@bison-lab/tokens 0.1.0 → 0.3.0
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/css/base.css +1 -1
- package/dist/index.d.mts +16 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +131 -151
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/css/base.css
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
body {
|
|
14
14
|
background-color: hsl(var(--background));
|
|
15
15
|
color: hsl(var(--foreground));
|
|
16
|
-
font-family: var(--font-
|
|
16
|
+
font-family: var(--font-body, ui-sans-serif, system-ui, sans-serif);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/* Locked focus ring style — color auto-follows brand */
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
//#region src/colors.d.ts
|
|
2
2
|
/**
|
|
3
3
|
* Color derivation engine.
|
|
4
|
-
* Takes
|
|
5
|
-
* for both light and dark modes.
|
|
4
|
+
* Takes brand colors (hex) + a grey scale selection and derives
|
|
5
|
+
* a full semantic palette for both light and dark modes.
|
|
6
|
+
*
|
|
7
|
+
* Brand colors → primary, secondary, accent, highlight
|
|
8
|
+
* Grey scale → background, foreground, card, popover, muted, border, input
|
|
6
9
|
*/
|
|
7
10
|
interface HSL {
|
|
8
11
|
h: number;
|
|
@@ -11,10 +14,16 @@ interface HSL {
|
|
|
11
14
|
}
|
|
12
15
|
declare function hexToHSL(hex: string): HSL;
|
|
13
16
|
declare function hslToString(hsl: HSL): string;
|
|
17
|
+
type GreyScale = "slate" | "gray" | "zinc" | "neutral" | "stone";
|
|
18
|
+
type GreyShade = "50" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | "950";
|
|
19
|
+
type GreyPalette = Record<GreyShade, string>;
|
|
20
|
+
declare const GREY_SCALES: Record<GreyScale, GreyPalette>;
|
|
14
21
|
interface BrandColors {
|
|
15
22
|
primary: string;
|
|
16
23
|
secondary: string;
|
|
17
24
|
accent?: string;
|
|
25
|
+
highlight?: string;
|
|
26
|
+
grey?: GreyScale;
|
|
18
27
|
}
|
|
19
28
|
interface SemanticPalette {
|
|
20
29
|
background: string;
|
|
@@ -29,6 +38,10 @@ interface SemanticPalette {
|
|
|
29
38
|
"secondary-foreground": string;
|
|
30
39
|
accent: string;
|
|
31
40
|
"accent-foreground": string;
|
|
41
|
+
"brand-accent": string;
|
|
42
|
+
"brand-accent-foreground": string;
|
|
43
|
+
highlight: string;
|
|
44
|
+
"highlight-foreground": string;
|
|
32
45
|
muted: string;
|
|
33
46
|
"muted-foreground": string;
|
|
34
47
|
destructive: string;
|
|
@@ -302,5 +315,5 @@ declare const zIndexTokens: {
|
|
|
302
315
|
};
|
|
303
316
|
type ZIndexToken = keyof typeof zIndexTokens;
|
|
304
317
|
//#endregion
|
|
305
|
-
export { type BrandColors, type DensityPreset, type FontWeightMap, type HSL, type MotionPreset, type RadiusPreset, type SemanticPalette, type ShadowPreset, type ZIndexToken, defaultFontWeights, densityPresets, deriveDarkPalette, deriveLightPalette, generatePaletteCSS, hexToHSL, hslToString, motionPresets, radiusPresets, shadowPresets, spacingScale, typeScale, zIndexTokens };
|
|
318
|
+
export { type BrandColors, type DensityPreset, type FontWeightMap, GREY_SCALES, type GreyScale, type HSL, type MotionPreset, type RadiusPreset, type SemanticPalette, type ShadowPreset, type ZIndexToken, defaultFontWeights, densityPresets, deriveDarkPalette, deriveLightPalette, generatePaletteCSS, hexToHSL, hslToString, motionPresets, radiusPresets, shadowPresets, spacingScale, typeScale, zIndexTokens };
|
|
306
319
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/colors.ts","../src/radius.ts","../src/shadows.ts","../src/motion.ts","../src/density.ts","../src/typography.ts","../src/spacing.ts","../src/z-index.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/colors.ts","../src/radius.ts","../src/shadows.ts","../src/motion.ts","../src/density.ts","../src/typography.ts","../src/spacing.ts","../src/z-index.ts"],"mappings":";;AASA;;;;;;;UAAiB,GAAA;EACf,CAAA;EACA,CAAA;EACA,CAAA;AAAA;AAAA,iBAGc,QAAA,CAAS,GAAA,WAAc,GAAA;AAAA,iBAmCvB,WAAA,CAAY,GAAA,EAAK,GAAA;AAAA,KAUrB,SAAA;AAAA,KAEP,SAAA;AAAA,KAEA,WAAA,GAAc,MAAA,CAAO,SAAA;AAAA,cAEb,WAAA,EAAa,MAAA,CAAO,SAAA,EAAW,WAAA;AAAA,UAsE3B,WAAA;EACf,OAAA;EACA,SAAA;EACA,MAAA;EACA,SAAA;EACA,IAAA,GAAO,SAAA;AAAA;AAAA,UAGQ,eAAA;EACf,UAAA;EACA,UAAA;EACA,IAAA;EACA,iBAAA;EACA,OAAA;EACA,oBAAA;EACA,OAAA;EACA,oBAAA;EACA,SAAA;EACA,sBAAA;EACA,MAAA;EACA,mBAAA;EACA,cAAA;EACA,yBAAA;EACA,SAAA;EACA,sBAAA;EACA,KAAA;EACA,kBAAA;EACA,WAAA;EACA,wBAAA;EACA,MAAA;EACA,KAAA;EACA,IAAA;AAAA;AAAA,iBAoBc,kBAAA,CAAmB,KAAA,EAAO,WAAA,GAAc,eAAA;AAAA,iBAkCxC,iBAAA,CAAkB,KAAA,EAAO,WAAA,GAAc,eAAA;AAAA,iBAkCvC,kBAAA,CAAmB,KAAA,EAAO,WAAA;;;cC/P7B,aAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmCD,YAAA,gBAA4B,aAAA;;;cCnC3B,aAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;KAwBD,YAAA,gBAA4B,aAAA;;;cCxB3B,aAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8BD,YAAA,gBAA4B,aAAA;;;cC9B3B,cAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0CD,aAAA,gBAA6B,cAAA;;;;cCzC5B,SAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAsCI,aAAA;EACf,MAAA;EACA,MAAA;EACA,QAAA;EACA,IAAA;AAAA;AAAA,cAGW,kBAAA,EAAoB,aAAA;;;;cC7CpB,YAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCAA,YAAA;EAAA;;;;;;;;;KAWD,WAAA,gBAA2B,YAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -36,173 +36,153 @@ function hslToString(hsl) {
|
|
|
36
36
|
function clamp(value, min, max) {
|
|
37
37
|
return Math.min(Math.max(value, min), max);
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
const GREY_SCALES = {
|
|
40
|
+
slate: {
|
|
41
|
+
"50": "210 40% 98%",
|
|
42
|
+
"100": "210 40% 96%",
|
|
43
|
+
"200": "214 32% 91%",
|
|
44
|
+
"300": "213 27% 84%",
|
|
45
|
+
"400": "215 20% 65%",
|
|
46
|
+
"500": "215 16% 47%",
|
|
47
|
+
"600": "215 19% 35%",
|
|
48
|
+
"700": "215 25% 27%",
|
|
49
|
+
"800": "217 33% 17%",
|
|
50
|
+
"900": "222 47% 11%",
|
|
51
|
+
"950": "229 84% 5%"
|
|
52
|
+
},
|
|
53
|
+
gray: {
|
|
54
|
+
"50": "210 20% 98%",
|
|
55
|
+
"100": "220 14% 96%",
|
|
56
|
+
"200": "220 13% 91%",
|
|
57
|
+
"300": "216 12% 84%",
|
|
58
|
+
"400": "218 11% 65%",
|
|
59
|
+
"500": "220 9% 46%",
|
|
60
|
+
"600": "215 14% 34%",
|
|
61
|
+
"700": "217 19% 27%",
|
|
62
|
+
"800": "215 28% 17%",
|
|
63
|
+
"900": "221 39% 11%",
|
|
64
|
+
"950": "224 71% 4%"
|
|
65
|
+
},
|
|
66
|
+
zinc: {
|
|
67
|
+
"50": "0 0% 98%",
|
|
68
|
+
"100": "240 5% 96%",
|
|
69
|
+
"200": "240 6% 90%",
|
|
70
|
+
"300": "240 5% 84%",
|
|
71
|
+
"400": "240 5% 65%",
|
|
72
|
+
"500": "240 4% 46%",
|
|
73
|
+
"600": "240 5% 34%",
|
|
74
|
+
"700": "240 5% 26%",
|
|
75
|
+
"800": "240 4% 16%",
|
|
76
|
+
"900": "240 6% 10%",
|
|
77
|
+
"950": "240 10% 4%"
|
|
78
|
+
},
|
|
79
|
+
neutral: {
|
|
80
|
+
"50": "0 0% 98%",
|
|
81
|
+
"100": "0 0% 96%",
|
|
82
|
+
"200": "0 0% 90%",
|
|
83
|
+
"300": "0 0% 83%",
|
|
84
|
+
"400": "0 0% 64%",
|
|
85
|
+
"500": "0 0% 45%",
|
|
86
|
+
"600": "0 0% 32%",
|
|
87
|
+
"700": "0 0% 25%",
|
|
88
|
+
"800": "0 0% 15%",
|
|
89
|
+
"900": "0 0% 9%",
|
|
90
|
+
"950": "0 0% 4%"
|
|
91
|
+
},
|
|
92
|
+
stone: {
|
|
93
|
+
"50": "60 9% 98%",
|
|
94
|
+
"100": "60 5% 96%",
|
|
95
|
+
"200": "20 6% 90%",
|
|
96
|
+
"300": "24 6% 83%",
|
|
97
|
+
"400": "24 5% 64%",
|
|
98
|
+
"500": "25 5% 45%",
|
|
99
|
+
"600": "33 5% 32%",
|
|
100
|
+
"700": "30 6% 25%",
|
|
101
|
+
"800": "12 6% 15%",
|
|
102
|
+
"900": "24 10% 10%",
|
|
103
|
+
"950": "20 14% 4%"
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
function contrastForeground(color) {
|
|
107
|
+
return color.l > 55 ? hslToString({
|
|
108
|
+
h: color.h,
|
|
109
|
+
s: clamp(color.s - 20, 0, 100),
|
|
110
|
+
l: 10
|
|
111
|
+
}) : hslToString({
|
|
112
|
+
h: color.h,
|
|
113
|
+
s: clamp(color.s - 25, 0, 100),
|
|
114
|
+
l: 98
|
|
115
|
+
});
|
|
44
116
|
}
|
|
45
|
-
function
|
|
46
|
-
return {
|
|
47
|
-
...
|
|
48
|
-
|
|
117
|
+
function boostForDark(color) {
|
|
118
|
+
if (color.l < 40) return {
|
|
119
|
+
...color,
|
|
120
|
+
l: clamp(color.l + 25, 0, 100)
|
|
49
121
|
};
|
|
122
|
+
return color;
|
|
50
123
|
}
|
|
51
124
|
function deriveLightPalette(brand) {
|
|
125
|
+
const grey = GREY_SCALES[brand.grey ?? "slate"];
|
|
52
126
|
const primary = hexToHSL(brand.primary);
|
|
53
127
|
const secondary = hexToHSL(brand.secondary);
|
|
54
|
-
const accent = brand.accent ? hexToHSL(brand.accent) :
|
|
55
|
-
|
|
56
|
-
s: clamp(primary.s - 10, 0, 100),
|
|
57
|
-
l: 90
|
|
58
|
-
};
|
|
128
|
+
const accent = brand.accent ? hexToHSL(brand.accent) : primary;
|
|
129
|
+
const highlight = brand.highlight ? hexToHSL(brand.highlight) : secondary;
|
|
59
130
|
return {
|
|
60
|
-
background:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
foreground:
|
|
66
|
-
h: primary.h,
|
|
67
|
-
s: clamp(primary.s - 20, 0, 100),
|
|
68
|
-
l: 10
|
|
69
|
-
}),
|
|
70
|
-
card: hslToString({
|
|
71
|
-
h: primary.h,
|
|
72
|
-
s: clamp(primary.s - 30, 0, 100),
|
|
73
|
-
l: 100
|
|
74
|
-
}),
|
|
75
|
-
"card-foreground": hslToString({
|
|
76
|
-
h: primary.h,
|
|
77
|
-
s: clamp(primary.s - 20, 0, 100),
|
|
78
|
-
l: 10
|
|
79
|
-
}),
|
|
80
|
-
popover: hslToString({
|
|
81
|
-
h: primary.h,
|
|
82
|
-
s: clamp(primary.s - 30, 0, 100),
|
|
83
|
-
l: 100
|
|
84
|
-
}),
|
|
85
|
-
"popover-foreground": hslToString({
|
|
86
|
-
h: primary.h,
|
|
87
|
-
s: clamp(primary.s - 20, 0, 100),
|
|
88
|
-
l: 10
|
|
89
|
-
}),
|
|
131
|
+
background: grey["50"],
|
|
132
|
+
foreground: grey["950"],
|
|
133
|
+
card: grey["50"],
|
|
134
|
+
"card-foreground": grey["950"],
|
|
135
|
+
popover: grey["50"],
|
|
136
|
+
"popover-foreground": grey["950"],
|
|
90
137
|
primary: hslToString(primary),
|
|
91
|
-
"primary-foreground":
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"
|
|
98
|
-
|
|
99
|
-
"
|
|
100
|
-
muted:
|
|
101
|
-
|
|
102
|
-
s: clamp(primary.s - 30, 0, 100),
|
|
103
|
-
l: 96
|
|
104
|
-
}),
|
|
105
|
-
"muted-foreground": hslToString({
|
|
106
|
-
h: primary.h,
|
|
107
|
-
s: clamp(primary.s - 25, 0, 100),
|
|
108
|
-
l: 45
|
|
109
|
-
}),
|
|
138
|
+
"primary-foreground": contrastForeground(primary),
|
|
139
|
+
secondary: hslToString(secondary),
|
|
140
|
+
"secondary-foreground": contrastForeground(secondary),
|
|
141
|
+
accent: grey["100"],
|
|
142
|
+
"accent-foreground": grey["950"],
|
|
143
|
+
"brand-accent": hslToString(accent),
|
|
144
|
+
"brand-accent-foreground": contrastForeground(accent),
|
|
145
|
+
highlight: hslToString(highlight),
|
|
146
|
+
"highlight-foreground": contrastForeground(highlight),
|
|
147
|
+
muted: grey["100"],
|
|
148
|
+
"muted-foreground": grey["500"],
|
|
110
149
|
destructive: "0 84% 60%",
|
|
111
150
|
"destructive-foreground": "0 0% 98%",
|
|
112
|
-
border:
|
|
113
|
-
|
|
114
|
-
s: clamp(primary.s - 25, 0, 100),
|
|
115
|
-
l: 91
|
|
116
|
-
}),
|
|
117
|
-
input: hslToString({
|
|
118
|
-
h: primary.h,
|
|
119
|
-
s: clamp(primary.s - 25, 0, 100),
|
|
120
|
-
l: 91
|
|
121
|
-
}),
|
|
151
|
+
border: grey["200"],
|
|
152
|
+
input: grey["200"],
|
|
122
153
|
ring: hslToString(primary)
|
|
123
154
|
};
|
|
124
155
|
}
|
|
125
156
|
function deriveDarkPalette(brand) {
|
|
126
|
-
const
|
|
127
|
-
const
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
l: 30
|
|
132
|
-
};
|
|
133
|
-
const darkPrimary = adjustLightness(primary, primary.l < 50 ? 20 : 0);
|
|
157
|
+
const grey = GREY_SCALES[brand.grey ?? "slate"];
|
|
158
|
+
const primary = boostForDark(hexToHSL(brand.primary));
|
|
159
|
+
const secondary = boostForDark(hexToHSL(brand.secondary));
|
|
160
|
+
const accent = boostForDark(brand.accent ? hexToHSL(brand.accent) : hexToHSL(brand.primary));
|
|
161
|
+
const highlight = boostForDark(brand.highlight ? hexToHSL(brand.highlight) : hexToHSL(brand.secondary));
|
|
134
162
|
return {
|
|
135
|
-
background:
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
foreground:
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
"
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
l: 98
|
|
154
|
-
}),
|
|
155
|
-
popover: hslToString({
|
|
156
|
-
h: primary.h,
|
|
157
|
-
s: clamp(primary.s - 25, 0, 100),
|
|
158
|
-
l: 10
|
|
159
|
-
}),
|
|
160
|
-
"popover-foreground": hslToString({
|
|
161
|
-
h: primary.h,
|
|
162
|
-
s: clamp(primary.s - 30, 0, 100),
|
|
163
|
-
l: 98
|
|
164
|
-
}),
|
|
165
|
-
primary: hslToString(darkPrimary),
|
|
166
|
-
"primary-foreground": hslToString(darkPrimary.l > 50 ? adjustLightness(darkPrimary, -80) : {
|
|
167
|
-
h: primary.h,
|
|
168
|
-
s: clamp(primary.s - 30, 0, 100),
|
|
169
|
-
l: 98
|
|
170
|
-
}),
|
|
171
|
-
secondary: hslToString({
|
|
172
|
-
h: secondary.h,
|
|
173
|
-
s: clamp(secondary.s - 20, 0, 100),
|
|
174
|
-
l: 18
|
|
175
|
-
}),
|
|
176
|
-
"secondary-foreground": hslToString(adjustLightness(secondary, 30)),
|
|
177
|
-
accent: hslToString({
|
|
178
|
-
h: accent.h,
|
|
179
|
-
s: clamp(accent.s - 10, 0, 100),
|
|
180
|
-
l: 20
|
|
181
|
-
}),
|
|
182
|
-
"accent-foreground": hslToString(adjustLightness(accent, 40)),
|
|
183
|
-
muted: hslToString({
|
|
184
|
-
h: primary.h,
|
|
185
|
-
s: clamp(primary.s - 25, 0, 100),
|
|
186
|
-
l: 18
|
|
187
|
-
}),
|
|
188
|
-
"muted-foreground": hslToString({
|
|
189
|
-
h: primary.h,
|
|
190
|
-
s: clamp(primary.s - 20, 0, 100),
|
|
191
|
-
l: 65
|
|
192
|
-
}),
|
|
163
|
+
background: grey["950"],
|
|
164
|
+
foreground: grey["50"],
|
|
165
|
+
card: grey["900"],
|
|
166
|
+
"card-foreground": grey["50"],
|
|
167
|
+
popover: grey["900"],
|
|
168
|
+
"popover-foreground": grey["50"],
|
|
169
|
+
primary: hslToString(primary),
|
|
170
|
+
"primary-foreground": contrastForeground(primary),
|
|
171
|
+
secondary: hslToString(secondary),
|
|
172
|
+
"secondary-foreground": contrastForeground(secondary),
|
|
173
|
+
accent: grey["800"],
|
|
174
|
+
"accent-foreground": grey["50"],
|
|
175
|
+
"brand-accent": hslToString(accent),
|
|
176
|
+
"brand-accent-foreground": contrastForeground(accent),
|
|
177
|
+
highlight: hslToString(highlight),
|
|
178
|
+
"highlight-foreground": contrastForeground(highlight),
|
|
179
|
+
muted: grey["800"],
|
|
180
|
+
"muted-foreground": grey["400"],
|
|
193
181
|
destructive: "0 62% 30%",
|
|
194
182
|
"destructive-foreground": "0 0% 98%",
|
|
195
|
-
border:
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
l: 18
|
|
199
|
-
}),
|
|
200
|
-
input: hslToString({
|
|
201
|
-
h: primary.h,
|
|
202
|
-
s: clamp(primary.s - 25, 0, 100),
|
|
203
|
-
l: 18
|
|
204
|
-
}),
|
|
205
|
-
ring: hslToString(darkPrimary)
|
|
183
|
+
border: grey["800"],
|
|
184
|
+
input: grey["800"],
|
|
185
|
+
ring: hslToString(primary)
|
|
206
186
|
};
|
|
207
187
|
}
|
|
208
188
|
function generatePaletteCSS(brand) {
|
|
@@ -467,6 +447,6 @@ const zIndexTokens = {
|
|
|
467
447
|
"--z-toast": "700"
|
|
468
448
|
};
|
|
469
449
|
//#endregion
|
|
470
|
-
export { defaultFontWeights, densityPresets, deriveDarkPalette, deriveLightPalette, generatePaletteCSS, hexToHSL, hslToString, motionPresets, radiusPresets, shadowPresets, spacingScale, typeScale, zIndexTokens };
|
|
450
|
+
export { GREY_SCALES, defaultFontWeights, densityPresets, deriveDarkPalette, deriveLightPalette, generatePaletteCSS, hexToHSL, hslToString, motionPresets, radiusPresets, shadowPresets, spacingScale, typeScale, zIndexTokens };
|
|
471
451
|
|
|
472
452
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/colors.ts","../src/radius.ts","../src/shadows.ts","../src/motion.ts","../src/density.ts","../src/typography.ts","../src/spacing.ts","../src/z-index.ts"],"sourcesContent":["/**\n * Color derivation engine.\n * Takes 2-3 brand colors (HSL) and auto-derives a full semantic palette\n * for both light and dark modes.\n */\n\nexport interface HSL {\n h: number;\n s: number;\n l: number;\n}\n\nexport function hexToHSL(hex: string): HSL {\n hex = hex.replace(\"#\", \"\");\n const r = parseInt(hex.substring(0, 2), 16) / 255;\n const g = parseInt(hex.substring(2, 4), 16) / 255;\n const b = parseInt(hex.substring(4, 6), 16) / 255;\n\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h = 0;\n let s = 0;\n\n if (max !== min) {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = ((g - b) / d + (g < b ? 6 : 0)) / 6;\n break;\n case g:\n h = ((b - r) / d + 2) / 6;\n break;\n case b:\n h = ((r - g) / d + 4) / 6;\n break;\n }\n }\n\n return {\n h: Math.round(h * 360),\n s: Math.round(s * 100),\n l: Math.round(l * 100),\n };\n}\n\nexport function hslToString(hsl: HSL): string {\n return `${hsl.h} ${hsl.s}% ${hsl.l}%`;\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\nfunction adjustLightness(hsl: HSL, amount: number): HSL {\n return { ...hsl, l: clamp(hsl.l + amount, 0, 100) };\n}\n\nfunction adjustSaturation(hsl: HSL, amount: number): HSL {\n return { ...hsl, s: clamp(hsl.s + amount, 0, 100) };\n}\n\nexport interface BrandColors {\n primary: string; // hex\n secondary: string; // hex\n accent?: string; // hex (optional, defaults to primary shifted)\n}\n\nexport interface SemanticPalette {\n background: string;\n foreground: string;\n card: string;\n \"card-foreground\": string;\n popover: string;\n \"popover-foreground\": string;\n primary: string;\n \"primary-foreground\": string;\n secondary: string;\n \"secondary-foreground\": string;\n accent: string;\n \"accent-foreground\": string;\n muted: string;\n \"muted-foreground\": string;\n destructive: string;\n \"destructive-foreground\": string;\n border: string;\n input: string;\n ring: string;\n}\n\nexport function deriveLightPalette(brand: BrandColors): SemanticPalette {\n const primary = hexToHSL(brand.primary);\n const secondary = hexToHSL(brand.secondary);\n const accent = brand.accent\n ? hexToHSL(brand.accent)\n : { h: (primary.h + 30) % 360, s: clamp(primary.s - 10, 0, 100), l: 90 };\n\n return {\n background: hslToString({ h: primary.h, s: clamp(primary.s - 30, 0, 100), l: 100 }),\n foreground: hslToString({ h: primary.h, s: clamp(primary.s - 20, 0, 100), l: 10 }),\n card: hslToString({ h: primary.h, s: clamp(primary.s - 30, 0, 100), l: 100 }),\n \"card-foreground\": hslToString({ h: primary.h, s: clamp(primary.s - 20, 0, 100), l: 10 }),\n popover: hslToString({ h: primary.h, s: clamp(primary.s - 30, 0, 100), l: 100 }),\n \"popover-foreground\": hslToString({ h: primary.h, s: clamp(primary.s - 20, 0, 100), l: 10 }),\n primary: hslToString(primary),\n \"primary-foreground\": hslToString(\n primary.l > 50\n ? adjustLightness(adjustSaturation(primary, -20), -80)\n : { h: primary.h, s: clamp(primary.s - 30, 0, 100), l: 98 }\n ),\n secondary: hslToString(adjustLightness(adjustSaturation(secondary, -30), 40)),\n \"secondary-foreground\": hslToString(adjustLightness(secondary, -30)),\n accent: hslToString(adjustLightness(accent, 10)),\n \"accent-foreground\": hslToString(adjustLightness(accent, -60)),\n muted: hslToString({ h: primary.h, s: clamp(primary.s - 30, 0, 100), l: 96 }),\n \"muted-foreground\": hslToString({ h: primary.h, s: clamp(primary.s - 25, 0, 100), l: 45 }),\n destructive: \"0 84% 60%\",\n \"destructive-foreground\": \"0 0% 98%\",\n border: hslToString({ h: primary.h, s: clamp(primary.s - 25, 0, 100), l: 91 }),\n input: hslToString({ h: primary.h, s: clamp(primary.s - 25, 0, 100), l: 91 }),\n ring: hslToString(primary),\n };\n}\n\nexport function deriveDarkPalette(brand: BrandColors): SemanticPalette {\n const primary = hexToHSL(brand.primary);\n const secondary = hexToHSL(brand.secondary);\n const accent = brand.accent\n ? hexToHSL(brand.accent)\n : { h: (primary.h + 30) % 360, s: clamp(primary.s - 10, 0, 100), l: 30 };\n\n const darkPrimary = adjustLightness(primary, primary.l < 50 ? 20 : 0);\n\n return {\n background: hslToString({ h: primary.h, s: clamp(primary.s - 25, 0, 100), l: 7 }),\n foreground: hslToString({ h: primary.h, s: clamp(primary.s - 30, 0, 100), l: 98 }),\n card: hslToString({ h: primary.h, s: clamp(primary.s - 25, 0, 100), l: 10 }),\n \"card-foreground\": hslToString({ h: primary.h, s: clamp(primary.s - 30, 0, 100), l: 98 }),\n popover: hslToString({ h: primary.h, s: clamp(primary.s - 25, 0, 100), l: 10 }),\n \"popover-foreground\": hslToString({ h: primary.h, s: clamp(primary.s - 30, 0, 100), l: 98 }),\n primary: hslToString(darkPrimary),\n \"primary-foreground\": hslToString(\n darkPrimary.l > 50\n ? adjustLightness(darkPrimary, -80)\n : { h: primary.h, s: clamp(primary.s - 30, 0, 100), l: 98 }\n ),\n secondary: hslToString({ h: secondary.h, s: clamp(secondary.s - 20, 0, 100), l: 18 }),\n \"secondary-foreground\": hslToString(adjustLightness(secondary, 30)),\n accent: hslToString({ h: accent.h, s: clamp(accent.s - 10, 0, 100), l: 20 }),\n \"accent-foreground\": hslToString(adjustLightness(accent, 40)),\n muted: hslToString({ h: primary.h, s: clamp(primary.s - 25, 0, 100), l: 18 }),\n \"muted-foreground\": hslToString({ h: primary.h, s: clamp(primary.s - 20, 0, 100), l: 65 }),\n destructive: \"0 62% 30%\",\n \"destructive-foreground\": \"0 0% 98%\",\n border: hslToString({ h: primary.h, s: clamp(primary.s - 25, 0, 100), l: 18 }),\n input: hslToString({ h: primary.h, s: clamp(primary.s - 25, 0, 100), l: 18 }),\n ring: hslToString(darkPrimary),\n };\n}\n\nexport function generatePaletteCSS(brand: BrandColors): string {\n const light = deriveLightPalette(brand);\n const dark = deriveDarkPalette(brand);\n\n const toVars = (palette: SemanticPalette, indent: string) =>\n Object.entries(palette)\n .map(([key, value]) => `${indent}--${key}: ${value};`)\n .join(\"\\n\");\n\n return `:root {\\n${toVars(light, \" \")}\\n}\\n\\n.dark {\\n${toVars(dark, \" \")}\\n}\\n`;\n}\n","export const radiusPresets = {\n sharp: {\n \"--radius\": \"0rem\",\n \"--radius-sm\": \"0rem\",\n \"--radius-md\": \"0rem\",\n \"--radius-lg\": \"0rem\",\n \"--radius-xl\": \"0rem\",\n \"--radius-full\": \"0rem\",\n },\n subtle: {\n \"--radius\": \"0.375rem\",\n \"--radius-sm\": \"0.125rem\",\n \"--radius-md\": \"0.375rem\",\n \"--radius-lg\": \"0.5rem\",\n \"--radius-xl\": \"0.75rem\",\n \"--radius-full\": \"9999px\",\n },\n rounded: {\n \"--radius\": \"0.5rem\",\n \"--radius-sm\": \"0.25rem\",\n \"--radius-md\": \"0.5rem\",\n \"--radius-lg\": \"0.75rem\",\n \"--radius-xl\": \"1rem\",\n \"--radius-full\": \"9999px\",\n },\n pill: {\n \"--radius\": \"0.75rem\",\n \"--radius-sm\": \"0.5rem\",\n \"--radius-md\": \"0.75rem\",\n \"--radius-lg\": \"1rem\",\n \"--radius-xl\": \"1.5rem\",\n \"--radius-full\": \"9999px\",\n },\n} as const;\n\nexport type RadiusPreset = keyof typeof radiusPresets;\n","export const shadowPresets = {\n flat: {\n \"--shadow-sm\": \"none\",\n \"--shadow\": \"none\",\n \"--shadow-md\": \"none\",\n \"--shadow-lg\": \"none\",\n \"--shadow-xl\": \"none\",\n },\n subtle: {\n \"--shadow-sm\": \"0 1px 2px 0 rgb(0 0 0 / 0.03)\",\n \"--shadow\": \"0 1px 3px 0 rgb(0 0 0 / 0.05), 0 1px 2px -1px rgb(0 0 0 / 0.05)\",\n \"--shadow-md\": \"0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05)\",\n \"--shadow-lg\": \"0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05)\",\n \"--shadow-xl\": \"0 20px 25px -5px rgb(0 0 0 / 0.05), 0 8px 10px -6px rgb(0 0 0 / 0.05)\",\n },\n elevated: {\n \"--shadow-sm\": \"0 1px 2px 0 rgb(0 0 0 / 0.06), 0 1px 3px 0 rgb(0 0 0 / 0.1)\",\n \"--shadow\": \"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)\",\n \"--shadow-md\": \"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)\",\n \"--shadow-lg\": \"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)\",\n \"--shadow-xl\": \"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)\",\n },\n} as const;\n\nexport type ShadowPreset = keyof typeof shadowPresets;\n","export const motionPresets = {\n snappy: {\n \"--duration-fast\": \"100ms\",\n \"--duration-normal\": \"150ms\",\n \"--duration-slow\": \"250ms\",\n \"--ease-default\": \"cubic-bezier(0.22, 1, 0.36, 1)\",\n \"--ease-in\": \"cubic-bezier(0.55, 0, 1, 0.45)\",\n \"--ease-out\": \"cubic-bezier(0, 0.55, 0.45, 1)\",\n \"--ease-in-out\": \"cubic-bezier(0.65, 0, 0.35, 1)\",\n },\n smooth: {\n \"--duration-fast\": \"150ms\",\n \"--duration-normal\": \"200ms\",\n \"--duration-slow\": \"350ms\",\n \"--ease-default\": \"cubic-bezier(0.25, 0.1, 0.25, 1)\",\n \"--ease-in\": \"cubic-bezier(0.42, 0, 1, 1)\",\n \"--ease-out\": \"cubic-bezier(0, 0, 0.58, 1)\",\n \"--ease-in-out\": \"cubic-bezier(0.42, 0, 0.58, 1)\",\n },\n minimal: {\n \"--duration-fast\": \"75ms\",\n \"--duration-normal\": \"100ms\",\n \"--duration-slow\": \"200ms\",\n \"--ease-default\": \"linear\",\n \"--ease-in\": \"linear\",\n \"--ease-out\": \"linear\",\n \"--ease-in-out\": \"linear\",\n },\n} as const;\n\nexport type MotionPreset = keyof typeof motionPresets;\n","export const densityPresets = {\n compact: {\n \"--density-padding-xs\": \"0.125rem\",\n \"--density-padding-sm\": \"0.25rem\",\n \"--density-padding-md\": \"0.375rem\",\n \"--density-padding-lg\": \"0.5rem\",\n \"--density-padding-xl\": \"0.75rem\",\n \"--density-gap-sm\": \"0.25rem\",\n \"--density-gap-md\": \"0.5rem\",\n \"--density-gap-lg\": \"0.75rem\",\n \"--density-height-sm\": \"1.75rem\",\n \"--density-height-md\": \"2rem\",\n \"--density-height-lg\": \"2.5rem\",\n },\n default: {\n \"--density-padding-xs\": \"0.25rem\",\n \"--density-padding-sm\": \"0.5rem\",\n \"--density-padding-md\": \"0.75rem\",\n \"--density-padding-lg\": \"1rem\",\n \"--density-padding-xl\": \"1.5rem\",\n \"--density-gap-sm\": \"0.5rem\",\n \"--density-gap-md\": \"0.75rem\",\n \"--density-gap-lg\": \"1rem\",\n \"--density-height-sm\": \"2rem\",\n \"--density-height-md\": \"2.5rem\",\n \"--density-height-lg\": \"3rem\",\n },\n spacious: {\n \"--density-padding-xs\": \"0.5rem\",\n \"--density-padding-sm\": \"0.75rem\",\n \"--density-padding-md\": \"1rem\",\n \"--density-padding-lg\": \"1.5rem\",\n \"--density-padding-xl\": \"2rem\",\n \"--density-gap-sm\": \"0.75rem\",\n \"--density-gap-md\": \"1rem\",\n \"--density-gap-lg\": \"1.5rem\",\n \"--density-height-sm\": \"2.5rem\",\n \"--density-height-md\": \"3rem\",\n \"--density-height-lg\": \"3.5rem\",\n },\n} as const;\n\nexport type DensityPreset = keyof typeof densityPresets;\n","/** Locked type scale — consumers cannot override sizes, only font-family and weights. */\nexport const typeScale = {\n \"text-xs\": { fontSize: \"0.75rem\", lineHeight: \"1rem\" },\n \"text-sm\": { fontSize: \"0.875rem\", lineHeight: \"1.25rem\" },\n \"text-base\": { fontSize: \"1rem\", lineHeight: \"1.5rem\" },\n \"text-lg\": { fontSize: \"1.125rem\", lineHeight: \"1.75rem\" },\n \"text-xl\": { fontSize: \"1.25rem\", lineHeight: \"1.75rem\" },\n \"text-2xl\": { fontSize: \"1.5rem\", lineHeight: \"2rem\" },\n \"text-3xl\": { fontSize: \"1.875rem\", lineHeight: \"2.25rem\" },\n \"text-4xl\": { fontSize: \"2.25rem\", lineHeight: \"2.5rem\" },\n\n // Fluid headings using clamp()\n \"heading-sm\": {\n fontSize: \"clamp(1.125rem, 1rem + 0.5vw, 1.25rem)\",\n lineHeight: \"1.4\",\n letterSpacing: \"-0.01em\",\n },\n \"heading-md\": {\n fontSize: \"clamp(1.25rem, 1rem + 1vw, 1.875rem)\",\n lineHeight: \"1.3\",\n letterSpacing: \"-0.015em\",\n },\n \"heading-lg\": {\n fontSize: \"clamp(1.5rem, 1rem + 2vw, 2.25rem)\",\n lineHeight: \"1.2\",\n letterSpacing: \"-0.02em\",\n },\n \"heading-xl\": {\n fontSize: \"clamp(1.875rem, 1rem + 3vw, 3rem)\",\n lineHeight: \"1.1\",\n letterSpacing: \"-0.025em\",\n },\n \"heading-2xl\": {\n fontSize: \"clamp(2.25rem, 1rem + 4vw, 3.75rem)\",\n lineHeight: \"1.1\",\n letterSpacing: \"-0.03em\",\n },\n} as const;\n\nexport interface FontWeightMap {\n normal: number;\n medium: number;\n semibold: number;\n bold: number;\n}\n\nexport const defaultFontWeights: FontWeightMap = {\n normal: 400,\n medium: 500,\n semibold: 600,\n bold: 700,\n};\n","/** Locked spacing scale — 4px (0.25rem) base grid. Not consumer-overridable. */\nexport const spacingScale = {\n \"0\": \"0\",\n \"0.5\": \"0.125rem\",\n \"1\": \"0.25rem\",\n \"1.5\": \"0.375rem\",\n \"2\": \"0.5rem\",\n \"2.5\": \"0.625rem\",\n \"3\": \"0.75rem\",\n \"3.5\": \"0.875rem\",\n \"4\": \"1rem\",\n \"5\": \"1.25rem\",\n \"6\": \"1.5rem\",\n \"7\": \"1.75rem\",\n \"8\": \"2rem\",\n \"9\": \"2.25rem\",\n \"10\": \"2.5rem\",\n \"11\": \"2.75rem\",\n \"12\": \"3rem\",\n \"14\": \"3.5rem\",\n \"16\": \"4rem\",\n \"20\": \"5rem\",\n \"24\": \"6rem\",\n \"28\": \"7rem\",\n \"32\": \"8rem\",\n \"36\": \"9rem\",\n \"40\": \"10rem\",\n \"44\": \"11rem\",\n \"48\": \"12rem\",\n \"52\": \"13rem\",\n \"56\": \"14rem\",\n \"60\": \"15rem\",\n \"64\": \"16rem\",\n \"72\": \"18rem\",\n \"80\": \"20rem\",\n \"96\": \"24rem\",\n} as const;\n","/** Z-index tokens — overridable by consumers via CSS custom properties. */\nexport const zIndexTokens = {\n \"--z-dropdown\": \"50\",\n \"--z-sticky\": \"100\",\n \"--z-fixed\": \"200\",\n \"--z-modal-backdrop\": \"300\",\n \"--z-modal\": \"400\",\n \"--z-popover\": \"500\",\n \"--z-tooltip\": \"600\",\n \"--z-toast\": \"700\",\n} as const;\n\nexport type ZIndexToken = keyof typeof zIndexTokens;\n"],"mappings":";AAYA,SAAgB,SAAS,KAAkB;AACzC,OAAM,IAAI,QAAQ,KAAK,GAAG;CAC1B,MAAM,IAAI,SAAS,IAAI,UAAU,GAAG,EAAE,EAAE,GAAG,GAAG;CAC9C,MAAM,IAAI,SAAS,IAAI,UAAU,GAAG,EAAE,EAAE,GAAG,GAAG;CAC9C,MAAM,IAAI,SAAS,IAAI,UAAU,GAAG,EAAE,EAAE,GAAG,GAAG;CAE9C,MAAM,MAAM,KAAK,IAAI,GAAG,GAAG,EAAE;CAC7B,MAAM,MAAM,KAAK,IAAI,GAAG,GAAG,EAAE;CAC7B,MAAM,KAAK,MAAM,OAAO;CACxB,IAAI,IAAI;CACR,IAAI,IAAI;AAER,KAAI,QAAQ,KAAK;EACf,MAAM,IAAI,MAAM;AAChB,MAAI,IAAI,KAAM,KAAK,IAAI,MAAM,OAAO,KAAK,MAAM;AAC/C,UAAQ,KAAR;GACE,KAAK;AACH,UAAM,IAAI,KAAK,KAAK,IAAI,IAAI,IAAI,MAAM;AACtC;GACF,KAAK;AACH,UAAM,IAAI,KAAK,IAAI,KAAK;AACxB;GACF,KAAK;AACH,UAAM,IAAI,KAAK,IAAI,KAAK;AACxB;;;AAIN,QAAO;EACL,GAAG,KAAK,MAAM,IAAI,IAAI;EACtB,GAAG,KAAK,MAAM,IAAI,IAAI;EACtB,GAAG,KAAK,MAAM,IAAI,IAAI;EACvB;;AAGH,SAAgB,YAAY,KAAkB;AAC5C,QAAO,GAAG,IAAI,EAAE,GAAG,IAAI,EAAE,IAAI,IAAI,EAAE;;AAGrC,SAAS,MA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;CAC1D,aAAa;EAAE,UAAU;EAAQ,YAAY;EAAU;CACvD,WAAW;EAAE,UAAU;EAAY,YAAY;EAAW;CAC1D,WAAW;EAAE,UAAU;EAAW,YAAY;EAAW;CACzD,YAAY;EAAE,UAAU;EAAU,YAAY;EAAQ;CACtD,YAAY;EAAE,UAAU;EAAY,YAAY;EAAW;CAC3D,YAAY;EAAE,UAAU;EAAW,YAAY;EAAU;CAGzD,cAAc;EACZ,UAAU;EACV,YAAY;EACZ,eAAe;EAChB;CACD,cAAc;EACZ,UAAU;EACV,YAAY;EACZ,eAAe;EAChB;CACD,cAAc;EACZ,UAAU;EACV,YAAY;EACZ,eAAe;EAChB;CACD,cAAc;EACZ,UAAU;EACV,YAAY;EACZ,eAAe;EAChB;CACD,eAAe;EACb,UAAU;EACV,YAAY;EACZ,eAAe;EAChB;CACF;AASD,MAAa,qBAAoC;CAC/C,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,MAAM;CACP;;;;AClDD,MAAa,eAAe;CAC1B,KAAK;CACL,OAAO;CACP,KAAK;CACL,OAAO;CACP,KAAK;CACL,OAAO;CACP,KAAK;CACL,OAAO;CACP,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACP;;;;ACnCD,MAAa,eAAe;CAC1B,gBAAgB;CAChB,cAAc;CACd,aAAa;CACb,sBAAsB;CACtB,aAAa;CACb,eAAe;CACf,eAAe;CACf,aAAa;CACd"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/colors.ts","../src/radius.ts","../src/shadows.ts","../src/motion.ts","../src/density.ts","../src/typography.ts","../src/spacing.ts","../src/z-index.ts"],"sourcesContent":["/**\n * Color derivation engine.\n * Takes brand colors (hex) + a grey scale selection and derives\n * a full semantic palette for both light and dark modes.\n *\n * Brand colors → primary, secondary, accent, highlight\n * Grey scale → background, foreground, card, popover, muted, border, input\n */\n\nexport interface HSL {\n h: number;\n s: number;\n l: number;\n}\n\nexport function hexToHSL(hex: string): HSL {\n hex = hex.replace(\"#\", \"\");\n const r = parseInt(hex.substring(0, 2), 16) / 255;\n const g = parseInt(hex.substring(2, 4), 16) / 255;\n const b = parseInt(hex.substring(4, 6), 16) / 255;\n\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h = 0;\n let s = 0;\n\n if (max !== min) {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = ((g - b) / d + (g < b ? 6 : 0)) / 6;\n break;\n case g:\n h = ((b - r) / d + 2) / 6;\n break;\n case b:\n h = ((r - g) / d + 4) / 6;\n break;\n }\n }\n\n return {\n h: Math.round(h * 360),\n s: Math.round(s * 100),\n l: Math.round(l * 100),\n };\n}\n\nexport function hslToString(hsl: HSL): string {\n return `${hsl.h} ${hsl.s}% ${hsl.l}%`;\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\n// --- Grey scale palettes (Tailwind v4 values as HSL strings) ---\n\nexport type GreyScale = \"slate\" | \"gray\" | \"zinc\" | \"neutral\" | \"stone\";\n\ntype GreyShade = \"50\" | \"100\" | \"200\" | \"300\" | \"400\" | \"500\" | \"600\" | \"700\" | \"800\" | \"900\" | \"950\";\n\ntype GreyPalette = Record<GreyShade, string>;\n\nexport const GREY_SCALES: Record<GreyScale, GreyPalette> = {\n slate: {\n \"50\": \"210 40% 98%\",\n \"100\": \"210 40% 96%\",\n \"200\": \"214 32% 91%\",\n \"300\": \"213 27% 84%\",\n \"400\": \"215 20% 65%\",\n \"500\": \"215 16% 47%\",\n \"600\": \"215 19% 35%\",\n \"700\": \"215 25% 27%\",\n \"800\": \"217 33% 17%\",\n \"900\": \"222 47% 11%\",\n \"950\": \"229 84% 5%\",\n },\n gray: {\n \"50\": \"210 20% 98%\",\n \"100\": \"220 14% 96%\",\n \"200\": \"220 13% 91%\",\n \"300\": \"216 12% 84%\",\n \"400\": \"218 11% 65%\",\n \"500\": \"220 9% 46%\",\n \"600\": \"215 14% 34%\",\n \"700\": \"217 19% 27%\",\n \"800\": \"215 28% 17%\",\n \"900\": \"221 39% 11%\",\n \"950\": \"224 71% 4%\",\n },\n zinc: {\n \"50\": \"0 0% 98%\",\n \"100\": \"240 5% 96%\",\n \"200\": \"240 6% 90%\",\n \"300\": \"240 5% 84%\",\n \"400\": \"240 5% 65%\",\n \"500\": \"240 4% 46%\",\n \"600\": \"240 5% 34%\",\n \"700\": \"240 5% 26%\",\n \"800\": \"240 4% 16%\",\n \"900\": \"240 6% 10%\",\n \"950\": \"240 10% 4%\",\n },\n neutral: {\n \"50\": \"0 0% 98%\",\n \"100\": \"0 0% 96%\",\n \"200\": \"0 0% 90%\",\n \"300\": \"0 0% 83%\",\n \"400\": \"0 0% 64%\",\n \"500\": \"0 0% 45%\",\n \"600\": \"0 0% 32%\",\n \"700\": \"0 0% 25%\",\n \"800\": \"0 0% 15%\",\n \"900\": \"0 0% 9%\",\n \"950\": \"0 0% 4%\",\n },\n stone: {\n \"50\": \"60 9% 98%\",\n \"100\": \"60 5% 96%\",\n \"200\": \"20 6% 90%\",\n \"300\": \"24 6% 83%\",\n \"400\": \"24 5% 64%\",\n \"500\": \"25 5% 45%\",\n \"600\": \"33 5% 32%\",\n \"700\": \"30 6% 25%\",\n \"800\": \"12 6% 15%\",\n \"900\": \"24 10% 10%\",\n \"950\": \"20 14% 4%\",\n },\n};\n\n// --- Brand color types ---\n\nexport interface BrandColors {\n primary: string; // hex\n secondary: string; // hex\n accent?: string; // hex\n highlight?: string; // hex\n grey?: GreyScale; // defaults to \"slate\"\n}\n\nexport interface SemanticPalette {\n background: string;\n foreground: string;\n card: string;\n \"card-foreground\": string;\n popover: string;\n \"popover-foreground\": string;\n primary: string;\n \"primary-foreground\": string;\n secondary: string;\n \"secondary-foreground\": string;\n accent: string;\n \"accent-foreground\": string;\n \"brand-accent\": string;\n \"brand-accent-foreground\": string;\n highlight: string;\n \"highlight-foreground\": string;\n muted: string;\n \"muted-foreground\": string;\n destructive: string;\n \"destructive-foreground\": string;\n border: string;\n input: string;\n ring: string;\n}\n\n// --- Foreground contrast ---\n\nfunction contrastForeground(color: HSL): string {\n return color.l > 55\n ? hslToString({ h: color.h, s: clamp(color.s - 20, 0, 100), l: 10 })\n : hslToString({ h: color.h, s: clamp(color.s - 25, 0, 100), l: 98 });\n}\n\nfunction boostForDark(color: HSL): HSL {\n if (color.l < 40) {\n return { ...color, l: clamp(color.l + 25, 0, 100) };\n }\n return color;\n}\n\n// --- Palette derivation ---\n\nexport function deriveLightPalette(brand: BrandColors): SemanticPalette {\n const grey = GREY_SCALES[brand.grey ?? \"slate\"];\n const primary = hexToHSL(brand.primary);\n const secondary = hexToHSL(brand.secondary);\n const accent = brand.accent ? hexToHSL(brand.accent) : primary;\n const highlight = brand.highlight ? hexToHSL(brand.highlight) : secondary;\n\n return {\n background: grey[\"50\"],\n foreground: grey[\"950\"],\n card: grey[\"50\"],\n \"card-foreground\": grey[\"950\"],\n popover: grey[\"50\"],\n \"popover-foreground\": grey[\"950\"],\n primary: hslToString(primary),\n \"primary-foreground\": contrastForeground(primary),\n secondary: hslToString(secondary),\n \"secondary-foreground\": contrastForeground(secondary),\n accent: grey[\"100\"],\n \"accent-foreground\": grey[\"950\"],\n \"brand-accent\": hslToString(accent),\n \"brand-accent-foreground\": contrastForeground(accent),\n highlight: hslToString(highlight),\n \"highlight-foreground\": contrastForeground(highlight),\n muted: grey[\"100\"],\n \"muted-foreground\": grey[\"500\"],\n destructive: \"0 84% 60%\",\n \"destructive-foreground\": \"0 0% 98%\",\n border: grey[\"200\"],\n input: grey[\"200\"],\n ring: hslToString(primary),\n };\n}\n\nexport function deriveDarkPalette(brand: BrandColors): SemanticPalette {\n const grey = GREY_SCALES[brand.grey ?? \"slate\"];\n const primary = boostForDark(hexToHSL(brand.primary));\n const secondary = boostForDark(hexToHSL(brand.secondary));\n const accent = boostForDark(brand.accent ? hexToHSL(brand.accent) : hexToHSL(brand.primary));\n const highlight = boostForDark(brand.highlight ? hexToHSL(brand.highlight) : hexToHSL(brand.secondary));\n\n return {\n background: grey[\"950\"],\n foreground: grey[\"50\"],\n card: grey[\"900\"],\n \"card-foreground\": grey[\"50\"],\n popover: grey[\"900\"],\n \"popover-foreground\": grey[\"50\"],\n primary: hslToString(primary),\n \"primary-foreground\": contrastForeground(primary),\n secondary: hslToString(secondary),\n \"secondary-foreground\": contrastForeground(secondary),\n accent: grey[\"800\"],\n \"accent-foreground\": grey[\"50\"],\n \"brand-accent\": hslToString(accent),\n \"brand-accent-foreground\": contrastForeground(accent),\n highlight: hslToString(highlight),\n \"highlight-foreground\": contrastForeground(highlight),\n muted: grey[\"800\"],\n \"muted-foreground\": grey[\"400\"],\n destructive: \"0 62% 30%\",\n \"destructive-foreground\": \"0 0% 98%\",\n border: grey[\"800\"],\n input: grey[\"800\"],\n ring: hslToString(primary),\n };\n}\n\nexport function generatePaletteCSS(brand: BrandColors): string {\n const light = deriveLightPalette(brand);\n const dark = deriveDarkPalette(brand);\n\n const toVars = (palette: SemanticPalette, indent: string) =>\n Object.entries(palette)\n .map(([key, value]) => `${indent}--${key}: ${value};`)\n .join(\"\\n\");\n\n return `:root {\\n${toVars(light, \" \")}\\n}\\n\\n.dark {\\n${toVars(dark, \" \")}\\n}\\n`;\n}\n","export const radiusPresets = {\n sharp: {\n \"--radius\": \"0rem\",\n \"--radius-sm\": \"0rem\",\n \"--radius-md\": \"0rem\",\n \"--radius-lg\": \"0rem\",\n \"--radius-xl\": \"0rem\",\n \"--radius-full\": \"0rem\",\n },\n subtle: {\n \"--radius\": \"0.375rem\",\n \"--radius-sm\": \"0.125rem\",\n \"--radius-md\": \"0.375rem\",\n \"--radius-lg\": \"0.5rem\",\n \"--radius-xl\": \"0.75rem\",\n \"--radius-full\": \"9999px\",\n },\n rounded: {\n \"--radius\": \"0.5rem\",\n \"--radius-sm\": \"0.25rem\",\n \"--radius-md\": \"0.5rem\",\n \"--radius-lg\": \"0.75rem\",\n \"--radius-xl\": \"1rem\",\n \"--radius-full\": \"9999px\",\n },\n pill: {\n \"--radius\": \"0.75rem\",\n \"--radius-sm\": \"0.5rem\",\n \"--radius-md\": \"0.75rem\",\n \"--radius-lg\": \"1rem\",\n \"--radius-xl\": \"1.5rem\",\n \"--radius-full\": \"9999px\",\n },\n} as const;\n\nexport type RadiusPreset = keyof typeof radiusPresets;\n","export const shadowPresets = {\n flat: {\n \"--shadow-sm\": \"none\",\n \"--shadow\": \"none\",\n \"--shadow-md\": \"none\",\n \"--shadow-lg\": \"none\",\n \"--shadow-xl\": \"none\",\n },\n subtle: {\n \"--shadow-sm\": \"0 1px 2px 0 rgb(0 0 0 / 0.03)\",\n \"--shadow\": \"0 1px 3px 0 rgb(0 0 0 / 0.05), 0 1px 2px -1px rgb(0 0 0 / 0.05)\",\n \"--shadow-md\": \"0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05)\",\n \"--shadow-lg\": \"0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05)\",\n \"--shadow-xl\": \"0 20px 25px -5px rgb(0 0 0 / 0.05), 0 8px 10px -6px rgb(0 0 0 / 0.05)\",\n },\n elevated: {\n \"--shadow-sm\": \"0 1px 2px 0 rgb(0 0 0 / 0.06), 0 1px 3px 0 rgb(0 0 0 / 0.1)\",\n \"--shadow\": \"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)\",\n \"--shadow-md\": \"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)\",\n \"--shadow-lg\": \"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)\",\n \"--shadow-xl\": \"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)\",\n },\n} as const;\n\nexport type ShadowPreset = keyof typeof shadowPresets;\n","export const motionPresets = {\n snappy: {\n \"--duration-fast\": \"100ms\",\n \"--duration-normal\": \"150ms\",\n \"--duration-slow\": \"250ms\",\n \"--ease-default\": \"cubic-bezier(0.22, 1, 0.36, 1)\",\n \"--ease-in\": \"cubic-bezier(0.55, 0, 1, 0.45)\",\n \"--ease-out\": \"cubic-bezier(0, 0.55, 0.45, 1)\",\n \"--ease-in-out\": \"cubic-bezier(0.65, 0, 0.35, 1)\",\n },\n smooth: {\n \"--duration-fast\": \"150ms\",\n \"--duration-normal\": \"200ms\",\n \"--duration-slow\": \"350ms\",\n \"--ease-default\": \"cubic-bezier(0.25, 0.1, 0.25, 1)\",\n \"--ease-in\": \"cubic-bezier(0.42, 0, 1, 1)\",\n \"--ease-out\": \"cubic-bezier(0, 0, 0.58, 1)\",\n \"--ease-in-out\": \"cubic-bezier(0.42, 0, 0.58, 1)\",\n },\n minimal: {\n \"--duration-fast\": \"75ms\",\n \"--duration-normal\": \"100ms\",\n \"--duration-slow\": \"200ms\",\n \"--ease-default\": \"linear\",\n \"--ease-in\": \"linear\",\n \"--ease-out\": \"linear\",\n \"--ease-in-out\": \"linear\",\n },\n} as const;\n\nexport type MotionPreset = keyof typeof motionPresets;\n","export const densityPresets = {\n compact: {\n \"--density-padding-xs\": \"0.125rem\",\n \"--density-padding-sm\": \"0.25rem\",\n \"--density-padding-md\": \"0.375rem\",\n \"--density-padding-lg\": \"0.5rem\",\n \"--density-padding-xl\": \"0.75rem\",\n \"--density-gap-sm\": \"0.25rem\",\n \"--density-gap-md\": \"0.5rem\",\n \"--density-gap-lg\": \"0.75rem\",\n \"--density-height-sm\": \"1.75rem\",\n \"--density-height-md\": \"2rem\",\n \"--density-height-lg\": \"2.5rem\",\n },\n default: {\n \"--density-padding-xs\": \"0.25rem\",\n \"--density-padding-sm\": \"0.5rem\",\n \"--density-padding-md\": \"0.75rem\",\n \"--density-padding-lg\": \"1rem\",\n \"--density-padding-xl\": \"1.5rem\",\n \"--density-gap-sm\": \"0.5rem\",\n \"--density-gap-md\": \"0.75rem\",\n \"--density-gap-lg\": \"1rem\",\n \"--density-height-sm\": \"2rem\",\n \"--density-height-md\": \"2.5rem\",\n \"--density-height-lg\": \"3rem\",\n },\n spacious: {\n \"--density-padding-xs\": \"0.5rem\",\n \"--density-padding-sm\": \"0.75rem\",\n \"--density-padding-md\": \"1rem\",\n \"--density-padding-lg\": \"1.5rem\",\n \"--density-padding-xl\": \"2rem\",\n \"--density-gap-sm\": \"0.75rem\",\n \"--density-gap-md\": \"1rem\",\n \"--density-gap-lg\": \"1.5rem\",\n \"--density-height-sm\": \"2.5rem\",\n \"--density-height-md\": \"3rem\",\n \"--density-height-lg\": \"3.5rem\",\n },\n} as const;\n\nexport type DensityPreset = keyof typeof densityPresets;\n","/** Locked type scale — consumers cannot override sizes, only font-family and weights. */\nexport const typeScale = {\n \"text-xs\": { fontSize: \"0.75rem\", lineHeight: \"1rem\" },\n \"text-sm\": { fontSize: \"0.875rem\", lineHeight: \"1.25rem\" },\n \"text-base\": { fontSize: \"1rem\", lineHeight: \"1.5rem\" },\n \"text-lg\": { fontSize: \"1.125rem\", lineHeight: \"1.75rem\" },\n \"text-xl\": { fontSize: \"1.25rem\", lineHeight: \"1.75rem\" },\n \"text-2xl\": { fontSize: \"1.5rem\", lineHeight: \"2rem\" },\n \"text-3xl\": { fontSize: \"1.875rem\", lineHeight: \"2.25rem\" },\n \"text-4xl\": { fontSize: \"2.25rem\", lineHeight: \"2.5rem\" },\n\n // Fluid headings using clamp()\n \"heading-sm\": {\n fontSize: \"clamp(1.125rem, 1rem + 0.5vw, 1.25rem)\",\n lineHeight: \"1.4\",\n letterSpacing: \"-0.01em\",\n },\n \"heading-md\": {\n fontSize: \"clamp(1.25rem, 1rem + 1vw, 1.875rem)\",\n lineHeight: \"1.3\",\n letterSpacing: \"-0.015em\",\n },\n \"heading-lg\": {\n fontSize: \"clamp(1.5rem, 1rem + 2vw, 2.25rem)\",\n lineHeight: \"1.2\",\n letterSpacing: \"-0.02em\",\n },\n \"heading-xl\": {\n fontSize: \"clamp(1.875rem, 1rem + 3vw, 3rem)\",\n lineHeight: \"1.1\",\n letterSpacing: \"-0.025em\",\n },\n \"heading-2xl\": {\n fontSize: \"clamp(2.25rem, 1rem + 4vw, 3.75rem)\",\n lineHeight: \"1.1\",\n letterSpacing: \"-0.03em\",\n },\n} as const;\n\nexport interface FontWeightMap {\n normal: number;\n medium: number;\n semibold: number;\n bold: number;\n}\n\nexport const defaultFontWeights: FontWeightMap = {\n normal: 400,\n medium: 500,\n semibold: 600,\n bold: 700,\n};\n","/** Locked spacing scale — 4px (0.25rem) base grid. Not consumer-overridable. */\nexport const spacingScale = {\n \"0\": \"0\",\n \"0.5\": \"0.125rem\",\n \"1\": \"0.25rem\",\n \"1.5\": \"0.375rem\",\n \"2\": \"0.5rem\",\n \"2.5\": \"0.625rem\",\n \"3\": \"0.75rem\",\n \"3.5\": \"0.875rem\",\n \"4\": \"1rem\",\n \"5\": \"1.25rem\",\n \"6\": \"1.5rem\",\n \"7\": \"1.75rem\",\n \"8\": \"2rem\",\n \"9\": \"2.25rem\",\n \"10\": \"2.5rem\",\n \"11\": \"2.75rem\",\n \"12\": \"3rem\",\n \"14\": \"3.5rem\",\n \"16\": \"4rem\",\n \"20\": \"5rem\",\n \"24\": \"6rem\",\n \"28\": \"7rem\",\n \"32\": \"8rem\",\n \"36\": \"9rem\",\n \"40\": \"10rem\",\n \"44\": \"11rem\",\n \"48\": \"12rem\",\n \"52\": \"13rem\",\n \"56\": \"14rem\",\n \"60\": \"15rem\",\n \"64\": \"16rem\",\n \"72\": \"18rem\",\n \"80\": \"20rem\",\n \"96\": \"24rem\",\n} as const;\n","/** Z-index tokens — overridable by consumers via CSS custom properties. */\nexport const zIndexTokens = {\n \"--z-dropdown\": \"50\",\n \"--z-sticky\": \"100\",\n \"--z-fixed\": \"200\",\n \"--z-modal-backdrop\": \"300\",\n \"--z-modal\": \"400\",\n \"--z-popover\": \"500\",\n \"--z-tooltip\": \"600\",\n \"--z-toast\": \"700\",\n} as const;\n\nexport type ZIndexToken = keyof typeof zIndexTokens;\n"],"mappings":";AAeA,SAAgB,SAAS,KAAkB;AACzC,OAAM,IAAI,QAAQ,KAAK,GAAG;CAC1B,MAAM,IAAI,SAAS,IAAI,UAAU,GAAG,EAAE,EAAE,GAAG,GAAG;CAC9C,MAAM,IAAI,SAAS,IAAI,UAAU,GAAG,EAAE,EAAE,GAAG,GAAG;CAC9C,MAAM,IAAI,SAAS,IAAI,UAAU,GAAG,EAAE,EAAE,GAAG,GAAG;CAE9C,MAAM,MAAM,KAAK,IAAI,GAAG,GAAG,EAAE;CAC7B,MAAM,MAAM,KAAK,IAAI,GAAG,GAAG,EAAE;CAC7B,MAAM,KAAK,MAAM,OAAO;CACxB,IAAI,IAAI;CACR,IAAI,IAAI;AAER,KAAI,QAAQ,KAAK;EACf,MAAM,IAAI,MAAM;AAChB,MAAI,IAAI,KAAM,KAAK,IAAI,MAAM,OAAO,KAAK,MAAM;AAC/C,UAAQ,KAAR;GACE,KAAK;AACH,UAAM,IAAI,KAAK,KAAK,IAAI,IAAI,IAAI,MAAM;AACtC;GACF,KAAK;AACH,UAAM,IAAI,KAAK,IAAI,KAAK;AACxB;GACF,KAAK;AACH,UAAM,IAAI,KAAK,IAAI,KAAK;AACxB;;;AAIN,QAAO;EACL,GAAG,KAAK,MAAM,IAAI,IAAI;EACtB,GAAG,KAAK,MAAM,IAAI,IAAI;EACtB,GAAG,KAAK,MAAM,IAAI,IAAI;EACvB;;AAGH,SAAgB,YAAY,KAAkB;AAC5C,QAAO,GAAG,IAAI,EAAE,GAAG,IAAI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