@spark-ui/components 18.1.1 → 18.1.3

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 (193) hide show
  1. package/dist/{DialogContent.styles-ClKRO43s.mjs → DialogContent.styles-BVyH8M3z.mjs} +5 -5
  2. package/dist/{DialogContent.styles-ClKRO43s.mjs.map → DialogContent.styles-BVyH8M3z.mjs.map} +1 -1
  3. package/dist/{DialogContent.styles-FnwXayCC.js → DialogContent.styles-Bh6DymkD.js} +2 -2
  4. package/dist/{DialogContent.styles-FnwXayCC.js.map → DialogContent.styles-Bh6DymkD.js.map} +1 -1
  5. package/dist/{FormFieldRequiredIndicator-DY3STDp1.js → FormFieldRequiredIndicator-BxZgeZ9H.js} +2 -2
  6. package/dist/{FormFieldRequiredIndicator-DY3STDp1.js.map → FormFieldRequiredIndicator-BxZgeZ9H.js.map} +1 -1
  7. package/dist/{FormFieldRequiredIndicator-COKYxTNs.mjs → FormFieldRequiredIndicator-CfE6AOta.mjs} +2 -2
  8. package/dist/{FormFieldRequiredIndicator-COKYxTNs.mjs.map → FormFieldRequiredIndicator-CfE6AOta.mjs.map} +1 -1
  9. package/dist/accordion/index.js +1 -1
  10. package/dist/accordion/index.js.map +1 -1
  11. package/dist/accordion/index.mjs +45 -50
  12. package/dist/accordion/index.mjs.map +1 -1
  13. package/dist/alert-dialog/AlertDialogAction.d.ts +1 -1
  14. package/dist/alert-dialog/AlertDialogCancel.d.ts +1 -1
  15. package/dist/alert-dialog/AlertDialogTrigger.d.ts +1 -1
  16. package/dist/alert-dialog/index.js +1 -1
  17. package/dist/alert-dialog/index.js.map +1 -1
  18. package/dist/alert-dialog/index.mjs +53 -56
  19. package/dist/alert-dialog/index.mjs.map +1 -1
  20. package/dist/avatar/index.js +1 -1
  21. package/dist/avatar/index.mjs +2 -2
  22. package/dist/badge/BadgeItem.styles.d.ts +1 -1
  23. package/dist/badge/index.js +1 -1
  24. package/dist/badge/index.mjs +13 -13
  25. package/dist/breadcrumb/index.js +1 -1
  26. package/dist/breadcrumb/index.mjs +1 -1
  27. package/dist/button/Button.styles.d.ts +1 -1
  28. package/dist/button/index.js +1 -1
  29. package/dist/button/index.mjs +1 -1
  30. package/dist/{button-D0s-21qo.js → button-3vvMrf1L.js} +2 -2
  31. package/dist/{button-D0s-21qo.js.map → button-3vvMrf1L.js.map} +1 -1
  32. package/dist/{button-DwLTXeJX.mjs → button-DBNjh3Bi.mjs} +76 -76
  33. package/dist/{button-DwLTXeJX.mjs.map → button-DBNjh3Bi.mjs.map} +1 -1
  34. package/dist/card/Backdrop.d.ts +1 -1
  35. package/dist/card/Card.styles.d.ts +1 -1
  36. package/dist/card/Content.styles.d.ts +1 -1
  37. package/dist/card/Type.d.ts +1 -1
  38. package/dist/card/index.js +1 -1
  39. package/dist/card/index.mjs +53 -53
  40. package/dist/carousel/index.js +1 -1
  41. package/dist/carousel/index.mjs +2 -2
  42. package/dist/checkbox/CheckboxInput.styles.d.ts +1 -1
  43. package/dist/checkbox/index.js +1 -1
  44. package/dist/checkbox/index.mjs +1 -1
  45. package/dist/{checkbox-uSINHQYe.mjs → checkbox-BEo9AVSB.mjs} +26 -26
  46. package/dist/{checkbox-uSINHQYe.mjs.map → checkbox-BEo9AVSB.mjs.map} +1 -1
  47. package/dist/{checkbox-Cbewcw6G.js → checkbox-Cr60_jql.js} +2 -2
  48. package/dist/{checkbox-Cbewcw6G.js.map → checkbox-Cr60_jql.js.map} +1 -1
  49. package/dist/chip/Chip.styles.d.ts +1 -1
  50. package/dist/chip/index.js +1 -1
  51. package/dist/chip/index.mjs +86 -86
  52. package/dist/collapsible/index.js +1 -1
  53. package/dist/collapsible/index.js.map +1 -1
  54. package/dist/collapsible/index.mjs +18 -24
  55. package/dist/collapsible/index.mjs.map +1 -1
  56. package/dist/combobox/index.js +1 -1
  57. package/dist/combobox/index.mjs +4 -4
  58. package/dist/dialog/DialogClose.d.ts +1 -1
  59. package/dist/dialog/DialogTrigger.d.ts +1 -1
  60. package/dist/dialog/index.js +1 -1
  61. package/dist/dialog/index.js.map +1 -1
  62. package/dist/dialog/index.mjs +14 -12
  63. package/dist/dialog/index.mjs.map +1 -1
  64. package/dist/divider/index.js +1 -1
  65. package/dist/divider/index.mjs +26 -26
  66. package/dist/drawer/DrawerClose.d.ts +1 -1
  67. package/dist/drawer/DrawerTrigger.d.ts +1 -1
  68. package/dist/drawer/index.js +1 -1
  69. package/dist/drawer/index.js.map +1 -1
  70. package/dist/drawer/index.mjs +13 -11
  71. package/dist/drawer/index.mjs.map +1 -1
  72. package/dist/dropdown/index.js +1 -1
  73. package/dist/dropdown/index.mjs +2 -2
  74. package/dist/file-upload/index.js +1 -1
  75. package/dist/file-upload/index.mjs +3 -3
  76. package/dist/form-field/index.js +1 -1
  77. package/dist/form-field/index.mjs +1 -1
  78. package/dist/{form-field-B38U0zp8.js → form-field-DMHwopHt.js} +2 -2
  79. package/dist/{form-field-B38U0zp8.js.map → form-field-DMHwopHt.js.map} +1 -1
  80. package/dist/{form-field-DCKyhBmv.mjs → form-field-Doq4zLEX.mjs} +4 -4
  81. package/dist/{form-field-DCKyhBmv.mjs.map → form-field-Doq4zLEX.mjs.map} +1 -1
  82. package/dist/icon/Icon.styles.d.ts +1 -1
  83. package/dist/icon/index.js +1 -1
  84. package/dist/icon/index.mjs +1 -1
  85. package/dist/icon-CfEsla9z.js +2 -0
  86. package/dist/{icon-DY4l9nsc.js.map → icon-CfEsla9z.js.map} +1 -1
  87. package/dist/{icon-Bs-39J-H.mjs → icon-VM_Ys9Xn.mjs} +11 -11
  88. package/dist/{icon-Bs-39J-H.mjs.map → icon-VM_Ys9Xn.mjs.map} +1 -1
  89. package/dist/icon-button/index.js +1 -1
  90. package/dist/icon-button/index.mjs +1 -1
  91. package/dist/icon-button-B2TM0Xby.js +2 -0
  92. package/dist/{icon-button-DRFf308H.js.map → icon-button-B2TM0Xby.js.map} +1 -1
  93. package/dist/icon-button-CexCkoV0.mjs +29 -0
  94. package/dist/{icon-button-C1ThqdK1.mjs.map → icon-button-CexCkoV0.mjs.map} +1 -1
  95. package/dist/input/index.js +1 -1
  96. package/dist/input/index.mjs +1 -1
  97. package/dist/{input-BoxJZira.js → input-CADvgFpY.js} +2 -2
  98. package/dist/{input-BoxJZira.js.map → input-CADvgFpY.js.map} +1 -1
  99. package/dist/{input-Du9YSgAt.mjs → input-CmlNZ4Bo.mjs} +2 -2
  100. package/dist/{input-Du9YSgAt.mjs.map → input-CmlNZ4Bo.mjs.map} +1 -1
  101. package/dist/label/index.js +1 -1
  102. package/dist/label/index.mjs +1 -1
  103. package/dist/{label-DO48yda7.js → label-B085X0Sg.js} +2 -2
  104. package/dist/{label-DO48yda7.js.map → label-B085X0Sg.js.map} +1 -1
  105. package/dist/{label-RKaPen31.mjs → label-BqWu-wLT.mjs} +6 -6
  106. package/dist/{label-RKaPen31.mjs.map → label-BqWu-wLT.mjs.map} +1 -1
  107. package/dist/menu/MenuItemStyles.d.ts +1 -1
  108. package/dist/menu/index.js +1 -1
  109. package/dist/menu/index.js.map +1 -1
  110. package/dist/menu/index.mjs +131 -140
  111. package/dist/menu/index.mjs.map +1 -1
  112. package/dist/meter/MeterTrack.styles.d.ts +1 -1
  113. package/dist/pagination/index.js +1 -1
  114. package/dist/pagination/index.mjs +3 -3
  115. package/dist/popover/PopoverContent.styles.d.ts +1 -1
  116. package/dist/popover/index.js +1 -1
  117. package/dist/popover/index.mjs +1 -1
  118. package/dist/{popover-DVz0JvON.js → popover-B-mcHcLF.js} +2 -2
  119. package/dist/{popover-DVz0JvON.js.map → popover-B-mcHcLF.js.map} +1 -1
  120. package/dist/{popover-CGhSHQzb.mjs → popover-COqbFikI.mjs} +17 -17
  121. package/dist/{popover-CGhSHQzb.mjs.map → popover-COqbFikI.mjs.map} +1 -1
  122. package/dist/progress/ProgressIndicator.d.ts +1 -1
  123. package/dist/progress-tracker/index.js +1 -1
  124. package/dist/progress-tracker/index.mjs +1 -1
  125. package/dist/radio-group/RadioIndicator.styles.d.ts +1 -1
  126. package/dist/radio-group/RadioInput.styles.d.ts +1 -1
  127. package/dist/radio-group/index.js +1 -1
  128. package/dist/radio-group/index.mjs +37 -37
  129. package/dist/rating/index.js +1 -1
  130. package/dist/rating/index.mjs +2 -2
  131. package/dist/rating-display/index.js +1 -1
  132. package/dist/rating-display/index.mjs +1 -1
  133. package/dist/scrolling-list/index.js +1 -1
  134. package/dist/scrolling-list/index.mjs +3 -3
  135. package/dist/select/index.js +1 -1
  136. package/dist/select/index.mjs +1 -1
  137. package/dist/slider/SliderThumb.styles.d.ts +1 -1
  138. package/dist/slider/SliderTrack.styles.d.ts +1 -1
  139. package/dist/slider/index.js +1 -1
  140. package/dist/slider/index.mjs +2 -2
  141. package/dist/slot/index.js +1 -1
  142. package/dist/slot/index.mjs +3 -3
  143. package/dist/spinner/Spinner.styles.d.ts +1 -1
  144. package/dist/spinner/index.js +1 -1
  145. package/dist/spinner/index.mjs +1 -1
  146. package/dist/{spinner-CmPypfJR.js → spinner-BAreohbs.js} +2 -2
  147. package/dist/{spinner-CmPypfJR.js.map → spinner-BAreohbs.js.map} +1 -1
  148. package/dist/{spinner-TfGcjNm3.mjs → spinner-DnrZf01S.mjs} +9 -9
  149. package/dist/{spinner-TfGcjNm3.mjs.map → spinner-DnrZf01S.mjs.map} +1 -1
  150. package/dist/stepper/index.js +1 -1
  151. package/dist/stepper/index.mjs +3 -3
  152. package/dist/switch/SwitchInput.d.ts +1 -1
  153. package/dist/switch/index.js +1 -1
  154. package/dist/switch/index.js.map +1 -1
  155. package/dist/switch/index.mjs +43 -44
  156. package/dist/switch/index.mjs.map +1 -1
  157. package/dist/table/index.js +1 -1
  158. package/dist/table/index.mjs +3 -3
  159. package/dist/tabs/index.js +1 -1
  160. package/dist/tabs/index.js.map +1 -1
  161. package/dist/tabs/index.mjs +144 -153
  162. package/dist/tabs/index.mjs.map +1 -1
  163. package/dist/tag/Tag.styles.d.ts +1 -1
  164. package/dist/tag/index.js +1 -1
  165. package/dist/tag/index.mjs +37 -37
  166. package/dist/text-link/TextLink.d.ts +1 -1
  167. package/dist/textarea/index.js +1 -1
  168. package/dist/textarea/index.mjs +1 -1
  169. package/dist/toast/Toast.styles.d.ts +1 -1
  170. package/dist/toast/index.js +1 -1
  171. package/dist/toast/index.js.map +1 -1
  172. package/dist/toast/index.mjs +4 -4
  173. package/dist/toast/index.mjs.map +1 -1
  174. package/dist/toggle-group/index.js +1 -1
  175. package/dist/toggle-group/index.js.map +1 -1
  176. package/dist/toggle-group/index.mjs +16 -21
  177. package/dist/toggle-group/index.mjs.map +1 -1
  178. package/package.json +5 -5
  179. package/dist/accordion/useRenderSlot.d.ts +0 -3
  180. package/dist/alert-dialog/useRenderSlot.d.ts +0 -3
  181. package/dist/collapsible/useRenderSlot.d.ts +0 -3
  182. package/dist/drawer/useRenderSlot.d.ts +0 -3
  183. package/dist/icon-DY4l9nsc.js +0 -2
  184. package/dist/icon-button-C1ThqdK1.mjs +0 -29
  185. package/dist/icon-button-DRFf308H.js +0 -2
  186. package/dist/menu/useRenderSlot.d.ts +0 -1
  187. package/dist/tabs/useRenderSlot.d.ts +0 -1
  188. package/dist/toast/useRenderSlot.d.ts +0 -3
  189. package/dist/toggle-group/useRenderSlot.d.ts +0 -1
  190. package/dist/useRenderSlot-5CPC9Lkj.mjs +0 -11
  191. package/dist/useRenderSlot-5CPC9Lkj.mjs.map +0 -1
  192. package/dist/useRenderSlot-DHV0CegV.js +0 -2
  193. package/dist/useRenderSlot-DHV0CegV.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"button-DwLTXeJX.mjs","names":[],"sources":["../src/button/Button.appearance-styles.tsx","../src/button/variants/filled.ts","../src/button/variants/ghost.ts","../src/button/variants/outlined.ts","../src/button/variants/tinted.ts","../src/button/variants/contrast.ts","../src/button/Button.styles.tsx","../src/button/Button.tsx"],"sourcesContent":["import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const buttonAppearanceStyles = cva(\n [\n 'u-shadow-border-transition',\n 'box-border inline-flex items-center justify-center gap-md whitespace-nowrap',\n 'default:px-lg',\n 'rounded-button',\n 'text-body-1-highlight',\n 'focus-visible:u-outline',\n ],\n {\n variants: {\n /**\n * Add underline to the button text.\n */\n underline: {\n true: ['underline'],\n },\n /**\n * Semantic appearance of the button that combines design and intent.\n * When specified, this prop overrides both `design` and `intent`.\n *\n * - `primary`: Main action, filled background\n * - `secondary`: Secondary action, filled support background\n * - `tertiary`: Tertiary action, outlined with surface background\n * - `contrast`: Contrast action, surface background\n * - `ghost`: Link-style without background\n * - `success`: Success action, outlined with transparent background\n * - `danger`: Danger action, outlined with transparent background\n * - `boost`: Accent action, filled accent background\n * - `AI`: AI action, filled AI background\n */\n appearance: {\n primary: [\n 'bg-main',\n 'text-on-main',\n 'rounded-button',\n 'enabled:hover:bg-main-hovered',\n 'enabled:active:bg-main-hovered',\n 'enabled:focus-visible:bg-main-hovered',\n ],\n secondary: [\n 'bg-support',\n 'text-on-support',\n 'rounded-button',\n 'enabled:hover:bg-support-hovered',\n 'enabled:active:bg-support-hovered',\n 'enabled:focus-visible:bg-support-hovered',\n ],\n tertiary: [\n 'border-outline',\n 'border-sm',\n 'bg-surface',\n 'text-on-surface',\n 'rounded-button',\n 'enabled:hover:bg-surface-hovered',\n 'enabled:active:bg-surface-hovered',\n 'enabled:focus-visible:bg-surface-hovered',\n ],\n contrast: [\n 'bg-surface',\n 'text-on-surface',\n 'rounded-button',\n 'enabled:hover:bg-surface-hovered',\n 'enabled:active:bg-surface-hovered',\n 'enabled:focus-visible:bg-surface-hovered',\n ],\n ghost: ['text-on-surface default:-mx-md px-md enabled:hover:bg-surface-hovered'],\n success: [\n 'border-outline',\n 'border-sm',\n 'bg-transparent',\n 'text-success',\n 'rounded-button',\n 'enabled:hover:bg-success-container',\n 'enabled:active:bg-success-container',\n 'enabled:focus-visible:bg-success-container',\n ],\n danger: [\n 'border-outline',\n 'border-sm',\n 'bg-transparent',\n 'text-error',\n 'rounded-button',\n 'enabled:hover:bg-error-container',\n 'enabled:active:bg-error-container',\n 'enabled:focus-visible:bg-error-container',\n ],\n boost: [\n 'bg-accent',\n 'text-on-accent',\n 'rounded-button',\n 'enabled:hover:bg-accent-hovered',\n 'enabled:active:bg-accent-hovered',\n 'enabled:focus-visible:bg-accent-hovered',\n ],\n AI: [\n 'bg-ai',\n 'text-on-ai',\n 'rounded-button',\n 'enabled:hover:bg-ai-hovered',\n 'enabled:active:bg-ai-hovered',\n 'enabled:focus-visible:bg-ai-hovered',\n ],\n },\n /**\n * Size of the button.\n */\n size: makeVariants<'size', ['sm', 'md', 'lg']>({\n sm: ['min-w-sz-32 h-sz-32'],\n md: ['min-w-sz-44 h-sz-44'],\n lg: ['min-w-sz-56 h-sz-56'],\n }),\n /**\n * Disable the button, preventing user interaction and adding opacity.\n */\n disabled: {\n true: ['cursor-not-allowed opacity-dim-3'],\n false: ['cursor-pointer'],\n },\n },\n defaultVariants: {\n size: 'md',\n },\n }\n)\n\nexport type ButtonAppearanceStylesProps = VariantProps<typeof buttonAppearanceStyles>\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const filledVariants = [\n // Main\n {\n intent: 'main',\n design: 'filled',\n class: tw([\n 'bg-main',\n 'text-on-main',\n 'hover:bg-main-hovered',\n 'enabled:active:bg-main-hovered',\n 'focus-visible:bg-main-hovered',\n ]),\n },\n // Support\n {\n intent: 'support',\n design: 'filled',\n class: tw([\n 'bg-support',\n 'text-on-support',\n 'hover:bg-support-hovered',\n 'enabled:active:bg-support-hovered',\n 'focus-visible:bg-support-hovered',\n ]),\n },\n // Accent\n {\n intent: 'accent',\n design: 'filled',\n class: tw([\n 'bg-accent',\n 'text-on-accent',\n 'hover:bg-accent-hovered',\n 'enabled:active:bg-accent-hovered',\n 'focus-visible:bg-accent-hovered',\n ]),\n },\n // AI\n {\n intent: 'ai',\n design: 'filled',\n class: tw([\n 'bg-ai',\n 'text-on-ai',\n 'hover:bg-ai-hovered',\n 'enabled:active:bg-ai-hovered',\n 'focus-visible:bg-ai-hovered',\n ]),\n },\n // Success\n {\n intent: 'success',\n design: 'filled',\n class: tw([\n 'bg-success',\n 'text-on-success',\n 'hover:bg-success-hovered',\n 'enabled:active:bg-success-hovered',\n 'focus-visible:bg-success-hovered',\n ]),\n },\n // Alert\n {\n intent: 'alert',\n design: 'filled',\n class: tw([\n 'bg-alert',\n 'text-on-alert',\n 'hover:bg-alert-hovered',\n 'enabled:active:bg-alert-hovered',\n 'focus-visible:bg-alert-hovered',\n ]),\n },\n // Danger\n {\n intent: 'danger',\n design: 'filled',\n class: tw([\n 'text-on-error bg-error',\n 'hover:bg-error-hovered enabled:active:bg-error-hovered',\n 'focus-visible:bg-error-hovered',\n ]),\n },\n // Info\n {\n intent: 'info',\n design: 'filled',\n class: tw([\n 'text-on-error bg-info',\n 'hover:bg-info-hovered enabled:active:bg-info-hovered',\n 'focus-visible:bg-info-hovered',\n ]),\n },\n // Neutral\n {\n intent: 'neutral',\n design: 'filled',\n class: tw([\n 'bg-neutral',\n 'text-on-neutral',\n 'hover:bg-neutral-hovered',\n 'enabled:active:bg-neutral-hovered',\n 'focus-visible:bg-neutral-hovered',\n ]),\n },\n // Surface\n {\n intent: 'surface',\n design: 'filled',\n class: tw([\n 'bg-surface',\n 'text-on-surface',\n 'hover:bg-surface-hovered',\n 'enabled:active:bg-surface-hovered',\n 'focus-visible:bg-surface-hovered',\n ]),\n },\n {\n intent: 'surfaceInverse',\n design: 'filled',\n class: tw([\n 'bg-surface-inverse',\n 'text-on-surface-inverse',\n 'hover:bg-surface-inverse-hovered',\n 'enabled:active:bg-surface-inverse-hovered',\n 'focus-visible:bg-surface-inverse-hovered',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const ghostVariants = [\n {\n intent: 'main',\n design: 'ghost',\n class: tw([\n 'text-on-main-container',\n 'hover:bg-main/dim-5',\n 'enabled:active:bg-main/dim-5',\n 'focus-visible:bg-main/dim-5',\n ]),\n },\n {\n intent: 'support',\n design: 'ghost',\n class: tw([\n 'text-on-support-container',\n 'hover:bg-support/dim-5',\n 'enabled:active:bg-support/dim-5',\n 'focus-visible:bg-support/dim-5',\n ]),\n },\n {\n intent: 'accent',\n design: 'ghost',\n class: tw([\n 'text-on-accent-container',\n 'hover:bg-accent/dim-5',\n 'enabled:active:bg-accent/dim-5',\n 'focus-visible:bg-accent/dim-5',\n ]),\n },\n {\n intent: 'ai',\n design: 'ghost',\n class: tw([\n 'text-on-ai-container',\n 'hover:bg-ai/dim-5',\n 'enabled:active:bg-ai/dim-5',\n 'focus-visible:bg-ai/dim-5',\n ]),\n },\n {\n intent: 'success',\n design: 'ghost',\n class: tw([\n 'text-on-success-container',\n 'hover:bg-success/dim-5',\n 'enabled:active:bg-success/dim-5',\n 'focus-visible:bg-success/dim-5',\n ]),\n },\n {\n intent: 'alert',\n design: 'ghost',\n class: tw([\n 'text-on-alert-container',\n 'hover:bg-alert/dim-5',\n 'enabled:active:bg-alert/dim-5',\n 'focus-visible:bg-alert/dim-5',\n ]),\n },\n {\n intent: 'danger',\n design: 'ghost',\n class: tw([\n 'text-on-error-container',\n 'hover:bg-error/dim-5',\n 'enabled:active:bg-error/dim-5',\n 'focus-visible:bg-error/dim-5',\n ]),\n },\n {\n intent: 'info',\n design: 'ghost',\n class: tw([\n 'text-on-info-container',\n 'hover:bg-info/dim-5',\n 'enabled:active:bg-info/dim-5',\n 'focus-visible:bg-info/dim-5',\n ]),\n },\n {\n intent: 'neutral',\n design: 'ghost',\n class: tw([\n 'text-on-neutral-container',\n 'hover:bg-neutral/dim-5',\n 'enabled:active:bg-neutral/dim-5',\n 'focus-visible:bg-neutral/dim-5',\n ]),\n },\n {\n intent: 'surface',\n design: 'ghost',\n class: tw([\n 'text-surface',\n 'hover:bg-surface/dim-5',\n 'enabled:active:bg-surface/dim-5',\n 'focus-visible:bg-surface/dim-5',\n ]),\n },\n {\n intent: 'surfaceInverse',\n design: 'ghost',\n class: tw([\n 'text-surface-inverse',\n 'hover:bg-surface-inverse/dim-5',\n 'enabled:active:bg-surface-inverse/dim-5',\n 'focus-visible:bg-surface-inverse/dim-5',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const outlinedVariants = [\n {\n intent: 'main',\n design: 'outlined',\n class: tw([\n 'hover:bg-main/dim-5',\n 'enabled:active:bg-main/dim-5',\n 'focus-visible:bg-main/dim-5',\n 'text-main',\n ]),\n },\n {\n intent: 'support',\n design: 'outlined',\n class: tw([\n 'hover:bg-support/dim-5',\n 'enabled:active:bg-support/dim-5',\n 'focus-visible:bg-support/dim-5',\n 'text-support',\n ]),\n },\n {\n intent: 'accent',\n design: 'outlined',\n class: tw([\n 'hover:bg-accent/dim-5',\n 'enabled:active:bg-accent/dim-5',\n 'focus-visible:bg-accent/dim-5',\n 'text-accent',\n ]),\n },\n {\n intent: 'ai',\n design: 'outlined',\n class: tw([\n 'hover:bg-ai/dim-5',\n 'enabled:active:bg-ai/dim-5',\n 'focus-visible:bg-ai/dim-5',\n 'text-ai',\n ]),\n },\n {\n intent: 'success',\n design: 'outlined',\n class: tw([\n 'hover:bg-success/dim-5',\n 'enabled:active:bg-success/dim-5',\n 'focus-visible:bg-success/dim-5',\n 'text-success',\n ]),\n },\n {\n intent: 'alert',\n design: 'outlined',\n class: tw([\n 'hover:bg-alert/dim-5',\n 'enabled:active:bg-alert/dim-5',\n 'focus-visible:bg-alert/dim-5',\n 'text-alert',\n ]),\n },\n {\n intent: 'danger',\n design: 'outlined',\n class: tw([\n 'hover:bg-error/dim-5',\n 'enabled:active:bg-error/dim-5',\n 'focus-visible:bg-error/dim-5',\n 'text-error',\n ]),\n },\n {\n intent: 'info',\n design: 'outlined',\n class: tw([\n 'hover:bg-info/dim-5',\n 'enabled:active:bg-info/dim-5',\n 'focus-visible:bg-info/dim-5',\n 'text-info',\n ]),\n },\n {\n intent: 'neutral',\n design: 'outlined',\n class: tw([\n 'hover:bg-neutral/dim-5',\n 'enabled:active:bg-neutral/dim-5',\n 'focus-visible:bg-neutral/dim-5',\n 'text-neutral',\n ]),\n },\n {\n intent: 'surface',\n design: 'outlined',\n class: tw([\n 'hover:bg-surface/dim-5',\n 'enabled:active:bg-surface/dim-5',\n 'focus-visible:bg-surface/dim-5',\n 'text-surface',\n ]),\n },\n {\n intent: 'surfaceInverse',\n design: 'outlined',\n class: tw([\n 'hover:bg-surface-inverse/dim-5',\n 'enabled:active:bg-surface-inverse/dim-5',\n 'focus-visible:bg-surface-inverse/dim-5',\n 'text-surface-inverse',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const tintedVariants = [\n {\n intent: 'main',\n design: 'tinted',\n class: tw([\n 'bg-main-container',\n 'text-on-main-container',\n 'hover:bg-main-container-hovered',\n 'enabled:active:bg-main-container-hovered',\n 'focus-visible:bg-main-container-hovered',\n ]),\n },\n {\n intent: 'support',\n design: 'tinted',\n class: tw([\n 'bg-support-container',\n 'text-on-support-container',\n 'hover:bg-support-container-hovered',\n 'enabled:active:bg-support-container-hovered',\n 'focus-visible:bg-support-container-hovered',\n ]),\n },\n {\n intent: 'accent',\n design: 'tinted',\n class: tw([\n 'bg-accent-container',\n 'text-on-accent-container',\n 'hover:bg-accent-container-hovered',\n 'enabled:active:bg-accent-container-hovered',\n 'focus-visible:bg-accent-container-hovered',\n ]),\n },\n {\n intent: 'ai',\n design: 'tinted',\n class: tw([\n 'bg-ai-container',\n 'text-on-ai-container',\n 'hover:bg-ai-container-hovered',\n 'enabled:active:bg-ai-container-hovered',\n 'focus-visible:bg-ai-container-hovered',\n ]),\n },\n {\n intent: 'success',\n design: 'tinted',\n class: tw([\n 'bg-success-container',\n 'text-on-success-container',\n 'hover:bg-success-container-hovered',\n 'enabled:active:bg-success-container-hovered',\n 'focus-visible:bg-success-container-hovered',\n ]),\n },\n {\n intent: 'alert',\n design: 'tinted',\n class: tw([\n 'bg-alert-container',\n 'text-on-alert-container',\n 'hover:bg-alert-container-hovered',\n 'enabled:active:bg-alert-container-hovered',\n 'focus-visible:bg-alert-container-hovered',\n ]),\n },\n {\n intent: 'danger',\n design: 'tinted',\n class: tw([\n 'bg-error-container',\n 'text-on-error-container',\n 'hover:bg-error-container-hovered',\n 'enabled:active:bg-error-container-hovered',\n 'focus-visible:bg-error-container-hovered',\n ]),\n },\n {\n intent: 'info',\n design: 'tinted',\n class: tw([\n 'bg-info-container',\n 'text-on-info-container',\n 'hover:bg-info-container-hovered',\n 'enabled:active:bg-info-container-hovered',\n 'focus-visible:bg-info-container-hovered',\n ]),\n },\n {\n intent: 'neutral',\n design: 'tinted',\n class: tw([\n 'bg-neutral-container',\n 'text-on-neutral-container',\n 'hover:bg-neutral-container-hovered',\n 'enabled:active:bg-neutral-container-hovered',\n 'focus-visible:bg-neutral-container-hovered',\n ]),\n },\n {\n intent: 'surface',\n design: 'tinted',\n class: tw([\n 'bg-surface',\n 'text-on-surface',\n 'hover:bg-surface-hovered',\n 'enabled:active:bg-surface-hovered',\n 'focus-visible:bg-surface-hovered',\n ]),\n },\n {\n intent: 'surfaceInverse',\n design: 'tinted',\n class: tw([\n 'bg-surface-inverse',\n 'text-on-surface-inverse',\n 'hover:bg-surface-inverse-hovered',\n 'enabled:active:bg-surface-inverse-hovered',\n 'focus-visible:bg-surface-inverse-hovered',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const contrastVariants = [\n {\n intent: 'main',\n design: 'contrast',\n class: tw([\n 'text-on-main-contaier bg-surface',\n 'hover:bg-main-container-hovered',\n 'enabled:active:bg-main-container-hovered',\n 'focus-visible:bg-main-container-hovered',\n ]),\n },\n {\n intent: 'support',\n design: 'contrast',\n class: tw([\n 'text-on-support-container bg-surface',\n 'hover:bg-support-container-hovered',\n 'enabled:active:bg-support-container-hovered',\n 'focus-visible:bg-support-container-hovered',\n ]),\n },\n {\n intent: 'accent',\n design: 'contrast',\n class: tw([\n 'text-on-accent-container bg-surface',\n 'hover:bg-accent-container-hovered',\n 'enabled:active:bg-accent-container-hovered',\n 'focus-visible:bg-accent-container-hovered',\n ]),\n },\n {\n intent: 'ai',\n design: 'contrast',\n class: tw([\n 'text-on-ai-container bg-surface',\n 'hover:bg-ai-container-hovered',\n 'enabled:active:bg-ai-container-hovered',\n 'focus-visible:bg-ai-container-hovered',\n ]),\n },\n {\n intent: 'success',\n design: 'contrast',\n class: tw([\n 'text-on-success-container bg-surface',\n 'hover:bg-success-container-hovered',\n 'enabled:active:bg-success-container-hovered',\n 'focus-visible:bg-success-container-hovered',\n ]),\n },\n {\n intent: 'alert',\n design: 'contrast',\n class: tw([\n 'text-on-alert-container bg-surface',\n 'hover:bg-alert-container-hovered',\n 'enabled:active:bg-alert-container-hovered',\n 'focus-visible:bg-alert-container-hovered',\n ]),\n },\n {\n intent: 'danger',\n design: 'contrast',\n class: tw([\n 'text-on-error-container bg-surface',\n 'hover:bg-error-container-hovered',\n 'enabled:active:bg-error-container-hovered',\n 'focus-visible:bg-error-container-hovered',\n ]),\n },\n {\n intent: 'info',\n design: 'contrast',\n class: tw([\n 'text-on-info-container bg-surface',\n 'hover:bg-info-container-hovered',\n 'enabled:active:bg-info-container-hovered',\n 'focus-visible:bg-info-container-hovered',\n ]),\n },\n {\n intent: 'neutral',\n design: 'contrast',\n class: tw([\n 'text-on-neutral-container bg-surface',\n 'hover:bg-neutral-container-hovered',\n 'enabled:active:bg-neutral-container-hovered',\n 'focus-visible:bg-neutral-container-hovered',\n ]),\n },\n {\n intent: 'surface',\n design: 'contrast',\n class: tw([\n 'text-on-surface bg-surface',\n 'hover:bg-surface-hovered',\n 'enabled:active:bg-surface-hovered',\n 'focus-visible:bg-surface-hovered',\n ]),\n },\n {\n intent: 'surfaceInverse',\n design: 'contrast',\n class: tw([\n 'text-on-surface-inverse bg-surface-inverse',\n 'hover:bg-surface-inverse-hovered',\n 'enabled:active:bg-surface-inverse-hovered',\n 'focus-visible:bg-surface-inverse-hovered',\n ]),\n },\n] as const\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nimport {\n contrastVariants,\n filledVariants,\n ghostVariants,\n outlinedVariants,\n tintedVariants,\n} from './variants'\n\nexport const buttonStyles = cva(\n [\n 'u-shadow-border-transition',\n 'box-border inline-flex items-center justify-center gap-md whitespace-nowrap',\n 'default:px-lg',\n 'text-body-1-highlight',\n 'focus-visible:u-outline',\n ],\n {\n variants: {\n /**\n * Main style of the button.\n *\n * - `filled`: Button will be plain.\n *\n * - `outlined`: Button will be transparent with an outline.\n *\n * - `tinted`: Button will be filled but using a lighter color scheme.\n *\n * - `ghost`: Button will look like a link. No borders, plain text.\n *\n * - `contrast`: Button will be surface filled. No borders, plain text.\n *\n */\n design: makeVariants<'design', ['filled', 'outlined', 'tinted', 'ghost', 'contrast']>({\n filled: [],\n outlined: ['bg-transparent', 'border-sm', 'border-current'],\n tinted: [],\n ghost: ['default:-mx-md px-md hover:bg-main/dim-5'],\n contrast: [],\n }),\n underline: {\n true: ['underline'],\n },\n /**\n * Color scheme of the button.\n */\n intent: makeVariants<\n 'intent',\n [\n 'main',\n 'support',\n 'accent',\n 'ai',\n 'success',\n 'alert',\n 'danger',\n 'info',\n 'neutral',\n 'surface',\n 'surfaceInverse',\n ]\n >({\n main: [],\n support: [],\n accent: [],\n ai: [],\n success: [],\n alert: [],\n danger: [],\n info: [],\n neutral: [],\n surface: [],\n surfaceInverse: [],\n }),\n /**\n * Size of the button.\n */\n size: makeVariants<'size', ['sm', 'md', 'lg']>({\n sm: ['min-w-sz-32', 'h-sz-32'],\n md: ['min-w-sz-44', 'h-sz-44'],\n lg: ['min-w-sz-56', 'h-sz-56'],\n }),\n /**\n * Shape of the button.\n */\n shape: makeVariants<'shape', ['rounded', 'square', 'pill']>({\n rounded: ['rounded-button'],\n square: ['rounded-0'],\n pill: ['rounded-full'],\n }),\n /**\n * Disable the button, preventing user interaction and adding opacity.\n */\n disabled: {\n true: ['cursor-not-allowed', 'opacity-dim-3'],\n false: ['cursor-pointer'],\n },\n },\n compoundVariants: [\n ...filledVariants,\n ...outlinedVariants,\n ...tintedVariants,\n ...ghostVariants,\n ...contrastVariants,\n ],\n defaultVariants: {\n design: 'filled',\n intent: 'main',\n size: 'md',\n shape: 'rounded',\n },\n }\n)\n\nexport type ButtonStylesProps = VariantProps<typeof buttonStyles>\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, type DOMAttributes, Ref, useMemo } from 'react'\n\nimport { Slot, wrapPolymorphicSlot } from '../slot'\nimport { Spinner, type SpinnerProps } from '../spinner'\nimport {\n buttonAppearanceStyles,\n type ButtonAppearanceStylesProps,\n} from './Button.appearance-styles'\nimport { buttonStyles, type ButtonStylesProps } from './Button.styles'\n\nexport interface ButtonProps\n extends\n Omit<ComponentPropsWithoutRef<'button'>, 'disabled'>,\n Omit<ButtonStylesProps, 'design' | 'intent'>,\n Pick<ButtonAppearanceStylesProps, 'appearance'> {\n /**\n * Main style of the button.\n */\n design?: ButtonStylesProps['design']\n /**\n * Color scheme of the button.\n */\n intent?: ButtonStylesProps['intent']\n /**\n * Combined appearance preset (replaces `design` and `intent`).\n * @beta This API is in beta and may change in future versions.\n */\n appearance?: ButtonAppearanceStylesProps['appearance']\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * Display a spinner to indicate to the user that the button is loading something after they interacted with it.\n */\n isLoading?: boolean\n /**\n * If your loading state should only display a spinner, it is better to specify a label for it (a11y).\n */\n loadingLabel?: string\n /**\n * If your loading state should also display a label, you can use this prop instead of `loadingLabel`.\n * **Please note that using this can result in layout shifting when the Button goes from loading state to normal state.**\n */\n loadingText?: string\n /**\n * When true, the button is non-interactive and has disabled styling but stays focusable (uses\n * `aria-disabled` instead of native `disabled`). Use for cases where the user should be able to\n * focus the control to discover why it is disabled (e.g. form submit, bulk bar actions).\n */\n ariaDisabled?: boolean\n ref?: Ref<HTMLButtonElement>\n}\n\ntype DOMAttributesEventHandler = keyof Omit<\n DOMAttributes<HTMLButtonElement>,\n 'children' | 'dangerouslySetInnerHTML'\n>\n\nconst blockedEventHandlers: DOMAttributesEventHandler[] = [\n 'onClick',\n 'onMouseDown',\n 'onMouseUp',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseOver',\n 'onMouseOut',\n 'onKeyDown',\n 'onKeyPress',\n 'onKeyUp',\n 'onSubmit',\n]\n\n/**\n * A clickable element that triggers an action or event when activated by the user.\n */\nexport const Button = ({\n children,\n design = 'filled',\n disabled = false,\n ariaDisabled = false,\n intent = 'main',\n isLoading = false,\n loadingLabel,\n loadingText,\n shape = 'pill',\n size = 'md',\n asChild,\n className,\n underline = false,\n appearance,\n ref,\n ...others\n}: ButtonProps) => {\n const Component = asChild ? Slot : 'button'\n\n const shouldNotInteract = !!disabled || !!ariaDisabled || isLoading\n const useNativeDisabled = !!disabled && !ariaDisabled\n\n const disabledEventHandlers = useMemo(() => {\n const result: Partial<Record<DOMAttributesEventHandler, (e: React.SyntheticEvent) => void>> = {}\n\n if (shouldNotInteract) {\n blockedEventHandlers.forEach(key => {\n result[key] = (e: React.SyntheticEvent) => {\n // Allow Tab to move focus away from the button\n if (e.type === 'keydown' && (e as React.KeyboardEvent).key === 'Tab') return\n /*\n Setting handlers to `undefined` (e.g. `result[eventHandler] = undefined`) only blocks JS-level handlers, it does not prevent native browser behavior.\n Calling preventDefault() here also blocks native form submission when type=\"submit\", since the browser triggers it from the click chain.\n */\n e.preventDefault()\n }\n })\n }\n\n return result\n }, [shouldNotInteract])\n\n const spinnerProps = {\n size: 'current' as SpinnerProps['size'],\n className: loadingText ? 'inline-block' : 'absolute',\n ...(loadingLabel && { 'aria-label': loadingLabel }),\n }\n\n // Use appearance styles when appearance is specified, otherwise use legacy styles\n const buttonClassName = appearance\n ? buttonAppearanceStyles({\n className,\n appearance,\n disabled: shouldNotInteract,\n size,\n underline,\n })\n : buttonStyles({\n className,\n design,\n disabled: shouldNotInteract,\n intent,\n shape,\n size,\n underline,\n })\n\n return (\n <Component\n data-spark-component=\"button\"\n {...(Component === 'button' && { type: 'button' })}\n ref={ref}\n className={buttonClassName}\n disabled={useNativeDisabled}\n aria-disabled={shouldNotInteract ? true : undefined}\n aria-busy={isLoading}\n aria-live={isLoading ? 'assertive' : 'off'}\n {...others}\n {...disabledEventHandlers}\n >\n {wrapPolymorphicSlot(asChild, children, slotted =>\n isLoading ? (\n <>\n <Spinner {...spinnerProps} />\n {loadingText}\n\n <div\n aria-hidden\n className={cx('gap-md', loadingText ? 'hidden' : 'inline-flex opacity-0')}\n >\n {slotted}\n </div>\n </>\n ) : (\n slotted\n )\n )}\n </Component>\n )\n}\n\nButton.displayName = 'Button'\n"],"mappings":";;;;;;;AAGA,IAAa,IAAyB,EACpC;CACE;CACA;CACA;CACA;CACA;CACA;AACF,GACA;CACE,UAAU;EAIR,WAAW,EACT,MAAM,CAAC,WAAW,EACpB;EAeA,YAAY;GACV,SAAS;IACP;IACA;IACA;IACA;IACA;IACA;GACF;GACA,WAAW;IACT;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU;IACR;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU;IACR;IACA;IACA;IACA;IACA;IACA;GACF;GACA,OAAO,CAAC,uEAAuE;GAC/E,SAAS;IACP;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,QAAQ;IACN;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;GACF;GACA,IAAI;IACF;IACA;IACA;IACA;IACA;IACA;GACF;EACF;EAIA,MAAM,EAAyC;GAC7C,IAAI,CAAC,qBAAqB;GAC1B,IAAI,CAAC,qBAAqB;GAC1B,IAAI,CAAC,qBAAqB;EAC5B,CAAC;EAID,UAAU;GACR,MAAM,CAAC,kCAAkC;GACzC,OAAO,CAAC,gBAAgB;EAC1B;CACF;CACA,iBAAiB,EACf,MAAM,KACR;AACF,CACF,GC7Ha,IAAiB;CAE5B;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CAEA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CAEA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CAEA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CAEA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CAEA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CAEA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;EACF,CAAC;CACH;CAEA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;EACF,CAAC;CACH;CAEA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CAEA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;AACF,GChIa,IAAgB;CAC3B;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;AACF,GC/Ga,IAAmB;CAC9B;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;AACF,GC/Ga,IAAiB;CAC5B;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;AACF,GC1Ha,IAAmB;CAC9B;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;AACF,GCtGa,IAAe,EAC1B;CACE;CACA;CACA;CACA;CACA;AACF,GACA;CACE,UAAU;EAeR,QAAQ,EAA8E;GACpF,QAAQ,CAAC;GACT,UAAU;IAAC;IAAkB;IAAa;GAAgB;GAC1D,QAAQ,CAAC;GACT,OAAO,CAAC,0CAA0C;GAClD,UAAU,CAAC;EACb,CAAC;EACD,WAAW,EACT,MAAM,CAAC,WAAW,EACpB;EAIA,QAAQ,EAeN;GACA,MAAM,CAAC;GACP,SAAS,CAAC;GACV,QAAQ,CAAC;GACT,IAAI,CAAC;GACL,SAAS,CAAC;GACV,OAAO,CAAC;GACR,QAAQ,CAAC;GACT,MAAM,CAAC;GACP,SAAS,CAAC;GACV,SAAS,CAAC;GACV,gBAAgB,CAAC;EACnB,CAAC;EAID,MAAM,EAAyC;GAC7C,IAAI,CAAC,eAAe,SAAS;GAC7B,IAAI,CAAC,eAAe,SAAS;GAC7B,IAAI,CAAC,eAAe,SAAS;EAC/B,CAAC;EAID,OAAO,EAAqD;GAC1D,SAAS,CAAC,gBAAgB;GAC1B,QAAQ,CAAC,WAAW;GACpB,MAAM,CAAC,cAAc;EACvB,CAAC;EAID,UAAU;GACR,MAAM,CAAC,sBAAsB,eAAe;GAC5C,OAAO,CAAC,gBAAgB;EAC1B;CACF;CACA,kBAAkB;EAChB,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG;CACL;CACA,iBAAiB;EACf,QAAQ;EACR,QAAQ;EACR,MAAM;EACN,OAAO;CACT;AACF,CACF,GCtDM,IAAoD;CACxD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAKa,KAAU,EACrB,aACA,YAAS,UACT,cAAW,IACX,kBAAe,IACf,YAAS,QACT,eAAY,IACZ,iBACA,gBACA,WAAQ,QACR,UAAO,MACP,YACA,cACA,eAAY,IACZ,eACA,QACA,GAAG,QACc;CACjB,IAAM,IAAY,IAAU,IAAO,UAE7B,IAAoB,CAAC,CAAC,KAAY,CAAC,CAAC,KAAgB,GACpD,IAAoB,CAAC,CAAC,KAAY,CAAC,GAEnC,IAAwB,QAAc;EAC1C,IAAM,IAAwF,CAAC;EAgB/F,OAdI,KACF,EAAqB,SAAQ,MAAO;GAClC,EAAO,MAAQ,MAA4B;IAErC,EAAE,SAAS,aAAc,EAA0B,QAAQ,SAK/D,EAAE,eAAe;GACnB;EACF,CAAC,GAGI;CACT,GAAG,CAAC,CAAiB,CAAC,GAEhB,IAAe;EACnB,MAAM;EACN,WAAW,IAAc,iBAAiB;EAC1C,GAAI,KAAgB,EAAE,cAAc,EAAa;CACnD,GAGM,IAAkB,IACpB,EAAuB;EACrB;EACA;EACA,UAAU;EACV;EACA;CACF,CAAC,IACD,EAAa;EACX;EACA;EACA,UAAU;EACV;EACA;EACA;EACA;CACF,CAAC;CAEL,OACE,kBAAC,GAAD;EACE,wBAAqB;EACrB,GAAK,MAAc,YAAY,EAAE,MAAM,SAAS;EAC3C;EACL,WAAW;EACX,UAAU;EACV,iBAAe,IAAoB,KAAO,KAAA;EAC1C,aAAW;EACX,aAAW,IAAY,cAAc;EACrC,GAAI;EACJ,GAAI;YAEH,EAAoB,GAAS,IAAU,MACtC,IACE,kBAAA,GAAA,EAAA,UAAA;GACE,kBAAC,GAAD,EAAS,GAAI,EAAe,CAAA;GAC3B;GAED,kBAAC,OAAD;IACE,eAAA;IACA,WAAW,EAAG,UAAU,IAAc,WAAW,uBAAuB;cAEvE;GACE,CAAA;EACL,EAAA,CAAA,IAEF,CAEJ;CACS,CAAA;AAEf;AAEA,EAAO,cAAc"}
1
+ {"version":3,"file":"button-DBNjh3Bi.mjs","names":[],"sources":["../src/button/Button.appearance-styles.tsx","../src/button/variants/filled.ts","../src/button/variants/ghost.ts","../src/button/variants/outlined.ts","../src/button/variants/tinted.ts","../src/button/variants/contrast.ts","../src/button/Button.styles.tsx","../src/button/Button.tsx"],"sourcesContent":["import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const buttonAppearanceStyles = cva(\n [\n 'u-shadow-border-transition',\n 'box-border inline-flex items-center justify-center gap-md whitespace-nowrap',\n 'default:px-lg',\n 'rounded-button',\n 'text-body-1-highlight',\n 'focus-visible:u-outline',\n ],\n {\n variants: {\n /**\n * Add underline to the button text.\n */\n underline: {\n true: ['underline'],\n },\n /**\n * Semantic appearance of the button that combines design and intent.\n * When specified, this prop overrides both `design` and `intent`.\n *\n * - `primary`: Main action, filled background\n * - `secondary`: Secondary action, filled support background\n * - `tertiary`: Tertiary action, outlined with surface background\n * - `contrast`: Contrast action, surface background\n * - `ghost`: Link-style without background\n * - `success`: Success action, outlined with transparent background\n * - `danger`: Danger action, outlined with transparent background\n * - `boost`: Accent action, filled accent background\n * - `AI`: AI action, filled AI background\n */\n appearance: {\n primary: [\n 'bg-main',\n 'text-on-main',\n 'rounded-button',\n 'enabled:hover:bg-main-hovered',\n 'enabled:active:bg-main-hovered',\n 'enabled:focus-visible:bg-main-hovered',\n ],\n secondary: [\n 'bg-support',\n 'text-on-support',\n 'rounded-button',\n 'enabled:hover:bg-support-hovered',\n 'enabled:active:bg-support-hovered',\n 'enabled:focus-visible:bg-support-hovered',\n ],\n tertiary: [\n 'border-outline',\n 'border-sm',\n 'bg-surface',\n 'text-on-surface',\n 'rounded-button',\n 'enabled:hover:bg-surface-hovered',\n 'enabled:active:bg-surface-hovered',\n 'enabled:focus-visible:bg-surface-hovered',\n ],\n contrast: [\n 'bg-surface',\n 'text-on-surface',\n 'rounded-button',\n 'enabled:hover:bg-surface-hovered',\n 'enabled:active:bg-surface-hovered',\n 'enabled:focus-visible:bg-surface-hovered',\n ],\n ghost: ['text-on-surface default:-mx-md px-md enabled:hover:bg-surface-hovered'],\n success: [\n 'border-outline',\n 'border-sm',\n 'bg-transparent',\n 'text-success',\n 'rounded-button',\n 'enabled:hover:bg-success-container',\n 'enabled:active:bg-success-container',\n 'enabled:focus-visible:bg-success-container',\n ],\n danger: [\n 'border-outline',\n 'border-sm',\n 'bg-transparent',\n 'text-error',\n 'rounded-button',\n 'enabled:hover:bg-error-container',\n 'enabled:active:bg-error-container',\n 'enabled:focus-visible:bg-error-container',\n ],\n boost: [\n 'bg-accent',\n 'text-on-accent',\n 'rounded-button',\n 'enabled:hover:bg-accent-hovered',\n 'enabled:active:bg-accent-hovered',\n 'enabled:focus-visible:bg-accent-hovered',\n ],\n AI: [\n 'bg-ai',\n 'text-on-ai',\n 'rounded-button',\n 'enabled:hover:bg-ai-hovered',\n 'enabled:active:bg-ai-hovered',\n 'enabled:focus-visible:bg-ai-hovered',\n ],\n },\n /**\n * Size of the button.\n */\n size: makeVariants<'size', ['sm', 'md', 'lg']>({\n sm: ['min-w-sz-32 h-sz-32'],\n md: ['min-w-sz-44 h-sz-44'],\n lg: ['min-w-sz-56 h-sz-56'],\n }),\n /**\n * Disable the button, preventing user interaction and adding opacity.\n */\n disabled: {\n true: ['cursor-not-allowed opacity-dim-3'],\n false: ['cursor-pointer'],\n },\n },\n defaultVariants: {\n size: 'md',\n },\n }\n)\n\nexport type ButtonAppearanceStylesProps = VariantProps<typeof buttonAppearanceStyles>\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const filledVariants = [\n // Main\n {\n intent: 'main',\n design: 'filled',\n class: tw([\n 'bg-main',\n 'text-on-main',\n 'hover:bg-main-hovered',\n 'enabled:active:bg-main-hovered',\n 'focus-visible:bg-main-hovered',\n ]),\n },\n // Support\n {\n intent: 'support',\n design: 'filled',\n class: tw([\n 'bg-support',\n 'text-on-support',\n 'hover:bg-support-hovered',\n 'enabled:active:bg-support-hovered',\n 'focus-visible:bg-support-hovered',\n ]),\n },\n // Accent\n {\n intent: 'accent',\n design: 'filled',\n class: tw([\n 'bg-accent',\n 'text-on-accent',\n 'hover:bg-accent-hovered',\n 'enabled:active:bg-accent-hovered',\n 'focus-visible:bg-accent-hovered',\n ]),\n },\n // AI\n {\n intent: 'ai',\n design: 'filled',\n class: tw([\n 'bg-ai',\n 'text-on-ai',\n 'hover:bg-ai-hovered',\n 'enabled:active:bg-ai-hovered',\n 'focus-visible:bg-ai-hovered',\n ]),\n },\n // Success\n {\n intent: 'success',\n design: 'filled',\n class: tw([\n 'bg-success',\n 'text-on-success',\n 'hover:bg-success-hovered',\n 'enabled:active:bg-success-hovered',\n 'focus-visible:bg-success-hovered',\n ]),\n },\n // Alert\n {\n intent: 'alert',\n design: 'filled',\n class: tw([\n 'bg-alert',\n 'text-on-alert',\n 'hover:bg-alert-hovered',\n 'enabled:active:bg-alert-hovered',\n 'focus-visible:bg-alert-hovered',\n ]),\n },\n // Danger\n {\n intent: 'danger',\n design: 'filled',\n class: tw([\n 'text-on-error bg-error',\n 'hover:bg-error-hovered enabled:active:bg-error-hovered',\n 'focus-visible:bg-error-hovered',\n ]),\n },\n // Info\n {\n intent: 'info',\n design: 'filled',\n class: tw([\n 'text-on-error bg-info',\n 'hover:bg-info-hovered enabled:active:bg-info-hovered',\n 'focus-visible:bg-info-hovered',\n ]),\n },\n // Neutral\n {\n intent: 'neutral',\n design: 'filled',\n class: tw([\n 'bg-neutral',\n 'text-on-neutral',\n 'hover:bg-neutral-hovered',\n 'enabled:active:bg-neutral-hovered',\n 'focus-visible:bg-neutral-hovered',\n ]),\n },\n // Surface\n {\n intent: 'surface',\n design: 'filled',\n class: tw([\n 'bg-surface',\n 'text-on-surface',\n 'hover:bg-surface-hovered',\n 'enabled:active:bg-surface-hovered',\n 'focus-visible:bg-surface-hovered',\n ]),\n },\n {\n intent: 'surfaceInverse',\n design: 'filled',\n class: tw([\n 'bg-surface-inverse',\n 'text-on-surface-inverse',\n 'hover:bg-surface-inverse-hovered',\n 'enabled:active:bg-surface-inverse-hovered',\n 'focus-visible:bg-surface-inverse-hovered',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const ghostVariants = [\n {\n intent: 'main',\n design: 'ghost',\n class: tw([\n 'text-on-main-container',\n 'hover:bg-main/dim-5',\n 'enabled:active:bg-main/dim-5',\n 'focus-visible:bg-main/dim-5',\n ]),\n },\n {\n intent: 'support',\n design: 'ghost',\n class: tw([\n 'text-on-support-container',\n 'hover:bg-support/dim-5',\n 'enabled:active:bg-support/dim-5',\n 'focus-visible:bg-support/dim-5',\n ]),\n },\n {\n intent: 'accent',\n design: 'ghost',\n class: tw([\n 'text-on-accent-container',\n 'hover:bg-accent/dim-5',\n 'enabled:active:bg-accent/dim-5',\n 'focus-visible:bg-accent/dim-5',\n ]),\n },\n {\n intent: 'ai',\n design: 'ghost',\n class: tw([\n 'text-on-ai-container',\n 'hover:bg-ai/dim-5',\n 'enabled:active:bg-ai/dim-5',\n 'focus-visible:bg-ai/dim-5',\n ]),\n },\n {\n intent: 'success',\n design: 'ghost',\n class: tw([\n 'text-on-success-container',\n 'hover:bg-success/dim-5',\n 'enabled:active:bg-success/dim-5',\n 'focus-visible:bg-success/dim-5',\n ]),\n },\n {\n intent: 'alert',\n design: 'ghost',\n class: tw([\n 'text-on-alert-container',\n 'hover:bg-alert/dim-5',\n 'enabled:active:bg-alert/dim-5',\n 'focus-visible:bg-alert/dim-5',\n ]),\n },\n {\n intent: 'danger',\n design: 'ghost',\n class: tw([\n 'text-on-error-container',\n 'hover:bg-error/dim-5',\n 'enabled:active:bg-error/dim-5',\n 'focus-visible:bg-error/dim-5',\n ]),\n },\n {\n intent: 'info',\n design: 'ghost',\n class: tw([\n 'text-on-info-container',\n 'hover:bg-info/dim-5',\n 'enabled:active:bg-info/dim-5',\n 'focus-visible:bg-info/dim-5',\n ]),\n },\n {\n intent: 'neutral',\n design: 'ghost',\n class: tw([\n 'text-on-neutral-container',\n 'hover:bg-neutral/dim-5',\n 'enabled:active:bg-neutral/dim-5',\n 'focus-visible:bg-neutral/dim-5',\n ]),\n },\n {\n intent: 'surface',\n design: 'ghost',\n class: tw([\n 'text-surface',\n 'hover:bg-surface/dim-5',\n 'enabled:active:bg-surface/dim-5',\n 'focus-visible:bg-surface/dim-5',\n ]),\n },\n {\n intent: 'surfaceInverse',\n design: 'ghost',\n class: tw([\n 'text-surface-inverse',\n 'hover:bg-surface-inverse/dim-5',\n 'enabled:active:bg-surface-inverse/dim-5',\n 'focus-visible:bg-surface-inverse/dim-5',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const outlinedVariants = [\n {\n intent: 'main',\n design: 'outlined',\n class: tw([\n 'hover:bg-main/dim-5',\n 'enabled:active:bg-main/dim-5',\n 'focus-visible:bg-main/dim-5',\n 'text-main',\n ]),\n },\n {\n intent: 'support',\n design: 'outlined',\n class: tw([\n 'hover:bg-support/dim-5',\n 'enabled:active:bg-support/dim-5',\n 'focus-visible:bg-support/dim-5',\n 'text-support',\n ]),\n },\n {\n intent: 'accent',\n design: 'outlined',\n class: tw([\n 'hover:bg-accent/dim-5',\n 'enabled:active:bg-accent/dim-5',\n 'focus-visible:bg-accent/dim-5',\n 'text-accent',\n ]),\n },\n {\n intent: 'ai',\n design: 'outlined',\n class: tw([\n 'hover:bg-ai/dim-5',\n 'enabled:active:bg-ai/dim-5',\n 'focus-visible:bg-ai/dim-5',\n 'text-ai',\n ]),\n },\n {\n intent: 'success',\n design: 'outlined',\n class: tw([\n 'hover:bg-success/dim-5',\n 'enabled:active:bg-success/dim-5',\n 'focus-visible:bg-success/dim-5',\n 'text-success',\n ]),\n },\n {\n intent: 'alert',\n design: 'outlined',\n class: tw([\n 'hover:bg-alert/dim-5',\n 'enabled:active:bg-alert/dim-5',\n 'focus-visible:bg-alert/dim-5',\n 'text-alert',\n ]),\n },\n {\n intent: 'danger',\n design: 'outlined',\n class: tw([\n 'hover:bg-error/dim-5',\n 'enabled:active:bg-error/dim-5',\n 'focus-visible:bg-error/dim-5',\n 'text-error',\n ]),\n },\n {\n intent: 'info',\n design: 'outlined',\n class: tw([\n 'hover:bg-info/dim-5',\n 'enabled:active:bg-info/dim-5',\n 'focus-visible:bg-info/dim-5',\n 'text-info',\n ]),\n },\n {\n intent: 'neutral',\n design: 'outlined',\n class: tw([\n 'hover:bg-neutral/dim-5',\n 'enabled:active:bg-neutral/dim-5',\n 'focus-visible:bg-neutral/dim-5',\n 'text-neutral',\n ]),\n },\n {\n intent: 'surface',\n design: 'outlined',\n class: tw([\n 'hover:bg-surface/dim-5',\n 'enabled:active:bg-surface/dim-5',\n 'focus-visible:bg-surface/dim-5',\n 'text-surface',\n ]),\n },\n {\n intent: 'surfaceInverse',\n design: 'outlined',\n class: tw([\n 'hover:bg-surface-inverse/dim-5',\n 'enabled:active:bg-surface-inverse/dim-5',\n 'focus-visible:bg-surface-inverse/dim-5',\n 'text-surface-inverse',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const tintedVariants = [\n {\n intent: 'main',\n design: 'tinted',\n class: tw([\n 'bg-main-container',\n 'text-on-main-container',\n 'hover:bg-main-container-hovered',\n 'enabled:active:bg-main-container-hovered',\n 'focus-visible:bg-main-container-hovered',\n ]),\n },\n {\n intent: 'support',\n design: 'tinted',\n class: tw([\n 'bg-support-container',\n 'text-on-support-container',\n 'hover:bg-support-container-hovered',\n 'enabled:active:bg-support-container-hovered',\n 'focus-visible:bg-support-container-hovered',\n ]),\n },\n {\n intent: 'accent',\n design: 'tinted',\n class: tw([\n 'bg-accent-container',\n 'text-on-accent-container',\n 'hover:bg-accent-container-hovered',\n 'enabled:active:bg-accent-container-hovered',\n 'focus-visible:bg-accent-container-hovered',\n ]),\n },\n {\n intent: 'ai',\n design: 'tinted',\n class: tw([\n 'bg-ai-container',\n 'text-on-ai-container',\n 'hover:bg-ai-container-hovered',\n 'enabled:active:bg-ai-container-hovered',\n 'focus-visible:bg-ai-container-hovered',\n ]),\n },\n {\n intent: 'success',\n design: 'tinted',\n class: tw([\n 'bg-success-container',\n 'text-on-success-container',\n 'hover:bg-success-container-hovered',\n 'enabled:active:bg-success-container-hovered',\n 'focus-visible:bg-success-container-hovered',\n ]),\n },\n {\n intent: 'alert',\n design: 'tinted',\n class: tw([\n 'bg-alert-container',\n 'text-on-alert-container',\n 'hover:bg-alert-container-hovered',\n 'enabled:active:bg-alert-container-hovered',\n 'focus-visible:bg-alert-container-hovered',\n ]),\n },\n {\n intent: 'danger',\n design: 'tinted',\n class: tw([\n 'bg-error-container',\n 'text-on-error-container',\n 'hover:bg-error-container-hovered',\n 'enabled:active:bg-error-container-hovered',\n 'focus-visible:bg-error-container-hovered',\n ]),\n },\n {\n intent: 'info',\n design: 'tinted',\n class: tw([\n 'bg-info-container',\n 'text-on-info-container',\n 'hover:bg-info-container-hovered',\n 'enabled:active:bg-info-container-hovered',\n 'focus-visible:bg-info-container-hovered',\n ]),\n },\n {\n intent: 'neutral',\n design: 'tinted',\n class: tw([\n 'bg-neutral-container',\n 'text-on-neutral-container',\n 'hover:bg-neutral-container-hovered',\n 'enabled:active:bg-neutral-container-hovered',\n 'focus-visible:bg-neutral-container-hovered',\n ]),\n },\n {\n intent: 'surface',\n design: 'tinted',\n class: tw([\n 'bg-surface',\n 'text-on-surface',\n 'hover:bg-surface-hovered',\n 'enabled:active:bg-surface-hovered',\n 'focus-visible:bg-surface-hovered',\n ]),\n },\n {\n intent: 'surfaceInverse',\n design: 'tinted',\n class: tw([\n 'bg-surface-inverse',\n 'text-on-surface-inverse',\n 'hover:bg-surface-inverse-hovered',\n 'enabled:active:bg-surface-inverse-hovered',\n 'focus-visible:bg-surface-inverse-hovered',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const contrastVariants = [\n {\n intent: 'main',\n design: 'contrast',\n class: tw([\n 'text-on-main-contaier bg-surface',\n 'hover:bg-main-container-hovered',\n 'enabled:active:bg-main-container-hovered',\n 'focus-visible:bg-main-container-hovered',\n ]),\n },\n {\n intent: 'support',\n design: 'contrast',\n class: tw([\n 'text-on-support-container bg-surface',\n 'hover:bg-support-container-hovered',\n 'enabled:active:bg-support-container-hovered',\n 'focus-visible:bg-support-container-hovered',\n ]),\n },\n {\n intent: 'accent',\n design: 'contrast',\n class: tw([\n 'text-on-accent-container bg-surface',\n 'hover:bg-accent-container-hovered',\n 'enabled:active:bg-accent-container-hovered',\n 'focus-visible:bg-accent-container-hovered',\n ]),\n },\n {\n intent: 'ai',\n design: 'contrast',\n class: tw([\n 'text-on-ai-container bg-surface',\n 'hover:bg-ai-container-hovered',\n 'enabled:active:bg-ai-container-hovered',\n 'focus-visible:bg-ai-container-hovered',\n ]),\n },\n {\n intent: 'success',\n design: 'contrast',\n class: tw([\n 'text-on-success-container bg-surface',\n 'hover:bg-success-container-hovered',\n 'enabled:active:bg-success-container-hovered',\n 'focus-visible:bg-success-container-hovered',\n ]),\n },\n {\n intent: 'alert',\n design: 'contrast',\n class: tw([\n 'text-on-alert-container bg-surface',\n 'hover:bg-alert-container-hovered',\n 'enabled:active:bg-alert-container-hovered',\n 'focus-visible:bg-alert-container-hovered',\n ]),\n },\n {\n intent: 'danger',\n design: 'contrast',\n class: tw([\n 'text-on-error-container bg-surface',\n 'hover:bg-error-container-hovered',\n 'enabled:active:bg-error-container-hovered',\n 'focus-visible:bg-error-container-hovered',\n ]),\n },\n {\n intent: 'info',\n design: 'contrast',\n class: tw([\n 'text-on-info-container bg-surface',\n 'hover:bg-info-container-hovered',\n 'enabled:active:bg-info-container-hovered',\n 'focus-visible:bg-info-container-hovered',\n ]),\n },\n {\n intent: 'neutral',\n design: 'contrast',\n class: tw([\n 'text-on-neutral-container bg-surface',\n 'hover:bg-neutral-container-hovered',\n 'enabled:active:bg-neutral-container-hovered',\n 'focus-visible:bg-neutral-container-hovered',\n ]),\n },\n {\n intent: 'surface',\n design: 'contrast',\n class: tw([\n 'text-on-surface bg-surface',\n 'hover:bg-surface-hovered',\n 'enabled:active:bg-surface-hovered',\n 'focus-visible:bg-surface-hovered',\n ]),\n },\n {\n intent: 'surfaceInverse',\n design: 'contrast',\n class: tw([\n 'text-on-surface-inverse bg-surface-inverse',\n 'hover:bg-surface-inverse-hovered',\n 'enabled:active:bg-surface-inverse-hovered',\n 'focus-visible:bg-surface-inverse-hovered',\n ]),\n },\n] as const\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nimport {\n contrastVariants,\n filledVariants,\n ghostVariants,\n outlinedVariants,\n tintedVariants,\n} from './variants'\n\nexport const buttonStyles = cva(\n [\n 'u-shadow-border-transition',\n 'box-border inline-flex items-center justify-center gap-md whitespace-nowrap',\n 'default:px-lg',\n 'text-body-1-highlight',\n 'focus-visible:u-outline',\n ],\n {\n variants: {\n /**\n * Main style of the button.\n *\n * - `filled`: Button will be plain.\n *\n * - `outlined`: Button will be transparent with an outline.\n *\n * - `tinted`: Button will be filled but using a lighter color scheme.\n *\n * - `ghost`: Button will look like a link. No borders, plain text.\n *\n * - `contrast`: Button will be surface filled. No borders, plain text.\n *\n */\n design: makeVariants<'design', ['filled', 'outlined', 'tinted', 'ghost', 'contrast']>({\n filled: [],\n outlined: ['bg-transparent', 'border-sm', 'border-current'],\n tinted: [],\n ghost: ['default:-mx-md px-md hover:bg-main/dim-5'],\n contrast: [],\n }),\n underline: {\n true: ['underline'],\n },\n /**\n * Color scheme of the button.\n */\n intent: makeVariants<\n 'intent',\n [\n 'main',\n 'support',\n 'accent',\n 'ai',\n 'success',\n 'alert',\n 'danger',\n 'info',\n 'neutral',\n 'surface',\n 'surfaceInverse',\n ]\n >({\n main: [],\n support: [],\n accent: [],\n ai: [],\n success: [],\n alert: [],\n danger: [],\n info: [],\n neutral: [],\n surface: [],\n surfaceInverse: [],\n }),\n /**\n * Size of the button.\n */\n size: makeVariants<'size', ['sm', 'md', 'lg']>({\n sm: ['min-w-sz-32', 'h-sz-32'],\n md: ['min-w-sz-44', 'h-sz-44'],\n lg: ['min-w-sz-56', 'h-sz-56'],\n }),\n /**\n * Shape of the button.\n */\n shape: makeVariants<'shape', ['rounded', 'square', 'pill']>({\n rounded: ['rounded-button'],\n square: ['rounded-0'],\n pill: ['rounded-full'],\n }),\n /**\n * Disable the button, preventing user interaction and adding opacity.\n */\n disabled: {\n true: ['cursor-not-allowed', 'opacity-dim-3'],\n false: ['cursor-pointer'],\n },\n },\n compoundVariants: [\n ...filledVariants,\n ...outlinedVariants,\n ...tintedVariants,\n ...ghostVariants,\n ...contrastVariants,\n ],\n defaultVariants: {\n design: 'filled',\n intent: 'main',\n size: 'md',\n shape: 'rounded',\n },\n }\n)\n\nexport type ButtonStylesProps = VariantProps<typeof buttonStyles>\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, type DOMAttributes, Ref, useMemo } from 'react'\n\nimport { Slot, wrapPolymorphicSlot } from '../slot'\nimport { Spinner, type SpinnerProps } from '../spinner'\nimport {\n buttonAppearanceStyles,\n type ButtonAppearanceStylesProps,\n} from './Button.appearance-styles'\nimport { buttonStyles, type ButtonStylesProps } from './Button.styles'\n\nexport interface ButtonProps\n extends\n Omit<ComponentPropsWithoutRef<'button'>, 'disabled'>,\n Omit<ButtonStylesProps, 'design' | 'intent'>,\n Pick<ButtonAppearanceStylesProps, 'appearance'> {\n /**\n * Main style of the button.\n */\n design?: ButtonStylesProps['design']\n /**\n * Color scheme of the button.\n */\n intent?: ButtonStylesProps['intent']\n /**\n * Combined appearance preset (replaces `design` and `intent`).\n * @beta This API is in beta and may change in future versions.\n */\n appearance?: ButtonAppearanceStylesProps['appearance']\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * Display a spinner to indicate to the user that the button is loading something after they interacted with it.\n */\n isLoading?: boolean\n /**\n * If your loading state should only display a spinner, it is better to specify a label for it (a11y).\n */\n loadingLabel?: string\n /**\n * If your loading state should also display a label, you can use this prop instead of `loadingLabel`.\n * **Please note that using this can result in layout shifting when the Button goes from loading state to normal state.**\n */\n loadingText?: string\n /**\n * When true, the button is non-interactive and has disabled styling but stays focusable (uses\n * `aria-disabled` instead of native `disabled`). Use for cases where the user should be able to\n * focus the control to discover why it is disabled (e.g. form submit, bulk bar actions).\n */\n ariaDisabled?: boolean\n ref?: Ref<HTMLButtonElement>\n}\n\ntype DOMAttributesEventHandler = keyof Omit<\n DOMAttributes<HTMLButtonElement>,\n 'children' | 'dangerouslySetInnerHTML'\n>\n\nconst blockedEventHandlers: DOMAttributesEventHandler[] = [\n 'onClick',\n 'onMouseDown',\n 'onMouseUp',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseOver',\n 'onMouseOut',\n 'onKeyDown',\n 'onKeyPress',\n 'onKeyUp',\n 'onSubmit',\n]\n\n/**\n * A clickable element that triggers an action or event when activated by the user.\n */\nexport const Button = ({\n children,\n design = 'filled',\n disabled = false,\n ariaDisabled = false,\n intent = 'main',\n isLoading = false,\n loadingLabel,\n loadingText,\n shape = 'pill',\n size = 'md',\n asChild,\n className,\n underline = false,\n appearance,\n ref,\n ...others\n}: ButtonProps) => {\n const Component = asChild ? Slot : 'button'\n\n const shouldNotInteract = !!disabled || !!ariaDisabled || isLoading\n const useNativeDisabled = !!disabled && !ariaDisabled\n\n const disabledEventHandlers = useMemo(() => {\n const result: Partial<Record<DOMAttributesEventHandler, (e: React.SyntheticEvent) => void>> = {}\n\n if (shouldNotInteract) {\n blockedEventHandlers.forEach(key => {\n result[key] = (e: React.SyntheticEvent) => {\n // Allow Tab to move focus away from the button\n if (e.type === 'keydown' && (e as React.KeyboardEvent).key === 'Tab') return\n /*\n Setting handlers to `undefined` (e.g. `result[eventHandler] = undefined`) only blocks JS-level handlers, it does not prevent native browser behavior.\n Calling preventDefault() here also blocks native form submission when type=\"submit\", since the browser triggers it from the click chain.\n */\n e.preventDefault()\n }\n })\n }\n\n return result\n }, [shouldNotInteract])\n\n const spinnerProps = {\n size: 'current' as SpinnerProps['size'],\n className: loadingText ? 'inline-block' : 'absolute',\n ...(loadingLabel && { 'aria-label': loadingLabel }),\n }\n\n // Use appearance styles when appearance is specified, otherwise use legacy styles\n const buttonClassName = appearance\n ? buttonAppearanceStyles({\n className,\n appearance,\n disabled: shouldNotInteract,\n size,\n underline,\n })\n : buttonStyles({\n className,\n design,\n disabled: shouldNotInteract,\n intent,\n shape,\n size,\n underline,\n })\n\n return (\n <Component\n data-spark-component=\"button\"\n {...(Component === 'button' && { type: 'button' })}\n ref={ref}\n className={buttonClassName}\n disabled={useNativeDisabled}\n aria-disabled={shouldNotInteract ? true : undefined}\n aria-busy={isLoading}\n aria-live={isLoading ? 'assertive' : 'off'}\n {...others}\n {...disabledEventHandlers}\n >\n {wrapPolymorphicSlot(asChild, children, slotted =>\n isLoading ? (\n <>\n <Spinner {...spinnerProps} />\n {loadingText}\n\n <div\n aria-hidden\n className={cx('gap-md', loadingText ? 'hidden' : 'inline-flex opacity-0')}\n >\n {slotted}\n </div>\n </>\n ) : (\n slotted\n )\n )}\n </Component>\n )\n}\n\nButton.displayName = 'Button'\n"],"mappings":";;;;;;;AAGA,IAAa,IAAyB,EACpC;CACE;CACA;CACA;CACA;CACA;CACA;AACF,GACA;CACE,UAAU;EAIR,WAAW,EACT,MAAM,CAAC,WAAW,EACpB;EAeA,YAAY;GACV,SAAS;IACP;IACA;IACA;IACA;IACA;IACA;GACF;GACA,WAAW;IACT;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU;IACR;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU;IACR;IACA;IACA;IACA;IACA;IACA;GACF;GACA,OAAO,CAAC,uEAAuE;GAC/E,SAAS;IACP;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,QAAQ;IACN;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;GACF;GACA,IAAI;IACF;IACA;IACA;IACA;IACA;IACA;GACF;EACF;EAIA,MAAM,EAAyC;GAC7C,IAAI,CAAC,qBAAqB;GAC1B,IAAI,CAAC,qBAAqB;GAC1B,IAAI,CAAC,qBAAqB;EAC5B,CAAC;EAID,UAAU;GACR,MAAM,CAAC,kCAAkC;GACzC,OAAO,CAAC,gBAAgB;EAC1B;CACF;CACA,iBAAiB,EACf,MAAM,KACR;AACF,CACF,GC7Ha,IAAiB;CAE5B;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CAEA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CAEA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CAEA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CAEA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CAEA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CAEA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;EACF,CAAC;CACH;CAEA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;EACF,CAAC;CACH;CAEA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CAEA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;AACF,GChIa,IAAgB;CAC3B;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;AACF,GC/Ga,IAAmB;CAC9B;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;AACF,GC/Ga,IAAiB;CAC5B;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;GACA;EACF,CAAC;CACH;AACF,GC1Ha,IAAmB;CAC9B;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;CACA;EACE,QAAQ;EACR,QAAQ;EACR,OAAO,EAAG;GACR;GACA;GACA;GACA;EACF,CAAC;CACH;AACF,GCtGa,IAAe,EAC1B;CACE;CACA;CACA;CACA;CACA;AACF,GACA;CACE,UAAU;EAeR,QAAQ,EAA8E;GACpF,QAAQ,CAAC;GACT,UAAU;IAAC;IAAkB;IAAa;GAAgB;GAC1D,QAAQ,CAAC;GACT,OAAO,CAAC,0CAA0C;GAClD,UAAU,CAAC;EACb,CAAC;EACD,WAAW,EACT,MAAM,CAAC,WAAW,EACpB;EAIA,QAAQ,EAeN;GACA,MAAM,CAAC;GACP,SAAS,CAAC;GACV,QAAQ,CAAC;GACT,IAAI,CAAC;GACL,SAAS,CAAC;GACV,OAAO,CAAC;GACR,QAAQ,CAAC;GACT,MAAM,CAAC;GACP,SAAS,CAAC;GACV,SAAS,CAAC;GACV,gBAAgB,CAAC;EACnB,CAAC;EAID,MAAM,EAAyC;GAC7C,IAAI,CAAC,eAAe,SAAS;GAC7B,IAAI,CAAC,eAAe,SAAS;GAC7B,IAAI,CAAC,eAAe,SAAS;EAC/B,CAAC;EAID,OAAO,EAAqD;GAC1D,SAAS,CAAC,gBAAgB;GAC1B,QAAQ,CAAC,WAAW;GACpB,MAAM,CAAC,cAAc;EACvB,CAAC;EAID,UAAU;GACR,MAAM,CAAC,sBAAsB,eAAe;GAC5C,OAAO,CAAC,gBAAgB;EAC1B;CACF;CACA,kBAAkB;EAChB,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG;CACL;CACA,iBAAiB;EACf,QAAQ;EACR,QAAQ;EACR,MAAM;EACN,OAAO;CACT;AACF,CACF,GCtDM,IAAoD;CACxD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAKa,KAAU,EACrB,aACA,YAAS,UACT,cAAW,IACX,kBAAe,IACf,YAAS,QACT,eAAY,IACZ,iBACA,gBACA,WAAQ,QACR,UAAO,MACP,YACA,cACA,eAAY,IACZ,eACA,QACA,GAAG,QACc;CACjB,IAAM,IAAY,IAAU,IAAO,UAE7B,IAAoB,CAAC,CAAC,KAAY,CAAC,CAAC,KAAgB,GACpD,IAAoB,CAAC,CAAC,KAAY,CAAC,GAEnC,IAAwB,QAAc;EAC1C,IAAM,IAAwF,CAAC;EAgB/F,OAdI,KACF,EAAqB,SAAQ,MAAO;GAClC,EAAO,MAAQ,MAA4B;IAErC,EAAE,SAAS,aAAc,EAA0B,QAAQ,SAK/D,EAAE,eAAe;GACnB;EACF,CAAC,GAGI;CACT,GAAG,CAAC,CAAiB,CAAC,GAEhB,IAAe;EACnB,MAAM;EACN,WAAW,IAAc,iBAAiB;EAC1C,GAAI,KAAgB,EAAE,cAAc,EAAa;CACnD,GAGM,IAAkB,IACpB,EAAuB;EACrB;EACA;EACA,UAAU;EACV;EACA;CACF,CAAC,IACD,EAAa;EACX;EACA;EACA,UAAU;EACV;EACA;EACA;EACA;CACF,CAAC;CAEL,OACE,kBAAC,GAAD;EACE,wBAAqB;EACrB,GAAK,MAAc,YAAY,EAAE,MAAM,SAAS;EAC3C;EACL,WAAW;EACX,UAAU;EACV,iBAAe,IAAoB,KAAO,KAAA;EAC1C,aAAW;EACX,aAAW,IAAY,cAAc;EACrC,GAAI;EACJ,GAAI;YAEH,EAAoB,GAAS,IAAU,MACtC,IACE,kBAAA,GAAA,EAAA,UAAA;GACE,kBAAC,GAAD,EAAS,GAAI,EAAe,CAAA;GAC3B;GAED,kBAAC,OAAD;IACE,eAAA;IACA,WAAW,EAAG,UAAU,IAAc,WAAW,uBAAuB;cAEvE;GACE,CAAA;EACL,EAAA,CAAA,IAEF,CAEJ;CACS,CAAA;AAEf;AAEA,EAAO,cAAc"}
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  export declare const backdropStyles: (props?: ({
3
3
  animation?: "none" | "pulse" | null | undefined;
4
- intent?: "main" | "alert" | "surface" | "support" | "accent" | "success" | "info" | "neutral" | "danger" | "surfaceInverse" | null | undefined;
4
+ intent?: "main" | "surface" | "support" | "alert" | "accent" | "success" | "info" | "neutral" | "danger" | "surfaceInverse" | null | undefined;
5
5
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
6
  export type BackdropStylesProps = VariantProps<typeof backdropStyles>;
7
7
  interface BackdropProps extends BackdropStylesProps {
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  export declare const cardStyles: (props?: ({
3
3
  design?: "outlined" | "tinted" | null | undefined;
4
- intent?: "main" | "alert" | "surface" | "support" | "accent" | "success" | "info" | "neutral" | "danger" | null | undefined;
4
+ intent?: "main" | "surface" | "support" | "alert" | "accent" | "success" | "info" | "neutral" | "danger" | null | undefined;
5
5
  hasType?: boolean | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
7
  export type CardStylesProps = VariantProps<typeof cardStyles>;
@@ -3,6 +3,6 @@ export declare const contentStyles: (props?: ({
3
3
  inset?: boolean | null | undefined;
4
4
  design?: "outlined" | "tinted" | null | undefined;
5
5
  hasType?: boolean | null | undefined;
6
- intent?: "main" | "alert" | "surface" | "support" | "accent" | "success" | "info" | "neutral" | "danger" | null | undefined;
6
+ intent?: "main" | "surface" | "support" | "alert" | "accent" | "success" | "info" | "neutral" | "danger" | null | undefined;
7
7
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
8
8
  export type ContentStylesProps = VariantProps<typeof contentStyles>;
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import { ComponentProps, ReactNode } from 'react';
3
3
  export declare const typeStyles: (props?: ({
4
- intent?: "main" | "alert" | "surface" | "support" | "accent" | "success" | "info" | "neutral" | "danger" | null | undefined;
4
+ intent?: "main" | "surface" | "support" | "alert" | "accent" | "success" | "info" | "neutral" | "danger" | null | undefined;
5
5
  design?: "outlined" | "tinted" | null | undefined;
6
6
  hasMediumBorder?: boolean | null | undefined;
7
7
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../slot/index.js");let t=require("class-variance-authority"),n=require("react"),r=require("react/jsx-runtime"),i=require("@spark-ui/internal-utils");var a=(0,t.cva)([`group relative bg-clip-padding default:rounded-lg focus-visible:u-outline`,`disabled:opacity-dim-3 disabled:cursor-not-allowed`],{variants:{design:{outlined:[],tinted:[]},intent:(0,i.makeVariants)({main:[],support:[],accent:[],success:[],alert:[],danger:[],info:[],neutral:[],surface:[]}),hasType:{true:[],false:[]}},compoundVariants:[{intent:`main`,design:`outlined`,class:(0,i.tw)([`border-main`])},{intent:`support`,design:`outlined`,class:(0,i.tw)([`border-support`])},{intent:`accent`,design:`outlined`,class:(0,i.tw)([`border-accent`])},{intent:`success`,design:`outlined`,class:(0,i.tw)([`border-success`])},{intent:`alert`,design:`outlined`,class:(0,i.tw)([`border-alert`])},{intent:`danger`,design:`outlined`,class:(0,i.tw)([`border-error`])},{intent:`info`,design:`outlined`,class:(0,i.tw)([`border-info`])},{intent:`neutral`,design:`outlined`,class:(0,i.tw)([`border-neutral`])},{intent:`surface`,design:`outlined`,class:(0,i.tw)([`border-outline`])},{design:`outlined`,hasType:!0,class:(0,i.tw)([`border-md`])},{design:`outlined`,hasType:!1,class:(0,i.tw)([`border-sm`])}],defaultVariants:{design:`outlined`,intent:`surface`}}),o=(0,n.createContext)(void 0),s=()=>{let e=(0,n.useContext)(o);if(!e)throw Error(`useCardContext must be used within a Card component`);return e},c=[`onClick`,`onMouseDown`,`onMouseUp`,`onMouseEnter`,`onMouseLeave`,`onMouseMove`,`onMouseOver`,`onMouseOut`,`onDoubleClick`,`onContextMenu`],l=e=>{let t=!1,r=e=>{t||n.Children.forEach(e,e=>{if(!t&&(0,n.isValidElement)(e)){if(typeof e.type==`function`&&e.type.displayName===`Card.Type`){t=!0;return}if(e.props&&typeof e.props==`object`&&`children`in e.props){let t=e.props.children;t!=null&&r(t)}}})};return r(e),t},u=(e,t,r)=>{if(c.some(e=>e in r))return!0;if(!t)return!1;let i=n.Children.only(e);if(!(0,n.isValidElement)(i))return!1;if(typeof i.type==`string`&&[`a`,`button`].includes(i.type))return!0;let a=i.props;return c.some(e=>e in a)},d=({children:t,design:n=`outlined`,intent:i=`surface`,inset:s=!1,asChild:c,className:d,ref:f,...p})=>{let m=c?e.Slot:`div`,h=l(t),g=u(t,c,p);return(0,r.jsx)(o,{value:{design:n,intent:i,hasType:h,inset:s,isInteractive:g},children:(0,r.jsx)(m,{"data-spark-component":`card`,"data-interactive":g,ref:f,className:a({className:d,design:n,intent:i,hasType:h}),...p,children:t})})};d.displayName=`Card`;var f=(0,t.cva)([`relative default:rounded-lg w-full focus-visible:u-outline`,`default:transition-colors default:duration-200 ease-linear`],{variants:{inset:{false:[`default:p-lg`]},design:{outlined:[`default:bg-surface group-focus:bg-surface-hovered group-not-disabled:group-data-[interactive=true]:group-hover:bg-surface-hovered`],tinted:[]},hasType:{true:[`rounded-t-0`]},intent:(0,i.makeVariants)({main:[],support:[],accent:[],success:[],alert:[],danger:[],info:[],neutral:[],surface:[]})},compoundVariants:[{intent:`main`,design:`tinted`,class:(0,i.tw)([`bg-main-container text-on-main-container group-focus:bg-main-container-hovered`,`group-not-disabled:group-data-[interactive=true]:group-hover:bg-main-container-hovered`])},{intent:`support`,design:`tinted`,class:(0,i.tw)([`bg-support-container text-on-support-container group-focus:bg-support-container-hovered`,`group-not-disabled:group-data-[interactive=true]:group-hover:bg-support-container-hovered`])},{intent:`accent`,design:`tinted`,class:(0,i.tw)([`bg-accent-container text-on-accent-container group-focus:bg-accent-container-hovered`,`group-not-disabled:group-data-[interactive=true]:group-hover:bg-accent-container-hovered`])},{intent:`success`,design:`tinted`,class:(0,i.tw)([`bg-success-container text-on-success-container group-focus:bg-success-container-hovered`,`group-not-disabled:group-data-[interactive=true]:group-hover:bg-success-container-hovered`])},{intent:`alert`,design:`tinted`,class:(0,i.tw)([`bg-alert-container text-on-alert-container group-focus:bg-alert-container-hovered`,`group-not-disabled:group-data-[interactive=true]:group-hover:bg-alert-container-hovered`])},{intent:`danger`,design:`tinted`,class:(0,i.tw)([`bg-error-container text-on-error-container group-focus:bg-error-container-hovered`,`group-not-disabled:group-data-[interactive=true]:group-hover:bg-error-container-hovered`])},{intent:`info`,design:`tinted`,class:(0,i.tw)([`bg-info-container text-on-info-container group-focus:bg-info-container-hovered`,`group-not-disabled:group-data-[interactive=true]:group-hover:bg-info-container-hovered`])},{intent:`neutral`,design:`tinted`,class:(0,i.tw)([`bg-neutral-container text-on-neutral-container group-focus:bg-neutral-container-hovered`,`group-not-disabled:group-data-[interactive=true]:group-hover:bg-neutral-container-hovered`])},{intent:`surface`,design:`tinted`,class:(0,i.tw)([`bg-surface text-on-surface group-focus:bg-surface-hovered`,`group-not-disabled:group-data-[interactive=true]:group-hover:bg-surface-hovered`])}],defaultVariants:{design:`outlined`,intent:`surface`,inset:!1,hasType:!0}}),p=({children:t,inset:n,asChild:i,className:a,ref:o,...c})=>{let l=i?e.Slot:`div`,{design:u,intent:d,hasType:p}=s();return(0,r.jsx)(l,{"data-spark-component":`card-content`,ref:o,className:f({className:a,design:u,intent:d,inset:n,hasType:p}),...c,children:t})};p.displayName=`Content`;var m=(0,t.cva)([`rounded-t-lg default:text-body-2-highlight`,`default:text-center`,`min-h-sz-32`,`px-md`,`py-xs`,`flex items-center justify-center`,`whitespace-normal break-words`],{variants:{intent:{main:[`bg-main text-on-main`],support:[`bg-support text-on-support`],accent:[`bg-accent text-on-accent`],success:[`bg-success text-on-success`],alert:[`bg-alert text-on-alert`],danger:[`bg-error text-on-error`],info:[`bg-info text-on-info`],neutral:[`bg-neutral text-on-neutral`],surface:[`bg-surface-inverse text-on-surface-inverse`]},design:{outlined:[],tinted:[]},hasMediumBorder:{true:[],false:[]}},compoundVariants:[{design:`outlined`,hasMediumBorder:!1,class:`-mx-px -mt-px`},{design:`outlined`,hasMediumBorder:!0,class:`-mx-(--border-width-md) -mt-(--border-width-md)`}],defaultVariants:{intent:`main`,design:`outlined`,hasMediumBorder:!1}}),h=({intent:e,children:t,...n})=>{let i=s(),a=e??i.intent??`main`,o=i.design===`outlined`&&i.hasType;return t?(0,r.jsx)(`header`,{className:m({intent:a,design:i.design,hasMediumBorder:o}),...n,children:t}):null};h.displayName=`Card.Type`;var g=Object.assign(d,{Content:p,Type:h});g.displayName=`Card`,p.displayName=`Card.Content`,h.displayName=`Card.Type`,exports.Card=g;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../slot/index.js");let t=require("@spark-ui/internal-utils"),n=require("class-variance-authority"),r=require("react"),i=require("react/jsx-runtime");var a=(0,n.cva)([`group relative bg-clip-padding default:rounded-lg focus-visible:u-outline`,`disabled:opacity-dim-3 disabled:cursor-not-allowed`],{variants:{design:{outlined:[],tinted:[]},intent:(0,t.makeVariants)({main:[],support:[],accent:[],success:[],alert:[],danger:[],info:[],neutral:[],surface:[]}),hasType:{true:[],false:[]}},compoundVariants:[{intent:`main`,design:`outlined`,class:(0,t.tw)([`border-main`])},{intent:`support`,design:`outlined`,class:(0,t.tw)([`border-support`])},{intent:`accent`,design:`outlined`,class:(0,t.tw)([`border-accent`])},{intent:`success`,design:`outlined`,class:(0,t.tw)([`border-success`])},{intent:`alert`,design:`outlined`,class:(0,t.tw)([`border-alert`])},{intent:`danger`,design:`outlined`,class:(0,t.tw)([`border-error`])},{intent:`info`,design:`outlined`,class:(0,t.tw)([`border-info`])},{intent:`neutral`,design:`outlined`,class:(0,t.tw)([`border-neutral`])},{intent:`surface`,design:`outlined`,class:(0,t.tw)([`border-outline`])},{design:`outlined`,hasType:!0,class:(0,t.tw)([`border-md`])},{design:`outlined`,hasType:!1,class:(0,t.tw)([`border-sm`])}],defaultVariants:{design:`outlined`,intent:`surface`}}),o=(0,r.createContext)(void 0),s=()=>{let e=(0,r.useContext)(o);if(!e)throw Error(`useCardContext must be used within a Card component`);return e},c=[`onClick`,`onMouseDown`,`onMouseUp`,`onMouseEnter`,`onMouseLeave`,`onMouseMove`,`onMouseOver`,`onMouseOut`,`onDoubleClick`,`onContextMenu`],l=e=>{let t=!1,n=e=>{t||r.Children.forEach(e,e=>{if(!t&&(0,r.isValidElement)(e)){if(typeof e.type==`function`&&e.type.displayName===`Card.Type`){t=!0;return}if(e.props&&typeof e.props==`object`&&`children`in e.props){let t=e.props.children;t!=null&&n(t)}}})};return n(e),t},u=(e,t,n)=>{if(c.some(e=>e in n))return!0;if(!t)return!1;let i=r.Children.only(e);if(!(0,r.isValidElement)(i))return!1;if(typeof i.type==`string`&&[`a`,`button`].includes(i.type))return!0;let a=i.props;return c.some(e=>e in a)},d=({children:t,design:n=`outlined`,intent:r=`surface`,inset:s=!1,asChild:c,className:d,ref:f,...p})=>{let m=c?e.Slot:`div`,h=l(t),g=u(t,c,p);return(0,i.jsx)(o,{value:{design:n,intent:r,hasType:h,inset:s,isInteractive:g},children:(0,i.jsx)(m,{"data-spark-component":`card`,"data-interactive":g,ref:f,className:a({className:d,design:n,intent:r,hasType:h}),...p,children:t})})};d.displayName=`Card`;var f=(0,n.cva)([`relative default:rounded-lg w-full focus-visible:u-outline`,`default:transition-colors default:duration-200 ease-linear`],{variants:{inset:{false:[`default:p-lg`]},design:{outlined:[`default:bg-surface group-focus:bg-surface-hovered group-not-disabled:group-data-[interactive=true]:group-hover:bg-surface-hovered`],tinted:[]},hasType:{true:[`rounded-t-0`]},intent:(0,t.makeVariants)({main:[],support:[],accent:[],success:[],alert:[],danger:[],info:[],neutral:[],surface:[]})},compoundVariants:[{intent:`main`,design:`tinted`,class:(0,t.tw)([`bg-main-container text-on-main-container group-focus:bg-main-container-hovered`,`group-not-disabled:group-data-[interactive=true]:group-hover:bg-main-container-hovered`])},{intent:`support`,design:`tinted`,class:(0,t.tw)([`bg-support-container text-on-support-container group-focus:bg-support-container-hovered`,`group-not-disabled:group-data-[interactive=true]:group-hover:bg-support-container-hovered`])},{intent:`accent`,design:`tinted`,class:(0,t.tw)([`bg-accent-container text-on-accent-container group-focus:bg-accent-container-hovered`,`group-not-disabled:group-data-[interactive=true]:group-hover:bg-accent-container-hovered`])},{intent:`success`,design:`tinted`,class:(0,t.tw)([`bg-success-container text-on-success-container group-focus:bg-success-container-hovered`,`group-not-disabled:group-data-[interactive=true]:group-hover:bg-success-container-hovered`])},{intent:`alert`,design:`tinted`,class:(0,t.tw)([`bg-alert-container text-on-alert-container group-focus:bg-alert-container-hovered`,`group-not-disabled:group-data-[interactive=true]:group-hover:bg-alert-container-hovered`])},{intent:`danger`,design:`tinted`,class:(0,t.tw)([`bg-error-container text-on-error-container group-focus:bg-error-container-hovered`,`group-not-disabled:group-data-[interactive=true]:group-hover:bg-error-container-hovered`])},{intent:`info`,design:`tinted`,class:(0,t.tw)([`bg-info-container text-on-info-container group-focus:bg-info-container-hovered`,`group-not-disabled:group-data-[interactive=true]:group-hover:bg-info-container-hovered`])},{intent:`neutral`,design:`tinted`,class:(0,t.tw)([`bg-neutral-container text-on-neutral-container group-focus:bg-neutral-container-hovered`,`group-not-disabled:group-data-[interactive=true]:group-hover:bg-neutral-container-hovered`])},{intent:`surface`,design:`tinted`,class:(0,t.tw)([`bg-surface text-on-surface group-focus:bg-surface-hovered`,`group-not-disabled:group-data-[interactive=true]:group-hover:bg-surface-hovered`])}],defaultVariants:{design:`outlined`,intent:`surface`,inset:!1,hasType:!0}}),p=({children:t,inset:n,asChild:r,className:a,ref:o,...c})=>{let l=r?e.Slot:`div`,{design:u,intent:d,hasType:p}=s();return(0,i.jsx)(l,{"data-spark-component":`card-content`,ref:o,className:f({className:a,design:u,intent:d,inset:n,hasType:p}),...c,children:t})};p.displayName=`Content`;var m=(0,n.cva)([`rounded-t-lg default:text-body-2-highlight`,`default:text-center`,`min-h-sz-32`,`px-md`,`py-xs`,`flex items-center justify-center`,`whitespace-normal break-words`],{variants:{intent:{main:[`bg-main text-on-main`],support:[`bg-support text-on-support`],accent:[`bg-accent text-on-accent`],success:[`bg-success text-on-success`],alert:[`bg-alert text-on-alert`],danger:[`bg-error text-on-error`],info:[`bg-info text-on-info`],neutral:[`bg-neutral text-on-neutral`],surface:[`bg-surface-inverse text-on-surface-inverse`]},design:{outlined:[],tinted:[]},hasMediumBorder:{true:[],false:[]}},compoundVariants:[{design:`outlined`,hasMediumBorder:!1,class:`-mx-px -mt-px`},{design:`outlined`,hasMediumBorder:!0,class:`-mx-(--border-width-md) -mt-(--border-width-md)`}],defaultVariants:{intent:`main`,design:`outlined`,hasMediumBorder:!1}}),h=({intent:e,children:t,...n})=>{let r=s(),a=e??r.intent??`main`,o=r.design===`outlined`&&r.hasType;return t?(0,i.jsx)(`header`,{className:m({intent:a,design:r.design,hasMediumBorder:o}),...n,children:t}):null};h.displayName=`Card.Type`;var g=Object.assign(d,{Content:p,Type:h});g.displayName=`Card`,p.displayName=`Card.Content`,h.displayName=`Card.Type`,exports.Card=g;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,16 +1,16 @@
1
1
  import { Slot as e } from "../slot/index.mjs";
2
- import { cva as t } from "class-variance-authority";
3
- import { Children as n, createContext as r, isValidElement as i, useContext as a } from "react";
4
- import { jsx as o } from "react/jsx-runtime";
5
- import { makeVariants as s, tw as c } from "@spark-ui/internal-utils";
2
+ import { makeVariants as t, tw as n } from "@spark-ui/internal-utils";
3
+ import { cva as r } from "class-variance-authority";
4
+ import { Children as i, createContext as a, isValidElement as o, useContext as s } from "react";
5
+ import { jsx as c } from "react/jsx-runtime";
6
6
  //#region src/card/Card.styles.tsx
7
- var l = t(["group relative bg-clip-padding default:rounded-lg focus-visible:u-outline", "disabled:opacity-dim-3 disabled:cursor-not-allowed"], {
7
+ var l = r(["group relative bg-clip-padding default:rounded-lg focus-visible:u-outline", "disabled:opacity-dim-3 disabled:cursor-not-allowed"], {
8
8
  variants: {
9
9
  design: {
10
10
  outlined: [],
11
11
  tinted: []
12
12
  },
13
- intent: s({
13
+ intent: t({
14
14
  main: [],
15
15
  support: [],
16
16
  accent: [],
@@ -30,65 +30,65 @@ var l = t(["group relative bg-clip-padding default:rounded-lg focus-visible:u-ou
30
30
  {
31
31
  intent: "main",
32
32
  design: "outlined",
33
- class: c(["border-main"])
33
+ class: n(["border-main"])
34
34
  },
35
35
  {
36
36
  intent: "support",
37
37
  design: "outlined",
38
- class: c(["border-support"])
38
+ class: n(["border-support"])
39
39
  },
40
40
  {
41
41
  intent: "accent",
42
42
  design: "outlined",
43
- class: c(["border-accent"])
43
+ class: n(["border-accent"])
44
44
  },
45
45
  {
46
46
  intent: "success",
47
47
  design: "outlined",
48
- class: c(["border-success"])
48
+ class: n(["border-success"])
49
49
  },
50
50
  {
51
51
  intent: "alert",
52
52
  design: "outlined",
53
- class: c(["border-alert"])
53
+ class: n(["border-alert"])
54
54
  },
55
55
  {
56
56
  intent: "danger",
57
57
  design: "outlined",
58
- class: c(["border-error"])
58
+ class: n(["border-error"])
59
59
  },
60
60
  {
61
61
  intent: "info",
62
62
  design: "outlined",
63
- class: c(["border-info"])
63
+ class: n(["border-info"])
64
64
  },
65
65
  {
66
66
  intent: "neutral",
67
67
  design: "outlined",
68
- class: c(["border-neutral"])
68
+ class: n(["border-neutral"])
69
69
  },
70
70
  {
71
71
  intent: "surface",
72
72
  design: "outlined",
73
- class: c(["border-outline"])
73
+ class: n(["border-outline"])
74
74
  },
75
75
  {
76
76
  design: "outlined",
77
77
  hasType: !0,
78
- class: c(["border-md"])
78
+ class: n(["border-md"])
79
79
  },
80
80
  {
81
81
  design: "outlined",
82
82
  hasType: !1,
83
- class: c(["border-sm"])
83
+ class: n(["border-sm"])
84
84
  }
85
85
  ],
86
86
  defaultVariants: {
87
87
  design: "outlined",
88
88
  intent: "surface"
89
89
  }
90
- }), u = r(void 0), d = () => {
91
- let e = a(u);
90
+ }), u = a(void 0), d = () => {
91
+ let e = s(u);
92
92
  if (!e) throw Error("useCardContext must be used within a Card component");
93
93
  return e;
94
94
  }, f = [
@@ -103,32 +103,32 @@ var l = t(["group relative bg-clip-padding default:rounded-lg focus-visible:u-ou
103
103
  "onDoubleClick",
104
104
  "onContextMenu"
105
105
  ], p = (e) => {
106
- let t = !1, r = (e) => {
107
- t || n.forEach(e, (e) => {
108
- if (!t && i(e)) {
106
+ let t = !1, n = (e) => {
107
+ t || i.forEach(e, (e) => {
108
+ if (!t && o(e)) {
109
109
  if (typeof e.type == "function" && e.type.displayName === "Card.Type") {
110
110
  t = !0;
111
111
  return;
112
112
  }
113
113
  if (e.props && typeof e.props == "object" && "children" in e.props) {
114
114
  let t = e.props.children;
115
- t != null && r(t);
115
+ t != null && n(t);
116
116
  }
117
117
  }
118
118
  });
119
119
  };
120
- return r(e), t;
121
- }, m = (e, t, r) => {
122
- if (f.some((e) => e in r)) return !0;
120
+ return n(e), t;
121
+ }, m = (e, t, n) => {
122
+ if (f.some((e) => e in n)) return !0;
123
123
  if (!t) return !1;
124
- let a = n.only(e);
125
- if (!i(a)) return !1;
126
- if (typeof a.type == "string" && ["a", "button"].includes(a.type)) return !0;
127
- let o = a.props;
128
- return f.some((e) => e in o);
129
- }, h = ({ children: t, design: n = "outlined", intent: r = "surface", inset: i = !1, asChild: a, className: s, ref: c, ...d }) => {
124
+ let r = i.only(e);
125
+ if (!o(r)) return !1;
126
+ if (typeof r.type == "string" && ["a", "button"].includes(r.type)) return !0;
127
+ let a = r.props;
128
+ return f.some((e) => e in a);
129
+ }, h = ({ children: t, design: n = "outlined", intent: r = "surface", inset: i = !1, asChild: a, className: o, ref: s, ...d }) => {
130
130
  let f = a ? e : "div", h = p(t), g = m(t, a, d);
131
- return /* @__PURE__ */ o(u, {
131
+ return /* @__PURE__ */ c(u, {
132
132
  value: {
133
133
  design: n,
134
134
  intent: r,
@@ -136,12 +136,12 @@ var l = t(["group relative bg-clip-padding default:rounded-lg focus-visible:u-ou
136
136
  inset: i,
137
137
  isInteractive: g
138
138
  },
139
- children: /* @__PURE__ */ o(f, {
139
+ children: /* @__PURE__ */ c(f, {
140
140
  "data-spark-component": "card",
141
141
  "data-interactive": g,
142
- ref: c,
142
+ ref: s,
143
143
  className: l({
144
- className: s,
144
+ className: o,
145
145
  design: n,
146
146
  intent: r,
147
147
  hasType: h
@@ -154,7 +154,7 @@ var l = t(["group relative bg-clip-padding default:rounded-lg focus-visible:u-ou
154
154
  h.displayName = "Card";
155
155
  //#endregion
156
156
  //#region src/card/Content.styles.tsx
157
- var g = t(["relative default:rounded-lg w-full focus-visible:u-outline", "default:transition-colors default:duration-200 ease-linear"], {
157
+ var g = r(["relative default:rounded-lg w-full focus-visible:u-outline", "default:transition-colors default:duration-200 ease-linear"], {
158
158
  variants: {
159
159
  inset: { false: ["default:p-lg"] },
160
160
  design: {
@@ -162,7 +162,7 @@ var g = t(["relative default:rounded-lg w-full focus-visible:u-outline", "defaul
162
162
  tinted: []
163
163
  },
164
164
  hasType: { true: ["rounded-t-0"] },
165
- intent: s({
165
+ intent: t({
166
166
  main: [],
167
167
  support: [],
168
168
  accent: [],
@@ -178,47 +178,47 @@ var g = t(["relative default:rounded-lg w-full focus-visible:u-outline", "defaul
178
178
  {
179
179
  intent: "main",
180
180
  design: "tinted",
181
- class: c(["bg-main-container text-on-main-container group-focus:bg-main-container-hovered", "group-not-disabled:group-data-[interactive=true]:group-hover:bg-main-container-hovered"])
181
+ class: n(["bg-main-container text-on-main-container group-focus:bg-main-container-hovered", "group-not-disabled:group-data-[interactive=true]:group-hover:bg-main-container-hovered"])
182
182
  },
183
183
  {
184
184
  intent: "support",
185
185
  design: "tinted",
186
- class: c(["bg-support-container text-on-support-container group-focus:bg-support-container-hovered", "group-not-disabled:group-data-[interactive=true]:group-hover:bg-support-container-hovered"])
186
+ class: n(["bg-support-container text-on-support-container group-focus:bg-support-container-hovered", "group-not-disabled:group-data-[interactive=true]:group-hover:bg-support-container-hovered"])
187
187
  },
188
188
  {
189
189
  intent: "accent",
190
190
  design: "tinted",
191
- class: c(["bg-accent-container text-on-accent-container group-focus:bg-accent-container-hovered", "group-not-disabled:group-data-[interactive=true]:group-hover:bg-accent-container-hovered"])
191
+ class: n(["bg-accent-container text-on-accent-container group-focus:bg-accent-container-hovered", "group-not-disabled:group-data-[interactive=true]:group-hover:bg-accent-container-hovered"])
192
192
  },
193
193
  {
194
194
  intent: "success",
195
195
  design: "tinted",
196
- class: c(["bg-success-container text-on-success-container group-focus:bg-success-container-hovered", "group-not-disabled:group-data-[interactive=true]:group-hover:bg-success-container-hovered"])
196
+ class: n(["bg-success-container text-on-success-container group-focus:bg-success-container-hovered", "group-not-disabled:group-data-[interactive=true]:group-hover:bg-success-container-hovered"])
197
197
  },
198
198
  {
199
199
  intent: "alert",
200
200
  design: "tinted",
201
- class: c(["bg-alert-container text-on-alert-container group-focus:bg-alert-container-hovered", "group-not-disabled:group-data-[interactive=true]:group-hover:bg-alert-container-hovered"])
201
+ class: n(["bg-alert-container text-on-alert-container group-focus:bg-alert-container-hovered", "group-not-disabled:group-data-[interactive=true]:group-hover:bg-alert-container-hovered"])
202
202
  },
203
203
  {
204
204
  intent: "danger",
205
205
  design: "tinted",
206
- class: c(["bg-error-container text-on-error-container group-focus:bg-error-container-hovered", "group-not-disabled:group-data-[interactive=true]:group-hover:bg-error-container-hovered"])
206
+ class: n(["bg-error-container text-on-error-container group-focus:bg-error-container-hovered", "group-not-disabled:group-data-[interactive=true]:group-hover:bg-error-container-hovered"])
207
207
  },
208
208
  {
209
209
  intent: "info",
210
210
  design: "tinted",
211
- class: c(["bg-info-container text-on-info-container group-focus:bg-info-container-hovered", "group-not-disabled:group-data-[interactive=true]:group-hover:bg-info-container-hovered"])
211
+ class: n(["bg-info-container text-on-info-container group-focus:bg-info-container-hovered", "group-not-disabled:group-data-[interactive=true]:group-hover:bg-info-container-hovered"])
212
212
  },
213
213
  {
214
214
  intent: "neutral",
215
215
  design: "tinted",
216
- class: c(["bg-neutral-container text-on-neutral-container group-focus:bg-neutral-container-hovered", "group-not-disabled:group-data-[interactive=true]:group-hover:bg-neutral-container-hovered"])
216
+ class: n(["bg-neutral-container text-on-neutral-container group-focus:bg-neutral-container-hovered", "group-not-disabled:group-data-[interactive=true]:group-hover:bg-neutral-container-hovered"])
217
217
  },
218
218
  {
219
219
  intent: "surface",
220
220
  design: "tinted",
221
- class: c(["bg-surface text-on-surface group-focus:bg-surface-hovered", "group-not-disabled:group-data-[interactive=true]:group-hover:bg-surface-hovered"])
221
+ class: n(["bg-surface text-on-surface group-focus:bg-surface-hovered", "group-not-disabled:group-data-[interactive=true]:group-hover:bg-surface-hovered"])
222
222
  }
223
223
  ],
224
224
  defaultVariants: {
@@ -227,9 +227,9 @@ var g = t(["relative default:rounded-lg w-full focus-visible:u-outline", "defaul
227
227
  inset: !1,
228
228
  hasType: !0
229
229
  }
230
- }), _ = ({ children: t, inset: n, asChild: r, className: i, ref: a, ...s }) => {
231
- let c = r ? e : "div", { design: l, intent: u, hasType: f } = d();
232
- return /* @__PURE__ */ o(c, {
230
+ }), _ = ({ children: t, inset: n, asChild: r, className: i, ref: a, ...o }) => {
231
+ let s = r ? e : "div", { design: l, intent: u, hasType: f } = d();
232
+ return /* @__PURE__ */ c(s, {
233
233
  "data-spark-component": "card-content",
234
234
  ref: a,
235
235
  className: g({
@@ -239,14 +239,14 @@ var g = t(["relative default:rounded-lg w-full focus-visible:u-outline", "defaul
239
239
  inset: n,
240
240
  hasType: f
241
241
  }),
242
- ...s,
242
+ ...o,
243
243
  children: t
244
244
  });
245
245
  };
246
246
  _.displayName = "Content";
247
247
  //#endregion
248
248
  //#region src/card/Type.tsx
249
- var v = t([
249
+ var v = r([
250
250
  "rounded-t-lg default:text-body-2-highlight",
251
251
  "default:text-center",
252
252
  "min-h-sz-32",
@@ -292,7 +292,7 @@ var v = t([
292
292
  }
293
293
  }), y = ({ intent: e, children: t, ...n }) => {
294
294
  let r = d(), i = e ?? r.intent ?? "main", a = r.design === "outlined" && r.hasType;
295
- return t ? /* @__PURE__ */ o("header", {
295
+ return t ? /* @__PURE__ */ c("header", {
296
296
  className: v({
297
297
  intent: i,
298
298
  design: r.design,
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../icon-DY4l9nsc.js"),t=require("../icon-button-DRFf308H.js");let n=require("class-variance-authority"),r=require("react"),i=require("react/jsx-runtime"),a=require("@spark-ui/icons/ArrowVerticalRight"),o=require("@spark-ui/icons/ArrowVerticalLeft");function s(e){let t=(0,r.useRef)(new Map),n=(0,r.useRef)(null),i=(0,r.useRef)(new Map),a=(0,r.useCallback)(()=>e=>{e.forEach(e=>{let n=e.isIntersecting,r=e.target;t.current.set(r,n);let a=i.current.get(r);a&&a(n)})},[]),o=(0,r.useCallback)(()=>{if(n.current)return n.current;let t=e.current;if(!t)return null;let r=new IntersectionObserver(a(),{root:t,threshold:.2});return n.current=r,r},[e,a]);(0,r.useEffect)(()=>{let e=o(),r=t.current,a=i.current;return()=>{e&&(e.disconnect(),r.clear(),a.clear(),n.current=null)}},[o]);let s=(0,r.useCallback)((e,n)=>{if(!e)return;let r=o();if(!r){setTimeout(()=>s(e,n),0);return}let a=t.current.get(e)??!0;t.current.set(e,a),i.current.set(e,n),r.observe(e),n(a)},[o]);return{registerSlide:s,unregisterSlide:(0,r.useCallback)(e=>{if(!e)return;let r=n.current;r&&r.unobserve(e),t.current.delete(e),i.current.delete(e)},[]),isSlideVisible:(0,r.useCallback)(e=>e?t.current.get(e)??!0:!0,[])}}function c(e){let t=(0,r.useRef)(()=>{throw Error(`Cannot call an event handler while rendering.`)});return(0,r.useLayoutEffect)(()=>{t.current=e}),(0,r.useCallback)((...e)=>t.current?.(...e),[])}var l=()=>{let e=(0,r.useRef)(!1);return(0,r.useEffect)(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function u(e,t){let n=(0,r.useRef)(0),i=(0,r.useRef)(null);(0,r.useEffect)(()=>{let r=e.current;if(!r)return;let a=`onscrollend`in window,o=()=>{t()},s=()=>{i.current&&clearTimeout(i.current),e.current&&(n.current=e.current.scrollLeft,i.current=setTimeout(()=>{e.current&&o()},150))};return a?r.addEventListener(`scrollend`,o):r.addEventListener(`scroll`,s),()=>{i.current&&clearTimeout(i.current),a?r.removeEventListener(`scrollend`,o):r.removeEventListener(`scroll`,s)}},[t,e])}function d(e,t){(0,r.useLayoutEffect)(()=>{let n=e.current;if(!n)return;let r=new ResizeObserver(e=>{for(let n of e)t(n.contentRect.width)});return r.observe(n),()=>r.disconnect()},[e,t])}function f({totalSlides:e,slidesPerMove:t,slidesPerPage:n}){let r=t===`auto`?n:t,i=[],a=Math.floor((e-n)/r)*r;for(let e=0;e<=a;e+=r)i.push(e);return i[i.length-1]!==e-n&&i.push(e-n),i}function p(e){return e?Array.from(e.querySelectorAll(`[data-part="item"]`)):[]}function m(e,{container:t,slidesPerMove:n,slidesPerPage:r}){return f({totalSlides:p(t).length,slidesPerPage:r,slidesPerMove:n}).includes(e)}function h({container:e,slidesPerMove:t,slidesPerPage:n}){return e?p(e).filter((r,i)=>m(i,{slidesPerMove:t,slidesPerPage:n,container:e})).map(e=>e.offsetLeft):[]}function g({dotIndex:e,pageState:t,totalPages:n,maxDots:r=5}){if(n<=r)return e===t?`active`:`idle`;if(t<=Math.floor(r/2))return e>r-1?`hidden`:e===t?`active`:e===r-1?`edge`:`idle`;if(t>=n-Math.ceil(r/2)){let i=n-r;return e<i?`hidden`:e===t?`active`:e===i?`edge`:`idle`}let i=t-Math.floor(r/2),a=t+Math.floor(r/2);return e<i||e>a?`hidden`:e===t?`active`:e===i||e===a?`edge`:`idle`}function _(e=[],{carouselRef:t,slidesPerMove:n,slidesPerPage:i}){let[a,o]=(0,r.useState)(e),s=(0,r.useMemo)(()=>a,[a]);return d(t,()=>{let e=h({slidesPerMove:n,slidesPerPage:i,container:t.current});JSON.stringify(a)!==JSON.stringify(e)&&o(e)}),[s,o]}var v=`carousel`,y=`ltr`,b=({defaultPage:e,gap:t=16,snapType:n=`mandatory`,snapStop:i=`always`,scrollPadding:a=0,slidesPerPage:o=1,slidesPerMove:d=`auto`,scrollBehavior:f=`smooth`,loop:p=!1,pagePickerInset:b=!1,maxDots:x=5,page:S,onPageChange:C})=>{let w=(0,r.useId)(),[T,E]=(0,r.useState)(e||S||0),D=(0,r.useRef)(null),O=(0,r.useRef)([]),k=l().current,A=c(C),{registerSlide:j,unregisterSlide:M,isSlideVisible:N}=s(D),[P]=_([],{carouselRef:D,slidesPerMove:d,slidesPerPage:o}),F=(0,r.useRef)(p||T>0),I=(0,r.useRef)(p||T<P.length-1);F.current=p||T>0,I.current=p||T<P.length-1;let L=(0,r.useCallback)(e=>{e!==T&&(E(e),A?.(e))},[A,T]),R=(0,r.useCallback)((e,t)=>{D.current&&(D.current.scrollTo({left:P[e],behavior:t===`instant`?`auto`:`smooth`}),L(e))},[L,P]),z=(0,r.useCallback)(e=>{if(F){let t=p&&T===0?P.length-1:Math.max(T-1,0);R(t,f),e?.(t)}},[p,P,T,f,R]),B=(0,r.useCallback)(e=>{if(I){let t=p&&T===P.length-1?0:Math.min(T+1,P.length-1);R(t,f),e?.(t)}},[p,P,T,f,R]);return(0,r.useEffect)(()=>{S!=null&&R(S,f)},[S,f,R]),(0,r.useLayoutEffect)(()=>{if(e!=null&&!k&&D.current){let t=h({container:D.current,slidesPerMove:d,slidesPerPage:o});D.current.scrollTo({left:t[e],behavior:`instant`})}},[e,k,d,o]),u(D,(0,r.useCallback)(()=>{if(!D.current||P.length===0)return;let{scrollLeft:e}=D.current,t=P.map(t=>Math.abs(e-t)),n=t.indexOf(Math.min(...t));n!==-1&&L(n)},[P,L])),{ref:D,pageIndicatorsRefs:O,gap:t,snapType:n,snapStop:i,scrollPadding:a,slidesPerPage:o,slidesPerMove:d,scrollBehavior:f,loop:p,pagePickerInset:b,maxDots:x,page:T,pageSnapPoints:P,canScrollNext:I.current,canScrollPrev:F.current,scrollTo:R,scrollPrev:z,scrollNext:B,registerSlide:j,unregisterSlide:M,isSlideVisible:N,getRootProps:()=>({id:`carousel::${w}:`,role:`region`,"aria-roledescription":`carousel`,"data-scope":v,"data-part":`root`,"data-orientation":`horizontal`,dir:y,style:{"--slides-per-page":o,"--slide-spacing":`${t}px`,"--slide-item-size":`calc(100% / var(--slides-per-page) - var(--slide-spacing) * (var(--slides-per-page) - 1) / var(--slides-per-page))`}}),getControlProps:()=>({"data-scope":v,"data-part":`control`,"data-orientation":`horizontal`}),getPrevTriggerProps:()=>({id:`carousel::${w}::prev-trigger`,"aria-controls":`carousel::${w}::item-group`,"data-scope":v,"data-part":`prev-trigger`,"data-orientation":`horizontal`,type:`button`,dir:y,disabled:!F.current,onClick:()=>z()}),getNextTriggerProps:()=>({id:`carousel::${w}::next-trigger`,"aria-controls":`carousel::${w}::item-group`,"data-scope":v,"data-part":`next-trigger`,"data-orientation":`horizontal`,type:`button`,dir:y,disabled:!I.current,onClick:()=>B()}),getSlidesContainerProps:()=>({id:`carousel::${w}::item-group`,"aria-live":o>1?`off`:`polite`,"data-scope":v,"data-part":`item-group`,"data-orientation":`horizontal`,dir:y,tabIndex:0,style:{display:`grid`,gap:`var(--slide-spacing)`,scrollSnapType:`x ${n}`,gridAutoFlow:`column`,scrollbarWidth:`none`,gridAutoColumns:`var(--slide-item-size)`,overflowX:`auto`},ref:D}),getSlideProps:({index:e})=>{let t=m(e,{container:D.current,slidesPerMove:d,slidesPerPage:o});return{id:`carousel::${w}::item:${e}`,role:`group`,"aria-roledescription":`slide`,"data-scope":v,"data-part":`item`,"data-index":e,"data-orientation":`horizontal`,dir:y,style:{...t&&{scrollSnapAlign:`start`,scrollSnapStop:i}}}},getIndicatorGroupProps:()=>({role:`radiogroup`,id:`carousel::${w}::indicator-group`,"data-scope":v,"data-part":`indicator-group`,"data-orientation":`horizontal`,dir:y}),getIndicatorProps:({index:e})=>{let t=g({dotIndex:e,pageState:T,totalPages:P.length,maxDots:x});return{role:`radio`,id:`carousel::${w}::indicator:${e}`,"aria-checked":e===T,"data-scope":v,"data-part":`indicator`,"data-orientation":`horizontal`,"data-index":e,"data-state":t,tabIndex:e===T?0:-1,onClick:()=>{R(e,f)},onKeyDown:e=>{let t=e=>{O.current[e]?.focus()};e.key===`ArrowRight`&&I?B(t):e.key===`ArrowLeft`&&F&&z(t)}}}}},x=(0,r.createContext)(null),S=({className:e,snapType:t=`mandatory`,snapStop:r=`always`,scrollBehavior:a=`smooth`,slidesPerMove:o=`auto`,pagePickerInset:s=!1,slidesPerPage:c=1,loop:l=!1,children:u,gap:d=16,defaultPage:f,page:p,onPageChange:m,maxDots:h=5,...g})=>{let _=b({defaultPage:f,slidesPerPage:c,slidesPerMove:o,loop:l,gap:d,scrollBehavior:a,snapStop:r,snapType:t,page:p,pagePickerInset:s,onPageChange:m,maxDots:h});return(0,i.jsx)(x,{value:{..._,scrollBehavior:a},children:(0,i.jsx)(`div`,{"data-spark-component":`carousel`,className:(0,n.cx)(`gap-lg relative box-border flex flex-col`,e),..._.getRootProps(),...g,children:u})})};S.displayName=`Carousel`;var C=()=>{let e=(0,r.useContext)(x);if(!e)throw Error(`useCarouselContext must be used within a Carousel provider`);return e},w=({children:e,className:t,...r})=>{let a=C();return(0,i.jsx)(`div`,{"data-spark-component":`carousel-controls`,className:(0,n.cx)(`default:px-lg pointer-events-none absolute inset-0 flex flex-row items-center justify-between`,t),...a.getControlProps(),...r,children:e})};w.displayName=`Carousel.Controls`;var T=({"aria-label":n,...r})=>(0,i.jsx)(t.t,{"data-spark-component":`carousel-next-button`,...C().getNextTriggerProps(),intent:`surface`,design:`filled`,className:`pointer-events-auto cursor-pointer shadow-sm disabled:invisible`,"aria-label":n,...r,children:(0,i.jsx)(e.t,{children:(0,i.jsx)(a.ArrowVerticalRight,{})})});T.displayName=`Carousel.NextButton`;var E=({children:e,unstyled:t=!1,index:a,"aria-label":o,className:s,intent:c=`support`})=>{let l=C(),u=(0,r.useRef)(null);return(0,r.useEffect)(()=>{l.pageIndicatorsRefs.current&&(l.pageIndicatorsRefs.current[a]=u.current)}),(0,i.jsx)(`button`,{"data-spark-component":`carousel-page-indicator`,ref:u,...l.getIndicatorProps({index:a}),"aria-label":o,className:(0,n.cx)({[(0,n.cx)(`border-outline group relative flex justify-center border-0 hover:cursor-pointer`,`m-sm rounded-sm transition-all duration-[200ms] ease-linear`,`w-sz-8 h-sz-8`,`data-[state=active]:w-sz-32 data-[state=active]:h-sz-8`,`data-[state=edge]:w-sz-4 data-[state=edge]:h-sz-4`,`data-[state=hidden]:m-0 data-[state=hidden]:size-0`,c===`surface`?`data-[state=active]:bg-surface bg-surface/dim-2`:`data-[state=active]:bg-support bg-on-surface/dim-2`)]:!t},s),children:e},a)};E.displayName=`Carousel.PageIndicator`;var D=({children:e,className:t})=>{let r=C();return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(`div`,{"data-spark-component":`carousel-page-picker`,...r.getIndicatorGroupProps(),className:(0,n.cx)(`flex-wrap items-center justify-center`,`default:min-h-sz-16 flex`,r.pagePickerInset&&`bottom-sz-12 absolute inset-x-0`,t),children:r.pageSnapPoints.length<=1?null:e({...r,pages:Array.from({length:r.pageSnapPoints.length},(e,t)=>t)})})})};D.displayName=`Carousel.PagePicker`;var O=({"aria-label":n,...r})=>(0,i.jsx)(t.t,{"data-spark-component":`carousel-prev-button`,...C().getPrevTriggerProps(),intent:`surface`,design:`filled`,className:`pointer-events-auto cursor-pointer shadow-sm disabled:invisible`,"aria-label":n,...r,children:(0,i.jsx)(e.t,{children:(0,i.jsx)(o.ArrowVerticalLeft,{})})});O.displayName=`Carousel.PrevButton`;function k(e,t){let[n,i]=(0,r.useState)(!0),a=C();return(0,r.useEffect)(()=>{let t=e.current;if(!t)return;let{registerSlide:n,unregisterSlide:r}=a;return n(t,i),()=>{r(t)}},[e]),n}var A=({children:e,index:t=0,totalSlides:a,className:o=``,...s})=>{let c=(0,r.useRef)(null),l=C(),u=k(c,l.ref);return(0,i.jsx)(`div`,{"data-spark-component":`carousel-slide`,ref:c,...l.getSlideProps({index:t,totalSlides:a}),className:(0,n.cx)(`default:bg-surface relative overflow-hidden`,o),"aria-hidden":!u,inert:!u,...s,children:e})};A.displayName=`Carousel.Slide`;var j=({children:e,className:t=``})=>{let a=C(),o=r.Children.toArray(e);return(0,i.jsx)(`div`,{"data-spark-component":`carousel-slides`,...a.getSlidesContainerProps(),className:(0,n.cx)(`focus-visible:u-outline relative w-full`,`[-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,t),children:o.map((e,t)=>(0,r.isValidElement)(e)?(0,r.cloneElement)(e,{index:t,totalSlides:o.length}):e)})};j.displayName=`Carousel.Slides`;var M=({children:e})=>(0,i.jsx)(`div`,{className:`relative flex items-center justify-around p-0`,children:e});M.displayName=`Carousel.Viewport`;var N=Object.assign(S,{Controls:w,NextButton:T,PrevButton:O,Slide:A,Slides:j,Viewport:M,PagePicker:D,PageIndicator:E});N.displayName=`Carousel`,exports.Carousel=N;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../icon-CfEsla9z.js"),t=require("../icon-button-B2TM0Xby.js");let n=require("class-variance-authority"),r=require("react"),i=require("react/jsx-runtime"),a=require("@spark-ui/icons/ArrowVerticalRight"),o=require("@spark-ui/icons/ArrowVerticalLeft");function s(e){let t=(0,r.useRef)(new Map),n=(0,r.useRef)(null),i=(0,r.useRef)(new Map),a=(0,r.useCallback)(()=>e=>{e.forEach(e=>{let n=e.isIntersecting,r=e.target;t.current.set(r,n);let a=i.current.get(r);a&&a(n)})},[]),o=(0,r.useCallback)(()=>{if(n.current)return n.current;let t=e.current;if(!t)return null;let r=new IntersectionObserver(a(),{root:t,threshold:.2});return n.current=r,r},[e,a]);(0,r.useEffect)(()=>{let e=o(),r=t.current,a=i.current;return()=>{e&&(e.disconnect(),r.clear(),a.clear(),n.current=null)}},[o]);let s=(0,r.useCallback)((e,n)=>{if(!e)return;let r=o();if(!r){setTimeout(()=>s(e,n),0);return}let a=t.current.get(e)??!0;t.current.set(e,a),i.current.set(e,n),r.observe(e),n(a)},[o]);return{registerSlide:s,unregisterSlide:(0,r.useCallback)(e=>{if(!e)return;let r=n.current;r&&r.unobserve(e),t.current.delete(e),i.current.delete(e)},[]),isSlideVisible:(0,r.useCallback)(e=>e?t.current.get(e)??!0:!0,[])}}function c(e){let t=(0,r.useRef)(()=>{throw Error(`Cannot call an event handler while rendering.`)});return(0,r.useLayoutEffect)(()=>{t.current=e}),(0,r.useCallback)((...e)=>t.current?.(...e),[])}var l=()=>{let e=(0,r.useRef)(!1);return(0,r.useEffect)(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function u(e,t){let n=(0,r.useRef)(0),i=(0,r.useRef)(null);(0,r.useEffect)(()=>{let r=e.current;if(!r)return;let a=`onscrollend`in window,o=()=>{t()},s=()=>{i.current&&clearTimeout(i.current),e.current&&(n.current=e.current.scrollLeft,i.current=setTimeout(()=>{e.current&&o()},150))};return a?r.addEventListener(`scrollend`,o):r.addEventListener(`scroll`,s),()=>{i.current&&clearTimeout(i.current),a?r.removeEventListener(`scrollend`,o):r.removeEventListener(`scroll`,s)}},[t,e])}function d(e,t){(0,r.useLayoutEffect)(()=>{let n=e.current;if(!n)return;let r=new ResizeObserver(e=>{for(let n of e)t(n.contentRect.width)});return r.observe(n),()=>r.disconnect()},[e,t])}function f({totalSlides:e,slidesPerMove:t,slidesPerPage:n}){let r=t===`auto`?n:t,i=[],a=Math.floor((e-n)/r)*r;for(let e=0;e<=a;e+=r)i.push(e);return i[i.length-1]!==e-n&&i.push(e-n),i}function p(e){return e?Array.from(e.querySelectorAll(`[data-part="item"]`)):[]}function m(e,{container:t,slidesPerMove:n,slidesPerPage:r}){return f({totalSlides:p(t).length,slidesPerPage:r,slidesPerMove:n}).includes(e)}function h({container:e,slidesPerMove:t,slidesPerPage:n}){return e?p(e).filter((r,i)=>m(i,{slidesPerMove:t,slidesPerPage:n,container:e})).map(e=>e.offsetLeft):[]}function g({dotIndex:e,pageState:t,totalPages:n,maxDots:r=5}){if(n<=r)return e===t?`active`:`idle`;if(t<=Math.floor(r/2))return e>r-1?`hidden`:e===t?`active`:e===r-1?`edge`:`idle`;if(t>=n-Math.ceil(r/2)){let i=n-r;return e<i?`hidden`:e===t?`active`:e===i?`edge`:`idle`}let i=t-Math.floor(r/2),a=t+Math.floor(r/2);return e<i||e>a?`hidden`:e===t?`active`:e===i||e===a?`edge`:`idle`}function _(e=[],{carouselRef:t,slidesPerMove:n,slidesPerPage:i}){let[a,o]=(0,r.useState)(e),s=(0,r.useMemo)(()=>a,[a]);return d(t,()=>{let e=h({slidesPerMove:n,slidesPerPage:i,container:t.current});JSON.stringify(a)!==JSON.stringify(e)&&o(e)}),[s,o]}var v=`carousel`,y=`ltr`,b=({defaultPage:e,gap:t=16,snapType:n=`mandatory`,snapStop:i=`always`,scrollPadding:a=0,slidesPerPage:o=1,slidesPerMove:d=`auto`,scrollBehavior:f=`smooth`,loop:p=!1,pagePickerInset:b=!1,maxDots:x=5,page:S,onPageChange:C})=>{let w=(0,r.useId)(),[T,E]=(0,r.useState)(e||S||0),D=(0,r.useRef)(null),O=(0,r.useRef)([]),k=l().current,A=c(C),{registerSlide:j,unregisterSlide:M,isSlideVisible:N}=s(D),[P]=_([],{carouselRef:D,slidesPerMove:d,slidesPerPage:o}),F=(0,r.useRef)(p||T>0),I=(0,r.useRef)(p||T<P.length-1);F.current=p||T>0,I.current=p||T<P.length-1;let L=(0,r.useCallback)(e=>{e!==T&&(E(e),A?.(e))},[A,T]),R=(0,r.useCallback)((e,t)=>{D.current&&(D.current.scrollTo({left:P[e],behavior:t===`instant`?`auto`:`smooth`}),L(e))},[L,P]),z=(0,r.useCallback)(e=>{if(F){let t=p&&T===0?P.length-1:Math.max(T-1,0);R(t,f),e?.(t)}},[p,P,T,f,R]),B=(0,r.useCallback)(e=>{if(I){let t=p&&T===P.length-1?0:Math.min(T+1,P.length-1);R(t,f),e?.(t)}},[p,P,T,f,R]);return(0,r.useEffect)(()=>{S!=null&&R(S,f)},[S,f,R]),(0,r.useLayoutEffect)(()=>{if(e!=null&&!k&&D.current){let t=h({container:D.current,slidesPerMove:d,slidesPerPage:o});D.current.scrollTo({left:t[e],behavior:`instant`})}},[e,k,d,o]),u(D,(0,r.useCallback)(()=>{if(!D.current||P.length===0)return;let{scrollLeft:e}=D.current,t=P.map(t=>Math.abs(e-t)),n=t.indexOf(Math.min(...t));n!==-1&&L(n)},[P,L])),{ref:D,pageIndicatorsRefs:O,gap:t,snapType:n,snapStop:i,scrollPadding:a,slidesPerPage:o,slidesPerMove:d,scrollBehavior:f,loop:p,pagePickerInset:b,maxDots:x,page:T,pageSnapPoints:P,canScrollNext:I.current,canScrollPrev:F.current,scrollTo:R,scrollPrev:z,scrollNext:B,registerSlide:j,unregisterSlide:M,isSlideVisible:N,getRootProps:()=>({id:`carousel::${w}:`,role:`region`,"aria-roledescription":`carousel`,"data-scope":v,"data-part":`root`,"data-orientation":`horizontal`,dir:y,style:{"--slides-per-page":o,"--slide-spacing":`${t}px`,"--slide-item-size":`calc(100% / var(--slides-per-page) - var(--slide-spacing) * (var(--slides-per-page) - 1) / var(--slides-per-page))`}}),getControlProps:()=>({"data-scope":v,"data-part":`control`,"data-orientation":`horizontal`}),getPrevTriggerProps:()=>({id:`carousel::${w}::prev-trigger`,"aria-controls":`carousel::${w}::item-group`,"data-scope":v,"data-part":`prev-trigger`,"data-orientation":`horizontal`,type:`button`,dir:y,disabled:!F.current,onClick:()=>z()}),getNextTriggerProps:()=>({id:`carousel::${w}::next-trigger`,"aria-controls":`carousel::${w}::item-group`,"data-scope":v,"data-part":`next-trigger`,"data-orientation":`horizontal`,type:`button`,dir:y,disabled:!I.current,onClick:()=>B()}),getSlidesContainerProps:()=>({id:`carousel::${w}::item-group`,"aria-live":o>1?`off`:`polite`,"data-scope":v,"data-part":`item-group`,"data-orientation":`horizontal`,dir:y,tabIndex:0,style:{display:`grid`,gap:`var(--slide-spacing)`,scrollSnapType:`x ${n}`,gridAutoFlow:`column`,scrollbarWidth:`none`,gridAutoColumns:`var(--slide-item-size)`,overflowX:`auto`},ref:D}),getSlideProps:({index:e})=>{let t=m(e,{container:D.current,slidesPerMove:d,slidesPerPage:o});return{id:`carousel::${w}::item:${e}`,role:`group`,"aria-roledescription":`slide`,"data-scope":v,"data-part":`item`,"data-index":e,"data-orientation":`horizontal`,dir:y,style:{...t&&{scrollSnapAlign:`start`,scrollSnapStop:i}}}},getIndicatorGroupProps:()=>({role:`radiogroup`,id:`carousel::${w}::indicator-group`,"data-scope":v,"data-part":`indicator-group`,"data-orientation":`horizontal`,dir:y}),getIndicatorProps:({index:e})=>{let t=g({dotIndex:e,pageState:T,totalPages:P.length,maxDots:x});return{role:`radio`,id:`carousel::${w}::indicator:${e}`,"aria-checked":e===T,"data-scope":v,"data-part":`indicator`,"data-orientation":`horizontal`,"data-index":e,"data-state":t,tabIndex:e===T?0:-1,onClick:()=>{R(e,f)},onKeyDown:e=>{let t=e=>{O.current[e]?.focus()};e.key===`ArrowRight`&&I?B(t):e.key===`ArrowLeft`&&F&&z(t)}}}}},x=(0,r.createContext)(null),S=({className:e,snapType:t=`mandatory`,snapStop:r=`always`,scrollBehavior:a=`smooth`,slidesPerMove:o=`auto`,pagePickerInset:s=!1,slidesPerPage:c=1,loop:l=!1,children:u,gap:d=16,defaultPage:f,page:p,onPageChange:m,maxDots:h=5,...g})=>{let _=b({defaultPage:f,slidesPerPage:c,slidesPerMove:o,loop:l,gap:d,scrollBehavior:a,snapStop:r,snapType:t,page:p,pagePickerInset:s,onPageChange:m,maxDots:h});return(0,i.jsx)(x,{value:{..._,scrollBehavior:a},children:(0,i.jsx)(`div`,{"data-spark-component":`carousel`,className:(0,n.cx)(`gap-lg relative box-border flex flex-col`,e),..._.getRootProps(),...g,children:u})})};S.displayName=`Carousel`;var C=()=>{let e=(0,r.useContext)(x);if(!e)throw Error(`useCarouselContext must be used within a Carousel provider`);return e},w=({children:e,className:t,...r})=>{let a=C();return(0,i.jsx)(`div`,{"data-spark-component":`carousel-controls`,className:(0,n.cx)(`default:px-lg pointer-events-none absolute inset-0 flex flex-row items-center justify-between`,t),...a.getControlProps(),...r,children:e})};w.displayName=`Carousel.Controls`;var T=({"aria-label":n,...r})=>(0,i.jsx)(t.t,{"data-spark-component":`carousel-next-button`,...C().getNextTriggerProps(),intent:`surface`,design:`filled`,className:`pointer-events-auto cursor-pointer shadow-sm disabled:invisible`,"aria-label":n,...r,children:(0,i.jsx)(e.t,{children:(0,i.jsx)(a.ArrowVerticalRight,{})})});T.displayName=`Carousel.NextButton`;var E=({children:e,unstyled:t=!1,index:a,"aria-label":o,className:s,intent:c=`support`})=>{let l=C(),u=(0,r.useRef)(null);return(0,r.useEffect)(()=>{l.pageIndicatorsRefs.current&&(l.pageIndicatorsRefs.current[a]=u.current)}),(0,i.jsx)(`button`,{"data-spark-component":`carousel-page-indicator`,ref:u,...l.getIndicatorProps({index:a}),"aria-label":o,className:(0,n.cx)({[(0,n.cx)(`border-outline group relative flex justify-center border-0 hover:cursor-pointer`,`m-sm rounded-sm transition-all duration-[200ms] ease-linear`,`w-sz-8 h-sz-8`,`data-[state=active]:w-sz-32 data-[state=active]:h-sz-8`,`data-[state=edge]:w-sz-4 data-[state=edge]:h-sz-4`,`data-[state=hidden]:m-0 data-[state=hidden]:size-0`,c===`surface`?`data-[state=active]:bg-surface bg-surface/dim-2`:`data-[state=active]:bg-support bg-on-surface/dim-2`)]:!t},s),children:e},a)};E.displayName=`Carousel.PageIndicator`;var D=({children:e,className:t})=>{let r=C();return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(`div`,{"data-spark-component":`carousel-page-picker`,...r.getIndicatorGroupProps(),className:(0,n.cx)(`flex-wrap items-center justify-center`,`default:min-h-sz-16 flex`,r.pagePickerInset&&`bottom-sz-12 absolute inset-x-0`,t),children:r.pageSnapPoints.length<=1?null:e({...r,pages:Array.from({length:r.pageSnapPoints.length},(e,t)=>t)})})})};D.displayName=`Carousel.PagePicker`;var O=({"aria-label":n,...r})=>(0,i.jsx)(t.t,{"data-spark-component":`carousel-prev-button`,...C().getPrevTriggerProps(),intent:`surface`,design:`filled`,className:`pointer-events-auto cursor-pointer shadow-sm disabled:invisible`,"aria-label":n,...r,children:(0,i.jsx)(e.t,{children:(0,i.jsx)(o.ArrowVerticalLeft,{})})});O.displayName=`Carousel.PrevButton`;function k(e,t){let[n,i]=(0,r.useState)(!0),a=C();return(0,r.useEffect)(()=>{let t=e.current;if(!t)return;let{registerSlide:n,unregisterSlide:r}=a;return n(t,i),()=>{r(t)}},[e]),n}var A=({children:e,index:t=0,totalSlides:a,className:o=``,...s})=>{let c=(0,r.useRef)(null),l=C(),u=k(c,l.ref);return(0,i.jsx)(`div`,{"data-spark-component":`carousel-slide`,ref:c,...l.getSlideProps({index:t,totalSlides:a}),className:(0,n.cx)(`default:bg-surface relative overflow-hidden`,o),"aria-hidden":!u,inert:!u,...s,children:e})};A.displayName=`Carousel.Slide`;var j=({children:e,className:t=``})=>{let a=C(),o=r.Children.toArray(e);return(0,i.jsx)(`div`,{"data-spark-component":`carousel-slides`,...a.getSlidesContainerProps(),className:(0,n.cx)(`focus-visible:u-outline relative w-full`,`[-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,t),children:o.map((e,t)=>(0,r.isValidElement)(e)?(0,r.cloneElement)(e,{index:t,totalSlides:o.length}):e)})};j.displayName=`Carousel.Slides`;var M=({children:e})=>(0,i.jsx)(`div`,{className:`relative flex items-center justify-around p-0`,children:e});M.displayName=`Carousel.Viewport`;var N=Object.assign(S,{Controls:w,NextButton:T,PrevButton:O,Slide:A,Slides:j,Viewport:M,PagePicker:D,PageIndicator:E});N.displayName=`Carousel`,exports.Carousel=N;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
- import { t as e } from "../icon-Bs-39J-H.mjs";
2
- import { t } from "../icon-button-C1ThqdK1.mjs";
1
+ import { t as e } from "../icon-VM_Ys9Xn.mjs";
2
+ import { t } from "../icon-button-CexCkoV0.mjs";
3
3
  import { cx as n } from "class-variance-authority";
4
4
  import { Children as r, cloneElement as i, createContext as a, isValidElement as o, useCallback as s, useContext as c, useEffect as l, useId as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m } from "react";
5
5
  import { Fragment as h, jsx as g } from "react/jsx-runtime";