diff --git a/apps/v4/app/(app)/create/components/style-picker.tsx b/apps/v4/app/(app)/create/components/style-picker.tsx index 5d2dc2f975..81248b1761 100644 --- a/apps/v4/app/(app)/create/components/style-picker.tsx +++ b/apps/v4/app/(app)/create/components/style-picker.tsx @@ -2,7 +2,7 @@ import * as React from "react" -import { type Style, type StyleName } from "@/registry/config" +import { PRESETS, type Style, type StyleName } from "@/registry/config" import { LockButton } from "@/app/(app)/create/components/lock-button" import { Picker, @@ -53,7 +53,24 @@ export function StylePicker({ { - setParams({ style: value as StyleName }) + const styleName = value as StyleName + const preset = PRESETS.find( + (p) => p.base === params.base && p.style === styleName + ) + setParams({ + style: styleName, + ...(preset && { + baseColor: preset.baseColor, + theme: preset.theme, + chartColor: preset.chartColor, + iconLibrary: preset.iconLibrary, + font: preset.font, + fontHeading: preset.fontHeading, + menuAccent: preset.menuAccent, + menuColor: preset.menuColor, + radius: preset.radius, + }), + }) }} > diff --git a/apps/v4/app/(app)/create/lib/fonts.ts b/apps/v4/app/(app)/create/lib/fonts.ts index 7deda364ff..1b8862b85e 100644 --- a/apps/v4/app/(app)/create/lib/fonts.ts +++ b/apps/v4/app/(app)/create/lib/fonts.ts @@ -1,5 +1,6 @@ import { DM_Sans, + EB_Garamond, Figtree, Geist, Geist_Mono, @@ -149,6 +150,11 @@ const playfairDisplay = Playfair_Display({ variable: "--font-playfair-display", }) +const ebGaramond = EB_Garamond({ + subsets: ["latin"], + variable: "--font-eb-garamond", +}) + const PREVIEW_FONTS = { geist: geistSans, inter, @@ -174,6 +180,7 @@ const PREVIEW_FONTS = { merriweather, lora, "playfair-display": playfairDisplay, + "eb-garamond": ebGaramond, } satisfies Record function createFontOption(name: FontName) { @@ -216,6 +223,7 @@ export const FONTS = [ createFontOption("merriweather"), createFontOption("lora"), createFontOption("playfair-display"), + createFontOption("eb-garamond"), ] as const export type Font = (typeof FONTS)[number] diff --git a/apps/v4/lib/font-definitions.ts b/apps/v4/lib/font-definitions.ts index b4df49d6ed..80afe1437e 100644 --- a/apps/v4/lib/font-definitions.ts +++ b/apps/v4/lib/font-definitions.ts @@ -301,6 +301,18 @@ export const FONT_DEFINITIONS = [ dependency: "@fontsource-variable/playfair-display", subsets: ["latin"], }, + { + name: "eb-garamond", + title: "EB Garamond", + type: "serif", + family: "'EB Garamond Variable', serif", + registryVariable: "--font-serif", + previewVariable: "--font-eb-garamond", + provider: "google", + import: "EB_Garamond", + dependency: "@fontsource-variable/eb-garamond", + subsets: ["latin"], + }, ] as const satisfies readonly FontDefinition[] export type FontName = (typeof FONT_DEFINITIONS)[number]["name"] diff --git a/apps/v4/public/r/config.json b/apps/v4/public/r/config.json index a0c28d6547..3e972fcf69 100644 --- a/apps/v4/public/r/config.json +++ b/apps/v4/public/r/config.json @@ -219,15 +219,15 @@ { "name": "radix-sera", "title": "Sera (Radix)", - "description": "Sera / Lucide / Inter + Playfair Display", + "description": "Sera / Lucide / Noto Sans + EB Garamond", "base": "radix", "style": "sera", - "baseColor": "neutral", - "theme": "neutral", - "chartColor": "neutral", + "baseColor": "taupe", + "theme": "taupe", + "chartColor": "taupe", "iconLibrary": "lucide", - "font": "inter", - "fontHeading": "playfair-display", + "font": "noto-sans", + "fontHeading": "eb-garamond", "item": "Item", "rtl": false, "menuAccent": "subtle", @@ -237,15 +237,15 @@ { "name": "base-sera", "title": "Sera (Base)", - "description": "Sera / Lucide / Inter + Playfair Display", + "description": "Sera / Lucide / Noto Sans + EB Garamond", "base": "base", "style": "sera", - "baseColor": "neutral", - "theme": "neutral", - "chartColor": "neutral", + "baseColor": "taupe", + "theme": "taupe", + "chartColor": "taupe", "iconLibrary": "lucide", - "font": "inter", - "fontHeading": "playfair-display", + "font": "noto-sans", + "fontHeading": "eb-garamond", "item": "Item", "rtl": false, "menuAccent": "subtle", diff --git a/apps/v4/public/r/styles/base-luma/demo.json b/apps/v4/public/r/styles/base-luma/demo.json index bcac2d98e0..3611ef67c1 100644 --- a/apps/v4/public/r/styles/base-luma/demo.json +++ b/apps/v4/public/r/styles/base-luma/demo.json @@ -21,7 +21,7 @@ "files": [ { "path": "registry/base-luma/examples/demo.tsx", - "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from \"@/registry/base-luma/ui/alert-dialog\"\nimport { Badge } from \"@/registry/base-luma/ui/badge\"\nimport { Button } from \"@/registry/base-luma/ui/button\"\nimport { ButtonGroup } from \"@/registry/base-luma/ui/button-group\"\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"@/registry/base-luma/ui/card\"\nimport { Checkbox } from \"@/registry/base-luma/ui/checkbox\"\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"@/registry/base-luma/ui/dropdown-menu\"\nimport { Field, FieldGroup } from \"@/registry/base-luma/ui/field\"\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupInput,\n InputGroupText,\n} from \"@/registry/base-luma/ui/input-group\"\nimport {\n Item,\n ItemActions,\n ItemContent,\n ItemDescription,\n ItemTitle,\n} from \"@/registry/base-luma/ui/item\"\nimport { RadioGroup, RadioGroupItem } from \"@/registry/base-luma/ui/radio-group\"\nimport { Slider } from \"@/registry/base-luma/ui/slider\"\nimport { Switch } from \"@/registry/base-luma/ui/switch\"\nimport { Textarea } from \"@/registry/base-luma/ui/textarea\"\nimport { IconPlaceholder } from \"@/app/(create)/components/icon-placeholder\"\n\nexport function Demo() {\n const [sliderValue, setSliderValue] = React.useState([500])\n const handleSliderValueChange = React.useCallback(\n (value: number | readonly number[]) => {\n if (typeof value === \"number\") {\n setSliderValue([value])\n } else {\n setSliderValue([...value])\n }\n },\n []\n )\n\n return (\n
\n
\n
\n \n \n Style Overview\n \n Designers love packing quirky glyphs into test phrases. This is\n a preview of the typography styles.\n \n \n \n
\n {[\n \"--background\",\n \"--foreground\",\n \"--primary\",\n \"--secondary\",\n \"--muted\",\n \"--accent\",\n \"--border\",\n \"--chart-1\",\n \"--chart-2\",\n \"--chart-3\",\n \"--chart-4\",\n \"--chart-5\",\n ].map((variant) => (\n \n \n
\n {variant}\n
\n
\n ))}\n
\n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n
\n
\n \n \n
\n
\n \n \n \n \n
\n \n \n Two-factor authentication\n \n Verify via email or phone number.\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n