fix(www): themes

This commit is contained in:
shadcn
2024-08-26 16:55:29 +04:00
parent cd66578d67
commit b7fc3167d8
17 changed files with 125 additions and 369 deletions

View File

@@ -2,7 +2,6 @@ import { cookies } from "next/headers"
import { AppSidebar } from "@/registry/new-york/block/sidebar-01/components/app-sidebar"
import {
SIDEBAR_STATE_COOKIE,
SidebarLayout,
SidebarTrigger,
} from "@/registry/new-york/block/sidebar-01/ui/sidebar"

View File

@@ -1,58 +0,0 @@
{
"name": "daylight",
"type": "registry:theme",
"cssVars": {
"light": {
"background": "0 0% 100%",
"foreground": "240 10% 3.9%",
"card": "0 0% 100%",
"card-foreground": "240 10% 3.9%",
"popover": "0 0% 100%",
"popover-foreground": "240 10% 3.9%",
"primary": "240 5.9% 10%",
"primary-foreground": "0 0% 98%",
"secondary": "240 4.8% 95.9%",
"secondary-foreground": "240 5.9% 10%",
"muted": "240 4.8% 95.9%",
"muted-foreground": "240 3.8% 46.1%",
"accent": "240 4.8% 95.9%",
"accent-foreground": "240 5.9% 10%",
"destructive": "0 84.2% 60.2%",
"destructive-foreground": "0 0% 98%",
"border": "240 5.9% 90%",
"input": "240 5.9% 90%",
"ring": "240 10% 3.9%",
"chart-1": "173 58% 39%",
"chart-2": "12 76% 61%",
"chart-3": "197 37% 24%",
"chart-4": "43 74% 66%",
"chart-5": "27 87% 67%"
},
"dark": {
"background": "240 10% 3.9%",
"foreground": "0 0% 98%",
"card": "240 10% 3.9%",
"card-foreground": "0 0% 98%",
"popover": "240 10% 3.9%",
"popover-foreground": "0 0% 98%",
"primary": "0 0% 98%",
"primary-foreground": "240 5.9% 10%",
"secondary": "240 3.7% 15.9%",
"secondary-foreground": "0 0% 98%",
"muted": "240 3.7% 15.9%",
"muted-foreground": "240 5% 64.9%",
"accent": "240 3.7% 15.9%",
"accent-foreground": "0 0% 98%",
"destructive": "0 62.8% 30.6%",
"destructive-foreground": "0 0% 98%",
"border": "240 3.7% 15.9%",
"input": "240 3.7% 15.9%",
"ring": "240 4.9% 83.9%",
"chart-1": "220 70% 50%",
"chart-5": "160 60% 45%",
"chart-3": "30 80% 55%",
"chart-4": "280 65% 60%",
"chart-2": "340 75% 55%"
}
}
}

View File

@@ -1,50 +0,0 @@
{
"name": "hello-block",
"type": "registry:block",
"registryDependencies": [
"button",
"use-media-query",
"card"
],
"files": [
{
"path": "block/hello-block/hello-block.tsx",
"type": "registry:block",
"content": "\"use client\"\n\nimport { HelloCard } from \"@/registry/default/block/hello-block/components/hello-card\"\nimport { useMediaQuery } from \"@/registry/default/hooks/use-media-query\"\nimport { cn } from \"@/registry/default/lib/utils\"\nimport { Button } from \"@/registry/default/ui/button\"\n\nexport default function HelloBlock() {\n const isDesktop = useMediaQuery(\"(min-width: 768px)\")\n\n return (\n <HelloCard\n title=\"Hello Block\"\n className={cn(\n \"p-12\",\n isDesktop\n ? \"bg-muted text-muted-foreground\"\n : \"bg-primary text-primary-foreground\"\n )}\n >\n <p>Hello. This is a component inside a block.</p>\n <p>You are currently on {isDesktop ? \"desktop\" : \"mobile\"}</p>\n <Button>Click me</Button>\n </HelloCard>\n )\n}\n"
},
{
"path": "block/hello-block/components/hello-card.tsx",
"type": "registry:block",
"content": "import {\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n} from \"@/registry/default/ui/card\"\n\nexport function HelloCard({\n title,\n children,\n className,\n}: {\n title: string\n} & React.ComponentProps<typeof Card>) {\n return (\n <Card className={className}>\n <CardHeader>\n <CardTitle className=\"text-brand-secondary text-4xl\">{title}</CardTitle>\n </CardHeader>\n <CardContent>{children}</CardContent>\n </Card>\n )\n}\n"
}
],
"tailwind": {
"config": {
"theme": {
"extend": {
"colors": {
"brand": {
"primary": "var(--brand-primary)",
"secondary": "var(--brand-secondary)"
}
},
"boxShadow": {
"brand": "0px 0px 10px 0px rgba(255, 255, 255, 0.10)"
}
}
}
}
},
"cssVars": {
"light": {
"brand-primary": "#a855f7",
"brand-secondary": "#10b981"
},
"dark": {
"brand-primary": "#831843",
"brand-secondary": "#ccfbf1"
}
},
"category": "Application",
"subcategory": "Examples"
}

View File

@@ -6,19 +6,19 @@
"background": "36 39% 88%",
"foreground": "36 45% 15%",
"primary": "36 45% 70%",
"primaryForeground": "36 45% 11%",
"primary-foreground": "36 45% 11%",
"secondary": "40 35% 77%",
"secondaryForeground": "36 45% 25%",
"secondary-foreground": "36 45% 25%",
"accent": "36 64% 57%",
"accentForeground": "36 72% 17%",
"accent-foreground": "36 72% 17%",
"destructive": "0 84% 37%",
"destructiveForeground": "0 0% 98%",
"destructive-foreground": "0 0% 98%",
"muted": "36 33% 75%",
"mutedForeground": "36 45% 25%",
"muted-foreground": "36 45% 25%",
"card": "36 46% 82%",
"cardForeground": "36 45% 20%",
"card-foreground": "36 45% 20%",
"popover": "0 0% 100%",
"popoverForeground": "240 10% 3.9%",
"popover-foreground": "240 10% 3.9%",
"border": "36 45% 60%",
"input": "36 45% 60%",
"ring": "36 45% 30%",
@@ -32,19 +32,19 @@
"background": "36 39% 88%",
"foreground": "36 45% 15%",
"primary": "36 45% 70%",
"primaryForeground": "36 45% 11%",
"primary-foreground": "36 45% 11%",
"secondary": "40 35% 77%",
"secondaryForeground": "36 45% 25%",
"secondary-foreground": "36 45% 25%",
"accent": "36 64% 57%",
"accentForeground": "36 72% 17%",
"accent-foreground": "36 72% 17%",
"destructive": "0 84% 37%",
"destructiveForeground": "0 0% 98%",
"destructive-foreground": "0 0% 98%",
"muted": "36 33% 75%",
"mutedForeground": "36 45% 25%",
"muted-foreground": "36 45% 25%",
"card": "36 46% 82%",
"cardForeground": "36 45% 20%",
"card-foreground": "36 45% 20%",
"popover": "0 0% 100%",
"popoverForeground": "240 10% 3.9%",
"popover-foreground": "240 10% 3.9%",
"border": "36 45% 60%",
"input": "36 45% 60%",
"ring": "36 45% 30%",

View File

@@ -6,19 +6,19 @@
"background": "240 5% 6%",
"foreground": "60 5% 90%",
"primary": "240 0% 90%",
"primaryForeground": "60 0% 0%",
"primary-foreground": "60 0% 0%",
"secondary": "240 4% 15%",
"secondaryForeground": "60 5% 85%",
"secondary-foreground": "60 5% 85%",
"accent": "240 0% 13%",
"accentForeground": "60 0% 100%",
"accent-foreground": "60 0% 100%",
"destructive": "0 60% 50%",
"destructiveForeground": "0 0% 98%",
"destructive-foreground": "0 0% 98%",
"muted": "240 5% 25%",
"mutedForeground": "60 5% 85%",
"muted-foreground": "60 5% 85%",
"card": "240 4% 10%",
"cardForeground": "60 5% 90%",
"card-foreground": "60 5% 90%",
"popover": "240 5% 15%",
"popoverForeground": "60 5% 85%",
"popover-foreground": "60 5% 85%",
"border": "240 6% 20%",
"input": "240 6% 20%",
"ring": "240 5% 90%",
@@ -32,19 +32,19 @@
"background": "240 5% 6%",
"foreground": "60 5% 90%",
"primary": "240 0% 90%",
"primaryForeground": "60 0% 0%",
"primary-foreground": "60 0% 0%",
"secondary": "240 4% 15%",
"secondaryForeground": "60 5% 85%",
"secondary-foreground": "60 5% 85%",
"accent": "240 0% 13%",
"accentForeground": "60 0% 100%",
"accent-foreground": "60 0% 100%",
"destructive": "0 60% 50%",
"destructiveForeground": "0 0% 98%",
"destructive-foreground": "0 0% 98%",
"muted": "240 5% 25%",
"mutedForeground": "60 5% 85%",
"muted-foreground": "60 5% 85%",
"card": "240 4% 10%",
"cardForeground": "60 5% 90%",
"card-foreground": "60 5% 90%",
"popover": "240 5% 15%",
"popoverForeground": "60 5% 85%",
"popover-foreground": "60 5% 85%",
"border": "240 6% 20%",
"input": "240 6% 20%",
"ring": "240 5% 90%",

View File

@@ -1,14 +0,0 @@
{
"name": "use-media-query",
"type": "registry:hook",
"dependencies": [
"@react-hook/window-size@1.0.3"
],
"files": [
{
"path": "hooks/use-media-query.ts",
"type": "registry:hook",
"content": "import * as React from \"react\"\n\nexport function useMediaQuery(query: string) {\n const [value, setValue] = React.useState(false)\n\n React.useEffect(() => {\n function onChange(event: MediaQueryListEvent) {\n setValue(event.matches)\n }\n\n const result = matchMedia(query)\n result.addEventListener(\"change\", onChange)\n setValue(result.matches)\n\n return () => result.removeEventListener(\"change\", onChange)\n }, [query])\n\n return value\n}\n"
}
]
}

View File

@@ -1,58 +0,0 @@
{
"name": "daylight",
"type": "registry:theme",
"cssVars": {
"light": {
"background": "0 0% 100%",
"foreground": "240 10% 3.9%",
"card": "0 0% 100%",
"card-foreground": "240 10% 3.9%",
"popover": "0 0% 100%",
"popover-foreground": "240 10% 3.9%",
"primary": "240 5.9% 10%",
"primary-foreground": "0 0% 98%",
"secondary": "240 4.8% 95.9%",
"secondary-foreground": "240 5.9% 10%",
"muted": "240 4.8% 95.9%",
"muted-foreground": "240 3.8% 46.1%",
"accent": "240 4.8% 95.9%",
"accent-foreground": "240 5.9% 10%",
"destructive": "0 84.2% 60.2%",
"destructive-foreground": "0 0% 98%",
"border": "240 5.9% 90%",
"input": "240 5.9% 90%",
"ring": "240 10% 3.9%",
"chart-1": "173 58% 39%",
"chart-2": "12 76% 61%",
"chart-3": "197 37% 24%",
"chart-4": "43 74% 66%",
"chart-5": "27 87% 67%"
},
"dark": {
"background": "240 10% 3.9%",
"foreground": "0 0% 98%",
"card": "240 10% 3.9%",
"card-foreground": "0 0% 98%",
"popover": "240 10% 3.9%",
"popover-foreground": "0 0% 98%",
"primary": "0 0% 98%",
"primary-foreground": "240 5.9% 10%",
"secondary": "240 3.7% 15.9%",
"secondary-foreground": "0 0% 98%",
"muted": "240 3.7% 15.9%",
"muted-foreground": "240 5% 64.9%",
"accent": "240 3.7% 15.9%",
"accent-foreground": "0 0% 98%",
"destructive": "0 62.8% 30.6%",
"destructive-foreground": "0 0% 98%",
"border": "240 3.7% 15.9%",
"input": "240 3.7% 15.9%",
"ring": "240 4.9% 83.9%",
"chart-1": "220 70% 50%",
"chart-5": "160 60% 45%",
"chart-3": "30 80% 55%",
"chart-4": "280 65% 60%",
"chart-2": "340 75% 55%"
}
}
}

View File

@@ -1,50 +0,0 @@
{
"name": "hello-block",
"type": "registry:block",
"registryDependencies": [
"button",
"use-media-query",
"card"
],
"files": [
{
"path": "block/hello-block/hello-block.tsx",
"type": "registry:block",
"content": "\"use client\"\n\nimport { HelloCard } from \"@/registry/new-york/block/hello-block/components/hello-card\"\nimport { useMediaQuery } from \"@/registry/new-york/hooks/use-media-query\"\nimport { cn } from \"@/registry/new-york/lib/utils\"\nimport { Button } from \"@/registry/new-york/ui/button\"\n\nexport default function HelloBlock() {\n const isDesktop = useMediaQuery(\"(min-width: 768px)\")\n\n return (\n <HelloCard\n title=\"Hello Block\"\n className={cn(\n \"p-12\",\n isDesktop\n ? \"bg-muted text-muted-foreground\"\n : \"bg-primary text-primary-foreground\"\n )}\n >\n <p>Hello. This is a component inside a block.</p>\n <p>You are currently on {isDesktop ? \"desktop\" : \"mobile\"}</p>\n <Button>Click me</Button>\n </HelloCard>\n )\n}\n"
},
{
"path": "block/hello-block/components/hello-card.tsx",
"type": "registry:block",
"content": "import {\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n} from \"@/registry/new-york/ui/card\"\n\nexport function HelloCard({\n title,\n children,\n className,\n}: {\n title: string\n} & React.ComponentProps<typeof Card>) {\n return (\n <Card className={className}>\n <CardHeader>\n <CardTitle className=\"text-brand-secondary text-4xl\">{title}</CardTitle>\n </CardHeader>\n <CardContent>{children}</CardContent>\n </Card>\n )\n}\n"
}
],
"tailwind": {
"config": {
"theme": {
"extend": {
"colors": {
"brand": {
"primary": "var(--brand-primary)",
"secondary": "var(--brand-secondary)"
}
},
"boxShadow": {
"brand": "0px 0px 10px 0px rgba(255, 255, 255, 0.10)"
}
}
}
}
},
"cssVars": {
"light": {
"brand-primary": "#a855f7",
"brand-secondary": "#10b981"
},
"dark": {
"brand-primary": "#831843",
"brand-secondary": "#ccfbf1"
}
},
"category": "Application",
"subcategory": "Examples"
}

File diff suppressed because one or more lines are too long

View File

@@ -6,19 +6,19 @@
"background": "36 39% 88%",
"foreground": "36 45% 15%",
"primary": "36 45% 70%",
"primaryForeground": "36 45% 11%",
"primary-foreground": "36 45% 11%",
"secondary": "40 35% 77%",
"secondaryForeground": "36 45% 25%",
"secondary-foreground": "36 45% 25%",
"accent": "36 64% 57%",
"accentForeground": "36 72% 17%",
"accent-foreground": "36 72% 17%",
"destructive": "0 84% 37%",
"destructiveForeground": "0 0% 98%",
"destructive-foreground": "0 0% 98%",
"muted": "36 33% 75%",
"mutedForeground": "36 45% 25%",
"muted-foreground": "36 45% 25%",
"card": "36 46% 82%",
"cardForeground": "36 45% 20%",
"card-foreground": "36 45% 20%",
"popover": "0 0% 100%",
"popoverForeground": "240 10% 3.9%",
"popover-foreground": "240 10% 3.9%",
"border": "36 45% 60%",
"input": "36 45% 60%",
"ring": "36 45% 30%",
@@ -32,19 +32,19 @@
"background": "36 39% 88%",
"foreground": "36 45% 15%",
"primary": "36 45% 70%",
"primaryForeground": "36 45% 11%",
"primary-foreground": "36 45% 11%",
"secondary": "40 35% 77%",
"secondaryForeground": "36 45% 25%",
"secondary-foreground": "36 45% 25%",
"accent": "36 64% 57%",
"accentForeground": "36 72% 17%",
"accent-foreground": "36 72% 17%",
"destructive": "0 84% 37%",
"destructiveForeground": "0 0% 98%",
"destructive-foreground": "0 0% 98%",
"muted": "36 33% 75%",
"mutedForeground": "36 45% 25%",
"muted-foreground": "36 45% 25%",
"card": "36 46% 82%",
"cardForeground": "36 45% 20%",
"card-foreground": "36 45% 20%",
"popover": "0 0% 100%",
"popoverForeground": "240 10% 3.9%",
"popover-foreground": "240 10% 3.9%",
"border": "36 45% 60%",
"input": "36 45% 60%",
"ring": "36 45% 30%",

View File

@@ -6,19 +6,19 @@
"background": "240 5% 6%",
"foreground": "60 5% 90%",
"primary": "240 0% 90%",
"primaryForeground": "60 0% 0%",
"primary-foreground": "60 0% 0%",
"secondary": "240 4% 15%",
"secondaryForeground": "60 5% 85%",
"secondary-foreground": "60 5% 85%",
"accent": "240 0% 13%",
"accentForeground": "60 0% 100%",
"accent-foreground": "60 0% 100%",
"destructive": "0 60% 50%",
"destructiveForeground": "0 0% 98%",
"destructive-foreground": "0 0% 98%",
"muted": "240 5% 25%",
"mutedForeground": "60 5% 85%",
"muted-foreground": "60 5% 85%",
"card": "240 4% 10%",
"cardForeground": "60 5% 90%",
"card-foreground": "60 5% 90%",
"popover": "240 5% 15%",
"popoverForeground": "60 5% 85%",
"popover-foreground": "60 5% 85%",
"border": "240 6% 20%",
"input": "240 6% 20%",
"ring": "240 5% 90%",
@@ -32,19 +32,19 @@
"background": "240 5% 6%",
"foreground": "60 5% 90%",
"primary": "240 0% 90%",
"primaryForeground": "60 0% 0%",
"primary-foreground": "60 0% 0%",
"secondary": "240 4% 15%",
"secondaryForeground": "60 5% 85%",
"secondary-foreground": "60 5% 85%",
"accent": "240 0% 13%",
"accentForeground": "60 0% 100%",
"accent-foreground": "60 0% 100%",
"destructive": "0 60% 50%",
"destructiveForeground": "0 0% 98%",
"destructive-foreground": "0 0% 98%",
"muted": "240 5% 25%",
"mutedForeground": "60 5% 85%",
"muted-foreground": "60 5% 85%",
"card": "240 4% 10%",
"cardForeground": "60 5% 90%",
"card-foreground": "60 5% 90%",
"popover": "240 5% 15%",
"popoverForeground": "60 5% 85%",
"popover-foreground": "60 5% 85%",
"border": "240 6% 20%",
"input": "240 6% 20%",
"ring": "240 5% 90%",

View File

@@ -1,14 +0,0 @@
{
"name": "use-media-query",
"type": "registry:hook",
"dependencies": [
"@react-hook/window-size@1.0.3"
],
"files": [
{
"path": "hooks/use-media-query.ts",
"type": "registry:hook",
"content": "import * as React from \"react\"\n\nexport function useMediaQuery(query: string) {\n const [value, setValue] = React.useState(false)\n\n React.useEffect(() => {\n function onChange(event: MediaQueryListEvent) {\n setValue(event.matches)\n }\n\n const result = matchMedia(query)\n result.addEventListener(\"change\", onChange)\n setValue(result.matches)\n\n return () => result.removeEventListener(\"change\", onChange)\n }, [query])\n\n return value\n}\n"
}
]
}

View File

@@ -2,7 +2,6 @@ import { cookies } from "next/headers"
import { AppSidebar } from "@/registry/new-york/block/sidebar-01/components/app-sidebar"
import {
SIDEBAR_STATE_COOKIE,
SidebarLayout,
SidebarTrigger,
} from "@/registry/new-york/block/sidebar-01/ui/sidebar"

View File

@@ -6,7 +6,6 @@ import { PanelLeft } from "lucide-react"
import { useIsMobile } from "@/registry/new-york/hooks/use-mobile"
import { cn } from "@/registry/new-york/lib/utils"
import { Button } from "@/registry/new-york/ui/button"
import { Drawer } from "@/registry/new-york/ui/drawer"
import { Sheet, SheetContent } from "@/registry/new-york/ui/sheet"
export const SIDEBAR_STATE_COOKIE = "sidebar:state"
@@ -190,13 +189,13 @@ const SidebarLabel = React.forwardRef<
SidebarLabel.displayName = "SidebarLabel"
export {
useSidebar,
SidebarLayout,
SidebarTrigger,
Sidebar,
SidebarHeader,
SidebarFooter,
SidebarContent,
SidebarFooter,
SidebarHeader,
SidebarItem,
SidebarLabel,
SidebarLayout,
SidebarTrigger,
useSidebar,
}

View File

@@ -9,19 +9,19 @@ export const themes: Registry = [
background: "36 39% 88%",
foreground: "36 45% 15%",
primary: "36 45% 70%",
primaryForeground: "36 45% 11%",
"primary-foreground": "36 45% 11%",
secondary: "40 35% 77%",
secondaryForeground: "36 45% 25%",
"secondary-foreground": "36 45% 25%",
accent: "36 64% 57%",
accentForeground: "36 72% 17%",
"accent-foreground": "36 72% 17%",
destructive: "0 84% 37%",
destructiveForeground: "0 0% 98%",
"destructive-foreground": "0 0% 98%",
muted: "36 33% 75%",
mutedForeground: "36 45% 25%",
"muted-foreground": "36 45% 25%",
card: "36 46% 82%",
cardForeground: "36 45% 20%",
"card-foreground": "36 45% 20%",
popover: "0 0% 100%",
popoverForeground: "240 10% 3.9%",
"popover-foreground": "240 10% 3.9%",
border: "36 45% 60%",
input: "36 45% 60%",
ring: "36 45% 30%",
@@ -35,19 +35,19 @@ export const themes: Registry = [
background: "36 39% 88%",
foreground: "36 45% 15%",
primary: "36 45% 70%",
primaryForeground: "36 45% 11%",
"primary-foreground": "36 45% 11%",
secondary: "40 35% 77%",
secondaryForeground: "36 45% 25%",
"secondary-foreground": "36 45% 25%",
accent: "36 64% 57%",
accentForeground: "36 72% 17%",
"accent-foreground": "36 72% 17%",
destructive: "0 84% 37%",
destructiveForeground: "0 0% 98%",
"destructive-foreground": "0 0% 98%",
muted: "36 33% 75%",
mutedForeground: "36 45% 25%",
"muted-foreground": "36 45% 25%",
card: "36 46% 82%",
cardForeground: "36 45% 20%",
"card-foreground": "36 45% 20%",
popover: "0 0% 100%",
popoverForeground: "240 10% 3.9%",
"popover-foreground": "240 10% 3.9%",
border: "36 45% 60%",
input: "36 45% 60%",
ring: "36 45% 30%",
@@ -67,19 +67,19 @@ export const themes: Registry = [
background: "240 5% 6%",
foreground: "60 5% 90%",
primary: "240 0% 90%",
primaryForeground: "60 0% 0%",
"primary-foreground": "60 0% 0%",
secondary: "240 4% 15%",
secondaryForeground: "60 5% 85%",
"secondary-foreground": "60 5% 85%",
accent: "240 0% 13%",
accentForeground: "60 0% 100%",
"accent-foreground": "60 0% 100%",
destructive: "0 60% 50%",
destructiveForeground: "0 0% 98%",
"destructive-foreground": "0 0% 98%",
muted: "240 5% 25%",
mutedForeground: "60 5% 85%",
"muted-foreground": "60 5% 85%",
card: "240 4% 10%",
cardForeground: "60 5% 90%",
"card-foreground": "60 5% 90%",
popover: "240 5% 15%",
popoverForeground: "60 5% 85%",
"popover-foreground": "60 5% 85%",
border: "240 6% 20%",
input: "240 6% 20%",
ring: "240 5% 90%",
@@ -93,19 +93,19 @@ export const themes: Registry = [
background: "240 5% 6%",
foreground: "60 5% 90%",
primary: "240 0% 90%",
primaryForeground: "60 0% 0%",
"primary-foreground": "60 0% 0%",
secondary: "240 4% 15%",
secondaryForeground: "60 5% 85%",
"secondary-foreground": "60 5% 85%",
accent: "240 0% 13%",
accentForeground: "60 0% 100%",
"accent-foreground": "60 0% 100%",
destructive: "0 60% 50%",
destructiveForeground: "0 0% 98%",
"destructive-foreground": "0 0% 98%",
muted: "240 5% 25%",
mutedForeground: "60 5% 85%",
"muted-foreground": "60 5% 85%",
card: "240 4% 10%",
cardForeground: "60 5% 90%",
"card-foreground": "60 5% 90%",
popover: "240 5% 15%",
popoverForeground: "60 5% 85%",
"popover-foreground": "60 5% 85%",
border: "240 6% 20%",
input: "240 6% 20%",
ring: "240 5% 90%",

View File

@@ -332,42 +332,45 @@ async function buildStyles(registry: Registry) {
}
for (const item of registry) {
if (!REGISTRY_INDEX_WHITELIST.includes(item.type) || !item.files) {
if (!REGISTRY_INDEX_WHITELIST.includes(item.type)) {
continue
}
const files = await Promise.all(
item.files.map(async (_file) => {
const file =
typeof _file === "string"
? {
path: _file,
type: item.type,
content: "",
}
: _file
let files
if (item.files) {
files = await Promise.all(
item.files.map(async (_file) => {
const file =
typeof _file === "string"
? {
path: _file,
type: item.type,
content: "",
}
: _file
const content = await fs.readFile(
path.join(process.cwd(), "registry", style.name, file.path),
"utf8"
)
const content = await fs.readFile(
path.join(process.cwd(), "registry", style.name, file.path),
"utf8"
)
const tempFile = await createTempSourceFile(file.path)
const sourceFile = project.createSourceFile(tempFile, content, {
scriptKind: ScriptKind.TSX,
const tempFile = await createTempSourceFile(file.path)
const sourceFile = project.createSourceFile(tempFile, content, {
scriptKind: ScriptKind.TSX,
})
sourceFile.getVariableDeclaration("iframeHeight")?.remove()
sourceFile.getVariableDeclaration("containerClassName")?.remove()
sourceFile.getVariableDeclaration("description")?.remove()
return {
path: file.path,
type: file.type,
content: sourceFile.getText(),
}
})
sourceFile.getVariableDeclaration("iframeHeight")?.remove()
sourceFile.getVariableDeclaration("containerClassName")?.remove()
sourceFile.getVariableDeclaration("description")?.remove()
return {
path: file.path,
type: file.type,
content: sourceFile.getText(),
}
})
)
)
}
const payload = registryEntrySchema
.omit({

View File

@@ -227,7 +227,7 @@ export async function getProjectConfig(
prefix: "",
},
aliases: {
ui: `${projectInfo.aliasPrefix}/ui`,
ui: `${projectInfo.aliasPrefix}/components/ui`,
components: `${projectInfo.aliasPrefix}/components`,
lib: `${projectInfo.aliasPrefix}/lib`,
utils: `${projectInfo.aliasPrefix}/lib/utils`,