@epilot/spark-ui 0.20.2 → 0.20.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 (262) hide show
  1. package/dist/components/accordion.cjs +5 -5
  2. package/dist/components/accordion.cjs.map +1 -1
  3. package/dist/components/alert-dialog.cjs +9 -9
  4. package/dist/components/alert-dialog.cjs.map +1 -1
  5. package/dist/components/attachment.cjs +10 -10
  6. package/dist/components/attachment.cjs.map +1 -1
  7. package/dist/components/autocomplete.cjs +12 -12
  8. package/dist/components/autocomplete.cjs.map +1 -1
  9. package/dist/components/avatar.cjs +2 -2
  10. package/dist/components/avatar.cjs.map +1 -1
  11. package/dist/components/avatar.js +1 -1
  12. package/dist/components/badge.cjs +2 -2
  13. package/dist/components/badge.cjs.map +1 -1
  14. package/dist/components/badge.js +2 -2
  15. package/dist/components/badge.js.map +1 -1
  16. package/dist/components/bar-chart.cjs +4 -4
  17. package/dist/components/bar-chart.cjs.map +1 -1
  18. package/dist/components/bar-chart.js +2 -2
  19. package/dist/components/bar-chart.js.map +1 -1
  20. package/dist/components/box.cjs +2 -2
  21. package/dist/components/box.cjs.map +1 -1
  22. package/dist/components/box.js +1 -1
  23. package/dist/components/breadcrumbs.cjs +7 -7
  24. package/dist/components/breadcrumbs.cjs.map +1 -1
  25. package/dist/components/bubble.cjs +5 -5
  26. package/dist/components/bubble.cjs.map +1 -1
  27. package/dist/components/bubble.d.cts +1 -1
  28. package/dist/components/bubble.d.ts +1 -1
  29. package/dist/components/button-group.cjs +5 -5
  30. package/dist/components/button-group.cjs.map +1 -1
  31. package/dist/components/button-group.js +1 -1
  32. package/dist/components/button.cjs +2 -2
  33. package/dist/components/button.cjs.map +1 -1
  34. package/dist/components/button.d.cts +2 -2
  35. package/dist/components/button.d.ts +2 -2
  36. package/dist/components/button.js +1 -1
  37. package/dist/components/button.js.map +1 -1
  38. package/dist/components/calendar.cjs +10 -11
  39. package/dist/components/calendar.cjs.map +1 -1
  40. package/dist/components/calendar.js +3 -4
  41. package/dist/components/calendar.js.map +1 -1
  42. package/dist/components/callout.cjs +7 -7
  43. package/dist/components/callout.cjs.map +1 -1
  44. package/dist/components/callout.d.cts +1 -1
  45. package/dist/components/callout.d.ts +1 -1
  46. package/dist/components/card.cjs +16 -16
  47. package/dist/components/card.cjs.map +1 -1
  48. package/dist/components/card.js +2 -2
  49. package/dist/components/card.js.map +1 -1
  50. package/dist/components/chart.cjs +2 -2
  51. package/dist/components/chart.cjs.map +1 -1
  52. package/dist/components/checkbox.cjs +2 -2
  53. package/dist/components/checkbox.cjs.map +1 -1
  54. package/dist/components/checkbox.js +1 -1
  55. package/dist/components/checkbox.js.map +1 -1
  56. package/dist/components/circular-gauge.cjs +3 -3
  57. package/dist/components/circular-gauge.cjs.map +1 -1
  58. package/dist/components/circular-gauge.js +1 -1
  59. package/dist/components/circular-gauge.js.map +1 -1
  60. package/dist/components/day-of-week-picker.cjs +4 -4
  61. package/dist/components/day-of-week-picker.cjs.map +1 -1
  62. package/dist/components/dialog.cjs +8 -8
  63. package/dist/components/dialog.cjs.map +1 -1
  64. package/dist/components/donut-chart.cjs.map +1 -1
  65. package/dist/components/donut-chart.js.map +1 -1
  66. package/dist/components/drawer.cjs +8 -8
  67. package/dist/components/drawer.cjs.map +1 -1
  68. package/dist/components/drawer.js +2 -2
  69. package/dist/components/drawer.js.map +1 -1
  70. package/dist/components/dropdown-menu.cjs +10 -10
  71. package/dist/components/dropdown-menu.cjs.map +1 -1
  72. package/dist/components/energy-breakdown.cjs +1 -1
  73. package/dist/components/energy-breakdown.cjs.map +1 -1
  74. package/dist/components/energy-breakdown.js +1 -1
  75. package/dist/components/energy-breakdown.js.map +1 -1
  76. package/dist/components/entity-card.cjs +11 -11
  77. package/dist/components/entity-card.cjs.map +1 -1
  78. package/dist/components/field.cjs +16 -16
  79. package/dist/components/field.cjs.map +1 -1
  80. package/dist/components/field.js +1 -1
  81. package/dist/components/field.js.map +1 -1
  82. package/dist/components/hero-metric.cjs +4 -4
  83. package/dist/components/hero-metric.cjs.map +1 -1
  84. package/dist/components/icon.cjs +6 -6
  85. package/dist/components/icon.cjs.map +1 -1
  86. package/dist/components/icon.js +5 -5
  87. package/dist/components/icon.js.map +1 -1
  88. package/dist/components/info-block.cjs +9 -9
  89. package/dist/components/info-block.cjs.map +1 -1
  90. package/dist/components/input-date.cjs +3 -4
  91. package/dist/components/input-date.cjs.map +1 -1
  92. package/dist/components/input-date.d.cts +1 -3
  93. package/dist/components/input-date.d.ts +1 -3
  94. package/dist/components/input-date.js +1 -2
  95. package/dist/components/input-date.js.map +1 -1
  96. package/dist/components/input-group.cjs +5 -5
  97. package/dist/components/input-group.cjs.map +1 -1
  98. package/dist/components/input-otp.cjs +2 -2
  99. package/dist/components/input-otp.cjs.map +1 -1
  100. package/dist/components/input.cjs +2 -2
  101. package/dist/components/input.cjs.map +1 -1
  102. package/dist/components/label.cjs +2 -2
  103. package/dist/components/label.cjs.map +1 -1
  104. package/dist/components/layout.cjs +2 -2
  105. package/dist/components/layout.cjs.map +1 -1
  106. package/dist/components/line-chart.cjs +7 -7
  107. package/dist/components/line-chart.cjs.map +1 -1
  108. package/dist/components/line-chart.js +5 -5
  109. package/dist/components/line-chart.js.map +1 -1
  110. package/dist/components/list.cjs +11 -11
  111. package/dist/components/list.cjs.map +1 -1
  112. package/dist/components/list.d.cts +2 -7
  113. package/dist/components/list.d.ts +2 -7
  114. package/dist/components/list.js +2 -2
  115. package/dist/components/list.js.map +1 -1
  116. package/dist/components/marker.cjs +4 -4
  117. package/dist/components/marker.cjs.map +1 -1
  118. package/dist/components/marker.d.cts +1 -1
  119. package/dist/components/marker.d.ts +1 -1
  120. package/dist/components/message-scroller.cjs +6 -6
  121. package/dist/components/message-scroller.cjs.map +1 -1
  122. package/dist/components/message-scroller.js +2 -2
  123. package/dist/components/message-scroller.js.map +1 -1
  124. package/dist/components/message.cjs +7 -7
  125. package/dist/components/message.cjs.map +1 -1
  126. package/dist/components/page-header.cjs +5 -5
  127. package/dist/components/page-header.cjs.map +1 -1
  128. package/dist/components/period-tabs.cjs +6 -6
  129. package/dist/components/period-tabs.cjs.map +1 -1
  130. package/dist/components/pill.cjs +3 -3
  131. package/dist/components/pill.cjs.map +1 -1
  132. package/dist/components/pill.js +3 -3
  133. package/dist/components/pill.js.map +1 -1
  134. package/dist/components/popover.cjs +2 -2
  135. package/dist/components/popover.cjs.map +1 -1
  136. package/dist/components/power-history-chart.cjs +4 -4
  137. package/dist/components/power-history-chart.cjs.map +1 -1
  138. package/dist/components/power-history-chart.js +3 -3
  139. package/dist/components/power-history-chart.js.map +1 -1
  140. package/dist/components/power-network.cjs +9 -9
  141. package/dist/components/power-network.cjs.map +1 -1
  142. package/dist/components/power-network.js +1 -1
  143. package/dist/components/progress.cjs +3 -3
  144. package/dist/components/progress.cjs.map +1 -1
  145. package/dist/components/progress.js +1 -1
  146. package/dist/components/progress.js.map +1 -1
  147. package/dist/components/radio-card-group.cjs +3 -3
  148. package/dist/components/radio-card-group.cjs.map +1 -1
  149. package/dist/components/radio.cjs +3 -3
  150. package/dist/components/radio.cjs.map +1 -1
  151. package/dist/components/radio.js +1 -1
  152. package/dist/components/sankey-chart.cjs +4 -4
  153. package/dist/components/sankey-chart.cjs.map +1 -1
  154. package/dist/components/sankey-chart.js +2 -2
  155. package/dist/components/sankey-chart.js.map +1 -1
  156. package/dist/components/schedule-editor.cjs +9 -9
  157. package/dist/components/schedule-editor.cjs.map +1 -1
  158. package/dist/components/schedule-list.cjs +10 -10
  159. package/dist/components/schedule-list.cjs.map +1 -1
  160. package/dist/components/scroll-area.cjs +3 -3
  161. package/dist/components/scroll-area.cjs.map +1 -1
  162. package/dist/components/segmented-control.cjs +8 -8
  163. package/dist/components/segmented-control.cjs.map +1 -1
  164. package/dist/components/segmented-control.d.cts +16 -2
  165. package/dist/components/segmented-control.d.ts +16 -2
  166. package/dist/components/segmented-control.js +5 -5
  167. package/dist/components/segmented-control.js.map +1 -1
  168. package/dist/components/select.cjs +11 -11
  169. package/dist/components/select.cjs.map +1 -1
  170. package/dist/components/separator.cjs +3 -3
  171. package/dist/components/separator.cjs.map +1 -1
  172. package/dist/components/series-legend.cjs +4 -4
  173. package/dist/components/series-legend.cjs.map +1 -1
  174. package/dist/components/sheet.cjs +8 -8
  175. package/dist/components/sheet.cjs.map +1 -1
  176. package/dist/components/skeleton.cjs +3 -3
  177. package/dist/components/skeleton.cjs.map +1 -1
  178. package/dist/components/slider.cjs +11 -11
  179. package/dist/components/slider.cjs.map +1 -1
  180. package/dist/components/slider.js.map +1 -1
  181. package/dist/components/solar-forecast-chart.cjs +2 -2
  182. package/dist/components/solar-forecast-chart.cjs.map +1 -1
  183. package/dist/components/solar-forecast-chart.js +1 -1
  184. package/dist/components/sortable-list.cjs +3 -3
  185. package/dist/components/sortable-list.cjs.map +1 -1
  186. package/dist/components/spinner.cjs +2 -2
  187. package/dist/components/spinner.cjs.map +1 -1
  188. package/dist/components/stat-card.cjs +8 -8
  189. package/dist/components/stat-card.cjs.map +1 -1
  190. package/dist/components/stepper.cjs +2 -2
  191. package/dist/components/stepper.cjs.map +1 -1
  192. package/dist/components/switch.cjs +3 -3
  193. package/dist/components/switch.cjs.map +1 -1
  194. package/dist/components/switch.js +2 -2
  195. package/dist/components/switch.js.map +1 -1
  196. package/dist/components/table.cjs +8 -8
  197. package/dist/components/table.cjs.map +1 -1
  198. package/dist/components/tabs.cjs +9 -9
  199. package/dist/components/tabs.cjs.map +1 -1
  200. package/dist/components/tabs.d.cts +8 -1
  201. package/dist/components/tabs.d.ts +8 -1
  202. package/dist/components/tabs.js +2 -2
  203. package/dist/components/tabs.js.map +1 -1
  204. package/dist/components/textarea.cjs +2 -2
  205. package/dist/components/textarea.cjs.map +1 -1
  206. package/dist/components/theme.cjs +2 -2
  207. package/dist/components/theme.cjs.map +1 -1
  208. package/dist/components/theme.js +1 -1
  209. package/dist/components/thumbnail.cjs +3 -3
  210. package/dist/components/thumbnail.cjs.map +1 -1
  211. package/dist/components/time-picker.cjs +3 -3
  212. package/dist/components/time-picker.cjs.map +1 -1
  213. package/dist/components/toast.cjs +14 -39
  214. package/dist/components/toast.cjs.map +1 -1
  215. package/dist/components/toast.d.cts +2 -15
  216. package/dist/components/toast.d.ts +2 -15
  217. package/dist/components/toast.js +7 -32
  218. package/dist/components/toast.js.map +1 -1
  219. package/dist/components/tooltip.cjs +3 -3
  220. package/dist/components/tooltip.cjs.map +1 -1
  221. package/dist/components/tooltip.js +1 -1
  222. package/dist/components/tooltip.js.map +1 -1
  223. package/dist/components/typography.cjs +6 -6
  224. package/dist/components/typography.cjs.map +1 -1
  225. package/dist/components/wizard-layout.cjs +8 -8
  226. package/dist/components/wizard-layout.cjs.map +1 -1
  227. package/dist/lib/generate-radix-colors.cjs +1 -1
  228. package/dist/lib/generate-radix-colors.cjs.map +1 -1
  229. package/dist/lib/generate-radix-colors.js +1 -1
  230. package/dist/lib/generate-radix-colors.js.map +1 -1
  231. package/dist/lib/input-box-variants.cjs +9 -9
  232. package/dist/lib/input-box-variants.cjs.map +1 -1
  233. package/dist/styles/spark-default.css +0 -11
  234. package/dist/utils/cn.cjs +2 -2
  235. package/dist/utils/cn.d.cts +1 -1
  236. package/dist/utils/cn.d.ts +1 -1
  237. package/dist/utils/cn.js +1 -1
  238. package/dist/utils/format.cjs +0 -1
  239. package/dist/utils/format.cjs.map +1 -1
  240. package/dist/utils/format.d.cts +1 -2
  241. package/dist/utils/format.d.ts +1 -2
  242. package/dist/utils/format.js +1 -1
  243. package/dist/utils/format.js.map +1 -1
  244. package/package.json +1 -1
  245. package/dist/components/toggle-group.cjs +0 -40
  246. package/dist/components/toggle-group.cjs.map +0 -1
  247. package/dist/components/toggle-group.d.cts +0 -28
  248. package/dist/components/toggle-group.d.ts +0 -28
  249. package/dist/components/toggle-group.js +0 -37
  250. package/dist/components/toggle-group.js.map +0 -1
  251. package/dist/components/toggle.cjs +0 -69
  252. package/dist/components/toggle.cjs.map +0 -1
  253. package/dist/components/toggle.d.cts +0 -23
  254. package/dist/components/toggle.d.ts +0 -23
  255. package/dist/components/toggle.js +0 -66
  256. package/dist/components/toggle.js.map +0 -1
  257. package/dist/lib/toggle-group-context.cjs +0 -12
  258. package/dist/lib/toggle-group-context.cjs.map +0 -1
  259. package/dist/lib/toggle-group-context.d.cts +0 -17
  260. package/dist/lib/toggle-group-context.d.ts +0 -17
  261. package/dist/lib/toggle-group-context.js +0 -9
  262. package/dist/lib/toggle-group-context.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"callout.cjs","names":["Cancel","CheckCircle","Warning","Info","React","Button"],"sources":["../../src/components/callout.tsx"],"sourcesContent":["import {\n Cancel,\n CheckCircle,\n Info,\n Warning,\n type SparkIcon,\n} from '@epilot/spark-icons'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\nimport { cn } from '../utils/cn'\nimport { Button, type ButtonProps } from './button'\n\ntype CalloutVariant = 'error' | 'info' | 'neutral' | 'success' | 'warning'\n\nconst calloutVariants = cva(\n 'group/callout flex w-full items-start gap-2 rounded-lg px-4 py-3 text-sm transition-colors duration-150 ease-out motion-reduce:transition-none',\n {\n variants: {\n variant: {\n error: 'bg-error-soft text-error-soft-foreground',\n success: 'bg-success-soft text-success-soft-foreground',\n warning: 'bg-warning-soft text-warning-soft-foreground',\n info: 'bg-base-info-soft text-info',\n neutral: 'bg-base-gray-soft text-gray',\n },\n },\n defaultVariants: {\n variant: 'info',\n },\n },\n)\n\nconst CALLOUT_ICONS: Record<\n CalloutVariant,\n { icon: SparkIcon; className: string }\n> = {\n error: { icon: Cancel, className: 'text-error-soft-foreground' },\n success: { icon: CheckCircle, className: 'text-success-soft-foreground' },\n warning: { icon: Warning, className: 'text-warning-soft-foreground' },\n info: { icon: Info, className: 'text-info-light' },\n neutral: { icon: Info, className: 'text-gray-light' },\n}\n\ninterface CalloutProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof calloutVariants> {\n /** Overrides the variant's default icon; the variant's color is kept. `false` renders no icon. */\n icon?: SparkIcon | false\n}\n\nconst CalloutTitle = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span\n data-slot=\"callout-title\"\n className={cn('text-base leading-5 font-semibold', className)}\n {...props}\n />\n)\n\nconst CalloutDescription = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLParagraphElement>) => (\n <p\n data-slot=\"callout-description\"\n className={cn('text-sm', className)}\n {...props}\n />\n)\n\nconst CalloutVariantContext = React.createContext<CalloutVariant>('info')\n\nconst CALLOUT_ACTION_COLORS: Record<CalloutVariant, string> = {\n error:\n 'bg-error-soft text-error-soft-foreground hover:bg-error-soft-hover focus-visible:bg-error-soft-hover',\n success:\n 'bg-success-soft text-success-soft-foreground hover:bg-success-soft-hover focus-visible:bg-success-soft-hover',\n warning:\n 'bg-warning-soft text-warning-soft-foreground hover:bg-warning-soft-hover focus-visible:bg-warning-soft-hover',\n info: 'bg-base-info-soft text-info hover:bg-blue-a4 focus-visible:bg-blue-a4',\n neutral:\n 'bg-base-gray-soft text-gray hover:bg-gray-a4 focus-visible:bg-gray-a4',\n}\n\nconst CalloutActions = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n data-slot=\"callout-actions\"\n className={cn(\n 'mt-2 flex flex-wrap items-center gap-2 [&_[data-slot=callout-action]]:mt-0',\n className,\n )}\n {...props}\n />\n)\n\ntype CalloutActionType = Omit<ButtonProps, 'styleVariant' | 'color'> & {\n align?: 'start' | 'end'\n primary?: boolean\n}\n\nconst CalloutAction = ({\n className,\n align = 'start',\n primary = false,\n ...props\n}: CalloutActionType) => {\n const calloutVariant = React.useContext(CalloutVariantContext)\n\n return (\n <Button\n data-slot=\"callout-action\"\n size=\"small\"\n styleVariant={primary ? 'solid' : 'surface'}\n color={primary ? 'primary' : 'neutral'}\n className={cn(\n 'mt-2 w-fit',\n { 'self-start': align === 'start', 'self-end': align === 'end' },\n !primary && CALLOUT_ACTION_COLORS[calloutVariant],\n className,\n )}\n {...props}\n />\n )\n}\n\nconst Callout = ({\n variant = 'info',\n icon,\n className,\n children,\n ...props\n}: CalloutProps) => {\n const variantIcon = CALLOUT_ICONS[variant ?? 'info']\n const Glyph = icon === false ? null : (icon ?? variantIcon.icon)\n\n return (\n <CalloutVariantContext.Provider value={variant ?? 'info'}>\n <div\n data-slot=\"callout\"\n className={cn(calloutVariants({ variant }), className)}\n {...props}\n >\n {Glyph ? (\n <Glyph\n className={cn(\n '[--spark-icon-size:calc(20px*var(--spark-scaling,1))]',\n variantIcon.className,\n )}\n />\n ) : null}\n <div className=\"flex w-full min-w-0 flex-col gap-1\">{children}</div>\n </div>\n </CalloutVariantContext.Provider>\n )\n}\n\nexport {\n Callout,\n CalloutAction,\n CalloutActions,\n CalloutDescription,\n CalloutTitle,\n calloutVariants,\n}\nexport type { CalloutProps, CalloutVariant }\n"],"mappings":";;;;;;;;;;;AAcA,MAAM,mBAAA,GAAA,yBAAA,KACJ,kJACA;CACE,UAAU,EACR,SAAS;EACP,OAAO;EACP,SAAS;EACT,SAAS;EACT,MAAM;EACN,SAAS;CACX,EACF;CACA,iBAAiB,EACf,SAAS,OACX;AACF,CACF;AAEA,MAAM,gBAGF;CACF,OAAO;EAAE,MAAMA,oBAAAA;EAAQ,WAAW;CAA6B;CAC/D,SAAS;EAAE,MAAMC,oBAAAA;EAAa,WAAW;CAA+B;CACxE,SAAS;EAAE,MAAMC,oBAAAA;EAAS,WAAW;CAA+B;CACpE,MAAM;EAAE,MAAMC,oBAAAA;EAAM,WAAW;CAAkB;CACjD,SAAS;EAAE,MAAMA,oBAAAA;EAAM,WAAW;CAAkB;AACtD;AAUA,MAAM,gBAAgB,EACpB,WACA,GAAG,YAEH,iBAAA,GAAA,kBAAA,KAAC,QAAD;CACE,aAAU;CACV,YAAA,GAAA,GAAA,IAAc,qCAAqC,SAAS;CAC5D,GAAI;AACL,CAAA;AAGH,MAAM,sBAAsB,EAC1B,WACA,GAAG,YAEH,iB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,OAAD;IAAK,WAAU;IAAsC;GAAc,CAAA,CAChE;;CACyB,CAAA;AAEpC"}
1
+ {"version":3,"file":"callout.cjs","names":["Cancel","CheckCircle","Warning","Info","React","Button"],"sources":["../../src/components/callout.tsx"],"sourcesContent":["import {\n Cancel,\n CheckCircle,\n Info,\n Warning,\n type SparkIcon,\n} from '@epilot/spark-icons'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\nimport { cn } from '../utils/cn'\nimport { Button, type ButtonProps } from './button'\n\ntype CalloutVariant = 'error' | 'info' | 'neutral' | 'success' | 'warning'\n\nconst calloutVariants = cva(\n 'group/callout flex w-full items-start gap-2 rounded-lg px-4 py-3 text-sm transition-colors duration-150 ease-out motion-reduce:transition-none',\n {\n variants: {\n variant: {\n error: 'bg-error-soft text-error-soft-foreground',\n success: 'bg-success-soft text-success-soft-foreground',\n warning: 'bg-warning-soft text-warning-soft-foreground',\n info: 'bg-base-info-soft text-info',\n neutral: 'bg-base-gray-soft text-gray',\n },\n },\n defaultVariants: {\n variant: 'info',\n },\n },\n)\n\nconst CALLOUT_ICONS: Record<\n CalloutVariant,\n { icon: SparkIcon; className: string }\n> = {\n error: { icon: Cancel, className: 'text-error-soft-foreground' },\n success: { icon: CheckCircle, className: 'text-success-soft-foreground' },\n warning: { icon: Warning, className: 'text-warning-soft-foreground' },\n info: { icon: Info, className: 'text-info-light' },\n neutral: { icon: Info, className: 'text-gray-light' },\n}\n\ninterface CalloutProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof calloutVariants> {\n /** Overrides the variant's default icon; the variant's color is kept. `false` renders no icon. */\n icon?: SparkIcon | false\n}\n\nconst CalloutTitle = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span\n data-slot=\"callout-title\"\n className={cn('text-base leading-5 font-semibold', className)}\n {...props}\n />\n)\n\nconst CalloutDescription = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLParagraphElement>) => (\n <p\n data-slot=\"callout-description\"\n className={cn('text-sm', className)}\n {...props}\n />\n)\n\nconst CalloutVariantContext = React.createContext<CalloutVariant>('info')\n\nconst CALLOUT_ACTION_COLORS: Record<CalloutVariant, string> = {\n error:\n 'bg-error-soft text-error-soft-foreground hover:bg-error-soft-hover focus-visible:bg-error-soft-hover',\n success:\n 'bg-success-soft text-success-soft-foreground hover:bg-success-soft-hover focus-visible:bg-success-soft-hover',\n warning:\n 'bg-warning-soft text-warning-soft-foreground hover:bg-warning-soft-hover focus-visible:bg-warning-soft-hover',\n info: 'bg-base-info-soft text-info hover:bg-blue-a4 focus-visible:bg-blue-a4',\n neutral:\n 'bg-base-gray-soft text-gray hover:bg-gray-a4 focus-visible:bg-gray-a4',\n}\n\nconst CalloutActions = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n data-slot=\"callout-actions\"\n className={cn(\n 'mt-2 flex flex-wrap items-center gap-2 [&_[data-slot=callout-action]]:mt-0',\n className,\n )}\n {...props}\n />\n)\n\ntype CalloutActionType = Omit<ButtonProps, 'styleVariant' | 'color'> & {\n align?: 'start' | 'end'\n primary?: boolean\n}\n\nconst CalloutAction = ({\n className,\n align = 'start',\n primary = false,\n ...props\n}: CalloutActionType) => {\n const calloutVariant = React.useContext(CalloutVariantContext)\n\n return (\n <Button\n data-slot=\"callout-action\"\n size=\"small\"\n styleVariant={primary ? 'solid' : 'surface'}\n color={primary ? 'primary' : 'neutral'}\n className={cn(\n 'mt-2 w-fit',\n { 'self-start': align === 'start', 'self-end': align === 'end' },\n !primary && CALLOUT_ACTION_COLORS[calloutVariant],\n className,\n )}\n {...props}\n />\n )\n}\n\nconst Callout = ({\n variant = 'info',\n icon,\n className,\n children,\n ...props\n}: CalloutProps) => {\n const variantIcon = CALLOUT_ICONS[variant ?? 'info']\n const Glyph = icon === false ? null : (icon ?? variantIcon.icon)\n\n return (\n <CalloutVariantContext.Provider value={variant ?? 'info'}>\n <div\n data-slot=\"callout\"\n className={cn(calloutVariants({ variant }), className)}\n {...props}\n >\n {Glyph ? (\n <Glyph\n className={cn(\n '[--spark-icon-size:calc(20px*var(--spark-scaling,1))]',\n variantIcon.className,\n )}\n />\n ) : null}\n <div className=\"flex w-full min-w-0 flex-col gap-1\">{children}</div>\n </div>\n </CalloutVariantContext.Provider>\n )\n}\n\nexport {\n Callout,\n CalloutAction,\n CalloutActions,\n CalloutDescription,\n CalloutTitle,\n calloutVariants,\n}\nexport type { CalloutProps, CalloutVariant }\n"],"mappings":";;;;;;;;;;;AAcA,MAAM,mBAAA,GAAA,yBAAA,KACJ,kJACA;CACE,UAAU,EACR,SAAS;EACP,OAAO;EACP,SAAS;EACT,SAAS;EACT,MAAM;EACN,SAAS;CACX,EACF;CACA,iBAAiB,EACf,SAAS,OACX;AACF,CACF;AAEA,MAAM,gBAGF;CACF,OAAO;EAAE,MAAMA,oBAAAA;EAAQ,WAAW;CAA6B;CAC/D,SAAS;EAAE,MAAMC,oBAAAA;EAAa,WAAW;CAA+B;CACxE,SAAS;EAAE,MAAMC,oBAAAA;EAAS,WAAW;CAA+B;CACpE,MAAM;EAAE,MAAMC,oBAAAA;EAAM,WAAW;CAAkB;CACjD,SAAS;EAAE,MAAMA,oBAAAA;EAAM,WAAW;CAAkB;AACtD;AAUA,MAAM,gBAAgB,EACpB,WACA,GAAG,YAEH,iBAAA,GAAA,kBAAA,KAAC,QAAD;CACE,aAAU;CACV,YAAA,GAAA,OAAA,IAAc,qCAAqC,SAAS;CAC5D,GAAI;AACL,CAAA;AAGH,MAAM,sBAAsB,EAC1B,WACA,GAAG,YAEH,iBAAA,GAAA,kBAAA,KAAC,KAAD;CACE,aAAU;CACV,YAAA,GAAA,OAAA,IAAc,WAAW,SAAS;CAClC,GAAI;AACL,CAAA;AAGH,MAAM,wBAAwBC,MAAM,cAA8B,MAAM;AAExE,MAAM,wBAAwD;CAC5D,OACE;CACF,SACE;CACF,SACE;CACF,MAAM;CACN,SACE;AACJ;AAEA,MAAM,kBAAkB,EACtB,WACA,GAAG,YAEH,iBAAA,GAAA,kBAAA,KAAC,OAAD;CACE,aAAU;CACV,YAAA,GAAA,OAAA,IACE,8EACA,SACF;CACA,GAAI;AACL,CAAA;AAQH,MAAM,iBAAiB,EACrB,WACA,QAAQ,SACR,UAAU,OACV,GAAG,YACoB;CACvB,MAAM,iBAAiBA,MAAM,WAAW,qBAAqB;CAE7D,OACE,iBAAA,GAAA,kBAAA,KAACC,0BAAAA,QAAD;EACE,aAAU;EACV,MAAK;EACL,cAAc,UAAU,UAAU;EAClC,OAAO,UAAU,YAAY;EAC7B,YAAA,GAAA,OAAA,IACE,cACA;GAAE,cAAc,UAAU;GAAS,YAAY,UAAU;EAAM,GAC/D,CAAC,WAAW,sBAAsB,iBAClC,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,WAAW,EACf,UAAU,QACV,MACA,WACA,UACA,GAAG,YACe;CAClB,MAAM,cAAc,cAAc,WAAW;CAC7C,MAAM,QAAQ,SAAS,QAAQ,OAAQ,QAAQ,YAAY;CAE3D,OACE,iBAAA,GAAA,kBAAA,KAAC,sBAAsB,UAAvB;EAAgC,OAAO,WAAW;YAChD,iBAAA,GAAA,kBAAA,MAAC,OAAD;GACE,aAAU;GACV,YAAA,GAAA,OAAA,IAAc,gBAAgB,EAAE,QAAQ,CAAC,GAAG,SAAS;GACrD,GAAI;aAHN,CAKG,QACC,iBAAA,GAAA,kBAAA,KAAC,OAAD,EACE,YAAA,GAAA,OAAA,IACE,yDACA,YAAY,SACd,EACD,CAAA,IACC,MACJ,iBAAA,GAAA,kBAAA,KAAC,OAAD;IAAK,WAAU;IAAsC;GAAc,CAAA,CAChE;;CACyB,CAAA;AAEpC"}
@@ -8,7 +8,7 @@ import { SparkIcon } from "@epilot/spark-icons";
8
8
  //#region src/components/callout.d.ts
9
9
  type CalloutVariant = 'error' | 'info' | 'neutral' | 'success' | 'warning';
10
10
  declare const calloutVariants: (props?: ({
11
- variant?: "neutral" | "success" | "warning" | "error" | "info" | null | undefined;
11
+ variant?: "error" | "success" | "warning" | "info" | "neutral" | null | undefined;
12
12
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
13
13
  interface CalloutProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof calloutVariants> {
14
14
  /** Overrides the variant's default icon; the variant's color is kept. `false` renders no icon. */
@@ -8,7 +8,7 @@ import { VariantProps } from "class-variance-authority";
8
8
  //#region src/components/callout.d.ts
9
9
  type CalloutVariant = 'error' | 'info' | 'neutral' | 'success' | 'warning';
10
10
  declare const calloutVariants: (props?: ({
11
- variant?: "neutral" | "success" | "warning" | "error" | "info" | null | undefined;
11
+ variant?: "error" | "success" | "warning" | "info" | "neutral" | null | undefined;
12
12
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
13
13
  interface CalloutProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof calloutVariants> {
14
14
  /** Overrides the variant's default icon; the variant's color is kept. `false` renders no icon. */
@@ -7,16 +7,16 @@ react = require_chunk.__toESM(react);
7
7
  let react_jsx_runtime = require("react/jsx-runtime");
8
8
  let class_variance_authority = require("class-variance-authority");
9
9
  let _base_ui_react_use_render = require("@base-ui/react/use-render");
10
- let cn = require("cn");
10
+ let cnfast = require("cnfast");
11
11
  //#region src/components/card.tsx
12
12
  const cardVariants = (0, class_variance_authority.cva)("relative flex w-full flex-col gap-1 py-3", {
13
13
  variants: { variant: {
14
- ambient: (0, cn.cn)(require_lib_container_chrome.containerChrome.ambient, require_lib_container_chrome.containerPaddingX.ambient),
15
- soft: (0, cn.cn)(require_lib_container_chrome.containerChrome.soft, require_lib_container_chrome.containerPaddingX.soft),
16
- surface: (0, cn.cn)(require_lib_container_chrome.containerChrome.surface, require_lib_container_chrome.containerPaddingX.surface),
17
- outline: (0, cn.cn)(require_lib_container_chrome.containerChrome.outline, require_lib_container_chrome.containerPaddingX.outline),
18
- ghost: (0, cn.cn)(require_lib_container_chrome.containerChrome.ghost, require_lib_container_chrome.containerPaddingX.ghost),
19
- solid: (0, cn.cn)(require_lib_container_chrome.containerChrome.solid, require_lib_container_chrome.containerPaddingX.solid)
14
+ ambient: (0, cnfast.cn)(require_lib_container_chrome.containerChrome.ambient, require_lib_container_chrome.containerPaddingX.ambient),
15
+ soft: (0, cnfast.cn)(require_lib_container_chrome.containerChrome.soft, require_lib_container_chrome.containerPaddingX.soft),
16
+ surface: (0, cnfast.cn)(require_lib_container_chrome.containerChrome.surface, require_lib_container_chrome.containerPaddingX.surface),
17
+ outline: (0, cnfast.cn)(require_lib_container_chrome.containerChrome.outline, require_lib_container_chrome.containerPaddingX.outline),
18
+ ghost: (0, cnfast.cn)(require_lib_container_chrome.containerChrome.ghost, require_lib_container_chrome.containerPaddingX.ghost),
19
+ solid: (0, cnfast.cn)(require_lib_container_chrome.containerChrome.solid, require_lib_container_chrome.containerPaddingX.solid)
20
20
  } },
21
21
  defaultVariants: { variant: "ambient" }
22
22
  });
@@ -29,9 +29,9 @@ const Card = react.forwardRef(({ className, variant, color, radius = "lg", eleva
29
29
  props: {
30
30
  "data-slot": "card",
31
31
  "data-variant": variant,
32
- "data-card-color": color,
32
+ "data-card-color": color === "accent" ? "accent" : void 0,
33
33
  "data-elevated": elevated ? "" : void 0,
34
- className: (0, cn.cn)(cardVariants({ variant }), require_lib_container_chrome.radiusClasses[radius], elevated && "bg-(--spark-elevated) [background-image:linear-gradient(var(--spark-card-bg,transparent),var(--spark-card-bg,transparent))] shadow-(--spark-card-shadow,var(--spark-shadow-1))", interactive && require_lib_container_chrome.containerInteractiveClasses(resolved, elevated), className),
34
+ className: (0, cnfast.cn)(cardVariants({ variant }), require_lib_container_chrome.radiusClasses[radius], elevated && "bg-(--spark-elevated) [background-image:linear-gradient(var(--spark-card-bg,transparent),var(--spark-card-bg,transparent))] shadow-(--spark-card-shadow,var(--spark-shadow-1))", interactive && require_lib_container_chrome.containerInteractiveClasses(resolved, elevated), className),
35
35
  ref,
36
36
  ...props
37
37
  }
@@ -39,43 +39,43 @@ const Card = react.forwardRef(({ className, variant, color, radius = "lg", eleva
39
39
  });
40
40
  Card.displayName = "Card";
41
41
  const CardHeader = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
42
- className: (0, cn.cn)("flex items-center gap-4", className),
42
+ className: (0, cnfast.cn)("flex items-center gap-4", className),
43
43
  ref,
44
44
  ...props
45
45
  }));
46
46
  CardHeader.displayName = "CardHeader";
47
47
  const CardIcon = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
48
- className: (0, cn.cn)("flex shrink-0 items-center justify-center text-(--spark-card-icon,var(--spark-a11))", className),
48
+ className: (0, cnfast.cn)("flex shrink-0 items-center justify-center text-(--spark-card-icon,var(--spark-a11))", className),
49
49
  ref,
50
50
  ...props
51
51
  }));
52
52
  CardIcon.displayName = "CardIcon";
53
53
  const CardTitle = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
54
- className: (0, cn.cn)("text-base leading-5 font-medium text-(--spark-card-fg,var(--neutral-a12))", className),
54
+ className: (0, cnfast.cn)("text-base leading-5 font-medium text-(--spark-card-fg,var(--neutral-a12))", className),
55
55
  ref,
56
56
  ...props
57
57
  }));
58
58
  CardTitle.displayName = "CardTitle";
59
59
  const CardDescription = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
60
- className: (0, cn.cn)("text-sm leading-5 text-(--spark-card-fg-muted,var(--neutral-a11))", className),
60
+ className: (0, cnfast.cn)("text-sm leading-5 text-(--spark-card-fg-muted,var(--neutral-a11))", className),
61
61
  ref,
62
62
  ...props
63
63
  }));
64
64
  CardDescription.displayName = "CardDescription";
65
65
  const CardContent = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
66
- className: (0, cn.cn)("", className),
66
+ className: (0, cnfast.cn)("", className),
67
67
  ref,
68
68
  ...props
69
69
  }));
70
70
  CardContent.displayName = "CardContent";
71
71
  const CardFooter = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
72
- className: (0, cn.cn)("flex items-center justify-end gap-2 pt-2 text-(--spark-card-fg,var(--neutral-a12))", className),
72
+ className: (0, cnfast.cn)("flex items-center justify-end gap-2 pt-2 text-(--spark-card-fg,var(--neutral-a12))", className),
73
73
  ref,
74
74
  ...props
75
75
  }));
76
76
  CardFooter.displayName = "CardFooter";
77
77
  const CardSkeleton = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
78
- className: (0, cn.cn)("relative flex w-full items-center gap-4 rounded-lg bg-spark-a3 p-4 opacity-80", className),
78
+ className: (0, cnfast.cn)("relative flex w-full items-center gap-4 rounded-lg bg-spark-a3 p-4 opacity-80", className),
79
79
  ref,
80
80
  ...props,
81
81
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "size-10 shrink-0 animate-pulse rounded-full bg-base-gray-soft motion-reduce:animate-none" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
@@ -1 +1 @@
1
- {"version":3,"file":"card.cjs","names":["containerChrome","containerPaddingX","React","radiusClasses","containerInteractiveClasses"],"sources":["../../src/components/card.tsx"],"sourcesContent":["import { useRender } from '@base-ui/react/use-render'\nimport { cva } from 'class-variance-authority'\nimport * as React from 'react'\nimport {\n containerChrome,\n containerElevated,\n containerInteractiveClasses,\n containerPaddingX,\n radiusClasses,\n type ContainerRadius,\n} from '../lib/container-chrome'\nimport type { SparkCardColor, SparkCardVariant } from '../lib/theme-types'\nimport { cn } from '../utils/cn'\n\ntype CardRadius = ContainerRadius\n\nconst cardVariants = cva('relative flex w-full flex-col gap-1 py-3', {\n variants: {\n variant: {\n ambient: cn(containerChrome.ambient, containerPaddingX.ambient),\n soft: cn(containerChrome.soft, containerPaddingX.soft),\n surface: cn(containerChrome.surface, containerPaddingX.surface),\n outline: cn(containerChrome.outline, containerPaddingX.outline),\n ghost: cn(containerChrome.ghost, containerPaddingX.ghost),\n solid: cn(containerChrome.solid, containerPaddingX.solid),\n },\n },\n defaultVariants: {\n variant: 'ambient',\n },\n})\n\ninterface CardProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Container chrome scoped to this card — NOT the ambient `data-style` knob\n * (that drives controls and would cascade into the card's content). Unset →\n * follows the app-level `[data-card-variant]` knob (default soft-neutral).\n */\n variant?: SparkCardVariant\n /** Chrome palette. `neutral` (default) tracks the app neutral; `accent` tints with the brand accent. */\n color?: SparkCardColor\n /** Corner radius, as a named step. Unset → `lg`, today's fixed behaviour. */\n radius?: CardRadius\n /**\n * Lift the card off an arbitrary backdrop (a photo, not the flat app canvas):\n * an opaque `--spark-elevated` fill plus a shadow, so no `variant`/`color`\n * combination — including a translucent one like `soft` — can bleed it through.\n */\n elevated?: boolean\n /**\n * Base UI polymorphism. Pass `<a href/>` or `<button/>` to make the whole\n * card interactive (hover tint, focus ring, disabled styles). Omit → static.\n */\n render?: useRender.RenderProp\n}\n\nconst Card = React.forwardRef<HTMLDivElement, CardProps>(\n (\n { className, variant, color, radius = 'lg', elevated, render, ...props },\n ref,\n ) => {\n const interactive = render != null\n const resolved = variant ?? 'ambient'\n return useRender({\n defaultTagName: 'div',\n render,\n props: {\n 'data-slot': 'card',\n 'data-variant': variant,\n 'data-card-color': color,\n 'data-elevated': elevated ? '' : undefined,\n className: cn(\n cardVariants({ variant }),\n radiusClasses[radius],\n elevated && containerElevated,\n interactive && containerInteractiveClasses(resolved, elevated),\n className,\n ),\n ref,\n ...props,\n },\n })\n },\n)\n\nCard.displayName = 'Card'\n\nconst CardHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n className={cn('flex items-center gap-4', className)}\n ref={ref}\n {...props}\n />\n))\n\nCardHeader.displayName = 'CardHeader'\n\nconst CardIcon = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n className={cn(\n 'flex shrink-0 items-center justify-center text-(--spark-card-icon,var(--spark-a11))',\n className,\n )}\n ref={ref}\n {...props}\n />\n))\n\nCardIcon.displayName = 'CardIcon'\n\nconst CardTitle = React.forwardRef<\n HTMLHeadingElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h3\n className={cn(\n 'text-base leading-5 font-medium text-(--spark-card-fg,var(--neutral-a12))',\n className,\n )}\n ref={ref}\n {...props}\n />\n))\n\nCardTitle.displayName = 'CardTitle'\n\nconst CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p\n className={cn(\n 'text-sm leading-5 text-(--spark-card-fg-muted,var(--neutral-a11))',\n className,\n )}\n ref={ref}\n {...props}\n />\n))\n\nCardDescription.displayName = 'CardDescription'\n\nconst CardContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div className={cn('', className)} ref={ref} {...props} />\n))\n\nCardContent.displayName = 'CardContent'\n\nconst CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n className={cn(\n 'flex items-center justify-end gap-2 pt-2 text-(--spark-card-fg,var(--neutral-a12))',\n className,\n )}\n ref={ref}\n {...props}\n />\n))\n\nCardFooter.displayName = 'CardFooter'\n\nconst CardSkeleton = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n className={cn(\n 'relative flex w-full items-center gap-4 rounded-lg bg-spark-a3 p-4 opacity-80',\n className,\n )}\n ref={ref}\n {...props}\n >\n <div className=\"size-10 shrink-0 animate-pulse rounded-full bg-base-gray-soft motion-reduce:animate-none\" />\n <div className=\"flex flex-1 flex-col gap-y-2\">\n <div className=\"h-5 w-1/3 max-w-32 animate-pulse rounded-md bg-base-gray-soft motion-reduce:animate-none\" />\n <div className=\"h-4 w-1/2 max-w-48 animate-pulse rounded-md bg-base-gray-soft motion-reduce:animate-none\" />\n </div>\n </div>\n))\n\nCardSkeleton.displayName = 'CardSkeleton'\n\nexport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardIcon,\n CardSkeleton,\n CardTitle,\n}\nexport type { CardProps, CardRadius }\n"],"mappings":";;;;;;;;;;;AAgBA,MAAM,gBAAA,GAAA,yBAAA,KAAmB,4CAA4C;CACnE,UAAU,EACR,SAAS;EACP,UAAA,GAAA,GAAA,IAAYA,6BAAAA,gBAAgB,SAASC,6BAAAA,kBAAkB,OAAO;EAC9D,OAAA,GAAA,GAAA,IAASD,6BAAAA,gBAAgB,MAAMC,6BAAAA,kBAAkB,IAAI;EACrD,UAAA,GAAA,GAAA,IAAYD,6BAAAA,gBAAgB,SAASC,6BAAAA,kBAAkB,OAAO;EAC9D,UAAA,GAAA,GAAA,IAAYD,6BAAAA,gBAAgB,SAASC,6BAAAA,kBAAkB,OAAO;EAC9D,QAAA,GAAA,GAAA,IAAUD,6BAAAA,gBAAgB,OAAOC,6BAAAA,kBAAkB,KAAK;EACxD,QAAA,GAAA,GAAA,IAAUD,6BAAAA,gBAAgB,OAAOC,6BAAAA,kBAAkB,KAAK;CAC1D,EACF;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CAAC;AA0BD,MAAM,OAAOC,MAAM,YAEf,EAAE,WAAW,SAAS,OAAO,SAAS,MAAM,UAAU,QAAQ,GAAG,SACjE,QACG;CACH,MAAM,cAAc,UAAU;CAC9B,MAAM,WAAW,WAAW;CAC5B,QAAA,GAAA,0BAAA,WAAiB;EACf,gBAAgB;EAChB;EACA,OAAO;GACL,aAAa;GACb,gBAAgB;GAChB,mBAAmB;GACnB,iBAAiB,WAAW,KAAK,KAAA;GACjC,YAAA,GAAA,G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,GAAA,GAAA,IACE,sFACA,SACF;CACK;CACL,GAAI;AACL,CAAA,CACF;AAED,WAAW,cAAc;AAEzB,MAAM,eAAeA,MAAM,YAGxB,EAAE,WAAW,GAAG,SAAS,QAC1B,iBAAA,GAAA,kBAAA,MAAC,OAAD;CACE,YAAA,GAAA,GAAA,IACE,iFACA,SACF;CACK;CACL,GAAI;WANN,CAQE,iBAAA,GAAA,kBAAA,KAAC,OAAD,EAAK,WAAU,2FAA4F,CAAA,GAC3G,iBAAA,GAAA,kBAAA,MAAC,OAAD;EAAK,WAAU;YAAf,CACE,iBAAA,GAAA,kBAAA,KAAC,OAAD,EAAK,WAAU,2FAA4F,CAAA,GAC3G,iBAAA,GAAA,kBAAA,KAAC,OAAD,EAAK,WAAU,2FAA4F,CAAA,CACxG;GACF;EACN;AAED,aAAa,cAAc"}
1
+ {"version":3,"file":"card.cjs","names":["containerChrome","containerPaddingX","React","radiusClasses","containerInteractiveClasses"],"sources":["../../src/components/card.tsx"],"sourcesContent":["import { useRender } from '@base-ui/react/use-render'\nimport { cva } from 'class-variance-authority'\nimport * as React from 'react'\nimport {\n containerChrome,\n containerElevated,\n containerInteractiveClasses,\n containerPaddingX,\n radiusClasses,\n type ContainerRadius,\n} from '../lib/container-chrome'\nimport type { SparkCardColor, SparkCardVariant } from '../lib/theme-types'\nimport { cn } from '../utils/cn'\n\ntype CardRadius = ContainerRadius\n\nconst cardVariants = cva('relative flex w-full flex-col gap-1 py-3', {\n variants: {\n variant: {\n ambient: cn(containerChrome.ambient, containerPaddingX.ambient),\n soft: cn(containerChrome.soft, containerPaddingX.soft),\n surface: cn(containerChrome.surface, containerPaddingX.surface),\n outline: cn(containerChrome.outline, containerPaddingX.outline),\n ghost: cn(containerChrome.ghost, containerPaddingX.ghost),\n solid: cn(containerChrome.solid, containerPaddingX.solid),\n },\n },\n defaultVariants: {\n variant: 'ambient',\n },\n})\n\ninterface CardProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Container chrome scoped to this card — NOT the ambient `data-style` knob\n * (that drives controls and would cascade into the card's content). Unset →\n * follows the app-level `[data-card-variant]` knob (default soft-neutral).\n */\n variant?: SparkCardVariant\n /** Chrome palette. `neutral` (default) tracks the app neutral; `accent` tints with the brand accent. */\n color?: SparkCardColor\n /** Corner radius, as a named step. Unset → `lg`, today's fixed behaviour. */\n radius?: CardRadius\n /**\n * Lift the card off an arbitrary backdrop (a photo, not the flat app canvas):\n * an opaque `--spark-elevated` fill plus a shadow, so no `variant`/`color`\n * combination — including a translucent one like `soft` — can bleed it through.\n */\n elevated?: boolean\n /**\n * Base UI polymorphism. Pass `<a href/>` or `<button/>` to make the whole\n * card interactive (hover tint, focus ring, disabled styles). Omit → static.\n */\n render?: useRender.RenderProp\n}\n\nconst Card = React.forwardRef<HTMLDivElement, CardProps>(\n (\n { className, variant, color, radius = 'lg', elevated, render, ...props },\n ref,\n ) => {\n const interactive = render != null\n const resolved = variant ?? 'ambient'\n return useRender({\n defaultTagName: 'div',\n render,\n props: {\n 'data-slot': 'card',\n 'data-variant': variant,\n 'data-card-color': color === 'accent' ? 'accent' : undefined,\n 'data-elevated': elevated ? '' : undefined,\n className: cn(\n cardVariants({ variant }),\n radiusClasses[radius],\n elevated && containerElevated,\n interactive && containerInteractiveClasses(resolved, elevated),\n className,\n ),\n ref,\n ...props,\n },\n })\n },\n)\n\nCard.displayName = 'Card'\n\nconst CardHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n className={cn('flex items-center gap-4', className)}\n ref={ref}\n {...props}\n />\n))\n\nCardHeader.displayName = 'CardHeader'\n\nconst CardIcon = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n className={cn(\n 'flex shrink-0 items-center justify-center text-(--spark-card-icon,var(--spark-a11))',\n className,\n )}\n ref={ref}\n {...props}\n />\n))\n\nCardIcon.displayName = 'CardIcon'\n\nconst CardTitle = React.forwardRef<\n HTMLHeadingElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h3\n className={cn(\n 'text-base leading-5 font-medium text-(--spark-card-fg,var(--neutral-a12))',\n className,\n )}\n ref={ref}\n {...props}\n />\n))\n\nCardTitle.displayName = 'CardTitle'\n\nconst CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p\n className={cn(\n 'text-sm leading-5 text-(--spark-card-fg-muted,var(--neutral-a11))',\n className,\n )}\n ref={ref}\n {...props}\n />\n))\n\nCardDescription.displayName = 'CardDescription'\n\nconst CardContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div className={cn('', className)} ref={ref} {...props} />\n))\n\nCardContent.displayName = 'CardContent'\n\nconst CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n className={cn(\n 'flex items-center justify-end gap-2 pt-2 text-(--spark-card-fg,var(--neutral-a12))',\n className,\n )}\n ref={ref}\n {...props}\n />\n))\n\nCardFooter.displayName = 'CardFooter'\n\nconst CardSkeleton = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n className={cn(\n 'relative flex w-full items-center gap-4 rounded-lg bg-spark-a3 p-4 opacity-80',\n className,\n )}\n ref={ref}\n {...props}\n >\n <div className=\"size-10 shrink-0 animate-pulse rounded-full bg-base-gray-soft motion-reduce:animate-none\" />\n <div className=\"flex flex-1 flex-col gap-y-2\">\n <div className=\"h-5 w-1/3 max-w-32 animate-pulse rounded-md bg-base-gray-soft motion-reduce:animate-none\" />\n <div className=\"h-4 w-1/2 max-w-48 animate-pulse rounded-md bg-base-gray-soft motion-reduce:animate-none\" />\n </div>\n </div>\n))\n\nCardSkeleton.displayName = 'CardSkeleton'\n\nexport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardIcon,\n CardSkeleton,\n CardTitle,\n}\nexport type { CardProps, CardRadius }\n"],"mappings":";;;;;;;;;;;AAgBA,MAAM,gBAAA,GAAA,yBAAA,KAAmB,4CAA4C;CACnE,UAAU,EACR,SAAS;EACP,UAAA,GAAA,OAAA,IAAYA,6BAAAA,gBAAgB,SAASC,6BAAAA,kBAAkB,OAAO;EAC9D,OAAA,GAAA,OAAA,IAASD,6BAAAA,gBAAgB,MAAMC,6BAAAA,kBAAkB,IAAI;EACrD,UAAA,GAAA,OAAA,IAAYD,6BAAAA,gBAAgB,SAASC,6BAAAA,kBAAkB,OAAO;EAC9D,UAAA,GAAA,OAAA,IAAYD,6BAAAA,gBAAgB,SAASC,6BAAAA,kBAAkB,OAAO;EAC9D,QAAA,GAAA,OAAA,IAAUD,6BAAAA,gBAAgB,OAAOC,6BAAAA,kBAAkB,KAAK;EACxD,QAAA,GAAA,OAAA,IAAUD,6BAAAA,gBAAgB,OAAOC,6BAAAA,kBAAkB,KAAK;CAC1D,EACF;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CAAC;AA0BD,MAAM,OAAOC,MAAM,YAEf,EAAE,WAAW,SAAS,OAAO,SAAS,MAAM,UAAU,QAAQ,GAAG,SACjE,QACG;CACH,MAAM,cAAc,UAAU;CAC9B,MAAM,WAAW,WAAW;CAC5B,QAAA,GAAA,0BAAA,WAAiB;EACf,gBAAgB;EAChB;EACA,OAAO;GACL,aAAa;GACb,gBAAgB;GAChB,mBAAmB,UAAU,WAAW,WAAW,KAAA;GACnD,iBAAiB,WAAW,KAAK,KAAA;GACjC,YAAA,GAAA,OAAA,IACE,aAAa,EAAE,QAAQ,CAAC,GACxBC,6BAAAA,cAAc,SACd,YAAA,kLACA,eAAeC,6BAAAA,4BAA4B,UAAU,QAAQ,GAC7D,SACF;GACA;GACA,GAAG;EACL;CACF,CAAC;AACH,CACF;AAEA,KAAK,c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E,YAAA,GAAA,OAAA,IACE,iFACA,SACF;CACK;CACL,GAAI;WANN,CAQE,iBAAA,GAAA,kBAAA,KAAC,OAAD,EAAK,WAAU,2FAA4F,CAAA,GAC3G,iBAAA,GAAA,kBAAA,MAAC,OAAD;EAAK,WAAU;YAAf,CACE,iBAAA,GAAA,kBAAA,KAAC,OAAD,EAAK,WAAU,2FAA4F,CAAA,GAC3G,iBAAA,GAAA,kBAAA,KAAC,OAAD,EAAK,WAAU,2FAA4F,CAAA,CACxG;GACF;EACN;AAED,aAAa,cAAc"}
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { containerChrome, containerInteractiveClasses, containerPaddingX, radiusClasses } from "../lib/container-chrome.js";
3
2
  import { cn } from "../utils/cn.js";
3
+ import { containerChrome, containerInteractiveClasses, containerPaddingX, radiusClasses } from "../lib/container-chrome.js";
4
4
  import * as React$1 from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { cva } from "class-variance-authority";
@@ -26,7 +26,7 @@ const Card = React$1.forwardRef(({ className, variant, color, radius = "lg", ele
26
26
  props: {
27
27
  "data-slot": "card",
28
28
  "data-variant": variant,
29
- "data-card-color": color,
29
+ "data-card-color": color === "accent" ? "accent" : void 0,
30
30
  "data-elevated": elevated ? "" : void 0,
31
31
  className: cn(cardVariants({ variant }), radiusClasses[radius], elevated && "bg-(--spark-elevated) [background-image:linear-gradient(var(--spark-card-bg,transparent),var(--spark-card-bg,transparent))] shadow-(--spark-card-shadow,var(--spark-shadow-1))", interactive && containerInteractiveClasses(resolved, elevated), className),
32
32
  ref,
@@ -1 +1 @@
1
- {"version":3,"file":"card.js","names":["React"],"sources":["../../src/components/card.tsx"],"sourcesContent":["import { useRender } from '@base-ui/react/use-render'\nimport { cva } from 'class-variance-authority'\nimport * as React from 'react'\nimport {\n containerChrome,\n containerElevated,\n containerInteractiveClasses,\n containerPaddingX,\n radiusClasses,\n type ContainerRadius,\n} from '../lib/container-chrome'\nimport type { SparkCardColor, SparkCardVariant } from '../lib/theme-types'\nimport { cn } from '../utils/cn'\n\ntype CardRadius = ContainerRadius\n\nconst cardVariants = cva('relative flex w-full flex-col gap-1 py-3', {\n variants: {\n variant: {\n ambient: cn(containerChrome.ambient, containerPaddingX.ambient),\n soft: cn(containerChrome.soft, containerPaddingX.soft),\n surface: cn(containerChrome.surface, containerPaddingX.surface),\n outline: cn(containerChrome.outline, containerPaddingX.outline),\n ghost: cn(containerChrome.ghost, containerPaddingX.ghost),\n solid: cn(containerChrome.solid, containerPaddingX.solid),\n },\n },\n defaultVariants: {\n variant: 'ambient',\n },\n})\n\ninterface CardProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Container chrome scoped to this card — NOT the ambient `data-style` knob\n * (that drives controls and would cascade into the card's content). Unset →\n * follows the app-level `[data-card-variant]` knob (default soft-neutral).\n */\n variant?: SparkCardVariant\n /** Chrome palette. `neutral` (default) tracks the app neutral; `accent` tints with the brand accent. */\n color?: SparkCardColor\n /** Corner radius, as a named step. Unset → `lg`, today's fixed behaviour. */\n radius?: CardRadius\n /**\n * Lift the card off an arbitrary backdrop (a photo, not the flat app canvas):\n * an opaque `--spark-elevated` fill plus a shadow, so no `variant`/`color`\n * combination — including a translucent one like `soft` — can bleed it through.\n */\n elevated?: boolean\n /**\n * Base UI polymorphism. Pass `<a href/>` or `<button/>` to make the whole\n * card interactive (hover tint, focus ring, disabled styles). Omit → static.\n */\n render?: useRender.RenderProp\n}\n\nconst Card = React.forwardRef<HTMLDivElement, CardProps>(\n (\n { className, variant, color, radius = 'lg', elevated, render, ...props },\n ref,\n ) => {\n const interactive = render != null\n const resolved = variant ?? 'ambient'\n return useRender({\n defaultTagName: 'div',\n render,\n props: {\n 'data-slot': 'card',\n 'data-variant': variant,\n 'data-card-color': color,\n 'data-elevated': elevated ? '' : undefined,\n className: cn(\n cardVariants({ variant }),\n radiusClasses[radius],\n elevated && containerElevated,\n interactive && containerInteractiveClasses(resolved, elevated),\n className,\n ),\n ref,\n ...props,\n },\n })\n },\n)\n\nCard.displayName = 'Card'\n\nconst CardHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n className={cn('flex items-center gap-4', className)}\n ref={ref}\n {...props}\n />\n))\n\nCardHeader.displayName = 'CardHeader'\n\nconst CardIcon = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n className={cn(\n 'flex shrink-0 items-center justify-center text-(--spark-card-icon,var(--spark-a11))',\n className,\n )}\n ref={ref}\n {...props}\n />\n))\n\nCardIcon.displayName = 'CardIcon'\n\nconst CardTitle = React.forwardRef<\n HTMLHeadingElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h3\n className={cn(\n 'text-base leading-5 font-medium text-(--spark-card-fg,var(--neutral-a12))',\n className,\n )}\n ref={ref}\n {...props}\n />\n))\n\nCardTitle.displayName = 'CardTitle'\n\nconst CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p\n className={cn(\n 'text-sm leading-5 text-(--spark-card-fg-muted,var(--neutral-a11))',\n className,\n )}\n ref={ref}\n {...props}\n />\n))\n\nCardDescription.displayName = 'CardDescription'\n\nconst CardContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div className={cn('', className)} ref={ref} {...props} />\n))\n\nCardContent.displayName = 'CardContent'\n\nconst CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n className={cn(\n 'flex items-center justify-end gap-2 pt-2 text-(--spark-card-fg,var(--neutral-a12))',\n className,\n )}\n ref={ref}\n {...props}\n />\n))\n\nCardFooter.displayName = 'CardFooter'\n\nconst CardSkeleton = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n className={cn(\n 'relative flex w-full items-center gap-4 rounded-lg bg-spark-a3 p-4 opacity-80',\n className,\n )}\n ref={ref}\n {...props}\n >\n <div className=\"size-10 shrink-0 animate-pulse rounded-full bg-base-gray-soft motion-reduce:animate-none\" />\n <div className=\"flex flex-1 flex-col gap-y-2\">\n <div className=\"h-5 w-1/3 max-w-32 animate-pulse rounded-md bg-base-gray-soft motion-reduce:animate-none\" />\n <div className=\"h-4 w-1/2 max-w-48 animate-pulse rounded-md bg-base-gray-soft motion-reduce:animate-none\" />\n </div>\n </div>\n))\n\nCardSkeleton.displayName = 'CardSkeleton'\n\nexport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardIcon,\n CardSkeleton,\n CardTitle,\n}\nexport type { CardProps, CardRadius }\n"],"mappings":";;;;;;;;AAgBA,MAAM,eAAe,IAAI,4CAA4C;CACnE,UAAU,EACR,SAAS;EACP,SAAS,GAAG,gBAAgB,SAAS,kBAAkB,OAAO;EAC9D,MAAM,GAAG,gBAAgB,MAAM,kBAAkB,IAAI;EACrD,SAAS,GAAG,gBAAgB,SAAS,kBAAkB,OAAO;EAC9D,SAAS,GAAG,gBAAgB,SAAS,kBAAkB,OAAO;EAC9D,OAAO,GAAG,gBAAgB,OAAO,kBAAkB,KAAK;EACxD,OAAO,GAAG,gBAAgB,OAAO,kBAAkB,KAAK;CAC1D,EACF;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CAAC;AA0BD,MAAM,OAAOA,QAAM,YAEf,EAAE,WAAW,SAAS,OAAO,SAAS,MAAM,UAAU,QAAQ,GAAG,SACjE,QACG;CACH,MAAM,cAAc,UAAU;CAC9B,MAAM,WAAW,WAAW;CAC5B,OAAO,UAAU;EACf,gBAAgB;EAChB;EACA,OAAO;GACL,aAAa;GACb,gBAAgB;GAChB,mBAAmB;GACnB,iBAAiB,WAAW,KAAK,KAAA;GACjC,WAAW,GACT,aAAa,EA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K,WAAU,2FAA4F,CAAA,GAC3G,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,OAAD,EAAK,WAAU,2FAA4F,CAAA,GAC3G,oBAAC,OAAD,EAAK,WAAU,2FAA4F,CAAA,CACxG;GACF;EACN;AAED,aAAa,cAAc"}
1
+ {"version":3,"file":"card.js","names":["React"],"sources":["../../src/components/card.tsx"],"sourcesContent":["import { useRender } from '@base-ui/react/use-render'\nimport { cva } from 'class-variance-authority'\nimport * as React from 'react'\nimport {\n containerChrome,\n containerElevated,\n containerInteractiveClasses,\n containerPaddingX,\n radiusClasses,\n type ContainerRadius,\n} from '../lib/container-chrome'\nimport type { SparkCardColor, SparkCardVariant } from '../lib/theme-types'\nimport { cn } from '../utils/cn'\n\ntype CardRadius = ContainerRadius\n\nconst cardVariants = cva('relative flex w-full flex-col gap-1 py-3', {\n variants: {\n variant: {\n ambient: cn(containerChrome.ambient, containerPaddingX.ambient),\n soft: cn(containerChrome.soft, containerPaddingX.soft),\n surface: cn(containerChrome.surface, containerPaddingX.surface),\n outline: cn(containerChrome.outline, containerPaddingX.outline),\n ghost: cn(containerChrome.ghost, containerPaddingX.ghost),\n solid: cn(containerChrome.solid, containerPaddingX.solid),\n },\n },\n defaultVariants: {\n variant: 'ambient',\n },\n})\n\ninterface CardProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Container chrome scoped to this card — NOT the ambient `data-style` knob\n * (that drives controls and would cascade into the card's content). Unset →\n * follows the app-level `[data-card-variant]` knob (default soft-neutral).\n */\n variant?: SparkCardVariant\n /** Chrome palette. `neutral` (default) tracks the app neutral; `accent` tints with the brand accent. */\n color?: SparkCardColor\n /** Corner radius, as a named step. Unset → `lg`, today's fixed behaviour. */\n radius?: CardRadius\n /**\n * Lift the card off an arbitrary backdrop (a photo, not the flat app canvas):\n * an opaque `--spark-elevated` fill plus a shadow, so no `variant`/`color`\n * combination — including a translucent one like `soft` — can bleed it through.\n */\n elevated?: boolean\n /**\n * Base UI polymorphism. Pass `<a href/>` or `<button/>` to make the whole\n * card interactive (hover tint, focus ring, disabled styles). Omit → static.\n */\n render?: useRender.RenderProp\n}\n\nconst Card = React.forwardRef<HTMLDivElement, CardProps>(\n (\n { className, variant, color, radius = 'lg', elevated, render, ...props },\n ref,\n ) => {\n const interactive = render != null\n const resolved = variant ?? 'ambient'\n return useRender({\n defaultTagName: 'div',\n render,\n props: {\n 'data-slot': 'card',\n 'data-variant': variant,\n 'data-card-color': color === 'accent' ? 'accent' : undefined,\n 'data-elevated': elevated ? '' : undefined,\n className: cn(\n cardVariants({ variant }),\n radiusClasses[radius],\n elevated && containerElevated,\n interactive && containerInteractiveClasses(resolved, elevated),\n className,\n ),\n ref,\n ...props,\n },\n })\n },\n)\n\nCard.displayName = 'Card'\n\nconst CardHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n className={cn('flex items-center gap-4', className)}\n ref={ref}\n {...props}\n />\n))\n\nCardHeader.displayName = 'CardHeader'\n\nconst CardIcon = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n className={cn(\n 'flex shrink-0 items-center justify-center text-(--spark-card-icon,var(--spark-a11))',\n className,\n )}\n ref={ref}\n {...props}\n />\n))\n\nCardIcon.displayName = 'CardIcon'\n\nconst CardTitle = React.forwardRef<\n HTMLHeadingElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h3\n className={cn(\n 'text-base leading-5 font-medium text-(--spark-card-fg,var(--neutral-a12))',\n className,\n )}\n ref={ref}\n {...props}\n />\n))\n\nCardTitle.displayName = 'CardTitle'\n\nconst CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p\n className={cn(\n 'text-sm leading-5 text-(--spark-card-fg-muted,var(--neutral-a11))',\n className,\n )}\n ref={ref}\n {...props}\n />\n))\n\nCardDescription.displayName = 'CardDescription'\n\nconst CardContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div className={cn('', className)} ref={ref} {...props} />\n))\n\nCardContent.displayName = 'CardContent'\n\nconst CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n className={cn(\n 'flex items-center justify-end gap-2 pt-2 text-(--spark-card-fg,var(--neutral-a12))',\n className,\n )}\n ref={ref}\n {...props}\n />\n))\n\nCardFooter.displayName = 'CardFooter'\n\nconst CardSkeleton = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n className={cn(\n 'relative flex w-full items-center gap-4 rounded-lg bg-spark-a3 p-4 opacity-80',\n className,\n )}\n ref={ref}\n {...props}\n >\n <div className=\"size-10 shrink-0 animate-pulse rounded-full bg-base-gray-soft motion-reduce:animate-none\" />\n <div className=\"flex flex-1 flex-col gap-y-2\">\n <div className=\"h-5 w-1/3 max-w-32 animate-pulse rounded-md bg-base-gray-soft motion-reduce:animate-none\" />\n <div className=\"h-4 w-1/2 max-w-48 animate-pulse rounded-md bg-base-gray-soft motion-reduce:animate-none\" />\n </div>\n </div>\n))\n\nCardSkeleton.displayName = 'CardSkeleton'\n\nexport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardIcon,\n CardSkeleton,\n CardTitle,\n}\nexport type { CardProps, CardRadius }\n"],"mappings":";;;;;;;;AAgBA,MAAM,eAAe,IAAI,4CAA4C;CACnE,UAAU,EACR,SAAS;EACP,SAAS,GAAG,gBAAgB,SAAS,kBAAkB,OAAO;EAC9D,MAAM,GAAG,gBAAgB,MAAM,kBAAkB,IAAI;EACrD,SAAS,GAAG,gBAAgB,SAAS,kBAAkB,OAAO;EAC9D,SAAS,GAAG,gBAAgB,SAAS,kBAAkB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AAc;AAE9B,MAAM,cAAcA,QAAM,YAGvB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,OAAD;CAAK,WAAW,GAAG,IAAI,SAAS;CAAQ;CAAK,GAAI;AAAQ,CAAA,CAC1D;AAED,YAAY,cAAc;AAE1B,MAAM,aAAaA,QAAM,YAGtB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,OAAD;CACE,WAAW,GACT,sFACA,SACF;CACK;CACL,GAAI;AACL,CAAA,CACF;AAED,WAAW,cAAc;AAEzB,MAAM,eAAeA,QAAM,YAGxB,EAAE,WAAW,GAAG,SAAS,QAC1B,qBAAC,OAAD;CACE,WAAW,GACT,iFACA,SACF;CACK;CACL,GAAI;WANN,CAQE,oBAAC,OAAD,EAAK,WAAU,2FAA4F,CAAA,GAC3G,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,OAAD,EAAK,WAAU,2FAA4F,CAAA,GAC3G,oBAAC,OAAD,EAAK,WAAU,2FAA4F,CAAA,CACxG;GACF;EACN;AAED,aAAa,cAAc"}
@@ -5,7 +5,7 @@ const require_components_button = require("./button.cjs");
5
5
  let react = require("react");
6
6
  react = require_chunk.__toESM(react);
7
7
  let react_jsx_runtime = require("react/jsx-runtime");
8
- let cn = require("cn");
8
+ let cnfast = require("cnfast");
9
9
  //#region src/components/chart.tsx
10
10
  function ChartZoomResetButton({ label, onReset }) {
11
11
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_button.Button, {
@@ -74,7 +74,7 @@ function clampTooltipPosition({ anchorX, anchorY, width, height, tipWidth, tipHe
74
74
  function ChartTooltipCard({ label, rows, className }) {
75
75
  if (rows.length === 0) return null;
76
76
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
77
- className: (0, cn.cn)("grid min-w-40 gap-1.5 rounded-lg border border-gray-a6 bg-gray-1 px-3 py-2 text-xs shadow-lg shadow-gray-a3", className),
77
+ className: (0, cnfast.cn)("grid min-w-40 gap-1.5 rounded-lg border border-gray-a6 bg-gray-1 px-3 py-2 text-xs shadow-lg shadow-gray-a3", className),
78
78
  children: [label !== void 0 && label !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
79
79
  className: "font-medium text-gray",
80
80
  children: label
@@ -1 +1 @@
1
- {"version":3,"file":"chart.cjs","names":["Button"],"sources":["../../src/components/chart.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useEffect, useRef, useState } from 'react'\nimport { cn } from '../utils/cn'\nimport { Button } from './button'\n\nexport type ChartConfig = Record<\n string,\n {\n label?: React.ReactNode\n color?: string\n }\n>\n\nexport interface ChartTooltipRow {\n key: string\n label: React.ReactNode\n /** CSS color value for the legend swatch (e.g. `var(--orange-a9)`). */\n color: string\n value: React.ReactNode\n /** Swatch shape: `dot` (default) for solid series, `dashed-line` for dashed ones. */\n marker?: 'dot' | 'dashed-line'\n}\n\nexport interface ChartTooltipCardProps {\n label?: React.ReactNode\n rows: ChartTooltipRow[]\n className?: string\n}\n\ninterface ChartZoomResetButtonProps {\n label: string\n onReset: () => void\n}\n\nexport function ChartZoomResetButton({\n label,\n onReset,\n}: ChartZoomResetButtonProps) {\n return (\n <Button\n className=\"absolute top-2 right-2 z-20 h-11 bg-gray-1 text-gray hover:bg-gray-2\"\n color=\"neutral\"\n onClick={onReset}\n styleVariant=\"surface\"\n type=\"button\"\n >\n {label}\n </Button>\n )\n}\n\n/**\n * Tracks an element's rendered size via ResizeObserver. The element must stay\n * mounted (e.g. an always-rendered, possibly-hidden tooltip wrapper) so the ref\n * is attached when the observer is set up.\n */\nexport function useMeasuredSize<T extends HTMLElement>() {\n const ref = useRef<T>(null)\n const [size, setSize] = useState({ width: 0, height: 0 })\n\n useEffect(() => {\n const element = ref.current\n if (!element) return\n\n const resizeObserver = new ResizeObserver((entries) => {\n const entry = entries[0]\n if (!entry) return\n setSize({\n width: entry.contentRect.width,\n height: entry.contentRect.height,\n })\n })\n\n resizeObserver.observe(element)\n return () => resizeObserver.disconnect()\n }, [])\n\n return [ref, size] as const\n}\n\ninterface ClampTooltipArgs {\n /** Anchor point (chart-local px) the tooltip should sit at, horizontally centred. */\n anchorX: number\n anchorY: number\n /** Chart bounds (px). */\n width: number\n height: number\n /** Measured tooltip size (px). */\n tipWidth: number\n tipHeight: number\n /** Gap between the anchor and the tooltip. */\n gap?: number\n /** Minimum distance kept from every chart edge. */\n pad?: number\n /**\n * `above` (default): centred above the anchor, flipped below if it would clip\n * the top — good for bars. `beside`: offset to the side of the anchor so it\n * never sits on top of the hovered point/line — good for line/area charts.\n */\n placement?: 'above' | 'beside'\n}\n\n/**\n * Positions a tooltip relative to an anchor while keeping it fully inside the\n * chart: clamped on every edge, flipped above/below or left/right as needed.\n */\nexport function clampTooltipPosition({\n anchorX,\n anchorY,\n width,\n height,\n tipWidth,\n tipHeight,\n gap = 12,\n pad = 8,\n placement = 'above',\n}: ClampTooltipArgs): { left: number; top: number } {\n const maxLeft = Math.max(pad, width - tipWidth - pad)\n const maxTop = Math.max(pad, height - tipHeight - pad)\n\n if (placement === 'beside') {\n // Prefer the right of the anchor; flip to the left if it would overflow.\n const right = anchorX + gap\n const left =\n right + tipWidth + pad <= width ? right : anchorX - gap - tipWidth\n return {\n left: Math.min(Math.max(left, pad), maxLeft),\n top: Math.min(Math.max(anchorY, pad), maxTop),\n }\n }\n\n const above = anchorY - gap - tipHeight\n const desiredTop = above >= pad ? above : anchorY + gap\n return {\n left: Math.min(Math.max(anchorX - tipWidth / 2, pad), maxLeft),\n top: Math.min(Math.max(desiredTop, pad), maxTop),\n }\n}\n\n/**\n * Card-style multi-series tooltip body: an optional header plus one\n * coloured-dot row per series. Rendered inside `@visx/tooltip` by the chart\n * components so every chart shares the same tooltip look.\n */\nexport function ChartTooltipCard({\n label,\n rows,\n className,\n}: ChartTooltipCardProps) {\n if (rows.length === 0) return null\n\n return (\n <div\n className={cn(\n 'grid min-w-40 gap-1.5 rounded-lg border border-gray-a6 bg-gray-1 px-3 py-2 text-xs shadow-lg shadow-gray-a3',\n className,\n )}\n >\n {label !== undefined && label !== null && (\n <div className=\"font-medium text-gray\">{label}</div>\n )}\n <div className=\"grid gap-1.5\">\n {rows.map((row) => (\n <div\n key={row.key}\n className=\"flex items-center justify-between gap-4\"\n >\n <span className=\"flex items-center gap-1.5 text-gray-light\">\n {row.marker === 'dashed-line' ? (\n <span\n aria-hidden=\"true\"\n className=\"w-3 shrink-0 border-t-2 border-dashed\"\n style={{ borderColor: row.color }}\n />\n ) : (\n <span\n aria-hidden=\"true\"\n className=\"size-2 shrink-0 rounded-[2px]\"\n style={{ backgroundColor: row.color }}\n />\n )}\n {row.label}\n </span>\n <span className=\"font-medium whitespace-nowrap text-gray tabular-nums\">\n {row.value}\n </span>\n </div>\n ))}\n </div>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;AAkCA,SAAgB,qBAAqB,EACnC,OACA,WAC4B;CAC5B,OACE,iBAAA,GAAA,kBAAA,KAACA,0BAAAA,QAAD;EACE,WAAU;EACV,OAAM;EACN,SAAS;EACT,cAAa;EACb,MAAK;YAEJ;CACK,CAAA;AAEZ;;;;;;AAOA,SAAgB,kBAAyC;CACvD,MAAM,OAAA,GAAA,MAAA,QAAgB,IAAI;CAC1B,MAAM,CAAC,MAAM,YAAA,GAAA,MAAA,UAAoB;EAAE,OAAO;EAAG,QAAQ;CAAE,CAAC;CAExD,CAAA,GAAA,MAAA,iBAAgB;EACd,MAAM,UAAU,IAAI;EACpB,IAAI,CAAC,SAAS;EAEd,MAAM,iBAAiB,IAAI,gBAAgB,YAAY;GACrD,MAAM,QAAQ,QAAQ;GACtB,IAAI,CAAC,OAAO;GACZ,QAAQ;IACN,OAAO,MAAM,YAAY;IACzB,QAAQ,MAAM,YAAY;GAC5B,CAAC;EACH,CAAC;EAED,eAAe,QAAQ,OAAO;EAC9B,aAAa,eAAe,WAAW;CACzC,GAAG,CAAC,CAAC;CAEL,OAAO,CAAC,KAAK,IAAI;AACnB;;;;;AA4BA,SAAgB,qBAAqB,EACnC,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M;KACjC,CAAA,IAED,iBAAA,GAAA,kBAAA,KAAC,QAAD;MACE,eAAY;MACZ,WAAU;MACV,OAAO,EAAE,iBAAiB,IAAI,MAAM;KACrC,CAAA,GAEF,IAAI,KACD;QACN,iBAAA,GAAA,kBAAA,KAAC,QAAD;KAAM,WAAU;eACb,IAAI;IACD,CAAA,CACH;MAtBE,IAAI,GAsBN,CACN;EACE,CAAA,CACF;;AAET"}
1
+ {"version":3,"file":"chart.cjs","names":["Button"],"sources":["../../src/components/chart.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useEffect, useRef, useState } from 'react'\nimport { cn } from '../utils/cn'\nimport { Button } from './button'\n\nexport type ChartConfig = Record<\n string,\n {\n label?: React.ReactNode\n color?: string\n }\n>\n\nexport interface ChartTooltipRow {\n key: string\n label: React.ReactNode\n /** CSS color value for the legend swatch (e.g. `var(--orange-a9)`). */\n color: string\n value: React.ReactNode\n /** Swatch shape: `dot` (default) for solid series, `dashed-line` for dashed ones. */\n marker?: 'dot' | 'dashed-line'\n}\n\nexport interface ChartTooltipCardProps {\n label?: React.ReactNode\n rows: ChartTooltipRow[]\n className?: string\n}\n\ninterface ChartZoomResetButtonProps {\n label: string\n onReset: () => void\n}\n\nexport function ChartZoomResetButton({\n label,\n onReset,\n}: ChartZoomResetButtonProps) {\n return (\n <Button\n className=\"absolute top-2 right-2 z-20 h-11 bg-gray-1 text-gray hover:bg-gray-2\"\n color=\"neutral\"\n onClick={onReset}\n styleVariant=\"surface\"\n type=\"button\"\n >\n {label}\n </Button>\n )\n}\n\n/**\n * Tracks an element's rendered size via ResizeObserver. The element must stay\n * mounted (e.g. an always-rendered, possibly-hidden tooltip wrapper) so the ref\n * is attached when the observer is set up.\n */\nexport function useMeasuredSize<T extends HTMLElement>() {\n const ref = useRef<T>(null)\n const [size, setSize] = useState({ width: 0, height: 0 })\n\n useEffect(() => {\n const element = ref.current\n if (!element) return\n\n const resizeObserver = new ResizeObserver((entries) => {\n const entry = entries[0]\n if (!entry) return\n setSize({\n width: entry.contentRect.width,\n height: entry.contentRect.height,\n })\n })\n\n resizeObserver.observe(element)\n return () => resizeObserver.disconnect()\n }, [])\n\n return [ref, size] as const\n}\n\ninterface ClampTooltipArgs {\n /** Anchor point (chart-local px) the tooltip should sit at, horizontally centred. */\n anchorX: number\n anchorY: number\n /** Chart bounds (px). */\n width: number\n height: number\n /** Measured tooltip size (px). */\n tipWidth: number\n tipHeight: number\n /** Gap between the anchor and the tooltip. */\n gap?: number\n /** Minimum distance kept from every chart edge. */\n pad?: number\n /**\n * `above` (default): centred above the anchor, flipped below if it would clip\n * the top — good for bars. `beside`: offset to the side of the anchor so it\n * never sits on top of the hovered point/line — good for line/area charts.\n */\n placement?: 'above' | 'beside'\n}\n\n/**\n * Positions a tooltip relative to an anchor while keeping it fully inside the\n * chart: clamped on every edge, flipped above/below or left/right as needed.\n */\nexport function clampTooltipPosition({\n anchorX,\n anchorY,\n width,\n height,\n tipWidth,\n tipHeight,\n gap = 12,\n pad = 8,\n placement = 'above',\n}: ClampTooltipArgs): { left: number; top: number } {\n const maxLeft = Math.max(pad, width - tipWidth - pad)\n const maxTop = Math.max(pad, height - tipHeight - pad)\n\n if (placement === 'beside') {\n // Prefer the right of the anchor; flip to the left if it would overflow.\n const right = anchorX + gap\n const left =\n right + tipWidth + pad <= width ? right : anchorX - gap - tipWidth\n return {\n left: Math.min(Math.max(left, pad), maxLeft),\n top: Math.min(Math.max(anchorY, pad), maxTop),\n }\n }\n\n const above = anchorY - gap - tipHeight\n const desiredTop = above >= pad ? above : anchorY + gap\n return {\n left: Math.min(Math.max(anchorX - tipWidth / 2, pad), maxLeft),\n top: Math.min(Math.max(desiredTop, pad), maxTop),\n }\n}\n\n/**\n * Card-style multi-series tooltip body: an optional header plus one\n * coloured-dot row per series. Rendered inside `@visx/tooltip` by the chart\n * components so every chart shares the same tooltip look.\n */\nexport function ChartTooltipCard({\n label,\n rows,\n className,\n}: ChartTooltipCardProps) {\n if (rows.length === 0) return null\n\n return (\n <div\n className={cn(\n 'grid min-w-40 gap-1.5 rounded-lg border border-gray-a6 bg-gray-1 px-3 py-2 text-xs shadow-lg shadow-gray-a3',\n className,\n )}\n >\n {label !== undefined && label !== null && (\n <div className=\"font-medium text-gray\">{label}</div>\n )}\n <div className=\"grid gap-1.5\">\n {rows.map((row) => (\n <div\n key={row.key}\n className=\"flex items-center justify-between gap-4\"\n >\n <span className=\"flex items-center gap-1.5 text-gray-light\">\n {row.marker === 'dashed-line' ? (\n <span\n aria-hidden=\"true\"\n className=\"w-3 shrink-0 border-t-2 border-dashed\"\n style={{ borderColor: row.color }}\n />\n ) : (\n <span\n aria-hidden=\"true\"\n className=\"size-2 shrink-0 rounded-[2px]\"\n style={{ backgroundColor: row.color }}\n />\n )}\n {row.label}\n </span>\n <span className=\"font-medium whitespace-nowrap text-gray tabular-nums\">\n {row.value}\n </span>\n </div>\n ))}\n </div>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;AAkCA,SAAgB,qBAAqB,EACnC,OACA,WAC4B;CAC5B,OACE,iBAAA,GAAA,kBAAA,KAACA,0BAAAA,QAAD;EACE,WAAU;EACV,OAAM;EACN,SAAS;EACT,cAAa;EACb,MAAK;YAEJ;CACK,CAAA;AAEZ;;;;;;AAOA,SAAgB,kBAAyC;CACvD,MAAM,OAAA,GAAA,MAAA,QAAgB,IAAI;CAC1B,MAAM,CAAC,MAAM,YAAA,GAAA,MAAA,UAAoB;EAAE,OAAO;EAAG,QAAQ;CAAE,CAAC;CAExD,CAAA,GAAA,MAAA,iBAAgB;EACd,MAAM,UAAU,IAAI;EACpB,IAAI,CAAC,SAAS;EAEd,MAAM,iBAAiB,IAAI,gBAAgB,YAAY;GACrD,MAAM,QAAQ,QAAQ;GACtB,IAAI,CAAC,OAAO;GACZ,QAAQ;IACN,OAAO,MAAM,YAAY;IACzB,QAAQ,MAAM,YAAY;GAC5B,CAAC;EACH,CAAC;EAED,eAAe,QAAQ,OAAO;EAC9B,aAAa,eAAe,WAAW;C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BACd,iBAAA,GAAA,kBAAA,KAAC,QAAD;MACE,eAAY;MACZ,WAAU;MACV,OAAO,EAAE,aAAa,IAAI,MAAM;KACjC,CAAA,IAED,iBAAA,GAAA,kBAAA,KAAC,QAAD;MACE,eAAY;MACZ,WAAU;MACV,OAAO,EAAE,iBAAiB,IAAI,MAAM;KACrC,CAAA,GAEF,IAAI,KACD;QACN,iBAAA,GAAA,kBAAA,KAAC,QAAD;KAAM,WAAU;eACb,IAAI;IACD,CAAA,CACH;MAtBE,IAAI,GAsBN,CACN;EACE,CAAA,CACF;;AAET"}
@@ -6,7 +6,7 @@ let react = require("react");
6
6
  react = require_chunk.__toESM(react);
7
7
  let react_jsx_runtime = require("react/jsx-runtime");
8
8
  let _base_ui_react_checkbox = require("@base-ui/react/checkbox");
9
- let cn = require("cn");
9
+ let cnfast = require("cnfast");
10
10
  //#region src/components/checkbox.tsx
11
11
  const Checkbox = react.forwardRef(({ className, size: _size, bordered: _bordered, styleVariant, color, render, nativeButton, ...props }, ref) => {
12
12
  const dataStyle = styleVariant !== void 0 || color !== void 0 ? styleVariant ?? "solid" : void 0;
@@ -16,7 +16,7 @@ const Checkbox = react.forwardRef(({ className, size: _size, bordered: _bordered
16
16
  "data-accent-color": dataAccentColor,
17
17
  nativeButton: nativeButton ?? render === void 0,
18
18
  render: render ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {}),
19
- className: (0, cn.cn)("peer touch-target relative my-2 inline-flex size-6 shrink-0 cursor-pointer items-center justify-center border-(length:--spark-style-border-width,2px) p-0 transition-colors any-pointer-coarse:my-[calc((2.75rem-var(--spacing)*6)/2)]", "before:absolute before:top-1/2 before:left-1/2 before:size-10 before:-translate-x-1/2 before:-translate-y-1/2 before:content-['']", "rounded-[min(var(--spark-rounded-md),40%)]", "focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden", "data-disabled:cursor-not-allowed data-disabled:opacity-50", "border-(--spark-style-idle-border,var(--color-accent-ui)) bg-base-accent-soft", "data-checked:border-(--spark-style-border,var(--color-primary)) data-checked:bg-(--spark-style-bg,var(--color-primary))", "data-indeterminate:border-(--spark-style-border,var(--color-primary)) data-indeterminate:bg-(--spark-style-bg,var(--color-primary))", className),
19
+ className: (0, cnfast.cn)("peer touch-target relative my-2 inline-flex size-6 shrink-0 cursor-pointer items-center justify-center border-(length:--spark-style-border-width,2px) p-0 transition-colors any-pointer-coarse:my-[calc((2.75rem-var(--spacing)*6)/2)]", "before:absolute before:top-1/2 before:left-1/2 before:size-10 before:-translate-x-1/2 before:-translate-y-1/2 before:content-['']", "rounded-[min(var(--spark-rounded-md),40%)]", "focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden", "data-disabled:cursor-not-allowed data-disabled:opacity-50", "border-(--spark-style-idle-border,var(--color-accent-ui)) bg-base-accent-soft", "data-checked:border-(--spark-style-border,var(--color-primary)) data-checked:bg-(--spark-style-bg,var(--color-primary))", "data-indeterminate:border-(--spark-style-border,var(--color-primary)) data-indeterminate:bg-(--spark-style-bg,var(--color-primary))", className),
20
20
  ref,
21
21
  ...props,
22
22
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_base_ui_react_checkbox.Checkbox.Indicator, {
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.cjs","names":["React","accentByColor","CheckboxPrimitive"],"sources":["../../src/components/checkbox.tsx"],"sourcesContent":["import { Checkbox as CheckboxPrimitive } from '@base-ui/react/checkbox'\nimport * as React from 'react'\nimport { accentByColor } from '../lib/accent-colors'\nimport type { SparkStyle } from '../lib/theme-types'\nimport { cn } from '../utils/cn'\n\nexport type SparkCheckboxColor = 'accent' | 'neutral' | 'danger'\n\ntype CheckboxProps = CheckboxPrimitive.Root.Props & {\n /**\n * @deprecated The checkbox now renders a single 24px size (with a 40px hit\n * area). Accepted for back-compat but ignored.\n */\n size?: 'default' | 'large'\n /**\n * @deprecated The checkbox is always bordered now. Accepted for back-compat\n * but ignored.\n */\n bordered?: boolean\n styleVariant?: SparkStyle\n color?: SparkCheckboxColor\n}\n\nconst Checkbox = React.forwardRef<\n React.ComponentRef<typeof CheckboxPrimitive.Root>,\n CheckboxProps\n>(\n (\n {\n className,\n // oxlint-disable-next-line typescript/no-deprecated -- strips deprecated back-compat prop before DOM spread\n size: _size,\n // oxlint-disable-next-line typescript/no-deprecated -- strips deprecated back-compat prop before DOM spread\n bordered: _bordered,\n styleVariant,\n color,\n render,\n nativeButton,\n ...props\n },\n ref,\n ) => {\n const hasLook = styleVariant !== undefined || color !== undefined\n const dataStyle = hasLook ? (styleVariant ?? 'solid') : undefined\n const dataAccentColor = color ? accentByColor[color] : undefined\n\n return (\n <CheckboxPrimitive.Root\n data-style={dataStyle}\n data-accent-color={dataAccentColor}\n // a native button owns the caller's `id`; on Base UI's default <span> the\n // `id` lands on the hidden input and the control gets a generated one\n nativeButton={nativeButton ?? render === undefined}\n render={render ?? <button />}\n className={cn(\n // p-0 defends the 24px box against the UA button padding when the\n // consumer's CSS has no Tailwind preflight\n 'peer touch-target relative my-2 inline-flex size-6 shrink-0 cursor-pointer items-center justify-center border-(length:--spark-style-border-width,2px) p-0 transition-colors any-pointer-coarse:my-[calc((2.75rem-var(--spacing)*6)/2)]',\n // both overlays are reserved as layout, so neither can bleed into a scroller;\n // the coarse margin tracks --spacing so the 44px reserve holds at any [data-scaling]\n \"before:absolute before:top-1/2 before:left-1/2 before:size-10 before:-translate-x-1/2 before:-translate-y-1/2 before:content-['']\",\n 'rounded-[min(var(--spark-rounded-md),40%)]',\n 'focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden',\n 'data-disabled:cursor-not-allowed data-disabled:opacity-50',\n 'border-(--spark-style-idle-border,var(--color-accent-ui)) bg-base-accent-soft',\n 'data-checked:border-(--spark-style-border,var(--color-primary)) data-checked:bg-(--spark-style-bg,var(--color-primary))',\n 'data-indeterminate:border-(--spark-style-border,var(--color-primary)) data-indeterminate:bg-(--spark-style-bg,var(--color-primary))',\n className,\n )}\n ref={ref}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"group inline-flex items-center justify-center text-(--spark-style-fg,var(--spark-on-solid))\">\n {/* custom-drawn glyphs; group-data toggles which one the mounted indicator shows */}\n <svg\n aria-hidden=\"true\"\n className=\"hidden size-5 group-data-checked:block\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <path\n className=\"animate-check-draw [stroke-dasharray:1] motion-reduce:animate-none\"\n d=\"M5.5 12.5 L10 17 L18.5 7.5\"\n pathLength={1}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2.5}\n />\n </svg>\n <span className=\"hidden h-0.5 w-3 origin-center animate-dash-pop rounded-full bg-current group-data-indeterminate:block motion-reduce:animate-none\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n },\n)\n\nCheckbox.displayName = 'Checkbox'\n\nexport { Checkbox }\nexport type { CheckboxProps }\n"],"mappings":";;;;;;;;;;AAuBA,MAAM,WAAWA,MAAM,YAKnB,EACE,WAEA,MAAM,OAEN,UAAU,WACV,cACA,OACA,QACA,cACA,GAAG,SAEL,QACG;CAEH,MAAM,YADU,iBAAiB,KAAA,KAAa,UAAU,KAAA,IAC3B,gBAAgB,UAAW,KAAA;CACxD,MAAM,kBAAkB,QAAQC,0BAAAA,cAAc,SAAS,KAAA;CAEvD,OACE,iBAAA,GAAA,kBAAA,KAACC,wBAAAA,SAAkB,MAAnB;EACE,cAAY;EACZ,qBAAmB;EAGnB,cAAc,gBAAgB,WAAW,KAAA;EACzC,QAAQ,UAAU,iBAAA,GAAA,kBAAA,KAAC,UAAD,CAAS,CAAA;EAC3B,YAAA,GAAA,GAAA,IAGE,0OAGA,qIACA,8CACA,iFACA,6DACA,iFACA,2HACA,uIACA,SACF;EACK;EACL,GAAI;YAEJ,iBAAA,GAAA,kBAAA,MAACA,wBAAAA,SAAkB,WAAnB;GAA6B,WAAU;aAAvC,CAEE,iBAAA,GAAA,kBAAA,KAAC,OAAD;IACE,eAAY;IACZ,WAAU;IACV,MAAK;IACL,SAAQ;cAER,iBAAA,GAAA,kBAAA,KAAC,QAAD;KACE,WAAU;KACV,GAAE;KACF,YAAY;KACZ,QAAO;KACP,eAAc;KACd,gBAAe;KACf,aAAa;IACd,CAAA;GACE,CAAA,GACL,iBAAA,GAAA,kBAAA,KAAC,QAAD,EAAM,WAAU,oIAAqI,CAAA,CAC1H;;CACP,CAAA;AAE5B,CACF;AAEA,SAAS,cAAc"}
1
+ {"version":3,"file":"checkbox.cjs","names":["React","accentByColor","CheckboxPrimitive"],"sources":["../../src/components/checkbox.tsx"],"sourcesContent":["import { Checkbox as CheckboxPrimitive } from '@base-ui/react/checkbox'\nimport * as React from 'react'\nimport { accentByColor } from '../lib/accent-colors'\nimport type { SparkStyle } from '../lib/theme-types'\nimport { cn } from '../utils/cn'\n\nexport type SparkCheckboxColor = 'accent' | 'neutral' | 'danger'\n\ntype CheckboxProps = CheckboxPrimitive.Root.Props & {\n /**\n * @deprecated The checkbox now renders a single 24px size (with a 40px hit\n * area). Accepted for back-compat but ignored.\n */\n size?: 'default' | 'large'\n /**\n * @deprecated The checkbox is always bordered now. Accepted for back-compat\n * but ignored.\n */\n bordered?: boolean\n styleVariant?: SparkStyle\n color?: SparkCheckboxColor\n}\n\nconst Checkbox = React.forwardRef<\n React.ComponentRef<typeof CheckboxPrimitive.Root>,\n CheckboxProps\n>(\n (\n {\n className,\n size: _size,\n bordered: _bordered,\n styleVariant,\n color,\n render,\n nativeButton,\n ...props\n },\n ref,\n ) => {\n const hasLook = styleVariant !== undefined || color !== undefined\n const dataStyle = hasLook ? (styleVariant ?? 'solid') : undefined\n const dataAccentColor = color ? accentByColor[color] : undefined\n\n return (\n <CheckboxPrimitive.Root\n data-style={dataStyle}\n data-accent-color={dataAccentColor}\n // a native button owns the caller's `id`; on Base UI's default <span> the\n // `id` lands on the hidden input and the control gets a generated one\n nativeButton={nativeButton ?? render === undefined}\n render={render ?? <button />}\n className={cn(\n // p-0 defends the 24px box against the UA button padding when the\n // consumer's CSS has no Tailwind preflight\n 'peer touch-target relative my-2 inline-flex size-6 shrink-0 cursor-pointer items-center justify-center border-(length:--spark-style-border-width,2px) p-0 transition-colors any-pointer-coarse:my-[calc((2.75rem-var(--spacing)*6)/2)]',\n // both overlays are reserved as layout, so neither can bleed into a scroller;\n // the coarse margin tracks --spacing so the 44px reserve holds at any [data-scaling]\n \"before:absolute before:top-1/2 before:left-1/2 before:size-10 before:-translate-x-1/2 before:-translate-y-1/2 before:content-['']\",\n 'rounded-[min(var(--spark-rounded-md),40%)]',\n 'focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden',\n 'data-disabled:cursor-not-allowed data-disabled:opacity-50',\n 'border-(--spark-style-idle-border,var(--color-accent-ui)) bg-base-accent-soft',\n 'data-checked:border-(--spark-style-border,var(--color-primary)) data-checked:bg-(--spark-style-bg,var(--color-primary))',\n 'data-indeterminate:border-(--spark-style-border,var(--color-primary)) data-indeterminate:bg-(--spark-style-bg,var(--color-primary))',\n className,\n )}\n ref={ref}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"group inline-flex items-center justify-center text-(--spark-style-fg,var(--spark-on-solid))\">\n {/* custom-drawn glyphs; group-data toggles which one the mounted indicator shows */}\n <svg\n aria-hidden=\"true\"\n className=\"hidden size-5 group-data-checked:block\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <path\n className=\"animate-check-draw [stroke-dasharray:1] motion-reduce:animate-none\"\n d=\"M5.5 12.5 L10 17 L18.5 7.5\"\n pathLength={1}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2.5}\n />\n </svg>\n <span className=\"hidden h-0.5 w-3 origin-center animate-dash-pop rounded-full bg-current group-data-indeterminate:block motion-reduce:animate-none\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n },\n)\n\nCheckbox.displayName = 'Checkbox'\n\nexport { Checkbox }\nexport type { CheckboxProps }\n"],"mappings":";;;;;;;;;;AAuBA,MAAM,WAAWA,MAAM,YAKnB,EACE,WACA,MAAM,OACN,UAAU,WACV,cACA,OACA,QACA,cACA,GAAG,SAEL,QACG;CAEH,MAAM,YADU,iBAAiB,KAAA,KAAa,UAAU,KAAA,IAC3B,gBAAgB,UAAW,KAAA;CACxD,MAAM,kBAAkB,QAAQC,0BAAAA,cAAc,SAAS,KAAA;CAEvD,OACE,iBAAA,GAAA,kBAAA,KAACC,wBAAAA,SAAkB,MAAnB;EACE,cAAY;EACZ,qBAAmB;EAGnB,cAAc,gBAAgB,WAAW,KAAA;EACzC,QAAQ,UAAU,iBAAA,GAAA,kBAAA,KAAC,UAAD,CAAS,CAAA;EAC3B,YAAA,GAAA,OAAA,IAGE,0OAGA,qIACA,8CACA,iFACA,6DACA,iFACA,2HACA,uIACA,SACF;EACK;EACL,GAAI;YAEJ,iBAAA,GAAA,kBAAA,MAACA,wBAAAA,SAAkB,WAAnB;GAA6B,WAAU;aAAvC,CAEE,iBAAA,GAAA,kBAAA,KAAC,OAAD;IACE,eAAY;IACZ,WAAU;IACV,MAAK;IACL,SAAQ;cAER,iBAAA,GAAA,kBAAA,KAAC,QAAD;KACE,WAAU;KACV,GAAE;KACF,YAAY;KACZ,QAAO;KACP,eAAc;KACd,gBAAe;KACf,aAAa;IACd,CAAA;GACE,CAAA,GACL,iBAAA,GAAA,kBAAA,KAAC,QAAD,EAAM,WAAU,oIAAqI,CAAA,CAC1H;;CACP,CAAA;AAE5B,CACF;AAEA,SAAS,cAAc"}
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { accentByColor } from "../lib/accent-colors.js";
3
2
  import { cn } from "../utils/cn.js";
3
+ import { accentByColor } from "../lib/accent-colors.js";
4
4
  import * as React$1 from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { Checkbox as Checkbox$1 } from "@base-ui/react/checkbox";
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.js","names":["React","CheckboxPrimitive"],"sources":["../../src/components/checkbox.tsx"],"sourcesContent":["import { Checkbox as CheckboxPrimitive } from '@base-ui/react/checkbox'\nimport * as React from 'react'\nimport { accentByColor } from '../lib/accent-colors'\nimport type { SparkStyle } from '../lib/theme-types'\nimport { cn } from '../utils/cn'\n\nexport type SparkCheckboxColor = 'accent' | 'neutral' | 'danger'\n\ntype CheckboxProps = CheckboxPrimitive.Root.Props & {\n /**\n * @deprecated The checkbox now renders a single 24px size (with a 40px hit\n * area). Accepted for back-compat but ignored.\n */\n size?: 'default' | 'large'\n /**\n * @deprecated The checkbox is always bordered now. Accepted for back-compat\n * but ignored.\n */\n bordered?: boolean\n styleVariant?: SparkStyle\n color?: SparkCheckboxColor\n}\n\nconst Checkbox = React.forwardRef<\n React.ComponentRef<typeof CheckboxPrimitive.Root>,\n CheckboxProps\n>(\n (\n {\n className,\n // oxlint-disable-next-line typescript/no-deprecated -- strips deprecated back-compat prop before DOM spread\n size: _size,\n // oxlint-disable-next-line typescript/no-deprecated -- strips deprecated back-compat prop before DOM spread\n bordered: _bordered,\n styleVariant,\n color,\n render,\n nativeButton,\n ...props\n },\n ref,\n ) => {\n const hasLook = styleVariant !== undefined || color !== undefined\n const dataStyle = hasLook ? (styleVariant ?? 'solid') : undefined\n const dataAccentColor = color ? accentByColor[color] : undefined\n\n return (\n <CheckboxPrimitive.Root\n data-style={dataStyle}\n data-accent-color={dataAccentColor}\n // a native button owns the caller's `id`; on Base UI's default <span> the\n // `id` lands on the hidden input and the control gets a generated one\n nativeButton={nativeButton ?? render === undefined}\n render={render ?? <button />}\n className={cn(\n // p-0 defends the 24px box against the UA button padding when the\n // consumer's CSS has no Tailwind preflight\n 'peer touch-target relative my-2 inline-flex size-6 shrink-0 cursor-pointer items-center justify-center border-(length:--spark-style-border-width,2px) p-0 transition-colors any-pointer-coarse:my-[calc((2.75rem-var(--spacing)*6)/2)]',\n // both overlays are reserved as layout, so neither can bleed into a scroller;\n // the coarse margin tracks --spacing so the 44px reserve holds at any [data-scaling]\n \"before:absolute before:top-1/2 before:left-1/2 before:size-10 before:-translate-x-1/2 before:-translate-y-1/2 before:content-['']\",\n 'rounded-[min(var(--spark-rounded-md),40%)]',\n 'focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden',\n 'data-disabled:cursor-not-allowed data-disabled:opacity-50',\n 'border-(--spark-style-idle-border,var(--color-accent-ui)) bg-base-accent-soft',\n 'data-checked:border-(--spark-style-border,var(--color-primary)) data-checked:bg-(--spark-style-bg,var(--color-primary))',\n 'data-indeterminate:border-(--spark-style-border,var(--color-primary)) data-indeterminate:bg-(--spark-style-bg,var(--color-primary))',\n className,\n )}\n ref={ref}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"group inline-flex items-center justify-center text-(--spark-style-fg,var(--spark-on-solid))\">\n {/* custom-drawn glyphs; group-data toggles which one the mounted indicator shows */}\n <svg\n aria-hidden=\"true\"\n className=\"hidden size-5 group-data-checked:block\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <path\n className=\"animate-check-draw [stroke-dasharray:1] motion-reduce:animate-none\"\n d=\"M5.5 12.5 L10 17 L18.5 7.5\"\n pathLength={1}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2.5}\n />\n </svg>\n <span className=\"hidden h-0.5 w-3 origin-center animate-dash-pop rounded-full bg-current group-data-indeterminate:block motion-reduce:animate-none\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n },\n)\n\nCheckbox.displayName = 'Checkbox'\n\nexport { Checkbox }\nexport type { CheckboxProps }\n"],"mappings":";;;;;;;AAuBA,MAAM,WAAWA,QAAM,YAKnB,EACE,WAEA,MAAM,OAEN,UAAU,WACV,cACA,OACA,QACA,cACA,GAAG,SAEL,QACG;CAEH,MAAM,YADU,iBAAiB,KAAA,KAAa,UAAU,KAAA,IAC3B,gBAAgB,UAAW,KAAA;CACxD,MAAM,kBAAkB,QAAQ,cAAc,SAAS,KAAA;CAEvD,OACE,oBAACC,WAAkB,MAAnB;EACE,cAAY;EACZ,qBAAmB;EAGnB,cAAc,gBAAgB,WAAW,KAAA;EACzC,QAAQ,UAAU,oBAAC,UAAD,CAAS,CAAA;EAC3B,WAAW,GAGT,0OAGA,qIACA,8CACA,iFACA,6DACA,iFACA,2HACA,uIACA,SACF;EACK;EACL,GAAI;YAEJ,qBAACA,WAAkB,WAAnB;GAA6B,WAAU;aAAvC,CAEE,oBAAC,OAAD;IACE,eAAY;IACZ,WAAU;IACV,MAAK;IACL,SAAQ;cAER,oBAAC,QAAD;KACE,WAAU;KACV,GAAE;KACF,YAAY;KACZ,QAAO;KACP,eAAc;KACd,gBAAe;KACf,aAAa;IACd,CAAA;GACE,CAAA,GACL,oBAAC,QAAD,EAAM,WAAU,oIAAqI,CAAA,CAC1H;;CACP,CAAA;AAE5B,CACF;AAEA,SAAS,cAAc"}
1
+ {"version":3,"file":"checkbox.js","names":["React","CheckboxPrimitive"],"sources":["../../src/components/checkbox.tsx"],"sourcesContent":["import { Checkbox as CheckboxPrimitive } from '@base-ui/react/checkbox'\nimport * as React from 'react'\nimport { accentByColor } from '../lib/accent-colors'\nimport type { SparkStyle } from '../lib/theme-types'\nimport { cn } from '../utils/cn'\n\nexport type SparkCheckboxColor = 'accent' | 'neutral' | 'danger'\n\ntype CheckboxProps = CheckboxPrimitive.Root.Props & {\n /**\n * @deprecated The checkbox now renders a single 24px size (with a 40px hit\n * area). Accepted for back-compat but ignored.\n */\n size?: 'default' | 'large'\n /**\n * @deprecated The checkbox is always bordered now. Accepted for back-compat\n * but ignored.\n */\n bordered?: boolean\n styleVariant?: SparkStyle\n color?: SparkCheckboxColor\n}\n\nconst Checkbox = React.forwardRef<\n React.ComponentRef<typeof CheckboxPrimitive.Root>,\n CheckboxProps\n>(\n (\n {\n className,\n size: _size,\n bordered: _bordered,\n styleVariant,\n color,\n render,\n nativeButton,\n ...props\n },\n ref,\n ) => {\n const hasLook = styleVariant !== undefined || color !== undefined\n const dataStyle = hasLook ? (styleVariant ?? 'solid') : undefined\n const dataAccentColor = color ? accentByColor[color] : undefined\n\n return (\n <CheckboxPrimitive.Root\n data-style={dataStyle}\n data-accent-color={dataAccentColor}\n // a native button owns the caller's `id`; on Base UI's default <span> the\n // `id` lands on the hidden input and the control gets a generated one\n nativeButton={nativeButton ?? render === undefined}\n render={render ?? <button />}\n className={cn(\n // p-0 defends the 24px box against the UA button padding when the\n // consumer's CSS has no Tailwind preflight\n 'peer touch-target relative my-2 inline-flex size-6 shrink-0 cursor-pointer items-center justify-center border-(length:--spark-style-border-width,2px) p-0 transition-colors any-pointer-coarse:my-[calc((2.75rem-var(--spacing)*6)/2)]',\n // both overlays are reserved as layout, so neither can bleed into a scroller;\n // the coarse margin tracks --spacing so the 44px reserve holds at any [data-scaling]\n \"before:absolute before:top-1/2 before:left-1/2 before:size-10 before:-translate-x-1/2 before:-translate-y-1/2 before:content-['']\",\n 'rounded-[min(var(--spark-rounded-md),40%)]',\n 'focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden',\n 'data-disabled:cursor-not-allowed data-disabled:opacity-50',\n 'border-(--spark-style-idle-border,var(--color-accent-ui)) bg-base-accent-soft',\n 'data-checked:border-(--spark-style-border,var(--color-primary)) data-checked:bg-(--spark-style-bg,var(--color-primary))',\n 'data-indeterminate:border-(--spark-style-border,var(--color-primary)) data-indeterminate:bg-(--spark-style-bg,var(--color-primary))',\n className,\n )}\n ref={ref}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"group inline-flex items-center justify-center text-(--spark-style-fg,var(--spark-on-solid))\">\n {/* custom-drawn glyphs; group-data toggles which one the mounted indicator shows */}\n <svg\n aria-hidden=\"true\"\n className=\"hidden size-5 group-data-checked:block\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <path\n className=\"animate-check-draw [stroke-dasharray:1] motion-reduce:animate-none\"\n d=\"M5.5 12.5 L10 17 L18.5 7.5\"\n pathLength={1}\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2.5}\n />\n </svg>\n <span className=\"hidden h-0.5 w-3 origin-center animate-dash-pop rounded-full bg-current group-data-indeterminate:block motion-reduce:animate-none\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n },\n)\n\nCheckbox.displayName = 'Checkbox'\n\nexport { Checkbox }\nexport type { CheckboxProps }\n"],"mappings":";;;;;;;AAuBA,MAAM,WAAWA,QAAM,YAKnB,EACE,WACA,MAAM,OACN,UAAU,WACV,cACA,OACA,QACA,cACA,GAAG,SAEL,QACG;CAEH,MAAM,YADU,iBAAiB,KAAA,KAAa,UAAU,KAAA,IAC3B,gBAAgB,UAAW,KAAA;CACxD,MAAM,kBAAkB,QAAQ,cAAc,SAAS,KAAA;CAEvD,OACE,oBAACC,WAAkB,MAAnB;EACE,cAAY;EACZ,qBAAmB;EAGnB,cAAc,gBAAgB,WAAW,KAAA;EACzC,QAAQ,UAAU,oBAAC,UAAD,CAAS,CAAA;EAC3B,WAAW,GAGT,0OAGA,qIACA,8CACA,iFACA,6DACA,iFACA,2HACA,uIACA,SACF;EACK;EACL,GAAI;YAEJ,qBAACA,WAAkB,WAAnB;GAA6B,WAAU;aAAvC,CAEE,oBAAC,OAAD;IACE,eAAY;IACZ,WAAU;IACV,MAAK;IACL,SAAQ;cAER,oBAAC,QAAD;KACE,WAAU;KACV,GAAE;KACF,YAAY;KACZ,QAAO;KACP,eAAc;KACd,gBAAe;KACf,aAAa;IACd,CAAA;GACE,CAAA,GACL,oBAAC,QAAD,EAAM,WAAU,oIAAqI,CAAA,CAC1H;;CACP,CAAA;AAE5B,CACF;AAEA,SAAS,cAAc"}
@@ -4,7 +4,7 @@ const require_chunk = require("../chunk-DY84GLCh.cjs");
4
4
  let react = require("react");
5
5
  react = require_chunk.__toESM(react);
6
6
  let react_jsx_runtime = require("react/jsx-runtime");
7
- let cn = require("cn");
7
+ let cnfast = require("cnfast");
8
8
  //#region src/components/circular-gauge.tsx
9
9
  const TRACK_TONE_CLASSES = {
10
10
  success: "stroke-success-soft",
@@ -27,7 +27,7 @@ const CircularGauge = ({ className, value, max = 100, tone = "accent", size = 44
27
27
  const offset = circumference * (1 - clamped / max);
28
28
  const percent = Math.round(clamped / max * 100);
29
29
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
30
- className: (0, cn.cn)("relative inline-flex shrink-0", className),
30
+ className: (0, cnfast.cn)("relative inline-flex shrink-0", className),
31
31
  style: {
32
32
  width: size,
33
33
  height: size
@@ -60,7 +60,7 @@ const CircularGauge = ({ className, value, max = 100, tone = "accent", size = 44
60
60
  strokeLinecap: "round",
61
61
  strokeDasharray: circumference,
62
62
  strokeDashoffset: offset,
63
- className: (0, cn.cn)("transition-[stroke-dashoffset] duration-300 motion-reduce:transition-none", INDICATOR_TONE_CLASSES[tone])
63
+ className: (0, cnfast.cn)("transition-[stroke-dashoffset] duration-300", INDICATOR_TONE_CLASSES[tone])
64
64
  })]
65
65
  }), children !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
66
66
  className: "absolute inset-0 flex items-center justify-center text-[11px] leading-none font-semibold tabular-nums",
@@ -1 +1 @@
1
- {"version":3,"file":"circular-gauge.cjs","names":[],"sources":["../../src/components/circular-gauge.tsx"],"sourcesContent":["import * as React from 'react'\nimport type { Tone } from '../lib/tones'\nimport { cn } from '../utils/cn'\n\nconst TRACK_TONE_CLASSES: Record<Tone, string> = {\n success: 'stroke-success-soft',\n warning: 'stroke-warning-soft',\n error: 'stroke-error-soft',\n accent: 'stroke-primary-soft',\n neutral: 'stroke-base-gray-soft',\n}\n\nconst INDICATOR_TONE_CLASSES: Record<Tone, string> = {\n // solid ramp, not `-active`: keeps the ring in step with EntityCardState's dot\n success: 'stroke-base-success-solid',\n warning: 'stroke-base-warning-solid',\n error: 'stroke-base-error-solid',\n accent: 'stroke-primary',\n neutral: 'stroke-gray',\n}\n\n/**\n * Consumers should pass an `aria-label` to name the metric the gauge represents\n * (e.g. \"Battery\"); `aria-valuetext` defaults to the value as a percentage.\n */\nexport interface CircularGaugeProps extends Omit<\n React.ComponentProps<'div'>,\n 'children'\n> {\n /** Current value (0–max). */\n value: number\n /** Maximum value. Default: 100 */\n max?: number\n /** Tone color for the indicator/track pair. Default: \"accent\" */\n tone?: Tone\n /** Diameter in pixels. Default: 44 */\n size?: number\n /** Stroke thickness in pixels. Default: 4 */\n strokeWidth?: number\n /** Optional content rendered centered inside the gauge (e.g. percentage, icon). */\n children?: React.ReactNode\n}\n\nconst CircularGauge = ({\n className,\n value,\n max = 100,\n tone = 'accent',\n size = 44,\n strokeWidth = 4,\n children,\n ...rest\n}: CircularGaugeProps) => {\n const clamped = Math.min(Math.max(value, 0), max)\n const radius = (size - strokeWidth) / 2\n const circumference = 2 * Math.PI * radius\n const offset = circumference * (1 - clamped / max)\n const percent = Math.round((clamped / max) * 100)\n\n return (\n <div\n className={cn('relative inline-flex shrink-0', className)}\n style={{ width: size, height: size }}\n role=\"meter\"\n aria-valuemin={0}\n aria-valuemax={max}\n aria-valuenow={value}\n aria-valuetext={`${percent}%`}\n {...rest}\n >\n <svg\n className=\"size-full -rotate-90\"\n width={size}\n height={size}\n viewBox={`0 0 ${size} ${size}`}\n aria-hidden=\"true\"\n >\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n fill=\"none\"\n strokeWidth={strokeWidth}\n className={TRACK_TONE_CLASSES[tone]}\n />\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n fill=\"none\"\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={offset}\n className={cn(\n 'transition-[stroke-dashoffset] duration-300 motion-reduce:transition-none',\n INDICATOR_TONE_CLASSES[tone],\n )}\n />\n </svg>\n {children !== undefined && (\n <span className=\"absolute inset-0 flex items-center justify-center text-[11px] leading-none font-semibold tabular-nums\">\n {children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AAa,KAAA,KACZ,iBAAA,GAAA,kBAAA,KAAC,QAAD;GAAM,WAAU;GACb;EACG,CAAA,CAEL;;AAET"}
1
+ {"version":3,"file":"circular-gauge.cjs","names":[],"sources":["../../src/components/circular-gauge.tsx"],"sourcesContent":["import * as React from 'react'\nimport type { Tone } from '../lib/tones'\nimport { cn } from '../utils/cn'\n\nconst TRACK_TONE_CLASSES: Record<Tone, string> = {\n success: 'stroke-success-soft',\n warning: 'stroke-warning-soft',\n error: 'stroke-error-soft',\n accent: 'stroke-primary-soft',\n neutral: 'stroke-base-gray-soft',\n}\n\nconst INDICATOR_TONE_CLASSES: Record<Tone, string> = {\n // solid ramp, not `-active`: keeps the ring in step with EntityCardState's dot\n success: 'stroke-base-success-solid',\n warning: 'stroke-base-warning-solid',\n error: 'stroke-base-error-solid',\n accent: 'stroke-primary',\n neutral: 'stroke-gray',\n}\n\n/**\n * Consumers should pass an `aria-label` to name the metric the gauge represents\n * (e.g. \"Battery\"); `aria-valuetext` defaults to the value as a percentage.\n */\nexport interface CircularGaugeProps extends Omit<\n React.ComponentProps<'div'>,\n 'children'\n> {\n /** Current value (0–max). */\n value: number\n /** Maximum value. Default: 100 */\n max?: number\n /** Tone color for the indicator/track pair. Default: \"accent\" */\n tone?: Tone\n /** Diameter in pixels. Default: 44 */\n size?: number\n /** Stroke thickness in pixels. Default: 4 */\n strokeWidth?: number\n /** Optional content rendered centered inside the gauge (e.g. percentage, icon). */\n children?: React.ReactNode\n}\n\nconst CircularGauge = ({\n className,\n value,\n max = 100,\n tone = 'accent',\n size = 44,\n strokeWidth = 4,\n children,\n ...rest\n}: CircularGaugeProps) => {\n const clamped = Math.min(Math.max(value, 0), max)\n const radius = (size - strokeWidth) / 2\n const circumference = 2 * Math.PI * radius\n const offset = circumference * (1 - clamped / max)\n const percent = Math.round((clamped / max) * 100)\n\n return (\n <div\n className={cn('relative inline-flex shrink-0', className)}\n style={{ width: size, height: size }}\n role=\"meter\"\n aria-valuemin={0}\n aria-valuemax={max}\n aria-valuenow={value}\n aria-valuetext={`${percent}%`}\n {...rest}\n >\n <svg\n className=\"size-full -rotate-90\"\n width={size}\n height={size}\n viewBox={`0 0 ${size} ${size}`}\n aria-hidden=\"true\"\n >\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n fill=\"none\"\n strokeWidth={strokeWidth}\n className={TRACK_TONE_CLASSES[tone]}\n />\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n fill=\"none\"\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={offset}\n className={cn(\n 'transition-[stroke-dashoffset] duration-300',\n INDICATOR_TONE_CLASSES[tone],\n )}\n />\n </svg>\n {children !== undefined && (\n <span className=\"absolute inset-0 flex items-center justify-center text-[11px] leading-none font-semibold tabular-nums\">\n {children}\n </span>\n )}\n </div>\n )\n}\n\nexport { CircularGauge }\n"],"mappings":";;;;;;;;AAIA,MAAM,qBAA2C;CAC/C,SAAS;CACT,SAAS;CACT,OAAO;CACP,QAAQ;CACR,SAAS;AACX;AAEA,MAAM,yBAA+C;CAEnD,SAAS;CACT,SAAS;CACT,OAAO;CACP,QAAQ;CACR,SAAS;AACX;AAwBA,MAAM,iBAAiB,EACrB,WACA,OACA,MAAM,KACN,OAAO,UACP,OAAO,IACP,cAAc,GACd,UACA,GAAG,WACqB;CACxB,MAAM,UAAU,KAAK,IAAI,KAAK,IAAI,OAAO,CAAC,GAAG,GAAG;CAChD,MAAM,UAAU,OAAO,eAAe;CACtC,MAAM,gBAAgB,IAAI,KAAK,KAAK;CACpC,MAAM,SAAS,iBAAiB,IAAI,UAAU;CAC9C,MAAM,UAAU,KAAK,MAAO,UAAU,MAAO,GAAG;CAEhD,OACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EACE,YAAA,GAAA,OAAA,IAAc,iCAAiC,SAAS;EACxD,OAAO;GAAE,OAAO;GAAM,QAAQ;EAAK;EACnC,MAAK;EACL,iBAAe;EACf,iBAAe;EACf,iBAAe;EACf,kBAAgB,GAAG,QAAQ;EAC3B,GAAI;YARN,CAUE,iBAAA,GAAA,kBAAA,MAAC,OAAD;GACE,WAAU;GACV,OAAO;GACP,QAAQ;GACR,SAAS,OAAO,KAAK,GAAG;GACxB,eAAY;aALd,CAOE,iBAAA,GAAA,kBAAA,KAAC,UAAD;IACE,IAAI,OAAO;IACX,IAAI,OAAO;IACX,GAAG;IACH,MAAK;IACQ;IACb,WAAW,mBAAmB;GAC/B,CAAA,GACD,iBAAA,GAAA,kBAAA,KAAC,UAAD;IACE,IAAI,OAAO;IACX,IAAI,OAAO;IACX,GAAG;IACH,MAAK;IACQ;IACb,eAAc;IACd,iBAAiB;IACjB,kBAAkB;IAClB,YAAA,GAAA,OAAA,IACE,+CACA,uBAAuB,KACzB;GACD,CAAA,CACE;MACJ,aAAa,KAAA,KACZ,iBAAA,GAAA,kBAAA,KAAC,QAAD;GAAM,WAAU;GACb;EACG,CAAA,CAEL;;AAET"}
@@ -57,7 +57,7 @@ const CircularGauge = ({ className, value, max = 100, tone = "accent", size = 44
57
57
  strokeLinecap: "round",
58
58
  strokeDasharray: circumference,
59
59
  strokeDashoffset: offset,
60
- className: cn("transition-[stroke-dashoffset] duration-300 motion-reduce:transition-none", INDICATOR_TONE_CLASSES[tone])
60
+ className: cn("transition-[stroke-dashoffset] duration-300", INDICATOR_TONE_CLASSES[tone])
61
61
  })]
62
62
  }), children !== void 0 && /* @__PURE__ */ jsx("span", {
63
63
  className: "absolute inset-0 flex items-center justify-center text-[11px] leading-none font-semibold tabular-nums",
@@ -1 +1 @@
1
- {"version":3,"file":"circular-gauge.js","names":[],"sources":["../../src/components/circular-gauge.tsx"],"sourcesContent":["import * as React from 'react'\nimport type { Tone } from '../lib/tones'\nimport { cn } from '../utils/cn'\n\nconst TRACK_TONE_CLASSES: Record<Tone, string> = {\n success: 'stroke-success-soft',\n warning: 'stroke-warning-soft',\n error: 'stroke-error-soft',\n accent: 'stroke-primary-soft',\n neutral: 'stroke-base-gray-soft',\n}\n\nconst INDICATOR_TONE_CLASSES: Record<Tone, string> = {\n // solid ramp, not `-active`: keeps the ring in step with EntityCardState's dot\n success: 'stroke-base-success-solid',\n warning: 'stroke-base-warning-solid',\n error: 'stroke-base-error-solid',\n accent: 'stroke-primary',\n neutral: 'stroke-gray',\n}\n\n/**\n * Consumers should pass an `aria-label` to name the metric the gauge represents\n * (e.g. \"Battery\"); `aria-valuetext` defaults to the value as a percentage.\n */\nexport interface CircularGaugeProps extends Omit<\n React.ComponentProps<'div'>,\n 'children'\n> {\n /** Current value (0–max). */\n value: number\n /** Maximum value. Default: 100 */\n max?: number\n /** Tone color for the indicator/track pair. Default: \"accent\" */\n tone?: Tone\n /** Diameter in pixels. Default: 44 */\n size?: number\n /** Stroke thickness in pixels. Default: 4 */\n strokeWidth?: number\n /** Optional content rendered centered inside the gauge (e.g. percentage, icon). */\n children?: React.ReactNode\n}\n\nconst CircularGauge = ({\n className,\n value,\n max = 100,\n tone = 'accent',\n size = 44,\n strokeWidth = 4,\n children,\n ...rest\n}: CircularGaugeProps) => {\n const clamped = Math.min(Math.max(value, 0), max)\n const radius = (size - strokeWidth) / 2\n const circumference = 2 * Math.PI * radius\n const offset = circumference * (1 - clamped / max)\n const percent = Math.round((clamped / max) * 100)\n\n return (\n <div\n className={cn('relative inline-flex shrink-0', className)}\n style={{ width: size, height: size }}\n role=\"meter\"\n aria-valuemin={0}\n aria-valuemax={max}\n aria-valuenow={value}\n aria-valuetext={`${percent}%`}\n {...rest}\n >\n <svg\n className=\"size-full -rotate-90\"\n width={size}\n height={size}\n viewBox={`0 0 ${size} ${size}`}\n aria-hidden=\"true\"\n >\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n fill=\"none\"\n strokeWidth={strokeWidth}\n className={TRACK_TONE_CLASSES[tone]}\n />\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n fill=\"none\"\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={offset}\n className={cn(\n 'transition-[stroke-dashoffset] duration-300 motion-reduce:transition-none',\n INDICATOR_TONE_CLASSES[tone],\n )}\n />\n </svg>\n {children !== undefined && (\n <span className=\"absolute inset-0 flex items-center justify-center text-[11px] leading-none font-semibold tabular-nums\">\n {children}\n </span>\n )}\n </div>\n )\n}\n\nexport { CircularGauge }\n"],"mappings":";;;;;AAIA,MAAM,qBAA2C;CAC/C,SAAS;CACT,SAAS;CACT,OAAO;CACP,QAAQ;CACR,SAAS;AACX;AAEA,MAAM,yBAA+C;CAEnD,SAAS;CACT,SAAS;CACT,OAAO;CACP,QAAQ;CACR,SAAS;AACX;AAwBA,MAAM,iBAAiB,EACrB,WACA,OACA,MAAM,KACN,OAAO,UACP,OAAO,IACP,cAAc,GACd,UACA,GAAG,WACqB;CACxB,MAAM,UAAU,KAAK,IAAI,KAAK,IAAI,OAAO,CAAC,GAAG,GAAG;CAChD,MAAM,UAAU,OAAO,eAAe;CACtC,MAAM,gBAAgB,IAAI,KAAK,KAAK;CACpC,MAAM,SAAS,iBAAiB,IAAI,UAAU;CAC9C,MAAM,UAAU,KAAK,MAAO,UAAU,MAAO,GAAG;CAEhD,OACE,qBAAC,OAAD;EACE,WAAW,GAAG,iCAAiC,SAAS;EACxD,OAAO;GAAE,OAAO;GAAM,QAAQ;EAAK;EACnC,MAAK;EACL,iBAAe;EACf,iBAAe;EACf,iBAAe;EACf,kBAAgB,GAAG,QAAQ;EAC3B,GAAI;YARN,CAUE,qBAAC,OAAD;GACE,WAAU;GACV,OAAO;GACP,QAAQ;GACR,SAAS,OAAO,KAAK,GAAG;GACxB,eAAY;aALd,CAOE,oBAAC,UAAD;IACE,IAAI,OAAO;IACX,IAAI,OAAO;IACX,GAAG;IACH,MAAK;IACQ;IACb,WAAW,mBAAmB;GAC/B,CAAA,GACD,oBAAC,UAAD;IACE,IAAI,OAAO;IACX,IAAI,OAAO;IACX,GAAG;IACH,MAAK;IACQ;IACb,eAAc;IACd,iBAAiB;IACjB,kBAAkB;IAClB,WAAW,GACT,6EACA,uBAAuB,KACzB;GACD,CAAA,CACE;MACJ,aAAa,KAAA,KACZ,oBAAC,QAAD;GAAM,WAAU;GACb;EACG,CAAA,CAEL;;AAET"}
1
+ {"version":3,"file":"circular-gauge.js","names":[],"sources":["../../src/components/circular-gauge.tsx"],"sourcesContent":["import * as React from 'react'\nimport type { Tone } from '../lib/tones'\nimport { cn } from '../utils/cn'\n\nconst TRACK_TONE_CLASSES: Record<Tone, string> = {\n success: 'stroke-success-soft',\n warning: 'stroke-warning-soft',\n error: 'stroke-error-soft',\n accent: 'stroke-primary-soft',\n neutral: 'stroke-base-gray-soft',\n}\n\nconst INDICATOR_TONE_CLASSES: Record<Tone, string> = {\n // solid ramp, not `-active`: keeps the ring in step with EntityCardState's dot\n success: 'stroke-base-success-solid',\n warning: 'stroke-base-warning-solid',\n error: 'stroke-base-error-solid',\n accent: 'stroke-primary',\n neutral: 'stroke-gray',\n}\n\n/**\n * Consumers should pass an `aria-label` to name the metric the gauge represents\n * (e.g. \"Battery\"); `aria-valuetext` defaults to the value as a percentage.\n */\nexport interface CircularGaugeProps extends Omit<\n React.ComponentProps<'div'>,\n 'children'\n> {\n /** Current value (0–max). */\n value: number\n /** Maximum value. Default: 100 */\n max?: number\n /** Tone color for the indicator/track pair. Default: \"accent\" */\n tone?: Tone\n /** Diameter in pixels. Default: 44 */\n size?: number\n /** Stroke thickness in pixels. Default: 4 */\n strokeWidth?: number\n /** Optional content rendered centered inside the gauge (e.g. percentage, icon). */\n children?: React.ReactNode\n}\n\nconst CircularGauge = ({\n className,\n value,\n max = 100,\n tone = 'accent',\n size = 44,\n strokeWidth = 4,\n children,\n ...rest\n}: CircularGaugeProps) => {\n const clamped = Math.min(Math.max(value, 0), max)\n const radius = (size - strokeWidth) / 2\n const circumference = 2 * Math.PI * radius\n const offset = circumference * (1 - clamped / max)\n const percent = Math.round((clamped / max) * 100)\n\n return (\n <div\n className={cn('relative inline-flex shrink-0', className)}\n style={{ width: size, height: size }}\n role=\"meter\"\n aria-valuemin={0}\n aria-valuemax={max}\n aria-valuenow={value}\n aria-valuetext={`${percent}%`}\n {...rest}\n >\n <svg\n className=\"size-full -rotate-90\"\n width={size}\n height={size}\n viewBox={`0 0 ${size} ${size}`}\n aria-hidden=\"true\"\n >\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n fill=\"none\"\n strokeWidth={strokeWidth}\n className={TRACK_TONE_CLASSES[tone]}\n />\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n fill=\"none\"\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={offset}\n className={cn(\n 'transition-[stroke-dashoffset] duration-300',\n INDICATOR_TONE_CLASSES[tone],\n )}\n />\n </svg>\n {children !== undefined && (\n <span className=\"absolute inset-0 flex items-center justify-center text-[11px] leading-none font-semibold tabular-nums\">\n {children}\n </span>\n )}\n </div>\n )\n}\n\nexport { CircularGauge }\n"],"mappings":";;;;;AAIA,MAAM,qBAA2C;CAC/C,SAAS;CACT,SAAS;CACT,OAAO;CACP,QAAQ;CACR,SAAS;AACX;AAEA,MAAM,yBAA+C;CAEnD,SAAS;CACT,SAAS;CACT,OAAO;CACP,QAAQ;CACR,SAAS;AACX;AAwBA,MAAM,iBAAiB,EACrB,WACA,OACA,MAAM,KACN,OAAO,UACP,OAAO,IACP,cAAc,GACd,UACA,GAAG,WACqB;CACxB,MAAM,UAAU,KAAK,IAAI,KAAK,IAAI,OAAO,CAAC,GAAG,GAAG;CAChD,MAAM,UAAU,OAAO,eAAe;CACtC,MAAM,gBAAgB,IAAI,KAAK,KAAK;CACpC,MAAM,SAAS,iBAAiB,IAAI,UAAU;CAC9C,MAAM,UAAU,KAAK,MAAO,UAAU,MAAO,GAAG;CAEhD,OACE,qBAAC,OAAD;EACE,WAAW,GAAG,iCAAiC,SAAS;EACxD,OAAO;GAAE,OAAO;GAAM,QAAQ;EAAK;EACnC,MAAK;EACL,iBAAe;EACf,iBAAe;EACf,iBAAe;EACf,kBAAgB,GAAG,QAAQ;EAC3B,GAAI;YARN,CAUE,qBAAC,OAAD;GACE,WAAU;GACV,OAAO;GACP,QAAQ;GACR,SAAS,OAAO,KAAK,GAAG;GACxB,eAAY;aALd,CAOE,oBAAC,UAAD;IACE,IAAI,OAAO;IACX,IAAI,OAAO;IACX,GAAG;IACH,MAAK;IACQ;IACb,WAAW,mBAAmB;GAC/B,CAAA,GACD,oBAAC,UAAD;IACE,IAAI,OAAO;IACX,IAAI,OAAO;IACX,GAAG;IACH,MAAK;IACQ;IACb,eAAc;IACd,iBAAiB;IACjB,kBAAkB;IAClB,WAAW,GACT,+CACA,uBAAuB,KACzB;GACD,CAAA,CACE;MACJ,aAAa,KAAA,KACZ,oBAAC,QAAD;GAAM,WAAU;GACb;EACG,CAAA,CAEL;;AAET"}
@@ -4,7 +4,7 @@ const require_chunk = require("../chunk-DY84GLCh.cjs");
4
4
  let react = require("react");
5
5
  react = require_chunk.__toESM(react);
6
6
  let react_jsx_runtime = require("react/jsx-runtime");
7
- let cn = require("cn");
7
+ let cnfast = require("cnfast");
8
8
  //#region src/components/day-of-week-picker.tsx
9
9
  const WEEK_DAYS = [
10
10
  "monday",
@@ -39,7 +39,7 @@ const DayOfWeekPicker = react.forwardRef(function DayOfWeekPicker(props, ref) {
39
39
  };
40
40
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
41
41
  ref,
42
- className: (0, cn.cn)("flex flex-col gap-2", className),
42
+ className: (0, cnfast.cn)("flex flex-col gap-2", className),
43
43
  children: [showPresets && props.showPresets ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
44
44
  role: "group",
45
45
  "aria-label": props.presetsAriaLabel,
@@ -78,7 +78,7 @@ const DayOfWeekPicker = react.forwardRef(function DayOfWeekPicker(props, ref) {
78
78
  "aria-label": dayAriaLabels?.[day] ?? label,
79
79
  disabled,
80
80
  onClick: () => toggle(day),
81
- className: (0, cn.cn)("touch-target inline-flex h-9 flex-1 items-center justify-center rounded-full text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none", checked ? "bg-base-accent-solid text-accent-contrast hover:bg-spark-9" : "bg-base-gray-soft text-gray-light hover:bg-gray-a4"),
81
+ className: (0, cnfast.cn)("touch-target inline-flex h-9 flex-1 items-center justify-center rounded-full text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none", checked ? "bg-base-accent-solid text-accent-contrast hover:bg-spark-9" : "bg-base-gray-soft text-gray-light hover:bg-gray-a4"),
82
82
  children: label
83
83
  }, day);
84
84
  })
@@ -92,7 +92,7 @@ function PresetButton({ active, children, disabled, onClick }) {
92
92
  onClick,
93
93
  disabled,
94
94
  "aria-pressed": active,
95
- className: (0, cn.cn)("touch-target inline-flex h-7 items-center justify-center rounded-full px-3 text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none", active ? "bg-base-accent-soft text-accent" : "bg-transparent text-gray-light hover:bg-gray-a3"),
95
+ className: (0, cnfast.cn)("touch-target inline-flex h-7 items-center justify-center rounded-full px-3 text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none", active ? "bg-base-accent-soft text-accent" : "bg-transparent text-gray-light hover:bg-gray-a3"),
96
96
  children
97
97
  });
98
98
  }
@@ -1 +1 @@
1
- {"version":3,"file":"day-of-week-picker.cjs","names":["React"],"sources":["../../src/components/day-of-week-picker.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cn } from '../utils/cn'\n\nexport type WeekDay =\n | 'monday'\n | 'tuesday'\n | 'wednesday'\n | 'thursday'\n | 'friday'\n | 'saturday'\n | 'sunday'\n\nexport const WEEK_DAYS: readonly WeekDay[] = [\n 'monday',\n 'tuesday',\n 'wednesday',\n 'thursday',\n 'friday',\n 'saturday',\n 'sunday',\n] as const\n\nconst WEEKDAYS_ONLY: WeekDay[] = [\n 'monday',\n 'tuesday',\n 'wednesday',\n 'thursday',\n 'friday',\n]\nconst WEEKEND_ONLY: WeekDay[] = ['saturday', 'sunday']\nconst ALL_DAYS: WeekDay[] = [...WEEK_DAYS]\n\ntype DayOfWeekPickerBaseProps = {\n value: WeekDay[]\n onValueChange: (next: WeekDay[]) => void\n disabled?: boolean\n className?: string\n dayLabels: Record<WeekDay, string>\n dayAriaLabels?: Partial<Record<WeekDay, string>>\n daysAriaLabel: string\n}\n\ntype DayOfWeekPickerWithPresets = DayOfWeekPickerBaseProps & {\n showPresets: true\n presetLabels: {\n weekdays: React.ReactNode\n weekend: React.ReactNode\n everyDay: React.ReactNode\n }\n presetsAriaLabel: string\n}\n\ntype DayOfWeekPickerWithoutPresets = DayOfWeekPickerBaseProps & {\n showPresets?: false\n presetLabels?: never\n presetsAriaLabel?: never\n}\n\ntype DayOfWeekPickerProps =\n | DayOfWeekPickerWithPresets\n | DayOfWeekPickerWithoutPresets\n\nconst DayOfWeekPicker = React.forwardRef<HTMLDivElement, DayOfWeekPickerProps>(\n function DayOfWeekPicker(props, ref) {\n const {\n className,\n disabled,\n onValueChange,\n showPresets = false,\n value,\n dayLabels,\n dayAriaLabels,\n daysAriaLabel,\n } = props\n\n const selected = React.useMemo(() => new Set(value), [value])\n\n const toggle = (day: WeekDay) => {\n const next = new Set(selected)\n if (next.has(day)) {\n next.delete(day)\n } else {\n next.add(day)\n }\n onValueChange(ALL_DAYS.filter((d) => next.has(d)))\n }\n\n const matches = (preset: WeekDay[]) =>\n selected.size === preset.length && preset.every((d) => selected.has(d))\n\n const setPreset = (preset: WeekDay[]) => {\n onValueChange(preset)\n }\n\n return (\n <div ref={ref} className={cn('flex flex-col gap-2', className)}>\n {showPresets && props.showPresets ? (\n <div\n role=\"group\"\n aria-label={props.presetsAriaLabel}\n className=\"flex flex-wrap gap-1.5\"\n >\n <PresetButton\n active={matches(WEEKDAYS_ONLY)}\n disabled={disabled}\n onClick={() => setPreset(WEEKDAYS_ONLY)}\n >\n {props.presetLabels.weekdays}\n </PresetButton>\n <PresetButton\n active={matches(WEEKEND_ONLY)}\n disabled={disabled}\n onClick={() => setPreset(WEEKEND_ONLY)}\n >\n {props.presetLabels.weekend}\n </PresetButton>\n <PresetButton\n active={matches(ALL_DAYS)}\n disabled={disabled}\n onClick={() => setPreset(ALL_DAYS)}\n >\n {props.presetLabels.everyDay}\n </PresetButton>\n </div>\n ) : null}\n <div role=\"group\" aria-label={daysAriaLabel} className=\"flex gap-1\">\n {WEEK_DAYS.map((day) => {\n const checked = selected.has(day)\n const label = dayLabels[day]\n const ariaLabel = dayAriaLabels?.[day] ?? label\n return (\n <button\n key={day}\n type=\"button\"\n role=\"checkbox\"\n aria-checked={checked}\n aria-label={ariaLabel}\n disabled={disabled}\n onClick={() => toggle(day)}\n className={cn(\n 'touch-target inline-flex h-9 flex-1 items-center justify-center rounded-full text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none',\n checked\n ? 'bg-base-accent-solid text-accent-contrast hover:bg-spark-9'\n : 'bg-base-gray-soft text-gray-light hover:bg-gray-a4',\n )}\n >\n {label}\n </button>\n )\n })}\n </div>\n </div>\n )\n },\n)\n\nDayOfWeekPicker.displayName = 'DayOfWeekPicker'\n\ninterface PresetButtonProps {\n active: boolean\n disabled?: boolean\n onClick: () => void\n children: React.ReactNode\n}\n\nfunction PresetButton({\n active,\n children,\n disabled,\n onClick,\n}: PresetButtonProps) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n aria-pressed={active}\n className={cn(\n 'touch-target inline-flex h-7 items-center justify-center rounded-full px-3 text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none',\n active\n ? 'bg-base-accent-soft text-accent'\n : 'bg-transparent text-gray-light hover:bg-gray-a3',\n )}\n >\n {children}\n </button>\n )\n}\n\nexport { DayOfWeekPicker }\n"],"mappings":";;;;;;;;AAYA,MAAa,YAAgC;CAC3C;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,gBAA2B;CAC/B;CACA;CACA;CACA;CACA;AACF;AACA,MAAM,eAA0B,CAAC,YAAY,QAAQ;AACrD,MAAM,WAAsB,CAAC,GAAG,SAAS;AAgCzC,MAAM,kBAAkBA,MAAM,WAC5B,SAAS,gBAAgB,OAAO,KAAK;CACnC,MAAM,EACJ,WACA,UACA,eACA,cAAc,OACd,OACA,WACA,eACA,kBACE;CAEJ,MAAM,WAAWA,MAAM,cAAc,IAAI,IAAI,KAAK,GAAG,CAAC,KAAK,CAAC;CAE5D,MAAM,UAAU,QAAiB;EAC/B,MAAM,OAAO,IAAI,IAAI,QAAQ;EAC7B,IAAI,KAAK,IAAI,GAAG,GACd,KAAK,OAAO,GAAG;OAEf,KAAK,IAAI,GAAG;EAEd,cAAc,SAAS,QAAQ,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC;CACnD;CAEA,MAAM,WAAW,WACf,SAAS,SAAS,OAAO,UAAU,OAAO,OAAO,MAAM,SAAS,IAAI,CAAC,CAAC;CAExE,MAAM,aAAa,WAAsB;EACvC,cAAc,MAAM;CACtB;CAEA,OACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EAAU;EAAK,YAAA,GAAA,GAAA,IAAc,uBAAuB,SAAS;YAA7D,CACG,eAAe,MAAM,cACpB,iBAAA,GAAA,kBAAA,MAAC,OAAD;GACE,MAAK;GACL,cAAY,MAAM;GAClB,WAAU;aAHZ;IAKE,iBAAA,GAAA,kBAAA,KAAC,cAAD;KACE,QAAQ,QAAQ,aAAa;KACnB;KACV,eAAe,UAAU,aAAa;eAErC,MAAM,aAAa;IACR,CAAA;IACd,iBAAA,GAAA,kBAAA,KAAC,cAAD;KACE,QAAQ,QAAQ,YAAY;KAClB;KACV,eAAe,UAAU,YAAY;eAEpC,MAAM,aAAa;IACR,CAAA;IACd,iBAAA,GAAA,kBAAA,KAAC,cAAD;KACE,QAAQ,QAAQ,QAAQ;KACd;KACV,eAAe,UAAU,QAAQ;eAEhC,MAAM,aAAa;IACR,CAAA;GACX;OACH,MACJ,iBAAA,GAAA,kBAAA,KAAC,OAAD;GAAK,MAAK;GAAQ,cAAY;GAAe,WAAU;aACpD,UAAU,KAAK,QAAQ;IACtB,MAAM,UAAU,SAAS,IAAI,GAAG;IAChC,MAAM,QAAQ,UAAU;IAExB,OACE,iBAAA,GAAA,kBAAA,KAAC,UAAD;KAEE,MAAK;KACL,MAAK;KACL,gBAAc;KACd,cAPc,gBAAgB,QAAQ;KAQ5B;KACV,eAAe,OAAO,GAAG;KACzB,YAAA,GAAA,GAAA,IACE,kRACA,UACI,+DACA,oDACN;eAEC;IACK,GAfD,GAeC;GAEZ,CAAC;EACE,CAAA,CACF;;AAET,CACF;AAEA,gBAAgB,cAAc;AAS9B,SAAS,aAAa,EACpB,QACA,UACA,UACA,WACoB;CACpB,OACE,iBAAA,GAAA,kBAAA,KAAC,UAAD;EACE,MAAK;EACI;EACC;EACV,gBAAc;EACd,YAAA,GAAA,GAAA,IACE,gRACA,SACI,oCACA,iDACN;EAEC;CACK,CAAA;AAEZ"}
1
+ {"version":3,"file":"day-of-week-picker.cjs","names":["React"],"sources":["../../src/components/day-of-week-picker.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cn } from '../utils/cn'\n\nexport type WeekDay =\n | 'monday'\n | 'tuesday'\n | 'wednesday'\n | 'thursday'\n | 'friday'\n | 'saturday'\n | 'sunday'\n\nexport const WEEK_DAYS: readonly WeekDay[] = [\n 'monday',\n 'tuesday',\n 'wednesday',\n 'thursday',\n 'friday',\n 'saturday',\n 'sunday',\n] as const\n\nconst WEEKDAYS_ONLY: WeekDay[] = [\n 'monday',\n 'tuesday',\n 'wednesday',\n 'thursday',\n 'friday',\n]\nconst WEEKEND_ONLY: WeekDay[] = ['saturday', 'sunday']\nconst ALL_DAYS: WeekDay[] = [...WEEK_DAYS]\n\ntype DayOfWeekPickerBaseProps = {\n value: WeekDay[]\n onValueChange: (next: WeekDay[]) => void\n disabled?: boolean\n className?: string\n dayLabels: Record<WeekDay, string>\n dayAriaLabels?: Partial<Record<WeekDay, string>>\n daysAriaLabel: string\n}\n\ntype DayOfWeekPickerWithPresets = DayOfWeekPickerBaseProps & {\n showPresets: true\n presetLabels: {\n weekdays: React.ReactNode\n weekend: React.ReactNode\n everyDay: React.ReactNode\n }\n presetsAriaLabel: string\n}\n\ntype DayOfWeekPickerWithoutPresets = DayOfWeekPickerBaseProps & {\n showPresets?: false\n presetLabels?: never\n presetsAriaLabel?: never\n}\n\ntype DayOfWeekPickerProps =\n | DayOfWeekPickerWithPresets\n | DayOfWeekPickerWithoutPresets\n\nconst DayOfWeekPicker = React.forwardRef<HTMLDivElement, DayOfWeekPickerProps>(\n function DayOfWeekPicker(props, ref) {\n const {\n className,\n disabled,\n onValueChange,\n showPresets = false,\n value,\n dayLabels,\n dayAriaLabels,\n daysAriaLabel,\n } = props\n\n const selected = React.useMemo(() => new Set(value), [value])\n\n const toggle = (day: WeekDay) => {\n const next = new Set(selected)\n if (next.has(day)) {\n next.delete(day)\n } else {\n next.add(day)\n }\n onValueChange(ALL_DAYS.filter((d) => next.has(d)))\n }\n\n const matches = (preset: WeekDay[]) =>\n selected.size === preset.length && preset.every((d) => selected.has(d))\n\n const setPreset = (preset: WeekDay[]) => {\n onValueChange(preset)\n }\n\n return (\n <div ref={ref} className={cn('flex flex-col gap-2', className)}>\n {showPresets && props.showPresets ? (\n <div\n role=\"group\"\n aria-label={props.presetsAriaLabel}\n className=\"flex flex-wrap gap-1.5\"\n >\n <PresetButton\n active={matches(WEEKDAYS_ONLY)}\n disabled={disabled}\n onClick={() => setPreset(WEEKDAYS_ONLY)}\n >\n {props.presetLabels.weekdays}\n </PresetButton>\n <PresetButton\n active={matches(WEEKEND_ONLY)}\n disabled={disabled}\n onClick={() => setPreset(WEEKEND_ONLY)}\n >\n {props.presetLabels.weekend}\n </PresetButton>\n <PresetButton\n active={matches(ALL_DAYS)}\n disabled={disabled}\n onClick={() => setPreset(ALL_DAYS)}\n >\n {props.presetLabels.everyDay}\n </PresetButton>\n </div>\n ) : null}\n <div role=\"group\" aria-label={daysAriaLabel} className=\"flex gap-1\">\n {WEEK_DAYS.map((day) => {\n const checked = selected.has(day)\n const label = dayLabels[day]\n const ariaLabel = dayAriaLabels?.[day] ?? label\n return (\n <button\n key={day}\n type=\"button\"\n role=\"checkbox\"\n aria-checked={checked}\n aria-label={ariaLabel}\n disabled={disabled}\n onClick={() => toggle(day)}\n className={cn(\n 'touch-target inline-flex h-9 flex-1 items-center justify-center rounded-full text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none',\n checked\n ? 'bg-base-accent-solid text-accent-contrast hover:bg-spark-9'\n : 'bg-base-gray-soft text-gray-light hover:bg-gray-a4',\n )}\n >\n {label}\n </button>\n )\n })}\n </div>\n </div>\n )\n },\n)\n\nDayOfWeekPicker.displayName = 'DayOfWeekPicker'\n\ninterface PresetButtonProps {\n active: boolean\n disabled?: boolean\n onClick: () => void\n children: React.ReactNode\n}\n\nfunction PresetButton({\n active,\n children,\n disabled,\n onClick,\n}: PresetButtonProps) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n aria-pressed={active}\n className={cn(\n 'touch-target inline-flex h-7 items-center justify-center rounded-full px-3 text-xs font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none',\n active\n ? 'bg-base-accent-soft text-accent'\n : 'bg-transparent text-gray-light hover:bg-gray-a3',\n )}\n >\n {children}\n </button>\n )\n}\n\nexport { DayOfWeekPicker }\n"],"mappings":";;;;;;;;AAYA,MAAa,YAAgC;CAC3C;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,gBAA2B;CAC/B;CACA;CACA;CACA;CACA;AACF;AACA,MAAM,eAA0B,CAAC,YAAY,QAAQ;AACrD,MAAM,WAAsB,CAAC,GAAG,SAAS;AAgCzC,MAAM,kBAAkBA,MAAM,WAC5B,SAAS,gBAAgB,OAAO,KAAK;CACnC,MAAM,EACJ,WACA,UACA,eACA,cAAc,OACd,OACA,WACA,eACA,kBACE;CAEJ,MAAM,WAAWA,MAAM,cAAc,IAAI,IAAI,KAAK,GAAG,CAAC,KAAK,CAAC;CAE5D,MAAM,UAAU,QAAiB;EAC/B,MAAM,OAAO,IAAI,IAAI,QAAQ;EAC7B,IAAI,KAAK,IAAI,GAAG,GACd,KAAK,OAAO,GAAG;OAEf,KAAK,IAAI,GAAG;EAEd,cAAc,SAAS,QAAQ,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC;CACnD;CAEA,MAAM,WAAW,WACf,SAAS,SAAS,OAAO,UAAU,OAAO,OAAO,MAAM,SAAS,IAAI,CAAC,CAAC;CAExE,MAAM,aAAa,WAAsB;EACvC,cAAc,MAAM;CACtB;CAEA,OACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EAAU;EAAK,YAAA,GAAA,OAAA,IAAc,uBAAuB,SAAS;YAA7D,CACG,eAAe,MAAM,cACpB,iBAAA,GAAA,kBAAA,MAAC,OAAD;GACE,MAAK;GACL,cAAY,MAAM;GAClB,WAAU;aAHZ;IAKE,iBAAA,GAAA,kBAAA,KAAC,cAAD;KACE,QAAQ,QAAQ,aAAa;KACnB;KACV,eAAe,UAAU,aAAa;eAErC,MAAM,aAAa;IACR,CAAA;IACd,iBAAA,GAAA,kBAAA,KAAC,cAAD;KACE,QAA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