@razorwind/core 0.0.46 → 0.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/dist/{config-25eDAKIq.d.cts → config-BtscEr7S.d.cts} +17 -5
  2. package/dist/config-BtscEr7S.d.cts.map +1 -0
  3. package/dist/{config-rgbP9zhp.d.mts → config-CNTGHrST.d.mts} +16 -4
  4. package/dist/config-CNTGHrST.d.mts.map +1 -0
  5. package/dist/flatten-tokens-CMlVe_J6.d.cts +54 -0
  6. package/dist/flatten-tokens-CMlVe_J6.d.cts.map +1 -0
  7. package/dist/flatten-tokens-DgTPHEhI.d.mts +54 -0
  8. package/dist/flatten-tokens-DgTPHEhI.d.mts.map +1 -0
  9. package/dist/fonts-B0ESWBBC.mjs +2 -0
  10. package/dist/fonts-B0ESWBBC.mjs.map +1 -0
  11. package/dist/fonts-BiuIJVev.mjs +10 -0
  12. package/dist/fonts-BiuIJVev.mjs.map +1 -0
  13. package/dist/fonts-CkBPEFie.cjs +9 -0
  14. package/dist/fonts-vhz5FAsy.cjs +1 -0
  15. package/dist/{index-D1ayVOTE.d.mts → index-B7MsziQp.d.cts} +4 -4
  16. package/dist/{index-Dk-i27fI.d.cts.map → index-B7MsziQp.d.cts.map} +1 -1
  17. package/dist/{index-BjSOzDOH.d.cts → index-CwN0c1Q4.d.cts} +1 -1
  18. package/dist/index-CzbZzpnz.d.mts +100 -0
  19. package/dist/index-CzbZzpnz.d.mts.map +1 -0
  20. package/dist/{index-Dk-i27fI.d.cts → index-CzjDptav.d.mts} +5 -5
  21. package/dist/{index-D1ayVOTE.d.mts.map → index-CzjDptav.d.mts.map} +1 -1
  22. package/dist/{index-DM8vit-J.d.mts → index-D5L2WXYk.d.mts} +1 -1
  23. package/dist/index-Di7vqmsi.d.cts +100 -0
  24. package/dist/index-Di7vqmsi.d.cts.map +1 -0
  25. package/dist/index.cjs +1 -1
  26. package/dist/index.d.cts +82 -15
  27. package/dist/index.d.cts.map +1 -1
  28. package/dist/index.d.mts +82 -15
  29. package/dist/index.d.mts.map +1 -1
  30. package/dist/index.mjs +1 -1
  31. package/dist/lib/fonts/index.cjs +1 -0
  32. package/dist/lib/fonts/index.d.cts +2 -0
  33. package/dist/lib/fonts/index.d.mts +2 -0
  34. package/dist/lib/fonts/index.mjs +1 -0
  35. package/dist/lib/tokens/index.cjs +1 -1
  36. package/dist/lib/tokens/index.d.cts +1 -1
  37. package/dist/lib/tokens/index.d.mts +1 -1
  38. package/dist/lib/tokens/index.mjs +1 -1
  39. package/dist/{plugin-CAoFfyMa.d.mts → plugin-0UYp_yIy.d.cts} +2 -2
  40. package/dist/{plugin-m5Bm4WrK.d.cts.map → plugin-0UYp_yIy.d.cts.map} +1 -1
  41. package/dist/{plugin-m5Bm4WrK.d.cts → plugin-CH6vFnxu.d.mts} +2 -2
  42. package/dist/plugin-CH6vFnxu.d.mts.map +1 -0
  43. package/dist/plugin.d.cts +2 -2
  44. package/dist/plugin.d.mts +2 -2
  45. package/dist/schema/index.cjs +1 -1
  46. package/dist/schema/index.d.cts +3 -3
  47. package/dist/schema/index.d.mts +3 -3
  48. package/dist/schema/index.mjs +1 -1
  49. package/dist/schema-BCofDJWf.cjs +1 -0
  50. package/dist/schema-BwOBgJIM.d.cts +545 -0
  51. package/dist/schema-BwOBgJIM.d.cts.map +1 -0
  52. package/dist/schema-BwOBgJIM.d.mts +545 -0
  53. package/dist/schema-BwOBgJIM.d.mts.map +1 -0
  54. package/dist/schema-CXK5pVmJ.mjs +2 -0
  55. package/dist/schema-CXK5pVmJ.mjs.map +1 -0
  56. package/dist/tokens-By75va9Y.cjs +7 -0
  57. package/dist/tokens-DFYNBFFR.mjs +8 -0
  58. package/dist/tokens-DFYNBFFR.mjs.map +1 -0
  59. package/dist/utils/index.cjs +1 -1
  60. package/dist/utils/index.d.cts +78 -92
  61. package/dist/utils/index.d.cts.map +1 -1
  62. package/dist/utils/index.d.mts +78 -92
  63. package/dist/utils/index.d.mts.map +1 -1
  64. package/dist/utils/index.mjs +1 -1
  65. package/dist/utils-CDYdsyyW.mjs +2 -0
  66. package/dist/utils-CDYdsyyW.mjs.map +1 -0
  67. package/dist/utils-DyK4l_bT.cjs +1 -0
  68. package/package.json +16 -2
  69. package/dist/config-25eDAKIq.d.cts.map +0 -1
  70. package/dist/config-rgbP9zhp.d.mts.map +0 -1
  71. package/dist/plugin-CAoFfyMa.d.mts.map +0 -1
  72. package/dist/schema-93daQRSN.cjs +0 -1
  73. package/dist/schema-CsbyELyn.d.cts +0 -263
  74. package/dist/schema-CsbyELyn.d.cts.map +0 -1
  75. package/dist/schema-CsbyELyn.d.mts +0 -263
  76. package/dist/schema-CsbyELyn.d.mts.map +0 -1
  77. package/dist/schema-buR6a6IP.mjs +0 -2
  78. package/dist/schema-buR6a6IP.mjs.map +0 -1
  79. package/dist/tokens-CFh9AQab.mjs +0 -2
  80. package/dist/tokens-CFh9AQab.mjs.map +0 -1
  81. package/dist/tokens-pHmukPOW.cjs +0 -1
  82. package/dist/utils-B5uabOd5.mjs +0 -2
  83. package/dist/utils-B5uabOd5.mjs.map +0 -1
  84. package/dist/utils-BiL8zQzg.cjs +0 -1
@@ -1,79 +1,57 @@
1
- import { t as Schema } from "../schema-CsbyELyn.cjs";
2
- import { n as Tokens } from "../index-BjSOzDOH.cjs";
3
- import { GeneratorFunctionResult } from "@power-plant/core";
4
- //#region src/utils/token-format.d.ts
5
- /**
6
- * Convert a DTCG color `$value` (string, hex/alpha object, or
7
- * colorSpace/components object) into a CSS-friendly color string.
8
- */
9
- declare function formatColorValue(value: unknown): string | undefined;
10
- /**
11
- * Convert a DTCG dimension/duration `$value` (number, string, or
12
- * value/unit object) into a CSS-friendly string.
13
- */
14
- declare function formatDimensionValue(value: unknown): string | undefined;
1
+ import { t as Schema } from "../schema-BwOBgJIM.cjs";
2
+ import { n as Tokens } from "../index-CwN0c1Q4.cjs";
3
+ import { a as flattenTokens, i as TokenSet, n as FlattenTokensOptions, o as isTokenLeaf, r as TOKEN_SET_THEME_PATTERN, s as resolveTokenSets, t as BaseFlatToken } from "../flatten-tokens-CMlVe_J6.cjs";
4
+ import { GeneratedDocument, GeneratorFunctionResult } from "@power-plant/core";
5
+ //#region src/utils/merge-tokens.d.ts
15
6
  /**
16
- * Convert a DTCG `$value` into a CSS-friendly string, dispatching on `type`
17
- * (or, when `type` is omitted, on the shape of `value`).
7
+ * Deep-merge token **groups**, replacing token leaves atomically.
8
+ *
9
+ * Unlike `defu`, this does not concatenate arrays inside `$value` (color
10
+ * `components`, cubicBezier lists, shadow layers). Theme `override` wins
11
+ * for leaves and `$`-prefixed group metadata.
18
12
  */
19
- declare function formatTokenValue(value: unknown, type?: string): string;
13
+ declare function mergeTokenTrees(override: Tokens, base: Tokens): Tokens;
20
14
  //#endregion
21
- //#region src/utils/flatten-tokens.d.ts
22
- /**
23
- * A flattened design token row produced by {@link flattenTokens}.
24
- */
25
- interface BaseFlatToken {
26
- /** Dot-separated token path (e.g. `color.primary`). */
27
- path: string;
28
- /** DTCG `$type`, when known. */
29
- type?: string;
30
- /** Raw `$value` from the token document. */
31
- value: unknown;
32
- /** CSS-friendly string form of {@link value}. */
33
- cssValue: string;
34
- /** Optional DTCG `$description`. */
15
+ //#region src/utils/schema-identity.d.ts
16
+ /** Design-system identity resolved for generated artifacts. */
17
+ interface SchemaIdentity {
18
+ name?: string;
19
+ title?: string;
35
20
  description?: string;
36
- /** Theme / set id when tokens are a `Record<string, Tokens>`. */
37
- theme?: string;
38
- }
39
- interface TokenSet {
40
- id: string;
41
- tokens: Tokens;
21
+ repository?: string;
22
+ homepage?: string;
23
+ logo?: string;
42
24
  }
43
25
  /**
44
- * Theme-like keys for splitting multi-theme token records.
45
- *
46
- * Extends core {@link ../lib/tokens/constants#THEME_BASENAME_PATTERN} with
47
- * camelCase suffixes from `@razorwind/color-variants` (e.g. `darkHighContrast`).
48
- */
49
- declare const TOKEN_SET_THEME_PATTERN: RegExp;
50
- /**
51
- * Split `Schema.tokens` into one or more named token sets.
52
- *
53
- * A record whose keys all look like themes (`light`, `dark`, …) is treated as
54
- * multi-theme input; otherwise the whole document is a single set.
26
+ * Plugin / call-site overrides. `displayName` aliases `title`; `icon` aliases
27
+ * `logo` (VS Code / Cursor extension field names).
55
28
  */
56
- declare function resolveTokenSets(tokens: Tokens | Record<string, Tokens>): TokenSet[];
57
- interface FlattenTokensOptions<T extends BaseFlatToken = BaseFlatToken> {
58
- /** When set, only tokens whose `$type` is listed are returned. */
59
- includeTypes?: readonly string[];
60
- /** Map each base row before it is appended (e.g. add `cssVar`). */
61
- enrichToken?: (token: BaseFlatToken) => T;
29
+ interface SchemaIdentityOverrides {
30
+ name?: string;
31
+ title?: string;
32
+ displayName?: string;
33
+ description?: string;
34
+ repository?: string;
35
+ homepage?: string;
36
+ logo?: string;
37
+ icon?: string;
62
38
  }
63
39
  /**
64
- * Flatten DTCG token trees into rows for theme mapping or documentation.
40
+ * Resolve design-system identity for generators.
41
+ *
42
+ * Precedence: plugin overrides → {@link Schema} fields → title-cased name.
43
+ * When {@link Schema.theme} is set, titles gain a ` (<Theme>)` suffix.
65
44
  */
66
- declare function flattenTokens<T extends BaseFlatToken = BaseFlatToken>(tokens: Tokens | Record<string, Tokens>, options?: FlattenTokensOptions<T>): T[];
45
+ declare function resolveSchemaIdentity(spec: Pick<Schema, "name" | "title" | "description" | "repository" | "homepage" | "logo" | "theme">, overrides?: SchemaIdentityOverrides): SchemaIdentity;
67
46
  //#endregion
68
- //#region src/utils/title-case.d.ts
47
+ //#region src/utils/slugify-theme-name.d.ts
69
48
  /**
70
- * Convert a slug or identifier into title case for display labels.
49
+ * Convert a theme name into a filesystem-safe slug.
71
50
  *
72
51
  * @example
73
- * titleCase("my-dark-theme") // "My Dark Theme"
74
- * titleCase("darkHighContrast") // "Dark High Contrast"
52
+ * slugifyThemeName("My Dark Theme") // "my-dark-theme"
75
53
  */
76
- declare function titleCase(value: string): string;
54
+ declare function slugifyThemeName(name: string): string;
77
55
  //#endregion
78
56
  //#region src/utils/theme-display-name.d.ts
79
57
  /** Theme-like object with optional human-readable label. */
@@ -87,45 +65,53 @@ interface ThemeNamed {
87
65
  */
88
66
  declare function themeDisplayName(theme: ThemeNamed): string;
89
67
  //#endregion
90
- //#region src/utils/slugify-theme-name.d.ts
68
+ //#region src/utils/theme-output.d.ts
91
69
  /**
92
- * Convert a theme name into a filesystem-safe slug.
70
+ * Append a title-cased theme label to a display title.
93
71
  *
94
72
  * @example
95
- * slugifyThemeName("My Dark Theme") // "my-dark-theme"
73
+ * applyThemeToTitle("My Theme", "dark") // "My Theme (Dark)"
96
74
  */
97
- declare function slugifyThemeName(name: string): string;
98
- //#endregion
99
- //#region src/utils/schema-identity.d.ts
100
- /** Design-system identity resolved for generated artifacts. */
101
- interface SchemaIdentity {
102
- name?: string;
103
- title?: string;
104
- description?: string;
105
- repository?: string;
106
- homepage?: string;
107
- logo?: string;
108
- }
75
+ declare function applyThemeToTitle(title: string | undefined, theme: string | undefined): string | undefined;
109
76
  /**
110
- * Plugin / call-site overrides. `displayName` aliases `title`; `icon` aliases
111
- * `logo` (VS Code / Cursor extension field names).
77
+ * Insert `-<theme>` before a file path's extension.
78
+ *
79
+ * @example
80
+ * appendThemeToFilePath("tokens.css", "dark") // "tokens-dark.css"
112
81
  */
113
- interface SchemaIdentityOverrides {
114
- name?: string;
115
- title?: string;
116
- displayName?: string;
117
- description?: string;
118
- repository?: string;
119
- homepage?: string;
120
- logo?: string;
121
- icon?: string;
122
- }
82
+ declare function appendThemeToFilePath(filePath: string, theme: string): string;
123
83
  /**
124
- * Resolve design-system identity for generators.
84
+ * Rewrite document record keys and {@link GeneratedDocument.path} with a
85
+ * theme suffix so per-theme generator passes do not collide.
86
+ */
87
+ declare function applyThemeToDocuments(documents: Record<string, GeneratedDocument>, theme: string): Record<string, GeneratedDocument>;
88
+ //#endregion
89
+ //#region src/utils/title-case.d.ts
90
+ /**
91
+ * Convert a slug or identifier into title case for display labels.
125
92
  *
126
- * Precedence: plugin overrides → {@link Schema} fields → title-cased name.
93
+ * @example
94
+ * titleCase("my-dark-theme") // "My Dark Theme"
95
+ * titleCase("darkHighContrast") // "Dark High Contrast"
127
96
  */
128
- declare function resolveSchemaIdentity(spec: Pick<Schema, "name" | "title" | "description" | "repository" | "homepage" | "logo">, overrides?: SchemaIdentityOverrides): SchemaIdentity;
97
+ declare function titleCase(value: string): string;
98
+ //#endregion
99
+ //#region src/utils/token-format.d.ts
100
+ /**
101
+ * Convert a DTCG color `$value` (string, hex/alpha object, or
102
+ * colorSpace/components object) into a CSS-friendly color string.
103
+ */
104
+ declare function formatColorValue(value: unknown): string | undefined;
105
+ /**
106
+ * Convert a DTCG dimension/duration `$value` (number, string, or
107
+ * value/unit object) into a CSS-friendly string.
108
+ */
109
+ declare function formatDimensionValue(value: unknown): string | undefined;
110
+ /**
111
+ * Convert a DTCG `$value` into a CSS-friendly string, dispatching on `type`
112
+ * (or, when `type` is omitted, on the shape of `value`).
113
+ */
114
+ declare function formatTokenValue(value: unknown, type?: string): string;
129
115
  //#endregion
130
116
  //#region src/utils/index.d.ts
131
117
  declare function isObject(value: unknown): value is Record<string, unknown>;
@@ -143,5 +129,5 @@ declare function createDocument<TSchema, TOptions extends object>(path: string,
143
129
  name: string;
144
130
  }, language?: string): GeneratorFunctionResult<TSchema, TOptions>[string];
145
131
  //#endregion
146
- export { type BaseFlatToken, type FlattenTokensOptions, type SchemaIdentity, type SchemaIdentityOverrides, TOKEN_SET_THEME_PATTERN, type ThemeNamed, type TokenSet, createDocument, flattenTokens, formatColorValue, formatDimensionValue, formatTokenValue, isObject, resolveSchemaIdentity, resolveTokenSets, slugifyThemeName, themeDisplayName, titleCase, toCssVar };
132
+ export { type BaseFlatToken, type FlattenTokensOptions, type SchemaIdentity, type SchemaIdentityOverrides, TOKEN_SET_THEME_PATTERN, type ThemeNamed, type TokenSet, appendThemeToFilePath, applyThemeToDocuments, applyThemeToTitle, createDocument, flattenTokens, formatColorValue, formatDimensionValue, formatTokenValue, isObject, isTokenLeaf, mergeTokenTrees, resolveSchemaIdentity, resolveTokenSets, slugifyThemeName, themeDisplayName, titleCase, toCssVar };
147
133
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/utils/token-format.ts","../../src/utils/flatten-tokens.ts","../../src/utils/title-case.ts","../../src/utils/theme-display-name.ts","../../src/utils/slugify-theme-name.ts","../../src/utils/schema-identity.ts","../../src/utils/index.ts"],"mappings":";;;;;;;;iBA4BgB,iBAAiB;;;;;iBAuDjB,qBAAqB;;;;;iBAwBrB,iBAAiB,gBAAgB;;;;;;UC9EhC;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;UAGe;EACf;EACA,QAAQ;;;;;;;;cASG,yBAAuB;;;;;;;iBAwFpB,iBACd,QAAQ,SAAS,eAAe,UAC/B;UAqBc,qBAAqB,UAAU,gBAAgB;;EAE9D;;EAEA,eAAe,OAAO,kBAAkB;;;;;iBAM1B,cAAc,UAAU,gBAAgB,eACtD,QAAQ,SAAS,eAAe,SAChC,UAAS,qBAAqB,KAC7B;;;;;;;;;;iBCxJa,UAAU;;;;UCNT;EACf;EACA;;;;;;iBAOc,iBAAiB,OAAO;;;;;;;;;iBCNxB,iBAAiB;;;;UCFhB;EACf;EACA;EACA;EACA;EACA;EACA;;;;;;UAOe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;;iBAac,sBACd,MAAM,KACJ,gFAGF,YAAW,0BACV;;;iBC1Ca,SAAS,iBAAiB,SAAS;;;;;;;iBAkCnC,SAAS,cAAc;;;;iBAavB,eAAe,SAAS,yBACtC,cACA,iBACA;EAAQ;GACR,oBACC,wBAAwB,SAAS"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/utils/merge-tokens.ts","../../src/utils/schema-identity.ts","../../src/utils/slugify-theme-name.ts","../../src/utils/theme-display-name.ts","../../src/utils/theme-output.ts","../../src/utils/title-case.ts","../../src/utils/token-format.ts","../../src/utils/index.ts"],"mappings":";;;;;;;;;;;;iBAiCgB,gBAAgB,UAAU,QAAQ,MAAM,SAAS;;;;UCVhD;EACf;EACA;EACA;EACA;EACA;EACA;;;;;;UAOe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;;;iBAec,sBACd,MAAM,KACJ,0FASF,YAAW,0BACV;;;;;;;;;iBC/Ca,iBAAiB;;;;UCHhB;EACf;EACA;;;;;;iBAOc,iBAAiB,OAAO;;;;;;;;;iBCDxB,kBACd,2BACA;;;;;;;iBAoBc,sBAAsB,kBAAkB;;;;;iBAkBxC,sBACd,WAAW,eAAe,oBAC1B,gBACC,eAAe;;;;;;;;;;iBC7CF,UAAU;;;;;;;iBCCV,iBAAiB;;;;;iBAuDjB,qBAAqB;;;;;iBAwBrB,iBAAiB,gBAAgB;;;iBCvFjC,SAAS,iBAAiB,SAAS;;;;;;;iBAyCnC,SAAS,cAAc;;;;iBAavB,eAAe,SAAS,yBACtC,cACA,iBACA;EAAQ;GACR,oBACC,wBAAwB,SAAS"}
@@ -1,79 +1,57 @@
1
- import { t as Schema } from "../schema-CsbyELyn.mjs";
2
- import { n as Tokens } from "../index-DM8vit-J.mjs";
3
- import { GeneratorFunctionResult } from "@power-plant/core";
4
- //#region src/utils/token-format.d.ts
5
- /**
6
- * Convert a DTCG color `$value` (string, hex/alpha object, or
7
- * colorSpace/components object) into a CSS-friendly color string.
8
- */
9
- declare function formatColorValue(value: unknown): string | undefined;
10
- /**
11
- * Convert a DTCG dimension/duration `$value` (number, string, or
12
- * value/unit object) into a CSS-friendly string.
13
- */
14
- declare function formatDimensionValue(value: unknown): string | undefined;
1
+ import { t as Schema } from "../schema-BwOBgJIM.mjs";
2
+ import { n as Tokens } from "../index-D5L2WXYk.mjs";
3
+ import { a as flattenTokens, i as TokenSet, n as FlattenTokensOptions, o as isTokenLeaf, r as TOKEN_SET_THEME_PATTERN, s as resolveTokenSets, t as BaseFlatToken } from "../flatten-tokens-DgTPHEhI.mjs";
4
+ import { GeneratedDocument, GeneratorFunctionResult } from "@power-plant/core";
5
+ //#region src/utils/merge-tokens.d.ts
15
6
  /**
16
- * Convert a DTCG `$value` into a CSS-friendly string, dispatching on `type`
17
- * (or, when `type` is omitted, on the shape of `value`).
7
+ * Deep-merge token **groups**, replacing token leaves atomically.
8
+ *
9
+ * Unlike `defu`, this does not concatenate arrays inside `$value` (color
10
+ * `components`, cubicBezier lists, shadow layers). Theme `override` wins
11
+ * for leaves and `$`-prefixed group metadata.
18
12
  */
19
- declare function formatTokenValue(value: unknown, type?: string): string;
13
+ declare function mergeTokenTrees(override: Tokens, base: Tokens): Tokens;
20
14
  //#endregion
21
- //#region src/utils/flatten-tokens.d.ts
22
- /**
23
- * A flattened design token row produced by {@link flattenTokens}.
24
- */
25
- interface BaseFlatToken {
26
- /** Dot-separated token path (e.g. `color.primary`). */
27
- path: string;
28
- /** DTCG `$type`, when known. */
29
- type?: string;
30
- /** Raw `$value` from the token document. */
31
- value: unknown;
32
- /** CSS-friendly string form of {@link value}. */
33
- cssValue: string;
34
- /** Optional DTCG `$description`. */
15
+ //#region src/utils/schema-identity.d.ts
16
+ /** Design-system identity resolved for generated artifacts. */
17
+ interface SchemaIdentity {
18
+ name?: string;
19
+ title?: string;
35
20
  description?: string;
36
- /** Theme / set id when tokens are a `Record<string, Tokens>`. */
37
- theme?: string;
38
- }
39
- interface TokenSet {
40
- id: string;
41
- tokens: Tokens;
21
+ repository?: string;
22
+ homepage?: string;
23
+ logo?: string;
42
24
  }
43
25
  /**
44
- * Theme-like keys for splitting multi-theme token records.
45
- *
46
- * Extends core {@link ../lib/tokens/constants#THEME_BASENAME_PATTERN} with
47
- * camelCase suffixes from `@razorwind/color-variants` (e.g. `darkHighContrast`).
48
- */
49
- declare const TOKEN_SET_THEME_PATTERN: RegExp;
50
- /**
51
- * Split `Schema.tokens` into one or more named token sets.
52
- *
53
- * A record whose keys all look like themes (`light`, `dark`, …) is treated as
54
- * multi-theme input; otherwise the whole document is a single set.
26
+ * Plugin / call-site overrides. `displayName` aliases `title`; `icon` aliases
27
+ * `logo` (VS Code / Cursor extension field names).
55
28
  */
56
- declare function resolveTokenSets(tokens: Tokens | Record<string, Tokens>): TokenSet[];
57
- interface FlattenTokensOptions<T extends BaseFlatToken = BaseFlatToken> {
58
- /** When set, only tokens whose `$type` is listed are returned. */
59
- includeTypes?: readonly string[];
60
- /** Map each base row before it is appended (e.g. add `cssVar`). */
61
- enrichToken?: (token: BaseFlatToken) => T;
29
+ interface SchemaIdentityOverrides {
30
+ name?: string;
31
+ title?: string;
32
+ displayName?: string;
33
+ description?: string;
34
+ repository?: string;
35
+ homepage?: string;
36
+ logo?: string;
37
+ icon?: string;
62
38
  }
63
39
  /**
64
- * Flatten DTCG token trees into rows for theme mapping or documentation.
40
+ * Resolve design-system identity for generators.
41
+ *
42
+ * Precedence: plugin overrides → {@link Schema} fields → title-cased name.
43
+ * When {@link Schema.theme} is set, titles gain a ` (<Theme>)` suffix.
65
44
  */
66
- declare function flattenTokens<T extends BaseFlatToken = BaseFlatToken>(tokens: Tokens | Record<string, Tokens>, options?: FlattenTokensOptions<T>): T[];
45
+ declare function resolveSchemaIdentity(spec: Pick<Schema, "name" | "title" | "description" | "repository" | "homepage" | "logo" | "theme">, overrides?: SchemaIdentityOverrides): SchemaIdentity;
67
46
  //#endregion
68
- //#region src/utils/title-case.d.ts
47
+ //#region src/utils/slugify-theme-name.d.ts
69
48
  /**
70
- * Convert a slug or identifier into title case for display labels.
49
+ * Convert a theme name into a filesystem-safe slug.
71
50
  *
72
51
  * @example
73
- * titleCase("my-dark-theme") // "My Dark Theme"
74
- * titleCase("darkHighContrast") // "Dark High Contrast"
52
+ * slugifyThemeName("My Dark Theme") // "my-dark-theme"
75
53
  */
76
- declare function titleCase(value: string): string;
54
+ declare function slugifyThemeName(name: string): string;
77
55
  //#endregion
78
56
  //#region src/utils/theme-display-name.d.ts
79
57
  /** Theme-like object with optional human-readable label. */
@@ -87,45 +65,53 @@ interface ThemeNamed {
87
65
  */
88
66
  declare function themeDisplayName(theme: ThemeNamed): string;
89
67
  //#endregion
90
- //#region src/utils/slugify-theme-name.d.ts
68
+ //#region src/utils/theme-output.d.ts
91
69
  /**
92
- * Convert a theme name into a filesystem-safe slug.
70
+ * Append a title-cased theme label to a display title.
93
71
  *
94
72
  * @example
95
- * slugifyThemeName("My Dark Theme") // "my-dark-theme"
73
+ * applyThemeToTitle("My Theme", "dark") // "My Theme (Dark)"
96
74
  */
97
- declare function slugifyThemeName(name: string): string;
98
- //#endregion
99
- //#region src/utils/schema-identity.d.ts
100
- /** Design-system identity resolved for generated artifacts. */
101
- interface SchemaIdentity {
102
- name?: string;
103
- title?: string;
104
- description?: string;
105
- repository?: string;
106
- homepage?: string;
107
- logo?: string;
108
- }
75
+ declare function applyThemeToTitle(title: string | undefined, theme: string | undefined): string | undefined;
109
76
  /**
110
- * Plugin / call-site overrides. `displayName` aliases `title`; `icon` aliases
111
- * `logo` (VS Code / Cursor extension field names).
77
+ * Insert `-<theme>` before a file path's extension.
78
+ *
79
+ * @example
80
+ * appendThemeToFilePath("tokens.css", "dark") // "tokens-dark.css"
112
81
  */
113
- interface SchemaIdentityOverrides {
114
- name?: string;
115
- title?: string;
116
- displayName?: string;
117
- description?: string;
118
- repository?: string;
119
- homepage?: string;
120
- logo?: string;
121
- icon?: string;
122
- }
82
+ declare function appendThemeToFilePath(filePath: string, theme: string): string;
123
83
  /**
124
- * Resolve design-system identity for generators.
84
+ * Rewrite document record keys and {@link GeneratedDocument.path} with a
85
+ * theme suffix so per-theme generator passes do not collide.
86
+ */
87
+ declare function applyThemeToDocuments(documents: Record<string, GeneratedDocument>, theme: string): Record<string, GeneratedDocument>;
88
+ //#endregion
89
+ //#region src/utils/title-case.d.ts
90
+ /**
91
+ * Convert a slug or identifier into title case for display labels.
125
92
  *
126
- * Precedence: plugin overrides → {@link Schema} fields → title-cased name.
93
+ * @example
94
+ * titleCase("my-dark-theme") // "My Dark Theme"
95
+ * titleCase("darkHighContrast") // "Dark High Contrast"
127
96
  */
128
- declare function resolveSchemaIdentity(spec: Pick<Schema, "name" | "title" | "description" | "repository" | "homepage" | "logo">, overrides?: SchemaIdentityOverrides): SchemaIdentity;
97
+ declare function titleCase(value: string): string;
98
+ //#endregion
99
+ //#region src/utils/token-format.d.ts
100
+ /**
101
+ * Convert a DTCG color `$value` (string, hex/alpha object, or
102
+ * colorSpace/components object) into a CSS-friendly color string.
103
+ */
104
+ declare function formatColorValue(value: unknown): string | undefined;
105
+ /**
106
+ * Convert a DTCG dimension/duration `$value` (number, string, or
107
+ * value/unit object) into a CSS-friendly string.
108
+ */
109
+ declare function formatDimensionValue(value: unknown): string | undefined;
110
+ /**
111
+ * Convert a DTCG `$value` into a CSS-friendly string, dispatching on `type`
112
+ * (or, when `type` is omitted, on the shape of `value`).
113
+ */
114
+ declare function formatTokenValue(value: unknown, type?: string): string;
129
115
  //#endregion
130
116
  //#region src/utils/index.d.ts
131
117
  declare function isObject(value: unknown): value is Record<string, unknown>;
@@ -143,5 +129,5 @@ declare function createDocument<TSchema, TOptions extends object>(path: string,
143
129
  name: string;
144
130
  }, language?: string): GeneratorFunctionResult<TSchema, TOptions>[string];
145
131
  //#endregion
146
- export { type BaseFlatToken, type FlattenTokensOptions, type SchemaIdentity, type SchemaIdentityOverrides, TOKEN_SET_THEME_PATTERN, type ThemeNamed, type TokenSet, createDocument, flattenTokens, formatColorValue, formatDimensionValue, formatTokenValue, isObject, resolveSchemaIdentity, resolveTokenSets, slugifyThemeName, themeDisplayName, titleCase, toCssVar };
132
+ export { type BaseFlatToken, type FlattenTokensOptions, type SchemaIdentity, type SchemaIdentityOverrides, TOKEN_SET_THEME_PATTERN, type ThemeNamed, type TokenSet, appendThemeToFilePath, applyThemeToDocuments, applyThemeToTitle, createDocument, flattenTokens, formatColorValue, formatDimensionValue, formatTokenValue, isObject, isTokenLeaf, mergeTokenTrees, resolveSchemaIdentity, resolveTokenSets, slugifyThemeName, themeDisplayName, titleCase, toCssVar };
147
133
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/utils/token-format.ts","../../src/utils/flatten-tokens.ts","../../src/utils/title-case.ts","../../src/utils/theme-display-name.ts","../../src/utils/slugify-theme-name.ts","../../src/utils/schema-identity.ts","../../src/utils/index.ts"],"mappings":""}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/utils/merge-tokens.ts","../../src/utils/schema-identity.ts","../../src/utils/slugify-theme-name.ts","../../src/utils/theme-display-name.ts","../../src/utils/theme-output.ts","../../src/utils/title-case.ts","../../src/utils/token-format.ts","../../src/utils/index.ts"],"mappings":""}
@@ -1 +1 @@
1
- import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,p as c,r as l,s as u,t as d,u as f}from"../utils-B5uabOd5.mjs";export{t as TOKEN_SET_THEME_PATTERN,d as createDocument,a as flattenTokens,n as formatColorValue,r as formatDimensionValue,c as formatTokenValue,o as isObject,i as resolveSchemaIdentity,f as resolveTokenSets,e as slugifyThemeName,s as themeDisplayName,u as titleCase,l as toCssVar};
1
+ import{_ as e,a as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,t as h,u as g,v as _}from"../utils-CDYdsyyW.mjs";export{i as TOKEN_SET_THEME_PATTERN,d as appendThemeToFilePath,m as applyThemeToDocuments,n as applyThemeToTitle,h as createDocument,f as flattenTokens,a as formatColorValue,e as formatDimensionValue,_ as formatTokenValue,u as isObject,l as isTokenLeaf,r as mergeTokenTrees,t as resolveSchemaIdentity,o as resolveTokenSets,g as slugifyThemeName,s as themeDisplayName,c as titleCase,p as toCssVar};
@@ -0,0 +1,2 @@
1
+ import{isObject as e}from"@stryke/type-checks/is-object";import{format as t,parse as n}from"node:path";import{titleCase as r}from"@stryke/string-format/title-case";function i(t){return e(t)}function a(e){if(typeof e==`string`)return e;if(!i(e))return;if(typeof e.hex==`string`){let t=typeof e.alpha==`number`&&e.alpha<1?Math.round(e.alpha*255).toString(16).padStart(2,`0`):``;return`${e.hex}${t}`}let t=typeof e.colorSpace==`string`?e.colorSpace:void 0,n=Array.isArray(e.components)?e.components:void 0;if(!t||!n)return;let r=typeof e.alpha==`number`&&e.alpha<1?` / ${e.alpha}`:``;if(t===`srgb`&&n.length>=3){let[e,t,i]=n;if(typeof e==`number`&&typeof t==`number`&&typeof i==`number`)return`rgb(${Math.round(e*255)} ${Math.round(t*255)} ${Math.round(i*255)}${r})`}return`${t}(${n.map(e=>String(e)).join(` `)}${r})`}function o(e){if(typeof e==`number`)return String(e);if(typeof e==`string`)return e;if(i(e)&&typeof e.value==`number`&&typeof e.unit==`string`)return`${e.value}${e.unit}`}function s(e,t){if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`)return String(e);if(t===`color`||!t&&i(e)&&`colorSpace`in e){let t=a(e);if(t)return t}if(t===`dimension`||t===`duration`||i(e)&&`value`in e&&`unit`in e){let t=o(e);if(t)return t}if(t===`cubicBezier`&&Array.isArray(e))return`cubic-bezier(${e.join(`, `)})`;if(Array.isArray(e))return e.map(String).join(`, `);if(i(e)){let t=a(e);if(t)return t;let n=o(e);if(n)return n}try{return JSON.stringify(e)}catch{return String(e)}}function c(t){return e(t)}const l=/^(?:light|dark|dim|dimmed|high-contrast|hc|protanopia|deuteranopia|tritanopia|achromatopsia|achromatomaly|monochrome|monochromatic|grayscale|greyscale|bw|black-and-white|black-white|blackWhite|default|base|theme)(?:[A-Z]\w*|[._-].+)?$/i;function u(e){return`$value`in e||`value`in e||`$ref`in e||`ref`in e}function d(e){if(typeof e.$description==`string`)return e.$description;if(typeof e.description==`string`)return e.description}function f(e,t){return typeof e.$type==`string`?e.$type:typeof e.type==`string`?e.type:t}function p(e){if(`$value`in e)return e.$value;if(`value`in e)return e.value;if(typeof e.$ref==`string`)return e.$ref;if(typeof e.ref==`string`)return e.ref}function m(e,t,n,r,i,a){if(!c(e))return;let o=f(e,n);if(u(e)){let n=p(e),c={path:t.join(`.`),type:o,value:n,cssValue:s(n,o),description:d(e),theme:r};a.push(i?i(c):c);return}for(let[n,s]of Object.entries(e))n.startsWith(`$`)||m(s,[...t,n],o,r,i,a)}function h(e){if(!c(e))return[];let t=Object.keys(e).filter(e=>!e.startsWith(`$`));if(t.length>0&&t.every(e=>l.test(e))){let n=e;return t.map(e=>({id:e,tokens:n[e]}))}return[{id:`default`,tokens:e}]}function g(e,t={}){let n=t.includeTypes?new Set(t.includeTypes):void 0,r=[];for(let n of h(e)){let e=n.id==="default"?void 0:n.id;m(n.tokens,[],void 0,e,t.enrichToken,r)}return n?r.filter(e=>!e.type||n.has(e.type)):r}function _(t){return e(t)}function v(e,t){return y(e,t)}function y(e,t){if(!_(t))return e;if(!_(e))return e??t;if(u(t)||u(e))return e;let n={...t};for(let[t,r]of Object.entries(e)){if(t.startsWith(`$`)){n[t]=r;continue}n[t]=t in n?y(r,n[t]):r}return n}function b(e){return e.trim().toLowerCase().replaceAll(/[^a-z0-9]+/g,`-`).replaceAll(/^-+|-+$/g,``)}function x(e){return r(e)}function S(e,t){if(!e||!t)return e;let n=` (${x(t)})`;return e.endsWith(n)?e:`${e}${n}`}function C(e,r){let i=n(e);return i.name?t({root:i.root,dir:i.dir,ext:i.ext,name:`${i.name}-${b(r)}`}):e}function w(e,t){let n={};for(let[r,i]of Object.entries(e)){let e=C(r,t);n[e]={...i,path:i.path?C(i.path,t):e}}return n}function T(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function E(e,t={}){let n=t.name??e.name,r=S(t.displayName??t.title??e.title??(n?x(T(n)):void 0),e.theme),i=t.description??e.description,a=t.repository??e.repository,o=t.homepage??e.homepage,s=t.icon??t.logo??e.logo;return{...n?{name:n}:{},...r?{title:r}:{},...i?{description:i}:{},...a?{repository:a}:{},...o?{homepage:o}:{},...s?{logo:s}:{}}}function D(e){return e.displayName??x(e.name)}function O(t){return e(t)}function k(e,t){return`--${t}-${e.split(`.`).filter(Boolean).join(`-`).replaceAll(/[^\w-]+/g,`-`)}`}function A(e,t,n,r){return{path:e,language:r,chunks:[{content:t,meta:n}]}}export{o as _,E as a,S as c,v as d,l as f,a as g,h,D as i,x as l,u as m,O as n,C as o,g as p,k as r,w as s,A as t,b as u,s as v};
2
+ //# sourceMappingURL=utils-CDYdsyyW.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils-CDYdsyyW.mjs","names":[],"sources":[],"mappings":""}
@@ -0,0 +1 @@
1
+ let e=require("@stryke/type-checks/is-object"),t=require("node:path"),n=require("@stryke/string-format/title-case");function r(t){return(0,e.isObject)(t)}function i(e){if(typeof e==`string`)return e;if(!r(e))return;if(typeof e.hex==`string`){let t=typeof e.alpha==`number`&&e.alpha<1?Math.round(e.alpha*255).toString(16).padStart(2,`0`):``;return`${e.hex}${t}`}let t=typeof e.colorSpace==`string`?e.colorSpace:void 0,n=Array.isArray(e.components)?e.components:void 0;if(!t||!n)return;let i=typeof e.alpha==`number`&&e.alpha<1?` / ${e.alpha}`:``;if(t===`srgb`&&n.length>=3){let[e,t,r]=n;if(typeof e==`number`&&typeof t==`number`&&typeof r==`number`)return`rgb(${Math.round(e*255)} ${Math.round(t*255)} ${Math.round(r*255)}${i})`}return`${t}(${n.map(e=>String(e)).join(` `)}${i})`}function a(e){if(typeof e==`number`)return String(e);if(typeof e==`string`)return e;if(r(e)&&typeof e.value==`number`&&typeof e.unit==`string`)return`${e.value}${e.unit}`}function o(e,t){if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`)return String(e);if(t===`color`||!t&&r(e)&&`colorSpace`in e){let t=i(e);if(t)return t}if(t===`dimension`||t===`duration`||r(e)&&`value`in e&&`unit`in e){let t=a(e);if(t)return t}if(t===`cubicBezier`&&Array.isArray(e))return`cubic-bezier(${e.join(`, `)})`;if(Array.isArray(e))return e.map(String).join(`, `);if(r(e)){let t=i(e);if(t)return t;let n=a(e);if(n)return n}try{return JSON.stringify(e)}catch{return String(e)}}function s(t){return(0,e.isObject)(t)}const c=/^(?:light|dark|dim|dimmed|high-contrast|hc|protanopia|deuteranopia|tritanopia|achromatopsia|achromatomaly|monochrome|monochromatic|grayscale|greyscale|bw|black-and-white|black-white|blackWhite|default|base|theme)(?:[A-Z]\w*|[._-].+)?$/i;function l(e){return`$value`in e||`value`in e||`$ref`in e||`ref`in e}function u(e){if(typeof e.$description==`string`)return e.$description;if(typeof e.description==`string`)return e.description}function d(e,t){return typeof e.$type==`string`?e.$type:typeof e.type==`string`?e.type:t}function f(e){if(`$value`in e)return e.$value;if(`value`in e)return e.value;if(typeof e.$ref==`string`)return e.$ref;if(typeof e.ref==`string`)return e.ref}function p(e,t,n,r,i,a){if(!s(e))return;let c=d(e,n);if(l(e)){let n=f(e),s={path:t.join(`.`),type:c,value:n,cssValue:o(n,c),description:u(e),theme:r};a.push(i?i(s):s);return}for(let[n,o]of Object.entries(e))n.startsWith(`$`)||p(o,[...t,n],c,r,i,a)}function m(e){if(!s(e))return[];let t=Object.keys(e).filter(e=>!e.startsWith(`$`));if(t.length>0&&t.every(e=>c.test(e))){let n=e;return t.map(e=>({id:e,tokens:n[e]}))}return[{id:`default`,tokens:e}]}function h(e,t={}){let n=t.includeTypes?new Set(t.includeTypes):void 0,r=[];for(let n of m(e)){let e=n.id==="default"?void 0:n.id;p(n.tokens,[],void 0,e,t.enrichToken,r)}return n?r.filter(e=>!e.type||n.has(e.type)):r}function g(t){return(0,e.isObject)(t)}function _(e,t){return v(e,t)}function v(e,t){if(!g(t))return e;if(!g(e))return e??t;if(l(t)||l(e))return e;let n={...t};for(let[t,r]of Object.entries(e)){if(t.startsWith(`$`)){n[t]=r;continue}n[t]=t in n?v(r,n[t]):r}return n}function y(e){return e.trim().toLowerCase().replaceAll(/[^a-z0-9]+/g,`-`).replaceAll(/^-+|-+$/g,``)}function b(e){return(0,n.titleCase)(e)}function x(e,t){if(!e||!t)return e;let n=` (${b(t)})`;return e.endsWith(n)?e:`${e}${n}`}function S(e,n){let r=(0,t.parse)(e);return r.name?(0,t.format)({root:r.root,dir:r.dir,ext:r.ext,name:`${r.name}-${y(n)}`}):e}function C(e,t){let n={};for(let[r,i]of Object.entries(e)){let e=S(r,t);n[e]={...i,path:i.path?S(i.path,t):e}}return n}function w(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function T(e,t={}){let n=t.name??e.name,r=x(t.displayName??t.title??e.title??(n?b(w(n)):void 0),e.theme),i=t.description??e.description,a=t.repository??e.repository,o=t.homepage??e.homepage,s=t.icon??t.logo??e.logo;return{...n?{name:n}:{},...r?{title:r}:{},...i?{description:i}:{},...a?{repository:a}:{},...o?{homepage:o}:{},...s?{logo:s}:{}}}function E(e){return e.displayName??b(e.name)}function D(t){return(0,e.isObject)(t)}function O(e,t){return`--${t}-${e.split(`.`).filter(Boolean).join(`-`).replaceAll(/[^\w-]+/g,`-`)}`}function k(e,t,n,r){return{path:e,language:r,chunks:[{content:t,meta:n}]}}Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return o}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@razorwind/core",
3
- "version": "0.0.46",
3
+ "version": "0.0.48",
4
4
  "private": false,
5
5
  "description": "💨 Razorwind is a unified set of tools that make creating design systems a breeze.",
6
6
  "keywords": ["razorwind", "storm-software"],
@@ -54,6 +54,20 @@
54
54
  "default": "./dist/index.mjs"
55
55
  }
56
56
  },
57
+ "./lib/fonts": {
58
+ "require": {
59
+ "types": "./dist/lib/fonts/index.d.cts",
60
+ "default": "./dist/lib/fonts/index.cjs"
61
+ },
62
+ "import": {
63
+ "types": "./dist/lib/fonts/index.d.mts",
64
+ "default": "./dist/lib/fonts/index.mjs"
65
+ },
66
+ "default": {
67
+ "types": "./dist/lib/fonts/index.d.mts",
68
+ "default": "./dist/lib/fonts/index.mjs"
69
+ }
70
+ },
57
71
  "./lib/tokens": {
58
72
  "require": {
59
73
  "types": "./dist/lib/tokens/index.d.cts",
@@ -145,5 +159,5 @@
145
159
  "typescript": "^6.0.3"
146
160
  },
147
161
  "publishConfig": { "access": "public" },
148
- "gitHead": "0bfdb728cdb6c241eae5072dab7984fe48146c22"
162
+ "gitHead": "c53ec72420850efd1c4f8339b264c33ca6b9870b"
149
163
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"config-25eDAKIq.d.cts","names":[],"sources":["../src/types/plugin.ts","../src/types/config.ts"],"mappings":";;;;;;;;;;;;;;;UAgCiB;EACf;EACA,SAAS;EACT,SAAS,qBAAqB;;;;;;;;;KAUpB;EAEN;EACA,eAAe,YAAY,uBAAuB;MAElD,YAAY,uBAAuB;;;;;;;;;UAUxB;;;;;;;EAOf;;;;;;EAOA,UAAU;;;;;;EAOV,gBAAgB;;;;;;;;EAShB,WAAW,MAAM,QAAQ,QAAQ,WAAW,aAAa;;;;;;;;EASzD,YACE,MAAM,QACN,QAAQ,WACL,aAAa,eAAe;;;;;;;;EASjC,YAAY,MAAM,QAAQ,QAAQ,WAAW;;;;UCtF9B;;;;;;;;;;;;;;;;;;EAkBf;;;;EAKA;;;;;;EAOA;;;;;;;;;;;EAYA;;;;;;EAOA;;;;;;;;;;;;EAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyCA;;UAGe,mBAAmB;EAClC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA,SAAS,SAAS,eAAe;EACjC,aAAa;EACb,QAAQ;EACR,UAAU;;UAGK;EACf;EACA;;KAGU,sBAAsB,QAAQ,eAAe;KAC7C,uBACV,QAAQ,qBACL,QAAQ,aAAa;KACd,gBACV,QAAQ,qBACL,aAAa,eAAe,QAAQ,aAAa;KAC1C,mBACR,aACA,eACA,QAAQ,aAAa,gBACrB,qBACA,sBACA;KAEQ,SAAS,aACnB;EAGA;EACA,UAAU;IACR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"config-rgbP9zhp.d.mts","names":[],"sources":["../src/types/plugin.ts","../src/types/config.ts"],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-CAoFfyMa.d.mts","names":[],"sources":["../src/plugin.ts"],"mappings":""}
@@ -1 +0,0 @@
1
- const e=require("./rolldown-runtime-BocRIvOZ.cjs");let t=require("zod");t=e.t(t,1);let n=require("@power-plant/dtcg-schema");const r=t.z.object({path:t.z.string(),type:t.z.enum([`lib`,`block`,`component`,`ui`,`hook`,`theme`,`page`,`file`,`style`,`base`,`font`,`item`]).optional(),content:t.z.string().optional(),target:t.z.string().optional().describe(`The target path of the file. This is the path to the file in the project. Supports registry target placeholders @components/, @ui/, @lib/, and @hooks/, which resolve to the corresponding aliases configured in components.json. These placeholders are independent of the project's import prefix.`)}),i=t.z.object({name:t.z.string().optional().describe(`Stable usage example id. Defaults to the source filename without extension.`),title:t.z.string().optional(),description:t.z.string().optional(),path:t.z.string(),content:t.z.string().optional(),language:t.z.enum([`tsx`,`jsx`,`ts`,`js`,`mdx`,`md`,`css`,`html`,`txt`]).optional().describe(`Source language for syntax highlighting. Inferred from the file extension when omitted.`)}),a=t.z.object({name:t.z.string(),title:t.z.string(),type:t.z.enum([`block`,`component`,`ui`,`page`]).default(`component`),category:t.z.string().optional(),description:t.z.string().optional(),tags:t.z.array(t.z.string()).optional(),related:t.z.array(t.z.string()).optional(),since:t.z.string().optional(),version:t.z.string().optional(),repository:t.z.string().optional(),homepage:t.z.string().optional(),dependencies:t.z.record(t.z.string(),t.z.string()).optional(),devDependencies:t.z.record(t.z.string(),t.z.string()).optional(),registryDependencies:t.z.record(t.z.string(),t.z.string()).optional(),files:t.z.array(r).optional(),usage:t.z.array(i).optional().describe("Example usage snippets for this component. Prefer a `usage/` directory of source files; entries may also be declared in metadata.")}),o=t.z.record(t.z.string(),a),s=t.z.object({path:t.z.string(),type:t.z.enum([`svg`,`png`,`webp`,`jpg`,`jpeg`,`gif`,`ico`,`file`]).optional(),content:t.z.string().optional(),theme:t.z.string().optional().describe(`Optional theme variant for this asset (for example light or dark).`),target:t.z.string().optional().describe(`The target path of the file in the project. Supports registry-style placeholders independent of the project's import prefix.`)}),c=t.z.object({name:t.z.string(),title:t.z.string(),category:t.z.string().optional(),description:t.z.string().optional(),tags:t.z.array(t.z.string()).optional(),aliases:t.z.array(t.z.string()).optional(),related:t.z.array(t.z.string()).optional(),since:t.z.string().optional(),version:t.z.string().optional(),repository:t.z.string().optional(),homepage:t.z.string().optional(),files:t.z.array(s).optional()}),l=t.z.record(t.z.string(),c),u=t.default.union([n.tokensSchema,t.default.record(t.default.string(),n.tokensSchema)]),d=t.default.object({name:t.default.string().optional(),title:t.default.string().optional(),repository:t.default.string().optional(),homepage:t.default.string().optional(),description:t.default.string().optional(),logo:t.default.string().optional(),tokens:u,components:o,icons:l});Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return d}});