@epilot/spark-ui 0.16.0 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/dist/components/accordion.cjs +3 -6
  2. package/dist/components/accordion.cjs.map +1 -1
  3. package/dist/components/accordion.d.ts +1 -1
  4. package/dist/components/accordion.js +3 -6
  5. package/dist/components/accordion.js.map +1 -1
  6. package/dist/components/alert-dialog.cjs +2 -5
  7. package/dist/components/alert-dialog.cjs.map +1 -1
  8. package/dist/components/alert-dialog.js +2 -5
  9. package/dist/components/alert-dialog.js.map +1 -1
  10. package/dist/components/bar-chart.cjs +1 -1
  11. package/dist/components/bar-chart.js +2 -2
  12. package/dist/components/battery-progress-row.cjs +14 -11
  13. package/dist/components/battery-progress-row.cjs.map +1 -1
  14. package/dist/components/battery-progress-row.d.cts +2 -10
  15. package/dist/components/battery-progress-row.d.ts +2 -10
  16. package/dist/components/battery-progress-row.js +14 -11
  17. package/dist/components/battery-progress-row.js.map +1 -1
  18. package/dist/components/bubble.d.cts +1 -1
  19. package/dist/components/bubble.d.ts +1 -1
  20. package/dist/components/button.cjs +6 -6
  21. package/dist/components/button.cjs.map +1 -1
  22. package/dist/components/button.d.cts +3 -3
  23. package/dist/components/button.d.ts +3 -3
  24. package/dist/components/button.js +6 -6
  25. package/dist/components/button.js.map +1 -1
  26. package/dist/components/calendar.cjs +4 -5
  27. package/dist/components/calendar.cjs.map +1 -1
  28. package/dist/components/calendar.js +4 -5
  29. package/dist/components/calendar.js.map +1 -1
  30. package/dist/components/callout.cjs +18 -14
  31. package/dist/components/callout.cjs.map +1 -1
  32. package/dist/components/callout.d.cts +10 -4
  33. package/dist/components/callout.d.ts +10 -4
  34. package/dist/components/callout.js +18 -15
  35. package/dist/components/callout.js.map +1 -1
  36. package/dist/components/device-card.cjs +2 -6
  37. package/dist/components/device-card.cjs.map +1 -1
  38. package/dist/components/device-card.d.cts +3 -3
  39. package/dist/components/device-card.d.ts +3 -3
  40. package/dist/components/device-card.js +2 -6
  41. package/dist/components/device-card.js.map +1 -1
  42. package/dist/components/dialog.cjs +2 -5
  43. package/dist/components/dialog.cjs.map +1 -1
  44. package/dist/components/dialog.js +2 -5
  45. package/dist/components/dialog.js.map +1 -1
  46. package/dist/components/dropdown-menu.cjs +4 -13
  47. package/dist/components/dropdown-menu.cjs.map +1 -1
  48. package/dist/components/dropdown-menu.js +4 -13
  49. package/dist/components/dropdown-menu.js.map +1 -1
  50. package/dist/components/empty-state.cjs +5 -5
  51. package/dist/components/empty-state.cjs.map +1 -1
  52. package/dist/components/empty-state.d.cts +3 -3
  53. package/dist/components/empty-state.d.ts +3 -3
  54. package/dist/components/empty-state.js +5 -5
  55. package/dist/components/empty-state.js.map +1 -1
  56. package/dist/components/icon.cjs +2 -3
  57. package/dist/components/icon.cjs.map +1 -1
  58. package/dist/components/icon.d.cts +0 -3
  59. package/dist/components/icon.d.ts +0 -3
  60. package/dist/components/icon.js +2 -3
  61. package/dist/components/icon.js.map +1 -1
  62. package/dist/components/info-block.d.cts +1 -1
  63. package/dist/components/info-block.d.ts +1 -1
  64. package/dist/components/input-otp.cjs +1 -1
  65. package/dist/components/input-otp.js +1 -1
  66. package/dist/components/input.cjs +1 -1
  67. package/dist/components/input.js +1 -1
  68. package/dist/components/line-chart.cjs +3 -3
  69. package/dist/components/line-chart.js +4 -4
  70. package/dist/components/list.cjs.map +1 -1
  71. package/dist/components/list.js.map +1 -1
  72. package/dist/components/marker.d.cts +1 -1
  73. package/dist/components/marker.d.ts +1 -1
  74. package/dist/components/message-scroller.cjs +3 -3
  75. package/dist/components/message-scroller.cjs.map +1 -1
  76. package/dist/components/message-scroller.js +3 -3
  77. package/dist/components/message-scroller.js.map +1 -1
  78. package/dist/components/metering-row.cjs +3 -3
  79. package/dist/components/metering-row.cjs.map +1 -1
  80. package/dist/components/metering-row.d.cts +3 -3
  81. package/dist/components/metering-row.d.ts +3 -3
  82. package/dist/components/metering-row.js +3 -3
  83. package/dist/components/metering-row.js.map +1 -1
  84. package/dist/components/money-saved-block.cjs +2 -5
  85. package/dist/components/money-saved-block.cjs.map +1 -1
  86. package/dist/components/money-saved-block.js +2 -5
  87. package/dist/components/money-saved-block.js.map +1 -1
  88. package/dist/components/on-off-button.cjs +2 -5
  89. package/dist/components/on-off-button.cjs.map +1 -1
  90. package/dist/components/on-off-button.js +2 -5
  91. package/dist/components/on-off-button.js.map +1 -1
  92. package/dist/components/page-header.cjs +2 -2
  93. package/dist/components/page-header.cjs.map +1 -1
  94. package/dist/components/page-header.d.cts +1 -1
  95. package/dist/components/page-header.d.ts +1 -1
  96. package/dist/components/page-header.js +2 -2
  97. package/dist/components/page-header.js.map +1 -1
  98. package/dist/components/period-tabs.cjs +3 -6
  99. package/dist/components/period-tabs.cjs.map +1 -1
  100. package/dist/components/period-tabs.js +3 -6
  101. package/dist/components/period-tabs.js.map +1 -1
  102. package/dist/components/pill.cjs +2 -5
  103. package/dist/components/pill.cjs.map +1 -1
  104. package/dist/components/pill.js +2 -5
  105. package/dist/components/pill.js.map +1 -1
  106. package/dist/components/power-history-chart.cjs +3 -3
  107. package/dist/components/power-history-chart.js +4 -4
  108. package/dist/components/power-history.cjs +1 -1
  109. package/dist/components/power-history.js +1 -1
  110. package/dist/components/power-network.cjs +2 -5
  111. package/dist/components/power-network.cjs.map +1 -1
  112. package/dist/components/power-network.js +2 -5
  113. package/dist/components/power-network.js.map +1 -1
  114. package/dist/components/sankey-chart.cjs +56 -71
  115. package/dist/components/sankey-chart.cjs.map +1 -1
  116. package/dist/components/sankey-chart.js +56 -71
  117. package/dist/components/sankey-chart.js.map +1 -1
  118. package/dist/components/schedule-list.cjs +3 -9
  119. package/dist/components/schedule-list.cjs.map +1 -1
  120. package/dist/components/schedule-list.js +3 -9
  121. package/dist/components/schedule-list.js.map +1 -1
  122. package/dist/components/select.cjs +6 -18
  123. package/dist/components/select.cjs.map +1 -1
  124. package/dist/components/select.js +6 -18
  125. package/dist/components/select.js.map +1 -1
  126. package/dist/components/sheet.cjs +2 -5
  127. package/dist/components/sheet.cjs.map +1 -1
  128. package/dist/components/sheet.js +2 -5
  129. package/dist/components/sheet.js.map +1 -1
  130. package/dist/components/slider.cjs +9 -3
  131. package/dist/components/slider.cjs.map +1 -1
  132. package/dist/components/slider.js +9 -3
  133. package/dist/components/slider.js.map +1 -1
  134. package/dist/components/smart-toggle-button.cjs +2 -5
  135. package/dist/components/smart-toggle-button.cjs.map +1 -1
  136. package/dist/components/smart-toggle-button.js +2 -5
  137. package/dist/components/smart-toggle-button.js.map +1 -1
  138. package/dist/components/solar-forecast-chart.cjs +8 -9
  139. package/dist/components/solar-forecast-chart.cjs.map +1 -1
  140. package/dist/components/solar-forecast-chart.d.cts +2 -2
  141. package/dist/components/solar-forecast-chart.d.ts +2 -2
  142. package/dist/components/solar-forecast-chart.js +9 -10
  143. package/dist/components/solar-forecast-chart.js.map +1 -1
  144. package/dist/components/stepper.cjs +3 -9
  145. package/dist/components/stepper.cjs.map +1 -1
  146. package/dist/components/stepper.js +3 -9
  147. package/dist/components/stepper.js.map +1 -1
  148. package/dist/components/tabs.cjs +2 -2
  149. package/dist/components/tabs.cjs.map +1 -1
  150. package/dist/components/tabs.js +2 -2
  151. package/dist/components/tabs.js.map +1 -1
  152. package/dist/components/textarea.cjs +1 -1
  153. package/dist/components/textarea.js +1 -1
  154. package/dist/components/toast.cjs +9 -12
  155. package/dist/components/toast.cjs.map +1 -1
  156. package/dist/components/toast.js +9 -12
  157. package/dist/components/toast.js.map +1 -1
  158. package/dist/components/tooltip.cjs +2 -5
  159. package/dist/components/tooltip.cjs.map +1 -1
  160. package/dist/components/tooltip.js +2 -5
  161. package/dist/components/tooltip.js.map +1 -1
  162. package/dist/styles/index.css +0 -2
  163. package/package.json +3 -10
  164. package/dist/icons/index.cjs +0 -7
  165. package/dist/icons/index.d.cts +0 -4
  166. package/dist/icons/index.d.ts +0 -4
  167. package/dist/icons/index.js +0 -3
  168. package/dist/icons/material-symbol.cjs +0 -106
  169. package/dist/icons/material-symbol.cjs.map +0 -1
  170. package/dist/icons/material-symbol.d.cts +0 -21
  171. package/dist/icons/material-symbol.d.ts +0 -21
  172. package/dist/icons/material-symbol.js +0 -102
  173. package/dist/icons/material-symbol.js.map +0 -1
  174. package/dist/styles/material-symbol.css +0 -25
@@ -25,12 +25,12 @@ const buttonVariants = (0, class_variance_authority.cva)("group/button touch-tar
25
25
  danger: "focus-visible:ring-base-error-solid"
26
26
  },
27
27
  size: {
28
- small: "h-9 px-3 text-sm [&_svg:not([class*=size-])]:size-4",
29
- default: "h-10 px-3 [&_svg:not([class*=size-])]:size-5",
30
- medium: "h-11 px-4 [&_svg:not([class*=size-])]:size-6",
31
- "icon-small": "size-9 [&_svg:not([class*=size-])]:size-4",
32
- icon: "size-10 [&_svg:not([class*=size-])]:size-5",
33
- "icon-medium": "size-11 [&_svg:not([class*=size-])]:size-6"
28
+ small: "h-9 px-3 text-sm [--spark-icon-size:16px] [&_svg:not([class*=size-])]:size-4",
29
+ default: "h-10 px-3 [--spark-icon-size:20px] [&_svg:not([class*=size-])]:size-5",
30
+ medium: "h-11 px-4 [--spark-icon-size:24px] [&_svg:not([class*=size-])]:size-6",
31
+ "icon-small": "size-9 [--spark-icon-size:16px] [&_svg:not([class*=size-])]:size-4",
32
+ icon: "size-10 [--spark-icon-size:20px] [&_svg:not([class*=size-])]:size-5",
33
+ "icon-medium": "size-11 [--spark-icon-size:24px] [&_svg:not([class*=size-])]:size-6"
34
34
  }
35
35
  },
36
36
  defaultVariants: { size: "default" }
@@ -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(--spark-9)) text-(--spark-style-fg,var(--spark-contrast)) hover:bg-(--spark-style-bg-hover,var(--spark-10))',\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-red-a3 text-red-a11 hover:bg-red-a4 focus-visible:ring-base-error-solid',\n },\n color: {\n accent: '',\n neutral: '',\n danger: 'focus-visible:ring-base-error-solid',\n },\n size: {\n small: 'h-9 px-3 text-sm [&_svg:not([class*=size-])]:size-4',\n default: 'h-10 px-3 [&_svg:not([class*=size-])]:size-5',\n medium: 'h-11 px-4 [&_svg:not([class*=size-])]:size-6',\n 'icon-small': 'size-9 [&_svg:not([class*=size-])]:size-4',\n icon: 'size-10 [&_svg:not([class*=size-])]:size-5',\n 'icon-medium': 'size-11 [&_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(--spark-9)) text-(--spark-style-fg,var(--spark-contrast)) hover:bg-(--spark-style-bg-hover,var(--spark-10)) shadow-[inset_0_0_0_var(--spark-style-border-width,1px)_var(--spark-style-border,transparent)]'\n\nexport type SparkButtonColor = 'accent' | 'neutral' | '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 * (`accent | neutral | danger`) 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 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,QAAQ;EACV;EACA,MAAM;GACJ,OAAO;GACP,SAAS;GACT,QAAQ;GACR,cAAc;GACd,MAAM;GACN,eAAe;EACjB;CACF;CACA,iBAAiB,EACf,MAAM,UACR;AACF,CACF;AAEA,MAAM,eACJ;AAoBF,MAAM,SAASA,MAAM,WAA2C,SAAS,OACvE,EACE,WACA,cACA,OACA,MACA,QACA,cACA,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,OAAA,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":["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(--spark-9)) text-(--spark-style-fg,var(--spark-contrast)) hover:bg-(--spark-style-bg-hover,var(--spark-10))',\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-red-a3 text-red-a11 hover:bg-red-a4 focus-visible:ring-base-error-solid',\n },\n color: {\n accent: '',\n neutral: '',\n danger: 'focus-visible:ring-base-error-solid',\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(--spark-9)) text-(--spark-style-fg,var(--spark-contrast)) hover:bg-(--spark-style-bg-hover,var(--spark-10)) shadow-[inset_0_0_0_var(--spark-style-border-width,1px)_var(--spark-style-border,transparent)]'\n\nexport type SparkButtonColor = 'accent' | 'neutral' | '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 * (`accent | neutral | danger`) 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 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,QAAQ;EACV;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;AAoBF,MAAM,SAASA,MAAM,WAA2C,SAAS,OACvE,EACE,WACA,cACA,OACA,MACA,QACA,cACA,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,OAAA,IAAc,eAAe;GAAE;GAAM;EAAM,CAAC,GAAG,cAAc,SAAS;EACjE;EACL,GAAI;CACL,CAAA;AAEL,CAAC;AAED,OAAO,cAAc"}
@@ -7,9 +7,9 @@ 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?: "accent" | "neutral" | "danger" | null | undefined;
12
- size?: "small" | "default" | "icon" | "medium" | "icon-small" | "icon-medium" | null | undefined;
10
+ variant?: "primary" | "secondary" | "tertiary" | "bare" | "destructive" | null | undefined;
11
+ color?: "neutral" | "accent" | "danger" | null | undefined;
12
+ size?: "small" | "default" | "medium" | "icon-small" | "icon" | "icon-medium" | null | undefined;
13
13
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
14
14
  type SparkButtonColor = 'accent' | 'neutral' | 'danger';
15
15
  interface ButtonProps extends Omit<React$1.ComponentProps<typeof Button$1>, 'ref'>, Omit<VariantProps<typeof buttonVariants>, 'variant' | 'color'> {
@@ -7,9 +7,9 @@ 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?: "accent" | "neutral" | "danger" | null | undefined;
12
- size?: "small" | "default" | "icon" | "medium" | "icon-small" | "icon-medium" | null | undefined;
10
+ variant?: "primary" | "secondary" | "tertiary" | "bare" | "destructive" | null | undefined;
11
+ color?: "neutral" | "accent" | "danger" | null | undefined;
12
+ size?: "small" | "default" | "medium" | "icon-small" | "icon" | "icon-medium" | null | undefined;
13
13
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
14
14
  type SparkButtonColor = 'accent' | 'neutral' | 'danger';
15
15
  interface ButtonProps extends Omit<React$1.ComponentProps<typeof Button$1>, 'ref'>, Omit<VariantProps<typeof buttonVariants>, 'variant' | 'color'> {
@@ -22,12 +22,12 @@ const buttonVariants = cva("group/button touch-target inline-flex cursor-pointer
22
22
  danger: "focus-visible:ring-base-error-solid"
23
23
  },
24
24
  size: {
25
- small: "h-9 px-3 text-sm [&_svg:not([class*=size-])]:size-4",
26
- default: "h-10 px-3 [&_svg:not([class*=size-])]:size-5",
27
- medium: "h-11 px-4 [&_svg:not([class*=size-])]:size-6",
28
- "icon-small": "size-9 [&_svg:not([class*=size-])]:size-4",
29
- icon: "size-10 [&_svg:not([class*=size-])]:size-5",
30
- "icon-medium": "size-11 [&_svg:not([class*=size-])]:size-6"
25
+ small: "h-9 px-3 text-sm [--spark-icon-size:16px] [&_svg:not([class*=size-])]:size-4",
26
+ default: "h-10 px-3 [--spark-icon-size:20px] [&_svg:not([class*=size-])]:size-5",
27
+ medium: "h-11 px-4 [--spark-icon-size:24px] [&_svg:not([class*=size-])]:size-6",
28
+ "icon-small": "size-9 [--spark-icon-size:16px] [&_svg:not([class*=size-])]:size-4",
29
+ icon: "size-10 [--spark-icon-size:20px] [&_svg:not([class*=size-])]:size-5",
30
+ "icon-medium": "size-11 [--spark-icon-size:24px] [&_svg:not([class*=size-])]:size-6"
31
31
  }
32
32
  },
33
33
  defaultVariants: { size: "default" }
@@ -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(--spark-9)) text-(--spark-style-fg,var(--spark-contrast)) hover:bg-(--spark-style-bg-hover,var(--spark-10))',\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-red-a3 text-red-a11 hover:bg-red-a4 focus-visible:ring-base-error-solid',\n },\n color: {\n accent: '',\n neutral: '',\n danger: 'focus-visible:ring-base-error-solid',\n },\n size: {\n small: 'h-9 px-3 text-sm [&_svg:not([class*=size-])]:size-4',\n default: 'h-10 px-3 [&_svg:not([class*=size-])]:size-5',\n medium: 'h-11 px-4 [&_svg:not([class*=size-])]:size-6',\n 'icon-small': 'size-9 [&_svg:not([class*=size-])]:size-4',\n icon: 'size-10 [&_svg:not([class*=size-])]:size-5',\n 'icon-medium': 'size-11 [&_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(--spark-9)) text-(--spark-style-fg,var(--spark-contrast)) hover:bg-(--spark-style-bg-hover,var(--spark-10)) shadow-[inset_0_0_0_var(--spark-style-border-width,1px)_var(--spark-style-border,transparent)]'\n\nexport type SparkButtonColor = 'accent' | 'neutral' | '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 * (`accent | neutral | danger`) 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 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,QAAQ;EACV;EACA,MAAM;GACJ,OAAO;GACP,SAAS;GACT,QAAQ;GACR,cAAc;GACd,MAAM;GACN,eAAe;EACjB;CACF;CACA,iBAAiB,EACf,MAAM,UACR;AACF,CACF;AAEA,MAAM,eACJ;AAoBF,MAAM,SAASA,QAAM,WAA2C,SAAS,OACvE,EACE,WACA,cACA,OACA,MACA,QACA,cACA,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 { 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(--spark-9)) text-(--spark-style-fg,var(--spark-contrast)) hover:bg-(--spark-style-bg-hover,var(--spark-10))',\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-red-a3 text-red-a11 hover:bg-red-a4 focus-visible:ring-base-error-solid',\n },\n color: {\n accent: '',\n neutral: '',\n danger: 'focus-visible:ring-base-error-solid',\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(--spark-9)) text-(--spark-style-fg,var(--spark-contrast)) hover:bg-(--spark-style-bg-hover,var(--spark-10)) shadow-[inset_0_0_0_var(--spark-style-border-width,1px)_var(--spark-style-border,transparent)]'\n\nexport type SparkButtonColor = 'accent' | 'neutral' | '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 * (`accent | neutral | danger`) 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 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,QAAQ;EACV;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;AAoBF,MAAM,SAASA,QAAM,WAA2C,SAAS,OACvE,EACE,WACA,cACA,OACA,MACA,QACA,cACA,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,10 +1,10 @@
1
1
  "use client";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const require_chunk = require("../chunk-DY84GLCh.cjs");
4
- const require_icons_material_symbol = require("../icons/material-symbol.cjs");
5
4
  const require_components_button = require("./button.cjs");
6
5
  let react = require("react");
7
6
  react = require_chunk.__toESM(react);
7
+ let _epilot_spark_icons = require("@epilot/spark-icons");
8
8
  let react_jsx_runtime = require("react/jsx-runtime");
9
9
  let _daypicker_react = require("@daypicker/react");
10
10
  let cnfast = require("cnfast");
@@ -44,10 +44,9 @@ function Calendar({ className, classNames, showOutsideDays = true, fixedWeeks =
44
44
  hidden: "invisible",
45
45
  ...classNames
46
46
  },
47
- components: { Chevron: ({ orientation }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_material_symbol.MaterialSymbol, {
48
- className: (0, cnfast.cn)("text-[20px]", orientation === "up" && "rotate-90", orientation === "down" && "-rotate-90"),
49
- name: orientation === "right" ? "chevron_right" : "chevron_left"
50
- }) },
47
+ components: { Chevron: ({ orientation }) => {
48
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(orientation === "right" ? _epilot_spark_icons.ChevronRight : _epilot_spark_icons.ChevronLeft, { className: (0, cnfast.cn)("[--spark-icon-size:20px]", orientation === "up" && "rotate-90", orientation === "down" && "-rotate-90") });
49
+ } },
51
50
  fixedWeeks,
52
51
  showOutsideDays,
53
52
  ...props
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.cjs","names":["DayPicker","buttonVariants","MaterialSymbol"],"sources":["../../src/components/calendar.tsx"],"sourcesContent":["import { DayPicker } from '@daypicker/react'\nimport * as React from 'react'\nimport { MaterialSymbol } from '../icons/material-symbol'\nimport { cn } from '../utils/cn'\nimport { buttonVariants } from './button'\n\ntype CalendarProps = React.ComponentProps<typeof DayPicker> & {\n showTodayDot?: boolean\n}\n\n// Pass `locale` (from '@daypicker/react/locale') for localized month/weekday\n// names — the library ships no language default.\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n fixedWeeks = true,\n showTodayDot = true,\n ...props\n}: CalendarProps) {\n return (\n <DayPicker\n className={cn('p-3', className)}\n classNames={{\n months: 'relative',\n month: 'flex flex-col gap-2',\n month_caption: 'flex h-10 items-center justify-center',\n caption_label: 'text-sm font-bold text-gray',\n button_previous: cn(\n buttonVariants({ size: 'icon', variant: 'tertiary' }),\n 'absolute top-0 left-0 z-10 text-gray-light hover:text-gray',\n ),\n button_next: cn(\n buttonVariants({ size: 'icon', variant: 'tertiary' }),\n 'absolute top-0 right-0 z-10 text-gray-light hover:text-gray',\n ),\n month_grid: 'w-full border-collapse',\n weekdays: 'flex w-full justify-between',\n weekday:\n 'mt-0.5 flex h-10 w-10 items-center justify-center rounded-full text-sm font-bold text-gray',\n week: 'mt-1 flex w-full justify-between',\n day: cn(\n 'relative mx-0.5 flex h-10 w-10 items-center justify-center rounded-full p-0 text-center text-sm focus-within:relative focus-within:z-20',\n props.mode === 'range'\n ? '[&:has(>.range-end)]:rounded-r-full [&:has(>.range-start)]:rounded-l-full first:[&:has([aria-selected])]:rounded-l-full last:[&:has([aria-selected])]:rounded-r-full'\n : '[&:has([aria-selected])]:rounded-full',\n ),\n day_button: cn(\n buttonVariants({ size: 'icon', variant: 'tertiary' }),\n // hover:…:bg-(--spark-style-bg-hover) outranks tertiary's hover:bg-gray-a3 —\n // selected days darken like a solid button instead of washing out gray\n 'size-10 shrink-0 rounded-full p-0 font-normal text-gray in-aria-selected:rounded-full in-aria-selected:bg-(--spark-style-bg,var(--spark-9)) in-aria-selected:text-(--spark-style-fg,var(--spark-contrast)) hover:in-aria-selected:bg-(--spark-style-bg-hover,var(--spark-10))',\n ),\n range_start: 'range-start',\n range_end: 'range-end',\n selected: 'rounded-full',\n today: cn(\n 'relative bg-base-gray-soft text-gray',\n showTodayDot &&\n 'after:absolute after:right-0 after:-bottom-1 after:left-0 after:m-auto after:inline-flex after:h-1 after:w-1 after:rounded-full after:bg-(--spark-style-bg,var(--spark-9)) after:content-[\"\"]',\n ),\n outside:\n 'outside text-gray-light opacity-50 aria-selected:bg-base-gray-soft aria-selected:text-gray-light',\n disabled: 'text-gray-light opacity-50',\n range_middle: 'aria-selected:bg-base-gray-soft aria-selected:text-gray',\n hidden: 'invisible',\n ...classNames,\n }}\n components={{\n Chevron: ({ orientation }) => (\n <MaterialSymbol\n className={cn(\n 'text-[20px]',\n orientation === 'up' && 'rotate-90',\n orientation === 'down' && '-rotate-90',\n )}\n name={orientation === 'right' ? 'chevron_right' : 'chevron_left'}\n />\n ),\n }}\n fixedWeeks={fixedWeeks}\n showOutsideDays={showOutsideDays}\n {...props}\n />\n )\n}\n\nexport { Calendar }\nexport type { CalendarProps }\n"],"mappings":";;;;;;;;;;;AAYA,SAAS,SAAS,EAChB,WACA,YACA,kBAAkB,MAClB,aAAa,MACb,eAAe,MACf,GAAG,SACa;CAChB,OACE,iBAAA,GAAA,kBAAA,KAACA,iBAAAA,WAAD;EACE,YAAA,GAAA,OAAA,IAAc,OAAO,SAAS;EAC9B,YAAY;GACV,QAAQ;GACR,OAAO;GACP,eAAe;GACf,eAAe;GACf,kBAAA,GAAA,OAAA,IACEC,0BAAAA,eAAe;IAAE,MAAM;IAAQ,SAAS;GAAW,CAAC,GACpD,4DACF;GACA,cAAA,GAAA,OAAA,IACEA,0BAAAA,eAAe;IAAE,MAAM;IAAQ,SAAS;GAAW,CAAC,GACpD,6DACF;GACA,YAAY;GACZ,UAAU;GACV,SACE;GACF,MAAM;GACN,MAAA,GAAA,OAAA,IACE,2IACA,MAAM,SAAS,UACX,yKACA,uCACN;GACA,aAAA,GAAA,OAAA,IACEA,0BAAAA,eAAe;IAAE,MAAM;IAAQ,SAAS;GAAW,CAAC,GAGpD,+QACF;GACA,aAAa;GACb,WAAW;GACX,UAAU;GACV,QAAA,GAAA,OAAA,IACE,wCACA,gBACE,iMACJ;GACA,SACE;GACF,UAAU;GACV,cAAc;GACd,QAAQ;GACR,GAAG;EACL;EACA,YAAY,EACV,UAAU,EAAE,kBACV,iBAAA,GAAA,kBAAA,KAACC,8BAAAA,gBAAD;GACE,YAAA,GAAA,OAAA,IACE,eACA,gBAAgB,QAAQ,aACxB,gBAAgB,UAAU,YAC5B;GACA,MAAM,gBAAgB,UAAU,kBAAkB;EACnD,CAAA,EAEL;EACY;EACK;EACjB,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"calendar.cjs","names":["DayPicker","buttonVariants","ChevronRight","ChevronLeft"],"sources":["../../src/components/calendar.tsx"],"sourcesContent":["import { DayPicker } from '@daypicker/react'\nimport { ChevronLeft, ChevronRight } from '@epilot/spark-icons'\nimport * as React from 'react'\nimport { cn } from '../utils/cn'\nimport { buttonVariants } from './button'\n\ntype CalendarProps = React.ComponentProps<typeof DayPicker> & {\n showTodayDot?: boolean\n}\n\n// Pass `locale` (from '@daypicker/react/locale') for localized month/weekday\n// names — the library ships no language default.\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n fixedWeeks = true,\n showTodayDot = true,\n ...props\n}: CalendarProps) {\n return (\n <DayPicker\n className={cn('p-3', className)}\n classNames={{\n months: 'relative',\n month: 'flex flex-col gap-2',\n month_caption: 'flex h-10 items-center justify-center',\n caption_label: 'text-sm font-bold text-gray',\n button_previous: cn(\n buttonVariants({ size: 'icon', variant: 'tertiary' }),\n 'absolute top-0 left-0 z-10 text-gray-light hover:text-gray',\n ),\n button_next: cn(\n buttonVariants({ size: 'icon', variant: 'tertiary' }),\n 'absolute top-0 right-0 z-10 text-gray-light hover:text-gray',\n ),\n month_grid: 'w-full border-collapse',\n weekdays: 'flex w-full justify-between',\n weekday:\n 'mt-0.5 flex h-10 w-10 items-center justify-center rounded-full text-sm font-bold text-gray',\n week: 'mt-1 flex w-full justify-between',\n day: cn(\n 'relative mx-0.5 flex h-10 w-10 items-center justify-center rounded-full p-0 text-center text-sm focus-within:relative focus-within:z-20',\n props.mode === 'range'\n ? '[&:has(>.range-end)]:rounded-r-full [&:has(>.range-start)]:rounded-l-full first:[&:has([aria-selected])]:rounded-l-full last:[&:has([aria-selected])]:rounded-r-full'\n : '[&:has([aria-selected])]:rounded-full',\n ),\n day_button: cn(\n buttonVariants({ size: 'icon', variant: 'tertiary' }),\n // hover:…:bg-(--spark-style-bg-hover) outranks tertiary's hover:bg-gray-a3 —\n // selected days darken like a solid button instead of washing out gray\n 'size-10 shrink-0 rounded-full p-0 font-normal text-gray in-aria-selected:rounded-full in-aria-selected:bg-(--spark-style-bg,var(--spark-9)) in-aria-selected:text-(--spark-style-fg,var(--spark-contrast)) hover:in-aria-selected:bg-(--spark-style-bg-hover,var(--spark-10))',\n ),\n range_start: 'range-start',\n range_end: 'range-end',\n selected: 'rounded-full',\n today: cn(\n 'relative bg-base-gray-soft text-gray',\n showTodayDot &&\n 'after:absolute after:right-0 after:-bottom-1 after:left-0 after:m-auto after:inline-flex after:h-1 after:w-1 after:rounded-full after:bg-(--spark-style-bg,var(--spark-9)) after:content-[\"\"]',\n ),\n outside:\n 'outside text-gray-light opacity-50 aria-selected:bg-base-gray-soft aria-selected:text-gray-light',\n disabled: 'text-gray-light opacity-50',\n range_middle: 'aria-selected:bg-base-gray-soft aria-selected:text-gray',\n hidden: 'invisible',\n ...classNames,\n }}\n components={{\n Chevron: ({ orientation }) => {\n const Glyph = orientation === 'right' ? ChevronRight : ChevronLeft\n return (\n <Glyph\n className={cn(\n '[--spark-icon-size:20px]',\n orientation === 'up' && 'rotate-90',\n orientation === 'down' && '-rotate-90',\n )}\n />\n )\n },\n }}\n fixedWeeks={fixedWeeks}\n showOutsideDays={showOutsideDays}\n {...props}\n />\n )\n}\n\nexport { Calendar }\nexport type { CalendarProps }\n"],"mappings":";;;;;;;;;;;AAYA,SAAS,SAAS,EAChB,WACA,YACA,kBAAkB,MAClB,aAAa,MACb,eAAe,MACf,GAAG,SACa;CAChB,OACE,iBAAA,GAAA,kBAAA,KAACA,iBAAAA,WAAD;EACE,YAAA,GAAA,OAAA,IAAc,OAAO,SAAS;EAC9B,YAAY;GACV,QAAQ;GACR,OAAO;GACP,eAAe;GACf,eAAe;GACf,kBAAA,GAAA,OAAA,IACEC,0BAAAA,eAAe;IAAE,MAAM;IAAQ,SAAS;GAAW,CAAC,GACpD,4DACF;GACA,cAAA,GAAA,OAAA,IACEA,0BAAAA,eAAe;IAAE,MAAM;IAAQ,SAAS;GAAW,CAAC,GACpD,6DACF;GACA,YAAY;GACZ,UAAU;GACV,SACE;GACF,MAAM;GACN,MAAA,GAAA,OAAA,IACE,2IACA,MAAM,SAAS,UACX,yKACA,uCACN;GACA,aAAA,GAAA,OAAA,IACEA,0BAAAA,eAAe;IAAE,MAAM;IAAQ,SAAS;GAAW,CAAC,GAGpD,+QACF;GACA,aAAa;GACb,WAAW;GACX,UAAU;GACV,QAAA,GAAA,OAAA,IACE,wCACA,gBACE,iMACJ;GACA,SACE;GACF,UAAU;GACV,cAAc;GACd,QAAQ;GACR,GAAG;EACL;EACA,YAAY,EACV,UAAU,EAAE,kBAAkB;GAE5B,OACE,iBAAA,GAAA,kBAAA,KAFY,gBAAgB,UAAUC,oBAAAA,eAAeC,oBAAAA,aAErD,EACE,YAAA,GAAA,OAAA,IACE,4BACA,gBAAgB,QAAQ,aACxB,gBAAgB,UAAU,YAC5B,EACD,CAAA;EAEL,EACF;EACY;EACK;EACjB,GAAI;CACL,CAAA;AAEL"}
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { cn } from "../utils/cn.js";
3
- import { MaterialSymbol } from "../icons/material-symbol.js";
4
3
  import { buttonVariants } from "./button.js";
5
4
  import "react";
5
+ import { ChevronLeft, ChevronRight } from "@epilot/spark-icons";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { DayPicker } from "@daypicker/react";
8
8
  //#region src/components/calendar.tsx
@@ -41,10 +41,9 @@ function Calendar({ className, classNames, showOutsideDays = true, fixedWeeks =
41
41
  hidden: "invisible",
42
42
  ...classNames
43
43
  },
44
- components: { Chevron: ({ orientation }) => /* @__PURE__ */ jsx(MaterialSymbol, {
45
- className: cn("text-[20px]", orientation === "up" && "rotate-90", orientation === "down" && "-rotate-90"),
46
- name: orientation === "right" ? "chevron_right" : "chevron_left"
47
- }) },
44
+ components: { Chevron: ({ orientation }) => {
45
+ return /* @__PURE__ */ jsx(orientation === "right" ? ChevronRight : ChevronLeft, { className: cn("[--spark-icon-size:20px]", orientation === "up" && "rotate-90", orientation === "down" && "-rotate-90") });
46
+ } },
48
47
  fixedWeeks,
49
48
  showOutsideDays,
50
49
  ...props
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.js","names":[],"sources":["../../src/components/calendar.tsx"],"sourcesContent":["import { DayPicker } from '@daypicker/react'\nimport * as React from 'react'\nimport { MaterialSymbol } from '../icons/material-symbol'\nimport { cn } from '../utils/cn'\nimport { buttonVariants } from './button'\n\ntype CalendarProps = React.ComponentProps<typeof DayPicker> & {\n showTodayDot?: boolean\n}\n\n// Pass `locale` (from '@daypicker/react/locale') for localized month/weekday\n// names — the library ships no language default.\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n fixedWeeks = true,\n showTodayDot = true,\n ...props\n}: CalendarProps) {\n return (\n <DayPicker\n className={cn('p-3', className)}\n classNames={{\n months: 'relative',\n month: 'flex flex-col gap-2',\n month_caption: 'flex h-10 items-center justify-center',\n caption_label: 'text-sm font-bold text-gray',\n button_previous: cn(\n buttonVariants({ size: 'icon', variant: 'tertiary' }),\n 'absolute top-0 left-0 z-10 text-gray-light hover:text-gray',\n ),\n button_next: cn(\n buttonVariants({ size: 'icon', variant: 'tertiary' }),\n 'absolute top-0 right-0 z-10 text-gray-light hover:text-gray',\n ),\n month_grid: 'w-full border-collapse',\n weekdays: 'flex w-full justify-between',\n weekday:\n 'mt-0.5 flex h-10 w-10 items-center justify-center rounded-full text-sm font-bold text-gray',\n week: 'mt-1 flex w-full justify-between',\n day: cn(\n 'relative mx-0.5 flex h-10 w-10 items-center justify-center rounded-full p-0 text-center text-sm focus-within:relative focus-within:z-20',\n props.mode === 'range'\n ? '[&:has(>.range-end)]:rounded-r-full [&:has(>.range-start)]:rounded-l-full first:[&:has([aria-selected])]:rounded-l-full last:[&:has([aria-selected])]:rounded-r-full'\n : '[&:has([aria-selected])]:rounded-full',\n ),\n day_button: cn(\n buttonVariants({ size: 'icon', variant: 'tertiary' }),\n // hover:…:bg-(--spark-style-bg-hover) outranks tertiary's hover:bg-gray-a3 —\n // selected days darken like a solid button instead of washing out gray\n 'size-10 shrink-0 rounded-full p-0 font-normal text-gray in-aria-selected:rounded-full in-aria-selected:bg-(--spark-style-bg,var(--spark-9)) in-aria-selected:text-(--spark-style-fg,var(--spark-contrast)) hover:in-aria-selected:bg-(--spark-style-bg-hover,var(--spark-10))',\n ),\n range_start: 'range-start',\n range_end: 'range-end',\n selected: 'rounded-full',\n today: cn(\n 'relative bg-base-gray-soft text-gray',\n showTodayDot &&\n 'after:absolute after:right-0 after:-bottom-1 after:left-0 after:m-auto after:inline-flex after:h-1 after:w-1 after:rounded-full after:bg-(--spark-style-bg,var(--spark-9)) after:content-[\"\"]',\n ),\n outside:\n 'outside text-gray-light opacity-50 aria-selected:bg-base-gray-soft aria-selected:text-gray-light',\n disabled: 'text-gray-light opacity-50',\n range_middle: 'aria-selected:bg-base-gray-soft aria-selected:text-gray',\n hidden: 'invisible',\n ...classNames,\n }}\n components={{\n Chevron: ({ orientation }) => (\n <MaterialSymbol\n className={cn(\n 'text-[20px]',\n orientation === 'up' && 'rotate-90',\n orientation === 'down' && '-rotate-90',\n )}\n name={orientation === 'right' ? 'chevron_right' : 'chevron_left'}\n />\n ),\n }}\n fixedWeeks={fixedWeeks}\n showOutsideDays={showOutsideDays}\n {...props}\n />\n )\n}\n\nexport { Calendar }\nexport type { CalendarProps }\n"],"mappings":";;;;;;;;AAYA,SAAS,SAAS,EAChB,WACA,YACA,kBAAkB,MAClB,aAAa,MACb,eAAe,MACf,GAAG,SACa;CAChB,OACE,oBAAC,WAAD;EACE,WAAW,GAAG,OAAO,SAAS;EAC9B,YAAY;GACV,QAAQ;GACR,OAAO;GACP,eAAe;GACf,eAAe;GACf,iBAAiB,GACf,eAAe;IAAE,MAAM;IAAQ,SAAS;GAAW,CAAC,GACpD,4DACF;GACA,aAAa,GACX,eAAe;IAAE,MAAM;IAAQ,SAAS;GAAW,CAAC,GACpD,6DACF;GACA,YAAY;GACZ,UAAU;GACV,SACE;GACF,MAAM;GACN,KAAK,GACH,2IACA,MAAM,SAAS,UACX,yKACA,uCACN;GACA,YAAY,GACV,eAAe;IAAE,MAAM;IAAQ,SAAS;GAAW,CAAC,GAGpD,+QACF;GACA,aAAa;GACb,WAAW;GACX,UAAU;GACV,OAAO,GACL,wCACA,gBACE,iMACJ;GACA,SACE;GACF,UAAU;GACV,cAAc;GACd,QAAQ;GACR,GAAG;EACL;EACA,YAAY,EACV,UAAU,EAAE,kBACV,oBAAC,gBAAD;GACE,WAAW,GACT,eACA,gBAAgB,QAAQ,aACxB,gBAAgB,UAAU,YAC5B;GACA,MAAM,gBAAgB,UAAU,kBAAkB;EACnD,CAAA,EAEL;EACY;EACK;EACjB,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"calendar.js","names":[],"sources":["../../src/components/calendar.tsx"],"sourcesContent":["import { DayPicker } from '@daypicker/react'\nimport { ChevronLeft, ChevronRight } from '@epilot/spark-icons'\nimport * as React from 'react'\nimport { cn } from '../utils/cn'\nimport { buttonVariants } from './button'\n\ntype CalendarProps = React.ComponentProps<typeof DayPicker> & {\n showTodayDot?: boolean\n}\n\n// Pass `locale` (from '@daypicker/react/locale') for localized month/weekday\n// names — the library ships no language default.\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n fixedWeeks = true,\n showTodayDot = true,\n ...props\n}: CalendarProps) {\n return (\n <DayPicker\n className={cn('p-3', className)}\n classNames={{\n months: 'relative',\n month: 'flex flex-col gap-2',\n month_caption: 'flex h-10 items-center justify-center',\n caption_label: 'text-sm font-bold text-gray',\n button_previous: cn(\n buttonVariants({ size: 'icon', variant: 'tertiary' }),\n 'absolute top-0 left-0 z-10 text-gray-light hover:text-gray',\n ),\n button_next: cn(\n buttonVariants({ size: 'icon', variant: 'tertiary' }),\n 'absolute top-0 right-0 z-10 text-gray-light hover:text-gray',\n ),\n month_grid: 'w-full border-collapse',\n weekdays: 'flex w-full justify-between',\n weekday:\n 'mt-0.5 flex h-10 w-10 items-center justify-center rounded-full text-sm font-bold text-gray',\n week: 'mt-1 flex w-full justify-between',\n day: cn(\n 'relative mx-0.5 flex h-10 w-10 items-center justify-center rounded-full p-0 text-center text-sm focus-within:relative focus-within:z-20',\n props.mode === 'range'\n ? '[&:has(>.range-end)]:rounded-r-full [&:has(>.range-start)]:rounded-l-full first:[&:has([aria-selected])]:rounded-l-full last:[&:has([aria-selected])]:rounded-r-full'\n : '[&:has([aria-selected])]:rounded-full',\n ),\n day_button: cn(\n buttonVariants({ size: 'icon', variant: 'tertiary' }),\n // hover:…:bg-(--spark-style-bg-hover) outranks tertiary's hover:bg-gray-a3 —\n // selected days darken like a solid button instead of washing out gray\n 'size-10 shrink-0 rounded-full p-0 font-normal text-gray in-aria-selected:rounded-full in-aria-selected:bg-(--spark-style-bg,var(--spark-9)) in-aria-selected:text-(--spark-style-fg,var(--spark-contrast)) hover:in-aria-selected:bg-(--spark-style-bg-hover,var(--spark-10))',\n ),\n range_start: 'range-start',\n range_end: 'range-end',\n selected: 'rounded-full',\n today: cn(\n 'relative bg-base-gray-soft text-gray',\n showTodayDot &&\n 'after:absolute after:right-0 after:-bottom-1 after:left-0 after:m-auto after:inline-flex after:h-1 after:w-1 after:rounded-full after:bg-(--spark-style-bg,var(--spark-9)) after:content-[\"\"]',\n ),\n outside:\n 'outside text-gray-light opacity-50 aria-selected:bg-base-gray-soft aria-selected:text-gray-light',\n disabled: 'text-gray-light opacity-50',\n range_middle: 'aria-selected:bg-base-gray-soft aria-selected:text-gray',\n hidden: 'invisible',\n ...classNames,\n }}\n components={{\n Chevron: ({ orientation }) => {\n const Glyph = orientation === 'right' ? ChevronRight : ChevronLeft\n return (\n <Glyph\n className={cn(\n '[--spark-icon-size:20px]',\n orientation === 'up' && 'rotate-90',\n orientation === 'down' && '-rotate-90',\n )}\n />\n )\n },\n }}\n fixedWeeks={fixedWeeks}\n showOutsideDays={showOutsideDays}\n {...props}\n />\n )\n}\n\nexport { Calendar }\nexport type { CalendarProps }\n"],"mappings":";;;;;;;;AAYA,SAAS,SAAS,EAChB,WACA,YACA,kBAAkB,MAClB,aAAa,MACb,eAAe,MACf,GAAG,SACa;CAChB,OACE,oBAAC,WAAD;EACE,WAAW,GAAG,OAAO,SAAS;EAC9B,YAAY;GACV,QAAQ;GACR,OAAO;GACP,eAAe;GACf,eAAe;GACf,iBAAiB,GACf,eAAe;IAAE,MAAM;IAAQ,SAAS;GAAW,CAAC,GACpD,4DACF;GACA,aAAa,GACX,eAAe;IAAE,MAAM;IAAQ,SAAS;GAAW,CAAC,GACpD,6DACF;GACA,YAAY;GACZ,UAAU;GACV,SACE;GACF,MAAM;GACN,KAAK,GACH,2IACA,MAAM,SAAS,UACX,yKACA,uCACN;GACA,YAAY,GACV,eAAe;IAAE,MAAM;IAAQ,SAAS;GAAW,CAAC,GAGpD,+QACF;GACA,aAAa;GACb,WAAW;GACX,UAAU;GACV,OAAO,GACL,wCACA,gBACE,iMACJ;GACA,SACE;GACF,UAAU;GACV,cAAc;GACd,QAAQ;GACR,GAAG;EACL;EACA,YAAY,EACV,UAAU,EAAE,kBAAkB;GAE5B,OACE,oBAFY,gBAAgB,UAAU,eAAe,aAErD,EACE,WAAW,GACT,4BACA,gBAAgB,QAAQ,aACxB,gBAAgB,UAAU,YAC5B,EACD,CAAA;EAEL,EACF;EACY;EACK;EACjB,GAAI;CACL,CAAA;AAEL"}
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const require_chunk = require("../chunk-DY84GLCh.cjs");
4
- const require_icons_material_symbol = require("../icons/material-symbol.cjs");
5
4
  const require_components_button = require("./button.cjs");
6
5
  let react = require("react");
7
6
  react = require_chunk.__toESM(react);
7
+ let _epilot_spark_icons = require("@epilot/spark-icons");
8
8
  let react_jsx_runtime = require("react/jsx-runtime");
9
9
  let class_variance_authority = require("class-variance-authority");
10
10
  let cnfast = require("cnfast");
@@ -21,23 +21,23 @@ const calloutVariants = (0, class_variance_authority.cva)("group/callout flex w-
21
21
  });
22
22
  const CALLOUT_ICONS = {
23
23
  error: {
24
- name: "cancel",
24
+ icon: _epilot_spark_icons.Cancel,
25
25
  className: "text-error-light"
26
26
  },
27
27
  success: {
28
- name: "check_circle",
28
+ icon: _epilot_spark_icons.CheckCircle,
29
29
  className: "text-success-light"
30
30
  },
31
31
  warning: {
32
- name: "warning",
32
+ icon: _epilot_spark_icons.Warning,
33
33
  className: "text-warning-light"
34
34
  },
35
35
  info: {
36
- name: "info",
36
+ icon: _epilot_spark_icons.Info,
37
37
  className: "text-info-light"
38
38
  },
39
39
  neutral: {
40
- name: "info",
40
+ icon: _epilot_spark_icons.Info,
41
41
  className: "text-gray-light"
42
42
  }
43
43
  };
@@ -59,32 +59,35 @@ const CALLOUT_ACTION_COLORS = {
59
59
  info: "bg-base-info-soft text-info hover:bg-blue-a4 focus-visible:bg-blue-a4",
60
60
  neutral: "bg-base-gray-soft text-gray hover:bg-gray-a4 focus-visible:bg-gray-a4"
61
61
  };
62
- const CalloutAction = ({ className, align = "start", ...props }) => {
62
+ const CalloutActions = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
63
+ "data-slot": "callout-actions",
64
+ className: (0, cnfast.cn)("mt-2 flex flex-wrap items-center gap-2 [&_[data-slot=callout-action]]:mt-0", className),
65
+ ...props
66
+ });
67
+ const CalloutAction = ({ className, align = "start", primary = false, ...props }) => {
63
68
  const calloutVariant = react.useContext(CalloutVariantContext);
64
69
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_button.Button, {
65
70
  "data-slot": "callout-action",
66
71
  size: "small",
67
- styleVariant: "surface",
68
- color: "neutral",
72
+ styleVariant: primary ? "solid" : "surface",
73
+ color: primary ? "accent" : "neutral",
69
74
  className: (0, cnfast.cn)("mt-2 w-fit", {
70
75
  "self-start": align === "start",
71
76
  "self-end": align === "end"
72
- }, CALLOUT_ACTION_COLORS[calloutVariant], className),
77
+ }, !primary && CALLOUT_ACTION_COLORS[calloutVariant], className),
73
78
  ...props
74
79
  });
75
80
  };
76
81
  const Callout = ({ variant = "info", icon, className, children, ...props }) => {
77
82
  const variantIcon = CALLOUT_ICONS[variant ?? "info"];
83
+ const Glyph = icon === false ? null : icon ?? variantIcon.icon;
78
84
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CalloutVariantContext.Provider, {
79
85
  value: variant ?? "info",
80
86
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
81
87
  "data-slot": "callout",
82
88
  className: (0, cnfast.cn)(calloutVariants({ variant }), className),
83
89
  ...props,
84
- children: [icon !== false && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_material_symbol.MaterialSymbol, {
85
- className: (0, cnfast.cn)("inline-flex shrink-0 items-center [--spark-icon-size:calc(20px*var(--spark-scaling,1))]", variantIcon?.className),
86
- name: icon ?? variantIcon.name
87
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
90
+ children: [Glyph ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Glyph, { className: (0, cnfast.cn)("[--spark-icon-size:calc(20px*var(--spark-scaling,1))]", variantIcon.className) }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
88
91
  className: "flex w-full min-w-0 flex-col gap-1",
89
92
  children
90
93
  })]
@@ -94,6 +97,7 @@ const Callout = ({ variant = "info", icon, className, children, ...props }) => {
94
97
  //#endregion
95
98
  exports.Callout = Callout;
96
99
  exports.CalloutAction = CalloutAction;
100
+ exports.CalloutActions = CalloutActions;
97
101
  exports.CalloutDescription = CalloutDescription;
98
102
  exports.CalloutTitle = CalloutTitle;
99
103
  exports.calloutVariants = calloutVariants;
@@ -1 +1 @@
1
- {"version":3,"file":"callout.cjs","names":["React","Button","MaterialSymbol"],"sources":["../../src/components/callout.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\nimport {\n MaterialSymbol,\n type MaterialSymbolIconName,\n} from '../icons/material-symbol'\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-base-error-soft text-error',\n success: 'bg-base-success-soft text-success',\n warning: 'bg-base-warning-soft text-warning',\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 { name: MaterialSymbolIconName; className: string }\n> = {\n error: { name: 'cancel', className: 'text-error-light' },\n success: { name: 'check_circle', className: 'text-success-light' },\n warning: { name: 'warning', className: 'text-warning-light' },\n info: { name: 'info', className: 'text-info-light' },\n // no severity to signal, so it borrows info's glyph — pass `icon` to change it\n // or `icon={false}` for a bare panel.\n neutral: { name: '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?: MaterialSymbolIconName | 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-base-error-soft text-error hover:bg-red-a4 focus-visible:bg-red-a4',\n success:\n 'bg-base-success-soft text-success hover:bg-green-a4 focus-visible:bg-green-a4',\n warning:\n 'bg-base-warning-soft text-warning hover:bg-orange-a4 focus-visible:bg-orange-a4',\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\ntype CalloutActionType = Omit<ButtonProps, 'styleVariant' | 'color'> & {\n align?: 'start' | 'end'\n}\n\nconst CalloutAction = ({\n className,\n align = 'start',\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=\"surface\"\n color=\"neutral\"\n className={cn(\n 'mt-2 w-fit',\n { 'self-start': align === 'start', 'self-end': align === 'end' },\n 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\n return (\n <CalloutVariantContext.Provider value={variant ?? 'info'}>\n <div\n data-slot=\"callout\"\n className={cn(calloutVariants({ variant }), className)}\n {...props}\n >\n {icon !== false && (\n <MaterialSymbol\n className={cn(\n 'inline-flex shrink-0 items-center [--spark-icon-size:calc(20px*var(--spark-scaling,1))]',\n variantIcon?.className,\n )}\n name={icon ?? variantIcon.name}\n />\n )}\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 CalloutDescription,\n CalloutTitle,\n calloutVariants,\n}\nexport type { CalloutProps, CalloutVariant }\n"],"mappings":";;;;;;;;;;;AAWA,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,MAAM;EAAU,WAAW;CAAmB;CACvD,SAAS;EAAE,MAAM;EAAgB,WAAW;CAAqB;CACjE,SAAS;EAAE,MAAM;EAAW,WAAW;CAAqB;CAC5D,MAAM;EAAE,MAAM;EAAQ,WAAW;CAAkB;CAGnD,SAAS;EAAE,MAAM;EAAQ,WAAW;CAAkB;AACxD;AAUA,MAAM,gBAAgB,EACpB,WACA,GAAG,YAEH,iBAAA,GAAA,kBAAA,KAAC,QAAD;CACE,aAAU;CACV,YAAA,GAAA,OAAA,IAAc,qCAAqC,SAAS;CAC5D,GAAI;AACL,CAAA;AAGH,MAAM,sBAAsB,EAC1B,WACA,GAAG,YAEH,iBAAA,GAAA,kBAAA,KAAC,KAAD;CACE,aAAU;CACV,YAAA,GAAA,OAAA,IAAc,WAAW,SAAS;CAClC,GAAI;AACL,CAAA;AAGH,MAAM,wBAAwBA,MAAM,cAA8B,MAAM;AAExE,MAAM,wBAAwD;CAC5D,OACE;CACF,SACE;CACF,SACE;CACF,MAAM;CACN,SACE;AACJ;AAMA,MAAM,iBAAiB,EACrB,WACA,QAAQ,SACR,GAAG,YACoB;CACvB,MAAM,iBAAiBA,MAAM,WAAW,qBAAqB;CAE7D,OACE,iBAAA,GAAA,kBAAA,KAACC,0BAAAA,QAAD;EACE,aAAU;EACV,MAAK;EACL,cAAa;EACb,OAAM;EACN,YAAA,GAAA,OAAA,IACE,cACA;GAAE,cAAc,UAAU;GAAS,YAAY,UAAU;EAAM,GAC/D,sBAAsB,iBACtB,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,WAAW,EACf,UAAU,QACV,MACA,WACA,UACA,GAAG,YACe;CAClB,MAAM,cAAc,cAAc,WAAW;CAE7C,OACE,iBAAA,GAAA,kBAAA,KAAC,sBAAsB,UAAvB;EAAgC,OAAO,WAAW;YAChD,iBAAA,GAAA,kBAAA,MAAC,OAAD;GACE,aAAU;GACV,YAAA,GAAA,OAAA,IAAc,gBAAgB,EAAE,QAAQ,CAAC,GAAG,SAAS;GACrD,GAAI;aAHN,CAKG,SAAS,SACR,iBAAA,GAAA,kBAAA,KAACC,8BAAAA,gBAAD;IACE,YAAA,GAAA,OAAA,IACE,2FACA,aAAa,SACf;IACA,MAAM,QAAQ,YAAY;GAC3B,CAAA,GAEH,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-base-error-soft text-error',\n success: 'bg-base-success-soft text-success',\n warning: 'bg-base-warning-soft text-warning',\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-light' },\n success: { icon: CheckCircle, className: 'text-success-light' },\n warning: { icon: Warning, className: 'text-warning-light' },\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-base-error-soft text-error hover:bg-red-a4 focus-visible:bg-red-a4',\n success:\n 'bg-base-success-soft text-success hover:bg-green-a4 focus-visible:bg-green-a4',\n warning:\n 'bg-base-warning-soft text-warning hover:bg-orange-a4 focus-visible:bg-orange-a4',\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 ? 'accent' : '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;CAAmB;CACrD,SAAS;EAAE,MAAMC,oBAAAA;EAAa,WAAW;CAAqB;CAC9D,SAAS;EAAE,MAAMC,oBAAAA;EAAS,WAAW;CAAqB;CAC1D,MAAM;EAAE,MAAMC,oBAAAA;EAAM,WAAW;CAAkB;CACjD,SAAS;EAAE,MAAMA,oBAAAA;EAAM,WAAW;CAAkB;AACtD;AAUA,MAAM,gBAAgB,EACpB,WACA,GAAG,YAEH,iBAAA,GAAA,kBAAA,KAAC,QAAD;CACE,aAAU;CACV,YAAA,GAAA,OAAA,IAAc,qCAAqC,SAAS;CAC5D,GAAI;AACL,CAAA;AAGH,MAAM,sBAAsB,EAC1B,WACA,GAAG,YAEH,iBAAA,GAAA,kBAAA,KAAC,KAAD;CACE,aAAU;CACV,YAAA,GAAA,OAAA,IAAc,WAAW,SAAS;CAClC,GAAI;AACL,CAAA;AAGH,MAAM,wBAAwBC,MAAM,cAA8B,MAAM;AAExE,MAAM,wBAAwD;CAC5D,OACE;CACF,SACE;CACF,SACE;CACF,MAAM;CACN,SACE;AACJ;AAEA,MAAM,kBAAkB,EACtB,WACA,GAAG,YAEH,iBAAA,GAAA,kBAAA,KAAC,OAAD;CACE,aAAU;CACV,YAAA,GAAA,OAAA,IACE,8EACA,SACF;CACA,GAAI;AACL,CAAA;AAQH,MAAM,iBAAiB,EACrB,WACA,QAAQ,SACR,UAAU,OACV,GAAG,YACoB;CACvB,MAAM,iBAAiBA,MAAM,WAAW,qBAAqB;CAE7D,OACE,iBAAA,GAAA,kBAAA,KAACC,0BAAAA,QAAD;EACE,aAAU;EACV,MAAK;EACL,cAAc,UAAU,UAAU;EAClC,OAAO,UAAU,WAAW;EAC5B,YAAA,GAAA,OAAA,IACE,cACA;GAAE,cAAc,UAAU;GAAS,YAAY,UAAU;EAAM,GAC/D,CAAC,WAAW,sBAAsB,iBAClC,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,WAAW,EACf,UAAU,QACV,MACA,WACA,UACA,GAAG,YACe;CAClB,MAAM,cAAc,cAAc,WAAW;CAC7C,MAAM,QAAQ,SAAS,QAAQ,OAAQ,QAAQ,YAAY;CAE3D,OACE,iBAAA,GAAA,kBAAA,KAAC,sBAAsB,UAAvB;EAAgC,OAAO,WAAW;YAChD,iBAAA,GAAA,kBAAA,MAAC,OAAD;GACE,aAAU;GACV,YAAA,GAAA,OAAA,IAAc,gBAAgB,EAAE,QAAQ,CAAC,GAAG,SAAS;GACrD,GAAI;aAHN,CAKG,QACC,iBAAA,GAAA,kBAAA,KAAC,OAAD,EACE,YAAA,GAAA,OAAA,IACE,yDACA,YAAY,SACd,EACD,CAAA,IACC,MACJ,iBAAA,GAAA,kBAAA,KAAC,OAAD;IAAK,WAAU;IAAsC;GAAc,CAAA,CAChE;;CACyB,CAAA;AAEpC"}
@@ -1,18 +1,18 @@
1
1
  "use client";
2
2
 
3
3
  import { ButtonProps } from "./button.cjs";
4
- import { MaterialSymbolIconName } from "../icons/material-symbol.cjs";
5
4
  import * as React$1 from "react";
6
5
  import { VariantProps } from "class-variance-authority";
6
+ import { SparkIcon } from "@epilot/spark-icons";
7
7
 
8
8
  //#region src/components/callout.d.ts
9
9
  type CalloutVariant = 'error' | 'info' | 'neutral' | 'success' | 'warning';
10
10
  declare const calloutVariants: (props?: ({
11
- variant?: "neutral" | "success" | "warning" | "info" | "error" | null | undefined;
11
+ variant?: "error" | "success" | "warning" | "info" | "neutral" | null | undefined;
12
12
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
13
13
  interface CalloutProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof calloutVariants> {
14
14
  /** Overrides the variant's default icon; the variant's color is kept. `false` renders no icon. */
15
- icon?: MaterialSymbolIconName | false;
15
+ icon?: SparkIcon | false;
16
16
  }
17
17
  declare const CalloutTitle: ({
18
18
  className,
@@ -22,12 +22,18 @@ declare const CalloutDescription: ({
22
22
  className,
23
23
  ...props
24
24
  }: React$1.HTMLAttributes<HTMLParagraphElement>) => import("react/jsx-runtime").JSX.Element;
25
+ declare const CalloutActions: ({
26
+ className,
27
+ ...props
28
+ }: React$1.HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
25
29
  type CalloutActionType = Omit<ButtonProps, 'styleVariant' | 'color'> & {
26
30
  align?: 'start' | 'end';
31
+ primary?: boolean;
27
32
  };
28
33
  declare const CalloutAction: ({
29
34
  className,
30
35
  align,
36
+ primary,
31
37
  ...props
32
38
  }: CalloutActionType) => import("react/jsx-runtime").JSX.Element;
33
39
  declare const Callout: ({
@@ -38,5 +44,5 @@ declare const Callout: ({
38
44
  ...props
39
45
  }: CalloutProps) => import("react/jsx-runtime").JSX.Element;
40
46
  //#endregion
41
- export { Callout, CalloutAction, CalloutDescription, type CalloutProps, CalloutTitle, type CalloutVariant, calloutVariants };
47
+ export { Callout, CalloutAction, CalloutActions, CalloutDescription, type CalloutProps, CalloutTitle, type CalloutVariant, calloutVariants };
42
48
  //# sourceMappingURL=callout.d.cts.map
@@ -1,18 +1,18 @@
1
1
  "use client";
2
2
 
3
3
  import { ButtonProps } from "./button.js";
4
- import { MaterialSymbolIconName } from "../icons/material-symbol.js";
5
4
  import * as React$1 from "react";
5
+ import { SparkIcon } from "@epilot/spark-icons";
6
6
  import { VariantProps } from "class-variance-authority";
7
7
 
8
8
  //#region src/components/callout.d.ts
9
9
  type CalloutVariant = 'error' | 'info' | 'neutral' | 'success' | 'warning';
10
10
  declare const calloutVariants: (props?: ({
11
- variant?: "neutral" | "success" | "warning" | "info" | "error" | null | undefined;
11
+ variant?: "error" | "success" | "warning" | "info" | "neutral" | null | undefined;
12
12
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
13
13
  interface CalloutProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof calloutVariants> {
14
14
  /** Overrides the variant's default icon; the variant's color is kept. `false` renders no icon. */
15
- icon?: MaterialSymbolIconName | false;
15
+ icon?: SparkIcon | false;
16
16
  }
17
17
  declare const CalloutTitle: ({
18
18
  className,
@@ -22,12 +22,18 @@ declare const CalloutDescription: ({
22
22
  className,
23
23
  ...props
24
24
  }: React$1.HTMLAttributes<HTMLParagraphElement>) => import("react/jsx-runtime").JSX.Element;
25
+ declare const CalloutActions: ({
26
+ className,
27
+ ...props
28
+ }: React$1.HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
25
29
  type CalloutActionType = Omit<ButtonProps, 'styleVariant' | 'color'> & {
26
30
  align?: 'start' | 'end';
31
+ primary?: boolean;
27
32
  };
28
33
  declare const CalloutAction: ({
29
34
  className,
30
35
  align,
36
+ primary,
31
37
  ...props
32
38
  }: CalloutActionType) => import("react/jsx-runtime").JSX.Element;
33
39
  declare const Callout: ({
@@ -38,5 +44,5 @@ declare const Callout: ({
38
44
  ...props
39
45
  }: CalloutProps) => import("react/jsx-runtime").JSX.Element;
40
46
  //#endregion
41
- export { Callout, CalloutAction, CalloutDescription, type CalloutProps, CalloutTitle, type CalloutVariant, calloutVariants };
47
+ export { Callout, CalloutAction, CalloutActions, CalloutDescription, type CalloutProps, CalloutTitle, type CalloutVariant, calloutVariants };
42
48
  //# sourceMappingURL=callout.d.ts.map
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { cn } from "../utils/cn.js";
3
- import { MaterialSymbol } from "../icons/material-symbol.js";
4
3
  import { Button } from "./button.js";
5
4
  import * as React$1 from "react";
5
+ import { Cancel, CheckCircle, Info, Warning } from "@epilot/spark-icons";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import { cva } from "class-variance-authority";
8
8
  //#region src/components/callout.tsx
@@ -18,23 +18,23 @@ const calloutVariants = cva("group/callout flex w-full items-start gap-2 rounded
18
18
  });
19
19
  const CALLOUT_ICONS = {
20
20
  error: {
21
- name: "cancel",
21
+ icon: Cancel,
22
22
  className: "text-error-light"
23
23
  },
24
24
  success: {
25
- name: "check_circle",
25
+ icon: CheckCircle,
26
26
  className: "text-success-light"
27
27
  },
28
28
  warning: {
29
- name: "warning",
29
+ icon: Warning,
30
30
  className: "text-warning-light"
31
31
  },
32
32
  info: {
33
- name: "info",
33
+ icon: Info,
34
34
  className: "text-info-light"
35
35
  },
36
36
  neutral: {
37
- name: "info",
37
+ icon: Info,
38
38
  className: "text-gray-light"
39
39
  }
40
40
  };
@@ -56,32 +56,35 @@ const CALLOUT_ACTION_COLORS = {
56
56
  info: "bg-base-info-soft text-info hover:bg-blue-a4 focus-visible:bg-blue-a4",
57
57
  neutral: "bg-base-gray-soft text-gray hover:bg-gray-a4 focus-visible:bg-gray-a4"
58
58
  };
59
- const CalloutAction = ({ className, align = "start", ...props }) => {
59
+ const CalloutActions = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
60
+ "data-slot": "callout-actions",
61
+ className: cn("mt-2 flex flex-wrap items-center gap-2 [&_[data-slot=callout-action]]:mt-0", className),
62
+ ...props
63
+ });
64
+ const CalloutAction = ({ className, align = "start", primary = false, ...props }) => {
60
65
  const calloutVariant = React$1.useContext(CalloutVariantContext);
61
66
  return /* @__PURE__ */ jsx(Button, {
62
67
  "data-slot": "callout-action",
63
68
  size: "small",
64
- styleVariant: "surface",
65
- color: "neutral",
69
+ styleVariant: primary ? "solid" : "surface",
70
+ color: primary ? "accent" : "neutral",
66
71
  className: cn("mt-2 w-fit", {
67
72
  "self-start": align === "start",
68
73
  "self-end": align === "end"
69
- }, CALLOUT_ACTION_COLORS[calloutVariant], className),
74
+ }, !primary && CALLOUT_ACTION_COLORS[calloutVariant], className),
70
75
  ...props
71
76
  });
72
77
  };
73
78
  const Callout = ({ variant = "info", icon, className, children, ...props }) => {
74
79
  const variantIcon = CALLOUT_ICONS[variant ?? "info"];
80
+ const Glyph = icon === false ? null : icon ?? variantIcon.icon;
75
81
  return /* @__PURE__ */ jsx(CalloutVariantContext.Provider, {
76
82
  value: variant ?? "info",
77
83
  children: /* @__PURE__ */ jsxs("div", {
78
84
  "data-slot": "callout",
79
85
  className: cn(calloutVariants({ variant }), className),
80
86
  ...props,
81
- children: [icon !== false && /* @__PURE__ */ jsx(MaterialSymbol, {
82
- className: cn("inline-flex shrink-0 items-center [--spark-icon-size:calc(20px*var(--spark-scaling,1))]", variantIcon?.className),
83
- name: icon ?? variantIcon.name
84
- }), /* @__PURE__ */ jsx("div", {
87
+ children: [Glyph ? /* @__PURE__ */ jsx(Glyph, { className: cn("[--spark-icon-size:calc(20px*var(--spark-scaling,1))]", variantIcon.className) }) : null, /* @__PURE__ */ jsx("div", {
85
88
  className: "flex w-full min-w-0 flex-col gap-1",
86
89
  children
87
90
  })]
@@ -89,6 +92,6 @@ const Callout = ({ variant = "info", icon, className, children, ...props }) => {
89
92
  });
90
93
  };
91
94
  //#endregion
92
- export { Callout, CalloutAction, CalloutDescription, CalloutTitle, calloutVariants };
95
+ export { Callout, CalloutAction, CalloutActions, CalloutDescription, CalloutTitle, calloutVariants };
93
96
 
94
97
  //# sourceMappingURL=callout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"callout.js","names":["React"],"sources":["../../src/components/callout.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\nimport {\n MaterialSymbol,\n type MaterialSymbolIconName,\n} from '../icons/material-symbol'\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-base-error-soft text-error',\n success: 'bg-base-success-soft text-success',\n warning: 'bg-base-warning-soft text-warning',\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 { name: MaterialSymbolIconName; className: string }\n> = {\n error: { name: 'cancel', className: 'text-error-light' },\n success: { name: 'check_circle', className: 'text-success-light' },\n warning: { name: 'warning', className: 'text-warning-light' },\n info: { name: 'info', className: 'text-info-light' },\n // no severity to signal, so it borrows info's glyph — pass `icon` to change it\n // or `icon={false}` for a bare panel.\n neutral: { name: '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?: MaterialSymbolIconName | 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-base-error-soft text-error hover:bg-red-a4 focus-visible:bg-red-a4',\n success:\n 'bg-base-success-soft text-success hover:bg-green-a4 focus-visible:bg-green-a4',\n warning:\n 'bg-base-warning-soft text-warning hover:bg-orange-a4 focus-visible:bg-orange-a4',\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\ntype CalloutActionType = Omit<ButtonProps, 'styleVariant' | 'color'> & {\n align?: 'start' | 'end'\n}\n\nconst CalloutAction = ({\n className,\n align = 'start',\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=\"surface\"\n color=\"neutral\"\n className={cn(\n 'mt-2 w-fit',\n { 'self-start': align === 'start', 'self-end': align === 'end' },\n 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\n return (\n <CalloutVariantContext.Provider value={variant ?? 'info'}>\n <div\n data-slot=\"callout\"\n className={cn(calloutVariants({ variant }), className)}\n {...props}\n >\n {icon !== false && (\n <MaterialSymbol\n className={cn(\n 'inline-flex shrink-0 items-center [--spark-icon-size:calc(20px*var(--spark-scaling,1))]',\n variantIcon?.className,\n )}\n name={icon ?? variantIcon.name}\n />\n )}\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 CalloutDescription,\n CalloutTitle,\n calloutVariants,\n}\nexport type { CalloutProps, CalloutVariant }\n"],"mappings":";;;;;;;;AAWA,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;EAAU,WAAW;CAAmB;CACvD,SAAS;EAAE,MAAM;EAAgB,WAAW;CAAqB;CACjE,SAAS;EAAE,MAAM;EAAW,WAAW;CAAqB;CAC5D,MAAM;EAAE,MAAM;EAAQ,WAAW;CAAkB;CAGnD,SAAS;EAAE,MAAM;EAAQ,WAAW;CAAkB;AACxD;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;AAMA,MAAM,iBAAiB,EACrB,WACA,QAAQ,SACR,GAAG,YACoB;CACvB,MAAM,iBAAiBA,QAAM,WAAW,qBAAqB;CAE7D,OACE,oBAAC,QAAD;EACE,aAAU;EACV,MAAK;EACL,cAAa;EACb,OAAM;EACN,WAAW,GACT,cACA;GAAE,cAAc,UAAU;GAAS,YAAY,UAAU;EAAM,GAC/D,sBAAsB,iBACtB,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,WAAW,EACf,UAAU,QACV,MACA,WACA,UACA,GAAG,YACe;CAClB,MAAM,cAAc,cAAc,WAAW;CAE7C,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,SAAS,SACR,oBAAC,gBAAD;IACE,WAAW,GACT,2FACA,aAAa,SACf;IACA,MAAM,QAAQ,YAAY;GAC3B,CAAA,GAEH,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-base-error-soft text-error',\n success: 'bg-base-success-soft text-success',\n warning: 'bg-base-warning-soft text-warning',\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-light' },\n success: { icon: CheckCircle, className: 'text-success-light' },\n warning: { icon: Warning, className: 'text-warning-light' },\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-base-error-soft text-error hover:bg-red-a4 focus-visible:bg-red-a4',\n success:\n 'bg-base-success-soft text-success hover:bg-green-a4 focus-visible:bg-green-a4',\n warning:\n 'bg-base-warning-soft text-warning hover:bg-orange-a4 focus-visible:bg-orange-a4',\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 ? 'accent' : '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,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;CAAmB;CACrD,SAAS;EAAE,MAAM;EAAa,WAAW;CAAqB;CAC9D,SAAS;EAAE,MAAM;EAAS,WAAW;CAAqB;CAC1D,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,WAAW;EAC5B,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"}