@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.
- package/dist/{config-25eDAKIq.d.cts → config-BtscEr7S.d.cts} +17 -5
- package/dist/config-BtscEr7S.d.cts.map +1 -0
- package/dist/{config-rgbP9zhp.d.mts → config-CNTGHrST.d.mts} +16 -4
- package/dist/config-CNTGHrST.d.mts.map +1 -0
- package/dist/flatten-tokens-CMlVe_J6.d.cts +54 -0
- package/dist/flatten-tokens-CMlVe_J6.d.cts.map +1 -0
- package/dist/flatten-tokens-DgTPHEhI.d.mts +54 -0
- package/dist/flatten-tokens-DgTPHEhI.d.mts.map +1 -0
- package/dist/fonts-B0ESWBBC.mjs +2 -0
- package/dist/fonts-B0ESWBBC.mjs.map +1 -0
- package/dist/fonts-BiuIJVev.mjs +10 -0
- package/dist/fonts-BiuIJVev.mjs.map +1 -0
- package/dist/fonts-CkBPEFie.cjs +9 -0
- package/dist/fonts-vhz5FAsy.cjs +1 -0
- package/dist/{index-D1ayVOTE.d.mts → index-B7MsziQp.d.cts} +4 -4
- package/dist/{index-Dk-i27fI.d.cts.map → index-B7MsziQp.d.cts.map} +1 -1
- package/dist/{index-BjSOzDOH.d.cts → index-CwN0c1Q4.d.cts} +1 -1
- package/dist/index-CzbZzpnz.d.mts +100 -0
- package/dist/index-CzbZzpnz.d.mts.map +1 -0
- package/dist/{index-Dk-i27fI.d.cts → index-CzjDptav.d.mts} +5 -5
- package/dist/{index-D1ayVOTE.d.mts.map → index-CzjDptav.d.mts.map} +1 -1
- package/dist/{index-DM8vit-J.d.mts → index-D5L2WXYk.d.mts} +1 -1
- package/dist/index-Di7vqmsi.d.cts +100 -0
- package/dist/index-Di7vqmsi.d.cts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +82 -15
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +82 -15
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lib/fonts/index.cjs +1 -0
- package/dist/lib/fonts/index.d.cts +2 -0
- package/dist/lib/fonts/index.d.mts +2 -0
- package/dist/lib/fonts/index.mjs +1 -0
- package/dist/lib/tokens/index.cjs +1 -1
- package/dist/lib/tokens/index.d.cts +1 -1
- package/dist/lib/tokens/index.d.mts +1 -1
- package/dist/lib/tokens/index.mjs +1 -1
- package/dist/{plugin-CAoFfyMa.d.mts → plugin-0UYp_yIy.d.cts} +2 -2
- package/dist/{plugin-m5Bm4WrK.d.cts.map → plugin-0UYp_yIy.d.cts.map} +1 -1
- package/dist/{plugin-m5Bm4WrK.d.cts → plugin-CH6vFnxu.d.mts} +2 -2
- package/dist/plugin-CH6vFnxu.d.mts.map +1 -0
- package/dist/plugin.d.cts +2 -2
- package/dist/plugin.d.mts +2 -2
- package/dist/schema/index.cjs +1 -1
- package/dist/schema/index.d.cts +3 -3
- package/dist/schema/index.d.mts +3 -3
- package/dist/schema/index.mjs +1 -1
- package/dist/schema-BCofDJWf.cjs +1 -0
- package/dist/schema-BwOBgJIM.d.cts +545 -0
- package/dist/schema-BwOBgJIM.d.cts.map +1 -0
- package/dist/schema-BwOBgJIM.d.mts +545 -0
- package/dist/schema-BwOBgJIM.d.mts.map +1 -0
- package/dist/schema-CXK5pVmJ.mjs +2 -0
- package/dist/schema-CXK5pVmJ.mjs.map +1 -0
- package/dist/tokens-By75va9Y.cjs +7 -0
- package/dist/tokens-DFYNBFFR.mjs +8 -0
- package/dist/tokens-DFYNBFFR.mjs.map +1 -0
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.cts +78 -92
- package/dist/utils/index.d.cts.map +1 -1
- package/dist/utils/index.d.mts +78 -92
- package/dist/utils/index.d.mts.map +1 -1
- package/dist/utils/index.mjs +1 -1
- package/dist/utils-CDYdsyyW.mjs +2 -0
- package/dist/utils-CDYdsyyW.mjs.map +1 -0
- package/dist/utils-DyK4l_bT.cjs +1 -0
- package/package.json +16 -2
- package/dist/config-25eDAKIq.d.cts.map +0 -1
- package/dist/config-rgbP9zhp.d.mts.map +0 -1
- package/dist/plugin-CAoFfyMa.d.mts.map +0 -1
- package/dist/schema-93daQRSN.cjs +0 -1
- package/dist/schema-CsbyELyn.d.cts +0 -263
- package/dist/schema-CsbyELyn.d.cts.map +0 -1
- package/dist/schema-CsbyELyn.d.mts +0 -263
- package/dist/schema-CsbyELyn.d.mts.map +0 -1
- package/dist/schema-buR6a6IP.mjs +0 -2
- package/dist/schema-buR6a6IP.mjs.map +0 -1
- package/dist/tokens-CFh9AQab.mjs +0 -2
- package/dist/tokens-CFh9AQab.mjs.map +0 -1
- package/dist/tokens-pHmukPOW.cjs +0 -1
- package/dist/utils-B5uabOd5.mjs +0 -2
- package/dist/utils-B5uabOd5.mjs.map +0 -1
- package/dist/utils-BiL8zQzg.cjs +0 -1
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
import z, { z as z$1 } from "zod";
|
|
2
|
+
import { Tokens } from "@power-plant/dtcg-schema";
|
|
3
|
+
//#region src/schema/components.d.ts
|
|
4
|
+
declare const componentFileSchema: z$1.ZodObject<{
|
|
5
|
+
path: z$1.ZodString;
|
|
6
|
+
type: z$1.ZodOptional<z$1.ZodEnum<{
|
|
7
|
+
lib: "lib";
|
|
8
|
+
block: "block";
|
|
9
|
+
component: "component";
|
|
10
|
+
ui: "ui";
|
|
11
|
+
hook: "hook";
|
|
12
|
+
theme: "theme";
|
|
13
|
+
page: "page";
|
|
14
|
+
file: "file";
|
|
15
|
+
style: "style";
|
|
16
|
+
base: "base";
|
|
17
|
+
font: "font";
|
|
18
|
+
item: "item";
|
|
19
|
+
}>>;
|
|
20
|
+
content: z$1.ZodOptional<z$1.ZodString>;
|
|
21
|
+
target: z$1.ZodOptional<z$1.ZodString>;
|
|
22
|
+
}, z$1.core.$strip>;
|
|
23
|
+
type ComponentFile = z$1.infer<typeof componentFileSchema>;
|
|
24
|
+
/**
|
|
25
|
+
* An example of how a component should be used.
|
|
26
|
+
*
|
|
27
|
+
* Loaded from a component directory's `usage/` folder, or declared under
|
|
28
|
+
* `usage` in `component.json` / `package.json` `razorwind`. Consumed by
|
|
29
|
+
* documentation and Storybook plugins.
|
|
30
|
+
*/
|
|
31
|
+
declare const componentUsageSchema: z$1.ZodObject<{
|
|
32
|
+
name: z$1.ZodOptional<z$1.ZodString>;
|
|
33
|
+
title: z$1.ZodOptional<z$1.ZodString>;
|
|
34
|
+
description: z$1.ZodOptional<z$1.ZodString>;
|
|
35
|
+
path: z$1.ZodString;
|
|
36
|
+
content: z$1.ZodOptional<z$1.ZodString>;
|
|
37
|
+
language: z$1.ZodOptional<z$1.ZodEnum<{
|
|
38
|
+
tsx: "tsx";
|
|
39
|
+
jsx: "jsx";
|
|
40
|
+
ts: "ts";
|
|
41
|
+
js: "js";
|
|
42
|
+
mdx: "mdx";
|
|
43
|
+
md: "md";
|
|
44
|
+
css: "css";
|
|
45
|
+
html: "html";
|
|
46
|
+
txt: "txt";
|
|
47
|
+
}>>;
|
|
48
|
+
}, z$1.core.$strip>;
|
|
49
|
+
type ComponentUsage = z$1.infer<typeof componentUsageSchema>;
|
|
50
|
+
declare const componentSchema: z$1.ZodObject<{
|
|
51
|
+
name: z$1.ZodString;
|
|
52
|
+
title: z$1.ZodString;
|
|
53
|
+
type: z$1.ZodDefault<z$1.ZodEnum<{
|
|
54
|
+
block: "block";
|
|
55
|
+
component: "component";
|
|
56
|
+
ui: "ui";
|
|
57
|
+
page: "page";
|
|
58
|
+
}>>;
|
|
59
|
+
category: z$1.ZodOptional<z$1.ZodString>;
|
|
60
|
+
description: z$1.ZodOptional<z$1.ZodString>;
|
|
61
|
+
tags: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
62
|
+
related: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
63
|
+
since: z$1.ZodOptional<z$1.ZodString>;
|
|
64
|
+
version: z$1.ZodOptional<z$1.ZodString>;
|
|
65
|
+
repository: z$1.ZodOptional<z$1.ZodString>;
|
|
66
|
+
homepage: z$1.ZodOptional<z$1.ZodString>;
|
|
67
|
+
dependencies: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
68
|
+
devDependencies: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
69
|
+
registryDependencies: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
70
|
+
files: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
|
|
71
|
+
path: z$1.ZodString;
|
|
72
|
+
type: z$1.ZodOptional<z$1.ZodEnum<{
|
|
73
|
+
lib: "lib";
|
|
74
|
+
block: "block";
|
|
75
|
+
component: "component";
|
|
76
|
+
ui: "ui";
|
|
77
|
+
hook: "hook";
|
|
78
|
+
theme: "theme";
|
|
79
|
+
page: "page";
|
|
80
|
+
file: "file";
|
|
81
|
+
style: "style";
|
|
82
|
+
base: "base";
|
|
83
|
+
font: "font";
|
|
84
|
+
item: "item";
|
|
85
|
+
}>>;
|
|
86
|
+
content: z$1.ZodOptional<z$1.ZodString>;
|
|
87
|
+
target: z$1.ZodOptional<z$1.ZodString>;
|
|
88
|
+
}, z$1.core.$strip>>>;
|
|
89
|
+
usage: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
|
|
90
|
+
name: z$1.ZodOptional<z$1.ZodString>;
|
|
91
|
+
title: z$1.ZodOptional<z$1.ZodString>;
|
|
92
|
+
description: z$1.ZodOptional<z$1.ZodString>;
|
|
93
|
+
path: z$1.ZodString;
|
|
94
|
+
content: z$1.ZodOptional<z$1.ZodString>;
|
|
95
|
+
language: z$1.ZodOptional<z$1.ZodEnum<{
|
|
96
|
+
tsx: "tsx";
|
|
97
|
+
jsx: "jsx";
|
|
98
|
+
ts: "ts";
|
|
99
|
+
js: "js";
|
|
100
|
+
mdx: "mdx";
|
|
101
|
+
md: "md";
|
|
102
|
+
css: "css";
|
|
103
|
+
html: "html";
|
|
104
|
+
txt: "txt";
|
|
105
|
+
}>>;
|
|
106
|
+
}, z$1.core.$strip>>>;
|
|
107
|
+
}, z$1.core.$strip>;
|
|
108
|
+
type Component = z$1.infer<typeof componentSchema>;
|
|
109
|
+
declare const componentsSchema: z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{
|
|
110
|
+
name: z$1.ZodString;
|
|
111
|
+
title: z$1.ZodString;
|
|
112
|
+
type: z$1.ZodDefault<z$1.ZodEnum<{
|
|
113
|
+
block: "block";
|
|
114
|
+
component: "component";
|
|
115
|
+
ui: "ui";
|
|
116
|
+
page: "page";
|
|
117
|
+
}>>;
|
|
118
|
+
category: z$1.ZodOptional<z$1.ZodString>;
|
|
119
|
+
description: z$1.ZodOptional<z$1.ZodString>;
|
|
120
|
+
tags: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
121
|
+
related: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
122
|
+
since: z$1.ZodOptional<z$1.ZodString>;
|
|
123
|
+
version: z$1.ZodOptional<z$1.ZodString>;
|
|
124
|
+
repository: z$1.ZodOptional<z$1.ZodString>;
|
|
125
|
+
homepage: z$1.ZodOptional<z$1.ZodString>;
|
|
126
|
+
dependencies: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
127
|
+
devDependencies: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
128
|
+
registryDependencies: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
129
|
+
files: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
|
|
130
|
+
path: z$1.ZodString;
|
|
131
|
+
type: z$1.ZodOptional<z$1.ZodEnum<{
|
|
132
|
+
lib: "lib";
|
|
133
|
+
block: "block";
|
|
134
|
+
component: "component";
|
|
135
|
+
ui: "ui";
|
|
136
|
+
hook: "hook";
|
|
137
|
+
theme: "theme";
|
|
138
|
+
page: "page";
|
|
139
|
+
file: "file";
|
|
140
|
+
style: "style";
|
|
141
|
+
base: "base";
|
|
142
|
+
font: "font";
|
|
143
|
+
item: "item";
|
|
144
|
+
}>>;
|
|
145
|
+
content: z$1.ZodOptional<z$1.ZodString>;
|
|
146
|
+
target: z$1.ZodOptional<z$1.ZodString>;
|
|
147
|
+
}, z$1.core.$strip>>>;
|
|
148
|
+
usage: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
|
|
149
|
+
name: z$1.ZodOptional<z$1.ZodString>;
|
|
150
|
+
title: z$1.ZodOptional<z$1.ZodString>;
|
|
151
|
+
description: z$1.ZodOptional<z$1.ZodString>;
|
|
152
|
+
path: z$1.ZodString;
|
|
153
|
+
content: z$1.ZodOptional<z$1.ZodString>;
|
|
154
|
+
language: z$1.ZodOptional<z$1.ZodEnum<{
|
|
155
|
+
tsx: "tsx";
|
|
156
|
+
jsx: "jsx";
|
|
157
|
+
ts: "ts";
|
|
158
|
+
js: "js";
|
|
159
|
+
mdx: "mdx";
|
|
160
|
+
md: "md";
|
|
161
|
+
css: "css";
|
|
162
|
+
html: "html";
|
|
163
|
+
txt: "txt";
|
|
164
|
+
}>>;
|
|
165
|
+
}, z$1.core.$strip>>>;
|
|
166
|
+
}, z$1.core.$strip>>;
|
|
167
|
+
type Components = z$1.infer<typeof componentsSchema>;
|
|
168
|
+
//#endregion
|
|
169
|
+
//#region src/schema/fonts.d.ts
|
|
170
|
+
declare const fontRoleSchema: z$1.ZodEnum<{
|
|
171
|
+
sans: "sans";
|
|
172
|
+
serif: "serif";
|
|
173
|
+
mono: "mono";
|
|
174
|
+
display: "display";
|
|
175
|
+
heading: "heading";
|
|
176
|
+
body: "body";
|
|
177
|
+
code: "code";
|
|
178
|
+
}>;
|
|
179
|
+
type FontRole = z$1.infer<typeof fontRoleSchema>;
|
|
180
|
+
declare const fontDisplaySchema: z$1.ZodEnum<{
|
|
181
|
+
block: "block";
|
|
182
|
+
optional: "optional";
|
|
183
|
+
auto: "auto";
|
|
184
|
+
swap: "swap";
|
|
185
|
+
fallback: "fallback";
|
|
186
|
+
}>;
|
|
187
|
+
type FontDisplay = z$1.infer<typeof fontDisplaySchema>;
|
|
188
|
+
declare const fontFileFormatSchema: z$1.ZodEnum<{
|
|
189
|
+
woff2: "woff2";
|
|
190
|
+
woff: "woff";
|
|
191
|
+
truetype: "truetype";
|
|
192
|
+
opentype: "opentype";
|
|
193
|
+
svg: "svg";
|
|
194
|
+
}>;
|
|
195
|
+
type FontFileFormat = z$1.infer<typeof fontFileFormatSchema>;
|
|
196
|
+
declare const fontFileSchema: z$1.ZodObject<{
|
|
197
|
+
path: z$1.ZodString;
|
|
198
|
+
format: z$1.ZodOptional<z$1.ZodEnum<{
|
|
199
|
+
woff2: "woff2";
|
|
200
|
+
woff: "woff";
|
|
201
|
+
truetype: "truetype";
|
|
202
|
+
opentype: "opentype";
|
|
203
|
+
svg: "svg";
|
|
204
|
+
}>>;
|
|
205
|
+
weight: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodNumber, z$1.ZodString]>>;
|
|
206
|
+
style: z$1.ZodOptional<z$1.ZodEnum<{
|
|
207
|
+
normal: "normal";
|
|
208
|
+
italic: "italic";
|
|
209
|
+
oblique: "oblique";
|
|
210
|
+
}>>;
|
|
211
|
+
unicodeRange: z$1.ZodOptional<z$1.ZodString>;
|
|
212
|
+
}, z$1.core.$strip>;
|
|
213
|
+
type FontFile = z$1.infer<typeof fontFileSchema>;
|
|
214
|
+
declare const googleFontSchema: z$1.ZodObject<{
|
|
215
|
+
name: z$1.ZodString;
|
|
216
|
+
title: z$1.ZodString;
|
|
217
|
+
family: z$1.ZodOptional<z$1.ZodString>;
|
|
218
|
+
role: z$1.ZodOptional<z$1.ZodEnum<{
|
|
219
|
+
sans: "sans";
|
|
220
|
+
serif: "serif";
|
|
221
|
+
mono: "mono";
|
|
222
|
+
display: "display";
|
|
223
|
+
heading: "heading";
|
|
224
|
+
body: "body";
|
|
225
|
+
code: "code";
|
|
226
|
+
}>>;
|
|
227
|
+
fallbacks: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
228
|
+
display: z$1.ZodOptional<z$1.ZodEnum<{
|
|
229
|
+
block: "block";
|
|
230
|
+
optional: "optional";
|
|
231
|
+
auto: "auto";
|
|
232
|
+
swap: "swap";
|
|
233
|
+
fallback: "fallback";
|
|
234
|
+
}>>;
|
|
235
|
+
category: z$1.ZodOptional<z$1.ZodString>;
|
|
236
|
+
description: z$1.ZodOptional<z$1.ZodString>;
|
|
237
|
+
tags: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
238
|
+
source: z$1.ZodLiteral<"google">;
|
|
239
|
+
weights: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodNumber, z$1.ZodString]>>>;
|
|
240
|
+
styles: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
|
|
241
|
+
normal: "normal";
|
|
242
|
+
italic: "italic";
|
|
243
|
+
}>>>;
|
|
244
|
+
subsets: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
245
|
+
variable: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
246
|
+
}, z$1.core.$strip>;
|
|
247
|
+
type GoogleFont = z$1.infer<typeof googleFontSchema>;
|
|
248
|
+
declare const localFontSchema: z$1.ZodObject<{
|
|
249
|
+
name: z$1.ZodString;
|
|
250
|
+
title: z$1.ZodString;
|
|
251
|
+
family: z$1.ZodOptional<z$1.ZodString>;
|
|
252
|
+
role: z$1.ZodOptional<z$1.ZodEnum<{
|
|
253
|
+
sans: "sans";
|
|
254
|
+
serif: "serif";
|
|
255
|
+
mono: "mono";
|
|
256
|
+
display: "display";
|
|
257
|
+
heading: "heading";
|
|
258
|
+
body: "body";
|
|
259
|
+
code: "code";
|
|
260
|
+
}>>;
|
|
261
|
+
fallbacks: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
262
|
+
display: z$1.ZodOptional<z$1.ZodEnum<{
|
|
263
|
+
block: "block";
|
|
264
|
+
optional: "optional";
|
|
265
|
+
auto: "auto";
|
|
266
|
+
swap: "swap";
|
|
267
|
+
fallback: "fallback";
|
|
268
|
+
}>>;
|
|
269
|
+
category: z$1.ZodOptional<z$1.ZodString>;
|
|
270
|
+
description: z$1.ZodOptional<z$1.ZodString>;
|
|
271
|
+
tags: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
272
|
+
source: z$1.ZodLiteral<"local">;
|
|
273
|
+
files: z$1.ZodArray<z$1.ZodObject<{
|
|
274
|
+
path: z$1.ZodString;
|
|
275
|
+
format: z$1.ZodOptional<z$1.ZodEnum<{
|
|
276
|
+
woff2: "woff2";
|
|
277
|
+
woff: "woff";
|
|
278
|
+
truetype: "truetype";
|
|
279
|
+
opentype: "opentype";
|
|
280
|
+
svg: "svg";
|
|
281
|
+
}>>;
|
|
282
|
+
weight: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodNumber, z$1.ZodString]>>;
|
|
283
|
+
style: z$1.ZodOptional<z$1.ZodEnum<{
|
|
284
|
+
normal: "normal";
|
|
285
|
+
italic: "italic";
|
|
286
|
+
oblique: "oblique";
|
|
287
|
+
}>>;
|
|
288
|
+
unicodeRange: z$1.ZodOptional<z$1.ZodString>;
|
|
289
|
+
}, z$1.core.$strip>>;
|
|
290
|
+
}, z$1.core.$strip>;
|
|
291
|
+
type LocalFont = z$1.infer<typeof localFontSchema>;
|
|
292
|
+
declare const fontSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
293
|
+
name: z$1.ZodString;
|
|
294
|
+
title: z$1.ZodString;
|
|
295
|
+
family: z$1.ZodOptional<z$1.ZodString>;
|
|
296
|
+
role: z$1.ZodOptional<z$1.ZodEnum<{
|
|
297
|
+
sans: "sans";
|
|
298
|
+
serif: "serif";
|
|
299
|
+
mono: "mono";
|
|
300
|
+
display: "display";
|
|
301
|
+
heading: "heading";
|
|
302
|
+
body: "body";
|
|
303
|
+
code: "code";
|
|
304
|
+
}>>;
|
|
305
|
+
fallbacks: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
306
|
+
display: z$1.ZodOptional<z$1.ZodEnum<{
|
|
307
|
+
block: "block";
|
|
308
|
+
optional: "optional";
|
|
309
|
+
auto: "auto";
|
|
310
|
+
swap: "swap";
|
|
311
|
+
fallback: "fallback";
|
|
312
|
+
}>>;
|
|
313
|
+
category: z$1.ZodOptional<z$1.ZodString>;
|
|
314
|
+
description: z$1.ZodOptional<z$1.ZodString>;
|
|
315
|
+
tags: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
316
|
+
source: z$1.ZodLiteral<"google">;
|
|
317
|
+
weights: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodNumber, z$1.ZodString]>>>;
|
|
318
|
+
styles: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
|
|
319
|
+
normal: "normal";
|
|
320
|
+
italic: "italic";
|
|
321
|
+
}>>>;
|
|
322
|
+
subsets: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
323
|
+
variable: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
324
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
325
|
+
name: z$1.ZodString;
|
|
326
|
+
title: z$1.ZodString;
|
|
327
|
+
family: z$1.ZodOptional<z$1.ZodString>;
|
|
328
|
+
role: z$1.ZodOptional<z$1.ZodEnum<{
|
|
329
|
+
sans: "sans";
|
|
330
|
+
serif: "serif";
|
|
331
|
+
mono: "mono";
|
|
332
|
+
display: "display";
|
|
333
|
+
heading: "heading";
|
|
334
|
+
body: "body";
|
|
335
|
+
code: "code";
|
|
336
|
+
}>>;
|
|
337
|
+
fallbacks: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
338
|
+
display: z$1.ZodOptional<z$1.ZodEnum<{
|
|
339
|
+
block: "block";
|
|
340
|
+
optional: "optional";
|
|
341
|
+
auto: "auto";
|
|
342
|
+
swap: "swap";
|
|
343
|
+
fallback: "fallback";
|
|
344
|
+
}>>;
|
|
345
|
+
category: z$1.ZodOptional<z$1.ZodString>;
|
|
346
|
+
description: z$1.ZodOptional<z$1.ZodString>;
|
|
347
|
+
tags: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
348
|
+
source: z$1.ZodLiteral<"local">;
|
|
349
|
+
files: z$1.ZodArray<z$1.ZodObject<{
|
|
350
|
+
path: z$1.ZodString;
|
|
351
|
+
format: z$1.ZodOptional<z$1.ZodEnum<{
|
|
352
|
+
woff2: "woff2";
|
|
353
|
+
woff: "woff";
|
|
354
|
+
truetype: "truetype";
|
|
355
|
+
opentype: "opentype";
|
|
356
|
+
svg: "svg";
|
|
357
|
+
}>>;
|
|
358
|
+
weight: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodNumber, z$1.ZodString]>>;
|
|
359
|
+
style: z$1.ZodOptional<z$1.ZodEnum<{
|
|
360
|
+
normal: "normal";
|
|
361
|
+
italic: "italic";
|
|
362
|
+
oblique: "oblique";
|
|
363
|
+
}>>;
|
|
364
|
+
unicodeRange: z$1.ZodOptional<z$1.ZodString>;
|
|
365
|
+
}, z$1.core.$strip>>;
|
|
366
|
+
}, z$1.core.$strip>], "source">;
|
|
367
|
+
type Font = z$1.infer<typeof fontSchema>;
|
|
368
|
+
declare const fontsSchema: z$1.ZodRecord<z$1.ZodString, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
369
|
+
name: z$1.ZodString;
|
|
370
|
+
title: z$1.ZodString;
|
|
371
|
+
family: z$1.ZodOptional<z$1.ZodString>;
|
|
372
|
+
role: z$1.ZodOptional<z$1.ZodEnum<{
|
|
373
|
+
sans: "sans";
|
|
374
|
+
serif: "serif";
|
|
375
|
+
mono: "mono";
|
|
376
|
+
display: "display";
|
|
377
|
+
heading: "heading";
|
|
378
|
+
body: "body";
|
|
379
|
+
code: "code";
|
|
380
|
+
}>>;
|
|
381
|
+
fallbacks: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
382
|
+
display: z$1.ZodOptional<z$1.ZodEnum<{
|
|
383
|
+
block: "block";
|
|
384
|
+
optional: "optional";
|
|
385
|
+
auto: "auto";
|
|
386
|
+
swap: "swap";
|
|
387
|
+
fallback: "fallback";
|
|
388
|
+
}>>;
|
|
389
|
+
category: z$1.ZodOptional<z$1.ZodString>;
|
|
390
|
+
description: z$1.ZodOptional<z$1.ZodString>;
|
|
391
|
+
tags: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
392
|
+
source: z$1.ZodLiteral<"google">;
|
|
393
|
+
weights: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodNumber, z$1.ZodString]>>>;
|
|
394
|
+
styles: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
|
|
395
|
+
normal: "normal";
|
|
396
|
+
italic: "italic";
|
|
397
|
+
}>>>;
|
|
398
|
+
subsets: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
399
|
+
variable: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
400
|
+
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
401
|
+
name: z$1.ZodString;
|
|
402
|
+
title: z$1.ZodString;
|
|
403
|
+
family: z$1.ZodOptional<z$1.ZodString>;
|
|
404
|
+
role: z$1.ZodOptional<z$1.ZodEnum<{
|
|
405
|
+
sans: "sans";
|
|
406
|
+
serif: "serif";
|
|
407
|
+
mono: "mono";
|
|
408
|
+
display: "display";
|
|
409
|
+
heading: "heading";
|
|
410
|
+
body: "body";
|
|
411
|
+
code: "code";
|
|
412
|
+
}>>;
|
|
413
|
+
fallbacks: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
414
|
+
display: z$1.ZodOptional<z$1.ZodEnum<{
|
|
415
|
+
block: "block";
|
|
416
|
+
optional: "optional";
|
|
417
|
+
auto: "auto";
|
|
418
|
+
swap: "swap";
|
|
419
|
+
fallback: "fallback";
|
|
420
|
+
}>>;
|
|
421
|
+
category: z$1.ZodOptional<z$1.ZodString>;
|
|
422
|
+
description: z$1.ZodOptional<z$1.ZodString>;
|
|
423
|
+
tags: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
424
|
+
source: z$1.ZodLiteral<"local">;
|
|
425
|
+
files: z$1.ZodArray<z$1.ZodObject<{
|
|
426
|
+
path: z$1.ZodString;
|
|
427
|
+
format: z$1.ZodOptional<z$1.ZodEnum<{
|
|
428
|
+
woff2: "woff2";
|
|
429
|
+
woff: "woff";
|
|
430
|
+
truetype: "truetype";
|
|
431
|
+
opentype: "opentype";
|
|
432
|
+
svg: "svg";
|
|
433
|
+
}>>;
|
|
434
|
+
weight: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodNumber, z$1.ZodString]>>;
|
|
435
|
+
style: z$1.ZodOptional<z$1.ZodEnum<{
|
|
436
|
+
normal: "normal";
|
|
437
|
+
italic: "italic";
|
|
438
|
+
oblique: "oblique";
|
|
439
|
+
}>>;
|
|
440
|
+
unicodeRange: z$1.ZodOptional<z$1.ZodString>;
|
|
441
|
+
}, z$1.core.$strip>>;
|
|
442
|
+
}, z$1.core.$strip>], "source">>;
|
|
443
|
+
type Fonts = z$1.infer<typeof fontsSchema>;
|
|
444
|
+
//#endregion
|
|
445
|
+
//#region src/schema/icons.d.ts
|
|
446
|
+
declare const iconFileSchema: z$1.ZodObject<{
|
|
447
|
+
path: z$1.ZodString;
|
|
448
|
+
type: z$1.ZodOptional<z$1.ZodEnum<{
|
|
449
|
+
file: "file";
|
|
450
|
+
svg: "svg";
|
|
451
|
+
png: "png";
|
|
452
|
+
webp: "webp";
|
|
453
|
+
jpg: "jpg";
|
|
454
|
+
jpeg: "jpeg";
|
|
455
|
+
gif: "gif";
|
|
456
|
+
ico: "ico";
|
|
457
|
+
}>>;
|
|
458
|
+
content: z$1.ZodOptional<z$1.ZodString>;
|
|
459
|
+
theme: z$1.ZodOptional<z$1.ZodString>;
|
|
460
|
+
target: z$1.ZodOptional<z$1.ZodString>;
|
|
461
|
+
}, z$1.core.$strip>;
|
|
462
|
+
type IconFile = z$1.infer<typeof iconFileSchema>;
|
|
463
|
+
declare const iconSchema: z$1.ZodObject<{
|
|
464
|
+
name: z$1.ZodString;
|
|
465
|
+
title: z$1.ZodString;
|
|
466
|
+
category: z$1.ZodOptional<z$1.ZodString>;
|
|
467
|
+
description: z$1.ZodOptional<z$1.ZodString>;
|
|
468
|
+
tags: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
469
|
+
aliases: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
470
|
+
related: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
471
|
+
since: z$1.ZodOptional<z$1.ZodString>;
|
|
472
|
+
version: z$1.ZodOptional<z$1.ZodString>;
|
|
473
|
+
repository: z$1.ZodOptional<z$1.ZodString>;
|
|
474
|
+
homepage: z$1.ZodOptional<z$1.ZodString>;
|
|
475
|
+
files: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
|
|
476
|
+
path: z$1.ZodString;
|
|
477
|
+
type: z$1.ZodOptional<z$1.ZodEnum<{
|
|
478
|
+
file: "file";
|
|
479
|
+
svg: "svg";
|
|
480
|
+
png: "png";
|
|
481
|
+
webp: "webp";
|
|
482
|
+
jpg: "jpg";
|
|
483
|
+
jpeg: "jpeg";
|
|
484
|
+
gif: "gif";
|
|
485
|
+
ico: "ico";
|
|
486
|
+
}>>;
|
|
487
|
+
content: z$1.ZodOptional<z$1.ZodString>;
|
|
488
|
+
theme: z$1.ZodOptional<z$1.ZodString>;
|
|
489
|
+
target: z$1.ZodOptional<z$1.ZodString>;
|
|
490
|
+
}, z$1.core.$strip>>>;
|
|
491
|
+
}, z$1.core.$strip>;
|
|
492
|
+
type Icon = z$1.infer<typeof iconSchema>;
|
|
493
|
+
declare const iconsSchema: z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{
|
|
494
|
+
name: z$1.ZodString;
|
|
495
|
+
title: z$1.ZodString;
|
|
496
|
+
category: z$1.ZodOptional<z$1.ZodString>;
|
|
497
|
+
description: z$1.ZodOptional<z$1.ZodString>;
|
|
498
|
+
tags: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
499
|
+
aliases: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
500
|
+
related: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
501
|
+
since: z$1.ZodOptional<z$1.ZodString>;
|
|
502
|
+
version: z$1.ZodOptional<z$1.ZodString>;
|
|
503
|
+
repository: z$1.ZodOptional<z$1.ZodString>;
|
|
504
|
+
homepage: z$1.ZodOptional<z$1.ZodString>;
|
|
505
|
+
files: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
|
|
506
|
+
path: z$1.ZodString;
|
|
507
|
+
type: z$1.ZodOptional<z$1.ZodEnum<{
|
|
508
|
+
file: "file";
|
|
509
|
+
svg: "svg";
|
|
510
|
+
png: "png";
|
|
511
|
+
webp: "webp";
|
|
512
|
+
jpg: "jpg";
|
|
513
|
+
jpeg: "jpeg";
|
|
514
|
+
gif: "gif";
|
|
515
|
+
ico: "ico";
|
|
516
|
+
}>>;
|
|
517
|
+
content: z$1.ZodOptional<z$1.ZodString>;
|
|
518
|
+
theme: z$1.ZodOptional<z$1.ZodString>;
|
|
519
|
+
target: z$1.ZodOptional<z$1.ZodString>;
|
|
520
|
+
}, z$1.core.$strip>>>;
|
|
521
|
+
}, z$1.core.$strip>>;
|
|
522
|
+
type Icons = z$1.infer<typeof iconsSchema>;
|
|
523
|
+
//#endregion
|
|
524
|
+
//#region src/schema/schema.d.ts
|
|
525
|
+
interface Schema {
|
|
526
|
+
name?: string;
|
|
527
|
+
title?: string;
|
|
528
|
+
repository?: string;
|
|
529
|
+
homepage?: string;
|
|
530
|
+
description?: string;
|
|
531
|
+
logo?: string;
|
|
532
|
+
/**
|
|
533
|
+
* Active theme id when generating a single theme from a multi-theme token
|
|
534
|
+
* record. Generators append this to titles and output file names.
|
|
535
|
+
*/
|
|
536
|
+
theme?: string;
|
|
537
|
+
components: Components;
|
|
538
|
+
icons: Icons;
|
|
539
|
+
fonts: Fonts;
|
|
540
|
+
tokens: Tokens | Record<string, Tokens>;
|
|
541
|
+
}
|
|
542
|
+
declare const schema: z.ZodType<Schema>;
|
|
543
|
+
//#endregion
|
|
544
|
+
export { componentSchema as A, googleFontSchema as C, ComponentUsage as D, ComponentFile as E, componentsSchema as M, Components as O, fontsSchema as S, Component as T, fontDisplaySchema as _, Icons as a, fontRoleSchema as b, iconsSchema as c, FontFile as d, FontFileFormat as f, LocalFont as g, GoogleFont as h, IconFile as i, componentUsageSchema as j, componentFileSchema as k, Font as l, Fonts as m, schema as n, iconFileSchema as o, FontRole as p, Icon as r, iconSchema as s, Schema as t, FontDisplay as u, fontFileFormatSchema as v, localFontSchema as w, fontSchema as x, fontFileSchema as y };
|
|
545
|
+
//# sourceMappingURL=schema-BwOBgJIM.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-BwOBgJIM.d.mts","names":[],"sources":["../src/schema/components.ts","../src/schema/fonts.ts","../src/schema/icons.ts","../src/schema/schema.ts"],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o as e}from"./fonts-B0ESWBBC.mjs";import t,{z as n}from"zod";import{tokenSchema as r,tokensSchema as i,tokensSchema as a}from"@power-plant/dtcg-schema";const o=n.object({path:n.string(),type:n.enum([`lib`,`block`,`component`,`ui`,`hook`,`theme`,`page`,`file`,`style`,`base`,`font`,`item`]).optional(),content:n.string().optional(),target:n.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.`)}),s=n.object({name:n.string().optional().describe(`Stable usage example id. Defaults to the source filename without extension.`),title:n.string().optional(),description:n.string().optional(),path:n.string(),content:n.string().optional(),language:n.enum([`tsx`,`jsx`,`ts`,`js`,`mdx`,`md`,`css`,`html`,`txt`]).optional().describe(`Source language for syntax highlighting. Inferred from the file extension when omitted.`)}),c=n.object({name:n.string(),title:n.string(),type:n.enum([`block`,`component`,`ui`,`page`]).default(`component`),category:n.string().optional(),description:n.string().optional(),tags:n.array(n.string()).optional(),related:n.array(n.string()).optional(),since:n.string().optional(),version:n.string().optional(),repository:n.string().optional(),homepage:n.string().optional(),dependencies:n.record(n.string(),n.string()).optional(),devDependencies:n.record(n.string(),n.string()).optional(),registryDependencies:n.record(n.string(),n.string()).optional(),files:n.array(o).optional(),usage:n.array(s).optional().describe("Example usage snippets for this component. Prefer a `usage/` directory of source files; entries may also be declared in metadata.")}),l=n.record(n.string(),c),u=n.object({path:n.string(),type:n.enum([`svg`,`png`,`webp`,`jpg`,`jpeg`,`gif`,`ico`,`file`]).optional(),content:n.string().optional(),theme:n.string().optional().describe(`Optional theme variant for this asset (for example light or dark).`),target:n.string().optional().describe(`The target path of the file in the project. Supports registry-style placeholders independent of the project's import prefix.`)}),d=n.object({name:n.string(),title:n.string(),category:n.string().optional(),description:n.string().optional(),tags:n.array(n.string()).optional(),aliases:n.array(n.string()).optional(),related:n.array(n.string()).optional(),since:n.string().optional(),version:n.string().optional(),repository:n.string().optional(),homepage:n.string().optional(),files:n.array(u).optional()}),f=n.record(n.string(),d),p=t.union([i,t.record(t.string(),i)]),m=t.object({name:t.string().optional(),title:t.string().optional(),repository:t.string().optional(),homepage:t.string().optional(),description:t.string().optional(),logo:t.string().optional(),theme:t.string().optional(),tokens:p,components:l,icons:f,fonts:e});export{d as a,c,u as i,s as l,a as n,f as o,m as r,o as s,r as t,l as u};
|
|
2
|
+
//# sourceMappingURL=schema-CXK5pVmJ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-CXK5pVmJ.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-BocRIvOZ.cjs"),t=require("./utils-DyK4l_bT.cjs");let n=require("node:path"),r=require("@stryke/fs/exists"),i=require("@stryke/fs/is-file"),a=require("@stryke/path/join"),o=require("@stryke/type-checks/is-set-string"),s=require("@stryke/type-checks/is-function"),c=require("@stryke/fs/resolve"),l=require("fast-glob");l=e.t(l,1);let u=require("style-dictionary");u=e.t(u,1);let d=require("style-dictionary/enums"),f=require("json5");f=e.t(f,1);let p=require("smol-toml"),ee=require("yaml");const m=[`razorwind-json`,`razorwind-yaml`,`razorwind-toml`,`razorwind-css`],h=[`json`,`json5`,`jsonc`,`yaml`,`yml`,`toml`,`css`,`js`,`mjs`,`cjs`,`ts`,`mts`,`cts`],te=h.join(`,`),g=[`tokens.json`,`tokens.json5`,`tokens.jsonc`,`tokens.yaml`,`tokens.yml`,`tokens.toml`,`tokens.css`,`design-tokens.json`,`design-tokens.yaml`,`design-tokens.yml`,`tokens`,`design-tokens`,`src/tokens`,`src/design-tokens`,`packages/tokens`,`style-dictionary.config.js`,`style-dictionary.config.mjs`,`style-dictionary.config.ts`,`sd.config.js`,`sd.config.mjs`,`sd.config.ts`],_=`**/*.{${te}}`,v=/^(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)([._-].+)?$/i,y={color:`color`,colours:`color`,colors:`color`,colour:`color`,palette:`color`,bg:`color`,background:`color`,foreground:`color`,fg:`color`,border:`color`,fill:`color`,stroke:`color`,spacing:`dimension`,space:`dimension`,size:`dimension`,sizes:`dimension`,sizing:`dimension`,gap:`dimension`,radius:`dimension`,radii:`dimension`,rounded:`dimension`,width:`dimension`,height:`dimension`,dimension:`dimension`,dimensions:`dimension`,duration:`duration`,durations:`duration`,time:`duration`,delay:`duration`,animation:`duration`,motion:`duration`,transition:`duration`,font:`fontFamily`,fonts:`fontFamily`,fontfamily:`fontFamily`,"font-family":`fontFamily`,typeface:`fontFamily`,fontweight:`fontWeight`,"font-weight":`fontWeight`,weight:`fontWeight`,opacity:`number`,opacities:`number`,zindex:`number`,"z-index":`number`,lineheight:`number`,"line-height":`number`,letterspacing:`dimension`,"letter-spacing":`dimension`,shadow:`shadow`,shadows:`shadow`,elevation:`shadow`,gradient:`gradient`,gradients:`gradient`,typography:`typography`,text:`typography`,cubicbezier:`cubicBezier`,easing:`cubicBezier`,ease:`cubicBezier`},ne=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,re=/^rgba?\(\s*([+\d.]+%?)[\x09-\x0D\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?: |(?: \s*)?,)\s*([+\d.]+%?)[\x09-\x0D\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?: |(?: \s*)?,)\s*([+\d.]+%?)(?:\s*[,/]\s*([+\d.]+%?))?\s*\)$/i,ie=/^hsla?\(\s*([+\d.]+)[\x09-\x0D\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?: |(?: \s*)?,)\s*([+\d.]+)%[\x09-\x0D\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?: |(?: \s*)?,)\s*([+\d.]+)%(?:\s*[,/]\s*([+\d.]+%?))?\s*\)$/i,ae=/^oklch\(\s*([+\d.]+%?|none)\s+([+\d.]+|none)\s+([+\d.]+|none)(?:\s*\/\s*([+\d.]+%?))?\s*\)$/i,b=/^([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(px|rem|em|%|vh|vw|vmin|vmax|ch|ex|cm|mm|in|pt|pc)$/i,oe=/^([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(ms|s)$/i,se=/^cubic-bezier\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*\)$/i,ce=/^var\(\s*(--[\w-]+)\s*(?:,\s*(?:\S.*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))?\)\s*$/i,le=/^\{[^{}]+\}$/,ue={thin:100,hairline:100,extralight:200,"extra-light":200,ultralight:200,light:300,normal:400,regular:400,book:400,medium:500,semibold:600,"semi-bold":600,demibold:600,bold:700,extrabold:800,"extra-bold":800,ultrabold:800,black:900,heavy:900},x=new Set([`px`,`rem`]);function S(e){return Math.min(1,Math.max(0,e))}function C(e,t=100){let n=e.trim();if(n.endsWith(`%`))return S(Number.parseFloat(n)/t);let r=Number.parseFloat(n);return S(r>1?r/255:r)}function de(e){let t=e.slice(1);return t.length===3||t.length===4?`#${[...t].map(e=>e+e).join(``)}`:(e.length===7||e.length,e)}function w(e){let t=de(e.toLowerCase()).slice(1),n=Number.parseInt(t.slice(0,2),16)/255,r=Number.parseInt(t.slice(2,4),16)/255,i=Number.parseInt(t.slice(4,6),16)/255,a=t.length===8?Number.parseInt(t.slice(6,8),16)/255:void 0;return{colorSpace:`srgb`,components:[n,r,i],...a===void 0||a===1?{}:{alpha:a},hex:`#${t.slice(0,6)}`}}function T(e){return`{${e.replace(/^--/,``).split(`-`).filter(Boolean).join(`.`)}}`}function E(e){for(let t=e.length-1;t>=0;t--){let n=e[t]?.toLowerCase();if(!n)continue;let r=y[n];if(r)return r}}function D(e,n=[]){let r=E(n);if(typeof e==`string`){let t=e.trim();if(le.test(t))return{value:t,type:r};let i=t.match(ce);if(i?.[1])return{value:T(i[1]),type:r};if(ne.test(t))return{value:w(t),type:`color`};let a=t.match(re);if(a){let e=[C(a[1]),C(a[2]),C(a[3])],t=a[4]?a[4].endsWith(`%`)?S(Number.parseFloat(a[4])/100):S(Number.parseFloat(a[4])):void 0;return{value:{colorSpace:`srgb`,components:e,...t===void 0||Number.isNaN(t)?{}:{alpha:t}},type:`color`}}let o=t.match(ie);if(o)return{value:{colorSpace:`hsl`,components:[Number.parseFloat(o[1]),Number.parseFloat(o[2]),Number.parseFloat(o[3])],...o[4]?{alpha:o[4].endsWith(`%`)?S(Number.parseFloat(o[4])/100):S(Number.parseFloat(o[4]))}:{}},type:`color`};let s=t.match(ae);if(s){let e=e=>e===`none`?`none`:e.endsWith(`%`)?Number.parseFloat(e)/100:Number.parseFloat(e);return{value:{colorSpace:`oklch`,components:[e(s[1]),e(s[2]),e(s[3])],...s[4]?{alpha:s[4].endsWith(`%`)?S(Number.parseFloat(s[4])/100):S(Number.parseFloat(s[4]))}:{}},type:`color`}}let c=t.match(b);if(c){let e=c[2].toLowerCase(),n=Number.parseFloat(c[1]);return x.has(e)?{value:{value:n,unit:e},type:`dimension`}:{value:t,type:r===`dimension`?void 0:r}}let l=t.match(oe);if(l)return{value:{value:Number.parseFloat(l[1]),unit:l[2].toLowerCase()},type:`duration`};let u=t.match(se);if(u)return{value:[Number.parseFloat(u[1]),Number.parseFloat(u[2]),Number.parseFloat(u[3]),Number.parseFloat(u[4])],type:`cubicBezier`};let d=ue[t.toLowerCase()];return d===void 0?r===`fontFamily`||/family|font|typeface/i.test(n.at(-1)??``)?t.includes(`,`)?{value:t.split(`,`).map(e=>e.trim().replace(/^["']|["']$/g,``)),type:`fontFamily`}:{value:t.replace(/^["']|["']$/g,``),type:`fontFamily`}:r===`color`&&!t.startsWith(`{`)?{value:t,type:void 0}:{value:t,type:r}:{value:d,type:`fontWeight`}}if(typeof e==`number`)return r===`fontWeight`?{value:e,type:`fontWeight`}:r===`duration`?{value:{value:e,unit:`ms`},type:`duration`}:r===`dimension`?{value:{value:e,unit:`px`},type:`dimension`}:{value:e,type:r??`number`};if(Array.isArray(e))return e.length===4&&e.every(e=>typeof e==`number`)&&(r===`cubicBezier`||n.some(e=>/ease|bezier/i.test(e)))?{value:e,type:`cubicBezier`}:e.every(e=>typeof e==`string`)?{value:e,type:r??`fontFamily`}:{value:e,type:r};if(t.n(e)){if(`colorSpace`in e&&`components`in e)return{value:e,type:`color`};if(`value`in e&&`unit`in e){let t=String(e.unit).toLowerCase();return t===`ms`||t===`s`?{value:e,type:`duration`}:x.has(t)?{value:e,type:`dimension`}:{value:e,type:r}}}return{value:e,type:r}}function fe(e,t){let n={...e};if(`value`in n&&!(`$value`in n)&&(n.$value=n.value,delete n.value),`type`in n&&!(`$type`in n)&&(n.$type=n.type,delete n.type),`comment`in n&&!(`$description`in n)&&(n.$description=n.comment,delete n.comment),`description`in n&&!(`$description`in n)&&(n.$description=n.description,delete n.description),`ref`in n&&!(`$ref`in n)&&(n.$ref=n.ref,delete n.ref),`$value`in n){let e=D(n.$value,t);n.$value=e.value,!(`$type`in n)&&e.type&&(n.$type=e.type)}return n}function O(e,n=[]){if(Array.isArray(e))return e.map((e,t)=>O(e,[...n,String(t)]));if(!t.n(e))return e;if(t.m(e))return fe(e,n);let r={};for(let[t,i]of Object.entries(e)){if(t.startsWith(`$`)){r[t]=i;continue}r[t]=O(i,[...n,t])}if(!(`$type`in r)){let e=E(n);e&&n.length>0&&(r.$type=e)}return r}function k(e){let n={};for(let[r,i]of Object.entries(e)){let e=r.replace(/^--/,``).split(/[-./]/).filter(Boolean);if(e.length===0)continue;let a=n;for(let n=0;n<e.length-1;n++){let r=e[n],i=a[r];t.n(i)?t.m(i)&&(a[r]={DEFAULT:i}):a[r]={},a=a[r]}let o=e.at(-1),s=D(i,e),c={$value:s.value,...s.type?{$type:s.type}:{}},l=a[o];t.n(l)&&!t.m(l)?l.DEFAULT=c:a[o]=c}return O(n)}const pe=/(--[A-Z_][\w-]*)\s*:\s*([^;}{]+?)(?=\s*(?:;|\}|$))/gi;function A(e){let t={},n=e.split(` `).join(` `).replace(/\s*\{\s*/g,` {
|
|
2
|
+
`).replace(/;\s*/g,`;
|
|
3
|
+
`).replace(/,\s*/g,`, `).replace(/ *\}\s*/g,`}
|
|
4
|
+
`).replace(/\}\s*(.+)/g,`}
|
|
5
|
+
$1`).replace(/\n {4}([^:]+):\s*/g,`
|
|
6
|
+
$1: `).replace(/([a-z0-9-)])\}/gi,`$1;
|
|
7
|
+
}`).replace(/\/\*[\s\S]*?\*\//g,``);for(let e of n.matchAll(pe)){let n=e[1],r=e[2]?.trim();!n||!r||(t[n]=r)}return k(t)}function j(e){return e?{verbosity:d.logVerbosityLevels.verbose}:{}}const M=`razorwind-infer`;function N(e){if(e==null)return{};if(typeof e!=`object`||Array.isArray(e))throw TypeError(`Token file must parse to a plain object.`);return O(e)}function P(e){try{return N(f.default.parse(e))}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to parse JSON token file: ${t}`)}}function F(e){try{return N((0,ee.parse)(e))}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to parse YAML token file: ${t}`)}}function I(e){try{return N((0,p.parse)(e))}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to parse TOML token file: ${t}`)}}const L=[{name:`razorwind-json`,pattern:/\.json[c5]?$/i,parser:({contents:e})=>P(e)},{name:`razorwind-yaml`,pattern:/\.ya?ml$/i,parser:({contents:e})=>F(e)},{name:`razorwind-toml`,pattern:/\.toml$/i,parser:({contents:e})=>I(e)},{name:`razorwind-css`,pattern:/\.css$/i,parser:({contents:e})=>O(A(e))}];function R(){return Object.fromEntries(L.map(({name:e,pattern:t,parser:n})=>[e,{pattern:t,parser:n}]))}function z(e){return O(e)}function B(){return{[M]:z}}function V(e=[]){let t={...R()},n={...B()},r=[...m],i=[M],a=0,o=0;for(let c of e){for(let e of c.parsers??[]){let n=e.name??`${c.name}-parser-${a}`;t[n]={pattern:e.pattern,parser:({contents:t})=>e.parser(t)},r.push(n),a++}for(let e of c.preprocessors??[]){let t=(0,s.isFunction)(e)?{name:`${c.name}-preprocessor-${o}`,preprocessor:e}:{name:e.name??`${c.name}-preprocessor-${o}`,preprocessor:e.preprocessor};n[t.name]=t.preprocessor,i.push(t.name),o++}}return{parsers:t,preprocessors:n,parserNames:r,preprocessorNames:i}}function H(e=[],t=u.default){let n=V(e);if(typeof t.registerParser==`function`)for(let[e,r]of Object.entries(n.parsers))t.registerParser({name:e,...r});if(typeof t.registerPreprocessor==`function`)for(let[e,r]of Object.entries(n.preprocessors))t.registerPreprocessor({name:e,preprocessor:r});return n}const me=H;function U(e,t){return(0,n.isAbsolute)(t)?t:(0,n.resolve)(e,t)}function W(e){return/\.([^.]+)$/.exec(e)?.[1]?.toLowerCase()??``}function G(e){return h.includes(W(e))}function K(e){let t=e.split(/[/\\]/).pop()?.toLowerCase()??``;return t.startsWith(`style-dictionary.config.`)||t.startsWith(`sd.config.`)}function q(e){return(0,a.joinPaths)(e,_)}function he(e){return Array.isArray(e)?e.filter(o.isSetString):(0,o.isSetString)(e)?[e]:[]}const ge=/[*?[\]{}]/;function _e(e){return ge.test(e)}function ve(e){let t=e.search(/[*?[{]/);if(t<=0)return;let n=e.slice(0,t).replace(/[/\\]+$/,``);return n.length>0?n:void 0}function ye(e,t){let n=U(e,t);if(_e(t)){let e=ve(n);if(e&&!(0,r.existsSync)(e))throw Error(`tokensPath "${t}" does not exist (resolved: ${n}).`);return{resolvedPath:n,source:[n],isStyleDictionaryConfig:!1}}if(!(0,r.existsSync)(n))throw Error(`tokensPath "${t}" does not exist (resolved: ${n}).`);return(0,i.isDirectory)(n)?{resolvedPath:n,source:[q(n)],isStyleDictionaryConfig:!1}:K(n)?{resolvedPath:n,source:[],isStyleDictionaryConfig:!0}:{resolvedPath:n,source:[n],isStyleDictionaryConfig:!1}}function J(e){let{cwd:t,tokensPath:n,fallbackPaths:a=[]}=e,o=he(n);if(o.length>0){let e=o.map(e=>ye(t,e)),n=e.filter(e=>e.isStyleDictionaryConfig);if(n.length>0){if(e.length>1)throw Error(`tokensPath cannot mix Style Dictionary config files with other token sources.`);return{resolvedPath:n[0].resolvedPath,source:[],origin:`tokensPath`}}return{resolvedPath:e[0]?.resolvedPath,source:e.flatMap(e=>e.source),origin:`tokensPath`}}for(let e of g){let n=U(t,e);if((0,r.existsSync)(n)){if((0,i.isDirectory)(n))return{resolvedPath:n,source:[q(n)],origin:`default`};if(K(n))return{resolvedPath:n,source:[],origin:`default`};if(G(n))return{resolvedPath:n,source:[n],origin:`default`}}}for(let e of a){if(!e)continue;let n=U(t,e);if(!(!(0,r.existsSync)(n)||(0,i.isDirectory)(n))&&(G(n)||W(n)===`css`))return{resolvedPath:n,source:[n],origin:`fallback`}}return{source:[],origin:`none`}}function Y(e){return(e.split(/[/\\]/).pop()??``).replace(/\.[^.]+$/,``).match(v)?.[1]?.toLowerCase()}function be(e){let t=e,n=new Set;for(;t!=null&&!n.has(t);){if(n.add(t),typeof t==`function`)return t;if(typeof t==`object`&&`default`in t){t=t.default;continue}break}throw TypeError(`style-dictionary did not export a constructable StyleDictionary class.`)}const xe=be(u.default);function X(e){return!e||typeof e!=`object`||Object.keys(e).length===0}async function Se(e){let t=await(0,c.importModule)(e);return t&&typeof t==`object`&&`default`in t&&t.default?t.default:t}async function Z(e,t){let n=V(e.plugins),r=new xe({...t,parsers:[...n.parserNames,...t.parsers??[]],preprocessors:[...n.preprocessorNames,...t.preprocessors??[]],hooks:{...t.hooks,parsers:{...n.parsers,...t.hooks?.parsers},preprocessors:{...n.preprocessors,...t.hooks?.preprocessors}},usesDtcg:t.usesDtcg??!0,platforms:t.platforms??{}},j(e.verbose));return await r.hasInitialized,r}async function Q(e,t){return t.length===0?{}:(await Z(e,{source:t})).tokens}async function Ce(e){return(await(0,l.default)(e,{absolute:!0,onlyFiles:!0,unique:!0})).sort()}async function we(e,t){let n=await Ce(t);if(n.length===0)return{};let r=new Map,i=[];for(let e of n){let t=Y(e);if(t){let n=r.get(t)??[];n.push(e),r.set(t,n)}else i.push(e)}if(r.size<2)return Q(e,t);let a={};if(i.length>0){let t=await Q(e,i);X(t)||(a.base=t)}for(let[t,n]of r)a[t]=await Q(e,[...i,...n]);return a}async function $(e){let t=J(e.options);return t.resolvedPath&&(0,r.existsSync)(t.resolvedPath)&&/(?:^|[/\\])(?:style-dictionary|sd)\.config\./i.test((0,n.basename)(t.resolvedPath))?(e.sd=await Z(e.options,await Se(t.resolvedPath)),e.sd.tokens):t.source.length===0?{}:e.options.splitThemes?we(e.options,t.source):Q(e.options,t.source)}async function Te(e){let t=await $(e);if(X(t)){let{tokensPath:t}=e.options,n=Array.isArray(t)?t.length>0?`tokensPath=[${t.map(e=>`"${e}"`).join(`, `)}]`:`default token paths / CSS fallbacks`:(0,o.isSetString)(t)?`tokensPath="${t}"`:`default token paths / CSS fallbacks`;throw Error(`No design tokens found via ${n}. Provide tokensPath or add a tokens file.`)}return t}Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return me}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return g}});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{m as e,n as t}from"./utils-CDYdsyyW.mjs";import{basename as n,isAbsolute as r,resolve as i}from"node:path";import{existsSync as a}from"@stryke/fs/exists";import{isDirectory as o}from"@stryke/fs/is-file";import{joinPaths as s}from"@stryke/path/join";import{isSetString as c}from"@stryke/type-checks/is-set-string";import{isFunction as l}from"@stryke/type-checks/is-function";import{importModule as u}from"@stryke/fs/resolve";import d from"fast-glob";import f from"style-dictionary";import{logVerbosityLevels as ee}from"style-dictionary/enums";import te from"json5";import{parse as ne}from"smol-toml";import{parse as re}from"yaml";const p=[`razorwind-json`,`razorwind-yaml`,`razorwind-toml`,`razorwind-css`],m=[`json`,`json5`,`jsonc`,`yaml`,`yml`,`toml`,`css`,`js`,`mjs`,`cjs`,`ts`,`mts`,`cts`],h=m.join(`,`),g=[`tokens.json`,`tokens.json5`,`tokens.jsonc`,`tokens.yaml`,`tokens.yml`,`tokens.toml`,`tokens.css`,`design-tokens.json`,`design-tokens.yaml`,`design-tokens.yml`,`tokens`,`design-tokens`,`src/tokens`,`src/design-tokens`,`packages/tokens`,`style-dictionary.config.js`,`style-dictionary.config.mjs`,`style-dictionary.config.ts`,`sd.config.js`,`sd.config.mjs`,`sd.config.ts`],_=`**/*.{${h}}`,v=/^(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)([._-].+)?$/i,y={color:`color`,colours:`color`,colors:`color`,colour:`color`,palette:`color`,bg:`color`,background:`color`,foreground:`color`,fg:`color`,border:`color`,fill:`color`,stroke:`color`,spacing:`dimension`,space:`dimension`,size:`dimension`,sizes:`dimension`,sizing:`dimension`,gap:`dimension`,radius:`dimension`,radii:`dimension`,rounded:`dimension`,width:`dimension`,height:`dimension`,dimension:`dimension`,dimensions:`dimension`,duration:`duration`,durations:`duration`,time:`duration`,delay:`duration`,animation:`duration`,motion:`duration`,transition:`duration`,font:`fontFamily`,fonts:`fontFamily`,fontfamily:`fontFamily`,"font-family":`fontFamily`,typeface:`fontFamily`,fontweight:`fontWeight`,"font-weight":`fontWeight`,weight:`fontWeight`,opacity:`number`,opacities:`number`,zindex:`number`,"z-index":`number`,lineheight:`number`,"line-height":`number`,letterspacing:`dimension`,"letter-spacing":`dimension`,shadow:`shadow`,shadows:`shadow`,elevation:`shadow`,gradient:`gradient`,gradients:`gradient`,typography:`typography`,text:`typography`,cubicbezier:`cubicBezier`,easing:`cubicBezier`,ease:`cubicBezier`},ie=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,ae=/^rgba?\(\s*([+\d.]+%?)[\x09-\x0D\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?: |(?: \s*)?,)\s*([+\d.]+%?)[\x09-\x0D\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?: |(?: \s*)?,)\s*([+\d.]+%?)(?:\s*[,/]\s*([+\d.]+%?))?\s*\)$/i,oe=/^hsla?\(\s*([+\d.]+)[\x09-\x0D\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?: |(?: \s*)?,)\s*([+\d.]+)%[\x09-\x0D\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?: |(?: \s*)?,)\s*([+\d.]+)%(?:\s*[,/]\s*([+\d.]+%?))?\s*\)$/i,se=/^oklch\(\s*([+\d.]+%?|none)\s+([+\d.]+|none)\s+([+\d.]+|none)(?:\s*\/\s*([+\d.]+%?))?\s*\)$/i,ce=/^([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(px|rem|em|%|vh|vw|vmin|vmax|ch|ex|cm|mm|in|pt|pc)$/i,le=/^([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(ms|s)$/i,ue=/^cubic-bezier\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*\)$/i,de=/^var\(\s*(--[\w-]+)\s*(?:,\s*(?:\S.*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))?\)\s*$/i,b=/^\{[^{}]+\}$/,x={thin:100,hairline:100,extralight:200,"extra-light":200,ultralight:200,light:300,normal:400,regular:400,book:400,medium:500,semibold:600,"semi-bold":600,demibold:600,bold:700,extrabold:800,"extra-bold":800,ultrabold:800,black:900,heavy:900},S=new Set([`px`,`rem`]);function C(e){return Math.min(1,Math.max(0,e))}function w(e,t=100){let n=e.trim();if(n.endsWith(`%`))return C(Number.parseFloat(n)/t);let r=Number.parseFloat(n);return C(r>1?r/255:r)}function fe(e){let t=e.slice(1);return t.length===3||t.length===4?`#${[...t].map(e=>e+e).join(``)}`:(e.length===7||e.length,e)}function pe(e){let t=fe(e.toLowerCase()).slice(1),n=Number.parseInt(t.slice(0,2),16)/255,r=Number.parseInt(t.slice(2,4),16)/255,i=Number.parseInt(t.slice(4,6),16)/255,a=t.length===8?Number.parseInt(t.slice(6,8),16)/255:void 0;return{colorSpace:`srgb`,components:[n,r,i],...a===void 0||a===1?{}:{alpha:a},hex:`#${t.slice(0,6)}`}}function me(e){return`{${e.replace(/^--/,``).split(`-`).filter(Boolean).join(`.`)}}`}function T(e){for(let t=e.length-1;t>=0;t--){let n=e[t]?.toLowerCase();if(!n)continue;let r=y[n];if(r)return r}}function E(e,n=[]){let r=T(n);if(typeof e==`string`){let t=e.trim();if(b.test(t))return{value:t,type:r};let i=t.match(de);if(i?.[1])return{value:me(i[1]),type:r};if(ie.test(t))return{value:pe(t),type:`color`};let a=t.match(ae);if(a){let e=[w(a[1]),w(a[2]),w(a[3])],t=a[4]?a[4].endsWith(`%`)?C(Number.parseFloat(a[4])/100):C(Number.parseFloat(a[4])):void 0;return{value:{colorSpace:`srgb`,components:e,...t===void 0||Number.isNaN(t)?{}:{alpha:t}},type:`color`}}let o=t.match(oe);if(o)return{value:{colorSpace:`hsl`,components:[Number.parseFloat(o[1]),Number.parseFloat(o[2]),Number.parseFloat(o[3])],...o[4]?{alpha:o[4].endsWith(`%`)?C(Number.parseFloat(o[4])/100):C(Number.parseFloat(o[4]))}:{}},type:`color`};let s=t.match(se);if(s){let e=e=>e===`none`?`none`:e.endsWith(`%`)?Number.parseFloat(e)/100:Number.parseFloat(e);return{value:{colorSpace:`oklch`,components:[e(s[1]),e(s[2]),e(s[3])],...s[4]?{alpha:s[4].endsWith(`%`)?C(Number.parseFloat(s[4])/100):C(Number.parseFloat(s[4]))}:{}},type:`color`}}let c=t.match(ce);if(c){let e=c[2].toLowerCase(),n=Number.parseFloat(c[1]);return S.has(e)?{value:{value:n,unit:e},type:`dimension`}:{value:t,type:r===`dimension`?void 0:r}}let l=t.match(le);if(l)return{value:{value:Number.parseFloat(l[1]),unit:l[2].toLowerCase()},type:`duration`};let u=t.match(ue);if(u)return{value:[Number.parseFloat(u[1]),Number.parseFloat(u[2]),Number.parseFloat(u[3]),Number.parseFloat(u[4])],type:`cubicBezier`};let d=x[t.toLowerCase()];return d===void 0?r===`fontFamily`||/family|font|typeface/i.test(n.at(-1)??``)?t.includes(`,`)?{value:t.split(`,`).map(e=>e.trim().replace(/^["']|["']$/g,``)),type:`fontFamily`}:{value:t.replace(/^["']|["']$/g,``),type:`fontFamily`}:r===`color`&&!t.startsWith(`{`)?{value:t,type:void 0}:{value:t,type:r}:{value:d,type:`fontWeight`}}if(typeof e==`number`)return r===`fontWeight`?{value:e,type:`fontWeight`}:r===`duration`?{value:{value:e,unit:`ms`},type:`duration`}:r===`dimension`?{value:{value:e,unit:`px`},type:`dimension`}:{value:e,type:r??`number`};if(Array.isArray(e))return e.length===4&&e.every(e=>typeof e==`number`)&&(r===`cubicBezier`||n.some(e=>/ease|bezier/i.test(e)))?{value:e,type:`cubicBezier`}:e.every(e=>typeof e==`string`)?{value:e,type:r??`fontFamily`}:{value:e,type:r};if(t(e)){if(`colorSpace`in e&&`components`in e)return{value:e,type:`color`};if(`value`in e&&`unit`in e){let t=String(e.unit).toLowerCase();return t===`ms`||t===`s`?{value:e,type:`duration`}:S.has(t)?{value:e,type:`dimension`}:{value:e,type:r}}}return{value:e,type:r}}function he(e,t){let n={...e};if(`value`in n&&!(`$value`in n)&&(n.$value=n.value,delete n.value),`type`in n&&!(`$type`in n)&&(n.$type=n.type,delete n.type),`comment`in n&&!(`$description`in n)&&(n.$description=n.comment,delete n.comment),`description`in n&&!(`$description`in n)&&(n.$description=n.description,delete n.description),`ref`in n&&!(`$ref`in n)&&(n.$ref=n.ref,delete n.ref),`$value`in n){let e=E(n.$value,t);n.$value=e.value,!(`$type`in n)&&e.type&&(n.$type=e.type)}return n}function D(n,r=[]){if(Array.isArray(n))return n.map((e,t)=>D(e,[...r,String(t)]));if(!t(n))return n;if(e(n))return he(n,r);let i={};for(let[e,t]of Object.entries(n)){if(e.startsWith(`$`)){i[e]=t;continue}i[e]=D(t,[...r,e])}if(!(`$type`in i)){let e=T(r);e&&r.length>0&&(i.$type=e)}return i}function O(n){let r={};for(let[i,a]of Object.entries(n)){let n=i.replace(/^--/,``).split(/[-./]/).filter(Boolean);if(n.length===0)continue;let o=r;for(let r=0;r<n.length-1;r++){let i=n[r],a=o[i];t(a)?e(a)&&(o[i]={DEFAULT:a}):o[i]={},o=o[i]}let s=n.at(-1),c=E(a,n),l={$value:c.value,...c.type?{$type:c.type}:{}},u=o[s];t(u)&&!e(u)?u.DEFAULT=l:o[s]=l}return D(r)}const ge=/(--[A-Z_][\w-]*)\s*:\s*([^;}{]+?)(?=\s*(?:;|\}|$))/gi;function k(e){let t={},n=e.split(` `).join(` `).replace(/\s*\{\s*/g,` {
|
|
2
|
+
`).replace(/;\s*/g,`;
|
|
3
|
+
`).replace(/,\s*/g,`, `).replace(/ *\}\s*/g,`}
|
|
4
|
+
`).replace(/\}\s*(.+)/g,`}
|
|
5
|
+
$1`).replace(/\n {4}([^:]+):\s*/g,`
|
|
6
|
+
$1: `).replace(/([a-z0-9-)])\}/gi,`$1;
|
|
7
|
+
}`).replace(/\/\*[\s\S]*?\*\//g,``);for(let e of n.matchAll(ge)){let n=e[1],r=e[2]?.trim();!n||!r||(t[n]=r)}return O(t)}function A(e){return e?{verbosity:ee.verbose}:{}}const j=`razorwind-infer`;function M(e){if(e==null)return{};if(typeof e!=`object`||Array.isArray(e))throw TypeError(`Token file must parse to a plain object.`);return D(e)}function N(e){try{return M(te.parse(e))}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to parse JSON token file: ${t}`)}}function P(e){try{return M(re(e))}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to parse YAML token file: ${t}`)}}function F(e){try{return M(ne(e))}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to parse TOML token file: ${t}`)}}const I=[{name:`razorwind-json`,pattern:/\.json[c5]?$/i,parser:({contents:e})=>N(e)},{name:`razorwind-yaml`,pattern:/\.ya?ml$/i,parser:({contents:e})=>P(e)},{name:`razorwind-toml`,pattern:/\.toml$/i,parser:({contents:e})=>F(e)},{name:`razorwind-css`,pattern:/\.css$/i,parser:({contents:e})=>D(k(e))}];function L(){return Object.fromEntries(I.map(({name:e,pattern:t,parser:n})=>[e,{pattern:t,parser:n}]))}function R(e){return D(e)}function z(){return{[j]:R}}function B(e=[]){let t={...L()},n={...z()},r=[...p],i=[j],a=0,o=0;for(let s of e){for(let e of s.parsers??[]){let n=e.name??`${s.name}-parser-${a}`;t[n]={pattern:e.pattern,parser:({contents:t})=>e.parser(t)},r.push(n),a++}for(let e of s.preprocessors??[]){let t=l(e)?{name:`${s.name}-preprocessor-${o}`,preprocessor:e}:{name:e.name??`${s.name}-preprocessor-${o}`,preprocessor:e.preprocessor};n[t.name]=t.preprocessor,i.push(t.name),o++}}return{parsers:t,preprocessors:n,parserNames:r,preprocessorNames:i}}function V(e=[],t=f){let n=B(e);if(typeof t.registerParser==`function`)for(let[e,r]of Object.entries(n.parsers))t.registerParser({name:e,...r});if(typeof t.registerPreprocessor==`function`)for(let[e,r]of Object.entries(n.preprocessors))t.registerPreprocessor({name:e,preprocessor:r});return n}const _e=V;function H(e,t){return r(t)?t:i(e,t)}function U(e){return/\.([^.]+)$/.exec(e)?.[1]?.toLowerCase()??``}function W(e){return m.includes(U(e))}function G(e){let t=e.split(/[/\\]/).pop()?.toLowerCase()??``;return t.startsWith(`style-dictionary.config.`)||t.startsWith(`sd.config.`)}function K(e){return s(e,_)}function ve(e){return Array.isArray(e)?e.filter(c):c(e)?[e]:[]}const ye=/[*?[\]{}]/;function be(e){return ye.test(e)}function xe(e){let t=e.search(/[*?[{]/);if(t<=0)return;let n=e.slice(0,t).replace(/[/\\]+$/,``);return n.length>0?n:void 0}function Se(e,t){let n=H(e,t);if(be(t)){let e=xe(n);if(e&&!a(e))throw Error(`tokensPath "${t}" does not exist (resolved: ${n}).`);return{resolvedPath:n,source:[n],isStyleDictionaryConfig:!1}}if(!a(n))throw Error(`tokensPath "${t}" does not exist (resolved: ${n}).`);return o(n)?{resolvedPath:n,source:[K(n)],isStyleDictionaryConfig:!1}:G(n)?{resolvedPath:n,source:[],isStyleDictionaryConfig:!0}:{resolvedPath:n,source:[n],isStyleDictionaryConfig:!1}}function q(e){let{cwd:t,tokensPath:n,fallbackPaths:r=[]}=e,i=ve(n);if(i.length>0){let e=i.map(e=>Se(t,e)),n=e.filter(e=>e.isStyleDictionaryConfig);if(n.length>0){if(e.length>1)throw Error(`tokensPath cannot mix Style Dictionary config files with other token sources.`);return{resolvedPath:n[0].resolvedPath,source:[],origin:`tokensPath`}}return{resolvedPath:e[0]?.resolvedPath,source:e.flatMap(e=>e.source),origin:`tokensPath`}}for(let e of g){let n=H(t,e);if(a(n)){if(o(n))return{resolvedPath:n,source:[K(n)],origin:`default`};if(G(n))return{resolvedPath:n,source:[],origin:`default`};if(W(n))return{resolvedPath:n,source:[n],origin:`default`}}}for(let e of r){if(!e)continue;let n=H(t,e);if(!(!a(n)||o(n))&&(W(n)||U(n)===`css`))return{resolvedPath:n,source:[n],origin:`fallback`}}return{source:[],origin:`none`}}function J(e){return(e.split(/[/\\]/).pop()??``).replace(/\.[^.]+$/,``).match(v)?.[1]?.toLowerCase()}function Ce(e){let t=e,n=new Set;for(;t!=null&&!n.has(t);){if(n.add(t),typeof t==`function`)return t;if(typeof t==`object`&&`default`in t){t=t.default;continue}break}throw TypeError(`style-dictionary did not export a constructable StyleDictionary class.`)}const we=Ce(f);function Y(e){return!e||typeof e!=`object`||Object.keys(e).length===0}async function Te(e){let t=await u(e);return t&&typeof t==`object`&&`default`in t&&t.default?t.default:t}async function X(e,t){let n=B(e.plugins),r=new we({...t,parsers:[...n.parserNames,...t.parsers??[]],preprocessors:[...n.preprocessorNames,...t.preprocessors??[]],hooks:{...t.hooks,parsers:{...n.parsers,...t.hooks?.parsers},preprocessors:{...n.preprocessors,...t.hooks?.preprocessors}},usesDtcg:t.usesDtcg??!0,platforms:t.platforms??{}},A(e.verbose));return await r.hasInitialized,r}async function Z(e,t){return t.length===0?{}:(await X(e,{source:t})).tokens}async function Q(e){return(await d(e,{absolute:!0,onlyFiles:!0,unique:!0})).sort()}async function Ee(e,t){let n=await Q(t);if(n.length===0)return{};let r=new Map,i=[];for(let e of n){let t=J(e);if(t){let n=r.get(t)??[];n.push(e),r.set(t,n)}else i.push(e)}if(r.size<2)return Z(e,t);let a={};if(i.length>0){let t=await Z(e,i);Y(t)||(a.base=t)}for(let[t,n]of r)a[t]=await Z(e,[...i,...n]);return a}async function $(e){let t=q(e.options);return t.resolvedPath&&a(t.resolvedPath)&&/(?:^|[/\\])(?:style-dictionary|sd)\.config\./i.test(n(t.resolvedPath))?(e.sd=await X(e.options,await Te(t.resolvedPath)),e.sd.tokens):t.source.length===0?{}:e.options.splitThemes?Ee(e.options,t.source):Z(e.options,t.source)}async function De(e){let t=await $(e);if(Y(t)){let{tokensPath:t}=e.options,n=Array.isArray(t)?t.length>0?`tokensPath=[${t.map(e=>`"${e}"`).join(`, `)}]`:`default token paths / CSS fallbacks`:c(t)?`tokensPath="${t}"`:`default token paths / CSS fallbacks`;throw Error(`No design tokens found via ${n}. Provide tokensPath or add a tokens file.`)}return t}export{p as C,m as S,O as _,J as a,v as b,L as c,V as d,_e as f,E as g,T as h,q as i,z as l,k as m,$ as n,j as o,A as p,De as r,B as s,Y as t,R as u,D as v,y as w,_ as x,g as y};
|
|
8
|
+
//# sourceMappingURL=tokens-DFYNBFFR.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens-DFYNBFFR.mjs","names":[],"sources":[],"mappings":""}
|
package/dist/utils/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../utils-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../utils-DyK4l_bT.cjs");exports.TOKEN_SET_THEME_PATTERN=e.f,exports.appendThemeToFilePath=e.o,exports.applyThemeToDocuments=e.s,exports.applyThemeToTitle=e.c,exports.createDocument=e.t,exports.flattenTokens=e.p,exports.formatColorValue=e.g,exports.formatDimensionValue=e._,exports.formatTokenValue=e.v,exports.isObject=e.n,exports.isTokenLeaf=e.m,exports.mergeTokenTrees=e.d,exports.resolveSchemaIdentity=e.a,exports.resolveTokenSets=e.h,exports.slugifyThemeName=e.u,exports.themeDisplayName=e.i,exports.titleCase=e.l,exports.toCssVar=e.r;
|