@asafarim/design-tokens 0.3.1 → 0.3.4
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/css → css}/tokens.dark.css +1 -1
- package/{dist/css → css}/tokens.high-contrast.css +1 -1
- package/{dist/css → css}/tokens.light.css +1 -1
- package/package.json +9 -34
- package/dist/build/index.cjs +0 -166
- package/dist/build/index.cjs.map +0 -1
- package/dist/build/index.d.cts +0 -30
- package/dist/build/index.d.ts +0 -30
- package/dist/build/index.js +0 -135
- package/dist/build/index.js.map +0 -1
- package/dist/index.cjs +0 -1042
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -1118
- package/dist/index.d.ts +0 -1118
- package/dist/index.js +0 -1015
- package/dist/index.js.map +0 -1
- /package/{dist/css → css}/index.css +0 -0
- /package/{dist/css → css}/tokens.base.css +0 -0
- /package/{dist/css → css}/tokens.density.comfortable.css +0 -0
- /package/{dist/css → css}/tokens.density.compact.css +0 -0
- /package/{dist/css → css}/tokens.rtl.css +0 -0
- /package/{dist/css → css}/tokens.utilities.css +0 -0
package/dist/index.js
DELETED
|
@@ -1,1015 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __export = (target, all) => {
|
|
3
|
-
for (var name in all)
|
|
4
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
// src/tokens/color/brand.ts
|
|
8
|
-
var brand = {
|
|
9
|
-
primary50: {
|
|
10
|
-
value: "#EEF2FF",
|
|
11
|
-
description: "Primary brand color scale - 50 (lightest)."
|
|
12
|
-
},
|
|
13
|
-
primary100: {
|
|
14
|
-
value: "#E0E7FF",
|
|
15
|
-
description: "Primary brand color scale - 100."
|
|
16
|
-
},
|
|
17
|
-
primary200: {
|
|
18
|
-
value: "#C7D2FE",
|
|
19
|
-
description: "Primary brand color scale - 200."
|
|
20
|
-
},
|
|
21
|
-
primary300: {
|
|
22
|
-
value: "#A5B4FC",
|
|
23
|
-
description: "Primary brand color scale - 300."
|
|
24
|
-
},
|
|
25
|
-
primary400: {
|
|
26
|
-
value: "#818CF8",
|
|
27
|
-
description: "Primary brand color scale - 400."
|
|
28
|
-
},
|
|
29
|
-
primary500: {
|
|
30
|
-
value: "#3A5AFE",
|
|
31
|
-
description: "Primary brand color scale - 500 (core brand blue).",
|
|
32
|
-
meta: { wcag: "Use for primary actions; pair with onPrimary tokens." }
|
|
33
|
-
},
|
|
34
|
-
primary600: {
|
|
35
|
-
value: "#304FFE",
|
|
36
|
-
description: "Primary brand color scale - 600."
|
|
37
|
-
},
|
|
38
|
-
primary700: {
|
|
39
|
-
value: "#1E40FF",
|
|
40
|
-
description: "Primary brand color scale - 700 (darkest brand accent)."
|
|
41
|
-
},
|
|
42
|
-
secondary500: {
|
|
43
|
-
value: "#14B8A6",
|
|
44
|
-
description: "Optional secondary brand accent (teal)."
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
// src/tokens/color/neutral.ts
|
|
49
|
-
var neutral = {
|
|
50
|
-
gray900: {
|
|
51
|
-
value: "#111827",
|
|
52
|
-
description: "Neutral gray - 900 (near-black)."
|
|
53
|
-
},
|
|
54
|
-
gray700: {
|
|
55
|
-
value: "#374151",
|
|
56
|
-
description: "Neutral gray - 700."
|
|
57
|
-
},
|
|
58
|
-
gray500: {
|
|
59
|
-
value: "#6B7280",
|
|
60
|
-
description: "Neutral gray - 500."
|
|
61
|
-
},
|
|
62
|
-
gray300: {
|
|
63
|
-
value: "#D1D5DB",
|
|
64
|
-
description: "Neutral gray - 300."
|
|
65
|
-
},
|
|
66
|
-
gray50: {
|
|
67
|
-
value: "#F9FAFB",
|
|
68
|
-
description: "Neutral gray - 50 (near-white)."
|
|
69
|
-
},
|
|
70
|
-
white: {
|
|
71
|
-
value: "#FFFFFF",
|
|
72
|
-
description: "Pure white."
|
|
73
|
-
},
|
|
74
|
-
black: {
|
|
75
|
-
value: "#000000",
|
|
76
|
-
description: "Pure black."
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
// src/tokens/color/semantic.ts
|
|
81
|
-
var semantic = {
|
|
82
|
-
success: {
|
|
83
|
-
value: "#16A34A",
|
|
84
|
-
description: "Semantic success color (base)."
|
|
85
|
-
},
|
|
86
|
-
successSubtle: {
|
|
87
|
-
value: "#DCFCE7",
|
|
88
|
-
description: "Semantic success background/surface (subtle)."
|
|
89
|
-
},
|
|
90
|
-
warning: {
|
|
91
|
-
value: "#F59E0B",
|
|
92
|
-
description: "Semantic warning color (base)."
|
|
93
|
-
},
|
|
94
|
-
warningSubtle: {
|
|
95
|
-
value: "#FEF3C7",
|
|
96
|
-
description: "Semantic warning background/surface (subtle)."
|
|
97
|
-
},
|
|
98
|
-
error: {
|
|
99
|
-
value: "#EF4444",
|
|
100
|
-
description: "Semantic error color (base)."
|
|
101
|
-
},
|
|
102
|
-
errorSubtle: {
|
|
103
|
-
value: "#FEE2E2",
|
|
104
|
-
description: "Semantic error background/surface (subtle)."
|
|
105
|
-
},
|
|
106
|
-
info: {
|
|
107
|
-
value: "#0EA5E9",
|
|
108
|
-
description: "Semantic info color (base)."
|
|
109
|
-
},
|
|
110
|
-
infoSubtle: {
|
|
111
|
-
value: "#E0F2FE",
|
|
112
|
-
description: "Semantic info background/surface (subtle)."
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
// src/tokens/color/overlays.ts
|
|
117
|
-
var overlays = {
|
|
118
|
-
scrimStrong: {
|
|
119
|
-
value: "rgba(17, 24, 39, 0.64)",
|
|
120
|
-
description: "Strong scrim for modals/overlays."
|
|
121
|
-
},
|
|
122
|
-
scrim: {
|
|
123
|
-
value: "rgba(17, 24, 39, 0.48)",
|
|
124
|
-
description: "Default scrim for overlays."
|
|
125
|
-
},
|
|
126
|
-
scrimSubtle: {
|
|
127
|
-
value: "rgba(17, 24, 39, 0.24)",
|
|
128
|
-
description: "Subtle scrim for light overlays."
|
|
129
|
-
},
|
|
130
|
-
glassFill: {
|
|
131
|
-
value: "rgba(249, 250, 251, 0.72)",
|
|
132
|
-
description: "Glass/blur fill for frosted surfaces (light).",
|
|
133
|
-
meta: { note: "For dark theme, use theme override." }
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
// src/themes/light.ts
|
|
138
|
-
var light = {
|
|
139
|
-
name: "light",
|
|
140
|
-
tokens: {
|
|
141
|
-
"--asm-color-bg": neutral.gray50.value,
|
|
142
|
-
"--asm-color-surface": neutral.white.value,
|
|
143
|
-
"--asm-color-surface-muted": "#F3F4F6",
|
|
144
|
-
"--asm-color-panel": neutral.white.value,
|
|
145
|
-
"--asm-color-modal": neutral.white.value,
|
|
146
|
-
"--asm-color-text": neutral.gray900.value,
|
|
147
|
-
"--asm-color-text-muted": neutral.gray500.value,
|
|
148
|
-
"--asm-color-border": neutral.gray300.value,
|
|
149
|
-
"--asm-color-brand-primary-50": brand.primary50.value,
|
|
150
|
-
"--asm-color-brand-primary-500": brand.primary500.value,
|
|
151
|
-
"--asm-color-brand-primary-600": brand.primary600.value,
|
|
152
|
-
"--asm-color-brand-primary-700": brand.primary700.value,
|
|
153
|
-
"--asm-color-semantic-success": semantic.success.value,
|
|
154
|
-
"--asm-color-semantic-warning": semantic.warning.value,
|
|
155
|
-
"--asm-color-semantic-error": semantic.error.value,
|
|
156
|
-
"--asm-color-semantic-info": semantic.info.value,
|
|
157
|
-
"--asm-color-button-primary-bg": brand.primary600.value,
|
|
158
|
-
"--asm-color-button-primary-bg-hover": brand.primary700.value,
|
|
159
|
-
"--asm-color-button-primary-bg-active": brand.primary700.value,
|
|
160
|
-
"--asm-color-button-primary-text": neutral.white.value,
|
|
161
|
-
"--asm-color-button-secondary-bg": neutral.white.value,
|
|
162
|
-
"--asm-color-button-secondary-text": neutral.gray900.value,
|
|
163
|
-
"--asm-color-button-ghost-bg-hover": "rgba(17, 24, 39, 0.06)",
|
|
164
|
-
"--asm-color-button-destructive-bg": semantic.error.value,
|
|
165
|
-
"--asm-color-button-destructive-text": neutral.white.value,
|
|
166
|
-
"--asm-color-button-disabled-bg": neutral.gray300.value,
|
|
167
|
-
"--asm-color-button-disabled-text": neutral.gray700.value,
|
|
168
|
-
"--asm-color-input-bg": neutral.white.value,
|
|
169
|
-
"--asm-color-input-text": neutral.gray900.value,
|
|
170
|
-
"--asm-color-input-border": neutral.gray300.value,
|
|
171
|
-
"--asm-color-input-border-hover": neutral.gray500.value,
|
|
172
|
-
"--asm-color-input-border-focus": brand.primary600.value,
|
|
173
|
-
"--asm-color-input-placeholder": neutral.gray500.value,
|
|
174
|
-
"--asm-color-input-error-border": semantic.error.value,
|
|
175
|
-
"--asm-color-input-success-border": semantic.success.value,
|
|
176
|
-
"--asm-color-focus-ring": brand.primary500.value,
|
|
177
|
-
"--asm-color-overlay-scrim": overlays.scrim.value,
|
|
178
|
-
"--asm-color-dataviz-gridline": neutral.gray300.value,
|
|
179
|
-
"--asm-color-dataviz-axis": neutral.gray500.value,
|
|
180
|
-
"--asm-color-dataviz-tooltip-bg": neutral.gray900.value,
|
|
181
|
-
"--asm-color-dataviz-tooltip-text": neutral.gray50.value
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
// src/themes/dark.ts
|
|
186
|
-
var dark = {
|
|
187
|
-
name: "dark",
|
|
188
|
-
tokens: {
|
|
189
|
-
"--asm-color-bg": "#0B1220",
|
|
190
|
-
"--asm-color-surface": "#0F172A",
|
|
191
|
-
"--asm-color-surface-muted": "#111B2E",
|
|
192
|
-
"--asm-color-panel": "#0F172A",
|
|
193
|
-
"--asm-color-modal": "#0F172A",
|
|
194
|
-
"--asm-color-text": "#E5E7EB",
|
|
195
|
-
"--asm-color-text-muted": "#9CA3AF",
|
|
196
|
-
"--asm-color-border": "#1F2937",
|
|
197
|
-
"--asm-color-brand-primary-50": brand.primary50.value,
|
|
198
|
-
"--asm-color-brand-primary-500": brand.primary500.value,
|
|
199
|
-
"--asm-color-brand-primary-600": brand.primary500.value,
|
|
200
|
-
"--asm-color-brand-primary-700": brand.primary600.value,
|
|
201
|
-
"--asm-color-semantic-success": "#22C55E",
|
|
202
|
-
"--asm-color-semantic-warning": "#FBBF24",
|
|
203
|
-
"--asm-color-semantic-error": "#F87171",
|
|
204
|
-
"--asm-color-semantic-info": "#38BDF8",
|
|
205
|
-
"--asm-color-button-primary-bg": brand.primary500.value,
|
|
206
|
-
"--asm-color-button-primary-bg-hover": brand.primary600.value,
|
|
207
|
-
"--asm-color-button-primary-bg-active": brand.primary600.value,
|
|
208
|
-
"--asm-color-button-primary-text": neutral.white.value,
|
|
209
|
-
"--asm-color-button-secondary-bg": "#111B2E",
|
|
210
|
-
"--asm-color-button-secondary-text": "#E5E7EB",
|
|
211
|
-
"--asm-color-button-ghost-bg-hover": "rgba(229, 231, 235, 0.08)",
|
|
212
|
-
"--asm-color-button-destructive-bg": "#F87171",
|
|
213
|
-
"--asm-color-button-destructive-text": "#0B1220",
|
|
214
|
-
"--asm-color-button-disabled-bg": "#1F2937",
|
|
215
|
-
"--asm-color-button-disabled-text": "#9CA3AF",
|
|
216
|
-
"--asm-color-input-bg": "#0B1220",
|
|
217
|
-
"--asm-color-input-text": "#E5E7EB",
|
|
218
|
-
"--asm-color-input-border": "#1F2937",
|
|
219
|
-
"--asm-color-input-border-hover": "#374151",
|
|
220
|
-
"--asm-color-input-border-focus": brand.primary500.value,
|
|
221
|
-
"--asm-color-input-placeholder": "#9CA3AF",
|
|
222
|
-
"--asm-color-input-error-border": "#F87171",
|
|
223
|
-
"--asm-color-input-success-border": "#22C55E",
|
|
224
|
-
"--asm-color-focus-ring": brand.primary500.value,
|
|
225
|
-
"--asm-color-overlay-scrim": overlays.scrimStrong.value,
|
|
226
|
-
"--asm-color-dataviz-gridline": "#1F2937",
|
|
227
|
-
"--asm-color-dataviz-axis": "#9CA3AF",
|
|
228
|
-
"--asm-color-dataviz-tooltip-bg": "#111827",
|
|
229
|
-
"--asm-color-dataviz-tooltip-text": "#F9FAFB"
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
|
|
233
|
-
// src/themes/highContrast.ts
|
|
234
|
-
var highContrast = {
|
|
235
|
-
name: "high-contrast",
|
|
236
|
-
tokens: {
|
|
237
|
-
"--asm-color-bg": "#000000",
|
|
238
|
-
"--asm-color-surface": "#000000",
|
|
239
|
-
"--asm-color-surface-muted": "#000000",
|
|
240
|
-
"--asm-color-panel": "#000000",
|
|
241
|
-
"--asm-color-modal": "#000000",
|
|
242
|
-
"--asm-color-text": "#FFFFFF",
|
|
243
|
-
"--asm-color-text-muted": "#FFFFFF",
|
|
244
|
-
"--asm-color-border": "#FFFFFF",
|
|
245
|
-
"--asm-color-brand-primary-50": "#FFFFFF",
|
|
246
|
-
"--asm-color-brand-primary-500": "#FFFFFF",
|
|
247
|
-
"--asm-color-brand-primary-600": "#FFFFFF",
|
|
248
|
-
"--asm-color-brand-primary-700": "#FFFFFF",
|
|
249
|
-
"--asm-color-semantic-success": "#00FF00",
|
|
250
|
-
"--asm-color-semantic-warning": "#FFFF00",
|
|
251
|
-
"--asm-color-semantic-error": "#FF0000",
|
|
252
|
-
"--asm-color-semantic-info": "#00FFFF",
|
|
253
|
-
"--asm-color-button-primary-bg": "#FFFFFF",
|
|
254
|
-
"--asm-color-button-primary-bg-hover": "#FFFFFF",
|
|
255
|
-
"--asm-color-button-primary-bg-active": "#FFFFFF",
|
|
256
|
-
"--asm-color-button-primary-text": "#000000",
|
|
257
|
-
"--asm-color-button-secondary-bg": "#000000",
|
|
258
|
-
"--asm-color-button-secondary-text": "#FFFFFF",
|
|
259
|
-
"--asm-color-button-ghost-bg-hover": "#FFFFFF",
|
|
260
|
-
"--asm-color-button-destructive-bg": "#FF0000",
|
|
261
|
-
"--asm-color-button-destructive-text": "#000000",
|
|
262
|
-
"--asm-color-button-disabled-bg": "#000000",
|
|
263
|
-
"--asm-color-button-disabled-text": "#FFFFFF",
|
|
264
|
-
"--asm-color-input-bg": "#000000",
|
|
265
|
-
"--asm-color-input-text": "#FFFFFF",
|
|
266
|
-
"--asm-color-input-border": "#FFFFFF",
|
|
267
|
-
"--asm-color-input-border-hover": "#FFFFFF",
|
|
268
|
-
"--asm-color-input-border-focus": "#FFFFFF",
|
|
269
|
-
"--asm-color-input-placeholder": "#FFFFFF",
|
|
270
|
-
"--asm-color-input-error-border": "#FF0000",
|
|
271
|
-
"--asm-color-input-success-border": "#00FF00",
|
|
272
|
-
"--asm-color-focus-ring": "#FFFFFF",
|
|
273
|
-
"--asm-color-overlay-scrim": "rgba(255, 255, 255, 0.9)",
|
|
274
|
-
"--asm-color-dataviz-gridline": "#FFFFFF",
|
|
275
|
-
"--asm-color-dataviz-axis": "#FFFFFF",
|
|
276
|
-
"--asm-color-dataviz-tooltip-bg": "#FFFFFF",
|
|
277
|
-
"--asm-color-dataviz-tooltip-text": "#000000"
|
|
278
|
-
}
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
// src/themes/densityCompact.ts
|
|
282
|
-
var densityCompact = {
|
|
283
|
-
name: "compact",
|
|
284
|
-
tokens: {
|
|
285
|
-
"--asm-density-factor": 0.9,
|
|
286
|
-
"--asm-space-component-gap": "12px",
|
|
287
|
-
"--asm-space-control-padding-y": "6px",
|
|
288
|
-
"--asm-space-control-padding-x": "10px"
|
|
289
|
-
}
|
|
290
|
-
};
|
|
291
|
-
|
|
292
|
-
// src/themes/densityComfortable.ts
|
|
293
|
-
var densityComfortable = {
|
|
294
|
-
name: "comfortable",
|
|
295
|
-
tokens: {
|
|
296
|
-
"--asm-density-factor": 1.05,
|
|
297
|
-
"--asm-space-component-gap": "18px",
|
|
298
|
-
"--asm-space-control-padding-y": "10px",
|
|
299
|
-
"--asm-space-control-padding-x": "14px"
|
|
300
|
-
}
|
|
301
|
-
};
|
|
302
|
-
|
|
303
|
-
// src/themes/index.ts
|
|
304
|
-
var themes = {
|
|
305
|
-
light,
|
|
306
|
-
dark,
|
|
307
|
-
highContrast,
|
|
308
|
-
density: {
|
|
309
|
-
compact: densityCompact,
|
|
310
|
-
comfortable: densityComfortable
|
|
311
|
-
}
|
|
312
|
-
};
|
|
313
|
-
|
|
314
|
-
// src/tokens/color/index.ts
|
|
315
|
-
var color_exports = {};
|
|
316
|
-
__export(color_exports, {
|
|
317
|
-
accent: () => accent,
|
|
318
|
-
brand: () => brand,
|
|
319
|
-
dataViz: () => dataViz,
|
|
320
|
-
gradients: () => gradients,
|
|
321
|
-
neutral: () => neutral,
|
|
322
|
-
overlays: () => overlays,
|
|
323
|
-
semantic: () => semantic
|
|
324
|
-
});
|
|
325
|
-
|
|
326
|
-
// src/tokens/color/accent.ts
|
|
327
|
-
var accent = {
|
|
328
|
-
purple500: {
|
|
329
|
-
value: "#8B5CF6",
|
|
330
|
-
description: "Accent purple for special contexts (e.g., highlights)."
|
|
331
|
-
},
|
|
332
|
-
cyan500: {
|
|
333
|
-
value: "#06B6D4",
|
|
334
|
-
description: "Accent cyan for special contexts (e.g., data accents)."
|
|
335
|
-
},
|
|
336
|
-
pink500: {
|
|
337
|
-
value: "#EC4899",
|
|
338
|
-
description: "Accent pink for special contexts."
|
|
339
|
-
},
|
|
340
|
-
lime500: {
|
|
341
|
-
value: "#84CC16",
|
|
342
|
-
description: "Accent lime for special contexts."
|
|
343
|
-
}
|
|
344
|
-
};
|
|
345
|
-
|
|
346
|
-
// src/tokens/color/dataViz.ts
|
|
347
|
-
var dataViz = {
|
|
348
|
-
series1: { value: "#3A5AFE", description: "DataViz series color 1 (brand primary)." },
|
|
349
|
-
series2: { value: "#14B8A6", description: "DataViz series color 2 (brand secondary)." },
|
|
350
|
-
series3: { value: "#8B5CF6", description: "DataViz series color 3." },
|
|
351
|
-
series4: { value: "#F59E0B", description: "DataViz series color 4." },
|
|
352
|
-
series5: { value: "#EF4444", description: "DataViz series color 5." },
|
|
353
|
-
series6: { value: "#0EA5E9", description: "DataViz series color 6." },
|
|
354
|
-
series7: { value: "#84CC16", description: "DataViz series color 7." },
|
|
355
|
-
series8: { value: "#EC4899", description: "DataViz series color 8." },
|
|
356
|
-
series9: { value: "#6366F1", description: "DataViz series color 9." },
|
|
357
|
-
series10: { value: "#F97316", description: "DataViz series color 10." },
|
|
358
|
-
series11: { value: "#22C55E", description: "DataViz series color 11." },
|
|
359
|
-
series12: { value: "#A855F7", description: "DataViz series color 12." },
|
|
360
|
-
gridline: { value: "#D1D5DB", description: "DataViz gridline color." },
|
|
361
|
-
axis: { value: "#6B7280", description: "DataViz axis label color." },
|
|
362
|
-
tooltipBg: { value: "#111827", description: "DataViz tooltip background color." },
|
|
363
|
-
tooltipText: { value: "#F9FAFB", description: "DataViz tooltip text color." }
|
|
364
|
-
};
|
|
365
|
-
|
|
366
|
-
// src/tokens/color/gradients.ts
|
|
367
|
-
var gradients = {
|
|
368
|
-
primary: {
|
|
369
|
-
value: "linear-gradient(135deg, #3A5AFE 0%, #8B5CF6 100%)",
|
|
370
|
-
description: "Primary brand gradient (used for hero/marketing accents)."
|
|
371
|
-
},
|
|
372
|
-
subtleHero: {
|
|
373
|
-
value: "linear-gradient(180deg, rgba(58, 90, 254, 0.10) 0%, rgba(249, 250, 251, 0) 80%)",
|
|
374
|
-
description: "Subtle hero gradient background overlay (light).",
|
|
375
|
-
meta: { note: "Use theme override in dark/high-contrast." }
|
|
376
|
-
}
|
|
377
|
-
};
|
|
378
|
-
|
|
379
|
-
// src/tokens/typography/index.ts
|
|
380
|
-
var typography_exports = {};
|
|
381
|
-
__export(typography_exports, {
|
|
382
|
-
families: () => families,
|
|
383
|
-
headings: () => headings,
|
|
384
|
-
letterSpacing: () => letterSpacing,
|
|
385
|
-
lineHeights: () => lineHeights,
|
|
386
|
-
responsive: () => responsive,
|
|
387
|
-
sizes: () => sizes,
|
|
388
|
-
weights: () => weights
|
|
389
|
-
});
|
|
390
|
-
|
|
391
|
-
// src/tokens/typography/families.ts
|
|
392
|
-
var families = {
|
|
393
|
-
primary: {
|
|
394
|
-
value: 'Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji"',
|
|
395
|
-
description: "Primary UI font family stack (Inter first)."
|
|
396
|
-
},
|
|
397
|
-
mono: {
|
|
398
|
-
value: '"JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
|
|
399
|
-
description: "Monospace font family stack (JetBrains Mono first)."
|
|
400
|
-
}
|
|
401
|
-
};
|
|
402
|
-
|
|
403
|
-
// src/tokens/typography/weights.ts
|
|
404
|
-
var weights = {
|
|
405
|
-
w100: { value: 100, description: "Font weight 100 (thin)." },
|
|
406
|
-
w200: { value: 200, description: "Font weight 200 (extra light)." },
|
|
407
|
-
w300: { value: 300, description: "Font weight 300 (light)." },
|
|
408
|
-
w400: { value: 400, description: "Font weight 400 (regular)." },
|
|
409
|
-
w500: { value: 500, description: "Font weight 500 (medium)." },
|
|
410
|
-
w600: { value: 600, description: "Font weight 600 (semibold)." },
|
|
411
|
-
w700: { value: 700, description: "Font weight 700 (bold)." },
|
|
412
|
-
w800: { value: 800, description: "Font weight 800 (extra bold)." },
|
|
413
|
-
w900: { value: 900, description: "Font weight 900 (black)." }
|
|
414
|
-
};
|
|
415
|
-
|
|
416
|
-
// src/tokens/typography/sizes.ts
|
|
417
|
-
var sizes = {
|
|
418
|
-
xs: { value: "0.75rem", description: "Font size xs (12px)." },
|
|
419
|
-
sm: { value: "0.875rem", description: "Font size sm (14px)." },
|
|
420
|
-
md: { value: "1rem", description: "Font size md (16px)." },
|
|
421
|
-
lg: { value: "1.125rem", description: "Font size lg (18px)." },
|
|
422
|
-
xl: { value: "1.25rem", description: "Font size xl (20px)." },
|
|
423
|
-
x2l: { value: "1.5rem", description: "Font size 2xl (24px)." },
|
|
424
|
-
x3l: { value: "1.875rem", description: "Font size 3xl (30px)." },
|
|
425
|
-
x4l: { value: "2.25rem", description: "Font size 4xl (36px)." },
|
|
426
|
-
x5l: { value: "3rem", description: "Font size 5xl (48px)." },
|
|
427
|
-
x6l: { value: "3.75rem", description: "Font size 6xl (60px)." }
|
|
428
|
-
};
|
|
429
|
-
|
|
430
|
-
// src/tokens/typography/lineHeights.ts
|
|
431
|
-
var lineHeights = {
|
|
432
|
-
tight: { value: 1.1, description: "Tight line-height (headings)." },
|
|
433
|
-
normal: { value: 1.4, description: "Normal line-height (UI)." },
|
|
434
|
-
relaxed: { value: 1.6, description: "Relaxed line-height (long form)." },
|
|
435
|
-
h1: { value: 1.05, description: "H1 line-height." },
|
|
436
|
-
h2: { value: 1.1, description: "H2 line-height." },
|
|
437
|
-
h3: { value: 1.15, description: "H3 line-height." },
|
|
438
|
-
h4: { value: 1.2, description: "H4 line-height." },
|
|
439
|
-
h5: { value: 1.25, description: "H5 line-height." },
|
|
440
|
-
h6: { value: 1.25, description: "H6 line-height." }
|
|
441
|
-
};
|
|
442
|
-
|
|
443
|
-
// src/tokens/typography/letterSpacing.ts
|
|
444
|
-
var letterSpacing = {
|
|
445
|
-
tight: { value: "-0.01em", description: "Tight letter spacing." },
|
|
446
|
-
normal: { value: "0em", description: "Normal letter spacing." },
|
|
447
|
-
wide: { value: "0.02em", description: "Wide letter spacing." }
|
|
448
|
-
};
|
|
449
|
-
|
|
450
|
-
// src/tokens/typography/headings.ts
|
|
451
|
-
var headings = {
|
|
452
|
-
h1: {
|
|
453
|
-
value: "var(--asm-font-size-6xl) / var(--asm-line-height-h1) var(--asm-font-family-primary)",
|
|
454
|
-
description: "H1 shorthand (size/line-height/family).",
|
|
455
|
-
meta: { note: "Use size/weight/lineHeight tokens for precise control." }
|
|
456
|
-
},
|
|
457
|
-
h2: {
|
|
458
|
-
value: "var(--asm-font-size-5xl) / var(--asm-line-height-h2) var(--asm-font-family-primary)",
|
|
459
|
-
description: "H2 shorthand (size/line-height/family)."
|
|
460
|
-
},
|
|
461
|
-
h3: {
|
|
462
|
-
value: "var(--asm-font-size-4xl) / var(--asm-line-height-h3) var(--asm-font-family-primary)",
|
|
463
|
-
description: "H3 shorthand (size/line-height/family)."
|
|
464
|
-
},
|
|
465
|
-
h4: {
|
|
466
|
-
value: "var(--asm-font-size-3xl) / var(--asm-line-height-h4) var(--asm-font-family-primary)",
|
|
467
|
-
description: "H4 shorthand (size/line-height/family)."
|
|
468
|
-
},
|
|
469
|
-
h5: {
|
|
470
|
-
value: "var(--asm-font-size-2xl) / var(--asm-line-height-h5) var(--asm-font-family-primary)",
|
|
471
|
-
description: "H5 shorthand (size/line-height/family)."
|
|
472
|
-
},
|
|
473
|
-
h6: {
|
|
474
|
-
value: "var(--asm-font-size-xl) / var(--asm-line-height-h6) var(--asm-font-family-primary)",
|
|
475
|
-
description: "H6 shorthand (size/line-height/family)."
|
|
476
|
-
}
|
|
477
|
-
};
|
|
478
|
-
|
|
479
|
-
// src/tokens/typography/responsive.ts
|
|
480
|
-
var responsive = {
|
|
481
|
-
bodyMaxWidth: {
|
|
482
|
-
value: "68ch",
|
|
483
|
-
description: "Recommended max-width for long-form text blocks."
|
|
484
|
-
},
|
|
485
|
-
scaleMobile: {
|
|
486
|
-
value: 0.95,
|
|
487
|
-
description: "Typography scale factor for mobile contexts.",
|
|
488
|
-
meta: { note: "Use with clamp() in consuming apps when needed." }
|
|
489
|
-
},
|
|
490
|
-
scaleTablet: {
|
|
491
|
-
value: 1,
|
|
492
|
-
description: "Typography scale factor for tablet contexts."
|
|
493
|
-
},
|
|
494
|
-
scaleDesktop: {
|
|
495
|
-
value: 1.05,
|
|
496
|
-
description: "Typography scale factor for desktop contexts."
|
|
497
|
-
}
|
|
498
|
-
};
|
|
499
|
-
|
|
500
|
-
// src/tokens/spacing/index.ts
|
|
501
|
-
var spacing_exports = {};
|
|
502
|
-
__export(spacing_exports, {
|
|
503
|
-
density: () => density,
|
|
504
|
-
grid: () => grid,
|
|
505
|
-
layout: () => layout,
|
|
506
|
-
rtl: () => rtl,
|
|
507
|
-
scale: () => scale
|
|
508
|
-
});
|
|
509
|
-
|
|
510
|
-
// src/tokens/spacing/scale.ts
|
|
511
|
-
var scale = {
|
|
512
|
-
s0: { value: "0px", description: "Spacing 0." },
|
|
513
|
-
s1: { value: "4px", description: "Spacing 1 (4px)." },
|
|
514
|
-
s2: { value: "8px", description: "Spacing 2 (8px)." },
|
|
515
|
-
s3: { value: "12px", description: "Spacing 3 (12px)." },
|
|
516
|
-
s4: { value: "16px", description: "Spacing 4 (16px)." },
|
|
517
|
-
s5: { value: "20px", description: "Spacing 5 (20px)." },
|
|
518
|
-
s6: { value: "24px", description: "Spacing 6 (24px)." },
|
|
519
|
-
s8: { value: "32px", description: "Spacing 8 (32px)." },
|
|
520
|
-
s10: { value: "40px", description: "Spacing 10 (40px)." },
|
|
521
|
-
s12: { value: "48px", description: "Spacing 12 (48px)." },
|
|
522
|
-
s16: { value: "64px", description: "Spacing 16 (64px)." }
|
|
523
|
-
};
|
|
524
|
-
|
|
525
|
-
// src/tokens/spacing/layout.ts
|
|
526
|
-
var layout = {
|
|
527
|
-
pagePaddingX: {
|
|
528
|
-
value: "clamp(16px, 3vw, 32px)",
|
|
529
|
-
description: "Default horizontal page padding (responsive)."
|
|
530
|
-
},
|
|
531
|
-
pagePaddingY: {
|
|
532
|
-
value: "clamp(16px, 3vw, 40px)",
|
|
533
|
-
description: "Default vertical page padding (responsive)."
|
|
534
|
-
},
|
|
535
|
-
sectionGap: {
|
|
536
|
-
value: "clamp(24px, 4vw, 64px)",
|
|
537
|
-
description: "Vertical spacing between major sections."
|
|
538
|
-
},
|
|
539
|
-
componentGap: {
|
|
540
|
-
value: "16px",
|
|
541
|
-
description: "Default spacing between components within a section."
|
|
542
|
-
}
|
|
543
|
-
};
|
|
544
|
-
|
|
545
|
-
// src/tokens/spacing/grid.ts
|
|
546
|
-
var grid = {
|
|
547
|
-
columns: {
|
|
548
|
-
value: 12,
|
|
549
|
-
description: "Default grid column count."
|
|
550
|
-
},
|
|
551
|
-
gutter: {
|
|
552
|
-
value: "24px",
|
|
553
|
-
description: "Default grid gutter size."
|
|
554
|
-
},
|
|
555
|
-
breakpoints: {
|
|
556
|
-
xs: { value: "360px", description: "Breakpoint XS." },
|
|
557
|
-
sm: { value: "640px", description: "Breakpoint SM." },
|
|
558
|
-
md: { value: "768px", description: "Breakpoint MD." },
|
|
559
|
-
lg: { value: "1024px", description: "Breakpoint LG." },
|
|
560
|
-
xl: { value: "1280px", description: "Breakpoint XL." },
|
|
561
|
-
x2l: { value: "1536px", description: "Breakpoint 2XL." }
|
|
562
|
-
},
|
|
563
|
-
containerWidths: {
|
|
564
|
-
xs: { value: "480px", description: "Container width XS." },
|
|
565
|
-
sm: { value: "640px", description: "Container width SM." },
|
|
566
|
-
md: { value: "768px", description: "Container width MD." },
|
|
567
|
-
lg: { value: "1024px", description: "Container width LG." },
|
|
568
|
-
xl: { value: "1280px", description: "Container width XL." },
|
|
569
|
-
x2l: { value: "1360px", description: "Container width 2XL (ASafariM standard)." }
|
|
570
|
-
}
|
|
571
|
-
};
|
|
572
|
-
|
|
573
|
-
// src/tokens/spacing/density.ts
|
|
574
|
-
var density = {
|
|
575
|
-
compactFactor: {
|
|
576
|
-
value: 0.9,
|
|
577
|
-
description: "Density factor applied in compact mode."
|
|
578
|
-
},
|
|
579
|
-
comfortableFactor: {
|
|
580
|
-
value: 1.05,
|
|
581
|
-
description: "Density factor applied in comfortable mode."
|
|
582
|
-
}
|
|
583
|
-
};
|
|
584
|
-
|
|
585
|
-
// src/tokens/spacing/rtl.ts
|
|
586
|
-
var rtl = {
|
|
587
|
-
logicalInsetStart: {
|
|
588
|
-
value: "inset-inline-start",
|
|
589
|
-
description: "Use logical inset start property for RTL-safe positioning."
|
|
590
|
-
},
|
|
591
|
-
logicalInsetEnd: {
|
|
592
|
-
value: "inset-inline-end",
|
|
593
|
-
description: "Use logical inset end property for RTL-safe positioning."
|
|
594
|
-
},
|
|
595
|
-
logicalMarginStart: {
|
|
596
|
-
value: "margin-inline-start",
|
|
597
|
-
description: "Use logical margin start for RTL-safe spacing."
|
|
598
|
-
},
|
|
599
|
-
logicalMarginEnd: {
|
|
600
|
-
value: "margin-inline-end",
|
|
601
|
-
description: "Use logical margin end for RTL-safe spacing."
|
|
602
|
-
}
|
|
603
|
-
};
|
|
604
|
-
|
|
605
|
-
// src/tokens/shape/index.ts
|
|
606
|
-
var shape_exports = {};
|
|
607
|
-
__export(shape_exports, {
|
|
608
|
-
borders: () => borders,
|
|
609
|
-
radii: () => radii,
|
|
610
|
-
strokes: () => strokes
|
|
611
|
-
});
|
|
612
|
-
|
|
613
|
-
// src/tokens/shape/radii.ts
|
|
614
|
-
var radii = {
|
|
615
|
-
sm: { value: "6px", description: "Small radius." },
|
|
616
|
-
md: { value: "10px", description: "Medium radius." },
|
|
617
|
-
lg: { value: "12px", description: "Large radius (cards)." },
|
|
618
|
-
xl: { value: "16px", description: "Extra-large radius." },
|
|
619
|
-
full: { value: "9999px", description: "Full pill/circle radius." }
|
|
620
|
-
};
|
|
621
|
-
|
|
622
|
-
// src/tokens/shape/borders.ts
|
|
623
|
-
var borders = {
|
|
624
|
-
hairline: { value: "1px", description: "Hairline border width." },
|
|
625
|
-
thin: { value: "2px", description: "Thin border width." },
|
|
626
|
-
thick: { value: "3px", description: "Thick border width." }
|
|
627
|
-
};
|
|
628
|
-
|
|
629
|
-
// src/tokens/shape/strokes.ts
|
|
630
|
-
var strokes = {
|
|
631
|
-
default: { value: "1px", description: "Default stroke width." },
|
|
632
|
-
strong: { value: "2px", description: "Strong stroke width." },
|
|
633
|
-
dash: { value: "4 2", description: "Default dash pattern (stroke-dasharray)." }
|
|
634
|
-
};
|
|
635
|
-
|
|
636
|
-
// src/tokens/effects/index.ts
|
|
637
|
-
var effects_exports = {};
|
|
638
|
-
__export(effects_exports, {
|
|
639
|
-
blur: () => blur,
|
|
640
|
-
opacity: () => opacity,
|
|
641
|
-
shadows: () => shadows,
|
|
642
|
-
textures: () => textures
|
|
643
|
-
});
|
|
644
|
-
|
|
645
|
-
// src/tokens/effects/shadows.ts
|
|
646
|
-
var shadows = {
|
|
647
|
-
sm: {
|
|
648
|
-
value: "0 1px 2px rgba(17, 24, 39, 0.06)",
|
|
649
|
-
description: "Shadow sm (subtle elevation)."
|
|
650
|
-
},
|
|
651
|
-
md: {
|
|
652
|
-
value: "0 6px 20px rgba(17, 24, 39, 0.10)",
|
|
653
|
-
description: "Shadow md (card elevation)."
|
|
654
|
-
},
|
|
655
|
-
lg: {
|
|
656
|
-
value: "0 16px 40px rgba(17, 24, 39, 0.14)",
|
|
657
|
-
description: "Shadow lg (overlay elevation)."
|
|
658
|
-
},
|
|
659
|
-
xl: {
|
|
660
|
-
value: "0 24px 60px rgba(17, 24, 39, 0.18)",
|
|
661
|
-
description: "Shadow xl (modal elevation)."
|
|
662
|
-
}
|
|
663
|
-
};
|
|
664
|
-
|
|
665
|
-
// src/tokens/effects/blur.ts
|
|
666
|
-
var blur = {
|
|
667
|
-
sm: { value: "4px", description: "Small blur." },
|
|
668
|
-
md: { value: "8px", description: "Medium blur." },
|
|
669
|
-
lg: { value: "16px", description: "Large blur (glass)." }
|
|
670
|
-
};
|
|
671
|
-
|
|
672
|
-
// src/tokens/effects/opacity.ts
|
|
673
|
-
var opacity = {
|
|
674
|
-
o0: { value: 0, description: "Opacity 0%." },
|
|
675
|
-
o10: { value: 0.1, description: "Opacity 10%." },
|
|
676
|
-
o20: { value: 0.2, description: "Opacity 20%." },
|
|
677
|
-
o40: { value: 0.4, description: "Opacity 40%." },
|
|
678
|
-
o60: { value: 0.6, description: "Opacity 60%." },
|
|
679
|
-
o80: { value: 0.8, description: "Opacity 80%." },
|
|
680
|
-
o100: { value: 1, description: "Opacity 100%." }
|
|
681
|
-
};
|
|
682
|
-
|
|
683
|
-
// src/tokens/effects/textures.ts
|
|
684
|
-
var textures = {
|
|
685
|
-
none: { value: "none", description: "No texture." },
|
|
686
|
-
noise: {
|
|
687
|
-
value: "url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22120%22 height=%22120%22%3E%3Cfilter id=%22n%22 x=%220%22 y=%220%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%220.9%22 numOctaves=%223%22 stitchTiles=%22stitch%22/%3E%3C/filter%3E%3Crect width=%22120%22 height=%22120%22 filter=%22url(%23n)%22 opacity=%220.06%22/%3E%3C/svg%3E')",
|
|
688
|
-
description: "Subtle noise texture (data URI).",
|
|
689
|
-
meta: { note: "Use as background-image; keep opacity low." }
|
|
690
|
-
}
|
|
691
|
-
};
|
|
692
|
-
|
|
693
|
-
// src/tokens/motion/index.ts
|
|
694
|
-
var motion_exports = {};
|
|
695
|
-
__export(motion_exports, {
|
|
696
|
-
duration: () => duration,
|
|
697
|
-
easing: () => easing,
|
|
698
|
-
reducedMotion: () => reducedMotion,
|
|
699
|
-
transitions: () => transitions
|
|
700
|
-
});
|
|
701
|
-
|
|
702
|
-
// src/tokens/motion/duration.ts
|
|
703
|
-
var duration = {
|
|
704
|
-
fast: { value: "120ms", description: "Fast duration for micro-interactions." },
|
|
705
|
-
normal: { value: "200ms", description: "Normal duration for standard UI transitions." },
|
|
706
|
-
slow: { value: "320ms", description: "Slow duration for larger transitions." }
|
|
707
|
-
};
|
|
708
|
-
|
|
709
|
-
// src/tokens/motion/easing.ts
|
|
710
|
-
var easing = {
|
|
711
|
-
standard: { value: "cubic-bezier(0.2, 0, 0, 1)", description: "Standard easing." },
|
|
712
|
-
emphasized: { value: "cubic-bezier(0.2, 0, 0, 1.2)", description: "Emphasized easing." },
|
|
713
|
-
entrance: { value: "cubic-bezier(0, 0, 0, 1)", description: "Entrance easing." },
|
|
714
|
-
exit: { value: "cubic-bezier(0.4, 0, 1, 1)", description: "Exit easing." }
|
|
715
|
-
};
|
|
716
|
-
|
|
717
|
-
// src/tokens/motion/transitions.ts
|
|
718
|
-
var transitions = {
|
|
719
|
-
fade: {
|
|
720
|
-
value: "opacity var(--asm-motion-duration-normal) var(--asm-motion-easing-standard)",
|
|
721
|
-
description: "Fade transition preset."
|
|
722
|
-
},
|
|
723
|
-
slide: {
|
|
724
|
-
value: "transform var(--asm-motion-duration-normal) var(--asm-motion-easing-standard)",
|
|
725
|
-
description: "Slide transition preset."
|
|
726
|
-
},
|
|
727
|
-
scale: {
|
|
728
|
-
value: "transform var(--asm-motion-duration-fast) var(--asm-motion-easing-emphasized)",
|
|
729
|
-
description: "Scale transition preset."
|
|
730
|
-
}
|
|
731
|
-
};
|
|
732
|
-
|
|
733
|
-
// src/tokens/motion/reducedMotion.ts
|
|
734
|
-
var reducedMotion = {
|
|
735
|
-
disableTransitions: {
|
|
736
|
-
value: 1,
|
|
737
|
-
description: "If true, consumers should disable non-essential transitions when prefers-reduced-motion is enabled.",
|
|
738
|
-
meta: { hint: "Use @media (prefers-reduced-motion: reduce) in CSS." }
|
|
739
|
-
}
|
|
740
|
-
};
|
|
741
|
-
|
|
742
|
-
// src/tokens/zindex/index.ts
|
|
743
|
-
var zindex_exports = {};
|
|
744
|
-
__export(zindex_exports, {
|
|
745
|
-
scale: () => scale2
|
|
746
|
-
});
|
|
747
|
-
|
|
748
|
-
// src/tokens/zindex/scale.ts
|
|
749
|
-
var scale2 = {
|
|
750
|
-
base: { value: 0, description: "Base stacking context." },
|
|
751
|
-
dropdown: { value: 100, description: "Dropdown menus." },
|
|
752
|
-
sticky: { value: 200, description: "Sticky headers." },
|
|
753
|
-
overlay: { value: 300, description: "Overlays/scrims." },
|
|
754
|
-
modal: { value: 400, description: "Modal dialogs." },
|
|
755
|
-
popover: { value: 450, description: "Popovers." },
|
|
756
|
-
tooltip: { value: 500, description: "Tooltips." },
|
|
757
|
-
toast: { value: 600, description: "Toasts/notifications." }
|
|
758
|
-
};
|
|
759
|
-
|
|
760
|
-
// src/tokens/iconography/index.ts
|
|
761
|
-
var iconography_exports = {};
|
|
762
|
-
__export(iconography_exports, {
|
|
763
|
-
sizes: () => sizes2,
|
|
764
|
-
strokeWidths: () => strokeWidths
|
|
765
|
-
});
|
|
766
|
-
|
|
767
|
-
// src/tokens/iconography/sizes.ts
|
|
768
|
-
var sizes2 = {
|
|
769
|
-
xs: { value: "12px", description: "Icon size XS." },
|
|
770
|
-
sm: { value: "16px", description: "Icon size SM." },
|
|
771
|
-
md: { value: "20px", description: "Icon size MD." },
|
|
772
|
-
lg: { value: "24px", description: "Icon size LG." },
|
|
773
|
-
xl: { value: "28px", description: "Icon size XL." }
|
|
774
|
-
};
|
|
775
|
-
|
|
776
|
-
// src/tokens/iconography/strokeWidths.ts
|
|
777
|
-
var strokeWidths = {
|
|
778
|
-
thin: { value: 1, description: "Thin icon stroke width." },
|
|
779
|
-
regular: { value: 1.5, description: "Regular icon stroke width." },
|
|
780
|
-
bold: { value: 2, description: "Bold icon stroke width." }
|
|
781
|
-
};
|
|
782
|
-
|
|
783
|
-
// src/tokens/ui/index.ts
|
|
784
|
-
var ui_exports = {};
|
|
785
|
-
__export(ui_exports, {
|
|
786
|
-
button: () => button,
|
|
787
|
-
focus: () => focus,
|
|
788
|
-
input: () => input,
|
|
789
|
-
overlay: () => overlay,
|
|
790
|
-
surface: () => surface
|
|
791
|
-
});
|
|
792
|
-
|
|
793
|
-
// src/tokens/ui/surface.ts
|
|
794
|
-
var surface = {
|
|
795
|
-
background: { value: "var(--asm-color-bg)", description: "App background surface." },
|
|
796
|
-
surface: { value: "var(--asm-color-surface)", description: "Default surface (cards)." },
|
|
797
|
-
surfaceMuted: { value: "var(--asm-color-surface-muted)", description: "Muted surface." },
|
|
798
|
-
panel: { value: "var(--asm-color-panel)", description: "Panel surface." },
|
|
799
|
-
modal: { value: "var(--asm-color-modal)", description: "Modal surface." }
|
|
800
|
-
};
|
|
801
|
-
|
|
802
|
-
// src/tokens/ui/button.ts
|
|
803
|
-
var button = {
|
|
804
|
-
primaryBg: { value: "var(--asm-color-button-primary-bg)", description: "Primary button background." },
|
|
805
|
-
primaryText: { value: "var(--asm-color-button-primary-text)", description: "Primary button text." },
|
|
806
|
-
primaryBgHover: {
|
|
807
|
-
value: "var(--asm-color-button-primary-bg-hover)",
|
|
808
|
-
description: "Primary button background (hover)."
|
|
809
|
-
},
|
|
810
|
-
primaryBgActive: {
|
|
811
|
-
value: "var(--asm-color-button-primary-bg-active)",
|
|
812
|
-
description: "Primary button background (active)."
|
|
813
|
-
},
|
|
814
|
-
secondaryBg: { value: "var(--asm-color-button-secondary-bg)", description: "Secondary button background." },
|
|
815
|
-
secondaryText: { value: "var(--asm-color-button-secondary-text)", description: "Secondary button text." },
|
|
816
|
-
ghostBgHover: { value: "var(--asm-color-button-ghost-bg-hover)", description: "Ghost button hover background." },
|
|
817
|
-
destructiveBg: { value: "var(--asm-color-button-destructive-bg)", description: "Destructive button background." },
|
|
818
|
-
destructiveText: { value: "var(--asm-color-button-destructive-text)", description: "Destructive button text." },
|
|
819
|
-
disabledBg: { value: "var(--asm-color-button-disabled-bg)", description: "Disabled button background." },
|
|
820
|
-
disabledText: { value: "var(--asm-color-button-disabled-text)", description: "Disabled button text." }
|
|
821
|
-
};
|
|
822
|
-
|
|
823
|
-
// src/tokens/ui/input.ts
|
|
824
|
-
var input = {
|
|
825
|
-
bg: { value: "var(--asm-color-input-bg)", description: "Input background." },
|
|
826
|
-
text: { value: "var(--asm-color-input-text)", description: "Input text." },
|
|
827
|
-
border: { value: "var(--asm-color-input-border)", description: "Input border." },
|
|
828
|
-
borderHover: { value: "var(--asm-color-input-border-hover)", description: "Input border (hover)." },
|
|
829
|
-
borderFocus: { value: "var(--asm-color-input-border-focus)", description: "Input border (focus)." },
|
|
830
|
-
placeholder: { value: "var(--asm-color-input-placeholder)", description: "Input placeholder text." },
|
|
831
|
-
errorBorder: { value: "var(--asm-color-input-error-border)", description: "Input error border." },
|
|
832
|
-
successBorder: { value: "var(--asm-color-input-success-border)", description: "Input success border." }
|
|
833
|
-
};
|
|
834
|
-
|
|
835
|
-
// src/tokens/ui/focus.ts
|
|
836
|
-
var focus = {
|
|
837
|
-
ringColor: { value: "var(--asm-color-focus-ring)", description: "Focus ring color." },
|
|
838
|
-
ringWidth: { value: "2px", description: "Focus ring width." },
|
|
839
|
-
ringOffset: { value: "2px", description: "Focus ring offset." }
|
|
840
|
-
};
|
|
841
|
-
|
|
842
|
-
// src/tokens/ui/overlay.ts
|
|
843
|
-
var overlay = {
|
|
844
|
-
scrim: { value: "var(--asm-color-overlay-scrim)", description: "Overlay scrim color." },
|
|
845
|
-
backdropBlur: { value: "var(--asm-effect-blur-md)", description: "Default overlay backdrop blur." }
|
|
846
|
-
};
|
|
847
|
-
|
|
848
|
-
// src/tokens/index.ts
|
|
849
|
-
var tokens = {
|
|
850
|
-
color: color_exports,
|
|
851
|
-
typography: typography_exports,
|
|
852
|
-
spacing: spacing_exports,
|
|
853
|
-
shape: shape_exports,
|
|
854
|
-
effects: effects_exports,
|
|
855
|
-
motion: motion_exports,
|
|
856
|
-
zindex: zindex_exports,
|
|
857
|
-
iconography: iconography_exports,
|
|
858
|
-
ui: ui_exports
|
|
859
|
-
};
|
|
860
|
-
|
|
861
|
-
// src/core/utils.ts
|
|
862
|
-
function isTokenLeaf(value) {
|
|
863
|
-
return typeof value === "object" && value !== null && "value" in value && "description" in value && (typeof value.value === "string" || typeof value.value === "number") && typeof value.description === "string";
|
|
864
|
-
}
|
|
865
|
-
function toKebabCase(input2) {
|
|
866
|
-
return input2.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[_\s]+/g, "-").toLowerCase();
|
|
867
|
-
}
|
|
868
|
-
function walkTokenTree(tree, visitor, path = []) {
|
|
869
|
-
for (const [key, value] of Object.entries(tree)) {
|
|
870
|
-
const nextPath = [...path, key];
|
|
871
|
-
if (isTokenLeaf(value)) {
|
|
872
|
-
visitor({ path: nextPath, leaf: value });
|
|
873
|
-
continue;
|
|
874
|
-
}
|
|
875
|
-
if (typeof value === "object" && value !== null) {
|
|
876
|
-
walkTokenTree(value, visitor, nextPath);
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
// src/build/toCssVars.ts
|
|
882
|
-
function tokenPathToCssVarName(path) {
|
|
883
|
-
const kebabParts = path.map(toKebabCase);
|
|
884
|
-
return `--asm-${kebabParts.join("-")}`;
|
|
885
|
-
}
|
|
886
|
-
function toCssVars(tree) {
|
|
887
|
-
const out = {};
|
|
888
|
-
walkTokenTree(tree, ({ path, leaf }) => {
|
|
889
|
-
const cssVar = tokenPathToCssVarName(path);
|
|
890
|
-
out[cssVar] = String(leaf.value);
|
|
891
|
-
});
|
|
892
|
-
return out;
|
|
893
|
-
}
|
|
894
|
-
function toCssVarNames(tree) {
|
|
895
|
-
const out = {};
|
|
896
|
-
walkTokenTree(tree, ({ path }) => {
|
|
897
|
-
const dotPath = path.join(".");
|
|
898
|
-
out[dotPath] = tokenPathToCssVarName(path);
|
|
899
|
-
});
|
|
900
|
-
return out;
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
// src/build/validate.ts
|
|
904
|
-
var HEX_COLOR = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;
|
|
905
|
-
function validateTokens(args) {
|
|
906
|
-
const errors = [];
|
|
907
|
-
const warnings = [];
|
|
908
|
-
const seenDotKeys = /* @__PURE__ */ new Set();
|
|
909
|
-
const seenCssVars = /* @__PURE__ */ new Set();
|
|
910
|
-
walkTokenTree(args.tokens, ({ path, leaf }) => {
|
|
911
|
-
const dotKey = path.join(".");
|
|
912
|
-
if (seenDotKeys.has(dotKey)) {
|
|
913
|
-
errors.push(`Duplicate token key: ${dotKey}`);
|
|
914
|
-
} else {
|
|
915
|
-
seenDotKeys.add(dotKey);
|
|
916
|
-
}
|
|
917
|
-
if (!leaf.description || leaf.description.trim().length === 0) {
|
|
918
|
-
errors.push(`Missing description for token: ${dotKey}`);
|
|
919
|
-
}
|
|
920
|
-
const cssVar = tokenPathToCssVarName(path);
|
|
921
|
-
if (!cssVar.startsWith("--asm-")) {
|
|
922
|
-
errors.push(`Invalid CSS var prefix (must be --asm-): ${cssVar}`);
|
|
923
|
-
}
|
|
924
|
-
if (seenCssVars.has(cssVar)) {
|
|
925
|
-
errors.push(`Duplicate CSS var name generated: ${cssVar} (from ${dotKey})`);
|
|
926
|
-
} else {
|
|
927
|
-
seenCssVars.add(cssVar);
|
|
928
|
-
}
|
|
929
|
-
const v = leaf.value;
|
|
930
|
-
if (typeof v === "string" && v.startsWith("#") && !HEX_COLOR.test(v)) {
|
|
931
|
-
errors.push(`Invalid hex color for ${dotKey}: ${v}`);
|
|
932
|
-
}
|
|
933
|
-
});
|
|
934
|
-
const requiredThemeVars = [
|
|
935
|
-
"--asm-color-bg",
|
|
936
|
-
"--asm-color-surface",
|
|
937
|
-
"--asm-color-text",
|
|
938
|
-
"--asm-color-border",
|
|
939
|
-
"--asm-color-button-primary-bg",
|
|
940
|
-
"--asm-color-input-border-focus",
|
|
941
|
-
"--asm-color-focus-ring",
|
|
942
|
-
"--asm-color-overlay-scrim"
|
|
943
|
-
];
|
|
944
|
-
const themeNames = new Set(args.themes.map((t) => t.name));
|
|
945
|
-
for (const name of ["light", "dark", "high-contrast"]) {
|
|
946
|
-
if (!themeNames.has(name)) {
|
|
947
|
-
errors.push(`Missing required theme: ${name}`);
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
for (const theme of args.themes) {
|
|
951
|
-
if (theme.name !== "light" && theme.name !== "dark" && theme.name !== "high-contrast") {
|
|
952
|
-
warnings.push(`Theme has non-standard name: ${theme.name}`);
|
|
953
|
-
}
|
|
954
|
-
for (const varName of requiredThemeVars) {
|
|
955
|
-
if (!(varName in theme.tokens)) {
|
|
956
|
-
errors.push(`Theme '${theme.name}' missing required token override: ${varName}`);
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
for (const [key, value] of Object.entries(theme.tokens)) {
|
|
960
|
-
if (!key.startsWith("--asm-")) {
|
|
961
|
-
errors.push(`Theme '${theme.name}' contains non --asm- var: ${key}`);
|
|
962
|
-
}
|
|
963
|
-
if (typeof value === "string" && value.startsWith("#") && !HEX_COLOR.test(value)) {
|
|
964
|
-
errors.push(`Theme '${theme.name}' invalid hex for ${key}: ${value}`);
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
return {
|
|
969
|
-
ok: errors.length === 0,
|
|
970
|
-
errors,
|
|
971
|
-
warnings
|
|
972
|
-
};
|
|
973
|
-
}
|
|
974
|
-
|
|
975
|
-
// src/index.ts
|
|
976
|
-
var cssVarNames = toCssVarNames(tokens);
|
|
977
|
-
function applyThemeToElement(element, theme, options) {
|
|
978
|
-
const cleanup = options?.cleanup ?? false;
|
|
979
|
-
const keys = Object.keys(theme.tokens);
|
|
980
|
-
if (cleanup) {
|
|
981
|
-
for (const k of keys) {
|
|
982
|
-
element.style.removeProperty(k);
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
for (const [k, v] of Object.entries(theme.tokens)) {
|
|
986
|
-
element.style.setProperty(k, String(v));
|
|
987
|
-
}
|
|
988
|
-
if (options?.overrides) {
|
|
989
|
-
for (const [k, v] of Object.entries(options.overrides)) {
|
|
990
|
-
element.style.setProperty(k, String(v));
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
}
|
|
994
|
-
function prefersColorScheme() {
|
|
995
|
-
if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
|
|
996
|
-
return void 0;
|
|
997
|
-
}
|
|
998
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
999
|
-
}
|
|
1000
|
-
function validateTokens2() {
|
|
1001
|
-
return validateTokens({
|
|
1002
|
-
tokens,
|
|
1003
|
-
themes: [themes.light, themes.dark, themes.highContrast]
|
|
1004
|
-
});
|
|
1005
|
-
}
|
|
1006
|
-
export {
|
|
1007
|
-
applyThemeToElement,
|
|
1008
|
-
cssVarNames,
|
|
1009
|
-
prefersColorScheme,
|
|
1010
|
-
themes,
|
|
1011
|
-
toCssVars,
|
|
1012
|
-
tokens,
|
|
1013
|
-
validateTokens2 as validateTokens
|
|
1014
|
-
};
|
|
1015
|
-
//# sourceMappingURL=index.js.map
|