@kbach/react 0.6.24 → 0.6.26

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.
@@ -0,0 +1,3457 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/core/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ BASE_RESET: () => BASE_RESET,
24
+ LRUCache: () => LRUCache,
25
+ RESET_STYLE_ID: () => RESET_STYLE_ID,
26
+ buildConfig: () => buildConfig,
27
+ clearCache: () => clearCache,
28
+ clearPluginModifiers: () => clearPluginModifiers,
29
+ customVariants: () => customVariants,
30
+ defaultColors: () => defaultColors,
31
+ defaultTheme: () => defaultTheme,
32
+ disableRuntimeCSS: () => disableRuntimeCSS,
33
+ escapeCSSSelector: () => escapeCSSSelector,
34
+ flatten: () => flatten,
35
+ generateClassCSS: () => generateClassCSS,
36
+ getActiveBreakpoints: () => getActiveBreakpoints,
37
+ getAllModifierNames: () => getAllModifierNames,
38
+ getBuiltinStandaloneNames: () => getBuiltinStandaloneNames,
39
+ getBuiltinUtilityPrefixes: () => getBuiltinUtilityPrefixes,
40
+ getConfig: () => getConfig,
41
+ getDefaultFontFamily: () => getDefaultFontFamily,
42
+ getEffectiveIsWeb: () => getEffectiveIsWeb,
43
+ getGlobalDarkMode: () => getGlobalDarkMode,
44
+ getGlobalScreens: () => getGlobalScreens,
45
+ getGlobalWidth: () => getGlobalWidth,
46
+ getInteractiveModifiers: () => getInteractiveModifiers,
47
+ getModeModifiers: () => getModeModifiers,
48
+ getModifier: () => getModifier,
49
+ getResponsiveModifiers: () => getResponsiveModifiers,
50
+ initConfig: () => initConfig,
51
+ isKnownModifier: () => isKnownModifier,
52
+ isKnownUtility: () => isKnownUtility,
53
+ isNative: () => isNative,
54
+ isRuntimeCSSDisabled: () => isRuntimeCSSDisabled,
55
+ isWeb: () => isWeb,
56
+ kbachWarn: () => kbachWarn,
57
+ matchModifier: () => matchModifier,
58
+ normalizeClassString: () => normalizeClassString,
59
+ onConfigChange: () => onConfigChange,
60
+ parseClass: () => parseClass,
61
+ parseClasses: () => parseClasses,
62
+ parseHexRgb: () => parseHexRgb,
63
+ registerModifier: () => registerModifier,
64
+ resetConfig: () => resetConfig,
65
+ resolve: () => resolve,
66
+ resolveColor: () => resolveColor,
67
+ resolveSizing: () => resolveSizing,
68
+ resolveSpacing: () => resolveSpacing,
69
+ resolveUtility: () => resolveUtility,
70
+ setDefaultFontFamily: () => setDefaultFontFamily,
71
+ setGlobalDarkMode: () => setGlobalDarkMode,
72
+ setGlobalWidth: () => setGlobalWidth,
73
+ setResolveTarget: () => setResolveTarget,
74
+ splitClassTokens: () => splitClassTokens,
75
+ subscribeGlobalDarkMode: () => subscribeGlobalDarkMode,
76
+ subscribeGlobalWidth: () => subscribeGlobalWidth,
77
+ syncGlobalDarkMode: () => syncGlobalDarkMode,
78
+ syncGlobalScreens: () => syncGlobalScreens,
79
+ syncGlobalWidth: () => syncGlobalWidth,
80
+ toNativeValue: () => toNativeValue,
81
+ updateConfig: () => updateConfig
82
+ });
83
+ module.exports = __toCommonJS(index_exports);
84
+
85
+ // src/core/theme.ts
86
+ var defaultColors = {
87
+ transparent: "transparent",
88
+ current: "currentColor",
89
+ black: "#000000",
90
+ white: "#ffffff",
91
+ slate: {
92
+ 1: "#f8fafc",
93
+ 2: "#f1f5f9",
94
+ 3: "#e2e8f0",
95
+ 4: "#cbd5e1",
96
+ 5: "#94a3b8",
97
+ 6: "#64748b",
98
+ 7: "#475569",
99
+ 8: "#334155",
100
+ 9: "#1e293b",
101
+ 10: "#0f172a",
102
+ 11: "#020617",
103
+ 12: "#01020a"
104
+ },
105
+ gray: {
106
+ 1: "#f9fafb",
107
+ 2: "#f3f4f6",
108
+ 3: "#e5e7eb",
109
+ 4: "#d1d5db",
110
+ 5: "#9ca3af",
111
+ 6: "#6b7280",
112
+ 7: "#4b5563",
113
+ 8: "#374151",
114
+ 9: "#1f2937",
115
+ 10: "#111827",
116
+ 11: "#030712",
117
+ 12: "#020409"
118
+ },
119
+ zinc: {
120
+ 1: "#fafafa",
121
+ 2: "#f4f4f5",
122
+ 3: "#e4e4e7",
123
+ 4: "#d4d4d8",
124
+ 5: "#a1a1aa",
125
+ 6: "#71717a",
126
+ 7: "#52525b",
127
+ 8: "#3f3f46",
128
+ 9: "#27272a",
129
+ 10: "#18181b",
130
+ 11: "#09090b",
131
+ 12: "#050506"
132
+ },
133
+ neutral: {
134
+ 1: "#fafafa",
135
+ 2: "#f5f5f5",
136
+ 3: "#e5e5e5",
137
+ 4: "#d4d4d4",
138
+ 5: "#a3a3a3",
139
+ 6: "#737373",
140
+ 7: "#525252",
141
+ 8: "#404040",
142
+ 9: "#262626",
143
+ 10: "#171717",
144
+ 11: "#0a0a0a",
145
+ 12: "#050505"
146
+ },
147
+ stone: {
148
+ 1: "#fafaf9",
149
+ 2: "#f5f5f4",
150
+ 3: "#e7e5e4",
151
+ 4: "#d6d3d1",
152
+ 5: "#a8a29e",
153
+ 6: "#78716c",
154
+ 7: "#57534e",
155
+ 8: "#44403c",
156
+ 9: "#292524",
157
+ 10: "#1c1917",
158
+ 11: "#0c0a09",
159
+ 12: "#070605"
160
+ },
161
+ red: {
162
+ 1: "#fef2f2",
163
+ 2: "#fee2e2",
164
+ 3: "#fecaca",
165
+ 4: "#fca5a5",
166
+ 5: "#f87171",
167
+ 6: "#ef4444",
168
+ 7: "#dc2626",
169
+ 8: "#b91c1c",
170
+ 9: "#991b1b",
171
+ 10: "#7f1d1d",
172
+ 11: "#450a0a",
173
+ 12: "#280606"
174
+ },
175
+ orange: {
176
+ 1: "#fff7ed",
177
+ 2: "#ffedd5",
178
+ 3: "#fed7aa",
179
+ 4: "#fdba74",
180
+ 5: "#fb923c",
181
+ 6: "#f97316",
182
+ 7: "#ea580c",
183
+ 8: "#c2410c",
184
+ 9: "#9a3412",
185
+ 10: "#7c2d12",
186
+ 11: "#431407",
187
+ 12: "#270c04"
188
+ },
189
+ amber: {
190
+ 1: "#fffbeb",
191
+ 2: "#fef3c7",
192
+ 3: "#fde68a",
193
+ 4: "#fcd34d",
194
+ 5: "#fbbf24",
195
+ 6: "#f59e0b",
196
+ 7: "#d97706",
197
+ 8: "#b45309",
198
+ 9: "#92400e",
199
+ 10: "#78350f",
200
+ 11: "#451a03",
201
+ 12: "#291002"
202
+ },
203
+ yellow: {
204
+ 1: "#fefce8",
205
+ 2: "#fef9c3",
206
+ 3: "#fef08a",
207
+ 4: "#fde047",
208
+ 5: "#facc15",
209
+ 6: "#eab308",
210
+ 7: "#ca8a04",
211
+ 8: "#a16207",
212
+ 9: "#854d0e",
213
+ 10: "#713f12",
214
+ 11: "#422006",
215
+ 12: "#271304"
216
+ },
217
+ lime: {
218
+ 1: "#f7fee7",
219
+ 2: "#ecfccb",
220
+ 3: "#d9f99d",
221
+ 4: "#bef264",
222
+ 5: "#a3e635",
223
+ 6: "#84cc16",
224
+ 7: "#65a30d",
225
+ 8: "#4d7c0f",
226
+ 9: "#3f6212",
227
+ 10: "#365314",
228
+ 11: "#1a2e05",
229
+ 12: "#0f1b03"
230
+ },
231
+ green: {
232
+ 1: "#f0fdf4",
233
+ 2: "#dcfce7",
234
+ 3: "#bbf7d0",
235
+ 4: "#86efac",
236
+ 5: "#4ade80",
237
+ 6: "#22c55e",
238
+ 7: "#16a34a",
239
+ 8: "#15803d",
240
+ 9: "#166534",
241
+ 10: "#14532d",
242
+ 11: "#052e16",
243
+ 12: "#031b0d"
244
+ },
245
+ emerald: {
246
+ 1: "#ecfdf5",
247
+ 2: "#d1fae5",
248
+ 3: "#a7f3d0",
249
+ 4: "#6ee7b7",
250
+ 5: "#34d399",
251
+ 6: "#10b981",
252
+ 7: "#059669",
253
+ 8: "#047857",
254
+ 9: "#065f46",
255
+ 10: "#064e3b",
256
+ 11: "#022c22",
257
+ 12: "#011a14"
258
+ },
259
+ teal: {
260
+ 1: "#f0fdfa",
261
+ 2: "#ccfbf1",
262
+ 3: "#99f6e4",
263
+ 4: "#5eead4",
264
+ 5: "#2dd4bf",
265
+ 6: "#14b8a6",
266
+ 7: "#0d9488",
267
+ 8: "#0f766e",
268
+ 9: "#115e59",
269
+ 10: "#134e4a",
270
+ 11: "#042f2e",
271
+ 12: "#021c1b"
272
+ },
273
+ cyan: {
274
+ 1: "#ecfeff",
275
+ 2: "#cffafe",
276
+ 3: "#a5f3fc",
277
+ 4: "#67e8f9",
278
+ 5: "#22d3ee",
279
+ 6: "#06b6d4",
280
+ 7: "#0891b2",
281
+ 8: "#0e7490",
282
+ 9: "#155e75",
283
+ 10: "#164e63",
284
+ 11: "#083344",
285
+ 12: "#041e28"
286
+ },
287
+ sky: {
288
+ 1: "#f0f9ff",
289
+ 2: "#e0f2fe",
290
+ 3: "#bae6fd",
291
+ 4: "#7dd3fc",
292
+ 5: "#38bdf8",
293
+ 6: "#0ea5e9",
294
+ 7: "#0284c7",
295
+ 8: "#0369a1",
296
+ 9: "#075985",
297
+ 10: "#0c4a6e",
298
+ 11: "#082f49",
299
+ 12: "#041b2b"
300
+ },
301
+ blue: {
302
+ 1: "#eff6ff",
303
+ 2: "#dbeafe",
304
+ 3: "#bfdbfe",
305
+ 4: "#93c5fd",
306
+ 5: "#60a5fa",
307
+ 6: "#3b82f6",
308
+ 7: "#2563eb",
309
+ 8: "#1d4ed8",
310
+ 9: "#1e40af",
311
+ 10: "#1e3a8a",
312
+ 11: "#172554",
313
+ 12: "#0d1633"
314
+ },
315
+ indigo: {
316
+ 1: "#eef2ff",
317
+ 2: "#e0e7ff",
318
+ 3: "#c7d2fe",
319
+ 4: "#a5b4fc",
320
+ 5: "#818cf8",
321
+ 6: "#6366f1",
322
+ 7: "#4f46e5",
323
+ 8: "#4338ca",
324
+ 9: "#3730a3",
325
+ 10: "#312e81",
326
+ 11: "#1e1b4b",
327
+ 12: "#12102d"
328
+ },
329
+ violet: {
330
+ 1: "#f5f3ff",
331
+ 2: "#ede9fe",
332
+ 3: "#ddd6fe",
333
+ 4: "#c4b5fd",
334
+ 5: "#a78bfa",
335
+ 6: "#8b5cf6",
336
+ 7: "#7c3aed",
337
+ 8: "#6d28d9",
338
+ 9: "#5b21b6",
339
+ 10: "#4c1d95",
340
+ 11: "#2e1065",
341
+ 12: "#1c0a3d"
342
+ },
343
+ purple: {
344
+ 1: "#faf5ff",
345
+ 2: "#f3e8ff",
346
+ 3: "#e9d5ff",
347
+ 4: "#d8b4fe",
348
+ 5: "#c084fc",
349
+ 6: "#a855f7",
350
+ 7: "#9333ea",
351
+ 8: "#7e22ce",
352
+ 9: "#6b21a8",
353
+ 10: "#581c87",
354
+ 11: "#3b0764",
355
+ 12: "#23043c"
356
+ },
357
+ fuchsia: {
358
+ 1: "#fdf4ff",
359
+ 2: "#fae8ff",
360
+ 3: "#f5d0fe",
361
+ 4: "#f0abfc",
362
+ 5: "#e879f9",
363
+ 6: "#d946ef",
364
+ 7: "#c026d3",
365
+ 8: "#a21caf",
366
+ 9: "#86198f",
367
+ 10: "#701a75",
368
+ 11: "#4a044e",
369
+ 12: "#2d022f"
370
+ },
371
+ pink: {
372
+ 1: "#fdf2f8",
373
+ 2: "#fce7f3",
374
+ 3: "#fbcfe8",
375
+ 4: "#f9a8d4",
376
+ 5: "#f472b6",
377
+ 6: "#ec4899",
378
+ 7: "#db2777",
379
+ 8: "#be185d",
380
+ 9: "#9d174d",
381
+ 10: "#831843",
382
+ 11: "#500724",
383
+ 12: "#300415"
384
+ },
385
+ rose: {
386
+ 1: "#fff1f2",
387
+ 2: "#ffe4e6",
388
+ 3: "#fecdd3",
389
+ 4: "#fda4af",
390
+ 5: "#fb7185",
391
+ 6: "#f43f5e",
392
+ 7: "#e11d48",
393
+ 8: "#be123c",
394
+ 9: "#9f1239",
395
+ 10: "#881337",
396
+ 11: "#4c0519",
397
+ 12: "#2d030e"
398
+ }
399
+ };
400
+ var defaultTheme = {
401
+ colors: defaultColors,
402
+ // 1 unit = 4px
403
+ spacing: {
404
+ px: 1,
405
+ 0: 0,
406
+ "0.5": 2,
407
+ 1: 4,
408
+ "1.5": 6,
409
+ 2: 8,
410
+ "2.5": 10,
411
+ 3: 12,
412
+ "3.5": 14,
413
+ 4: 16,
414
+ 5: 20,
415
+ 6: 24,
416
+ 7: 28,
417
+ 8: 32,
418
+ 9: 36,
419
+ 10: 40,
420
+ 11: 44,
421
+ 12: 48,
422
+ 14: 56,
423
+ 16: 64,
424
+ 20: 80,
425
+ 24: 96,
426
+ 28: 112,
427
+ 32: 128,
428
+ 36: 144,
429
+ 40: 160,
430
+ 44: 176,
431
+ 48: 192,
432
+ 52: 208,
433
+ 56: 224,
434
+ 60: 240,
435
+ 64: 256,
436
+ 72: 288,
437
+ 80: 320,
438
+ 96: 384,
439
+ auto: "auto",
440
+ full: "100%",
441
+ "1/2": "50%",
442
+ "1/3": "33.333333%",
443
+ "2/3": "66.666667%",
444
+ "1/4": "25%",
445
+ "3/4": "75%",
446
+ // Dynamic viewport unit — see the comment on the 'screen' standalone utilities
447
+ // in utilities.ts for why dvh beats vh on mobile. Used by h-screen (w-screen
448
+ // has its own standalone entry so it never reaches this spacing lookup).
449
+ screen: "100dvh",
450
+ min: "min-content",
451
+ max: "max-content",
452
+ fit: "fit-content"
453
+ },
454
+ fontSize: {
455
+ xs: 12,
456
+ sm: 14,
457
+ base: 16,
458
+ lg: 18,
459
+ xl: 20,
460
+ "2xl": 24,
461
+ "3xl": 30,
462
+ "4xl": 36,
463
+ "5xl": 48,
464
+ "6xl": 60,
465
+ "7xl": 72,
466
+ "8xl": 96,
467
+ "9xl": 128
468
+ },
469
+ fontFamily: {
470
+ sans: "System",
471
+ mono: "Courier New",
472
+ serif: "Georgia"
473
+ },
474
+ fontWeight: {
475
+ thin: "100",
476
+ extralight: "200",
477
+ light: "300",
478
+ normal: "400",
479
+ medium: "500",
480
+ semibold: "600",
481
+ bold: "700",
482
+ extrabold: "800",
483
+ black: "900"
484
+ },
485
+ borderRadius: {
486
+ none: 0,
487
+ sm: 2,
488
+ DEFAULT: 4,
489
+ md: 6,
490
+ lg: 8,
491
+ xl: 12,
492
+ "2xl": 16,
493
+ "3xl": 24,
494
+ full: 9999
495
+ },
496
+ borderWidth: {
497
+ DEFAULT: 1,
498
+ 0: 0,
499
+ 2: 2,
500
+ 4: 4,
501
+ 8: 8
502
+ },
503
+ opacity: {
504
+ 0: 0,
505
+ 5: 0.05,
506
+ 10: 0.1,
507
+ 15: 0.15,
508
+ 20: 0.2,
509
+ 25: 0.25,
510
+ 30: 0.3,
511
+ 40: 0.4,
512
+ 50: 0.5,
513
+ 60: 0.6,
514
+ 70: 0.7,
515
+ 75: 0.75,
516
+ 80: 0.8,
517
+ 90: 0.9,
518
+ 95: 0.95,
519
+ 100: 1
520
+ },
521
+ lineHeight: {
522
+ none: 1,
523
+ tight: 1.25,
524
+ snug: 1.375,
525
+ normal: 1.5,
526
+ relaxed: 1.625,
527
+ loose: 2,
528
+ // Pixel values stored as strings; styleValueToCSS passes them through, toNativeValue strips the unit
529
+ 3: "12px",
530
+ 4: "16px",
531
+ 5: "20px",
532
+ 6: "24px",
533
+ 7: "28px",
534
+ 8: "32px",
535
+ 9: "36px",
536
+ 10: "40px"
537
+ },
538
+ letterSpacing: {
539
+ tighter: -0.8,
540
+ tight: -0.4,
541
+ normal: 0,
542
+ wide: 0.4,
543
+ wider: 0.8,
544
+ widest: 1.6
545
+ },
546
+ zIndex: {
547
+ auto: "auto",
548
+ 0: 0,
549
+ 10: 10,
550
+ 20: 20,
551
+ 30: 30,
552
+ 40: 40,
553
+ 50: 50
554
+ },
555
+ flex: {
556
+ 1: 1,
557
+ auto: "auto",
558
+ // CSS: flex: auto = 1 1 auto; native: mapped to 1 in resolver
559
+ initial: "initial",
560
+ // CSS: flex: initial = 0 1 auto; native: mapped to 1
561
+ none: "none"
562
+ // CSS: flex: none = 0 0 auto; native: mapped to 0
563
+ },
564
+ shadow: {
565
+ sm: {
566
+ shadowColor: "#000",
567
+ shadowOffset: { width: 0, height: 1 },
568
+ shadowOpacity: 0.05,
569
+ shadowRadius: 2,
570
+ elevation: 1
571
+ },
572
+ DEFAULT: {
573
+ shadowColor: "#000",
574
+ shadowOffset: { width: 0, height: 2 },
575
+ shadowOpacity: 0.1,
576
+ shadowRadius: 4,
577
+ elevation: 2
578
+ },
579
+ md: {
580
+ shadowColor: "#000",
581
+ shadowOffset: { width: 0, height: 4 },
582
+ shadowOpacity: 0.1,
583
+ shadowRadius: 8,
584
+ elevation: 3
585
+ },
586
+ lg: {
587
+ shadowColor: "#000",
588
+ shadowOffset: { width: 0, height: 8 },
589
+ shadowOpacity: 0.1,
590
+ shadowRadius: 15,
591
+ elevation: 4
592
+ },
593
+ xl: {
594
+ shadowColor: "#000",
595
+ shadowOffset: { width: 0, height: 16 },
596
+ shadowOpacity: 0.1,
597
+ shadowRadius: 24,
598
+ elevation: 6
599
+ },
600
+ "2xl": {
601
+ shadowColor: "#000",
602
+ shadowOffset: { width: 0, height: 24 },
603
+ shadowOpacity: 0.25,
604
+ shadowRadius: 48,
605
+ elevation: 8
606
+ },
607
+ none: {
608
+ shadowColor: "transparent",
609
+ shadowOffset: { width: 0, height: 0 },
610
+ shadowOpacity: 0,
611
+ shadowRadius: 0,
612
+ elevation: 0
613
+ }
614
+ },
615
+ screens: {
616
+ sm: 576,
617
+ // small tablets / large phones (landscape)
618
+ md: 768,
619
+ // tablets (iPad and up)
620
+ lg: 1024,
621
+ // large tablets (iPad Pro)
622
+ xl: 1280,
623
+ // desktop
624
+ "2xl": 1536
625
+ },
626
+ // Empty by default — the 4 built-in presets (spin/ping/pulse/bounce) are handled
627
+ // directly in the `animate` resolver, not through this theme table. This exists so
628
+ // user-defined ones (kbach.config.js theme.extend.keyframes/animation) merge in
629
+ // alongside them without needing to redeclare the built-ins.
630
+ keyframes: {},
631
+ animation: {}
632
+ };
633
+
634
+ // src/core/reset.ts
635
+ var RESET_STYLE_ID = "kbach-reset";
636
+ var BASE_RESET = [
637
+ // border-style: solid means border-N utilities show a visible border without an extra border-solid class.
638
+ // border-width: 0 keeps all elements borderless by default.
639
+ "*, *::before, *::after { box-sizing: border-box; border-width: 0; border-style: solid; border-color: currentColor; }",
640
+ "body { margin: 0; padding: 0; }",
641
+ "h1, h2, h3, h4, h5, h6 { margin: 0; font-size: inherit; font-weight: inherit; }",
642
+ "p { margin: 0; }",
643
+ "a { color: inherit; text-decoration: none; }",
644
+ "ul, ol { margin: 0; padding: 0; list-style: none; }",
645
+ "img, video, svg { display: block; max-width: 100%; }",
646
+ // appearance: none is deliberately NOT applied to checkbox/radio/select below —
647
+ // stripping it hides their native checkmark/arrow with nothing rendered in its
648
+ // place, leaving an invisible checkbox or an arrow-less <select> that looks like
649
+ // plain text. Text-like inputs, textarea, and button don't have that problem
650
+ // (their native chrome is just a skin around content utilities can fully
651
+ // restyle), so they keep the blank-canvas treatment.
652
+ "input:not([type='checkbox']):not([type='radio']), textarea { appearance: none; -webkit-appearance: none; background: transparent; padding: 0; margin: 0; font: inherit; color: inherit; line-height: inherit; }",
653
+ // Native checkbox/radio/range still get typography + spacing normalized, and
654
+ // accent-color re-themes their native indicator to the current text color
655
+ // instead of the browser/OS default blue, so they stay on-brand without
656
+ // needing to be rebuilt from scratch.
657
+ "input[type='checkbox'], input[type='radio'], input[type='range'] { margin: 0; font: inherit; accent-color: currentColor; }",
658
+ // select keeps its native chrome (border/background/arrow are all part of the
659
+ // same OS-drawn widget that appearance: none would blank out) — only typography
660
+ // and spacing are normalized so it still matches surrounding text.
661
+ "select { margin: 0; font: inherit; color: inherit; line-height: inherit; }",
662
+ "button { appearance: none; -webkit-appearance: none; background: transparent; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; line-height: inherit; text-align: inherit; }",
663
+ "button, [role='button'] { cursor: pointer; }",
664
+ ":disabled { cursor: default; }",
665
+ "textarea { resize: vertical; }",
666
+ // Firefox renders placeholders at ~54% opacity by default; every other browser uses 1 —
667
+ // normalize to 1 so placeholder color is consistent and fully controlled by the placeholder: modifier.
668
+ "::placeholder { opacity: 1; }",
669
+ "input[type='number']::-webkit-inner-spin-button, input[type='number']::-webkit-outer-spin-button { margin: 0; }",
670
+ "input[type='search']::-webkit-search-decoration, input[type='search']::-webkit-search-cancel-button { -webkit-appearance: none; }",
671
+ "fieldset { padding: 0; margin: 0; }",
672
+ "table { border-collapse: collapse; border-spacing: 0; }"
673
+ ].join("\n");
674
+
675
+ // src/core/cache.ts
676
+ var LRUCache = class {
677
+ constructor(capacity = 1e4, onEvict) {
678
+ this.capacity = capacity;
679
+ if (capacity <= 0) throw new Error("LRUCache: capacity must be a positive integer");
680
+ this.cache = /* @__PURE__ */ new Map();
681
+ this.onEvict = onEvict;
682
+ }
683
+ get(key) {
684
+ if (!this.cache.has(key)) return void 0;
685
+ const value = this.cache.get(key);
686
+ this.cache.delete(key);
687
+ this.cache.set(key, value);
688
+ return value;
689
+ }
690
+ set(key, value) {
691
+ if (this.cache.has(key)) {
692
+ this.cache.delete(key);
693
+ } else if (this.cache.size >= this.capacity) {
694
+ const oldestKey = this.cache.keys().next().value;
695
+ const oldestValue = this.cache.get(oldestKey);
696
+ this.cache.delete(oldestKey);
697
+ this.onEvict?.(oldestKey, oldestValue);
698
+ }
699
+ this.cache.set(key, value);
700
+ return this;
701
+ }
702
+ has(key) {
703
+ return this.cache.has(key);
704
+ }
705
+ delete(key) {
706
+ return this.cache.delete(key);
707
+ }
708
+ clear() {
709
+ this.cache.clear();
710
+ }
711
+ get size() {
712
+ return this.cache.size;
713
+ }
714
+ };
715
+
716
+ // src/core/platform.ts
717
+ var isWeb = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
718
+ var isNative = !isWeb && (typeof globalThis.HermesInternal !== "undefined" || typeof globalThis.__fbBatchedBridge !== "undefined" || typeof navigator !== "undefined" && navigator.product === "ReactNative" || typeof globalThis.__REACT_NATIVE__ !== "undefined");
719
+ var _resolveTargetOverride = null;
720
+ function setResolveTarget(target) {
721
+ _resolveTargetOverride = target;
722
+ }
723
+ function getEffectiveIsWeb() {
724
+ if (_resolveTargetOverride) return _resolveTargetOverride === "web";
725
+ return isWeb || !isNative;
726
+ }
727
+ function toNativeValue(raw) {
728
+ if (/^-?\d+(\.\d+)?px$/.test(raw)) return parseFloat(raw);
729
+ if (/^-?\d+(\.\d+)?rem$/.test(raw)) return parseFloat(raw) * 16;
730
+ if (/^-?\d+(\.\d+)?em$/.test(raw)) return parseFloat(raw) * 16;
731
+ if (/^-?\d+(\.\d+)?$/.test(raw)) return parseFloat(raw);
732
+ return raw;
733
+ }
734
+ function escapeCSSSelector(cls) {
735
+ return cls.replace(/[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g, "\\$&");
736
+ }
737
+
738
+ // src/core/devWarn.ts
739
+ function kbachWarn(message) {
740
+ console.warn(
741
+ "%c[kbach]%c " + message,
742
+ "color:#8b5cf6;font-weight:700",
743
+ "color:inherit;font-weight:400"
744
+ );
745
+ }
746
+
747
+ // src/core/registry.ts
748
+ var BUILTIN_MODIFIERS = {
749
+ // ── Mode ─────────────────────────────────────────────────────────────────
750
+ dark: { darkScheme: "dark", jsBehavior: "mode", jsMatch: (d) => d },
751
+ "not-light": { darkScheme: "dark", jsBehavior: "mode", jsMatch: (d) => d },
752
+ light: { darkScheme: "light", jsBehavior: "mode", jsMatch: (d) => !d },
753
+ "not-dark": { darkScheme: "light", jsBehavior: "mode", jsMatch: (d) => !d },
754
+ // ── Interactive — JS state + CSS pseudo ───────────────────────────────────
755
+ hover: { pseudo: ":hover", jsBehavior: "interactive", jsMatch: (_, s) => !!s.hover },
756
+ "not-hover": { pseudo: ":not(:hover)", jsBehavior: "interactive", jsMatch: (_, s) => !s.hover },
757
+ focus: { pseudo: ":focus", jsBehavior: "interactive", jsMatch: (_, s) => !!s.focus },
758
+ "not-focus": { pseudo: ":not(:focus)", jsBehavior: "interactive", jsMatch: (_, s) => !s.focus },
759
+ active: { pseudo: ":active", jsBehavior: "interactive", jsMatch: (_, s) => !!s.active || !!s.pressed },
760
+ "not-active": { pseudo: ":not(:active)", jsBehavior: "interactive", jsMatch: (_, s) => !s.active && !s.pressed },
761
+ pressed: { pseudo: ":active", jsBehavior: "interactive", jsMatch: (_, s) => !!s.pressed || !!s.active },
762
+ "not-pressed": { pseudo: ":not(:active)", jsBehavior: "interactive", jsMatch: (_, s) => !s.pressed && !s.active },
763
+ disabled: { pseudo: ":disabled", jsBehavior: "interactive", jsMatch: (_, s) => !!s.disabled },
764
+ "not-disabled": { pseudo: ":not(:disabled)", jsBehavior: "interactive", jsMatch: (_, s) => !s.disabled },
765
+ checked: { pseudo: ":checked", jsBehavior: "interactive", jsMatch: (_, s) => !!s.checked },
766
+ "not-checked": { pseudo: ":not(:checked)", jsBehavior: "interactive", jsMatch: (_, s) => !s.checked },
767
+ visited: { pseudo: ":visited", jsBehavior: "interactive", jsMatch: (_, s) => !!s.visited },
768
+ "not-visited": { pseudo: ":not(:visited)", jsBehavior: "interactive", jsMatch: (_, s) => !s.visited },
769
+ placeholder: { pseudo: "::placeholder", jsBehavior: "interactive", jsMatch: (_, s) => !!s.placeholder },
770
+ // ── CSS-only pseudo-classes (structural) ──────────────────────────────────
771
+ first: { pseudo: ":first-child", jsBehavior: "css-only", forcesImportant: true },
772
+ last: { pseudo: ":last-child", jsBehavior: "css-only", forcesImportant: true },
773
+ odd: { pseudo: ":nth-child(odd)", jsBehavior: "css-only", forcesImportant: true },
774
+ even: { pseudo: ":nth-child(even)", jsBehavior: "css-only", forcesImportant: true },
775
+ only: { pseudo: ":only-child", jsBehavior: "css-only", forcesImportant: true },
776
+ "focus-within": { pseudo: ":focus-within", jsBehavior: "css-only", forcesImportant: true },
777
+ "focus-visible": { pseudo: ":focus-visible", jsBehavior: "css-only", forcesImportant: true },
778
+ // ── CSS-only pseudo-elements ───────────────────────────────────────────────
779
+ before: { pseudo: "::before", jsBehavior: "css-only" },
780
+ after: { pseudo: "::after", jsBehavior: "css-only" },
781
+ selection: { pseudo: "::selection", jsBehavior: "css-only" },
782
+ "first-letter": { pseudo: "::first-letter", jsBehavior: "css-only" },
783
+ "first-line": { pseudo: "::first-line", jsBehavior: "css-only" },
784
+ marker: { pseudo: "::marker", jsBehavior: "css-only" },
785
+ // ── Group / peer ancestor selectors (CSS-only) ─────────────────────────────
786
+ "group-hover": { ancestorSelector: ".group:hover ", jsBehavior: "css-only", forcesImportant: true },
787
+ "group-focus": { ancestorSelector: ".group:focus ", jsBehavior: "css-only", forcesImportant: true },
788
+ "peer-hover": { ancestorSelector: ".peer:hover ~ ", jsBehavior: "css-only", forcesImportant: true },
789
+ "peer-focus": { ancestorSelector: ".peer:focus ~ ", jsBehavior: "css-only", forcesImportant: true },
790
+ // ── Responsive — both CSS (@media min-width) and JS (breakpoints set) ──────
791
+ sm: { isResponsive: true, jsBehavior: "responsive", jsMatch: (_, __, bp) => bp.has("sm") },
792
+ md: { isResponsive: true, jsBehavior: "responsive", jsMatch: (_, __, bp) => bp.has("md") },
793
+ lg: { isResponsive: true, jsBehavior: "responsive", jsMatch: (_, __, bp) => bp.has("lg") },
794
+ xl: { isResponsive: true, jsBehavior: "responsive", jsMatch: (_, __, bp) => bp.has("xl") },
795
+ "2xl": { isResponsive: true, jsBehavior: "responsive", jsMatch: (_, __, bp) => bp.has("2xl") },
796
+ // ── Print media (CSS-only) ─────────────────────────────────────────────────
797
+ print: { mediaQuery: "print", jsBehavior: "css-only", forcesImportant: true },
798
+ // ── Orientation / accessibility media (CSS-only) ───────────────────────────
799
+ landscape: { mediaQuery: "(orientation: landscape)", jsBehavior: "css-only", forcesImportant: true },
800
+ portrait: { mediaQuery: "(orientation: portrait)", jsBehavior: "css-only", forcesImportant: true },
801
+ "motion-reduce": { mediaQuery: "(prefers-reduced-motion: reduce)", jsBehavior: "css-only", forcesImportant: true },
802
+ "motion-safe": { mediaQuery: "(prefers-reduced-motion: no-preference)", jsBehavior: "css-only", forcesImportant: true },
803
+ "contrast-more": { mediaQuery: "(prefers-contrast: more)", jsBehavior: "css-only", forcesImportant: true },
804
+ "contrast-less": { mediaQuery: "(prefers-contrast: less)", jsBehavior: "css-only", forcesImportant: true },
805
+ // ── Directionality (CSS-only) ──────────────────────────────────────────────
806
+ rtl: { dirSelector: '[dir="rtl"] ', jsBehavior: "css-only", forcesImportant: true },
807
+ ltr: { dirSelector: '[dir="ltr"] ', jsBehavior: "css-only", forcesImportant: true }
808
+ };
809
+ var _pluginModifiers = {};
810
+ var _allNames = null;
811
+ var _interactiveNames = null;
812
+ var _modeNames = null;
813
+ var _responsiveNames = null;
814
+ function _invalidate() {
815
+ _allNames = null;
816
+ _interactiveNames = null;
817
+ _modeNames = null;
818
+ _responsiveNames = null;
819
+ }
820
+ function registerModifier(name, def) {
821
+ if (process.env.NODE_ENV !== "production" && name in BUILTIN_MODIFIERS) {
822
+ kbachWarn(`"${name}" is built-in \u2014 pick another modifier name`);
823
+ return;
824
+ }
825
+ _pluginModifiers[name] = def;
826
+ _invalidate();
827
+ }
828
+ function clearPluginModifiers() {
829
+ for (const k of Object.keys(_pluginModifiers)) delete _pluginModifiers[k];
830
+ _invalidate();
831
+ }
832
+ var NAMED_GROUP_PEER_RE = /^(group|peer)-(hover|focus)\/(.+)$/;
833
+ var _namedModifierCache = new LRUCache(1e4);
834
+ function getNamedGroupPeerModifier(name) {
835
+ const cached = _namedModifierCache.get(name);
836
+ if (cached) return cached;
837
+ const m = NAMED_GROUP_PEER_RE.exec(name);
838
+ if (!m) return void 0;
839
+ const [, kind, trigger, groupName] = m;
840
+ const escapedName = escapeCSSSelector(groupName);
841
+ const pseudo = trigger === "hover" ? ":hover" : ":focus";
842
+ const combinator = kind === "group" ? " " : " ~ ";
843
+ const def = {
844
+ ancestorSelector: `.${kind}\\/${escapedName}${pseudo}${combinator}`,
845
+ jsBehavior: "css-only",
846
+ forcesImportant: true
847
+ };
848
+ _namedModifierCache.set(name, def);
849
+ return def;
850
+ }
851
+ function getModifier(name) {
852
+ return BUILTIN_MODIFIERS[name] ?? _pluginModifiers[name] ?? getNamedGroupPeerModifier(name);
853
+ }
854
+ function isKnownModifier(name) {
855
+ return name in BUILTIN_MODIFIERS || name in _pluginModifiers || NAMED_GROUP_PEER_RE.test(name);
856
+ }
857
+ function _allEntries() {
858
+ return [...Object.entries(BUILTIN_MODIFIERS), ...Object.entries(_pluginModifiers)];
859
+ }
860
+ function getAllModifierNames() {
861
+ if (!_allNames) _allNames = new Set(_allEntries().map(([k]) => k));
862
+ return _allNames;
863
+ }
864
+ function getInteractiveModifiers() {
865
+ if (!_interactiveNames) {
866
+ _interactiveNames = new Set(_allEntries().filter(([, d]) => d.jsBehavior === "interactive").map(([k]) => k));
867
+ }
868
+ return _interactiveNames;
869
+ }
870
+ function getModeModifiers() {
871
+ if (!_modeNames) {
872
+ _modeNames = new Set(_allEntries().filter(([, d]) => d.jsBehavior === "mode").map(([k]) => k));
873
+ }
874
+ return _modeNames;
875
+ }
876
+ function getResponsiveModifiers() {
877
+ if (!_responsiveNames) {
878
+ _responsiveNames = new Set(_allEntries().filter(([, d]) => d.jsBehavior === "responsive").map(([k]) => k));
879
+ }
880
+ return _responsiveNames;
881
+ }
882
+ function matchModifier(name, isDark, state, breakpoints) {
883
+ return getModifier(name)?.jsMatch?.(isDark, state, breakpoints) ?? false;
884
+ }
885
+
886
+ // src/core/resolvers/color.ts
887
+ function resolveColor(value, colors, isArbitrary) {
888
+ if (isArbitrary) return value;
889
+ const slashIdx = value.indexOf("/");
890
+ const colorPart = slashIdx > 0 ? value.slice(0, slashIdx) : value;
891
+ const opacityPart = slashIdx > 0 ? value.slice(slashIdx + 1) : null;
892
+ let hex = null;
893
+ if (colorPart.startsWith("[") && colorPart.endsWith("]")) {
894
+ hex = colorPart.slice(1, -1);
895
+ } else if (colorPart in colors) {
896
+ const entry = colors[colorPart];
897
+ if (typeof entry === "string") hex = entry;
898
+ else if (typeof entry === "object" && "6" in entry) hex = entry["6"];
899
+ } else {
900
+ const lastDash = colorPart.lastIndexOf("-");
901
+ if (lastDash > 0) {
902
+ const colorName = colorPart.slice(0, lastDash);
903
+ const shade = colorPart.slice(lastDash + 1);
904
+ const scale = colors[colorName];
905
+ if (scale && typeof scale === "object" && shade in scale) {
906
+ hex = scale[shade] ?? null;
907
+ }
908
+ }
909
+ }
910
+ if (!hex) return null;
911
+ if (!opacityPart) {
912
+ if (!getEffectiveIsWeb() && hex.startsWith("#") && hex.length === 9) {
913
+ return hexToRgba(hex, Math.round(parseInt(hex.slice(7, 9), 16) / 255 * 1e3) / 1e3);
914
+ }
915
+ return hex;
916
+ }
917
+ let alpha;
918
+ if (opacityPart.startsWith("[") && opacityPart.endsWith("]")) {
919
+ const v = parseFloat(opacityPart.slice(1, -1));
920
+ alpha = v > 1 ? v / 100 : v;
921
+ } else {
922
+ alpha = parseFloat(opacityPart) / 100;
923
+ }
924
+ if (isNaN(alpha)) return hex;
925
+ if (alpha < 0) alpha = 0;
926
+ else if (alpha > 1) alpha = 1;
927
+ return hexToRgba(hex, alpha);
928
+ }
929
+ function parseHexRgb(hex) {
930
+ const h = hex.replace("#", "");
931
+ if (h.length === 3 || h.length === 4) {
932
+ return [
933
+ parseInt(h[0] + h[0], 16),
934
+ parseInt(h[1] + h[1], 16),
935
+ parseInt(h[2] + h[2], 16)
936
+ ];
937
+ }
938
+ if (h.length === 6 || h.length === 8) {
939
+ return [
940
+ parseInt(h.slice(0, 2), 16),
941
+ parseInt(h.slice(2, 4), 16),
942
+ parseInt(h.slice(4, 6), 16)
943
+ ];
944
+ }
945
+ return null;
946
+ }
947
+ function hexToRgba(hex, alpha) {
948
+ const rgb = parseHexRgb(hex);
949
+ if (!rgb) return hex;
950
+ const [r, g, b] = rgb;
951
+ return `rgba(${r},${g},${b},${alpha})`;
952
+ }
953
+ function withOpacityVar(color, varName) {
954
+ if (!color.startsWith("#")) return color;
955
+ const rgb = parseHexRgb(color);
956
+ if (!rgb) return color;
957
+ const [r, g, b] = rgb;
958
+ return `rgba(${r},${g},${b},var(${varName},1))`;
959
+ }
960
+ var colorResolvers = {
961
+ // ── Background ─────────────────────────────────────────────────────────────
962
+ bg: ({ value, isArbitrary }, { colors }) => {
963
+ const color = resolveColor(value, colors, isArbitrary);
964
+ if (!color) return null;
965
+ return { backgroundColor: getEffectiveIsWeb() ? withOpacityVar(color, "--bg-opacity") : color };
966
+ },
967
+ "bg-opacity": ({ value, isArbitrary }, _) => {
968
+ if (!getEffectiveIsWeb()) return null;
969
+ const n = parseFloat(value);
970
+ if (isNaN(n)) return null;
971
+ const v = isArbitrary ? n > 1 ? n / 100 : n : n / 100;
972
+ return { "--bg-opacity": v };
973
+ },
974
+ // ── Background gradient (CSS variable gradient stops, web-only) ──────────
975
+ "bg-gradient-to": ({ value }) => {
976
+ if (!getEffectiveIsWeb()) return null;
977
+ const directions = {
978
+ t: "to top",
979
+ tr: "to top right",
980
+ r: "to right",
981
+ br: "to bottom right",
982
+ b: "to bottom",
983
+ bl: "to bottom left",
984
+ l: "to left",
985
+ tl: "to top left"
986
+ };
987
+ const dir = directions[value];
988
+ if (!dir) return null;
989
+ return {
990
+ backgroundImage: `linear-gradient(${dir}, var(--kb-gradient-from, transparent), var(--kb-gradient-stops, transparent))`
991
+ };
992
+ },
993
+ from: ({ value, isArbitrary }, { colors }) => {
994
+ if (!getEffectiveIsWeb()) return null;
995
+ const color = resolveColor(value, colors, isArbitrary);
996
+ if (!color) return null;
997
+ return {
998
+ "--kb-gradient-from": color,
999
+ "--kb-gradient-stops": `var(--kb-gradient-from), var(--kb-gradient-to, transparent)`
1000
+ };
1001
+ },
1002
+ via: ({ value, isArbitrary }, { colors }) => {
1003
+ if (!getEffectiveIsWeb()) return null;
1004
+ const color = resolveColor(value, colors, isArbitrary);
1005
+ if (!color) return null;
1006
+ return {
1007
+ "--kb-gradient-via": color,
1008
+ "--kb-gradient-stops": `var(--kb-gradient-from), var(--kb-gradient-via), var(--kb-gradient-to, transparent)`
1009
+ };
1010
+ },
1011
+ to: ({ value, isArbitrary }, { colors }) => {
1012
+ if (!getEffectiveIsWeb()) return null;
1013
+ const color = resolveColor(value, colors, isArbitrary);
1014
+ if (!color) return null;
1015
+ return { "--kb-gradient-to": color };
1016
+ },
1017
+ // ── Tint color (native-only, for Image and icon components) ──────────────
1018
+ tint: ({ value, isArbitrary }, { colors }) => {
1019
+ if (getEffectiveIsWeb()) return null;
1020
+ const color = resolveColor(value, colors, isArbitrary);
1021
+ return color ? { tintColor: color } : null;
1022
+ },
1023
+ // ── Caret color (web-only) ────────────────────────────────────────────────
1024
+ caret: ({ value, isArbitrary }, { colors }) => {
1025
+ if (!getEffectiveIsWeb()) return null;
1026
+ if (value === "auto" || value === "transparent") return { caretColor: value };
1027
+ const color = resolveColor(value, colors, isArbitrary);
1028
+ return color ? { caretColor: color } : null;
1029
+ },
1030
+ // ── Accent color (web-only) ───────────────────────────────────────────────
1031
+ accent: ({ value, isArbitrary }, { colors }) => {
1032
+ if (!getEffectiveIsWeb()) return null;
1033
+ if (value === "auto") return { accentColor: "auto" };
1034
+ const color = resolveColor(value, colors, isArbitrary);
1035
+ return color ? { accentColor: color } : null;
1036
+ }
1037
+ };
1038
+
1039
+ // src/core/resolvers/spacing.ts
1040
+ function resolveSpacing(value, negative, spacing, isArbitrary) {
1041
+ if (isArbitrary) {
1042
+ const resolved = getEffectiveIsWeb() ? value : toNativeValue(value);
1043
+ if (negative) {
1044
+ if (typeof resolved === "number") return -resolved;
1045
+ if (typeof resolved === "string") {
1046
+ if (/^\d/.test(resolved)) return `-${resolved}`;
1047
+ if (/^(calc|var|min|max|clamp|env)\s*\(/.test(resolved)) return `calc(-1 * (${resolved}))`;
1048
+ }
1049
+ }
1050
+ return resolved;
1051
+ }
1052
+ const raw = spacing[value];
1053
+ if (raw === void 0) return null;
1054
+ if (typeof raw === "number") return negative ? -raw : raw;
1055
+ if (raw === "auto") return "auto";
1056
+ if (negative && typeof raw === "string" && raw.endsWith("%")) {
1057
+ return `-${raw}`;
1058
+ }
1059
+ return raw;
1060
+ }
1061
+ function resolveSizing(value, spacing, isArbitrary) {
1062
+ if (isArbitrary) return getEffectiveIsWeb() ? value : toNativeValue(value);
1063
+ const raw = spacing[value];
1064
+ if (raw !== void 0) return raw;
1065
+ if (/^\d+\/\d+$/.test(value)) {
1066
+ const [num, den] = value.split("/").map(Number);
1067
+ if (!den) return null;
1068
+ return `${(num / den * 100).toFixed(6)}%`;
1069
+ }
1070
+ return null;
1071
+ }
1072
+ function makeSpacingResolver(prop) {
1073
+ return ({ value, negative, isArbitrary }, { spacing }) => {
1074
+ const v = resolveSpacing(value, negative, spacing, isArbitrary);
1075
+ return v !== null ? { [prop]: v } : null;
1076
+ };
1077
+ }
1078
+ var PADDING_MARGIN_PROPS = {
1079
+ p: "padding",
1080
+ px: "paddingHorizontal",
1081
+ py: "paddingVertical",
1082
+ pt: "paddingTop",
1083
+ pr: "paddingRight",
1084
+ pb: "paddingBottom",
1085
+ pl: "paddingLeft",
1086
+ m: "margin",
1087
+ mx: "marginHorizontal",
1088
+ my: "marginVertical",
1089
+ mt: "marginTop",
1090
+ mr: "marginRight",
1091
+ mb: "marginBottom",
1092
+ ml: "marginLeft"
1093
+ };
1094
+ var spacingResolvers = {
1095
+ // ── Sizing ─────────────────────────────────────────────────────────────────
1096
+ w: ({ value, isArbitrary }, { spacing }) => {
1097
+ const v = resolveSizing(value, spacing, isArbitrary);
1098
+ return v !== null ? { width: v } : null;
1099
+ },
1100
+ h: ({ value, isArbitrary }, { spacing }) => {
1101
+ const v = resolveSizing(value, spacing, isArbitrary);
1102
+ return v !== null ? { height: v } : null;
1103
+ },
1104
+ "min-w": ({ value, isArbitrary }, { spacing }) => {
1105
+ const v = resolveSizing(value, spacing, isArbitrary);
1106
+ return v !== null ? { minWidth: v } : null;
1107
+ },
1108
+ "min-h": ({ value, isArbitrary }, { spacing }) => {
1109
+ const v = resolveSizing(value, spacing, isArbitrary);
1110
+ return v !== null ? { minHeight: v } : null;
1111
+ },
1112
+ "max-w": ({ value, isArbitrary }, { spacing }) => {
1113
+ const v = resolveSizing(value, spacing, isArbitrary);
1114
+ return v !== null ? { maxWidth: v } : null;
1115
+ },
1116
+ "max-h": ({ value, isArbitrary }, { spacing }) => {
1117
+ const v = resolveSizing(value, spacing, isArbitrary);
1118
+ return v !== null ? { maxHeight: v } : null;
1119
+ },
1120
+ // ── Size shorthand (sets width AND height in one utility) ────────────────
1121
+ size: ({ value, isArbitrary }, { spacing }) => {
1122
+ const v = resolveSizing(value, spacing, isArbitrary);
1123
+ return v !== null ? { width: v, height: v } : null;
1124
+ },
1125
+ // ── Flex basis ─────────────────────────────────────────────────────────────
1126
+ basis: ({ value, isArbitrary }, { spacing }) => {
1127
+ const v = resolveSizing(value, spacing, isArbitrary);
1128
+ return v !== null ? { flexBasis: v } : null;
1129
+ },
1130
+ // ── Gap ────────────────────────────────────────────────────────────────────
1131
+ gap: ({ value, negative, isArbitrary }, { spacing }) => {
1132
+ const v = resolveSpacing(value, negative, spacing, isArbitrary);
1133
+ return v !== null ? { gap: v } : null;
1134
+ },
1135
+ "gap-x": ({ value, negative, isArbitrary }, { spacing }) => {
1136
+ const v = resolveSpacing(value, negative, spacing, isArbitrary);
1137
+ return v !== null ? { columnGap: v } : null;
1138
+ },
1139
+ "gap-y": ({ value, negative, isArbitrary }, { spacing }) => {
1140
+ const v = resolveSpacing(value, negative, spacing, isArbitrary);
1141
+ return v !== null ? { rowGap: v } : null;
1142
+ },
1143
+ // ── Position ───────────────────────────────────────────────────────────────
1144
+ top: ({ value, negative, isArbitrary }, { spacing }) => {
1145
+ const v = resolveSpacing(value, negative, spacing, isArbitrary);
1146
+ return v !== null ? { top: v } : null;
1147
+ },
1148
+ right: ({ value, negative, isArbitrary }, { spacing }) => {
1149
+ const v = resolveSpacing(value, negative, spacing, isArbitrary);
1150
+ return v !== null ? { right: v } : null;
1151
+ },
1152
+ bottom: ({ value, negative, isArbitrary }, { spacing }) => {
1153
+ const v = resolveSpacing(value, negative, spacing, isArbitrary);
1154
+ return v !== null ? { bottom: v } : null;
1155
+ },
1156
+ left: ({ value, negative, isArbitrary }, { spacing }) => {
1157
+ const v = resolveSpacing(value, negative, spacing, isArbitrary);
1158
+ return v !== null ? { left: v } : null;
1159
+ },
1160
+ inset: ({ value, negative, isArbitrary }, { spacing }) => {
1161
+ const v = resolveSpacing(value, negative, spacing, isArbitrary);
1162
+ return v !== null ? { top: v, right: v, bottom: v, left: v } : null;
1163
+ },
1164
+ "inset-x": ({ value, negative, isArbitrary }, { spacing }) => {
1165
+ const v = resolveSpacing(value, negative, spacing, isArbitrary);
1166
+ return v !== null ? { left: v, right: v } : null;
1167
+ },
1168
+ "inset-y": ({ value, negative, isArbitrary }, { spacing }) => {
1169
+ const v = resolveSpacing(value, negative, spacing, isArbitrary);
1170
+ return v !== null ? { top: v, bottom: v } : null;
1171
+ },
1172
+ // ── Translate ──────────────────────────────────────────────────────────────
1173
+ "translate-x": ({ value, negative, isArbitrary }, { spacing }) => {
1174
+ const v = resolveSpacing(value, negative, spacing, isArbitrary);
1175
+ if (v === null) return null;
1176
+ if (getEffectiveIsWeb()) return { transform: `translateX(${typeof v === "number" ? `${v}px` : v})` };
1177
+ if (typeof v === "string") {
1178
+ const n = parseFloat(v);
1179
+ return isNaN(n) ? null : { transform: [{ translateX: n }] };
1180
+ }
1181
+ return { transform: [{ translateX: v }] };
1182
+ },
1183
+ "translate-y": ({ value, negative, isArbitrary }, { spacing }) => {
1184
+ const v = resolveSpacing(value, negative, spacing, isArbitrary);
1185
+ if (v === null) return null;
1186
+ if (getEffectiveIsWeb()) return { transform: `translateY(${typeof v === "number" ? `${v}px` : v})` };
1187
+ if (typeof v === "string") {
1188
+ const n = parseFloat(v);
1189
+ return isNaN(n) ? null : { transform: [{ translateY: n }] };
1190
+ }
1191
+ return { transform: [{ translateY: v }] };
1192
+ },
1193
+ // ── Space between ─────────────────────────────────────────────────────────
1194
+ // On web: emits __spaceX/__spaceY markers → resolver generates > * + * CSS rules.
1195
+ // On native (RN 0.71+): uses columnGap/rowGap directly.
1196
+ "space-x": ({ value, negative, isArbitrary }, { spacing }) => {
1197
+ const v = resolveSpacing(value, negative, spacing, isArbitrary);
1198
+ if (v === null) return null;
1199
+ if (getEffectiveIsWeb()) return { __spaceX: v };
1200
+ return { columnGap: v };
1201
+ },
1202
+ "space-y": ({ value, negative, isArbitrary }, { spacing }) => {
1203
+ const v = resolveSpacing(value, negative, spacing, isArbitrary);
1204
+ if (v === null) return null;
1205
+ if (getEffectiveIsWeb()) return { __spaceY: v };
1206
+ return { rowGap: v };
1207
+ }
1208
+ };
1209
+ for (const [utility, prop] of Object.entries(PADDING_MARGIN_PROPS)) {
1210
+ spacingResolvers[utility] = makeSpacingResolver(prop);
1211
+ }
1212
+
1213
+ // src/core/resolvers/border.ts
1214
+ function resolveRadius(value, radii, isArbitrary) {
1215
+ if (isArbitrary) return getEffectiveIsWeb() ? value : toNativeValue(value);
1216
+ const key = value === "" ? "DEFAULT" : value;
1217
+ return radii[key] ?? null;
1218
+ }
1219
+ function makeBorderSideResolver(widthProp, colorProp) {
1220
+ return ({ value, isArbitrary }, { colors, borderWidth }) => {
1221
+ if (!value) return { [widthProp]: 1 };
1222
+ if (isArbitrary) {
1223
+ const w2 = toNativeValue(value);
1224
+ if (typeof w2 === "number") return { [widthProp]: w2 };
1225
+ return { [colorProp]: value };
1226
+ }
1227
+ const color = resolveColor(value, colors, false);
1228
+ if (color) return { [colorProp]: color };
1229
+ const w = borderWidth[value];
1230
+ return w !== void 0 ? { [widthProp]: w } : null;
1231
+ };
1232
+ }
1233
+ var BORDER_SIDE_PROPS = {
1234
+ "border-t": ["borderTopWidth", "borderTopColor"],
1235
+ "border-r": ["borderRightWidth", "borderRightColor"],
1236
+ "border-b": ["borderBottomWidth", "borderBottomColor"],
1237
+ "border-l": ["borderLeftWidth", "borderLeftColor"]
1238
+ };
1239
+ var borderResolvers = {
1240
+ // ── Border width ───────────────────────────────────────────────────────────
1241
+ border: ({ value, isArbitrary }, { colors, borderWidth, spacing }) => {
1242
+ if (!value) return { borderWidth: borderWidth["DEFAULT"] ?? 1 };
1243
+ if (isArbitrary) {
1244
+ const w2 = toNativeValue(value);
1245
+ if (typeof w2 === "number") return { borderWidth: w2 };
1246
+ return { borderColor: value };
1247
+ }
1248
+ const color = resolveColor(value, colors, false);
1249
+ if (color) return { borderColor: color };
1250
+ const w = borderWidth[value] ?? spacing[value];
1251
+ if (w !== void 0) {
1252
+ const numW = typeof w === "number" ? w : parseFloat(String(w));
1253
+ if (isNaN(numW)) return null;
1254
+ return { borderWidth: numW };
1255
+ }
1256
+ return null;
1257
+ },
1258
+ // border-t/-r/-b/-l generated below via makeBorderSideResolver() — see BORDER_SIDE_PROPS.
1259
+ // ── Border radius ──────────────────────────────────────────────────────────
1260
+ rounded: ({ value, isArbitrary }, { borderRadius }) => {
1261
+ const r = resolveRadius(value, borderRadius, isArbitrary);
1262
+ return r !== null ? { borderRadius: r } : null;
1263
+ },
1264
+ "rounded-t": ({ value, isArbitrary }, { borderRadius }) => {
1265
+ const r = resolveRadius(value, borderRadius, isArbitrary);
1266
+ return r !== null ? { borderTopLeftRadius: r, borderTopRightRadius: r } : null;
1267
+ },
1268
+ "rounded-r": ({ value, isArbitrary }, { borderRadius }) => {
1269
+ const r = resolveRadius(value, borderRadius, isArbitrary);
1270
+ return r !== null ? { borderTopRightRadius: r, borderBottomRightRadius: r } : null;
1271
+ },
1272
+ "rounded-b": ({ value, isArbitrary }, { borderRadius }) => {
1273
+ const r = resolveRadius(value, borderRadius, isArbitrary);
1274
+ return r !== null ? { borderBottomLeftRadius: r, borderBottomRightRadius: r } : null;
1275
+ },
1276
+ "rounded-l": ({ value, isArbitrary }, { borderRadius }) => {
1277
+ const r = resolveRadius(value, borderRadius, isArbitrary);
1278
+ return r !== null ? { borderTopLeftRadius: r, borderBottomLeftRadius: r } : null;
1279
+ },
1280
+ "rounded-tl": ({ value, isArbitrary }, { borderRadius }) => {
1281
+ const r = resolveRadius(value, borderRadius, isArbitrary);
1282
+ return r !== null ? { borderTopLeftRadius: r } : null;
1283
+ },
1284
+ "rounded-tr": ({ value, isArbitrary }, { borderRadius }) => {
1285
+ const r = resolveRadius(value, borderRadius, isArbitrary);
1286
+ return r !== null ? { borderTopRightRadius: r } : null;
1287
+ },
1288
+ "rounded-bl": ({ value, isArbitrary }, { borderRadius }) => {
1289
+ const r = resolveRadius(value, borderRadius, isArbitrary);
1290
+ return r !== null ? { borderBottomLeftRadius: r } : null;
1291
+ },
1292
+ "rounded-br": ({ value, isArbitrary }, { borderRadius }) => {
1293
+ const r = resolveRadius(value, borderRadius, isArbitrary);
1294
+ return r !== null ? { borderBottomRightRadius: r } : null;
1295
+ },
1296
+ // ── Outline extended (web-only) ───────────────────────────────────────────
1297
+ outline: ({ value, isArbitrary }, { colors }) => {
1298
+ if (!getEffectiveIsWeb()) return null;
1299
+ if (!value) return { outline: "2px solid transparent", outlineOffset: "2px" };
1300
+ if (value === "none") return { outline: "none", outlineOffset: "0" };
1301
+ if (isArbitrary) {
1302
+ if (/^\d/.test(value) || value.startsWith("calc(")) return { outlineWidth: value };
1303
+ return { outlineColor: value };
1304
+ }
1305
+ const widths = { "0": "0px", "1": "1px", "2": "2px", "4": "4px", "8": "8px" };
1306
+ if (value in widths) return { outlineWidth: widths[value] };
1307
+ const color = resolveColor(value, colors, false);
1308
+ return color ? { outlineColor: color } : null;
1309
+ },
1310
+ "outline-offset": ({ value, isArbitrary }) => {
1311
+ if (!getEffectiveIsWeb()) return null;
1312
+ if (isArbitrary) return { outlineOffset: value };
1313
+ const offsets = { "0": "0px", "1": "1px", "2": "2px", "4": "4px", "8": "8px" };
1314
+ return offsets[value] ? { outlineOffset: offsets[value] } : null;
1315
+ },
1316
+ // ── Divide (child combinator CSS, web-only) ───────────────────────────────
1317
+ // These return special __divide* markers that resolver.ts converts to
1318
+ // .cls > * + * { border-... } CSS rules. No inline style is applied.
1319
+ "divide-x": ({ value, isArbitrary }) => {
1320
+ if (!getEffectiveIsWeb()) return null;
1321
+ if (value === "reverse") return null;
1322
+ if (!value) return { __divideX: 1 };
1323
+ const n = parseFloat(value);
1324
+ return isNaN(n) ? null : { __divideX: n };
1325
+ },
1326
+ "divide-y": ({ value, isArbitrary }) => {
1327
+ if (!getEffectiveIsWeb()) return null;
1328
+ if (value === "reverse") return null;
1329
+ if (!value) return { __divideY: 1 };
1330
+ const n = parseFloat(value);
1331
+ return isNaN(n) ? null : { __divideY: n };
1332
+ },
1333
+ divide: ({ value, isArbitrary }, { colors }) => {
1334
+ if (!getEffectiveIsWeb()) return null;
1335
+ if (isArbitrary) return { __divideColor: value };
1336
+ const styleTokens = {
1337
+ solid: "solid",
1338
+ dashed: "dashed",
1339
+ dotted: "dotted",
1340
+ double: "double",
1341
+ none: "none"
1342
+ };
1343
+ if (value in styleTokens) return { __divideStyle: styleTokens[value] };
1344
+ const color = resolveColor(value, colors, false);
1345
+ return color ? { __divideColor: color } : null;
1346
+ },
1347
+ // ── Ring ───────────────────────────────────────────────────────────────────
1348
+ // Web: box-shadow outline ring (doesn't affect layout).
1349
+ // Native: React Native has no box-shadow, so this falls back to borderWidth/
1350
+ // borderColor — the closest visual approximation (used by other RN Tailwind-
1351
+ // likes for the same reason). Unlike the web ring, this DOES affect layout,
1352
+ // and it shares its properties with the `border` utility — combining
1353
+ // `border-*` and `ring-*` on the same native element means whichever class
1354
+ // comes later wins, since both ultimately set borderWidth/borderColor.
1355
+ ring: ({ value, isArbitrary }, { colors }) => {
1356
+ const onWeb = getEffectiveIsWeb();
1357
+ const DEFAULT_COLOR = "rgba(59, 130, 246, 0.5)";
1358
+ const DEFAULT_WIDTH = 3;
1359
+ const asNative = (w, color2) => w === 0 ? { borderWidth: 0 } : { borderWidth: w, borderColor: color2 };
1360
+ if (!value) {
1361
+ return onWeb ? { boxShadow: `0 0 0 ${DEFAULT_WIDTH}px ${DEFAULT_COLOR}` } : asNative(DEFAULT_WIDTH, DEFAULT_COLOR);
1362
+ }
1363
+ if (value === "inset") {
1364
+ return onWeb ? { boxShadow: `inset 0 0 0 ${DEFAULT_WIDTH}px ${DEFAULT_COLOR}` } : asNative(DEFAULT_WIDTH, DEFAULT_COLOR);
1365
+ }
1366
+ const widthTokens = { "0": 0, "1": 1, "2": 2, "4": 4, "8": 8 };
1367
+ if (!isArbitrary && value in widthTokens) {
1368
+ const w = widthTokens[value];
1369
+ return onWeb ? { boxShadow: w === 0 ? "none" : `0 0 0 ${w}px ${DEFAULT_COLOR}` } : asNative(w, DEFAULT_COLOR);
1370
+ }
1371
+ if (isArbitrary) {
1372
+ const numMatch = /^(\d+(?:\.\d+)?)(px|rem|em|vw|vh)?$/.exec(value);
1373
+ if (numMatch) {
1374
+ const unit = numMatch[2] ?? "px";
1375
+ if (onWeb) return { boxShadow: `0 0 0 ${numMatch[1]}${unit} ${DEFAULT_COLOR}` };
1376
+ return unit === "px" ? asNative(parseFloat(numMatch[1]), DEFAULT_COLOR) : null;
1377
+ }
1378
+ return onWeb ? { boxShadow: value.replace(/_/g, " ") } : null;
1379
+ }
1380
+ const color = resolveColor(value, colors, false);
1381
+ if (color) {
1382
+ return onWeb ? { boxShadow: `0 0 0 ${DEFAULT_WIDTH}px ${color}` } : asNative(DEFAULT_WIDTH, color);
1383
+ }
1384
+ return null;
1385
+ },
1386
+ // Web-only, unlike `ring` above: this stacks a second box-shadow layer to
1387
+ // create a gap between the element and the ring. There's no native
1388
+ // equivalent to approximate that with (a border can't create a gap outside
1389
+ // its own element without an extra wrapper view), so this stays a no-op
1390
+ // on native rather than rendering a misleading half-translation.
1391
+ "ring-offset": ({ value, isArbitrary }, _theme) => {
1392
+ if (!getEffectiveIsWeb()) return null;
1393
+ const DEFAULT_RING_COLOR = "rgba(59, 130, 246, 0.5)";
1394
+ const DEFAULT_RING_WIDTH = 3;
1395
+ const offsetTokens = { "0": 0, "1": 1, "2": 2, "4": 4, "8": 8 };
1396
+ let offsetWidth;
1397
+ if (!isArbitrary) {
1398
+ offsetWidth = value in offsetTokens ? offsetTokens[value] : null;
1399
+ } else {
1400
+ offsetWidth = /^-?\d+(\.\d+)?$/.test(value) ? parseFloat(value) : value;
1401
+ }
1402
+ if (offsetWidth === null || typeof offsetWidth === "number" && isNaN(offsetWidth)) return null;
1403
+ const isZero = offsetWidth === 0 || offsetWidth === "0";
1404
+ const offsetCss = typeof offsetWidth === "number" ? `${offsetWidth}px` : offsetWidth;
1405
+ return {
1406
+ boxShadow: isZero ? `0 0 0 ${DEFAULT_RING_WIDTH}px ${DEFAULT_RING_COLOR}` : `0 0 0 ${offsetCss} #fff, 0 0 0 calc(${offsetCss} + ${DEFAULT_RING_WIDTH}px) ${DEFAULT_RING_COLOR}`
1407
+ };
1408
+ }
1409
+ };
1410
+ for (const [utility, [widthProp, colorProp]] of Object.entries(BORDER_SIDE_PROPS)) {
1411
+ borderResolvers[utility] = makeBorderSideResolver(widthProp, colorProp);
1412
+ }
1413
+
1414
+ // src/core/resolvers/filters.ts
1415
+ var FILTER_COMPOSE = "var(--kb-blur,) var(--kb-brightness,) var(--kb-contrast,) var(--kb-grayscale,) var(--kb-hue-rotate,) var(--kb-invert,) var(--kb-saturate,) var(--kb-sepia,) var(--kb-drop-shadow,)";
1416
+ var BACKDROP_FILTER_COMPOSE = "var(--kb-backdrop-blur,) var(--kb-backdrop-brightness,) var(--kb-backdrop-contrast,) var(--kb-backdrop-grayscale,) var(--kb-backdrop-hue-rotate,) var(--kb-backdrop-invert,) var(--kb-backdrop-opacity,) var(--kb-backdrop-saturate,) var(--kb-backdrop-sepia,)";
1417
+ var filterResolvers = {
1418
+ // ── CSS Filters (composable via CSS variables, web-only) ─────────────────
1419
+ blur: ({ value, isArbitrary }) => {
1420
+ if (!getEffectiveIsWeb()) return null;
1421
+ const sizes = {
1422
+ "": "blur(8px)",
1423
+ sm: "blur(4px)",
1424
+ md: "blur(12px)",
1425
+ lg: "blur(16px)",
1426
+ xl: "blur(24px)",
1427
+ "2xl": "blur(40px)",
1428
+ "3xl": "blur(64px)"
1429
+ };
1430
+ if (value === "none") return { "--kb-blur": "", filter: FILTER_COMPOSE };
1431
+ const v = isArbitrary ? `blur(${value})` : sizes[value];
1432
+ return v !== void 0 ? { "--kb-blur": v, filter: FILTER_COMPOSE } : null;
1433
+ },
1434
+ brightness: ({ value, isArbitrary }) => {
1435
+ if (!getEffectiveIsWeb()) return null;
1436
+ const v = isArbitrary ? `brightness(${value})` : `brightness(${parseFloat(value) / 100})`;
1437
+ return isNaN(parseFloat(value)) && !isArbitrary ? null : { "--kb-brightness": v, filter: FILTER_COMPOSE };
1438
+ },
1439
+ contrast: ({ value, isArbitrary }) => {
1440
+ if (!getEffectiveIsWeb()) return null;
1441
+ const v = isArbitrary ? `contrast(${value})` : `contrast(${parseFloat(value) / 100})`;
1442
+ return isNaN(parseFloat(value)) && !isArbitrary ? null : { "--kb-contrast": v, filter: FILTER_COMPOSE };
1443
+ },
1444
+ grayscale: ({ value }) => {
1445
+ if (!getEffectiveIsWeb()) return null;
1446
+ const v = value === "0" ? "grayscale(0)" : "grayscale(100%)";
1447
+ return { "--kb-grayscale": v, filter: FILTER_COMPOSE };
1448
+ },
1449
+ "hue-rotate": ({ value, negative, isArbitrary }) => {
1450
+ if (!getEffectiveIsWeb()) return null;
1451
+ const deg = isArbitrary ? value : `${(negative ? -1 : 1) * parseFloat(value)}deg`;
1452
+ if (isNaN(parseFloat(deg)) && !isArbitrary) return null;
1453
+ return { "--kb-hue-rotate": `hue-rotate(${deg})`, filter: FILTER_COMPOSE };
1454
+ },
1455
+ invert: ({ value }) => {
1456
+ if (!getEffectiveIsWeb()) return null;
1457
+ const v = value === "0" ? "invert(0)" : "invert(100%)";
1458
+ return { "--kb-invert": v, filter: FILTER_COMPOSE };
1459
+ },
1460
+ saturate: ({ value, isArbitrary }) => {
1461
+ if (!getEffectiveIsWeb()) return null;
1462
+ const v = isArbitrary ? `saturate(${value})` : `saturate(${parseFloat(value) / 100})`;
1463
+ return isNaN(parseFloat(value)) && !isArbitrary ? null : { "--kb-saturate": v, filter: FILTER_COMPOSE };
1464
+ },
1465
+ sepia: ({ value }) => {
1466
+ if (!getEffectiveIsWeb()) return null;
1467
+ const v = value === "0" ? "sepia(0)" : "sepia(100%)";
1468
+ return { "--kb-sepia": v, filter: FILTER_COMPOSE };
1469
+ },
1470
+ "drop-shadow": ({ value, isArbitrary }) => {
1471
+ if (!getEffectiveIsWeb()) return null;
1472
+ if (isArbitrary) return { "--kb-drop-shadow": `drop-shadow(${value.replace(/_/g, " ")})`, filter: FILTER_COMPOSE };
1473
+ const presets = {
1474
+ "": "drop-shadow(0 1px 2px rgb(0 0 0/0.1)) drop-shadow(0 1px 1px rgb(0 0 0/0.06))",
1475
+ sm: "drop-shadow(0 1px 1px rgb(0 0 0/0.05))",
1476
+ md: "drop-shadow(0 4px 3px rgb(0 0 0/0.07)) drop-shadow(0 2px 2px rgb(0 0 0/0.06))",
1477
+ lg: "drop-shadow(0 10px 8px rgb(0 0 0/0.04)) drop-shadow(0 4px 3px rgb(0 0 0/0.1))",
1478
+ xl: "drop-shadow(0 20px 13px rgb(0 0 0/0.03)) drop-shadow(0 8px 5px rgb(0 0 0/0.08))",
1479
+ "2xl": "drop-shadow(0 25px 25px rgb(0 0 0/0.15))",
1480
+ none: "drop-shadow(0 0 #0000)"
1481
+ };
1482
+ const v = presets[value];
1483
+ return v !== void 0 ? { "--kb-drop-shadow": v, filter: FILTER_COMPOSE } : null;
1484
+ },
1485
+ // Arbitrary full filter string: filter-[blur(4px)_grayscale(1)]
1486
+ filter: ({ value, isArbitrary }) => {
1487
+ if (!getEffectiveIsWeb()) return null;
1488
+ if (isArbitrary) return { filter: value.replace(/_/g, " ") };
1489
+ if (value === "none") return { filter: "none" };
1490
+ return null;
1491
+ },
1492
+ // ── Backdrop Filters (composable via CSS variables, web-only) ────────────
1493
+ "backdrop-blur": ({ value, isArbitrary }) => {
1494
+ if (!getEffectiveIsWeb()) return null;
1495
+ const sizes = {
1496
+ "": "blur(8px)",
1497
+ sm: "blur(4px)",
1498
+ md: "blur(12px)",
1499
+ lg: "blur(16px)",
1500
+ xl: "blur(24px)",
1501
+ "2xl": "blur(40px)",
1502
+ "3xl": "blur(64px)"
1503
+ };
1504
+ if (value === "none") return { "--kb-backdrop-blur": "", backdropFilter: BACKDROP_FILTER_COMPOSE };
1505
+ const v = isArbitrary ? `blur(${value})` : sizes[value];
1506
+ return v !== void 0 ? { "--kb-backdrop-blur": v, backdropFilter: BACKDROP_FILTER_COMPOSE } : null;
1507
+ },
1508
+ "backdrop-brightness": ({ value, isArbitrary }) => {
1509
+ if (!getEffectiveIsWeb()) return null;
1510
+ const v = isArbitrary ? `brightness(${value})` : `brightness(${parseFloat(value) / 100})`;
1511
+ return isNaN(parseFloat(value)) && !isArbitrary ? null : { "--kb-backdrop-brightness": v, backdropFilter: BACKDROP_FILTER_COMPOSE };
1512
+ },
1513
+ "backdrop-contrast": ({ value, isArbitrary }) => {
1514
+ if (!getEffectiveIsWeb()) return null;
1515
+ const v = isArbitrary ? `contrast(${value})` : `contrast(${parseFloat(value) / 100})`;
1516
+ return isNaN(parseFloat(value)) && !isArbitrary ? null : { "--kb-backdrop-contrast": v, backdropFilter: BACKDROP_FILTER_COMPOSE };
1517
+ },
1518
+ "backdrop-grayscale": ({ value }) => {
1519
+ if (!getEffectiveIsWeb()) return null;
1520
+ return { "--kb-backdrop-grayscale": value === "0" ? "grayscale(0)" : "grayscale(100%)", backdropFilter: BACKDROP_FILTER_COMPOSE };
1521
+ },
1522
+ "backdrop-hue-rotate": ({ value, negative, isArbitrary }) => {
1523
+ if (!getEffectiveIsWeb()) return null;
1524
+ const deg = isArbitrary ? value : `${(negative ? -1 : 1) * parseFloat(value)}deg`;
1525
+ if (isNaN(parseFloat(deg)) && !isArbitrary) return null;
1526
+ return { "--kb-backdrop-hue-rotate": `hue-rotate(${deg})`, backdropFilter: BACKDROP_FILTER_COMPOSE };
1527
+ },
1528
+ "backdrop-invert": ({ value }) => {
1529
+ if (!getEffectiveIsWeb()) return null;
1530
+ return { "--kb-backdrop-invert": value === "0" ? "invert(0)" : "invert(100%)", backdropFilter: BACKDROP_FILTER_COMPOSE };
1531
+ },
1532
+ "backdrop-opacity": ({ value, isArbitrary }) => {
1533
+ if (!getEffectiveIsWeb()) return null;
1534
+ const v = isArbitrary ? `opacity(${value})` : `opacity(${parseFloat(value) / 100})`;
1535
+ return isNaN(parseFloat(value)) && !isArbitrary ? null : { "--kb-backdrop-opacity": v, backdropFilter: BACKDROP_FILTER_COMPOSE };
1536
+ },
1537
+ "backdrop-saturate": ({ value, isArbitrary }) => {
1538
+ if (!getEffectiveIsWeb()) return null;
1539
+ const v = isArbitrary ? `saturate(${value})` : `saturate(${parseFloat(value) / 100})`;
1540
+ return isNaN(parseFloat(value)) && !isArbitrary ? null : { "--kb-backdrop-saturate": v, backdropFilter: BACKDROP_FILTER_COMPOSE };
1541
+ },
1542
+ "backdrop-sepia": ({ value }) => {
1543
+ if (!getEffectiveIsWeb()) return null;
1544
+ return { "--kb-backdrop-sepia": value === "0" ? "sepia(0)" : "sepia(100%)", backdropFilter: BACKDROP_FILTER_COMPOSE };
1545
+ },
1546
+ "backdrop-filter": ({ value, isArbitrary }) => {
1547
+ if (!getEffectiveIsWeb()) return null;
1548
+ if (isArbitrary) return { backdropFilter: value.replace(/_/g, " ") };
1549
+ if (value === "none") return { backdropFilter: "none" };
1550
+ return null;
1551
+ },
1552
+ // ── Mix / background blend mode (web-only) ───────────────────────────────
1553
+ "mix-blend": ({ value }) => {
1554
+ if (!getEffectiveIsWeb()) return null;
1555
+ const modes = [
1556
+ "normal",
1557
+ "multiply",
1558
+ "screen",
1559
+ "overlay",
1560
+ "darken",
1561
+ "lighten",
1562
+ "color-dodge",
1563
+ "color-burn",
1564
+ "hard-light",
1565
+ "soft-light",
1566
+ "difference",
1567
+ "exclusion",
1568
+ "hue",
1569
+ "saturation",
1570
+ "color",
1571
+ "luminosity",
1572
+ "plus-lighter"
1573
+ ];
1574
+ return modes.includes(value) ? { mixBlendMode: value } : null;
1575
+ },
1576
+ "bg-blend": ({ value }) => {
1577
+ if (!getEffectiveIsWeb()) return null;
1578
+ const modes = [
1579
+ "normal",
1580
+ "multiply",
1581
+ "screen",
1582
+ "overlay",
1583
+ "darken",
1584
+ "lighten",
1585
+ "color-dodge",
1586
+ "color-burn",
1587
+ "hard-light",
1588
+ "soft-light",
1589
+ "difference",
1590
+ "exclusion",
1591
+ "hue",
1592
+ "saturation",
1593
+ "color",
1594
+ "luminosity"
1595
+ ];
1596
+ return modes.includes(value) ? { backgroundBlendMode: value } : null;
1597
+ },
1598
+ // ── Will-change (web-only) ─────────────────────────────────────────────────
1599
+ "will-change": ({ value, isArbitrary }) => {
1600
+ if (!getEffectiveIsWeb()) return null;
1601
+ if (isArbitrary) return { willChange: value.replace(/_/g, ", ") };
1602
+ const presets = {
1603
+ auto: "auto",
1604
+ scroll: "scroll-position",
1605
+ contents: "contents",
1606
+ transform: "transform"
1607
+ };
1608
+ return presets[value] ? { willChange: presets[value] } : null;
1609
+ }
1610
+ };
1611
+
1612
+ // src/core/resolvers/layout.ts
1613
+ var _standalone = null;
1614
+ function buildStandalone() {
1615
+ const web = getEffectiveIsWeb();
1616
+ return {
1617
+ // Display
1618
+ // React Native only supports display:'flex'|'none'. Setting 'flex' explicitly is
1619
+ // a no-op normally, but is needed to re-show an element that was hidden via `hidden`.
1620
+ // `grid`, `contents`, `flow-root` have no native equivalent and stay null there.
1621
+ // The inline-* family (inline, inline-block, inline-flex, inline-grid) falls back
1622
+ // to 'flex' on native instead — like plain `flex`, this is a no-op most of the
1623
+ // time, but without it these utilities couldn't re-show a `hidden` element on
1624
+ // native either (null → no style applied → still display:'none').
1625
+ flex: { display: "flex" },
1626
+ block: web ? { display: "block" } : null,
1627
+ "inline-block": { display: web ? "inline-block" : "flex" },
1628
+ inline: { display: web ? "inline" : "flex" },
1629
+ grid: web ? { display: "grid" } : null,
1630
+ grd: web ? { display: "grid" } : null,
1631
+ "inline-flex": { display: web ? "inline-flex" : "flex" },
1632
+ "inline-grid": { display: web ? "inline-grid" : "flex" },
1633
+ hidden: { display: "none" },
1634
+ contents: web ? { display: "contents" } : null,
1635
+ "flow-root": web ? { display: "flow-root" } : null,
1636
+ // Flex direction (both web and native)
1637
+ "flex-row": { flexDirection: "row" },
1638
+ "flex-col": { flexDirection: "column" },
1639
+ "flex-row-reverse": { flexDirection: "row-reverse" },
1640
+ "flex-col-reverse": { flexDirection: "column-reverse" },
1641
+ // Flex wrap (both)
1642
+ "flex-wrap": { flexWrap: "wrap" },
1643
+ "flex-wrap-reverse": { flexWrap: "wrap-reverse" },
1644
+ "flex-nowrap": { flexWrap: "nowrap" },
1645
+ // Flex grow / shrink (both)
1646
+ "flex-grow": { flexGrow: 1 },
1647
+ "flex-grow-0": { flexGrow: 0 },
1648
+ "flex-shrink": { flexShrink: 1 },
1649
+ "flex-shrink-0": { flexShrink: 0 },
1650
+ // Align items (both)
1651
+ "items-start": { alignItems: "flex-start" },
1652
+ "items-end": { alignItems: "flex-end" },
1653
+ "items-center": { alignItems: "center" },
1654
+ "items-baseline": { alignItems: "baseline" },
1655
+ "items-stretch": { alignItems: "stretch" },
1656
+ // Justify content (both)
1657
+ "justify-start": { justifyContent: "flex-start" },
1658
+ "justify-end": { justifyContent: "flex-end" },
1659
+ "justify-center": { justifyContent: "center" },
1660
+ "justify-between": { justifyContent: "space-between" },
1661
+ "justify-around": { justifyContent: "space-around" },
1662
+ "justify-evenly": { justifyContent: "space-evenly" },
1663
+ // Align content (both)
1664
+ "content-start": { alignContent: "flex-start" },
1665
+ "content-end": { alignContent: "flex-end" },
1666
+ "content-center": { alignContent: "center" },
1667
+ "content-between": { alignContent: "space-between" },
1668
+ "content-around": { alignContent: "space-around" },
1669
+ "content-evenly": { alignContent: "space-evenly" },
1670
+ "content-stretch": { alignContent: "stretch" },
1671
+ // Align self (both)
1672
+ "self-auto": { alignSelf: "auto" },
1673
+ "self-start": { alignSelf: "flex-start" },
1674
+ "self-end": { alignSelf: "flex-end" },
1675
+ "self-center": { alignSelf: "center" },
1676
+ "self-stretch": { alignSelf: "stretch" },
1677
+ "self-baseline": { alignSelf: "baseline" },
1678
+ // Text align (both)
1679
+ "text-left": { textAlign: "left" },
1680
+ "text-right": { textAlign: "right" },
1681
+ "text-center": { textAlign: "center" },
1682
+ "text-justify": { textAlign: "justify" },
1683
+ // Font weight shortcuts (both)
1684
+ "font-thin": { fontWeight: "100" },
1685
+ "font-extralight": { fontWeight: "200" },
1686
+ "font-light": { fontWeight: "300" },
1687
+ "font-normal": { fontWeight: "400" },
1688
+ "font-medium": { fontWeight: "500" },
1689
+ "font-semibold": { fontWeight: "600" },
1690
+ "font-bold": { fontWeight: "700" },
1691
+ "font-extrabold": { fontWeight: "800" },
1692
+ "font-black": { fontWeight: "900" },
1693
+ // Text decoration (overline is web-only)
1694
+ underline: { textDecorationLine: "underline" },
1695
+ overline: web ? { textDecorationLine: "overline" } : null,
1696
+ "line-through": { textDecorationLine: "line-through" },
1697
+ "no-underline": { textDecorationLine: "none" },
1698
+ // Text transform (both)
1699
+ uppercase: { textTransform: "uppercase" },
1700
+ lowercase: { textTransform: "lowercase" },
1701
+ capitalize: { textTransform: "capitalize" },
1702
+ "normal-case": { textTransform: "none" },
1703
+ // Font style (both)
1704
+ italic: { fontStyle: "italic" },
1705
+ "non-italic": { fontStyle: "normal" },
1706
+ // Position (fixed/sticky/static are web-only; RN only supports relative/absolute)
1707
+ relative: { position: "relative" },
1708
+ absolute: { position: "absolute" },
1709
+ fixed: web ? { position: "fixed" } : null,
1710
+ sticky: web ? { position: "sticky" } : null,
1711
+ static: web ? { position: "static" } : null,
1712
+ // Visibility (no `visibility` prop on native; use opacity instead)
1713
+ visible: web ? { visibility: "visible" } : null,
1714
+ invisible: web ? { visibility: "hidden" } : { opacity: 0 },
1715
+ // Overflow (RN supports 'hidden' | 'visible' | 'scroll'; not 'auto')
1716
+ "overflow-hidden": { overflow: "hidden" },
1717
+ "overflow-visible": { overflow: "visible" },
1718
+ "overflow-scroll": { overflow: "scroll" },
1719
+ "overflow-auto": web ? { overflow: "auto" } : { overflow: "scroll" },
1720
+ // overflowX / overflowY are web-only
1721
+ "overflow-x-hidden": web ? { overflowX: "hidden" } : null,
1722
+ "overflow-x-scroll": web ? { overflowX: "scroll" } : null,
1723
+ "overflow-x-auto": web ? { overflowX: "auto" } : null,
1724
+ "overflow-y-hidden": web ? { overflowY: "hidden" } : null,
1725
+ "overflow-y-scroll": web ? { overflowY: "scroll" } : null,
1726
+ "overflow-y-auto": web ? { overflowY: "auto" } : null,
1727
+ // Object fit (web-only; use resizeMode prop on RN Image)
1728
+ "object-contain": web ? { objectFit: "contain" } : null,
1729
+ "object-cover": web ? { objectFit: "cover" } : null,
1730
+ "object-fill": web ? { objectFit: "fill" } : null,
1731
+ "object-none": web ? { objectFit: "none" } : null,
1732
+ "object-scale-down": web ? { objectFit: "scale-down" } : null,
1733
+ // Border style (both)
1734
+ "border-solid": { borderStyle: "solid" },
1735
+ "border-dashed": { borderStyle: "dashed" },
1736
+ "border-dotted": { borderStyle: "dotted" },
1737
+ "border-none": { borderWidth: 0 },
1738
+ // Border sides default width (both)
1739
+ "border-t": { borderTopWidth: 1 },
1740
+ "border-r": { borderRightWidth: 1 },
1741
+ "border-b": { borderBottomWidth: 1 },
1742
+ "border-l": { borderLeftWidth: 1 },
1743
+ // Cursor (web-only)
1744
+ "cursor-auto": web ? { cursor: "auto" } : null,
1745
+ "cursor-default": web ? { cursor: "default" } : null,
1746
+ "cursor-pointer": web ? { cursor: "pointer" } : null,
1747
+ "cursor-wait": web ? { cursor: "wait" } : null,
1748
+ "cursor-text": web ? { cursor: "text" } : null,
1749
+ "cursor-move": web ? { cursor: "move" } : null,
1750
+ "cursor-not-allowed": web ? { cursor: "not-allowed" } : null,
1751
+ // User select (web-only)
1752
+ "select-none": web ? { userSelect: "none" } : null,
1753
+ "select-text": web ? { userSelect: "text" } : null,
1754
+ "select-all": web ? { userSelect: "all" } : null,
1755
+ "select-auto": web ? { userSelect: "auto" } : null,
1756
+ // Pointer events (both)
1757
+ "pointer-events-none": { pointerEvents: "none" },
1758
+ "pointer-events-auto": { pointerEvents: "auto" },
1759
+ // Whitespace (web-only; RN Text uses numberOfLines prop instead)
1760
+ "whitespace-normal": web ? { whiteSpace: "normal" } : null,
1761
+ "whitespace-nowrap": web ? { whiteSpace: "nowrap" } : null,
1762
+ "whitespace-pre": web ? { whiteSpace: "pre" } : null,
1763
+ "whitespace-pre-wrap": web ? { whiteSpace: "pre-wrap" } : null,
1764
+ "whitespace-pre-line": web ? { whiteSpace: "pre-line" } : null,
1765
+ // Word break (web-only)
1766
+ "break-normal": web ? { overflowWrap: "normal", wordBreak: "normal" } : null,
1767
+ "break-words": web ? { overflowWrap: "break-word" } : null,
1768
+ "break-all": web ? { wordBreak: "break-all" } : null,
1769
+ // Misc web-only
1770
+ truncate: web ? { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } : null,
1771
+ "box-border": web ? { boxSizing: "border-box" } : null,
1772
+ "box-content": web ? { boxSizing: "content-box" } : null,
1773
+ "appearance-none": web ? { appearance: "none" } : null,
1774
+ "outline-none": web ? { outline: "none", outlineOffset: "0" } : null,
1775
+ outline: web ? { outline: "2px solid transparent", outlineOffset: "2px" } : null,
1776
+ resize: web ? { resize: "both" } : null,
1777
+ "resize-none": web ? { resize: "none" } : null,
1778
+ "resize-y": web ? { resize: "vertical" } : null,
1779
+ "resize-x": web ? { resize: "horizontal" } : null,
1780
+ antialiased: web ? { WebkitFontSmoothing: "antialiased", MozOsxFontSmoothing: "grayscale" } : null,
1781
+ "subpixel-antialiased": web ? { WebkitFontSmoothing: "subpixel-antialiased", MozOsxFontSmoothing: "auto" } : null,
1782
+ "overflow-ellipsis": web ? { textOverflow: "ellipsis" } : null,
1783
+ "sr-only": web ? {
1784
+ position: "absolute",
1785
+ width: 1,
1786
+ height: 1,
1787
+ padding: 0,
1788
+ margin: -1,
1789
+ overflow: "hidden",
1790
+ clip: "rect(0,0,0,0)",
1791
+ whiteSpace: "nowrap",
1792
+ border: 0
1793
+ } : null,
1794
+ "not-sr-only": web ? {
1795
+ position: "static",
1796
+ width: "auto",
1797
+ height: "auto",
1798
+ padding: 0,
1799
+ margin: 0,
1800
+ overflow: "visible",
1801
+ clip: "auto",
1802
+ whiteSpace: "normal"
1803
+ } : null,
1804
+ // Lists (web-only)
1805
+ "list-none": web ? { listStyleType: "none" } : null,
1806
+ "list-disc": web ? { listStyleType: "disc" } : null,
1807
+ "list-decimal": web ? { listStyleType: "decimal" } : null,
1808
+ // Background clip (web-only)
1809
+ "bg-clip-border": web ? { backgroundClip: "border-box" } : null,
1810
+ "bg-clip-padding": web ? { backgroundClip: "padding-box" } : null,
1811
+ "bg-clip-content": web ? { backgroundClip: "content-box" } : null,
1812
+ "bg-clip-text": web ? { backgroundClip: "text", WebkitBackgroundClip: "text" } : null,
1813
+ // Background image
1814
+ "bg-none": web ? { backgroundImage: "none" } : null,
1815
+ // Background size (web-only)
1816
+ "bg-auto": web ? { backgroundSize: "auto" } : null,
1817
+ "bg-cover": web ? { backgroundSize: "cover" } : null,
1818
+ "bg-contain": web ? { backgroundSize: "contain" } : null,
1819
+ // Background position (web-only)
1820
+ "bg-center": web ? { backgroundPosition: "center" } : null,
1821
+ "bg-top": web ? { backgroundPosition: "top" } : null,
1822
+ "bg-bottom": web ? { backgroundPosition: "bottom" } : null,
1823
+ "bg-left": web ? { backgroundPosition: "left" } : null,
1824
+ "bg-right": web ? { backgroundPosition: "right" } : null,
1825
+ "bg-left-top": web ? { backgroundPosition: "left top" } : null,
1826
+ "bg-left-bottom": web ? { backgroundPosition: "left bottom" } : null,
1827
+ "bg-right-top": web ? { backgroundPosition: "right top" } : null,
1828
+ "bg-right-bottom": web ? { backgroundPosition: "right bottom" } : null,
1829
+ // Background repeat (web-only)
1830
+ "bg-repeat": web ? { backgroundRepeat: "repeat" } : null,
1831
+ "bg-no-repeat": web ? { backgroundRepeat: "no-repeat" } : null,
1832
+ "bg-repeat-x": web ? { backgroundRepeat: "repeat-x" } : null,
1833
+ "bg-repeat-y": web ? { backgroundRepeat: "repeat-y" } : null,
1834
+ "bg-repeat-round": web ? { backgroundRepeat: "round" } : null,
1835
+ "bg-repeat-space": web ? { backgroundRepeat: "space" } : null,
1836
+ // Background attachment (web-only)
1837
+ "bg-fixed": web ? { backgroundAttachment: "fixed" } : null,
1838
+ "bg-local": web ? { backgroundAttachment: "local" } : null,
1839
+ "bg-scroll": web ? { backgroundAttachment: "scroll" } : null,
1840
+ // Object position (web-only)
1841
+ "object-center": web ? { objectPosition: "center" } : null,
1842
+ "object-top": web ? { objectPosition: "top" } : null,
1843
+ "object-bottom": web ? { objectPosition: "bottom" } : null,
1844
+ "object-left": web ? { objectPosition: "left" } : null,
1845
+ "object-right": web ? { objectPosition: "right" } : null,
1846
+ "object-left-top": web ? { objectPosition: "left top" } : null,
1847
+ "object-left-bottom": web ? { objectPosition: "left bottom" } : null,
1848
+ "object-right-top": web ? { objectPosition: "right top" } : null,
1849
+ "object-right-bottom": web ? { objectPosition: "right bottom" } : null,
1850
+ // Table (web-only)
1851
+ table: web ? { display: "table" } : null,
1852
+ "table-auto": web ? { tableLayout: "auto" } : null,
1853
+ "table-fixed": web ? { tableLayout: "fixed" } : null,
1854
+ "caption-top": web ? { captionSide: "top" } : null,
1855
+ "caption-bottom": web ? { captionSide: "bottom" } : null,
1856
+ "border-collapse": web ? { borderCollapse: "collapse" } : null,
1857
+ "border-separate": web ? { borderCollapse: "separate" } : null,
1858
+ // List style position (web-only)
1859
+ "list-inside": web ? { listStylePosition: "inside" } : null,
1860
+ "list-outside": web ? { listStylePosition: "outside" } : null,
1861
+ // Font variant numeric (web-only)
1862
+ "normal-nums": web ? { fontVariantNumeric: "normal" } : null,
1863
+ ordinal: web ? { fontVariantNumeric: "ordinal" } : null,
1864
+ "slashed-zero": web ? { fontVariantNumeric: "slashed-zero" } : null,
1865
+ "lining-nums": web ? { fontVariantNumeric: "lining-nums" } : null,
1866
+ "oldstyle-nums": web ? { fontVariantNumeric: "oldstyle-nums" } : null,
1867
+ "proportional-nums": web ? { fontVariantNumeric: "proportional-nums" } : null,
1868
+ "tabular-nums": web ? { fontVariantNumeric: "tabular-nums" } : null,
1869
+ "diagonal-fractions": web ? { fontVariantNumeric: "diagonal-fractions" } : null,
1870
+ "stacked-fractions": web ? { fontVariantNumeric: "stacked-fractions" } : null,
1871
+ // Isolation (web-only)
1872
+ isolate: web ? { isolation: "isolate" } : null,
1873
+ "isolation-auto": web ? { isolation: "auto" } : null,
1874
+ // Backface visibility (both iOS and Android)
1875
+ "backface-visible": { backfaceVisibility: "visible" },
1876
+ "backface-hidden": { backfaceVisibility: "hidden" },
1877
+ // CSS filters — standalone = default/full effect (web-only)
1878
+ grayscale: web ? { "--kb-grayscale": "grayscale(100%)", filter: FILTER_COMPOSE } : null,
1879
+ invert: web ? { "--kb-invert": "invert(100%)", filter: FILTER_COMPOSE } : null,
1880
+ sepia: web ? { "--kb-sepia": "sepia(100%)", filter: FILTER_COMPOSE } : null,
1881
+ // Divide none
1882
+ "divide-none": web ? { __divideX: 0, __divideY: 0 } : null,
1883
+ // Group / peer markers (no-op: no style emitted; just ensures isKnownUtility returns true)
1884
+ group: web ? {} : null,
1885
+ peer: web ? {} : null,
1886
+ // Text-wrap (web-only)
1887
+ "text-wrap": web ? { textWrap: "wrap" } : null,
1888
+ "text-nowrap": web ? { textWrap: "nowrap" } : null,
1889
+ "text-balance": web ? { textWrap: "balance" } : null,
1890
+ "text-pretty": web ? { textWrap: "pretty" } : null,
1891
+ // Screen sizing — dvw/dvh (dynamic viewport units) instead of vw/vh: on mobile
1892
+ // browsers, vh/vw are pinned to the LARGEST viewport size (address bar hidden),
1893
+ // so `h-screen` overflows behind the address bar when it's shown. dvh/dvw track
1894
+ // the actual visible viewport as browser chrome shows/hides. Desktop behavior
1895
+ // is unchanged since there's no dynamic chrome to account for.
1896
+ // (vw/dvw values are web-only; vh/dvh values work cross-platform via spacing scale for h-*)
1897
+ "w-screen": web ? { width: "100dvw" } : null,
1898
+ "min-h-screen": { minHeight: "100dvh" },
1899
+ "max-h-screen": { maxHeight: "100dvh" },
1900
+ "min-w-screen": web ? { minWidth: "100dvw" } : null,
1901
+ "max-w-screen": web ? { maxWidth: "100dvw" } : null,
1902
+ // max-w named container sizes (mirrors Tailwind's container scale)
1903
+ "max-w-none": { maxWidth: "none" },
1904
+ "max-w-xs": { maxWidth: 320 },
1905
+ "max-w-sm": { maxWidth: 384 },
1906
+ "max-w-md": { maxWidth: 448 },
1907
+ "max-w-lg": { maxWidth: 512 },
1908
+ "max-w-xl": { maxWidth: 576 },
1909
+ "max-w-2xl": { maxWidth: 672 },
1910
+ "max-w-3xl": { maxWidth: 768 },
1911
+ "max-w-4xl": { maxWidth: 896 },
1912
+ "max-w-5xl": { maxWidth: 1024 },
1913
+ "max-w-6xl": { maxWidth: 1152 },
1914
+ "max-w-7xl": { maxWidth: 1280 },
1915
+ "max-w-prose": web ? { maxWidth: "65ch" } : null,
1916
+ // Extended cursors (web-only)
1917
+ "cursor-grab": web ? { cursor: "grab" } : null,
1918
+ "cursor-grabbing": web ? { cursor: "grabbing" } : null,
1919
+ "cursor-zoom-in": web ? { cursor: "zoom-in" } : null,
1920
+ "cursor-zoom-out": web ? { cursor: "zoom-out" } : null,
1921
+ "cursor-crosshair": web ? { cursor: "crosshair" } : null,
1922
+ "cursor-help": web ? { cursor: "help" } : null,
1923
+ "cursor-none": web ? { cursor: "none" } : null,
1924
+ // Overflow clip (web-only)
1925
+ "overflow-clip": web ? { overflow: "clip" } : null,
1926
+ "overflow-x-clip": web ? { overflowX: "clip" } : null,
1927
+ "overflow-y-clip": web ? { overflowY: "clip" } : null,
1928
+ // Scroll behavior (web-only)
1929
+ "scroll-smooth": web ? { scrollBehavior: "smooth" } : null,
1930
+ "scroll-auto": web ? { scrollBehavior: "auto" } : null,
1931
+ // Float (web-only)
1932
+ "float-left": web ? { float: "left" } : null,
1933
+ "float-right": web ? { float: "right" } : null,
1934
+ "float-start": web ? { float: "inline-start" } : null,
1935
+ "float-end": web ? { float: "inline-end" } : null,
1936
+ "float-none": web ? { float: "none" } : null,
1937
+ // Clear (web-only)
1938
+ "clear-left": web ? { clear: "left" } : null,
1939
+ "clear-right": web ? { clear: "right" } : null,
1940
+ "clear-both": web ? { clear: "both" } : null,
1941
+ "clear-start": web ? { clear: "inline-start" } : null,
1942
+ "clear-end": web ? { clear: "inline-end" } : null,
1943
+ "clear-none": web ? { clear: "none" } : null,
1944
+ // Vertical align (web-only)
1945
+ "align-baseline": web ? { verticalAlign: "baseline" } : null,
1946
+ "align-top": web ? { verticalAlign: "top" } : null,
1947
+ "align-middle": web ? { verticalAlign: "middle" } : null,
1948
+ "align-bottom": web ? { verticalAlign: "bottom" } : null,
1949
+ "align-text-top": web ? { verticalAlign: "text-top" } : null,
1950
+ "align-text-bottom": web ? { verticalAlign: "text-bottom" } : null,
1951
+ "align-sub": web ? { verticalAlign: "sub" } : null,
1952
+ "align-super": web ? { verticalAlign: "super" } : null,
1953
+ // Touch action (web-only)
1954
+ "touch-auto": web ? { touchAction: "auto" } : null,
1955
+ "touch-none": web ? { touchAction: "none" } : null,
1956
+ "touch-pan-x": web ? { touchAction: "pan-x" } : null,
1957
+ "touch-pan-y": web ? { touchAction: "pan-y" } : null,
1958
+ "touch-pan-left": web ? { touchAction: "pan-left" } : null,
1959
+ "touch-pan-right": web ? { touchAction: "pan-right" } : null,
1960
+ "touch-pan-up": web ? { touchAction: "pan-up" } : null,
1961
+ "touch-pan-down": web ? { touchAction: "pan-down" } : null,
1962
+ "touch-pinch-zoom": web ? { touchAction: "pinch-zoom" } : null,
1963
+ "touch-manipulation": web ? { touchAction: "manipulation" } : null
1964
+ };
1965
+ }
1966
+ function getStandalone() {
1967
+ if (!_standalone) _standalone = buildStandalone();
1968
+ return _standalone;
1969
+ }
1970
+ var layoutResolvers = {
1971
+ // ── Grid (responsive column count: grid-1 … grid-12, or arbitrary) ───────
1972
+ grid: ({ value, isArbitrary }) => {
1973
+ if (!value) return null;
1974
+ if (isArbitrary) return { display: "grid", gridTemplateColumns: value };
1975
+ const n = parseInt(value, 10);
1976
+ if (isNaN(n) || n < 1 || n > 12) return null;
1977
+ return { display: "grid", gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` };
1978
+ },
1979
+ // ── Grid template columns/rows (Tailwind-style aliases, web-only) ──────────
1980
+ "grid-cols": ({ value, isArbitrary }) => {
1981
+ if (!getEffectiveIsWeb()) return null;
1982
+ if (!value) return null;
1983
+ if (isArbitrary) return { display: "grid", gridTemplateColumns: value };
1984
+ if (value === "none") return { display: "grid", gridTemplateColumns: "none" };
1985
+ const n = parseInt(value, 10);
1986
+ if (isNaN(n) || n < 1 || n > 12) return null;
1987
+ return { display: "grid", gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` };
1988
+ },
1989
+ "grid-rows": ({ value, isArbitrary }) => {
1990
+ if (!getEffectiveIsWeb()) return null;
1991
+ if (!value) return null;
1992
+ if (isArbitrary) return { gridTemplateRows: value };
1993
+ if (value === "none") return { gridTemplateRows: "none" };
1994
+ const n = parseInt(value, 10);
1995
+ if (isNaN(n) || n < 1) return null;
1996
+ return { gridTemplateRows: `repeat(${n}, minmax(0, 1fr))` };
1997
+ },
1998
+ // ── Grid auto flow (web-only) ─────────────────────────────────────────────
1999
+ "grid-flow": ({ value }) => {
2000
+ if (!getEffectiveIsWeb()) return null;
2001
+ const flows = {
2002
+ row: "row",
2003
+ col: "column",
2004
+ dense: "dense",
2005
+ "row-dense": "row dense",
2006
+ "col-dense": "column dense"
2007
+ };
2008
+ const flow = flows[value];
2009
+ return flow ? { gridAutoFlow: flow } : null;
2010
+ },
2011
+ // ── Grid auto sizing (web-only) ───────────────────────────────────────────
2012
+ "auto-cols": ({ value, isArbitrary }) => {
2013
+ if (!getEffectiveIsWeb()) return null;
2014
+ if (isArbitrary) return { gridAutoColumns: value };
2015
+ const presets = {
2016
+ auto: "auto",
2017
+ min: "min-content",
2018
+ max: "max-content",
2019
+ fr: "minmax(0, 1fr)"
2020
+ };
2021
+ const v = presets[value];
2022
+ return v ? { gridAutoColumns: v } : null;
2023
+ },
2024
+ "auto-rows": ({ value, isArbitrary }) => {
2025
+ if (!getEffectiveIsWeb()) return null;
2026
+ if (isArbitrary) return { gridAutoRows: value };
2027
+ const presets = {
2028
+ auto: "auto",
2029
+ min: "min-content",
2030
+ max: "max-content",
2031
+ fr: "minmax(0, 1fr)"
2032
+ };
2033
+ const v = presets[value];
2034
+ return v ? { gridAutoRows: v } : null;
2035
+ },
2036
+ // ── Grid column placement (web-only) ──────────────────────────────────────
2037
+ "col-span": ({ value }) => {
2038
+ if (!getEffectiveIsWeb()) return null;
2039
+ if (value === "full") return { gridColumn: "1 / -1" };
2040
+ const n = parseInt(value, 10);
2041
+ return isNaN(n) ? null : { gridColumn: `span ${n} / span ${n}` };
2042
+ },
2043
+ "col-start": ({ value, isArbitrary }) => {
2044
+ if (!getEffectiveIsWeb()) return null;
2045
+ if (value === "auto") return { gridColumnStart: "auto" };
2046
+ if (isArbitrary) return { gridColumnStart: value };
2047
+ const n = parseInt(value, 10);
2048
+ return isNaN(n) ? null : { gridColumnStart: n };
2049
+ },
2050
+ "col-end": ({ value, isArbitrary }) => {
2051
+ if (!getEffectiveIsWeb()) return null;
2052
+ if (value === "auto") return { gridColumnEnd: "auto" };
2053
+ if (isArbitrary) return { gridColumnEnd: value };
2054
+ const n = parseInt(value, 10);
2055
+ return isNaN(n) ? null : { gridColumnEnd: n };
2056
+ },
2057
+ col: ({ value, isArbitrary }) => {
2058
+ if (!getEffectiveIsWeb()) return null;
2059
+ if (!value || value === "auto") return { gridColumn: "auto" };
2060
+ if (isArbitrary) return { gridColumn: value };
2061
+ return null;
2062
+ },
2063
+ // ── Grid row placement (web-only) ─────────────────────────────────────────
2064
+ "row-span": ({ value }) => {
2065
+ if (!getEffectiveIsWeb()) return null;
2066
+ if (value === "full") return { gridRow: "1 / -1" };
2067
+ const n = parseInt(value, 10);
2068
+ return isNaN(n) ? null : { gridRow: `span ${n} / span ${n}` };
2069
+ },
2070
+ "row-start": ({ value, isArbitrary }) => {
2071
+ if (!getEffectiveIsWeb()) return null;
2072
+ if (value === "auto") return { gridRowStart: "auto" };
2073
+ if (isArbitrary) return { gridRowStart: value };
2074
+ const n = parseInt(value, 10);
2075
+ return isNaN(n) ? null : { gridRowStart: n };
2076
+ },
2077
+ "row-end": ({ value, isArbitrary }) => {
2078
+ if (!getEffectiveIsWeb()) return null;
2079
+ if (value === "auto") return { gridRowEnd: "auto" };
2080
+ if (isArbitrary) return { gridRowEnd: value };
2081
+ const n = parseInt(value, 10);
2082
+ return isNaN(n) ? null : { gridRowEnd: n };
2083
+ },
2084
+ row: ({ value, isArbitrary }) => {
2085
+ if (!getEffectiveIsWeb()) return null;
2086
+ if (!value || value === "auto") return { gridRow: "auto" };
2087
+ if (isArbitrary) return { gridRow: value };
2088
+ return null;
2089
+ },
2090
+ // ── Grid alignment (web-only) ──────────────────────────────────────────────
2091
+ // place-items is shorthand for align-items + justify-items on a grid container
2092
+ "place-items": ({ value }) => {
2093
+ if (!getEffectiveIsWeb()) return null;
2094
+ const map = {
2095
+ start: "start",
2096
+ end: "end",
2097
+ center: "center",
2098
+ stretch: "stretch",
2099
+ baseline: "baseline"
2100
+ };
2101
+ return map[value] ? { placeItems: map[value] } : null;
2102
+ },
2103
+ // place-content is shorthand for align-content + justify-content on a grid container
2104
+ "place-content": ({ value }) => {
2105
+ if (!getEffectiveIsWeb()) return null;
2106
+ const map = {
2107
+ start: "start",
2108
+ end: "end",
2109
+ center: "center",
2110
+ stretch: "stretch",
2111
+ between: "space-between",
2112
+ around: "space-around",
2113
+ evenly: "space-evenly",
2114
+ baseline: "baseline"
2115
+ };
2116
+ return map[value] ? { placeContent: map[value] } : null;
2117
+ },
2118
+ // justify-items controls inline-axis alignment of grid items within their cells
2119
+ "justify-items": ({ value }) => {
2120
+ if (!getEffectiveIsWeb()) return null;
2121
+ const map = {
2122
+ start: "start",
2123
+ end: "end",
2124
+ center: "center",
2125
+ stretch: "stretch"
2126
+ };
2127
+ return map[value] ? { justifyItems: map[value] } : null;
2128
+ },
2129
+ // place-self is shorthand for align-self + justify-self on a grid item
2130
+ "place-self": ({ value }) => {
2131
+ if (!getEffectiveIsWeb()) return null;
2132
+ const map = {
2133
+ auto: "auto",
2134
+ start: "start",
2135
+ end: "end",
2136
+ center: "center",
2137
+ stretch: "stretch"
2138
+ };
2139
+ return map[value] ? { placeSelf: map[value] } : null;
2140
+ },
2141
+ // justify-self controls inline-axis self-alignment of a grid item
2142
+ "justify-self": ({ value }) => {
2143
+ if (!getEffectiveIsWeb()) return null;
2144
+ const map = {
2145
+ auto: "auto",
2146
+ start: "start",
2147
+ end: "end",
2148
+ center: "center",
2149
+ stretch: "stretch"
2150
+ };
2151
+ return map[value] ? { justifySelf: map[value] } : null;
2152
+ },
2153
+ // ── Flex ───────────────────────────────────────────────────────────────────
2154
+ flex: ({ value, isArbitrary }, { flex }) => {
2155
+ if (!value) return { display: "flex" };
2156
+ if (isArbitrary) {
2157
+ const v = parseFloat(value);
2158
+ return isNaN(v) ? null : { flex: v };
2159
+ }
2160
+ if (value in flex) {
2161
+ const v = flex[value];
2162
+ if (typeof v === "string" && !getEffectiveIsWeb()) {
2163
+ if (v === "auto" || v === "initial") return { flex: 1 };
2164
+ if (v === "none") return { flex: 0 };
2165
+ return null;
2166
+ }
2167
+ return { flex: v };
2168
+ }
2169
+ const n = parseFloat(value);
2170
+ return isNaN(n) ? null : { flex: n };
2171
+ },
2172
+ grow: ({ value }, _) => {
2173
+ if (!value) return { flexGrow: 1 };
2174
+ const n = parseFloat(value);
2175
+ return { flexGrow: isNaN(n) ? 1 : n };
2176
+ },
2177
+ shrink: ({ value }, _) => {
2178
+ if (!value) return { flexShrink: 1 };
2179
+ const n = parseFloat(value);
2180
+ return { flexShrink: isNaN(n) ? 1 : n };
2181
+ },
2182
+ order: ({ value, negative }, _) => {
2183
+ const n = parseInt(value, 10);
2184
+ return isNaN(n) ? null : { order: negative ? -n : n };
2185
+ },
2186
+ // ── Z-index ────────────────────────────────────────────────────────────────
2187
+ z: ({ value, isArbitrary }, { zIndex }) => {
2188
+ if (isArbitrary) {
2189
+ const n2 = parseInt(value);
2190
+ return isNaN(n2) ? null : { zIndex: n2 };
2191
+ }
2192
+ const v = zIndex[value];
2193
+ if (v !== void 0) {
2194
+ if (v === "auto") return getEffectiveIsWeb() ? { zIndex: "auto" } : null;
2195
+ return { zIndex: v };
2196
+ }
2197
+ const n = parseInt(value);
2198
+ return isNaN(n) ? null : { zIndex: n };
2199
+ },
2200
+ // ── Aspect ratio ───────────────────────────────────────────────────────────
2201
+ aspect: ({ value, isArbitrary }) => {
2202
+ if (isArbitrary) return { aspectRatio: value };
2203
+ const presets = { auto: "auto", square: 1, video: 16 / 9 };
2204
+ if (!(value in presets)) return null;
2205
+ const v = presets[value];
2206
+ if (v === "auto") return getEffectiveIsWeb() ? { aspectRatio: "auto" } : null;
2207
+ return { aspectRatio: v };
2208
+ },
2209
+ // ── Columns (web-only) ─────────────────────────────────────────────────────
2210
+ columns: ({ value, isArbitrary }) => {
2211
+ if (!getEffectiveIsWeb()) return null;
2212
+ if (isArbitrary) return { columnCount: value };
2213
+ if (value === "auto") return { columnCount: "auto" };
2214
+ const n = parseInt(value, 10);
2215
+ if (!isNaN(n)) return { columnCount: n };
2216
+ const widths = {
2217
+ "3xs": "16rem",
2218
+ "2xs": "18rem",
2219
+ xs: "20rem",
2220
+ sm: "24rem",
2221
+ md: "28rem",
2222
+ lg: "32rem",
2223
+ xl: "36rem",
2224
+ "2xl": "42rem",
2225
+ "3xl": "48rem",
2226
+ "4xl": "56rem",
2227
+ "5xl": "64rem",
2228
+ "6xl": "72rem",
2229
+ "7xl": "80rem"
2230
+ };
2231
+ return widths[value] ? { columnWidth: widths[value] } : null;
2232
+ }
2233
+ };
2234
+
2235
+ // src/core/resolvers/typography.ts
2236
+ function resolveFontSize(value, fontSizes, isArbitrary) {
2237
+ if (isArbitrary) return getEffectiveIsWeb() ? value : toNativeValue(value);
2238
+ return fontSizes[value] ?? null;
2239
+ }
2240
+ var typographyResolvers = {
2241
+ // ── Text ───────────────────────────────────────────────────────────────────
2242
+ text: ({ value, isArbitrary }, { colors, fontSize }) => {
2243
+ const size = resolveFontSize(value, fontSize, false);
2244
+ if (!isArbitrary && size !== null) return { fontSize: size };
2245
+ if (isArbitrary) {
2246
+ if (/^\d/.test(value) || /^(calc|min|max|clamp)/.test(value)) {
2247
+ return { fontSize: getEffectiveIsWeb() ? value : toNativeValue(value) };
2248
+ }
2249
+ return { color: getEffectiveIsWeb() ? withOpacityVar(value, "--text-opacity") : value };
2250
+ }
2251
+ const color = resolveColor(value, colors, false);
2252
+ if (!color) return null;
2253
+ return { color: getEffectiveIsWeb() ? withOpacityVar(color, "--text-opacity") : color };
2254
+ },
2255
+ "text-opacity": ({ value, isArbitrary }, _) => {
2256
+ if (!getEffectiveIsWeb()) return null;
2257
+ const n = parseFloat(value);
2258
+ if (isNaN(n)) return null;
2259
+ const v = isArbitrary ? n > 1 ? n / 100 : n : n / 100;
2260
+ return { "--text-opacity": v };
2261
+ },
2262
+ // ── Text decoration advanced (web-only) ───────────────────────────────────
2263
+ decoration: ({ value, isArbitrary }, { colors }) => {
2264
+ if (!getEffectiveIsWeb()) return null;
2265
+ if (isArbitrary) {
2266
+ if (/^\d/.test(value) || value.startsWith("calc(")) return { textDecorationThickness: value };
2267
+ return { textDecorationColor: value };
2268
+ }
2269
+ const thickTokens = {
2270
+ auto: "auto",
2271
+ "from-font": "from-font",
2272
+ "0": "0px",
2273
+ "1": "1px",
2274
+ "2": "2px",
2275
+ "4": "4px",
2276
+ "8": "8px"
2277
+ };
2278
+ if (value in thickTokens) return { textDecorationThickness: thickTokens[value] };
2279
+ const styleTokens = {
2280
+ solid: "solid",
2281
+ dashed: "dashed",
2282
+ dotted: "dotted",
2283
+ double: "double",
2284
+ wavy: "wavy"
2285
+ };
2286
+ if (value in styleTokens) return { textDecorationStyle: styleTokens[value] };
2287
+ const color = resolveColor(value, colors, false);
2288
+ return color ? { textDecorationColor: color } : null;
2289
+ },
2290
+ "underline-offset": ({ value, isArbitrary }) => {
2291
+ if (!getEffectiveIsWeb()) return null;
2292
+ if (isArbitrary) return { textUnderlineOffset: value };
2293
+ const offsets = {
2294
+ auto: "auto",
2295
+ "0": "0px",
2296
+ "1": "1px",
2297
+ "2": "2px",
2298
+ "4": "4px",
2299
+ "8": "8px"
2300
+ };
2301
+ return offsets[value] ? { textUnderlineOffset: offsets[value] } : null;
2302
+ },
2303
+ // ── Content (web-only — for before:/after: pseudo-elements, which don't exist on native) ──
2304
+ // Arbitrary value carries its own quotes from the bracket syntax (content-['*'] parses to
2305
+ // the literal string 'you can see it' quotes included), so it passes straight through as a
2306
+ // valid `content: '*'` CSS value with no extra wrapping needed.
2307
+ content: ({ value, isArbitrary }) => {
2308
+ if (!getEffectiveIsWeb()) return null;
2309
+ if (isArbitrary) return { content: value };
2310
+ const presets = { none: "none" };
2311
+ return value in presets ? { content: presets[value] } : null;
2312
+ },
2313
+ // ── Font ───────────────────────────────────────────────────────────────────
2314
+ font: ({ value, isArbitrary }, { fontFamily, fontWeight }) => {
2315
+ if (isArbitrary) return { fontFamily: value };
2316
+ if (value in fontFamily) {
2317
+ const ff = fontFamily[value];
2318
+ return { fontFamily: Array.isArray(ff) ? ff.join(", ") : ff };
2319
+ }
2320
+ if (value in fontWeight) return { fontWeight: String(fontWeight[value]) };
2321
+ return null;
2322
+ },
2323
+ // ── Line height ────────────────────────────────────────────────────────────
2324
+ leading: ({ value, isArbitrary }, { lineHeight }) => {
2325
+ if (isArbitrary) return { lineHeight: getEffectiveIsWeb() ? value : toNativeValue(value) };
2326
+ const v = lineHeight[value];
2327
+ if (v === void 0) return null;
2328
+ if (typeof v === "string" && !getEffectiveIsWeb()) return { lineHeight: toNativeValue(v) };
2329
+ return { lineHeight: v };
2330
+ },
2331
+ // ── Letter spacing ─────────────────────────────────────────────────────────
2332
+ tracking: ({ value, isArbitrary }, { letterSpacing }) => {
2333
+ if (isArbitrary) return { letterSpacing: getEffectiveIsWeb() ? value : toNativeValue(value) };
2334
+ const v = letterSpacing[value];
2335
+ return v !== void 0 ? { letterSpacing: v } : null;
2336
+ },
2337
+ // ── Line-clamp (web-only) ─────────────────────────────────────────────────
2338
+ "line-clamp": ({ value }) => {
2339
+ if (!getEffectiveIsWeb()) return null;
2340
+ if (value === "none") return { overflow: "visible", display: "block", WebkitLineClamp: "unset" };
2341
+ const n = parseInt(value, 10);
2342
+ if (isNaN(n) || n < 1) return null;
2343
+ return {
2344
+ overflow: "hidden",
2345
+ display: "-webkit-box",
2346
+ WebkitBoxOrient: "vertical",
2347
+ WebkitLineClamp: n
2348
+ };
2349
+ }
2350
+ };
2351
+
2352
+ // src/core/resolvers/transform.ts
2353
+ var transformResolvers = {
2354
+ // ── Transform extras (web-only) ───────────────────────────────────────────
2355
+ "skew-x": ({ value, negative, isArbitrary }) => {
2356
+ const deg = isArbitrary ? value : `${(negative ? -1 : 1) * parseFloat(value)}deg`;
2357
+ if (!isArbitrary && isNaN(parseFloat(value))) return null;
2358
+ return getEffectiveIsWeb() ? { transform: `skewX(${deg})` } : { transform: [{ skewX: deg }] };
2359
+ },
2360
+ "skew-y": ({ value, negative, isArbitrary }) => {
2361
+ const deg = isArbitrary ? value : `${(negative ? -1 : 1) * parseFloat(value)}deg`;
2362
+ if (!isArbitrary && isNaN(parseFloat(value))) return null;
2363
+ return getEffectiveIsWeb() ? { transform: `skewY(${deg})` } : { transform: [{ skewY: deg }] };
2364
+ },
2365
+ // Arbitrary full transform string: transform-[rotate(45deg)_scale(1.5)]
2366
+ transform: ({ value, isArbitrary }) => {
2367
+ if (!getEffectiveIsWeb()) return null;
2368
+ if (isArbitrary) return { transform: value.replace(/_/g, " ") };
2369
+ if (value === "none") return { transform: "none" };
2370
+ return null;
2371
+ },
2372
+ // Transform origin
2373
+ origin: ({ value, isArbitrary }) => {
2374
+ if (!getEffectiveIsWeb()) return null;
2375
+ if (isArbitrary) return { transformOrigin: value.replace(/_/g, " ") };
2376
+ const origins = {
2377
+ center: "center",
2378
+ top: "top",
2379
+ "top-right": "top right",
2380
+ right: "right",
2381
+ "bottom-right": "bottom right",
2382
+ bottom: "bottom",
2383
+ "bottom-left": "bottom left",
2384
+ left: "left",
2385
+ "top-left": "top left"
2386
+ };
2387
+ return origins[value] ? { transformOrigin: origins[value] } : null;
2388
+ },
2389
+ // ── Scale ──────────────────────────────────────────────────────────────────
2390
+ // Non-arbitrary: scale-150 → value='150' → 150/100 = 1.5
2391
+ // Arbitrary: scale-[1.5] → value='1.5' → used as-is (already the factor)
2392
+ scale: ({ value, isArbitrary }) => {
2393
+ const n = isArbitrary ? parseFloat(value) : parseFloat(value) / 100;
2394
+ if (isNaN(n)) return null;
2395
+ return getEffectiveIsWeb() ? { transform: `scale(${n})` } : { transform: [{ scale: n }] };
2396
+ },
2397
+ "scale-x": ({ value, isArbitrary }) => {
2398
+ const n = isArbitrary ? parseFloat(value) : parseFloat(value) / 100;
2399
+ if (isNaN(n)) return null;
2400
+ return getEffectiveIsWeb() ? { transform: `scaleX(${n})` } : { transform: [{ scaleX: n }] };
2401
+ },
2402
+ "scale-y": ({ value, isArbitrary }) => {
2403
+ const n = isArbitrary ? parseFloat(value) : parseFloat(value) / 100;
2404
+ if (isNaN(n)) return null;
2405
+ return getEffectiveIsWeb() ? { transform: `scaleY(${n})` } : { transform: [{ scaleY: n }] };
2406
+ },
2407
+ // ── Rotate ─────────────────────────────────────────────────────────────────
2408
+ rotate: ({ value, negative, isArbitrary }) => {
2409
+ if (isArbitrary) {
2410
+ const finalValue = negative ? `-${value}` : value;
2411
+ return getEffectiveIsWeb() ? { transform: `rotate(${finalValue})` } : { transform: [{ rotate: finalValue }] };
2412
+ }
2413
+ const deg = parseFloat(value);
2414
+ if (isNaN(deg)) return null;
2415
+ const finalDeg = negative ? -deg : deg;
2416
+ return getEffectiveIsWeb() ? { transform: `rotate(${finalDeg}deg)` } : { transform: [{ rotate: `${finalDeg}deg` }] };
2417
+ },
2418
+ // ── Perspective transform (cross-platform: iOS, Android, web) ────────────
2419
+ perspective: ({ value, isArbitrary }) => {
2420
+ if (isArbitrary) {
2421
+ const numPx = parseFloat(value);
2422
+ if (getEffectiveIsWeb()) return { transform: `perspective(${value})` };
2423
+ return isNaN(numPx) ? null : { transform: [{ perspective: numPx }] };
2424
+ }
2425
+ if (value === "none") return getEffectiveIsWeb() ? { transform: "none" } : null;
2426
+ const n = parseFloat(value);
2427
+ if (isNaN(n)) return null;
2428
+ return getEffectiveIsWeb() ? { transform: `perspective(${n}px)` } : { transform: [{ perspective: n }] };
2429
+ }
2430
+ };
2431
+
2432
+ // src/core/resolvers/effects.ts
2433
+ function keyframeDeclToCSS(decl) {
2434
+ return Object.entries(decl).map(([prop, val]) => `${prop.replace(/([A-Z])/g, "-$1").toLowerCase()}: ${val}`).join("; ");
2435
+ }
2436
+ function buildKeyframeCSS(name, steps) {
2437
+ const body = Object.entries(steps).map(([selector, decl]) => `${selector} { ${keyframeDeclToCSS(decl)} }`).join(" ");
2438
+ return `@keyframes ${name} { ${body} }`;
2439
+ }
2440
+ var BUILTIN_ANIMATIONS = {
2441
+ none: { animation: "none" },
2442
+ spin: {
2443
+ animation: "kb-spin 1s linear infinite",
2444
+ __keyframe: "@keyframes kb-spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }"
2445
+ },
2446
+ ping: {
2447
+ animation: "kb-ping 1s cubic-bezier(0,0,0.2,1) infinite",
2448
+ __keyframe: "@keyframes kb-ping { 75%, 100% { transform: scale(2); opacity: 0 } }"
2449
+ },
2450
+ pulse: {
2451
+ animation: "kb-pulse 2s cubic-bezier(0.4,0,0.6,1) infinite",
2452
+ __keyframe: "@keyframes kb-pulse { 0%, 100% { opacity: 1 } 50% { opacity: .5 } }"
2453
+ },
2454
+ bounce: {
2455
+ animation: "kb-bounce 1s infinite",
2456
+ __keyframe: "@keyframes kb-bounce { 0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8,0,1,1) } 50% { transform: none; animation-timing-function: cubic-bezier(0,0,0.2,1) } }"
2457
+ }
2458
+ };
2459
+ function buildAnimationValue(animation, keyframes) {
2460
+ const words = animation.trim().split(/\s+/);
2461
+ const name = words[0];
2462
+ if (!name) return { animation };
2463
+ const builtin = BUILTIN_ANIMATIONS[name];
2464
+ if (builtin?.__keyframe) {
2465
+ const kbName = builtin.animation.split(/\s+/, 1)[0];
2466
+ return { animation: [kbName, ...words.slice(1)].join(" "), __keyframe: builtin.__keyframe };
2467
+ }
2468
+ const steps = keyframes?.[name];
2469
+ return steps ? { animation, __keyframe: buildKeyframeCSS(name, steps) } : { animation };
2470
+ }
2471
+ var effectResolvers = {
2472
+ // ── Opacity ────────────────────────────────────────────────────────────────
2473
+ opacity: ({ value, isArbitrary }, { opacity }) => {
2474
+ if (isArbitrary) {
2475
+ const v2 = parseFloat(value);
2476
+ return isNaN(v2) ? null : { opacity: v2 > 1 ? v2 / 100 : v2 };
2477
+ }
2478
+ const v = opacity[value];
2479
+ if (v !== void 0) return { opacity: v };
2480
+ const n = parseFloat(value);
2481
+ return isNaN(n) ? null : { opacity: n > 1 ? n / 100 : n };
2482
+ },
2483
+ // ── Shadow ─────────────────────────────────────────────────────────────────
2484
+ shadow: ({ value }, { shadow }) => {
2485
+ const key = value === "" ? "DEFAULT" : value;
2486
+ return shadow[key] ?? null;
2487
+ },
2488
+ // ── Animations (CSS keyframe animations, web-only) ────────────────────────
2489
+ // Each variant injects a @keyframes rule once via the __keyframe marker.
2490
+ // resolver.ts detects __keyframe, injects the rule, then strips the marker
2491
+ // so it never reaches element inline styles.
2492
+ animate: ({ value, isArbitrary }, theme) => {
2493
+ if (!getEffectiveIsWeb()) return null;
2494
+ if (isArbitrary) return buildAnimationValue(value.replace(/_/g, " "), theme.keyframes);
2495
+ if (value in BUILTIN_ANIMATIONS) return BUILTIN_ANIMATIONS[value];
2496
+ const custom = theme.animation?.[value];
2497
+ return custom ? buildAnimationValue(custom, theme.keyframes) : null;
2498
+ },
2499
+ // ── Transition (web-only; use Animated API on native) ─────────────────────
2500
+ transition: ({ value }) => {
2501
+ if (!getEffectiveIsWeb()) return null;
2502
+ const presets = {
2503
+ "": "color 150ms, background-color 150ms, border-color 150ms, text-decoration-color 150ms, fill 150ms, stroke 150ms, opacity 150ms, box-shadow 150ms, transform 150ms, filter 150ms, backdrop-filter 150ms",
2504
+ all: "all 150ms",
2505
+ none: "none",
2506
+ colors: "color 150ms, background-color 150ms, border-color 150ms",
2507
+ opacity: "opacity 150ms",
2508
+ shadow: "box-shadow 150ms",
2509
+ transform: "transform 150ms"
2510
+ };
2511
+ const v = presets[value];
2512
+ return v !== void 0 ? { transition: v } : null;
2513
+ },
2514
+ duration: ({ value, isArbitrary }) => {
2515
+ if (!getEffectiveIsWeb()) return null;
2516
+ if (!isArbitrary && isNaN(parseFloat(value))) return null;
2517
+ const ms = isArbitrary ? value : `${value}ms`;
2518
+ return { transitionDuration: ms };
2519
+ },
2520
+ delay: ({ value, isArbitrary }) => {
2521
+ if (!getEffectiveIsWeb()) return null;
2522
+ if (!isArbitrary && isNaN(parseFloat(value))) return null;
2523
+ const ms = isArbitrary ? value : `${value}ms`;
2524
+ return { transitionDelay: ms };
2525
+ }
2526
+ };
2527
+
2528
+ // src/core/resolvers/misc.ts
2529
+ var miscResolvers = {
2530
+ // ── Arbitrary CSS property (web-only): [property:value] with no utility prefix ──
2531
+ // e.g. [mask-type:luminance], [--my-var:10px]. parser.ts already isolates this case
2532
+ // as utility: '' — it's ALSO how a stray, prefix-less negative bracket ("-[10px]",
2533
+ // presumably a typo) parses, which is why this only fires when the arbitrary value
2534
+ // itself contains a "property:value" pair; anything else (no colon) still resolves
2535
+ // to null exactly as before this resolver existed, rather than guessing a property.
2536
+ //
2537
+ // Only the FIRST colon splits property from value — the value itself may contain
2538
+ // more colons (a URL's "http://…") and must stay intact: [background:url(http://x/a.png)].
2539
+ // camelToKebab() in resolver.ts is a no-op on an already-kebab-case (or "--"-prefixed
2540
+ // custom property) key, so it can be used as the style object key as-written with no
2541
+ // extra case conversion — it only needs to look like a plausible CSS property name.
2542
+ "": ({ value, isArbitrary, negative }) => {
2543
+ if (!getEffectiveIsWeb() || !isArbitrary || !value) return null;
2544
+ if (negative) return null;
2545
+ const colonIdx = value.indexOf(":");
2546
+ if (colonIdx <= 0) return null;
2547
+ const prop = value.slice(0, colonIdx).trim();
2548
+ const cssValue = value.slice(colonIdx + 1).trim();
2549
+ if (!cssValue || !/^(--[\w-]+|[a-zA-Z-]+)$/.test(prop)) return null;
2550
+ return { [prop]: cssValue };
2551
+ },
2552
+ // ── SVG stroke/fill (web-only) ────────────────────────────────────────────
2553
+ // Native is intentionally excluded: react-native-svg's <Path>/<Circle>/etc.
2554
+ // take stroke/fill as component PROPS, not style entries, so there's no
2555
+ // reliable way to apply a resolved color through the `style` prop there.
2556
+ // `stroke-{n}` sets strokeWidth (a plain number, unlike a color) — same
2557
+ // color-first-then-numeric-fallback disambiguation `border` uses above.
2558
+ stroke: ({ value, isArbitrary }, { colors }) => {
2559
+ if (!getEffectiveIsWeb()) return null;
2560
+ if (!value) return null;
2561
+ if (value === "none") return { stroke: "none" };
2562
+ if (isArbitrary) {
2563
+ const w = toNativeValue(value);
2564
+ return typeof w === "number" ? { strokeWidth: w } : { stroke: value };
2565
+ }
2566
+ const color = resolveColor(value, colors, false);
2567
+ if (color) return { stroke: color };
2568
+ const n = parseFloat(value);
2569
+ return isNaN(n) ? null : { strokeWidth: n };
2570
+ },
2571
+ fill: ({ value, isArbitrary }, { colors }) => {
2572
+ if (!getEffectiveIsWeb()) return null;
2573
+ if (!value) return null;
2574
+ if (value === "none") return { fill: "none" };
2575
+ if (isArbitrary) return { fill: value };
2576
+ const color = resolveColor(value, colors, false);
2577
+ return color ? { fill: color } : null;
2578
+ },
2579
+ // ── Text shadow (cross-platform: iOS, Android, web) ─────────────────────
2580
+ // Named presets give cross-platform shadow; arbitrary is web-only.
2581
+ "text-shadow": ({ value, isArbitrary }, { colors }) => {
2582
+ if (value === "none") {
2583
+ return getEffectiveIsWeb() ? { textShadow: "none" } : { textShadowColor: "transparent", textShadowOffset: { width: 0, height: 0 }, textShadowRadius: 0 };
2584
+ }
2585
+ const webPresets = {
2586
+ "": "0 2px 4px rgba(0,0,0,0.3)",
2587
+ sm: "0 1px 2px rgba(0,0,0,0.3)",
2588
+ md: "0 4px 6px rgba(0,0,0,0.3)",
2589
+ lg: "0 8px 16px rgba(0,0,0,0.5)",
2590
+ xl: "0 16px 32px rgba(0,0,0,0.5)"
2591
+ };
2592
+ const nativePresets = {
2593
+ "": { textShadowColor: "rgba(0,0,0,0.3)", textShadowOffset: { width: 0, height: 2 }, textShadowRadius: 4 },
2594
+ sm: { textShadowColor: "rgba(0,0,0,0.3)", textShadowOffset: { width: 0, height: 1 }, textShadowRadius: 2 },
2595
+ md: { textShadowColor: "rgba(0,0,0,0.3)", textShadowOffset: { width: 0, height: 4 }, textShadowRadius: 6 },
2596
+ lg: { textShadowColor: "rgba(0,0,0,0.5)", textShadowOffset: { width: 0, height: 8 }, textShadowRadius: 16 },
2597
+ xl: { textShadowColor: "rgba(0,0,0,0.5)", textShadowOffset: { width: 0, height: 16 }, textShadowRadius: 32 }
2598
+ };
2599
+ if (value in webPresets) {
2600
+ if (getEffectiveIsWeb()) return { textShadow: webPresets[value] };
2601
+ return nativePresets[value] ?? null;
2602
+ }
2603
+ if (isArbitrary) {
2604
+ return getEffectiveIsWeb() ? { textShadow: value.replace(/_/g, " ") } : null;
2605
+ }
2606
+ const color = resolveColor(value, colors, false);
2607
+ if (color) {
2608
+ return getEffectiveIsWeb() ? { textShadow: `0 2px 4px ${color}` } : { textShadowColor: color };
2609
+ }
2610
+ return null;
2611
+ }
2612
+ };
2613
+
2614
+ // src/core/utilities.ts
2615
+ var RESOLVERS = {
2616
+ ...colorResolvers,
2617
+ ...spacingResolvers,
2618
+ ...borderResolvers,
2619
+ ...layoutResolvers,
2620
+ ...typographyResolvers,
2621
+ ...filterResolvers,
2622
+ ...transformResolvers,
2623
+ ...effectResolvers,
2624
+ ...miscResolvers
2625
+ };
2626
+ var NAMED_GROUP_PEER_MARKER_RE = /^(group|peer)\/.+$/;
2627
+ function resolveUtility(parsed, theme) {
2628
+ if (!parsed.value) {
2629
+ if (parsed.utility in PLUGIN_STANDALONE) return PLUGIN_STANDALONE[parsed.utility] ?? null;
2630
+ if (parsed.utility in getStandalone()) return getStandalone()[parsed.utility] ?? null;
2631
+ if (NAMED_GROUP_PEER_MARKER_RE.test(parsed.utility)) return getEffectiveIsWeb() ? {} : null;
2632
+ }
2633
+ const resolver = PLUGIN_RESOLVERS[parsed.utility] ?? RESOLVERS[parsed.utility];
2634
+ if (resolver) return resolver(parsed, theme);
2635
+ return null;
2636
+ }
2637
+ var PLUGIN_STANDALONE = {};
2638
+ var PLUGIN_RESOLVERS = {};
2639
+ function clearPluginUtilities() {
2640
+ for (const key of Object.keys(PLUGIN_STANDALONE)) delete PLUGIN_STANDALONE[key];
2641
+ for (const key of Object.keys(PLUGIN_RESOLVERS)) delete PLUGIN_RESOLVERS[key];
2642
+ _sortedPrefixes = null;
2643
+ _standaloneNames = null;
2644
+ }
2645
+ function getPluginStandaloneMap() {
2646
+ return PLUGIN_STANDALONE;
2647
+ }
2648
+ function isKnownUtility(utility) {
2649
+ return utility in getStandalone() || utility in RESOLVERS || utility in PLUGIN_STANDALONE || utility in PLUGIN_RESOLVERS || NAMED_GROUP_PEER_MARKER_RE.test(utility);
2650
+ }
2651
+ var _sortedPrefixes = null;
2652
+ var _standaloneNames = null;
2653
+ function getBuiltinUtilityPrefixes() {
2654
+ if (!_sortedPrefixes) {
2655
+ const all = [.../* @__PURE__ */ new Set([...Object.keys(RESOLVERS), ...Object.keys(PLUGIN_RESOLVERS)])];
2656
+ _sortedPrefixes = all.sort((a, b) => b.length - a.length);
2657
+ }
2658
+ return _sortedPrefixes;
2659
+ }
2660
+ function getBuiltinStandaloneNames() {
2661
+ if (!_standaloneNames) {
2662
+ _standaloneNames = /* @__PURE__ */ new Set([...Object.keys(getStandalone()), ...Object.keys(PLUGIN_STANDALONE)]);
2663
+ }
2664
+ return _standaloneNames;
2665
+ }
2666
+
2667
+ // src/core/parser.ts
2668
+ var UNSAFE_ARBITRARY_VALUE = /[{};\\]|\/\*|\*\//;
2669
+ function isSafeArbitraryValue(value) {
2670
+ if (!UNSAFE_ARBITRARY_VALUE.test(value)) return true;
2671
+ if (process.env.NODE_ENV !== "production") {
2672
+ kbachWarn(`Unsafe arbitrary value rejected: "${value}"`);
2673
+ }
2674
+ return false;
2675
+ }
2676
+ function parseClass(className) {
2677
+ const trimmed = className.trim();
2678
+ if (!trimmed) return null;
2679
+ const modifiers = [];
2680
+ let remaining = trimmed;
2681
+ while (true) {
2682
+ const colonIdx = findOuterColon(remaining);
2683
+ if (colonIdx === -1) break;
2684
+ const candidate = remaining.slice(0, colonIdx);
2685
+ if (!isKnownModifier(candidate)) break;
2686
+ modifiers.push(candidate);
2687
+ remaining = remaining.slice(colonIdx + 1);
2688
+ }
2689
+ let important = false;
2690
+ if (remaining.startsWith("!") && remaining.length > 1) {
2691
+ important = true;
2692
+ remaining = remaining.slice(1);
2693
+ }
2694
+ let negative = false;
2695
+ if (remaining.startsWith("-") && remaining.length > 1 && remaining[1] !== "-") {
2696
+ negative = true;
2697
+ remaining = remaining.slice(1);
2698
+ }
2699
+ let bracketDepth = 0;
2700
+ let bracketStart = -1;
2701
+ for (let i = remaining.length - 1; i >= 0; i--) {
2702
+ if (remaining[i] === "]") bracketDepth++;
2703
+ else if (remaining[i] === "[") {
2704
+ bracketDepth--;
2705
+ if (bracketDepth === 0) {
2706
+ bracketStart = i;
2707
+ break;
2708
+ }
2709
+ }
2710
+ }
2711
+ if (bracketStart > 0 && remaining[bracketStart - 1] === "-" && remaining.endsWith("]")) {
2712
+ const utility = remaining.slice(0, bracketStart - 1);
2713
+ const value = remaining.slice(bracketStart + 1, -1).replace(/_/g, " ");
2714
+ if (!isSafeArbitraryValue(value)) return null;
2715
+ return { original: trimmed, modifiers, negative, important, utility, value, isArbitrary: true };
2716
+ }
2717
+ if (remaining.endsWith("]") && bracketStart === -1) {
2718
+ if (process.env.NODE_ENV !== "production") {
2719
+ kbachWarn(`Unbalanced brackets: "${trimmed}"`);
2720
+ }
2721
+ }
2722
+ if (remaining.startsWith("[") && remaining.endsWith("]")) {
2723
+ const value = remaining.slice(1, -1).replace(/_/g, " ");
2724
+ if (!isSafeArbitraryValue(value)) return null;
2725
+ return { original: trimmed, modifiers, negative, important, utility: "", value, isArbitrary: true };
2726
+ }
2727
+ if (getBuiltinStandaloneNames().has(remaining)) {
2728
+ return { original: trimmed, modifiers, negative, important, utility: remaining, value: "", isArbitrary: false };
2729
+ }
2730
+ for (const prefix of getBuiltinUtilityPrefixes()) {
2731
+ if (remaining === prefix) {
2732
+ return { original: trimmed, modifiers, negative, important, utility: prefix, value: "", isArbitrary: false };
2733
+ }
2734
+ if (remaining.startsWith(prefix + "-")) {
2735
+ const value = remaining.slice(prefix.length + 1);
2736
+ return { original: trimmed, modifiers, negative, important, utility: prefix, value, isArbitrary: false };
2737
+ }
2738
+ }
2739
+ const firstDash = remaining.indexOf("-");
2740
+ if (firstDash > 0) {
2741
+ return {
2742
+ original: trimmed,
2743
+ modifiers,
2744
+ negative,
2745
+ important,
2746
+ utility: remaining.slice(0, firstDash),
2747
+ value: remaining.slice(firstDash + 1),
2748
+ isArbitrary: false
2749
+ };
2750
+ }
2751
+ return { original: trimmed, modifiers, negative, important, utility: remaining, value: "", isArbitrary: false };
2752
+ }
2753
+ function splitClassTokens(classString) {
2754
+ const tokens = [];
2755
+ let current = "";
2756
+ let depth = 0;
2757
+ let parenDepth = 0;
2758
+ for (let i = 0; i < classString.length; i++) {
2759
+ const ch = classString[i];
2760
+ if (ch === "[") {
2761
+ depth++;
2762
+ current += ch;
2763
+ continue;
2764
+ }
2765
+ if (ch === "]") {
2766
+ depth--;
2767
+ current += ch;
2768
+ continue;
2769
+ }
2770
+ if (ch === "(") {
2771
+ parenDepth++;
2772
+ current += ch;
2773
+ continue;
2774
+ }
2775
+ if (ch === ")") {
2776
+ parenDepth--;
2777
+ current += ch;
2778
+ continue;
2779
+ }
2780
+ if (/\s/.test(ch)) {
2781
+ if (depth === 0 && parenDepth === 0) {
2782
+ if (current) {
2783
+ tokens.push(current);
2784
+ current = "";
2785
+ }
2786
+ }
2787
+ } else {
2788
+ current += ch;
2789
+ }
2790
+ }
2791
+ if (current) tokens.push(current);
2792
+ return tokens;
2793
+ }
2794
+ function normalizeClassString(classString) {
2795
+ return splitClassTokens(classString).join(" ");
2796
+ }
2797
+ function parseClasses(classString) {
2798
+ const results = [];
2799
+ for (const token of splitClassTokens(classString)) {
2800
+ const parsed = parseClass(token);
2801
+ if (parsed) results.push(parsed);
2802
+ }
2803
+ return results;
2804
+ }
2805
+ function findOuterColon(s) {
2806
+ let depth = 0;
2807
+ for (let i = 0; i < s.length; i++) {
2808
+ const ch = s[i];
2809
+ if (ch === "[") depth++;
2810
+ else if (ch === "]") depth--;
2811
+ else if (ch === ":" && depth === 0) return i;
2812
+ }
2813
+ return -1;
2814
+ }
2815
+
2816
+ // src/core/responsiveStore.ts
2817
+ var store = { width: 0, notifiedWidth: 0, screens: {}, listeners: /* @__PURE__ */ new Set() };
2818
+ function syncGlobalWidth(width) {
2819
+ store.width = width;
2820
+ }
2821
+ function syncGlobalScreens(screens) {
2822
+ store.screens = screens;
2823
+ }
2824
+ function getGlobalScreens() {
2825
+ return store.screens;
2826
+ }
2827
+ function setGlobalWidth(width) {
2828
+ store.width = width;
2829
+ if (store.notifiedWidth === width) return;
2830
+ store.notifiedWidth = width;
2831
+ for (const l of store.listeners) l();
2832
+ }
2833
+ function getGlobalWidth() {
2834
+ return store.width;
2835
+ }
2836
+ function subscribeGlobalWidth(listener) {
2837
+ store.listeners.add(listener);
2838
+ return () => store.listeners.delete(listener);
2839
+ }
2840
+ function getActiveBreakpoints(width, screens) {
2841
+ const w = width ?? store.width;
2842
+ const s = screens ?? store.screens;
2843
+ const active = /* @__PURE__ */ new Set();
2844
+ for (const [name, minW] of Object.entries(s)) {
2845
+ if (typeof minW === "number" && w >= minW) active.add(name);
2846
+ }
2847
+ return active;
2848
+ }
2849
+
2850
+ // src/core/resolver.ts
2851
+ var _themeCache = /* @__PURE__ */ new WeakMap();
2852
+ function getThemeCache(theme) {
2853
+ let cache = _themeCache.get(theme);
2854
+ if (!cache) {
2855
+ cache = new LRUCache(1e4);
2856
+ _themeCache.set(theme, cache);
2857
+ }
2858
+ return cache;
2859
+ }
2860
+ var _sortCache = /* @__PURE__ */ new WeakMap();
2861
+ function getSortedEntries(resolved) {
2862
+ let sorted = _sortCache.get(resolved);
2863
+ if (!sorted) {
2864
+ const entries = Object.entries(resolved);
2865
+ entries.sort((a, b) => {
2866
+ const pa = a[0] === "base" ? -1 : a[0].split(":").length;
2867
+ const pb = b[0] === "base" ? -1 : b[0].split(":").length;
2868
+ return pa - pb;
2869
+ });
2870
+ sorted = entries;
2871
+ _sortCache.set(resolved, sorted);
2872
+ }
2873
+ return sorted;
2874
+ }
2875
+ var _defaultFontFamily;
2876
+ function setDefaultFontFamily(font) {
2877
+ _defaultFontFamily = font;
2878
+ }
2879
+ function getDefaultFontFamily() {
2880
+ return _defaultFontFamily;
2881
+ }
2882
+ var _styleEl = null;
2883
+ var _ruleIndexByKey = /* @__PURE__ */ new Map();
2884
+ function evictInjectedRule(rule) {
2885
+ const idx = _ruleIndexByKey.get(rule);
2886
+ _ruleIndexByKey.delete(rule);
2887
+ if (idx === void 0) return;
2888
+ const sheet = _styleEl?.sheet;
2889
+ if (!sheet) return;
2890
+ try {
2891
+ sheet.deleteRule(idx);
2892
+ } catch {
2893
+ return;
2894
+ }
2895
+ for (const [key, i] of _ruleIndexByKey) {
2896
+ if (i > idx) _ruleIndexByKey.set(key, i - 1);
2897
+ }
2898
+ }
2899
+ var _injectedRules = new LRUCache(5e4, evictInjectedRule);
2900
+ var _runtimeCSSDisabled = false;
2901
+ function disableRuntimeCSS() {
2902
+ _runtimeCSSDisabled = true;
2903
+ }
2904
+ function isRuntimeCSSDisabled() {
2905
+ return _runtimeCSSDisabled;
2906
+ }
2907
+ function getStyleEl() {
2908
+ if (_styleEl) return _styleEl;
2909
+ _styleEl = document.createElement("style");
2910
+ _styleEl.setAttribute("data-kbach", "");
2911
+ document.head.appendChild(_styleEl);
2912
+ return _styleEl;
2913
+ }
2914
+ function injectRule(rule) {
2915
+ if (isRuntimeCSSDisabled()) return;
2916
+ if (_injectedRules.get(rule)) return;
2917
+ try {
2918
+ const sheet = getStyleEl().sheet;
2919
+ if (sheet) {
2920
+ const idx = sheet.cssRules.length;
2921
+ sheet.insertRule(rule, idx);
2922
+ _ruleIndexByKey.set(rule, idx);
2923
+ _injectedRules.set(rule, true);
2924
+ }
2925
+ } catch {
2926
+ }
2927
+ }
2928
+ var _globalStyleEl = null;
2929
+ function getGlobalStyleEl() {
2930
+ if (_globalStyleEl) return _globalStyleEl;
2931
+ _globalStyleEl = document.createElement("style");
2932
+ _globalStyleEl.setAttribute("data-kbach-global", "");
2933
+ document.head.insertBefore(_globalStyleEl, getStyleEl());
2934
+ return _globalStyleEl;
2935
+ }
2936
+ function injectGlobalStyles(theme) {
2937
+ if (typeof document === "undefined" || isRuntimeCSSDisabled()) return;
2938
+ const rules = document.getElementById(RESET_STYLE_ID) ? [] : [BASE_RESET];
2939
+ const ff = theme.fontFamily;
2940
+ if (ff?.sans && ff.sans !== "System") {
2941
+ const family = Array.isArray(ff.sans) ? ff.sans.join(", ") : ff.sans;
2942
+ rules.push(`body { font-family: ${family}; }`);
2943
+ }
2944
+ getGlobalStyleEl().textContent = rules.join("\n");
2945
+ }
2946
+ function buildDivideDecls(styles, forceImportant) {
2947
+ const imp = forceImportant ? " !important" : "";
2948
+ const parts = [];
2949
+ if ("__divideX" in styles) {
2950
+ const w = Number(styles.__divideX);
2951
+ parts.push(`border-left-width: ${w}px${imp}`, `border-right-width: 0px${imp}`);
2952
+ }
2953
+ if ("__divideY" in styles) {
2954
+ const w = Number(styles.__divideY);
2955
+ parts.push(`border-top-width: ${w}px${imp}`, `border-bottom-width: 0px${imp}`);
2956
+ }
2957
+ if ("__divideColor" in styles) parts.push(`border-color: ${String(styles.__divideColor)}${imp}`);
2958
+ if ("__divideStyle" in styles) parts.push(`border-style: ${String(styles.__divideStyle)}${imp}`);
2959
+ return parts.join("; ");
2960
+ }
2961
+ function buildSpaceDecls(styles, forceImportant) {
2962
+ const imp = forceImportant ? " !important" : "";
2963
+ const parts = [];
2964
+ if ("__spaceX" in styles) {
2965
+ const v = styles.__spaceX;
2966
+ const val = typeof v === "number" ? `${v}px` : String(v);
2967
+ parts.push(`margin-left: ${val}${imp}`);
2968
+ }
2969
+ if ("__spaceY" in styles) {
2970
+ const v = styles.__spaceY;
2971
+ const val = typeof v === "number" ? `${v}px` : String(v);
2972
+ parts.push(`margin-top: ${val}${imp}`);
2973
+ }
2974
+ return parts.join("; ");
2975
+ }
2976
+ var RN_ONLY_PROPS = /* @__PURE__ */ new Set([
2977
+ "shadowColor",
2978
+ "shadowOffset",
2979
+ "shadowOpacity",
2980
+ "shadowRadius",
2981
+ "elevation",
2982
+ "includeFontPadding",
2983
+ "textAlignVertical",
2984
+ "writingDirection",
2985
+ "textShadowColor",
2986
+ "textShadowOffset",
2987
+ "textShadowRadius",
2988
+ "tintColor",
2989
+ "__divideX",
2990
+ "__divideY",
2991
+ "__divideColor",
2992
+ "__divideStyle",
2993
+ "__keyframe",
2994
+ "__spaceX",
2995
+ "__spaceY"
2996
+ ]);
2997
+ var CSS_UNITLESS = /* @__PURE__ */ new Set([
2998
+ "opacity",
2999
+ "fontWeight",
3000
+ "flex",
3001
+ "flexGrow",
3002
+ "flexShrink",
3003
+ "order",
3004
+ "zIndex",
3005
+ "aspectRatio",
3006
+ "columnCount",
3007
+ "lineHeight",
3008
+ "gridColumnStart",
3009
+ "gridColumnEnd",
3010
+ "gridRowStart",
3011
+ "gridRowEnd"
3012
+ ]);
3013
+ var RN_SHORTHAND_EXPAND = {
3014
+ marginHorizontal: ["margin-left", "margin-right"],
3015
+ marginVertical: ["margin-top", "margin-bottom"],
3016
+ paddingHorizontal: ["padding-left", "padding-right"],
3017
+ paddingVertical: ["padding-top", "padding-bottom"]
3018
+ };
3019
+ function styleValueToCSS(styles, forceImportant = false) {
3020
+ const parts = [];
3021
+ for (const [prop, val] of Object.entries(styles)) {
3022
+ if (val === void 0 || val === null || typeof val === "object" || RN_ONLY_PROPS.has(prop)) continue;
3023
+ let cssVal;
3024
+ if (typeof val === "number") {
3025
+ const isCustomProp = prop.startsWith("--");
3026
+ cssVal = val === 0 || isCustomProp || CSS_UNITLESS.has(prop) ? String(val) : `${val}px`;
3027
+ } else {
3028
+ cssVal = String(val);
3029
+ }
3030
+ const imp = forceImportant || prop === "display" && (cssVal === "grid" || cssVal === "inline-grid") || prop === "position" && (cssVal === "sticky" || cssVal === "fixed" || cssVal === "static") ? " !important" : "";
3031
+ if (prop in RN_SHORTHAND_EXPAND) {
3032
+ const [p1, p2] = RN_SHORTHAND_EXPAND[prop];
3033
+ parts.push(`${p1}: ${cssVal}${imp}`, `${p2}: ${cssVal}${imp}`);
3034
+ continue;
3035
+ }
3036
+ parts.push(`${camelToKebab(prop)}: ${cssVal}${imp}`);
3037
+ }
3038
+ return parts.join("; ");
3039
+ }
3040
+ function camelToKebab(str) {
3041
+ return str.replace(/([A-Z])/g, "-$1").toLowerCase();
3042
+ }
3043
+ function buildClassCSSRules(cls, bucketKey, styles, darkMode, important, screens) {
3044
+ const rules = [];
3045
+ if ("__keyframe" in styles && typeof styles.__keyframe === "string") {
3046
+ rules.push(styles.__keyframe);
3047
+ }
3048
+ const isDivide = "__divideX" in styles || "__divideY" in styles || "__divideColor" in styles || "__divideStyle" in styles;
3049
+ const isSpace = "__spaceX" in styles || "__spaceY" in styles;
3050
+ const isChildCombinator = isDivide || isSpace;
3051
+ const escaped = escapeCSSSelector(cls);
3052
+ const childSuffix = isChildCombinator ? " > * + *" : "";
3053
+ if (bucketKey === "base") {
3054
+ const decls2 = isDivide ? buildDivideDecls(styles, important) : isSpace ? buildSpaceDecls(styles, important) : styleValueToCSS(styles, important);
3055
+ if (!decls2) return rules;
3056
+ rules.push(`.${escaped}${childSuffix} { ${decls2} }`);
3057
+ return rules;
3058
+ }
3059
+ const mods = bucketKey.split(":");
3060
+ let darkScheme;
3061
+ let needsImportant = important;
3062
+ const pseudoParts = [];
3063
+ const ancestorParts = [];
3064
+ const dirParts = [];
3065
+ const mediaWrappers = [];
3066
+ let minWidth = 0;
3067
+ for (const mod of mods) {
3068
+ const def = getModifier(mod);
3069
+ if (!def) continue;
3070
+ if (def.darkScheme) darkScheme = def.darkScheme;
3071
+ if (def.pseudo) pseudoParts.push(def.pseudo);
3072
+ if (def.ancestorSelector) {
3073
+ ancestorParts.push(def.ancestorSelector);
3074
+ needsImportant = true;
3075
+ }
3076
+ if (def.dirSelector) {
3077
+ dirParts.push(def.dirSelector);
3078
+ needsImportant = true;
3079
+ }
3080
+ if (def.mediaQuery) {
3081
+ mediaWrappers.push(`@media ${def.mediaQuery}`);
3082
+ needsImportant = true;
3083
+ }
3084
+ if (def.isResponsive) {
3085
+ const w = screens[mod] ?? 0;
3086
+ if (w > minWidth) minWidth = w;
3087
+ }
3088
+ if (def.forcesImportant) needsImportant = true;
3089
+ }
3090
+ const pseudoSuffix = pseudoParts.join("");
3091
+ const elementSelector = `.${escaped}${pseudoSuffix}${childSuffix}`;
3092
+ const ancestorPrefix = ancestorParts.join("");
3093
+ const dirPrefix = dirParts.join("");
3094
+ const selector = `${dirPrefix}${ancestorPrefix}${elementSelector}`;
3095
+ const decls = isDivide ? buildDivideDecls(styles, needsImportant) : isSpace ? buildSpaceDecls(styles, needsImportant) : styleValueToCSS(styles, needsImportant);
3096
+ if (!decls) return rules;
3097
+ let rule;
3098
+ if (darkScheme === "dark") {
3099
+ if (darkMode === "media") rule = `@media (prefers-color-scheme: dark) { ${selector} { ${decls} } }`;
3100
+ else if (darkMode === "class") rule = `.dark ${selector} { ${decls} }`;
3101
+ else rule = `[data-theme="dark"] ${selector} { ${decls} }`;
3102
+ } else if (darkScheme === "light") {
3103
+ if (darkMode === "media") rule = `@media (prefers-color-scheme: light) { ${selector} { ${decls} } }`;
3104
+ else if (darkMode === "class") rule = `.light ${selector} { ${decls} }`;
3105
+ else rule = `[data-theme="light"] ${selector} { ${decls} }`;
3106
+ } else {
3107
+ rule = `${selector} { ${decls} }`;
3108
+ }
3109
+ for (const mw of mediaWrappers) rule = `${mw} { ${rule} }`;
3110
+ if (minWidth > 0) rule = `@media (min-width: ${minWidth}px) { ${rule} }`;
3111
+ rules.push(rule);
3112
+ return rules;
3113
+ }
3114
+ function injectClassRule(cls, bucketKey, styles, darkMode, important) {
3115
+ const cssRules = buildClassCSSRules(cls, bucketKey, styles, darkMode, important, getGlobalScreens());
3116
+ for (const r of cssRules) injectRule(r);
3117
+ }
3118
+ function generateClassCSS(classString, theme, darkMode = "attribute", screens = {}) {
3119
+ const rules = [];
3120
+ for (const parsed of parseClasses(classString)) {
3121
+ const styles = resolveUtility(parsed, theme);
3122
+ if (!styles) continue;
3123
+ const bucketKey = parsed.modifiers.length === 0 ? "base" : parsed.modifiers.join(":");
3124
+ rules.push(...buildClassCSSRules(parsed.original, bucketKey, styles, darkMode, parsed.important, screens));
3125
+ }
3126
+ return rules.join("\n");
3127
+ }
3128
+ function resolve(classString, theme, darkMode = "attribute") {
3129
+ const cache = getThemeCache(theme);
3130
+ const cacheKey = `${classString}::${darkMode}`;
3131
+ const cached = cache.get(cacheKey);
3132
+ if (cached) return cached;
3133
+ const result = {};
3134
+ const onWeb = isWeb;
3135
+ for (const parsed of parseClasses(classString)) {
3136
+ const styles = resolveUtility(parsed, theme);
3137
+ if (!styles) {
3138
+ if (process.env.NODE_ENV !== "production" && !parsed.isArbitrary && !isKnownUtility(parsed.utility) && !parsed.original.startsWith("__")) {
3139
+ kbachWarn(`Unknown class "${parsed.original}"`);
3140
+ }
3141
+ continue;
3142
+ }
3143
+ const bucketKey = parsed.modifiers.length === 0 ? "base" : parsed.modifiers.join(":");
3144
+ if (!result[bucketKey]) result[bucketKey] = {};
3145
+ Object.assign(result[bucketKey], styles);
3146
+ if (onWeb) {
3147
+ injectClassRule(parsed.original, bucketKey, styles, darkMode, parsed.important);
3148
+ }
3149
+ }
3150
+ cache.set(cacheKey, result);
3151
+ return result;
3152
+ }
3153
+ function flatten(resolved, isDark, state = {}, breakpoints = /* @__PURE__ */ new Set()) {
3154
+ const result = {};
3155
+ for (const [key, styles] of getSortedEntries(resolved)) {
3156
+ if (!styles) continue;
3157
+ if (key === "base") {
3158
+ Object.assign(result, styles);
3159
+ continue;
3160
+ }
3161
+ const mods = key.split(":");
3162
+ if (mods.every((mod) => matchModifier(mod, isDark, state, breakpoints))) {
3163
+ Object.assign(result, styles);
3164
+ }
3165
+ }
3166
+ if (isNative) {
3167
+ const defaultFont = getDefaultFontFamily();
3168
+ if (defaultFont && !("fontFamily" in result)) {
3169
+ result.fontFamily = defaultFont;
3170
+ }
3171
+ }
3172
+ if (!isNative) {
3173
+ const r = result;
3174
+ const ph = r.paddingHorizontal;
3175
+ if (ph !== void 0) {
3176
+ r.paddingLeft = ph;
3177
+ r.paddingRight = ph;
3178
+ delete r.paddingHorizontal;
3179
+ }
3180
+ const pv = r.paddingVertical;
3181
+ if (pv !== void 0) {
3182
+ r.paddingTop = pv;
3183
+ r.paddingBottom = pv;
3184
+ delete r.paddingVertical;
3185
+ }
3186
+ const mh = r.marginHorizontal;
3187
+ if (mh !== void 0) {
3188
+ r.marginLeft = mh;
3189
+ r.marginRight = mh;
3190
+ delete r.marginHorizontal;
3191
+ }
3192
+ const mv = r.marginVertical;
3193
+ if (mv !== void 0) {
3194
+ r.marginTop = mv;
3195
+ r.marginBottom = mv;
3196
+ delete r.marginVertical;
3197
+ }
3198
+ }
3199
+ return result;
3200
+ }
3201
+ function clearCache() {
3202
+ _injectedRules.clear();
3203
+ _ruleIndexByKey.clear();
3204
+ if (_styleEl) {
3205
+ _styleEl.remove();
3206
+ _styleEl = null;
3207
+ }
3208
+ if (_globalStyleEl) {
3209
+ _globalStyleEl.remove();
3210
+ _globalStyleEl = null;
3211
+ }
3212
+ }
3213
+
3214
+ // src/core/config.ts
3215
+ function deepMerge(base, override) {
3216
+ const result = { ...base };
3217
+ for (const key of Object.keys(override)) {
3218
+ const baseVal = base[key];
3219
+ const overVal = override[key];
3220
+ if (baseVal !== null && typeof baseVal === "object" && !Array.isArray(baseVal) && overVal !== null && typeof overVal === "object" && !Array.isArray(overVal)) {
3221
+ result[key] = deepMerge(
3222
+ baseVal,
3223
+ overVal
3224
+ );
3225
+ } else if (overVal !== void 0) {
3226
+ result[key] = overVal;
3227
+ }
3228
+ }
3229
+ return result;
3230
+ }
3231
+ var configStore = { resolved: null, listeners: /* @__PURE__ */ new Set(), customVariants: {} };
3232
+ function getConfig() {
3233
+ if (configStore.resolved) return configStore.resolved;
3234
+ configStore.resolved = buildConfig({});
3235
+ return configStore.resolved;
3236
+ }
3237
+ function resetConfig() {
3238
+ configStore.resolved = null;
3239
+ }
3240
+ function resolveOneRef(ref, colors) {
3241
+ const lastDash = ref.lastIndexOf("-");
3242
+ if (lastDash <= 0) return null;
3243
+ const name = ref.slice(0, lastDash);
3244
+ const shade = ref.slice(lastDash + 1);
3245
+ if (!/^\d+$/.test(shade)) return null;
3246
+ const entry = colors[name];
3247
+ if (!entry || typeof entry !== "object") return null;
3248
+ return entry[shade] ?? null;
3249
+ }
3250
+ function resolveColorRefs(colors) {
3251
+ const MAX_DEPTH = 5;
3252
+ function resolveChain(raw) {
3253
+ let current = raw;
3254
+ for (let i = 0; i < MAX_DEPTH; i++) {
3255
+ const next = resolveOneRef(current, colors);
3256
+ if (!next || next === current) break;
3257
+ current = next;
3258
+ }
3259
+ return current;
3260
+ }
3261
+ const out = {};
3262
+ for (const [key, val] of Object.entries(colors)) {
3263
+ if (typeof val === "string") {
3264
+ out[key] = resolveChain(val);
3265
+ } else {
3266
+ const shades = {};
3267
+ for (const [shade, hex] of Object.entries(val)) {
3268
+ shades[shade] = resolveChain(hex);
3269
+ }
3270
+ out[key] = shades;
3271
+ }
3272
+ }
3273
+ return out;
3274
+ }
3275
+ function buildConfig(userConfig) {
3276
+ let theme = { ...defaultTheme };
3277
+ if (userConfig.theme) {
3278
+ theme = { ...theme, ...userConfig.theme };
3279
+ }
3280
+ if (userConfig.extend) {
3281
+ const extendConfig = userConfig.extend;
3282
+ const { theme: nestedTheme, ...directKeys } = extendConfig;
3283
+ const extSources = [];
3284
+ if (nestedTheme) extSources.push(nestedTheme);
3285
+ if (Object.keys(directKeys).length) extSources.push(directKeys);
3286
+ for (const ext of extSources) {
3287
+ for (const [key, value] of Object.entries(ext)) {
3288
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
3289
+ if (process.env.NODE_ENV !== "production") {
3290
+ kbachWarn(`extend.${key} should be an object, got ${typeof value} \u2014 skipped`);
3291
+ }
3292
+ continue;
3293
+ }
3294
+ if (value !== null && typeof value === "object" && !Array.isArray(value)) {
3295
+ theme[key] = deepMerge(
3296
+ theme[key] ?? {},
3297
+ value
3298
+ );
3299
+ }
3300
+ }
3301
+ }
3302
+ }
3303
+ theme = { ...theme, colors: resolveColorRefs(theme.colors) };
3304
+ const resolved = {
3305
+ darkMode: userConfig.darkMode ?? "attribute",
3306
+ theme,
3307
+ plugins: userConfig.plugins ?? []
3308
+ };
3309
+ if (userConfig.plugins !== void 0) {
3310
+ clearPluginUtilities();
3311
+ clearPluginModifiers();
3312
+ }
3313
+ for (const k of Object.keys(configStore.customVariants)) delete configStore.customVariants[k];
3314
+ const pluginAPI = makePluginAPI(resolved.theme);
3315
+ for (const plugin of resolved.plugins) {
3316
+ plugin(pluginAPI);
3317
+ }
3318
+ const rawSans = theme.fontFamily?.sans;
3319
+ const sansFontValue = Array.isArray(rawSans) ? rawSans[0] : rawSans;
3320
+ setDefaultFontFamily(sansFontValue && sansFontValue !== "System" ? sansFontValue : void 0);
3321
+ injectGlobalStyles(resolved.theme);
3322
+ return resolved;
3323
+ }
3324
+ function _selectorToModifierDef(selector) {
3325
+ const s = selector.trim();
3326
+ if (s.startsWith("@media ")) {
3327
+ return { mediaQuery: s.slice(7), jsBehavior: "css-only", forcesImportant: true };
3328
+ }
3329
+ if (s.startsWith("::") || s.startsWith(":") && !s.includes(" ") && !s.includes("&") && !s.includes("(")) {
3330
+ return { pseudo: s, jsBehavior: "css-only", forcesImportant: true };
3331
+ }
3332
+ return { ancestorSelector: s.endsWith(" ") ? s : `${s} `, jsBehavior: "css-only", forcesImportant: true };
3333
+ }
3334
+ function makePluginAPI(theme) {
3335
+ const standalone = getPluginStandaloneMap();
3336
+ return {
3337
+ addUtility(name, styles) {
3338
+ standalone[name] = styles;
3339
+ },
3340
+ addVariant(name, selectorOrDef) {
3341
+ const def = typeof selectorOrDef === "string" ? _selectorToModifierDef(selectorOrDef) : selectorOrDef;
3342
+ const selector = typeof selectorOrDef === "string" ? selectorOrDef : selectorOrDef.pseudo ?? selectorOrDef.mediaQuery ?? selectorOrDef.ancestorSelector ?? null;
3343
+ if (selector !== null && selector !== name) customVariants[name] = selector;
3344
+ registerModifier(name, def);
3345
+ },
3346
+ theme(path, defaultValue) {
3347
+ const parts = path.replace(/\[([^\]]+)\]/g, ".$1").split(".");
3348
+ let current = theme;
3349
+ for (const part of parts) {
3350
+ if (current === null || typeof current !== "object") return defaultValue;
3351
+ current = current[part];
3352
+ }
3353
+ return current ?? defaultValue;
3354
+ },
3355
+ e(className) {
3356
+ return className.replace(/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g, "\\$&");
3357
+ }
3358
+ };
3359
+ }
3360
+ function onConfigChange(listener) {
3361
+ configStore.listeners.add(listener);
3362
+ return () => configStore.listeners.delete(listener);
3363
+ }
3364
+ function updateConfig(userConfig) {
3365
+ configStore.resolved = buildConfig(userConfig);
3366
+ configStore._src = userConfig;
3367
+ clearCache();
3368
+ for (const listener of configStore.listeners) {
3369
+ listener(configStore.resolved);
3370
+ }
3371
+ }
3372
+ function initConfig(userConfig) {
3373
+ if (configStore._src === userConfig) return;
3374
+ updateConfig(userConfig);
3375
+ }
3376
+ var customVariants = configStore.customVariants;
3377
+
3378
+ // src/core/darkModeStore.ts
3379
+ var store2 = { isDark: false, notifiedIsDark: false, subscribers: /* @__PURE__ */ new Set() };
3380
+ function syncGlobalDarkMode(isDark) {
3381
+ store2.isDark = isDark;
3382
+ }
3383
+ function setGlobalDarkMode(isDark) {
3384
+ store2.isDark = isDark;
3385
+ if (store2.notifiedIsDark === isDark) return;
3386
+ store2.notifiedIsDark = isDark;
3387
+ for (const sub of store2.subscribers) sub();
3388
+ }
3389
+ function getGlobalDarkMode() {
3390
+ return store2.isDark;
3391
+ }
3392
+ function subscribeGlobalDarkMode(callback) {
3393
+ store2.subscribers.add(callback);
3394
+ return () => store2.subscribers.delete(callback);
3395
+ }
3396
+ // Annotate the CommonJS export names for ESM import in node:
3397
+ 0 && (module.exports = {
3398
+ BASE_RESET,
3399
+ LRUCache,
3400
+ RESET_STYLE_ID,
3401
+ buildConfig,
3402
+ clearCache,
3403
+ clearPluginModifiers,
3404
+ customVariants,
3405
+ defaultColors,
3406
+ defaultTheme,
3407
+ disableRuntimeCSS,
3408
+ escapeCSSSelector,
3409
+ flatten,
3410
+ generateClassCSS,
3411
+ getActiveBreakpoints,
3412
+ getAllModifierNames,
3413
+ getBuiltinStandaloneNames,
3414
+ getBuiltinUtilityPrefixes,
3415
+ getConfig,
3416
+ getDefaultFontFamily,
3417
+ getEffectiveIsWeb,
3418
+ getGlobalDarkMode,
3419
+ getGlobalScreens,
3420
+ getGlobalWidth,
3421
+ getInteractiveModifiers,
3422
+ getModeModifiers,
3423
+ getModifier,
3424
+ getResponsiveModifiers,
3425
+ initConfig,
3426
+ isKnownModifier,
3427
+ isKnownUtility,
3428
+ isNative,
3429
+ isRuntimeCSSDisabled,
3430
+ isWeb,
3431
+ kbachWarn,
3432
+ matchModifier,
3433
+ normalizeClassString,
3434
+ onConfigChange,
3435
+ parseClass,
3436
+ parseClasses,
3437
+ parseHexRgb,
3438
+ registerModifier,
3439
+ resetConfig,
3440
+ resolve,
3441
+ resolveColor,
3442
+ resolveSizing,
3443
+ resolveSpacing,
3444
+ resolveUtility,
3445
+ setDefaultFontFamily,
3446
+ setGlobalDarkMode,
3447
+ setGlobalWidth,
3448
+ setResolveTarget,
3449
+ splitClassTokens,
3450
+ subscribeGlobalDarkMode,
3451
+ subscribeGlobalWidth,
3452
+ syncGlobalDarkMode,
3453
+ syncGlobalScreens,
3454
+ syncGlobalWidth,
3455
+ toNativeValue,
3456
+ updateConfig
3457
+ });