@spark-ui/components 16.2.3 → 17.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 (181) hide show
  1. package/dist/{Button-DPncfbbM.mjs → Button-1M9DcZl0.mjs} +25 -79
  2. package/dist/Button-1M9DcZl0.mjs.map +1 -0
  3. package/dist/Button-FZceRWG2.js +2 -0
  4. package/dist/Button-FZceRWG2.js.map +1 -0
  5. package/dist/{Icon-C23-htlD.mjs → Icon-BO327oHU.mjs} +8 -9
  6. package/dist/Icon-BO327oHU.mjs.map +1 -0
  7. package/dist/Icon-C-cNTnzd.js +2 -0
  8. package/dist/Icon-C-cNTnzd.js.map +1 -0
  9. package/dist/{IconButton-D3g86WpZ.js → IconButton-BR1bJSQA.js} +2 -2
  10. package/dist/{IconButton-D3g86WpZ.js.map → IconButton-BR1bJSQA.js.map} +1 -1
  11. package/dist/{IconButton-Bfd-6BAD.mjs → IconButton-DdB3Pq13.mjs} +2 -2
  12. package/dist/{IconButton-Bfd-6BAD.mjs.map → IconButton-DdB3Pq13.mjs.map} +1 -1
  13. package/dist/Spinner-Br4Rp9V2.js +2 -0
  14. package/dist/Spinner-Br4Rp9V2.js.map +1 -0
  15. package/dist/{Spinner-aLrtE2JN.mjs → Spinner-Co3AjkQV.mjs} +7 -8
  16. package/dist/Spinner-Co3AjkQV.mjs.map +1 -0
  17. package/dist/TextLink-5MvP0P8D.js +2 -0
  18. package/dist/TextLink-5MvP0P8D.js.map +1 -0
  19. package/dist/{TextLink-D7mOCjY_.mjs → TextLink-Cc_LeVcx.mjs} +10 -11
  20. package/dist/TextLink-Cc_LeVcx.mjs.map +1 -0
  21. package/dist/accordion/index.js +1 -1
  22. package/dist/accordion/index.mjs +1 -1
  23. package/dist/avatar/index.js +1 -1
  24. package/dist/avatar/index.mjs +2 -2
  25. package/dist/badge/BadgeItem.styles.d.ts +1 -1
  26. package/dist/badge/index.js +1 -1
  27. package/dist/badge/index.js.map +1 -1
  28. package/dist/badge/index.mjs +10 -11
  29. package/dist/badge/index.mjs.map +1 -1
  30. package/dist/breadcrumb/index.js +1 -1
  31. package/dist/breadcrumb/index.mjs +2 -2
  32. package/dist/button/Button.styles.d.ts +1 -1
  33. package/dist/button/index.js +1 -1
  34. package/dist/button/index.mjs +1 -1
  35. package/dist/button/variants/contrast.d.ts +0 -4
  36. package/dist/button/variants/filled.d.ts +0 -4
  37. package/dist/button/variants/ghost.d.ts +0 -4
  38. package/dist/button/variants/outlined.d.ts +0 -4
  39. package/dist/button/variants/tinted.d.ts +0 -4
  40. package/dist/card/Backdrop.d.ts +1 -1
  41. package/dist/card/Card.styles.d.ts +1 -1
  42. package/dist/card/Content.styles.d.ts +1 -1
  43. package/dist/card/index.js +1 -1
  44. package/dist/card/index.js.map +1 -1
  45. package/dist/card/index.mjs +12 -31
  46. package/dist/card/index.mjs.map +1 -1
  47. package/dist/carousel/CarouselPageIndicator.d.ts +1 -1
  48. package/dist/carousel/index.js +1 -1
  49. package/dist/carousel/index.js.map +1 -1
  50. package/dist/carousel/index.mjs +29 -29
  51. package/dist/carousel/index.mjs.map +1 -1
  52. package/dist/checkbox/CheckboxInput.styles.d.ts +1 -1
  53. package/dist/checkbox/index.js +1 -1
  54. package/dist/checkbox/index.js.map +1 -1
  55. package/dist/checkbox/index.mjs +26 -33
  56. package/dist/checkbox/index.mjs.map +1 -1
  57. package/dist/chip/Chip.styles.d.ts +1 -1
  58. package/dist/chip/index.js +1 -1
  59. package/dist/chip/index.js.map +1 -1
  60. package/dist/chip/index.mjs +33 -68
  61. package/dist/chip/index.mjs.map +1 -1
  62. package/dist/chip/variants/dashed.d.ts +0 -4
  63. package/dist/chip/variants/outlined.d.ts +0 -4
  64. package/dist/chip/variants/tinted.d.ts +0 -4
  65. package/dist/combobox/index.js +1 -1
  66. package/dist/combobox/index.mjs +3 -3
  67. package/dist/dialog/index.js +1 -1
  68. package/dist/dialog/index.mjs +2 -2
  69. package/dist/drawer/index.js +1 -1
  70. package/dist/drawer/index.mjs +2 -2
  71. package/dist/dropdown/index.js +1 -1
  72. package/dist/dropdown/index.mjs +1 -1
  73. package/dist/file-upload/index.js +1 -1
  74. package/dist/file-upload/index.js.map +1 -1
  75. package/dist/file-upload/index.mjs +4 -4
  76. package/dist/file-upload/index.mjs.map +1 -1
  77. package/dist/form-field/index.js +1 -1
  78. package/dist/form-field/index.mjs +1 -1
  79. package/dist/icon/Icon.styles.d.ts +1 -1
  80. package/dist/icon/index.js +1 -1
  81. package/dist/icon/index.mjs +1 -1
  82. package/dist/icon-button/index.js +1 -1
  83. package/dist/icon-button/index.mjs +1 -1
  84. package/dist/input/index.js +1 -1
  85. package/dist/input/index.mjs +1 -1
  86. package/dist/pagination/index.js +1 -1
  87. package/dist/pagination/index.mjs +3 -3
  88. package/dist/popover/PopoverContent.styles.d.ts +1 -1
  89. package/dist/popover/PopoverContext.d.ts +1 -1
  90. package/dist/popover/index.js +1 -1
  91. package/dist/popover/index.js.map +1 -1
  92. package/dist/popover/index.mjs +33 -35
  93. package/dist/popover/index.mjs.map +1 -1
  94. package/dist/progress/ProgressIndicator.d.ts +1 -1
  95. package/dist/progress/index.js +1 -1
  96. package/dist/progress/index.js.map +1 -1
  97. package/dist/progress/index.mjs +42 -43
  98. package/dist/progress/index.mjs.map +1 -1
  99. package/dist/progress-tracker/ProgressTrackerStep.styles.d.ts +1 -1
  100. package/dist/progress-tracker/ProgressTrackerStepIndicator.styles.d.ts +1 -1
  101. package/dist/progress-tracker/index.js +1 -1
  102. package/dist/progress-tracker/index.js.map +1 -1
  103. package/dist/progress-tracker/index.mjs +38 -38
  104. package/dist/progress-tracker/index.mjs.map +1 -1
  105. package/dist/radio-group/RadioIndicator.styles.d.ts +1 -1
  106. package/dist/radio-group/RadioInput.styles.d.ts +1 -1
  107. package/dist/radio-group/index.js +1 -1
  108. package/dist/radio-group/index.js.map +1 -1
  109. package/dist/radio-group/index.mjs +47 -53
  110. package/dist/radio-group/index.mjs.map +1 -1
  111. package/dist/rating/index.js +1 -1
  112. package/dist/rating/index.mjs +1 -1
  113. package/dist/rating-display/index.js +1 -1
  114. package/dist/rating-display/index.mjs +1 -1
  115. package/dist/scrolling-list/index.js +1 -1
  116. package/dist/scrolling-list/index.mjs +3 -3
  117. package/dist/segmented-gauge/SegmentedGauge.d.ts +1 -1
  118. package/dist/segmented-gauge/SegmentedGaugeContext.d.ts +1 -1
  119. package/dist/segmented-gauge/index.js +1 -1
  120. package/dist/segmented-gauge/index.js.map +1 -1
  121. package/dist/segmented-gauge/index.mjs +14 -16
  122. package/dist/segmented-gauge/index.mjs.map +1 -1
  123. package/dist/select/index.js +1 -1
  124. package/dist/select/index.mjs +1 -1
  125. package/dist/slider/SliderThumb.styles.d.ts +1 -1
  126. package/dist/slider/SliderTrack.styles.d.ts +1 -1
  127. package/dist/slider/index.js +1 -1
  128. package/dist/slider/index.js.map +1 -1
  129. package/dist/slider/index.mjs +3 -5
  130. package/dist/slider/index.mjs.map +1 -1
  131. package/dist/snackbar/SnackbarItem.styles.d.ts +1 -1
  132. package/dist/snackbar/index.js +1 -1
  133. package/dist/snackbar/index.js.map +1 -1
  134. package/dist/snackbar/index.mjs +24 -35
  135. package/dist/snackbar/index.mjs.map +1 -1
  136. package/dist/snackbar/snackbarVariants.d.ts +0 -8
  137. package/dist/spinner/Spinner.styles.d.ts +1 -1
  138. package/dist/spinner/index.js +1 -1
  139. package/dist/spinner/index.mjs +1 -1
  140. package/dist/stepper/index.js +1 -1
  141. package/dist/stepper/index.mjs +2 -2
  142. package/dist/switch/SwitchInput.styles.d.ts +1 -1
  143. package/dist/switch/index.js +1 -1
  144. package/dist/switch/index.js.map +1 -1
  145. package/dist/switch/index.mjs +22 -23
  146. package/dist/switch/index.mjs.map +1 -1
  147. package/dist/tabs/TabsTrigger.styles.d.ts +1 -1
  148. package/dist/tabs/index.js +1 -1
  149. package/dist/tabs/index.js.map +1 -1
  150. package/dist/tabs/index.mjs +20 -21
  151. package/dist/tabs/index.mjs.map +1 -1
  152. package/dist/tag/Tag.styles.d.ts +1 -1
  153. package/dist/tag/index.js +1 -1
  154. package/dist/tag/index.js.map +1 -1
  155. package/dist/tag/index.mjs +15 -31
  156. package/dist/tag/index.mjs.map +1 -1
  157. package/dist/tag/variants/filled.d.ts +0 -4
  158. package/dist/tag/variants/outlined.d.ts +0 -4
  159. package/dist/tag/variants/tinted.d.ts +0 -4
  160. package/dist/text-link/TextLink.d.ts +1 -1
  161. package/dist/text-link/index.js +1 -1
  162. package/dist/text-link/index.mjs +1 -1
  163. package/dist/toast/Toast.styles.d.ts +1 -1
  164. package/dist/toast/index.js +1 -1
  165. package/dist/toast/index.js.map +1 -1
  166. package/dist/toast/index.mjs +25 -37
  167. package/dist/toast/index.mjs.map +1 -1
  168. package/dist/toast/types.d.ts +1 -1
  169. package/package.json +4 -4
  170. package/dist/Button-B6rA3-e5.js +0 -2
  171. package/dist/Button-B6rA3-e5.js.map +0 -1
  172. package/dist/Button-DPncfbbM.mjs.map +0 -1
  173. package/dist/Icon-C23-htlD.mjs.map +0 -1
  174. package/dist/Icon-CF0W0LKr.js +0 -2
  175. package/dist/Icon-CF0W0LKr.js.map +0 -1
  176. package/dist/Spinner-_Kffli3B.js +0 -2
  177. package/dist/Spinner-_Kffli3B.js.map +0 -1
  178. package/dist/Spinner-aLrtE2JN.mjs.map +0 -1
  179. package/dist/TextLink-C3xDLsbC.js +0 -2
  180. package/dist/TextLink-C3xDLsbC.js.map +0 -1
  181. package/dist/TextLink-D7mOCjY_.mjs.map +0 -1
@@ -4,11 +4,11 @@ import { createContext as at, useContext as ot, useState as st, useRef as w, use
4
4
  import { createPortal as dt } from "react-dom";
5
5
  import { useToast as mt, useToastRegion as ut } from "@react-aria/toast";
6
6
  import { cva as B, cx as V } from "class-variance-authority";
7
- import { B as pt } from "../Button-DPncfbbM.mjs";
7
+ import { B as pt } from "../Button-1M9DcZl0.mjs";
8
8
  import { Close as gt } from "@spark-ui/icons/Close";
9
- import { I as F } from "../Icon-C23-htlD.mjs";
10
- import { I as bt } from "../IconButton-Bfd-6BAD.mjs";
11
- const ft = [
9
+ import { I as F } from "../Icon-BO327oHU.mjs";
10
+ import { I as ft } from "../IconButton-DdB3Pq13.mjs";
11
+ const bt = [
12
12
  {
13
13
  design: "filled",
14
14
  intent: "success",
@@ -39,11 +39,6 @@ const ft = [
39
39
  intent: "main",
40
40
  class: ["bg-main text-on-main"]
41
41
  },
42
- {
43
- design: "filled",
44
- intent: "basic",
45
- class: ["bg-basic text-on-basic"]
46
- },
47
42
  {
48
43
  design: "filled",
49
44
  intent: "support",
@@ -90,11 +85,6 @@ const ft = [
90
85
  intent: "main",
91
86
  class: ["bg-main-container text-on-main-container"]
92
87
  },
93
- {
94
- design: "tinted",
95
- intent: "basic",
96
- class: ["bg-basic-container text-on-basic-container"]
97
- },
98
88
  {
99
89
  design: "tinted",
100
90
  intent: "support",
@@ -178,13 +168,12 @@ const ft = [
178
168
  info: "",
179
169
  neutral: "",
180
170
  main: "",
181
- basic: "",
182
171
  support: "",
183
172
  accent: "",
184
173
  inverse: ""
185
174
  }
186
175
  },
187
- compoundVariants: [...ft, ...xt],
176
+ compoundVariants: [...bt, ...xt],
188
177
  defaultVariants: {
189
178
  design: "filled",
190
179
  intent: "neutral"
@@ -228,7 +217,7 @@ const ft = [
228
217
  ref: d,
229
218
  ...m
230
219
  }) => {
231
- const { toast: i, state: o } = O(), a = e ?? i.content.intent, b = t ?? i.content.design;
220
+ const { toast: i, state: o } = O(), a = e ?? i.content.intent, f = t ?? i.content.design;
232
221
  return /* @__PURE__ */ g(
233
222
  pt,
234
223
  {
@@ -240,7 +229,7 @@ const ft = [
240
229
  design: "ghost",
241
230
  intent: "surface"
242
231
  } : {
243
- design: b,
232
+ design: f,
244
233
  intent: a === "error" ? "danger" : a
245
234
  },
246
235
  onClick: (x) => {
@@ -263,9 +252,9 @@ const I = ({
263
252
  ref: d,
264
253
  ...m
265
254
  }) => {
266
- const { toast: i, state: o } = O(), a = e ?? i.content.intent, b = t ?? i.content.design;
255
+ const { toast: i, state: o } = O(), a = e ?? i.content.intent, f = t ?? i.content.design;
267
256
  return /* @__PURE__ */ g(
268
- bt,
257
+ ft,
269
258
  {
270
259
  "data-spark-component": "snackbar-item-close",
271
260
  ref: d,
@@ -275,7 +264,7 @@ const I = ({
275
264
  design: "ghost",
276
265
  intent: "surface"
277
266
  } : {
278
- design: b,
267
+ design: f,
279
268
  intent: a === "error" ? "danger" : a
280
269
  },
281
270
  "aria-label": n,
@@ -313,25 +302,25 @@ const Y = 75, St = ({
313
302
  onSwipeEnd: c,
314
303
  threshold: d = 10
315
304
  }) => {
316
- const [m, i] = st(), o = w(null), a = w(null), b = w(null), x = (s) => {
305
+ const [m, i] = st(), o = w(null), a = w(null), f = w(null), x = (s) => {
317
306
  a.current = { x: s.clientX, y: s.clientY }, document.addEventListener("selectstart", (u) => u.preventDefault());
318
307
  }, y = (s) => {
319
308
  if (!a.current) return;
320
- const u = Math.abs(s.clientX - a.current.x), f = Math.abs(s.clientY - a.current.y);
309
+ const u = Math.abs(s.clientX - a.current.x), b = Math.abs(s.clientY - a.current.y);
321
310
  let l;
322
- u > f && u > d ? o.current = s.clientX > a.current.x ? "right" : "left" : f > d && (o.current = s.clientY > a.current.y ? "down" : "up"), o.current && (b.current ? (l = "move", b.current = { x: u, y: f }, t.current.style.setProperty(
311
+ u > b && u > d ? o.current = s.clientX > a.current.x ? "right" : "left" : b > d && (o.current = s.clientY > a.current.y ? "down" : "up"), o.current && (f.current ? (l = "move", f.current = { x: u, y: b }, t.current.style.setProperty(
323
312
  "--swipe-position-x",
324
- `${u > f ? s.clientX - a.current.x : 0}px`
313
+ `${u > b ? s.clientX - a.current.x : 0}px`
325
314
  ), t.current.style.setProperty(
326
315
  "--swipe-position-y",
327
- `${u > f ? 0 : s.clientY - a.current.y}px`
328
- ), n?.({ state: l, direction: o.current })) : (l = "start", b.current = { x: u, y: f }, e?.({ state: l, direction: o.current })), i(l));
316
+ `${u > b ? 0 : s.clientY - a.current.y}px`
317
+ ), n?.({ state: l, direction: o.current })) : (l = "start", f.current = { x: u, y: b }, e?.({ state: l, direction: o.current })), i(l));
329
318
  }, p = () => {
330
- const s = b.current;
331
- if (a.current = null, b.current = null, s) {
332
- const { x: u, y: f } = s;
319
+ const s = f.current;
320
+ if (a.current = null, f.current = null, s) {
321
+ const { x: u, y: b } = s;
333
322
  let l;
334
- u > f ? u > Y ? (l = "end", c?.({ state: l, direction: o.current })) : (l = "cancel", r?.({ state: l, direction: o.current })) : f > Y ? (l = "end", c?.({ state: l, direction: o.current })) : (l = "cancel", r?.({ state: l, direction: o.current })), i(l), document.removeEventListener("selectstart", (v) => v.preventDefault());
323
+ u > b ? u > Y ? (l = "end", c?.({ state: l, direction: o.current })) : (l = "cancel", r?.({ state: l, direction: o.current })) : b > Y ? (l = "end", c?.({ state: l, direction: o.current })) : (l = "cancel", r?.({ state: l, direction: o.current })), i(l), document.removeEventListener("selectstart", (v) => v.preventDefault());
335
324
  }
336
325
  };
337
326
  return z(() => {
@@ -355,9 +344,9 @@ const Y = 75, St = ({
355
344
  className: i,
356
345
  children: o,
357
346
  ref: a,
358
- ...b
347
+ ...f
359
348
  }) => {
360
- const x = w(null), y = typeof a != "function" && a || x, { toast: p, state: s } = O(), { state: u, direction: f } = St({
349
+ const x = w(null), y = typeof a != "function" && a || x, { toast: p, state: s } = O(), { state: u, direction: b } = St({
361
350
  swipeRef: y,
362
351
  onSwipeStart: s.pauseAll,
363
352
  onSwipeCancel: s.resumeAll,
@@ -389,7 +378,7 @@ const Y = 75, St = ({
389
378
  "data-animation": p.animation,
390
379
  ...!(u === "cancel" && p.animation === "exiting") && {
391
380
  "data-swipe": u,
392
- "data-swipe-direction": f
381
+ "data-swipe-direction": b
393
382
  },
394
383
  ...p.animation === "exiting" && {
395
384
  // Remove snackbar when the exiting animation completes
@@ -397,7 +386,7 @@ const Y = 75, St = ({
397
386
  },
398
387
  ref: y,
399
388
  ...q,
400
- ...b,
389
+ ...f,
401
390
  children: /* @__PURE__ */ et("div", { className: wt({ actionOnNewline: M }), ...U, children: [
402
391
  L(W, v ? N : null, {
403
392
  children: v
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/snackbar/snackbarVariants.ts","../../src/snackbar/SnackbarItem.styles.ts","../../src/snackbar/SnackbarItemContext.tsx","../../src/snackbar/SnackbarItemAction.tsx","../../src/snackbar/SnackbarItemClose.tsx","../../src/snackbar/SnackbarItemIcon.tsx","../../src/snackbar/useSwipe.ts","../../src/snackbar/SnackbarItem.tsx","../../src/snackbar/SnackbarRegion.styles.ts","../../src/snackbar/SnackbarRegion.tsx","../../src/snackbar/useSnackbarGlobalStore.ts","../../src/snackbar/Snackbar.tsx","../../src/snackbar/index.ts"],"sourcesContent":["export const filledVariants = [\n {\n design: 'filled',\n intent: 'success',\n class: ['bg-success text-on-success'],\n },\n {\n design: 'filled',\n intent: 'alert',\n class: ['bg-alert text-on-alert'],\n },\n {\n design: 'filled',\n intent: 'error',\n class: ['bg-error text-on-error'],\n },\n {\n design: 'filled',\n intent: 'info',\n class: ['bg-info text-on-info'],\n },\n {\n design: 'filled',\n intent: 'neutral',\n class: ['bg-neutral text-on-neutral'],\n },\n {\n design: 'filled',\n intent: 'main',\n class: ['bg-main text-on-main'],\n },\n {\n design: 'filled',\n intent: 'basic',\n class: ['bg-basic text-on-basic'],\n },\n {\n design: 'filled',\n intent: 'support',\n class: ['bg-support text-on-support'],\n },\n {\n design: 'filled',\n intent: 'accent',\n class: ['bg-accent text-on-accent'],\n },\n {\n design: 'filled',\n intent: 'inverse',\n class: ['bg-surface-inverse text-on-surface-inverse'],\n },\n] as const\n\nexport const tintedVariants = [\n {\n design: 'tinted',\n intent: 'success',\n class: ['bg-success-container text-on-success-container'],\n },\n {\n design: 'tinted',\n intent: 'alert',\n class: ['bg-alert-container text-on-alert-container'],\n },\n {\n design: 'tinted',\n intent: 'error',\n class: ['bg-error-container text-on-error-container'],\n },\n {\n design: 'tinted',\n intent: 'info',\n class: ['bg-info-container text-on-info-container'],\n },\n {\n design: 'tinted',\n intent: 'neutral',\n class: ['bg-neutral-container text-on-neutral-container'],\n },\n {\n design: 'tinted',\n intent: 'main',\n class: ['bg-main-container text-on-main-container'],\n },\n {\n design: 'tinted',\n intent: 'basic',\n class: ['bg-basic-container text-on-basic-container'],\n },\n {\n design: 'tinted',\n intent: 'support',\n class: ['bg-support-container text-on-support-container'],\n },\n {\n design: 'tinted',\n intent: 'accent',\n class: ['bg-accent-container text-on-accent-container'],\n },\n {\n design: 'tinted',\n intent: 'inverse',\n class: ['bg-surface-inverse text-on-surface-inverse'],\n },\n] as const\n","import { cva, VariantProps } from 'class-variance-authority'\n\nimport { filledVariants, tintedVariants } from './snackbarVariants'\n\nexport const snackbarItemVariant = cva(\n [\n 'rounded-md shadow-sm',\n 'max-w-[600px]',\n 'cursor-default pointer-events-auto touch-none select-none',\n 'absolute',\n /**\n * Focus\n */\n 'group-focus-visible:outline-hidden group-focus-visible:u-outline group-not-focus-visible:ring-inset',\n /**\n * Positionning\n */\n 'group-data-[position=bottom]:bottom-0 group-data-[position=bottom-left]:bottom-0 group-data-[position=bottom-right]:bottom-0',\n 'group-data-[position=top]:top-0 group-data-[position=top-left]:top-0 group-data-[position=top-right]:top-0',\n /**\n * Animation and opacity\n */\n 'animation-duration-400',\n '[animation-fill-mode: forwards]!',\n 'data-[animation=queued]:animate-fade-in',\n 'data-[animation=entering]:animation-ease-decelerate-back',\n 'data-[animation=exiting]:animation-ease-accelerate',\n // Parent position bottom|bottom-left|bottom-right\n 'data-[animation=entering]:group-data-[position=bottom]:[&:not([data-swipe])]:animate-slide-in-bottom',\n 'data-[animation=exiting]:opacity-0 data-[animation=exiting]:transition-opacity',\n 'data-[animation=exiting]:group-data-[position=bottom]:[&:not([data-swipe])]:animate-slide-out-bottom',\n 'data-[animation=entering]:group-data-[position=bottom-left]:[&:not([data-swipe])]:animate-slide-in-bottom',\n 'data-[animation=exiting]:group-data-[position=bottom-left]:[&:not([data-swipe])]:animate-slide-out-bottom',\n 'data-[animation=entering]:group-data-[position=bottom-right]:[&:not([data-swipe])]:animate-slide-in-bottom',\n 'data-[animation=exiting]:group-data-[position=bottom-right]:[&:not([data-swipe])]:animate-slide-out-bottom',\n // Parent position top|top-left|top-right\n 'data-[animation=entering]:group-data-[position=top]:[&:not([data-swipe])]:animate-slide-in-top',\n 'data-[animation=exiting]:group-data-[position=top]:[&:not([data-swipe])]:animate-slide-out-top',\n 'data-[animation=entering]:group-data-[position=top-left]:[&:not([data-swipe])]:animate-slide-in-top',\n 'data-[animation=exiting]:group-data-[position=top-left]:[&:not([data-swipe])]:animate-slide-out-top',\n 'data-[animation=entering]:group-data-[position=top-right]:[&:not([data-swipe])]:animate-slide-in-top',\n 'data-[animation=exiting]:group-data-[position=top-right]:[&:not([data-swipe])]:animate-slide-out-top',\n /**\n * Swipe\n */\n 'data-[swipe=move]:data-[swipe-direction=right]:translate-x-(--swipe-position-x)',\n 'data-[swipe=move]:data-[swipe-direction=left]:translate-x-(--swipe-position-x)',\n 'data-[swipe=cancel]:translate-x-0',\n 'data-[swipe=end]:data-[swipe-direction=right]:animate-standalone-swipe-out-right',\n 'data-[swipe=end]:data-[swipe-direction=left]:animate-standalone-swipe-out-left',\n ],\n {\n variants: {\n /**\n * Set different look and feel\n * @default 'filled'\n */\n design: {\n filled: '',\n tinted: '',\n },\n /**\n * Set color intent\n * @default 'neutral'\n */\n intent: {\n success: '',\n alert: '',\n error: '',\n info: '',\n neutral: '',\n main: '',\n basic: '',\n support: '',\n accent: '',\n inverse: '',\n },\n },\n compoundVariants: [...filledVariants, ...tintedVariants],\n defaultVariants: {\n design: 'filled',\n intent: 'neutral',\n },\n }\n)\n\nexport const snackbarItemVariantContent = cva(\n [\n 'inline-grid items-center',\n 'col-start-1 row-start-1',\n 'pl-md pr-lg', // applying padding on the parent prevents VoiceOver on Safari from reading snackbar content 🤷\n ],\n {\n variants: {\n /**\n * Force action button displaying on a new line\n * @default false\n */\n actionOnNewline: {\n true: [\n 'grid-rows-[52px_1fr_52px]',\n 'grid-cols-[min-content_1fr_min-content]',\n \"[grid-template-areas:'icon_message_close'_'._message_.'_'action_action_action']\",\n ],\n false: [\n 'grid-cols-[min-content_1fr_min-content_min-content]',\n \"[grid-template-areas:'icon_message_action_close']\",\n ],\n },\n },\n defaultVariants: {\n actionOnNewline: false,\n },\n }\n)\n\nexport type SnackbarItemVariantProps = VariantProps<typeof snackbarItemVariant>\nexport type SnackbarItemVariantContentProps = VariantProps<typeof snackbarItemVariantContent>\n","import { QueuedToast, ToastState } from '@react-stately/toast'\nimport { createContext, useContext } from 'react'\n\nimport type { SnackbarItemValue } from './SnackbarItem'\n\nexport interface SnackbarItemState<T = SnackbarItemValue> {\n toast: QueuedToast<T>\n state: ToastState<T>\n}\n\nexport const SnackbarItemContext = createContext<SnackbarItemState>({} as SnackbarItemState)\n\nexport const useSnackbarItemContext = () => useContext(SnackbarItemContext)\n","import { cx } from 'class-variance-authority'\nimport { Ref } from 'react'\n\nimport { Button, type ButtonProps } from '../button'\nimport type { SnackbarItemVariantProps } from './SnackbarItem.styles'\nimport { useSnackbarItemContext } from './SnackbarItemContext'\n\nexport type SnackbarItemActionProps = Omit<ButtonProps, 'size' | 'shape' | 'intent'> &\n SnackbarItemVariantProps & {\n ref?: Ref<HTMLButtonElement>\n }\n\nexport const SnackbarItemAction = ({\n design: designProp = 'filled',\n intent: intentProp = 'neutral',\n onClick,\n children,\n className,\n ref,\n ...rest\n}: SnackbarItemActionProps) => {\n const { toast, state } = useSnackbarItemContext()\n\n const intent = intentProp ?? toast.content.intent\n const design = designProp ?? toast.content.design\n\n return (\n <Button\n data-spark-component=\"snackbar-item-action\"\n ref={ref}\n size=\"md\"\n shape=\"rounded\"\n {...(intent === 'inverse'\n ? {\n design: 'ghost',\n intent: 'surface',\n }\n : {\n design,\n intent: intent === 'error' ? 'danger' : intent,\n })}\n onClick={e => {\n onClick?.(e)\n state.close(toast.key)\n }}\n style={{ gridArea: 'action', ...rest.style }}\n className={cx('ml-md justify-self-end', className)}\n {...rest}\n >\n {children}\n </Button>\n )\n}\n\nSnackbarItemAction.displayName = 'Snackbar.ItemAction'\n","import { Close } from '@spark-ui/icons/Close'\nimport { cx } from 'class-variance-authority'\nimport { type ComponentPropsWithRef } from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton, type IconButtonProps } from '../icon-button'\nimport type { SnackbarItemVariantProps } from './SnackbarItem.styles'\nimport { useSnackbarItemContext } from './SnackbarItemContext'\n\nexport interface SnackbarItemCloseProps\n extends Omit<ComponentPropsWithRef<'button'>, 'aria-label' | 'disabled'>,\n Pick<IconButtonProps, 'aria-label'>,\n SnackbarItemVariantProps {}\n\nexport const SnackbarItemClose = ({\n design: designProp = 'filled',\n intent: intentProp = 'neutral',\n 'aria-label': ariaLabel,\n onClick,\n className,\n ref,\n ...rest\n}: SnackbarItemCloseProps) => {\n const { toast, state } = useSnackbarItemContext()\n\n const intent = intentProp ?? toast.content.intent\n const design = designProp ?? toast.content.design\n\n return (\n <IconButton\n data-spark-component=\"snackbar-item-close\"\n ref={ref}\n size=\"md\"\n shape=\"rounded\"\n {...(intent === 'inverse'\n ? {\n design: 'ghost',\n intent: 'surface',\n }\n : {\n design,\n intent: intent === 'error' ? 'danger' : intent,\n })}\n aria-label={ariaLabel}\n onClick={e => {\n onClick?.(e)\n state.close(toast.key)\n }}\n style={{ gridArea: 'close', ...rest.style }}\n className={cx('ml-md justify-self-end', className)}\n {...rest}\n >\n <Icon size=\"sm\">\n <Close />\n </Icon>\n </IconButton>\n )\n}\n\nSnackbarItemClose.displayName = 'Snackbar.ItemClose'\n","import { cx } from 'class-variance-authority'\nimport type { ReactElement } from 'react'\n\nimport { Icon, type IconProps } from '../icon'\n\nexport type SnackbarItemIconProps = IconProps\n\nexport const SnackbarItemIcon = ({\n children,\n className,\n ...rest\n}: SnackbarItemIconProps): ReactElement => (\n <Icon\n size=\"md\"\n className={cx('mx-md', className)}\n style={{ gridArea: 'icon', ...rest.style }}\n {...rest}\n >\n {children}\n </Icon>\n)\n\nSnackbarItemIcon.displayName = 'Snackbar.ItemIcon'\n","/* eslint-disable complexity */\nimport { type RefObject, useEffect, useRef, useState } from 'react'\n\ninterface SwipeArgs<T> {\n swipeRef: RefObject<T | null>\n onSwipeStart?: ({ state, direction }: SwipeReturn) => void\n onSwipeMove?: ({ state, direction }: SwipeReturn) => void\n onSwipeCancel?: ({ state, direction }: SwipeReturn) => void\n onSwipeEnd?: ({ state, direction }: SwipeReturn) => void\n threshold?: number\n}\n\ninterface SwipeReturn {\n state?: 'start' | 'move' | 'cancel' | 'end'\n direction?: 'up' | 'down' | 'right' | 'left' | null\n}\n\nconst SWIPE_THRESHOLD = 75\n\nexport const useSwipe = <T extends HTMLElement>({\n swipeRef,\n onSwipeStart,\n onSwipeMove,\n onSwipeCancel,\n onSwipeEnd,\n threshold = 10,\n}: SwipeArgs<T>): SwipeReturn => {\n const [state, setState] = useState<SwipeReturn['state']>()\n\n const direction = useRef<SwipeReturn['direction']>(null)\n const origin = useRef<Record<'x' | 'y', number> | null>(null)\n const delta = useRef<Record<'x' | 'y', number> | null>(null)\n\n const handleSwipeStart = (evt: PointerEvent) => {\n origin.current = { x: evt.clientX, y: evt.clientY }\n\n /**\n * Prevents unwanted text selection in Safari browser (longpress)\n */\n document.addEventListener('selectstart', e => e.preventDefault())\n }\n\n const handleSwipeMove = (evt: PointerEvent) => {\n if (!origin.current) return\n\n const deltaX = Math.abs(evt.clientX - origin.current.x)\n const deltaY = Math.abs(evt.clientY - origin.current.y)\n\n let moveState: SwipeReturn['state']\n\n if (deltaX > deltaY && deltaX > threshold) {\n direction.current = evt.clientX > origin.current.x ? 'right' : 'left'\n } else if (deltaY > threshold) {\n direction.current = evt.clientY > origin.current.y ? 'down' : 'up'\n }\n\n /**\n * If no direction could be defined, then no move should be handled.\n * This is particularly true with trackpads working with MacOS/Windows.\n */\n if (!direction.current) return\n\n if (!delta.current) {\n moveState = 'start'\n delta.current = { x: deltaX, y: deltaY }\n onSwipeStart?.({ state: moveState, direction: direction.current })\n } else {\n moveState = 'move'\n delta.current = { x: deltaX, y: deltaY }\n ;(swipeRef.current as T).style.setProperty(\n '--swipe-position-x',\n `${deltaX > deltaY ? evt.clientX - origin.current.x : 0}px`\n )\n ;(swipeRef.current as T).style.setProperty(\n '--swipe-position-y',\n `${!(deltaX > deltaY) ? evt.clientY - origin.current.y : 0}px`\n )\n onSwipeMove?.({ state: moveState, direction: direction.current })\n }\n\n setState(moveState)\n }\n\n const handleSwipeEnd = () => {\n const proxyDelta = delta.current\n\n origin.current = null\n delta.current = null\n\n if (proxyDelta) {\n const { x: deltaX, y: deltaY } = proxyDelta\n\n let endState: SwipeReturn['state']\n\n if (deltaX > deltaY) {\n if (deltaX > SWIPE_THRESHOLD) {\n endState = 'end'\n onSwipeEnd?.({ state: endState, direction: direction.current })\n } else {\n endState = 'cancel'\n onSwipeCancel?.({ state: endState, direction: direction.current })\n }\n } else {\n if (deltaY > SWIPE_THRESHOLD) {\n endState = 'end'\n onSwipeEnd?.({ state: endState, direction: direction.current })\n } else {\n endState = 'cancel'\n onSwipeCancel?.({ state: endState, direction: direction.current })\n }\n }\n\n setState(endState)\n\n /**\n * Prevents unwanted text selection in Safari browser (longpress)\n */\n document.removeEventListener('selectstart', e => e.preventDefault())\n }\n }\n\n useEffect(() => {\n if (!swipeRef.current) return\n\n const swipeElement = swipeRef.current\n\n swipeElement.addEventListener('pointerdown', handleSwipeStart)\n document.addEventListener('pointermove', handleSwipeMove)\n document.addEventListener('pointerup', handleSwipeEnd)\n\n return () => {\n swipeElement.removeEventListener('pointerdown', handleSwipeStart)\n document.removeEventListener('pointermove', handleSwipeMove)\n document.removeEventListener('pointerup', handleSwipeEnd)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n return {\n state,\n direction: direction.current,\n }\n}\n","/* eslint-disable max-lines-per-function */\n\nimport { useToast } from '@react-aria/toast'\nimport {\n Children,\n cloneElement,\n type ComponentPropsWithRef,\n type FC,\n isValidElement,\n type PropsWithChildren,\n type ReactElement,\n type ReactNode,\n useCallback,\n useRef,\n} from 'react'\n\nimport {\n snackbarItemVariant,\n snackbarItemVariantContent,\n type SnackbarItemVariantContentProps,\n type SnackbarItemVariantProps,\n} from './SnackbarItem.styles'\nimport { SnackbarItemAction, SnackbarItemActionProps } from './SnackbarItemAction'\nimport { SnackbarItemClose, SnackbarItemCloseProps } from './SnackbarItemClose'\nimport { useSnackbarItemContext } from './SnackbarItemContext'\nimport { SnackbarItemIcon, SnackbarItemIconProps } from './SnackbarItemIcon'\nimport { useSwipe } from './useSwipe'\n\nexport interface SnackbarItemValue extends SnackbarItemVariantProps {\n /**\n * Icon that will be prepended before snackbar message\n */\n icon?: ReactNode\n message: ReactNode\n /**\n * If `true` snackbar will display a close button\n * @default false\n */\n isClosable?: boolean\n /**\n * A label for the action button within the toast.\n */\n actionLabel?: string\n /**\n * Handler that is called when the action button is pressed.\n */\n onAction?: () => void\n /**\n * If `true` the action button will be displayed on a new line.\n * @default false\n */\n actionOnNewline?: boolean\n}\n\nexport interface SnackbarItemProps\n extends ComponentPropsWithRef<'div'>,\n SnackbarItemVariantProps,\n SnackbarItemVariantContentProps {\n /**\n * Defines a string value that labels the current element.\n */\n 'aria-label'?: string\n /**\n * Identifies the element (or elements) that labels the current element.\n */\n 'aria-labelledby'?: string\n /**\n * Identifies the element (or elements) that describes the object.\n */\n 'aria-describedby'?: string\n /**\n * Identifies the element (or elements) that provide a detailed, extended description for the object.\n */\n 'aria-details'?: string\n}\n\nexport const SnackbarItem = ({\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'aria-details': ariaDetails,\n design: designProp,\n intent: intentProp,\n actionOnNewline: actionOnNewlineProp,\n className,\n children,\n ref: forwardedRef,\n ...rest\n}: PropsWithChildren<SnackbarItemProps>) => {\n const innerRef = useRef(null)\n const ref = typeof forwardedRef !== 'function' ? forwardedRef || innerRef : innerRef\n\n const { toast, state } = useSnackbarItemContext()\n\n const { state: swipeState, direction: swipeDirection } = useSwipe({\n swipeRef: ref,\n onSwipeStart: state.pauseAll,\n onSwipeCancel: state.resumeAll,\n onSwipeEnd: ({ direction }) => {\n ;['left', 'right'].includes(`${direction}`) && state.close(toast.key)\n },\n })\n\n const { message, icon, isClosable, onAction, actionLabel } = toast.content\n const intent = intentProp ?? toast.content.intent\n const design = designProp ?? toast.content.design\n const actionOnNewline = actionOnNewlineProp ?? toast.content.actionOnNewline\n\n const ariaProps = {\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n ariaDetails,\n }\n\n const { toastProps, titleProps, closeButtonProps, contentProps } = useToast(\n { toast, ...ariaProps },\n state,\n ref\n )\n\n const findElement = useCallback(\n <P extends object>(elementDisplayName: string): ReactElement<P> | undefined => {\n const childrenArray = Children.toArray(children)\n\n const match = childrenArray\n .filter(isValidElement)\n .find(\n (child): child is ReactElement<P> =>\n !!(child.type as FC<P> & { displayName?: string }).displayName?.includes(\n elementDisplayName\n )\n )\n\n return match as ReactElement<P> | undefined\n },\n [children]\n )\n\n const iconFromChildren = findElement<SnackbarItemIconProps>('Snackbar.ItemIcon')\n const actionBtnFromChildren = findElement<SnackbarItemActionProps>('Snackbar.ItemAction')\n const closeBtnFromChildren = findElement<SnackbarItemCloseProps>('Snackbar.ItemClose')\n\n return (\n <div\n data-spark-component=\"snackbar-item\"\n className={snackbarItemVariant({ design, intent, className })}\n data-animation={toast.animation}\n {...(!(swipeState === 'cancel' && toast.animation === 'exiting') && {\n 'data-swipe': swipeState,\n 'data-swipe-direction': swipeDirection,\n })}\n {...(toast.animation === 'exiting' && {\n // Remove snackbar when the exiting animation completes\n onAnimationEnd: () => state.remove(toast.key),\n })}\n ref={ref}\n {...toastProps}\n {...rest}\n >\n <div className={snackbarItemVariantContent({ actionOnNewline })} {...contentProps}>\n {/* 1. ICON */}\n {renderSubComponent(iconFromChildren, icon ? SnackbarItemIcon : null, {\n children: icon,\n })}\n\n {/* 2. MESSAGE */}\n <p\n className=\"px-md py-lg text-body-2 row-span-3\"\n style={{ gridArea: 'message' }}\n {...titleProps}\n >\n {message}\n </p>\n\n {/* 3. ACTION BUTTON */}\n {renderSubComponent(\n actionBtnFromChildren,\n actionLabel && onAction ? SnackbarItemAction : null,\n { intent, design, onClick: onAction, children: actionLabel }\n )}\n\n {/* 4. CLOSE BUTTON */}\n {renderSubComponent(closeBtnFromChildren, isClosable ? SnackbarItemClose : null, {\n intent,\n design,\n /**\n * React Spectrum typing of aria-label is inaccurate, and aria-label value should never be undefined.\n * See https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/i18n/src/useLocalizedStringFormatter.ts#L40\n */\n 'aria-label': closeButtonProps['aria-label'] as string,\n })}\n </div>\n </div>\n )\n}\n\nSnackbarItem.displayName = 'Snackbar.Item'\n\n/**\n * Returns compound item if found in children prop.\n * If not fallbacks to default item, conditionned by addSnackbar options.\n */\nconst renderSubComponent = <P extends object>(\n childItem?: ReactElement<P>,\n defaultItem?: FC<P> | null,\n props?: P\n) => {\n if (childItem) {\n return cloneElement(childItem, { ...props, ...childItem.props })\n } else if (defaultItem) {\n const Item = defaultItem\n\n return <Item {...(props as P)} />\n } else {\n return null\n }\n}\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const snackbarRegionVariant = cva(\n [\n 'fixed inset-x-lg z-toast group',\n 'outline-hidden pointer-events-none',\n 'grid grid-rows-1 grid-cols-1 gap-lg',\n ],\n {\n variants: {\n /**\n * Set snackbar item position\n * @default 'bottom'\n */\n position: {\n top: 'top-lg justify-items-center',\n 'top-right': 'top-lg justify-items-end',\n 'top-left': 'top-lg justify-items-start',\n bottom: 'bottom-lg justify-items-center',\n 'bottom-right': 'bottom-lg justify-items-end',\n 'bottom-left': 'bottom-lg justify-items-start',\n },\n },\n defaultVariants: {\n position: 'bottom',\n },\n }\n)\n\nexport type SnackbarRegionVariantProps = VariantProps<typeof snackbarRegionVariant>\n","import { type AriaToastRegionProps, useToastRegion } from '@react-aria/toast'\nimport { cloneElement, type ComponentPropsWithRef, type ReactElement, useRef } from 'react'\n\nimport { SnackbarItem, type SnackbarItemProps } from './SnackbarItem'\nimport { SnackbarItemContext, type SnackbarItemState } from './SnackbarItemContext'\nimport { snackbarRegionVariant, type SnackbarRegionVariantProps } from './SnackbarRegion.styles'\n\nexport interface SnackbarRegionProps\n extends ComponentPropsWithRef<'div'>,\n AriaToastRegionProps,\n SnackbarRegionVariantProps,\n Pick<SnackbarItemState, 'state'> {\n /**\n * An accessibility label for the snackbar region.\n * @default 'Notifications'\n */\n 'aria-label'?: string\n /**\n * Identifies the element (or elements) that labels the current element.\n */\n 'aria-labelledby'?: string\n /**\n * Identifies the element (or elements) that describes the object.\n */\n 'aria-describedby'?: string\n /**\n * Identifies the element (or elements) that provide a detailed, extended description for the object.\n */\n 'aria-details'?: string\n /**\n * The component/template used to display each snackbar from the queue\n * @default 'Snackbar.Item'\n */\n children?: ReactElement<SnackbarItemProps, typeof SnackbarItem>\n}\n\nexport const SnackbarRegion = ({\n children = <SnackbarItem />,\n state,\n position = 'bottom',\n className,\n ref: forwardedRef,\n ...rest\n}: SnackbarRegionProps): ReactElement => {\n const innerRef = useRef<HTMLDivElement>(null)\n const ref = forwardedRef && typeof forwardedRef !== 'function' ? forwardedRef : innerRef\n\n const { regionProps } = useToastRegion(rest, state, ref)\n\n return (\n <div\n {...regionProps}\n ref={ref}\n data-position={position}\n className={snackbarRegionVariant({ position, className })}\n >\n {state.visibleToasts.map(toast => (\n <SnackbarItemContext.Provider key={toast.key} value={{ toast, state }}>\n {cloneElement(children, { key: toast.key })}\n </SnackbarItemContext.Provider>\n ))}\n </div>\n )\n}\n","import { type RefObject, useCallback, useSyncExternalStore } from 'react'\n\ninterface UseSnackbarGlobalStoreArgs<T> {\n providers: Set<T>\n subscriptions: Set<() => void>\n}\n\ninterface UseSnackbarGlobalStoreReturn<T> {\n provider: T\n addProvider: (ref: T) => void\n deleteProvider: (ref: T) => void\n}\n\n/**\n * This hook is a basic abstraction of useSyncExternalStore hook which allows us\n * to consume data from an external data store.\n *\n * Cf. https://react.dev/reference/react/useSyncExternalStore#subscribing-to-an-external-store\n */\n\nexport const useSnackbarGlobalStore = <T = RefObject<HTMLDivElement | null>>({\n providers,\n subscriptions,\n}: UseSnackbarGlobalStoreArgs<T>): UseSnackbarGlobalStoreReturn<T> => {\n const subscribe = useCallback(\n (listener: () => void) => {\n subscriptions.add(listener)\n\n return () => subscriptions.delete(listener)\n },\n [subscriptions]\n )\n\n const getLastSnackbarProvider = useCallback(() => [...providers].reverse()[0] as T, [providers])\n\n const addProvider = useCallback(\n (provider: T) => {\n providers.add(provider)\n\n for (const subscribeFn of subscriptions) {\n subscribeFn()\n }\n },\n [providers, subscriptions]\n )\n\n const deleteProvider = useCallback(\n (provider: T) => {\n providers.delete(provider)\n\n for (const subscribeFn of subscriptions) {\n subscribeFn()\n }\n },\n [providers, subscriptions]\n )\n\n const provider = useSyncExternalStore(subscribe, getLastSnackbarProvider, getLastSnackbarProvider)\n\n return {\n provider,\n addProvider,\n deleteProvider,\n }\n}\n","import {\n type ToastOptions as SnackBarItemOptions,\n ToastQueue,\n useToastQueue,\n} from '@react-stately/toast'\nimport { type ReactElement, Ref, type RefObject, useEffect, useRef } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { type SnackbarItemValue } from './SnackbarItem'\nimport { SnackbarRegion, type SnackbarRegionProps } from './SnackbarRegion'\nimport { useSnackbarGlobalStore } from './useSnackbarGlobalStore'\n\n/**\n * We define here a global queue thanks to dedicated util from React Spectrum.\n * It is based on React `useSyncExternalStore` and allows us to consume data from\n * an external data store, and thus preventing use of React context that could\n * lead to unwanted rerenderings. It also simplifies initial implementation.\n */\nlet GLOBAL_SNACKBAR_QUEUE: ToastQueue<SnackbarItemValue> | null = null\n\nconst getGlobalSnackBarQueue = () => {\n if (!GLOBAL_SNACKBAR_QUEUE) {\n GLOBAL_SNACKBAR_QUEUE = new ToastQueue({\n maxVisibleToasts: 1,\n hasExitAnimation: true,\n })\n }\n\n return GLOBAL_SNACKBAR_QUEUE\n}\n\nexport const clearSnackbarQueue = () => {\n GLOBAL_SNACKBAR_QUEUE = null\n}\n\n/**\n * We define a global store to keep track of all providers instances, to ensure\n * we always have a single Snackbar container.\n */\nconst GLOBAL_SNACKBAR_STORE = {\n providers: new Set<RefObject<HTMLDivElement | null>>(),\n subscriptions: new Set<() => void>(),\n}\n\nexport type SnackbarProps = Omit<SnackbarRegionProps, 'state'> & {\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Snackbar = ({ ref: forwardedRef, ...props }: SnackbarProps): ReactElement | null => {\n const ref = useRef<HTMLDivElement>(null)\n\n const state = useToastQueue(getGlobalSnackBarQueue())\n\n const { provider, addProvider, deleteProvider } = useSnackbarGlobalStore(GLOBAL_SNACKBAR_STORE)\n\n useEffect(() => {\n addProvider(ref)\n\n return () => {\n for (const toast of getGlobalSnackBarQueue().visibleToasts) {\n toast.animation = undefined\n }\n\n deleteProvider(ref)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n return ref === provider && state.visibleToasts.length > 0\n ? createPortal(<SnackbarRegion ref={forwardedRef} state={state} {...props} />, document.body)\n : null\n}\n\nSnackbar.displayName = 'Snackbar'\n\nexport interface AddSnackbarArgs extends SnackbarItemValue, Omit<SnackBarItemOptions, 'timeout'> {\n /**\n * Handler that is called when the snackbar is closed, either by the user\n * or after a timeout.\n */\n onClose?: () => void\n /**\n * A timeout to automatically close the snackbar after, in milliseconds.\n * @default 5000\n */\n timeout?: number | null\n /**\n * The priority of the snackbar relative to other snackbars. Larger numbers indicate higher priority.\n */\n priority?: number\n}\n\nexport const addSnackbar = ({ onClose, timeout = 5000, priority, ...content }: AddSnackbarArgs) => {\n const queue = getGlobalSnackBarQueue()\n\n queue.add(content, {\n onClose,\n timeout: timeout && !content.onAction ? Math.max(timeout, 5000) : undefined,\n priority,\n })\n}\n","import {\n addSnackbar,\n type AddSnackbarArgs,\n clearSnackbarQueue,\n Snackbar as Root,\n type SnackbarProps,\n} from './Snackbar'\nimport { SnackbarItem as Item, type SnackbarItemProps } from './SnackbarItem'\nimport {\n SnackbarItemAction as ItemAction,\n type SnackbarItemActionProps,\n} from './SnackbarItemAction'\nimport { SnackbarItemClose as ItemClose, type SnackbarItemCloseProps } from './SnackbarItemClose'\nimport { SnackbarItemIcon as ItemIcon, type SnackbarItemIconProps } from './SnackbarItemIcon'\n\nexport const Snackbar: typeof Root & {\n Item: typeof Item\n ItemAction: typeof ItemAction\n ItemClose: typeof ItemClose\n ItemIcon: typeof ItemIcon\n} = Object.assign(Root, {\n Item,\n ItemAction,\n ItemClose,\n ItemIcon,\n})\n\nSnackbar.displayName = 'Snackbar'\nItem.displayName = 'Snackbar.Item'\nItemAction.displayName = 'Snackbar.ItemAction'\nItemClose.displayName = 'Snackbar.ItemClose'\nItemIcon.displayName = 'Snackbar.ItemIcon'\n\nexport type {\n SnackbarProps,\n SnackbarItemProps,\n SnackbarItemActionProps,\n SnackbarItemCloseProps,\n SnackbarItemIconProps,\n AddSnackbarArgs,\n}\nexport { addSnackbar, clearSnackbarQueue }\n"],"names":["filledVariants","tintedVariants","snackbarItemVariant","cva","snackbarItemVariantContent","SnackbarItemContext","createContext","useSnackbarItemContext","useContext","SnackbarItemAction","designProp","intentProp","onClick","children","className","ref","rest","toast","state","intent","design","jsx","Button","e","cx","SnackbarItemClose","ariaLabel","IconButton","Icon","Close","SnackbarItemIcon","SWIPE_THRESHOLD","useSwipe","swipeRef","onSwipeStart","onSwipeMove","onSwipeCancel","onSwipeEnd","threshold","setState","useState","direction","useRef","origin","delta","handleSwipeStart","evt","handleSwipeMove","deltaX","deltaY","moveState","handleSwipeEnd","proxyDelta","endState","useEffect","swipeElement","SnackbarItem","ariaLabelledby","ariaDescribedby","ariaDetails","actionOnNewlineProp","forwardedRef","innerRef","swipeState","swipeDirection","message","icon","isClosable","onAction","actionLabel","actionOnNewline","ariaProps","toastProps","titleProps","closeButtonProps","contentProps","useToast","findElement","useCallback","elementDisplayName","Children","isValidElement","child","iconFromChildren","actionBtnFromChildren","closeBtnFromChildren","jsxs","renderSubComponent","childItem","defaultItem","props","cloneElement","snackbarRegionVariant","SnackbarRegion","position","regionProps","useToastRegion","useSnackbarGlobalStore","providers","subscriptions","subscribe","listener","getLastSnackbarProvider","addProvider","provider","subscribeFn","deleteProvider","useSyncExternalStore","GLOBAL_SNACKBAR_QUEUE","getGlobalSnackBarQueue","ToastQueue","clearSnackbarQueue","GLOBAL_SNACKBAR_STORE","Snackbar","useToastQueue","createPortal","addSnackbar","onClose","timeout","priority","content","Root","Item","ItemAction","ItemClose","ItemIcon"],"mappings":";;;;;;;;;;AAAO,MAAMA,KAAiB;AAAA,EAC5B;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO,CAAC,4BAA4B;AAAA,EAAA;AAAA,EAEtC;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO,CAAC,wBAAwB;AAAA,EAAA;AAAA,EAElC;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO,CAAC,wBAAwB;AAAA,EAAA;AAAA,EAElC;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO,CAAC,sBAAsB;AAAA,EAAA;AAAA,EAEhC;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO,CAAC,4BAA4B;AAAA,EAAA;AAAA,EAEtC;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO,CAAC,sBAAsB;AAAA,EAAA;AAAA,EAEhC;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO,CAAC,wBAAwB;AAAA,EAAA;AAAA,EAElC;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO,CAAC,4BAA4B;AAAA,EAAA;AAAA,EAEtC;AAAA,IACE,QAAQ;A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EC,CAAA,CAAE,GAEEA,MAAQyF,KAAYtF,EAAM,cAAc,SAAS,IACpDiG,GAAa,gBAAA9F,EAACwE,IAAA,EAAe,KAAKhC,GAAc,OAAA3C,GAAe,GAAGwE,GAAO,GAAI,SAAS,IAAI,IAC1F;AACN;AAEAuB,EAAS,cAAc;AAmBhB,MAAMG,KAAc,CAAC,EAAE,SAAAC,GAAS,SAAAC,IAAU,KAAM,UAAAC,GAAU,GAAGC,QAA+B;AAGjG,EAFcX,EAAA,EAER,IAAIW,GAAS;AAAA,IACjB,SAAAH;AAAA,IACA,SAASC,KAAW,CAACE,EAAQ,WAAW,KAAK,IAAIF,GAAS,GAAI,IAAI;AAAA,IAClE,UAAAC;AAAA,EAAA,CACD;AACH,GCrFaN,KAKT,OAAO,OAAOQ,GAAM;AAAA,EAAA,MACtBC;AAAAA,EAAA,YACAC;AAAAA,EAAA,WACAC;AAAAA,EAAA,UACAC;AACF,CAAC;AAEDZ,GAAS,cAAc;AACvBS,EAAK,cAAc;AACnBC,EAAW,cAAc;AACzBC,EAAU,cAAc;AACxBC,EAAS,cAAc;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/snackbar/snackbarVariants.ts","../../src/snackbar/SnackbarItem.styles.ts","../../src/snackbar/SnackbarItemContext.tsx","../../src/snackbar/SnackbarItemAction.tsx","../../src/snackbar/SnackbarItemClose.tsx","../../src/snackbar/SnackbarItemIcon.tsx","../../src/snackbar/useSwipe.ts","../../src/snackbar/SnackbarItem.tsx","../../src/snackbar/SnackbarRegion.styles.ts","../../src/snackbar/SnackbarRegion.tsx","../../src/snackbar/useSnackbarGlobalStore.ts","../../src/snackbar/Snackbar.tsx","../../src/snackbar/index.ts"],"sourcesContent":["export const filledVariants = [\n {\n design: 'filled',\n intent: 'success',\n class: ['bg-success text-on-success'],\n },\n {\n design: 'filled',\n intent: 'alert',\n class: ['bg-alert text-on-alert'],\n },\n {\n design: 'filled',\n intent: 'error',\n class: ['bg-error text-on-error'],\n },\n {\n design: 'filled',\n intent: 'info',\n class: ['bg-info text-on-info'],\n },\n {\n design: 'filled',\n intent: 'neutral',\n class: ['bg-neutral text-on-neutral'],\n },\n {\n design: 'filled',\n intent: 'main',\n class: ['bg-main text-on-main'],\n },\n {\n design: 'filled',\n intent: 'support',\n class: ['bg-support text-on-support'],\n },\n {\n design: 'filled',\n intent: 'accent',\n class: ['bg-accent text-on-accent'],\n },\n {\n design: 'filled',\n intent: 'inverse',\n class: ['bg-surface-inverse text-on-surface-inverse'],\n },\n] as const\n\nexport const tintedVariants = [\n {\n design: 'tinted',\n intent: 'success',\n class: ['bg-success-container text-on-success-container'],\n },\n {\n design: 'tinted',\n intent: 'alert',\n class: ['bg-alert-container text-on-alert-container'],\n },\n {\n design: 'tinted',\n intent: 'error',\n class: ['bg-error-container text-on-error-container'],\n },\n {\n design: 'tinted',\n intent: 'info',\n class: ['bg-info-container text-on-info-container'],\n },\n {\n design: 'tinted',\n intent: 'neutral',\n class: ['bg-neutral-container text-on-neutral-container'],\n },\n {\n design: 'tinted',\n intent: 'main',\n class: ['bg-main-container text-on-main-container'],\n },\n {\n design: 'tinted',\n intent: 'support',\n class: ['bg-support-container text-on-support-container'],\n },\n {\n design: 'tinted',\n intent: 'accent',\n class: ['bg-accent-container text-on-accent-container'],\n },\n {\n design: 'tinted',\n intent: 'inverse',\n class: ['bg-surface-inverse text-on-surface-inverse'],\n },\n] as const\n","import { cva, VariantProps } from 'class-variance-authority'\n\nimport { filledVariants, tintedVariants } from './snackbarVariants'\n\nexport const snackbarItemVariant = cva(\n [\n 'rounded-md shadow-sm',\n 'max-w-[600px]',\n 'cursor-default pointer-events-auto touch-none select-none',\n 'absolute',\n /**\n * Focus\n */\n 'group-focus-visible:outline-hidden group-focus-visible:u-outline group-not-focus-visible:ring-inset',\n /**\n * Positionning\n */\n 'group-data-[position=bottom]:bottom-0 group-data-[position=bottom-left]:bottom-0 group-data-[position=bottom-right]:bottom-0',\n 'group-data-[position=top]:top-0 group-data-[position=top-left]:top-0 group-data-[position=top-right]:top-0',\n /**\n * Animation and opacity\n */\n 'animation-duration-400',\n '[animation-fill-mode: forwards]!',\n 'data-[animation=queued]:animate-fade-in',\n 'data-[animation=entering]:animation-ease-decelerate-back',\n 'data-[animation=exiting]:animation-ease-accelerate',\n // Parent position bottom|bottom-left|bottom-right\n 'data-[animation=entering]:group-data-[position=bottom]:[&:not([data-swipe])]:animate-slide-in-bottom',\n 'data-[animation=exiting]:opacity-0 data-[animation=exiting]:transition-opacity',\n 'data-[animation=exiting]:group-data-[position=bottom]:[&:not([data-swipe])]:animate-slide-out-bottom',\n 'data-[animation=entering]:group-data-[position=bottom-left]:[&:not([data-swipe])]:animate-slide-in-bottom',\n 'data-[animation=exiting]:group-data-[position=bottom-left]:[&:not([data-swipe])]:animate-slide-out-bottom',\n 'data-[animation=entering]:group-data-[position=bottom-right]:[&:not([data-swipe])]:animate-slide-in-bottom',\n 'data-[animation=exiting]:group-data-[position=bottom-right]:[&:not([data-swipe])]:animate-slide-out-bottom',\n // Parent position top|top-left|top-right\n 'data-[animation=entering]:group-data-[position=top]:[&:not([data-swipe])]:animate-slide-in-top',\n 'data-[animation=exiting]:group-data-[position=top]:[&:not([data-swipe])]:animate-slide-out-top',\n 'data-[animation=entering]:group-data-[position=top-left]:[&:not([data-swipe])]:animate-slide-in-top',\n 'data-[animation=exiting]:group-data-[position=top-left]:[&:not([data-swipe])]:animate-slide-out-top',\n 'data-[animation=entering]:group-data-[position=top-right]:[&:not([data-swipe])]:animate-slide-in-top',\n 'data-[animation=exiting]:group-data-[position=top-right]:[&:not([data-swipe])]:animate-slide-out-top',\n /**\n * Swipe\n */\n 'data-[swipe=move]:data-[swipe-direction=right]:translate-x-(--swipe-position-x)',\n 'data-[swipe=move]:data-[swipe-direction=left]:translate-x-(--swipe-position-x)',\n 'data-[swipe=cancel]:translate-x-0',\n 'data-[swipe=end]:data-[swipe-direction=right]:animate-standalone-swipe-out-right',\n 'data-[swipe=end]:data-[swipe-direction=left]:animate-standalone-swipe-out-left',\n ],\n {\n variants: {\n /**\n * Set different look and feel\n * @default 'filled'\n */\n design: {\n filled: '',\n tinted: '',\n },\n /**\n * Set color intent\n * @default 'neutral'\n */\n intent: {\n success: '',\n alert: '',\n error: '',\n info: '',\n neutral: '',\n main: '',\n support: '',\n accent: '',\n inverse: '',\n },\n },\n compoundVariants: [...filledVariants, ...tintedVariants],\n defaultVariants: {\n design: 'filled',\n intent: 'neutral',\n },\n }\n)\n\nexport const snackbarItemVariantContent = cva(\n [\n 'inline-grid items-center',\n 'col-start-1 row-start-1',\n 'pl-md pr-lg', // applying padding on the parent prevents VoiceOver on Safari from reading snackbar content 🤷\n ],\n {\n variants: {\n /**\n * Force action button displaying on a new line\n * @default false\n */\n actionOnNewline: {\n true: [\n 'grid-rows-[52px_1fr_52px]',\n 'grid-cols-[min-content_1fr_min-content]',\n \"[grid-template-areas:'icon_message_close'_'._message_.'_'action_action_action']\",\n ],\n false: [\n 'grid-cols-[min-content_1fr_min-content_min-content]',\n \"[grid-template-areas:'icon_message_action_close']\",\n ],\n },\n },\n defaultVariants: {\n actionOnNewline: false,\n },\n }\n)\n\nexport type SnackbarItemVariantProps = VariantProps<typeof snackbarItemVariant>\nexport type SnackbarItemVariantContentProps = VariantProps<typeof snackbarItemVariantContent>\n","import { QueuedToast, ToastState } from '@react-stately/toast'\nimport { createContext, useContext } from 'react'\n\nimport type { SnackbarItemValue } from './SnackbarItem'\n\nexport interface SnackbarItemState<T = SnackbarItemValue> {\n toast: QueuedToast<T>\n state: ToastState<T>\n}\n\nexport const SnackbarItemContext = createContext<SnackbarItemState>({} as SnackbarItemState)\n\nexport const useSnackbarItemContext = () => useContext(SnackbarItemContext)\n","import { cx } from 'class-variance-authority'\nimport { Ref } from 'react'\n\nimport { Button, type ButtonProps } from '../button'\nimport type { SnackbarItemVariantProps } from './SnackbarItem.styles'\nimport { useSnackbarItemContext } from './SnackbarItemContext'\n\nexport type SnackbarItemActionProps = Omit<ButtonProps, 'size' | 'shape' | 'intent'> &\n SnackbarItemVariantProps & {\n ref?: Ref<HTMLButtonElement>\n }\n\nexport const SnackbarItemAction = ({\n design: designProp = 'filled',\n intent: intentProp = 'neutral',\n onClick,\n children,\n className,\n ref,\n ...rest\n}: SnackbarItemActionProps) => {\n const { toast, state } = useSnackbarItemContext()\n\n const intent = intentProp ?? toast.content.intent\n const design = designProp ?? toast.content.design\n\n return (\n <Button\n data-spark-component=\"snackbar-item-action\"\n ref={ref}\n size=\"md\"\n shape=\"rounded\"\n {...(intent === 'inverse'\n ? {\n design: 'ghost',\n intent: 'surface',\n }\n : {\n design,\n intent: intent === 'error' ? 'danger' : intent,\n })}\n onClick={e => {\n onClick?.(e)\n state.close(toast.key)\n }}\n style={{ gridArea: 'action', ...rest.style }}\n className={cx('ml-md justify-self-end', className)}\n {...rest}\n >\n {children}\n </Button>\n )\n}\n\nSnackbarItemAction.displayName = 'Snackbar.ItemAction'\n","import { Close } from '@spark-ui/icons/Close'\nimport { cx } from 'class-variance-authority'\nimport { type ComponentPropsWithRef } from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton, type IconButtonProps } from '../icon-button'\nimport type { SnackbarItemVariantProps } from './SnackbarItem.styles'\nimport { useSnackbarItemContext } from './SnackbarItemContext'\n\nexport interface SnackbarItemCloseProps\n extends Omit<ComponentPropsWithRef<'button'>, 'aria-label' | 'disabled'>,\n Pick<IconButtonProps, 'aria-label'>,\n SnackbarItemVariantProps {}\n\nexport const SnackbarItemClose = ({\n design: designProp = 'filled',\n intent: intentProp = 'neutral',\n 'aria-label': ariaLabel,\n onClick,\n className,\n ref,\n ...rest\n}: SnackbarItemCloseProps) => {\n const { toast, state } = useSnackbarItemContext()\n\n const intent = intentProp ?? toast.content.intent\n const design = designProp ?? toast.content.design\n\n return (\n <IconButton\n data-spark-component=\"snackbar-item-close\"\n ref={ref}\n size=\"md\"\n shape=\"rounded\"\n {...(intent === 'inverse'\n ? {\n design: 'ghost',\n intent: 'surface',\n }\n : {\n design,\n intent: intent === 'error' ? 'danger' : intent,\n })}\n aria-label={ariaLabel}\n onClick={e => {\n onClick?.(e)\n state.close(toast.key)\n }}\n style={{ gridArea: 'close', ...rest.style }}\n className={cx('ml-md justify-self-end', className)}\n {...rest}\n >\n <Icon size=\"sm\">\n <Close />\n </Icon>\n </IconButton>\n )\n}\n\nSnackbarItemClose.displayName = 'Snackbar.ItemClose'\n","import { cx } from 'class-variance-authority'\nimport type { ReactElement } from 'react'\n\nimport { Icon, type IconProps } from '../icon'\n\nexport type SnackbarItemIconProps = IconProps\n\nexport const SnackbarItemIcon = ({\n children,\n className,\n ...rest\n}: SnackbarItemIconProps): ReactElement => (\n <Icon\n size=\"md\"\n className={cx('mx-md', className)}\n style={{ gridArea: 'icon', ...rest.style }}\n {...rest}\n >\n {children}\n </Icon>\n)\n\nSnackbarItemIcon.displayName = 'Snackbar.ItemIcon'\n","/* eslint-disable complexity */\nimport { type RefObject, useEffect, useRef, useState } from 'react'\n\ninterface SwipeArgs<T> {\n swipeRef: RefObject<T | null>\n onSwipeStart?: ({ state, direction }: SwipeReturn) => void\n onSwipeMove?: ({ state, direction }: SwipeReturn) => void\n onSwipeCancel?: ({ state, direction }: SwipeReturn) => void\n onSwipeEnd?: ({ state, direction }: SwipeReturn) => void\n threshold?: number\n}\n\ninterface SwipeReturn {\n state?: 'start' | 'move' | 'cancel' | 'end'\n direction?: 'up' | 'down' | 'right' | 'left' | null\n}\n\nconst SWIPE_THRESHOLD = 75\n\nexport const useSwipe = <T extends HTMLElement>({\n swipeRef,\n onSwipeStart,\n onSwipeMove,\n onSwipeCancel,\n onSwipeEnd,\n threshold = 10,\n}: SwipeArgs<T>): SwipeReturn => {\n const [state, setState] = useState<SwipeReturn['state']>()\n\n const direction = useRef<SwipeReturn['direction']>(null)\n const origin = useRef<Record<'x' | 'y', number> | null>(null)\n const delta = useRef<Record<'x' | 'y', number> | null>(null)\n\n const handleSwipeStart = (evt: PointerEvent) => {\n origin.current = { x: evt.clientX, y: evt.clientY }\n\n /**\n * Prevents unwanted text selection in Safari browser (longpress)\n */\n document.addEventListener('selectstart', e => e.preventDefault())\n }\n\n const handleSwipeMove = (evt: PointerEvent) => {\n if (!origin.current) return\n\n const deltaX = Math.abs(evt.clientX - origin.current.x)\n const deltaY = Math.abs(evt.clientY - origin.current.y)\n\n let moveState: SwipeReturn['state']\n\n if (deltaX > deltaY && deltaX > threshold) {\n direction.current = evt.clientX > origin.current.x ? 'right' : 'left'\n } else if (deltaY > threshold) {\n direction.current = evt.clientY > origin.current.y ? 'down' : 'up'\n }\n\n /**\n * If no direction could be defined, then no move should be handled.\n * This is particularly true with trackpads working with MacOS/Windows.\n */\n if (!direction.current) return\n\n if (!delta.current) {\n moveState = 'start'\n delta.current = { x: deltaX, y: deltaY }\n onSwipeStart?.({ state: moveState, direction: direction.current })\n } else {\n moveState = 'move'\n delta.current = { x: deltaX, y: deltaY }\n ;(swipeRef.current as T).style.setProperty(\n '--swipe-position-x',\n `${deltaX > deltaY ? evt.clientX - origin.current.x : 0}px`\n )\n ;(swipeRef.current as T).style.setProperty(\n '--swipe-position-y',\n `${!(deltaX > deltaY) ? evt.clientY - origin.current.y : 0}px`\n )\n onSwipeMove?.({ state: moveState, direction: direction.current })\n }\n\n setState(moveState)\n }\n\n const handleSwipeEnd = () => {\n const proxyDelta = delta.current\n\n origin.current = null\n delta.current = null\n\n if (proxyDelta) {\n const { x: deltaX, y: deltaY } = proxyDelta\n\n let endState: SwipeReturn['state']\n\n if (deltaX > deltaY) {\n if (deltaX > SWIPE_THRESHOLD) {\n endState = 'end'\n onSwipeEnd?.({ state: endState, direction: direction.current })\n } else {\n endState = 'cancel'\n onSwipeCancel?.({ state: endState, direction: direction.current })\n }\n } else {\n if (deltaY > SWIPE_THRESHOLD) {\n endState = 'end'\n onSwipeEnd?.({ state: endState, direction: direction.current })\n } else {\n endState = 'cancel'\n onSwipeCancel?.({ state: endState, direction: direction.current })\n }\n }\n\n setState(endState)\n\n /**\n * Prevents unwanted text selection in Safari browser (longpress)\n */\n document.removeEventListener('selectstart', e => e.preventDefault())\n }\n }\n\n useEffect(() => {\n if (!swipeRef.current) return\n\n const swipeElement = swipeRef.current\n\n swipeElement.addEventListener('pointerdown', handleSwipeStart)\n document.addEventListener('pointermove', handleSwipeMove)\n document.addEventListener('pointerup', handleSwipeEnd)\n\n return () => {\n swipeElement.removeEventListener('pointerdown', handleSwipeStart)\n document.removeEventListener('pointermove', handleSwipeMove)\n document.removeEventListener('pointerup', handleSwipeEnd)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n return {\n state,\n direction: direction.current,\n }\n}\n","/* eslint-disable max-lines-per-function */\n\nimport { useToast } from '@react-aria/toast'\nimport {\n Children,\n cloneElement,\n type ComponentPropsWithRef,\n type FC,\n isValidElement,\n type PropsWithChildren,\n type ReactElement,\n type ReactNode,\n useCallback,\n useRef,\n} from 'react'\n\nimport {\n snackbarItemVariant,\n snackbarItemVariantContent,\n type SnackbarItemVariantContentProps,\n type SnackbarItemVariantProps,\n} from './SnackbarItem.styles'\nimport { SnackbarItemAction, SnackbarItemActionProps } from './SnackbarItemAction'\nimport { SnackbarItemClose, SnackbarItemCloseProps } from './SnackbarItemClose'\nimport { useSnackbarItemContext } from './SnackbarItemContext'\nimport { SnackbarItemIcon, SnackbarItemIconProps } from './SnackbarItemIcon'\nimport { useSwipe } from './useSwipe'\n\nexport interface SnackbarItemValue extends SnackbarItemVariantProps {\n /**\n * Icon that will be prepended before snackbar message\n */\n icon?: ReactNode\n message: ReactNode\n /**\n * If `true` snackbar will display a close button\n * @default false\n */\n isClosable?: boolean\n /**\n * A label for the action button within the toast.\n */\n actionLabel?: string\n /**\n * Handler that is called when the action button is pressed.\n */\n onAction?: () => void\n /**\n * If `true` the action button will be displayed on a new line.\n * @default false\n */\n actionOnNewline?: boolean\n}\n\nexport interface SnackbarItemProps\n extends ComponentPropsWithRef<'div'>,\n SnackbarItemVariantProps,\n SnackbarItemVariantContentProps {\n /**\n * Defines a string value that labels the current element.\n */\n 'aria-label'?: string\n /**\n * Identifies the element (or elements) that labels the current element.\n */\n 'aria-labelledby'?: string\n /**\n * Identifies the element (or elements) that describes the object.\n */\n 'aria-describedby'?: string\n /**\n * Identifies the element (or elements) that provide a detailed, extended description for the object.\n */\n 'aria-details'?: string\n}\n\nexport const SnackbarItem = ({\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'aria-details': ariaDetails,\n design: designProp,\n intent: intentProp,\n actionOnNewline: actionOnNewlineProp,\n className,\n children,\n ref: forwardedRef,\n ...rest\n}: PropsWithChildren<SnackbarItemProps>) => {\n const innerRef = useRef(null)\n const ref = typeof forwardedRef !== 'function' ? forwardedRef || innerRef : innerRef\n\n const { toast, state } = useSnackbarItemContext()\n\n const { state: swipeState, direction: swipeDirection } = useSwipe({\n swipeRef: ref,\n onSwipeStart: state.pauseAll,\n onSwipeCancel: state.resumeAll,\n onSwipeEnd: ({ direction }) => {\n ;['left', 'right'].includes(`${direction}`) && state.close(toast.key)\n },\n })\n\n const { message, icon, isClosable, onAction, actionLabel } = toast.content\n const intent = intentProp ?? toast.content.intent\n const design = designProp ?? toast.content.design\n const actionOnNewline = actionOnNewlineProp ?? toast.content.actionOnNewline\n\n const ariaProps = {\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n ariaDetails,\n }\n\n const { toastProps, titleProps, closeButtonProps, contentProps } = useToast(\n { toast, ...ariaProps },\n state,\n ref\n )\n\n const findElement = useCallback(\n <P extends object>(elementDisplayName: string): ReactElement<P> | undefined => {\n const childrenArray = Children.toArray(children)\n\n const match = childrenArray\n .filter(isValidElement)\n .find(\n (child): child is ReactElement<P> =>\n !!(child.type as FC<P> & { displayName?: string }).displayName?.includes(\n elementDisplayName\n )\n )\n\n return match as ReactElement<P> | undefined\n },\n [children]\n )\n\n const iconFromChildren = findElement<SnackbarItemIconProps>('Snackbar.ItemIcon')\n const actionBtnFromChildren = findElement<SnackbarItemActionProps>('Snackbar.ItemAction')\n const closeBtnFromChildren = findElement<SnackbarItemCloseProps>('Snackbar.ItemClose')\n\n return (\n <div\n data-spark-component=\"snackbar-item\"\n className={snackbarItemVariant({ design, intent, className })}\n data-animation={toast.animation}\n {...(!(swipeState === 'cancel' && toast.animation === 'exiting') && {\n 'data-swipe': swipeState,\n 'data-swipe-direction': swipeDirection,\n })}\n {...(toast.animation === 'exiting' && {\n // Remove snackbar when the exiting animation completes\n onAnimationEnd: () => state.remove(toast.key),\n })}\n ref={ref}\n {...toastProps}\n {...rest}\n >\n <div className={snackbarItemVariantContent({ actionOnNewline })} {...contentProps}>\n {/* 1. ICON */}\n {renderSubComponent(iconFromChildren, icon ? SnackbarItemIcon : null, {\n children: icon,\n })}\n\n {/* 2. MESSAGE */}\n <p\n className=\"px-md py-lg text-body-2 row-span-3\"\n style={{ gridArea: 'message' }}\n {...titleProps}\n >\n {message}\n </p>\n\n {/* 3. ACTION BUTTON */}\n {renderSubComponent(\n actionBtnFromChildren,\n actionLabel && onAction ? SnackbarItemAction : null,\n { intent, design, onClick: onAction, children: actionLabel }\n )}\n\n {/* 4. CLOSE BUTTON */}\n {renderSubComponent(closeBtnFromChildren, isClosable ? SnackbarItemClose : null, {\n intent,\n design,\n /**\n * React Spectrum typing of aria-label is inaccurate, and aria-label value should never be undefined.\n * See https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/i18n/src/useLocalizedStringFormatter.ts#L40\n */\n 'aria-label': closeButtonProps['aria-label'] as string,\n })}\n </div>\n </div>\n )\n}\n\nSnackbarItem.displayName = 'Snackbar.Item'\n\n/**\n * Returns compound item if found in children prop.\n * If not fallbacks to default item, conditionned by addSnackbar options.\n */\nconst renderSubComponent = <P extends object>(\n childItem?: ReactElement<P>,\n defaultItem?: FC<P> | null,\n props?: P\n) => {\n if (childItem) {\n return cloneElement(childItem, { ...props, ...childItem.props })\n } else if (defaultItem) {\n const Item = defaultItem\n\n return <Item {...(props as P)} />\n } else {\n return null\n }\n}\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const snackbarRegionVariant = cva(\n [\n 'fixed inset-x-lg z-toast group',\n 'outline-hidden pointer-events-none',\n 'grid grid-rows-1 grid-cols-1 gap-lg',\n ],\n {\n variants: {\n /**\n * Set snackbar item position\n * @default 'bottom'\n */\n position: {\n top: 'top-lg justify-items-center',\n 'top-right': 'top-lg justify-items-end',\n 'top-left': 'top-lg justify-items-start',\n bottom: 'bottom-lg justify-items-center',\n 'bottom-right': 'bottom-lg justify-items-end',\n 'bottom-left': 'bottom-lg justify-items-start',\n },\n },\n defaultVariants: {\n position: 'bottom',\n },\n }\n)\n\nexport type SnackbarRegionVariantProps = VariantProps<typeof snackbarRegionVariant>\n","import { type AriaToastRegionProps, useToastRegion } from '@react-aria/toast'\nimport { cloneElement, type ComponentPropsWithRef, type ReactElement, useRef } from 'react'\n\nimport { SnackbarItem, type SnackbarItemProps } from './SnackbarItem'\nimport { SnackbarItemContext, type SnackbarItemState } from './SnackbarItemContext'\nimport { snackbarRegionVariant, type SnackbarRegionVariantProps } from './SnackbarRegion.styles'\n\nexport interface SnackbarRegionProps\n extends ComponentPropsWithRef<'div'>,\n AriaToastRegionProps,\n SnackbarRegionVariantProps,\n Pick<SnackbarItemState, 'state'> {\n /**\n * An accessibility label for the snackbar region.\n * @default 'Notifications'\n */\n 'aria-label'?: string\n /**\n * Identifies the element (or elements) that labels the current element.\n */\n 'aria-labelledby'?: string\n /**\n * Identifies the element (or elements) that describes the object.\n */\n 'aria-describedby'?: string\n /**\n * Identifies the element (or elements) that provide a detailed, extended description for the object.\n */\n 'aria-details'?: string\n /**\n * The component/template used to display each snackbar from the queue\n * @default 'Snackbar.Item'\n */\n children?: ReactElement<SnackbarItemProps, typeof SnackbarItem>\n}\n\nexport const SnackbarRegion = ({\n children = <SnackbarItem />,\n state,\n position = 'bottom',\n className,\n ref: forwardedRef,\n ...rest\n}: SnackbarRegionProps): ReactElement => {\n const innerRef = useRef<HTMLDivElement>(null)\n const ref = forwardedRef && typeof forwardedRef !== 'function' ? forwardedRef : innerRef\n\n const { regionProps } = useToastRegion(rest, state, ref)\n\n return (\n <div\n {...regionProps}\n ref={ref}\n data-position={position}\n className={snackbarRegionVariant({ position, className })}\n >\n {state.visibleToasts.map(toast => (\n <SnackbarItemContext.Provider key={toast.key} value={{ toast, state }}>\n {cloneElement(children, { key: toast.key })}\n </SnackbarItemContext.Provider>\n ))}\n </div>\n )\n}\n","import { type RefObject, useCallback, useSyncExternalStore } from 'react'\n\ninterface UseSnackbarGlobalStoreArgs<T> {\n providers: Set<T>\n subscriptions: Set<() => void>\n}\n\ninterface UseSnackbarGlobalStoreReturn<T> {\n provider: T\n addProvider: (ref: T) => void\n deleteProvider: (ref: T) => void\n}\n\n/**\n * This hook is a basic abstraction of useSyncExternalStore hook which allows us\n * to consume data from an external data store.\n *\n * Cf. https://react.dev/reference/react/useSyncExternalStore#subscribing-to-an-external-store\n */\n\nexport const useSnackbarGlobalStore = <T = RefObject<HTMLDivElement | null>>({\n providers,\n subscriptions,\n}: UseSnackbarGlobalStoreArgs<T>): UseSnackbarGlobalStoreReturn<T> => {\n const subscribe = useCallback(\n (listener: () => void) => {\n subscriptions.add(listener)\n\n return () => subscriptions.delete(listener)\n },\n [subscriptions]\n )\n\n const getLastSnackbarProvider = useCallback(() => [...providers].reverse()[0] as T, [providers])\n\n const addProvider = useCallback(\n (provider: T) => {\n providers.add(provider)\n\n for (const subscribeFn of subscriptions) {\n subscribeFn()\n }\n },\n [providers, subscriptions]\n )\n\n const deleteProvider = useCallback(\n (provider: T) => {\n providers.delete(provider)\n\n for (const subscribeFn of subscriptions) {\n subscribeFn()\n }\n },\n [providers, subscriptions]\n )\n\n const provider = useSyncExternalStore(subscribe, getLastSnackbarProvider, getLastSnackbarProvider)\n\n return {\n provider,\n addProvider,\n deleteProvider,\n }\n}\n","import {\n type ToastOptions as SnackBarItemOptions,\n ToastQueue,\n useToastQueue,\n} from '@react-stately/toast'\nimport { type ReactElement, Ref, type RefObject, useEffect, useRef } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { type SnackbarItemValue } from './SnackbarItem'\nimport { SnackbarRegion, type SnackbarRegionProps } from './SnackbarRegion'\nimport { useSnackbarGlobalStore } from './useSnackbarGlobalStore'\n\n/**\n * We define here a global queue thanks to dedicated util from React Spectrum.\n * It is based on React `useSyncExternalStore` and allows us to consume data from\n * an external data store, and thus preventing use of React context that could\n * lead to unwanted rerenderings. It also simplifies initial implementation.\n */\nlet GLOBAL_SNACKBAR_QUEUE: ToastQueue<SnackbarItemValue> | null = null\n\nconst getGlobalSnackBarQueue = () => {\n if (!GLOBAL_SNACKBAR_QUEUE) {\n GLOBAL_SNACKBAR_QUEUE = new ToastQueue({\n maxVisibleToasts: 1,\n hasExitAnimation: true,\n })\n }\n\n return GLOBAL_SNACKBAR_QUEUE\n}\n\nexport const clearSnackbarQueue = () => {\n GLOBAL_SNACKBAR_QUEUE = null\n}\n\n/**\n * We define a global store to keep track of all providers instances, to ensure\n * we always have a single Snackbar container.\n */\nconst GLOBAL_SNACKBAR_STORE = {\n providers: new Set<RefObject<HTMLDivElement | null>>(),\n subscriptions: new Set<() => void>(),\n}\n\nexport type SnackbarProps = Omit<SnackbarRegionProps, 'state'> & {\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Snackbar = ({ ref: forwardedRef, ...props }: SnackbarProps): ReactElement | null => {\n const ref = useRef<HTMLDivElement>(null)\n\n const state = useToastQueue(getGlobalSnackBarQueue())\n\n const { provider, addProvider, deleteProvider } = useSnackbarGlobalStore(GLOBAL_SNACKBAR_STORE)\n\n useEffect(() => {\n addProvider(ref)\n\n return () => {\n for (const toast of getGlobalSnackBarQueue().visibleToasts) {\n toast.animation = undefined\n }\n\n deleteProvider(ref)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n return ref === provider && state.visibleToasts.length > 0\n ? createPortal(<SnackbarRegion ref={forwardedRef} state={state} {...props} />, document.body)\n : null\n}\n\nSnackbar.displayName = 'Snackbar'\n\nexport interface AddSnackbarArgs extends SnackbarItemValue, Omit<SnackBarItemOptions, 'timeout'> {\n /**\n * Handler that is called when the snackbar is closed, either by the user\n * or after a timeout.\n */\n onClose?: () => void\n /**\n * A timeout to automatically close the snackbar after, in milliseconds.\n * @default 5000\n */\n timeout?: number | null\n /**\n * The priority of the snackbar relative to other snackbars. Larger numbers indicate higher priority.\n */\n priority?: number\n}\n\nexport const addSnackbar = ({ onClose, timeout = 5000, priority, ...content }: AddSnackbarArgs) => {\n const queue = getGlobalSnackBarQueue()\n\n queue.add(content, {\n onClose,\n timeout: timeout && !content.onAction ? Math.max(timeout, 5000) : undefined,\n priority,\n })\n}\n","import {\n addSnackbar,\n type AddSnackbarArgs,\n clearSnackbarQueue,\n Snackbar as Root,\n type SnackbarProps,\n} from './Snackbar'\nimport { SnackbarItem as Item, type SnackbarItemProps } from './SnackbarItem'\nimport {\n SnackbarItemAction as ItemAction,\n type SnackbarItemActionProps,\n} from './SnackbarItemAction'\nimport { SnackbarItemClose as ItemClose, type SnackbarItemCloseProps } from './SnackbarItemClose'\nimport { SnackbarItemIcon as ItemIcon, type SnackbarItemIconProps } from './SnackbarItemIcon'\n\nexport const Snackbar: typeof Root & {\n Item: typeof Item\n ItemAction: typeof ItemAction\n ItemClose: typeof ItemClose\n ItemIcon: typeof ItemIcon\n} = Object.assign(Root, {\n Item,\n ItemAction,\n ItemClose,\n ItemIcon,\n})\n\nSnackbar.displayName = 'Snackbar'\nItem.displayName = 'Snackbar.Item'\nItemAction.displayName = 'Snackbar.ItemAction'\nItemClose.displayName = 'Snackbar.ItemClose'\nItemIcon.displayName = 'Snackbar.ItemIcon'\n\nexport type {\n SnackbarProps,\n SnackbarItemProps,\n SnackbarItemActionProps,\n SnackbarItemCloseProps,\n SnackbarItemIconProps,\n AddSnackbarArgs,\n}\nexport { addSnackbar, clearSnackbarQueue }\n"],"names":["filledVariants","tintedVariants","snackbarItemVariant","cva","snackbarItemVariantContent","SnackbarItemContext","createContext","useSnackbarItemContext","useContext","SnackbarItemAction","designProp","intentProp","onClick","children","className","ref","rest","toast","state","intent","design","jsx","Button","e","cx","SnackbarItemClose","ariaLabel","IconButton","Icon","Close","SnackbarItemIcon","SWIPE_THRESHOLD","useSwipe","swipeRef","onSwipeStart","onSwipeMove","onSwipeCancel","onSwipeEnd","threshold","setState","useState","direction","useRef","origin","delta","handleSwipeStart","evt","handleSwipeMove","deltaX","deltaY","moveState","handleSwipeEnd","proxyDelta","endState","useEffect","swipeElement","SnackbarItem","ariaLabelledby","ariaDescribedby","ariaDetails","actionOnNewlineProp","forwardedRef","innerRef","swipeState","swipeDirection","message","icon","isClosable","onAction","actionLabel","actionOnNewline","ariaProps","toastProps","titleProps","closeButtonProps","contentProps","useToast","findElement","useCallback","elementDisplayName","Children","isValidElement","child","iconFromChildren","actionBtnFromChildren","closeBtnFromChildren","jsxs","renderSubComponent","childItem","defaultItem","props","cloneElement","snackbarRegionVariant","SnackbarRegion","position","regionProps","useToastRegion","useSnackbarGlobalStore","providers","subscriptions","subscribe","listener","getLastSnackbarProvider","addProvider","provider","subscribeFn","deleteProvider","useSyncExternalStore","GLOBAL_SNACKBAR_QUEUE","getGlobalSnackBarQueue","ToastQueue","clearSnackbarQueue","GLOBAL_SNACKBAR_STORE","Snackbar","useToastQueue","createPortal","addSnackbar","onClose","timeout","priority","content","Root","Item","ItemAction","ItemClose","ItemIcon"],"mappings":";;;;;;;;;;AAAO,MAAMA,KAAiB;AAAA,EAC5B;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO,CAAC,4BAA4B;AAAA,EAAA;AAAA,EAEtC;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO,CAAC,wBAAwB;AAAA,EAAA;AAAA,EAElC;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO,CAAC,wBAAwB;AAAA,EAAA;AAAA,EAElC;AAAA,IACE,QAAQ;A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IAAQgG,GAAcL,GAAwB,GAE9C,EAAE,UAAAL,GAAU,aAAAD,GAAa,gBAAAG,EAAA,IAAmBT,GAAuBe,EAAqB;AAE9F,SAAA1D,EAAU,OACRiD,EAAYxF,CAAG,GAER,MAAM;AACX,eAAWE,KAAS4F,EAAA,EAAyB;AAC3C,MAAA5F,EAAM,YAAY;AAGpB,IAAAyF,EAAe3F,CAAG;AAAA,EACpB,IAEC,CAAA,CAAE,GAEEA,MAAQyF,KAAYtF,EAAM,cAAc,SAAS,IACpDiG,GAAa,gBAAA9F,EAACwE,IAAA,EAAe,KAAKhC,GAAc,OAAA3C,GAAe,GAAGwE,GAAO,GAAI,SAAS,IAAI,IAC1F;AACN;AAEAuB,EAAS,cAAc;AAmBhB,MAAMG,KAAc,CAAC,EAAE,SAAAC,GAAS,SAAAC,IAAU,KAAM,UAAAC,GAAU,GAAGC,QAA+B;AAGjG,EAFcX,EAAA,EAER,IAAIW,GAAS;AAAA,IACjB,SAAAH;AAAA,IACA,SAASC,KAAW,CAACE,EAAQ,WAAW,KAAK,IAAIF,GAAS,GAAI,IAAI;AAAA,IAClE,UAAAC;AAAA,EAAA,CACD;AACH,GCrFaN,KAKT,OAAO,OAAOQ,GAAM;AAAA,EAAA,MACtBC;AAAAA,EAAA,YACAC;AAAAA,EAAA,WACAC;AAAAA,EAAA,UACAC;AACF,CAAC;AAEDZ,GAAS,cAAc;AACvBS,EAAK,cAAc;AACnBC,EAAW,cAAc;AACzBC,EAAU,cAAc;AACxBC,EAAS,cAAc;"}
@@ -22,10 +22,6 @@ export declare const filledVariants: readonly [{
22
22
  readonly design: "filled";
23
23
  readonly intent: "main";
24
24
  readonly class: readonly ["bg-main text-on-main"];
25
- }, {
26
- readonly design: "filled";
27
- readonly intent: "basic";
28
- readonly class: readonly ["bg-basic text-on-basic"];
29
25
  }, {
30
26
  readonly design: "filled";
31
27
  readonly intent: "support";
@@ -63,10 +59,6 @@ export declare const tintedVariants: readonly [{
63
59
  readonly design: "tinted";
64
60
  readonly intent: "main";
65
61
  readonly class: readonly ["bg-main-container text-on-main-container"];
66
- }, {
67
- readonly design: "tinted";
68
- readonly intent: "basic";
69
- readonly class: readonly ["bg-basic-container text-on-basic-container"];
70
62
  }, {
71
63
  readonly design: "tinted";
72
64
  readonly intent: "support";
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  export declare const spinnerStyles: (props?: ({
3
3
  size?: "current" | "sm" | "md" | "full" | null | undefined;
4
- intent?: "main" | "current" | "alert" | "error" | "support" | "accent" | "basic" | "success" | "info" | "neutral" | null | undefined;
4
+ intent?: "main" | "current" | "alert" | "error" | "support" | "accent" | "success" | "info" | "neutral" | null | undefined;
5
5
  isBackgroundVisible?: boolean | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
7
  export type SpinnerStylesProps = VariantProps<typeof spinnerStyles>;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../Spinner-_Kffli3B.js");exports.Spinner=e.Spinner;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../Spinner-Br4Rp9V2.js");exports.Spinner=e.Spinner;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { S as n } from "../Spinner-aLrtE2JN.mjs";
1
+ import { S as n } from "../Spinner-Co3AjkQV.mjs";
2
2
  export {
3
3
  n as Spinner
4
4
  };
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),M=require("@spark-ui/components/form-field"),l=require("react"),m=require("../input/index.js"),A=require("@react-aria/numberfield"),_=require("@react-stately/numberfield"),S=require("@react-aria/button"),k=require("@spark-ui/icons/Minus"),G=require("@spark-ui/icons/Plus"),I=require("../Icon-CF0W0LKr.js"),P=require("../IconButton-D3g86WpZ.js"),T=require("@spark-ui/hooks/use-merge-refs"),$=({inputRef:r,locale:i="fr",...e})=>{const u=_.useNumberFieldState({...e,isDisabled:e.disabled,isReadOnly:e.readOnly,isRequired:e.required,locale:i}),{groupProps:n,inputProps:t,incrementButtonProps:s,decrementButtonProps:c}=A.useNumberField({isWheelDisabled:!1,...e,isDisabled:e.disabled,isReadOnly:e.readOnly,isRequired:e.required},u,r);return{groupProps:n,inputProps:t,incrementButtonProps:s,decrementButtonProps:c}},f=l.createContext(null),g=({children:r,formatOptions:i,minValue:e,maxValue:u,ref:n,...t})=>{const s=l.useRef(null),{groupProps:c,inputProps:d,incrementButtonProps:p,decrementButtonProps:R}=$({...t,..."value"in t&&{value:t.value??NaN},onChange:t.onValueChange,formatOptions:i,minValue:e,maxValue:u,inputRef:s}),a=M.useFormFieldControl(),b=!!a.id,v={...p,...b&&{"aria-controls":a.id}},D={...R,...b&&{"aria-controls":a.id}},O={...d,...b&&{id:a.id,required:a.isRequired,"aria-invalid":a.isInvalid?!0:void 0}},{onValueChange:L,...F}=t;return o.jsx(f.Provider,{value:{incrementButtonProps:v,decrementButtonProps:D,inputProps:O,inputRef:s},children:o.jsx(m.InputGroup,{...F,...c,"data-spark-component":"stepper",ref:n,children:r})})};g.displayName="Stepper";const B=()=>{const r=l.useContext(f);if(!r)throw Error("useStepperContext must be used within a Stepper provider");return r},x=({children:r,design:i="ghost",intent:e="neutral",className:u,ref:n,...t})=>{const s=l.useRef(null),c=n&&typeof n!="function"?n:s,{incrementButtonProps:d}=B(),{buttonProps:p}=S.useButton({...d,...t},c);return o.jsx(m.InputGroup.TrailingAddon,{asChild:!0,"data-spark-component":"stepper-increment-button",children:o.jsx(P.IconButton,{ref:c,design:i,intent:e,className:u,"aria-label":p["aria-label"],...p,disabled:t.disabled||p.disabled,children:r||o.jsx(I.Icon,{children:o.jsx(G.Plus,{})})})})},q=({children:r,design:i="ghost",intent:e="neutral",className:u,ref:n,...t})=>{const s=l.useRef(null),c=n&&typeof n!="function"?n:s,{decrementButtonProps:d}=B(),{buttonProps:p}=S.useButton({...d,...t},c);return o.jsx(m.InputGroup.LeadingAddon,{asChild:!0,"data-spark-component":"stepper-decrement-button",children:o.jsx(P.IconButton,{ref:c,design:i,intent:e,className:u,"aria-label":p["aria-label"],...p,disabled:t.disabled||p.disabled,children:r||o.jsx(I.Icon,{children:o.jsx(k.Minus,{})})})})},h=Object.assign(x,{id:"TrailingAddon"}),j=Object.assign(q,{id:"LeadingAddon"});x.displayName="Stepper.DecrementButton";q.displayName="Stepper.DecrementButton";const y=({ref:r,...i})=>{const{inputRef:e,inputProps:u}=B(),n=T.useMergeRefs(r,e),{className:t="",...s}=i;return o.jsx(m.Input,{ref:n,...s,...u,className:`min-w-sz-56 text-center ${t}`})},N=Object.assign(y,{id:"Input"});y.displayName="Stepper.Input";const C=Object.assign(g,{IncrementButton:h,DecrementButton:j,Input:N});C.displayName="Stepper";h.displayName="Stepper.IncrementButton";j.displayName="Stepper.DecrementButton";N.displayName="Stepper.Input";exports.Stepper=C;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),M=require("@spark-ui/components/form-field"),l=require("react"),m=require("../input/index.js"),A=require("@react-aria/numberfield"),_=require("@react-stately/numberfield"),S=require("@react-aria/button"),k=require("@spark-ui/icons/Minus"),G=require("@spark-ui/icons/Plus"),I=require("../Icon-C-cNTnzd.js"),P=require("../IconButton-BR1bJSQA.js"),T=require("@spark-ui/hooks/use-merge-refs"),$=({inputRef:r,locale:i="fr",...e})=>{const u=_.useNumberFieldState({...e,isDisabled:e.disabled,isReadOnly:e.readOnly,isRequired:e.required,locale:i}),{groupProps:n,inputProps:t,incrementButtonProps:s,decrementButtonProps:c}=A.useNumberField({isWheelDisabled:!1,...e,isDisabled:e.disabled,isReadOnly:e.readOnly,isRequired:e.required},u,r);return{groupProps:n,inputProps:t,incrementButtonProps:s,decrementButtonProps:c}},f=l.createContext(null),g=({children:r,formatOptions:i,minValue:e,maxValue:u,ref:n,...t})=>{const s=l.useRef(null),{groupProps:c,inputProps:d,incrementButtonProps:p,decrementButtonProps:R}=$({...t,..."value"in t&&{value:t.value??NaN},onChange:t.onValueChange,formatOptions:i,minValue:e,maxValue:u,inputRef:s}),a=M.useFormFieldControl(),b=!!a.id,v={...p,...b&&{"aria-controls":a.id}},D={...R,...b&&{"aria-controls":a.id}},O={...d,...b&&{id:a.id,required:a.isRequired,"aria-invalid":a.isInvalid?!0:void 0}},{onValueChange:L,...F}=t;return o.jsx(f.Provider,{value:{incrementButtonProps:v,decrementButtonProps:D,inputProps:O,inputRef:s},children:o.jsx(m.InputGroup,{...F,...c,"data-spark-component":"stepper",ref:n,children:r})})};g.displayName="Stepper";const B=()=>{const r=l.useContext(f);if(!r)throw Error("useStepperContext must be used within a Stepper provider");return r},x=({children:r,design:i="ghost",intent:e="neutral",className:u,ref:n,...t})=>{const s=l.useRef(null),c=n&&typeof n!="function"?n:s,{incrementButtonProps:d}=B(),{buttonProps:p}=S.useButton({...d,...t},c);return o.jsx(m.InputGroup.TrailingAddon,{asChild:!0,"data-spark-component":"stepper-increment-button",children:o.jsx(P.IconButton,{ref:c,design:i,intent:e,className:u,"aria-label":p["aria-label"],...p,disabled:t.disabled||p.disabled,children:r||o.jsx(I.Icon,{children:o.jsx(G.Plus,{})})})})},q=({children:r,design:i="ghost",intent:e="neutral",className:u,ref:n,...t})=>{const s=l.useRef(null),c=n&&typeof n!="function"?n:s,{decrementButtonProps:d}=B(),{buttonProps:p}=S.useButton({...d,...t},c);return o.jsx(m.InputGroup.LeadingAddon,{asChild:!0,"data-spark-component":"stepper-decrement-button",children:o.jsx(P.IconButton,{ref:c,design:i,intent:e,className:u,"aria-label":p["aria-label"],...p,disabled:t.disabled||p.disabled,children:r||o.jsx(I.Icon,{children:o.jsx(k.Minus,{})})})})},h=Object.assign(x,{id:"TrailingAddon"}),j=Object.assign(q,{id:"LeadingAddon"});x.displayName="Stepper.DecrementButton";q.displayName="Stepper.DecrementButton";const y=({ref:r,...i})=>{const{inputRef:e,inputProps:u}=B(),n=T.useMergeRefs(r,e),{className:t="",...s}=i;return o.jsx(m.Input,{ref:n,...s,...u,className:`min-w-sz-56 text-center ${t}`})},N=Object.assign(y,{id:"Input"});y.displayName="Stepper.Input";const C=Object.assign(g,{IncrementButton:h,DecrementButton:j,Input:N});C.displayName="Stepper";h.displayName="Stepper.IncrementButton";j.displayName="Stepper.DecrementButton";N.displayName="Stepper.Input";exports.Stepper=C;
2
2
  //# sourceMappingURL=index.js.map
@@ -7,8 +7,8 @@ import { useNumberFieldState as L } from "@react-stately/numberfield";
7
7
  import { useButton as B } from "@react-aria/button";
8
8
  import { Minus as M } from "@spark-ui/icons/Minus";
9
9
  import { Plus as T } from "@spark-ui/icons/Plus";
10
- import { I as P } from "../Icon-C23-htlD.mjs";
11
- import { I as S } from "../IconButton-Bfd-6BAD.mjs";
10
+ import { I as P } from "../Icon-BO327oHU.mjs";
11
+ import { I as S } from "../IconButton-DdB3Pq13.mjs";
12
12
  import { useMergeRefs as V } from "@spark-ui/hooks/use-merge-refs";
13
13
  const W = ({
14
14
  inputRef: r,
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  export declare const styles: (props?: ({
3
3
  size?: "sm" | "md" | null | undefined;
4
- intent?: "main" | "alert" | "error" | "support" | "accent" | "basic" | "success" | "info" | "neutral" | null | undefined;
4
+ intent?: "main" | "alert" | "error" | "support" | "accent" | "success" | "info" | "neutral" | null | undefined;
5
5
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
6
  export type StylesProps = VariantProps<typeof styles>;
7
7
  export declare const thumbWrapperStyles: (props?: ({
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),y=require("@spark-ui/components/form-field"),c=require("class-variance-authority"),w=require("react"),k=require("@base-ui/react/switch"),L=require("@spark-ui/hooks/use-combined-state"),P=require("@spark-ui/icons/Check"),T=require("@spark-ui/icons/Close"),_=require("../useRenderSlot-DATwjgpo.js"),S=require("../Slot-DQ8z2zsy.js"),a=require("@spark-ui/internal-utils"),A=require("../label/index.js"),B=c.cva(a.tw(["relative shrink-0 self-baseline","cursor-pointer","rounded-full border-transparent","hover:ring-4","transition-colors duration-200 ease-in-out","disabled:hover:ring-transparent disabled:cursor-not-allowed disabled:opacity-dim-3","focus-visible:u-outline","data-unchecked:bg-on-surface/dim-3","u-shadow-border-transition","overflow-x-hidden"]),{variants:{size:a.makeVariants({sm:a.tw(["h-sz-24","w-sz-40","border-md"]),md:a.tw(["h-sz-32","w-sz-56","border-[4px]"])}),intent:a.makeVariants({main:["[&[data-checked]]:bg-main","hover:ring-main-container","text-main"],support:["[&[data-checked]]:bg-support","hover:ring-support-container","text-support"],accent:["[&[data-checked]]:bg-accent","hover:ring-accent-container","text-accent"],basic:["[&[data-checked]]:bg-basic","hover:ring-basic-container","text-basic"],success:["[&[data-checked]]:bg-success","hover:ring-success-container","text-success"],alert:["[&[data-checked]]:bg-alert","hover:ring-alert-container","text-alert"],error:["[&[data-checked]]:bg-error","hover:ring-error-container","text-error"],info:["[&[data-checked]]:bg-info","hover:ring-info-container","text-info"],neutral:["[&[data-checked]]:bg-neutral","hover:ring-neutral-container","text-neutral"]})},defaultVariants:{intent:"basic",size:"sm"}}),E=c.cva(["pointer-events-none absolute inset-0 flex items-center","transition-all duration-200 ease-in-out"],{variants:{checked:{true:"translate-x-full",false:"translate-x-0"}}}),G=c.cva(["absolute left-0 top-0 flex items-center justify-center","bg-surface","rounded-full","ring-0","transition-all duration-200 ease-in-out"],{variants:{size:a.makeVariants({sm:["h-sz-20","w-sz-20"],md:["h-sz-24","w-sz-24"]}),checked:{true:"-translate-x-full",false:"translate-x-0 text-on-surface/dim-2"}},defaultVariants:{size:"sm",checked:!1}}),j=c.cva(["transition-opacity duration-200"],{variants:{size:a.makeVariants({sm:["h-sz-10 w-sz-10"],md:["h-sz-12 w-sz-12"]})},defaultVariants:{size:"sm"}}),z=({checked:n,checkedIcon:t=e.jsx(P.Check,{}),defaultChecked:r,intent:b,uncheckedIcon:o=e.jsx(T.Close,{}),size:i="md",onCheckedChange:p,className:x,required:l,ref:d,asChild:f=!1,...u})=>{const[s,h]=L.useCombinedState(n,r),{name:g,description:I,state:F,isRequired:N,isInvalid:V}=y.useFormFieldControl(),R=F??b,D=_.useRenderSlot(f,"span"),v=!!(l||N),$=m=>{h(m),p?.(m)};return e.jsx(k.Switch.Root,{"data-spark-component":"switch-input",ref:d,render:D,className:B({intent:R,size:i,className:x}),checked:n,defaultChecked:r,onCheckedChange:m=>$(m),name:g,required:v,"aria-required":v?!0:void 0,"aria-invalid":V,"aria-describedby":I,...u,children:e.jsx("span",{className:E({checked:s}),children:e.jsxs(k.Switch.Thumb,{className:G({size:i,checked:s}),children:[s&&t&&e.jsx(S.Slot,{className:j({size:i}),children:t}),!s&&o&&e.jsx(S.Slot,{className:j({size:i}),children:o})]})})})};z.displayName="SwitchInput";const M=c.cva("default:text-on-surface",{variants:{disabled:{true:["text-neutral/dim-2","cursor-not-allowed"],false:["cursor-pointer"]}},defaultVariants:{disabled:!1}}),O=({className:n,disabled:t,...r})=>e.jsx(A.Label,{"data-spark-component":"switch-label",className:M({disabled:t,className:n}),...r}),q=":switch",C=({size:n="md",children:t,className:r,id:b,disabled:o,reverse:i=!1,ref:p,...x})=>{const l=y.useFormFieldControl(),d=`${q}-label-${w.useId()}`,f=`${q}-input-${w.useId()}`,u=l.id||b||f,s=t&&e.jsx(O,{disabled:o,htmlFor:u,id:d,children:t}),h=e.jsx(z,{ref:p,size:n,id:u,disabled:o,"aria-labelledby":t?d:l.labelId,...x}),g=i?e.jsxs(e.Fragment,{children:[s,h]}):e.jsxs(e.Fragment,{children:[h,s]});return e.jsx("div",{"data-spark-component":"switch",className:c.cx("gap-md text-body-1 flex items-center",r),children:g})};C.displayName="Switch";exports.Switch=C;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),y=require("@spark-ui/components/form-field"),o=require("class-variance-authority"),w=require("react"),k=require("@base-ui/react/switch"),L=require("@spark-ui/hooks/use-combined-state"),P=require("@spark-ui/icons/Check"),T=require("@spark-ui/icons/Close"),_=require("../useRenderSlot-DATwjgpo.js"),S=require("../Slot-DQ8z2zsy.js"),a=require("@spark-ui/internal-utils"),A=require("../label/index.js"),B=o.cva(a.tw(["relative shrink-0 self-baseline","cursor-pointer","rounded-full border-transparent","hover:ring-4","transition-colors duration-200 ease-in-out","disabled:hover:ring-transparent disabled:cursor-not-allowed disabled:opacity-dim-3","focus-visible:u-outline","data-unchecked:bg-on-surface/dim-3","u-shadow-border-transition","overflow-x-hidden"]),{variants:{size:a.makeVariants({sm:a.tw(["h-sz-24","w-sz-40","border-md"]),md:a.tw(["h-sz-32","w-sz-56","border-[4px]"])}),intent:a.makeVariants({main:["[&[data-checked]]:bg-main","hover:ring-main-container","text-main"],support:["[&[data-checked]]:bg-support","hover:ring-support-container","text-support"],accent:["[&[data-checked]]:bg-accent","hover:ring-accent-container","text-accent"],success:["[&[data-checked]]:bg-success","hover:ring-success-container","text-success"],alert:["[&[data-checked]]:bg-alert","hover:ring-alert-container","text-alert"],error:["[&[data-checked]]:bg-error","hover:ring-error-container","text-error"],info:["[&[data-checked]]:bg-info","hover:ring-info-container","text-info"],neutral:["[&[data-checked]]:bg-neutral","hover:ring-neutral-container","text-neutral"]})},defaultVariants:{intent:"support",size:"sm"}}),E=o.cva(["pointer-events-none absolute inset-0 flex items-center","transition-all duration-200 ease-in-out"],{variants:{checked:{true:"translate-x-full",false:"translate-x-0"}}}),G=o.cva(["absolute left-0 top-0 flex items-center justify-center","bg-surface","rounded-full","ring-0","transition-all duration-200 ease-in-out"],{variants:{size:a.makeVariants({sm:["h-sz-20","w-sz-20"],md:["h-sz-24","w-sz-24"]}),checked:{true:"-translate-x-full",false:"translate-x-0 text-on-surface/dim-2"}},defaultVariants:{size:"sm",checked:!1}}),j=o.cva(["transition-opacity duration-200"],{variants:{size:a.makeVariants({sm:["h-sz-10 w-sz-10"],md:["h-sz-12 w-sz-12"]})},defaultVariants:{size:"sm"}}),z=({checked:r,checkedIcon:t=e.jsx(P.Check,{}),defaultChecked:n,intent:b,uncheckedIcon:c=e.jsx(T.Close,{}),size:i="md",onCheckedChange:p,className:x,required:l,ref:d,asChild:f=!1,...u})=>{const[s,h]=L.useCombinedState(r,n),{name:v,description:I,state:F,isRequired:N,isInvalid:V}=y.useFormFieldControl(),R=F??b,D=_.useRenderSlot(f,"span"),g=!!(l||N),$=m=>{h(m),p?.(m)};return e.jsx(k.Switch.Root,{"data-spark-component":"switch-input",ref:d,render:D,className:B({intent:R,size:i,className:x}),checked:r,defaultChecked:n,onCheckedChange:m=>$(m),name:v,required:g,"aria-required":g?!0:void 0,"aria-invalid":V,"aria-describedby":I,...u,children:e.jsx("span",{className:E({checked:s}),children:e.jsxs(k.Switch.Thumb,{className:G({size:i,checked:s}),children:[s&&t&&e.jsx(S.Slot,{className:j({size:i}),children:t}),!s&&c&&e.jsx(S.Slot,{className:j({size:i}),children:c})]})})})};z.displayName="SwitchInput";const M=o.cva("default:text-on-surface",{variants:{disabled:{true:["text-neutral/dim-2","cursor-not-allowed"],false:["cursor-pointer"]}},defaultVariants:{disabled:!1}}),O=({className:r,disabled:t,...n})=>e.jsx(A.Label,{"data-spark-component":"switch-label",className:M({disabled:t,className:r}),...n}),q=":switch",C=({size:r="md",children:t,className:n,id:b,disabled:c,reverse:i=!1,ref:p,...x})=>{const l=y.useFormFieldControl(),d=`${q}-label-${w.useId()}`,f=`${q}-input-${w.useId()}`,u=l.id||b||f,s=t&&e.jsx(O,{disabled:c,htmlFor:u,id:d,children:t}),h=e.jsx(z,{ref:p,size:r,id:u,disabled:c,"aria-labelledby":t?d:l.labelId,...x}),v=i?e.jsxs(e.Fragment,{children:[s,h]}):e.jsxs(e.Fragment,{children:[h,s]});return e.jsx("div",{"data-spark-component":"switch",className:o.cx("gap-md text-body-1 flex items-center",n),children:v})};C.displayName="Switch";exports.Switch=C;
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/switch/SwitchInput.styles.ts","../../src/switch/SwitchInput.tsx","../../src/switch/SwitchLabel.styles.ts","../../src/switch/SwitchLabel.tsx","../../src/switch/Switch.tsx"],"sourcesContent":["import { makeVariants, tw } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const styles = cva(\n tw([\n 'relative shrink-0 self-baseline',\n 'cursor-pointer',\n 'rounded-full border-transparent',\n 'hover:ring-4',\n 'transition-colors duration-200 ease-in-out',\n 'disabled:hover:ring-transparent disabled:cursor-not-allowed disabled:opacity-dim-3',\n 'focus-visible:u-outline',\n 'data-unchecked:bg-on-surface/dim-3',\n 'u-shadow-border-transition',\n 'overflow-x-hidden',\n ]),\n {\n variants: {\n /**\n * Size of the switch input.\n */\n size: makeVariants<'size', ['sm', 'md']>({\n sm: tw(['h-sz-24', 'w-sz-40', 'border-md']),\n md: tw(['h-sz-32', 'w-sz-56', 'border-[4px]']),\n }),\n /**\n * Color scheme of the switch input.\n */\n intent: makeVariants<\n 'intent',\n ['main', 'support', 'accent', 'basic', 'success', 'alert', 'error', 'info', 'neutral']\n >({\n main: ['[&[data-checked]]:bg-main', 'hover:ring-main-container', 'text-main'],\n support: ['[&[data-checked]]:bg-support', 'hover:ring-support-container', 'text-support'],\n accent: ['[&[data-checked]]:bg-accent', 'hover:ring-accent-container', 'text-accent'],\n basic: ['[&[data-checked]]:bg-basic', 'hover:ring-basic-container', 'text-basic'],\n success: ['[&[data-checked]]:bg-success', 'hover:ring-success-container', 'text-success'],\n alert: ['[&[data-checked]]:bg-alert', 'hover:ring-alert-container', 'text-alert'],\n error: ['[&[data-checked]]:bg-error', 'hover:ring-error-container', 'text-error'],\n info: ['[&[data-checked]]:bg-info', 'hover:ring-info-container', 'text-info'],\n neutral: ['[&[data-checked]]:bg-neutral', 'hover:ring-neutral-container', 'text-neutral'],\n }),\n },\n defaultVariants: {\n intent: 'basic',\n size: 'sm',\n },\n }\n)\n\nexport type StylesProps = VariantProps<typeof styles>\n\nexport const thumbWrapperStyles = cva(\n [\n 'pointer-events-none absolute inset-0 flex items-center',\n 'transition-all duration-200 ease-in-out',\n ],\n {\n variants: {\n checked: {\n true: 'translate-x-full',\n false: 'translate-x-0',\n },\n },\n }\n)\n\nexport const thumbStyles = cva(\n [\n 'absolute left-0 top-0 flex items-center justify-center',\n 'bg-surface',\n 'rounded-full',\n 'ring-0',\n 'transition-all duration-200 ease-in-out',\n ],\n {\n variants: {\n size: makeVariants<'size', ['sm', 'md']>({\n sm: ['h-sz-20', 'w-sz-20'],\n md: ['h-sz-24', 'w-sz-24'],\n }),\n checked: {\n true: '-translate-x-full',\n false: 'translate-x-0 text-on-surface/dim-2',\n },\n },\n defaultVariants: {\n size: 'sm',\n checked: false,\n },\n }\n)\n\nexport const thumbCheckSVGStyles = cva(['transition-opacity duration-200'], {\n variants: {\n size: makeVariants<'size', ['sm', 'md']>({\n sm: ['h-sz-10 w-sz-10'],\n md: ['h-sz-12 w-sz-12'],\n }),\n },\n defaultVariants: {\n size: 'sm',\n },\n})\n","import { Switch as BaseSwitch } from '@base-ui/react/switch'\nimport { useFormFieldControl } from '@spark-ui/components/form-field'\nimport { useCombinedState } from '@spark-ui/hooks/use-combined-state'\nimport { Check } from '@spark-ui/icons/Check'\nimport { Close } from '@spark-ui/icons/Close'\nimport { type ComponentPropsWithRef, type ReactNode } from 'react'\n\nimport { useRenderSlot } from '../drawer/useRenderSlot'\nimport { Slot } from '../slot'\nimport {\n styles,\n type StylesProps,\n thumbCheckSVGStyles,\n thumbStyles,\n thumbWrapperStyles,\n} from './SwitchInput.styles'\n\nexport interface SwitchInputProps\n extends StylesProps,\n Omit<ComponentPropsWithRef<typeof BaseSwitch.Root>, 'value' | 'render' | 'onCheckedChange'> {\n /**\n * The state of the switch when it is initially rendered. Use when you do not need to control its state.\n */\n defaultChecked?: boolean\n /**\n * The controlled state of the switch. Must be used in conjunction with `onCheckedChange`.\n */\n checked?: boolean\n /**\n * Event handler called when the state of the switch changes.\n */\n onCheckedChange?: (checked: boolean) => void\n /**\n * When `true`, prevents the user from interacting with the switch.\n */\n disabled?: boolean\n /**\n * When true, indicates that the user must check the switch before the owning form can be submitted.\n */\n required?: boolean\n /**\n * The name of the switch. Submitted with its owning form as part of a name/value pair.\n */\n name?: string\n /**\n * The value given as data when submitted with a name.\n */\n value?: string\n /**\n * Icon shown inside the thumb of the Switch whenever it is checked\n */\n checkedIcon?: ReactNode\n /**\n * Icon shown inside the thumb of the Switch whenever it is unchecked\n */\n uncheckedIcon?: ReactNode\n /**\n * When true, the label will be placed on the left side of the Switch\n */\n reverse?: boolean\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean\n}\n\nexport const SwitchInput = ({\n checked,\n checkedIcon = <Check />,\n defaultChecked,\n intent: intentProp,\n uncheckedIcon = <Close />,\n size = 'md',\n onCheckedChange,\n className,\n required,\n ref,\n asChild = false,\n ...rest\n}: SwitchInputProps) => {\n const [isChecked, setIsChecked] = useCombinedState(checked, defaultChecked)\n const { name, description, state, isRequired, isInvalid } = useFormFieldControl()\n const intent = state ?? intentProp\n const renderSlot = useRenderSlot(asChild, 'span')\n const isRequiredComputed = Boolean(required || isRequired)\n\n const handleCheckedChange = (updatedValue: boolean): void => {\n setIsChecked(updatedValue)\n onCheckedChange?.(updatedValue)\n }\n\n return (\n <BaseSwitch.Root\n data-spark-component=\"switch-input\"\n ref={ref}\n render={renderSlot}\n className={styles({ intent, size, className })}\n checked={checked}\n defaultChecked={defaultChecked}\n onCheckedChange={nextChecked => handleCheckedChange(nextChecked)}\n name={name}\n required={isRequiredComputed}\n aria-required={isRequiredComputed ? true : undefined}\n aria-invalid={isInvalid}\n aria-describedby={description}\n {...rest}\n >\n <span className={thumbWrapperStyles({ checked: isChecked })}>\n <BaseSwitch.Thumb className={thumbStyles({ size, checked: isChecked })}>\n {isChecked && checkedIcon && (\n <Slot className={thumbCheckSVGStyles({ size })}>{checkedIcon}</Slot>\n )}\n {!isChecked && uncheckedIcon && (\n <Slot className={thumbCheckSVGStyles({ size })}>{uncheckedIcon}</Slot>\n )}\n </BaseSwitch.Thumb>\n </span>\n </BaseSwitch.Root>\n )\n}\n\nSwitchInput.displayName = 'SwitchInput'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const labelStyles = cva('default:text-on-surface', {\n variants: {\n disabled: {\n true: ['text-neutral/dim-2', 'cursor-not-allowed'],\n false: ['cursor-pointer'],\n },\n },\n defaultVariants: {\n disabled: false,\n },\n})\n\nexport type LabelStylesProps = VariantProps<typeof labelStyles>\n","import { Label, LabelProps } from '../label'\nimport { labelStyles, LabelStylesProps } from './SwitchLabel.styles'\n\nexport interface SwitchLabelProps extends LabelStylesProps, LabelProps {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * The id of the element the label is associated with.\n */\n htmlFor?: string\n /**\n * When true, prevents the user from interacting with the switch item.\n */\n disabled?: boolean\n}\n\nexport const SwitchLabel = ({ className, disabled, ...others }: SwitchLabelProps) => (\n <Label\n data-spark-component=\"switch-label\"\n className={labelStyles({ disabled, className })}\n {...others}\n />\n)\n","import { useFormFieldControl } from '@spark-ui/components/form-field'\nimport { cx } from 'class-variance-authority'\nimport { useId } from 'react'\n\nimport { SwitchInput, SwitchInputProps } from './SwitchInput'\nimport { SwitchLabel } from './SwitchLabel'\n\nexport type SwitchProps = SwitchInputProps\n\nconst ID_PREFIX = ':switch'\n\nexport const Switch = ({\n size = 'md',\n children,\n className,\n id,\n disabled,\n reverse = false,\n ref,\n ...rest\n}: SwitchProps) => {\n const field = useFormFieldControl()\n\n const labelID = `${ID_PREFIX}-label-${useId()}`\n const innerID = `${ID_PREFIX}-input-${useId()}`\n const fieldID = field.id || id || innerID\n\n const switchLabel = children && (\n <SwitchLabel disabled={disabled} htmlFor={fieldID} id={labelID}>\n {children}\n </SwitchLabel>\n )\n\n const switchInput = (\n <SwitchInput\n ref={ref}\n size={size}\n id={fieldID}\n disabled={disabled}\n /**\n * If the switch doesn't have any direct label (children) then we should try to\n * get an eventual alternative label from FormField.\n * On last resort, we shouldn't forget to define an aria-label attribute.\n */\n aria-labelledby={children ? labelID : field.labelId}\n {...rest}\n />\n )\n\n const content = reverse ? (\n <>\n {switchLabel}\n {switchInput}\n </>\n ) : (\n <>\n {switchInput}\n {switchLabel}\n </>\n )\n\n return (\n <div\n data-spark-component=\"switch\"\n className={cx('gap-md text-body-1 flex items-center', className)}\n >\n {content}\n </div>\n )\n}\n\nSwitch.displayName = 'Switch'\n"],"names":["styles","cva","tw","makeVariants","thumbWrapperStyles","thumbStyles","thumbCheckSVGStyles","SwitchInput","checked","checkedIcon","Check","defaultChecked","intentProp","uncheckedIcon","Close","size","onCheckedChange","className","required","ref","asChild","rest","isChecked","setIsChecked","useCombinedState","name","description","state","isRequired","isInvalid","useFormFieldControl","intent","renderSlot","useRenderSlot","isRequiredComputed","handleCheckedChange","updatedValue","jsx","BaseSwitch","nextChecked","jsxs","Slot","labelStyles","SwitchLabel","disabled","others","Label","ID_PREFIX","Switch","children","id","reverse","field","labelID","useId","innerID","fieldID","switchLabel","switchInput","content","Fragment","cx"],"mappings":"ogBAGaA,EAASC,EAAAA,IACpBC,KAAG,CACD,kCACA,iBACA,kCACA,eACA,6CACA,qFACA,0BACA,qCACA,6BACA,mBAAA,CACD,EACD,CACE,SAAU,CAIR,KAAMC,EAAAA,aAAmC,CACvC,GAAID,EAAAA,GAAG,CAAC,UAAW,UAAW,WAAW,CAAC,EAC1C,GAAIA,EAAAA,GAAG,CAAC,UAAW,UAAW,cAAc,CAAC,CAAA,CAC9C,EAID,OAAQC,EAAAA,aAGN,CACA,KAAM,CAAC,4BAA6B,4BAA6B,WAAW,EAC5E,QAAS,CAAC,+BAAgC,+BAAgC,cAAc,EACxF,OAAQ,CAAC,8BAA+B,8BAA+B,aAAa,EACpF,MAAO,CAAC,6BA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,EAAc,CAAC,CAAE,UAAA1B,EAAW,SAAA2B,EAAU,GAAGC,KACpDR,EAAAA,IAACS,EAAAA,MAAA,CACC,uBAAqB,eACrB,UAAWJ,EAAY,CAAE,SAAAE,EAAU,UAAA3B,EAAW,EAC7C,GAAG4B,CAAA,CACN,ECdIE,EAAY,UAELC,EAAS,CAAC,CACrB,KAAAjC,EAAO,KACP,SAAAkC,EACA,UAAAhC,EACA,GAAAiC,EACA,SAAAN,EACA,QAAAO,EAAU,GACV,IAAAhC,EACA,GAAGE,CACL,IAAmB,CACjB,MAAM+B,EAAQtB,EAAAA,oBAAA,EAERuB,EAAU,GAAGN,CAAS,UAAUO,EAAAA,OAAO,GACvCC,EAAU,GAAGR,CAAS,UAAUO,EAAAA,OAAO,GACvCE,EAAUJ,EAAM,IAAMF,GAAMK,EAE5BE,EAAcR,GAClBZ,EAAAA,IAACM,EAAA,CAAY,SAAAC,EAAoB,QAASY,EAAS,GAAIH,EACpD,SAAAJ,CAAA,CACH,EAGIS,EACJrB,EAAAA,IAAC9B,EAAA,CACC,IAAAY,EACA,KAAAJ,EACA,GAAIyC,EACJ,SAAAZ,EAMA,kBAAiBK,EAAWI,EAAUD,EAAM,QAC3C,GAAG/B,CAAA,CAAA,EAIFsC,EAAUR,EACdX,EAAAA,KAAAoB,EAAAA,SAAA,CACG,SAAA,CAAAH,EACAC,CAAA,CAAA,CACH,EAEAlB,EAAAA,KAAAoB,EAAAA,SAAA,CACG,SAAA,CAAAF,EACAD,CAAA,EACH,EAGF,OACEpB,EAAAA,IAAC,MAAA,CACC,uBAAqB,SACrB,UAAWwB,EAAAA,GAAG,uCAAwC5C,CAAS,EAE9D,SAAA0C,CAAA,CAAA,CAGP,EAEAX,EAAO,YAAc"}
1
+ {"version":3,"file":"index.js","sources":["../../src/switch/SwitchInput.styles.ts","../../src/switch/SwitchInput.tsx","../../src/switch/SwitchLabel.styles.ts","../../src/switch/SwitchLabel.tsx","../../src/switch/Switch.tsx"],"sourcesContent":["import { makeVariants, tw } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const styles = cva(\n tw([\n 'relative shrink-0 self-baseline',\n 'cursor-pointer',\n 'rounded-full border-transparent',\n 'hover:ring-4',\n 'transition-colors duration-200 ease-in-out',\n 'disabled:hover:ring-transparent disabled:cursor-not-allowed disabled:opacity-dim-3',\n 'focus-visible:u-outline',\n 'data-unchecked:bg-on-surface/dim-3',\n 'u-shadow-border-transition',\n 'overflow-x-hidden',\n ]),\n {\n variants: {\n /**\n * Size of the switch input.\n */\n size: makeVariants<'size', ['sm', 'md']>({\n sm: tw(['h-sz-24', 'w-sz-40', 'border-md']),\n md: tw(['h-sz-32', 'w-sz-56', 'border-[4px]']),\n }),\n /**\n * Color scheme of the switch input.\n */\n intent: makeVariants<\n 'intent',\n ['main', 'support', 'accent', 'success', 'alert', 'error', 'info', 'neutral']\n >({\n main: ['[&[data-checked]]:bg-main', 'hover:ring-main-container', 'text-main'],\n support: ['[&[data-checked]]:bg-support', 'hover:ring-support-container', 'text-support'],\n accent: ['[&[data-checked]]:bg-accent', 'hover:ring-accent-container', 'text-accent'],\n success: ['[&[data-checked]]:bg-success', 'hover:ring-success-container', 'text-success'],\n alert: ['[&[data-checked]]:bg-alert', 'hover:ring-alert-container', 'text-alert'],\n error: ['[&[data-checked]]:bg-error', 'hover:ring-error-container', 'text-error'],\n info: ['[&[data-checked]]:bg-info', 'hover:ring-info-container', 'text-info'],\n neutral: ['[&[data-checked]]:bg-neutral', 'hover:ring-neutral-container', 'text-neutral'],\n }),\n },\n defaultVariants: {\n intent: 'support',\n size: 'sm',\n },\n }\n)\n\nexport type StylesProps = VariantProps<typeof styles>\n\nexport const thumbWrapperStyles = cva(\n [\n 'pointer-events-none absolute inset-0 flex items-center',\n 'transition-all duration-200 ease-in-out',\n ],\n {\n variants: {\n checked: {\n true: 'translate-x-full',\n false: 'translate-x-0',\n },\n },\n }\n)\n\nexport const thumbStyles = cva(\n [\n 'absolute left-0 top-0 flex items-center justify-center',\n 'bg-surface',\n 'rounded-full',\n 'ring-0',\n 'transition-all duration-200 ease-in-out',\n ],\n {\n variants: {\n size: makeVariants<'size', ['sm', 'md']>({\n sm: ['h-sz-20', 'w-sz-20'],\n md: ['h-sz-24', 'w-sz-24'],\n }),\n checked: {\n true: '-translate-x-full',\n false: 'translate-x-0 text-on-surface/dim-2',\n },\n },\n defaultVariants: {\n size: 'sm',\n checked: false,\n },\n }\n)\n\nexport const thumbCheckSVGStyles = cva(['transition-opacity duration-200'], {\n variants: {\n size: makeVariants<'size', ['sm', 'md']>({\n sm: ['h-sz-10 w-sz-10'],\n md: ['h-sz-12 w-sz-12'],\n }),\n },\n defaultVariants: {\n size: 'sm',\n },\n})\n","import { Switch as BaseSwitch } from '@base-ui/react/switch'\nimport { useFormFieldControl } from '@spark-ui/components/form-field'\nimport { useCombinedState } from '@spark-ui/hooks/use-combined-state'\nimport { Check } from '@spark-ui/icons/Check'\nimport { Close } from '@spark-ui/icons/Close'\nimport { type ComponentPropsWithRef, type ReactNode } from 'react'\n\nimport { useRenderSlot } from '../drawer/useRenderSlot'\nimport { Slot } from '../slot'\nimport {\n styles,\n type StylesProps,\n thumbCheckSVGStyles,\n thumbStyles,\n thumbWrapperStyles,\n} from './SwitchInput.styles'\n\nexport interface SwitchInputProps\n extends StylesProps,\n Omit<ComponentPropsWithRef<typeof BaseSwitch.Root>, 'value' | 'render' | 'onCheckedChange'> {\n /**\n * The state of the switch when it is initially rendered. Use when you do not need to control its state.\n */\n defaultChecked?: boolean\n /**\n * The controlled state of the switch. Must be used in conjunction with `onCheckedChange`.\n */\n checked?: boolean\n /**\n * Event handler called when the state of the switch changes.\n */\n onCheckedChange?: (checked: boolean) => void\n /**\n * When `true`, prevents the user from interacting with the switch.\n */\n disabled?: boolean\n /**\n * When true, indicates that the user must check the switch before the owning form can be submitted.\n */\n required?: boolean\n /**\n * The name of the switch. Submitted with its owning form as part of a name/value pair.\n */\n name?: string\n /**\n * The value given as data when submitted with a name.\n */\n value?: string\n /**\n * Icon shown inside the thumb of the Switch whenever it is checked\n */\n checkedIcon?: ReactNode\n /**\n * Icon shown inside the thumb of the Switch whenever it is unchecked\n */\n uncheckedIcon?: ReactNode\n /**\n * When true, the label will be placed on the left side of the Switch\n */\n reverse?: boolean\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean\n}\n\nexport const SwitchInput = ({\n checked,\n checkedIcon = <Check />,\n defaultChecked,\n intent: intentProp,\n uncheckedIcon = <Close />,\n size = 'md',\n onCheckedChange,\n className,\n required,\n ref,\n asChild = false,\n ...rest\n}: SwitchInputProps) => {\n const [isChecked, setIsChecked] = useCombinedState(checked, defaultChecked)\n const { name, description, state, isRequired, isInvalid } = useFormFieldControl()\n const intent = state ?? intentProp\n const renderSlot = useRenderSlot(asChild, 'span')\n const isRequiredComputed = Boolean(required || isRequired)\n\n const handleCheckedChange = (updatedValue: boolean): void => {\n setIsChecked(updatedValue)\n onCheckedChange?.(updatedValue)\n }\n\n return (\n <BaseSwitch.Root\n data-spark-component=\"switch-input\"\n ref={ref}\n render={renderSlot}\n className={styles({ intent, size, className })}\n checked={checked}\n defaultChecked={defaultChecked}\n onCheckedChange={nextChecked => handleCheckedChange(nextChecked)}\n name={name}\n required={isRequiredComputed}\n aria-required={isRequiredComputed ? true : undefined}\n aria-invalid={isInvalid}\n aria-describedby={description}\n {...rest}\n >\n <span className={thumbWrapperStyles({ checked: isChecked })}>\n <BaseSwitch.Thumb className={thumbStyles({ size, checked: isChecked })}>\n {isChecked && checkedIcon && (\n <Slot className={thumbCheckSVGStyles({ size })}>{checkedIcon}</Slot>\n )}\n {!isChecked && uncheckedIcon && (\n <Slot className={thumbCheckSVGStyles({ size })}>{uncheckedIcon}</Slot>\n )}\n </BaseSwitch.Thumb>\n </span>\n </BaseSwitch.Root>\n )\n}\n\nSwitchInput.displayName = 'SwitchInput'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const labelStyles = cva('default:text-on-surface', {\n variants: {\n disabled: {\n true: ['text-neutral/dim-2', 'cursor-not-allowed'],\n false: ['cursor-pointer'],\n },\n },\n defaultVariants: {\n disabled: false,\n },\n})\n\nexport type LabelStylesProps = VariantProps<typeof labelStyles>\n","import { Label, LabelProps } from '../label'\nimport { labelStyles, LabelStylesProps } from './SwitchLabel.styles'\n\nexport interface SwitchLabelProps extends LabelStylesProps, LabelProps {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * The id of the element the label is associated with.\n */\n htmlFor?: string\n /**\n * When true, prevents the user from interacting with the switch item.\n */\n disabled?: boolean\n}\n\nexport const SwitchLabel = ({ className, disabled, ...others }: SwitchLabelProps) => (\n <Label\n data-spark-component=\"switch-label\"\n className={labelStyles({ disabled, className })}\n {...others}\n />\n)\n","import { useFormFieldControl } from '@spark-ui/components/form-field'\nimport { cx } from 'class-variance-authority'\nimport { useId } from 'react'\n\nimport { SwitchInput, SwitchInputProps } from './SwitchInput'\nimport { SwitchLabel } from './SwitchLabel'\n\nexport type SwitchProps = SwitchInputProps\n\nconst ID_PREFIX = ':switch'\n\nexport const Switch = ({\n size = 'md',\n children,\n className,\n id,\n disabled,\n reverse = false,\n ref,\n ...rest\n}: SwitchProps) => {\n const field = useFormFieldControl()\n\n const labelID = `${ID_PREFIX}-label-${useId()}`\n const innerID = `${ID_PREFIX}-input-${useId()}`\n const fieldID = field.id || id || innerID\n\n const switchLabel = children && (\n <SwitchLabel disabled={disabled} htmlFor={fieldID} id={labelID}>\n {children}\n </SwitchLabel>\n )\n\n const switchInput = (\n <SwitchInput\n ref={ref}\n size={size}\n id={fieldID}\n disabled={disabled}\n /**\n * If the switch doesn't have any direct label (children) then we should try to\n * get an eventual alternative label from FormField.\n * On last resort, we shouldn't forget to define an aria-label attribute.\n */\n aria-labelledby={children ? labelID : field.labelId}\n {...rest}\n />\n )\n\n const content = reverse ? (\n <>\n {switchLabel}\n {switchInput}\n </>\n ) : (\n <>\n {switchInput}\n {switchLabel}\n </>\n )\n\n return (\n <div\n data-spark-component=\"switch\"\n className={cx('gap-md text-body-1 flex items-center', className)}\n >\n {content}\n </div>\n )\n}\n\nSwitch.displayName = 'Switch'\n"],"names":["styles","cva","tw","makeVariants","thumbWrapperStyles","thumbStyles","thumbCheckSVGStyles","SwitchInput","checked","checkedIcon","Check","defaultChecked","intentProp","uncheckedIcon","Close","size","onCheckedChange","className","required","ref","asChild","rest","isChecked","setIsChecked","useCombinedState","name","description","state","isRequired","isInvalid","useFormFieldControl","intent","renderSlot","useRenderSlot","isRequiredComputed","handleCheckedChange","updatedValue","jsx","BaseSwitch","nextChecked","jsxs","Slot","labelStyles","SwitchLabel","disabled","others","Label","ID_PREFIX","Switch","children","id","reverse","field","labelID","useId","innerID","fieldID","switchLabel","switchInput","content","Fragment","cx"],"mappings":"ogBAGaA,EAASC,EAAAA,IACpBC,KAAG,CACD,kCACA,iBACA,kCACA,eACA,6CACA,qFACA,0BACA,qCACA,6BACA,mBAAA,CACD,EACD,CACE,SAAU,CAIR,KAAMC,EAAAA,aAAmC,CACvC,GAAID,EAAAA,GAAG,CAAC,UAAW,UAAW,WAAW,CAAC,EAC1C,GAAIA,EAAAA,GAAG,CAAC,UAAW,UAAW,cAAc,CAAC,CAAA,CAC9C,EAID,OAAQC,EAAAA,aAGN,CACA,KAAM,CAAC,4BAA6B,4BAA6B,WAAW,EAC5E,QAAS,CAAC,+BAAgC,+BAAgC,cAAc,EACxF,OAAQ,CAAC,8BAA+B,8BAA+B,aAAa,EACpF,QAAS,CAAC,+BAAgC,+BAAgC,cAAc,EACxF,MAAO,CAAC,6BAA8B,6BAA8B,YAAY,EAChF,MAAO,CAAC,6BAA8B,6BAA8B,YAAY,EAChF,KAAM,CAAC,4BAA6B,4BAA6B,WAAW,EAC5E,QAAS,CAAC,+BAAgC,+BAAgC,cAAc,CAAA,CACzF,CAAA,EAEH,gBAAiB,CACf,OAAQ,UACR,KAAM,IAAA,CACR,CAEJ,EAIaC,E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