@szum-tech/design-system 2.0.4 → 2.1.1

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 (108) hide show
  1. package/dist/chunk-463KEXY6.cjs +80 -0
  2. package/dist/chunk-4YZSPNLW.cjs +43 -0
  3. package/dist/chunk-5EN2HNFU.js +50 -0
  4. package/dist/chunk-5ENMEB5L.cjs +341 -0
  5. package/dist/chunk-AO4TMCYJ.js +88 -0
  6. package/dist/chunk-C5YRMEKV.js +319 -0
  7. package/dist/chunk-HFHADY43.js +36 -0
  8. package/dist/chunk-HIWVHD4V.js +57 -0
  9. package/dist/chunk-HXC3EALP.js +40 -0
  10. package/dist/chunk-IFBQNWVG.js +70 -0
  11. package/dist/chunk-J264N6AZ.js +22 -0
  12. package/dist/chunk-J56UDYA3.js +71 -0
  13. package/dist/chunk-KPB3CBHE.cjs +40 -0
  14. package/dist/chunk-LI7IHIOM.cjs +31 -0
  15. package/dist/chunk-LND2W67K.cjs +18 -0
  16. package/dist/chunk-N7DXGCBJ.cjs +31 -0
  17. package/dist/chunk-PB3EGVTV.cjs +116 -0
  18. package/dist/chunk-QRSQCHBO.cjs +60 -0
  19. package/dist/chunk-RF5YR553.cjs +24 -0
  20. package/dist/chunk-TD2KDWNP.js +58 -0
  21. package/dist/chunk-US32J7DK.js +16 -0
  22. package/dist/chunk-UZBZFCWX.js +29 -0
  23. package/dist/chunk-V4POHGAW.cjs +60 -0
  24. package/dist/chunk-VFRIU5CV.cjs +17 -0
  25. package/dist/chunk-VQMM75HD.cjs +67 -0
  26. package/dist/chunk-WTVBTZ3P.js +30 -0
  27. package/dist/chunk-XGA2F5GG.cjs +72 -0
  28. package/dist/chunk-XPM62WMM.js +24 -0
  29. package/dist/chunk-YHU2OW52.js +15 -0
  30. package/dist/chunk-YXTTED5V.cjs +32 -0
  31. package/dist/components/alert-dialog/index.cjs +43 -0
  32. package/dist/components/alert-dialog/index.d.cts +32 -0
  33. package/dist/components/alert-dialog/index.d.ts +32 -0
  34. package/dist/components/alert-dialog/index.js +2 -0
  35. package/dist/components/avatar/index.cjs +19 -0
  36. package/dist/components/avatar/index.d.cts +28 -0
  37. package/dist/components/avatar/index.d.ts +28 -0
  38. package/dist/components/avatar/index.js +2 -0
  39. package/dist/components/button/index.cjs +11 -0
  40. package/dist/components/button/index.d.cts +64 -0
  41. package/dist/components/button/index.d.ts +64 -0
  42. package/dist/components/button/index.js +2 -0
  43. package/dist/components/card/index.cjs +30 -0
  44. package/dist/components/card/index.d.cts +22 -0
  45. package/dist/components/card/index.d.ts +22 -0
  46. package/dist/components/card/index.js +1 -0
  47. package/dist/components/dialog/index.cjs +38 -0
  48. package/dist/components/dialog/index.d.cts +40 -0
  49. package/dist/components/dialog/index.d.ts +40 -0
  50. package/dist/components/dialog/index.js +1 -0
  51. package/dist/components/form/index.cjs +50 -0
  52. package/dist/components/form/index.d.cts +32 -0
  53. package/dist/components/form/index.d.ts +32 -0
  54. package/dist/components/form/index.js +17 -0
  55. package/dist/components/header/index.cjs +10 -0
  56. package/dist/components/header/index.d.cts +9 -0
  57. package/dist/components/header/index.d.ts +9 -0
  58. package/dist/components/header/index.js +1 -0
  59. package/dist/components/helper-text/index.cjs +10 -0
  60. package/dist/components/helper-text/index.d.cts +18 -0
  61. package/dist/components/helper-text/index.d.ts +18 -0
  62. package/dist/components/helper-text/index.js +1 -0
  63. package/dist/components/index.cjs +232 -0
  64. package/dist/components/index.d.cts +22 -0
  65. package/dist/components/index.d.ts +22 -0
  66. package/dist/components/index.js +19 -0
  67. package/dist/components/input/index.cjs +11 -0
  68. package/dist/components/input/index.d.cts +11 -0
  69. package/dist/components/input/index.d.ts +11 -0
  70. package/dist/components/input/index.js +2 -0
  71. package/dist/components/label/index.cjs +10 -0
  72. package/dist/components/label/index.d.cts +8 -0
  73. package/dist/components/label/index.d.ts +8 -0
  74. package/dist/components/label/index.js +1 -0
  75. package/dist/components/select/index.cjs +14 -0
  76. package/dist/components/select/index.d.cts +15 -0
  77. package/dist/components/select/index.d.ts +15 -0
  78. package/dist/components/select/index.js +1 -0
  79. package/dist/components/separator/index.cjs +11 -0
  80. package/dist/components/separator/index.d.cts +8 -0
  81. package/dist/components/separator/index.d.ts +8 -0
  82. package/dist/components/separator/index.js +2 -0
  83. package/dist/components/sheet/index.cjs +38 -0
  84. package/dist/components/sheet/index.d.cts +40 -0
  85. package/dist/components/sheet/index.d.ts +40 -0
  86. package/dist/components/sheet/index.js +1 -0
  87. package/dist/components/textarea/index.cjs +10 -0
  88. package/dist/components/textarea/index.d.cts +9 -0
  89. package/dist/components/textarea/index.d.ts +9 -0
  90. package/dist/components/textarea/index.js +1 -0
  91. package/dist/components/tooltip/index.cjs +14 -0
  92. package/dist/components/tooltip/index.d.cts +20 -0
  93. package/dist/components/tooltip/index.d.ts +20 -0
  94. package/dist/components/tooltip/index.js +1 -0
  95. package/dist/{icons.cjs → icons/index.cjs} +1 -1
  96. package/dist/{icons.js → icons/index.js} +1 -1
  97. package/dist/{utils.cjs → utils/index.cjs} +1 -1
  98. package/dist/utils/index.js +1 -0
  99. package/package.json +61 -50
  100. package/dist/index.cjs +0 -908
  101. package/dist/index.d.cts +0 -285
  102. package/dist/index.d.ts +0 -285
  103. package/dist/index.js +0 -832
  104. package/dist/utils.js +0 -1
  105. /package/dist/{icons.d.cts → icons/index.d.cts} +0 -0
  106. /package/dist/{icons.d.ts → icons/index.d.ts} +0 -0
  107. /package/dist/{utils.d.cts → utils/index.d.cts} +0 -0
  108. /package/dist/{utils.d.ts → utils/index.d.ts} +0 -0
package/dist/index.js DELETED
@@ -1,832 +0,0 @@
1
- import { cn } from './chunk-ZD2QRAOX.js';
2
- export { cn } from './chunk-ZD2QRAOX.js';
3
- import { LoadingIcon } from './chunk-INJBKPIE.js';
4
- import { Dialog as Dialog$1, AlertDialog as AlertDialog$1, Label as Label$1, Avatar as Avatar$1, Tooltip as Tooltip$1, Select as Select$1, Separator as Separator$1 } from 'radix-ui';
5
- import { cva } from 'class-variance-authority';
6
- import { jsx, jsxs } from 'react/jsx-runtime';
7
- import * as React from 'react';
8
- import { Slot } from '@radix-ui/react-slot';
9
- import { CaretSortIcon, CheckIcon, Cross1Icon } from '@radix-ui/react-icons';
10
- import { twMerge } from 'tailwind-merge';
11
- import { useFormContext, FormProvider, Controller } from 'react-hook-form';
12
-
13
- var avatarCva = cva("relative flex shrink-0 overflow-hidden rounded text-gray-100", {
14
- variants: {
15
- size: {
16
- sm: "size-6 text-xs",
17
- md: "size-10 text-lg",
18
- lg: "size-14 text-2xl"
19
- }
20
- },
21
- defaultVariants: {
22
- size: "md"
23
- }
24
- });
25
- function Avatar({ className, size, ref, ...props }) {
26
- const avatarStyles = avatarCva({ size });
27
- return /* @__PURE__ */ jsx(Avatar$1.Root, { ref, className: cn(avatarStyles, className), ...props });
28
- }
29
- function AvatarImage({ className, ref, ...props }) {
30
- return /* @__PURE__ */ jsx(Avatar$1.Image, { ref, className: cn("aspect-square h-full w-full", className), ...props });
31
- }
32
- function AvatarFallback({ className, ref, ...props }) {
33
- return /* @__PURE__ */ jsx(
34
- Avatar$1.Fallback,
35
- {
36
- ref,
37
- className: cn("bg-gray-350 flex h-full w-full items-center justify-center", className),
38
- ...props
39
- }
40
- );
41
- }
42
- var buttonCva = cva(
43
- [
44
- "inline-flex cursor-pointer items-center justify-center align-middle no-underline transition-colors duration-300 ease-in-out",
45
- "select-none appearance-none rounded-sm border font-sans font-medium tracking-[.02857em]",
46
- "aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-50"
47
- ],
48
- {
49
- variants: {
50
- fullWidth: {
51
- true: "w-full"
52
- },
53
- color: {
54
- neutral: "",
55
- primary: "",
56
- success: "",
57
- warning: "",
58
- error: ""
59
- },
60
- size: {
61
- sm: "px-2.5 py-1 text-[.8125rem] leading-4",
62
- md: "px-4 py-1.5 text-[0.875rem] leading-5",
63
- lg: "px-5 py-2 text-[.9375rem] leading-6"
64
- },
65
- variant: {
66
- text: "border-transparent bg-transparent",
67
- outlined: "bg-transparent",
68
- contained: ""
69
- }
70
- },
71
- compoundVariants: [
72
- // ---------- TEXT ---------- //
73
- {
74
- variant: "text",
75
- color: "neutral",
76
- class: [
77
- "text-gray-100",
78
- "hover:border-gray-350 hover:bg-gray-350 hover:text-gray-100",
79
- "active:border-gray-400 active:bg-gray-400"
80
- ]
81
- },
82
- {
83
- variant: "text",
84
- color: "primary",
85
- class: [
86
- "text-primary-500",
87
- "hover:border-primary-500 hover:bg-primary-500 hover:text-white",
88
- "active:border-primary-600 active:bg-primary-600 active:text-white"
89
- ]
90
- },
91
- {
92
- variant: "text",
93
- color: "success",
94
- class: [
95
- "text-success-500",
96
- "hover:border-success-500 hover:bg-success-500 hover:text-white",
97
- "active:border-success-600 active:bg-success-600 active:text-white"
98
- ]
99
- },
100
- {
101
- variant: "text",
102
- color: "warning",
103
- class: [
104
- "text-warning-500",
105
- "hover:border-warning-500 hover:bg-warning-500 hover:text-white",
106
- "active:border-warning-600 active:bg-warning-600 active:text-white"
107
- ]
108
- },
109
- {
110
- variant: "text",
111
- color: "error",
112
- class: [
113
- "text-error-500",
114
- "hover:border-error-500 hover:bg-error-500 hover:text-white",
115
- "active:border-error-600 active:bg-error-600 active:text-white"
116
- ]
117
- },
118
- // ---------- OUTLINED ---------- //
119
- {
120
- variant: "outlined",
121
- color: "neutral",
122
- class: ["border-gray-350 text-gray-100", "hover:bg-gray-350", "active:bg-gray-400"]
123
- },
124
- {
125
- variant: "outlined",
126
- color: "primary",
127
- class: [
128
- "text-primary-500 border-primary-500",
129
- "hover:bg-primary-500 hover:text-white",
130
- "active:bg-primary-600 active:text-white"
131
- ]
132
- },
133
- {
134
- variant: "outlined",
135
- color: "success",
136
- class: [
137
- "text-success-500 border-success-500",
138
- "hover:bg-success-500 hover:text-white",
139
- "active:bg-success-600 active:text-white"
140
- ]
141
- },
142
- {
143
- variant: "outlined",
144
- color: "warning",
145
- class: [
146
- "text-warning-500 border-warning-500",
147
- "hover:bg-warning-500 hover:text-white",
148
- "active:bg-warning-600 active:text-white"
149
- ]
150
- },
151
- {
152
- variant: "outlined",
153
- color: "error",
154
- class: [
155
- "text-error-500 border-error-500",
156
- "hover:bg-error-500 hover:text-white",
157
- "active:bg-error-600 active:text-white"
158
- ]
159
- },
160
- // ---------- OUTLINED ---------- //
161
- {
162
- variant: "contained",
163
- color: "neutral",
164
- class: [
165
- "border-gray-350 bg-gray-350 text-gray-100",
166
- "hover:border-gray-300 hover:bg-gray-300",
167
- "active:border-gray-400 active:bg-gray-400"
168
- ]
169
- },
170
- {
171
- variant: "contained",
172
- color: "primary",
173
- class: [
174
- "border-primary-500 bg-primary-500 text-white",
175
- "hover:border-primary-400 hover:bg-primary-400",
176
- "active:border-primary-600 active:bg-primary-600"
177
- ]
178
- },
179
- {
180
- variant: "contained",
181
- color: "success",
182
- class: [
183
- "border-success-500 bg-success-500 text-white",
184
- "hover:border-success-400 hover:bg-success-400",
185
- "active:border-success-600 active:bg-success-600"
186
- ]
187
- },
188
- {
189
- variant: "contained",
190
- color: "warning",
191
- class: [
192
- "border-warning-500 bg-warning-500 text-white",
193
- "hover:border-warning-400 hover:bg-warning-400",
194
- "active:border-warning-600 active:bg-warning-600"
195
- ]
196
- },
197
- {
198
- variant: "contained",
199
- color: "error",
200
- class: [
201
- "border-error-500 bg-error-500 text-white",
202
- "hover:border-error-400 hover:bg-error-400",
203
- "active:border-error-600 active:bg-error-600"
204
- ]
205
- }
206
- ],
207
- defaultVariants: {
208
- fullWidth: false,
209
- color: "primary",
210
- size: "md",
211
- variant: "text"
212
- }
213
- }
214
- );
215
- var iconContainerCva = cva("", {
216
- variants: {
217
- site: {
218
- left: "",
219
- right: ""
220
- },
221
- size: {
222
- sm: "",
223
- md: "",
224
- lg: ""
225
- }
226
- },
227
- compoundVariants: [
228
- // ---------- LEFT ---------- //
229
- {
230
- site: "left",
231
- size: "sm",
232
- class: "-ml-0.5 mr-1.5"
233
- },
234
- {
235
- site: "left",
236
- size: "md",
237
- class: "-ml-1 mr-2"
238
- },
239
- {
240
- site: "left",
241
- size: "lg",
242
- class: "-ml-1.5 mr-2.5"
243
- },
244
- // ---------- RIGHT ---------- //
245
- {
246
- site: "right",
247
- size: "sm",
248
- class: "-mr-0.5 ml-1.5"
249
- },
250
- {
251
- site: "right",
252
- size: "md",
253
- class: "-mr-1 ml-2"
254
- },
255
- {
256
- site: "right",
257
- size: "lg",
258
- class: "-mr-1.5 ml-2.5"
259
- }
260
- ],
261
- defaultVariants: {
262
- site: "left",
263
- size: "md"
264
- }
265
- });
266
- var iconCva = cva("", {
267
- variants: {
268
- loading: {
269
- true: "animate-spin motion-reduce:hidden"
270
- },
271
- size: {
272
- sm: "h-4.5 w-4.5",
273
- md: "size-5",
274
- lg: "h-5.5 w-5.5"
275
- }
276
- },
277
- defaultVariants: {
278
- loading: false,
279
- size: "md"
280
- }
281
- });
282
- function Button({
283
- asChild = false,
284
- variant = "text",
285
- color = "primary",
286
- disabled = false,
287
- fullWidth = false,
288
- loadingPosition = "start",
289
- ref,
290
- ...props
291
- }) {
292
- const {
293
- children,
294
- type = "button",
295
- loading = false,
296
- size = "md",
297
- endIcon,
298
- startIcon,
299
- ...rest
300
- } = { ...props, loadingPosition };
301
- const Comp = asChild ? Slot : "button";
302
- const buttonStyles = buttonCva({ fullWidth, size, variant, color });
303
- const isDisabled = disabled || loading;
304
- return /* @__PURE__ */ jsx(
305
- Comp,
306
- {
307
- ...asChild ? props : rest,
308
- "aria-disabled": isDisabled || void 0,
309
- className: buttonStyles,
310
- "data-state": loading ? "loading" : void 0,
311
- disabled: isDisabled,
312
- ref,
313
- role: Comp !== "button" ? "button" : void 0,
314
- tabIndex: isDisabled ? -1 : 0,
315
- type: Comp === "button" ? type : void 0,
316
- children: asChild ? /* @__PURE__ */ jsx(ButtonContent, { children }) : /* @__PURE__ */ jsx(ButtonContent, { ...props })
317
- }
318
- );
319
- }
320
- function ButtonContent({
321
- children,
322
- loading = false,
323
- size = "md",
324
- loadingPosition = "start",
325
- startIcon,
326
- endIcon,
327
- ...props
328
- }) {
329
- const isStartLoading = loading && loadingPosition === "start";
330
- const StartIcon = isStartLoading ? /* @__PURE__ */ jsx(LoadingIcon, { "aria-label": "Loading" }) : startIcon || null;
331
- const startIconStyles = iconCva({ size, loading: isStartLoading });
332
- const startIconContainerStyles = iconContainerCva({ size, site: "left" });
333
- const isEndLoading = loading && loadingPosition === "end";
334
- const EndIcon = isEndLoading ? /* @__PURE__ */ jsx(LoadingIcon, { "aria-label": "Loading" }) : endIcon || null;
335
- const endIconStyles = iconCva({ size, loading: isEndLoading });
336
- const endIconContainerStyles = iconContainerCva({ size, site: "right" });
337
- const LeadingIcon = StartIcon ? /* @__PURE__ */ jsx("span", { className: startIconContainerStyles, role: isStartLoading ? "progressbar" : void 0, children: React.cloneElement(StartIcon, { className: startIconStyles }) }) : null;
338
- const TrailingIcon = EndIcon ? /* @__PURE__ */ jsx("span", { className: endIconContainerStyles, role: isEndLoading ? "progressbar" : void 0, children: React.cloneElement(EndIcon, { className: endIconStyles }) }) : null;
339
- return React.isValidElement(children) ? React.cloneElement(
340
- children,
341
- props,
342
- /* @__PURE__ */ jsxs(React.Fragment, { children: [
343
- LeadingIcon,
344
- React.isValidElement(children) ? children.props?.children : null,
345
- TrailingIcon
346
- ] })
347
- ) : /* @__PURE__ */ jsxs(React.Fragment, { children: [
348
- LeadingIcon,
349
- children,
350
- TrailingIcon
351
- ] });
352
- }
353
- var inputCva = cva(
354
- [
355
- "bg-app-foreground font-poppins h-10 w-full appearance-none border py-2 outline-0 transition-colors duration-300 ease-in-out",
356
- "placeholder:select-none placeholder:text-gray-200",
357
- "invalid:border-error-500 focus:border-primary-400 active:border-primary-400",
358
- "disabled:border-gray-400 disabled:text-gray-200 disabled:placeholder:text-gray-300"
359
- ],
360
- {
361
- variants: {
362
- invalid: {
363
- true: ["text-error-500 border-error-500 hover:border-error-400 focus:text-gray-100"],
364
- false: ["border-gray-350 hover:border-primary-500 text-gray-100"]
365
- },
366
- withStartIcon: {
367
- true: "pl-11",
368
- false: "pl-3"
369
- },
370
- withEndIcon: {
371
- true: "pr-11",
372
- false: "pr-3"
373
- }
374
- },
375
- defaultVariants: {
376
- invalid: false,
377
- withStartIcon: false,
378
- withEndIcon: false
379
- }
380
- }
381
- );
382
- var inputIconContainerCva = cva(
383
- ["pointer-events-none absolute inset-y-2 inline-flex w-10 place-content-center items-center text-center"],
384
- {
385
- variants: {
386
- disabled: {
387
- true: "text-gray-200"
388
- },
389
- site: {
390
- right: "right-0 border-l border-l-gray-400 pr-1",
391
- left: "left-0 border-r border-r-gray-400 pl-1"
392
- }
393
- },
394
- defaultVariants: {
395
- disabled: false
396
- }
397
- }
398
- );
399
- function Input({ invalid = false, startIcon, endIcon, disabled = false, className, ...props }) {
400
- const inputStyles = inputCva({ withEndIcon: !!endIcon, withStartIcon: !!startIcon, invalid });
401
- const inputIconStartContainer = inputIconContainerCva({ site: "left", disabled });
402
- const inputIconEndContainer = inputIconContainerCva({ site: "right", disabled });
403
- return /* @__PURE__ */ jsxs("div", { className: "text-body-2 relative text-gray-100", children: [
404
- startIcon ? /* @__PURE__ */ jsx("span", { className: inputIconStartContainer, children: startIcon }) : null,
405
- /* @__PURE__ */ jsx(
406
- "input",
407
- {
408
- "aria-invalid": invalid || void 0,
409
- disabled,
410
- className: cn(inputStyles, className),
411
- ...props
412
- }
413
- ),
414
- endIcon ? /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: inputIconEndContainer, children: endIcon }) : null
415
- ] });
416
- }
417
- function Tooltip({
418
- defaultOpen,
419
- content,
420
- open,
421
- onOpenChange,
422
- children,
423
- side,
424
- align,
425
- collisionPadding = 8,
426
- sideOffset = 8,
427
- ...props
428
- }) {
429
- return /* @__PURE__ */ jsxs(Tooltip$1.Root, { delayDuration: 0, open, defaultOpen, onOpenChange, children: [
430
- /* @__PURE__ */ jsx(Tooltip$1.Trigger, { asChild: true, children }),
431
- content ? /* @__PURE__ */ jsx(Tooltip$1.Portal, { children: /* @__PURE__ */ jsxs(
432
- Tooltip$1.Content,
433
- {
434
- className: "text-body-1 data-[state=delayed-open]:data-[side=bottom]:animate-slideUpAndFade data-[state=delayed-open]:data-[side=left]:animate-slideRightAndFade data-[state=delayed-open]:data-[side=right]:animate-slideLeftAndFade data-[state=delayed-open]:data-[side=top]:animate-slideDownAndFade rounded bg-white p-2 text-gray-100 will-change-[transform,opacity] select-none",
435
- sideOffset,
436
- side,
437
- align,
438
- collisionPadding,
439
- ...props,
440
- children: [
441
- content,
442
- /* @__PURE__ */ jsx(Tooltip$1.Arrow, { width: 8, height: 4, className: "fill-white" })
443
- ]
444
- }
445
- ) }) : null
446
- ] });
447
- }
448
- function TooltipProvider({ children }) {
449
- return /* @__PURE__ */ jsx(Tooltip$1.Provider, { skipDelayDuration: 500, children });
450
- }
451
- var textareaCva = cva(
452
- [
453
- "bg-app-primary font-poppins text-body-2 h-28 min-h-10 w-full appearance-none border px-3 py-2 outline-0 transition-colors duration-300 ease-in-out placeholder:select-none placeholder:text-gray-200",
454
- "focus:border-primary-400",
455
- "active:border-primary-400",
456
- "disabled:border-gray-400 disabled:text-gray-200 disabled:placeholder:text-gray-300"
457
- ],
458
- {
459
- variants: {
460
- invalid: {
461
- true: ["text-error-500 border-error-500", "hover:border-error-400", "focus:text-gray-100"],
462
- false: ["border-gray-350 text-gray-100", "hover:border-primary-500"]
463
- }
464
- },
465
- defaultVariants: {
466
- invalid: false
467
- }
468
- }
469
- );
470
- function Textarea({ invalid = false, ...props }) {
471
- const textareaStyles = textareaCva({ invalid });
472
- return /* @__PURE__ */ jsx("textarea", { "aria-invalid": invalid || void 0, className: textareaStyles, ...props });
473
- }
474
- var selectCva = cva(
475
- [
476
- "bg-app-foreground text-body-2 inline-flex h-10 w-full appearance-none items-center justify-between gap-2 border px-3 py-2 text-gray-100 outline-0 transition-colors duration-300 ease-in-out",
477
- "placeholder:select-none placeholder:text-gray-200",
478
- "invalid:border-error-500 focus:border-primary-400 active:border-primary-400",
479
- "disabled:border-gray-400 disabled:text-gray-200 disabled:placeholder:text-gray-300"
480
- ],
481
- {
482
- variants: {
483
- invalid: {
484
- true: ["text-error-500 border-error-500 hover:border-error-400 focus:text-gray-100"],
485
- false: ["border-gray-350 hover:border-primary-500 text-gray-100"]
486
- }
487
- },
488
- defaultVariants: {
489
- invalid: false
490
- }
491
- }
492
- );
493
- function Select({ children, placeholder, invalid = false, ref, ...props }) {
494
- const selectStyles = selectCva({ invalid });
495
- return /* @__PURE__ */ jsxs(Select$1.Root, { ...props, children: [
496
- /* @__PURE__ */ jsxs(Select$1.Trigger, { className: selectStyles, ref, children: [
497
- /* @__PURE__ */ jsx(Select$1.Value, { placeholder }),
498
- /* @__PURE__ */ jsx(Select$1.Icon, { className: "-mr-1.5", children: /* @__PURE__ */ jsx(CaretSortIcon, { className: "size-5 text-gray-200" }) })
499
- ] }),
500
- /* @__PURE__ */ jsx(Select$1.Portal, { children: /* @__PURE__ */ jsx(
501
- Select$1.Content,
502
- {
503
- sideOffset: 4,
504
- className: "bg-app-foreground z-50 w-full overflow-hidden border border-gray-400 py-1",
505
- children: /* @__PURE__ */ jsx(Select$1.Viewport, { children })
506
- }
507
- ) })
508
- ] });
509
- }
510
- function SelectItem({ children, ...props }) {
511
- return /* @__PURE__ */ jsxs(
512
- Select$1.Item,
513
- {
514
- className: "text-body-2 data-[state=checked]:bg-primary-300 flex w-full flex-row items-center justify-between px-3 py-2 text-gray-100 select-none data-[disabled]:pointer-events-none data-[highlighted]:bg-gray-400 data-[highlighted]:outline-none",
515
- ...props,
516
- children: [
517
- /* @__PURE__ */ jsx(Select$1.ItemText, { className: "flex-1", children }),
518
- /* @__PURE__ */ jsx(Select$1.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) })
519
- ]
520
- }
521
- );
522
- }
523
- function Card({ className, ...props }) {
524
- return /* @__PURE__ */ jsx("div", { className: twMerge("bg-app-foreground h-full rounded border border-gray-400", className), ...props });
525
- }
526
- function CardHeader({ className, ...props }) {
527
- return /* @__PURE__ */ jsx("div", { className: twMerge("flex flex-col p-6", className), ...props });
528
- }
529
- function CardTitle({ className, ...props }) {
530
- return /* @__PURE__ */ jsx("h3", { className: twMerge("text-heading-5", className), ...props });
531
- }
532
- function CardDescription({ className, ...props }) {
533
- return /* @__PURE__ */ jsx("p", { className: twMerge("text-body-2 text-gray-200", className), ...props });
534
- }
535
- function CardContent({ className, ...props }) {
536
- return /* @__PURE__ */ jsx("div", { className: twMerge("p-6 pt-0", className), ...props });
537
- }
538
- function CardFooter({ className, ...props }) {
539
- return /* @__PURE__ */ jsx("div", { className: twMerge("flex items-center p-6 pt-0", className), ...props });
540
- }
541
- var Sheet = Dialog$1.Root;
542
- var SheetTrigger = Dialog$1.Trigger;
543
- var SheetClose = Dialog$1.Close;
544
- var sheetContentStyles = cva(
545
- "bg-foreground data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col border-gray-400 p-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
546
- {
547
- variants: {
548
- side: {
549
- top: "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 border-b",
550
- bottom: "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 border-t",
551
- left: "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
552
- right: "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm"
553
- }
554
- },
555
- defaultVariants: {
556
- side: "right"
557
- }
558
- }
559
- );
560
- function SheetContent({ side = "right", className, children, ...props }) {
561
- return /* @__PURE__ */ jsxs(Dialog$1.Portal, { children: [
562
- /* @__PURE__ */ jsx(
563
- Dialog$1.Overlay,
564
- {
565
- className: "bg-background/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 backdrop-blur-sm",
566
- ...props
567
- }
568
- ),
569
- /* @__PURE__ */ jsxs(Dialog$1.Content, { className: twMerge(sheetContentStyles({ side }), className), ...props, children: [
570
- children,
571
- /* @__PURE__ */ jsxs(Dialog$1.Close, { className: "focus:ring-ring ring-primary-500 ring-offset-foreground data-[state=open]:bg-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none", children: [
572
- /* @__PURE__ */ jsx(Cross1Icon, { className: "size-4" }),
573
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
574
- ] })
575
- ] })
576
- ] });
577
- }
578
- function SheetHeader({ className, ...props }) {
579
- return /* @__PURE__ */ jsx("div", { className: twMerge("flex flex-col space-y-2 text-center sm:text-left", className), ...props });
580
- }
581
- function SheetFooter({ className, ...props }) {
582
- return /* @__PURE__ */ jsx("div", { className: twMerge("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props });
583
- }
584
- function SheetTitle({ className, ...props }) {
585
- return /* @__PURE__ */ jsx(Dialog$1.Title, { className: twMerge("typography-heading-6", className), ...props });
586
- }
587
- function SheetDescription({ className, ...props }) {
588
- return /* @__PURE__ */ jsx(Dialog$1.Description, { className: twMerge("typography-body-2 text-gray-200", className), ...props });
589
- }
590
- function Separator({ className, orientation = "horizontal", decorative = false, ...props }) {
591
- return /* @__PURE__ */ jsx(
592
- Separator$1.Root,
593
- {
594
- decorative,
595
- orientation,
596
- "aria-orientation": orientation,
597
- className: cn(
598
- "shrink-0 bg-gray-400",
599
- orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
600
- className
601
- ),
602
- ...props
603
- }
604
- );
605
- }
606
- function Header({ children, ...props }) {
607
- return /* @__PURE__ */ jsx(
608
- "header",
609
- {
610
- className: "bg-foreground/95 supports-[backdrop-filter]:bg-foreground/60 sticky top-0 z-50 w-full border-b border-gray-400 backdrop-blur",
611
- ...props,
612
- children: /* @__PURE__ */ jsx("div", { className: "container flex h-16 items-center", children })
613
- }
614
- );
615
- }
616
- var Dialog = Dialog$1.Root;
617
- var DialogClose = Dialog$1.Close;
618
- var dialogContentStyles = cva(
619
- [
620
- "bg-foreground fixed left-1/2 top-1/2 z-50 flex w-full -translate-x-1/2 -translate-y-1/2 flex-col rounded border border-gray-400 p-4 shadow-lg",
621
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] duration-200"
622
- ],
623
- {
624
- variants: {
625
- width: {
626
- xs: "max-w-xs",
627
- sm: "max-w-sm",
628
- md: "max-w-md",
629
- lg: "max-w-lg",
630
- xl: "max-w-xl",
631
- "2xl": "max-w-2xl",
632
- "3xl": "max-w-3xl",
633
- "4xl": "max-w-4xl",
634
- "5xl": "max-w-5xl",
635
- "6xl": "max-w-6xl",
636
- full: "max-w-full"
637
- }
638
- },
639
- defaultVariants: {
640
- width: "md"
641
- }
642
- }
643
- );
644
- function DialogOverlay(props) {
645
- return /* @__PURE__ */ jsx(
646
- Dialog$1.Overlay,
647
- {
648
- className: "bg-background/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 backdrop-blur-xs",
649
- ...props
650
- }
651
- );
652
- }
653
- function DialogContent({ className, children, width = "md", ...props }) {
654
- return /* @__PURE__ */ jsxs(Dialog$1.Portal, { children: [
655
- /* @__PURE__ */ jsx(DialogOverlay, {}),
656
- /* @__PURE__ */ jsxs(Dialog$1.Content, { className: twMerge(dialogContentStyles({ width }), className), ...props, children: [
657
- children,
658
- /* @__PURE__ */ jsxs(Dialog$1.Close, { className: "focus:ring-ring ring-primary-500 ring-offset-foreground data-[state=open]:bg-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none", children: [
659
- /* @__PURE__ */ jsx(Cross1Icon, { className: "size-4" }),
660
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
661
- ] })
662
- ] })
663
- ] });
664
- }
665
- var DialogTrigger = Dialog$1.Trigger;
666
- function DialogHeader({ className, ...props }) {
667
- return /* @__PURE__ */ jsx("div", { className: twMerge("mb-4 flex flex-col space-y-1.5 text-center sm:text-left", className), ...props });
668
- }
669
- function DialogFooter({ className, ...props }) {
670
- return /* @__PURE__ */ jsx("div", { className: twMerge("mt-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className), ...props });
671
- }
672
- function DialogTitle({ className, ...props }) {
673
- return /* @__PURE__ */ jsx(Dialog$1.Title, { className: twMerge("text-heading-6", className), ...props });
674
- }
675
- function DialogDescription({ className, ...props }) {
676
- return /* @__PURE__ */ jsx(Dialog$1.Description, { className: twMerge("text-body-2 text-gray-200", className), ...props });
677
- }
678
- var Form = FormProvider;
679
- var FormItemContext = React.createContext({});
680
- var FormItem = React.forwardRef(function({ className, ...props }, ref) {
681
- const id = React.useId();
682
- return /* @__PURE__ */ jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx("div", { ref, className: twMerge("space-y-2", className), ...props }) });
683
- });
684
- FormItem.displayName = "FormItem";
685
- var FormFieldContext = React.createContext({});
686
- var FormField = ({
687
- ...props
688
- }) => {
689
- return /* @__PURE__ */ jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx(Controller, { ...props }) });
690
- };
691
- function Label({ className, ...props }) {
692
- return /* @__PURE__ */ jsx(
693
- Label$1.Root,
694
- {
695
- className: twMerge("text-subtitle-1 peer-disabled:cursor-not-allowed peer-disabled:opacity-70", className),
696
- ...props
697
- }
698
- );
699
- }
700
- var useFormField = () => {
701
- const fieldContext = React.useContext(FormFieldContext);
702
- const itemContext = React.useContext(FormItemContext);
703
- const { getFieldState, formState } = useFormContext();
704
- const fieldState = getFieldState(fieldContext.name, formState);
705
- if (!fieldContext) {
706
- throw new Error("useFormField should be used within <FormField>");
707
- }
708
- const { id } = itemContext;
709
- return {
710
- id,
711
- name: fieldContext.name,
712
- formItemId: `${id}-form-item`,
713
- formDescriptionId: `${id}-form-item-description`,
714
- formMessageId: `${id}-form-item-message`,
715
- ...fieldState
716
- };
717
- };
718
- var FormLabel = React.forwardRef(
719
- ({ className, caption, ...props }, ref) => {
720
- const { error, formItemId } = useFormField();
721
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-end justify-between", children: [
722
- /* @__PURE__ */ jsx(
723
- Label,
724
- {
725
- ref,
726
- className: twMerge(error ? "text-error-500" : null, className),
727
- htmlFor: formItemId,
728
- ...props
729
- }
730
- ),
731
- caption ? /* @__PURE__ */ jsx("div", { className: "typography-caption text-gray-200", children: caption }) : null
732
- ] });
733
- }
734
- );
735
- FormLabel.displayName = "FormLabel";
736
- var FormControl = React.forwardRef(function(props, ref) {
737
- const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
738
- const newProps = { ...props, invalid: !!error };
739
- return /* @__PURE__ */ jsx(
740
- Slot,
741
- {
742
- ref,
743
- id: formItemId,
744
- "aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
745
- "aria-invalid": !!error,
746
- ...newProps
747
- }
748
- );
749
- });
750
- FormControl.displayName = "FormControl";
751
- var FormMessage = React.forwardRef(function({ children, ...props }, ref) {
752
- const { error, formMessageId } = useFormField();
753
- const body = error ? String(error?.message) : children;
754
- if (!body) {
755
- return null;
756
- }
757
- return /* @__PURE__ */ jsx(HelperText, { ref, type: "error", id: formMessageId, ...props, children: body });
758
- });
759
- FormMessage.displayName = "FormMessage";
760
- var FormDescription = React.forwardRef(function(props, ref) {
761
- const { formDescriptionId } = useFormField();
762
- return /* @__PURE__ */ jsx(HelperText, { ref, id: formDescriptionId, ...props });
763
- });
764
- FormDescription.displayName = "FormDescription";
765
- var helperTextCva = cva("", {
766
- variants: {
767
- type: {
768
- description: "text-body-2 text-gray-200",
769
- error: "text-caption text-error-500"
770
- }
771
- },
772
- defaultVariants: {
773
- type: "description"
774
- }
775
- });
776
- function HelperText({ className, children, type = "description", role, ref, ...props }) {
777
- return /* @__PURE__ */ jsx(
778
- "p",
779
- {
780
- ref,
781
- className: twMerge(helperTextCva({ type }), className),
782
- role: type === "error" ? "alert" : role,
783
- ...props,
784
- children
785
- }
786
- );
787
- }
788
- var AlertDialog = AlertDialog$1.Root;
789
- var AlertDialogTrigger = AlertDialog$1.Trigger;
790
- function AlertDialogOverlay({ className, ...props }) {
791
- return /* @__PURE__ */ jsx(
792
- AlertDialog$1.Overlay,
793
- {
794
- className: cn(
795
- "bg-background/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 backdrop-blur-xs",
796
- className
797
- ),
798
- ...props
799
- }
800
- );
801
- }
802
- function AlertDialogContent({ className, ...props }) {
803
- return /* @__PURE__ */ jsxs(AlertDialog$1.Portal, { children: [
804
- /* @__PURE__ */ jsx(AlertDialogOverlay, {}),
805
- /* @__PURE__ */ jsx(
806
- AlertDialog$1.Content,
807
- {
808
- className: cn(
809
- "bg-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed top-1/2 left-1/2 z-50 flex w-full max-w-lg -translate-x-1/2 -translate-y-1/2 flex-col rounded border border-gray-400 p-4 shadow-lg duration-200",
810
- className
811
- ),
812
- ...props
813
- }
814
- )
815
- ] });
816
- }
817
- function AlertDialogHeader({ className, ...props }) {
818
- return /* @__PURE__ */ jsx("div", { className: twMerge("mb-4 flex flex-col space-y-2 text-center sm:text-left", className), ...props });
819
- }
820
- function AlertDialogFooter({ className, ...props }) {
821
- return /* @__PURE__ */ jsx("div", { className: twMerge("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className), ...props });
822
- }
823
- function AlertDialogTitle({ className, ref, ...props }) {
824
- return /* @__PURE__ */ jsx(AlertDialog$1.Title, { ref, className: cn("text-heading-6", className), ...props });
825
- }
826
- function AlertDialogDescription({ className, ...props }) {
827
- return /* @__PURE__ */ jsx(AlertDialog$1.Description, { className: cn("text-body-2 text-gray-200", className), ...props });
828
- }
829
- var AlertDialogAction = AlertDialog$1.Action;
830
- var AlertDialogCancel = AlertDialog$1.Cancel;
831
-
832
- export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Header, HelperText, Input, Label, Select, SelectItem, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Textarea, Tooltip, TooltipProvider };