syntra-ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -0
- package/dist/components/button/Button.d.ts +19 -0
- package/dist/components/button/button.styles.d.ts +9 -0
- package/dist/components/button/index.d.ts +3 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/input/Input.d.ts +18 -0
- package/dist/components/input/index.d.ts +3 -0
- package/dist/components/input/input.styles.d.ts +8 -0
- package/dist/components/spinner/Spinner.d.ts +13 -0
- package/dist/components/spinner/index.d.ts +2 -0
- package/dist/defaults/borders.d.ts +2 -0
- package/dist/defaults/colors.d.ts +3 -0
- package/dist/defaults/shadows.d.ts +3 -0
- package/dist/defaults/spacing.d.ts +2 -0
- package/dist/defaults/theme.d.ts +3 -0
- package/dist/defaults/transitions.d.ts +2 -0
- package/dist/defaults/typography.d.ts +2 -0
- package/dist/hooks/useSyntra.d.ts +2 -0
- package/dist/hooks/useSyntraMode.d.ts +2 -0
- package/dist/index.d.ts +15 -0
- package/dist/primitives/Box.d.ts +10 -0
- package/dist/primitives/Divider.d.ts +14 -0
- package/dist/primitives/Flex.d.ts +18 -0
- package/dist/primitives/Grid.d.ts +19 -0
- package/dist/primitives/Heading.d.ts +15 -0
- package/dist/primitives/Stack.d.ts +15 -0
- package/dist/primitives/Text.d.ts +19 -0
- package/dist/primitives/VisuallyHidden.d.ts +9 -0
- package/dist/primitives/index.d.ts +19 -0
- package/dist/primitives/polymorphic.d.ts +13 -0
- package/dist/primitives/style-props.d.ts +75 -0
- package/dist/provider/SyntraContext.d.ts +2 -0
- package/dist/provider/SyntraProvider.d.ts +10 -0
- package/dist/provider/cssVars.d.ts +6 -0
- package/dist/syntra-ui.cjs +135 -0
- package/dist/syntra-ui.mjs +1541 -0
- package/dist/types.d.ts +176 -0
- package/dist/utils/cn.d.ts +3 -0
- package/dist/utils/colorScale.d.ts +10 -0
- package/dist/utils/createSyntraTheme.d.ts +2 -0
- package/dist/utils/deepMerge.d.ts +1 -0
- package/dist/utils/use-styles.d.ts +1 -0
- package/dist/utils/use-syntra-context.d.ts +1 -0
- package/dist/vite.svg +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,1541 @@
|
|
|
1
|
+
import { jsx as x, jsxs as L } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as Q, useState as I, useRef as tt, useMemo as M, useLayoutEffect as nt, useEffect as R, useCallback as et, useContext as D, forwardRef as k, useInsertionEffect as rt } from "react";
|
|
3
|
+
const H = Q(null), at = {
|
|
4
|
+
primary: {
|
|
5
|
+
50: "#f0f5ff",
|
|
6
|
+
100: "#dce8ff",
|
|
7
|
+
200: "#b4cdff",
|
|
8
|
+
300: "#84adff",
|
|
9
|
+
400: "#4d8bff",
|
|
10
|
+
500: "#007AFF",
|
|
11
|
+
600: "#0064d6",
|
|
12
|
+
700: "#004fad",
|
|
13
|
+
800: "#003c85",
|
|
14
|
+
900: "#002a5e",
|
|
15
|
+
950: "#001d42"
|
|
16
|
+
},
|
|
17
|
+
gray: {
|
|
18
|
+
25: "#fcfcfd",
|
|
19
|
+
50: "#f8f8fa",
|
|
20
|
+
100: "#f2f2f7",
|
|
21
|
+
200: "#e5e5ea",
|
|
22
|
+
300: "#d1d1d6",
|
|
23
|
+
400: "#aeaeb2",
|
|
24
|
+
500: "#8e8e93",
|
|
25
|
+
600: "#636366",
|
|
26
|
+
700: "#48484a",
|
|
27
|
+
800: "#3a3a3c",
|
|
28
|
+
900: "#2c2c2e",
|
|
29
|
+
950: "#1c1c1e"
|
|
30
|
+
},
|
|
31
|
+
red: {
|
|
32
|
+
50: "#fff5f5",
|
|
33
|
+
100: "#ffe3e3",
|
|
34
|
+
200: "#ffc9c9",
|
|
35
|
+
300: "#ffa8a8",
|
|
36
|
+
400: "#ff7e7e",
|
|
37
|
+
500: "#FF3B30",
|
|
38
|
+
600: "#d63028",
|
|
39
|
+
700: "#ad2620",
|
|
40
|
+
800: "#851d19",
|
|
41
|
+
900: "#5e1412",
|
|
42
|
+
950: "#420e0d"
|
|
43
|
+
},
|
|
44
|
+
orange: {
|
|
45
|
+
50: "#fff8f0",
|
|
46
|
+
100: "#ffecdb",
|
|
47
|
+
200: "#ffd5b0",
|
|
48
|
+
300: "#ffba7d",
|
|
49
|
+
400: "#ff9d4d",
|
|
50
|
+
500: "#FF9500",
|
|
51
|
+
600: "#d67d00",
|
|
52
|
+
700: "#ad6500",
|
|
53
|
+
800: "#854d00",
|
|
54
|
+
900: "#5e3700",
|
|
55
|
+
950: "#422700"
|
|
56
|
+
},
|
|
57
|
+
yellow: {
|
|
58
|
+
50: "#fffcf0",
|
|
59
|
+
100: "#fff7db",
|
|
60
|
+
200: "#ffecb0",
|
|
61
|
+
300: "#ffe07d",
|
|
62
|
+
400: "#ffd44d",
|
|
63
|
+
500: "#FFCC00",
|
|
64
|
+
600: "#d6ab00",
|
|
65
|
+
700: "#ad8a00",
|
|
66
|
+
800: "#856a00",
|
|
67
|
+
900: "#5e4b00",
|
|
68
|
+
950: "#423500"
|
|
69
|
+
},
|
|
70
|
+
green: {
|
|
71
|
+
50: "#f0faf2",
|
|
72
|
+
100: "#dbf5e0",
|
|
73
|
+
200: "#b0e8bc",
|
|
74
|
+
300: "#7dd995",
|
|
75
|
+
400: "#4dca6f",
|
|
76
|
+
500: "#34C759",
|
|
77
|
+
600: "#2ba74a",
|
|
78
|
+
700: "#23873c",
|
|
79
|
+
800: "#1b682e",
|
|
80
|
+
900: "#134a21",
|
|
81
|
+
950: "#0d3417"
|
|
82
|
+
},
|
|
83
|
+
teal: {
|
|
84
|
+
50: "#f0fcfa",
|
|
85
|
+
100: "#dbf8f3",
|
|
86
|
+
200: "#b0f0e4",
|
|
87
|
+
300: "#7de6d2",
|
|
88
|
+
400: "#4ddbbf",
|
|
89
|
+
500: "#5AC8FA",
|
|
90
|
+
600: "#4ba8d2",
|
|
91
|
+
700: "#3c88aa",
|
|
92
|
+
800: "#2e6983",
|
|
93
|
+
900: "#204b5d",
|
|
94
|
+
950: "#163542"
|
|
95
|
+
},
|
|
96
|
+
blue: {
|
|
97
|
+
50: "#f0f5ff",
|
|
98
|
+
100: "#dce8ff",
|
|
99
|
+
200: "#b4cdff",
|
|
100
|
+
300: "#84adff",
|
|
101
|
+
400: "#4d8bff",
|
|
102
|
+
500: "#007AFF",
|
|
103
|
+
600: "#0064d6",
|
|
104
|
+
700: "#004fad",
|
|
105
|
+
800: "#003c85",
|
|
106
|
+
900: "#002a5e",
|
|
107
|
+
950: "#001d42"
|
|
108
|
+
},
|
|
109
|
+
indigo: {
|
|
110
|
+
50: "#f2f0ff",
|
|
111
|
+
100: "#e3dbff",
|
|
112
|
+
200: "#c4b0ff",
|
|
113
|
+
300: "#a27dff",
|
|
114
|
+
400: "#814dff",
|
|
115
|
+
500: "#5856D6",
|
|
116
|
+
600: "#4944b3",
|
|
117
|
+
700: "#3b3791",
|
|
118
|
+
800: "#2d2a70",
|
|
119
|
+
900: "#201e50",
|
|
120
|
+
950: "#161538"
|
|
121
|
+
},
|
|
122
|
+
purple: {
|
|
123
|
+
50: "#f8f0ff",
|
|
124
|
+
100: "#efdbff",
|
|
125
|
+
200: "#dcb0ff",
|
|
126
|
+
300: "#c67dff",
|
|
127
|
+
400: "#b04dff",
|
|
128
|
+
500: "#AF52DE",
|
|
129
|
+
600: "#9244b9",
|
|
130
|
+
700: "#763796",
|
|
131
|
+
800: "#5b2a73",
|
|
132
|
+
900: "#401e52",
|
|
133
|
+
950: "#2d1539"
|
|
134
|
+
},
|
|
135
|
+
pink: {
|
|
136
|
+
50: "#fff0f5",
|
|
137
|
+
100: "#ffdbea",
|
|
138
|
+
200: "#ffb0d1",
|
|
139
|
+
300: "#ff7db4",
|
|
140
|
+
400: "#ff4d98",
|
|
141
|
+
500: "#FF2D55",
|
|
142
|
+
600: "#d62647",
|
|
143
|
+
700: "#ad1f39",
|
|
144
|
+
800: "#85182c",
|
|
145
|
+
900: "#5e1120",
|
|
146
|
+
950: "#420c16"
|
|
147
|
+
},
|
|
148
|
+
background: {
|
|
149
|
+
default: "#ffffff",
|
|
150
|
+
emphasis: "#f2f2f7",
|
|
151
|
+
muted: "#f8f8fa",
|
|
152
|
+
subtle: "#fcfcfd"
|
|
153
|
+
},
|
|
154
|
+
foreground: {
|
|
155
|
+
default: "#1c1c1e",
|
|
156
|
+
emphasis: "#000000",
|
|
157
|
+
muted: "#636366",
|
|
158
|
+
subtle: "#8e8e93"
|
|
159
|
+
},
|
|
160
|
+
border: {
|
|
161
|
+
default: "#d1d1d6",
|
|
162
|
+
emphasis: "#aeaeb2",
|
|
163
|
+
muted: "#e5e5ea",
|
|
164
|
+
subtle: "#f2f2f7"
|
|
165
|
+
}
|
|
166
|
+
}, ot = {
|
|
167
|
+
primary: {
|
|
168
|
+
50: "#001a3d",
|
|
169
|
+
100: "#002455",
|
|
170
|
+
200: "#003580",
|
|
171
|
+
300: "#0050b3",
|
|
172
|
+
400: "#0068de",
|
|
173
|
+
500: "#0A84FF",
|
|
174
|
+
600: "#3d9eff",
|
|
175
|
+
700: "#6db5ff",
|
|
176
|
+
800: "#9dccff",
|
|
177
|
+
900: "#cce3ff",
|
|
178
|
+
950: "#e8f2ff"
|
|
179
|
+
},
|
|
180
|
+
gray: {
|
|
181
|
+
25: "#1c1c1e",
|
|
182
|
+
50: "#2c2c2e",
|
|
183
|
+
100: "#3a3a3c",
|
|
184
|
+
200: "#48484a",
|
|
185
|
+
300: "#636366",
|
|
186
|
+
400: "#8e8e93",
|
|
187
|
+
500: "#aeaeb2",
|
|
188
|
+
600: "#d1d1d6",
|
|
189
|
+
700: "#e5e5ea",
|
|
190
|
+
800: "#f2f2f7",
|
|
191
|
+
900: "#f8f8fa",
|
|
192
|
+
950: "#fcfcfd"
|
|
193
|
+
},
|
|
194
|
+
red: {
|
|
195
|
+
50: "#3d0a08",
|
|
196
|
+
100: "#551210",
|
|
197
|
+
200: "#801f1b",
|
|
198
|
+
300: "#b33228",
|
|
199
|
+
400: "#de4a3d",
|
|
200
|
+
500: "#FF453A",
|
|
201
|
+
600: "#ff6b63",
|
|
202
|
+
700: "#ff918b",
|
|
203
|
+
800: "#ffb8b4",
|
|
204
|
+
900: "#ffdedd",
|
|
205
|
+
950: "#fff0ef"
|
|
206
|
+
},
|
|
207
|
+
orange: {
|
|
208
|
+
50: "#3d2400",
|
|
209
|
+
100: "#553300",
|
|
210
|
+
200: "#804d00",
|
|
211
|
+
300: "#b36d00",
|
|
212
|
+
400: "#de8d00",
|
|
213
|
+
500: "#FF9F0A",
|
|
214
|
+
600: "#ffb43d",
|
|
215
|
+
700: "#ffc96d",
|
|
216
|
+
800: "#ffdd9d",
|
|
217
|
+
900: "#fff0cc",
|
|
218
|
+
950: "#fff8e8"
|
|
219
|
+
},
|
|
220
|
+
yellow: {
|
|
221
|
+
50: "#3d3200",
|
|
222
|
+
100: "#554500",
|
|
223
|
+
200: "#806800",
|
|
224
|
+
300: "#b39200",
|
|
225
|
+
400: "#deb800",
|
|
226
|
+
500: "#FFD60A",
|
|
227
|
+
600: "#ffdf3d",
|
|
228
|
+
700: "#ffe86d",
|
|
229
|
+
800: "#fff09d",
|
|
230
|
+
900: "#fff7cc",
|
|
231
|
+
950: "#fffbe8"
|
|
232
|
+
},
|
|
233
|
+
green: {
|
|
234
|
+
50: "#0a3015",
|
|
235
|
+
100: "#10431e",
|
|
236
|
+
200: "#1a6630",
|
|
237
|
+
300: "#258f44",
|
|
238
|
+
400: "#2fb85a",
|
|
239
|
+
500: "#30D158",
|
|
240
|
+
600: "#5ddc7c",
|
|
241
|
+
700: "#89e6a0",
|
|
242
|
+
800: "#b5f0c3",
|
|
243
|
+
900: "#e0f9e6",
|
|
244
|
+
950: "#f0fcf3"
|
|
245
|
+
},
|
|
246
|
+
indigo: {
|
|
247
|
+
50: "#141238",
|
|
248
|
+
100: "#1d1a50",
|
|
249
|
+
200: "#2c2980",
|
|
250
|
+
300: "#3f3cb3",
|
|
251
|
+
400: "#5351de",
|
|
252
|
+
500: "#5E5CE6",
|
|
253
|
+
600: "#807feb",
|
|
254
|
+
700: "#a1a0f0",
|
|
255
|
+
800: "#c2c1f5",
|
|
256
|
+
900: "#e2e2fa",
|
|
257
|
+
950: "#f2f2fd"
|
|
258
|
+
},
|
|
259
|
+
purple: {
|
|
260
|
+
50: "#2a1239",
|
|
261
|
+
100: "#3b1a50",
|
|
262
|
+
200: "#582880",
|
|
263
|
+
300: "#7b39b3",
|
|
264
|
+
400: "#9d4bde",
|
|
265
|
+
500: "#BF5AF2",
|
|
266
|
+
600: "#cf7ef5",
|
|
267
|
+
700: "#dda1f7",
|
|
268
|
+
800: "#ecc4fa",
|
|
269
|
+
900: "#f7e5fd",
|
|
270
|
+
950: "#fbf2fe"
|
|
271
|
+
},
|
|
272
|
+
pink: {
|
|
273
|
+
50: "#3d0a1c",
|
|
274
|
+
100: "#551028",
|
|
275
|
+
200: "#801a3e",
|
|
276
|
+
300: "#b32857",
|
|
277
|
+
400: "#de3672",
|
|
278
|
+
500: "#FF375F",
|
|
279
|
+
600: "#ff6282",
|
|
280
|
+
700: "#ff8da5",
|
|
281
|
+
800: "#ffb8c7",
|
|
282
|
+
900: "#ffe3ea",
|
|
283
|
+
950: "#fff2f5"
|
|
284
|
+
},
|
|
285
|
+
teal: {
|
|
286
|
+
50: "#0a2e3d",
|
|
287
|
+
100: "#104055",
|
|
288
|
+
200: "#1a6180",
|
|
289
|
+
300: "#2588b3",
|
|
290
|
+
400: "#2fb0de",
|
|
291
|
+
500: "#64D2FF",
|
|
292
|
+
600: "#85dcff",
|
|
293
|
+
700: "#a5e5ff",
|
|
294
|
+
800: "#c5eeff",
|
|
295
|
+
900: "#e5f7ff",
|
|
296
|
+
950: "#f2fbff"
|
|
297
|
+
},
|
|
298
|
+
blue: {
|
|
299
|
+
50: "#001a3d",
|
|
300
|
+
100: "#002455",
|
|
301
|
+
200: "#003580",
|
|
302
|
+
300: "#0050b3",
|
|
303
|
+
400: "#0068de",
|
|
304
|
+
500: "#0A84FF",
|
|
305
|
+
600: "#3d9eff",
|
|
306
|
+
700: "#6db5ff",
|
|
307
|
+
800: "#9dccff",
|
|
308
|
+
900: "#cce3ff",
|
|
309
|
+
950: "#e8f2ff"
|
|
310
|
+
},
|
|
311
|
+
background: {
|
|
312
|
+
default: "#000000",
|
|
313
|
+
emphasis: "#1c1c1e",
|
|
314
|
+
muted: "#2c2c2e",
|
|
315
|
+
subtle: "#3a3a3c"
|
|
316
|
+
},
|
|
317
|
+
foreground: {
|
|
318
|
+
default: "#f2f2f7",
|
|
319
|
+
emphasis: "#ffffff",
|
|
320
|
+
muted: "#aeaeb2",
|
|
321
|
+
subtle: "#8e8e93"
|
|
322
|
+
},
|
|
323
|
+
border: {
|
|
324
|
+
default: "#48484a",
|
|
325
|
+
emphasis: "#636366",
|
|
326
|
+
muted: "#3a3a3c",
|
|
327
|
+
subtle: "#2c2c2e"
|
|
328
|
+
}
|
|
329
|
+
}, G = {
|
|
330
|
+
fontFamily: {
|
|
331
|
+
sans: '-apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif',
|
|
332
|
+
mono: '"SF Mono", SFMono-Regular, ui-monospace, Menlo, Monaco, "Cascadia Code", "Courier New", monospace'
|
|
333
|
+
},
|
|
334
|
+
fontSize: {
|
|
335
|
+
"2xs": "11px",
|
|
336
|
+
xs: "12px",
|
|
337
|
+
sm: "13px",
|
|
338
|
+
base: "15px",
|
|
339
|
+
md: "17px",
|
|
340
|
+
lg: "20px",
|
|
341
|
+
xl: "24px",
|
|
342
|
+
"2xl": "28px",
|
|
343
|
+
"3xl": "34px",
|
|
344
|
+
"4xl": "48px"
|
|
345
|
+
},
|
|
346
|
+
fontWeight: {
|
|
347
|
+
regular: 400,
|
|
348
|
+
medium: 500,
|
|
349
|
+
semibold: 600,
|
|
350
|
+
bold: 700
|
|
351
|
+
},
|
|
352
|
+
lineHeight: {
|
|
353
|
+
tight: "1.2",
|
|
354
|
+
normal: "1.47",
|
|
355
|
+
relaxed: "1.6"
|
|
356
|
+
},
|
|
357
|
+
letterSpacing: {
|
|
358
|
+
tight: "-0.02em",
|
|
359
|
+
normal: "0em",
|
|
360
|
+
wide: "0.02em"
|
|
361
|
+
}
|
|
362
|
+
}, K = {
|
|
363
|
+
px: "1px",
|
|
364
|
+
0: "0px",
|
|
365
|
+
0.5: "2px",
|
|
366
|
+
1: "4px",
|
|
367
|
+
1.5: "6px",
|
|
368
|
+
2: "8px",
|
|
369
|
+
2.5: "10px",
|
|
370
|
+
3: "12px",
|
|
371
|
+
4: "16px",
|
|
372
|
+
5: "20px",
|
|
373
|
+
6: "24px",
|
|
374
|
+
8: "32px",
|
|
375
|
+
10: "40px",
|
|
376
|
+
12: "48px",
|
|
377
|
+
16: "64px",
|
|
378
|
+
20: "80px",
|
|
379
|
+
24: "96px"
|
|
380
|
+
}, V = {
|
|
381
|
+
none: "0px",
|
|
382
|
+
xs: "4px",
|
|
383
|
+
sm: "6px",
|
|
384
|
+
md: "8px",
|
|
385
|
+
lg: "12px",
|
|
386
|
+
xl: "16px",
|
|
387
|
+
"2xl": "20px",
|
|
388
|
+
full: "9999px"
|
|
389
|
+
}, it = {
|
|
390
|
+
none: "none",
|
|
391
|
+
xs: "0 1px 2px rgba(0, 0, 0, 0.04)",
|
|
392
|
+
sm: "0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04)",
|
|
393
|
+
md: "0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.04)",
|
|
394
|
+
lg: "0 10px 15px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.04)",
|
|
395
|
+
xl: "0 20px 25px rgba(0, 0, 0, 0.10), 0 8px 10px rgba(0, 0, 0, 0.04)",
|
|
396
|
+
"2xl": "0 25px 50px rgba(0, 0, 0, 0.15)"
|
|
397
|
+
}, st = {
|
|
398
|
+
none: "none",
|
|
399
|
+
xs: "0 1px 2px rgba(0, 0, 0, 0.20)",
|
|
400
|
+
sm: "0 1px 3px rgba(0, 0, 0, 0.30), 0 1px 2px rgba(0, 0, 0, 0.20)",
|
|
401
|
+
md: "0 4px 6px rgba(0, 0, 0, 0.28), 0 2px 4px rgba(0, 0, 0, 0.20)",
|
|
402
|
+
lg: "0 10px 15px rgba(0, 0, 0, 0.30), 0 4px 6px rgba(0, 0, 0, 0.20)",
|
|
403
|
+
xl: "0 20px 25px rgba(0, 0, 0, 0.35), 0 8px 10px rgba(0, 0, 0, 0.20)",
|
|
404
|
+
"2xl": "0 25px 50px rgba(0, 0, 0, 0.45)"
|
|
405
|
+
}, Y = {
|
|
406
|
+
duration: {
|
|
407
|
+
fast: "100ms",
|
|
408
|
+
normal: "200ms",
|
|
409
|
+
slow: "350ms",
|
|
410
|
+
slower: "500ms"
|
|
411
|
+
},
|
|
412
|
+
easing: {
|
|
413
|
+
default: "cubic-bezier(0.25, 0.1, 0.25, 1)",
|
|
414
|
+
in: "cubic-bezier(0.42, 0, 1, 1)",
|
|
415
|
+
out: "cubic-bezier(0, 0, 0.58, 1)",
|
|
416
|
+
inOut: "cubic-bezier(0.42, 0, 0.58, 1)",
|
|
417
|
+
spring: "cubic-bezier(0.175, 0.885, 0.32, 1.275)"
|
|
418
|
+
}
|
|
419
|
+
}, lt = {
|
|
420
|
+
colors: at,
|
|
421
|
+
typography: G,
|
|
422
|
+
spacing: K,
|
|
423
|
+
borderRadius: V,
|
|
424
|
+
shadows: it,
|
|
425
|
+
transitions: Y
|
|
426
|
+
}, dt = {
|
|
427
|
+
colors: ot,
|
|
428
|
+
typography: G,
|
|
429
|
+
spacing: K,
|
|
430
|
+
borderRadius: V,
|
|
431
|
+
shadows: st,
|
|
432
|
+
transitions: Y
|
|
433
|
+
};
|
|
434
|
+
function ft(t) {
|
|
435
|
+
const e = t.replace("#", "");
|
|
436
|
+
if (/^[0-9a-fA-F]{3}$/.test(e))
|
|
437
|
+
return e[0] + e[0] + e[1] + e[1] + e[2] + e[2];
|
|
438
|
+
if (/^[0-9a-fA-F]{6}$/.test(e))
|
|
439
|
+
return e;
|
|
440
|
+
throw new Error(`[syntra] Invalid hex color: "${t}"`);
|
|
441
|
+
}
|
|
442
|
+
function ct(t) {
|
|
443
|
+
const e = ft(t), n = parseInt(e.slice(0, 2), 16) / 255, r = parseInt(e.slice(2, 4), 16) / 255, a = parseInt(e.slice(4, 6), 16) / 255, o = Math.max(n, r, a), i = Math.min(n, r, a), l = (o + i) / 2;
|
|
444
|
+
if (o === i) return { h: 0, s: 0, l };
|
|
445
|
+
const s = o - i, d = l > 0.5 ? s / (2 - o - i) : s / (o + i);
|
|
446
|
+
let c = 0;
|
|
447
|
+
return o === n ? c = ((r - a) / s + (r < a ? 6 : 0)) / 6 : o === r ? c = ((a - n) / s + 2) / 6 : c = ((n - r) / s + 4) / 6, { h: c * 360, s: d, l };
|
|
448
|
+
}
|
|
449
|
+
function ut(t) {
|
|
450
|
+
const { h: e, s: n, l: r } = t;
|
|
451
|
+
if (n === 0)
|
|
452
|
+
return `#${Math.round(r * 255).toString(16).padStart(2, "0").repeat(3)}`;
|
|
453
|
+
const a = (u, f, y) => {
|
|
454
|
+
const p = y < 0 ? y + 1 : y > 1 ? y - 1 : y;
|
|
455
|
+
return p < 1 / 6 ? u + (f - u) * 6 * p : p < 1 / 2 ? f : p < 2 / 3 ? u + (f - u) * (2 / 3 - p) * 6 : u;
|
|
456
|
+
}, o = r < 0.5 ? r * (1 + n) : r + n - r * n, i = 2 * r - o, l = e / 360, s = Math.round(a(i, o, l + 1 / 3) * 255), d = Math.round(a(i, o, l) * 255), c = Math.round(a(i, o, l - 1 / 3) * 255);
|
|
457
|
+
return `#${s.toString(16).padStart(2, "0")}${d.toString(16).padStart(2, "0")}${c.toString(16).padStart(2, "0")}`;
|
|
458
|
+
}
|
|
459
|
+
const bt = {
|
|
460
|
+
50: 0.97,
|
|
461
|
+
100: 0.94,
|
|
462
|
+
200: 0.86,
|
|
463
|
+
300: 0.76,
|
|
464
|
+
400: 0.64,
|
|
465
|
+
500: 0.5,
|
|
466
|
+
600: 0.42,
|
|
467
|
+
700: 0.35,
|
|
468
|
+
800: 0.27,
|
|
469
|
+
900: 0.2,
|
|
470
|
+
950: 0.14
|
|
471
|
+
};
|
|
472
|
+
function gt(t) {
|
|
473
|
+
const e = ct(t), n = {};
|
|
474
|
+
for (const [r, a] of Object.entries(bt)) {
|
|
475
|
+
const o = { ...e };
|
|
476
|
+
o.l = a, a > 0.9 ? o.s = e.s * 0.6 : (a > 0.8 || a < 0.2) && (o.s = e.s * 0.8), n[r] = ut(o);
|
|
477
|
+
}
|
|
478
|
+
return n;
|
|
479
|
+
}
|
|
480
|
+
function P(t) {
|
|
481
|
+
return !!(t && typeof t == "object" && !Array.isArray(t));
|
|
482
|
+
}
|
|
483
|
+
function U(t, ...e) {
|
|
484
|
+
const n = { ...t };
|
|
485
|
+
for (const r of e)
|
|
486
|
+
if (P(r))
|
|
487
|
+
for (const a of Object.keys(r)) {
|
|
488
|
+
const o = r[a];
|
|
489
|
+
o !== void 0 && (P(o) && P(n[a]) ? n[a] = U(
|
|
490
|
+
n[a],
|
|
491
|
+
o
|
|
492
|
+
) : n[a] = o);
|
|
493
|
+
}
|
|
494
|
+
return n;
|
|
495
|
+
}
|
|
496
|
+
const yt = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
|
|
497
|
+
function j(t, e) {
|
|
498
|
+
if (typeof t == "string")
|
|
499
|
+
return gt(t);
|
|
500
|
+
const n = { ...e };
|
|
501
|
+
for (const r of yt)
|
|
502
|
+
t[r] !== void 0 && (n[r] = t[r]);
|
|
503
|
+
return n;
|
|
504
|
+
}
|
|
505
|
+
const pt = [
|
|
506
|
+
"primary",
|
|
507
|
+
"gray",
|
|
508
|
+
"red",
|
|
509
|
+
"orange",
|
|
510
|
+
"yellow",
|
|
511
|
+
"green",
|
|
512
|
+
"teal",
|
|
513
|
+
"blue",
|
|
514
|
+
"indigo",
|
|
515
|
+
"purple",
|
|
516
|
+
"pink"
|
|
517
|
+
];
|
|
518
|
+
function mt(t, e) {
|
|
519
|
+
if (!t) return e.colors;
|
|
520
|
+
const n = { ...e.colors };
|
|
521
|
+
for (const r of pt) {
|
|
522
|
+
const a = t[r];
|
|
523
|
+
if (a !== void 0)
|
|
524
|
+
if (r === "gray") {
|
|
525
|
+
const o = j(a, e.colors.gray);
|
|
526
|
+
n.gray = {
|
|
527
|
+
...o,
|
|
528
|
+
25: e.colors.gray[25]
|
|
529
|
+
};
|
|
530
|
+
} else
|
|
531
|
+
n[r] = j(a, e.colors[r]);
|
|
532
|
+
}
|
|
533
|
+
return t.background && (n.background = { ...n.background, ...t.background }), t.foreground && (n.foreground = { ...n.foreground, ...t.foreground }), t.border && (n.border = { ...n.border, ...t.border }), n;
|
|
534
|
+
}
|
|
535
|
+
function O(t, e = "light") {
|
|
536
|
+
const n = e === "light" ? lt : dt;
|
|
537
|
+
if (!t) return n;
|
|
538
|
+
const r = mt(t.colors, n), { colors: a, ...o } = t, i = U(
|
|
539
|
+
n,
|
|
540
|
+
o
|
|
541
|
+
);
|
|
542
|
+
return i.colors = r, i;
|
|
543
|
+
}
|
|
544
|
+
function F(t, e, n) {
|
|
545
|
+
for (const [r, a] of Object.entries(t)) {
|
|
546
|
+
const o = `${e}-${r}`;
|
|
547
|
+
typeof a == "string" ? n[o] = a : typeof a == "number" ? n[o] = String(a) : a && typeof a == "object" && !Array.isArray(a) && F(a, o, n);
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
function ht(t, e = "syntra") {
|
|
551
|
+
const n = {};
|
|
552
|
+
return F(
|
|
553
|
+
t.colors,
|
|
554
|
+
`--${e}-color`,
|
|
555
|
+
n
|
|
556
|
+
), F(
|
|
557
|
+
t.typography,
|
|
558
|
+
`--${e}-font`,
|
|
559
|
+
n
|
|
560
|
+
), F(
|
|
561
|
+
t.spacing,
|
|
562
|
+
`--${e}-space`,
|
|
563
|
+
n
|
|
564
|
+
), F(
|
|
565
|
+
t.borderRadius,
|
|
566
|
+
`--${e}-radius`,
|
|
567
|
+
n
|
|
568
|
+
), F(
|
|
569
|
+
t.shadows,
|
|
570
|
+
`--${e}-shadow`,
|
|
571
|
+
n
|
|
572
|
+
), F(
|
|
573
|
+
t.transitions,
|
|
574
|
+
`--${e}-transition`,
|
|
575
|
+
n
|
|
576
|
+
), n;
|
|
577
|
+
}
|
|
578
|
+
function xt(t, e = "syntra", n = document.documentElement) {
|
|
579
|
+
const r = ht(t, e);
|
|
580
|
+
for (const [a, o] of Object.entries(r))
|
|
581
|
+
n.style.setProperty(a, o);
|
|
582
|
+
}
|
|
583
|
+
function vt(t = "syntra", e = document.documentElement) {
|
|
584
|
+
const n = e.style, r = [];
|
|
585
|
+
for (let a = 0; a < n.length; a++) {
|
|
586
|
+
const o = n[a];
|
|
587
|
+
o.startsWith(`--${t}-`) && r.push(o);
|
|
588
|
+
}
|
|
589
|
+
for (const a of r)
|
|
590
|
+
n.removeProperty(a);
|
|
591
|
+
}
|
|
592
|
+
function _t() {
|
|
593
|
+
const [t, e] = I(() => typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light");
|
|
594
|
+
return R(() => {
|
|
595
|
+
const n = window.matchMedia("(prefers-color-scheme: dark)"), r = (a) => {
|
|
596
|
+
e(a.matches ? "dark" : "light");
|
|
597
|
+
};
|
|
598
|
+
return n.addEventListener("change", r), () => n.removeEventListener("change", r);
|
|
599
|
+
}, []), t;
|
|
600
|
+
}
|
|
601
|
+
function an({
|
|
602
|
+
theme: t,
|
|
603
|
+
darkTheme: e,
|
|
604
|
+
mode: n = "system",
|
|
605
|
+
cssVarPrefix: r = "syntra",
|
|
606
|
+
children: a
|
|
607
|
+
}) {
|
|
608
|
+
const [o, i] = I(n), l = _t(), s = tt(null), d = o === "system" ? l : o, c = M(
|
|
609
|
+
() => O(t, "light"),
|
|
610
|
+
[t]
|
|
611
|
+
), u = M(
|
|
612
|
+
() => O(e ?? t, "dark"),
|
|
613
|
+
[e, t]
|
|
614
|
+
), f = d === "dark" ? u : c;
|
|
615
|
+
nt(() => {
|
|
616
|
+
const b = s.current;
|
|
617
|
+
b && xt(f, r, b);
|
|
618
|
+
}, [f, r]), R(() => {
|
|
619
|
+
const b = s.current;
|
|
620
|
+
return () => {
|
|
621
|
+
b && vt(r, b);
|
|
622
|
+
};
|
|
623
|
+
}, [r]);
|
|
624
|
+
const y = et((b) => {
|
|
625
|
+
i(b);
|
|
626
|
+
}, []), p = M(
|
|
627
|
+
() => ({
|
|
628
|
+
theme: f,
|
|
629
|
+
mode: o,
|
|
630
|
+
resolvedMode: d,
|
|
631
|
+
setMode: y,
|
|
632
|
+
cssVarPrefix: r
|
|
633
|
+
}),
|
|
634
|
+
[f, o, d, y, r]
|
|
635
|
+
);
|
|
636
|
+
return /* @__PURE__ */ x(H.Provider, { value: p, children: /* @__PURE__ */ x(
|
|
637
|
+
"div",
|
|
638
|
+
{
|
|
639
|
+
ref: s,
|
|
640
|
+
"data-syntra-root": "",
|
|
641
|
+
"data-syntra-mode": d,
|
|
642
|
+
style: { display: "contents" },
|
|
643
|
+
children: a
|
|
644
|
+
}
|
|
645
|
+
) });
|
|
646
|
+
}
|
|
647
|
+
function St() {
|
|
648
|
+
const t = D(H);
|
|
649
|
+
if (!t)
|
|
650
|
+
throw new Error("useSyntra must be used within a <SyntraProvider>");
|
|
651
|
+
return t;
|
|
652
|
+
}
|
|
653
|
+
function on() {
|
|
654
|
+
const { resolvedMode: t, setMode: e } = St();
|
|
655
|
+
return [t, e];
|
|
656
|
+
}
|
|
657
|
+
const wt = /* @__PURE__ */ new Set([
|
|
658
|
+
"px",
|
|
659
|
+
"0",
|
|
660
|
+
"0.5",
|
|
661
|
+
"1",
|
|
662
|
+
"1.5",
|
|
663
|
+
"2",
|
|
664
|
+
"2.5",
|
|
665
|
+
"3",
|
|
666
|
+
"4",
|
|
667
|
+
"5",
|
|
668
|
+
"6",
|
|
669
|
+
"8",
|
|
670
|
+
"10",
|
|
671
|
+
"12",
|
|
672
|
+
"16",
|
|
673
|
+
"20",
|
|
674
|
+
"24"
|
|
675
|
+
]), kt = /* @__PURE__ */ new Set([
|
|
676
|
+
"none",
|
|
677
|
+
"xs",
|
|
678
|
+
"sm",
|
|
679
|
+
"md",
|
|
680
|
+
"lg",
|
|
681
|
+
"xl",
|
|
682
|
+
"2xl",
|
|
683
|
+
"full"
|
|
684
|
+
]), Nt = /* @__PURE__ */ new Set([
|
|
685
|
+
"none",
|
|
686
|
+
"xs",
|
|
687
|
+
"sm",
|
|
688
|
+
"md",
|
|
689
|
+
"lg",
|
|
690
|
+
"xl",
|
|
691
|
+
"2xl"
|
|
692
|
+
]), zt = /* @__PURE__ */ new Set([
|
|
693
|
+
"2xs",
|
|
694
|
+
"xs",
|
|
695
|
+
"sm",
|
|
696
|
+
"base",
|
|
697
|
+
"md",
|
|
698
|
+
"lg",
|
|
699
|
+
"xl",
|
|
700
|
+
"2xl",
|
|
701
|
+
"3xl",
|
|
702
|
+
"4xl"
|
|
703
|
+
]), Ct = /* @__PURE__ */ new Set([
|
|
704
|
+
"regular",
|
|
705
|
+
"medium",
|
|
706
|
+
"semibold",
|
|
707
|
+
"bold"
|
|
708
|
+
]), $t = /* @__PURE__ */ new Set([
|
|
709
|
+
"tight",
|
|
710
|
+
"normal",
|
|
711
|
+
"relaxed"
|
|
712
|
+
]), Ft = /* @__PURE__ */ new Set([
|
|
713
|
+
"tight",
|
|
714
|
+
"normal",
|
|
715
|
+
"wide"
|
|
716
|
+
]);
|
|
717
|
+
function m(t, e) {
|
|
718
|
+
const n = String(t);
|
|
719
|
+
return wt.has(n) ? `var(--${e}-space-${n})` : typeof t == "number" ? `${t}px` : t;
|
|
720
|
+
}
|
|
721
|
+
function Tt(t, e) {
|
|
722
|
+
return kt.has(t) ? `var(--${e}-radius-${t})` : t;
|
|
723
|
+
}
|
|
724
|
+
function Et(t, e) {
|
|
725
|
+
return Nt.has(t) ? `var(--${e}-shadow-${t})` : t;
|
|
726
|
+
}
|
|
727
|
+
function S(t) {
|
|
728
|
+
return typeof t == "number" ? `${t}px` : t;
|
|
729
|
+
}
|
|
730
|
+
function X(t, e) {
|
|
731
|
+
return zt.has(t) ? `var(--${e}-font-fontSize-${t})` : t;
|
|
732
|
+
}
|
|
733
|
+
function Z(t, e) {
|
|
734
|
+
return Ct.has(t) ? `var(--${e}-font-fontWeight-${t})` : t;
|
|
735
|
+
}
|
|
736
|
+
function At(t, e) {
|
|
737
|
+
return $t.has(t) ? `var(--${e}-font-lineHeight-${t})` : t;
|
|
738
|
+
}
|
|
739
|
+
function q(t, e) {
|
|
740
|
+
return Ft.has(t) ? `var(--${e}-font-letterSpacing-${t})` : t;
|
|
741
|
+
}
|
|
742
|
+
function N(t, e = "syntra") {
|
|
743
|
+
const n = {};
|
|
744
|
+
return t.p != null && (n.padding = m(t.p, e)), t.px != null && (n.paddingLeft = m(t.px, e), n.paddingRight = m(t.px, e)), t.py != null && (n.paddingTop = m(t.py, e), n.paddingBottom = m(t.py, e)), t.pt != null && (n.paddingTop = m(t.pt, e)), t.pr != null && (n.paddingRight = m(t.pr, e)), t.pb != null && (n.paddingBottom = m(t.pb, e)), t.pl != null && (n.paddingLeft = m(t.pl, e)), t.m != null && (n.margin = m(t.m, e)), t.mx != null && (n.marginLeft = m(t.mx, e), n.marginRight = m(t.mx, e)), t.my != null && (n.marginTop = m(t.my, e), n.marginBottom = m(t.my, e)), t.mt != null && (n.marginTop = m(t.mt, e)), t.mr != null && (n.marginRight = m(t.mr, e)), t.mb != null && (n.marginBottom = m(t.mb, e)), t.ml != null && (n.marginLeft = m(t.ml, e)), t.gap != null && (n.gap = m(t.gap, e)), t.gapX != null && (n.columnGap = m(t.gapX, e)), t.gapY != null && (n.rowGap = m(t.gapY, e)), t.w != null && (n.width = S(t.w)), t.h != null && (n.height = S(t.h)), t.minW != null && (n.minWidth = S(t.minW)), t.minH != null && (n.minHeight = S(t.minH)), t.maxW != null && (n.maxWidth = S(t.maxW)), t.maxH != null && (n.maxHeight = S(t.maxH)), t.display != null && (n.display = t.display), t.position != null && (n.position = t.position), t.overflow != null && (n.overflow = t.overflow), t.inset != null && (n.inset = S(t.inset)), t.top != null && (n.top = S(t.top)), t.right != null && (n.right = S(t.right)), t.bottom != null && (n.bottom = S(t.bottom)), t.left != null && (n.left = S(t.left)), t.bg != null && (n.background = t.bg), t.color != null && (n.color = t.color), t.opacity != null && (n.opacity = t.opacity), t.radius != null && (n.borderRadius = Tt(t.radius, e)), t.shadow != null && (n.boxShadow = Et(t.shadow, e)), t.border != null && (n.border = t.border), t.borderColor != null && (n.borderColor = t.borderColor), t.borderWidth != null && (n.borderWidth = S(t.borderWidth)), t.flex != null && (n.flex = t.flex), t.flexGrow != null && (n.flexGrow = t.flexGrow), t.flexShrink != null && (n.flexShrink = t.flexShrink), t.flexBasis != null && (n.flexBasis = typeof t.flexBasis == "number" ? `${t.flexBasis}px` : t.flexBasis), t.alignSelf != null && (n.alignSelf = t.alignSelf), t.justifySelf != null && (n.justifySelf = t.justifySelf), n;
|
|
745
|
+
}
|
|
746
|
+
const Mt = /* @__PURE__ */ new Set([
|
|
747
|
+
"p",
|
|
748
|
+
"px",
|
|
749
|
+
"py",
|
|
750
|
+
"pt",
|
|
751
|
+
"pr",
|
|
752
|
+
"pb",
|
|
753
|
+
"pl",
|
|
754
|
+
"m",
|
|
755
|
+
"mx",
|
|
756
|
+
"my",
|
|
757
|
+
"mt",
|
|
758
|
+
"mr",
|
|
759
|
+
"mb",
|
|
760
|
+
"ml",
|
|
761
|
+
"gap",
|
|
762
|
+
"gapX",
|
|
763
|
+
"gapY",
|
|
764
|
+
"w",
|
|
765
|
+
"h",
|
|
766
|
+
"minW",
|
|
767
|
+
"minH",
|
|
768
|
+
"maxW",
|
|
769
|
+
"maxH",
|
|
770
|
+
"display",
|
|
771
|
+
"position",
|
|
772
|
+
"overflow",
|
|
773
|
+
"inset",
|
|
774
|
+
"top",
|
|
775
|
+
"right",
|
|
776
|
+
"bottom",
|
|
777
|
+
"left",
|
|
778
|
+
"bg",
|
|
779
|
+
"color",
|
|
780
|
+
"opacity",
|
|
781
|
+
"radius",
|
|
782
|
+
"shadow",
|
|
783
|
+
"border",
|
|
784
|
+
"borderColor",
|
|
785
|
+
"borderWidth",
|
|
786
|
+
"flex",
|
|
787
|
+
"flexGrow",
|
|
788
|
+
"flexShrink",
|
|
789
|
+
"flexBasis",
|
|
790
|
+
"alignSelf",
|
|
791
|
+
"justifySelf"
|
|
792
|
+
]);
|
|
793
|
+
function z(t) {
|
|
794
|
+
const e = {}, n = {};
|
|
795
|
+
for (const r of Object.keys(t))
|
|
796
|
+
Mt.has(r) ? e[r] = t[r] : n[r] = t[r];
|
|
797
|
+
return {
|
|
798
|
+
styleProps: e,
|
|
799
|
+
rest: n
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
function C() {
|
|
803
|
+
return D(H)?.cssVarPrefix ?? "syntra";
|
|
804
|
+
}
|
|
805
|
+
function w(...t) {
|
|
806
|
+
const e = [];
|
|
807
|
+
for (const n of t)
|
|
808
|
+
if (!(!n && n !== 0)) {
|
|
809
|
+
if (typeof n == "string")
|
|
810
|
+
e.push(n);
|
|
811
|
+
else if (typeof n == "number")
|
|
812
|
+
e.push(String(n));
|
|
813
|
+
else if (Array.isArray(n)) {
|
|
814
|
+
const r = w(...n);
|
|
815
|
+
r && e.push(r);
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
return e.join(" ");
|
|
819
|
+
}
|
|
820
|
+
const Pt = k(
|
|
821
|
+
(t, e) => {
|
|
822
|
+
const { as: n = "div", className: r, style: a, children: o, ...i } = t, l = C(), { styleProps: s, rest: d } = z(i), c = N(s, l);
|
|
823
|
+
return /* @__PURE__ */ x(
|
|
824
|
+
n,
|
|
825
|
+
{
|
|
826
|
+
...d,
|
|
827
|
+
ref: e,
|
|
828
|
+
className: w("syntra-box", r),
|
|
829
|
+
style: { ...c, ...a },
|
|
830
|
+
children: o
|
|
831
|
+
}
|
|
832
|
+
);
|
|
833
|
+
}
|
|
834
|
+
);
|
|
835
|
+
Pt.displayName = "Box";
|
|
836
|
+
const Ht = k(
|
|
837
|
+
(t, e) => {
|
|
838
|
+
const {
|
|
839
|
+
as: n = "span",
|
|
840
|
+
className: r,
|
|
841
|
+
style: a,
|
|
842
|
+
children: o,
|
|
843
|
+
size: i,
|
|
844
|
+
weight: l,
|
|
845
|
+
lineHeight: s,
|
|
846
|
+
tracking: d,
|
|
847
|
+
align: c,
|
|
848
|
+
truncate: u,
|
|
849
|
+
lineClamp: f,
|
|
850
|
+
mono: y,
|
|
851
|
+
italic: p,
|
|
852
|
+
...b
|
|
853
|
+
} = t, g = C(), { styleProps: _, rest: $ } = z(b), T = N(_, g), h = {};
|
|
854
|
+
i != null && (h.fontSize = X(String(i), g)), l != null && (h.fontWeight = Z(String(l), g)), s != null && (h.lineHeight = At(String(s), g)), d != null && (h.letterSpacing = q(String(d), g)), c != null && (h.textAlign = c), y && (h.fontFamily = `var(--${g}-font-fontFamily-mono)`), p && (h.fontStyle = "italic"), u && (h.overflow = "hidden", h.textOverflow = "ellipsis", h.whiteSpace = "nowrap"), f != null && (h.display = "-webkit-box", h.WebkitLineClamp = f, h.WebkitBoxOrient = "vertical", h.overflow = "hidden");
|
|
855
|
+
const E = {};
|
|
856
|
+
return u && (E["data-truncate"] = ""), f != null && (E["data-line-clamp"] = String(f)), /* @__PURE__ */ x(
|
|
857
|
+
n,
|
|
858
|
+
{
|
|
859
|
+
...$,
|
|
860
|
+
...E,
|
|
861
|
+
ref: e,
|
|
862
|
+
className: w("syntra-text", r),
|
|
863
|
+
style: { ...h, ...T, ...a },
|
|
864
|
+
children: o
|
|
865
|
+
}
|
|
866
|
+
);
|
|
867
|
+
}
|
|
868
|
+
);
|
|
869
|
+
Ht.displayName = "Text";
|
|
870
|
+
const Wt = {
|
|
871
|
+
h1: { size: "4xl", weight: "bold", tracking: "tight" },
|
|
872
|
+
h2: { size: "3xl", weight: "bold", tracking: "tight" },
|
|
873
|
+
h3: { size: "2xl", weight: "semibold", tracking: "tight" },
|
|
874
|
+
h4: { size: "xl", weight: "semibold", tracking: void 0 },
|
|
875
|
+
h5: { size: "lg", weight: "semibold", tracking: void 0 },
|
|
876
|
+
h6: { size: "md", weight: "medium", tracking: void 0 }
|
|
877
|
+
}, jt = k(
|
|
878
|
+
(t, e) => {
|
|
879
|
+
const {
|
|
880
|
+
as: n,
|
|
881
|
+
className: r,
|
|
882
|
+
style: a,
|
|
883
|
+
children: o,
|
|
884
|
+
level: i = "h2",
|
|
885
|
+
size: l,
|
|
886
|
+
weight: s,
|
|
887
|
+
tracking: d,
|
|
888
|
+
...c
|
|
889
|
+
} = t, u = n || i, f = C(), { styleProps: y, rest: p } = z(c), b = N(y, f), g = Wt[i], _ = l ?? g.size, $ = s ?? g.weight, T = d ?? g.tracking, h = {
|
|
890
|
+
fontSize: X(String(_), f),
|
|
891
|
+
fontWeight: Z(String($), f)
|
|
892
|
+
};
|
|
893
|
+
return T != null && (h.letterSpacing = q(String(T), f)), /* @__PURE__ */ x(
|
|
894
|
+
u,
|
|
895
|
+
{
|
|
896
|
+
...p,
|
|
897
|
+
ref: e,
|
|
898
|
+
className: w("syntra-heading", r),
|
|
899
|
+
style: { ...h, ...b, ...a },
|
|
900
|
+
children: o
|
|
901
|
+
}
|
|
902
|
+
);
|
|
903
|
+
}
|
|
904
|
+
);
|
|
905
|
+
jt.displayName = "Heading";
|
|
906
|
+
const Ot = k(
|
|
907
|
+
(t, e) => {
|
|
908
|
+
const {
|
|
909
|
+
as: n = "div",
|
|
910
|
+
className: r,
|
|
911
|
+
style: a,
|
|
912
|
+
children: o,
|
|
913
|
+
direction: i,
|
|
914
|
+
align: l,
|
|
915
|
+
justify: s,
|
|
916
|
+
wrap: d,
|
|
917
|
+
inline: c,
|
|
918
|
+
...u
|
|
919
|
+
} = t, f = C(), { styleProps: y, rest: p } = z(u), b = N(y, f), g = {
|
|
920
|
+
display: c ? "inline-flex" : "flex"
|
|
921
|
+
};
|
|
922
|
+
return i != null && (g.flexDirection = i), l != null && (g.alignItems = l), s != null && (g.justifyContent = s), d != null && (g.flexWrap = d), /* @__PURE__ */ x(
|
|
923
|
+
n,
|
|
924
|
+
{
|
|
925
|
+
...p,
|
|
926
|
+
ref: e,
|
|
927
|
+
className: w("syntra-flex", r),
|
|
928
|
+
style: { ...g, ...b, ...a },
|
|
929
|
+
children: o
|
|
930
|
+
}
|
|
931
|
+
);
|
|
932
|
+
}
|
|
933
|
+
);
|
|
934
|
+
Ot.displayName = "Flex";
|
|
935
|
+
const Bt = k(
|
|
936
|
+
(t, e) => {
|
|
937
|
+
const {
|
|
938
|
+
as: n = "div",
|
|
939
|
+
className: r,
|
|
940
|
+
style: a,
|
|
941
|
+
children: o,
|
|
942
|
+
direction: i = "vertical",
|
|
943
|
+
align: l,
|
|
944
|
+
justify: s,
|
|
945
|
+
wrap: d,
|
|
946
|
+
...c
|
|
947
|
+
} = t, u = C(), { styleProps: f, rest: y } = z(c), p = N(f, u), b = {
|
|
948
|
+
display: "flex",
|
|
949
|
+
flexDirection: i === "horizontal" ? "row" : "column"
|
|
950
|
+
};
|
|
951
|
+
l != null && (b.alignItems = l), s != null && (b.justifyContent = s), d != null && (b.flexWrap = d);
|
|
952
|
+
const g = i === "horizontal" ? "horizontal" : "vertical";
|
|
953
|
+
return /* @__PURE__ */ x(
|
|
954
|
+
n,
|
|
955
|
+
{
|
|
956
|
+
...y,
|
|
957
|
+
ref: e,
|
|
958
|
+
className: w("syntra-stack", r),
|
|
959
|
+
style: { ...b, ...p, ...a },
|
|
960
|
+
"data-orientation": g,
|
|
961
|
+
children: o
|
|
962
|
+
}
|
|
963
|
+
);
|
|
964
|
+
}
|
|
965
|
+
);
|
|
966
|
+
Bt.displayName = "Stack";
|
|
967
|
+
function B(t) {
|
|
968
|
+
return typeof t == "number" ? `repeat(${t}, 1fr)` : t;
|
|
969
|
+
}
|
|
970
|
+
const Lt = k(
|
|
971
|
+
(t, e) => {
|
|
972
|
+
const {
|
|
973
|
+
as: n = "div",
|
|
974
|
+
className: r,
|
|
975
|
+
style: a,
|
|
976
|
+
children: o,
|
|
977
|
+
columns: i,
|
|
978
|
+
rows: l,
|
|
979
|
+
areas: s,
|
|
980
|
+
align: d,
|
|
981
|
+
justify: c,
|
|
982
|
+
inline: u,
|
|
983
|
+
...f
|
|
984
|
+
} = t, y = C(), { styleProps: p, rest: b } = z(f), g = N(p, y), _ = {
|
|
985
|
+
display: u ? "inline-grid" : "grid"
|
|
986
|
+
};
|
|
987
|
+
return i != null && (_.gridTemplateColumns = B(i)), l != null && (_.gridTemplateRows = B(l)), s != null && (_.gridTemplateAreas = s), d != null && (_.alignItems = d), c != null && (_.justifyContent = c), /* @__PURE__ */ x(
|
|
988
|
+
n,
|
|
989
|
+
{
|
|
990
|
+
...b,
|
|
991
|
+
ref: e,
|
|
992
|
+
className: w("syntra-grid", r),
|
|
993
|
+
style: { ..._, ...g, ...a },
|
|
994
|
+
children: o
|
|
995
|
+
}
|
|
996
|
+
);
|
|
997
|
+
}
|
|
998
|
+
);
|
|
999
|
+
Lt.displayName = "Grid";
|
|
1000
|
+
const It = k(
|
|
1001
|
+
(t, e) => {
|
|
1002
|
+
const {
|
|
1003
|
+
as: n = "div",
|
|
1004
|
+
className: r,
|
|
1005
|
+
style: a,
|
|
1006
|
+
children: o,
|
|
1007
|
+
orientation: i = "horizontal",
|
|
1008
|
+
color: l,
|
|
1009
|
+
thickness: s = 1,
|
|
1010
|
+
decorative: d = !0,
|
|
1011
|
+
...c
|
|
1012
|
+
} = t, u = C(), { styleProps: f, rest: y } = z(c), p = N(f, u), b = l ?? `var(--${u}-color-border-default)`, g = typeof s == "number" ? `${s}px` : s, _ = i === "horizontal" ? {
|
|
1013
|
+
width: "100%",
|
|
1014
|
+
height: 0,
|
|
1015
|
+
borderTop: `${g} solid ${b}`
|
|
1016
|
+
} : {
|
|
1017
|
+
height: "100%",
|
|
1018
|
+
width: 0,
|
|
1019
|
+
borderLeft: `${g} solid ${b}`
|
|
1020
|
+
};
|
|
1021
|
+
return /* @__PURE__ */ x(
|
|
1022
|
+
n,
|
|
1023
|
+
{
|
|
1024
|
+
...y,
|
|
1025
|
+
...d ? { "aria-hidden": !0 } : { role: "separator", "aria-orientation": i },
|
|
1026
|
+
ref: e,
|
|
1027
|
+
className: w("syntra-divider", r),
|
|
1028
|
+
style: { ..._, ...p, ...a },
|
|
1029
|
+
"data-orientation": i,
|
|
1030
|
+
children: o
|
|
1031
|
+
}
|
|
1032
|
+
);
|
|
1033
|
+
}
|
|
1034
|
+
);
|
|
1035
|
+
It.displayName = "Divider";
|
|
1036
|
+
const Rt = {
|
|
1037
|
+
position: "absolute",
|
|
1038
|
+
width: 1,
|
|
1039
|
+
height: 1,
|
|
1040
|
+
padding: 0,
|
|
1041
|
+
margin: -1,
|
|
1042
|
+
overflow: "hidden",
|
|
1043
|
+
clip: "rect(0, 0, 0, 0)",
|
|
1044
|
+
whiteSpace: "nowrap",
|
|
1045
|
+
borderWidth: 0
|
|
1046
|
+
}, Dt = k(
|
|
1047
|
+
(t, e) => {
|
|
1048
|
+
const { as: n = "span", className: r, style: a, children: o, ...i } = t;
|
|
1049
|
+
return /* @__PURE__ */ x(
|
|
1050
|
+
n,
|
|
1051
|
+
{
|
|
1052
|
+
...i,
|
|
1053
|
+
ref: e,
|
|
1054
|
+
className: r,
|
|
1055
|
+
style: { ...Rt, ...a },
|
|
1056
|
+
children: o
|
|
1057
|
+
}
|
|
1058
|
+
);
|
|
1059
|
+
}
|
|
1060
|
+
);
|
|
1061
|
+
Dt.displayName = "VisuallyHidden";
|
|
1062
|
+
const A = /* @__PURE__ */ new Map();
|
|
1063
|
+
function W(t, e) {
|
|
1064
|
+
rt(() => {
|
|
1065
|
+
if ((A.get(t) ?? 0) === 0) {
|
|
1066
|
+
const r = document.createElement("style");
|
|
1067
|
+
r.setAttribute("data-syntra", t), r.textContent = e, document.head.appendChild(r);
|
|
1068
|
+
}
|
|
1069
|
+
return A.set(t, (A.get(t) ?? 0) + 1), () => {
|
|
1070
|
+
const r = (A.get(t) ?? 1) - 1;
|
|
1071
|
+
r <= 0 ? (A.delete(t), document.head.querySelector(`style[data-syntra="${t}"]`)?.remove()) : A.set(t, r);
|
|
1072
|
+
};
|
|
1073
|
+
}, [t, e]);
|
|
1074
|
+
}
|
|
1075
|
+
const Gt = `
|
|
1076
|
+
@keyframes syntra-spin {
|
|
1077
|
+
to { transform: rotate(360deg); }
|
|
1078
|
+
}
|
|
1079
|
+
.syntra-spinner {
|
|
1080
|
+
animation: syntra-spin 0.6s linear infinite;
|
|
1081
|
+
}
|
|
1082
|
+
`;
|
|
1083
|
+
function J({ size: t = "1em", color: e = "currentColor", className: n, style: r }) {
|
|
1084
|
+
W("spinner", Gt);
|
|
1085
|
+
const a = typeof t == "number" ? `${t}px` : t;
|
|
1086
|
+
return /* @__PURE__ */ x(
|
|
1087
|
+
"svg",
|
|
1088
|
+
{
|
|
1089
|
+
className: `syntra-spinner${n ? ` ${n}` : ""}`,
|
|
1090
|
+
width: a,
|
|
1091
|
+
height: a,
|
|
1092
|
+
viewBox: "0 0 24 24",
|
|
1093
|
+
fill: "none",
|
|
1094
|
+
stroke: e,
|
|
1095
|
+
strokeWidth: "2.5",
|
|
1096
|
+
strokeLinecap: "round",
|
|
1097
|
+
style: r,
|
|
1098
|
+
"aria-hidden": "true",
|
|
1099
|
+
children: /* @__PURE__ */ x("path", { d: "M12 2a10 10 0 0 1 10 10" })
|
|
1100
|
+
}
|
|
1101
|
+
);
|
|
1102
|
+
}
|
|
1103
|
+
J.displayName = "Spinner";
|
|
1104
|
+
const Kt = `
|
|
1105
|
+
.syntra-button {
|
|
1106
|
+
display: inline-flex;
|
|
1107
|
+
align-items: center;
|
|
1108
|
+
justify-content: center;
|
|
1109
|
+
position: relative;
|
|
1110
|
+
white-space: nowrap;
|
|
1111
|
+
user-select: none;
|
|
1112
|
+
vertical-align: middle;
|
|
1113
|
+
cursor: pointer;
|
|
1114
|
+
font-family: inherit;
|
|
1115
|
+
font-weight: var(--_btn-fw);
|
|
1116
|
+
font-size: var(--_btn-fz);
|
|
1117
|
+
height: var(--_btn-h);
|
|
1118
|
+
padding-left: var(--_btn-px);
|
|
1119
|
+
padding-right: var(--_btn-px);
|
|
1120
|
+
gap: var(--_btn-gap);
|
|
1121
|
+
border-radius: var(--_btn-radius);
|
|
1122
|
+
background: var(--_btn-bg);
|
|
1123
|
+
color: var(--_btn-color);
|
|
1124
|
+
border: 1px solid var(--_btn-border, transparent);
|
|
1125
|
+
transition: background 150ms ease, border-color 150ms ease, color 150ms ease, opacity 150ms ease;
|
|
1126
|
+
text-decoration: none;
|
|
1127
|
+
outline: none;
|
|
1128
|
+
}
|
|
1129
|
+
.syntra-button:hover:not(:disabled):not([data-loading]) {
|
|
1130
|
+
background: var(--_btn-bg-hover);
|
|
1131
|
+
border-color: var(--_btn-border-hover, transparent);
|
|
1132
|
+
color: var(--_btn-color-hover, var(--_btn-color));
|
|
1133
|
+
}
|
|
1134
|
+
.syntra-button:active:not(:disabled):not([data-loading]) {
|
|
1135
|
+
background: var(--_btn-bg-active);
|
|
1136
|
+
}
|
|
1137
|
+
.syntra-button:focus-visible {
|
|
1138
|
+
outline: 2px solid var(--_btn-ring);
|
|
1139
|
+
outline-offset: 2px;
|
|
1140
|
+
}
|
|
1141
|
+
.syntra-button:disabled,
|
|
1142
|
+
.syntra-button[data-loading] {
|
|
1143
|
+
opacity: 0.5;
|
|
1144
|
+
cursor: not-allowed;
|
|
1145
|
+
}
|
|
1146
|
+
.syntra-button[data-loading] {
|
|
1147
|
+
cursor: wait;
|
|
1148
|
+
pointer-events: none;
|
|
1149
|
+
}
|
|
1150
|
+
.syntra-button[data-full-width] {
|
|
1151
|
+
width: 100%;
|
|
1152
|
+
}
|
|
1153
|
+
.syntra-button[data-variant="link"] {
|
|
1154
|
+
height: auto;
|
|
1155
|
+
padding-left: 0;
|
|
1156
|
+
padding-right: 0;
|
|
1157
|
+
background: transparent;
|
|
1158
|
+
border-color: transparent;
|
|
1159
|
+
}
|
|
1160
|
+
.syntra-button[data-variant="link"]:hover:not(:disabled) {
|
|
1161
|
+
text-decoration: underline;
|
|
1162
|
+
background: transparent;
|
|
1163
|
+
}
|
|
1164
|
+
.syntra-button-label[data-loading] {
|
|
1165
|
+
opacity: 0;
|
|
1166
|
+
}
|
|
1167
|
+
.syntra-button-spinner {
|
|
1168
|
+
position: absolute;
|
|
1169
|
+
inset: 0;
|
|
1170
|
+
display: flex;
|
|
1171
|
+
align-items: center;
|
|
1172
|
+
justify-content: center;
|
|
1173
|
+
}
|
|
1174
|
+
`, Vt = {
|
|
1175
|
+
xs: {
|
|
1176
|
+
"--_btn-h": "28px",
|
|
1177
|
+
"--_btn-px": "10px",
|
|
1178
|
+
"--_btn-fz": "var(--syntra-font-fontSize-2xs)",
|
|
1179
|
+
"--_btn-fw": "500",
|
|
1180
|
+
"--_btn-radius": "var(--syntra-radius-sm)",
|
|
1181
|
+
"--_btn-gap": "4px"
|
|
1182
|
+
},
|
|
1183
|
+
sm: {
|
|
1184
|
+
"--_btn-h": "32px",
|
|
1185
|
+
"--_btn-px": "12px",
|
|
1186
|
+
"--_btn-fz": "var(--syntra-font-fontSize-xs)",
|
|
1187
|
+
"--_btn-fw": "500",
|
|
1188
|
+
"--_btn-radius": "var(--syntra-radius-sm)",
|
|
1189
|
+
"--_btn-gap": "6px"
|
|
1190
|
+
},
|
|
1191
|
+
md: {
|
|
1192
|
+
"--_btn-h": "36px",
|
|
1193
|
+
"--_btn-px": "16px",
|
|
1194
|
+
"--_btn-fz": "var(--syntra-font-fontSize-sm)",
|
|
1195
|
+
"--_btn-fw": "500",
|
|
1196
|
+
"--_btn-radius": "var(--syntra-radius-md)",
|
|
1197
|
+
"--_btn-gap": "8px"
|
|
1198
|
+
},
|
|
1199
|
+
lg: {
|
|
1200
|
+
"--_btn-h": "44px",
|
|
1201
|
+
"--_btn-px": "20px",
|
|
1202
|
+
"--_btn-fz": "var(--syntra-font-fontSize-md)",
|
|
1203
|
+
"--_btn-fw": "500",
|
|
1204
|
+
"--_btn-radius": "var(--syntra-radius-md)",
|
|
1205
|
+
"--_btn-gap": "8px"
|
|
1206
|
+
}
|
|
1207
|
+
};
|
|
1208
|
+
function Yt(t) {
|
|
1209
|
+
return Vt[t];
|
|
1210
|
+
}
|
|
1211
|
+
function v(t, e) {
|
|
1212
|
+
return t === "danger" ? `var(--syntra-color-red-${e})` : `var(--syntra-color-${t}-${e})`;
|
|
1213
|
+
}
|
|
1214
|
+
function Ut(t, e) {
|
|
1215
|
+
const n = e === "neutral" ? "var(--syntra-color-foreground-subtle)" : e === "danger" ? "var(--syntra-color-red-500)" : `var(--syntra-color-${e}-500)`;
|
|
1216
|
+
return (() => {
|
|
1217
|
+
switch (t) {
|
|
1218
|
+
case "solid":
|
|
1219
|
+
return e === "neutral" ? {
|
|
1220
|
+
"--_btn-bg": "var(--syntra-color-foreground-default)",
|
|
1221
|
+
"--_btn-bg-hover": "var(--syntra-color-foreground-muted)",
|
|
1222
|
+
"--_btn-bg-active": "var(--syntra-color-foreground-subtle)",
|
|
1223
|
+
"--_btn-color": "var(--syntra-color-background-default)",
|
|
1224
|
+
"--_btn-border": "transparent",
|
|
1225
|
+
"--_btn-ring": n
|
|
1226
|
+
} : {
|
|
1227
|
+
"--_btn-bg": v(e, 500),
|
|
1228
|
+
"--_btn-bg-hover": v(e, 600),
|
|
1229
|
+
"--_btn-bg-active": v(e, 700),
|
|
1230
|
+
"--_btn-color": "#fff",
|
|
1231
|
+
"--_btn-border": "transparent",
|
|
1232
|
+
"--_btn-ring": n
|
|
1233
|
+
};
|
|
1234
|
+
case "outline":
|
|
1235
|
+
return e === "neutral" ? {
|
|
1236
|
+
"--_btn-bg": "transparent",
|
|
1237
|
+
"--_btn-bg-hover": "var(--syntra-color-background-emphasis)",
|
|
1238
|
+
"--_btn-bg-active": "var(--syntra-color-background-subtle)",
|
|
1239
|
+
"--_btn-color": "var(--syntra-color-foreground-default)",
|
|
1240
|
+
"--_btn-border": "var(--syntra-color-border-default)",
|
|
1241
|
+
"--_btn-border-hover": "var(--syntra-color-border-emphasis)",
|
|
1242
|
+
"--_btn-ring": n
|
|
1243
|
+
} : {
|
|
1244
|
+
"--_btn-bg": "transparent",
|
|
1245
|
+
"--_btn-bg-hover": v(e, 50),
|
|
1246
|
+
"--_btn-bg-active": v(e, 100),
|
|
1247
|
+
"--_btn-color": v(e, 500),
|
|
1248
|
+
"--_btn-border": v(e, 500),
|
|
1249
|
+
"--_btn-border-hover": v(e, 600),
|
|
1250
|
+
"--_btn-ring": n
|
|
1251
|
+
};
|
|
1252
|
+
case "ghost":
|
|
1253
|
+
return e === "neutral" ? {
|
|
1254
|
+
"--_btn-bg": "transparent",
|
|
1255
|
+
"--_btn-bg-hover": "var(--syntra-color-background-emphasis)",
|
|
1256
|
+
"--_btn-bg-active": "var(--syntra-color-background-subtle)",
|
|
1257
|
+
"--_btn-color": "var(--syntra-color-foreground-default)",
|
|
1258
|
+
"--_btn-border": "transparent",
|
|
1259
|
+
"--_btn-ring": n
|
|
1260
|
+
} : {
|
|
1261
|
+
"--_btn-bg": "transparent",
|
|
1262
|
+
"--_btn-bg-hover": v(e, 50),
|
|
1263
|
+
"--_btn-bg-active": v(e, 100),
|
|
1264
|
+
"--_btn-color": v(e, 500),
|
|
1265
|
+
"--_btn-border": "transparent",
|
|
1266
|
+
"--_btn-ring": n
|
|
1267
|
+
};
|
|
1268
|
+
case "soft":
|
|
1269
|
+
return e === "neutral" ? {
|
|
1270
|
+
"--_btn-bg": "var(--syntra-color-background-emphasis)",
|
|
1271
|
+
"--_btn-bg-hover": "var(--syntra-color-background-subtle)",
|
|
1272
|
+
"--_btn-bg-active": "var(--syntra-color-border-default)",
|
|
1273
|
+
"--_btn-color": "var(--syntra-color-foreground-default)",
|
|
1274
|
+
"--_btn-border": "transparent",
|
|
1275
|
+
"--_btn-ring": n
|
|
1276
|
+
} : {
|
|
1277
|
+
"--_btn-bg": v(e, 50),
|
|
1278
|
+
"--_btn-bg-hover": v(e, 100),
|
|
1279
|
+
"--_btn-bg-active": v(e, 200),
|
|
1280
|
+
"--_btn-color": v(e, 700),
|
|
1281
|
+
"--_btn-border": "transparent",
|
|
1282
|
+
"--_btn-ring": n
|
|
1283
|
+
};
|
|
1284
|
+
case "link":
|
|
1285
|
+
return e === "neutral" ? {
|
|
1286
|
+
"--_btn-bg": "transparent",
|
|
1287
|
+
"--_btn-bg-hover": "transparent",
|
|
1288
|
+
"--_btn-bg-active": "transparent",
|
|
1289
|
+
"--_btn-color": "var(--syntra-color-foreground-default)",
|
|
1290
|
+
"--_btn-color-hover": "var(--syntra-color-foreground-muted)",
|
|
1291
|
+
"--_btn-border": "transparent",
|
|
1292
|
+
"--_btn-ring": n
|
|
1293
|
+
} : {
|
|
1294
|
+
"--_btn-bg": "transparent",
|
|
1295
|
+
"--_btn-bg-hover": "transparent",
|
|
1296
|
+
"--_btn-bg-active": "transparent",
|
|
1297
|
+
"--_btn-color": v(e, 500),
|
|
1298
|
+
"--_btn-color-hover": v(e, 600),
|
|
1299
|
+
"--_btn-border": "transparent",
|
|
1300
|
+
"--_btn-ring": n
|
|
1301
|
+
};
|
|
1302
|
+
}
|
|
1303
|
+
})();
|
|
1304
|
+
}
|
|
1305
|
+
const Xt = k(
|
|
1306
|
+
(t, e) => {
|
|
1307
|
+
const {
|
|
1308
|
+
as: n = "button",
|
|
1309
|
+
variant: r = "solid",
|
|
1310
|
+
colorScheme: a = "primary",
|
|
1311
|
+
size: o = "md",
|
|
1312
|
+
loading: i = !1,
|
|
1313
|
+
disabled: l = !1,
|
|
1314
|
+
fullWidth: s = !1,
|
|
1315
|
+
leftSection: d,
|
|
1316
|
+
rightSection: c,
|
|
1317
|
+
className: u,
|
|
1318
|
+
style: f,
|
|
1319
|
+
children: y,
|
|
1320
|
+
...p
|
|
1321
|
+
} = t;
|
|
1322
|
+
W("button", Kt);
|
|
1323
|
+
const b = C(), { styleProps: g, rest: _ } = z(p), $ = N(g, b), T = Ut(r, a), h = Yt(o), E = l || i;
|
|
1324
|
+
return /* @__PURE__ */ L(
|
|
1325
|
+
n,
|
|
1326
|
+
{
|
|
1327
|
+
..._,
|
|
1328
|
+
ref: e,
|
|
1329
|
+
className: w("syntra-button", u),
|
|
1330
|
+
disabled: n === "button" ? E : void 0,
|
|
1331
|
+
"aria-disabled": n !== "button" && E ? !0 : void 0,
|
|
1332
|
+
"data-variant": r,
|
|
1333
|
+
"data-loading": i || void 0,
|
|
1334
|
+
"data-full-width": s || void 0,
|
|
1335
|
+
style: {
|
|
1336
|
+
...T,
|
|
1337
|
+
...h,
|
|
1338
|
+
...$,
|
|
1339
|
+
...f
|
|
1340
|
+
},
|
|
1341
|
+
children: [
|
|
1342
|
+
i && /* @__PURE__ */ x("span", { className: "syntra-button-spinner", children: /* @__PURE__ */ x(J, {}) }),
|
|
1343
|
+
d && /* @__PURE__ */ x("span", { className: "syntra-button-section", "data-position": "left", "aria-hidden": "true", children: d }),
|
|
1344
|
+
/* @__PURE__ */ x("span", { className: "syntra-button-label", "data-loading": i || void 0, children: y }),
|
|
1345
|
+
c && /* @__PURE__ */ x("span", { className: "syntra-button-section", "data-position": "right", "aria-hidden": "true", children: c })
|
|
1346
|
+
]
|
|
1347
|
+
}
|
|
1348
|
+
);
|
|
1349
|
+
}
|
|
1350
|
+
);
|
|
1351
|
+
Xt.displayName = "Button";
|
|
1352
|
+
const Zt = `
|
|
1353
|
+
.syntra-input-wrapper {
|
|
1354
|
+
display: inline-flex;
|
|
1355
|
+
align-items: center;
|
|
1356
|
+
position: relative;
|
|
1357
|
+
width: var(--_input-w, auto);
|
|
1358
|
+
height: var(--_input-h);
|
|
1359
|
+
padding-left: var(--_input-px);
|
|
1360
|
+
padding-right: var(--_input-px);
|
|
1361
|
+
gap: var(--_input-gap);
|
|
1362
|
+
border-radius: var(--_input-radius);
|
|
1363
|
+
background: var(--_input-bg);
|
|
1364
|
+
border: 1px solid var(--_input-border, transparent);
|
|
1365
|
+
font-family: inherit;
|
|
1366
|
+
font-size: var(--_input-fz);
|
|
1367
|
+
transition: border-color 150ms ease, box-shadow 150ms ease;
|
|
1368
|
+
}
|
|
1369
|
+
.syntra-input-wrapper:focus-within:not([data-disabled]):not([data-variant="unstyled"]) {
|
|
1370
|
+
border-color: var(--_input-focus-border);
|
|
1371
|
+
box-shadow: 0 0 0 1px var(--_input-focus-border);
|
|
1372
|
+
}
|
|
1373
|
+
.syntra-input-wrapper[data-invalid]:not([data-disabled]) {
|
|
1374
|
+
border-color: var(--_input-invalid-border);
|
|
1375
|
+
}
|
|
1376
|
+
.syntra-input-wrapper[data-invalid]:focus-within:not([data-disabled]) {
|
|
1377
|
+
border-color: var(--_input-invalid-border);
|
|
1378
|
+
box-shadow: 0 0 0 1px var(--_input-invalid-border);
|
|
1379
|
+
}
|
|
1380
|
+
.syntra-input-wrapper[data-disabled] {
|
|
1381
|
+
opacity: 0.5;
|
|
1382
|
+
cursor: not-allowed;
|
|
1383
|
+
}
|
|
1384
|
+
.syntra-input {
|
|
1385
|
+
flex: 1;
|
|
1386
|
+
min-width: 0;
|
|
1387
|
+
height: 100%;
|
|
1388
|
+
border: none;
|
|
1389
|
+
outline: none;
|
|
1390
|
+
background: transparent;
|
|
1391
|
+
color: inherit;
|
|
1392
|
+
font-family: inherit;
|
|
1393
|
+
font-size: inherit;
|
|
1394
|
+
padding: 0;
|
|
1395
|
+
}
|
|
1396
|
+
.syntra-input::placeholder {
|
|
1397
|
+
color: var(--syntra-color-foreground-muted);
|
|
1398
|
+
}
|
|
1399
|
+
.syntra-input:disabled {
|
|
1400
|
+
cursor: not-allowed;
|
|
1401
|
+
}
|
|
1402
|
+
.syntra-input-section {
|
|
1403
|
+
display: flex;
|
|
1404
|
+
align-items: center;
|
|
1405
|
+
justify-content: center;
|
|
1406
|
+
flex-shrink: 0;
|
|
1407
|
+
color: var(--syntra-color-foreground-muted);
|
|
1408
|
+
}
|
|
1409
|
+
`, qt = {
|
|
1410
|
+
xs: {
|
|
1411
|
+
"--_input-h": "28px",
|
|
1412
|
+
"--_input-px": "8px",
|
|
1413
|
+
"--_input-fz": "var(--syntra-font-fontSize-2xs)",
|
|
1414
|
+
"--_input-radius": "var(--syntra-radius-sm)",
|
|
1415
|
+
"--_input-gap": "4px"
|
|
1416
|
+
},
|
|
1417
|
+
sm: {
|
|
1418
|
+
"--_input-h": "32px",
|
|
1419
|
+
"--_input-px": "10px",
|
|
1420
|
+
"--_input-fz": "var(--syntra-font-fontSize-xs)",
|
|
1421
|
+
"--_input-radius": "var(--syntra-radius-sm)",
|
|
1422
|
+
"--_input-gap": "6px"
|
|
1423
|
+
},
|
|
1424
|
+
md: {
|
|
1425
|
+
"--_input-h": "36px",
|
|
1426
|
+
"--_input-px": "12px",
|
|
1427
|
+
"--_input-fz": "var(--syntra-font-fontSize-sm)",
|
|
1428
|
+
"--_input-radius": "var(--syntra-radius-md)",
|
|
1429
|
+
"--_input-gap": "8px"
|
|
1430
|
+
},
|
|
1431
|
+
lg: {
|
|
1432
|
+
"--_input-h": "44px",
|
|
1433
|
+
"--_input-px": "16px",
|
|
1434
|
+
"--_input-fz": "var(--syntra-font-fontSize-md)",
|
|
1435
|
+
"--_input-radius": "var(--syntra-radius-md)",
|
|
1436
|
+
"--_input-gap": "8px"
|
|
1437
|
+
}
|
|
1438
|
+
};
|
|
1439
|
+
function Jt(t) {
|
|
1440
|
+
return qt[t];
|
|
1441
|
+
}
|
|
1442
|
+
const Qt = {
|
|
1443
|
+
outline: {
|
|
1444
|
+
"--_input-bg": "var(--syntra-color-background-default)",
|
|
1445
|
+
"--_input-border": "var(--syntra-color-border-default)",
|
|
1446
|
+
"--_input-focus-border": "var(--syntra-color-primary-500)",
|
|
1447
|
+
"--_input-invalid-border": "var(--syntra-color-red-500)"
|
|
1448
|
+
},
|
|
1449
|
+
filled: {
|
|
1450
|
+
"--_input-bg": "var(--syntra-color-background-emphasis)",
|
|
1451
|
+
"--_input-border": "transparent",
|
|
1452
|
+
"--_input-focus-border": "var(--syntra-color-primary-500)",
|
|
1453
|
+
"--_input-invalid-border": "var(--syntra-color-red-500)"
|
|
1454
|
+
},
|
|
1455
|
+
unstyled: {
|
|
1456
|
+
"--_input-bg": "transparent",
|
|
1457
|
+
"--_input-border": "transparent",
|
|
1458
|
+
"--_input-focus-border": "transparent",
|
|
1459
|
+
"--_input-invalid-border": "transparent"
|
|
1460
|
+
}
|
|
1461
|
+
};
|
|
1462
|
+
function tn(t) {
|
|
1463
|
+
return Qt[t];
|
|
1464
|
+
}
|
|
1465
|
+
const nn = k(
|
|
1466
|
+
(t, e) => {
|
|
1467
|
+
const {
|
|
1468
|
+
variant: n = "outline",
|
|
1469
|
+
size: r = "md",
|
|
1470
|
+
invalid: a = !1,
|
|
1471
|
+
leftSection: o,
|
|
1472
|
+
rightSection: i,
|
|
1473
|
+
wrapperClassName: l,
|
|
1474
|
+
wrapperStyle: s,
|
|
1475
|
+
className: d,
|
|
1476
|
+
style: c,
|
|
1477
|
+
disabled: u,
|
|
1478
|
+
...f
|
|
1479
|
+
} = t;
|
|
1480
|
+
W("input", Zt);
|
|
1481
|
+
const y = C(), { styleProps: p, rest: b } = z(f), g = N(p, y), _ = tn(n), $ = Jt(r);
|
|
1482
|
+
return /* @__PURE__ */ L(
|
|
1483
|
+
"div",
|
|
1484
|
+
{
|
|
1485
|
+
className: w("syntra-input-wrapper", l),
|
|
1486
|
+
"data-variant": n,
|
|
1487
|
+
"data-size": r,
|
|
1488
|
+
"data-invalid": a || void 0,
|
|
1489
|
+
"data-disabled": u || void 0,
|
|
1490
|
+
style: {
|
|
1491
|
+
..._,
|
|
1492
|
+
...$,
|
|
1493
|
+
...g,
|
|
1494
|
+
...s
|
|
1495
|
+
},
|
|
1496
|
+
children: [
|
|
1497
|
+
o && /* @__PURE__ */ x("span", { className: "syntra-input-section", "data-position": "left", children: o }),
|
|
1498
|
+
/* @__PURE__ */ x(
|
|
1499
|
+
"input",
|
|
1500
|
+
{
|
|
1501
|
+
...b,
|
|
1502
|
+
ref: e,
|
|
1503
|
+
className: w("syntra-input", d),
|
|
1504
|
+
disabled: u,
|
|
1505
|
+
"aria-invalid": a || void 0,
|
|
1506
|
+
style: c
|
|
1507
|
+
}
|
|
1508
|
+
),
|
|
1509
|
+
i && /* @__PURE__ */ x("span", { className: "syntra-input-section", "data-position": "right", children: i })
|
|
1510
|
+
]
|
|
1511
|
+
}
|
|
1512
|
+
);
|
|
1513
|
+
}
|
|
1514
|
+
);
|
|
1515
|
+
nn.displayName = "Input";
|
|
1516
|
+
export {
|
|
1517
|
+
Pt as Box,
|
|
1518
|
+
Xt as Button,
|
|
1519
|
+
It as Divider,
|
|
1520
|
+
Ot as Flex,
|
|
1521
|
+
Lt as Grid,
|
|
1522
|
+
jt as Heading,
|
|
1523
|
+
nn as Input,
|
|
1524
|
+
J as Spinner,
|
|
1525
|
+
Bt as Stack,
|
|
1526
|
+
an as SyntraProvider,
|
|
1527
|
+
Ht as Text,
|
|
1528
|
+
Dt as VisuallyHidden,
|
|
1529
|
+
w as cn,
|
|
1530
|
+
O as createSyntraTheme,
|
|
1531
|
+
ot as darkColors,
|
|
1532
|
+
U as deepMerge,
|
|
1533
|
+
dt as defaultDarkTheme,
|
|
1534
|
+
lt as defaultLightTheme,
|
|
1535
|
+
z as extractStyleProps,
|
|
1536
|
+
gt as generateColorScale,
|
|
1537
|
+
at as lightColors,
|
|
1538
|
+
N as resolveStyleProps,
|
|
1539
|
+
St as useSyntra,
|
|
1540
|
+
on as useSyntraMode
|
|
1541
|
+
};
|