@spark-ui/components 10.22.1 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/package.json +5 -5
  2. package/dist/DialogTrigger-woU7vsJi.d.ts +0 -142
  3. package/dist/Input-N8AWWSmt.d.ts +0 -41
  4. package/dist/InputTrailingIcon-ZZx8PoJy.d.ts +0 -20
  5. package/dist/LabelRequiredIndicator-DRnCzHMU.d.ts +0 -19
  6. package/dist/accordion/index.d.ts +0 -73
  7. package/dist/accordion/index.js +0 -325
  8. package/dist/accordion/index.js.map +0 -1
  9. package/dist/alert-dialog/index.d.ts +0 -119
  10. package/dist/alert-dialog/index.js +0 -1554
  11. package/dist/alert-dialog/index.js.map +0 -1
  12. package/dist/avatar/index.d.ts +0 -66
  13. package/dist/avatar/index.js +0 -1303
  14. package/dist/avatar/index.js.map +0 -1
  15. package/dist/badge/index.d.ts +0 -47
  16. package/dist/badge/index.js +0 -122
  17. package/dist/badge/index.js.map +0 -1
  18. package/dist/breadcrumb/index.d.ts +0 -64
  19. package/dist/breadcrumb/index.js +0 -327
  20. package/dist/breadcrumb/index.js.map +0 -1
  21. package/dist/button/index.d.ts +0 -41
  22. package/dist/button/index.js +0 -935
  23. package/dist/button/index.js.map +0 -1
  24. package/dist/card/index.d.ts +0 -61
  25. package/dist/card/index.js +0 -502
  26. package/dist/card/index.js.map +0 -1
  27. package/dist/carousel/index.d.ts +0 -261
  28. package/dist/carousel/index.js +0 -1801
  29. package/dist/carousel/index.js.map +0 -1
  30. package/dist/checkbox/index.d.ts +0 -120
  31. package/dist/checkbox/index.js +0 -511
  32. package/dist/checkbox/index.js.map +0 -1
  33. package/dist/chip/index.d.ts +0 -97
  34. package/dist/chip/index.js +0 -908
  35. package/dist/chip/index.js.map +0 -1
  36. package/dist/collapsible/index.d.ts +0 -43
  37. package/dist/collapsible/index.js +0 -109
  38. package/dist/collapsible/index.js.map +0 -1
  39. package/dist/combobox/index.d.ts +0 -287
  40. package/dist/combobox/index.js +0 -2588
  41. package/dist/combobox/index.js.map +0 -1
  42. package/dist/dialog/index.d.ts +0 -33
  43. package/dist/dialog/index.js +0 -1389
  44. package/dist/dialog/index.js.map +0 -1
  45. package/dist/divider/index.d.ts +0 -61
  46. package/dist/divider/index.js +0 -224
  47. package/dist/divider/index.js.map +0 -1
  48. package/dist/drawer/index.d.ts +0 -152
  49. package/dist/drawer/index.js +0 -1400
  50. package/dist/drawer/index.js.map +0 -1
  51. package/dist/dropdown/index.d.ts +0 -233
  52. package/dist/dropdown/index.js +0 -2051
  53. package/dist/dropdown/index.js.map +0 -1
  54. package/dist/form-field/index.d.ts +0 -186
  55. package/dist/form-field/index.js +0 -553
  56. package/dist/form-field/index.js.map +0 -1
  57. package/dist/icon/index.d.ts +0 -28
  58. package/dist/icon/index.js +0 -127
  59. package/dist/icon/index.js.map +0 -1
  60. package/dist/icon-button/index.d.ts +0 -16
  61. package/dist/icon-button/index.js +0 -980
  62. package/dist/icon-button/index.js.map +0 -1
  63. package/dist/input/index.d.ts +0 -78
  64. package/dist/input/index.js +0 -724
  65. package/dist/input/index.js.map +0 -1
  66. package/dist/kbd/index.d.ts +0 -9
  67. package/dist/kbd/index.js +0 -47
  68. package/dist/kbd/index.js.map +0 -1
  69. package/dist/label/index.d.ts +0 -11
  70. package/dist/label/index.js +0 -78
  71. package/dist/label/index.js.map +0 -1
  72. package/dist/link-box/index.d.ts +0 -34
  73. package/dist/link-box/index.js +0 -92
  74. package/dist/link-box/index.js.map +0 -1
  75. package/dist/pagination/index.d.ts +0 -143
  76. package/dist/pagination/index.js +0 -1353
  77. package/dist/pagination/index.js.map +0 -1
  78. package/dist/popover/index.d.ts +0 -93
  79. package/dist/popover/index.js +0 -1339
  80. package/dist/popover/index.js.map +0 -1
  81. package/dist/portal/index.d.ts +0 -13
  82. package/dist/portal/index.js +0 -37
  83. package/dist/portal/index.js.map +0 -1
  84. package/dist/progress/index.d.ts +0 -48
  85. package/dist/progress/index.js +0 -223
  86. package/dist/progress/index.js.map +0 -1
  87. package/dist/progress-tracker/index.d.ts +0 -80
  88. package/dist/progress-tracker/index.js +0 -571
  89. package/dist/progress-tracker/index.js.map +0 -1
  90. package/dist/radio-group/index.d.ts +0 -100
  91. package/dist/radio-group/index.js +0 -318
  92. package/dist/radio-group/index.js.map +0 -1
  93. package/dist/rating/index.d.ts +0 -78
  94. package/dist/rating/index.js +0 -363
  95. package/dist/rating/index.js.map +0 -1
  96. package/dist/scrolling-list/index.d.ts +0 -118
  97. package/dist/scrolling-list/index.js +0 -1426
  98. package/dist/scrolling-list/index.js.map +0 -1
  99. package/dist/segmented-gauge/index.d.ts +0 -100
  100. package/dist/segmented-gauge/index.js +0 -277
  101. package/dist/segmented-gauge/index.js.map +0 -1
  102. package/dist/select/index.d.ts +0 -167
  103. package/dist/select/index.js +0 -581
  104. package/dist/select/index.js.map +0 -1
  105. package/dist/skeleton/index.d.ts +0 -67
  106. package/dist/skeleton/index.js +0 -206
  107. package/dist/skeleton/index.js.map +0 -1
  108. package/dist/slider/index.d.ts +0 -97
  109. package/dist/slider/index.js +0 -220
  110. package/dist/slider/index.js.map +0 -1
  111. package/dist/slot/index.d.ts +0 -16
  112. package/dist/slot/index.js +0 -51
  113. package/dist/slot/index.js.map +0 -1
  114. package/dist/snackbar/index.d.ts +0 -158
  115. package/dist/snackbar/index.js +0 -1756
  116. package/dist/snackbar/index.js.map +0 -1
  117. package/dist/spinner/index.d.ts +0 -21
  118. package/dist/spinner/index.js +0 -139
  119. package/dist/spinner/index.js.map +0 -1
  120. package/dist/stepper/index.d.ts +0 -81
  121. package/dist/stepper/index.js +0 -1847
  122. package/dist/stepper/index.js.map +0 -1
  123. package/dist/switch/index.d.ts +0 -64
  124. package/dist/switch/index.js +0 -327
  125. package/dist/switch/index.js.map +0 -1
  126. package/dist/tabs/index.d.ts +0 -103
  127. package/dist/tabs/index.js +0 -1376
  128. package/dist/tabs/index.js.map +0 -1
  129. package/dist/tag/index.d.ts +0 -29
  130. package/dist/tag/index.js +0 -283
  131. package/dist/tag/index.js.map +0 -1
  132. package/dist/text-link/index.d.ts +0 -20
  133. package/dist/text-link/index.js +0 -100
  134. package/dist/text-link/index.js.map +0 -1
  135. package/dist/textarea/index.d.ts +0 -57
  136. package/dist/textarea/index.js +0 -797
  137. package/dist/textarea/index.js.map +0 -1
  138. package/dist/toast/index.d.ts +0 -56
  139. package/dist/toast/index.js +0 -1412
  140. package/dist/toast/index.js.map +0 -1
  141. package/dist/visually-hidden/index.d.ts +0 -16
  142. package/dist/visually-hidden/index.js +0 -67
  143. package/dist/visually-hidden/index.js.map +0 -1
@@ -1,1400 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/drawer/index.ts
21
- var drawer_exports = {};
22
- __export(drawer_exports, {
23
- Drawer: () => Drawer2
24
- });
25
- module.exports = __toCommonJS(drawer_exports);
26
-
27
- // src/drawer/Drawer.tsx
28
- var import_radix_ui = require("radix-ui");
29
-
30
- // src/drawer/DrawerContext.tsx
31
- var import_react = require("react");
32
- var import_jsx_runtime = require("react/jsx-runtime");
33
- var DrawerContext = (0, import_react.createContext)(null);
34
- var DrawerProvider = ({
35
- children: childrenProp,
36
- withFade = false
37
- }) => {
38
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
39
- DrawerContext.Provider,
40
- {
41
- value: {
42
- withFade
43
- },
44
- children: childrenProp
45
- }
46
- );
47
- };
48
- var useDrawer = () => {
49
- const context = (0, import_react.useContext)(DrawerContext);
50
- if (!context) {
51
- throw Error("useDrawer must be used within a Drawer provider");
52
- }
53
- return context;
54
- };
55
-
56
- // src/drawer/Drawer.tsx
57
- var import_jsx_runtime2 = require("react/jsx-runtime");
58
- var Drawer = ({ children, withFade = false, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DrawerProvider, { withFade, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_radix_ui.Dialog.Root, { ...rest, children }) });
59
- Drawer.displayName = "Drawer.Root";
60
-
61
- // src/drawer/DrawerBody.tsx
62
- var import_use_merge_refs = require("@spark-ui/hooks/use-merge-refs");
63
- var import_use_scroll_overflow = require("@spark-ui/hooks/use-scroll-overflow");
64
- var import_react2 = require("react");
65
-
66
- // src/drawer/DrawerBody.styles.ts
67
- var import_class_variance_authority = require("class-variance-authority");
68
- var drawerBodyStyles = (0, import_class_variance_authority.cva)(
69
- ["grow", "overflow-y-auto", "outline-hidden", "focus-visible:u-outline"],
70
- {
71
- variants: {
72
- inset: {
73
- true: "",
74
- false: "px-xl py-lg"
75
- }
76
- },
77
- defaultVariants: {
78
- inset: false
79
- }
80
- }
81
- );
82
-
83
- // src/drawer/DrawerBody.tsx
84
- var import_jsx_runtime3 = require("react/jsx-runtime");
85
- var DrawerBody = ({
86
- children,
87
- inset = false,
88
- className,
89
- ref: forwardedRef,
90
- ...rest
91
- }) => {
92
- const scrollAreaRef = (0, import_react2.useRef)(null);
93
- const ref = (0, import_use_merge_refs.useMergeRefs)(forwardedRef, scrollAreaRef);
94
- const { withFade } = useDrawer();
95
- const overflow = (0, import_use_scroll_overflow.useScrollOverflow)(scrollAreaRef);
96
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
97
- "div",
98
- {
99
- "data-spark-component": "drawer-body",
100
- ref,
101
- className: drawerBodyStyles({ inset, className }),
102
- style: {
103
- ...withFade && {
104
- maskImage: "linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))",
105
- maskSize: `100% calc(100% + ${overflow.top ? "0px" : "44px"} + ${overflow.bottom ? "0px" : "44px"})`,
106
- maskPosition: `0 ${overflow.top ? "0px" : "-44px"}`
107
- }
108
- },
109
- ...rest,
110
- children
111
- }
112
- );
113
- };
114
- DrawerBody.displayName = "Drawer.Body";
115
-
116
- // src/drawer/DrawerCloseButton.tsx
117
- var import_Close = require("@spark-ui/icons/Close");
118
- var import_class_variance_authority7 = require("class-variance-authority");
119
-
120
- // src/icon/Icon.tsx
121
- var import_react4 = require("react");
122
-
123
- // src/slot/Slot.tsx
124
- var import_radix_ui2 = require("radix-ui");
125
- var import_react3 = require("react");
126
- var import_jsx_runtime4 = require("react/jsx-runtime");
127
- var Slottable = import_radix_ui2.Slot.Slottable;
128
- var Slot = ({ ref, ...props }) => {
129
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_radix_ui2.Slot.Root, { ref, ...props });
130
- };
131
- var wrapPolymorphicSlot = (asChild, children, callback) => {
132
- if (!asChild) return callback(children);
133
- return (0, import_react3.isValidElement)(children) ? (0, import_react3.cloneElement)(
134
- children,
135
- void 0,
136
- callback(children.props.children)
137
- ) : null;
138
- };
139
-
140
- // src/visually-hidden/VisuallyHidden.tsx
141
- var import_jsx_runtime5 = require("react/jsx-runtime");
142
- var VisuallyHidden = ({ asChild = false, ref, ...props }) => {
143
- const Component = asChild ? Slot : "span";
144
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
145
- Component,
146
- {
147
- ...props,
148
- ref,
149
- style: {
150
- // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
151
- position: "absolute",
152
- border: 0,
153
- width: 1,
154
- height: 1,
155
- padding: 0,
156
- margin: -1,
157
- overflow: "hidden",
158
- clip: "rect(0, 0, 0, 0)",
159
- whiteSpace: "nowrap",
160
- wordWrap: "normal",
161
- ...props.style
162
- }
163
- }
164
- );
165
- };
166
- VisuallyHidden.displayName = "VisuallyHidden";
167
-
168
- // src/icon/Icon.styles.tsx
169
- var import_internal_utils = require("@spark-ui/internal-utils");
170
- var import_class_variance_authority2 = require("class-variance-authority");
171
- var iconStyles = (0, import_class_variance_authority2.cva)(["fill-current shrink-0"], {
172
- variants: {
173
- /**
174
- * Color scheme of the icon.
175
- */
176
- intent: (0, import_internal_utils.makeVariants)({
177
- current: ["text-current"],
178
- main: ["text-main"],
179
- support: ["text-support"],
180
- accent: ["text-accent"],
181
- basic: ["text-basic"],
182
- success: ["text-success"],
183
- alert: ["text-alert"],
184
- error: ["text-error"],
185
- info: ["text-info"],
186
- neutral: ["text-neutral"]
187
- }),
188
- /**
189
- * Sets the size of the icon.
190
- */
191
- size: (0, import_internal_utils.makeVariants)({
192
- current: ["u-current-font-size"],
193
- sm: ["w-sz-16", "h-sz-16"],
194
- md: ["w-sz-24", "h-sz-24"],
195
- lg: ["w-sz-32", "h-sz-32"],
196
- xl: ["w-sz-40", "h-sz-40"]
197
- })
198
- }
199
- });
200
-
201
- // src/icon/Icon.tsx
202
- var import_jsx_runtime6 = require("react/jsx-runtime");
203
- var Icon = ({
204
- label,
205
- className,
206
- size = "current",
207
- intent = "current",
208
- children,
209
- ...others
210
- }) => {
211
- const child = import_react4.Children.only(children);
212
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
213
- (0, import_react4.cloneElement)(child, {
214
- className: iconStyles({ className, size, intent }),
215
- "data-spark-component": "icon",
216
- "aria-hidden": "true",
217
- focusable: "false",
218
- ...others
219
- }),
220
- label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(VisuallyHidden, { children: label })
221
- ] });
222
- };
223
- Icon.displayName = "Icon";
224
-
225
- // src/button/Button.tsx
226
- var import_class_variance_authority5 = require("class-variance-authority");
227
- var import_react5 = require("react");
228
-
229
- // src/spinner/Spinner.styles.tsx
230
- var import_internal_utils2 = require("@spark-ui/internal-utils");
231
- var import_class_variance_authority3 = require("class-variance-authority");
232
- var defaultVariants = {
233
- intent: "current",
234
- size: "current",
235
- isBackgroundVisible: false
236
- };
237
- var spinnerStyles = (0, import_class_variance_authority3.cva)(
238
- ["inline-block", "border-solid", "rounded-full", "border-md", "animate-spin"],
239
- {
240
- variants: {
241
- /**
242
- * Use `size` prop to set the size of the spinner. If you want to set the full size for the spinner, don't forget to add a wrapping container with its own size.
243
- */
244
- size: {
245
- current: ["u-current-font-size"],
246
- sm: ["w-sz-20", "h-sz-20"],
247
- md: ["w-sz-28", "h-sz-28"],
248
- full: ["w-full", "h-full"]
249
- },
250
- /**
251
- * Color scheme of the spinner.
252
- */
253
- intent: (0, import_internal_utils2.makeVariants)({
254
- current: ["border-current"],
255
- main: ["border-main"],
256
- support: ["border-support"],
257
- accent: ["border-accent"],
258
- basic: ["border-basic"],
259
- success: ["border-success"],
260
- alert: ["border-alert"],
261
- error: ["border-error"],
262
- info: ["border-info"],
263
- neutral: ["border-neutral"]
264
- }),
265
- /**
266
- * Size of the button.
267
- */
268
- isBackgroundVisible: {
269
- true: ["border-b-neutral-container", "border-l-neutral-container"],
270
- false: ["border-b-transparent", "border-l-transparent"]
271
- }
272
- },
273
- defaultVariants
274
- }
275
- );
276
-
277
- // src/spinner/Spinner.tsx
278
- var import_jsx_runtime7 = require("react/jsx-runtime");
279
- var Spinner = ({
280
- className,
281
- size = "current",
282
- intent = "current",
283
- label,
284
- isBackgroundVisible,
285
- ref,
286
- ...others
287
- }) => {
288
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
289
- "span",
290
- {
291
- role: "status",
292
- "data-spark-component": "spinner",
293
- ref,
294
- className: spinnerStyles({ className, size, intent, isBackgroundVisible }),
295
- ...others,
296
- children: label && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(VisuallyHidden, { children: label })
297
- }
298
- );
299
- };
300
-
301
- // src/button/Button.styles.tsx
302
- var import_internal_utils8 = require("@spark-ui/internal-utils");
303
- var import_class_variance_authority4 = require("class-variance-authority");
304
-
305
- // src/button/variants/filled.ts
306
- var import_internal_utils3 = require("@spark-ui/internal-utils");
307
- var filledVariants = [
308
- // Main
309
- {
310
- intent: "main",
311
- design: "filled",
312
- class: (0, import_internal_utils3.tw)([
313
- "bg-main",
314
- "text-on-main",
315
- "hover:bg-main-hovered",
316
- "enabled:active:bg-main-hovered",
317
- "focus-visible:bg-main-hovered"
318
- ])
319
- },
320
- // Support
321
- {
322
- intent: "support",
323
- design: "filled",
324
- class: (0, import_internal_utils3.tw)([
325
- "bg-support",
326
- "text-on-support",
327
- "hover:bg-support-hovered",
328
- "enabled:active:bg-support-hovered",
329
- "focus-visible:bg-support-hovered"
330
- ])
331
- },
332
- // Accent
333
- {
334
- intent: "accent",
335
- design: "filled",
336
- class: (0, import_internal_utils3.tw)([
337
- "bg-accent",
338
- "text-on-accent",
339
- "hover:bg-accent-hovered",
340
- "enabled:active:bg-accent-hovered",
341
- "focus-visible:bg-accent-hovered"
342
- ])
343
- },
344
- // Basic
345
- {
346
- intent: "basic",
347
- design: "filled",
348
- class: (0, import_internal_utils3.tw)([
349
- "bg-basic",
350
- "text-on-basic",
351
- "hover:bg-basic-hovered",
352
- "enabled:active:bg-basic-hovered",
353
- "focus-visible:bg-basic-hovered"
354
- ])
355
- },
356
- // Success
357
- {
358
- intent: "success",
359
- design: "filled",
360
- class: (0, import_internal_utils3.tw)([
361
- "bg-success",
362
- "text-on-success",
363
- "hover:bg-success-hovered",
364
- "enabled:active:bg-success-hovered",
365
- "focus-visible:bg-success-hovered"
366
- ])
367
- },
368
- // Alert
369
- {
370
- intent: "alert",
371
- design: "filled",
372
- class: (0, import_internal_utils3.tw)([
373
- "bg-alert",
374
- "text-on-alert",
375
- "hover:bg-alert-hovered",
376
- "enabled:active:bg-alert-hovered",
377
- "focus-visible:bg-alert-hovered"
378
- ])
379
- },
380
- // Danger
381
- {
382
- intent: "danger",
383
- design: "filled",
384
- class: (0, import_internal_utils3.tw)([
385
- "text-on-error bg-error",
386
- "hover:bg-error-hovered enabled:active:bg-error-hovered",
387
- "focus-visible:bg-error-hovered"
388
- ])
389
- },
390
- // Info
391
- {
392
- intent: "info",
393
- design: "filled",
394
- class: (0, import_internal_utils3.tw)([
395
- "text-on-error bg-info",
396
- "hover:bg-info-hovered enabled:active:bg-info-hovered",
397
- "focus-visible:bg-info-hovered"
398
- ])
399
- },
400
- // Neutral
401
- {
402
- intent: "neutral",
403
- design: "filled",
404
- class: (0, import_internal_utils3.tw)([
405
- "bg-neutral",
406
- "text-on-neutral",
407
- "hover:bg-neutral-hovered",
408
- "enabled:active:bg-neutral-hovered",
409
- "focus-visible:bg-neutral-hovered"
410
- ])
411
- },
412
- // Surface
413
- {
414
- intent: "surface",
415
- design: "filled",
416
- class: (0, import_internal_utils3.tw)([
417
- "bg-surface",
418
- "text-on-surface",
419
- "hover:bg-surface-hovered",
420
- "enabled:active:bg-surface-hovered",
421
- "focus-visible:bg-surface-hovered"
422
- ])
423
- },
424
- {
425
- intent: "surfaceInverse",
426
- design: "filled",
427
- class: (0, import_internal_utils3.tw)([
428
- "bg-surface-inverse",
429
- "text-on-surface-inverse",
430
- "hover:bg-surface-inverse-hovered",
431
- "enabled:active:bg-surface-inverse-hovered",
432
- "focus-visible:bg-surface-inverse-hovered"
433
- ])
434
- }
435
- ];
436
-
437
- // src/button/variants/ghost.ts
438
- var import_internal_utils4 = require("@spark-ui/internal-utils");
439
- var ghostVariants = [
440
- {
441
- intent: "main",
442
- design: "ghost",
443
- class: (0, import_internal_utils4.tw)([
444
- "text-on-main-container",
445
- "hover:bg-main/dim-5",
446
- "enabled:active:bg-main/dim-5",
447
- "focus-visible:bg-main/dim-5"
448
- ])
449
- },
450
- {
451
- intent: "support",
452
- design: "ghost",
453
- class: (0, import_internal_utils4.tw)([
454
- "text-on-support-container",
455
- "hover:bg-support/dim-5",
456
- "enabled:active:bg-support/dim-5",
457
- "focus-visible:bg-support/dim-5"
458
- ])
459
- },
460
- {
461
- intent: "accent",
462
- design: "ghost",
463
- class: (0, import_internal_utils4.tw)([
464
- "text-on-accent-container",
465
- "hover:bg-accent/dim-5",
466
- "enabled:active:bg-accent/dim-5",
467
- "focus-visible:bg-accent/dim-5"
468
- ])
469
- },
470
- {
471
- intent: "basic",
472
- design: "ghost",
473
- class: (0, import_internal_utils4.tw)([
474
- "text-on-basic-container",
475
- "hover:bg-basic/dim-5",
476
- "enabled:active:bg-basic/dim-5",
477
- "focus-visible:bg-basic/dim-5"
478
- ])
479
- },
480
- {
481
- intent: "success",
482
- design: "ghost",
483
- class: (0, import_internal_utils4.tw)([
484
- "text-on-success-container",
485
- "hover:bg-success/dim-5",
486
- "enabled:active:bg-success/dim-5",
487
- "focus-visible:bg-success/dim-5"
488
- ])
489
- },
490
- {
491
- intent: "alert",
492
- design: "ghost",
493
- class: (0, import_internal_utils4.tw)([
494
- "text-on-alert-container",
495
- "hover:bg-alert/dim-5",
496
- "enabled:active:bg-alert/dim-5",
497
- "focus-visible:bg-alert/dim-5"
498
- ])
499
- },
500
- {
501
- intent: "danger",
502
- design: "ghost",
503
- class: (0, import_internal_utils4.tw)([
504
- "text-on-error-container",
505
- "hover:bg-error/dim-5",
506
- "enabled:active:bg-error/dim-5",
507
- "focus-visible:bg-error/dim-5"
508
- ])
509
- },
510
- {
511
- intent: "info",
512
- design: "ghost",
513
- class: (0, import_internal_utils4.tw)([
514
- "text-on-info-container",
515
- "hover:bg-info/dim-5",
516
- "enabled:active:bg-info/dim-5",
517
- "focus-visible:bg-info/dim-5"
518
- ])
519
- },
520
- {
521
- intent: "neutral",
522
- design: "ghost",
523
- class: (0, import_internal_utils4.tw)([
524
- "text-on-neutral-container",
525
- "hover:bg-neutral/dim-5",
526
- "enabled:active:bg-neutral/dim-5",
527
- "focus-visible:bg-neutral/dim-5"
528
- ])
529
- },
530
- {
531
- intent: "surface",
532
- design: "ghost",
533
- class: (0, import_internal_utils4.tw)([
534
- "text-surface",
535
- "hover:bg-surface/dim-5",
536
- "enabled:active:bg-surface/dim-5",
537
- "focus-visible:bg-surface/dim-5"
538
- ])
539
- },
540
- {
541
- intent: "surfaceInverse",
542
- design: "ghost",
543
- class: (0, import_internal_utils4.tw)([
544
- "text-surface-inverse",
545
- "hover:bg-surface-inverse/dim-5",
546
- "enabled:active:bg-surface-inverse/dim-5",
547
- "focus-visible:bg-surface-inverse/dim-5"
548
- ])
549
- }
550
- ];
551
-
552
- // src/button/variants/outlined.ts
553
- var import_internal_utils5 = require("@spark-ui/internal-utils");
554
- var outlinedVariants = [
555
- {
556
- intent: "main",
557
- design: "outlined",
558
- class: (0, import_internal_utils5.tw)([
559
- "hover:bg-main/dim-5",
560
- "enabled:active:bg-main/dim-5",
561
- "focus-visible:bg-main/dim-5",
562
- "text-main"
563
- ])
564
- },
565
- {
566
- intent: "support",
567
- design: "outlined",
568
- class: (0, import_internal_utils5.tw)([
569
- "hover:bg-support/dim-5",
570
- "enabled:active:bg-support/dim-5",
571
- "focus-visible:bg-support/dim-5",
572
- "text-support"
573
- ])
574
- },
575
- {
576
- intent: "accent",
577
- design: "outlined",
578
- class: (0, import_internal_utils5.tw)([
579
- "hover:bg-accent/dim-5",
580
- "enabled:active:bg-accent/dim-5",
581
- "focus-visible:bg-accent/dim-5",
582
- "text-accent"
583
- ])
584
- },
585
- {
586
- intent: "basic",
587
- design: "outlined",
588
- class: (0, import_internal_utils5.tw)([
589
- "hover:bg-basic/dim-5",
590
- "enabled:active:bg-basic/dim-5",
591
- "focus-visible:bg-basic/dim-5",
592
- "text-basic"
593
- ])
594
- },
595
- {
596
- intent: "success",
597
- design: "outlined",
598
- class: (0, import_internal_utils5.tw)([
599
- "hover:bg-success/dim-5",
600
- "enabled:active:bg-success/dim-5",
601
- "focus-visible:bg-success/dim-5",
602
- "text-success"
603
- ])
604
- },
605
- {
606
- intent: "alert",
607
- design: "outlined",
608
- class: (0, import_internal_utils5.tw)([
609
- "hover:bg-alert/dim-5",
610
- "enabled:active:bg-alert/dim-5",
611
- "focus-visible:bg-alert/dim-5",
612
- "text-alert"
613
- ])
614
- },
615
- {
616
- intent: "danger",
617
- design: "outlined",
618
- class: (0, import_internal_utils5.tw)([
619
- "hover:bg-error/dim-5",
620
- "enabled:active:bg-error/dim-5",
621
- "focus-visible:bg-error/dim-5",
622
- "text-error"
623
- ])
624
- },
625
- {
626
- intent: "info",
627
- design: "outlined",
628
- class: (0, import_internal_utils5.tw)([
629
- "hover:bg-info/dim-5",
630
- "enabled:active:bg-info/dim-5",
631
- "focus-visible:bg-info/dim-5",
632
- "text-info"
633
- ])
634
- },
635
- {
636
- intent: "neutral",
637
- design: "outlined",
638
- class: (0, import_internal_utils5.tw)([
639
- "hover:bg-neutral/dim-5",
640
- "enabled:active:bg-neutral/dim-5",
641
- "focus-visible:bg-neutral/dim-5",
642
- "text-neutral"
643
- ])
644
- },
645
- {
646
- intent: "surface",
647
- design: "outlined",
648
- class: (0, import_internal_utils5.tw)([
649
- "hover:bg-surface/dim-5",
650
- "enabled:active:bg-surface/dim-5",
651
- "focus-visible:bg-surface/dim-5",
652
- "text-surface"
653
- ])
654
- },
655
- {
656
- intent: "surfaceInverse",
657
- design: "outlined",
658
- class: (0, import_internal_utils5.tw)([
659
- "hover:bg-surface-inverse/dim-5",
660
- "enabled:active:bg-surface-inverse/dim-5",
661
- "focus-visible:bg-surface-inverse/dim-5",
662
- "text-surface-inverse"
663
- ])
664
- }
665
- ];
666
-
667
- // src/button/variants/tinted.ts
668
- var import_internal_utils6 = require("@spark-ui/internal-utils");
669
- var tintedVariants = [
670
- {
671
- intent: "main",
672
- design: "tinted",
673
- class: (0, import_internal_utils6.tw)([
674
- "bg-main-container",
675
- "text-on-main-container",
676
- "hover:bg-main-container-hovered",
677
- "enabled:active:bg-main-container-hovered",
678
- "focus-visible:bg-main-container-hovered"
679
- ])
680
- },
681
- {
682
- intent: "support",
683
- design: "tinted",
684
- class: (0, import_internal_utils6.tw)([
685
- "bg-support-container",
686
- "text-on-support-container",
687
- "hover:bg-support-container-hovered",
688
- "enabled:active:bg-support-container-hovered",
689
- "focus-visible:bg-support-container-hovered"
690
- ])
691
- },
692
- {
693
- intent: "accent",
694
- design: "tinted",
695
- class: (0, import_internal_utils6.tw)([
696
- "bg-accent-container",
697
- "text-on-accent-container",
698
- "hover:bg-accent-container-hovered",
699
- "enabled:active:bg-accent-container-hovered",
700
- "focus-visible:bg-accent-container-hovered"
701
- ])
702
- },
703
- {
704
- intent: "basic",
705
- design: "tinted",
706
- class: (0, import_internal_utils6.tw)([
707
- "bg-basic-container",
708
- "text-on-basic-container",
709
- "hover:bg-basic-container-hovered",
710
- "enabled:active:bg-basic-container-hovered",
711
- "focus-visible:bg-basic-container-hovered"
712
- ])
713
- },
714
- {
715
- intent: "success",
716
- design: "tinted",
717
- class: (0, import_internal_utils6.tw)([
718
- "bg-success-container",
719
- "text-on-success-container",
720
- "hover:bg-success-container-hovered",
721
- "enabled:active:bg-success-container-hovered",
722
- "focus-visible:bg-success-container-hovered"
723
- ])
724
- },
725
- {
726
- intent: "alert",
727
- design: "tinted",
728
- class: (0, import_internal_utils6.tw)([
729
- "bg-alert-container",
730
- "text-on-alert-container",
731
- "hover:bg-alert-container-hovered",
732
- "enabled:active:bg-alert-container-hovered",
733
- "focus-visible:bg-alert-container-hovered"
734
- ])
735
- },
736
- {
737
- intent: "danger",
738
- design: "tinted",
739
- class: (0, import_internal_utils6.tw)([
740
- "bg-error-container",
741
- "text-on-error-container",
742
- "hover:bg-error-container-hovered",
743
- "enabled:active:bg-error-container-hovered",
744
- "focus-visible:bg-error-container-hovered"
745
- ])
746
- },
747
- {
748
- intent: "info",
749
- design: "tinted",
750
- class: (0, import_internal_utils6.tw)([
751
- "bg-info-container",
752
- "text-on-info-container",
753
- "hover:bg-info-container-hovered",
754
- "enabled:active:bg-info-container-hovered",
755
- "focus-visible:bg-info-container-hovered"
756
- ])
757
- },
758
- {
759
- intent: "neutral",
760
- design: "tinted",
761
- class: (0, import_internal_utils6.tw)([
762
- "bg-neutral-container",
763
- "text-on-neutral-container",
764
- "hover:bg-neutral-container-hovered",
765
- "enabled:active:bg-neutral-container-hovered",
766
- "focus-visible:bg-neutral-container-hovered"
767
- ])
768
- },
769
- {
770
- intent: "surface",
771
- design: "tinted",
772
- class: (0, import_internal_utils6.tw)([
773
- "bg-surface",
774
- "text-on-surface",
775
- "hover:bg-surface-hovered",
776
- "enabled:active:bg-surface-hovered",
777
- "focus-visible:bg-surface-hovered"
778
- ])
779
- },
780
- {
781
- intent: "surfaceInverse",
782
- design: "tinted",
783
- class: (0, import_internal_utils6.tw)([
784
- "bg-surface-inverse",
785
- "text-on-surface-inverse",
786
- "hover:bg-surface-inverse-hovered",
787
- "enabled:active:bg-surface-inverse-hovered",
788
- "focus-visible:bg-surface-inverse-hovered"
789
- ])
790
- }
791
- ];
792
-
793
- // src/button/variants/contrast.ts
794
- var import_internal_utils7 = require("@spark-ui/internal-utils");
795
- var contrastVariants = [
796
- {
797
- intent: "main",
798
- design: "contrast",
799
- class: (0, import_internal_utils7.tw)([
800
- "text-on-main-contaier bg-surface",
801
- "hover:bg-main-container-hovered",
802
- "enabled:active:bg-main-container-hovered",
803
- "focus-visible:bg-main-container-hovered"
804
- ])
805
- },
806
- {
807
- intent: "support",
808
- design: "contrast",
809
- class: (0, import_internal_utils7.tw)([
810
- "text-on-support-container bg-surface",
811
- "hover:bg-support-container-hovered",
812
- "enabled:active:bg-support-container-hovered",
813
- "focus-visible:bg-support-container-hovered"
814
- ])
815
- },
816
- {
817
- intent: "accent",
818
- design: "contrast",
819
- class: (0, import_internal_utils7.tw)([
820
- "text-on-accent-container bg-surface",
821
- "hover:bg-accent-container-hovered",
822
- "enabled:active:bg-accent-container-hovered",
823
- "focus-visible:bg-accent-container-hovered"
824
- ])
825
- },
826
- {
827
- intent: "basic",
828
- design: "contrast",
829
- class: (0, import_internal_utils7.tw)([
830
- "text-on-basic-container bg-surface",
831
- "hover:bg-basic-container-hovered",
832
- "enabled:active:bg-basic-container-hovered",
833
- "focus-visible:bg-basic-container-hovered"
834
- ])
835
- },
836
- {
837
- intent: "success",
838
- design: "contrast",
839
- class: (0, import_internal_utils7.tw)([
840
- "text-on-success-container bg-surface",
841
- "hover:bg-success-container-hovered",
842
- "enabled:active:bg-success-container-hovered",
843
- "focus-visible:bg-success-container-hovered"
844
- ])
845
- },
846
- {
847
- intent: "alert",
848
- design: "contrast",
849
- class: (0, import_internal_utils7.tw)([
850
- "text-on-alert-container bg-surface",
851
- "hover:bg-alert-container-hovered",
852
- "enabled:active:bg-alert-container-hovered",
853
- "focus-visible:bg-alert-container-hovered"
854
- ])
855
- },
856
- {
857
- intent: "danger",
858
- design: "contrast",
859
- class: (0, import_internal_utils7.tw)([
860
- "text-on-error-container bg-surface",
861
- "hover:bg-error-container-hovered",
862
- "enabled:active:bg-error-container-hovered",
863
- "focus-visible:bg-error-container-hovered"
864
- ])
865
- },
866
- {
867
- intent: "info",
868
- design: "contrast",
869
- class: (0, import_internal_utils7.tw)([
870
- "text-on-info-container bg-surface",
871
- "hover:bg-info-container-hovered",
872
- "enabled:active:bg-info-container-hovered",
873
- "focus-visible:bg-info-container-hovered"
874
- ])
875
- },
876
- {
877
- intent: "neutral",
878
- design: "contrast",
879
- class: (0, import_internal_utils7.tw)([
880
- "text-on-neutral-container bg-surface",
881
- "hover:bg-neutral-container-hovered",
882
- "enabled:active:bg-neutral-container-hovered",
883
- "focus-visible:bg-neutral-container-hovered"
884
- ])
885
- },
886
- {
887
- intent: "surface",
888
- design: "contrast",
889
- class: (0, import_internal_utils7.tw)([
890
- "text-on-surface bg-surface",
891
- "hover:bg-surface-hovered",
892
- "enabled:active:bg-surface-hovered",
893
- "focus-visible:bg-surface-hovered"
894
- ])
895
- },
896
- {
897
- intent: "surfaceInverse",
898
- design: "contrast",
899
- class: (0, import_internal_utils7.tw)([
900
- "text-on-surface-inverse bg-surface-inverse",
901
- "hover:bg-surface-inverse-hovered",
902
- "enabled:active:bg-surface-inverse-hovered",
903
- "focus-visible:bg-surface-inverse-hovered"
904
- ])
905
- }
906
- ];
907
-
908
- // src/button/Button.styles.tsx
909
- var buttonStyles = (0, import_class_variance_authority4.cva)(
910
- [
911
- "u-shadow-border-transition",
912
- "box-border inline-flex items-center justify-center gap-md whitespace-nowrap",
913
- "default:px-lg",
914
- "text-body-1 font-bold",
915
- "focus-visible:u-outline"
916
- ],
917
- {
918
- variants: {
919
- /**
920
- * Main style of the button.
921
- *
922
- * - `filled`: Button will be plain.
923
- *
924
- * - `outlined`: Button will be transparent with an outline.
925
- *
926
- * - `tinted`: Button will be filled but using a lighter color scheme.
927
- *
928
- * - `ghost`: Button will look like a link. No borders, plain text.
929
- *
930
- * - `contrast`: Button will be surface filled. No borders, plain text.
931
- *
932
- */
933
- design: (0, import_internal_utils8.makeVariants)({
934
- filled: [],
935
- outlined: ["bg-transparent", "border-sm", "border-current"],
936
- tinted: [],
937
- ghost: ["default:-mx-md px-md hover:bg-main/dim-5"],
938
- contrast: []
939
- }),
940
- underline: {
941
- true: ["underline"]
942
- },
943
- /**
944
- * Color scheme of the button.
945
- */
946
- intent: (0, import_internal_utils8.makeVariants)({
947
- main: [],
948
- support: [],
949
- accent: [],
950
- basic: [],
951
- success: [],
952
- alert: [],
953
- danger: [],
954
- info: [],
955
- neutral: [],
956
- surface: [],
957
- surfaceInverse: []
958
- }),
959
- /**
960
- * Size of the button.
961
- */
962
- size: (0, import_internal_utils8.makeVariants)({
963
- sm: ["min-w-sz-32", "h-sz-32"],
964
- md: ["min-w-sz-44", "h-sz-44"],
965
- lg: ["min-w-sz-56", "h-sz-56"]
966
- }),
967
- /**
968
- * Shape of the button.
969
- */
970
- shape: (0, import_internal_utils8.makeVariants)({
971
- rounded: ["rounded-lg"],
972
- square: ["rounded-0"],
973
- pill: ["rounded-full"]
974
- }),
975
- /**
976
- * Disable the button, preventing user interaction and adding opacity.
977
- */
978
- disabled: {
979
- true: ["cursor-not-allowed", "opacity-dim-3"],
980
- false: ["cursor-pointer"]
981
- }
982
- },
983
- compoundVariants: [
984
- ...filledVariants,
985
- ...outlinedVariants,
986
- ...tintedVariants,
987
- ...ghostVariants,
988
- ...contrastVariants
989
- ],
990
- defaultVariants: {
991
- design: "filled",
992
- intent: "main",
993
- size: "md",
994
- shape: "rounded"
995
- }
996
- }
997
- );
998
-
999
- // src/button/Button.tsx
1000
- var import_jsx_runtime8 = require("react/jsx-runtime");
1001
- var blockedEventHandlers = [
1002
- "onClick",
1003
- "onMouseDown",
1004
- "onMouseUp",
1005
- "onMouseEnter",
1006
- "onMouseLeave",
1007
- "onMouseOver",
1008
- "onMouseOut",
1009
- "onKeyDown",
1010
- "onKeyPress",
1011
- "onKeyUp",
1012
- "onSubmit"
1013
- ];
1014
- var Button = ({
1015
- children,
1016
- design = "filled",
1017
- disabled = false,
1018
- intent = "main",
1019
- isLoading = false,
1020
- loadingLabel,
1021
- loadingText,
1022
- shape = "rounded",
1023
- size = "md",
1024
- asChild,
1025
- className,
1026
- underline = false,
1027
- ref,
1028
- ...others
1029
- }) => {
1030
- const Component = asChild ? Slot : "button";
1031
- const shouldNotInteract = !!disabled || isLoading;
1032
- const disabledEventHandlers = (0, import_react5.useMemo)(() => {
1033
- const result = {};
1034
- if (shouldNotInteract) {
1035
- blockedEventHandlers.forEach((eventHandler) => result[eventHandler] = void 0);
1036
- }
1037
- return result;
1038
- }, [shouldNotInteract]);
1039
- const spinnerProps = {
1040
- size: "current",
1041
- className: loadingText ? "inline-block" : "absolute",
1042
- ...loadingLabel && { "aria-label": loadingLabel }
1043
- };
1044
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1045
- Component,
1046
- {
1047
- "data-spark-component": "button",
1048
- ...Component === "button" && { type: "button" },
1049
- ref,
1050
- className: buttonStyles({
1051
- className,
1052
- design,
1053
- disabled: shouldNotInteract,
1054
- intent,
1055
- shape,
1056
- size,
1057
- underline
1058
- }),
1059
- disabled: !!disabled,
1060
- "aria-busy": isLoading,
1061
- "aria-live": isLoading ? "assertive" : "off",
1062
- ...others,
1063
- ...disabledEventHandlers,
1064
- children: wrapPolymorphicSlot(
1065
- asChild,
1066
- children,
1067
- (slotted) => isLoading ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1068
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Spinner, { ...spinnerProps }),
1069
- loadingText && loadingText,
1070
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1071
- "div",
1072
- {
1073
- "aria-hidden": true,
1074
- className: (0, import_class_variance_authority5.cx)("gap-md", loadingText ? "hidden" : "inline-flex opacity-0"),
1075
- children: slotted
1076
- }
1077
- )
1078
- ] }) : slotted
1079
- )
1080
- }
1081
- );
1082
- };
1083
- Button.displayName = "Button";
1084
-
1085
- // src/icon-button/IconButton.styles.tsx
1086
- var import_internal_utils9 = require("@spark-ui/internal-utils");
1087
- var import_class_variance_authority6 = require("class-variance-authority");
1088
- var iconButtonStyles = (0, import_class_variance_authority6.cva)(["pl-0 pr-0"], {
1089
- variants: {
1090
- /**
1091
- * Sets the size of the icon.
1092
- */
1093
- size: (0, import_internal_utils9.makeVariants)({
1094
- sm: ["text-body-1"],
1095
- md: ["text-body-1"],
1096
- lg: ["text-display-3"]
1097
- })
1098
- }
1099
- });
1100
-
1101
- // src/icon-button/IconButton.tsx
1102
- var import_jsx_runtime9 = require("react/jsx-runtime");
1103
- var IconButton = ({
1104
- design = "filled",
1105
- disabled = false,
1106
- intent = "main",
1107
- shape = "rounded",
1108
- size = "md",
1109
- className,
1110
- ref,
1111
- ...others
1112
- }) => {
1113
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1114
- Button,
1115
- {
1116
- "data-spark-component": "icon-button",
1117
- ref,
1118
- className: iconButtonStyles({ size, className }),
1119
- design,
1120
- disabled,
1121
- intent,
1122
- shape,
1123
- size,
1124
- ...others
1125
- }
1126
- );
1127
- };
1128
- IconButton.displayName = "IconButton";
1129
-
1130
- // src/drawer/DrawerClose.tsx
1131
- var import_radix_ui3 = require("radix-ui");
1132
- var import_jsx_runtime10 = require("react/jsx-runtime");
1133
- var DrawerClose = (props) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_radix_ui3.Dialog.Close, { "data-spark-component": "drawer-close", ...props });
1134
- DrawerClose.displayName = "Drawer.Close";
1135
-
1136
- // src/drawer/DrawerCloseButton.tsx
1137
- var import_jsx_runtime11 = require("react/jsx-runtime");
1138
- var DrawerCloseButton = ({
1139
- "aria-label": ariaLabel,
1140
- className,
1141
- size = "md",
1142
- intent = "neutral",
1143
- design = "ghost",
1144
- children = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_Close.Close, {}),
1145
- ref,
1146
- ...rest
1147
- }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1148
- DrawerClose,
1149
- {
1150
- "data-spark-component": "drawer-close-button",
1151
- ref,
1152
- className: (0, import_class_variance_authority7.cx)(["absolute", "top-sm", "right-xl"], className),
1153
- asChild: true,
1154
- ...rest,
1155
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(IconButton, { intent, size, design, "aria-label": ariaLabel, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { children }) })
1156
- }
1157
- );
1158
- DrawerCloseButton.displayName = "Drawer.CloseButton";
1159
-
1160
- // src/drawer/DrawerContent.tsx
1161
- var import_radix_ui4 = require("radix-ui");
1162
-
1163
- // src/drawer/DrawerContent.styles.tsx
1164
- var import_class_variance_authority8 = require("class-variance-authority");
1165
- var drawerContentStyles = (0, import_class_variance_authority8.cva)(
1166
- [
1167
- "fixed z-modal flex flex-col bg-surface shadow-md",
1168
- "data-[state=open]:animation-duration-400 data-[state=closed]:animation-duration-200"
1169
- ],
1170
- {
1171
- variants: {
1172
- size: {
1173
- sm: "",
1174
- md: "",
1175
- lg: "",
1176
- fluid: "",
1177
- fullscreen: "h-screen w-screen"
1178
- },
1179
- side: {
1180
- right: [
1181
- "inset-y-0 right-0",
1182
- "data-[state=open]:animate-slide-in-right ",
1183
- "data-[state=closed]:animate-slide-out-right"
1184
- ],
1185
- left: [
1186
- "inset-y-0 left-0",
1187
- "data-[state=open]:animate-slide-in-left",
1188
- "data-[state=closed]:animate-slide-out-left"
1189
- ],
1190
- top: [
1191
- "top-0 left-0",
1192
- "w-screen",
1193
- "data-[state=open]:animate-slide-in-top",
1194
- "data-[state=closed]:animate-slide-out-top"
1195
- ],
1196
- bottom: [
1197
- "bottom-0 left-0",
1198
- "w-screen",
1199
- "data-[state=open]:animate-slide-in-bottom",
1200
- "data-[state=closed]:animate-slide-out-bottom"
1201
- ]
1202
- }
1203
- },
1204
- compoundVariants: [
1205
- {
1206
- side: ["right", "left"],
1207
- size: "sm",
1208
- class: ["w-sz-480", "max-w-full"]
1209
- },
1210
- {
1211
- side: ["right", "left"],
1212
- size: "md",
1213
- class: ["w-sz-672", "max-w-full"]
1214
- },
1215
- {
1216
- side: ["right", "left"],
1217
- size: "lg",
1218
- class: ["w-sz-864", "max-w-full"]
1219
- },
1220
- {
1221
- side: ["left", "right"],
1222
- size: "fluid",
1223
- class: ["w-auto", "max-w-full"]
1224
- },
1225
- {
1226
- side: ["top", "bottom"],
1227
- size: "sm",
1228
- class: ["h-sz-480", "max-h-full"]
1229
- },
1230
- {
1231
- side: ["top", "bottom"],
1232
- size: "md",
1233
- class: ["h-sz-672", "max-h-full"]
1234
- },
1235
- {
1236
- side: ["top", "bottom"],
1237
- size: "lg",
1238
- class: ["h-sz-864", "max-h-full"]
1239
- },
1240
- {
1241
- side: ["top", "bottom"],
1242
- size: "fluid",
1243
- class: ["h-auto", "max-h-full"]
1244
- }
1245
- ],
1246
- defaultVariants: {
1247
- side: "right",
1248
- size: "md"
1249
- }
1250
- }
1251
- );
1252
-
1253
- // src/drawer/DrawerContent.tsx
1254
- var import_jsx_runtime12 = require("react/jsx-runtime");
1255
- var DrawerContent = ({
1256
- className,
1257
- size = "md",
1258
- side = "right",
1259
- onInteractOutside,
1260
- ref,
1261
- ...rest
1262
- }) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1263
- import_radix_ui4.Dialog.Content,
1264
- {
1265
- "data-spark-component": "drawer-content",
1266
- ref,
1267
- className: drawerContentStyles({
1268
- size,
1269
- side,
1270
- className
1271
- }),
1272
- onInteractOutside: (e) => {
1273
- const isForegroundElement = e.target.closest(".z-toast, .z-popover");
1274
- if (isForegroundElement) {
1275
- e.preventDefault();
1276
- }
1277
- onInteractOutside?.(e);
1278
- },
1279
- ...rest
1280
- }
1281
- );
1282
- DrawerContent.displayName = "Drawer.Content";
1283
-
1284
- // src/drawer/DrawerDescription.tsx
1285
- var import_radix_ui5 = require("radix-ui");
1286
- var import_jsx_runtime13 = require("react/jsx-runtime");
1287
- var DrawerDescription = (props) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_radix_ui5.Dialog.Description, { "data-spark-component": "drawer-description", ...props });
1288
- DrawerDescription.displayName = "Drawer.Description";
1289
-
1290
- // src/drawer/DrawerFooter.tsx
1291
- var import_class_variance_authority9 = require("class-variance-authority");
1292
- var import_jsx_runtime14 = require("react/jsx-runtime");
1293
- var DrawerFooter = ({ className, ref, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1294
- "footer",
1295
- {
1296
- "data-spark-component": "drawer-footer",
1297
- ref,
1298
- className: (0, import_class_variance_authority9.cx)(["px-xl", "py-lg"], className),
1299
- ...rest
1300
- }
1301
- );
1302
- DrawerFooter.displayName = "Drawer.Footer";
1303
-
1304
- // src/drawer/DrawerHeader.tsx
1305
- var import_class_variance_authority10 = require("class-variance-authority");
1306
- var import_jsx_runtime15 = require("react/jsx-runtime");
1307
- var DrawerHeader = ({
1308
- children,
1309
- className,
1310
- ref,
1311
- ...rest
1312
- }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1313
- "header",
1314
- {
1315
- "data-spark-component": "drawer-header",
1316
- ref,
1317
- className: (0, import_class_variance_authority10.cx)(["px-xl", "py-lg"], className),
1318
- ...rest,
1319
- children
1320
- }
1321
- );
1322
- DrawerHeader.displayName = "Dialog.Header";
1323
-
1324
- // src/drawer/DrawerOverlay.tsx
1325
- var import_class_variance_authority11 = require("class-variance-authority");
1326
- var import_radix_ui6 = require("radix-ui");
1327
- var import_jsx_runtime16 = require("react/jsx-runtime");
1328
- var DrawerOverlay = ({ className, ref, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1329
- import_radix_ui6.Dialog.Overlay,
1330
- {
1331
- "data-spark-component": "drawer-overlay",
1332
- ref,
1333
- className: (0, import_class_variance_authority11.cx)(
1334
- ["fixed", "top-0", "left-0", "w-screen", "h-screen", "z-overlay"],
1335
- ["bg-overlay/dim-1"],
1336
- ["data-[state=open]:animate-fade-in"],
1337
- ["data-[state=closed]:animate-fade-out"],
1338
- className
1339
- ),
1340
- ...rest
1341
- }
1342
- );
1343
- DrawerOverlay.displayName = "Drawer.Overlay";
1344
-
1345
- // src/drawer/DrawerPortal.tsx
1346
- var import_radix_ui7 = require("radix-ui");
1347
- var import_jsx_runtime17 = require("react/jsx-runtime");
1348
- var DrawerPortal = ({ children, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_radix_ui7.Dialog.Portal, { ...rest, children });
1349
- DrawerPortal.displayName = "Drawer.Portal";
1350
-
1351
- // src/drawer/DrawerTitle.tsx
1352
- var import_class_variance_authority12 = require("class-variance-authority");
1353
- var import_radix_ui8 = require("radix-ui");
1354
- var import_jsx_runtime18 = require("react/jsx-runtime");
1355
- var DrawerTitle = ({ className, ref, ...others }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1356
- import_radix_ui8.Dialog.Title,
1357
- {
1358
- "data-spark-component": "drawer-title",
1359
- ref,
1360
- className: (0, import_class_variance_authority12.cx)("text-headline-2 text-on-surface", className),
1361
- ...others
1362
- }
1363
- );
1364
- DrawerTitle.displayName = "Drawer.Title";
1365
-
1366
- // src/drawer/DrawerTrigger.tsx
1367
- var import_radix_ui9 = require("radix-ui");
1368
- var import_jsx_runtime19 = require("react/jsx-runtime");
1369
- var DrawerTrigger = (props) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_radix_ui9.Dialog.Trigger, { "data-spark-component": "drawer-trigger", ...props });
1370
- DrawerTrigger.displayName = "Drawer.Trigger";
1371
-
1372
- // src/drawer/index.ts
1373
- var Drawer2 = Object.assign(Drawer, {
1374
- Trigger: DrawerTrigger,
1375
- Portal: DrawerPortal,
1376
- Overlay: DrawerOverlay,
1377
- Content: DrawerContent,
1378
- Header: DrawerHeader,
1379
- Body: DrawerBody,
1380
- Footer: DrawerFooter,
1381
- CloseButton: DrawerCloseButton,
1382
- Title: DrawerTitle,
1383
- Description: DrawerDescription
1384
- });
1385
- Drawer2.displayName = "Drawer";
1386
- DrawerTrigger.displayName = "Drawer.Trigger";
1387
- DrawerPortal.displayName = "Drawer.Portal";
1388
- DrawerOverlay.displayName = "Drawer.Overlay";
1389
- DrawerContent.displayName = "Drawer.Content";
1390
- DrawerHeader.displayName = "Drawer.Header";
1391
- DrawerBody.displayName = "Drawer.Body";
1392
- DrawerFooter.displayName = "Drawer.Footer";
1393
- DrawerCloseButton.displayName = "Drawer.CloseButton";
1394
- DrawerTitle.displayName = "Drawer.Title";
1395
- DrawerDescription.displayName = "Drawer.Description";
1396
- // Annotate the CommonJS export names for ESM import in node:
1397
- 0 && (module.exports = {
1398
- Drawer
1399
- });
1400
- //# sourceMappingURL=index.js.map