windrunner 1.1.2 → 1.1.3
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/index.d.ts +242 -10
- package/dist/index.esm.js +366 -260
- package/dist/index.esm.js.map +7 -0
- package/dist/index.js +368 -260
- package/dist/index.js.map +7 -0
- package/dist/index.min.js +4 -3
- package/dist/react.d.ts +69 -0
- package/dist/react.esm.js +4170 -0
- package/dist/react.esm.js.map +7 -0
- package/dist/react.js +4199 -0
- package/dist/react.js.map +7 -0
- package/package.json +13 -1
|
@@ -0,0 +1,4170 @@
|
|
|
1
|
+
// src/react.js
|
|
2
|
+
import { useEffect, useRef, useMemo, useCallback } from "react";
|
|
3
|
+
|
|
4
|
+
// src/theme.js
|
|
5
|
+
var theme = {
|
|
6
|
+
accentColor: ({ theme: theme2 }) => ({
|
|
7
|
+
...theme2("colors"),
|
|
8
|
+
auto: "auto"
|
|
9
|
+
}),
|
|
10
|
+
aspectRatio: {
|
|
11
|
+
auto: "auto",
|
|
12
|
+
square: "1 / 1",
|
|
13
|
+
video: "16 / 9"
|
|
14
|
+
},
|
|
15
|
+
backdropBlur: ({ theme: theme2 }) => theme2("blur"),
|
|
16
|
+
backdropBrightness: ({ theme: theme2 }) => theme2("brightness"),
|
|
17
|
+
backdropContrast: ({ theme: theme2 }) => theme2("contrast"),
|
|
18
|
+
backdropGrayscale: ({ theme: theme2 }) => theme2("grayscale"),
|
|
19
|
+
backdropHueRotate: ({ theme: theme2 }) => theme2("hueRotate"),
|
|
20
|
+
backdropInvert: ({ theme: theme2 }) => theme2("invert"),
|
|
21
|
+
backdropOpacity: ({ theme: theme2 }) => theme2("opacity"),
|
|
22
|
+
backdropSaturate: ({ theme: theme2 }) => theme2("saturate"),
|
|
23
|
+
backdropSepia: ({ theme: theme2 }) => theme2("sepia"),
|
|
24
|
+
backgroundColor: ({ theme: theme2 }) => theme2("colors"),
|
|
25
|
+
backgroundImage: {
|
|
26
|
+
none: "none",
|
|
27
|
+
"linear-to-t": "linear-gradient(to top, var(--tw-gradient-stops))",
|
|
28
|
+
"linear-to-tr": "linear-gradient(to top right, var(--tw-gradient-stops))",
|
|
29
|
+
"linear-to-r": "linear-gradient(to right, var(--tw-gradient-stops))",
|
|
30
|
+
"linear-to-br": "linear-gradient(to bottom right, var(--tw-gradient-stops))",
|
|
31
|
+
"linear-to-b": "linear-gradient(to bottom, var(--tw-gradient-stops))",
|
|
32
|
+
"linear-to-bl": "linear-gradient(to bottom left, var(--tw-gradient-stops))",
|
|
33
|
+
"linear-to-l": "linear-gradient(to left, var(--tw-gradient-stops))",
|
|
34
|
+
"linear-to-tl": "linear-gradient(to top left, var(--tw-gradient-stops))"
|
|
35
|
+
},
|
|
36
|
+
backgroundPosition: {
|
|
37
|
+
bottom: "bottom",
|
|
38
|
+
center: "center",
|
|
39
|
+
left: "left",
|
|
40
|
+
"left-bottom": "left bottom",
|
|
41
|
+
"left-top": "left top",
|
|
42
|
+
right: "right",
|
|
43
|
+
"right-bottom": "right bottom",
|
|
44
|
+
"right-top": "right top",
|
|
45
|
+
top: "top"
|
|
46
|
+
},
|
|
47
|
+
backgroundSize: {
|
|
48
|
+
auto: "auto",
|
|
49
|
+
cover: "cover",
|
|
50
|
+
contain: "contain"
|
|
51
|
+
},
|
|
52
|
+
blur: {
|
|
53
|
+
0: "0",
|
|
54
|
+
none: "0",
|
|
55
|
+
sm: "4px",
|
|
56
|
+
DEFAULT: "8px",
|
|
57
|
+
md: "12px",
|
|
58
|
+
lg: "16px",
|
|
59
|
+
xl: "24px",
|
|
60
|
+
"2xl": "40px",
|
|
61
|
+
"3xl": "64px"
|
|
62
|
+
},
|
|
63
|
+
borderColor: ({ theme: theme2 }) => ({
|
|
64
|
+
...theme2("colors"),
|
|
65
|
+
DEFAULT: "#e5e7eb"
|
|
66
|
+
}),
|
|
67
|
+
borderRadius: {
|
|
68
|
+
none: "0px",
|
|
69
|
+
sm: "0.125rem",
|
|
70
|
+
DEFAULT: "0.25rem",
|
|
71
|
+
md: "0.375rem",
|
|
72
|
+
lg: "0.5rem",
|
|
73
|
+
xl: "0.75rem",
|
|
74
|
+
"2xl": "1rem",
|
|
75
|
+
"3xl": "1.5rem",
|
|
76
|
+
full: "9999px"
|
|
77
|
+
},
|
|
78
|
+
borderSpacing: ({ theme: theme2 }) => ({
|
|
79
|
+
...theme2("spacing")
|
|
80
|
+
}),
|
|
81
|
+
borderWidth: {
|
|
82
|
+
DEFAULT: "1px",
|
|
83
|
+
0: "0px",
|
|
84
|
+
2: "2px",
|
|
85
|
+
4: "4px",
|
|
86
|
+
8: "8px"
|
|
87
|
+
},
|
|
88
|
+
boxShadow: {
|
|
89
|
+
sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
|
|
90
|
+
DEFAULT: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
|
|
91
|
+
md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
|
92
|
+
lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
93
|
+
xl: "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",
|
|
94
|
+
"2xl": "0 25px 50px -12px rgb(0 0 0 / 0.25)",
|
|
95
|
+
inner: "inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",
|
|
96
|
+
none: "none"
|
|
97
|
+
},
|
|
98
|
+
boxShadowColor: ({ theme: theme2 }) => theme2("colors"),
|
|
99
|
+
brightness: {
|
|
100
|
+
0: "0",
|
|
101
|
+
50: ".5",
|
|
102
|
+
75: ".75",
|
|
103
|
+
90: ".9",
|
|
104
|
+
95: ".95",
|
|
105
|
+
100: "1",
|
|
106
|
+
105: "1.05",
|
|
107
|
+
110: "1.1",
|
|
108
|
+
125: "1.25",
|
|
109
|
+
150: "1.5",
|
|
110
|
+
200: "2"
|
|
111
|
+
},
|
|
112
|
+
caretColor: ({ theme: theme2 }) => theme2("colors"),
|
|
113
|
+
colors: {
|
|
114
|
+
transparent: "transparent",
|
|
115
|
+
current: "currentColor",
|
|
116
|
+
black: "oklch(0% 0 0)",
|
|
117
|
+
white: "oklch(100% 0 0)",
|
|
118
|
+
slate: {
|
|
119
|
+
50: "oklch(0.984 0.003 247.9)",
|
|
120
|
+
100: "oklch(0.968 0.007 247.9)",
|
|
121
|
+
200: "oklch(0.929 0.013 255.5)",
|
|
122
|
+
300: "oklch(0.869 0.022 252.9)",
|
|
123
|
+
400: "oklch(0.704 0.04 256.8)",
|
|
124
|
+
500: "oklch(0.554 0.046 257.4)",
|
|
125
|
+
600: "oklch(0.446 0.043 257.3)",
|
|
126
|
+
700: "oklch(0.372 0.044 257.4)",
|
|
127
|
+
800: "oklch(0.279 0.041 260.0)",
|
|
128
|
+
900: "oklch(0.208 0.042 265.8)",
|
|
129
|
+
950: "oklch(0.129 0.042 264.7)"
|
|
130
|
+
},
|
|
131
|
+
gray: {
|
|
132
|
+
50: "oklch(0.985 0.002 247.9)",
|
|
133
|
+
100: "oklch(0.967 0.003 264.5)",
|
|
134
|
+
200: "oklch(0.928 0.006 264.5)",
|
|
135
|
+
300: "oklch(0.872 0.010 258.3)",
|
|
136
|
+
400: "oklch(0.707 0.022 261.3)",
|
|
137
|
+
500: "oklch(0.551 0.027 264.4)",
|
|
138
|
+
600: "oklch(0.446 0.030 256.8)",
|
|
139
|
+
700: "oklch(0.373 0.034 259.7)",
|
|
140
|
+
800: "oklch(0.278 0.033 256.8)",
|
|
141
|
+
900: "oklch(0.210 0.034 264.7)",
|
|
142
|
+
950: "oklch(0.130 0.028 261.7)"
|
|
143
|
+
},
|
|
144
|
+
zinc: {
|
|
145
|
+
50: "oklch(0.985 0.000 0.0)",
|
|
146
|
+
100: "oklch(0.967 0.001 286.4)",
|
|
147
|
+
200: "oklch(0.920 0.004 286.3)",
|
|
148
|
+
300: "oklch(0.871 0.006 286.3)",
|
|
149
|
+
400: "oklch(0.705 0.015 286.1)",
|
|
150
|
+
500: "oklch(0.552 0.016 285.9)",
|
|
151
|
+
600: "oklch(0.442 0.017 285.8)",
|
|
152
|
+
700: "oklch(0.370 0.013 285.8)",
|
|
153
|
+
800: "oklch(0.274 0.006 286.0)",
|
|
154
|
+
900: "oklch(0.210 0.006 285.9)",
|
|
155
|
+
950: "oklch(0.141 0.005 285.8)"
|
|
156
|
+
},
|
|
157
|
+
neutral: {
|
|
158
|
+
50: "oklch(0.985 0.000 0.0)",
|
|
159
|
+
100: "oklch(0.970 0.000 0.0)",
|
|
160
|
+
200: "oklch(0.922 0.000 0.0)",
|
|
161
|
+
300: "oklch(0.870 0.000 0.0)",
|
|
162
|
+
400: "oklch(0.708 0.000 0.0)",
|
|
163
|
+
500: "oklch(0.556 0.000 0.0)",
|
|
164
|
+
600: "oklch(0.439 0.000 0.0)",
|
|
165
|
+
700: "oklch(0.371 0.000 0.0)",
|
|
166
|
+
800: "oklch(0.269 0.000 0.0)",
|
|
167
|
+
900: "oklch(0.205 0.000 0.0)",
|
|
168
|
+
950: "oklch(0.145 0.000 0.0)"
|
|
169
|
+
},
|
|
170
|
+
stone: {
|
|
171
|
+
50: "oklch(0.985 0.001 67.4)",
|
|
172
|
+
100: "oklch(0.970 0.002 75.2)",
|
|
173
|
+
200: "oklch(0.923 0.006 75.2)",
|
|
174
|
+
300: "oklch(0.869 0.011 65.3)",
|
|
175
|
+
400: "oklch(0.709 0.023 56.0)",
|
|
176
|
+
500: "oklch(0.553 0.028 50.3)",
|
|
177
|
+
600: "oklch(0.444 0.024 48.7)",
|
|
178
|
+
700: "oklch(0.374 0.020 50.9)",
|
|
179
|
+
800: "oklch(0.268 0.015 52.9)",
|
|
180
|
+
900: "oklch(0.216 0.012 56.0)",
|
|
181
|
+
950: "oklch(0.147 0.009 50.9)"
|
|
182
|
+
},
|
|
183
|
+
red: {
|
|
184
|
+
50: "oklch(0.971 0.013 17.4)",
|
|
185
|
+
100: "oklch(0.936 0.032 17.7)",
|
|
186
|
+
200: "oklch(0.885 0.062 18.3)",
|
|
187
|
+
300: "oklch(0.808 0.114 19.6)",
|
|
188
|
+
400: "oklch(0.704 0.191 22.2)",
|
|
189
|
+
500: "oklch(0.637 0.237 25.3)",
|
|
190
|
+
600: "oklch(0.577 0.245 27.3)",
|
|
191
|
+
700: "oklch(0.505 0.213 27.5)",
|
|
192
|
+
800: "oklch(0.444 0.177 26.3)",
|
|
193
|
+
900: "oklch(0.396 0.141 25.7)",
|
|
194
|
+
950: "oklch(0.258 0.092 26.0)"
|
|
195
|
+
},
|
|
196
|
+
orange: {
|
|
197
|
+
50: "oklch(0.980 0.016 73.7)",
|
|
198
|
+
100: "oklch(0.954 0.038 75.2)",
|
|
199
|
+
200: "oklch(0.901 0.076 70.7)",
|
|
200
|
+
300: "oklch(0.837 0.128 66.3)",
|
|
201
|
+
400: "oklch(0.750 0.183 55.9)",
|
|
202
|
+
500: "oklch(0.705 0.213 47.6)",
|
|
203
|
+
600: "oklch(0.646 0.222 41.1)",
|
|
204
|
+
700: "oklch(0.553 0.195 38.4)",
|
|
205
|
+
800: "oklch(0.470 0.157 37.5)",
|
|
206
|
+
900: "oklch(0.408 0.123 38.1)",
|
|
207
|
+
950: "oklch(0.266 0.079 36.3)"
|
|
208
|
+
},
|
|
209
|
+
amber: {
|
|
210
|
+
50: "oklch(0.987 0.022 95.3)",
|
|
211
|
+
100: "oklch(0.962 0.059 95.6)",
|
|
212
|
+
200: "oklch(0.924 0.120 95.2)",
|
|
213
|
+
300: "oklch(0.879 0.169 91.6)",
|
|
214
|
+
400: "oklch(0.828 0.189 84.6)",
|
|
215
|
+
500: "oklch(0.769 0.188 70.1)",
|
|
216
|
+
600: "oklch(0.666 0.179 58.3)",
|
|
217
|
+
700: "oklch(0.555 0.163 48.9)",
|
|
218
|
+
800: "oklch(0.473 0.137 46.2)",
|
|
219
|
+
900: "oklch(0.414 0.112 45.9)",
|
|
220
|
+
950: "oklch(0.279 0.077 45.2)"
|
|
221
|
+
},
|
|
222
|
+
yellow: {
|
|
223
|
+
50: "oklch(0.987 0.026 102.2)",
|
|
224
|
+
100: "oklch(0.973 0.071 103.2)",
|
|
225
|
+
200: "oklch(0.945 0.129 101.5)",
|
|
226
|
+
300: "oklch(0.905 0.182 98.1)",
|
|
227
|
+
400: "oklch(0.852 0.199 91.3)",
|
|
228
|
+
500: "oklch(0.795 0.184 86.0)",
|
|
229
|
+
600: "oklch(0.681 0.162 75.8)",
|
|
230
|
+
700: "oklch(0.554 0.135 66.4)",
|
|
231
|
+
800: "oklch(0.476 0.114 61.9)",
|
|
232
|
+
900: "oklch(0.421 0.095 57.7)",
|
|
233
|
+
950: "oklch(0.286 0.066 53.8)"
|
|
234
|
+
},
|
|
235
|
+
lime: {
|
|
236
|
+
50: "oklch(0.986 0.031 129.5)",
|
|
237
|
+
100: "oklch(0.967 0.067 130.9)",
|
|
238
|
+
200: "oklch(0.938 0.127 130.7)",
|
|
239
|
+
300: "oklch(0.897 0.196 126.5)",
|
|
240
|
+
400: "oklch(0.841 0.238 128.5)",
|
|
241
|
+
500: "oklch(0.768 0.233 130.9)",
|
|
242
|
+
600: "oklch(0.648 0.200 131.4)",
|
|
243
|
+
700: "oklch(0.532 0.157 131.6)",
|
|
244
|
+
800: "oklch(0.453 0.124 130.9)",
|
|
245
|
+
900: "oklch(0.405 0.101 131.1)",
|
|
246
|
+
950: "oklch(0.274 0.072 132.1)"
|
|
247
|
+
},
|
|
248
|
+
green: {
|
|
249
|
+
50: "oklch(0.982 0.018 155.8)",
|
|
250
|
+
100: "oklch(0.962 0.044 156.7)",
|
|
251
|
+
200: "oklch(0.925 0.084 155.9)",
|
|
252
|
+
300: "oklch(0.871 0.150 154.4)",
|
|
253
|
+
400: "oklch(0.792 0.209 151.7)",
|
|
254
|
+
500: "oklch(0.723 0.219 149.6)",
|
|
255
|
+
600: "oklch(0.627 0.194 149.2)",
|
|
256
|
+
700: "oklch(0.527 0.154 150.1)",
|
|
257
|
+
800: "oklch(0.448 0.119 151.3)",
|
|
258
|
+
900: "oklch(0.393 0.095 152.5)",
|
|
259
|
+
950: "oklch(0.266 0.065 152.9)"
|
|
260
|
+
},
|
|
261
|
+
emerald: {
|
|
262
|
+
50: "oklch(0.979 0.021 166.1)",
|
|
263
|
+
100: "oklch(0.950 0.052 163.1)",
|
|
264
|
+
200: "oklch(0.905 0.093 164.2)",
|
|
265
|
+
300: "oklch(0.845 0.143 164.9)",
|
|
266
|
+
400: "oklch(0.765 0.177 163.2)",
|
|
267
|
+
500: "oklch(0.696 0.170 162.5)",
|
|
268
|
+
600: "oklch(0.596 0.145 163.2)",
|
|
269
|
+
700: "oklch(0.508 0.118 165.6)",
|
|
270
|
+
800: "oklch(0.432 0.095 166.9)",
|
|
271
|
+
900: "oklch(0.378 0.077 168.9)",
|
|
272
|
+
950: "oklch(0.262 0.051 172.6)"
|
|
273
|
+
},
|
|
274
|
+
teal: {
|
|
275
|
+
50: "oklch(0.984 0.014 180.7)",
|
|
276
|
+
100: "oklch(0.953 0.051 180.8)",
|
|
277
|
+
200: "oklch(0.910 0.096 180.4)",
|
|
278
|
+
300: "oklch(0.855 0.138 181.1)",
|
|
279
|
+
400: "oklch(0.777 0.152 181.1)",
|
|
280
|
+
500: "oklch(0.704 0.140 182.5)",
|
|
281
|
+
600: "oklch(0.600 0.118 184.7)",
|
|
282
|
+
700: "oklch(0.511 0.096 186.4)",
|
|
283
|
+
800: "oklch(0.437 0.078 188.2)",
|
|
284
|
+
900: "oklch(0.386 0.063 188.4)",
|
|
285
|
+
950: "oklch(0.277 0.046 192.5)"
|
|
286
|
+
},
|
|
287
|
+
cyan: {
|
|
288
|
+
50: "oklch(0.984 0.019 200.9)",
|
|
289
|
+
100: "oklch(0.956 0.045 203.4)",
|
|
290
|
+
200: "oklch(0.917 0.080 205.0)",
|
|
291
|
+
300: "oklch(0.865 0.127 207.1)",
|
|
292
|
+
400: "oklch(0.789 0.154 211.1)",
|
|
293
|
+
500: "oklch(0.715 0.143 215.2)",
|
|
294
|
+
600: "oklch(0.609 0.126 221.7)",
|
|
295
|
+
700: "oklch(0.520 0.105 223.1)",
|
|
296
|
+
800: "oklch(0.450 0.085 224.3)",
|
|
297
|
+
900: "oklch(0.398 0.070 227.4)",
|
|
298
|
+
950: "oklch(0.302 0.056 229.7)"
|
|
299
|
+
},
|
|
300
|
+
sky: {
|
|
301
|
+
50: "oklch(0.977 0.013 236.6)",
|
|
302
|
+
100: "oklch(0.951 0.026 236.8)",
|
|
303
|
+
200: "oklch(0.901 0.058 230.9)",
|
|
304
|
+
300: "oklch(0.828 0.111 230.3)",
|
|
305
|
+
400: "oklch(0.746 0.160 232.7)",
|
|
306
|
+
500: "oklch(0.685 0.169 237.3)",
|
|
307
|
+
600: "oklch(0.588 0.158 241.9)",
|
|
308
|
+
700: "oklch(0.500 0.134 242.7)",
|
|
309
|
+
800: "oklch(0.443 0.110 240.8)",
|
|
310
|
+
900: "oklch(0.391 0.090 240.9)",
|
|
311
|
+
950: "oklch(0.293 0.066 243.2)"
|
|
312
|
+
},
|
|
313
|
+
blue: {
|
|
314
|
+
50: "oklch(0.970 0.014 254.6)",
|
|
315
|
+
100: "oklch(0.932 0.032 255.6)",
|
|
316
|
+
200: "oklch(0.882 0.059 254.1)",
|
|
317
|
+
300: "oklch(0.809 0.105 251.8)",
|
|
318
|
+
400: "oklch(0.707 0.165 254.6)",
|
|
319
|
+
500: "oklch(0.623 0.214 259.1)",
|
|
320
|
+
600: "oklch(0.546 0.245 262.9)",
|
|
321
|
+
700: "oklch(0.488 0.243 264.4)",
|
|
322
|
+
800: "oklch(0.424 0.199 265.6)",
|
|
323
|
+
900: "oklch(0.379 0.146 265.5)",
|
|
324
|
+
950: "oklch(0.282 0.091 267.9)"
|
|
325
|
+
},
|
|
326
|
+
indigo: {
|
|
327
|
+
50: "oklch(0.962 0.018 272.3)",
|
|
328
|
+
100: "oklch(0.930 0.034 272.8)",
|
|
329
|
+
200: "oklch(0.870 0.065 274.0)",
|
|
330
|
+
300: "oklch(0.785 0.115 274.7)",
|
|
331
|
+
400: "oklch(0.673 0.182 276.9)",
|
|
332
|
+
500: "oklch(0.585 0.233 277.1)",
|
|
333
|
+
600: "oklch(0.511 0.262 276.9)",
|
|
334
|
+
700: "oklch(0.457 0.240 277.0)",
|
|
335
|
+
800: "oklch(0.398 0.195 277.4)",
|
|
336
|
+
900: "oklch(0.359 0.144 278.7)",
|
|
337
|
+
950: "oklch(0.257 0.090 281.3)"
|
|
338
|
+
},
|
|
339
|
+
violet: {
|
|
340
|
+
50: "oklch(0.969 0.016 293.8)",
|
|
341
|
+
100: "oklch(0.943 0.029 294.6)",
|
|
342
|
+
200: "oklch(0.894 0.057 293.3)",
|
|
343
|
+
300: "oklch(0.811 0.111 293.6)",
|
|
344
|
+
400: "oklch(0.702 0.183 293.5)",
|
|
345
|
+
500: "oklch(0.606 0.250 292.7)",
|
|
346
|
+
600: "oklch(0.541 0.281 293.0)",
|
|
347
|
+
700: "oklch(0.491 0.270 292.6)",
|
|
348
|
+
800: "oklch(0.432 0.232 292.8)",
|
|
349
|
+
900: "oklch(0.380 0.189 293.7)",
|
|
350
|
+
950: "oklch(0.283 0.141 291.1)"
|
|
351
|
+
},
|
|
352
|
+
purple: {
|
|
353
|
+
50: "oklch(0.977 0.014 308.3)",
|
|
354
|
+
100: "oklch(0.946 0.033 307.1)",
|
|
355
|
+
200: "oklch(0.902 0.063 306.7)",
|
|
356
|
+
300: "oklch(0.827 0.119 306.3)",
|
|
357
|
+
400: "oklch(0.714 0.203 305.3)",
|
|
358
|
+
500: "oklch(0.627 0.265 303.9)",
|
|
359
|
+
600: "oklch(0.558 0.288 302.3)",
|
|
360
|
+
700: "oklch(0.496 0.265 301.9)",
|
|
361
|
+
800: "oklch(0.438 0.218 303.7)",
|
|
362
|
+
900: "oklch(0.381 0.176 304.1)",
|
|
363
|
+
950: "oklch(0.291 0.149 302.7)"
|
|
364
|
+
},
|
|
365
|
+
fuchsia: {
|
|
366
|
+
50: "oklch(0.977 0.017 320.1)",
|
|
367
|
+
100: "oklch(0.952 0.037 318.9)",
|
|
368
|
+
200: "oklch(0.903 0.076 319.6)",
|
|
369
|
+
300: "oklch(0.833 0.145 321.4)",
|
|
370
|
+
400: "oklch(0.740 0.238 322.2)",
|
|
371
|
+
500: "oklch(0.667 0.295 322.1)",
|
|
372
|
+
600: "oklch(0.591 0.293 321.5)",
|
|
373
|
+
700: "oklch(0.518 0.253 323.1)",
|
|
374
|
+
800: "oklch(0.452 0.211 324.1)",
|
|
375
|
+
900: "oklch(0.401 0.170 325.6)",
|
|
376
|
+
950: "oklch(0.293 0.136 325.7)"
|
|
377
|
+
},
|
|
378
|
+
pink: {
|
|
379
|
+
50: "oklch(0.971 0.014 343.2)",
|
|
380
|
+
100: "oklch(0.948 0.028 342.3)",
|
|
381
|
+
200: "oklch(0.899 0.061 343.2)",
|
|
382
|
+
300: "oklch(0.823 0.120 346.0)",
|
|
383
|
+
400: "oklch(0.718 0.202 349.8)",
|
|
384
|
+
500: "oklch(0.656 0.241 354.3)",
|
|
385
|
+
600: "oklch(0.592 0.249 0.6)",
|
|
386
|
+
700: "oklch(0.525 0.223 3.9)",
|
|
387
|
+
800: "oklch(0.459 0.187 3.8)",
|
|
388
|
+
900: "oklch(0.408 0.153 2.4)",
|
|
389
|
+
950: "oklch(0.284 0.109 3.9)"
|
|
390
|
+
},
|
|
391
|
+
rose: {
|
|
392
|
+
50: "oklch(0.969 0.015 12.4)",
|
|
393
|
+
100: "oklch(0.941 0.030 12.6)",
|
|
394
|
+
200: "oklch(0.892 0.058 10.0)",
|
|
395
|
+
300: "oklch(0.810 0.117 11.6)",
|
|
396
|
+
400: "oklch(0.712 0.194 13.4)",
|
|
397
|
+
500: "oklch(0.645 0.246 16.4)",
|
|
398
|
+
600: "oklch(0.586 0.253 17.6)",
|
|
399
|
+
700: "oklch(0.514 0.222 16.9)",
|
|
400
|
+
800: "oklch(0.455 0.188 13.9)",
|
|
401
|
+
900: "oklch(0.410 0.159 10.9)",
|
|
402
|
+
950: "oklch(0.271 0.105 12.1)"
|
|
403
|
+
},
|
|
404
|
+
mauve: {
|
|
405
|
+
50: "oklch(0.980 0.005 300.0)",
|
|
406
|
+
100: "oklch(0.960 0.010 300.0)",
|
|
407
|
+
200: "oklch(0.920 0.018 300.0)",
|
|
408
|
+
300: "oklch(0.860 0.028 300.0)",
|
|
409
|
+
400: "oklch(0.720 0.040 300.0)",
|
|
410
|
+
500: "oklch(0.580 0.052 300.0)",
|
|
411
|
+
600: "oklch(0.470 0.048 300.0)",
|
|
412
|
+
700: "oklch(0.380 0.040 300.0)",
|
|
413
|
+
800: "oklch(0.280 0.030 300.0)",
|
|
414
|
+
900: "oklch(0.200 0.022 300.0)",
|
|
415
|
+
950: "oklch(0.130 0.015 300.0)"
|
|
416
|
+
},
|
|
417
|
+
olive: {
|
|
418
|
+
50: "oklch(0.980 0.015 90.0)",
|
|
419
|
+
100: "oklch(0.960 0.022 90.0)",
|
|
420
|
+
200: "oklch(0.920 0.032 90.0)",
|
|
421
|
+
300: "oklch(0.860 0.045 90.0)",
|
|
422
|
+
400: "oklch(0.720 0.060 90.0)",
|
|
423
|
+
500: "oklch(0.580 0.072 90.0)",
|
|
424
|
+
600: "oklch(0.470 0.065 90.0)",
|
|
425
|
+
700: "oklch(0.380 0.055 90.0)",
|
|
426
|
+
800: "oklch(0.280 0.040 90.0)",
|
|
427
|
+
900: "oklch(0.200 0.028 90.0)",
|
|
428
|
+
950: "oklch(0.130 0.018 90.0)"
|
|
429
|
+
},
|
|
430
|
+
mist: {
|
|
431
|
+
50: "oklch(0.982 0.008 200.0)",
|
|
432
|
+
100: "oklch(0.962 0.014 200.0)",
|
|
433
|
+
200: "oklch(0.922 0.022 200.0)",
|
|
434
|
+
300: "oklch(0.862 0.034 200.0)",
|
|
435
|
+
400: "oklch(0.722 0.048 200.0)",
|
|
436
|
+
500: "oklch(0.582 0.060 200.0)",
|
|
437
|
+
600: "oklch(0.472 0.055 200.0)",
|
|
438
|
+
700: "oklch(0.382 0.045 200.0)",
|
|
439
|
+
800: "oklch(0.282 0.032 200.0)",
|
|
440
|
+
900: "oklch(0.202 0.022 200.0)",
|
|
441
|
+
950: "oklch(0.128 0.012 200.0)"
|
|
442
|
+
},
|
|
443
|
+
taupe: {
|
|
444
|
+
50: "oklch(0.978 0.008 60.0)",
|
|
445
|
+
100: "oklch(0.958 0.014 60.0)",
|
|
446
|
+
200: "oklch(0.918 0.022 60.0)",
|
|
447
|
+
300: "oklch(0.858 0.034 60.0)",
|
|
448
|
+
400: "oklch(0.718 0.048 60.0)",
|
|
449
|
+
500: "oklch(0.578 0.060 60.0)",
|
|
450
|
+
600: "oklch(0.468 0.055 60.0)",
|
|
451
|
+
700: "oklch(0.378 0.045 60.0)",
|
|
452
|
+
800: "oklch(0.278 0.032 60.0)",
|
|
453
|
+
900: "oklch(0.198 0.022 60.0)",
|
|
454
|
+
950: "oklch(0.128 0.014 60.0)"
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
columns: {
|
|
458
|
+
auto: "auto",
|
|
459
|
+
1: "1",
|
|
460
|
+
2: "2",
|
|
461
|
+
3: "3",
|
|
462
|
+
4: "4",
|
|
463
|
+
5: "5",
|
|
464
|
+
6: "6",
|
|
465
|
+
7: "7",
|
|
466
|
+
8: "8",
|
|
467
|
+
9: "9",
|
|
468
|
+
10: "10",
|
|
469
|
+
11: "11",
|
|
470
|
+
12: "12",
|
|
471
|
+
"3xs": "16rem",
|
|
472
|
+
"2xs": "18rem",
|
|
473
|
+
xs: "20rem",
|
|
474
|
+
sm: "24rem",
|
|
475
|
+
md: "28rem",
|
|
476
|
+
lg: "32rem",
|
|
477
|
+
xl: "36rem",
|
|
478
|
+
"2xl": "42rem",
|
|
479
|
+
"3xl": "48rem",
|
|
480
|
+
"4xl": "56rem",
|
|
481
|
+
"5xl": "64rem",
|
|
482
|
+
"6xl": "72rem",
|
|
483
|
+
"7xl": "80rem"
|
|
484
|
+
},
|
|
485
|
+
container: {},
|
|
486
|
+
containers: {
|
|
487
|
+
xs: "20rem",
|
|
488
|
+
// 320px
|
|
489
|
+
sm: "24rem",
|
|
490
|
+
// 384px
|
|
491
|
+
md: "28rem",
|
|
492
|
+
// 448px
|
|
493
|
+
lg: "32rem",
|
|
494
|
+
// 512px
|
|
495
|
+
xl: "36rem",
|
|
496
|
+
// 576px
|
|
497
|
+
"2xl": "42rem",
|
|
498
|
+
// 672px
|
|
499
|
+
"3xl": "48rem",
|
|
500
|
+
// 768px
|
|
501
|
+
"4xl": "56rem",
|
|
502
|
+
// 896px
|
|
503
|
+
"5xl": "64rem",
|
|
504
|
+
// 1024px
|
|
505
|
+
"6xl": "72rem",
|
|
506
|
+
// 1152px
|
|
507
|
+
"7xl": "80rem"
|
|
508
|
+
// 1280px
|
|
509
|
+
},
|
|
510
|
+
content: {
|
|
511
|
+
none: "none"
|
|
512
|
+
},
|
|
513
|
+
contrast: {
|
|
514
|
+
0: "0",
|
|
515
|
+
50: ".5",
|
|
516
|
+
75: ".75",
|
|
517
|
+
100: "1",
|
|
518
|
+
125: "1.25",
|
|
519
|
+
150: "1.5",
|
|
520
|
+
200: "2"
|
|
521
|
+
},
|
|
522
|
+
cursor: {
|
|
523
|
+
auto: "auto",
|
|
524
|
+
default: "default",
|
|
525
|
+
pointer: "pointer",
|
|
526
|
+
wait: "wait",
|
|
527
|
+
text: "text",
|
|
528
|
+
move: "move",
|
|
529
|
+
help: "help",
|
|
530
|
+
"not-allowed": "not-allowed",
|
|
531
|
+
none: "none",
|
|
532
|
+
"context-menu": "context-menu",
|
|
533
|
+
progress: "progress",
|
|
534
|
+
cell: "cell",
|
|
535
|
+
crosshair: "crosshair",
|
|
536
|
+
"vertical-text": "vertical-text",
|
|
537
|
+
alias: "alias",
|
|
538
|
+
copy: "copy",
|
|
539
|
+
"no-drop": "no-drop",
|
|
540
|
+
grab: "grab",
|
|
541
|
+
grabbing: "grabbing",
|
|
542
|
+
"all-scroll": "all-scroll",
|
|
543
|
+
"col-resize": "col-resize",
|
|
544
|
+
"row-resize": "row-resize",
|
|
545
|
+
"n-resize": "n-resize",
|
|
546
|
+
"e-resize": "e-resize",
|
|
547
|
+
"s-resize": "s-resize",
|
|
548
|
+
"w-resize": "w-resize",
|
|
549
|
+
"ne-resize": "ne-resize",
|
|
550
|
+
"nw-resize": "nw-resize",
|
|
551
|
+
"se-resize": "se-resize",
|
|
552
|
+
"sw-resize": "sw-resize",
|
|
553
|
+
"ew-resize": "ew-resize",
|
|
554
|
+
"ns-resize": "ns-resize",
|
|
555
|
+
"nesw-resize": "nesw-resize",
|
|
556
|
+
"nwse-resize": "nwse-resize",
|
|
557
|
+
"zoom-in": "zoom-in",
|
|
558
|
+
"zoom-out": "zoom-out"
|
|
559
|
+
},
|
|
560
|
+
divideColor: ({ theme: theme2 }) => theme2("borderColor"),
|
|
561
|
+
divideWidth: ({ theme: theme2 }) => theme2("borderWidth"),
|
|
562
|
+
dropShadow: {
|
|
563
|
+
sm: "0 1px 1px rgb(0 0 0 / 0.05)",
|
|
564
|
+
DEFAULT: "0 1px 2px rgb(0 0 0 / 0.1) , 0 1px 1px rgb(0 0 0 / 0.06)",
|
|
565
|
+
md: "0 4px 3px rgb(0 0 0 / 0.07) , 0 2px 2px rgb(0 0 0 / 0.06)",
|
|
566
|
+
lg: "0 10px 8px rgb(0 0 0 / 0.04) , 0 4px 3px rgb(0 0 0 / 0.1)",
|
|
567
|
+
xl: "0 20px 13px rgb(0 0 0 / 0.03) , 0 8px 5px rgb(0 0 0 / 0.08)",
|
|
568
|
+
"2xl": "0 25px 25px rgb(0 0 0 / 0.15)",
|
|
569
|
+
none: "0 0 #0000"
|
|
570
|
+
},
|
|
571
|
+
fill: ({ theme: theme2 }) => ({
|
|
572
|
+
none: "none",
|
|
573
|
+
...theme2("colors")
|
|
574
|
+
}),
|
|
575
|
+
flex: {
|
|
576
|
+
1: "1 1 0%",
|
|
577
|
+
auto: "1 1 auto",
|
|
578
|
+
initial: "0 1 auto",
|
|
579
|
+
none: "none"
|
|
580
|
+
},
|
|
581
|
+
flexBasis: ({ theme: theme2 }) => ({
|
|
582
|
+
auto: "auto",
|
|
583
|
+
...theme2("spacing"),
|
|
584
|
+
"1/2": "50%",
|
|
585
|
+
"1/3": "33.333333%",
|
|
586
|
+
"2/3": "66.666667%",
|
|
587
|
+
"1/4": "25%",
|
|
588
|
+
"2/4": "50%",
|
|
589
|
+
"3/4": "75%",
|
|
590
|
+
"1/5": "20%",
|
|
591
|
+
"2/5": "40%",
|
|
592
|
+
"3/5": "60%",
|
|
593
|
+
"4/5": "80%",
|
|
594
|
+
"1/6": "16.666667%",
|
|
595
|
+
"2/6": "33.333333%",
|
|
596
|
+
"3/6": "50%",
|
|
597
|
+
"4/6": "66.666667%",
|
|
598
|
+
"5/6": "83.333333%",
|
|
599
|
+
"1/12": "8.333333%",
|
|
600
|
+
"2/12": "16.666667%",
|
|
601
|
+
"3/12": "25%",
|
|
602
|
+
"4/12": "33.333333%",
|
|
603
|
+
"5/12": "41.666667%",
|
|
604
|
+
"6/12": "50%",
|
|
605
|
+
"7/12": "58.333333%",
|
|
606
|
+
"8/12": "66.666667%",
|
|
607
|
+
"9/12": "75%",
|
|
608
|
+
"10/12": "83.333333%",
|
|
609
|
+
"11/12": "91.666667%",
|
|
610
|
+
full: "100%"
|
|
611
|
+
}),
|
|
612
|
+
flexGrow: {
|
|
613
|
+
0: "0",
|
|
614
|
+
DEFAULT: "1"
|
|
615
|
+
},
|
|
616
|
+
flexShrink: {
|
|
617
|
+
0: "0",
|
|
618
|
+
DEFAULT: "1"
|
|
619
|
+
},
|
|
620
|
+
fontFamily: {
|
|
621
|
+
sans: ["ui-sans-serif", "system-ui", "sans-serif", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"],
|
|
622
|
+
serif: ["ui-serif", "Georgia", "Cambria", "Times New Roman", "Times", "serif"],
|
|
623
|
+
mono: ["ui-monospace", "SFMono-Regular", "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", "monospace"]
|
|
624
|
+
},
|
|
625
|
+
fontSize: {
|
|
626
|
+
xs: "0.75rem",
|
|
627
|
+
sm: "0.875rem",
|
|
628
|
+
base: "1rem",
|
|
629
|
+
lg: "1.125rem",
|
|
630
|
+
xl: "1.25rem",
|
|
631
|
+
"2xl": "1.5rem",
|
|
632
|
+
"3xl": "1.875rem",
|
|
633
|
+
"4xl": "2.25rem",
|
|
634
|
+
"5xl": "3rem",
|
|
635
|
+
"6xl": "3.75rem",
|
|
636
|
+
"7xl": "4.5rem",
|
|
637
|
+
"8xl": "6rem",
|
|
638
|
+
"9xl": "8rem"
|
|
639
|
+
},
|
|
640
|
+
fontWeight: {
|
|
641
|
+
thin: "100",
|
|
642
|
+
extralight: "200",
|
|
643
|
+
light: "300",
|
|
644
|
+
normal: "400",
|
|
645
|
+
medium: "500",
|
|
646
|
+
semibold: "600",
|
|
647
|
+
bold: "700",
|
|
648
|
+
extrabold: "800",
|
|
649
|
+
black: "900"
|
|
650
|
+
},
|
|
651
|
+
gap: ({ theme: theme2 }) => theme2("spacing"),
|
|
652
|
+
gradientColorStops: ({ theme: theme2 }) => theme2("colors"),
|
|
653
|
+
gradientColorStopPositions: {
|
|
654
|
+
"0%": "0%",
|
|
655
|
+
"5%": "5%",
|
|
656
|
+
"10%": "10%",
|
|
657
|
+
"15%": "15%",
|
|
658
|
+
"20%": "20%",
|
|
659
|
+
"25%": "25%",
|
|
660
|
+
"30%": "30%",
|
|
661
|
+
"35%": "35%",
|
|
662
|
+
"40%": "40%",
|
|
663
|
+
"45%": "45%",
|
|
664
|
+
"50%": "50%",
|
|
665
|
+
"55%": "55%",
|
|
666
|
+
"60%": "60%",
|
|
667
|
+
"65%": "65%",
|
|
668
|
+
"70%": "70%",
|
|
669
|
+
"75%": "75%",
|
|
670
|
+
"80%": "80%",
|
|
671
|
+
"85%": "85%",
|
|
672
|
+
"90%": "90%",
|
|
673
|
+
"95%": "95%",
|
|
674
|
+
"100%": "100%"
|
|
675
|
+
},
|
|
676
|
+
grayscale: {
|
|
677
|
+
0: "0",
|
|
678
|
+
50: "0.5",
|
|
679
|
+
DEFAULT: "100%"
|
|
680
|
+
},
|
|
681
|
+
gridAutoColumns: {
|
|
682
|
+
auto: "auto",
|
|
683
|
+
min: "min-content",
|
|
684
|
+
max: "max-content",
|
|
685
|
+
fr: "minmax(0, 1fr)"
|
|
686
|
+
},
|
|
687
|
+
gridAutoRows: {
|
|
688
|
+
auto: "auto",
|
|
689
|
+
min: "min-content",
|
|
690
|
+
max: "max-content",
|
|
691
|
+
fr: "minmax(0, 1fr)"
|
|
692
|
+
},
|
|
693
|
+
gridColumn: {
|
|
694
|
+
auto: "auto",
|
|
695
|
+
"span-1": "span 1 / span 1",
|
|
696
|
+
"span-2": "span 2 / span 2",
|
|
697
|
+
"span-3": "span 3 / span 3",
|
|
698
|
+
"span-4": "span 4 / span 4",
|
|
699
|
+
"span-5": "span 5 / span 5",
|
|
700
|
+
"span-6": "span 6 / span 6",
|
|
701
|
+
"span-7": "span 7 / span 7",
|
|
702
|
+
"span-8": "span 8 / span 8",
|
|
703
|
+
"span-9": "span 9 / span 9",
|
|
704
|
+
"span-10": "span 10 / span 10",
|
|
705
|
+
"span-11": "span 11 / span 11",
|
|
706
|
+
"span-12": "span 12 / span 12",
|
|
707
|
+
"span-full": "1 / -1"
|
|
708
|
+
},
|
|
709
|
+
gridColumnEnd: {
|
|
710
|
+
auto: "auto",
|
|
711
|
+
1: "1",
|
|
712
|
+
2: "2",
|
|
713
|
+
3: "3",
|
|
714
|
+
4: "4",
|
|
715
|
+
5: "5",
|
|
716
|
+
6: "6",
|
|
717
|
+
7: "7",
|
|
718
|
+
8: "8",
|
|
719
|
+
9: "9",
|
|
720
|
+
10: "10",
|
|
721
|
+
11: "11",
|
|
722
|
+
12: "12",
|
|
723
|
+
13: "13"
|
|
724
|
+
},
|
|
725
|
+
gridColumnStart: {
|
|
726
|
+
auto: "auto",
|
|
727
|
+
1: "1",
|
|
728
|
+
2: "2",
|
|
729
|
+
3: "3",
|
|
730
|
+
4: "4",
|
|
731
|
+
5: "5",
|
|
732
|
+
6: "6",
|
|
733
|
+
7: "7",
|
|
734
|
+
8: "8",
|
|
735
|
+
9: "9",
|
|
736
|
+
10: "10",
|
|
737
|
+
11: "11",
|
|
738
|
+
12: "12",
|
|
739
|
+
13: "13"
|
|
740
|
+
},
|
|
741
|
+
gridRow: {
|
|
742
|
+
auto: "auto",
|
|
743
|
+
"span-1": "span 1 / span 1",
|
|
744
|
+
"span-2": "span 2 / span 2",
|
|
745
|
+
"span-3": "span 3 / span 3",
|
|
746
|
+
"span-4": "span 4 / span 4",
|
|
747
|
+
"span-5": "span 5 / span 5",
|
|
748
|
+
"span-6": "span 6 / span 6",
|
|
749
|
+
"span-7": "span 7 / span 7",
|
|
750
|
+
"span-8": "span 8 / span 8",
|
|
751
|
+
"span-9": "span 9 / span 9",
|
|
752
|
+
"span-10": "span 10 / span 10",
|
|
753
|
+
"span-11": "span 11 / span 11",
|
|
754
|
+
"span-12": "span 12 / span 12",
|
|
755
|
+
"span-full": "1 / -1"
|
|
756
|
+
},
|
|
757
|
+
gridRowEnd: {
|
|
758
|
+
auto: "auto",
|
|
759
|
+
1: "1",
|
|
760
|
+
2: "2",
|
|
761
|
+
3: "3",
|
|
762
|
+
4: "4",
|
|
763
|
+
5: "5",
|
|
764
|
+
6: "6",
|
|
765
|
+
7: "7",
|
|
766
|
+
8: "8",
|
|
767
|
+
9: "9",
|
|
768
|
+
10: "10",
|
|
769
|
+
11: "11",
|
|
770
|
+
12: "12",
|
|
771
|
+
13: "13"
|
|
772
|
+
},
|
|
773
|
+
gridRowStart: {
|
|
774
|
+
auto: "auto",
|
|
775
|
+
1: "1",
|
|
776
|
+
2: "2",
|
|
777
|
+
3: "3",
|
|
778
|
+
4: "4",
|
|
779
|
+
5: "5",
|
|
780
|
+
6: "6",
|
|
781
|
+
7: "7",
|
|
782
|
+
8: "8",
|
|
783
|
+
9: "9",
|
|
784
|
+
10: "10",
|
|
785
|
+
11: "11",
|
|
786
|
+
12: "12",
|
|
787
|
+
13: "13"
|
|
788
|
+
},
|
|
789
|
+
gridTemplateColumns: {
|
|
790
|
+
none: "none",
|
|
791
|
+
subgrid: "subgrid",
|
|
792
|
+
1: "repeat(1, minmax(0, 1fr))",
|
|
793
|
+
2: "repeat(2, minmax(0, 1fr))",
|
|
794
|
+
3: "repeat(3, minmax(0, 1fr))",
|
|
795
|
+
4: "repeat(4, minmax(0, 1fr))",
|
|
796
|
+
5: "repeat(5, minmax(0, 1fr))",
|
|
797
|
+
6: "repeat(6, minmax(0, 1fr))",
|
|
798
|
+
7: "repeat(7, minmax(0, 1fr))",
|
|
799
|
+
8: "repeat(8, minmax(0, 1fr))",
|
|
800
|
+
9: "repeat(9, minmax(0, 1fr))",
|
|
801
|
+
10: "repeat(10, minmax(0, 1fr))",
|
|
802
|
+
11: "repeat(11, minmax(0, 1fr))",
|
|
803
|
+
12: "repeat(12, minmax(0, 1fr))"
|
|
804
|
+
},
|
|
805
|
+
gridTemplateRows: {
|
|
806
|
+
none: "none",
|
|
807
|
+
subgrid: "subgrid",
|
|
808
|
+
1: "repeat(1, minmax(0, 1fr))",
|
|
809
|
+
2: "repeat(2, minmax(0, 1fr))",
|
|
810
|
+
3: "repeat(3, minmax(0, 1fr))",
|
|
811
|
+
4: "repeat(4, minmax(0, 1fr))",
|
|
812
|
+
5: "repeat(5, minmax(0, 1fr))",
|
|
813
|
+
6: "repeat(6, minmax(0, 1fr))",
|
|
814
|
+
7: "repeat(7, minmax(0, 1fr))",
|
|
815
|
+
8: "repeat(8, minmax(0, 1fr))",
|
|
816
|
+
9: "repeat(9, minmax(0, 1fr))",
|
|
817
|
+
10: "repeat(10, minmax(0, 1fr))",
|
|
818
|
+
11: "repeat(11, minmax(0, 1fr))",
|
|
819
|
+
12: "repeat(12, minmax(0, 1fr))"
|
|
820
|
+
},
|
|
821
|
+
height: ({ theme: theme2 }) => ({
|
|
822
|
+
auto: "auto",
|
|
823
|
+
...theme2("spacing"),
|
|
824
|
+
"1/2": "50%",
|
|
825
|
+
"1/3": "33.333333%",
|
|
826
|
+
"2/3": "66.666667%",
|
|
827
|
+
"1/4": "25%",
|
|
828
|
+
"2/4": "50%",
|
|
829
|
+
"3/4": "75%",
|
|
830
|
+
"1/5": "20%",
|
|
831
|
+
"2/5": "40%",
|
|
832
|
+
"3/5": "60%",
|
|
833
|
+
"4/5": "80%",
|
|
834
|
+
"1/6": "16.666667%",
|
|
835
|
+
"2/6": "33.333333%",
|
|
836
|
+
"3/6": "50%",
|
|
837
|
+
"4/6": "66.666667%",
|
|
838
|
+
"5/6": "83.333333%",
|
|
839
|
+
full: "100%",
|
|
840
|
+
screen: "100vh",
|
|
841
|
+
svh: "100svh",
|
|
842
|
+
lvh: "100lvh",
|
|
843
|
+
dvh: "100dvh",
|
|
844
|
+
min: "min-content",
|
|
845
|
+
max: "max-content",
|
|
846
|
+
fit: "fit-content"
|
|
847
|
+
}),
|
|
848
|
+
hueRotate: {
|
|
849
|
+
0: "0deg",
|
|
850
|
+
15: "15deg",
|
|
851
|
+
30: "30deg",
|
|
852
|
+
60: "60deg",
|
|
853
|
+
90: "90deg",
|
|
854
|
+
180: "180deg"
|
|
855
|
+
},
|
|
856
|
+
inset: ({ theme: theme2 }) => ({
|
|
857
|
+
auto: "auto",
|
|
858
|
+
...theme2("spacing"),
|
|
859
|
+
"1/2": "50%",
|
|
860
|
+
"1/3": "33.333333%",
|
|
861
|
+
"2/3": "66.666667%",
|
|
862
|
+
"1/4": "25%",
|
|
863
|
+
"2/4": "50%",
|
|
864
|
+
"3/4": "75%",
|
|
865
|
+
full: "100%"
|
|
866
|
+
}),
|
|
867
|
+
invert: {
|
|
868
|
+
0: "0",
|
|
869
|
+
50: "0.5",
|
|
870
|
+
DEFAULT: "100%"
|
|
871
|
+
},
|
|
872
|
+
letterSpacing: {
|
|
873
|
+
tighter: "-0.05em",
|
|
874
|
+
tight: "-0.025em",
|
|
875
|
+
normal: "0em",
|
|
876
|
+
wide: "0.025em",
|
|
877
|
+
wider: "0.05em",
|
|
878
|
+
widest: "0.1em"
|
|
879
|
+
},
|
|
880
|
+
lineClamp: {
|
|
881
|
+
1: "1",
|
|
882
|
+
2: "2",
|
|
883
|
+
3: "3",
|
|
884
|
+
4: "4",
|
|
885
|
+
5: "5",
|
|
886
|
+
6: "6"
|
|
887
|
+
},
|
|
888
|
+
lineHeight: {
|
|
889
|
+
none: "1",
|
|
890
|
+
tight: "1.25",
|
|
891
|
+
snug: "1.375",
|
|
892
|
+
normal: "1.5",
|
|
893
|
+
relaxed: "1.625",
|
|
894
|
+
loose: "2",
|
|
895
|
+
3: ".75rem",
|
|
896
|
+
4: "1rem",
|
|
897
|
+
5: "1.25rem",
|
|
898
|
+
6: "1.5rem",
|
|
899
|
+
7: "1.75rem",
|
|
900
|
+
8: "2rem",
|
|
901
|
+
9: "2.25rem",
|
|
902
|
+
10: "2.5rem"
|
|
903
|
+
},
|
|
904
|
+
listStyleType: {
|
|
905
|
+
none: "none",
|
|
906
|
+
disc: "disc",
|
|
907
|
+
decimal: "decimal"
|
|
908
|
+
},
|
|
909
|
+
margin: ({ theme: theme2 }) => ({
|
|
910
|
+
auto: "auto",
|
|
911
|
+
...theme2("spacing")
|
|
912
|
+
}),
|
|
913
|
+
maxHeight: ({ theme: theme2 }) => ({
|
|
914
|
+
...theme2("spacing"),
|
|
915
|
+
none: "none",
|
|
916
|
+
full: "100%",
|
|
917
|
+
screen: "100vh",
|
|
918
|
+
svh: "100svh",
|
|
919
|
+
lvh: "100lvh",
|
|
920
|
+
dvh: "100dvh",
|
|
921
|
+
min: "min-content",
|
|
922
|
+
max: "max-content",
|
|
923
|
+
fit: "fit-content"
|
|
924
|
+
}),
|
|
925
|
+
maxWidth: ({ theme: theme2 }) => ({
|
|
926
|
+
...theme2("spacing"),
|
|
927
|
+
none: "none",
|
|
928
|
+
xs: "20rem",
|
|
929
|
+
sm: "24rem",
|
|
930
|
+
md: "28rem",
|
|
931
|
+
lg: "32rem",
|
|
932
|
+
xl: "36rem",
|
|
933
|
+
"2xl": "42rem",
|
|
934
|
+
"3xl": "48rem",
|
|
935
|
+
"4xl": "56rem",
|
|
936
|
+
"5xl": "64rem",
|
|
937
|
+
"6xl": "72rem",
|
|
938
|
+
"7xl": "80rem",
|
|
939
|
+
full: "100%",
|
|
940
|
+
min: "min-content",
|
|
941
|
+
max: "max-content",
|
|
942
|
+
fit: "fit-content",
|
|
943
|
+
prose: "65ch"
|
|
944
|
+
}),
|
|
945
|
+
minHeight: ({ theme: theme2 }) => ({
|
|
946
|
+
...theme2("spacing"),
|
|
947
|
+
full: "100%",
|
|
948
|
+
screen: "100vh",
|
|
949
|
+
svh: "100svh",
|
|
950
|
+
lvh: "100lvh",
|
|
951
|
+
dvh: "100dvh",
|
|
952
|
+
min: "min-content",
|
|
953
|
+
max: "max-content",
|
|
954
|
+
fit: "fit-content"
|
|
955
|
+
}),
|
|
956
|
+
minWidth: ({ theme: theme2 }) => ({
|
|
957
|
+
...theme2("spacing"),
|
|
958
|
+
full: "100%",
|
|
959
|
+
min: "min-content",
|
|
960
|
+
max: "max-content",
|
|
961
|
+
fit: "fit-content"
|
|
962
|
+
}),
|
|
963
|
+
objectPosition: {
|
|
964
|
+
bottom: "bottom",
|
|
965
|
+
center: "center",
|
|
966
|
+
left: "left",
|
|
967
|
+
"left-bottom": "left bottom",
|
|
968
|
+
"left-top": "left top",
|
|
969
|
+
right: "right",
|
|
970
|
+
"right-bottom": "right bottom",
|
|
971
|
+
"right-top": "right top",
|
|
972
|
+
top: "top"
|
|
973
|
+
},
|
|
974
|
+
opacity: {
|
|
975
|
+
0: "0",
|
|
976
|
+
5: "0.05",
|
|
977
|
+
10: "0.1",
|
|
978
|
+
15: "0.15",
|
|
979
|
+
20: "0.2",
|
|
980
|
+
25: "0.25",
|
|
981
|
+
30: "0.3",
|
|
982
|
+
35: "0.35",
|
|
983
|
+
40: "0.4",
|
|
984
|
+
45: "0.45",
|
|
985
|
+
50: "0.5",
|
|
986
|
+
55: "0.55",
|
|
987
|
+
60: "0.6",
|
|
988
|
+
65: "0.65",
|
|
989
|
+
70: "0.7",
|
|
990
|
+
75: "0.75",
|
|
991
|
+
80: "0.8",
|
|
992
|
+
85: "0.85",
|
|
993
|
+
90: "0.9",
|
|
994
|
+
95: "0.95",
|
|
995
|
+
100: "1"
|
|
996
|
+
},
|
|
997
|
+
order: {
|
|
998
|
+
first: "-9999",
|
|
999
|
+
last: "9999",
|
|
1000
|
+
none: "0",
|
|
1001
|
+
1: "1",
|
|
1002
|
+
2: "2",
|
|
1003
|
+
3: "3",
|
|
1004
|
+
4: "4",
|
|
1005
|
+
5: "5",
|
|
1006
|
+
6: "6",
|
|
1007
|
+
7: "7",
|
|
1008
|
+
8: "8",
|
|
1009
|
+
9: "9",
|
|
1010
|
+
10: "10",
|
|
1011
|
+
11: "11",
|
|
1012
|
+
12: "12"
|
|
1013
|
+
},
|
|
1014
|
+
outlineColor: ({ theme: theme2 }) => theme2("colors"),
|
|
1015
|
+
outlineOffset: {
|
|
1016
|
+
0: "0px",
|
|
1017
|
+
1: "1px",
|
|
1018
|
+
2: "2px",
|
|
1019
|
+
4: "4px",
|
|
1020
|
+
8: "8px"
|
|
1021
|
+
},
|
|
1022
|
+
outlineWidth: {
|
|
1023
|
+
0: "0px",
|
|
1024
|
+
1: "1px",
|
|
1025
|
+
2: "2px",
|
|
1026
|
+
4: "4px",
|
|
1027
|
+
8: "8px"
|
|
1028
|
+
},
|
|
1029
|
+
padding: ({ theme: theme2 }) => theme2("spacing"),
|
|
1030
|
+
placeholderColor: ({ theme: theme2 }) => theme2("colors"),
|
|
1031
|
+
ringColor: ({ theme: theme2 }) => ({
|
|
1032
|
+
DEFAULT: "#3b82f6",
|
|
1033
|
+
...theme2("colors")
|
|
1034
|
+
}),
|
|
1035
|
+
ringOffsetColor: ({ theme: theme2 }) => theme2("colors"),
|
|
1036
|
+
ringOffsetWidth: {
|
|
1037
|
+
0: "0px",
|
|
1038
|
+
1: "1px",
|
|
1039
|
+
2: "2px",
|
|
1040
|
+
4: "4px",
|
|
1041
|
+
8: "8px"
|
|
1042
|
+
},
|
|
1043
|
+
ringWidth: {
|
|
1044
|
+
DEFAULT: "3px",
|
|
1045
|
+
0: "0px",
|
|
1046
|
+
1: "1px",
|
|
1047
|
+
2: "2px",
|
|
1048
|
+
4: "4px",
|
|
1049
|
+
8: "8px"
|
|
1050
|
+
},
|
|
1051
|
+
rotate: {
|
|
1052
|
+
0: "0deg",
|
|
1053
|
+
1: "1deg",
|
|
1054
|
+
2: "2deg",
|
|
1055
|
+
3: "3deg",
|
|
1056
|
+
6: "6deg",
|
|
1057
|
+
12: "12deg",
|
|
1058
|
+
45: "45deg",
|
|
1059
|
+
90: "90deg",
|
|
1060
|
+
180: "180deg"
|
|
1061
|
+
},
|
|
1062
|
+
saturate: {
|
|
1063
|
+
0: "0",
|
|
1064
|
+
50: ".5",
|
|
1065
|
+
100: "1",
|
|
1066
|
+
150: "1.5",
|
|
1067
|
+
200: "2"
|
|
1068
|
+
},
|
|
1069
|
+
scale: {
|
|
1070
|
+
0: "0",
|
|
1071
|
+
50: ".5",
|
|
1072
|
+
75: ".75",
|
|
1073
|
+
90: ".9",
|
|
1074
|
+
95: ".95",
|
|
1075
|
+
100: "1",
|
|
1076
|
+
105: "1.05",
|
|
1077
|
+
110: "1.1",
|
|
1078
|
+
125: "1.25",
|
|
1079
|
+
150: "1.5"
|
|
1080
|
+
},
|
|
1081
|
+
screens: {
|
|
1082
|
+
sm: "640px",
|
|
1083
|
+
md: "768px",
|
|
1084
|
+
lg: "1024px",
|
|
1085
|
+
xl: "1280px",
|
|
1086
|
+
"2xl": "1536px"
|
|
1087
|
+
},
|
|
1088
|
+
scrollMargin: ({ theme: theme2 }) => ({
|
|
1089
|
+
...theme2("spacing")
|
|
1090
|
+
}),
|
|
1091
|
+
scrollPadding: ({ theme: theme2 }) => theme2("spacing"),
|
|
1092
|
+
sepia: {
|
|
1093
|
+
0: "0",
|
|
1094
|
+
50: "0.5",
|
|
1095
|
+
DEFAULT: "100%"
|
|
1096
|
+
},
|
|
1097
|
+
skew: {
|
|
1098
|
+
0: "0deg",
|
|
1099
|
+
1: "1deg",
|
|
1100
|
+
2: "2deg",
|
|
1101
|
+
3: "3deg",
|
|
1102
|
+
6: "6deg",
|
|
1103
|
+
12: "12deg"
|
|
1104
|
+
},
|
|
1105
|
+
space: ({ theme: theme2 }) => ({
|
|
1106
|
+
...theme2("spacing")
|
|
1107
|
+
}),
|
|
1108
|
+
spacing: {
|
|
1109
|
+
px: "1px",
|
|
1110
|
+
0: "0px",
|
|
1111
|
+
0.5: "0.125rem",
|
|
1112
|
+
1: "0.25rem",
|
|
1113
|
+
1.5: "0.375rem",
|
|
1114
|
+
2: "0.5rem",
|
|
1115
|
+
2.5: "0.625rem",
|
|
1116
|
+
3: "0.75rem",
|
|
1117
|
+
3.5: "0.875rem",
|
|
1118
|
+
4: "1rem",
|
|
1119
|
+
5: "1.25rem",
|
|
1120
|
+
6: "1.5rem",
|
|
1121
|
+
7: "1.75rem",
|
|
1122
|
+
8: "2rem",
|
|
1123
|
+
9: "2.25rem",
|
|
1124
|
+
10: "2.5rem",
|
|
1125
|
+
11: "2.75rem",
|
|
1126
|
+
12: "3rem",
|
|
1127
|
+
14: "3.5rem",
|
|
1128
|
+
16: "4rem",
|
|
1129
|
+
20: "5rem",
|
|
1130
|
+
24: "6rem",
|
|
1131
|
+
28: "7rem",
|
|
1132
|
+
32: "8rem",
|
|
1133
|
+
36: "9rem",
|
|
1134
|
+
40: "10rem",
|
|
1135
|
+
44: "11rem",
|
|
1136
|
+
48: "12rem",
|
|
1137
|
+
52: "13rem",
|
|
1138
|
+
56: "14rem",
|
|
1139
|
+
60: "15rem",
|
|
1140
|
+
64: "16rem",
|
|
1141
|
+
72: "18rem",
|
|
1142
|
+
80: "20rem",
|
|
1143
|
+
96: "24rem",
|
|
1144
|
+
"screen-sm": "640px",
|
|
1145
|
+
"screen-md": "768px",
|
|
1146
|
+
"screen-lg": "1024px",
|
|
1147
|
+
"screen-xl": "1280px",
|
|
1148
|
+
"screen-2xl": "1536px"
|
|
1149
|
+
},
|
|
1150
|
+
stroke: ({ theme: theme2 }) => ({
|
|
1151
|
+
none: "none",
|
|
1152
|
+
...theme2("colors")
|
|
1153
|
+
}),
|
|
1154
|
+
strokeWidth: {
|
|
1155
|
+
0: "0",
|
|
1156
|
+
1: "1",
|
|
1157
|
+
2: "2"
|
|
1158
|
+
},
|
|
1159
|
+
textColor: ({ theme: theme2 }) => theme2("colors"),
|
|
1160
|
+
textDecorationColor: ({ theme: theme2 }) => theme2("colors"),
|
|
1161
|
+
textDecorationThickness: {
|
|
1162
|
+
auto: "auto",
|
|
1163
|
+
"from-font": "from-font",
|
|
1164
|
+
0: "0px",
|
|
1165
|
+
1: "1px",
|
|
1166
|
+
2: "2px",
|
|
1167
|
+
4: "4px",
|
|
1168
|
+
8: "8px"
|
|
1169
|
+
},
|
|
1170
|
+
textIndent: ({ theme: theme2 }) => ({
|
|
1171
|
+
...theme2("spacing")
|
|
1172
|
+
}),
|
|
1173
|
+
textShadowBlur: ({ theme: theme2 }) => theme2("blur"),
|
|
1174
|
+
textShadowColor: ({ theme: theme2 }) => ({
|
|
1175
|
+
...theme2("colors"),
|
|
1176
|
+
DEFAULT: "#e5e7eb"
|
|
1177
|
+
}),
|
|
1178
|
+
textShadowOpacity: ({ theme: theme2 }) => theme2("opacity"),
|
|
1179
|
+
textShadowX: {
|
|
1180
|
+
0: "0px",
|
|
1181
|
+
1: "1px",
|
|
1182
|
+
2: "2px",
|
|
1183
|
+
3: "3px",
|
|
1184
|
+
4: "4px",
|
|
1185
|
+
5: "5px",
|
|
1186
|
+
6: "6px",
|
|
1187
|
+
7: "7px",
|
|
1188
|
+
8: "8px",
|
|
1189
|
+
9: "9px",
|
|
1190
|
+
10: "10px"
|
|
1191
|
+
},
|
|
1192
|
+
textShadowY: ({ theme: theme2 }) => theme2("textShadowX"),
|
|
1193
|
+
textUnderlineOffset: {
|
|
1194
|
+
auto: "auto",
|
|
1195
|
+
0: "0px",
|
|
1196
|
+
1: "1px",
|
|
1197
|
+
2: "2px",
|
|
1198
|
+
4: "4px",
|
|
1199
|
+
8: "8px"
|
|
1200
|
+
},
|
|
1201
|
+
transformOrigin: {
|
|
1202
|
+
center: "center",
|
|
1203
|
+
top: "top",
|
|
1204
|
+
"top-right": "top right",
|
|
1205
|
+
right: "right",
|
|
1206
|
+
"bottom-right": "bottom right",
|
|
1207
|
+
bottom: "bottom",
|
|
1208
|
+
"bottom-left": "bottom left",
|
|
1209
|
+
left: "left",
|
|
1210
|
+
"top-left": "top left"
|
|
1211
|
+
},
|
|
1212
|
+
translate: ({ theme: theme2 }) => ({
|
|
1213
|
+
...theme2("spacing"),
|
|
1214
|
+
"1/2": "50%",
|
|
1215
|
+
"1/3": "33.333333%",
|
|
1216
|
+
"2/3": "66.666667%",
|
|
1217
|
+
"1/4": "25%",
|
|
1218
|
+
"2/4": "50%",
|
|
1219
|
+
"3/4": "75%",
|
|
1220
|
+
full: "100%"
|
|
1221
|
+
}),
|
|
1222
|
+
size: ({ theme: theme2 }) => ({
|
|
1223
|
+
auto: "auto",
|
|
1224
|
+
...theme2("spacing"),
|
|
1225
|
+
"1/2": "50%",
|
|
1226
|
+
"1/3": "33.333333%",
|
|
1227
|
+
"2/3": "66.666667%",
|
|
1228
|
+
"1/4": "25%",
|
|
1229
|
+
"2/4": "50%",
|
|
1230
|
+
"3/4": "75%",
|
|
1231
|
+
"1/5": "20%",
|
|
1232
|
+
"2/5": "40%",
|
|
1233
|
+
"3/5": "60%",
|
|
1234
|
+
"4/5": "80%",
|
|
1235
|
+
"1/6": "16.666667%",
|
|
1236
|
+
"2/6": "33.333333%",
|
|
1237
|
+
"3/6": "50%",
|
|
1238
|
+
"4/6": "66.666667%",
|
|
1239
|
+
"5/6": "83.333333%",
|
|
1240
|
+
"1/12": "8.333333%",
|
|
1241
|
+
"2/12": "16.666667%",
|
|
1242
|
+
"3/12": "25%",
|
|
1243
|
+
"4/12": "33.333333%",
|
|
1244
|
+
"5/12": "41.666667%",
|
|
1245
|
+
"6/12": "50%",
|
|
1246
|
+
"7/12": "58.333333%",
|
|
1247
|
+
"8/12": "66.666667%",
|
|
1248
|
+
"9/12": "75%",
|
|
1249
|
+
"10/12": "83.333333%",
|
|
1250
|
+
"11/12": "91.666667%",
|
|
1251
|
+
full: "100%",
|
|
1252
|
+
min: "min-content",
|
|
1253
|
+
max: "max-content",
|
|
1254
|
+
fit: "fit-content"
|
|
1255
|
+
}),
|
|
1256
|
+
width: ({ theme: theme2 }) => ({
|
|
1257
|
+
auto: "auto",
|
|
1258
|
+
...theme2("spacing"),
|
|
1259
|
+
"1/2": "50%",
|
|
1260
|
+
"1/3": "33.333333%",
|
|
1261
|
+
"2/3": "66.666667%",
|
|
1262
|
+
"1/4": "25%",
|
|
1263
|
+
"2/4": "50%",
|
|
1264
|
+
"3/4": "75%",
|
|
1265
|
+
"1/5": "20%",
|
|
1266
|
+
"2/5": "40%",
|
|
1267
|
+
"3/5": "60%",
|
|
1268
|
+
"4/5": "80%",
|
|
1269
|
+
"1/6": "16.666667%",
|
|
1270
|
+
"2/6": "33.333333%",
|
|
1271
|
+
"3/6": "50%",
|
|
1272
|
+
"4/6": "66.666667%",
|
|
1273
|
+
"5/6": "83.333333%",
|
|
1274
|
+
"1/12": "8.333333%",
|
|
1275
|
+
"2/12": "16.666667%",
|
|
1276
|
+
"3/12": "25%",
|
|
1277
|
+
"4/12": "33.333333%",
|
|
1278
|
+
"5/12": "41.666667%",
|
|
1279
|
+
"6/12": "50%",
|
|
1280
|
+
"7/12": "58.333333%",
|
|
1281
|
+
"8/12": "66.666667%",
|
|
1282
|
+
"9/12": "75%",
|
|
1283
|
+
"10/12": "83.333333%",
|
|
1284
|
+
"11/12": "91.666667%",
|
|
1285
|
+
full: "100%",
|
|
1286
|
+
screen: "100vw",
|
|
1287
|
+
svw: "100svw",
|
|
1288
|
+
lvw: "100lvw",
|
|
1289
|
+
dvw: "100dvw",
|
|
1290
|
+
min: "min-content",
|
|
1291
|
+
max: "max-content",
|
|
1292
|
+
fit: "fit-content"
|
|
1293
|
+
}),
|
|
1294
|
+
textShadow: {
|
|
1295
|
+
"2xs": "0 1px 2px rgb(0 0 0 / 0.10)",
|
|
1296
|
+
xs: "0 1px 2px rgb(0 0 0 / 0.20)",
|
|
1297
|
+
sm: "0 1px 3px rgb(0 0 0 / 0.25)",
|
|
1298
|
+
DEFAULT: "0 1px 3px rgb(0 0 0 / 0.30)",
|
|
1299
|
+
md: "0 2px 4px rgb(0 0 0 / 0.30)",
|
|
1300
|
+
lg: "0 4px 6px rgb(0 0 0 / 0.25)",
|
|
1301
|
+
xl: "0 8px 12px rgb(0 0 0 / 0.20)",
|
|
1302
|
+
"2xl": "0 16px 24px rgb(0 0 0 / 0.15)",
|
|
1303
|
+
none: "none"
|
|
1304
|
+
},
|
|
1305
|
+
willChange: {
|
|
1306
|
+
auto: "auto",
|
|
1307
|
+
scroll: "scroll-position",
|
|
1308
|
+
contents: "contents",
|
|
1309
|
+
transform: "transform"
|
|
1310
|
+
},
|
|
1311
|
+
zoom: {
|
|
1312
|
+
0: "0",
|
|
1313
|
+
50: ".5",
|
|
1314
|
+
75: ".75",
|
|
1315
|
+
90: ".9",
|
|
1316
|
+
95: ".95",
|
|
1317
|
+
100: "1",
|
|
1318
|
+
105: "1.05",
|
|
1319
|
+
110: "1.1",
|
|
1320
|
+
125: "1.25",
|
|
1321
|
+
150: "1.5",
|
|
1322
|
+
200: "2"
|
|
1323
|
+
},
|
|
1324
|
+
zIndex: {
|
|
1325
|
+
0: "0",
|
|
1326
|
+
10: "10",
|
|
1327
|
+
20: "20",
|
|
1328
|
+
30: "30",
|
|
1329
|
+
40: "40",
|
|
1330
|
+
50: "50",
|
|
1331
|
+
60: "60",
|
|
1332
|
+
70: "70",
|
|
1333
|
+
80: "80",
|
|
1334
|
+
90: "90",
|
|
1335
|
+
100: "100",
|
|
1336
|
+
auto: "auto"
|
|
1337
|
+
}
|
|
1338
|
+
};
|
|
1339
|
+
var theme_default = theme;
|
|
1340
|
+
|
|
1341
|
+
// src/vars.js
|
|
1342
|
+
var vars = {
|
|
1343
|
+
transform: `transform: translateX(var(--transform-translate-x, 0)) translateY(var(--transform-translate-y, 0)) rotate(var(--transform-rotate, 0)) skewX(var(--transform-skew-x, 0)) skewY(var(--transform-skew-y, 0)) scaleX(var(--transform-scale-x, 1)) scaleY(var(--transform-scale-y, 1));`,
|
|
1344
|
+
filter: `filter: blur(var(--blur, 0)) brightness(var(--brightness, 1)) contrast(var(--contrast, 1)) grayscale(var(--grayscale, 0)) hue-rotate(var(--hue-rotate, 0deg)) invert(var(--invert, 0)) saturate(var(--saturate, 1)) sepia(var(--sepia, 0)) drop-shadow(var(--drop-shadow, 0 0 #0000));`,
|
|
1345
|
+
backdropFilter: `-webkit-backdrop-filter: blur(var(--backdrop-blur, 0)) brightness(var(--backdrop-brightness, 1)) contrast(var(--backdrop-contrast, 1)) grayscale(var(--backdrop-grayscale, 0)) hue-rotate(var(--backdrop-hue-rotate, 0deg)) invert(var(--backdrop-invert, 0)) opacity(var(--backdrop-opacity, 1)) saturate(var(--backdrop-saturate, 1)) sepia(var(--backdrop-sepia, 0)); backdrop-filter: blur(var(--backdrop-blur, 0)) brightness(var(--backdrop-brightness, 1)) contrast(var(--backdrop-contrast, 1)) grayscale(var(--backdrop-grayscale, 0)) hue-rotate(var(--backdrop-hue-rotate, 0deg)) invert(var(--backdrop-invert, 0)) opacity(var(--backdrop-opacity, 1)) saturate(var(--backdrop-saturate, 1)) sepia(var(--backdrop-sepia, 0));`
|
|
1346
|
+
};
|
|
1347
|
+
var vars_default = vars;
|
|
1348
|
+
|
|
1349
|
+
// src/config.js
|
|
1350
|
+
var configOptions = {
|
|
1351
|
+
theme: theme_default,
|
|
1352
|
+
vars: vars_default
|
|
1353
|
+
};
|
|
1354
|
+
var config_default = configOptions;
|
|
1355
|
+
|
|
1356
|
+
// src/utils.js
|
|
1357
|
+
function isFunction(fn) {
|
|
1358
|
+
return fn && {}.toString.call(fn) === "[object Function]";
|
|
1359
|
+
}
|
|
1360
|
+
var configCache = /* @__PURE__ */ new WeakMap();
|
|
1361
|
+
var defaultContextCache = null;
|
|
1362
|
+
function createLazyTheme(userTheme = {}, userThemeExtend = {}) {
|
|
1363
|
+
const resolved = /* @__PURE__ */ new Map();
|
|
1364
|
+
const defaultTheme = config_default.theme;
|
|
1365
|
+
return new Proxy({}, {
|
|
1366
|
+
get(_, key) {
|
|
1367
|
+
if (resolved.has(key)) {
|
|
1368
|
+
return resolved.get(key);
|
|
1369
|
+
}
|
|
1370
|
+
let value = Object.prototype.hasOwnProperty.call(userTheme, key) ? userTheme[key] : defaultTheme[key];
|
|
1371
|
+
if (isFunction(value)) {
|
|
1372
|
+
value = value({
|
|
1373
|
+
theme: (keyRef) => {
|
|
1374
|
+
if (resolved.has(keyRef)) return resolved.get(keyRef);
|
|
1375
|
+
return createLazyTheme(userTheme, userThemeExtend)[keyRef];
|
|
1376
|
+
}
|
|
1377
|
+
});
|
|
1378
|
+
}
|
|
1379
|
+
if (userThemeExtend[key]) {
|
|
1380
|
+
value = Object.assign({}, value, userThemeExtend[key]);
|
|
1381
|
+
}
|
|
1382
|
+
resolved.set(key, value);
|
|
1383
|
+
return value;
|
|
1384
|
+
},
|
|
1385
|
+
has(_, key) {
|
|
1386
|
+
return key in defaultTheme || key in userTheme;
|
|
1387
|
+
},
|
|
1388
|
+
ownKeys(_) {
|
|
1389
|
+
return [.../* @__PURE__ */ new Set([...Object.keys(defaultTheme), ...Object.keys(userTheme)])];
|
|
1390
|
+
},
|
|
1391
|
+
getOwnPropertyDescriptor(_, key) {
|
|
1392
|
+
if (key in defaultTheme || key in userTheme) {
|
|
1393
|
+
return {
|
|
1394
|
+
enumerable: true,
|
|
1395
|
+
configurable: true
|
|
1396
|
+
};
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
});
|
|
1400
|
+
}
|
|
1401
|
+
function getConfigOptions(options = {}, pluginKeys = []) {
|
|
1402
|
+
if (!options || typeof options === "object" && Object.keys(options).length === 0) {
|
|
1403
|
+
if (!defaultContextCache) {
|
|
1404
|
+
defaultContextCache = {
|
|
1405
|
+
...config_default,
|
|
1406
|
+
theme: createLazyTheme({}, {})
|
|
1407
|
+
};
|
|
1408
|
+
}
|
|
1409
|
+
return defaultContextCache;
|
|
1410
|
+
}
|
|
1411
|
+
if (configCache.has(options)) {
|
|
1412
|
+
return configCache.get(options);
|
|
1413
|
+
}
|
|
1414
|
+
const { theme: theme2 = {} } = options;
|
|
1415
|
+
const { extend: themeExtend = {} } = theme2;
|
|
1416
|
+
const lazyTheme = createLazyTheme(theme2, themeExtend);
|
|
1417
|
+
const config = {
|
|
1418
|
+
...config_default,
|
|
1419
|
+
...options,
|
|
1420
|
+
theme: lazyTheme
|
|
1421
|
+
};
|
|
1422
|
+
configCache.set(options, config);
|
|
1423
|
+
return config;
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
// src/constants.js
|
|
1427
|
+
var TIME_VALUE_WITH_UNIT_REGEX = /^\d+(?:\.\d+)?(?:ms|s)$/;
|
|
1428
|
+
var TIME_VALUE_NUMERIC_REGEX = /^\d+(?:\.\d+)?$/;
|
|
1429
|
+
var CSS_ESCAPE_BACKSLASH_REGEX = /\\/g;
|
|
1430
|
+
var CSS_ESCAPE_SPECIAL_CHARS_REGEX = /([ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g;
|
|
1431
|
+
var CSS_ESCAPE_LEADING_DIGIT_REGEX = /^(\d)/;
|
|
1432
|
+
|
|
1433
|
+
// src/resolvers.js
|
|
1434
|
+
function resolveArbitraryValue(valueKey) {
|
|
1435
|
+
if (valueKey.startsWith("[") && valueKey.endsWith("]")) {
|
|
1436
|
+
return valueKey.slice(1, -1).replace(/_/g, " ");
|
|
1437
|
+
}
|
|
1438
|
+
return void 0;
|
|
1439
|
+
}
|
|
1440
|
+
function resolveThemeValue(scale, valueKey) {
|
|
1441
|
+
if (typeof scale !== "object" || scale === null) return void 0;
|
|
1442
|
+
if (Object.prototype.hasOwnProperty.call(scale, valueKey)) {
|
|
1443
|
+
return scale[valueKey];
|
|
1444
|
+
}
|
|
1445
|
+
const arbitrary = resolveArbitraryValue(valueKey);
|
|
1446
|
+
if (arbitrary !== void 0) return arbitrary;
|
|
1447
|
+
return void 0;
|
|
1448
|
+
}
|
|
1449
|
+
function resolveTimeValue(valueKey) {
|
|
1450
|
+
const arbitrary = resolveArbitraryValue(valueKey);
|
|
1451
|
+
if (arbitrary !== void 0) return arbitrary;
|
|
1452
|
+
if (TIME_VALUE_WITH_UNIT_REGEX.test(valueKey)) return valueKey;
|
|
1453
|
+
if (TIME_VALUE_NUMERIC_REGEX.test(valueKey)) return `${valueKey}ms`;
|
|
1454
|
+
return void 0;
|
|
1455
|
+
}
|
|
1456
|
+
function resolveColorValue(colors, colorKey) {
|
|
1457
|
+
if (!colors || typeof colors !== "object") return void 0;
|
|
1458
|
+
const arbitrary = resolveArbitraryValue(colorKey);
|
|
1459
|
+
if (arbitrary !== void 0) return arbitrary;
|
|
1460
|
+
if (Object.prototype.hasOwnProperty.call(colors, colorKey)) {
|
|
1461
|
+
const direct = colors[colorKey];
|
|
1462
|
+
if (typeof direct === "string") return direct;
|
|
1463
|
+
if (direct && typeof direct === "object" && typeof direct.DEFAULT === "string") {
|
|
1464
|
+
return direct.DEFAULT;
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
const segments = colorKey.split("-");
|
|
1468
|
+
let current = colors;
|
|
1469
|
+
for (let i = 0; i < segments.length; i += 1) {
|
|
1470
|
+
const segment = segments[i];
|
|
1471
|
+
if (!current || typeof current !== "object") return void 0;
|
|
1472
|
+
if (!Object.prototype.hasOwnProperty.call(current, segment)) return void 0;
|
|
1473
|
+
current = current[segment];
|
|
1474
|
+
}
|
|
1475
|
+
if (typeof current === "string") return current;
|
|
1476
|
+
if (current && typeof current === "object" && typeof current.DEFAULT === "string") {
|
|
1477
|
+
return current.DEFAULT;
|
|
1478
|
+
}
|
|
1479
|
+
return void 0;
|
|
1480
|
+
}
|
|
1481
|
+
function resolveColorWithOpacity(colors, rawKey) {
|
|
1482
|
+
const slashIdx = rawKey.lastIndexOf("/");
|
|
1483
|
+
if (slashIdx === -1) return resolveColorValue(colors, rawKey);
|
|
1484
|
+
const colorKey = rawKey.slice(0, slashIdx);
|
|
1485
|
+
const opacityStr = rawKey.slice(slashIdx + 1);
|
|
1486
|
+
const color = resolveColorValue(colors, colorKey);
|
|
1487
|
+
if (color === void 0) return void 0;
|
|
1488
|
+
const arbOpacity = resolveArbitraryValue(opacityStr);
|
|
1489
|
+
if (arbOpacity !== void 0) {
|
|
1490
|
+
const opacityVal = parseFloat(arbOpacity);
|
|
1491
|
+
if (isNaN(opacityVal)) return void 0;
|
|
1492
|
+
const finalOpacity = opacityVal <= 1 ? opacityVal * 100 : opacityVal;
|
|
1493
|
+
return `color-mix(in oklch, ${color} ${finalOpacity}%, transparent)`;
|
|
1494
|
+
}
|
|
1495
|
+
const opacityNum = parseFloat(opacityStr);
|
|
1496
|
+
if (isNaN(opacityNum)) return void 0;
|
|
1497
|
+
return `color-mix(in oklch, ${color} ${opacityNum}%, transparent)`;
|
|
1498
|
+
}
|
|
1499
|
+
function escapeCssIdentifier(value) {
|
|
1500
|
+
if (typeof CSS !== "undefined" && typeof CSS.escape === "function") {
|
|
1501
|
+
return CSS.escape(value);
|
|
1502
|
+
}
|
|
1503
|
+
return String(value).replace(CSS_ESCAPE_BACKSLASH_REGEX, "\\\\").replace(CSS_ESCAPE_SPECIAL_CHARS_REGEX, "\\$1").replace(CSS_ESCAPE_LEADING_DIGIT_REGEX, "\\3$1 ");
|
|
1504
|
+
}
|
|
1505
|
+
function appendImportant(declaration, isImportant) {
|
|
1506
|
+
if (!isImportant) return declaration;
|
|
1507
|
+
return declaration.replace(/([^;{}]+);/g, (match, decl) => {
|
|
1508
|
+
const trimmed = decl.trim();
|
|
1509
|
+
if (!trimmed || trimmed.includes("!important")) return match;
|
|
1510
|
+
return `${trimmed} !important;`;
|
|
1511
|
+
});
|
|
1512
|
+
}
|
|
1513
|
+
function splitByVariantDelimiter(token) {
|
|
1514
|
+
const parts = [];
|
|
1515
|
+
let start = 0;
|
|
1516
|
+
let bracketDepth = 0;
|
|
1517
|
+
for (let i = 0; i < token.length; i += 1) {
|
|
1518
|
+
const char = token[i];
|
|
1519
|
+
if (char === "[") {
|
|
1520
|
+
bracketDepth += 1;
|
|
1521
|
+
} else if (char === "]") {
|
|
1522
|
+
bracketDepth = Math.max(0, bracketDepth - 1);
|
|
1523
|
+
} else if (char === ":" && bracketDepth === 0) {
|
|
1524
|
+
parts.push(token.slice(start, i));
|
|
1525
|
+
start = i + 1;
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
parts.push(token.slice(start));
|
|
1529
|
+
return parts;
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
// src/maps/layout.maps.js
|
|
1533
|
+
function createSimpleMap(prop, values, keyMap = {}) {
|
|
1534
|
+
const map = {};
|
|
1535
|
+
values.forEach((value) => {
|
|
1536
|
+
const key = keyMap[value] || value;
|
|
1537
|
+
map[key] = `${prop}: ${value};`;
|
|
1538
|
+
});
|
|
1539
|
+
return map;
|
|
1540
|
+
}
|
|
1541
|
+
var DISPLAY_MAP = {
|
|
1542
|
+
...createSimpleMap("display", [
|
|
1543
|
+
"block",
|
|
1544
|
+
"inline",
|
|
1545
|
+
"inline-block",
|
|
1546
|
+
"flex",
|
|
1547
|
+
"inline-flex",
|
|
1548
|
+
"grid",
|
|
1549
|
+
"inline-grid",
|
|
1550
|
+
"contents",
|
|
1551
|
+
"flow-root",
|
|
1552
|
+
"list-item",
|
|
1553
|
+
"table",
|
|
1554
|
+
"inline-table",
|
|
1555
|
+
"table-caption",
|
|
1556
|
+
"table-cell",
|
|
1557
|
+
"table-column",
|
|
1558
|
+
"table-column-group",
|
|
1559
|
+
"table-footer-group",
|
|
1560
|
+
"table-header-group",
|
|
1561
|
+
"table-row-group",
|
|
1562
|
+
"table-row"
|
|
1563
|
+
]),
|
|
1564
|
+
hidden: "display: none;"
|
|
1565
|
+
// Special case
|
|
1566
|
+
};
|
|
1567
|
+
var POSITION_MAP = createSimpleMap("position", [
|
|
1568
|
+
"static",
|
|
1569
|
+
"fixed",
|
|
1570
|
+
"absolute",
|
|
1571
|
+
"relative",
|
|
1572
|
+
"sticky"
|
|
1573
|
+
]);
|
|
1574
|
+
var VISIBILITY_MAP = {
|
|
1575
|
+
...createSimpleMap("visibility", ["visible", "collapse"]),
|
|
1576
|
+
invisible: "visibility: hidden;"
|
|
1577
|
+
// Key differs from value
|
|
1578
|
+
};
|
|
1579
|
+
var OVERFLOW_VALUES = ["auto", "hidden", "clip", "visible", "scroll"];
|
|
1580
|
+
var OVERFLOW_MAP = createSimpleMap("overflow", OVERFLOW_VALUES);
|
|
1581
|
+
var OVERFLOW_X_MAP = createSimpleMap("overflow-x", OVERFLOW_VALUES);
|
|
1582
|
+
var OVERFLOW_Y_MAP = createSimpleMap("overflow-y", OVERFLOW_VALUES);
|
|
1583
|
+
var OVERSCROLL_VALUES = ["auto", "contain", "none"];
|
|
1584
|
+
var OVERSCROLL_MAP = createSimpleMap("overscroll-behavior", OVERSCROLL_VALUES);
|
|
1585
|
+
var OVERSCROLL_X_MAP = createSimpleMap("overscroll-behavior-x", OVERSCROLL_VALUES);
|
|
1586
|
+
var OVERSCROLL_Y_MAP = createSimpleMap("overscroll-behavior-y", OVERSCROLL_VALUES);
|
|
1587
|
+
var FLOAT_MAP = {
|
|
1588
|
+
...createSimpleMap("float", ["left", "right", "none"]),
|
|
1589
|
+
start: "float: inline-start;",
|
|
1590
|
+
end: "float: inline-end;"
|
|
1591
|
+
};
|
|
1592
|
+
var CLEAR_MAP = {
|
|
1593
|
+
...createSimpleMap("clear", ["left", "right", "both", "none"]),
|
|
1594
|
+
start: "clear: inline-start;",
|
|
1595
|
+
end: "clear: inline-end;"
|
|
1596
|
+
};
|
|
1597
|
+
var ISOLATION_MAP = {
|
|
1598
|
+
isolate: "isolation: isolate;",
|
|
1599
|
+
"isolation-auto": "isolation: auto;"
|
|
1600
|
+
};
|
|
1601
|
+
var OBJECT_FIT_MAP = createSimpleMap("object-fit", [
|
|
1602
|
+
"contain",
|
|
1603
|
+
"cover",
|
|
1604
|
+
"fill",
|
|
1605
|
+
"none",
|
|
1606
|
+
"scale-down"
|
|
1607
|
+
]);
|
|
1608
|
+
var TRANSFORM_STYLE_MAP = {
|
|
1609
|
+
"transform-style-flat": "transform-style: flat;",
|
|
1610
|
+
"transform-style-3d": "transform-style: preserve-3d;",
|
|
1611
|
+
"transform-3d": "transform-style: preserve-3d;"
|
|
1612
|
+
};
|
|
1613
|
+
var BACKFACE_MAP = {
|
|
1614
|
+
"backface-visible": "backface-visibility: visible;",
|
|
1615
|
+
"backface-hidden": "backface-visibility: hidden;"
|
|
1616
|
+
};
|
|
1617
|
+
var FIELD_SIZING_MAP = {
|
|
1618
|
+
"field-sizing-fixed": "field-sizing: fixed;",
|
|
1619
|
+
"field-sizing-content": "field-sizing: content;"
|
|
1620
|
+
};
|
|
1621
|
+
var BOX_SIZING_MAP = {
|
|
1622
|
+
border: "box-sizing: border-box;",
|
|
1623
|
+
content: "box-sizing: content-box;"
|
|
1624
|
+
};
|
|
1625
|
+
var BREAK_AFTER_BEFORE_VALUES = [
|
|
1626
|
+
"auto",
|
|
1627
|
+
"avoid",
|
|
1628
|
+
"avoid-page",
|
|
1629
|
+
"avoid-column",
|
|
1630
|
+
"page",
|
|
1631
|
+
"left",
|
|
1632
|
+
"right",
|
|
1633
|
+
"recto",
|
|
1634
|
+
"verso"
|
|
1635
|
+
];
|
|
1636
|
+
var BREAK_AFTER_MAP = {
|
|
1637
|
+
...createSimpleMap("break-after", BREAK_AFTER_BEFORE_VALUES),
|
|
1638
|
+
all: "break-after: all;"
|
|
1639
|
+
};
|
|
1640
|
+
var BREAK_BEFORE_MAP = createSimpleMap("break-before", BREAK_AFTER_BEFORE_VALUES);
|
|
1641
|
+
var BREAK_INSIDE_MAP = createSimpleMap("break-inside", [
|
|
1642
|
+
"auto",
|
|
1643
|
+
"avoid",
|
|
1644
|
+
"avoid-page",
|
|
1645
|
+
"avoid-column"
|
|
1646
|
+
]);
|
|
1647
|
+
var BOX_DECORATION_BREAK_MAP = createSimpleMap("box-decoration-break", [
|
|
1648
|
+
"slice",
|
|
1649
|
+
"clone"
|
|
1650
|
+
]);
|
|
1651
|
+
var HYPHENS_MAP = createSimpleMap("hyphens", ["none", "manual", "auto"]);
|
|
1652
|
+
var COLOR_SCHEME_MAP = createSimpleMap("color-scheme", [
|
|
1653
|
+
"light",
|
|
1654
|
+
"dark",
|
|
1655
|
+
"normal"
|
|
1656
|
+
]);
|
|
1657
|
+
var SCROLLBAR_COLOR_MAP = createSimpleMap("scrollbar-color", [
|
|
1658
|
+
"auto",
|
|
1659
|
+
"transparent",
|
|
1660
|
+
"current"
|
|
1661
|
+
]);
|
|
1662
|
+
var SCROLLBAR_WIDTH_MAP = createSimpleMap("scrollbar-width", [
|
|
1663
|
+
"auto",
|
|
1664
|
+
"thin",
|
|
1665
|
+
"none"
|
|
1666
|
+
]);
|
|
1667
|
+
var SCROLLBAR_GUTTER_MAP = {
|
|
1668
|
+
auto: "scrollbar-gutter: auto;",
|
|
1669
|
+
stable: "scrollbar-gutter: stable;",
|
|
1670
|
+
"stable-both-edges": "scrollbar-gutter: stable both-edges;",
|
|
1671
|
+
"both-edges": "scrollbar-gutter: both-edges;"
|
|
1672
|
+
};
|
|
1673
|
+
var TABLE_LAYOUT_MAP = createSimpleMap("table-layout", ["auto", "fixed"]);
|
|
1674
|
+
var CAPTION_SIDE_MAP = createSimpleMap("caption-side", ["top", "bottom"]);
|
|
1675
|
+
var BORDER_COLLAPSE_MAP = createSimpleMap("border-collapse", [
|
|
1676
|
+
"collapse",
|
|
1677
|
+
"separate"
|
|
1678
|
+
]);
|
|
1679
|
+
var SCROLL_BEHAVIOR_MAP = createSimpleMap("scroll-behavior", [
|
|
1680
|
+
"auto",
|
|
1681
|
+
"smooth"
|
|
1682
|
+
]);
|
|
1683
|
+
var SIDE_PROPS = {
|
|
1684
|
+
"": [""],
|
|
1685
|
+
t: ["-top"],
|
|
1686
|
+
r: ["-right"],
|
|
1687
|
+
b: ["-bottom"],
|
|
1688
|
+
l: ["-left"],
|
|
1689
|
+
x: ["-left", "-right"],
|
|
1690
|
+
y: ["-top", "-bottom"]
|
|
1691
|
+
};
|
|
1692
|
+
var INSET_AXIS_PROPS = {
|
|
1693
|
+
x: ["left", "right"],
|
|
1694
|
+
y: ["top", "bottom"]
|
|
1695
|
+
};
|
|
1696
|
+
var ROUNDED_PROPS = {
|
|
1697
|
+
"": ["border-radius"],
|
|
1698
|
+
t: ["border-top-left-radius", "border-top-right-radius"],
|
|
1699
|
+
r: ["border-top-right-radius", "border-bottom-right-radius"],
|
|
1700
|
+
b: ["border-bottom-right-radius", "border-bottom-left-radius"],
|
|
1701
|
+
l: ["border-top-left-radius", "border-bottom-left-radius"],
|
|
1702
|
+
tl: ["border-top-left-radius"],
|
|
1703
|
+
tr: ["border-top-right-radius"],
|
|
1704
|
+
br: ["border-bottom-right-radius"],
|
|
1705
|
+
bl: ["border-bottom-left-radius"],
|
|
1706
|
+
ss: ["border-start-start-radius"],
|
|
1707
|
+
se: ["border-start-end-radius"],
|
|
1708
|
+
es: ["border-end-start-radius"],
|
|
1709
|
+
ee: ["border-end-end-radius"]
|
|
1710
|
+
};
|
|
1711
|
+
|
|
1712
|
+
// src/maps/interactivity.maps.js
|
|
1713
|
+
function createSimpleMap2(prop, values) {
|
|
1714
|
+
const map = {};
|
|
1715
|
+
values.forEach((value) => {
|
|
1716
|
+
map[value] = `${prop}: ${value};`;
|
|
1717
|
+
});
|
|
1718
|
+
return map;
|
|
1719
|
+
}
|
|
1720
|
+
var CURSOR_MAP = createSimpleMap2("cursor", [
|
|
1721
|
+
"auto",
|
|
1722
|
+
"default",
|
|
1723
|
+
"pointer",
|
|
1724
|
+
"wait",
|
|
1725
|
+
"text",
|
|
1726
|
+
"move",
|
|
1727
|
+
"help",
|
|
1728
|
+
"not-allowed",
|
|
1729
|
+
"none",
|
|
1730
|
+
"context-menu",
|
|
1731
|
+
"progress",
|
|
1732
|
+
"cell",
|
|
1733
|
+
"crosshair",
|
|
1734
|
+
"vertical-text",
|
|
1735
|
+
"alias",
|
|
1736
|
+
"copy",
|
|
1737
|
+
"no-drop",
|
|
1738
|
+
"grab",
|
|
1739
|
+
"grabbing",
|
|
1740
|
+
"all-scroll",
|
|
1741
|
+
"zoom-in",
|
|
1742
|
+
"zoom-out"
|
|
1743
|
+
]);
|
|
1744
|
+
var POINTER_EVENTS_MAP = createSimpleMap2("pointer-events", ["none", "auto"]);
|
|
1745
|
+
var USER_SELECT_MAP = createSimpleMap2("user-select", [
|
|
1746
|
+
"none",
|
|
1747
|
+
"text",
|
|
1748
|
+
"all",
|
|
1749
|
+
"auto"
|
|
1750
|
+
]);
|
|
1751
|
+
var APPEARANCE_MAP = createSimpleMap2("appearance", ["none", "auto"]);
|
|
1752
|
+
var TOUCH_ACTION_MAP = createSimpleMap2("touch-action", [
|
|
1753
|
+
"auto",
|
|
1754
|
+
"none",
|
|
1755
|
+
"pan-x",
|
|
1756
|
+
"pan-left",
|
|
1757
|
+
"pan-right",
|
|
1758
|
+
"pan-y",
|
|
1759
|
+
"pan-up",
|
|
1760
|
+
"pan-down",
|
|
1761
|
+
"pinch-zoom",
|
|
1762
|
+
"manipulation"
|
|
1763
|
+
]);
|
|
1764
|
+
var OUTLINE_STYLE_MAP = {
|
|
1765
|
+
none: "outline: 2px solid transparent; outline-offset: 2px;",
|
|
1766
|
+
...createSimpleMap2("outline-style", ["solid", "dashed", "dotted", "double"])
|
|
1767
|
+
};
|
|
1768
|
+
var BORDER_STYLE_MAP = createSimpleMap2("border-style", [
|
|
1769
|
+
"solid",
|
|
1770
|
+
"dashed",
|
|
1771
|
+
"dotted",
|
|
1772
|
+
"double",
|
|
1773
|
+
"hidden",
|
|
1774
|
+
"none"
|
|
1775
|
+
]);
|
|
1776
|
+
var TRANSITION_PROPERTY_MAP = {
|
|
1777
|
+
none: "none",
|
|
1778
|
+
all: "all",
|
|
1779
|
+
DEFAULT: "color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",
|
|
1780
|
+
colors: "color, background-color, border-color, text-decoration-color, fill, stroke",
|
|
1781
|
+
opacity: "opacity",
|
|
1782
|
+
shadow: "box-shadow",
|
|
1783
|
+
transform: "transform"
|
|
1784
|
+
};
|
|
1785
|
+
var TRANSITION_TIMING_MAP = {
|
|
1786
|
+
linear: "linear",
|
|
1787
|
+
in: "cubic-bezier(0.4, 0, 1, 1)",
|
|
1788
|
+
out: "cubic-bezier(0, 0, 0.2, 1)",
|
|
1789
|
+
"in-out": "cubic-bezier(0.4, 0, 0.2, 1)"
|
|
1790
|
+
};
|
|
1791
|
+
|
|
1792
|
+
// src/builders/layout.js
|
|
1793
|
+
function buildLayoutDeclaration(baseToken, theme2) {
|
|
1794
|
+
if (baseToken.startsWith("overflow-x-")) return OVERFLOW_X_MAP[baseToken.slice(11)] ?? void 0;
|
|
1795
|
+
if (baseToken.startsWith("overflow-y-")) return OVERFLOW_Y_MAP[baseToken.slice(11)] ?? void 0;
|
|
1796
|
+
if (baseToken.startsWith("overflow-")) return OVERFLOW_MAP[baseToken.slice(9)] ?? void 0;
|
|
1797
|
+
if (baseToken.startsWith("overscroll-x-")) return OVERSCROLL_X_MAP[baseToken.slice(13)] ?? void 0;
|
|
1798
|
+
if (baseToken.startsWith("overscroll-y-")) return OVERSCROLL_Y_MAP[baseToken.slice(13)] ?? void 0;
|
|
1799
|
+
if (baseToken.startsWith("overscroll-")) return OVERSCROLL_MAP[baseToken.slice(11)] ?? void 0;
|
|
1800
|
+
if (baseToken.startsWith("float-")) return FLOAT_MAP[baseToken.slice(6)] ?? void 0;
|
|
1801
|
+
if (baseToken.startsWith("clear-")) return CLEAR_MAP[baseToken.slice(6)] ?? void 0;
|
|
1802
|
+
if (baseToken.startsWith("object-fit-")) return OBJECT_FIT_MAP[baseToken.slice(11)] ?? void 0;
|
|
1803
|
+
if (baseToken.startsWith("object-")) {
|
|
1804
|
+
const val = baseToken.slice(7);
|
|
1805
|
+
if (OBJECT_FIT_MAP[val]) return OBJECT_FIT_MAP[val];
|
|
1806
|
+
const pos = resolveThemeValue(theme2.objectPosition || {}, val);
|
|
1807
|
+
if (pos !== void 0) return `object-position: ${pos};`;
|
|
1808
|
+
}
|
|
1809
|
+
if (baseToken.startsWith("z-") || baseToken.startsWith("-z-")) {
|
|
1810
|
+
const negative = baseToken.startsWith("-");
|
|
1811
|
+
const key = negative ? baseToken.slice(3) : baseToken.slice(2);
|
|
1812
|
+
const val = resolveThemeValue(theme2.zIndex || {}, key);
|
|
1813
|
+
if (val !== void 0) return `z-index: ${negative ? `-${val}` : val};`;
|
|
1814
|
+
const arb = resolveArbitraryValue(negative ? baseToken.slice(3) : baseToken.slice(2));
|
|
1815
|
+
if (arb !== void 0) return `z-index: ${negative ? `-${arb}` : arb};`;
|
|
1816
|
+
}
|
|
1817
|
+
if (baseToken.startsWith("order-")) {
|
|
1818
|
+
const val = resolveThemeValue(theme2.order || {}, baseToken.slice(6));
|
|
1819
|
+
if (val !== void 0) return `order: ${val};`;
|
|
1820
|
+
}
|
|
1821
|
+
if (baseToken.startsWith("break-after-")) return BREAK_AFTER_MAP[baseToken.slice(12)] ?? void 0;
|
|
1822
|
+
if (baseToken.startsWith("break-before-")) return BREAK_BEFORE_MAP[baseToken.slice(13)] ?? void 0;
|
|
1823
|
+
if (baseToken.startsWith("break-inside-")) return BREAK_INSIDE_MAP[baseToken.slice(13)] ?? void 0;
|
|
1824
|
+
if (baseToken.startsWith("box-decoration-break-")) return BOX_DECORATION_BREAK_MAP[baseToken.slice(21)] ?? void 0;
|
|
1825
|
+
if (baseToken.startsWith("hyphens-")) return HYPHENS_MAP[baseToken.slice(8)] ?? void 0;
|
|
1826
|
+
if (baseToken.startsWith("color-scheme-")) return COLOR_SCHEME_MAP[baseToken.slice(13)] ?? void 0;
|
|
1827
|
+
if (baseToken.startsWith("scrollbar-color-")) return SCROLLBAR_COLOR_MAP[baseToken.slice(16)] ?? void 0;
|
|
1828
|
+
if (baseToken.startsWith("scrollbar-width-")) return SCROLLBAR_WIDTH_MAP[baseToken.slice(16)] ?? void 0;
|
|
1829
|
+
if (baseToken.startsWith("scrollbar-gutter-")) return SCROLLBAR_GUTTER_MAP[baseToken.slice(17)] ?? void 0;
|
|
1830
|
+
if (baseToken.startsWith("scroll-behavior-")) return SCROLL_BEHAVIOR_MAP[baseToken.slice(16)] ?? void 0;
|
|
1831
|
+
if (baseToken.startsWith("aspect-")) {
|
|
1832
|
+
const val = resolveThemeValue(theme2.aspectRatio || {}, baseToken.slice(7));
|
|
1833
|
+
if (val !== void 0) return `aspect-ratio: ${val};`;
|
|
1834
|
+
const arb = resolveArbitraryValue(baseToken.slice(7));
|
|
1835
|
+
if (arb !== void 0) return `aspect-ratio: ${arb};`;
|
|
1836
|
+
}
|
|
1837
|
+
if (baseToken.startsWith("columns-")) {
|
|
1838
|
+
const val = resolveThemeValue(theme2.columns || {}, baseToken.slice(8));
|
|
1839
|
+
if (val !== void 0) return `columns: ${val};`;
|
|
1840
|
+
}
|
|
1841
|
+
if (baseToken.startsWith("box-")) return BOX_SIZING_MAP[baseToken.slice(4)] ?? void 0;
|
|
1842
|
+
if (baseToken.startsWith("table-")) {
|
|
1843
|
+
const key = baseToken.slice(6);
|
|
1844
|
+
if (TABLE_LAYOUT_MAP[key]) return TABLE_LAYOUT_MAP[key];
|
|
1845
|
+
}
|
|
1846
|
+
if (baseToken.startsWith("caption-")) return CAPTION_SIDE_MAP[baseToken.slice(8)] ?? void 0;
|
|
1847
|
+
if (baseToken.startsWith("border-collapse") || baseToken.startsWith("border-separate")) {
|
|
1848
|
+
return BORDER_COLLAPSE_MAP[baseToken.slice(7)] ?? void 0;
|
|
1849
|
+
}
|
|
1850
|
+
if (baseToken.startsWith("scroll-")) {
|
|
1851
|
+
const key = baseToken.slice(7);
|
|
1852
|
+
if (SCROLL_BEHAVIOR_MAP[key]) return SCROLL_BEHAVIOR_MAP[key];
|
|
1853
|
+
const smMatch = baseToken.match(/^scroll-m([trblxy]?)-(.+)$/);
|
|
1854
|
+
if (smMatch) {
|
|
1855
|
+
const [, side, valueKey] = smMatch;
|
|
1856
|
+
const val = resolveThemeValue(theme2.scrollMargin || theme2.spacing || {}, valueKey);
|
|
1857
|
+
if (val === void 0) return void 0;
|
|
1858
|
+
const suffixes = SIDE_PROPS[side] ?? void 0;
|
|
1859
|
+
if (!suffixes) return void 0;
|
|
1860
|
+
return suffixes.map((s) => `scroll-margin${s}: ${val};`).join(" ");
|
|
1861
|
+
}
|
|
1862
|
+
const spMatch = baseToken.match(/^scroll-p([trblxy]?)-(.+)$/);
|
|
1863
|
+
if (spMatch) {
|
|
1864
|
+
const [, side, valueKey] = spMatch;
|
|
1865
|
+
const val = resolveThemeValue(theme2.scrollPadding || theme2.spacing || {}, valueKey);
|
|
1866
|
+
if (val === void 0) return void 0;
|
|
1867
|
+
const suffixes = SIDE_PROPS[side] ?? void 0;
|
|
1868
|
+
if (!suffixes) return void 0;
|
|
1869
|
+
return suffixes.map((s) => `scroll-padding${s}: ${val};`).join(" ");
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
if (baseToken.startsWith("will-change-")) {
|
|
1873
|
+
const val = resolveThemeValue(theme2.willChange || {}, baseToken.slice(12));
|
|
1874
|
+
if (val !== void 0) return `will-change: ${val};`;
|
|
1875
|
+
}
|
|
1876
|
+
if (baseToken.startsWith("content-")) {
|
|
1877
|
+
const valueKey = baseToken.slice(8);
|
|
1878
|
+
if (valueKey.startsWith("[") && valueKey.endsWith("]")) {
|
|
1879
|
+
const arb = resolveArbitraryValue(valueKey);
|
|
1880
|
+
if (arb !== void 0) return `content: ${arb};`;
|
|
1881
|
+
} else {
|
|
1882
|
+
const val = resolveThemeValue(theme2.content || {}, valueKey);
|
|
1883
|
+
if (val !== void 0) return `content: "${val}";`;
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
if (baseToken.startsWith("size-")) {
|
|
1887
|
+
const val = resolveThemeValue(theme2.size || theme2.spacing || {}, baseToken.slice(5));
|
|
1888
|
+
if (val !== void 0) return `width: ${val}; height: ${val};`;
|
|
1889
|
+
}
|
|
1890
|
+
if (DISPLAY_MAP[baseToken]) return DISPLAY_MAP[baseToken];
|
|
1891
|
+
if (VISIBILITY_MAP[baseToken]) return VISIBILITY_MAP[baseToken];
|
|
1892
|
+
if (ISOLATION_MAP[baseToken]) return ISOLATION_MAP[baseToken];
|
|
1893
|
+
if (TRANSFORM_STYLE_MAP[baseToken]) return TRANSFORM_STYLE_MAP[baseToken];
|
|
1894
|
+
if (BACKFACE_MAP[baseToken]) return BACKFACE_MAP[baseToken];
|
|
1895
|
+
if (FIELD_SIZING_MAP[baseToken]) return FIELD_SIZING_MAP[baseToken];
|
|
1896
|
+
if (baseToken.startsWith("touch-")) {
|
|
1897
|
+
const key = baseToken.slice(6);
|
|
1898
|
+
if (TOUCH_ACTION_MAP[key]) return TOUCH_ACTION_MAP[key];
|
|
1899
|
+
}
|
|
1900
|
+
if (TOUCH_ACTION_MAP[baseToken]) return TOUCH_ACTION_MAP[baseToken];
|
|
1901
|
+
if (APPEARANCE_MAP[baseToken]) return APPEARANCE_MAP[baseToken];
|
|
1902
|
+
return void 0;
|
|
1903
|
+
}
|
|
1904
|
+
function buildPositionInsetDeclaration(baseToken, theme2) {
|
|
1905
|
+
if (POSITION_MAP[baseToken]) return POSITION_MAP[baseToken];
|
|
1906
|
+
const negative = baseToken.startsWith("-");
|
|
1907
|
+
const normalized = negative ? baseToken.slice(1) : baseToken;
|
|
1908
|
+
const insetScale = theme2.inset || theme2.spacing || {};
|
|
1909
|
+
const directionalMatch = normalized.match(/^(top|right|bottom|left)-(.+)$/);
|
|
1910
|
+
if (directionalMatch) {
|
|
1911
|
+
const [, side, valueKey] = directionalMatch;
|
|
1912
|
+
let value = resolveThemeValue(insetScale, valueKey);
|
|
1913
|
+
if (value === void 0) return void 0;
|
|
1914
|
+
if (negative && value !== "auto") value = `-${value}`;
|
|
1915
|
+
return `${side}: ${value};`;
|
|
1916
|
+
}
|
|
1917
|
+
const axisMatch = normalized.match(/^inset-([xy])-(.+)$/);
|
|
1918
|
+
if (axisMatch) {
|
|
1919
|
+
const [, axis, valueKey] = axisMatch;
|
|
1920
|
+
let value = resolveThemeValue(insetScale, valueKey);
|
|
1921
|
+
if (value === void 0) return void 0;
|
|
1922
|
+
if (negative && value !== "auto") value = `-${value}`;
|
|
1923
|
+
const props = INSET_AXIS_PROPS[axis];
|
|
1924
|
+
if (!props) return void 0;
|
|
1925
|
+
return props.map((prop) => `${prop}: ${value};`).join(" ");
|
|
1926
|
+
}
|
|
1927
|
+
const insetMatch = normalized.match(/^inset-(.+)$/);
|
|
1928
|
+
if (insetMatch) {
|
|
1929
|
+
const valueKey = insetMatch[1];
|
|
1930
|
+
let value = resolveThemeValue(insetScale, valueKey);
|
|
1931
|
+
if (value === void 0) return void 0;
|
|
1932
|
+
if (negative && value !== "auto") value = `-${value}`;
|
|
1933
|
+
return `top: ${value}; right: ${value}; bottom: ${value}; left: ${value};`;
|
|
1934
|
+
}
|
|
1935
|
+
return void 0;
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
// src/builders/spacing.js
|
|
1939
|
+
function buildSpacingDeclaration(baseToken, theme2) {
|
|
1940
|
+
const negative = baseToken.startsWith("-");
|
|
1941
|
+
const normalized = negative ? baseToken.slice(1) : baseToken;
|
|
1942
|
+
const match = normalized.match(/^(m|p)([trblxy]?)-(.+)$/);
|
|
1943
|
+
if (!match) return void 0;
|
|
1944
|
+
const [, kind, side, valueKey] = match;
|
|
1945
|
+
const baseProp = kind === "m" ? "margin" : "padding";
|
|
1946
|
+
let value = resolveThemeValue(theme2.spacing || {}, valueKey);
|
|
1947
|
+
if (value === void 0 && kind === "m" && valueKey === "auto") value = "auto";
|
|
1948
|
+
if (value === void 0) return void 0;
|
|
1949
|
+
if (negative && value !== "auto") value = `-${value}`;
|
|
1950
|
+
const suffixes = SIDE_PROPS[side];
|
|
1951
|
+
if (!suffixes) return void 0;
|
|
1952
|
+
return suffixes.map((s) => `${baseProp}${s}: ${value};`).join(" ");
|
|
1953
|
+
}
|
|
1954
|
+
function buildGapDeclaration(baseToken, theme2) {
|
|
1955
|
+
const match = baseToken.match(/^gap(?:-([xy]))?-(.+)$/);
|
|
1956
|
+
if (!match) return void 0;
|
|
1957
|
+
const [, axis = "", valueKey] = match;
|
|
1958
|
+
const gapScale = theme2.gap || theme2.spacing || {};
|
|
1959
|
+
const value = resolveThemeValue(gapScale, valueKey);
|
|
1960
|
+
if (value === void 0) return void 0;
|
|
1961
|
+
if (axis === "x") return `column-gap: ${value};`;
|
|
1962
|
+
if (axis === "y") return `row-gap: ${value};`;
|
|
1963
|
+
return `gap: ${value};`;
|
|
1964
|
+
}
|
|
1965
|
+
function buildDimensionDeclaration(baseToken, theme2) {
|
|
1966
|
+
const patterns = [
|
|
1967
|
+
{ prefix: "min-inline-size-", prop: "min-inline-size", scale: theme2.minWidth || theme2.width || theme2.spacing || {} },
|
|
1968
|
+
{ prefix: "max-inline-size-", prop: "max-inline-size", scale: theme2.maxWidth || theme2.width || theme2.spacing || {} },
|
|
1969
|
+
{ prefix: "inline-size-", prop: "inline-size", scale: theme2.width || theme2.spacing || {} },
|
|
1970
|
+
{ prefix: "min-block-size-", prop: "min-block-size", scale: theme2.minHeight || theme2.height || theme2.spacing || {} },
|
|
1971
|
+
{ prefix: "max-block-size-", prop: "max-block-size", scale: theme2.maxHeight || theme2.height || theme2.spacing || {} },
|
|
1972
|
+
{ prefix: "block-size-", prop: "block-size", scale: theme2.height || theme2.spacing || {} },
|
|
1973
|
+
{ prefix: "min-w-", prop: "min-width", scale: theme2.minWidth || theme2.width || {} },
|
|
1974
|
+
{ prefix: "max-w-", prop: "max-width", scale: theme2.maxWidth || theme2.width || {} },
|
|
1975
|
+
{ prefix: "min-h-", prop: "min-height", scale: theme2.minHeight || theme2.height || {} },
|
|
1976
|
+
{ prefix: "max-h-", prop: "max-height", scale: theme2.maxHeight || theme2.height || {} },
|
|
1977
|
+
{ prefix: "w-", prop: "width", scale: theme2.width || {} },
|
|
1978
|
+
{ prefix: "h-", prop: "height", scale: theme2.height || {} }
|
|
1979
|
+
];
|
|
1980
|
+
for (const pattern of patterns) {
|
|
1981
|
+
if (!baseToken.startsWith(pattern.prefix)) continue;
|
|
1982
|
+
const valueKey = baseToken.slice(pattern.prefix.length);
|
|
1983
|
+
let value = resolveThemeValue(pattern.scale, valueKey);
|
|
1984
|
+
if (value === void 0) value = resolveThemeValue(theme2.spacing || {}, valueKey);
|
|
1985
|
+
if (value === void 0) {
|
|
1986
|
+
const arb = resolveArbitraryValue(valueKey);
|
|
1987
|
+
if (arb !== void 0) return `${pattern.prop}: ${arb};`;
|
|
1988
|
+
return void 0;
|
|
1989
|
+
}
|
|
1990
|
+
return `${pattern.prop}: ${value};`;
|
|
1991
|
+
}
|
|
1992
|
+
return void 0;
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
// src/maps/flexgrid.maps.js
|
|
1996
|
+
var FLEX_DIRECTION_MAP = {
|
|
1997
|
+
row: "flex-direction: row;",
|
|
1998
|
+
"row-reverse": "flex-direction: row-reverse;",
|
|
1999
|
+
col: "flex-direction: column;",
|
|
2000
|
+
"col-reverse": "flex-direction: column-reverse;"
|
|
2001
|
+
};
|
|
2002
|
+
var FLEX_WRAP_MAP = {
|
|
2003
|
+
nowrap: "flex-wrap: nowrap;",
|
|
2004
|
+
wrap: "flex-wrap: wrap;",
|
|
2005
|
+
"wrap-reverse": "flex-wrap: wrap-reverse;"
|
|
2006
|
+
};
|
|
2007
|
+
var ALIGN_CONTENT_MAP = {
|
|
2008
|
+
normal: "align-content: normal;",
|
|
2009
|
+
center: "align-content: center;",
|
|
2010
|
+
start: "align-content: flex-start;",
|
|
2011
|
+
end: "align-content: flex-end;",
|
|
2012
|
+
between: "align-content: space-between;",
|
|
2013
|
+
around: "align-content: space-around;",
|
|
2014
|
+
evenly: "align-content: space-evenly;",
|
|
2015
|
+
baseline: "align-content: baseline;",
|
|
2016
|
+
stretch: "align-content: stretch;"
|
|
2017
|
+
};
|
|
2018
|
+
var ALIGN_SELF_MAP = {
|
|
2019
|
+
auto: "align-self: auto;",
|
|
2020
|
+
start: "align-self: flex-start;",
|
|
2021
|
+
end: "align-self: flex-end;",
|
|
2022
|
+
center: "align-self: center;",
|
|
2023
|
+
stretch: "align-self: stretch;",
|
|
2024
|
+
baseline: "align-self: baseline;"
|
|
2025
|
+
};
|
|
2026
|
+
var ALIGN_ITEMS_MAP = {
|
|
2027
|
+
start: "align-items: flex-start;",
|
|
2028
|
+
end: "align-items: flex-end;",
|
|
2029
|
+
center: "align-items: center;",
|
|
2030
|
+
baseline: "align-items: baseline;",
|
|
2031
|
+
stretch: "align-items: stretch;"
|
|
2032
|
+
};
|
|
2033
|
+
var JUSTIFY_CONTENT_MAP = {
|
|
2034
|
+
normal: "justify-content: normal;",
|
|
2035
|
+
start: "justify-content: flex-start;",
|
|
2036
|
+
end: "justify-content: flex-end;",
|
|
2037
|
+
center: "justify-content: center;",
|
|
2038
|
+
between: "justify-content: space-between;",
|
|
2039
|
+
around: "justify-content: space-around;",
|
|
2040
|
+
evenly: "justify-content: space-evenly;",
|
|
2041
|
+
stretch: "justify-content: stretch;"
|
|
2042
|
+
};
|
|
2043
|
+
var JUSTIFY_ITEMS_MAP = {
|
|
2044
|
+
normal: "justify-items: normal;",
|
|
2045
|
+
start: "justify-items: start;",
|
|
2046
|
+
end: "justify-items: end;",
|
|
2047
|
+
center: "justify-items: center;",
|
|
2048
|
+
stretch: "justify-items: stretch;"
|
|
2049
|
+
};
|
|
2050
|
+
var JUSTIFY_SELF_MAP = {
|
|
2051
|
+
auto: "justify-self: auto;",
|
|
2052
|
+
start: "justify-self: start;",
|
|
2053
|
+
end: "justify-self: end;",
|
|
2054
|
+
center: "justify-self: center;",
|
|
2055
|
+
stretch: "justify-self: stretch;"
|
|
2056
|
+
};
|
|
2057
|
+
var PLACE_CONTENT_MAP = {
|
|
2058
|
+
center: "place-content: center;",
|
|
2059
|
+
start: "place-content: start;",
|
|
2060
|
+
end: "place-content: end;",
|
|
2061
|
+
between: "place-content: space-between;",
|
|
2062
|
+
around: "place-content: space-around;",
|
|
2063
|
+
evenly: "place-content: space-evenly;",
|
|
2064
|
+
baseline: "place-content: baseline;",
|
|
2065
|
+
stretch: "place-content: stretch;"
|
|
2066
|
+
};
|
|
2067
|
+
var PLACE_ITEMS_MAP = {
|
|
2068
|
+
start: "place-items: start;",
|
|
2069
|
+
end: "place-items: end;",
|
|
2070
|
+
center: "place-items: center;",
|
|
2071
|
+
baseline: "place-items: baseline;",
|
|
2072
|
+
stretch: "place-items: stretch;"
|
|
2073
|
+
};
|
|
2074
|
+
var PLACE_SELF_MAP = {
|
|
2075
|
+
auto: "place-self: auto;",
|
|
2076
|
+
start: "place-self: start;",
|
|
2077
|
+
end: "place-self: end;",
|
|
2078
|
+
center: "place-self: center;",
|
|
2079
|
+
stretch: "place-self: stretch;"
|
|
2080
|
+
};
|
|
2081
|
+
var GRID_AUTO_FLOW_MAP = {
|
|
2082
|
+
row: "grid-auto-flow: row;",
|
|
2083
|
+
col: "grid-auto-flow: column;",
|
|
2084
|
+
dense: "grid-auto-flow: dense;",
|
|
2085
|
+
"row-dense": "grid-auto-flow: row dense;",
|
|
2086
|
+
"col-dense": "grid-auto-flow: column dense;"
|
|
2087
|
+
};
|
|
2088
|
+
|
|
2089
|
+
// src/builders/flexgrid.js
|
|
2090
|
+
function buildFlexGridDeclaration(baseToken, theme2) {
|
|
2091
|
+
if (baseToken === "grow") return "flex-grow: 1;";
|
|
2092
|
+
if (baseToken === "grow-0") return "flex-grow: 0;";
|
|
2093
|
+
if (baseToken === "shrink") return "flex-shrink: 1;";
|
|
2094
|
+
if (baseToken === "shrink-0") return "flex-shrink: 0;";
|
|
2095
|
+
if (baseToken.startsWith("grow-")) {
|
|
2096
|
+
const val = resolveThemeValue(theme2.flexGrow || {}, baseToken.slice(5));
|
|
2097
|
+
if (val !== void 0) return `flex-grow: ${val};`;
|
|
2098
|
+
}
|
|
2099
|
+
if (baseToken.startsWith("shrink-")) {
|
|
2100
|
+
const val = resolveThemeValue(theme2.flexShrink || {}, baseToken.slice(7));
|
|
2101
|
+
if (val !== void 0) return `flex-shrink: ${val};`;
|
|
2102
|
+
}
|
|
2103
|
+
if (baseToken.startsWith("basis-")) {
|
|
2104
|
+
const val = resolveThemeValue(theme2.flexBasis || theme2.spacing || {}, baseToken.slice(6));
|
|
2105
|
+
if (val !== void 0) return `flex-basis: ${val};`;
|
|
2106
|
+
}
|
|
2107
|
+
if (baseToken === "flex-1") return "flex: 1 1 0%;";
|
|
2108
|
+
if (baseToken === "flex-auto") return "flex: 1 1 auto;";
|
|
2109
|
+
if (baseToken === "flex-initial") return "flex: 0 1 auto;";
|
|
2110
|
+
if (baseToken === "flex-none") return "flex: none;";
|
|
2111
|
+
if (baseToken.startsWith("flex-")) {
|
|
2112
|
+
const value = baseToken.slice(5);
|
|
2113
|
+
if (FLEX_DIRECTION_MAP[value]) return FLEX_DIRECTION_MAP[value];
|
|
2114
|
+
if (FLEX_WRAP_MAP[value]) return FLEX_WRAP_MAP[value];
|
|
2115
|
+
const themeVal = resolveThemeValue(theme2.flex || {}, value);
|
|
2116
|
+
if (themeVal !== void 0) return `flex: ${themeVal};`;
|
|
2117
|
+
}
|
|
2118
|
+
if (baseToken.startsWith("content-")) {
|
|
2119
|
+
const key = baseToken.slice(8);
|
|
2120
|
+
if (ALIGN_CONTENT_MAP[key]) return ALIGN_CONTENT_MAP[key];
|
|
2121
|
+
}
|
|
2122
|
+
if (baseToken.startsWith("self-")) return ALIGN_SELF_MAP[baseToken.slice(5)] ?? void 0;
|
|
2123
|
+
if (baseToken.startsWith("justify-items-")) return JUSTIFY_ITEMS_MAP[baseToken.slice(14)] ?? void 0;
|
|
2124
|
+
if (baseToken.startsWith("justify-self-")) return JUSTIFY_SELF_MAP[baseToken.slice(13)] ?? void 0;
|
|
2125
|
+
if (baseToken.startsWith("justify-")) return JUSTIFY_CONTENT_MAP[baseToken.slice(8)] ?? void 0;
|
|
2126
|
+
if (baseToken.startsWith("items-")) return ALIGN_ITEMS_MAP[baseToken.slice(6)] ?? void 0;
|
|
2127
|
+
if (baseToken.startsWith("place-content-")) return PLACE_CONTENT_MAP[baseToken.slice(14)] ?? void 0;
|
|
2128
|
+
if (baseToken.startsWith("place-items-")) return PLACE_ITEMS_MAP[baseToken.slice(12)] ?? void 0;
|
|
2129
|
+
if (baseToken.startsWith("place-self-")) return PLACE_SELF_MAP[baseToken.slice(11)] ?? void 0;
|
|
2130
|
+
if (baseToken.startsWith("grid-flow-")) return GRID_AUTO_FLOW_MAP[baseToken.slice(10)] ?? void 0;
|
|
2131
|
+
if (baseToken.startsWith("auto-cols-")) {
|
|
2132
|
+
const val = resolveThemeValue(theme2.gridAutoColumns || {}, baseToken.slice(10));
|
|
2133
|
+
if (val !== void 0) return `grid-auto-columns: ${val};`;
|
|
2134
|
+
}
|
|
2135
|
+
if (baseToken.startsWith("auto-rows-")) {
|
|
2136
|
+
const val = resolveThemeValue(theme2.gridAutoRows || {}, baseToken.slice(10));
|
|
2137
|
+
if (val !== void 0) return `grid-auto-rows: ${val};`;
|
|
2138
|
+
}
|
|
2139
|
+
if (baseToken.startsWith("grid-cols-")) {
|
|
2140
|
+
const valueKey = baseToken.slice(10);
|
|
2141
|
+
const direct = resolveThemeValue(theme2.gridTemplateColumns || {}, valueKey);
|
|
2142
|
+
if (direct !== void 0) return `grid-template-columns: ${direct};`;
|
|
2143
|
+
if (/^\d+$/.test(valueKey)) return `grid-template-columns: repeat(${valueKey}, minmax(0, 1fr));`;
|
|
2144
|
+
const arb = resolveArbitraryValue(valueKey);
|
|
2145
|
+
if (arb !== void 0) return `grid-template-columns: ${arb};`;
|
|
2146
|
+
}
|
|
2147
|
+
if (baseToken.startsWith("grid-rows-")) {
|
|
2148
|
+
const valueKey = baseToken.slice(10);
|
|
2149
|
+
const direct = resolveThemeValue(theme2.gridTemplateRows || {}, valueKey);
|
|
2150
|
+
if (direct !== void 0) return `grid-template-rows: ${direct};`;
|
|
2151
|
+
if (/^\d+$/.test(valueKey)) return `grid-template-rows: repeat(${valueKey}, minmax(0, 1fr));`;
|
|
2152
|
+
const arb = resolveArbitraryValue(valueKey);
|
|
2153
|
+
if (arb !== void 0) return `grid-template-rows: ${arb};`;
|
|
2154
|
+
}
|
|
2155
|
+
if (baseToken.startsWith("col-")) {
|
|
2156
|
+
const val = resolveThemeValue(theme2.gridColumn || {}, baseToken.slice(4));
|
|
2157
|
+
if (val !== void 0) return `grid-column: ${val};`;
|
|
2158
|
+
const spanMatch = baseToken.match(/^col-span-(\d+)$/);
|
|
2159
|
+
if (spanMatch) return `grid-column: span ${spanMatch[1]} / span ${spanMatch[1]};`;
|
|
2160
|
+
if (baseToken === "col-auto") return "grid-column: auto;";
|
|
2161
|
+
if (baseToken.startsWith("col-start-")) {
|
|
2162
|
+
const sv = resolveThemeValue(theme2.gridColumnStart || {}, baseToken.slice(10));
|
|
2163
|
+
if (sv !== void 0) return `grid-column-start: ${sv};`;
|
|
2164
|
+
}
|
|
2165
|
+
if (baseToken.startsWith("col-end-")) {
|
|
2166
|
+
const ev = resolveThemeValue(theme2.gridColumnEnd || {}, baseToken.slice(8));
|
|
2167
|
+
if (ev !== void 0) return `grid-column-end: ${ev};`;
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
if (baseToken.startsWith("row-")) {
|
|
2171
|
+
const val = resolveThemeValue(theme2.gridRow || {}, baseToken.slice(4));
|
|
2172
|
+
if (val !== void 0) return `grid-row: ${val};`;
|
|
2173
|
+
const spanMatch = baseToken.match(/^row-span-(\d+)$/);
|
|
2174
|
+
if (spanMatch) return `grid-row: span ${spanMatch[1]} / span ${spanMatch[1]};`;
|
|
2175
|
+
if (baseToken === "row-auto") return "grid-row: auto;";
|
|
2176
|
+
if (baseToken.startsWith("row-start-")) {
|
|
2177
|
+
const sv = resolveThemeValue(theme2.gridRowStart || {}, baseToken.slice(10));
|
|
2178
|
+
if (sv !== void 0) return `grid-row-start: ${sv};`;
|
|
2179
|
+
}
|
|
2180
|
+
if (baseToken.startsWith("row-end-")) {
|
|
2181
|
+
const ev = resolveThemeValue(theme2.gridRowEnd || {}, baseToken.slice(8));
|
|
2182
|
+
if (ev !== void 0) return `grid-row-end: ${ev};`;
|
|
2183
|
+
}
|
|
2184
|
+
}
|
|
2185
|
+
return void 0;
|
|
2186
|
+
}
|
|
2187
|
+
|
|
2188
|
+
// src/maps/typography.maps.js
|
|
2189
|
+
var TEXT_ALIGN_MAP = {
|
|
2190
|
+
left: "text-align: left;",
|
|
2191
|
+
center: "text-align: center;",
|
|
2192
|
+
right: "text-align: right;",
|
|
2193
|
+
justify: "text-align: justify;",
|
|
2194
|
+
start: "text-align: start;",
|
|
2195
|
+
end: "text-align: end;"
|
|
2196
|
+
};
|
|
2197
|
+
var TEXT_DECORATION_MAP = {
|
|
2198
|
+
underline: "text-decoration-line: underline;",
|
|
2199
|
+
overline: "text-decoration-line: overline;",
|
|
2200
|
+
"line-through": "text-decoration-line: line-through;",
|
|
2201
|
+
"no-underline": "text-decoration-line: none;"
|
|
2202
|
+
};
|
|
2203
|
+
var TEXT_DECORATION_STYLE_MAP = {
|
|
2204
|
+
solid: "text-decoration-style: solid;",
|
|
2205
|
+
double: "text-decoration-style: double;",
|
|
2206
|
+
dotted: "text-decoration-style: dotted;",
|
|
2207
|
+
dashed: "text-decoration-style: dashed;",
|
|
2208
|
+
wavy: "text-decoration-style: wavy;"
|
|
2209
|
+
};
|
|
2210
|
+
var TEXT_TRANSFORM_MAP = {
|
|
2211
|
+
uppercase: "text-transform: uppercase;",
|
|
2212
|
+
lowercase: "text-transform: lowercase;",
|
|
2213
|
+
capitalize: "text-transform: capitalize;",
|
|
2214
|
+
"normal-case": "text-transform: none;"
|
|
2215
|
+
};
|
|
2216
|
+
var TEXT_OVERFLOW_MAP = {
|
|
2217
|
+
truncate: "overflow: hidden; text-overflow: ellipsis; white-space: nowrap;",
|
|
2218
|
+
"overflow-ellipsis": "text-overflow: ellipsis;",
|
|
2219
|
+
"text-ellipsis": "text-overflow: ellipsis;",
|
|
2220
|
+
"text-clip": "text-overflow: clip;"
|
|
2221
|
+
};
|
|
2222
|
+
var WHITESPACE_MAP = {
|
|
2223
|
+
normal: "white-space: normal;",
|
|
2224
|
+
nowrap: "white-space: nowrap;",
|
|
2225
|
+
pre: "white-space: pre;",
|
|
2226
|
+
"pre-line": "white-space: pre-line;",
|
|
2227
|
+
"pre-wrap": "white-space: pre-wrap;",
|
|
2228
|
+
"break-spaces": "white-space: break-spaces;"
|
|
2229
|
+
};
|
|
2230
|
+
var WORD_BREAK_MAP = {
|
|
2231
|
+
"break-normal": "overflow-wrap: normal; word-break: normal;",
|
|
2232
|
+
"break-words": "overflow-wrap: break-word;",
|
|
2233
|
+
"break-all": "word-break: break-all;",
|
|
2234
|
+
"break-keep": "word-break: keep-all;"
|
|
2235
|
+
};
|
|
2236
|
+
var FONT_STYLE_MAP = {
|
|
2237
|
+
italic: "font-style: italic;",
|
|
2238
|
+
"not-italic": "font-style: normal;"
|
|
2239
|
+
};
|
|
2240
|
+
var FONT_STRETCH_MAP = {
|
|
2241
|
+
"ultra-condensed": "font-stretch: ultra-condensed;",
|
|
2242
|
+
"extra-condensed": "font-stretch: extra-condensed;",
|
|
2243
|
+
condensed: "font-stretch: condensed;",
|
|
2244
|
+
"semi-condensed": "font-stretch: semi-condensed;",
|
|
2245
|
+
normal: "font-stretch: normal;",
|
|
2246
|
+
"semi-expanded": "font-stretch: semi-expanded;",
|
|
2247
|
+
expanded: "font-stretch: expanded;",
|
|
2248
|
+
"extra-expanded": "font-stretch: extra-expanded;",
|
|
2249
|
+
"ultra-expanded": "font-stretch: ultra-expanded;"
|
|
2250
|
+
};
|
|
2251
|
+
var FONT_VARIANT_NUMERIC_MAP = {
|
|
2252
|
+
ordinal: "font-variant-numeric: ordinal;",
|
|
2253
|
+
"slashed-zero": "font-variant-numeric: slashed-zero;",
|
|
2254
|
+
"lining-nums": "font-variant-numeric: lining-nums;",
|
|
2255
|
+
"oldstyle-nums": "font-variant-numeric: oldstyle-nums;",
|
|
2256
|
+
"proportional-nums": "font-variant-numeric: proportional-nums;",
|
|
2257
|
+
"tabular-nums": "font-variant-numeric: tabular-nums;",
|
|
2258
|
+
"diagonal-fractions": "font-variant-numeric: diagonal-fractions;",
|
|
2259
|
+
"stacked-fractions": "font-variant-numeric: stacked-fractions;"
|
|
2260
|
+
};
|
|
2261
|
+
var LIST_STYLE_IMAGE_MAP = {
|
|
2262
|
+
none: "list-style-image: none;"
|
|
2263
|
+
};
|
|
2264
|
+
var HYPHENS_MAP2 = {
|
|
2265
|
+
none: "hyphens: none;",
|
|
2266
|
+
manual: "hyphens: manual;",
|
|
2267
|
+
auto: "hyphens: auto;"
|
|
2268
|
+
};
|
|
2269
|
+
var FONT_SMOOTHING_MAP = {
|
|
2270
|
+
antialiased: "-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;",
|
|
2271
|
+
"subpixel-antialiased": "-webkit-font-smoothing: auto; -moz-osx-font-smoothing: auto;"
|
|
2272
|
+
};
|
|
2273
|
+
var LIST_STYLE_POSITION_MAP = {
|
|
2274
|
+
inside: "list-style-position: inside;",
|
|
2275
|
+
outside: "list-style-position: outside;"
|
|
2276
|
+
};
|
|
2277
|
+
var VERTICAL_ALIGN_MAP = {
|
|
2278
|
+
baseline: "vertical-align: baseline;",
|
|
2279
|
+
top: "vertical-align: top;",
|
|
2280
|
+
middle: "vertical-align: middle;",
|
|
2281
|
+
bottom: "vertical-align: bottom;",
|
|
2282
|
+
"text-top": "vertical-align: text-top;",
|
|
2283
|
+
"text-bottom": "vertical-align: text-bottom;",
|
|
2284
|
+
sub: "vertical-align: sub;",
|
|
2285
|
+
super: "vertical-align: super;"
|
|
2286
|
+
};
|
|
2287
|
+
|
|
2288
|
+
// src/builders/typography.js
|
|
2289
|
+
function buildTypographyDeclaration(baseToken, theme2) {
|
|
2290
|
+
if (TEXT_DECORATION_MAP[baseToken]) return TEXT_DECORATION_MAP[baseToken];
|
|
2291
|
+
if (TEXT_TRANSFORM_MAP[baseToken]) return TEXT_TRANSFORM_MAP[baseToken];
|
|
2292
|
+
if (TEXT_OVERFLOW_MAP[baseToken]) return TEXT_OVERFLOW_MAP[baseToken];
|
|
2293
|
+
if (WORD_BREAK_MAP[baseToken]) return WORD_BREAK_MAP[baseToken];
|
|
2294
|
+
if (FONT_STYLE_MAP[baseToken]) return FONT_STYLE_MAP[baseToken];
|
|
2295
|
+
if (FONT_SMOOTHING_MAP[baseToken]) return FONT_SMOOTHING_MAP[baseToken];
|
|
2296
|
+
if (baseToken.startsWith("text-")) {
|
|
2297
|
+
const valueKey = baseToken.slice(5);
|
|
2298
|
+
if (TEXT_ALIGN_MAP[valueKey]) return TEXT_ALIGN_MAP[valueKey];
|
|
2299
|
+
const fontSize = resolveThemeValue(theme2.fontSize || {}, valueKey);
|
|
2300
|
+
if (fontSize !== void 0) {
|
|
2301
|
+
if (Array.isArray(fontSize)) return `font-size: ${fontSize[0]};`;
|
|
2302
|
+
return `font-size: ${fontSize};`;
|
|
2303
|
+
}
|
|
2304
|
+
const color = resolveColorWithOpacity(theme2.colors || {}, valueKey);
|
|
2305
|
+
if (color !== void 0) return `color: ${color};`;
|
|
2306
|
+
}
|
|
2307
|
+
if (baseToken.startsWith("font-")) {
|
|
2308
|
+
const valueKey = baseToken.slice(5);
|
|
2309
|
+
const fontWeight = resolveThemeValue(theme2.fontWeight || {}, valueKey);
|
|
2310
|
+
if (fontWeight !== void 0) return `font-weight: ${fontWeight};`;
|
|
2311
|
+
const fontFamily = resolveThemeValue(theme2.fontFamily || {}, valueKey);
|
|
2312
|
+
if (fontFamily !== void 0) {
|
|
2313
|
+
if (Array.isArray(fontFamily)) return `font-family: ${fontFamily.join(", ")};`;
|
|
2314
|
+
return `font-family: ${fontFamily};`;
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
2317
|
+
if (baseToken.startsWith("font-stretch-")) {
|
|
2318
|
+
return FONT_STRETCH_MAP[baseToken.slice(13)] ?? void 0;
|
|
2319
|
+
}
|
|
2320
|
+
if (baseToken.startsWith("font-variant-numeric-")) {
|
|
2321
|
+
return FONT_VARIANT_NUMERIC_MAP[baseToken.slice(21)] ?? void 0;
|
|
2322
|
+
}
|
|
2323
|
+
if (baseToken.startsWith("leading-")) {
|
|
2324
|
+
const val = resolveThemeValue(theme2.lineHeight || {}, baseToken.slice(8));
|
|
2325
|
+
if (val !== void 0) return `line-height: ${val};`;
|
|
2326
|
+
}
|
|
2327
|
+
if (baseToken.startsWith("tracking-")) {
|
|
2328
|
+
const val = resolveThemeValue(theme2.letterSpacing || {}, baseToken.slice(9));
|
|
2329
|
+
if (val !== void 0) return `letter-spacing: ${val};`;
|
|
2330
|
+
}
|
|
2331
|
+
if (baseToken.startsWith("decoration-")) {
|
|
2332
|
+
const key = baseToken.slice(11);
|
|
2333
|
+
if (TEXT_DECORATION_STYLE_MAP[key]) return TEXT_DECORATION_STYLE_MAP[key];
|
|
2334
|
+
const thicknessVal = resolveThemeValue(theme2.textDecorationThickness || {}, key);
|
|
2335
|
+
if (thicknessVal !== void 0) return `text-decoration-thickness: ${thicknessVal};`;
|
|
2336
|
+
const color = resolveColorWithOpacity(theme2.colors || {}, key);
|
|
2337
|
+
if (color !== void 0) return `text-decoration-color: ${color};`;
|
|
2338
|
+
}
|
|
2339
|
+
if (baseToken.startsWith("underline-offset-")) {
|
|
2340
|
+
const val = resolveThemeValue(theme2.textUnderlineOffset || {}, baseToken.slice(17));
|
|
2341
|
+
if (val !== void 0) return `text-underline-offset: ${val};`;
|
|
2342
|
+
}
|
|
2343
|
+
if (baseToken.startsWith("indent-")) {
|
|
2344
|
+
const val = resolveThemeValue(theme2.textIndent || theme2.spacing || {}, baseToken.slice(7));
|
|
2345
|
+
if (val !== void 0) return `text-indent: ${val};`;
|
|
2346
|
+
}
|
|
2347
|
+
if (baseToken.startsWith("list-")) {
|
|
2348
|
+
const key = baseToken.slice(5);
|
|
2349
|
+
if (LIST_STYLE_POSITION_MAP[key]) return LIST_STYLE_POSITION_MAP[key];
|
|
2350
|
+
if (LIST_STYLE_IMAGE_MAP[baseToken]) return LIST_STYLE_IMAGE_MAP[baseToken.slice(17)] ?? void 0;
|
|
2351
|
+
const val = resolveThemeValue(theme2.listStyleType || {}, key);
|
|
2352
|
+
if (val !== void 0) return `list-style-type: ${val};`;
|
|
2353
|
+
}
|
|
2354
|
+
if (baseToken.startsWith("list-style-image-")) {
|
|
2355
|
+
return LIST_STYLE_IMAGE_MAP[baseToken.slice(17)] ?? void 0;
|
|
2356
|
+
}
|
|
2357
|
+
if (baseToken.startsWith("whitespace-")) {
|
|
2358
|
+
const key = baseToken.slice(11);
|
|
2359
|
+
if (WHITESPACE_MAP[key]) return WHITESPACE_MAP[key];
|
|
2360
|
+
}
|
|
2361
|
+
if (baseToken.startsWith("hyphens-")) return HYPHENS_MAP2[baseToken.slice(8)] ?? void 0;
|
|
2362
|
+
if (baseToken === "text-wrap") return "text-wrap: wrap;";
|
|
2363
|
+
if (baseToken === "text-nowrap") return "text-wrap: nowrap;";
|
|
2364
|
+
if (baseToken === "text-balance") return "text-wrap: balance;";
|
|
2365
|
+
if (baseToken === "text-pretty") return "text-wrap: pretty;";
|
|
2366
|
+
if (baseToken.startsWith("align-")) {
|
|
2367
|
+
const key = baseToken.slice(6);
|
|
2368
|
+
if (VERTICAL_ALIGN_MAP[key]) return VERTICAL_ALIGN_MAP[key];
|
|
2369
|
+
}
|
|
2370
|
+
if (baseToken === "line-clamp-none") {
|
|
2371
|
+
return "overflow: visible; display: block; -webkit-box-orient: horizontal; -webkit-line-clamp: unset;";
|
|
2372
|
+
}
|
|
2373
|
+
if (baseToken.startsWith("line-clamp-")) {
|
|
2374
|
+
const val = resolveThemeValue(theme2.lineClamp || {}, baseToken.slice(11));
|
|
2375
|
+
if (val !== void 0) {
|
|
2376
|
+
return `overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: ${val};`;
|
|
2377
|
+
}
|
|
2378
|
+
const num = baseToken.slice(11);
|
|
2379
|
+
if (/^\d+$/.test(num)) {
|
|
2380
|
+
return `overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: ${num};`;
|
|
2381
|
+
}
|
|
2382
|
+
}
|
|
2383
|
+
return void 0;
|
|
2384
|
+
}
|
|
2385
|
+
|
|
2386
|
+
// src/builders/colors.js
|
|
2387
|
+
function buildColorDeclaration(baseToken, theme2) {
|
|
2388
|
+
const colors = theme2.colors || {};
|
|
2389
|
+
if (baseToken.startsWith("bg-")) {
|
|
2390
|
+
const key = baseToken.slice(3);
|
|
2391
|
+
const color = resolveColorWithOpacity(colors, key);
|
|
2392
|
+
if (color !== void 0) return `background-color: ${color};`;
|
|
2393
|
+
}
|
|
2394
|
+
if (baseToken.startsWith("border-")) {
|
|
2395
|
+
const key = baseToken.slice(7);
|
|
2396
|
+
const color = resolveColorWithOpacity(colors, key);
|
|
2397
|
+
if (color !== void 0) return `border-color: ${color};`;
|
|
2398
|
+
}
|
|
2399
|
+
if (baseToken.startsWith("fill-")) {
|
|
2400
|
+
const val = resolveColorWithOpacity({ ...colors, none: "none" }, baseToken.slice(5));
|
|
2401
|
+
if (val !== void 0) return `fill: ${val};`;
|
|
2402
|
+
}
|
|
2403
|
+
if (baseToken.startsWith("stroke-")) {
|
|
2404
|
+
const key = baseToken.slice(7);
|
|
2405
|
+
const width = resolveThemeValue(theme2.strokeWidth || {}, key);
|
|
2406
|
+
if (width !== void 0) return `stroke-width: ${width};`;
|
|
2407
|
+
const color = resolveColorWithOpacity({ ...colors, none: "none" }, key);
|
|
2408
|
+
if (color !== void 0) return `stroke: ${color};`;
|
|
2409
|
+
}
|
|
2410
|
+
if (baseToken.startsWith("outline-")) {
|
|
2411
|
+
const key = baseToken.slice(8);
|
|
2412
|
+
if (OUTLINE_STYLE_MAP[key]) return OUTLINE_STYLE_MAP[key];
|
|
2413
|
+
const width = resolveThemeValue(theme2.outlineWidth || {}, key);
|
|
2414
|
+
if (width !== void 0) return `outline-width: ${width};`;
|
|
2415
|
+
const offset = resolveThemeValue(theme2.outlineOffset || {}, key);
|
|
2416
|
+
if (offset !== void 0) return `outline-offset: ${offset};`;
|
|
2417
|
+
const color = resolveColorWithOpacity(theme2.outlineColor || colors, key);
|
|
2418
|
+
if (color !== void 0) return `outline-color: ${color};`;
|
|
2419
|
+
}
|
|
2420
|
+
if (baseToken.startsWith("caret-")) {
|
|
2421
|
+
const color = resolveColorWithOpacity(theme2.caretColor || colors, baseToken.slice(6));
|
|
2422
|
+
if (color !== void 0) return `caret-color: ${color};`;
|
|
2423
|
+
}
|
|
2424
|
+
if (baseToken.startsWith("accent-")) {
|
|
2425
|
+
const color = resolveColorWithOpacity({ ...colors, auto: "auto" }, baseToken.slice(7));
|
|
2426
|
+
if (color !== void 0) return `accent-color: ${color};`;
|
|
2427
|
+
}
|
|
2428
|
+
if (baseToken.startsWith("placeholder-")) {
|
|
2429
|
+
const color = resolveColorWithOpacity(colors, baseToken.slice(12));
|
|
2430
|
+
if (color !== void 0) return `--tw-placeholder-color: ${color};`;
|
|
2431
|
+
}
|
|
2432
|
+
return void 0;
|
|
2433
|
+
}
|
|
2434
|
+
|
|
2435
|
+
// src/builders/borders.js
|
|
2436
|
+
function buildBorderDeclaration(baseToken, theme2) {
|
|
2437
|
+
if (baseToken === "border") {
|
|
2438
|
+
const value = resolveThemeValue(theme2.borderWidth || {}, "DEFAULT") || "1px";
|
|
2439
|
+
return `border-width: ${value};`;
|
|
2440
|
+
}
|
|
2441
|
+
const sideMatch = baseToken.match(/^border-([trblxy])-?(\d+)?$/);
|
|
2442
|
+
if (sideMatch) {
|
|
2443
|
+
const [, side, numVal] = sideMatch;
|
|
2444
|
+
const sideMap = { t: "top", r: "right", b: "bottom", l: "left" };
|
|
2445
|
+
const widthKey = numVal || "DEFAULT";
|
|
2446
|
+
const widthVal = resolveThemeValue(theme2.borderWidth || {}, widthKey);
|
|
2447
|
+
if (widthVal === void 0) return void 0;
|
|
2448
|
+
if (side === "x") return `border-left-width: ${widthVal}; border-right-width: ${widthVal};`;
|
|
2449
|
+
if (side === "y") return `border-top-width: ${widthVal}; border-bottom-width: ${widthVal};`;
|
|
2450
|
+
return `border-${sideMap[side]}-width: ${widthVal};`;
|
|
2451
|
+
}
|
|
2452
|
+
const widthMatch = baseToken.match(/^border-(\d+)$/);
|
|
2453
|
+
if (widthMatch) {
|
|
2454
|
+
const value = resolveThemeValue(theme2.borderWidth || {}, widthMatch[1]);
|
|
2455
|
+
if (value !== void 0) return `border-width: ${value};`;
|
|
2456
|
+
}
|
|
2457
|
+
if (baseToken.startsWith("border-")) {
|
|
2458
|
+
const key = baseToken.slice(7);
|
|
2459
|
+
if (BORDER_STYLE_MAP[key]) return BORDER_STYLE_MAP[key];
|
|
2460
|
+
}
|
|
2461
|
+
return void 0;
|
|
2462
|
+
}
|
|
2463
|
+
function buildBorderRadiusDeclaration(baseToken, theme2) {
|
|
2464
|
+
if (!baseToken.startsWith("rounded")) return void 0;
|
|
2465
|
+
const match = baseToken.match(/^rounded(?:-(tl|tr|br|bl|ss|se|es|ee|t|r|b|l))?(?:-(.+))?$/);
|
|
2466
|
+
if (!match) return void 0;
|
|
2467
|
+
const [, side = "", rawValueKey] = match;
|
|
2468
|
+
const valueKey = rawValueKey || "DEFAULT";
|
|
2469
|
+
const radius = resolveThemeValue(theme2.borderRadius || {}, valueKey);
|
|
2470
|
+
if (radius === void 0) return void 0;
|
|
2471
|
+
const props = ROUNDED_PROPS[side];
|
|
2472
|
+
if (!props) return void 0;
|
|
2473
|
+
return props.map((prop) => `${prop}: ${radius};`).join(" ");
|
|
2474
|
+
}
|
|
2475
|
+
|
|
2476
|
+
// src/maps/effects.maps.js
|
|
2477
|
+
var ANIMATE_MAP = {
|
|
2478
|
+
none: "animation: none;",
|
|
2479
|
+
spin: "animation: spin 1s linear infinite;",
|
|
2480
|
+
ping: "animation: ping 1s cubic-bezier(0,0,0.2,1) infinite;",
|
|
2481
|
+
pulse: "animation: pulse 2s cubic-bezier(0.4,0,0.6,1) infinite;",
|
|
2482
|
+
bounce: "animation: bounce 1s infinite;"
|
|
2483
|
+
};
|
|
2484
|
+
var INSET_SHADOW_SIZES = {
|
|
2485
|
+
none: "box-shadow: none;",
|
|
2486
|
+
xs: "box-shadow: inset 0 1px 1px 0 rgb(0 0 0 / 0.05);",
|
|
2487
|
+
sm: "box-shadow: inset 0 1px 2px 0 rgb(0 0 0 / 0.1);",
|
|
2488
|
+
DEFAULT: "box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.1);",
|
|
2489
|
+
md: "box-shadow: inset 0 2px 6px 0 rgb(0 0 0 / 0.1);",
|
|
2490
|
+
lg: "box-shadow: inset 0 4px 8px 0 rgb(0 0 0 / 0.15);"
|
|
2491
|
+
};
|
|
2492
|
+
var PERSPECTIVE_MAP = {
|
|
2493
|
+
none: "perspective: none;",
|
|
2494
|
+
dramatic: "perspective: 100px;",
|
|
2495
|
+
near: "perspective: 300px;",
|
|
2496
|
+
normal: "perspective: 500px;",
|
|
2497
|
+
midrange: "perspective: 800px;",
|
|
2498
|
+
distant: "perspective: 1200px;"
|
|
2499
|
+
};
|
|
2500
|
+
var PERSPECTIVE_ORIGIN_MAP = {
|
|
2501
|
+
center: "perspective-origin: center;",
|
|
2502
|
+
top: "perspective-origin: top;",
|
|
2503
|
+
bottom: "perspective-origin: bottom;",
|
|
2504
|
+
left: "perspective-origin: left;",
|
|
2505
|
+
right: "perspective-origin: right;",
|
|
2506
|
+
"top-left": "perspective-origin: top left;",
|
|
2507
|
+
"top-right": "perspective-origin: top right;",
|
|
2508
|
+
"bottom-left": "perspective-origin: bottom left;",
|
|
2509
|
+
"bottom-right": "perspective-origin: bottom right;"
|
|
2510
|
+
};
|
|
2511
|
+
var MASK_CLIP_MAP = {
|
|
2512
|
+
"mask-clip-border": "mask-clip: border; -webkit-mask-clip: border;",
|
|
2513
|
+
"mask-clip-padding": "mask-clip: padding; -webkit-mask-clip: padding;",
|
|
2514
|
+
"mask-clip-content": "mask-clip: content; -webkit-mask-clip: content;",
|
|
2515
|
+
"mask-clip-text": "mask-clip: text; -webkit-mask-clip: text;"
|
|
2516
|
+
};
|
|
2517
|
+
var MASK_COMPOSITE_MAP = {
|
|
2518
|
+
"mask-composite-add": "mask-composite: add; -webkit-mask-composite: add;",
|
|
2519
|
+
"mask-composite-subtract": "mask-composite: subtract; -webkit-mask-composite: subtract;",
|
|
2520
|
+
"mask-composite-intersect": "mask-composite: intersect; -webkit-mask-composite: intersect;",
|
|
2521
|
+
"mask-composite-exclude": "mask-composite: exclude; -webkit-mask-composite: exclude;",
|
|
2522
|
+
"mask-composite-replace": "mask-composite: replace; -webkit-mask-composite: replace;",
|
|
2523
|
+
"mask-composite-xor": "mask-composite: xor; -webkit-mask-composite: xor;"
|
|
2524
|
+
};
|
|
2525
|
+
var MASK_MODE_MAP = {
|
|
2526
|
+
"mask-mode-alpha": "mask-mode: alpha; -webkit-mask-mode: alpha;",
|
|
2527
|
+
"mask-mode-luminance": "mask-mode: luminance; -webkit-mask-mode: luminance;",
|
|
2528
|
+
"mask-mode-match-source": "mask-mode: match-source; -webkit-mask-mode: match-source;"
|
|
2529
|
+
};
|
|
2530
|
+
var MASK_ORIGIN_MAP = {
|
|
2531
|
+
"mask-origin-border": "mask-origin: border-box; -webkit-mask-origin: border-box;",
|
|
2532
|
+
"mask-origin-padding": "mask-origin: padding-box; -webkit-mask-origin: padding-box;",
|
|
2533
|
+
"mask-origin-content": "mask-origin: content-box; -webkit-mask-origin: content-box;",
|
|
2534
|
+
"mask-origin-fill": "mask-origin: fill-box; -webkit-mask-origin: fill-box;",
|
|
2535
|
+
"mask-origin-stroke": "mask-origin: stroke-box; -webkit-mask-origin: stroke-box;",
|
|
2536
|
+
"mask-origin-view": "mask-origin: view-box; -webkit-mask-origin: view-box;"
|
|
2537
|
+
};
|
|
2538
|
+
var MASK_TYPE_MAP = {
|
|
2539
|
+
"mask-type-luminance": "mask-type: luminance; -webkit-mask-type: luminance;",
|
|
2540
|
+
"mask-type-alpha": "mask-type: alpha; -webkit-mask-type: alpha;"
|
|
2541
|
+
};
|
|
2542
|
+
var MASK_LINEAR_MAP = {
|
|
2543
|
+
"mask-linear-to-t": "mask-image: linear-gradient(to top, black, transparent); -webkit-mask-image: linear-gradient(to top, black, transparent);",
|
|
2544
|
+
"mask-linear-to-tr": "mask-image: linear-gradient(to top right, black, transparent); -webkit-mask-image: linear-gradient(to top right, black, transparent);",
|
|
2545
|
+
"mask-linear-to-r": "mask-image: linear-gradient(to right, black, transparent); -webkit-mask-image: linear-gradient(to right, black, transparent);",
|
|
2546
|
+
"mask-linear-to-br": "mask-image: linear-gradient(to bottom right, black, transparent); -webkit-mask-image: linear-gradient(to bottom right, black, transparent);",
|
|
2547
|
+
"mask-linear-to-b": "mask-image: linear-gradient(to bottom, black, transparent); -webkit-mask-image: linear-gradient(to bottom, black, transparent);",
|
|
2548
|
+
"mask-linear-to-bl": "mask-image: linear-gradient(to bottom left, black, transparent); -webkit-mask-image: linear-gradient(to bottom left, black, transparent);",
|
|
2549
|
+
"mask-linear-to-l": "mask-image: linear-gradient(to left, black, transparent); -webkit-mask-image: linear-gradient(to left, black, transparent);",
|
|
2550
|
+
"mask-linear-to-tl": "mask-image: linear-gradient(to top left, black, transparent); -webkit-mask-image: linear-gradient(to top left, black, transparent);",
|
|
2551
|
+
"mask-none": "mask-image: none; -webkit-mask-image: none;"
|
|
2552
|
+
};
|
|
2553
|
+
var MASK_RADIAL_POSITIONS = {
|
|
2554
|
+
center: "center",
|
|
2555
|
+
top: "top",
|
|
2556
|
+
right: "right",
|
|
2557
|
+
bottom: "bottom",
|
|
2558
|
+
left: "left",
|
|
2559
|
+
"top-right": "top right",
|
|
2560
|
+
"bottom-right": "bottom right",
|
|
2561
|
+
"bottom-left": "bottom left",
|
|
2562
|
+
"top-left": "top left"
|
|
2563
|
+
};
|
|
2564
|
+
var MASK_REPEAT_MAP = {
|
|
2565
|
+
"mask-repeat": "mask-repeat: repeat; -webkit-mask-repeat: repeat;",
|
|
2566
|
+
"mask-no-repeat": "mask-repeat: no-repeat; -webkit-mask-repeat: no-repeat;",
|
|
2567
|
+
"mask-repeat-x": "mask-repeat: repeat-x; -webkit-mask-repeat: repeat-x;",
|
|
2568
|
+
"mask-repeat-y": "mask-repeat: repeat-y; -webkit-mask-repeat: repeat-y;",
|
|
2569
|
+
"mask-repeat-round": "mask-repeat: round; -webkit-mask-repeat: round;",
|
|
2570
|
+
"mask-repeat-space": "mask-repeat: space; -webkit-mask-repeat: space;"
|
|
2571
|
+
};
|
|
2572
|
+
var MASK_SIZE_MAP = {
|
|
2573
|
+
"mask-size-auto": "mask-size: auto; -webkit-mask-size: auto;",
|
|
2574
|
+
"mask-size-cover": "mask-size: cover; -webkit-mask-size: cover;",
|
|
2575
|
+
"mask-size-contain": "mask-size: contain; -webkit-mask-size: contain;"
|
|
2576
|
+
};
|
|
2577
|
+
var BG_ATTACHMENT_MAP = {
|
|
2578
|
+
fixed: "background-attachment: fixed;",
|
|
2579
|
+
local: "background-attachment: local;",
|
|
2580
|
+
scroll: "background-attachment: scroll;"
|
|
2581
|
+
};
|
|
2582
|
+
var BG_CLIP_MAP = {
|
|
2583
|
+
border: "background-clip: border-box;",
|
|
2584
|
+
padding: "background-clip: padding-box;",
|
|
2585
|
+
content: "background-clip: content-box;",
|
|
2586
|
+
text: "background-clip: text; -webkit-background-clip: text;"
|
|
2587
|
+
};
|
|
2588
|
+
var BG_ORIGIN_MAP = {
|
|
2589
|
+
border: "background-origin: border-box;",
|
|
2590
|
+
padding: "background-origin: padding-box;",
|
|
2591
|
+
content: "background-origin: content-box;"
|
|
2592
|
+
};
|
|
2593
|
+
var BG_REPEAT_MAP = {
|
|
2594
|
+
repeat: "background-repeat: repeat;",
|
|
2595
|
+
"no-repeat": "background-repeat: no-repeat;",
|
|
2596
|
+
"repeat-x": "background-repeat: repeat-x;",
|
|
2597
|
+
"repeat-y": "background-repeat: repeat-y;",
|
|
2598
|
+
"repeat-round": "background-repeat: round;",
|
|
2599
|
+
"repeat-space": "background-repeat: space;"
|
|
2600
|
+
};
|
|
2601
|
+
var MIX_BLEND_MAP = {
|
|
2602
|
+
"mix-blend-normal": "mix-blend-mode: normal;",
|
|
2603
|
+
"mix-blend-multiply": "mix-blend-mode: multiply;",
|
|
2604
|
+
"mix-blend-screen": "mix-blend-mode: screen;",
|
|
2605
|
+
"mix-blend-overlay": "mix-blend-mode: overlay;",
|
|
2606
|
+
"mix-blend-darken": "mix-blend-mode: darken;",
|
|
2607
|
+
"mix-blend-lighten": "mix-blend-mode: lighten;",
|
|
2608
|
+
"mix-blend-color-dodge": "mix-blend-mode: color-dodge;",
|
|
2609
|
+
"mix-blend-color-burn": "mix-blend-mode: color-burn;",
|
|
2610
|
+
"mix-blend-hard-light": "mix-blend-mode: hard-light;",
|
|
2611
|
+
"mix-blend-soft-light": "mix-blend-mode: soft-light;",
|
|
2612
|
+
"mix-blend-difference": "mix-blend-mode: difference;",
|
|
2613
|
+
"mix-blend-exclusion": "mix-blend-mode: exclusion;",
|
|
2614
|
+
"mix-blend-hue": "mix-blend-mode: hue;",
|
|
2615
|
+
"mix-blend-saturation": "mix-blend-mode: saturation;",
|
|
2616
|
+
"mix-blend-color": "mix-blend-mode: color;",
|
|
2617
|
+
"mix-blend-luminosity": "mix-blend-mode: luminosity;",
|
|
2618
|
+
"mix-blend-plus-darker": "mix-blend-mode: plus-darker;",
|
|
2619
|
+
"mix-blend-plus-lighter": "mix-blend-mode: plus-lighter;"
|
|
2620
|
+
};
|
|
2621
|
+
var BG_BLEND_MAP = {
|
|
2622
|
+
"bg-blend-normal": "background-blend-mode: normal;",
|
|
2623
|
+
"bg-blend-multiply": "background-blend-mode: multiply;",
|
|
2624
|
+
"bg-blend-screen": "background-blend-mode: screen;",
|
|
2625
|
+
"bg-blend-overlay": "background-blend-mode: overlay;",
|
|
2626
|
+
"bg-blend-darken": "background-blend-mode: darken;",
|
|
2627
|
+
"bg-blend-lighten": "background-blend-mode: lighten;",
|
|
2628
|
+
"bg-blend-color-dodge": "background-blend-mode: color-dodge;",
|
|
2629
|
+
"bg-blend-color-burn": "background-blend-mode: color-burn;",
|
|
2630
|
+
"bg-blend-hard-light": "background-blend-mode: hard-light;",
|
|
2631
|
+
"bg-blend-soft-light": "background-blend-mode: soft-light;",
|
|
2632
|
+
"bg-blend-difference": "background-blend-mode: difference;",
|
|
2633
|
+
"bg-blend-exclusion": "background-blend-mode: exclusion;",
|
|
2634
|
+
"bg-blend-hue": "background-blend-mode: hue;",
|
|
2635
|
+
"bg-blend-saturation": "background-blend-mode: saturation;",
|
|
2636
|
+
"bg-blend-color": "background-blend-mode: color;",
|
|
2637
|
+
"bg-blend-luminosity": "background-blend-mode: luminosity;"
|
|
2638
|
+
};
|
|
2639
|
+
var TEXT_SHADOW_SIZES = {
|
|
2640
|
+
"2xs": "0 1px 2px rgb(0 0 0 / 0.10)",
|
|
2641
|
+
xs: "0 1px 2px rgb(0 0 0 / 0.20)",
|
|
2642
|
+
sm: "0 1px 3px rgb(0 0 0 / 0.25)",
|
|
2643
|
+
DEFAULT: "0 1px 3px rgb(0 0 0 / 0.30)",
|
|
2644
|
+
md: "0 2px 4px rgb(0 0 0 / 0.30)",
|
|
2645
|
+
lg: "0 4px 6px rgb(0 0 0 / 0.25)",
|
|
2646
|
+
xl: "0 8px 12px rgb(0 0 0 / 0.20)",
|
|
2647
|
+
"2xl": "0 16px 24px rgb(0 0 0 / 0.15)",
|
|
2648
|
+
none: "none"
|
|
2649
|
+
};
|
|
2650
|
+
|
|
2651
|
+
// src/builders/effects.js
|
|
2652
|
+
function buildOpacityDeclaration(baseToken, theme2) {
|
|
2653
|
+
if (!baseToken.startsWith("opacity-")) return void 0;
|
|
2654
|
+
const opacity = resolveThemeValue(theme2.opacity || {}, baseToken.slice(8));
|
|
2655
|
+
if (opacity === void 0) return void 0;
|
|
2656
|
+
return `opacity: ${opacity};`;
|
|
2657
|
+
}
|
|
2658
|
+
function buildShadowDeclaration(baseToken, theme2) {
|
|
2659
|
+
if (baseToken === "shadow") {
|
|
2660
|
+
const value2 = resolveThemeValue(theme2.boxShadow || {}, "DEFAULT");
|
|
2661
|
+
if (value2 === void 0) return void 0;
|
|
2662
|
+
return `box-shadow: ${value2};`;
|
|
2663
|
+
}
|
|
2664
|
+
if (!baseToken.startsWith("shadow-")) return void 0;
|
|
2665
|
+
const valueKey = baseToken.slice(7);
|
|
2666
|
+
const arb = resolveArbitraryValue(valueKey);
|
|
2667
|
+
if (arb !== void 0) return `box-shadow: ${arb};`;
|
|
2668
|
+
const value = resolveThemeValue(theme2.boxShadow || {}, valueKey);
|
|
2669
|
+
if (value !== void 0) return `box-shadow: ${value};`;
|
|
2670
|
+
const colorScale = theme2.boxShadowColor || theme2.colors || {};
|
|
2671
|
+
const color = resolveColorWithOpacity(colorScale, valueKey);
|
|
2672
|
+
if (color !== void 0) return `--tw-shadow-color: ${color};`;
|
|
2673
|
+
return void 0;
|
|
2674
|
+
}
|
|
2675
|
+
function buildInsetShadowDeclaration(baseToken, theme2) {
|
|
2676
|
+
if (baseToken === "inset-shadow") return INSET_SHADOW_SIZES.DEFAULT;
|
|
2677
|
+
if (baseToken.startsWith("inset-shadow-")) {
|
|
2678
|
+
const key = baseToken.slice(13);
|
|
2679
|
+
if (INSET_SHADOW_SIZES[key]) return INSET_SHADOW_SIZES[key];
|
|
2680
|
+
const color = resolveColorWithOpacity(theme2.colors || {}, key);
|
|
2681
|
+
if (color !== void 0) return `--tw-inset-shadow-color: ${color};`;
|
|
2682
|
+
}
|
|
2683
|
+
return void 0;
|
|
2684
|
+
}
|
|
2685
|
+
function buildInsetRingDeclaration(baseToken, theme2) {
|
|
2686
|
+
const ringColors = theme2.ringColor || {};
|
|
2687
|
+
const colors = theme2.colors || {};
|
|
2688
|
+
if (baseToken === "inset-ring") {
|
|
2689
|
+
return `box-shadow: inset 0 0 0 1px var(--tw-inset-ring-color, currentColor);`;
|
|
2690
|
+
}
|
|
2691
|
+
if (baseToken.startsWith("inset-ring-")) {
|
|
2692
|
+
const key = baseToken.slice(11);
|
|
2693
|
+
if (/^\d+$/.test(key)) {
|
|
2694
|
+
return `box-shadow: inset 0 0 0 ${key}px var(--tw-inset-ring-color, currentColor);`;
|
|
2695
|
+
}
|
|
2696
|
+
const color = resolveColorWithOpacity({ ...ringColors, ...colors }, key);
|
|
2697
|
+
if (color !== void 0) return `--tw-inset-ring-color: ${color};`;
|
|
2698
|
+
}
|
|
2699
|
+
return void 0;
|
|
2700
|
+
}
|
|
2701
|
+
function buildRingDeclaration(baseToken, theme2) {
|
|
2702
|
+
const ringColorScale = theme2.ringColor || {};
|
|
2703
|
+
const ringWidthScale = theme2.ringWidth || {};
|
|
2704
|
+
const defaultRingColor = resolveThemeValue(ringColorScale, "DEFAULT") || "#3b82f6";
|
|
2705
|
+
const buildRingWidth = (widthValue2) => `--tw-ring-inset: ; --tw-ring-offset-width: 0px; --tw-ring-offset-color: #fff; --tw-ring-color: ${defaultRingColor}; box-shadow: var(--tw-ring-inset,) 0 0 0 calc(${widthValue2} + var(--tw-ring-offset-width, 0px)) var(--tw-ring-color);`;
|
|
2706
|
+
if (baseToken === "ring") {
|
|
2707
|
+
const widthValue2 = resolveThemeValue(ringWidthScale, "DEFAULT") || "3px";
|
|
2708
|
+
return buildRingWidth(widthValue2);
|
|
2709
|
+
}
|
|
2710
|
+
if (!baseToken.startsWith("ring-")) return void 0;
|
|
2711
|
+
const valueKey = baseToken.slice(5);
|
|
2712
|
+
const widthValue = resolveThemeValue(ringWidthScale, valueKey);
|
|
2713
|
+
if (widthValue !== void 0) return buildRingWidth(widthValue);
|
|
2714
|
+
if (valueKey === "inset") return `--tw-ring-inset: inset;`;
|
|
2715
|
+
const colorValue = resolveColorWithOpacity(ringColorScale, valueKey) || resolveColorWithOpacity(theme2.colors || {}, valueKey);
|
|
2716
|
+
if (colorValue !== void 0) return `--tw-ring-color: ${colorValue};`;
|
|
2717
|
+
return void 0;
|
|
2718
|
+
}
|
|
2719
|
+
function buildTextShadowDeclaration(baseToken, theme2) {
|
|
2720
|
+
if (baseToken === "text-shadow") {
|
|
2721
|
+
const val = (theme2.textShadow || TEXT_SHADOW_SIZES).DEFAULT || TEXT_SHADOW_SIZES.DEFAULT;
|
|
2722
|
+
return `text-shadow: ${val};`;
|
|
2723
|
+
}
|
|
2724
|
+
if (baseToken.startsWith("text-shadow-")) {
|
|
2725
|
+
const key = baseToken.slice(12);
|
|
2726
|
+
const color = resolveColorWithOpacity(theme2.colors || {}, key);
|
|
2727
|
+
if (color !== void 0) return `--tw-text-shadow-color: ${color};`;
|
|
2728
|
+
const scale = theme2.textShadow || TEXT_SHADOW_SIZES;
|
|
2729
|
+
const val = resolveThemeValue(scale, key);
|
|
2730
|
+
if (val !== void 0) return val === "none" ? "text-shadow: none;" : `text-shadow: ${val};`;
|
|
2731
|
+
}
|
|
2732
|
+
return void 0;
|
|
2733
|
+
}
|
|
2734
|
+
function buildRingOffsetDeclaration(baseToken, theme2) {
|
|
2735
|
+
if (!baseToken.startsWith("ring-offset-")) return void 0;
|
|
2736
|
+
const key = baseToken.slice(12);
|
|
2737
|
+
const widthVal = resolveThemeValue(theme2.ringOffsetWidth || {}, key);
|
|
2738
|
+
if (widthVal !== void 0) {
|
|
2739
|
+
return `--tw-ring-offset-width: ${widthVal}; box-shadow: 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color, #fff), var(--tw-ring-shadow, 0 0 #0000);`;
|
|
2740
|
+
}
|
|
2741
|
+
let color = resolveColorWithOpacity(theme2.ringOffsetColor || {}, key);
|
|
2742
|
+
if (color === void 0) {
|
|
2743
|
+
color = resolveColorWithOpacity(theme2.colors || {}, key);
|
|
2744
|
+
}
|
|
2745
|
+
if (color !== void 0) return `--tw-ring-offset-color: ${color};`;
|
|
2746
|
+
return void 0;
|
|
2747
|
+
}
|
|
2748
|
+
|
|
2749
|
+
// src/builders/backgrounds.js
|
|
2750
|
+
function buildBackgroundDeclaration(baseToken, theme2) {
|
|
2751
|
+
if (!baseToken.startsWith("bg-")) return void 0;
|
|
2752
|
+
const key = baseToken.slice(3);
|
|
2753
|
+
if (BG_ATTACHMENT_MAP[key]) return BG_ATTACHMENT_MAP[key];
|
|
2754
|
+
if (key.startsWith("clip-")) return BG_CLIP_MAP[key.slice(5)] ?? void 0;
|
|
2755
|
+
if (key.startsWith("origin-")) return BG_ORIGIN_MAP[key.slice(7)] ?? void 0;
|
|
2756
|
+
if (BG_REPEAT_MAP[key]) return BG_REPEAT_MAP[key];
|
|
2757
|
+
const bgSize = resolveThemeValue(theme2.backgroundSize || {}, key);
|
|
2758
|
+
if (bgSize !== void 0) return `background-size: ${bgSize};`;
|
|
2759
|
+
const bgPos = resolveThemeValue(theme2.backgroundPosition || {}, key);
|
|
2760
|
+
if (bgPos !== void 0) return `background-position: ${bgPos};`;
|
|
2761
|
+
const bgImage = resolveThemeValue(theme2.backgroundImage || {}, key);
|
|
2762
|
+
if (bgImage !== void 0) return `background-image: ${bgImage};`;
|
|
2763
|
+
return void 0;
|
|
2764
|
+
}
|
|
2765
|
+
function buildGradientDeclaration(baseToken, theme2) {
|
|
2766
|
+
const colors = theme2.gradientColorStops || theme2.colors || {};
|
|
2767
|
+
if (baseToken.startsWith("from-")) {
|
|
2768
|
+
const key = baseToken.slice(5);
|
|
2769
|
+
if (key.endsWith("%")) return `--tw-gradient-from-position: ${key};`;
|
|
2770
|
+
const color = resolveColorWithOpacity(colors, key);
|
|
2771
|
+
if (color !== void 0) {
|
|
2772
|
+
return `--tw-gradient-from: ${color}; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-via, transparent), var(--tw-gradient-to, transparent);`;
|
|
2773
|
+
}
|
|
2774
|
+
}
|
|
2775
|
+
if (baseToken.startsWith("via-")) {
|
|
2776
|
+
const key = baseToken.slice(4);
|
|
2777
|
+
if (key.endsWith("%")) return `--tw-gradient-via-position: ${key};`;
|
|
2778
|
+
const color = resolveColorWithOpacity(colors, key);
|
|
2779
|
+
if (color !== void 0) return `--tw-gradient-via: ${color};`;
|
|
2780
|
+
}
|
|
2781
|
+
if (baseToken.startsWith("to-")) {
|
|
2782
|
+
const key = baseToken.slice(3);
|
|
2783
|
+
if (key.endsWith("%")) return `--tw-gradient-to-position: ${key};`;
|
|
2784
|
+
const color = resolveColorWithOpacity(colors, key);
|
|
2785
|
+
if (color !== void 0) return `--tw-gradient-to: ${color};`;
|
|
2786
|
+
}
|
|
2787
|
+
return void 0;
|
|
2788
|
+
}
|
|
2789
|
+
|
|
2790
|
+
// src/builders/transforms.js
|
|
2791
|
+
function buildTransformDeclaration(baseToken, theme2) {
|
|
2792
|
+
if (baseToken === "transform") {
|
|
2793
|
+
return "--tw-translate-x: 0; --tw-translate-y: 0; --tw-rotate: 0; --tw-skew-x: 0; --tw-skew-y: 0; --tw-scale-x: 1; --tw-scale-y: 1; transform: translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));";
|
|
2794
|
+
}
|
|
2795
|
+
if (baseToken === "transform-none") return "transform: none;";
|
|
2796
|
+
if (baseToken === "transform-gpu") {
|
|
2797
|
+
return "transform: translate3d(var(--tw-translate-x,0), var(--tw-translate-y,0), 0) rotate(var(--tw-rotate,0)) skewX(var(--tw-skew-x,0)) skewY(var(--tw-skew-y,0)) scaleX(var(--tw-scale-x,1)) scaleY(var(--tw-scale-y,1));";
|
|
2798
|
+
}
|
|
2799
|
+
const negative = baseToken.startsWith("-");
|
|
2800
|
+
const normalized = negative ? baseToken.slice(1) : baseToken;
|
|
2801
|
+
if (normalized.startsWith("rotate-")) {
|
|
2802
|
+
const key = normalized.slice(7);
|
|
2803
|
+
const axisMatch = key.match(/^([xyz])-(.+)$/);
|
|
2804
|
+
if (axisMatch) {
|
|
2805
|
+
const [, axis, valueKey] = axisMatch;
|
|
2806
|
+
let val2 = resolveThemeValue(theme2.rotate || {}, valueKey) || resolveArbitraryValue(valueKey);
|
|
2807
|
+
if (val2 === void 0) return void 0;
|
|
2808
|
+
if (negative) val2 = val2.startsWith("-") ? val2.slice(1) : `-${val2}`;
|
|
2809
|
+
return `rotate: ${axis.toUpperCase()}(${val2});`;
|
|
2810
|
+
}
|
|
2811
|
+
let val = resolveThemeValue(theme2.rotate || {}, key) || resolveArbitraryValue(key);
|
|
2812
|
+
if (val === void 0) return void 0;
|
|
2813
|
+
if (negative) val = val.startsWith("-") ? val.slice(1) : `-${val}`;
|
|
2814
|
+
return `--tw-rotate: ${val}; transform: rotate(${val});`;
|
|
2815
|
+
}
|
|
2816
|
+
if (normalized.startsWith("scale-")) {
|
|
2817
|
+
const key = normalized.slice(6);
|
|
2818
|
+
const axisMatch = key.match(/^([xyz])-(.+)$/);
|
|
2819
|
+
if (axisMatch) {
|
|
2820
|
+
const [, axis, valueKey] = axisMatch;
|
|
2821
|
+
let val2 = resolveThemeValue(theme2.scale || {}, valueKey) || resolveArbitraryValue(valueKey);
|
|
2822
|
+
if (val2 === void 0) return void 0;
|
|
2823
|
+
if (negative && val2 !== "0") val2 = `-${val2}`;
|
|
2824
|
+
if (axis === "z") return `--tw-scale-z: ${val2}; scale: var(--tw-scale-x, 1) var(--tw-scale-y, 1) ${val2};`;
|
|
2825
|
+
return `--tw-scale-${axis}: ${val2}; transform: scale${axis.toUpperCase()}(${val2});`;
|
|
2826
|
+
}
|
|
2827
|
+
let val = resolveThemeValue(theme2.scale || {}, key) || resolveArbitraryValue(key);
|
|
2828
|
+
if (val === void 0) return void 0;
|
|
2829
|
+
if (negative && val !== "0") val = `-${val}`;
|
|
2830
|
+
return `--tw-scale-x: ${val}; --tw-scale-y: ${val}; transform: scale(${val});`;
|
|
2831
|
+
}
|
|
2832
|
+
if (normalized.startsWith("translate-")) {
|
|
2833
|
+
const key = normalized.slice(10);
|
|
2834
|
+
const axisMatch = key.match(/^([xyz])-(.+)$/);
|
|
2835
|
+
if (axisMatch) {
|
|
2836
|
+
const [, axis, valueKey] = axisMatch;
|
|
2837
|
+
const scale2 = theme2.translate || theme2.spacing || {};
|
|
2838
|
+
let val2 = resolveThemeValue(scale2, valueKey) || resolveArbitraryValue(valueKey);
|
|
2839
|
+
if (val2 === void 0) return void 0;
|
|
2840
|
+
if (negative && val2 !== "0") val2 = `-${val2}`;
|
|
2841
|
+
if (axis === "z") return `--tw-translate-z: ${val2}; transform: translateZ(${val2});`;
|
|
2842
|
+
return `--tw-translate-${axis}: ${val2}; transform: translate${axis.toUpperCase()}(${val2});`;
|
|
2843
|
+
}
|
|
2844
|
+
const scale = theme2.translate || theme2.spacing || {};
|
|
2845
|
+
let val = resolveThemeValue(scale, key) || resolveArbitraryValue(key);
|
|
2846
|
+
if (val === void 0) return void 0;
|
|
2847
|
+
if (negative && val !== "0") val = `-${val}`;
|
|
2848
|
+
return `--tw-translate-x: ${val}; --tw-translate-y: ${val}; transform: translate(${val}, ${val});`;
|
|
2849
|
+
}
|
|
2850
|
+
if (normalized.startsWith("skew-")) {
|
|
2851
|
+
const key = normalized.slice(5);
|
|
2852
|
+
const axisMatch = key.match(/^([xy])-(.+)$/);
|
|
2853
|
+
if (axisMatch) {
|
|
2854
|
+
const [, axis, valueKey] = axisMatch;
|
|
2855
|
+
let val = resolveThemeValue(theme2.skew || {}, valueKey) || resolveArbitraryValue(valueKey);
|
|
2856
|
+
if (val === void 0) return void 0;
|
|
2857
|
+
if (negative) val = val.startsWith("-") ? val.slice(1) : `-${val}`;
|
|
2858
|
+
return `--tw-skew-${axis}: ${val}; transform: skew${axis.toUpperCase()}(${val});`;
|
|
2859
|
+
}
|
|
2860
|
+
}
|
|
2861
|
+
if (normalized.startsWith("origin-")) {
|
|
2862
|
+
const val = resolveThemeValue(theme2.transformOrigin || {}, normalized.slice(7));
|
|
2863
|
+
if (val !== void 0) return `transform-origin: ${val};`;
|
|
2864
|
+
}
|
|
2865
|
+
if (normalized.startsWith("perspective-origin-")) {
|
|
2866
|
+
const key = normalized.slice(19);
|
|
2867
|
+
if (PERSPECTIVE_ORIGIN_MAP[key]) return PERSPECTIVE_ORIGIN_MAP[key];
|
|
2868
|
+
const arb = resolveArbitraryValue(key);
|
|
2869
|
+
if (arb !== void 0) return `perspective-origin: ${arb};`;
|
|
2870
|
+
}
|
|
2871
|
+
if (normalized.startsWith("perspective-")) {
|
|
2872
|
+
const key = normalized.slice(12);
|
|
2873
|
+
if (PERSPECTIVE_MAP[key]) return PERSPECTIVE_MAP[key];
|
|
2874
|
+
const arb = resolveArbitraryValue(key);
|
|
2875
|
+
if (arb !== void 0) return `perspective: ${arb};`;
|
|
2876
|
+
}
|
|
2877
|
+
return void 0;
|
|
2878
|
+
}
|
|
2879
|
+
|
|
2880
|
+
// src/builders/filters.js
|
|
2881
|
+
function buildFilterDeclaration(baseToken, theme2) {
|
|
2882
|
+
const negative = baseToken.startsWith("-");
|
|
2883
|
+
const normalized = negative ? baseToken.slice(1) : baseToken;
|
|
2884
|
+
const isBackdrop = normalized.startsWith("backdrop-");
|
|
2885
|
+
const rest = isBackdrop ? normalized.slice(9) : normalized;
|
|
2886
|
+
const prefix = isBackdrop ? "backdrop-filter" : "filter";
|
|
2887
|
+
const getScale = (key) => {
|
|
2888
|
+
if (isBackdrop) {
|
|
2889
|
+
const backdropKey = `backdrop${key.charAt(0).toUpperCase() + key.slice(1)}`;
|
|
2890
|
+
return theme2[backdropKey] || theme2[key] || {};
|
|
2891
|
+
}
|
|
2892
|
+
return theme2[key] || {};
|
|
2893
|
+
};
|
|
2894
|
+
if (rest === "filter") {
|
|
2895
|
+
return `${prefix}: none;`;
|
|
2896
|
+
}
|
|
2897
|
+
if (rest === "blur" || rest.startsWith("blur-")) {
|
|
2898
|
+
const key = rest === "blur" ? "DEFAULT" : rest.slice(5);
|
|
2899
|
+
const val = resolveThemeValue(getScale("blur"), key);
|
|
2900
|
+
if (val !== void 0) return `${prefix}: blur(${val});`;
|
|
2901
|
+
}
|
|
2902
|
+
if (rest === "brightness") {
|
|
2903
|
+
const val = resolveThemeValue(getScale("brightness"), "100") || resolveThemeValue(getScale("brightness"), "DEFAULT") || "1";
|
|
2904
|
+
return `${prefix}: brightness(${val});`;
|
|
2905
|
+
}
|
|
2906
|
+
if (rest.startsWith("brightness-")) {
|
|
2907
|
+
const val = resolveThemeValue(getScale("brightness"), rest.slice(11));
|
|
2908
|
+
if (val !== void 0) return `${prefix}: brightness(${val});`;
|
|
2909
|
+
}
|
|
2910
|
+
if (rest === "contrast") {
|
|
2911
|
+
const val = resolveThemeValue(getScale("contrast"), "100") || resolveThemeValue(getScale("contrast"), "DEFAULT") || "1";
|
|
2912
|
+
return `${prefix}: contrast(${val});`;
|
|
2913
|
+
}
|
|
2914
|
+
if (rest.startsWith("contrast-")) {
|
|
2915
|
+
const val = resolveThemeValue(getScale("contrast"), rest.slice(9));
|
|
2916
|
+
if (val !== void 0) return `${prefix}: contrast(${val});`;
|
|
2917
|
+
}
|
|
2918
|
+
if (rest === "grayscale" || rest.startsWith("grayscale-")) {
|
|
2919
|
+
const key = rest === "grayscale" ? "DEFAULT" : rest.slice(10);
|
|
2920
|
+
const val = resolveThemeValue(getScale("grayscale"), key);
|
|
2921
|
+
if (val !== void 0) return `${prefix}: grayscale(${val});`;
|
|
2922
|
+
}
|
|
2923
|
+
if (rest === "hue-rotate") {
|
|
2924
|
+
const val = resolveThemeValue(getScale("hueRotate"), "0") || resolveThemeValue(getScale("hueRotate"), "DEFAULT") || "0deg";
|
|
2925
|
+
return `${prefix}: hue-rotate(${val});`;
|
|
2926
|
+
}
|
|
2927
|
+
if (rest.startsWith("hue-rotate-")) {
|
|
2928
|
+
const val = resolveThemeValue(getScale("hueRotate"), rest.slice(11));
|
|
2929
|
+
if (val !== void 0) {
|
|
2930
|
+
const v = negative ? `-${val}` : val;
|
|
2931
|
+
return `${prefix}: hue-rotate(${v});`;
|
|
2932
|
+
}
|
|
2933
|
+
}
|
|
2934
|
+
if (rest === "invert" || rest.startsWith("invert-")) {
|
|
2935
|
+
const key = rest === "invert" ? "DEFAULT" : rest.slice(7);
|
|
2936
|
+
const val = resolveThemeValue(getScale("invert"), key);
|
|
2937
|
+
if (val !== void 0) return `${prefix}: invert(${val});`;
|
|
2938
|
+
}
|
|
2939
|
+
if (rest === "saturate") {
|
|
2940
|
+
const val = resolveThemeValue(getScale("saturate"), "100") || resolveThemeValue(getScale("saturate"), "DEFAULT") || "1";
|
|
2941
|
+
return `${prefix}: saturate(${val});`;
|
|
2942
|
+
}
|
|
2943
|
+
if (rest.startsWith("saturate-")) {
|
|
2944
|
+
const val = resolveThemeValue(getScale("saturate"), rest.slice(9));
|
|
2945
|
+
if (val !== void 0) return `${prefix}: saturate(${val});`;
|
|
2946
|
+
}
|
|
2947
|
+
if (rest === "sepia" || rest.startsWith("sepia-")) {
|
|
2948
|
+
const key = rest === "sepia" ? "DEFAULT" : rest.slice(6);
|
|
2949
|
+
const val = resolveThemeValue(getScale("sepia"), key);
|
|
2950
|
+
if (val !== void 0) return `${prefix}: sepia(${val});`;
|
|
2951
|
+
}
|
|
2952
|
+
if (!isBackdrop && rest === "drop-shadow") {
|
|
2953
|
+
const val = resolveThemeValue(theme2.dropShadow || {}, "DEFAULT");
|
|
2954
|
+
if (val !== void 0) return `filter: drop-shadow(${val});`;
|
|
2955
|
+
}
|
|
2956
|
+
if (!isBackdrop && rest.startsWith("drop-shadow-")) {
|
|
2957
|
+
const val = resolveThemeValue(theme2.dropShadow || {}, rest.slice(12) || "DEFAULT");
|
|
2958
|
+
if (val !== void 0) return `filter: drop-shadow(${val});`;
|
|
2959
|
+
}
|
|
2960
|
+
if (isBackdrop && rest === "opacity") {
|
|
2961
|
+
const val = resolveThemeValue(theme2.backdropOpacity || theme2.opacity || {}, "DEFAULT") || "1";
|
|
2962
|
+
return `backdrop-filter: opacity(${val});`;
|
|
2963
|
+
}
|
|
2964
|
+
if (isBackdrop && rest.startsWith("opacity-")) {
|
|
2965
|
+
const val = resolveThemeValue(theme2.backdropOpacity || theme2.opacity || {}, rest.slice(8));
|
|
2966
|
+
if (val !== void 0) return `backdrop-filter: opacity(${val});`;
|
|
2967
|
+
}
|
|
2968
|
+
return void 0;
|
|
2969
|
+
}
|
|
2970
|
+
|
|
2971
|
+
// src/builders/transitions.js
|
|
2972
|
+
function buildTransitionDeclaration(baseToken) {
|
|
2973
|
+
if (baseToken === "transition") {
|
|
2974
|
+
return `transition-property: ${TRANSITION_PROPERTY_MAP.DEFAULT}; transition-timing-function: ${TRANSITION_TIMING_MAP["in-out"]}; transition-duration: 150ms;`;
|
|
2975
|
+
}
|
|
2976
|
+
if (baseToken.startsWith("transition-")) {
|
|
2977
|
+
const key = baseToken.slice(11);
|
|
2978
|
+
if (Object.prototype.hasOwnProperty.call(TRANSITION_PROPERTY_MAP, key)) {
|
|
2979
|
+
const propertyValue = TRANSITION_PROPERTY_MAP[key];
|
|
2980
|
+
if (propertyValue === "none") return "transition-property: none;";
|
|
2981
|
+
return `transition-property: ${propertyValue}; transition-timing-function: ${TRANSITION_TIMING_MAP["in-out"]}; transition-duration: 150ms;`;
|
|
2982
|
+
}
|
|
2983
|
+
}
|
|
2984
|
+
if (baseToken.startsWith("duration-")) {
|
|
2985
|
+
const value = resolveTimeValue(baseToken.slice(9));
|
|
2986
|
+
if (value !== void 0) return `transition-duration: ${value};`;
|
|
2987
|
+
}
|
|
2988
|
+
if (baseToken.startsWith("delay-")) {
|
|
2989
|
+
const value = resolveTimeValue(baseToken.slice(6));
|
|
2990
|
+
if (value !== void 0) return `transition-delay: ${value};`;
|
|
2991
|
+
}
|
|
2992
|
+
if (baseToken.startsWith("ease-")) {
|
|
2993
|
+
const valueKey = baseToken.slice(5);
|
|
2994
|
+
const value = TRANSITION_TIMING_MAP[valueKey] || resolveArbitraryValue(valueKey);
|
|
2995
|
+
if (value !== void 0) return `transition-timing-function: ${value};`;
|
|
2996
|
+
}
|
|
2997
|
+
return void 0;
|
|
2998
|
+
}
|
|
2999
|
+
|
|
3000
|
+
// src/builders/misc.js
|
|
3001
|
+
function buildAnimationDeclaration(baseToken) {
|
|
3002
|
+
if (!baseToken.startsWith("animate-")) return void 0;
|
|
3003
|
+
const key = baseToken.slice(8);
|
|
3004
|
+
if (ANIMATE_MAP[key]) return ANIMATE_MAP[key];
|
|
3005
|
+
const arb = resolveArbitraryValue(key);
|
|
3006
|
+
if (arb !== void 0) return `animation: ${arb};`;
|
|
3007
|
+
return void 0;
|
|
3008
|
+
}
|
|
3009
|
+
function buildMaskDeclaration(baseToken) {
|
|
3010
|
+
if (MASK_CLIP_MAP[baseToken]) return MASK_CLIP_MAP[baseToken];
|
|
3011
|
+
if (MASK_COMPOSITE_MAP[baseToken]) return MASK_COMPOSITE_MAP[baseToken];
|
|
3012
|
+
if (MASK_MODE_MAP[baseToken]) return MASK_MODE_MAP[baseToken];
|
|
3013
|
+
if (MASK_ORIGIN_MAP[baseToken]) return MASK_ORIGIN_MAP[baseToken];
|
|
3014
|
+
if (MASK_TYPE_MAP[baseToken]) return MASK_TYPE_MAP[baseToken];
|
|
3015
|
+
if (MASK_LINEAR_MAP[baseToken]) return MASK_LINEAR_MAP[baseToken];
|
|
3016
|
+
if (MASK_REPEAT_MAP[baseToken]) return MASK_REPEAT_MAP[baseToken];
|
|
3017
|
+
if (MASK_SIZE_MAP[baseToken]) return MASK_SIZE_MAP[baseToken];
|
|
3018
|
+
if (baseToken === "mask-radial") {
|
|
3019
|
+
return "mask-image: radial-gradient(circle at center, black, transparent); -webkit-mask-image: radial-gradient(circle at center, black, transparent);";
|
|
3020
|
+
}
|
|
3021
|
+
if (baseToken.startsWith("mask-radial-at-")) {
|
|
3022
|
+
const pos = MASK_RADIAL_POSITIONS[baseToken.slice(15)];
|
|
3023
|
+
if (pos !== void 0) {
|
|
3024
|
+
return `mask-image: radial-gradient(circle at ${pos}, black, transparent); -webkit-mask-image: radial-gradient(circle at ${pos}, black, transparent);`;
|
|
3025
|
+
}
|
|
3026
|
+
}
|
|
3027
|
+
if (baseToken.startsWith("mask-position-")) {
|
|
3028
|
+
const pos = MASK_RADIAL_POSITIONS[baseToken.slice(14)];
|
|
3029
|
+
if (pos !== void 0) {
|
|
3030
|
+
return `mask-position: ${pos}; -webkit-mask-position: ${pos};`;
|
|
3031
|
+
}
|
|
3032
|
+
}
|
|
3033
|
+
return void 0;
|
|
3034
|
+
}
|
|
3035
|
+
function buildContainerQueryDeclaration(baseToken) {
|
|
3036
|
+
if (baseToken === "@container") return "container-type: inline-size;";
|
|
3037
|
+
if (baseToken.startsWith("@container/")) {
|
|
3038
|
+
const name = baseToken.slice(11);
|
|
3039
|
+
return `container-type: inline-size; container-name: ${name};`;
|
|
3040
|
+
}
|
|
3041
|
+
return void 0;
|
|
3042
|
+
}
|
|
3043
|
+
function buildInteractivityDeclaration(baseToken, theme2) {
|
|
3044
|
+
if (baseToken.startsWith("cursor-")) return CURSOR_MAP[baseToken.slice(7)] ?? void 0;
|
|
3045
|
+
if (baseToken.startsWith("pointer-events-")) return POINTER_EVENTS_MAP[baseToken.slice(15)] ?? void 0;
|
|
3046
|
+
if (baseToken.startsWith("select-")) return USER_SELECT_MAP[baseToken.slice(7)] ?? void 0;
|
|
3047
|
+
if (baseToken.startsWith("user-select-")) return USER_SELECT_MAP[baseToken.slice(12)] ?? void 0;
|
|
3048
|
+
if (baseToken.startsWith("appearance-")) {
|
|
3049
|
+
return APPEARANCE_MAP[baseToken.slice(11)] ? `appearance: ${baseToken.slice(11)};` : void 0;
|
|
3050
|
+
}
|
|
3051
|
+
if (baseToken === "resize-none") return "resize: none;";
|
|
3052
|
+
if (baseToken === "resize-y") return "resize: vertical;";
|
|
3053
|
+
if (baseToken === "resize-x") return "resize: horizontal;";
|
|
3054
|
+
if (baseToken === "resize") return "resize: both;";
|
|
3055
|
+
if (baseToken === "outline") return "outline-style: solid;";
|
|
3056
|
+
if (baseToken === "outline-none") return "outline: 2px solid transparent; outline-offset: 2px;";
|
|
3057
|
+
if (baseToken.startsWith("outline-")) {
|
|
3058
|
+
const key = baseToken.slice(8);
|
|
3059
|
+
if (OUTLINE_STYLE_MAP[key]) return OUTLINE_STYLE_MAP[key];
|
|
3060
|
+
if (key.startsWith("offset-")) {
|
|
3061
|
+
const offsetKey = key.slice(7);
|
|
3062
|
+
const offset = resolveThemeValue(theme2.outlineOffset || {}, offsetKey);
|
|
3063
|
+
if (offset !== void 0) return `outline-offset: ${offset};`;
|
|
3064
|
+
const arb = resolveArbitraryValue(offsetKey);
|
|
3065
|
+
if (arb !== void 0) return `outline-offset: ${arb};`;
|
|
3066
|
+
}
|
|
3067
|
+
const width = resolveThemeValue(theme2.outlineWidth || {}, key);
|
|
3068
|
+
if (width !== void 0) return `outline-width: ${width};`;
|
|
3069
|
+
const color = resolveColorWithOpacity(theme2.outlineColor || theme2.colors || {}, key);
|
|
3070
|
+
if (color !== void 0) return `outline-color: ${color};`;
|
|
3071
|
+
}
|
|
3072
|
+
return void 0;
|
|
3073
|
+
}
|
|
3074
|
+
function buildZoomDeclaration(baseToken, theme2) {
|
|
3075
|
+
if (!baseToken.startsWith("zoom-")) return void 0;
|
|
3076
|
+
const key = baseToken.slice(5);
|
|
3077
|
+
const val = resolveThemeValue(theme2.zoom || {}, key);
|
|
3078
|
+
if (val !== void 0) return `zoom: ${val};`;
|
|
3079
|
+
const arb = resolveArbitraryValue(key);
|
|
3080
|
+
if (arb !== void 0) return `zoom: ${arb};`;
|
|
3081
|
+
return void 0;
|
|
3082
|
+
}
|
|
3083
|
+
function buildForcedColorDeclaration(baseToken) {
|
|
3084
|
+
if (baseToken === "forced-color-adjust-auto") return "forced-color-adjust: auto;";
|
|
3085
|
+
if (baseToken === "forced-color-adjust-none") return "forced-color-adjust: none;";
|
|
3086
|
+
return void 0;
|
|
3087
|
+
}
|
|
3088
|
+
function buildBorderSpacingDeclaration(baseToken, theme2) {
|
|
3089
|
+
if (!baseToken.startsWith("border-spacing-")) return void 0;
|
|
3090
|
+
const rest = baseToken.slice(15);
|
|
3091
|
+
const axisMatchX = rest.match(/^x-(.+)$/);
|
|
3092
|
+
if (axisMatchX) {
|
|
3093
|
+
const val2 = resolveThemeValue(theme2.borderSpacing || theme2.spacing || {}, axisMatchX[1]);
|
|
3094
|
+
if (val2 !== void 0) return `--tw-border-spacing-x: ${val2}; border-spacing: var(--tw-border-spacing-x) var(--tw-border-spacing-y, 0);`;
|
|
3095
|
+
}
|
|
3096
|
+
const axisMatchY = rest.match(/^y-(.+)$/);
|
|
3097
|
+
if (axisMatchY) {
|
|
3098
|
+
const val2 = resolveThemeValue(theme2.borderSpacing || theme2.spacing || {}, axisMatchY[1]);
|
|
3099
|
+
if (val2 !== void 0) return `--tw-border-spacing-y: ${val2}; border-spacing: var(--tw-border-spacing-x, 0) var(--tw-border-spacing-y);`;
|
|
3100
|
+
}
|
|
3101
|
+
const val = resolveThemeValue(theme2.borderSpacing || theme2.spacing || {}, rest);
|
|
3102
|
+
if (val !== void 0) return `--tw-border-spacing-x: ${val}; --tw-border-spacing-y: ${val}; border-spacing: ${val};`;
|
|
3103
|
+
const arb = resolveArbitraryValue(rest);
|
|
3104
|
+
if (arb !== void 0) return `--tw-border-spacing-x: ${arb}; --tw-border-spacing-y: ${arb}; border-spacing: ${arb};`;
|
|
3105
|
+
return void 0;
|
|
3106
|
+
}
|
|
3107
|
+
var SNAP_TYPE_MAP = {
|
|
3108
|
+
none: "scroll-snap-type: none;",
|
|
3109
|
+
x: "scroll-snap-type: x var(--tw-scroll-snap-strictness);",
|
|
3110
|
+
y: "scroll-snap-type: y var(--tw-scroll-snap-strictness);",
|
|
3111
|
+
both: "scroll-snap-type: both var(--tw-scroll-snap-strictness);",
|
|
3112
|
+
mandatory: "--tw-scroll-snap-strictness: mandatory;",
|
|
3113
|
+
proximity: "--tw-scroll-snap-strictness: proximity;"
|
|
3114
|
+
};
|
|
3115
|
+
var SNAP_ALIGN_MAP = {
|
|
3116
|
+
start: "scroll-snap-align: start;",
|
|
3117
|
+
end: "scroll-snap-align: end;",
|
|
3118
|
+
center: "scroll-snap-align: center;",
|
|
3119
|
+
"align-none": "scroll-snap-align: none;"
|
|
3120
|
+
};
|
|
3121
|
+
var SNAP_STOP_MAP = {
|
|
3122
|
+
normal: "scroll-snap-stop: normal;",
|
|
3123
|
+
always: "scroll-snap-stop: always;"
|
|
3124
|
+
};
|
|
3125
|
+
function buildScrollSnapDeclaration(baseToken) {
|
|
3126
|
+
if (!baseToken.startsWith("snap-")) return void 0;
|
|
3127
|
+
const key = baseToken.slice(5);
|
|
3128
|
+
if (SNAP_TYPE_MAP[key]) return SNAP_TYPE_MAP[key];
|
|
3129
|
+
if (SNAP_ALIGN_MAP[key]) return SNAP_ALIGN_MAP[key];
|
|
3130
|
+
if (SNAP_STOP_MAP[key]) return SNAP_STOP_MAP[key];
|
|
3131
|
+
return void 0;
|
|
3132
|
+
}
|
|
3133
|
+
function buildAccessibilityDeclaration(baseToken) {
|
|
3134
|
+
if (baseToken === "sr-only") {
|
|
3135
|
+
return "position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;";
|
|
3136
|
+
}
|
|
3137
|
+
if (baseToken === "not-sr-only") {
|
|
3138
|
+
return "position: static; width: auto; height: auto; padding: 0; margin: 0; overflow: visible; clip: auto; white-space: normal;";
|
|
3139
|
+
}
|
|
3140
|
+
return void 0;
|
|
3141
|
+
}
|
|
3142
|
+
|
|
3143
|
+
// src/builders/blending.js
|
|
3144
|
+
function buildBlendingDeclaration(baseToken) {
|
|
3145
|
+
if (MIX_BLEND_MAP[baseToken]) return MIX_BLEND_MAP[baseToken];
|
|
3146
|
+
if (BG_BLEND_MAP[baseToken]) return BG_BLEND_MAP[baseToken];
|
|
3147
|
+
return void 0;
|
|
3148
|
+
}
|
|
3149
|
+
|
|
3150
|
+
// src/builders/space-divide.js
|
|
3151
|
+
function childScoped(declaration) {
|
|
3152
|
+
return { __childScoped: true, declaration };
|
|
3153
|
+
}
|
|
3154
|
+
function isChildScoped(result) {
|
|
3155
|
+
return result !== null && typeof result === "object" && result.__childScoped === true;
|
|
3156
|
+
}
|
|
3157
|
+
function buildSpaceBetweenDeclaration(baseToken, theme2) {
|
|
3158
|
+
const negative = baseToken.startsWith("-");
|
|
3159
|
+
const normalized = negative ? baseToken.slice(1) : baseToken;
|
|
3160
|
+
if (normalized === "space-x-reverse") return "--tw-space-x-reverse: 1;";
|
|
3161
|
+
if (normalized === "space-y-reverse") return "--tw-space-y-reverse: 1;";
|
|
3162
|
+
const matchX = normalized.match(/^space-x-(.+)$/);
|
|
3163
|
+
if (matchX) {
|
|
3164
|
+
let val = resolveThemeValue(theme2.spacing || {}, matchX[1]);
|
|
3165
|
+
if (val === void 0) return void 0;
|
|
3166
|
+
if (negative && val !== "0") val = `-${val}`;
|
|
3167
|
+
return childScoped([
|
|
3168
|
+
`--tw-space-x-reverse: 0;`,
|
|
3169
|
+
`margin-inline-end: calc(${val} * var(--tw-space-x-reverse));`,
|
|
3170
|
+
`margin-inline-start: calc(${val} * calc(1 - var(--tw-space-x-reverse)));`
|
|
3171
|
+
].join(" "));
|
|
3172
|
+
}
|
|
3173
|
+
const matchY = normalized.match(/^space-y-(.+)$/);
|
|
3174
|
+
if (matchY) {
|
|
3175
|
+
let val = resolveThemeValue(theme2.spacing || {}, matchY[1]);
|
|
3176
|
+
if (val === void 0) return void 0;
|
|
3177
|
+
if (negative && val !== "0") val = `-${val}`;
|
|
3178
|
+
return childScoped([
|
|
3179
|
+
`--tw-space-y-reverse: 0;`,
|
|
3180
|
+
`margin-bottom: calc(${val} * var(--tw-space-y-reverse));`,
|
|
3181
|
+
`margin-top: calc(${val} * calc(1 - var(--tw-space-y-reverse)));`
|
|
3182
|
+
].join(" "));
|
|
3183
|
+
}
|
|
3184
|
+
return void 0;
|
|
3185
|
+
}
|
|
3186
|
+
function buildDivideDeclaration(baseToken, theme2) {
|
|
3187
|
+
if (!baseToken.startsWith("divide-")) return void 0;
|
|
3188
|
+
const key = baseToken.slice(7);
|
|
3189
|
+
if (key === "x" || key === "x-reverse") {
|
|
3190
|
+
if (key === "x-reverse") return "--tw-divide-x-reverse: 1;";
|
|
3191
|
+
const val = resolveThemeValue(theme2.borderWidth || {}, "DEFAULT") || "1px";
|
|
3192
|
+
return childScoped(`--tw-divide-x-reverse: 0; border-inline-end-width: calc(${val} * var(--tw-divide-x-reverse)); border-inline-start-width: calc(${val} * calc(1 - var(--tw-divide-x-reverse)));`);
|
|
3193
|
+
}
|
|
3194
|
+
const matchX = key.match(/^x-(\d+)$/);
|
|
3195
|
+
if (matchX) {
|
|
3196
|
+
const val = resolveThemeValue(theme2.borderWidth || {}, matchX[1]);
|
|
3197
|
+
if (val !== void 0) return childScoped(`--tw-divide-x-reverse: 0; border-inline-end-width: calc(${val} * var(--tw-divide-x-reverse)); border-inline-start-width: calc(${val} * calc(1 - var(--tw-divide-x-reverse)));`);
|
|
3198
|
+
}
|
|
3199
|
+
if (key === "y" || key === "y-reverse") {
|
|
3200
|
+
if (key === "y-reverse") return "--tw-divide-y-reverse: 1;";
|
|
3201
|
+
const val = resolveThemeValue(theme2.borderWidth || {}, "DEFAULT") || "1px";
|
|
3202
|
+
return childScoped(`--tw-divide-y-reverse: 0; border-bottom-width: calc(${val} * var(--tw-divide-y-reverse)); border-top-width: calc(${val} * calc(1 - var(--tw-divide-y-reverse)));`);
|
|
3203
|
+
}
|
|
3204
|
+
const matchY = key.match(/^y-(\d+)$/);
|
|
3205
|
+
if (matchY) {
|
|
3206
|
+
const val = resolveThemeValue(theme2.borderWidth || {}, matchY[1]);
|
|
3207
|
+
if (val !== void 0) return childScoped(`--tw-divide-y-reverse: 0; border-bottom-width: calc(${val} * var(--tw-divide-y-reverse)); border-top-width: calc(${val} * calc(1 - var(--tw-divide-y-reverse)));`);
|
|
3208
|
+
}
|
|
3209
|
+
if (BORDER_STYLE_MAP[key]) return `border-style: ${BORDER_STYLE_MAP[key].replace("border-style: ", "").replace(";", "")};`;
|
|
3210
|
+
if (key === "none") return "border-style: none;";
|
|
3211
|
+
if (key === "solid") return "border-style: solid;";
|
|
3212
|
+
if (key === "dashed") return "border-style: dashed;";
|
|
3213
|
+
if (key === "dotted") return "border-style: dotted;";
|
|
3214
|
+
if (key === "double") return "border-style: double;";
|
|
3215
|
+
const colors = theme2.colors || {};
|
|
3216
|
+
const color = resolveColorWithOpacity(theme2.divideColor || colors, key);
|
|
3217
|
+
if (color !== void 0) return childScoped(`border-color: ${color};`);
|
|
3218
|
+
if (key.startsWith("opacity-")) {
|
|
3219
|
+
const val = resolveThemeValue(theme2.opacity || {}, key.slice(8));
|
|
3220
|
+
if (val !== void 0) return childScoped(`--tw-divide-opacity: ${val};`);
|
|
3221
|
+
}
|
|
3222
|
+
return void 0;
|
|
3223
|
+
}
|
|
3224
|
+
|
|
3225
|
+
// src/plugins.js
|
|
3226
|
+
var PluginRegistry = class {
|
|
3227
|
+
constructor() {
|
|
3228
|
+
this.exactUtilities = /* @__PURE__ */ new Map();
|
|
3229
|
+
this.regexUtilities = [];
|
|
3230
|
+
this.variants = /* @__PURE__ */ new Map();
|
|
3231
|
+
}
|
|
3232
|
+
/**
|
|
3233
|
+
* Register a custom utility
|
|
3234
|
+
* @param {string|RegExp} pattern - Class name pattern (e.g., "glass" or /^glass-(.+)$/)
|
|
3235
|
+
* @param {Function|string} handler - Function that returns CSS or CSS string
|
|
3236
|
+
*/
|
|
3237
|
+
addUtility(pattern, handler) {
|
|
3238
|
+
if (pattern instanceof RegExp) {
|
|
3239
|
+
this.regexUtilities.push([pattern, handler]);
|
|
3240
|
+
} else {
|
|
3241
|
+
this.exactUtilities.set(pattern, handler);
|
|
3242
|
+
}
|
|
3243
|
+
}
|
|
3244
|
+
/**
|
|
3245
|
+
* Register multiple utilities at once
|
|
3246
|
+
* @param {Object} utilities - Object mapping patterns to handlers
|
|
3247
|
+
*/
|
|
3248
|
+
addUtilities(utilities) {
|
|
3249
|
+
Object.entries(utilities).forEach(([pattern, handler]) => {
|
|
3250
|
+
this.addUtility(pattern, handler);
|
|
3251
|
+
});
|
|
3252
|
+
}
|
|
3253
|
+
/**
|
|
3254
|
+
* Register a custom variant
|
|
3255
|
+
* @param {string} name - Variant name (e.g., "parent-hover")
|
|
3256
|
+
* @param {Function} handler - Function that transforms selector
|
|
3257
|
+
*/
|
|
3258
|
+
addVariant(name, handler) {
|
|
3259
|
+
this.variants.set(name, handler);
|
|
3260
|
+
}
|
|
3261
|
+
/**
|
|
3262
|
+
* Register multiple variants at once
|
|
3263
|
+
* @param {Object} variants - Object mapping names to handlers
|
|
3264
|
+
*/
|
|
3265
|
+
addVariants(variants) {
|
|
3266
|
+
Object.entries(variants).forEach(([name, handler]) => {
|
|
3267
|
+
this.addVariant(name, handler);
|
|
3268
|
+
});
|
|
3269
|
+
}
|
|
3270
|
+
/**
|
|
3271
|
+
* Check if a token matches any custom utility pattern
|
|
3272
|
+
* Optimized: O(1) fast path for exact matches, O(n) only for regex patterns
|
|
3273
|
+
* @param {string} token - The base token to match
|
|
3274
|
+
* @returns {Object|null} - { handler, match } or null
|
|
3275
|
+
*/
|
|
3276
|
+
matchUtility(token) {
|
|
3277
|
+
if (this.exactUtilities.has(token)) {
|
|
3278
|
+
return {
|
|
3279
|
+
handler: this.exactUtilities.get(token),
|
|
3280
|
+
match: [token]
|
|
3281
|
+
};
|
|
3282
|
+
}
|
|
3283
|
+
for (let i = 0; i < this.regexUtilities.length; i += 1) {
|
|
3284
|
+
const [pattern, handler] = this.regexUtilities[i];
|
|
3285
|
+
const match = pattern.exec(token);
|
|
3286
|
+
if (match) {
|
|
3287
|
+
return { handler, match };
|
|
3288
|
+
}
|
|
3289
|
+
}
|
|
3290
|
+
return null;
|
|
3291
|
+
}
|
|
3292
|
+
/**
|
|
3293
|
+
* Check if a variant name matches any custom variant
|
|
3294
|
+
* @param {string} variantName - The variant to check
|
|
3295
|
+
* @returns {Function|null} - Handler function or null
|
|
3296
|
+
*/
|
|
3297
|
+
matchVariant(variantName) {
|
|
3298
|
+
return this.variants.get(variantName) || null;
|
|
3299
|
+
}
|
|
3300
|
+
/**
|
|
3301
|
+
* Get all registered utility patterns (for debugging)
|
|
3302
|
+
*/
|
|
3303
|
+
getUtilities() {
|
|
3304
|
+
return [
|
|
3305
|
+
...Array.from(this.exactUtilities.keys()),
|
|
3306
|
+
...this.regexUtilities.map(([pattern]) => pattern)
|
|
3307
|
+
];
|
|
3308
|
+
}
|
|
3309
|
+
/**
|
|
3310
|
+
* Get all registered variant names (for debugging)
|
|
3311
|
+
*/
|
|
3312
|
+
getVariants() {
|
|
3313
|
+
return Array.from(this.variants.keys());
|
|
3314
|
+
}
|
|
3315
|
+
/**
|
|
3316
|
+
* Clear all registered plugins
|
|
3317
|
+
*/
|
|
3318
|
+
clear() {
|
|
3319
|
+
this.exactUtilities.clear();
|
|
3320
|
+
this.regexUtilities = [];
|
|
3321
|
+
this.variants.clear();
|
|
3322
|
+
}
|
|
3323
|
+
};
|
|
3324
|
+
function isPlugin(obj) {
|
|
3325
|
+
return obj && obj.__isWindrunnerPlugin === true && typeof obj.handler === "function";
|
|
3326
|
+
}
|
|
3327
|
+
|
|
3328
|
+
// src/compiler.js
|
|
3329
|
+
var PREFIX_ROUTER = {
|
|
3330
|
+
// Layout & Display
|
|
3331
|
+
"block": [buildLayoutDeclaration],
|
|
3332
|
+
"inline": [buildLayoutDeclaration],
|
|
3333
|
+
"flex": [buildFlexGridDeclaration, buildLayoutDeclaration],
|
|
3334
|
+
"grid": [buildFlexGridDeclaration, buildLayoutDeclaration],
|
|
3335
|
+
"hidden": [buildLayoutDeclaration],
|
|
3336
|
+
"table": [buildLayoutDeclaration],
|
|
3337
|
+
"flow": [buildLayoutDeclaration],
|
|
3338
|
+
// Position
|
|
3339
|
+
"static": [buildLayoutDeclaration],
|
|
3340
|
+
"fixed": [buildLayoutDeclaration],
|
|
3341
|
+
"absolute": [buildLayoutDeclaration],
|
|
3342
|
+
"relative": [buildLayoutDeclaration],
|
|
3343
|
+
"sticky": [buildLayoutDeclaration],
|
|
3344
|
+
"inset": [buildPositionInsetDeclaration, buildInsetShadowDeclaration, buildInsetRingDeclaration],
|
|
3345
|
+
"top": [buildPositionInsetDeclaration],
|
|
3346
|
+
"right": [buildPositionInsetDeclaration],
|
|
3347
|
+
"bottom": [buildPositionInsetDeclaration],
|
|
3348
|
+
"left": [buildPositionInsetDeclaration],
|
|
3349
|
+
"start": [buildPositionInsetDeclaration],
|
|
3350
|
+
"end": [buildPositionInsetDeclaration],
|
|
3351
|
+
"z": [buildLayoutDeclaration],
|
|
3352
|
+
// Spacing
|
|
3353
|
+
"m": [buildSpacingDeclaration],
|
|
3354
|
+
"mx": [buildSpacingDeclaration],
|
|
3355
|
+
"my": [buildSpacingDeclaration],
|
|
3356
|
+
"mt": [buildSpacingDeclaration],
|
|
3357
|
+
"mr": [buildSpacingDeclaration],
|
|
3358
|
+
"mb": [buildSpacingDeclaration],
|
|
3359
|
+
"ml": [buildSpacingDeclaration],
|
|
3360
|
+
"ms": [buildSpacingDeclaration],
|
|
3361
|
+
"me": [buildSpacingDeclaration],
|
|
3362
|
+
"p": [buildSpacingDeclaration],
|
|
3363
|
+
"px": [buildSpacingDeclaration],
|
|
3364
|
+
"py": [buildSpacingDeclaration],
|
|
3365
|
+
"pt": [buildSpacingDeclaration],
|
|
3366
|
+
"pr": [buildSpacingDeclaration],
|
|
3367
|
+
"pb": [buildSpacingDeclaration],
|
|
3368
|
+
"pl": [buildSpacingDeclaration],
|
|
3369
|
+
"ps": [buildSpacingDeclaration],
|
|
3370
|
+
"pe": [buildSpacingDeclaration],
|
|
3371
|
+
"space": [buildSpaceBetweenDeclaration],
|
|
3372
|
+
// Sizing
|
|
3373
|
+
"w": [buildDimensionDeclaration],
|
|
3374
|
+
"h": [buildDimensionDeclaration],
|
|
3375
|
+
"min": [buildDimensionDeclaration],
|
|
3376
|
+
"max": [buildDimensionDeclaration],
|
|
3377
|
+
"size": [buildDimensionDeclaration],
|
|
3378
|
+
// Typography
|
|
3379
|
+
"text": [buildTypographyDeclaration, buildColorDeclaration],
|
|
3380
|
+
"font": [buildTypographyDeclaration],
|
|
3381
|
+
"leading": [buildTypographyDeclaration],
|
|
3382
|
+
"tracking": [buildTypographyDeclaration],
|
|
3383
|
+
"line": [buildTypographyDeclaration],
|
|
3384
|
+
"whitespace": [buildTypographyDeclaration],
|
|
3385
|
+
"break": [buildTypographyDeclaration],
|
|
3386
|
+
"hyphens": [buildTypographyDeclaration],
|
|
3387
|
+
"list": [buildTypographyDeclaration],
|
|
3388
|
+
"italic": [buildTypographyDeclaration],
|
|
3389
|
+
"underline": [buildTypographyDeclaration],
|
|
3390
|
+
"overline": [buildTypographyDeclaration],
|
|
3391
|
+
"uppercase": [buildTypographyDeclaration],
|
|
3392
|
+
"lowercase": [buildTypographyDeclaration],
|
|
3393
|
+
"capitalize": [buildTypographyDeclaration],
|
|
3394
|
+
"normal": [buildTypographyDeclaration, buildLayoutDeclaration],
|
|
3395
|
+
"truncate": [buildTypographyDeclaration],
|
|
3396
|
+
// Colors & Backgrounds
|
|
3397
|
+
"bg": [buildBackgroundDeclaration, buildColorDeclaration, buildGradientDeclaration],
|
|
3398
|
+
"from": [buildGradientDeclaration],
|
|
3399
|
+
"via": [buildGradientDeclaration],
|
|
3400
|
+
"to": [buildGradientDeclaration],
|
|
3401
|
+
"fill": [buildColorDeclaration],
|
|
3402
|
+
"stroke": [buildColorDeclaration],
|
|
3403
|
+
// Borders
|
|
3404
|
+
"border": [buildBorderDeclaration, buildColorDeclaration],
|
|
3405
|
+
"rounded": [buildBorderRadiusDeclaration],
|
|
3406
|
+
"divide": [buildDivideDeclaration],
|
|
3407
|
+
// Effects
|
|
3408
|
+
"shadow": [buildShadowDeclaration, buildTextShadowDeclaration],
|
|
3409
|
+
"opacity": [buildOpacityDeclaration],
|
|
3410
|
+
"ring": [buildRingDeclaration, buildRingOffsetDeclaration],
|
|
3411
|
+
// Transforms
|
|
3412
|
+
"scale": [buildTransformDeclaration],
|
|
3413
|
+
"rotate": [buildTransformDeclaration],
|
|
3414
|
+
"translate": [buildTransformDeclaration],
|
|
3415
|
+
"skew": [buildTransformDeclaration],
|
|
3416
|
+
"origin": [buildTransformDeclaration],
|
|
3417
|
+
"transform": [buildTransformDeclaration],
|
|
3418
|
+
// Filters
|
|
3419
|
+
"blur": [buildFilterDeclaration],
|
|
3420
|
+
"brightness": [buildFilterDeclaration],
|
|
3421
|
+
"contrast": [buildFilterDeclaration],
|
|
3422
|
+
"grayscale": [buildFilterDeclaration],
|
|
3423
|
+
"hue": [buildFilterDeclaration],
|
|
3424
|
+
"invert": [buildFilterDeclaration],
|
|
3425
|
+
"saturate": [buildFilterDeclaration],
|
|
3426
|
+
"sepia": [buildFilterDeclaration],
|
|
3427
|
+
"drop": [buildFilterDeclaration],
|
|
3428
|
+
"backdrop": [buildFilterDeclaration],
|
|
3429
|
+
// Transitions & Animations
|
|
3430
|
+
"transition": [buildTransitionDeclaration],
|
|
3431
|
+
"duration": [buildTransitionDeclaration],
|
|
3432
|
+
"ease": [buildTransitionDeclaration],
|
|
3433
|
+
"delay": [buildTransitionDeclaration],
|
|
3434
|
+
"animate": [buildAnimationDeclaration],
|
|
3435
|
+
// Interactivity
|
|
3436
|
+
"cursor": [buildInteractivityDeclaration],
|
|
3437
|
+
"pointer": [buildInteractivityDeclaration],
|
|
3438
|
+
"resize": [buildInteractivityDeclaration],
|
|
3439
|
+
"select": [buildInteractivityDeclaration],
|
|
3440
|
+
"appearance": [buildInteractivityDeclaration],
|
|
3441
|
+
"outline": [buildColorDeclaration, buildInteractivityDeclaration],
|
|
3442
|
+
"caret": [buildColorDeclaration],
|
|
3443
|
+
"accent": [buildColorDeclaration],
|
|
3444
|
+
// Flexbox & Grid specific
|
|
3445
|
+
"items": [buildFlexGridDeclaration],
|
|
3446
|
+
"justify": [buildFlexGridDeclaration],
|
|
3447
|
+
"place": [buildFlexGridDeclaration],
|
|
3448
|
+
"content": [buildFlexGridDeclaration, buildTypographyDeclaration],
|
|
3449
|
+
"self": [buildFlexGridDeclaration],
|
|
3450
|
+
"order": [buildFlexGridDeclaration],
|
|
3451
|
+
"gap": [buildGapDeclaration],
|
|
3452
|
+
"grow": [buildFlexGridDeclaration],
|
|
3453
|
+
"shrink": [buildFlexGridDeclaration],
|
|
3454
|
+
"basis": [buildFlexGridDeclaration],
|
|
3455
|
+
"cols": [buildFlexGridDeclaration],
|
|
3456
|
+
"rows": [buildFlexGridDeclaration],
|
|
3457
|
+
"col": [buildFlexGridDeclaration],
|
|
3458
|
+
"row": [buildFlexGridDeclaration],
|
|
3459
|
+
"auto": [buildFlexGridDeclaration, buildLayoutDeclaration],
|
|
3460
|
+
// Misc
|
|
3461
|
+
"overflow": [buildLayoutDeclaration],
|
|
3462
|
+
"overscroll": [buildInteractivityDeclaration],
|
|
3463
|
+
"scroll": [buildScrollSnapDeclaration, buildInteractivityDeclaration],
|
|
3464
|
+
"snap": [buildScrollSnapDeclaration],
|
|
3465
|
+
"touch": [buildInteractivityDeclaration],
|
|
3466
|
+
"will": [buildInteractivityDeclaration],
|
|
3467
|
+
"mix": [buildBlendingDeclaration],
|
|
3468
|
+
"blend": [buildBlendingDeclaration],
|
|
3469
|
+
"isolation": [buildLayoutDeclaration],
|
|
3470
|
+
"object": [buildLayoutDeclaration],
|
|
3471
|
+
"container": [buildContainerQueryDeclaration],
|
|
3472
|
+
"columns": [buildLayoutDeclaration],
|
|
3473
|
+
"aspect": [buildLayoutDeclaration],
|
|
3474
|
+
"clear": [buildLayoutDeclaration],
|
|
3475
|
+
"float": [buildLayoutDeclaration],
|
|
3476
|
+
"box": [buildLayoutDeclaration],
|
|
3477
|
+
"visible": [buildLayoutDeclaration],
|
|
3478
|
+
"invisible": [buildLayoutDeclaration],
|
|
3479
|
+
"collapse": [buildLayoutDeclaration],
|
|
3480
|
+
"mask": [buildMaskDeclaration],
|
|
3481
|
+
"forced": [buildForcedColorDeclaration],
|
|
3482
|
+
"field": [buildInteractivityDeclaration],
|
|
3483
|
+
"placeholder": [buildColorDeclaration],
|
|
3484
|
+
"sr": [buildAccessibilityDeclaration],
|
|
3485
|
+
"not": [buildAccessibilityDeclaration]
|
|
3486
|
+
};
|
|
3487
|
+
function extractPrefix(token) {
|
|
3488
|
+
const dashIndex = token.indexOf("-");
|
|
3489
|
+
if (dashIndex === -1) return token;
|
|
3490
|
+
const prefix = token.slice(0, dashIndex);
|
|
3491
|
+
const secondDashIndex = token.indexOf("-", dashIndex + 1);
|
|
3492
|
+
if (secondDashIndex !== -1) {
|
|
3493
|
+
const twoPartPrefix = token.slice(0, secondDashIndex);
|
|
3494
|
+
if (PREFIX_ROUTER[twoPartPrefix]) return twoPartPrefix;
|
|
3495
|
+
}
|
|
3496
|
+
return prefix;
|
|
3497
|
+
}
|
|
3498
|
+
var UNKNOWN_PREFIX_CACHE = /* @__PURE__ */ new Set();
|
|
3499
|
+
var MAX_UNKNOWN_CACHE_SIZE = 500;
|
|
3500
|
+
function checkAllBuilders(baseToken, theme2) {
|
|
3501
|
+
const prefix = extractPrefix(baseToken);
|
|
3502
|
+
if (UNKNOWN_PREFIX_CACHE.has(prefix)) {
|
|
3503
|
+
return void 0;
|
|
3504
|
+
}
|
|
3505
|
+
const result = buildLayoutDeclaration(baseToken, theme2) || buildPositionInsetDeclaration(baseToken, theme2) || buildSpacingDeclaration(baseToken, theme2) || buildSpaceBetweenDeclaration(baseToken, theme2) || buildGapDeclaration(baseToken, theme2) || buildDimensionDeclaration(baseToken, theme2) || buildFlexGridDeclaration(baseToken, theme2) || buildBorderDeclaration(baseToken, theme2) || buildBorderRadiusDeclaration(baseToken, theme2) || buildBorderSpacingDeclaration(baseToken, theme2) || buildDivideDeclaration(baseToken, theme2) || buildOpacityDeclaration(baseToken, theme2) || buildShadowDeclaration(baseToken, theme2) || buildInsetShadowDeclaration(baseToken, theme2) || buildInsetRingDeclaration(baseToken, theme2) || buildRingDeclaration(baseToken, theme2) || buildRingOffsetDeclaration(baseToken, theme2) || buildTextShadowDeclaration(baseToken, theme2) || buildTransitionDeclaration(baseToken) || buildTransformDeclaration(baseToken, theme2) || buildFilterDeclaration(baseToken, theme2) || buildBackgroundDeclaration(baseToken, theme2) || buildGradientDeclaration(baseToken, theme2) || buildColorDeclaration(baseToken, theme2) || buildTypographyDeclaration(baseToken, theme2) || buildBlendingDeclaration(baseToken) || buildInteractivityDeclaration(baseToken, theme2) || buildAnimationDeclaration(baseToken) || buildMaskDeclaration(baseToken) || buildContainerQueryDeclaration(baseToken) || buildScrollSnapDeclaration(baseToken) || buildAccessibilityDeclaration(baseToken) || buildZoomDeclaration(baseToken, theme2) || buildForcedColorDeclaration(baseToken);
|
|
3506
|
+
if (!result && prefix) {
|
|
3507
|
+
if (UNKNOWN_PREFIX_CACHE.size >= MAX_UNKNOWN_CACHE_SIZE) {
|
|
3508
|
+
const toRemove = Math.floor(MAX_UNKNOWN_CACHE_SIZE / 2);
|
|
3509
|
+
const iterator = UNKNOWN_PREFIX_CACHE.values();
|
|
3510
|
+
for (let i = 0; i < toRemove; i += 1) {
|
|
3511
|
+
const value = iterator.next().value;
|
|
3512
|
+
if (value) UNKNOWN_PREFIX_CACHE.delete(value);
|
|
3513
|
+
}
|
|
3514
|
+
}
|
|
3515
|
+
UNKNOWN_PREFIX_CACHE.add(prefix);
|
|
3516
|
+
}
|
|
3517
|
+
return result;
|
|
3518
|
+
}
|
|
3519
|
+
function compileBaseToken(baseToken, theme2, pluginRegistry) {
|
|
3520
|
+
if (pluginRegistry) {
|
|
3521
|
+
const pluginMatch = pluginRegistry.matchUtility(baseToken);
|
|
3522
|
+
if (pluginMatch) {
|
|
3523
|
+
const { handler, match } = pluginMatch;
|
|
3524
|
+
try {
|
|
3525
|
+
if (typeof handler === "function") {
|
|
3526
|
+
const result = handler(match, theme2);
|
|
3527
|
+
if (result) return result;
|
|
3528
|
+
} else if (typeof handler === "string") {
|
|
3529
|
+
return handler;
|
|
3530
|
+
}
|
|
3531
|
+
} catch (error) {
|
|
3532
|
+
console.warn(`[Windrunner] Plugin utility handler error for "${baseToken}":`, error);
|
|
3533
|
+
}
|
|
3534
|
+
}
|
|
3535
|
+
}
|
|
3536
|
+
const prefix = extractPrefix(baseToken);
|
|
3537
|
+
const builders = PREFIX_ROUTER[prefix];
|
|
3538
|
+
if (builders) {
|
|
3539
|
+
for (let i = 0; i < builders.length; i += 1) {
|
|
3540
|
+
const result = builders[i](baseToken, theme2);
|
|
3541
|
+
if (result) return result;
|
|
3542
|
+
}
|
|
3543
|
+
}
|
|
3544
|
+
return checkAllBuilders(baseToken, theme2);
|
|
3545
|
+
}
|
|
3546
|
+
var VARIANT_MAP = /* @__PURE__ */ new Map([
|
|
3547
|
+
// Dark mode
|
|
3548
|
+
["dark", (s) => `.dark ${s}`],
|
|
3549
|
+
// Pseudo-classes – interactive
|
|
3550
|
+
["hover", (s) => `${s}:hover`],
|
|
3551
|
+
["focus", (s) => `${s}:focus`],
|
|
3552
|
+
["focus-visible", (s) => `${s}:focus-visible`],
|
|
3553
|
+
["focus-within", (s) => `${s}:focus-within`],
|
|
3554
|
+
["active", (s) => `${s}:active`],
|
|
3555
|
+
["visited", (s) => `${s}:visited`],
|
|
3556
|
+
["disabled", (s) => `${s}:disabled`],
|
|
3557
|
+
["checked", (s) => `${s}:checked`],
|
|
3558
|
+
["indeterminate", (s) => `${s}:indeterminate`],
|
|
3559
|
+
["required", (s) => `${s}:required`],
|
|
3560
|
+
["valid", (s) => `${s}:valid`],
|
|
3561
|
+
["invalid", (s) => `${s}:invalid`],
|
|
3562
|
+
["target", (s) => `${s}:target`],
|
|
3563
|
+
["enabled", (s) => `${s}:enabled`],
|
|
3564
|
+
["default", (s) => `${s}:default`],
|
|
3565
|
+
["optional", (s) => `${s}:optional`],
|
|
3566
|
+
["user-valid", (s) => `${s}:user-valid`],
|
|
3567
|
+
["user-invalid", (s) => `${s}:user-invalid`],
|
|
3568
|
+
["in-range", (s) => `${s}:in-range`],
|
|
3569
|
+
["out-of-range", (s) => `${s}:out-of-range`],
|
|
3570
|
+
["placeholder-shown", (s) => `${s}:placeholder-shown`],
|
|
3571
|
+
["autofill", (s) => `${s}:autofill`],
|
|
3572
|
+
["details-content", (s) => `${s}:details-content`],
|
|
3573
|
+
["read-only", (s) => `${s}:read-only`],
|
|
3574
|
+
["open", (s) => `${s}[open]`],
|
|
3575
|
+
// Pseudo-elements
|
|
3576
|
+
["placeholder", (s) => `${s}::placeholder`],
|
|
3577
|
+
["backdrop", (s) => `${s}::backdrop`],
|
|
3578
|
+
["before", (s) => `${s}::before`],
|
|
3579
|
+
["after", (s) => `${s}::after`],
|
|
3580
|
+
["first-letter", (s) => `${s}::first-letter`],
|
|
3581
|
+
["first-line", (s) => `${s}::first-line`],
|
|
3582
|
+
["marker", (s) => `${s}::marker`],
|
|
3583
|
+
["selection", (s) => `${s}::selection`],
|
|
3584
|
+
["file", (s) => `${s}::file-selector-button`],
|
|
3585
|
+
// Structural pseudo-classes
|
|
3586
|
+
["first", (s) => `${s}:first-child`],
|
|
3587
|
+
["last", (s) => `${s}:last-child`],
|
|
3588
|
+
["odd", (s) => `${s}:nth-child(odd)`],
|
|
3589
|
+
["even", (s) => `${s}:nth-child(even)`],
|
|
3590
|
+
["first-of-type", (s) => `${s}:first-of-type`],
|
|
3591
|
+
["last-of-type", (s) => `${s}:last-of-type`],
|
|
3592
|
+
["only", (s) => `${s}:only-child`],
|
|
3593
|
+
["only-of-type", (s) => `${s}:only-of-type`],
|
|
3594
|
+
["empty", (s) => `${s}:empty`],
|
|
3595
|
+
// Group & peer variants
|
|
3596
|
+
["group-hover", (s) => `.group:hover ${s}`],
|
|
3597
|
+
["group-focus", (s) => `.group:focus ${s}`],
|
|
3598
|
+
["group-active", (s) => `.group:active ${s}`],
|
|
3599
|
+
["peer-hover", (s) => `.peer:hover ~ ${s}`],
|
|
3600
|
+
["peer-focus", (s) => `.peer:focus ~ ${s}`],
|
|
3601
|
+
["peer-checked", (s) => `.peer:checked ~ ${s}`],
|
|
3602
|
+
["peer-disabled", (s) => `.peer:disabled ~ ${s}`],
|
|
3603
|
+
// Negation variants
|
|
3604
|
+
["not-hover", (s) => `${s}:not(:hover)`],
|
|
3605
|
+
["not-focus", (s) => `${s}:not(:focus)`],
|
|
3606
|
+
["not-disabled", (s) => `${s}:not(:disabled)`],
|
|
3607
|
+
["not-checked", (s) => `${s}:not(:checked)`],
|
|
3608
|
+
// In-* variants (group-based)
|
|
3609
|
+
["in-hover", (s) => `.group:hover ${s}`],
|
|
3610
|
+
["in-focus", (s) => `.group:focus ${s}`]
|
|
3611
|
+
]);
|
|
3612
|
+
function applyVariants(selector, variants, pluginRegistry) {
|
|
3613
|
+
let currentSelector = selector;
|
|
3614
|
+
for (const variant of variants) {
|
|
3615
|
+
if (pluginRegistry) {
|
|
3616
|
+
const customHandler = pluginRegistry.matchVariant(variant);
|
|
3617
|
+
if (customHandler) {
|
|
3618
|
+
try {
|
|
3619
|
+
const result = customHandler(currentSelector);
|
|
3620
|
+
if (result) {
|
|
3621
|
+
currentSelector = result;
|
|
3622
|
+
continue;
|
|
3623
|
+
}
|
|
3624
|
+
} catch (error) {
|
|
3625
|
+
console.warn(`[Windrunner] Plugin variant handler error for "${variant}":`, error);
|
|
3626
|
+
}
|
|
3627
|
+
}
|
|
3628
|
+
}
|
|
3629
|
+
const builtinHandler = VARIANT_MAP.get(variant);
|
|
3630
|
+
if (builtinHandler) {
|
|
3631
|
+
currentSelector = builtinHandler(currentSelector);
|
|
3632
|
+
} else {
|
|
3633
|
+
return void 0;
|
|
3634
|
+
}
|
|
3635
|
+
}
|
|
3636
|
+
return currentSelector;
|
|
3637
|
+
}
|
|
3638
|
+
function resolveRuntimeContext(options = {}) {
|
|
3639
|
+
const config = getConfigOptions(options, []);
|
|
3640
|
+
const pluginRegistry = new PluginRegistry();
|
|
3641
|
+
if (options.plugins && Array.isArray(options.plugins)) {
|
|
3642
|
+
options.plugins.forEach((pluginDef) => {
|
|
3643
|
+
if (isPlugin(pluginDef)) {
|
|
3644
|
+
try {
|
|
3645
|
+
pluginDef.handler({
|
|
3646
|
+
addUtility: (pattern, handler) => pluginRegistry.addUtility(pattern, handler),
|
|
3647
|
+
addUtilities: (utilities) => pluginRegistry.addUtilities(utilities),
|
|
3648
|
+
addVariant: (name, handler) => pluginRegistry.addVariant(name, handler),
|
|
3649
|
+
addVariants: (variants) => pluginRegistry.addVariants(variants),
|
|
3650
|
+
theme: (key) => {
|
|
3651
|
+
if (!key) return config.theme || {};
|
|
3652
|
+
const keys = key.split(".");
|
|
3653
|
+
let value = config.theme || {};
|
|
3654
|
+
for (const k of keys) {
|
|
3655
|
+
value = value[k];
|
|
3656
|
+
if (value === void 0) break;
|
|
3657
|
+
}
|
|
3658
|
+
return value;
|
|
3659
|
+
},
|
|
3660
|
+
config: () => config
|
|
3661
|
+
});
|
|
3662
|
+
} catch (error) {
|
|
3663
|
+
console.error("[Windrunner] Plugin initialization error:", error);
|
|
3664
|
+
}
|
|
3665
|
+
}
|
|
3666
|
+
});
|
|
3667
|
+
}
|
|
3668
|
+
return {
|
|
3669
|
+
config,
|
|
3670
|
+
theme: config.theme || {},
|
|
3671
|
+
screens: config.theme && config.theme.screens || config.screens || {},
|
|
3672
|
+
containers: config.theme && config.theme.containers || config.containers || {},
|
|
3673
|
+
plugins: pluginRegistry
|
|
3674
|
+
};
|
|
3675
|
+
}
|
|
3676
|
+
function getBaseTailwindOptions(options = {}) {
|
|
3677
|
+
const { id, autoStart, compatMode, compatStyleId, compatGenerateCss, ...tailwindOptions } = options;
|
|
3678
|
+
return tailwindOptions;
|
|
3679
|
+
}
|
|
3680
|
+
var parseCache = /* @__PURE__ */ new Map();
|
|
3681
|
+
var PARSE_CACHE_MAX_SIZE = 2e3;
|
|
3682
|
+
function getConfigHash(screens, containers) {
|
|
3683
|
+
const screensEmpty = !screens || Object.keys(screens).length === 0;
|
|
3684
|
+
const containersEmpty = !containers || Object.keys(containers).length === 0;
|
|
3685
|
+
if (screensEmpty && containersEmpty) return "default";
|
|
3686
|
+
return `${Object.keys(screens || {}).join(",")}|${Object.keys(containers || {}).join(",")}`;
|
|
3687
|
+
}
|
|
3688
|
+
function parseClass(className, screens = {}, containers = {}) {
|
|
3689
|
+
if (typeof className !== "string") return null;
|
|
3690
|
+
const token = className.trim();
|
|
3691
|
+
if (!token) return null;
|
|
3692
|
+
const configHash = getConfigHash(screens, containers);
|
|
3693
|
+
const cacheKey = `${token}:${configHash}`;
|
|
3694
|
+
if (parseCache.has(cacheKey)) {
|
|
3695
|
+
return parseCache.get(cacheKey);
|
|
3696
|
+
}
|
|
3697
|
+
const important = token.startsWith("!");
|
|
3698
|
+
const normalized = important ? token.slice(1) : token;
|
|
3699
|
+
const parts = splitByVariantDelimiter(normalized);
|
|
3700
|
+
if (parts.length === 0) return null;
|
|
3701
|
+
const baseToken = parts[parts.length - 1];
|
|
3702
|
+
const variants = [];
|
|
3703
|
+
let breakpoint = null;
|
|
3704
|
+
let containerBreakpoint = null;
|
|
3705
|
+
let starting = false;
|
|
3706
|
+
for (let i = 0; i < parts.length - 1; i += 1) {
|
|
3707
|
+
const part = parts[i];
|
|
3708
|
+
if (part === "starting") {
|
|
3709
|
+
starting = true;
|
|
3710
|
+
continue;
|
|
3711
|
+
}
|
|
3712
|
+
if (part.startsWith("@")) {
|
|
3713
|
+
const cKey = part.slice(1);
|
|
3714
|
+
if (!containerBreakpoint && containers[cKey]) {
|
|
3715
|
+
containerBreakpoint = cKey;
|
|
3716
|
+
continue;
|
|
3717
|
+
}
|
|
3718
|
+
}
|
|
3719
|
+
if (!breakpoint && screens[part]) {
|
|
3720
|
+
breakpoint = part;
|
|
3721
|
+
continue;
|
|
3722
|
+
}
|
|
3723
|
+
variants.push(part);
|
|
3724
|
+
}
|
|
3725
|
+
const result = { original: token, baseToken, variants, breakpoint, containerBreakpoint, important, starting };
|
|
3726
|
+
if (parseCache.size >= PARSE_CACHE_MAX_SIZE) {
|
|
3727
|
+
const firstKey = parseCache.keys().next().value;
|
|
3728
|
+
parseCache.delete(firstKey);
|
|
3729
|
+
}
|
|
3730
|
+
parseCache.set(cacheKey, result);
|
|
3731
|
+
return result;
|
|
3732
|
+
}
|
|
3733
|
+
function compileRuntimeClassNameWithContext(className, context) {
|
|
3734
|
+
const parsed = parseClass(className, context.screens, context.containers);
|
|
3735
|
+
if (!parsed) return "";
|
|
3736
|
+
const declaration = compileBaseToken(parsed.baseToken, context.theme, context.plugins);
|
|
3737
|
+
if (!declaration) return "";
|
|
3738
|
+
const selector = `.${escapeCssIdentifier(parsed.original)}`;
|
|
3739
|
+
const variantSelector = applyVariants(selector, parsed.variants, context.plugins);
|
|
3740
|
+
if (!variantSelector) return "";
|
|
3741
|
+
const finalDeclaration = appendImportant(
|
|
3742
|
+
isChildScoped(declaration) ? declaration.declaration : declaration,
|
|
3743
|
+
parsed.important
|
|
3744
|
+
);
|
|
3745
|
+
const scopedSelector = isChildScoped(declaration) ? `${variantSelector} > :not(:first-child)` : variantSelector;
|
|
3746
|
+
const ruleBody = `${scopedSelector} { ${finalDeclaration} }`;
|
|
3747
|
+
let result = ruleBody;
|
|
3748
|
+
if (parsed.breakpoint) {
|
|
3749
|
+
result = `@media (min-width: ${context.screens[parsed.breakpoint]}) { ${ruleBody} }`;
|
|
3750
|
+
} else if (parsed.containerBreakpoint) {
|
|
3751
|
+
result = `@container (min-width: ${context.containers[parsed.containerBreakpoint]}) { ${ruleBody} }`;
|
|
3752
|
+
}
|
|
3753
|
+
if (parsed.starting) {
|
|
3754
|
+
return `@starting-style { ${result} }`;
|
|
3755
|
+
}
|
|
3756
|
+
return result;
|
|
3757
|
+
}
|
|
3758
|
+
function compileClass(className, options = {}) {
|
|
3759
|
+
return compileRuntimeClassNameWithContext(className, resolveRuntimeContext(options));
|
|
3760
|
+
}
|
|
3761
|
+
|
|
3762
|
+
// src/preflight.js
|
|
3763
|
+
var preflight = `
|
|
3764
|
+
*,::before,::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}
|
|
3765
|
+
html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:"Inter",ui-sans-serif,system-ui,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}
|
|
3766
|
+
body{margin:0;line-height:inherit}
|
|
3767
|
+
hr{height:0;color:inherit;border-top-width:1px}
|
|
3768
|
+
abbr:where([title]){text-decoration:underline dotted}
|
|
3769
|
+
h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}
|
|
3770
|
+
a{color:inherit;text-decoration:inherit}
|
|
3771
|
+
b,strong{font-weight:bolder}
|
|
3772
|
+
code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}
|
|
3773
|
+
small{font-size:80%}
|
|
3774
|
+
sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}
|
|
3775
|
+
sub{bottom:-0.25em}
|
|
3776
|
+
sup{top:-0.5em}
|
|
3777
|
+
table{text-indent:0;border-color:inherit;border-collapse:collapse}
|
|
3778
|
+
button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}
|
|
3779
|
+
button,select{text-transform:none}
|
|
3780
|
+
button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}
|
|
3781
|
+
:-moz-focusring{outline:auto}
|
|
3782
|
+
:-moz-ui-invalid{box-shadow:none}
|
|
3783
|
+
progress{vertical-align:baseline}
|
|
3784
|
+
::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}
|
|
3785
|
+
[type=search]{-webkit-appearance:textfield;outline-offset:-2px}
|
|
3786
|
+
::-webkit-search-decoration{-webkit-appearance:none}
|
|
3787
|
+
::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}
|
|
3788
|
+
summary{display:list-item}
|
|
3789
|
+
blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}
|
|
3790
|
+
fieldset{margin:0;padding:0}
|
|
3791
|
+
legend{padding:0}
|
|
3792
|
+
ol,ul,menu{list-style:none;margin:0;padding:0}
|
|
3793
|
+
dialog{padding:0}
|
|
3794
|
+
textarea{resize:vertical}
|
|
3795
|
+
input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}
|
|
3796
|
+
button,[role=button]{cursor:pointer}
|
|
3797
|
+
:disabled{cursor:default}
|
|
3798
|
+
img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}
|
|
3799
|
+
img,video{max-width:100%;height:auto}
|
|
3800
|
+
[hidden]:where(:not([hidden=until-found])){display:none}
|
|
3801
|
+
`;
|
|
3802
|
+
var preflight_default = preflight;
|
|
3803
|
+
|
|
3804
|
+
// src/runtime.js
|
|
3805
|
+
function injectPreflight(styleId) {
|
|
3806
|
+
if (typeof document !== "object") return;
|
|
3807
|
+
const prefId = `${styleId}-preflight`;
|
|
3808
|
+
const escapedId = prefId.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
3809
|
+
if (document.querySelector(`style[data-tailwind-preflight="${escapedId}"]`)) return;
|
|
3810
|
+
const style = document.createElement("style");
|
|
3811
|
+
style.setAttribute("type", "text/css");
|
|
3812
|
+
style.setAttribute("data-tailwind-preflight", prefId);
|
|
3813
|
+
style.appendChild(document.createTextNode(preflight_default));
|
|
3814
|
+
const head = document.head || document.getElementsByTagName("head")[0];
|
|
3815
|
+
head.insertBefore(style, head.firstChild);
|
|
3816
|
+
}
|
|
3817
|
+
function findOrCreateRuntimeStyle(id) {
|
|
3818
|
+
if (typeof document !== "object") return null;
|
|
3819
|
+
const escapedId = String(id).replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
3820
|
+
const existing = document.querySelector(`style[data-tailwind-runtime="${escapedId}"]`);
|
|
3821
|
+
if (existing) return existing;
|
|
3822
|
+
const style = document.createElement("style");
|
|
3823
|
+
style.setAttribute("type", "text/css");
|
|
3824
|
+
style.setAttribute("data-tailwind-runtime", id);
|
|
3825
|
+
const head = document.head || document.getElementsByTagName("head")[0];
|
|
3826
|
+
head.appendChild(style);
|
|
3827
|
+
return style;
|
|
3828
|
+
}
|
|
3829
|
+
function createWindrunner(options = {}) {
|
|
3830
|
+
const styleId = options.id || "tailwind-runtime-css";
|
|
3831
|
+
const preflight2 = options.preflight !== false;
|
|
3832
|
+
const compatMode = options.compatMode || "none";
|
|
3833
|
+
const compatStyleId = options.compatStyleId || `${styleId}-full`;
|
|
3834
|
+
const maxCacheSize = options.maxCacheSize || 1e4;
|
|
3835
|
+
const onError = typeof options.onError === "function" ? options.onError : null;
|
|
3836
|
+
const onCompile = typeof options.onCompile === "function" ? options.onCompile : null;
|
|
3837
|
+
const tailwindOptions = getBaseTailwindOptions(options);
|
|
3838
|
+
const context = resolveRuntimeContext(tailwindOptions);
|
|
3839
|
+
const cache = /* @__PURE__ */ new Map();
|
|
3840
|
+
const insertedRules = /* @__PURE__ */ new Set();
|
|
3841
|
+
const pendingElements = /* @__PURE__ */ new Set();
|
|
3842
|
+
let observer = null;
|
|
3843
|
+
let scheduled = false;
|
|
3844
|
+
let styleElement = null;
|
|
3845
|
+
let domReadyHandler = null;
|
|
3846
|
+
let compatLoaded = false;
|
|
3847
|
+
const loadExistingRules = (style) => {
|
|
3848
|
+
if (!style || !style.sheet || insertedRules.size > 0) return;
|
|
3849
|
+
try {
|
|
3850
|
+
const rules = style.sheet.cssRules || [];
|
|
3851
|
+
for (let i = 0; i < rules.length; i += 1) {
|
|
3852
|
+
insertedRules.add(rules[i].cssText);
|
|
3853
|
+
}
|
|
3854
|
+
} catch {
|
|
3855
|
+
}
|
|
3856
|
+
};
|
|
3857
|
+
const ensureCompatStyle = () => {
|
|
3858
|
+
if (compatMode !== "full") return false;
|
|
3859
|
+
if (compatLoaded) return true;
|
|
3860
|
+
if (typeof document !== "object") return false;
|
|
3861
|
+
if (typeof options.compatGenerateCss !== "function") return false;
|
|
3862
|
+
const escapedCompatId = String(compatStyleId).replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
3863
|
+
const existing = document.querySelector(`style[data-tailwind-runtime-compat="${escapedCompatId}"]`);
|
|
3864
|
+
if (existing) {
|
|
3865
|
+
compatLoaded = true;
|
|
3866
|
+
return true;
|
|
3867
|
+
}
|
|
3868
|
+
const cssText = options.compatGenerateCss(tailwindOptions);
|
|
3869
|
+
if (typeof cssText !== "string" || !cssText.trim()) return false;
|
|
3870
|
+
const style = document.createElement("style");
|
|
3871
|
+
style.setAttribute("type", "text/css");
|
|
3872
|
+
style.setAttribute("data-tailwind-runtime-compat", compatStyleId);
|
|
3873
|
+
style.appendChild(document.createTextNode(cssText));
|
|
3874
|
+
const head = document.head || document.getElementsByTagName("head")[0];
|
|
3875
|
+
head.appendChild(style);
|
|
3876
|
+
compatLoaded = true;
|
|
3877
|
+
return true;
|
|
3878
|
+
};
|
|
3879
|
+
const compileWithCache = (className) => {
|
|
3880
|
+
if (cache.has(className)) return cache.get(className);
|
|
3881
|
+
const cssRule = compileRuntimeClassNameWithContext(className, context);
|
|
3882
|
+
if (cache.size >= maxCacheSize) {
|
|
3883
|
+
const firstKey = cache.keys().next().value;
|
|
3884
|
+
cache.delete(firstKey);
|
|
3885
|
+
}
|
|
3886
|
+
cache.set(className, cssRule);
|
|
3887
|
+
return cssRule;
|
|
3888
|
+
};
|
|
3889
|
+
const insertRule = (rule) => {
|
|
3890
|
+
if (!rule || insertedRules.has(rule)) return;
|
|
3891
|
+
if (typeof document !== "object") return;
|
|
3892
|
+
if (!styleElement) styleElement = findOrCreateRuntimeStyle(styleId);
|
|
3893
|
+
if (styleElement) loadExistingRules(styleElement);
|
|
3894
|
+
if (insertedRules.has(rule)) return;
|
|
3895
|
+
insertedRules.add(rule);
|
|
3896
|
+
if (!styleElement || !styleElement.sheet) return;
|
|
3897
|
+
try {
|
|
3898
|
+
styleElement.sheet.insertRule(rule, styleElement.sheet.cssRules.length);
|
|
3899
|
+
} catch {
|
|
3900
|
+
styleElement.appendChild(document.createTextNode(`${rule}
|
|
3901
|
+
`));
|
|
3902
|
+
}
|
|
3903
|
+
};
|
|
3904
|
+
const processClassName = (className) => {
|
|
3905
|
+
const cssRule = compileWithCache(className);
|
|
3906
|
+
if (!cssRule) {
|
|
3907
|
+
ensureCompatStyle();
|
|
3908
|
+
if (onError) {
|
|
3909
|
+
const parsed = parseClass(className, context.screens, context.containers);
|
|
3910
|
+
const errorContext = {
|
|
3911
|
+
reason: parsed ? "unknown-utility" : "parse-error",
|
|
3912
|
+
baseToken: parsed ? parsed.baseToken : className,
|
|
3913
|
+
variants: parsed ? parsed.variants : void 0,
|
|
3914
|
+
details: parsed ? `Could not compile utility "${parsed.baseToken}"${parsed.variants.length ? ` with variants: ${parsed.variants.join(", ")}` : ""}` : `Failed to parse class name "${className}"`
|
|
3915
|
+
};
|
|
3916
|
+
onError(className, errorContext);
|
|
3917
|
+
}
|
|
3918
|
+
} else {
|
|
3919
|
+
insertRule(cssRule);
|
|
3920
|
+
if (onCompile) onCompile(className, cssRule);
|
|
3921
|
+
}
|
|
3922
|
+
return cssRule;
|
|
3923
|
+
};
|
|
3924
|
+
const processElement = (element) => {
|
|
3925
|
+
if (!element || !element.classList) return;
|
|
3926
|
+
element.classList.forEach((className) => processClassName(className));
|
|
3927
|
+
};
|
|
3928
|
+
const processElementTree = (element) => {
|
|
3929
|
+
if (!element || element.nodeType !== 1) return;
|
|
3930
|
+
processElement(element);
|
|
3931
|
+
const children = element.querySelectorAll ? element.querySelectorAll("[class]") : [];
|
|
3932
|
+
children.forEach((child) => processElement(child));
|
|
3933
|
+
};
|
|
3934
|
+
const processClassList = (classList) => {
|
|
3935
|
+
if (!classList) return [];
|
|
3936
|
+
const values = typeof classList === "string" ? classList.split(/\s+/) : Array.isArray(classList) ? classList : typeof classList === "object" && typeof classList.forEach === "function" ? Array.from(classList) : [];
|
|
3937
|
+
return values.filter((item) => typeof item === "string" && item.length > 0).map((item) => processClassName(item)).filter(Boolean);
|
|
3938
|
+
};
|
|
3939
|
+
const scan = (root = document) => {
|
|
3940
|
+
if (typeof document !== "object" || !root) return;
|
|
3941
|
+
const startTime = typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
3942
|
+
const scannedElements = /* @__PURE__ */ new Set();
|
|
3943
|
+
const foundClasses = /* @__PURE__ */ new Set();
|
|
3944
|
+
const initialRuleCount = insertedRules.size;
|
|
3945
|
+
if (root.nodeType === 1) {
|
|
3946
|
+
processElementTree(root);
|
|
3947
|
+
if (root.classList) {
|
|
3948
|
+
scannedElements.add(root);
|
|
3949
|
+
root.classList.forEach((cls) => foundClasses.add(cls));
|
|
3950
|
+
}
|
|
3951
|
+
}
|
|
3952
|
+
const elements = root.querySelectorAll ? root.querySelectorAll("[class]") : [];
|
|
3953
|
+
elements.forEach((element) => {
|
|
3954
|
+
processElement(element);
|
|
3955
|
+
scannedElements.add(element);
|
|
3956
|
+
if (element.classList) {
|
|
3957
|
+
element.classList.forEach((cls) => foundClasses.add(cls));
|
|
3958
|
+
}
|
|
3959
|
+
});
|
|
3960
|
+
if (typeof options.onScanComplete === "function") {
|
|
3961
|
+
const endTime = typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
3962
|
+
const stats = {
|
|
3963
|
+
elementCount: scannedElements.size,
|
|
3964
|
+
classCount: foundClasses.size,
|
|
3965
|
+
ruleCount: insertedRules.size - initialRuleCount,
|
|
3966
|
+
duration: endTime - startTime
|
|
3967
|
+
};
|
|
3968
|
+
if (typeof requestAnimationFrame === "function") {
|
|
3969
|
+
requestAnimationFrame(() => options.onScanComplete(stats));
|
|
3970
|
+
} else {
|
|
3971
|
+
setTimeout(() => options.onScanComplete(stats), 0);
|
|
3972
|
+
}
|
|
3973
|
+
}
|
|
3974
|
+
};
|
|
3975
|
+
const flushQueue = () => {
|
|
3976
|
+
scheduled = false;
|
|
3977
|
+
pendingElements.forEach((element) => processElementTree(element));
|
|
3978
|
+
pendingElements.clear();
|
|
3979
|
+
};
|
|
3980
|
+
const flush = () => {
|
|
3981
|
+
if (pendingElements.size > 0) flushQueue();
|
|
3982
|
+
};
|
|
3983
|
+
const scheduleFlush = () => {
|
|
3984
|
+
if (scheduled) return;
|
|
3985
|
+
scheduled = true;
|
|
3986
|
+
if (typeof requestAnimationFrame === "function") {
|
|
3987
|
+
requestAnimationFrame(flushQueue);
|
|
3988
|
+
} else {
|
|
3989
|
+
setTimeout(flushQueue, 0);
|
|
3990
|
+
}
|
|
3991
|
+
};
|
|
3992
|
+
const observe = (root = document.documentElement) => {
|
|
3993
|
+
if (typeof MutationObserver !== "function" || !root) return;
|
|
3994
|
+
if (observer) observer.disconnect();
|
|
3995
|
+
observer = new MutationObserver((mutations) => {
|
|
3996
|
+
mutations.forEach((mutation) => {
|
|
3997
|
+
if (mutation.type === "attributes" && mutation.target) {
|
|
3998
|
+
pendingElements.add(mutation.target);
|
|
3999
|
+
}
|
|
4000
|
+
mutation.addedNodes.forEach((node) => {
|
|
4001
|
+
if (node.nodeType === 1) pendingElements.add(node);
|
|
4002
|
+
});
|
|
4003
|
+
});
|
|
4004
|
+
scheduleFlush();
|
|
4005
|
+
});
|
|
4006
|
+
const observerConfig = options.observerOptions || {};
|
|
4007
|
+
const finalConfig = {
|
|
4008
|
+
childList: observerConfig.childList !== false,
|
|
4009
|
+
// default: true
|
|
4010
|
+
subtree: observerConfig.subtree !== false,
|
|
4011
|
+
// default: true
|
|
4012
|
+
attributes: observerConfig.attributes !== false,
|
|
4013
|
+
// default: true
|
|
4014
|
+
attributeFilter: observerConfig.attributeFilter || ["class"]
|
|
4015
|
+
// default: ["class"]
|
|
4016
|
+
};
|
|
4017
|
+
observer.observe(root, finalConfig);
|
|
4018
|
+
};
|
|
4019
|
+
const disconnect = () => {
|
|
4020
|
+
pendingElements.clear();
|
|
4021
|
+
scheduled = false;
|
|
4022
|
+
if (observer) {
|
|
4023
|
+
observer.disconnect();
|
|
4024
|
+
observer = null;
|
|
4025
|
+
}
|
|
4026
|
+
if (domReadyHandler && typeof document === "object") {
|
|
4027
|
+
document.removeEventListener("DOMContentLoaded", domReadyHandler);
|
|
4028
|
+
domReadyHandler = null;
|
|
4029
|
+
}
|
|
4030
|
+
};
|
|
4031
|
+
const start = () => {
|
|
4032
|
+
if (typeof document !== "object") return;
|
|
4033
|
+
if (preflight2) injectPreflight(styleId);
|
|
4034
|
+
const fireReady = () => {
|
|
4035
|
+
if (typeof options.onReady !== "function") return;
|
|
4036
|
+
if (typeof requestAnimationFrame === "function") {
|
|
4037
|
+
requestAnimationFrame(() => requestAnimationFrame(() => options.onReady()));
|
|
4038
|
+
} else {
|
|
4039
|
+
setTimeout(() => options.onReady(), 16);
|
|
4040
|
+
}
|
|
4041
|
+
};
|
|
4042
|
+
const runStart = () => {
|
|
4043
|
+
scan();
|
|
4044
|
+
observe();
|
|
4045
|
+
fireReady();
|
|
4046
|
+
};
|
|
4047
|
+
if (document.readyState === "loading") {
|
|
4048
|
+
if (!domReadyHandler) {
|
|
4049
|
+
domReadyHandler = () => {
|
|
4050
|
+
domReadyHandler = null;
|
|
4051
|
+
runStart();
|
|
4052
|
+
};
|
|
4053
|
+
document.addEventListener("DOMContentLoaded", domReadyHandler, { once: true });
|
|
4054
|
+
}
|
|
4055
|
+
return;
|
|
4056
|
+
}
|
|
4057
|
+
runStart();
|
|
4058
|
+
};
|
|
4059
|
+
const clearCache = () => {
|
|
4060
|
+
cache.clear();
|
|
4061
|
+
};
|
|
4062
|
+
const getStats = () => ({
|
|
4063
|
+
cacheSize: cache.size,
|
|
4064
|
+
insertedRuleCount: insertedRules.size,
|
|
4065
|
+
pendingElementCount: pendingElements.size,
|
|
4066
|
+
isObserving: observer !== null,
|
|
4067
|
+
isCompatLoaded: compatLoaded
|
|
4068
|
+
});
|
|
4069
|
+
return {
|
|
4070
|
+
processClassName,
|
|
4071
|
+
processClassList,
|
|
4072
|
+
processElement,
|
|
4073
|
+
scan,
|
|
4074
|
+
observe,
|
|
4075
|
+
flush,
|
|
4076
|
+
start,
|
|
4077
|
+
disconnect,
|
|
4078
|
+
clearCache,
|
|
4079
|
+
getStats,
|
|
4080
|
+
isCompatLoaded: () => compatLoaded,
|
|
4081
|
+
getCacheSize: () => cache.size,
|
|
4082
|
+
getInsertedRuleCount: () => insertedRules.size
|
|
4083
|
+
};
|
|
4084
|
+
}
|
|
4085
|
+
|
|
4086
|
+
// src/react.js
|
|
4087
|
+
import { createContext, useContext } from "react";
|
|
4088
|
+
function useWindrunner(options = {}) {
|
|
4089
|
+
const runtimeRef = useRef(null);
|
|
4090
|
+
const isStartedRef = useRef(false);
|
|
4091
|
+
const optionsKey = useMemo(
|
|
4092
|
+
() => JSON.stringify(options),
|
|
4093
|
+
[options]
|
|
4094
|
+
);
|
|
4095
|
+
useEffect(() => {
|
|
4096
|
+
if (!runtimeRef.current) {
|
|
4097
|
+
runtimeRef.current = createWindrunner({
|
|
4098
|
+
autoStart: false,
|
|
4099
|
+
// We'll start manually
|
|
4100
|
+
...options
|
|
4101
|
+
});
|
|
4102
|
+
}
|
|
4103
|
+
if (!isStartedRef.current && runtimeRef.current) {
|
|
4104
|
+
runtimeRef.current.start();
|
|
4105
|
+
isStartedRef.current = true;
|
|
4106
|
+
}
|
|
4107
|
+
return () => {
|
|
4108
|
+
if (runtimeRef.current) {
|
|
4109
|
+
runtimeRef.current.disconnect();
|
|
4110
|
+
isStartedRef.current = false;
|
|
4111
|
+
}
|
|
4112
|
+
};
|
|
4113
|
+
}, [optionsKey]);
|
|
4114
|
+
return runtimeRef.current;
|
|
4115
|
+
}
|
|
4116
|
+
function useCompileClass(options = {}) {
|
|
4117
|
+
const compile = useCallback(
|
|
4118
|
+
(className) => compileClass(className, options),
|
|
4119
|
+
[JSON.stringify(options)]
|
|
4120
|
+
);
|
|
4121
|
+
return compile;
|
|
4122
|
+
}
|
|
4123
|
+
function useClassList(classList, options = {}) {
|
|
4124
|
+
const windrunner = useWindrunner(options);
|
|
4125
|
+
const cssRules = useMemo(() => {
|
|
4126
|
+
if (!windrunner) return [];
|
|
4127
|
+
return windrunner.processClassList(classList);
|
|
4128
|
+
}, [windrunner, Array.isArray(classList) ? classList.join(" ") : classList]);
|
|
4129
|
+
return cssRules;
|
|
4130
|
+
}
|
|
4131
|
+
function useScanElement(elementRef, options = {}) {
|
|
4132
|
+
const windrunner = useWindrunner(options);
|
|
4133
|
+
useEffect(() => {
|
|
4134
|
+
if (!windrunner || !elementRef.current) return;
|
|
4135
|
+
windrunner.scan(elementRef.current);
|
|
4136
|
+
windrunner.observe(elementRef.current);
|
|
4137
|
+
return () => {
|
|
4138
|
+
};
|
|
4139
|
+
}, [windrunner, elementRef]);
|
|
4140
|
+
}
|
|
4141
|
+
var WindrunnerContext = createContext(null);
|
|
4142
|
+
function WindrunnerProvider({ children, ...options }) {
|
|
4143
|
+
const runtime = useWindrunner(options);
|
|
4144
|
+
return /* @__PURE__ */ React.createElement(WindrunnerContext.Provider, { value: runtime }, children);
|
|
4145
|
+
}
|
|
4146
|
+
function useWindrunnerContext() {
|
|
4147
|
+
const runtime = useContext(WindrunnerContext);
|
|
4148
|
+
if (!runtime) {
|
|
4149
|
+
throw new Error("useWindrunnerContext must be used within WindrunnerProvider");
|
|
4150
|
+
}
|
|
4151
|
+
return runtime;
|
|
4152
|
+
}
|
|
4153
|
+
var react_default = {
|
|
4154
|
+
useWindrunner,
|
|
4155
|
+
useCompileClass,
|
|
4156
|
+
useClassList,
|
|
4157
|
+
useScanElement,
|
|
4158
|
+
WindrunnerProvider,
|
|
4159
|
+
useWindrunnerContext
|
|
4160
|
+
};
|
|
4161
|
+
export {
|
|
4162
|
+
WindrunnerProvider,
|
|
4163
|
+
react_default as default,
|
|
4164
|
+
useClassList,
|
|
4165
|
+
useCompileClass,
|
|
4166
|
+
useScanElement,
|
|
4167
|
+
useWindrunner,
|
|
4168
|
+
useWindrunnerContext
|
|
4169
|
+
};
|
|
4170
|
+
//# sourceMappingURL=react.esm.js.map
|