@tarve/core 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/CHANGELOG.md +126 -1
  2. package/README.md +121 -12
  3. package/dist/npm/build.js +1401 -85
  4. package/dist/npm/cli.js +1940 -117
  5. package/dist/npm/embedded-assets.js +22 -3
  6. package/dist/npm/index.js +5274 -975
  7. package/dist/npm/jsx-dev-runtime.js +1268 -0
  8. package/dist/npm/jsx-runtime.js +1268 -0
  9. package/dist/npm/native-runtime.json +3 -3
  10. package/dist/npm/node-build.js +1159 -0
  11. package/dist/npm/protocol.js +1 -1
  12. package/dist/npm/runtime.js +5 -5
  13. package/dist/npm/txiki/fetch.ts +228 -0
  14. package/dist/npm/txiki/intl-data.ts +7 -0
  15. package/dist/npm/txiki/intl.test.ts +53 -0
  16. package/dist/npm/txiki/intl.ts +249 -0
  17. package/dist/npm/txiki/prelude.ts +132 -0
  18. package/dist/npm/txiki/runtime.ts +6 -0
  19. package/dist/npm/txiki/shims/buffer.ts +112 -0
  20. package/dist/npm/txiki/shims/child-process.ts +151 -0
  21. package/dist/npm/txiki/shims/crypto.ts +30 -0
  22. package/dist/npm/txiki/shims/events.ts +75 -0
  23. package/dist/npm/txiki/shims/fs-promises.ts +77 -0
  24. package/dist/npm/txiki/shims/fs.ts +231 -0
  25. package/dist/npm/txiki/shims/module.ts +8 -0
  26. package/dist/npm/txiki/shims/net.ts +69 -0
  27. package/dist/npm/txiki/shims/os.ts +72 -0
  28. package/dist/npm/txiki/shims/path.ts +4 -0
  29. package/dist/npm/txiki/shims/timers-promises.ts +9 -0
  30. package/dist/npm/txiki/shims/zlib.ts +9 -0
  31. package/dist/npm/txiki/tjs.d.ts +58 -0
  32. package/dist/npm/txiki/unavailable.ts +10 -0
  33. package/dist/types/core/build.d.ts +24 -0
  34. package/dist/types/core/cli.d.ts +1 -1
  35. package/dist/types/core/esbuild-file-imports.d.ts +8 -0
  36. package/dist/types/core/jsx-compile.d.ts +7 -0
  37. package/dist/types/core/node-build.d.ts +7 -0
  38. package/dist/types/core/node-dev.d.ts +4 -0
  39. package/dist/types/core/node-target.d.ts +10 -0
  40. package/dist/types/core/package-metadata.d.ts +49 -0
  41. package/dist/types/core/runtime-select.d.ts +8 -0
  42. package/dist/types/core/src/advanced-controls.d.ts +1 -1
  43. package/dist/types/core/src/app/element-events.d.ts +18 -0
  44. package/dist/types/core/src/app/media.d.ts +15 -0
  45. package/dist/types/core/src/app/requests.d.ts +25 -0
  46. package/dist/types/core/src/app/shadow.d.ts +7 -0
  47. package/dist/types/core/src/app/stats.d.ts +12 -0
  48. package/dist/types/core/src/app/tray.d.ts +40 -0
  49. package/dist/types/core/src/app-metadata.d.ts +18 -0
  50. package/dist/types/core/src/app.d.ts +89 -2
  51. package/dist/types/core/src/assets.d.ts +4 -0
  52. package/dist/types/core/src/bridge/binding.d.ts +10 -34
  53. package/dist/types/core/src/bridge/index.d.ts +1 -1
  54. package/dist/types/core/src/canvas.d.ts +161 -0
  55. package/dist/types/core/src/chat-controls.d.ts +2 -1
  56. package/dist/types/core/src/components/button.d.ts +1 -1
  57. package/dist/types/core/src/components/glass.d.ts +52 -0
  58. package/dist/types/core/src/components/icon.d.ts +1 -1
  59. package/dist/types/core/src/components/image.d.ts +8 -4
  60. package/dist/types/core/src/components/layout.d.ts +5 -4
  61. package/dist/types/core/src/components/pressable.d.ts +3 -3
  62. package/dist/types/core/src/components/rich-content.d.ts +1 -1
  63. package/dist/types/core/src/components/scroll.d.ts +2 -2
  64. package/dist/types/core/src/components/svg.d.ts +1 -1
  65. package/dist/types/core/src/components/titlebar.d.ts +15 -1
  66. package/dist/types/core/src/components/window.d.ts +21 -1
  67. package/dist/types/core/src/components.d.ts +2 -0
  68. package/dist/types/core/src/css-shadow.d.ts +1 -1
  69. package/dist/types/core/src/desktop-controls.d.ts +2 -2
  70. package/dist/types/core/src/embedded-assets.d.ts +3 -2
  71. package/dist/types/core/src/extra-controls.d.ts +2 -2
  72. package/dist/types/core/src/form-controls.d.ts +1 -1
  73. package/dist/types/core/src/html-elements.d.ts +26 -0
  74. package/dist/types/core/src/index.d.ts +23 -11
  75. package/dist/types/core/src/inline-text.d.ts +25 -0
  76. package/dist/types/core/src/intrinsic-style.d.ts +1 -1
  77. package/dist/types/core/src/jsx-runtime.d.ts +182 -5
  78. package/dist/types/core/src/media-element.d.ts +70 -0
  79. package/dist/types/core/src/memo.d.ts +28 -0
  80. package/dist/types/core/src/motion.d.ts +1 -1
  81. package/dist/types/core/src/png.d.ts +29 -0
  82. package/dist/types/core/src/popups.d.ts +4 -3
  83. package/dist/types/core/src/protocol.d.ts +6 -0
  84. package/dist/types/core/src/reconciler/diff.d.ts +11 -0
  85. package/dist/types/core/src/reconciler/intrinsics.d.ts +24 -0
  86. package/dist/types/core/src/reconciler.d.ts +33 -10
  87. package/dist/types/core/src/render-scope.d.ts +8 -0
  88. package/dist/types/core/src/style.d.ts +1 -1
  89. package/dist/types/core/src/tailwind-palette.d.ts +1 -0
  90. package/dist/types/core/src/tailwind.d.ts +8 -0
  91. package/dist/types/core/src/test-renderer.d.ts +3 -1
  92. package/dist/types/core/src/text-search.d.ts +1 -1
  93. package/dist/types/core/src/theme.d.ts +10 -2
  94. package/dist/types/core/src/updates.d.ts +87 -0
  95. package/dist/types/core/src/virtual-list.d.ts +8 -2
  96. package/dist/types/core/txiki/fetch.d.ts +1 -0
  97. package/dist/types/core/txiki/intl-data.d.ts +6 -0
  98. package/dist/types/core/txiki/intl.d.ts +92 -0
  99. package/dist/types/core/txiki/prelude.d.ts +1 -0
  100. package/dist/types/core/txiki/runtime.d.ts +2 -0
  101. package/dist/types/core/txiki/shims/buffer.d.ts +37 -0
  102. package/dist/types/core/txiki/shims/child-process.d.ts +46 -0
  103. package/dist/types/core/txiki/shims/crypto.d.ts +16 -0
  104. package/dist/types/core/txiki/shims/events.d.ts +21 -0
  105. package/dist/types/core/txiki/shims/fs-promises.d.ts +41 -0
  106. package/dist/types/core/txiki/shims/fs.d.ts +44 -0
  107. package/dist/types/core/txiki/shims/module.d.ts +5 -0
  108. package/dist/types/core/txiki/shims/net.d.ts +22 -0
  109. package/dist/types/core/txiki/shims/os.d.ts +52 -0
  110. package/dist/types/core/txiki/shims/path.d.ts +3 -0
  111. package/dist/types/core/txiki/shims/timers-promises.d.ts +7 -0
  112. package/dist/types/core/txiki/shims/zlib.d.ts +11 -0
  113. package/dist/types/core/txiki/unavailable.d.ts +5 -0
  114. package/dist/types/core/txiki-build.d.ts +23 -0
  115. package/dist/types/core/updates-build.d.ts +35 -0
  116. package/dist/types/core/windows-executable.d.ts +16 -0
  117. package/dist/types/protocol/src/index.d.ts +344 -11
  118. package/native/linux-x64/libtarve_native.so +0 -0
  119. package/native/linux-x64/runtime.json +4 -4
  120. package/native/win32-x64/runtime.json +4 -4
  121. package/native/win32-x64/tarve_native.dll +0 -0
  122. package/package.json +13 -3
@@ -1,7 +1,1275 @@
1
1
  // @bun
2
+ // packages/core/src/css-shadow.ts
3
+ var NAMED = Object.fromEntries("aliceblue f0f8ff antiquewhite faebd7 aqua 00ffff aquamarine 7fffd4 azure f0ffff beige f5f5dc bisque ffe4c4 black 000000 blanchedalmond ffebcd blue 0000ff blueviolet 8a2be2 brown a52a2a burlywood deb887 cadetblue 5f9ea0 chartreuse 7fff00 chocolate d2691e coral ff7f50 cornflowerblue 6495ed cornsilk fff8dc crimson dc143c cyan 00ffff darkblue 00008b darkcyan 008b8b darkgoldenrod b8860b darkgray a9a9a9 darkgreen 006400 darkgrey a9a9a9 darkkhaki bdb76b darkmagenta 8b008b darkolivegreen 556b2f darkorange ff8c00 darkorchid 9932cc darkred 8b0000 darksalmon e9967a darkseagreen 8fbc8f darkslateblue 483d8b darkslategray 2f4f4f darkslategrey 2f4f4f darkturquoise 00ced1 darkviolet 9400d3 deeppink ff1493 deepskyblue 00bfff dimgray 696969 dimgrey 696969 dodgerblue 1e90ff firebrick b22222 floralwhite fffaf0 forestgreen 228b22 fuchsia ff00ff gainsboro dcdcdc ghostwhite f8f8ff gold ffd700 goldenrod daa520 gray 808080 green 008000 greenyellow adff2f grey 808080 honeydew f0fff0 hotpink ff69b4 indianred cd5c5c indigo 4b0082 ivory fffff0 khaki f0e68c lavender e6e6fa lavenderblush fff0f5 lawngreen 7cfc00 lemonchiffon fffacd lightblue add8e6 lightcoral f08080 lightcyan e0ffff lightgoldenrodyellow fafad2 lightgray d3d3d3 lightgreen 90ee90 lightgrey d3d3d3 lightpink ffb6c1 lightsalmon ffa07a lightseagreen 20b2aa lightskyblue 87cefa lightslategray 778899 lightslategrey 778899 lightsteelblue b0c4de lightyellow ffffe0 lime 00ff00 limegreen 32cd32 linen faf0e6 magenta ff00ff maroon 800000 mediumaquamarine 66cdaa mediumblue 0000cd mediumorchid ba55d3 mediumpurple 9370db mediumseagreen 3cb371 mediumslateblue 7b68ee mediumspringgreen 00fa9a mediumturquoise 48d1cc mediumvioletred c71585 midnightblue 191970 mintcream f5fffa mistyrose ffe4e1 moccasin ffe4b5 navajowhite ffdead navy 000080 oldlace fdf5e6 olive 808000 olivedrab 6b8e23 orange ffa500 orangered ff4500 orchid da70d6 palegoldenrod eee8aa palegreen 98fb98 paleturquoise afeeee palevioletred db7093 papayawhip ffefd5 peachpuff ffdab9 peru cd853f pink ffc0cb plum dda0dd powderblue b0e0e6 purple 800080 rebeccapurple 663399 red ff0000 rosybrown bc8f8f royalblue 4169e1 saddlebrown 8b4513 salmon fa8072 sandybrown f4a460 seagreen 2e8b57 seashell fff5ee sienna a0522d silver c0c0c0 skyblue 87ceeb slateblue 6a5acd slategray 708090 slategrey 708090 snow fffafa springgreen 00ff7f steelblue 4682b4 tan d2b48c teal 008080 thistle d8bfd8 tomato ff6347 turquoise 40e0d0 violet ee82ee wheat f5deb3 white ffffff whitesmoke f5f5f5 yellow ffff00 yellowgreen 9acd32 transparent 00000000".split(" ").flatMap((word, index, words) => index % 2 === 0 ? [[word, `#${words[index + 1]}`]] : []));
4
+
5
+ // packages/core/src/theme.ts
6
+ var defaultFocusOutline = {
7
+ outlineWidth: 2,
8
+ outlineOffset: 2,
9
+ outlineStyle: "solid"
10
+ };
11
+ var lightTheme = {
12
+ focusOutline: { ...defaultFocusOutline },
13
+ syntax: {
14
+ comment: "#6e7781",
15
+ keyword: "#cf222e",
16
+ string: "#0a3069",
17
+ stringSpecial: "#0550ae",
18
+ escape: "#953800",
19
+ number: "#0550ae",
20
+ boolean: "#0550ae",
21
+ typeName: "#8250df",
22
+ typeBuiltin: "#8250df",
23
+ constructor: "#8250df",
24
+ function: "#8250df",
25
+ functionBuiltin: "#6639ba",
26
+ macro: "#8250df",
27
+ property: "#953800",
28
+ constant: "#0550ae",
29
+ variable: "#24292f",
30
+ variableSpecial: "#953800",
31
+ parameter: "#24292f",
32
+ operator: "#cf222e",
33
+ punctuation: "#57606a",
34
+ tag: "#116329",
35
+ attribute: "#0550ae",
36
+ label: "#953800",
37
+ embedded: "#24292f",
38
+ invalid: "#cf222e"
39
+ },
40
+ colors: {
41
+ background: "#fafafa",
42
+ card: "#ffffff",
43
+ foreground: "#18181b",
44
+ muted: "#f4f4f5",
45
+ mutedForeground: "#71717a",
46
+ border: "#e4e4e7",
47
+ input: "#ffffff",
48
+ primary: "#18181b",
49
+ primaryForeground: "#fafafa",
50
+ primaryHover: "#303036",
51
+ primaryActive: "#3f3f46",
52
+ secondary: "#f4f4f5",
53
+ secondaryForeground: "#18181b",
54
+ secondaryHover: "#e4e4e7",
55
+ secondaryActive: "#d4d4d8",
56
+ destructive: "#dc2626",
57
+ destructiveForeground: "#ffffff",
58
+ destructiveHover: "#b91c1c",
59
+ destructiveActive: "#991b1b",
60
+ destructiveText: "#dc2626",
61
+ ring: "#a1a1aa",
62
+ ringSoft: "#aeaeb6",
63
+ success: "#15803d",
64
+ successMuted: "#f0fdf4",
65
+ diffAddBackground: "#dcfce7",
66
+ diffAddEmphasisBackground: "#bbf7d0",
67
+ diffAddForeground: "#14532d",
68
+ diffAddAccent: "#15803d",
69
+ diffRemoveBackground: "#fee2e2",
70
+ diffRemoveEmphasisBackground: "#fecaca",
71
+ diffRemoveForeground: "#7f1d1d",
72
+ diffRemoveAccent: "#dc2626",
73
+ disabled: "#e4e4e7",
74
+ disabledForeground: "#a1a1aa",
75
+ placeholder: "#a1a1aa",
76
+ selection: "#dbeafe",
77
+ scrollbar: "#d4d4d8",
78
+ overlay: "#00000066",
79
+ imagePlaceholder: "#f4f4f5",
80
+ sliderThumb: "#ffffff",
81
+ windowCloseHover: "#e81123",
82
+ windowCloseActive: "#c50f1f"
83
+ }
84
+ };
85
+ var darkTheme = {
86
+ focusOutline: { ...defaultFocusOutline },
87
+ syntax: {
88
+ comment: "#8b949e",
89
+ keyword: "#ff7b72",
90
+ string: "#a5d6ff",
91
+ stringSpecial: "#79c0ff",
92
+ escape: "#ffa657",
93
+ number: "#79c0ff",
94
+ boolean: "#79c0ff",
95
+ typeName: "#d2a8ff",
96
+ typeBuiltin: "#d2a8ff",
97
+ constructor: "#d2a8ff",
98
+ function: "#d2a8ff",
99
+ functionBuiltin: "#bc8cff",
100
+ macro: "#d2a8ff",
101
+ property: "#ffa657",
102
+ constant: "#79c0ff",
103
+ variable: "#c9d1d9",
104
+ variableSpecial: "#ffa657",
105
+ parameter: "#c9d1d9",
106
+ operator: "#ff7b72",
107
+ punctuation: "#8b949e",
108
+ tag: "#7ee787",
109
+ attribute: "#79c0ff",
110
+ label: "#ffa657",
111
+ embedded: "#c9d1d9",
112
+ invalid: "#f85149"
113
+ },
114
+ colors: {
115
+ background: "#09090b",
116
+ card: "#09090b",
117
+ foreground: "#fafafa",
118
+ muted: "#27272a",
119
+ mutedForeground: "#a1a1aa",
120
+ border: "#27272a",
121
+ input: "#18181b",
122
+ primary: "#fafafa",
123
+ primaryForeground: "#18181b",
124
+ primaryHover: "#e4e4e7",
125
+ primaryActive: "#d4d4d8",
126
+ secondary: "#27272a",
127
+ secondaryForeground: "#fafafa",
128
+ secondaryHover: "#3f3f46",
129
+ secondaryActive: "#52525b",
130
+ destructive: "#7f1d1d",
131
+ destructiveForeground: "#fafafa",
132
+ destructiveHover: "#991b1b",
133
+ destructiveActive: "#b91c1c",
134
+ destructiveText: "#f87171",
135
+ ring: "#d4d4d8",
136
+ ringSoft: "#b1b1b5",
137
+ success: "#4ade80",
138
+ successMuted: "#052e16",
139
+ diffAddBackground: "#052e16",
140
+ diffAddEmphasisBackground: "#14532d",
141
+ diffAddForeground: "#a7f3d0",
142
+ diffAddAccent: "#4ade80",
143
+ diffRemoveBackground: "#450a0a",
144
+ diffRemoveEmphasisBackground: "#7f1d1d",
145
+ diffRemoveForeground: "#fecaca",
146
+ diffRemoveAccent: "#f87171",
147
+ disabled: "#27272a",
148
+ disabledForeground: "#71717a",
149
+ placeholder: "#71717a",
150
+ selection: "#1e3a5f",
151
+ scrollbar: "#52525b",
152
+ overlay: "#00000099",
153
+ imagePlaceholder: "#18181b",
154
+ sliderThumb: "#fafafa",
155
+ windowCloseHover: "#e81123",
156
+ windowCloseActive: "#c50f1f"
157
+ }
158
+ };
159
+ var names = Object.keys(lightTheme.colors);
160
+ var cssName = (name) => name.replace(/[A-Z]/g, (value) => `-${value.toLowerCase()}`);
161
+ var refs = Object.fromEntries(names.map((name) => [name, `var(--${cssName(name)})`]));
162
+ var keyByRef = new Map(names.map((name) => [refs[name], name]));
163
+ var theme = {
164
+ colors: refs,
165
+ space: { xs: 4, sm: 8, md: 12, lg: 16, xl: 24, xxl: 32 },
166
+ radius: { sm: 6, md: 8, lg: 12 },
167
+ font: { family: "system-ui", size: 14, lineHeight: 1.5 }
168
+ };
169
+ var resolvedStrings = new WeakMap;
170
+ var resolvedStyles = new WeakMap;
171
+ var buttonVariants = {
172
+ default: {
173
+ background: theme.colors.primary,
174
+ foreground: theme.colors.primaryForeground,
175
+ hover: { background: theme.colors.primaryHover },
176
+ active: { background: theme.colors.primaryActive }
177
+ },
178
+ secondary: {
179
+ background: theme.colors.secondary,
180
+ foreground: theme.colors.secondaryForeground,
181
+ hover: { background: theme.colors.secondaryHover },
182
+ active: { background: theme.colors.secondaryActive }
183
+ },
184
+ outline: {
185
+ background: theme.colors.input,
186
+ foreground: theme.colors.foreground,
187
+ borderColor: theme.colors.border,
188
+ borderWidth: 1,
189
+ hover: { background: theme.colors.muted },
190
+ active: { background: theme.colors.secondaryActive }
191
+ },
192
+ ghost: {
193
+ background: "#00000000",
194
+ foreground: theme.colors.foreground,
195
+ hover: { background: theme.colors.muted },
196
+ active: { background: theme.colors.secondaryActive }
197
+ },
198
+ destructive: {
199
+ background: theme.colors.destructive,
200
+ foreground: theme.colors.destructiveForeground,
201
+ hover: { background: theme.colors.destructiveHover },
202
+ active: { background: theme.colors.destructiveActive }
203
+ }
204
+ };
205
+
206
+ // packages/core/src/tailwind-palette.ts
207
+ var PALETTE = {
208
+ red: "fef2f2 ffe2e2 ffc9c9 ffa2a2 ff6467 fb2c36 e7000b c10007 9f0712 82181a 460809",
209
+ orange: "fff7ed ffedd4 ffd6a8 ffb86a ff8904 ff6900 f54a00 ca3500 9f2d00 7e2a0c 441306",
210
+ amber: "fffbeb fef3c6 fee685 ffd230 ffba00 fd9a00 e17100 bb4d00 973c00 7b3306 461901",
211
+ yellow: "fefce8 fef9c2 fff085 ffdf20 fcc800 efb100 d08700 a65f00 894b00 733e0a 432004",
212
+ lime: "f7fee7 ecfcca d8f999 bbf451 9ae600 7ccf00 5ea500 497d00 3d6300 35530e 192e03",
213
+ green: "f0fdf4 dcfce7 b9f8cf 7bf1a8 05df72 00c951 00a63e 008236 016630 0d542b 032e15",
214
+ emerald: "ecfdf5 d0fae5 a4f4cf 5ee9b5 00d492 00bc7d 009966 007a55 006045 004f3b 002c22",
215
+ teal: "f0fdfa cbfbf1 96f7e4 46ecd5 00d5be 00bba7 009689 00786f 005f5a 0b4f4a 022f2e",
216
+ cyan: "ecfeff cefafe a2f4fd 53eafd 00d3f2 00b8db 0092b8 007595 005f78 104e64 053345",
217
+ sky: "f0f9ff dff2fe b8e6fe 74d4ff 00bcff 00a6f4 0084d1 0069a8 00598a 024a70 052f4a",
218
+ blue: "eff6ff dbeafe bedbff 8ec5ff 51a2ff 2b7fff 155dfc 1447e6 193cb8 1c398e 162456",
219
+ indigo: "eef2ff e0e7ff c6d2ff a3b3ff 7c86ff 615fff 4f39f6 432dd7 372aac 312c85 1e1a4d",
220
+ violet: "f5f3ff ede9fe ddd6ff c4b4ff a684ff 8e51ff 7f22fe 7008e7 5d0ec0 4d179a 2f0d68",
221
+ purple: "faf5ff f3e8ff e9d4ff dab2ff c27aff ad46ff 9810fa 8200db 6e11b0 59168b 3c0366",
222
+ fuchsia: "fdf4ff fae8ff f6cfff f4a8ff ed6bff e12afb c800de a800b7 8a0194 721378 4b004f",
223
+ pink: "fdf2f8 fce7f3 fccee8 fda5d5 fb64b6 f6339a e60076 c6005c a3004c 861043 510424",
224
+ rose: "fff1f2 ffe4e6 ffccd3 ffa1ad ff637e ff2056 ec003f c70036 a50036 8b0836 4d0218",
225
+ slate: "f8fafc f1f5f9 e2e8f0 cad5e2 90a1b9 62748e 45556c 314158 1d293d 0f172b 020618",
226
+ gray: "f9fafb f3f4f6 e5e7eb d1d5dc 99a1af 6a7282 4a5565 364153 1e2939 101828 030712",
227
+ zinc: "fafafa f4f4f5 e4e4e7 d4d4d8 9f9fa9 71717b 52525c 3f3f46 27272a 18181b 09090b",
228
+ neutral: "fafafa f5f5f5 e5e5e5 d4d4d4 a1a1a1 737373 525252 404040 262626 171717 0a0a0a",
229
+ stone: "fafaf9 f5f5f4 e7e5e4 d6d3d1 a6a09b 79716b 57534d 44403b 292524 1c1917 0c0a09"
230
+ };
231
+
232
+ // packages/core/src/tailwind.ts
233
+ var UNIT = 4;
234
+ var BASE_FONT = 16;
235
+ var SIDES = {
236
+ "": "all",
237
+ x: ["left", "right"],
238
+ y: ["top", "bottom"],
239
+ t: ["top"],
240
+ r: ["right"],
241
+ b: ["bottom"],
242
+ l: ["left"],
243
+ s: ["left"],
244
+ e: ["right"]
245
+ };
246
+ var SHADES = ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900", "950"];
247
+ var NAMED_COLORS = { white: "#ffffff", black: "#000000", transparent: "transparent" };
248
+ var FONT_SIZES = {
249
+ xs: [12, 16],
250
+ sm: [14, 20],
251
+ base: [16, 24],
252
+ lg: [18, 28],
253
+ xl: [20, 28],
254
+ "2xl": [24, 32],
255
+ "3xl": [30, 36],
256
+ "4xl": [36, 40],
257
+ "5xl": [48, 48],
258
+ "6xl": [60, 60],
259
+ "7xl": [72, 72],
260
+ "8xl": [96, 96],
261
+ "9xl": [128, 128]
262
+ };
263
+ var FONT_WEIGHTS = {
264
+ thin: 100,
265
+ extralight: 200,
266
+ light: 300,
267
+ normal: 400,
268
+ medium: 500,
269
+ semibold: 600,
270
+ bold: 700,
271
+ extrabold: 800,
272
+ black: 900
273
+ };
274
+ var FONT_FAMILIES = { sans: "system-ui", serif: "serif", mono: "monospace" };
275
+ var LEADING = { none: 1, tight: 1.25, snug: 1.375, normal: 1.5, relaxed: 1.625, loose: 2 };
276
+ var TRACKING = { tighter: -0.05, tight: -0.025, normal: 0, wide: 0.025, wider: 0.05, widest: 0.1 };
277
+ var RADII = { none: 0, xs: 2, sm: 4, "": 4, md: 6, lg: 8, xl: 12, "2xl": 16, "3xl": 24, "4xl": 32, full: 9999 };
278
+ var CONTAINERS = {
279
+ "3xs": 256,
280
+ "2xs": 288,
281
+ xs: 320,
282
+ sm: 384,
283
+ md: 448,
284
+ lg: 512,
285
+ xl: 576,
286
+ "2xl": 672,
287
+ "3xl": 768,
288
+ "4xl": 896,
289
+ "5xl": 1024,
290
+ "6xl": 1152,
291
+ "7xl": 1280
292
+ };
293
+ var SHADOWS = {
294
+ "2xs": "0 1px #0000000d",
295
+ xs: "0 1px 2px 0 #0000000d",
296
+ sm: "0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a",
297
+ "": "0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a",
298
+ md: "0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a",
299
+ lg: "0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a",
300
+ xl: "0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a",
301
+ "2xl": "0 25px 50px -12px #00000040",
302
+ none: "none"
303
+ };
304
+ var TEXT_SHADOWS = {
305
+ "2xs": "0 1px 0 #00000026",
306
+ xs: "0 1px 1px #00000033",
307
+ sm: "0 2px 2px #00000013",
308
+ md: "0 2px 4px #00000013",
309
+ lg: "0 3px 6px #00000013",
310
+ none: "none"
311
+ };
312
+ var BLURS = { xs: 4, sm: 8, md: 12, lg: 16, xl: 24, "2xl": 40, "3xl": 64, none: 0 };
313
+ var OBJECT_FITS = new Set(["fill", "contain", "cover", "none", "scale-down"]);
314
+ var INSET_SHADOWS = {
315
+ "2xs": "inset 0 1px #0000000d",
316
+ xs: "inset 0 1px 1px #0000000d",
317
+ sm: "inset 0 2px 4px #0000000d",
318
+ none: "none"
319
+ };
320
+ var EASINGS = { linear: "linear", in: "easeIn", out: "easeOut", "in-out": "easeInOut" };
321
+ var CURSORS = new Set(["auto", "default", "pointer", "text", "vertical-text", "move", "grab", "grabbing", "not-allowed", "no-drop", "wait", "progress", "help", "crosshair", "copy", "alias", "context-menu", "cell", "zoom-in", "zoom-out", "col-resize", "row-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "all-scroll"]);
322
+ var BORDER_STYLES = new Set(["solid", "dashed", "dotted", "double", "none", "hidden"]);
323
+ var OVERFLOWS = new Set(["visible", "hidden", "clip", "auto", "scroll"]);
324
+ var WHITESPACE = new Set(["normal", "nowrap", "pre", "pre-wrap", "pre-line"]);
325
+ var STATE_VARIANTS = {
326
+ hover: "hover",
327
+ focus: "focus",
328
+ "focus-visible": "focusVisible",
329
+ active: "active",
330
+ disabled: "disabled",
331
+ "group-hover": "groupHover",
332
+ "focus-within": "focusWithin"
333
+ };
334
+ var WRAPPER_VARIANTS = new Set(["dark", "first", "last", "odd", "even", "sm", "md", "lg", "xl", "2xl"]);
335
+ var STATIC = {
336
+ flex: { display: "flex" },
337
+ "inline-flex": { display: "flex" },
338
+ grid: { display: "grid" },
339
+ "inline-grid": { display: "grid" },
340
+ block: { display: "block" },
341
+ hidden: { display: "none" },
342
+ "flex-row": { direction: "row" },
343
+ "flex-row-reverse": { direction: "row-reverse" },
344
+ "flex-col": { direction: "column" },
345
+ "flex-col-reverse": { direction: "column-reverse" },
346
+ "flex-wrap": { wrap: true },
347
+ "flex-nowrap": { wrap: false },
348
+ "flex-1": { flex: 1 },
349
+ "flex-auto": { flex: "1 1 auto" },
350
+ "flex-initial": { flex: "0 1 auto" },
351
+ "flex-none": { flex: "none" },
352
+ grow: { grow: 1 },
353
+ "grow-0": { grow: 0 },
354
+ shrink: { shrink: 1 },
355
+ "shrink-0": { shrink: 0 },
356
+ "flex-grow": { grow: 1 },
357
+ "flex-grow-0": { grow: 0 },
358
+ "flex-shrink": { shrink: 1 },
359
+ "flex-shrink-0": { shrink: 0 },
360
+ "items-start": { align: "start" },
361
+ "items-center": { align: "center" },
362
+ "items-end": { align: "end" },
363
+ "items-stretch": { align: "stretch" },
364
+ "items-baseline": { align: "baseline" },
365
+ "self-auto": { alignSelf: undefined },
366
+ "self-start": { alignSelf: "start" },
367
+ "self-center": { alignSelf: "center" },
368
+ "self-end": { alignSelf: "end" },
369
+ "self-stretch": { alignSelf: "stretch" },
370
+ "self-baseline": { alignSelf: "baseline" },
371
+ "content-start": { alignContent: "start" },
372
+ "content-center": { alignContent: "center" },
373
+ "content-end": { alignContent: "end" },
374
+ "content-stretch": { alignContent: "stretch" },
375
+ "content-between": { alignContent: "between" },
376
+ "content-around": { alignContent: "around" },
377
+ "content-evenly": { alignContent: "evenly" },
378
+ "justify-items-start": { justifyItems: "start" },
379
+ "justify-items-center": { justifyItems: "center" },
380
+ "justify-items-end": { justifyItems: "end" },
381
+ "justify-items-stretch": { justifyItems: "stretch" },
382
+ "justify-self-auto": { justifySelf: undefined },
383
+ "justify-self-start": { justifySelf: "start" },
384
+ "justify-self-center": { justifySelf: "center" },
385
+ "justify-self-end": { justifySelf: "end" },
386
+ "justify-self-stretch": { justifySelf: "stretch" },
387
+ "place-items-start": { align: "start", justifyItems: "start" },
388
+ "place-items-center": { align: "center", justifyItems: "center" },
389
+ "place-items-end": { align: "end", justifyItems: "end" },
390
+ "place-items-stretch": { align: "stretch", justifyItems: "stretch" },
391
+ "place-content-start": { alignContent: "start", justify: "start" },
392
+ "place-content-center": { alignContent: "center", justify: "center" },
393
+ "place-content-end": { alignContent: "end", justify: "end" },
394
+ "place-content-between": { alignContent: "between", justify: "between" },
395
+ "place-content-around": { alignContent: "around", justify: "around" },
396
+ "place-content-evenly": { alignContent: "evenly", justify: "evenly" },
397
+ "place-content-stretch": { alignContent: "stretch", justify: "stretch" },
398
+ "place-self-auto": { alignSelf: undefined, justifySelf: undefined },
399
+ "place-self-start": { alignSelf: "start", justifySelf: "start" },
400
+ "place-self-center": { alignSelf: "center", justifySelf: "center" },
401
+ "place-self-end": { alignSelf: "end", justifySelf: "end" },
402
+ "place-self-stretch": { alignSelf: "stretch", justifySelf: "stretch" },
403
+ "justify-stretch": { justify: "stretch" },
404
+ "text-justify": { textAlign: "justify" },
405
+ group: { group: true },
406
+ "pointer-events-none": { pointerEvents: "none" },
407
+ "origin-center": { transform: { originX: 0.5, originY: 0.5 } },
408
+ "origin-top": { transform: { originX: 0.5, originY: 0 } },
409
+ "origin-top-right": { transform: { originX: 1, originY: 0 } },
410
+ "origin-right": { transform: { originX: 1, originY: 0.5 } },
411
+ "origin-bottom-right": { transform: { originX: 1, originY: 1 } },
412
+ "origin-bottom": { transform: { originX: 0.5, originY: 1 } },
413
+ "origin-bottom-left": { transform: { originX: 0, originY: 1 } },
414
+ "origin-left": { transform: { originX: 0, originY: 0.5 } },
415
+ "origin-top-left": { transform: { originX: 0, originY: 0 } },
416
+ "justify-start": { justify: "start" },
417
+ "justify-center": { justify: "center" },
418
+ "justify-end": { justify: "end" },
419
+ "justify-between": { justify: "between" },
420
+ "justify-around": { justify: "around" },
421
+ "justify-evenly": { justify: "evenly" },
422
+ relative: { position: "relative" },
423
+ absolute: { position: "absolute" },
424
+ static: { position: "relative" },
425
+ "sr-only": { position: "absolute", width: 1, height: 1, padding: 0, margin: -1, overflow: "hidden", whiteSpace: "nowrap" },
426
+ "pointer-events-auto": { pointerEvents: "auto" },
427
+ "transition-none": { transition: undefined },
428
+ italic: { fontStyle: "italic" },
429
+ "not-italic": { fontStyle: "normal" },
430
+ "text-left": { textAlign: "start" },
431
+ "text-start": { textAlign: "start" },
432
+ "text-center": { textAlign: "center" },
433
+ "text-right": { textAlign: "end" },
434
+ "text-end": { textAlign: "end" },
435
+ "text-ellipsis": { textOverflow: "ellipsis" },
436
+ "text-clip": { textOverflow: "clip" },
437
+ truncate: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
438
+ uppercase: { textTransform: "uppercase" },
439
+ lowercase: { textTransform: "lowercase" },
440
+ capitalize: { textTransform: "capitalize" },
441
+ "normal-case": { textTransform: "none" },
442
+ underline: { textDecoration: "underline" },
443
+ overline: { textDecoration: "overline" },
444
+ "line-through": { textDecoration: "line-through" },
445
+ "no-underline": { textDecoration: "none" },
446
+ "decoration-solid": { textDecorationStyle: "solid" },
447
+ "decoration-double": { textDecorationStyle: "double" },
448
+ "decoration-dotted": { textDecorationStyle: "dotted" },
449
+ "decoration-dashed": { textDecorationStyle: "dashed" },
450
+ "decoration-wavy": { textDecorationStyle: "wavy" },
451
+ "tabular-nums": { fontVariantNumeric: "tabular-nums" },
452
+ "normal-nums": { fontVariantNumeric: "normal" },
453
+ "slashed-zero": { fontVariantNumeric: "slashed-zero" },
454
+ "select-none": { userSelect: "none" },
455
+ "select-text": { userSelect: "text" },
456
+ "select-all": { userSelect: "all" },
457
+ "select-auto": { userSelect: "auto" },
458
+ "aspect-square": { aspectRatio: 1 },
459
+ "aspect-video": { aspectRatio: 16 / 9 },
460
+ "col-span-full": { gridColumn: "1 / -1" },
461
+ "row-span-full": { gridRow: "1 / -1" },
462
+ "outline-none": { outlineStyle: "none" },
463
+ "outline-hidden": { outlineStyle: "none" },
464
+ "outline-solid": { outlineStyle: "solid" },
465
+ "outline-dashed": { outlineStyle: "dashed" },
466
+ "outline-dotted": { outlineStyle: "dotted" },
467
+ "line-clamp-none": { lineClamp: undefined },
468
+ "shadow-none": { boxShadow: "none" }
469
+ };
470
+ function arbitrary(value) {
471
+ return value.length > 2 && value.startsWith("[") && value.endsWith("]") ? value.slice(1, -1).replace(/_/g, " ") : undefined;
472
+ }
473
+ function px(raw) {
474
+ const match = /^(-?\d*\.?\d+)(px|rem|em)?$/.exec(raw);
475
+ if (!match)
476
+ return;
477
+ const number = Number(match[1]);
478
+ return match[2] === "rem" || match[2] === "em" ? number * BASE_FONT : number;
479
+ }
480
+ function length(value, allowAuto = true) {
481
+ const raw = arbitrary(value);
482
+ if (raw !== undefined)
483
+ return /^-?\d*\.?\d+%$/.test(raw) ? raw : px(raw);
484
+ if (value === "full")
485
+ return "100%";
486
+ if (value === "auto")
487
+ return allowAuto ? "auto" : undefined;
488
+ if (value === "px")
489
+ return 1;
490
+ const fraction = /^(\d+)\/(\d+)$/.exec(value);
491
+ if (fraction)
492
+ return `${Math.round(Number(fraction[1]) / Number(fraction[2]) * 1e6) / 1e4}%`;
493
+ const number = /^\d*\.?\d+$/.test(value) ? Number(value) : undefined;
494
+ return number === undefined ? undefined : number * UNIT;
495
+ }
496
+ function number(value) {
497
+ const raw = arbitrary(value) ?? value;
498
+ return /^-?\d*\.?\d+$/.test(raw) ? Number(raw) : undefined;
499
+ }
500
+ function alpha(hex, opacity) {
501
+ const channel = Math.round(Math.max(0, Math.min(1, opacity)) * 255).toString(16).padStart(2, "0");
502
+ return (hex.length === 4 ? "#" + [...hex.slice(1)].map((c) => c + c).join("") : hex) + channel;
503
+ }
504
+ var camel = (name) => name.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
505
+ function color(value) {
506
+ const raw = arbitrary(value);
507
+ if (raw !== undefined)
508
+ return raw;
509
+ const slash = value.lastIndexOf("/");
510
+ if (slash > 0 && value[slash - 1] === "]") {
511
+ const inner = arbitrary(value.slice(0, slash));
512
+ const opacity = number(value.slice(slash + 1));
513
+ if (inner === undefined || opacity === undefined)
514
+ return;
515
+ return inner.startsWith("#") ? alpha(inner, opacity / 100) : inner;
516
+ }
517
+ const opacity = slash > 0 ? number(value.slice(slash + 1)) : undefined;
518
+ const name = slash > 0 && opacity !== undefined ? value.slice(0, slash) : value;
519
+ let resolved = NAMED_COLORS[name];
520
+ if (resolved === undefined) {
521
+ const dash = name.lastIndexOf("-");
522
+ const family = PALETTE[name.slice(0, dash)];
523
+ const shade = SHADES.indexOf(name.slice(dash + 1));
524
+ if (family && shade >= 0)
525
+ resolved = "#" + family.split(" ")[shade];
526
+ }
527
+ if (resolved === undefined)
528
+ resolved = theme.colors[camel(name)];
529
+ if (resolved === undefined || opacity === undefined)
530
+ return resolved;
531
+ if (resolved.startsWith("var("))
532
+ return `${resolved}/${Math.max(0, Math.min(100, opacity))}`;
533
+ return resolved.startsWith("#") ? alpha(resolved, opacity / 100) : resolved;
534
+ }
535
+ function setInsets(out, key, sides, value) {
536
+ if (sides === "all") {
537
+ out[key] = value;
538
+ return;
539
+ }
540
+ const current = out[key];
541
+ const next = typeof current === "number" || current === "auto" ? { top: current, right: current, bottom: current, left: current } : { ...current ?? {} };
542
+ for (const side of sides)
543
+ next[side] = value;
544
+ out[key] = next;
545
+ }
546
+ function setTransform(out, patch) {
547
+ out.transform = { ...typeof out.transform === "object" && out.transform ? out.transform : {}, ...patch };
548
+ }
549
+ function setTransition(out, patch) {
550
+ out[TRANSITION] = { ...out[TRANSITION], ...patch };
551
+ }
552
+ function finishTransition(out) {
553
+ const pending = out[TRANSITION];
554
+ if (!pending)
555
+ return;
556
+ delete out[TRANSITION];
557
+ if (pending.duration === undefined || pending.duration <= 0)
558
+ return;
559
+ out.transition = { all: pending };
560
+ }
561
+ function fontSizeOf(out) {
562
+ return typeof out.fontSize === "number" ? out.fontSize : theme.font.size || BASE_FONT;
563
+ }
564
+ function insetHandler(key, sides) {
565
+ return (out, value, negative) => {
566
+ if (value === "auto" && key === "margin") {
567
+ setInsets(out, key, sides, "auto");
568
+ return;
569
+ }
570
+ const resolved = length(value, false);
571
+ if (typeof resolved === "number")
572
+ setInsets(out, key, sides, negative ? -resolved : resolved);
573
+ };
574
+ }
575
+ function containerHandler(key, allowAuto = true) {
576
+ const plain = lengthHandler(key, allowAuto);
577
+ return (out, value, negative) => {
578
+ const named = CONTAINERS[value];
579
+ if (named !== undefined)
580
+ out[key] = named;
581
+ else
582
+ plain(out, value, negative);
583
+ };
584
+ }
585
+ function lengthHandler(key, allowAuto = true) {
586
+ return (out, value, negative) => {
587
+ const resolved = length(value, allowAuto);
588
+ if (resolved !== undefined)
589
+ out[key] = negative && typeof resolved === "number" ? -resolved : resolved;
590
+ };
591
+ }
592
+ function offsetHandler(keys) {
593
+ return (out, value, negative) => {
594
+ const resolved = length(value);
595
+ if (resolved === undefined)
596
+ return;
597
+ for (const key of keys)
598
+ out[key] = negative && typeof resolved === "number" ? -resolved : resolved;
599
+ };
600
+ }
601
+ function borderSideHandler(sides) {
602
+ return (out, value) => {
603
+ const width = value === "" ? 1 : px(arbitrary(value) ?? value);
604
+ if (width !== undefined)
605
+ setInsets(out, "borderWidth", sides, width);
606
+ };
607
+ }
608
+ var HANDLERS = {
609
+ p: insetHandler("padding", "all"),
610
+ m: insetHandler("margin", "all"),
611
+ w: containerHandler("width"),
612
+ h: lengthHandler("height"),
613
+ "min-w": containerHandler("minWidth", false),
614
+ "min-h": lengthHandler("minHeight", false),
615
+ "max-h": lengthHandler("maxHeight", false),
616
+ "max-w": (out, value) => {
617
+ if (value === "none") {
618
+ out.maxWidth = undefined;
619
+ return;
620
+ }
621
+ const resolved = CONTAINERS[value] ?? length(value, false);
622
+ if (resolved !== undefined)
623
+ out.maxWidth = resolved;
624
+ },
625
+ start: offsetHandler(["left"]),
626
+ end: offsetHandler(["right"]),
627
+ "space-x": lengthHandler("columnGap", false),
628
+ "space-y": lengthHandler("rowGap", false),
629
+ object: (out, value) => {
630
+ if (OBJECT_FITS.has(value))
631
+ out.objectFit = value;
632
+ },
633
+ animate: (out, value) => {
634
+ if (value === "spin")
635
+ out.spin = 1000;
636
+ else if (value === "none")
637
+ out.spin = undefined;
638
+ },
639
+ "backdrop-blur": (out, value) => {
640
+ const blur = value === "" ? 8 : BLURS[value] ?? px(arbitrary(value) ?? "");
641
+ if (blur !== undefined)
642
+ setGlass(out, { blur });
643
+ },
644
+ "backdrop-saturate": (out, value) => {
645
+ const n = number(value);
646
+ if (n !== undefined)
647
+ setGlass(out, { saturate: n / 100 });
648
+ },
649
+ "text-shadow": (out, value) => {
650
+ const named = TEXT_SHADOWS[value];
651
+ if (named !== undefined) {
652
+ out.textShadow = named;
653
+ return;
654
+ }
655
+ const c = color(value);
656
+ if (c !== undefined)
657
+ pendingShadow(out).text = c;
658
+ },
659
+ size: (out, value) => {
660
+ const resolved = length(value);
661
+ if (resolved !== undefined) {
662
+ out.width = resolved;
663
+ out.height = resolved;
664
+ }
665
+ },
666
+ gap: lengthHandler("gap", false),
667
+ "gap-x": lengthHandler("columnGap", false),
668
+ "gap-y": lengthHandler("rowGap", false),
669
+ top: offsetHandler(["top"]),
670
+ right: offsetHandler(["right"]),
671
+ bottom: offsetHandler(["bottom"]),
672
+ left: offsetHandler(["left"]),
673
+ inset: offsetHandler(["top", "right", "bottom", "left"]),
674
+ "inset-x": offsetHandler(["left", "right"]),
675
+ "inset-y": offsetHandler(["top", "bottom"]),
676
+ z: (out, value, negative) => {
677
+ const resolved = number(value);
678
+ if (resolved !== undefined)
679
+ out.zIndex = negative ? -resolved : resolved;
680
+ },
681
+ flex: (out, value) => {
682
+ const raw = arbitrary(value);
683
+ if (raw !== undefined)
684
+ out.flex = /^\d+$/.test(raw) ? Number(raw) : raw;
685
+ },
686
+ grow: (out, value) => {
687
+ const n = number(value);
688
+ if (n !== undefined)
689
+ out.grow = n;
690
+ },
691
+ shrink: (out, value) => {
692
+ const n = number(value);
693
+ if (n !== undefined)
694
+ out.shrink = n;
695
+ },
696
+ basis: lengthHandler("basis"),
697
+ "grid-cols": (out, value) => {
698
+ const raw = arbitrary(value);
699
+ if (raw !== undefined)
700
+ out.columns = raw;
701
+ else if (/^\d+$/.test(value))
702
+ out.columns = Number(value);
703
+ },
704
+ "grid-rows": (out, value) => {
705
+ const raw = arbitrary(value);
706
+ if (raw !== undefined)
707
+ out.rows = raw;
708
+ else if (/^\d+$/.test(value))
709
+ out.rows = Number(value);
710
+ },
711
+ "col-span": (out, value) => {
712
+ if (/^\d+$/.test(value))
713
+ out.gridColumn = `span ${value}`;
714
+ },
715
+ "row-span": (out, value) => {
716
+ if (/^\d+$/.test(value))
717
+ out.gridRow = `span ${value}`;
718
+ },
719
+ "col-start": (out, value) => {
720
+ if (/^\d+$/.test(value))
721
+ out.gridColumn = Number(value);
722
+ },
723
+ "row-start": (out, value) => {
724
+ if (/^\d+$/.test(value))
725
+ out.gridRow = Number(value);
726
+ },
727
+ text: (out, value) => {
728
+ const slash = value.indexOf("/");
729
+ const size = FONT_SIZES[slash > 0 ? value.slice(0, slash) : value];
730
+ if (size) {
731
+ out.fontSize = size[0];
732
+ out.lineHeight = Math.round(size[1] / size[0] * 1000) / 1000;
733
+ if (slash > 0)
734
+ HANDLERS.leading(out, value.slice(slash + 1), false);
735
+ return;
736
+ }
737
+ const raw = arbitrary(value);
738
+ if (raw !== undefined) {
739
+ const resolved = px(raw);
740
+ if (resolved !== undefined)
741
+ out.fontSize = resolved;
742
+ else
743
+ out.foreground = raw;
744
+ return;
745
+ }
746
+ const resolved = color(value);
747
+ if (resolved !== undefined)
748
+ out.foreground = resolved;
749
+ },
750
+ font: (out, value) => {
751
+ const weight = FONT_WEIGHTS[value];
752
+ if (weight !== undefined) {
753
+ out.fontWeight = weight;
754
+ return;
755
+ }
756
+ const raw = arbitrary(value);
757
+ if (raw !== undefined) {
758
+ if (/^\d+$/.test(raw))
759
+ out.fontWeight = Number(raw);
760
+ else
761
+ out.fontFamily = raw;
762
+ return;
763
+ }
764
+ const family = FONT_FAMILIES[value];
765
+ if (family !== undefined)
766
+ out.fontFamily = family;
767
+ },
768
+ leading: (out, value) => {
769
+ const named = LEADING[value];
770
+ if (named !== undefined) {
771
+ out.lineHeight = named;
772
+ return;
773
+ }
774
+ const raw = arbitrary(value);
775
+ if (raw !== undefined && /^\d*\.?\d+$/.test(raw)) {
776
+ out.lineHeight = Number(raw);
777
+ return;
778
+ }
779
+ const resolved = length(raw ?? value, false);
780
+ if (typeof resolved === "number")
781
+ out.lineHeight = Math.round(resolved / fontSizeOf(out) * 1000) / 1000;
782
+ },
783
+ tracking: (out, value, negative) => {
784
+ const em = TRACKING[value];
785
+ if (em !== undefined) {
786
+ out.letterSpacing = Math.round(em * fontSizeOf(out) * 100) / 100;
787
+ return;
788
+ }
789
+ const raw = arbitrary(value) ?? "";
790
+ const ems = /^(-?\d*\.?\d+)em$/.exec(raw);
791
+ const resolved = ems ? Math.round(Number(ems[1]) * fontSizeOf(out) * 100) / 100 : px(raw);
792
+ if (resolved !== undefined)
793
+ out.letterSpacing = negative ? -resolved : resolved;
794
+ },
795
+ "line-clamp": (out, value) => {
796
+ const n = number(value);
797
+ if (n !== undefined) {
798
+ out.lineClamp = n;
799
+ out.overflow = "hidden";
800
+ }
801
+ },
802
+ whitespace: (out, value) => {
803
+ if (WHITESPACE.has(value))
804
+ out.whiteSpace = value;
805
+ },
806
+ bg: (out, value) => {
807
+ const direction = /^(?:gradient|linear)-to-(t|tr|r|br|b|bl|l|tl)$/.exec(value);
808
+ if (direction) {
809
+ gradientOf(out).to = GRADIENT_SIDES[direction[1]];
810
+ return;
811
+ }
812
+ const angle = /^linear-(\d+)$/.exec(value);
813
+ if (angle) {
814
+ gradientOf(out).angle = Number(angle[1]);
815
+ return;
816
+ }
817
+ if (value === "radial") {
818
+ gradientOf(out).shape = "radial";
819
+ return;
820
+ }
821
+ const conic = /^conic(?:-(\d+))?$/.exec(value);
822
+ if (conic) {
823
+ gradientOf(out).shape = "conic";
824
+ gradientOf(out).angle = conic[1] ? Number(conic[1]) : 0;
825
+ return;
826
+ }
827
+ const resolved = color(value);
828
+ if (resolved !== undefined)
829
+ out.background = resolved;
830
+ },
831
+ from: (out, value) => gradientStop(out, "from", value),
832
+ via: (out, value) => gradientStop(out, "via", value),
833
+ to: (out, value) => gradientStop(out, "stop", value),
834
+ border: (out, value) => {
835
+ if (value === "") {
836
+ setInsets(out, "borderWidth", "all", 1);
837
+ return;
838
+ }
839
+ if (BORDER_STYLES.has(value)) {
840
+ out.borderStyle = value;
841
+ return;
842
+ }
843
+ const dash = value.indexOf("-");
844
+ const head = dash < 0 ? value : value.slice(0, dash);
845
+ const sides = head.length === 1 ? SIDES[head] : undefined;
846
+ if (sides && sides !== "all" && (dash < 0 || /^(\d|\[)/.test(value.slice(dash + 1)))) {
847
+ borderSideHandler(sides)(out, dash < 0 ? "" : value.slice(dash + 1), false);
848
+ return;
849
+ }
850
+ const width = px(arbitrary(value) ?? value);
851
+ if (width !== undefined) {
852
+ setInsets(out, "borderWidth", "all", width);
853
+ return;
854
+ }
855
+ const resolved = color(value);
856
+ if (resolved !== undefined)
857
+ out.borderColor = resolved;
858
+ },
859
+ rounded: (out, value) => {
860
+ const dash = value.indexOf("-");
861
+ const head = dash < 0 ? value : value.slice(0, dash);
862
+ const corners = CORNERS[head];
863
+ const size = corners ? dash < 0 ? "" : value.slice(dash + 1) : value;
864
+ const resolved = RADII[size] ?? px(arbitrary(size) ?? "");
865
+ if (resolved === undefined)
866
+ return;
867
+ if (!corners) {
868
+ out.radius = resolved;
869
+ return;
870
+ }
871
+ const current = out.radius;
872
+ const next = typeof current === "number" ? { topLeft: current, topRight: current, bottomRight: current, bottomLeft: current } : { topLeft: 0, topRight: 0, bottomRight: 0, bottomLeft: 0, ...current };
873
+ for (const corner of corners)
874
+ next[corner] = resolved;
875
+ const values = Object.values(next);
876
+ out.radius = values.every((v) => v === values[0]) ? values[0] : next;
877
+ },
878
+ opacity: (out, value) => {
879
+ const n = number(value);
880
+ if (n !== undefined)
881
+ out.opacity = arbitrary(value) !== undefined ? n : n / 100;
882
+ },
883
+ shadow: (out, value) => {
884
+ const named = SHADOWS[value] ?? arbitrary(value);
885
+ if (named !== undefined) {
886
+ out.boxShadow = named;
887
+ return;
888
+ }
889
+ const c = color(value);
890
+ if (c !== undefined)
891
+ pendingShadow(out).box = c;
892
+ },
893
+ "inset-shadow": (out, value) => {
894
+ const named = INSET_SHADOWS[value] ?? arbitrary(value);
895
+ if (named !== undefined) {
896
+ out.boxShadow = named;
897
+ return;
898
+ }
899
+ const c = color(value);
900
+ if (c !== undefined)
901
+ pendingShadow(out).box = c;
902
+ },
903
+ cursor: (out, value) => {
904
+ if (CURSORS.has(value))
905
+ out.cursor = value;
906
+ },
907
+ overflow: (out, value) => {
908
+ if (OVERFLOWS.has(value))
909
+ out.overflow = value;
910
+ },
911
+ "overflow-x": (out, value) => {
912
+ if (OVERFLOWS.has(value))
913
+ out.overflowX = value;
914
+ },
915
+ "overflow-y": (out, value) => {
916
+ if (OVERFLOWS.has(value))
917
+ out.overflowY = value;
918
+ },
919
+ scale: (out, value, negative) => {
920
+ const n = number(value);
921
+ if (n !== undefined)
922
+ setTransform(out, { scale: (negative ? -n : n) / (arbitrary(value) !== undefined ? 1 : 100) });
923
+ },
924
+ rotate: (out, value, negative) => {
925
+ const raw = arbitrary(value) ?? value;
926
+ const n = /^(-?\d*\.?\d+)(deg)?$/.exec(raw);
927
+ if (n)
928
+ setTransform(out, { rotate: negative ? -Number(n[1]) : Number(n[1]) });
929
+ },
930
+ "skew-x": (out, value, negative) => {
931
+ const n = number(value);
932
+ if (n !== undefined)
933
+ setTransform(out, { skewX: negative ? -n : n });
934
+ },
935
+ "skew-y": (out, value, negative) => {
936
+ const n = number(value);
937
+ if (n !== undefined)
938
+ setTransform(out, { skewY: negative ? -n : n });
939
+ },
940
+ skew: (out, value, negative) => {
941
+ const n = number(value);
942
+ if (n !== undefined)
943
+ setTransform(out, { skewX: negative ? -n : n, skewY: negative ? -n : n });
944
+ },
945
+ "scale-x": (out, value) => {
946
+ const n = number(value);
947
+ if (n !== undefined)
948
+ setTransform(out, { scaleX: n / 100 });
949
+ },
950
+ "scale-y": (out, value) => {
951
+ const n = number(value);
952
+ if (n !== undefined)
953
+ setTransform(out, { scaleY: n / 100 });
954
+ },
955
+ "translate-x": (out, value, negative) => {
956
+ const resolved = length(value, false);
957
+ if (typeof resolved === "number")
958
+ setTransform(out, { x: negative ? -resolved : resolved });
959
+ },
960
+ "translate-y": (out, value, negative) => {
961
+ const resolved = length(value, false);
962
+ if (typeof resolved === "number")
963
+ setTransform(out, { y: negative ? -resolved : resolved });
964
+ },
965
+ transition: (out) => setTransition(out, { duration: 150, easing: "easeInOut" }),
966
+ duration: (out, value) => {
967
+ const n = number(value);
968
+ if (n !== undefined)
969
+ setTransition(out, { duration: n });
970
+ },
971
+ delay: (out, value) => {
972
+ const n = number(value);
973
+ if (n !== undefined)
974
+ setTransition(out, { delay: n });
975
+ },
976
+ ease: (out, value) => {
977
+ const easing = EASINGS[value];
978
+ if (easing)
979
+ setTransition(out, { easing });
980
+ },
981
+ aspect: (out, value) => {
982
+ const raw = arbitrary(value) ?? value;
983
+ if (raw === "auto") {
984
+ out.aspectRatio = undefined;
985
+ return;
986
+ }
987
+ const ratio = /^(\d*\.?\d+)\s*\/\s*(\d*\.?\d+)$/.exec(raw);
988
+ const resolved = ratio ? Number(ratio[1]) / Number(ratio[2]) : number(raw);
989
+ if (resolved !== undefined)
990
+ out.aspectRatio = resolved;
991
+ },
992
+ ring: (out, value) => {
993
+ if (value === "") {
994
+ out.outlineWidth = 1;
995
+ out.outlineStyle = "solid";
996
+ return;
997
+ }
998
+ const width = px(arbitrary(value) ?? value);
999
+ if (width !== undefined) {
1000
+ out.outlineWidth = width;
1001
+ out.outlineStyle = "solid";
1002
+ return;
1003
+ }
1004
+ const resolved = color(value);
1005
+ if (resolved !== undefined)
1006
+ out.outlineColor = resolved;
1007
+ },
1008
+ "ring-offset": (out, value) => {
1009
+ const n = px(arbitrary(value) ?? value);
1010
+ if (n !== undefined)
1011
+ out.outlineOffset = n;
1012
+ },
1013
+ outline: (out, value) => {
1014
+ if (value === "") {
1015
+ out.outlineWidth = 1;
1016
+ out.outlineStyle = "solid";
1017
+ return;
1018
+ }
1019
+ const width = px(arbitrary(value) ?? value);
1020
+ if (width !== undefined) {
1021
+ out.outlineWidth = width;
1022
+ out.outlineStyle = "solid";
1023
+ return;
1024
+ }
1025
+ const resolved = color(value);
1026
+ if (resolved !== undefined)
1027
+ out.outlineColor = resolved;
1028
+ },
1029
+ "outline-offset": (out, value) => {
1030
+ const n = px(arbitrary(value) ?? value);
1031
+ if (n !== undefined)
1032
+ out.outlineOffset = n;
1033
+ },
1034
+ stroke: (out, value) => {
1035
+ const n = number(value);
1036
+ if (n !== undefined)
1037
+ out.strokeWidth = n;
1038
+ },
1039
+ placeholder: (out, value) => {
1040
+ const c = color(value);
1041
+ if (c !== undefined)
1042
+ out.placeholderColor = c;
1043
+ },
1044
+ caret: (out, value) => {
1045
+ const c = color(value);
1046
+ if (c !== undefined)
1047
+ out.caretColor = c;
1048
+ },
1049
+ selection: (out, value) => {
1050
+ const c = color(value);
1051
+ if (c !== undefined)
1052
+ out.selectionColor = c;
1053
+ }
1054
+ };
1055
+ for (const [suffix, sides] of Object.entries(SIDES)) {
1056
+ if (suffix === "")
1057
+ continue;
1058
+ HANDLERS[`p${suffix}`] = insetHandler("padding", sides);
1059
+ HANDLERS[`m${suffix}`] = insetHandler("margin", sides);
1060
+ }
1061
+ var PREFIXES = Object.keys(HANDLERS).sort((a, b) => b.length - a.length);
1062
+ function splitVariants(token) {
1063
+ const parts = [];
1064
+ let depth = 0;
1065
+ let start = 0;
1066
+ for (let i = 0;i < token.length; i++) {
1067
+ const c = token[i];
1068
+ if (c === "[")
1069
+ depth++;
1070
+ else if (c === "]")
1071
+ depth--;
1072
+ else if (c === ":" && depth === 0) {
1073
+ parts.push(token.slice(start, i));
1074
+ start = i + 1;
1075
+ }
1076
+ }
1077
+ parts.push(token.slice(start));
1078
+ return parts;
1079
+ }
1080
+ function applyUtility(out, utility) {
1081
+ const negative = utility.startsWith("-");
1082
+ const token = negative ? utility.slice(1) : utility;
1083
+ const fixed = STATIC[token];
1084
+ if (fixed && !negative) {
1085
+ if (fixed.transform) {
1086
+ setTransform(out, fixed.transform);
1087
+ return;
1088
+ }
1089
+ Object.assign(out, fixed);
1090
+ return;
1091
+ }
1092
+ for (const prefix of PREFIXES) {
1093
+ if (token === prefix) {
1094
+ HANDLERS[prefix](out, "", negative);
1095
+ return;
1096
+ }
1097
+ if (token.startsWith(prefix + "-")) {
1098
+ HANDLERS[prefix](out, token.slice(prefix.length + 1), negative);
1099
+ return;
1100
+ }
1101
+ }
1102
+ }
1103
+ function compile(classes) {
1104
+ const out = {};
1105
+ const wrappers = [out];
1106
+ for (const token of classes.split(/\s+/)) {
1107
+ if (!token)
1108
+ continue;
1109
+ const parts = splitVariants(token);
1110
+ const utility = parts.pop();
1111
+ let target = out;
1112
+ let state;
1113
+ let supported = true;
1114
+ for (const variant of parts) {
1115
+ if (WRAPPER_VARIANTS.has(variant)) {
1116
+ const next = target[variant] ?? (target[variant] = {});
1117
+ if (!wrappers.includes(next))
1118
+ wrappers.push(next);
1119
+ target = next;
1120
+ } else if (STATE_VARIANTS[variant])
1121
+ state = STATE_VARIANTS[variant];
1122
+ else
1123
+ supported = false;
1124
+ }
1125
+ if (!supported)
1126
+ continue;
1127
+ if (state)
1128
+ target = target[state] ?? (target[state] = {});
1129
+ applyUtility(target, utility);
1130
+ }
1131
+ for (const wrapper of wrappers)
1132
+ finishGradients(wrapper);
1133
+ return out;
1134
+ }
1135
+ var cache = new Map;
1136
+ function tw(...classes) {
1137
+ const joined = classes.filter((value) => typeof value === "string" && value.length > 0).join(" ");
1138
+ let compiled = cache.get(joined);
1139
+ if (!compiled) {
1140
+ if (cache.size > 4096)
1141
+ cache.clear();
1142
+ compiled = compile(joined);
1143
+ for (const key of Object.keys(compiled))
1144
+ if (compiled[key] === undefined)
1145
+ delete compiled[key];
1146
+ cache.set(joined, compiled);
1147
+ }
1148
+ return { ...compiled };
1149
+ }
1150
+ var ALIASES = {
1151
+ backgroundColor: "background",
1152
+ color: "foreground",
1153
+ borderRadius: "radius",
1154
+ flexDirection: "direction",
1155
+ alignItems: "align",
1156
+ justifyContent: "justify"
1157
+ };
1158
+ function styleWithClassName(className, style) {
1159
+ const compiled = tw(className);
1160
+ if (!style)
1161
+ return compiled;
1162
+ for (const alias of Object.keys(ALIASES))
1163
+ if (style[alias] !== undefined)
1164
+ delete compiled[ALIASES[alias]];
1165
+ const merged = { ...compiled, ...style };
1166
+ for (const state of ["hover", "focus", "focusVisible", "active", "disabled", "groupHover", "focusWithin", "dark", "first", "last", "odd", "even", "sm", "md", "lg", "xl", "2xl"]) {
1167
+ if (compiled[state] && style[state])
1168
+ merged[state] = { ...compiled[state], ...style[state] };
1169
+ }
1170
+ return merged;
1171
+ }
1172
+ var GRADIENT2 = "\x00gradient";
1173
+ var TRANSITION = "\x00transition";
1174
+ var GRADIENT_SIDES = {
1175
+ t: "top",
1176
+ tr: "top right",
1177
+ r: "right",
1178
+ br: "bottom right",
1179
+ b: "bottom",
1180
+ bl: "bottom left",
1181
+ l: "left",
1182
+ tl: "top left"
1183
+ };
1184
+ function gradientStop(out, stop, value) {
1185
+ const position = /^(\d*\.?\d+)%$/.exec(value);
1186
+ if (position) {
1187
+ gradientOf(out)[`${stop}At`] = Number(position[1]) / 100;
1188
+ return;
1189
+ }
1190
+ const c = color(value);
1191
+ if (c !== undefined)
1192
+ gradientOf(out)[stop] = c;
1193
+ }
1194
+ var SHADOW = "\x00shadow";
1195
+ function pendingShadow(out) {
1196
+ return out[SHADOW] ?? (out[SHADOW] = {});
1197
+ }
1198
+ function finishShadow(out) {
1199
+ const pending = out[SHADOW];
1200
+ if (!pending)
1201
+ return;
1202
+ delete out[SHADOW];
1203
+ const recolour = (shadow, colour) => shadow.replace(/#[0-9a-f]{6,8}\b/gi, colour);
1204
+ if (pending.box !== undefined && typeof out.boxShadow === "string" && out.boxShadow !== "none")
1205
+ out.boxShadow = recolour(out.boxShadow, pending.box);
1206
+ if (pending.text !== undefined && typeof out.textShadow === "string")
1207
+ out.textShadow = recolour(out.textShadow, pending.text);
1208
+ }
1209
+ function setGlass(out, patch) {
1210
+ out.glass = { blur: 0, ...typeof out.glass === "object" && out.glass ? out.glass : {}, ...patch };
1211
+ }
1212
+ function gradientOf(out) {
1213
+ return out[GRADIENT2] ?? (out[GRADIENT2] = {});
1214
+ }
1215
+ function finishGradient(out) {
1216
+ const pending = out[GRADIENT2];
1217
+ if (!pending)
1218
+ return;
1219
+ delete out[GRADIENT2];
1220
+ if (pending.from === undefined && pending.via === undefined && pending.stop === undefined)
1221
+ return;
1222
+ const from = pending.from ?? "transparent";
1223
+ const stops = [{ color: from, offset: pending.fromAt ?? 0 }];
1224
+ if (pending.via !== undefined)
1225
+ stops.push({ color: pending.via, offset: pending.viaAt ?? 0.5 });
1226
+ stops.push({ color: pending.stop ?? "transparent", offset: pending.stopAt ?? 1 });
1227
+ if (pending.shape === "radial")
1228
+ out.background = { type: "radial", stops };
1229
+ else if (pending.shape === "conic")
1230
+ out.background = { type: "conic", from: pending.angle ?? 0, stops };
1231
+ else if (pending.angle !== undefined)
1232
+ out.background = { type: "linear", angle: pending.angle, stops };
1233
+ else
1234
+ out.background = { type: "linear", to: pending.to ?? "bottom", stops };
1235
+ }
1236
+ function finishGradients(out) {
1237
+ finishGradient(out);
1238
+ finishTransition(out);
1239
+ finishShadow(out);
1240
+ for (const state of Object.values(STATE_VARIANTS)) {
1241
+ if (!out[state])
1242
+ continue;
1243
+ finishGradient(out[state]);
1244
+ finishTransition(out[state]);
1245
+ finishShadow(out[state]);
1246
+ }
1247
+ }
1248
+ var CORNERS = {
1249
+ t: ["topLeft", "topRight"],
1250
+ r: ["topRight", "bottomRight"],
1251
+ b: ["bottomRight", "bottomLeft"],
1252
+ l: ["topLeft", "bottomLeft"],
1253
+ s: ["topLeft", "bottomLeft"],
1254
+ e: ["topRight", "bottomRight"],
1255
+ tl: ["topLeft"],
1256
+ tr: ["topRight"],
1257
+ br: ["bottomRight"],
1258
+ bl: ["bottomLeft"],
1259
+ ss: ["topLeft"],
1260
+ se: ["topRight"],
1261
+ es: ["bottomLeft"],
1262
+ ee: ["bottomRight"]
1263
+ };
1264
+
2
1265
  // packages/core/src/jsx-runtime.ts
3
1266
  var NATIVE_VNODE = Symbol("tarve.native-vnode");
4
1267
  function jsx(type, props, key) {
1268
+ if (props !== null && (typeof props.className === "string" || typeof props.class === "string")) {
1269
+ const { className, class: plain, ...rest } = props;
1270
+ rest.style = styleWithClassName([plain, className].filter((value) => typeof value === "string").join(" "), rest.style);
1271
+ props = rest;
1272
+ }
5
1273
  return { type, props: props ?? {}, key };
6
1274
  }
7
1275
  function _nativeJsx(type, props, key) {