@epilot/spark-ui 0.26.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/dist/components/accordion.cjs.map +1 -1
  2. package/dist/components/accordion.d.cts +1 -1
  3. package/dist/components/accordion.d.ts +1 -1
  4. package/dist/components/accordion.js.map +1 -1
  5. package/dist/components/alert-dialog.cjs +2 -2
  6. package/dist/components/alert-dialog.cjs.map +1 -1
  7. package/dist/components/alert-dialog.js +2 -2
  8. package/dist/components/alert-dialog.js.map +1 -1
  9. package/dist/components/attachment.d.cts +1 -1
  10. package/dist/components/attachment.d.ts +1 -1
  11. package/dist/components/avatar.d.cts +1 -1
  12. package/dist/components/avatar.d.ts +1 -1
  13. package/dist/components/badge.cjs +10 -2
  14. package/dist/components/badge.cjs.map +1 -1
  15. package/dist/components/badge.d.cts +2 -1
  16. package/dist/components/badge.d.ts +2 -1
  17. package/dist/components/badge.js +10 -2
  18. package/dist/components/badge.js.map +1 -1
  19. package/dist/components/banner.d.cts +1 -1
  20. package/dist/components/banner.d.ts +1 -1
  21. package/dist/components/box.d.cts +1 -1
  22. package/dist/components/box.d.ts +1 -1
  23. package/dist/components/bubble.cjs +1 -1
  24. package/dist/components/bubble.cjs.map +1 -1
  25. package/dist/components/bubble.d.cts +1 -1
  26. package/dist/components/bubble.d.ts +1 -1
  27. package/dist/components/bubble.js +1 -1
  28. package/dist/components/bubble.js.map +1 -1
  29. package/dist/components/button-group.d.cts +1 -1
  30. package/dist/components/button-group.d.ts +1 -1
  31. package/dist/components/button.cjs +27 -6
  32. package/dist/components/button.cjs.map +1 -1
  33. package/dist/components/button.d.cts +9 -8
  34. package/dist/components/button.d.ts +9 -8
  35. package/dist/components/button.js +27 -6
  36. package/dist/components/button.js.map +1 -1
  37. package/dist/components/callout.cjs +1 -1
  38. package/dist/components/callout.cjs.map +1 -1
  39. package/dist/components/callout.d.cts +1 -1
  40. package/dist/components/callout.d.ts +1 -1
  41. package/dist/components/callout.js +1 -1
  42. package/dist/components/callout.js.map +1 -1
  43. package/dist/components/card.cjs +8 -4
  44. package/dist/components/card.cjs.map +1 -1
  45. package/dist/components/card.d.cts +6 -2
  46. package/dist/components/card.d.ts +6 -2
  47. package/dist/components/card.js +8 -4
  48. package/dist/components/card.js.map +1 -1
  49. package/dist/components/checkbox-group.cjs +31 -0
  50. package/dist/components/checkbox-group.cjs.map +1 -0
  51. package/dist/components/checkbox-group.d.cts +27 -0
  52. package/dist/components/checkbox-group.d.ts +27 -0
  53. package/dist/components/checkbox-group.js +28 -0
  54. package/dist/components/checkbox-group.js.map +1 -0
  55. package/dist/components/checkbox.d.cts +1 -1
  56. package/dist/components/checkbox.d.ts +1 -1
  57. package/dist/components/dialog.cjs +2 -2
  58. package/dist/components/dialog.cjs.map +1 -1
  59. package/dist/components/dialog.js +2 -2
  60. package/dist/components/dialog.js.map +1 -1
  61. package/dist/components/drawer.cjs +1 -1
  62. package/dist/components/drawer.cjs.map +1 -1
  63. package/dist/components/drawer.js +1 -1
  64. package/dist/components/drawer.js.map +1 -1
  65. package/dist/components/empty-state.cjs +3 -13
  66. package/dist/components/empty-state.cjs.map +1 -1
  67. package/dist/components/empty-state.js +3 -13
  68. package/dist/components/empty-state.js.map +1 -1
  69. package/dist/components/energy-breakdown.cjs +1 -1
  70. package/dist/components/energy-breakdown.cjs.map +1 -1
  71. package/dist/components/energy-breakdown.js +1 -1
  72. package/dist/components/energy-breakdown.js.map +1 -1
  73. package/dist/components/entity-card.cjs +1 -1
  74. package/dist/components/entity-card.cjs.map +1 -1
  75. package/dist/components/entity-card.js +1 -1
  76. package/dist/components/entity-card.js.map +1 -1
  77. package/dist/components/field.cjs +113 -18
  78. package/dist/components/field.cjs.map +1 -1
  79. package/dist/components/field.d.cts +16 -3
  80. package/dist/components/field.d.ts +16 -3
  81. package/dist/components/field.js +114 -20
  82. package/dist/components/field.js.map +1 -1
  83. package/dist/components/input-group.cjs +9 -9
  84. package/dist/components/input-group.cjs.map +1 -1
  85. package/dist/components/input-group.d.cts +1 -1
  86. package/dist/components/input-group.d.ts +1 -1
  87. package/dist/components/input-group.js +9 -9
  88. package/dist/components/input-group.js.map +1 -1
  89. package/dist/components/input.d.cts +1 -1
  90. package/dist/components/input.d.ts +1 -1
  91. package/dist/components/list.cjs +21 -5
  92. package/dist/components/list.cjs.map +1 -1
  93. package/dist/components/list.d.cts +13 -5
  94. package/dist/components/list.d.ts +13 -5
  95. package/dist/components/list.js +21 -5
  96. package/dist/components/list.js.map +1 -1
  97. package/dist/components/marker.cjs +1 -1
  98. package/dist/components/marker.cjs.map +1 -1
  99. package/dist/components/marker.js +1 -1
  100. package/dist/components/marker.js.map +1 -1
  101. package/dist/components/message-scroller.cjs +1 -1
  102. package/dist/components/message-scroller.cjs.map +1 -1
  103. package/dist/components/message-scroller.js +1 -1
  104. package/dist/components/message-scroller.js.map +1 -1
  105. package/dist/components/page-header.d.cts +1 -1
  106. package/dist/components/page-header.d.ts +1 -1
  107. package/dist/components/pill.d.cts +1 -1
  108. package/dist/components/pill.d.ts +1 -1
  109. package/dist/components/radio.cjs +6 -2
  110. package/dist/components/radio.cjs.map +1 -1
  111. package/dist/components/radio.d.cts +4 -2
  112. package/dist/components/radio.d.ts +4 -2
  113. package/dist/components/radio.js +6 -2
  114. package/dist/components/radio.js.map +1 -1
  115. package/dist/components/rating.cjs +167 -0
  116. package/dist/components/rating.cjs.map +1 -0
  117. package/dist/components/rating.d.cts +50 -0
  118. package/dist/components/rating.d.ts +50 -0
  119. package/dist/components/rating.js +162 -0
  120. package/dist/components/rating.js.map +1 -0
  121. package/dist/components/schedule-list.cjs +1 -1
  122. package/dist/components/schedule-list.cjs.map +1 -1
  123. package/dist/components/schedule-list.js +1 -1
  124. package/dist/components/schedule-list.js.map +1 -1
  125. package/dist/components/scroll-area.cjs +9 -2
  126. package/dist/components/scroll-area.cjs.map +1 -1
  127. package/dist/components/scroll-area.d.cts +1 -1
  128. package/dist/components/scroll-area.d.ts +1 -1
  129. package/dist/components/scroll-area.js +10 -3
  130. package/dist/components/scroll-area.js.map +1 -1
  131. package/dist/components/segmented-control.d.cts +1 -1
  132. package/dist/components/segmented-control.d.ts +1 -1
  133. package/dist/components/select.d.cts +1 -1
  134. package/dist/components/select.d.ts +1 -1
  135. package/dist/components/selection-item.cjs +42 -0
  136. package/dist/components/selection-item.cjs.map +1 -0
  137. package/dist/components/selection-item.d.cts +25 -0
  138. package/dist/components/selection-item.d.ts +25 -0
  139. package/dist/components/selection-item.js +39 -0
  140. package/dist/components/selection-item.js.map +1 -0
  141. package/dist/components/sheet.cjs +1 -1
  142. package/dist/components/sheet.js +1 -1
  143. package/dist/components/skeleton.cjs +1 -1
  144. package/dist/components/skeleton.cjs.map +1 -1
  145. package/dist/components/skeleton.js +1 -1
  146. package/dist/components/skeleton.js.map +1 -1
  147. package/dist/components/slider.cjs +1 -1
  148. package/dist/components/slider.cjs.map +1 -1
  149. package/dist/components/slider.js +1 -1
  150. package/dist/components/slider.js.map +1 -1
  151. package/dist/components/spinner.cjs +81 -8
  152. package/dist/components/spinner.cjs.map +1 -1
  153. package/dist/components/spinner.js +81 -8
  154. package/dist/components/spinner.js.map +1 -1
  155. package/dist/components/stat-card.cjs +1 -1
  156. package/dist/components/stat-card.cjs.map +1 -1
  157. package/dist/components/stat-card.js +1 -1
  158. package/dist/components/stat-card.js.map +1 -1
  159. package/dist/components/stepper.cjs +3 -2
  160. package/dist/components/stepper.cjs.map +1 -1
  161. package/dist/components/stepper.js +3 -2
  162. package/dist/components/stepper.js.map +1 -1
  163. package/dist/components/switch-group.cjs +32 -0
  164. package/dist/components/switch-group.cjs.map +1 -0
  165. package/dist/components/switch-group.d.cts +26 -0
  166. package/dist/components/switch-group.d.ts +26 -0
  167. package/dist/components/switch-group.js +29 -0
  168. package/dist/components/switch-group.js.map +1 -0
  169. package/dist/components/switch.d.cts +1 -1
  170. package/dist/components/switch.d.ts +1 -1
  171. package/dist/components/tabs.cjs +32 -23
  172. package/dist/components/tabs.cjs.map +1 -1
  173. package/dist/components/tabs.d.cts +5 -5
  174. package/dist/components/tabs.d.ts +5 -5
  175. package/dist/components/tabs.js +32 -23
  176. package/dist/components/tabs.js.map +1 -1
  177. package/dist/components/textarea.d.cts +1 -1
  178. package/dist/components/textarea.d.ts +1 -1
  179. package/dist/components/theme.cjs +44 -2
  180. package/dist/components/theme.cjs.map +1 -1
  181. package/dist/components/theme.d.cts +4 -2
  182. package/dist/components/theme.d.ts +4 -2
  183. package/dist/components/theme.js +44 -2
  184. package/dist/components/theme.js.map +1 -1
  185. package/dist/components/toast.cjs +2 -2
  186. package/dist/components/toast.cjs.map +1 -1
  187. package/dist/components/toast.js +2 -2
  188. package/dist/components/toast.js.map +1 -1
  189. package/dist/components/toggle-group.d.cts +1 -1
  190. package/dist/components/toggle-group.d.ts +1 -1
  191. package/dist/components/toggle.d.cts +2 -2
  192. package/dist/components/toggle.d.ts +2 -2
  193. package/dist/lib/accent-theme.d.cts +1 -1
  194. package/dist/lib/accent-theme.d.ts +1 -1
  195. package/dist/lib/container-chrome.cjs +4 -4
  196. package/dist/lib/container-chrome.cjs.map +1 -1
  197. package/dist/lib/container-chrome.d.cts +1 -1
  198. package/dist/lib/container-chrome.d.ts +1 -1
  199. package/dist/lib/container-chrome.js +4 -4
  200. package/dist/lib/container-chrome.js.map +1 -1
  201. package/dist/lib/input-box-variants.cjs +8 -8
  202. package/dist/lib/input-box-variants.cjs.map +1 -1
  203. package/dist/lib/input-box-variants.d.cts +1 -1
  204. package/dist/lib/input-box-variants.d.ts +1 -1
  205. package/dist/lib/input-box-variants.js +8 -8
  206. package/dist/lib/input-box-variants.js.map +1 -1
  207. package/dist/lib/selection-list.cjs +17 -0
  208. package/dist/lib/selection-list.cjs.map +1 -0
  209. package/dist/lib/selection-list.d.cts +11 -0
  210. package/dist/lib/selection-list.d.ts +11 -0
  211. package/dist/lib/selection-list.js +15 -0
  212. package/dist/lib/selection-list.js.map +1 -0
  213. package/dist/lib/theme-types.cjs.map +1 -1
  214. package/dist/lib/theme-types.d.cts +2 -2
  215. package/dist/lib/theme-types.d.ts +2 -2
  216. package/dist/lib/theme-types.js.map +1 -1
  217. package/dist/lib/toggle-group-context.d.cts +2 -1
  218. package/dist/lib/toggle-group-context.d.ts +2 -1
  219. package/dist/styles/spark-default.css +12 -1
  220. package/dist/styles/theme.css +98 -0
  221. package/dist/{theme-types-Bn5E15-P.d.ts → theme-types-CKZzOmSa.d.cts} +11 -2
  222. package/dist/{theme-types-Bn5E15-P.d.cts → theme-types-CKZzOmSa.d.ts} +11 -2
  223. package/package.json +1 -1
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
4
  const require_chunk = require("../chunk-DY84GLCh.cjs");
5
5
  const require_lib_accent_colors = require("../lib/accent-colors.cjs");
6
+ const require_components_theme = require("./theme.cjs");
6
7
  let react = require("react");
7
8
  react = require_chunk.__toESM(react);
8
9
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -10,7 +11,7 @@ let _base_ui_react_button = require("@base-ui/react/button");
10
11
  let class_variance_authority = require("class-variance-authority");
11
12
  let cn = require("cn");
12
13
  //#region src/components/button.tsx
13
- const buttonVariants = (0, class_variance_authority.cva)("group/button touch-target inline-flex cursor-pointer items-center justify-center gap-2 rounded-[max(var(--spark-rounded-md),var(--spark-rounded-full))] text-base font-medium whitespace-nowrap transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 motion-reduce:transition-none [&_svg]:pointer-events-none [&_svg]:shrink-0", {
14
+ const buttonVariants = (0, class_variance_authority.cva)("group/button touch-target inline-flex cursor-pointer items-center justify-center gap-2 rounded-[max(var(--spark-rounded-md),var(--spark-rounded-full))] text-base font-medium whitespace-nowrap transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 motion-reduce:transition-none [&_[data-slot=spinner]]:text-current [&_svg]:pointer-events-none [&_svg]:shrink-0", {
14
15
  variants: {
15
16
  variant: {
16
17
  primary: "bg-(--spark-style-bg,var(--color-primary)) text-(--spark-style-fg,var(--color-primary-foreground)) hover:bg-(--spark-style-bg-hover,var(--color-primary-hover))",
@@ -38,16 +39,36 @@ const buttonVariants = (0, class_variance_authority.cva)("group/button touch-tar
38
39
  defaultVariants: { size: "default" }
39
40
  });
40
41
  const buttonRecipe = "bg-(--spark-style-bg,var(--color-primary)) text-(--spark-style-fg,var(--color-primary-foreground)) hover:bg-(--spark-style-bg-hover,var(--color-primary-hover)) shadow-[inset_0_0_0_var(--spark-style-border-width,1px)_var(--spark-style-border,transparent)]";
41
- const Button = react.forwardRef(function Button({ className, styleVariant, color, size, render, nativeButton, variant: _variant, ...props }, ref) {
42
+ const mediaRecipe = "bg-(--spark-button-media-bg,color-mix(in_srgb,black_50%,transparent)) text-(--spark-button-media-fg,white) shadow-none backdrop-blur-md hover:bg-(--spark-button-media-bg-hover,color-mix(in_srgb,black_65%,transparent))";
43
+ const defaultStyleByEmphasis = {
44
+ primary: void 0,
45
+ secondary: "soft",
46
+ tertiary: "ghost"
47
+ };
48
+ function useEmphasisLook(emphasis, styleVariant, color) {
49
+ const roles = require_components_theme.useTheme().buttons;
50
+ if (!emphasis) return {
51
+ styleVariant,
52
+ color
53
+ };
54
+ const role = roles?.[emphasis];
55
+ return {
56
+ styleVariant: styleVariant ?? role?.style ?? defaultStyleByEmphasis[emphasis],
57
+ color: color ?? role?.color
58
+ };
59
+ }
60
+ const Button = react.forwardRef(function Button({ className, emphasis, styleVariant: ownStyleVariant, color: ownColor, size, render, nativeButton, variant: _variant, ...props }, ref) {
61
+ const { styleVariant, color } = useEmphasisLook(emphasis, ownStyleVariant, ownColor);
62
+ const media = styleVariant === "media";
42
63
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_button.Button, {
43
- "data-style": styleVariant !== void 0 || color !== void 0 ? styleVariant ?? "solid" : void 0,
44
- "data-accent-color": color ? require_lib_accent_colors.accentByColor[color] : void 0,
64
+ "data-style": (styleVariant !== void 0 || color !== void 0) && !media ? styleVariant ?? "solid" : void 0,
65
+ "data-accent-color": color && !media ? require_lib_accent_colors.accentByColor[color] : void 0,
45
66
  nativeButton: nativeButton ?? render === void 0,
46
67
  render,
47
68
  className: (0, cn.cn)(buttonVariants({
48
69
  size,
49
- color
50
- }), buttonRecipe, className),
70
+ color: media ? void 0 : color
71
+ }), buttonRecipe, media && mediaRecipe, className),
51
72
  ref,
52
73
  ...props
53
74
  });
@@ -1 +1 @@
1
- {"version":3,"file":"button.cjs","names":["React","ButtonPrimitive","accentByColor"],"sources":["../../src/components/button.tsx"],"sourcesContent":["'use client'\n\nimport { Button as ButtonPrimitive } from '@base-ui/react/button'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\nimport { accentByColor } from '../lib/accent-colors'\nimport type { SparkStyle } from '../lib/theme-types'\nimport { cn } from '../utils/cn'\n\nconst buttonVariants = cva(\n 'group/button touch-target inline-flex cursor-pointer items-center justify-center gap-2 rounded-[max(var(--spark-rounded-md),var(--spark-rounded-full))] text-base font-medium whitespace-nowrap transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 motion-reduce:transition-none [&_svg]:pointer-events-none [&_svg]:shrink-0',\n {\n variants: {\n variant: {\n primary:\n 'bg-(--spark-style-bg,var(--color-primary)) text-(--spark-style-fg,var(--color-primary-foreground)) hover:bg-(--spark-style-bg-hover,var(--color-primary-hover))',\n secondary:\n 'bg-gray-2 text-gray-a11 shadow-[inset_0_0_0_1px_var(--neutral-a7)] hover:bg-gray-a3',\n tertiary: 'bg-transparent text-gray-a11 hover:bg-gray-a3',\n bare: 'rounded-none! text-gray-12 outline-hidden!',\n destructive:\n 'bg-destructive-soft text-destructive-soft-foreground hover:bg-destructive-soft-hover focus-visible:ring-destructive',\n },\n color: {\n accent: '',\n primary: '',\n neutral: '',\n danger: 'focus-visible:ring-destructive',\n destructive: 'focus-visible:ring-destructive',\n },\n size: {\n small:\n 'h-9 px-3 text-sm [--spark-icon-size:16px] [&_svg:not([class*=size-])]:size-4',\n default:\n 'h-10 px-3 [--spark-icon-size:20px] [&_svg:not([class*=size-])]:size-5',\n medium:\n 'h-11 px-4 [--spark-icon-size:24px] [&_svg:not([class*=size-])]:size-6',\n 'icon-small':\n 'size-9 [--spark-icon-size:16px] [&_svg:not([class*=size-])]:size-4',\n icon: 'size-10 [--spark-icon-size:20px] [&_svg:not([class*=size-])]:size-5',\n 'icon-medium':\n 'size-11 [--spark-icon-size:24px] [&_svg:not([class*=size-])]:size-6',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n },\n)\n\nconst buttonRecipe =\n 'bg-(--spark-style-bg,var(--color-primary)) text-(--spark-style-fg,var(--color-primary-foreground)) hover:bg-(--spark-style-bg-hover,var(--color-primary-hover)) shadow-[inset_0_0_0_var(--spark-style-border-width,1px)_var(--spark-style-border,transparent)]'\n\n/** Preferred: `primary` | `neutral` | `destructive`. `accent` / `danger` stay as aliases. */\nexport type SparkButtonColor =\n | 'primary'\n | 'accent'\n | 'neutral'\n | 'destructive'\n | 'danger'\n\nexport interface ButtonProps\n extends\n Omit<React.ComponentProps<typeof ButtonPrimitive>, 'ref'>,\n Omit<VariantProps<typeof buttonVariants>, 'variant' | 'color'> {\n styleVariant?: SparkStyle\n color?: SparkButtonColor\n /**\n * @deprecated Not a `<Button>` prop and silently ignored -- use `styleVariant`\n * (`solid | soft | surface | ghost | outline`) and `color`\n * (`primary | neutral | destructive`) instead. The `variant` axis on\n * `buttonVariants` exists only for class-string callers.\n */\n variant?: never\n}\n\n// forwardRef keeps refs working for React 18 consumers (ref-as-prop is 19-only)\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n className,\n styleVariant,\n color,\n size,\n render,\n nativeButton,\n // oxlint-disable-next-line typescript/no-deprecated -- strips deprecated back-compat prop before DOM spread\n variant: _variant,\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 <ButtonPrimitive\n data-style={dataStyle}\n data-accent-color={dataAccentColor}\n nativeButton={nativeButton ?? render === undefined}\n render={render}\n className={cn(buttonVariants({ size, color }), buttonRecipe, className)}\n ref={ref}\n {...props}\n />\n )\n})\n\nButton.displayName = 'Button'\n\nexport { Button, buttonVariants }\n"],"mappings":";;;;;;;;;;;;AASA,MAAM,kBAAA,GAAA,yBAAA,KACJ,0dACA;CACE,UAAU;EACR,SAAS;GACP,SACE;GACF,WACE;GACF,UAAU;GACV,MAAM;GACN,aACE;EACJ;EACA,OAAO;GACL,QAAQ;GACR,SAAS;GACT,SAAS;GACT,QAAQ;GACR,aAAa;EACf;EACA,MAAM;GACJ,OACE;GACF,SACE;GACF,QACE;GACF,cACE;GACF,MAAM;GACN,eACE;EACJ;CACF;CACA,iBAAiB,EACf,MAAM,UACR;AACF,CACF;AAEA,MAAM,eACJ;AA0BF,MAAM,SAASA,MAAM,WAA2C,SAAS,OACvE,EACE,WACA,cACA,OACA,MACA,QACA,cAEA,SAAS,UACT,GAAG,SAEL,KACA;CAKA,OACE,iBAAA,GAAA,kBAAA,KAACC,sBAAAA,QAAD;EACE,cANY,iBAAiB,KAAA,KAAa,UAAU,KAAA,IAC3B,gBAAgB,UAAW,KAAA;EAMpD,qBALoB,QAAQC,0BAAAA,cAAc,SAAS,KAAA;EAMnD,cAAc,gBAAgB,WAAW,KAAA;EACjC;EACR,YAAA,GAAA,GAAA,IAAc,eAAe;GAAE;GAAM;EAAM,CAAC,GAAG,cAAc,SAAS;EACjE;EACL,GAAI;CACL,CAAA;AAEL,CAAC;AAED,OAAO,cAAc"}
1
+ {"version":3,"file":"button.cjs","names":["useTheme","React","ButtonPrimitive","accentByColor"],"sources":["../../src/components/button.tsx"],"sourcesContent":["'use client'\n\nimport { Button as ButtonPrimitive } from '@base-ui/react/button'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\nimport { accentByColor } from '../lib/accent-colors'\nimport type {\n SparkButtonColor,\n SparkButtonEmphasis,\n SparkStyle,\n} from '../lib/theme-types'\nimport { cn } from '../utils/cn'\nimport { useTheme } from './theme'\n\nconst buttonVariants = cva(\n 'group/button touch-target inline-flex cursor-pointer items-center justify-center gap-2 rounded-[max(var(--spark-rounded-md),var(--spark-rounded-full))] text-base font-medium whitespace-nowrap transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 motion-reduce:transition-none [&_[data-slot=spinner]]:text-current [&_svg]:pointer-events-none [&_svg]:shrink-0',\n {\n variants: {\n variant: {\n primary:\n 'bg-(--spark-style-bg,var(--color-primary)) text-(--spark-style-fg,var(--color-primary-foreground)) hover:bg-(--spark-style-bg-hover,var(--color-primary-hover))',\n secondary:\n 'bg-gray-2 text-gray-a11 shadow-[inset_0_0_0_1px_var(--neutral-a7)] hover:bg-gray-a3',\n tertiary: 'bg-transparent text-gray-a11 hover:bg-gray-a3',\n bare: 'rounded-none! text-gray-12 outline-hidden!',\n destructive:\n 'bg-destructive-soft text-destructive-soft-foreground hover:bg-destructive-soft-hover focus-visible:ring-destructive',\n },\n color: {\n accent: '',\n primary: '',\n neutral: '',\n danger: 'focus-visible:ring-destructive',\n destructive: 'focus-visible:ring-destructive',\n },\n size: {\n small:\n 'h-9 px-3 text-sm [--spark-icon-size:16px] [&_svg:not([class*=size-])]:size-4',\n default:\n 'h-10 px-3 [--spark-icon-size:20px] [&_svg:not([class*=size-])]:size-5',\n medium:\n 'h-11 px-4 [--spark-icon-size:24px] [&_svg:not([class*=size-])]:size-6',\n 'icon-small':\n 'size-9 [--spark-icon-size:16px] [&_svg:not([class*=size-])]:size-4',\n icon: 'size-10 [--spark-icon-size:20px] [&_svg:not([class*=size-])]:size-5',\n 'icon-medium':\n 'size-11 [--spark-icon-size:24px] [&_svg:not([class*=size-])]:size-6',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n },\n)\n\nconst buttonRecipe =\n 'bg-(--spark-style-bg,var(--color-primary)) text-(--spark-style-fg,var(--color-primary-foreground)) hover:bg-(--spark-style-bg-hover,var(--color-primary-hover)) shadow-[inset_0_0_0_var(--spark-style-border-width,1px)_var(--spark-style-border,transparent)]'\n\nconst mediaRecipe =\n 'bg-(--spark-button-media-bg,color-mix(in_srgb,black_50%,transparent)) text-(--spark-button-media-fg,white) shadow-none backdrop-blur-md hover:bg-(--spark-button-media-bg-hover,color-mix(in_srgb,black_65%,transparent))'\n\nexport type { SparkButtonColor, SparkButtonEmphasis }\n\nconst defaultStyleByEmphasis: Record<\n SparkButtonEmphasis,\n SparkStyle | undefined\n> = {\n primary: undefined,\n secondary: 'soft',\n tertiary: 'ghost',\n}\n\nfunction useEmphasisLook(\n emphasis: SparkButtonEmphasis | undefined,\n styleVariant: ButtonProps['styleVariant'],\n color: SparkButtonColor | undefined,\n) {\n const roles = useTheme().buttons\n if (!emphasis) return { styleVariant, color }\n const role = roles?.[emphasis]\n return {\n styleVariant:\n styleVariant ?? role?.style ?? defaultStyleByEmphasis[emphasis],\n color: color ?? role?.color,\n }\n}\n\nexport interface ButtonProps\n extends\n Omit<React.ComponentProps<typeof ButtonPrimitive>, 'ref'>,\n Omit<VariantProps<typeof buttonVariants>, 'variant' | 'color'> {\n /** `media`: translucent dark fill for actions over images; ignores `color`. */\n styleVariant?: SparkStyle | 'media'\n color?: SparkButtonColor\n /** Draws the look the enclosing `<Theme buttons>` gives this role; `styleVariant` / `color` still win. */\n emphasis?: SparkButtonEmphasis\n /**\n * @deprecated Not a `<Button>` prop and silently ignored -- use `styleVariant`\n * (`solid | soft | surface | ghost | outline`) and `color`\n * (`primary | neutral | destructive`) instead. The `variant` axis on\n * `buttonVariants` exists only for class-string callers.\n */\n variant?: never\n}\n\n// forwardRef keeps refs working for React 18 consumers (ref-as-prop is 19-only)\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n className,\n emphasis,\n styleVariant: ownStyleVariant,\n color: ownColor,\n size,\n render,\n nativeButton,\n // oxlint-disable-next-line typescript/no-deprecated -- strips deprecated back-compat prop before DOM spread\n variant: _variant,\n ...props\n },\n ref,\n) {\n const { styleVariant, color } = useEmphasisLook(\n emphasis,\n ownStyleVariant,\n ownColor,\n )\n const media = styleVariant === 'media'\n const hasLook = styleVariant !== undefined || color !== undefined\n const dataStyle = hasLook && !media ? (styleVariant ?? 'solid') : undefined\n const dataAccentColor = color && !media ? accentByColor[color] : undefined\n\n return (\n <ButtonPrimitive\n data-style={dataStyle}\n data-accent-color={dataAccentColor}\n nativeButton={nativeButton ?? render === undefined}\n render={render}\n className={cn(\n buttonVariants({ size, color: media ? undefined : color }),\n buttonRecipe,\n media && mediaRecipe,\n className,\n )}\n ref={ref}\n {...props}\n />\n )\n})\n\nButton.displayName = 'Button'\n\nexport { Button, buttonVariants }\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAM,kBAAA,GAAA,yBAAA,KACJ,+fACA;CACE,UAAU;EACR,SAAS;GACP,SACE;GACF,WACE;GACF,UAAU;GACV,MAAM;GACN,aACE;EACJ;EACA,OAAO;GACL,QAAQ;GACR,SAAS;GACT,SAAS;GACT,QAAQ;GACR,aAAa;EACf;EACA,MAAM;GACJ,OACE;GACF,SACE;GACF,QACE;GACF,cACE;GACF,MAAM;GACN,eACE;EACJ;CACF;CACA,iBAAiB,EACf,MAAM,UACR;AACF,CACF;AAEA,MAAM,eACJ;AAEF,MAAM,cACJ;AAIF,MAAM,yBAGF;CACF,SAAS,KAAA;CACT,WAAW;CACX,UAAU;AACZ;AAEA,SAAS,gBACP,UACA,cACA,OACA;CACA,MAAM,QAAQA,yBAAAA,SAAS,EAAE;CACzB,IAAI,CAAC,UAAU,OAAO;EAAE;EAAc;CAAM;CAC5C,MAAM,OAAO,QAAQ;CACrB,OAAO;EACL,cACE,gBAAgB,MAAM,SAAS,uBAAuB;EACxD,OAAO,SAAS,MAAM;CACxB;AACF;AAqBA,MAAM,SAASC,MAAM,WAA2C,SAAS,OACvE,EACE,WACA,UACA,cAAc,iBACd,OAAO,UACP,MACA,QACA,cAEA,SAAS,UACT,GAAG,SAEL,KACA;CACA,MAAM,EAAE,cAAc,UAAU,gBAC9B,UACA,iBACA,QACF;CACA,MAAM,QAAQ,iBAAiB;CAK/B,OACE,iBAAA,GAAA,kBAAA,KAACC,sBAAAA,QAAD;EACE,eANY,iBAAiB,KAAA,KAAa,UAAU,KAAA,MAC3B,CAAC,QAAS,gBAAgB,UAAW,KAAA;EAM9D,qBALoB,SAAS,CAAC,QAAQC,0BAAAA,cAAc,SAAS,KAAA;EAM7D,cAAc,gBAAgB,WAAW,KAAA;EACjC;EACR,YAAA,GAAA,GAAA,IACE,eAAe;GAAE;GAAM,OAAO,QAAQ,KAAA,IAAY;EAAM,CAAC,GACzD,cACA,SAAS,aACT,SACF;EACK;EACL,GAAI;CACL,CAAA;AAEL,CAAC;AAED,OAAO,cAAc"}
@@ -1,21 +1,22 @@
1
1
  "use client";
2
2
 
3
- import { f as SparkStyle } from "../theme-types-Bn5E15-P.cjs";
3
+ import { g as SparkStyle, n as SparkButtonColor, r as SparkButtonEmphasis } from "../theme-types-CKZzOmSa.cjs";
4
4
  import * as React$1 from "react";
5
5
  import { Button as Button$1 } from "@base-ui/react/button";
6
6
  import { VariantProps } from "class-variance-authority";
7
7
 
8
8
  //#region src/components/button.d.ts
9
9
  declare const buttonVariants: (props?: ({
10
- variant?: "secondary" | "destructive" | "primary" | "tertiary" | "bare" | null | undefined;
11
- color?: "neutral" | "accent" | "destructive" | "primary" | "danger" | null | undefined;
12
- size?: "small" | "default" | "icon" | "medium" | "icon-small" | "icon-medium" | null | undefined;
10
+ variant?: "primary" | "destructive" | "secondary" | "tertiary" | "bare" | null | undefined;
11
+ color?: "accent" | "primary" | "neutral" | "danger" | "destructive" | null | undefined;
12
+ size?: "icon" | "small" | "default" | "medium" | "icon-small" | "icon-medium" | null | undefined;
13
13
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
14
- /** Preferred: `primary` | `neutral` | `destructive`. `accent` / `danger` stay as aliases. */
15
- type SparkButtonColor = 'primary' | 'accent' | 'neutral' | 'destructive' | 'danger';
16
14
  interface ButtonProps extends Omit<React$1.ComponentProps<typeof Button$1>, 'ref'>, Omit<VariantProps<typeof buttonVariants>, 'variant' | 'color'> {
17
- styleVariant?: SparkStyle;
15
+ /** `media`: translucent dark fill for actions over images; ignores `color`. */
16
+ styleVariant?: SparkStyle | 'media';
18
17
  color?: SparkButtonColor;
18
+ /** Draws the look the enclosing `<Theme buttons>` gives this role; `styleVariant` / `color` still win. */
19
+ emphasis?: SparkButtonEmphasis;
19
20
  /**
20
21
  * @deprecated Not a `<Button>` prop and silently ignored -- use `styleVariant`
21
22
  * (`solid | soft | surface | ghost | outline`) and `color`
@@ -26,5 +27,5 @@ interface ButtonProps extends Omit<React$1.ComponentProps<typeof Button$1>, 'ref
26
27
  }
27
28
  declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
28
29
  //#endregion
29
- export { Button, ButtonProps, SparkButtonColor, buttonVariants };
30
+ export { Button, ButtonProps, type SparkButtonColor, type SparkButtonEmphasis, buttonVariants };
30
31
  //# sourceMappingURL=button.d.cts.map
@@ -1,21 +1,22 @@
1
1
  "use client";
2
2
 
3
- import { f as SparkStyle } from "../theme-types-Bn5E15-P.js";
3
+ import { g as SparkStyle, n as SparkButtonColor, r as SparkButtonEmphasis } from "../theme-types-CKZzOmSa.js";
4
4
  import * as React$1 from "react";
5
5
  import { Button as Button$1 } from "@base-ui/react/button";
6
6
  import { VariantProps } from "class-variance-authority";
7
7
 
8
8
  //#region src/components/button.d.ts
9
9
  declare const buttonVariants: (props?: ({
10
- variant?: "secondary" | "destructive" | "primary" | "tertiary" | "bare" | null | undefined;
11
- color?: "neutral" | "accent" | "destructive" | "primary" | "danger" | null | undefined;
12
- size?: "small" | "default" | "icon" | "medium" | "icon-small" | "icon-medium" | null | undefined;
10
+ variant?: "primary" | "destructive" | "secondary" | "tertiary" | "bare" | null | undefined;
11
+ color?: "accent" | "primary" | "neutral" | "danger" | "destructive" | null | undefined;
12
+ size?: "icon" | "small" | "default" | "medium" | "icon-small" | "icon-medium" | null | undefined;
13
13
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
14
- /** Preferred: `primary` | `neutral` | `destructive`. `accent` / `danger` stay as aliases. */
15
- type SparkButtonColor = 'primary' | 'accent' | 'neutral' | 'destructive' | 'danger';
16
14
  interface ButtonProps extends Omit<React$1.ComponentProps<typeof Button$1>, 'ref'>, Omit<VariantProps<typeof buttonVariants>, 'variant' | 'color'> {
17
- styleVariant?: SparkStyle;
15
+ /** `media`: translucent dark fill for actions over images; ignores `color`. */
16
+ styleVariant?: SparkStyle | 'media';
18
17
  color?: SparkButtonColor;
18
+ /** Draws the look the enclosing `<Theme buttons>` gives this role; `styleVariant` / `color` still win. */
19
+ emphasis?: SparkButtonEmphasis;
19
20
  /**
20
21
  * @deprecated Not a `<Button>` prop and silently ignored -- use `styleVariant`
21
22
  * (`solid | soft | surface | ghost | outline`) and `color`
@@ -26,5 +27,5 @@ interface ButtonProps extends Omit<React$1.ComponentProps<typeof Button$1>, 'ref
26
27
  }
27
28
  declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
28
29
  //#endregion
29
- export { Button, ButtonProps, SparkButtonColor, buttonVariants };
30
+ export { Button, ButtonProps, type SparkButtonColor, type SparkButtonEmphasis, buttonVariants };
30
31
  //# sourceMappingURL=button.d.ts.map
@@ -2,12 +2,13 @@
2
2
  "use client";
3
3
  import { cn } from "../utils/cn.js";
4
4
  import { accentByColor } from "../lib/accent-colors.js";
5
+ import { useTheme } from "./theme.js";
5
6
  import * as React$1 from "react";
6
7
  import { jsx } from "react/jsx-runtime";
7
8
  import { Button as Button$1 } from "@base-ui/react/button";
8
9
  import { cva } from "class-variance-authority";
9
10
  //#region src/components/button.tsx
10
- const buttonVariants = cva("group/button touch-target inline-flex cursor-pointer items-center justify-center gap-2 rounded-[max(var(--spark-rounded-md),var(--spark-rounded-full))] text-base font-medium whitespace-nowrap transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 motion-reduce:transition-none [&_svg]:pointer-events-none [&_svg]:shrink-0", {
11
+ const buttonVariants = cva("group/button touch-target inline-flex cursor-pointer items-center justify-center gap-2 rounded-[max(var(--spark-rounded-md),var(--spark-rounded-full))] text-base font-medium whitespace-nowrap transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 motion-reduce:transition-none [&_[data-slot=spinner]]:text-current [&_svg]:pointer-events-none [&_svg]:shrink-0", {
11
12
  variants: {
12
13
  variant: {
13
14
  primary: "bg-(--spark-style-bg,var(--color-primary)) text-(--spark-style-fg,var(--color-primary-foreground)) hover:bg-(--spark-style-bg-hover,var(--color-primary-hover))",
@@ -35,16 +36,36 @@ const buttonVariants = cva("group/button touch-target inline-flex cursor-pointer
35
36
  defaultVariants: { size: "default" }
36
37
  });
37
38
  const buttonRecipe = "bg-(--spark-style-bg,var(--color-primary)) text-(--spark-style-fg,var(--color-primary-foreground)) hover:bg-(--spark-style-bg-hover,var(--color-primary-hover)) shadow-[inset_0_0_0_var(--spark-style-border-width,1px)_var(--spark-style-border,transparent)]";
38
- const Button = React$1.forwardRef(function Button({ className, styleVariant, color, size, render, nativeButton, variant: _variant, ...props }, ref) {
39
+ const mediaRecipe = "bg-(--spark-button-media-bg,color-mix(in_srgb,black_50%,transparent)) text-(--spark-button-media-fg,white) shadow-none backdrop-blur-md hover:bg-(--spark-button-media-bg-hover,color-mix(in_srgb,black_65%,transparent))";
40
+ const defaultStyleByEmphasis = {
41
+ primary: void 0,
42
+ secondary: "soft",
43
+ tertiary: "ghost"
44
+ };
45
+ function useEmphasisLook(emphasis, styleVariant, color) {
46
+ const roles = useTheme().buttons;
47
+ if (!emphasis) return {
48
+ styleVariant,
49
+ color
50
+ };
51
+ const role = roles?.[emphasis];
52
+ return {
53
+ styleVariant: styleVariant ?? role?.style ?? defaultStyleByEmphasis[emphasis],
54
+ color: color ?? role?.color
55
+ };
56
+ }
57
+ const Button = React$1.forwardRef(function Button({ className, emphasis, styleVariant: ownStyleVariant, color: ownColor, size, render, nativeButton, variant: _variant, ...props }, ref) {
58
+ const { styleVariant, color } = useEmphasisLook(emphasis, ownStyleVariant, ownColor);
59
+ const media = styleVariant === "media";
39
60
  return /* @__PURE__ */ jsx(Button$1, {
40
- "data-style": styleVariant !== void 0 || color !== void 0 ? styleVariant ?? "solid" : void 0,
41
- "data-accent-color": color ? accentByColor[color] : void 0,
61
+ "data-style": (styleVariant !== void 0 || color !== void 0) && !media ? styleVariant ?? "solid" : void 0,
62
+ "data-accent-color": color && !media ? accentByColor[color] : void 0,
42
63
  nativeButton: nativeButton ?? render === void 0,
43
64
  render,
44
65
  className: cn(buttonVariants({
45
66
  size,
46
- color
47
- }), buttonRecipe, className),
67
+ color: media ? void 0 : color
68
+ }), buttonRecipe, media && mediaRecipe, className),
48
69
  ref,
49
70
  ...props
50
71
  });
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","names":["React","ButtonPrimitive"],"sources":["../../src/components/button.tsx"],"sourcesContent":["'use client'\n\nimport { Button as ButtonPrimitive } from '@base-ui/react/button'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\nimport { accentByColor } from '../lib/accent-colors'\nimport type { SparkStyle } from '../lib/theme-types'\nimport { cn } from '../utils/cn'\n\nconst buttonVariants = cva(\n 'group/button touch-target inline-flex cursor-pointer items-center justify-center gap-2 rounded-[max(var(--spark-rounded-md),var(--spark-rounded-full))] text-base font-medium whitespace-nowrap transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 motion-reduce:transition-none [&_svg]:pointer-events-none [&_svg]:shrink-0',\n {\n variants: {\n variant: {\n primary:\n 'bg-(--spark-style-bg,var(--color-primary)) text-(--spark-style-fg,var(--color-primary-foreground)) hover:bg-(--spark-style-bg-hover,var(--color-primary-hover))',\n secondary:\n 'bg-gray-2 text-gray-a11 shadow-[inset_0_0_0_1px_var(--neutral-a7)] hover:bg-gray-a3',\n tertiary: 'bg-transparent text-gray-a11 hover:bg-gray-a3',\n bare: 'rounded-none! text-gray-12 outline-hidden!',\n destructive:\n 'bg-destructive-soft text-destructive-soft-foreground hover:bg-destructive-soft-hover focus-visible:ring-destructive',\n },\n color: {\n accent: '',\n primary: '',\n neutral: '',\n danger: 'focus-visible:ring-destructive',\n destructive: 'focus-visible:ring-destructive',\n },\n size: {\n small:\n 'h-9 px-3 text-sm [--spark-icon-size:16px] [&_svg:not([class*=size-])]:size-4',\n default:\n 'h-10 px-3 [--spark-icon-size:20px] [&_svg:not([class*=size-])]:size-5',\n medium:\n 'h-11 px-4 [--spark-icon-size:24px] [&_svg:not([class*=size-])]:size-6',\n 'icon-small':\n 'size-9 [--spark-icon-size:16px] [&_svg:not([class*=size-])]:size-4',\n icon: 'size-10 [--spark-icon-size:20px] [&_svg:not([class*=size-])]:size-5',\n 'icon-medium':\n 'size-11 [--spark-icon-size:24px] [&_svg:not([class*=size-])]:size-6',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n },\n)\n\nconst buttonRecipe =\n 'bg-(--spark-style-bg,var(--color-primary)) text-(--spark-style-fg,var(--color-primary-foreground)) hover:bg-(--spark-style-bg-hover,var(--color-primary-hover)) shadow-[inset_0_0_0_var(--spark-style-border-width,1px)_var(--spark-style-border,transparent)]'\n\n/** Preferred: `primary` | `neutral` | `destructive`. `accent` / `danger` stay as aliases. */\nexport type SparkButtonColor =\n | 'primary'\n | 'accent'\n | 'neutral'\n | 'destructive'\n | 'danger'\n\nexport interface ButtonProps\n extends\n Omit<React.ComponentProps<typeof ButtonPrimitive>, 'ref'>,\n Omit<VariantProps<typeof buttonVariants>, 'variant' | 'color'> {\n styleVariant?: SparkStyle\n color?: SparkButtonColor\n /**\n * @deprecated Not a `<Button>` prop and silently ignored -- use `styleVariant`\n * (`solid | soft | surface | ghost | outline`) and `color`\n * (`primary | neutral | destructive`) instead. The `variant` axis on\n * `buttonVariants` exists only for class-string callers.\n */\n variant?: never\n}\n\n// forwardRef keeps refs working for React 18 consumers (ref-as-prop is 19-only)\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n className,\n styleVariant,\n color,\n size,\n render,\n nativeButton,\n // oxlint-disable-next-line typescript/no-deprecated -- strips deprecated back-compat prop before DOM spread\n variant: _variant,\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 <ButtonPrimitive\n data-style={dataStyle}\n data-accent-color={dataAccentColor}\n nativeButton={nativeButton ?? render === undefined}\n render={render}\n className={cn(buttonVariants({ size, color }), buttonRecipe, className)}\n ref={ref}\n {...props}\n />\n )\n})\n\nButton.displayName = 'Button'\n\nexport { Button, buttonVariants }\n"],"mappings":";;;;;;;;;AASA,MAAM,iBAAiB,IACrB,0dACA;CACE,UAAU;EACR,SAAS;GACP,SACE;GACF,WACE;GACF,UAAU;GACV,MAAM;GACN,aACE;EACJ;EACA,OAAO;GACL,QAAQ;GACR,SAAS;GACT,SAAS;GACT,QAAQ;GACR,aAAa;EACf;EACA,MAAM;GACJ,OACE;GACF,SACE;GACF,QACE;GACF,cACE;GACF,MAAM;GACN,eACE;EACJ;CACF;CACA,iBAAiB,EACf,MAAM,UACR;AACF,CACF;AAEA,MAAM,eACJ;AA0BF,MAAM,SAASA,QAAM,WAA2C,SAAS,OACvE,EACE,WACA,cACA,OACA,MACA,QACA,cAEA,SAAS,UACT,GAAG,SAEL,KACA;CAKA,OACE,oBAACC,UAAD;EACE,cANY,iBAAiB,KAAA,KAAa,UAAU,KAAA,IAC3B,gBAAgB,UAAW,KAAA;EAMpD,qBALoB,QAAQ,cAAc,SAAS,KAAA;EAMnD,cAAc,gBAAgB,WAAW,KAAA;EACjC;EACR,WAAW,GAAG,eAAe;GAAE;GAAM;EAAM,CAAC,GAAG,cAAc,SAAS;EACjE;EACL,GAAI;CACL,CAAA;AAEL,CAAC;AAED,OAAO,cAAc"}
1
+ {"version":3,"file":"button.js","names":["React","ButtonPrimitive"],"sources":["../../src/components/button.tsx"],"sourcesContent":["'use client'\n\nimport { Button as ButtonPrimitive } from '@base-ui/react/button'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\nimport { accentByColor } from '../lib/accent-colors'\nimport type {\n SparkButtonColor,\n SparkButtonEmphasis,\n SparkStyle,\n} from '../lib/theme-types'\nimport { cn } from '../utils/cn'\nimport { useTheme } from './theme'\n\nconst buttonVariants = cva(\n 'group/button touch-target inline-flex cursor-pointer items-center justify-center gap-2 rounded-[max(var(--spark-rounded-md),var(--spark-rounded-full))] text-base font-medium whitespace-nowrap transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 motion-reduce:transition-none [&_[data-slot=spinner]]:text-current [&_svg]:pointer-events-none [&_svg]:shrink-0',\n {\n variants: {\n variant: {\n primary:\n 'bg-(--spark-style-bg,var(--color-primary)) text-(--spark-style-fg,var(--color-primary-foreground)) hover:bg-(--spark-style-bg-hover,var(--color-primary-hover))',\n secondary:\n 'bg-gray-2 text-gray-a11 shadow-[inset_0_0_0_1px_var(--neutral-a7)] hover:bg-gray-a3',\n tertiary: 'bg-transparent text-gray-a11 hover:bg-gray-a3',\n bare: 'rounded-none! text-gray-12 outline-hidden!',\n destructive:\n 'bg-destructive-soft text-destructive-soft-foreground hover:bg-destructive-soft-hover focus-visible:ring-destructive',\n },\n color: {\n accent: '',\n primary: '',\n neutral: '',\n danger: 'focus-visible:ring-destructive',\n destructive: 'focus-visible:ring-destructive',\n },\n size: {\n small:\n 'h-9 px-3 text-sm [--spark-icon-size:16px] [&_svg:not([class*=size-])]:size-4',\n default:\n 'h-10 px-3 [--spark-icon-size:20px] [&_svg:not([class*=size-])]:size-5',\n medium:\n 'h-11 px-4 [--spark-icon-size:24px] [&_svg:not([class*=size-])]:size-6',\n 'icon-small':\n 'size-9 [--spark-icon-size:16px] [&_svg:not([class*=size-])]:size-4',\n icon: 'size-10 [--spark-icon-size:20px] [&_svg:not([class*=size-])]:size-5',\n 'icon-medium':\n 'size-11 [--spark-icon-size:24px] [&_svg:not([class*=size-])]:size-6',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n },\n)\n\nconst buttonRecipe =\n 'bg-(--spark-style-bg,var(--color-primary)) text-(--spark-style-fg,var(--color-primary-foreground)) hover:bg-(--spark-style-bg-hover,var(--color-primary-hover)) shadow-[inset_0_0_0_var(--spark-style-border-width,1px)_var(--spark-style-border,transparent)]'\n\nconst mediaRecipe =\n 'bg-(--spark-button-media-bg,color-mix(in_srgb,black_50%,transparent)) text-(--spark-button-media-fg,white) shadow-none backdrop-blur-md hover:bg-(--spark-button-media-bg-hover,color-mix(in_srgb,black_65%,transparent))'\n\nexport type { SparkButtonColor, SparkButtonEmphasis }\n\nconst defaultStyleByEmphasis: Record<\n SparkButtonEmphasis,\n SparkStyle | undefined\n> = {\n primary: undefined,\n secondary: 'soft',\n tertiary: 'ghost',\n}\n\nfunction useEmphasisLook(\n emphasis: SparkButtonEmphasis | undefined,\n styleVariant: ButtonProps['styleVariant'],\n color: SparkButtonColor | undefined,\n) {\n const roles = useTheme().buttons\n if (!emphasis) return { styleVariant, color }\n const role = roles?.[emphasis]\n return {\n styleVariant:\n styleVariant ?? role?.style ?? defaultStyleByEmphasis[emphasis],\n color: color ?? role?.color,\n }\n}\n\nexport interface ButtonProps\n extends\n Omit<React.ComponentProps<typeof ButtonPrimitive>, 'ref'>,\n Omit<VariantProps<typeof buttonVariants>, 'variant' | 'color'> {\n /** `media`: translucent dark fill for actions over images; ignores `color`. */\n styleVariant?: SparkStyle | 'media'\n color?: SparkButtonColor\n /** Draws the look the enclosing `<Theme buttons>` gives this role; `styleVariant` / `color` still win. */\n emphasis?: SparkButtonEmphasis\n /**\n * @deprecated Not a `<Button>` prop and silently ignored -- use `styleVariant`\n * (`solid | soft | surface | ghost | outline`) and `color`\n * (`primary | neutral | destructive`) instead. The `variant` axis on\n * `buttonVariants` exists only for class-string callers.\n */\n variant?: never\n}\n\n// forwardRef keeps refs working for React 18 consumers (ref-as-prop is 19-only)\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n className,\n emphasis,\n styleVariant: ownStyleVariant,\n color: ownColor,\n size,\n render,\n nativeButton,\n // oxlint-disable-next-line typescript/no-deprecated -- strips deprecated back-compat prop before DOM spread\n variant: _variant,\n ...props\n },\n ref,\n) {\n const { styleVariant, color } = useEmphasisLook(\n emphasis,\n ownStyleVariant,\n ownColor,\n )\n const media = styleVariant === 'media'\n const hasLook = styleVariant !== undefined || color !== undefined\n const dataStyle = hasLook && !media ? (styleVariant ?? 'solid') : undefined\n const dataAccentColor = color && !media ? accentByColor[color] : undefined\n\n return (\n <ButtonPrimitive\n data-style={dataStyle}\n data-accent-color={dataAccentColor}\n nativeButton={nativeButton ?? render === undefined}\n render={render}\n className={cn(\n buttonVariants({ size, color: media ? undefined : color }),\n buttonRecipe,\n media && mediaRecipe,\n className,\n )}\n ref={ref}\n {...props}\n />\n )\n})\n\nButton.displayName = 'Button'\n\nexport { Button, buttonVariants }\n"],"mappings":";;;;;;;;;;AAcA,MAAM,iBAAiB,IACrB,+fACA;CACE,UAAU;EACR,SAAS;GACP,SACE;GACF,WACE;GACF,UAAU;GACV,MAAM;GACN,aACE;EACJ;EACA,OAAO;GACL,QAAQ;GACR,SAAS;GACT,SAAS;GACT,QAAQ;GACR,aAAa;EACf;EACA,MAAM;GACJ,OACE;GACF,SACE;GACF,QACE;GACF,cACE;GACF,MAAM;GACN,eACE;EACJ;CACF;CACA,iBAAiB,EACf,MAAM,UACR;AACF,CACF;AAEA,MAAM,eACJ;AAEF,MAAM,cACJ;AAIF,MAAM,yBAGF;CACF,SAAS,KAAA;CACT,WAAW;CACX,UAAU;AACZ;AAEA,SAAS,gBACP,UACA,cACA,OACA;CACA,MAAM,QAAQ,SAAS,EAAE;CACzB,IAAI,CAAC,UAAU,OAAO;EAAE;EAAc;CAAM;CAC5C,MAAM,OAAO,QAAQ;CACrB,OAAO;EACL,cACE,gBAAgB,MAAM,SAAS,uBAAuB;EACxD,OAAO,SAAS,MAAM;CACxB;AACF;AAqBA,MAAM,SAASA,QAAM,WAA2C,SAAS,OACvE,EACE,WACA,UACA,cAAc,iBACd,OAAO,UACP,MACA,QACA,cAEA,SAAS,UACT,GAAG,SAEL,KACA;CACA,MAAM,EAAE,cAAc,UAAU,gBAC9B,UACA,iBACA,QACF;CACA,MAAM,QAAQ,iBAAiB;CAK/B,OACE,oBAACC,UAAD;EACE,eANY,iBAAiB,KAAA,KAAa,UAAU,KAAA,MAC3B,CAAC,QAAS,gBAAgB,UAAW,KAAA;EAM9D,qBALoB,SAAS,CAAC,QAAQ,cAAc,SAAS,KAAA;EAM7D,cAAc,gBAAgB,WAAW,KAAA;EACjC;EACR,WAAW,GACT,eAAe;GAAE;GAAM,OAAO,QAAQ,KAAA,IAAY;EAAM,CAAC,GACzD,cACA,SAAS,aACT,SACF;EACK;EACL,GAAI;CACL,CAAA;AAEL,CAAC;AAED,OAAO,cAAc"}
@@ -88,7 +88,7 @@ const Callout = ({ variant = "info", icon, className, children, ...props }) => {
88
88
  className: (0, cn.cn)(calloutVariants({ variant }), className),
89
89
  ...props,
90
90
  children: [Glyph ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Glyph, { className: (0, cn.cn)("[--spark-icon-size:calc(20px*var(--spark-scaling,1))]", variantIcon.className) }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
91
- className: "flex w-full min-w-0 flex-col gap-1",
91
+ className: "flex w-full min-w-0 flex-col gap-2",
92
92
  children
93
93
  })]
94
94
  })
@@ -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;CAC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ACE,yDACA,YAAY,SACd,EACD,CAAA,IACC,MACJ,iBAAA,GAAA,kBAAA,KAAC,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-2\">{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,iBAAA,GAAA,kBAAA,KAAC,KAAD;CACE,aAAU;CACV,YAAA,GAAA,GAAA,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,GAAA,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,GAAA,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,GAAA,IAAc,gBAAgB,EAAE,QAAQ,CAAC,GAAG,SAAS;GACrD,GAAI;aAHN,CAKG,QACC,iBAAA,GAAA,kBAAA,KAAC,OAAD,EACE,YAAA,GAAA,GAAA,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?: "error" | "success" | "warning" | "info" | "neutral" | null | undefined;
11
+ variant?: "neutral" | "success" | "warning" | "error" | "info" | 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?: "error" | "success" | "warning" | "info" | "neutral" | null | undefined;
11
+ variant?: "neutral" | "success" | "warning" | "error" | "info" | 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. */
@@ -85,7 +85,7 @@ const Callout = ({ variant = "info", icon, className, children, ...props }) => {
85
85
  className: cn(calloutVariants({ variant }), className),
86
86
  ...props,
87
87
  children: [Glyph ? /* @__PURE__ */ jsx(Glyph, { className: cn("[--spark-icon-size:calc(20px*var(--spark-scaling,1))]", variantIcon.className) }) : null, /* @__PURE__ */ jsx("div", {
88
- className: "flex w-full min-w-0 flex-col gap-1",
88
+ className: "flex w-full min-w-0 flex-col gap-2",
89
89
  children
90
90
  })]
91
91
  })
@@ -1 +1 @@
1
- {"version":3,"file":"callout.js","names":["React"],"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,MAA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ACV,MACA,WACA,UACA,GAAG,YACe;CAClB,MAAM,cAAc,cAAc,WAAW;CAC7C,MAAM,QAAQ,SAAS,QAAQ,OAAQ,QAAQ,YAAY;CAE3D,OACE,oBAAC,sBAAsB,UAAvB;EAAgC,OAAO,WAAW;YAChD,qBAAC,OAAD;GACE,aAAU;GACV,WAAW,GAAG,gBAAgB,EAAE,QAAQ,CAAC,GAAG,SAAS;GACrD,GAAI;aAHN,CAKG,QACC,oBAAC,OAAD,EACE,WAAW,GACT,yDACA,YAAY,SACd,EACD,CAAA,IACC,MACJ,oBAAC,OAAD;IAAK,WAAU;IAAsC;GAAc,CAAA,CAChE;;CACyB,CAAA;AAEpC"}
1
+ {"version":3,"file":"callout.js","names":["React"],"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-2\">{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,kBAAkB,IACtB,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,MAAM;EAAQ,WAAW;CAA6B;CAC/D,SAAS;EAAE,MAAM;EAAa,WAAW;CAA+B;CACxE,SAAS;EAAE,MAAM;EAAS,WAAW;CAA+B;CACpE,MAAM;EAAE,MAAM;EAAM,WAAW;CAAkB;CACjD,SAAS;EAAE,MAAM;EAAM,WAAW;CAAkB;AACtD;AAUA,MAAM,gBAAgB,EACpB,WACA,GAAG,YAEH,oBAAC,QAAD;CACE,aAAU;CACV,WAAW,GAAG,qCAAqC,SAAS;CAC5D,GAAI;AACL,CAAA;AAGH,MAAM,sBAAsB,EAC1B,WACA,GAAG,YAEH,oBAAC,KAAD;CACE,aAAU;CACV,WAAW,GAAG,WAAW,SAAS;CAClC,GAAI;AACL,CAAA;AAGH,MAAM,wBAAwBA,QAAM,cAA8B,MAAM;AAExE,MAAM,wBAAwD;CAC5D,OACE;CACF,SACE;CACF,SACE;CACF,MAAM;CACN,SACE;AACJ;AAEA,MAAM,kBAAkB,EACtB,WACA,GAAG,YAEH,oBAAC,OAAD;CACE,aAAU;CACV,WAAW,GACT,8EACA,SACF;CACA,GAAI;AACL,CAAA;AAQH,MAAM,iBAAiB,EACrB,WACA,QAAQ,SACR,UAAU,OACV,GAAG,YACoB;CACvB,MAAM,iBAAiBA,QAAM,WAAW,qBAAqB;CAE7D,OACE,oBAAC,QAAD;EACE,aAAU;EACV,MAAK;EACL,cAAc,UAAU,UAAU;EAClC,OAAO,UAAU,YAAY;EAC7B,WAAW,GACT,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,oBAAC,sBAAsB,UAAvB;EAAgC,OAAO,WAAW;YAChD,qBAAC,OAAD;GACE,aAAU;GACV,WAAW,GAAG,gBAAgB,EAAE,QAAQ,CAAC,GAAG,SAAS;GACrD,GAAI;aAHN,CAKG,QACC,oBAAC,OAAD,EACE,WAAW,GACT,yDACA,YAAY,SACd,EACD,CAAA,IACC,MACJ,oBAAC,OAAD;IAAK,WAAU;IAAsC;GAAc,CAAA,CAChE;;CACyB,CAAA;AAEpC"}
@@ -50,10 +50,14 @@ const CardIcon = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__
50
50
  ...props
51
51
  }));
52
52
  CardIcon.displayName = "CardIcon";
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),
55
- ref,
56
- ...props
53
+ const CardTitle = react.forwardRef(({ className, render, ...props }, ref) => (0, _base_ui_react_use_render.useRender)({
54
+ defaultTagName: "h3",
55
+ render,
56
+ props: {
57
+ className: (0, cn.cn)("text-base leading-5 font-medium text-(--spark-card-fg,var(--neutral-a12))", className),
58
+ ref,
59
+ ...props
60
+ }
57
61
  }));
58
62
  CardTitle.displayName = "CardTitle";
59
63
  const CardDescription = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
@@ -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}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A,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,\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\ninterface CardTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {\n /** Base UI polymorphism. Pass `<h2/>` etc. to change the heading level. Omit → `<h3>`. */\n render?: useRender.RenderProp\n}\n\nconst CardTitle = React.forwardRef<HTMLHeadingElement, CardTitleProps>(\n ({ className, render, ...props }, ref) =>\n useRender({\n defaultTagName: 'h3',\n render,\n props: {\n className: cn(\n 'text-base leading-5 font-medium text-(--spark-card-fg,var(--neutral-a12))',\n className,\n ),\n ref,\n ...props,\n },\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,4C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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
2
 
3
- import { n as SparkCardColor, r as SparkCardVariant } from "../theme-types-Bn5E15-P.cjs";
3
+ import { o as SparkCardColor, s as SparkCardVariant } from "../theme-types-CKZzOmSa.cjs";
4
4
  import { ContainerRadius } from "../lib/container-chrome.cjs";
5
5
  import * as React$1 from "react";
6
6
  import { useRender } from "@base-ui/react/use-render";
@@ -33,7 +33,11 @@ interface CardProps extends React$1.HTMLAttributes<HTMLDivElement> {
33
33
  declare const Card: React$1.ForwardRefExoticComponent<CardProps & React$1.RefAttributes<HTMLDivElement>>;
34
34
  declare const CardHeader: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
35
35
  declare const CardIcon: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
36
- declare const CardTitle: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLHeadingElement> & React$1.RefAttributes<HTMLHeadingElement>>;
36
+ interface CardTitleProps extends React$1.HTMLAttributes<HTMLHeadingElement> {
37
+ /** Base UI polymorphism. Pass `<h2/>` etc. to change the heading level. Omit → `<h3>`. */
38
+ render?: useRender.RenderProp;
39
+ }
40
+ declare const CardTitle: React$1.ForwardRefExoticComponent<CardTitleProps & React$1.RefAttributes<HTMLHeadingElement>>;
37
41
  declare const CardDescription: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLParagraphElement> & React$1.RefAttributes<HTMLParagraphElement>>;
38
42
  declare const CardContent: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
39
43
  declare const CardFooter: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { n as SparkCardColor, r as SparkCardVariant } from "../theme-types-Bn5E15-P.js";
3
+ import { o as SparkCardColor, s as SparkCardVariant } from "../theme-types-CKZzOmSa.js";
4
4
  import { ContainerRadius } from "../lib/container-chrome.js";
5
5
  import * as React$1 from "react";
6
6
  import { useRender } from "@base-ui/react/use-render";
@@ -33,7 +33,11 @@ interface CardProps extends React$1.HTMLAttributes<HTMLDivElement> {
33
33
  declare const Card: React$1.ForwardRefExoticComponent<CardProps & React$1.RefAttributes<HTMLDivElement>>;
34
34
  declare const CardHeader: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
35
35
  declare const CardIcon: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
36
- declare const CardTitle: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLHeadingElement> & React$1.RefAttributes<HTMLHeadingElement>>;
36
+ interface CardTitleProps extends React$1.HTMLAttributes<HTMLHeadingElement> {
37
+ /** Base UI polymorphism. Pass `<h2/>` etc. to change the heading level. Omit → `<h3>`. */
38
+ render?: useRender.RenderProp;
39
+ }
40
+ declare const CardTitle: React$1.ForwardRefExoticComponent<CardTitleProps & React$1.RefAttributes<HTMLHeadingElement>>;
37
41
  declare const CardDescription: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLParagraphElement> & React$1.RefAttributes<HTMLParagraphElement>>;
38
42
  declare const CardContent: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
39
43
  declare const CardFooter: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
@@ -47,10 +47,14 @@ const CardIcon = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE
47
47
  ...props
48
48
  }));
49
49
  CardIcon.displayName = "CardIcon";
50
- const CardTitle = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("h3", {
51
- className: cn("text-base leading-5 font-medium text-(--spark-card-fg,var(--neutral-a12))", className),
52
- ref,
53
- ...props
50
+ const CardTitle = React$1.forwardRef(({ className, render, ...props }, ref) => useRender({
51
+ defaultTagName: "h3",
52
+ render,
53
+ props: {
54
+ className: cn("text-base leading-5 font-medium text-(--spark-card-fg,var(--neutral-a12))", className),
55
+ ref,
56
+ ...props
57
+ }
54
58
  }));
55
59
  CardTitle.displayName = "CardTitle";
56
60
  const CardDescription = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("p", {
@@ -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 C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A,QAAM,YAGrB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,MAAD;CACE,WAAW,GACT,6EACA,SACF;CACK;CACL,GAAI;AACL,CAAA,CACF;AAED,UAAU,cAAc;AAExB,MAAM,kBAAkBA,QAAM,YAG3B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,KAAD;CACE,WAAW,GACT,qEACA,SACF;CACK;CACL,GAAI;AACL,CAAA,CACF;AAED,gBAAgB,cAAc;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"}
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\ninterface CardTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {\n /** Base UI polymorphism. Pass `<h2/>` etc. to change the heading level. Omit → `<h3>`. */\n render?: useRender.RenderProp\n}\n\nconst CardTitle = React.forwardRef<HTMLHeadingElement, CardTitleProps>(\n ({ className, render, ...props }, ref) =>\n useRender({\n defaultTagName: 'h3',\n render,\n props: {\n className: cn(\n 'text-base leading-5 font-medium text-(--spark-card-fg,var(--neutral-a12))',\n className,\n ),\n ref,\n ...props,\n },\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;G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xB,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"}
@@ -0,0 +1,31 @@
1
+ "use client";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const require_chunk = require("../chunk-DY84GLCh.cjs");
4
+ const require_lib_accent_colors = require("../lib/accent-colors.cjs");
5
+ const require_components_field = require("./field.cjs");
6
+ const require_lib_selection_list = require("../lib/selection-list.cjs");
7
+ let react = require("react");
8
+ react = require_chunk.__toESM(react);
9
+ let react_jsx_runtime = require("react/jsx-runtime");
10
+ let _base_ui_react_checkbox_group = require("@base-ui/react/checkbox-group");
11
+ let cn = require("cn");
12
+ //#region src/components/checkbox-group.tsx
13
+ function CheckboxGroup({ className, styleVariant, color, gap = 3, listStyle, style, ...props }) {
14
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_checkbox_group.CheckboxGroup, {
15
+ "data-slot": "checkbox-group",
16
+ "data-style": styleVariant !== void 0 || color !== void 0 ? styleVariant ?? "solid" : void 0,
17
+ "data-accent-color": color ? require_lib_accent_colors.accentByColor[color] : void 0,
18
+ "data-list-style": listStyle,
19
+ "data-invalid": require_components_field.useFieldSetInvalid(),
20
+ className: (0, cn.cn)("grid", listStyle ? require_lib_selection_list.selectionListClasses[listStyle] : "gap-[calc(var(--spark-layout-gap)*var(--checkbox-group-gap-steps,3))]", className),
21
+ style: {
22
+ "--checkbox-group-gap-steps": gap,
23
+ ...style
24
+ },
25
+ ...props
26
+ });
27
+ }
28
+ //#endregion
29
+ exports.CheckboxGroup = CheckboxGroup;
30
+
31
+ //# sourceMappingURL=checkbox-group.cjs.map