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