mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-11 09:51:40 +00:00
fix(v4): add missing sera styles to public schema (#10452)
* Add Sera styles to v4 public schema Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test(v4): tighten public schema style assertion Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: shadcn <m@shadcn.com>
This commit is contained in:
@@ -4,7 +4,24 @@
|
||||
"properties": {
|
||||
"style": {
|
||||
"type": "string",
|
||||
"enum": ["default", "new-york", "radix-vega", "radix-nova", "radix-maia", "radix-lyra", "radix-mira", "radix-luma", "base-vega", "base-nova", "base-maia", "base-lyra", "base-mira", "base-luma"]
|
||||
"enum": [
|
||||
"default",
|
||||
"new-york",
|
||||
"radix-vega",
|
||||
"radix-nova",
|
||||
"radix-maia",
|
||||
"radix-lyra",
|
||||
"radix-mira",
|
||||
"radix-luma",
|
||||
"radix-sera",
|
||||
"base-vega",
|
||||
"base-nova",
|
||||
"base-maia",
|
||||
"base-lyra",
|
||||
"base-mira",
|
||||
"base-luma",
|
||||
"base-sera"
|
||||
]
|
||||
},
|
||||
"tailwind": {
|
||||
"type": "object",
|
||||
@@ -59,7 +76,12 @@
|
||||
},
|
||||
"menuColor": {
|
||||
"type": "string",
|
||||
"enum": ["default", "inverted", "default-translucent", "inverted-translucent"]
|
||||
"enum": [
|
||||
"default",
|
||||
"inverted",
|
||||
"default-translucent",
|
||||
"inverted-translucent"
|
||||
]
|
||||
},
|
||||
"menuAccent": {
|
||||
"type": "string",
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
import { describe, expect, it } from "vitest"
|
||||
|
||||
import publicSchema from "../public/schema.json"
|
||||
import {
|
||||
buildPartialRegistryBase,
|
||||
buildRegistryBase,
|
||||
DEFAULT_CONFIG,
|
||||
designSystemConfigSchema,
|
||||
parseRegistryBaseParts,
|
||||
PRESETS,
|
||||
} from "./config"
|
||||
|
||||
const legacyPublicSchemaStyles = ["default", "new-york"] as const
|
||||
|
||||
describe("buildRegistryBase", () => {
|
||||
it("seeds a font-heading fallback when heading inherits the body font", () => {
|
||||
const result = buildRegistryBase(DEFAULT_CONFIG)
|
||||
@@ -84,6 +88,15 @@ describe("buildRegistryBase", () => {
|
||||
expect(result.chartColor).toBe("taupe")
|
||||
})
|
||||
|
||||
it("keeps the public schema style enum in sync with presets", () => {
|
||||
expect([...publicSchema.properties.style.enum].sort()).toEqual(
|
||||
[
|
||||
...legacyPublicSchemaStyles,
|
||||
...PRESETS.map((preset) => preset.name),
|
||||
].sort()
|
||||
)
|
||||
})
|
||||
|
||||
it("rejects chartColor values that are unavailable for the selected base color", () => {
|
||||
const result = designSystemConfigSchema.safeParse({
|
||||
base: "radix",
|
||||
|
||||
Reference in New Issue
Block a user