@epilot/spark-ui 0.20.1 → 0.21.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 (193) hide show
  1. package/dist/components/accordion.cjs +5 -5
  2. package/dist/components/accordion.cjs.map +1 -1
  3. package/dist/components/alert-dialog.cjs +9 -9
  4. package/dist/components/alert-dialog.cjs.map +1 -1
  5. package/dist/components/attachment.cjs +10 -10
  6. package/dist/components/attachment.cjs.map +1 -1
  7. package/dist/components/attachment.d.cts +2 -2
  8. package/dist/components/attachment.d.ts +2 -2
  9. package/dist/components/autocomplete.cjs +12 -12
  10. package/dist/components/autocomplete.cjs.map +1 -1
  11. package/dist/components/avatar.cjs +2 -2
  12. package/dist/components/avatar.cjs.map +1 -1
  13. package/dist/components/avatar.js +1 -1
  14. package/dist/components/badge.cjs +2 -2
  15. package/dist/components/badge.cjs.map +1 -1
  16. package/dist/components/badge.js +1 -1
  17. package/dist/components/bar-chart.cjs +3 -3
  18. package/dist/components/bar-chart.cjs.map +1 -1
  19. package/dist/components/box.cjs +2 -2
  20. package/dist/components/box.cjs.map +1 -1
  21. package/dist/components/box.js +1 -1
  22. package/dist/components/breadcrumbs.cjs +7 -7
  23. package/dist/components/breadcrumbs.cjs.map +1 -1
  24. package/dist/components/bubble.cjs +5 -5
  25. package/dist/components/bubble.cjs.map +1 -1
  26. package/dist/components/bubble.d.cts +1 -1
  27. package/dist/components/bubble.d.ts +1 -1
  28. package/dist/components/button-group.cjs +5 -5
  29. package/dist/components/button-group.cjs.map +1 -1
  30. package/dist/components/button-group.js +1 -1
  31. package/dist/components/button.cjs +2 -2
  32. package/dist/components/button.cjs.map +1 -1
  33. package/dist/components/button.d.cts +2 -2
  34. package/dist/components/button.d.ts +2 -2
  35. package/dist/components/button.js +1 -1
  36. package/dist/components/calendar.cjs +8 -8
  37. package/dist/components/calendar.cjs.map +1 -1
  38. package/dist/components/callout.cjs +7 -7
  39. package/dist/components/callout.cjs.map +1 -1
  40. package/dist/components/callout.d.cts +1 -1
  41. package/dist/components/callout.d.ts +1 -1
  42. package/dist/components/card.cjs +16 -16
  43. package/dist/components/card.cjs.map +1 -1
  44. package/dist/components/card.js +2 -2
  45. package/dist/components/card.js.map +1 -1
  46. package/dist/components/chart.cjs +2 -2
  47. package/dist/components/chart.cjs.map +1 -1
  48. package/dist/components/checkbox.cjs +2 -2
  49. package/dist/components/checkbox.cjs.map +1 -1
  50. package/dist/components/checkbox.js +1 -1
  51. package/dist/components/circular-gauge.cjs +3 -3
  52. package/dist/components/circular-gauge.cjs.map +1 -1
  53. package/dist/components/day-of-week-picker.cjs +4 -4
  54. package/dist/components/day-of-week-picker.cjs.map +1 -1
  55. package/dist/components/dialog.cjs +8 -8
  56. package/dist/components/dialog.cjs.map +1 -1
  57. package/dist/components/drawer.cjs +8 -8
  58. package/dist/components/drawer.cjs.map +1 -1
  59. package/dist/components/dropdown-menu.cjs +10 -10
  60. package/dist/components/dropdown-menu.cjs.map +1 -1
  61. package/dist/components/entity-card.cjs +11 -11
  62. package/dist/components/entity-card.cjs.map +1 -1
  63. package/dist/components/field.cjs +15 -15
  64. package/dist/components/field.cjs.map +1 -1
  65. package/dist/components/hero-metric.cjs +4 -4
  66. package/dist/components/hero-metric.cjs.map +1 -1
  67. package/dist/components/icon.cjs +2 -2
  68. package/dist/components/icon.cjs.map +1 -1
  69. package/dist/components/icon.js +1 -1
  70. package/dist/components/info-block.cjs +9 -9
  71. package/dist/components/info-block.cjs.map +1 -1
  72. package/dist/components/info-block.d.cts +1 -1
  73. package/dist/components/info-block.d.ts +1 -1
  74. package/dist/components/input-date.cjs +2 -2
  75. package/dist/components/input-date.cjs.map +1 -1
  76. package/dist/components/input-group.cjs +5 -5
  77. package/dist/components/input-group.cjs.map +1 -1
  78. package/dist/components/input-group.d.cts +1 -1
  79. package/dist/components/input-group.d.ts +1 -1
  80. package/dist/components/input-otp.cjs +3 -3
  81. package/dist/components/input-otp.cjs.map +1 -1
  82. package/dist/components/input-otp.js +1 -1
  83. package/dist/components/input.cjs +3 -3
  84. package/dist/components/input.cjs.map +1 -1
  85. package/dist/components/input.js +1 -1
  86. package/dist/components/label.cjs +2 -2
  87. package/dist/components/label.cjs.map +1 -1
  88. package/dist/components/layout.cjs +2 -2
  89. package/dist/components/layout.cjs.map +1 -1
  90. package/dist/components/line-chart.cjs +4 -4
  91. package/dist/components/line-chart.cjs.map +1 -1
  92. package/dist/components/list.cjs +10 -10
  93. package/dist/components/list.cjs.map +1 -1
  94. package/dist/components/list.js +1 -1
  95. package/dist/components/list.js.map +1 -1
  96. package/dist/components/marker.cjs +4 -4
  97. package/dist/components/marker.cjs.map +1 -1
  98. package/dist/components/marker.d.cts +1 -1
  99. package/dist/components/marker.d.ts +1 -1
  100. package/dist/components/message-scroller.cjs +7 -7
  101. package/dist/components/message-scroller.cjs.map +1 -1
  102. package/dist/components/message-scroller.js +2 -2
  103. package/dist/components/message-scroller.js.map +1 -1
  104. package/dist/components/message.cjs +7 -7
  105. package/dist/components/message.cjs.map +1 -1
  106. package/dist/components/page-header.cjs +5 -5
  107. package/dist/components/page-header.cjs.map +1 -1
  108. package/dist/components/page-header.d.cts +1 -1
  109. package/dist/components/page-header.d.ts +1 -1
  110. package/dist/components/period-tabs.cjs +6 -6
  111. package/dist/components/period-tabs.cjs.map +1 -1
  112. package/dist/components/pill.cjs +2 -2
  113. package/dist/components/pill.cjs.map +1 -1
  114. package/dist/components/pill.js +1 -1
  115. package/dist/components/popover.cjs +2 -2
  116. package/dist/components/popover.cjs.map +1 -1
  117. package/dist/components/power-history-chart.cjs +2 -2
  118. package/dist/components/power-history-chart.cjs.map +1 -1
  119. package/dist/components/power-network.cjs +9 -9
  120. package/dist/components/power-network.cjs.map +1 -1
  121. package/dist/components/progress.cjs +2 -2
  122. package/dist/components/progress.cjs.map +1 -1
  123. package/dist/components/radio-card-group.cjs +3 -3
  124. package/dist/components/radio-card-group.cjs.map +1 -1
  125. package/dist/components/radio.cjs +3 -3
  126. package/dist/components/radio.cjs.map +1 -1
  127. package/dist/components/radio.js +1 -1
  128. package/dist/components/sankey-chart.cjs +2 -2
  129. package/dist/components/sankey-chart.cjs.map +1 -1
  130. package/dist/components/schedule-editor.cjs +9 -9
  131. package/dist/components/schedule-editor.cjs.map +1 -1
  132. package/dist/components/schedule-list.cjs +10 -10
  133. package/dist/components/schedule-list.cjs.map +1 -1
  134. package/dist/components/scroll-area.cjs +3 -3
  135. package/dist/components/scroll-area.cjs.map +1 -1
  136. package/dist/components/segmented-control.cjs +4 -4
  137. package/dist/components/segmented-control.cjs.map +1 -1
  138. package/dist/components/select.cjs +12 -12
  139. package/dist/components/select.cjs.map +1 -1
  140. package/dist/components/select.js +1 -1
  141. package/dist/components/separator.cjs +3 -3
  142. package/dist/components/separator.cjs.map +1 -1
  143. package/dist/components/series-legend.cjs +4 -4
  144. package/dist/components/series-legend.cjs.map +1 -1
  145. package/dist/components/sheet.cjs +8 -8
  146. package/dist/components/sheet.cjs.map +1 -1
  147. package/dist/components/skeleton.cjs +3 -3
  148. package/dist/components/skeleton.cjs.map +1 -1
  149. package/dist/components/slider.cjs +11 -11
  150. package/dist/components/slider.cjs.map +1 -1
  151. package/dist/components/solar-forecast-chart.cjs +2 -2
  152. package/dist/components/solar-forecast-chart.cjs.map +1 -1
  153. package/dist/components/sortable-list.cjs +3 -3
  154. package/dist/components/sortable-list.cjs.map +1 -1
  155. package/dist/components/spinner.cjs +2 -2
  156. package/dist/components/spinner.cjs.map +1 -1
  157. package/dist/components/stat-card.cjs +8 -8
  158. package/dist/components/stat-card.cjs.map +1 -1
  159. package/dist/components/stepper.cjs +2 -2
  160. package/dist/components/stepper.cjs.map +1 -1
  161. package/dist/components/switch.cjs +3 -3
  162. package/dist/components/switch.cjs.map +1 -1
  163. package/dist/components/switch.js +1 -1
  164. package/dist/components/table.cjs +8 -8
  165. package/dist/components/table.cjs.map +1 -1
  166. package/dist/components/tabs.cjs +7 -7
  167. package/dist/components/tabs.cjs.map +1 -1
  168. package/dist/components/textarea.cjs +3 -3
  169. package/dist/components/textarea.cjs.map +1 -1
  170. package/dist/components/textarea.js +1 -1
  171. package/dist/components/theme.cjs +2 -2
  172. package/dist/components/theme.cjs.map +1 -1
  173. package/dist/components/theme.js +1 -1
  174. package/dist/components/thumbnail.cjs +3 -3
  175. package/dist/components/thumbnail.cjs.map +1 -1
  176. package/dist/components/time-picker.cjs +3 -3
  177. package/dist/components/time-picker.cjs.map +1 -1
  178. package/dist/components/toast.cjs +7 -7
  179. package/dist/components/toast.cjs.map +1 -1
  180. package/dist/components/tooltip.cjs +3 -3
  181. package/dist/components/tooltip.cjs.map +1 -1
  182. package/dist/components/typography.cjs +6 -6
  183. package/dist/components/typography.cjs.map +1 -1
  184. package/dist/components/wizard-layout.cjs +8 -8
  185. package/dist/components/wizard-layout.cjs.map +1 -1
  186. package/dist/lib/input-box-variants.cjs +9 -9
  187. package/dist/lib/input-box-variants.cjs.map +1 -1
  188. package/dist/styles/spark-default.css +11 -0
  189. package/dist/utils/cn.cjs +2 -2
  190. package/dist/utils/cn.d.cts +1 -1
  191. package/dist/utils/cn.d.ts +1 -1
  192. package/dist/utils/cn.js +1 -1
  193. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"theme.cjs","names":["React","resolveAutoNeutral","isSparkNeutralFamily","isParsableColor","getMatchingNeutral","CURATED_ACCENTS","appearanceForBackground","accentSparkVars","neutralSparkVars","generateAccentScale","invertAccentScale","neutralFamilyVars"],"sources":["../../src/components/theme.tsx"],"sourcesContent":["'use client'\n\nimport { mergeProps } from '@base-ui/react/merge-props'\nimport { useRender } from '@base-ui/react/use-render'\nimport * as React from 'react'\nimport {\n CURATED_ACCENTS,\n accentSparkVars,\n appearanceForBackground,\n generateAccentScale,\n getMatchingNeutral,\n invertAccentScale,\n isParsableColor,\n neutralFamilyVars,\n neutralSparkVars,\n resolveAutoNeutral,\n type Appearance,\n type SparkAccentScale,\n} from '../lib/accent-theme'\nimport {\n isSparkNeutralFamily,\n type SparkCardColor,\n type SparkCardVariant,\n type SparkInputColor,\n type SparkInputStyle,\n type SparkLabelPosition,\n type SparkNeutral,\n type SparkRadius,\n type SparkScaling,\n type SparkSpacing,\n type SparkStyle,\n} from '../lib/theme-types'\nimport { cn } from '../utils/cn'\n\nexport type {\n SparkCardColor,\n SparkCardVariant,\n SparkInputColor,\n SparkInputStyle,\n SparkLabelPosition,\n SparkNeutral,\n SparkNeutralFamily,\n SparkRadius,\n SparkScaling,\n SparkSpacing,\n SparkStyle,\n} from '../lib/theme-types'\n\n/** The epilot brand accent — the scale `spark-default.css` ships statically. */\nconst DEFAULT_ACCENT = '#005EB4'\n\nexport interface ThemeValue {\n /** Curated accent name or a custom hex. */\n accentColor?: string\n /**\n * Page canvas as a custom hex. Regenerates BOTH the accent and neutral scales against\n * it (each alpha step is composited against the canvas, so a saturated colour needs\n * the neutral ramp regenerated too, not just the accent). Unset → the fixed\n * `#ffffff` / `#000000` default, and neutrals stay on the static Radix families.\n */\n backgroundColor?: string\n /**\n * A curated family name, an arbitrary color to seed the neutral scale, or `'auto'` to\n * resolve one — preferring `backgroundColor`'s own hue when it's perceptibly tinted,\n * else pairing with the accent (Radix's `grayColor=\"auto\"`). A custom seed (from `auto`\n * or set directly) only regenerates the scale alongside a `backgroundColor`; without\n * one, `data-neutral-color` falls back to the accent-matched family and that's what\n * actually paints.\n */\n neutralColor?: SparkNeutral\n radius?: SparkRadius\n scaling?: SparkScaling\n spacing?: SparkSpacing\n styleVariant?: SparkStyle\n /** Orthogonal to `styleVariant`: shifts any style toward higher-contrast steps. */\n highContrast?: boolean\n /**\n * Orthogonal to `styleVariant`: re-casts the accent scale for use ON its own solid fill,\n * for controls sitting on a solid accent surface (a `<Card variant=\"solid\" color=\"accent\">`),\n * where a solid control would otherwise paint the same `--spark-9` as the card and vanish.\n * Swaps step 9 with its contrast ink, so the fill/ink pair stays WCAG-safe for any accent.\n */\n inverted?: boolean\n labelPosition?: SparkLabelPosition\n inputStyle?: SparkInputStyle\n inputColor?: SparkInputColor\n /** App-level default `<Card>` chrome; a per-card `variant` prop overrides it. */\n cardVariant?: SparkCardVariant\n /** App-level default `<Card>` palette; a per-card `color` prop overrides it. */\n cardColor?: SparkCardColor\n appearance?: Appearance\n /** Font stack for `h1`–`h6`. Any valid CSS `font-family` value. */\n fontHeading?: string\n /** Font stack for everything else. Any valid CSS `font-family` value. */\n fontBody?: string\n}\n\nconst ThemeContext = React.createContext<ThemeValue>({})\n\n/** Merged theme values from enclosing `<Theme>` providers. */\nexport function useTheme(): ThemeValue {\n return React.useContext(ThemeContext)\n}\n\nexport interface ThemeProps\n extends useRender.ComponentProps<'div'>, ThemeValue {}\n\n/** Optional sugar: writes the theming `data-*` attrs + accent `--spark-*` vars onto a wrapper. */\nexport const Theme = React.forwardRef<HTMLDivElement, ThemeProps>(\n function Theme(\n {\n accentColor,\n backgroundColor,\n neutralColor,\n radius,\n scaling,\n spacing,\n styleVariant,\n highContrast,\n inverted,\n labelPosition,\n inputStyle,\n inputColor,\n cardVariant,\n cardColor,\n appearance,\n fontHeading,\n fontBody,\n render,\n className,\n style,\n children,\n ...rest\n },\n ref,\n ) {\n const parent = useTheme()\n\n const value = React.useMemo<ThemeValue>(\n () => ({\n accentColor: accentColor ?? parent.accentColor,\n backgroundColor: backgroundColor ?? parent.backgroundColor,\n neutralColor: neutralColor ?? parent.neutralColor,\n radius: radius ?? parent.radius,\n scaling: scaling ?? parent.scaling,\n spacing: spacing ?? parent.spacing,\n styleVariant: styleVariant ?? parent.styleVariant,\n highContrast: highContrast ?? parent.highContrast,\n inverted: inverted ?? parent.inverted,\n labelPosition: labelPosition ?? parent.labelPosition,\n inputStyle: inputStyle ?? parent.inputStyle,\n inputColor: inputColor ?? parent.inputColor,\n cardVariant: cardVariant ?? parent.cardVariant,\n cardColor: cardColor ?? parent.cardColor,\n appearance: appearance ?? parent.appearance,\n fontHeading: fontHeading ?? parent.fontHeading,\n fontBody: fontBody ?? parent.fontBody,\n }),\n [\n accentColor,\n backgroundColor,\n neutralColor,\n radius,\n scaling,\n spacing,\n styleVariant,\n highContrast,\n inverted,\n labelPosition,\n inputStyle,\n inputColor,\n cardVariant,\n cardColor,\n appearance,\n fontHeading,\n fontBody,\n parent,\n ],\n )\n\n // Scope id for the ambient-appearance case (both scales emitted in a <style>).\n const scopeId = React.useId()\n\n // 'auto' pairs a neutral with the canvas's own tint when it has one, else the\n // effective accent (Radix's grayColor=\"auto\") — see resolveAutoNeutral. Reads the\n // OWN backgroundColor, not the merged value.backgroundColor: optsFor (below) only\n // ever regenerates against a scope's own canvas too, so preferring an inherited one\n // here would resolve a seed that then gets silently discarded.\n const rawNeutralColor =\n neutralColor === 'auto'\n ? resolveAutoNeutral(\n value.accentColor ?? DEFAULT_ACCENT,\n backgroundColor,\n )\n : neutralColor\n\n // A custom neutral that isn't a recognized family must be a real, parseable color —\n // reject invalid input here (e.g. a typo'd family name like \"slat\") so it can't throw\n // deep inside the shared generator, where the catch below would otherwise blame\n // accentColor/backgroundColor without ever naming neutralColor as the actual cause.\n const neutralColorIsValid =\n rawNeutralColor === undefined ||\n isSparkNeutralFamily(rawNeutralColor) ||\n isParsableColor(rawNeutralColor)\n if (!neutralColorIsValid) {\n console.warn(\n `[Theme] Ignoring invalid neutralColor \"${rawNeutralColor}\" — falling back to the accent-matched family.`,\n )\n }\n const resolvedNeutralColor = neutralColorIsValid\n ? rawNeutralColor\n : getMatchingNeutral(value.accentColor ?? DEFAULT_ACCENT)\n\n // The DOM attribute stays one of the 6 static families `[data-neutral-color]` has CSS\n // for — a raw color (from the canvas-tinted auto path, or an arbitrary neutralColor\n // prop) falls back to its accent-matched family here instead, so the attribute is\n // always CSS-selectable/debuggable rather than a sentinel nothing matches.\n // generateAccentScale still gets the real resolvedNeutralColor for generation, below —\n // this substitution is display-only, and doesn't by itself guarantee the *other*\n // appearance's neutrals in ambient (no explicit `appearance`) mode: that's a\n // pre-existing cross-appearance leak in the same family as review-findings.md #5, not\n // something this attribute fallback fixes or regresses.\n const neutralColorAttr =\n resolvedNeutralColor === undefined\n ? undefined\n : isSparkNeutralFamily(resolvedNeutralColor)\n ? resolvedNeutralColor\n : getMatchingNeutral(value.accentColor ?? DEFAULT_ACCENT)\n\n const accent = React.useMemo(() => {\n const empty = {\n inlineVars: {} as React.CSSProperties,\n css: '',\n scoped: false,\n }\n // A custom canvas generates even with no accent of its own: the neutral ramp is\n // composited against it, and --spark-background has to carry it.\n if (!accentColor && !backgroundColor) return empty\n\n const toVars = (decls: string[]) =>\n Object.fromEntries(\n decls\n .filter((decl) => decl.includes(':'))\n .map((decl) => {\n const i = decl.indexOf(':')\n return [\n decl.slice(0, i).trim(),\n decl\n .slice(i + 1)\n .replace(/;$/, '')\n .trim(),\n ]\n }),\n ) as React.CSSProperties\n\n try {\n const source = value.accentColor ?? DEFAULT_ACCENT\n const hex = CURATED_ACCENTS[source] ?? source\n\n // A canvas has a polarity, unlike an accent hue: a yellow page is a *light*\n // page, and reusing it for the dark scale yields light ink on a light canvas\n // (measured 1.16:1). So the custom canvas applies to the appearance it actually\n // belongs to, and the other keeps its default. One knob still covers the common\n // case — a tenant wanting both sets an explicit appearance per scope.\n const bgAppearance = backgroundColor\n ? appearanceForBackground(backgroundColor)\n : undefined\n\n // Honouring a mismatched canvas would paint light ink on a light page, so it's\n // dropped — but say so, or the prop looks broken.\n if (\n backgroundColor &&\n value.appearance &&\n bgAppearance !== value.appearance\n ) {\n console.warn(\n `[Theme] Ignoring backgroundColor \"${backgroundColor}\": it reads as a ${bgAppearance} canvas on an appearance=\"${value.appearance}\" scope. Pass a ${value.appearance} colour, or set it on a scope whose appearance matches.`,\n )\n }\n\n // Default to slate so a regenerated neutral stays in the family the static\n // `:root` default already points at, rather than the generator's ECP gray seed.\n const optsFor = (appearance: Appearance) =>\n backgroundColor && bgAppearance === appearance\n ? {\n background: backgroundColor,\n neutral: resolvedNeutralColor ?? ('slate' as const),\n }\n : undefined\n\n // Neutrals are only worth regenerating against a custom canvas — see\n // neutralSparkVars. Without one the static Radix families are already correct.\n const emit = (scale: SparkAccentScale, custom: boolean) =>\n custom\n ? [...accentSparkVars(scale), ...neutralSparkVars(scale)]\n : accentSparkVars(scale)\n\n const build = (appearance: Appearance) => {\n const opts = optsFor(appearance)\n const scale = generateAccentScale(hex, appearance, opts)\n // `inverted` re-casts the accent for a solid-accent surface; the neutral ramp is\n // unrelated to that swap, so it passes through untouched.\n return emit(inverted ? invertAccentScale(scale) : scale, opts != null)\n }\n\n // Explicit appearance → single-scale inline vars. Correct for a light\n // island inside a dark page (which must NOT pick up the dark scale).\n if (value.appearance) {\n return {\n inlineVars: toVars(build(value.appearance)),\n css: '',\n scoped: false,\n }\n }\n\n // Ambient appearance → emit BOTH scales in a scoped <style> so the\n // `.dark` class selects the right one. Without this, a single-appearance\n // inline scale (default light) breaks components in dark mode.\n //\n // Both blocks must declare the SAME tokens. A custom canvas only regenerates\n // neutrals for its own appearance (see optsFor), and a custom property the other\n // block leaves undeclared keeps its sibling's value rather than falling back — so\n // the off-canvas appearance would paint this one's canvas-tinted neutrals, and\n // being unlayered they'd beat `[data-neutral-color]`'s @layer base mapping too.\n // Point it at the static family instead: the same seed the canvas side was given,\n // so the two appearances agree on family and differ only in canvas.\n const offCanvasNeutrals = backgroundColor\n ? neutralFamilyVars(resolvedNeutralColor ?? 'slate')\n : []\n const scaleFor = (appearance: Appearance) =>\n bgAppearance === appearance\n ? build(appearance)\n : [...build(appearance), ...offCanvasNeutrals]\n const light = scaleFor('light')\n const dark = scaleFor('dark')\n const sel = `[data-spark-scope=\"${scopeId}\"]`\n const css = `${sel}{${light.join('')}}:is(.dark,.dark-theme) ${sel}{${dark.join('')}}`\n return { inlineVars: {} as React.CSSProperties, css, scoped: true }\n } catch (error) {\n // A bad accentColor/backgroundColor must not throw through render — fall back\n // to the default theme.\n console.warn(\n `[Theme] Ignoring invalid accentColor \"${accentColor}\" / backgroundColor \"${backgroundColor}\".`,\n error,\n )\n return empty\n }\n }, [\n accentColor,\n backgroundColor,\n inverted,\n resolvedNeutralColor,\n value.accentColor,\n value.appearance,\n scopeId,\n ])\n\n const element = useRender({\n defaultTagName: 'div',\n render,\n ref,\n props: mergeProps<'div'>(\n {\n className: cn('spark-theme', appearance, className),\n 'data-neutral-color': neutralColorAttr,\n 'data-radius': radius,\n 'data-scaling': scaling,\n 'data-spacing': spacing,\n 'data-style': styleVariant,\n 'data-high-contrast': highContrast ? '' : undefined,\n 'data-inverted': inverted ? '' : undefined,\n 'data-label-position': labelPosition,\n 'data-input-style': inputStyle,\n 'data-input-color': inputColor,\n 'data-card-variant': cardVariant,\n 'data-card-color': cardColor === 'accent' ? 'accent' : undefined,\n 'data-spark-scope': accent.scoped ? scopeId : undefined,\n style: {\n ...accent.inlineVars,\n // Paint the canvas we were handed, else the prop emits a token and visibly\n // does nothing. Reads the var (not the raw prop) so the scoped <style>'s\n // per-appearance value still wins under ambient appearance.\n ...(backgroundColor\n ? { backgroundColor: 'var(--spark-background)' }\n : null),\n ...(fontHeading ? { '--spark-font-heading': fontHeading } : null),\n ...(fontBody ? { '--spark-font-body': fontBody } : null),\n ...style,\n } as React.CSSProperties,\n children,\n } as React.ComponentProps<'div'>,\n rest,\n ),\n })\n\n return (\n <ThemeContext.Provider value={value}>\n {accent.css ? <style>{accent.css}</style> : null}\n {element}\n </ThemeContext.Provider>\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;;AAiDA,MAAM,iBAAiB;AAgDvB,MAAM,eAAeA,MAAM,cAA0B,CAAC,CAAC;;AAGvD,SAAgB,WAAuB;CACrC,OAAOA,MAAM,WAAW,YAAY;AACtC;;AAMA,MAAa,QAAQA,MAAM,WACzB,SAAS,MACP,EACE,aACA,iBACA,cACA,QACA,SACA,SACA,cACA,cACA,UACA,eACA,YACA,YACA,aACA,WACA,YACA,aACA,UACA,QACA,WACA,OACA,UACA,GAAG,QAEL,KACA;CACA,MAAM,SAAS,SAAS;CAExB,MAAM,QAAQA,MAAM,eACX;EACL,aAAa,eAAe,OAA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sBAAsB,QAAQ;GAE1C,OAAO;IAAE,YAAY,CAAC;IAA0B,KAAA,GADjC,IAAI,GAAG,MAAM,KAAK,EAAE,EAAE,0BAA0B,IAAI,GAAG,KAAK,KAAK,EAAE,EAAE;IAC/B,QAAQ;GAAK;EACpE,SAAS,OAAO;GAGd,QAAQ,KACN,yCAAyC,YAAY,uBAAuB,gBAAgB,KAC5F,KACF;GACA,OAAO;EACT;CACF,GAAG;EACD;EACA;EACA;EACA;EACA,MAAM;EACN,MAAM;EACN;CACF,CAAC;CAED,MAAM,WAAA,GAAA,0BAAA,WAAoB;EACxB,gBAAgB;EAChB;EACA;EACA,QAAA,GAAA,2BAAA,YACE;GACE,YAAA,GAAA,OAAA,IAAc,eAAe,YAAY,SAAS;GAClD,sBAAsB;GACtB,eAAe;GACf,gBAAgB;GAChB,gBAAgB;GAChB,cAAc;GACd,sBAAsB,eAAe,KAAK,KAAA;GAC1C,iBAAiB,WAAW,KAAK,KAAA;GACjC,uBAAuB;GACvB,oBAAoB;GACpB,oBAAoB;GACpB,qBAAqB;GACrB,mBAAmB,cAAc,WAAW,WAAW,KAAA;GACvD,oBAAoB,OAAO,SAAS,UAAU,KAAA;GAC9C,OAAO;IACL,GAAG,OAAO;IAIV,GAAI,kBACA,EAAE,iBAAiB,0BAA0B,IAC7C;IACJ,GAAI,cAAc,EAAE,wBAAwB,YAAY,IAAI;IAC5D,GAAI,WAAW,EAAE,qBAAqB,SAAS,IAAI;IACnD,GAAG;GACL;GACA;EACF,GACA,IACF;CACF,CAAC;CAED,OACE,iBAAA,GAAA,kBAAA,MAAC,aAAa,UAAd;EAA8B;YAA9B,CACG,OAAO,MAAM,iBAAA,GAAA,kBAAA,KAAC,SAAD,EAAA,UAAQ,OAAO,IAAW,CAAA,IAAI,MAC3C,OACoB;;AAE3B,CACF"}
1
+ {"version":3,"file":"theme.cjs","names":["React","resolveAutoNeutral","isSparkNeutralFamily","isParsableColor","getMatchingNeutral","CURATED_ACCENTS","appearanceForBackground","accentSparkVars","neutralSparkVars","generateAccentScale","invertAccentScale","neutralFamilyVars"],"sources":["../../src/components/theme.tsx"],"sourcesContent":["'use client'\n\nimport { mergeProps } from '@base-ui/react/merge-props'\nimport { useRender } from '@base-ui/react/use-render'\nimport * as React from 'react'\nimport {\n CURATED_ACCENTS,\n accentSparkVars,\n appearanceForBackground,\n generateAccentScale,\n getMatchingNeutral,\n invertAccentScale,\n isParsableColor,\n neutralFamilyVars,\n neutralSparkVars,\n resolveAutoNeutral,\n type Appearance,\n type SparkAccentScale,\n} from '../lib/accent-theme'\nimport {\n isSparkNeutralFamily,\n type SparkCardColor,\n type SparkCardVariant,\n type SparkInputColor,\n type SparkInputStyle,\n type SparkLabelPosition,\n type SparkNeutral,\n type SparkRadius,\n type SparkScaling,\n type SparkSpacing,\n type SparkStyle,\n} from '../lib/theme-types'\nimport { cn } from '../utils/cn'\n\nexport type {\n SparkCardColor,\n SparkCardVariant,\n SparkInputColor,\n SparkInputStyle,\n SparkLabelPosition,\n SparkNeutral,\n SparkNeutralFamily,\n SparkRadius,\n SparkScaling,\n SparkSpacing,\n SparkStyle,\n} from '../lib/theme-types'\n\n/** The epilot brand accent — the scale `spark-default.css` ships statically. */\nconst DEFAULT_ACCENT = '#005EB4'\n\nexport interface ThemeValue {\n /** Curated accent name or a custom hex. */\n accentColor?: string\n /**\n * Page canvas as a custom hex. Regenerates BOTH the accent and neutral scales against\n * it (each alpha step is composited against the canvas, so a saturated colour needs\n * the neutral ramp regenerated too, not just the accent). Unset → the fixed\n * `#ffffff` / `#000000` default, and neutrals stay on the static Radix families.\n */\n backgroundColor?: string\n /**\n * A curated family name, an arbitrary color to seed the neutral scale, or `'auto'` to\n * resolve one — preferring `backgroundColor`'s own hue when it's perceptibly tinted,\n * else pairing with the accent (Radix's `grayColor=\"auto\"`). A custom seed (from `auto`\n * or set directly) only regenerates the scale alongside a `backgroundColor`; without\n * one, `data-neutral-color` falls back to the accent-matched family and that's what\n * actually paints.\n */\n neutralColor?: SparkNeutral\n radius?: SparkRadius\n scaling?: SparkScaling\n spacing?: SparkSpacing\n styleVariant?: SparkStyle\n /** Orthogonal to `styleVariant`: shifts any style toward higher-contrast steps. */\n highContrast?: boolean\n /**\n * Orthogonal to `styleVariant`: re-casts the accent scale for use ON its own solid fill,\n * for controls sitting on a solid accent surface (a `<Card variant=\"solid\" color=\"accent\">`),\n * where a solid control would otherwise paint the same `--spark-9` as the card and vanish.\n * Swaps step 9 with its contrast ink, so the fill/ink pair stays WCAG-safe for any accent.\n */\n inverted?: boolean\n labelPosition?: SparkLabelPosition\n inputStyle?: SparkInputStyle\n inputColor?: SparkInputColor\n /** App-level default `<Card>` chrome; a per-card `variant` prop overrides it. */\n cardVariant?: SparkCardVariant\n /** App-level default `<Card>` palette; a per-card `color` prop overrides it. */\n cardColor?: SparkCardColor\n appearance?: Appearance\n /** Font stack for `h1`–`h6`. Any valid CSS `font-family` value. */\n fontHeading?: string\n /** Font stack for everything else. Any valid CSS `font-family` value. */\n fontBody?: string\n}\n\nconst ThemeContext = React.createContext<ThemeValue>({})\n\n/** Merged theme values from enclosing `<Theme>` providers. */\nexport function useTheme(): ThemeValue {\n return React.useContext(ThemeContext)\n}\n\nexport interface ThemeProps\n extends useRender.ComponentProps<'div'>, ThemeValue {}\n\n/** Optional sugar: writes the theming `data-*` attrs + accent `--spark-*` vars onto a wrapper. */\nexport const Theme = React.forwardRef<HTMLDivElement, ThemeProps>(\n function Theme(\n {\n accentColor,\n backgroundColor,\n neutralColor,\n radius,\n scaling,\n spacing,\n styleVariant,\n highContrast,\n inverted,\n labelPosition,\n inputStyle,\n inputColor,\n cardVariant,\n cardColor,\n appearance,\n fontHeading,\n fontBody,\n render,\n className,\n style,\n children,\n ...rest\n },\n ref,\n ) {\n const parent = useTheme()\n\n const value = React.useMemo<ThemeValue>(\n () => ({\n accentColor: accentColor ?? parent.accentColor,\n backgroundColor: backgroundColor ?? parent.backgroundColor,\n neutralColor: neutralColor ?? parent.neutralColor,\n radius: radius ?? parent.radius,\n scaling: scaling ?? parent.scaling,\n spacing: spacing ?? parent.spacing,\n styleVariant: styleVariant ?? parent.styleVariant,\n highContrast: highContrast ?? parent.highContrast,\n inverted: inverted ?? parent.inverted,\n labelPosition: labelPosition ?? parent.labelPosition,\n inputStyle: inputStyle ?? parent.inputStyle,\n inputColor: inputColor ?? parent.inputColor,\n cardVariant: cardVariant ?? parent.cardVariant,\n cardColor: cardColor ?? parent.cardColor,\n appearance: appearance ?? parent.appearance,\n fontHeading: fontHeading ?? parent.fontHeading,\n fontBody: fontBody ?? parent.fontBody,\n }),\n [\n accentColor,\n backgroundColor,\n neutralColor,\n radius,\n scaling,\n spacing,\n styleVariant,\n highContrast,\n inverted,\n labelPosition,\n inputStyle,\n inputColor,\n cardVariant,\n cardColor,\n appearance,\n fontHeading,\n fontBody,\n parent,\n ],\n )\n\n // Scope id for the ambient-appearance case (both scales emitted in a <style>).\n const scopeId = React.useId()\n\n // 'auto' pairs a neutral with the canvas's own tint when it has one, else the\n // effective accent (Radix's grayColor=\"auto\") — see resolveAutoNeutral. Reads the\n // OWN backgroundColor, not the merged value.backgroundColor: optsFor (below) only\n // ever regenerates against a scope's own canvas too, so preferring an inherited one\n // here would resolve a seed that then gets silently discarded.\n const rawNeutralColor =\n neutralColor === 'auto'\n ? resolveAutoNeutral(\n value.accentColor ?? DEFAULT_ACCENT,\n backgroundColor,\n )\n : neutralColor\n\n // A custom neutral that isn't a recognized family must be a real, parseable color —\n // reject invalid input here (e.g. a typo'd family name like \"slat\") so it can't throw\n // deep inside the shared generator, where the catch below would otherwise blame\n // accentColor/backgroundColor without ever naming neutralColor as the actual cause.\n const neutralColorIsValid =\n rawNeutralColor === undefined ||\n isSparkNeutralFamily(rawNeutralColor) ||\n isParsableColor(rawNeutralColor)\n if (!neutralColorIsValid) {\n console.warn(\n `[Theme] Ignoring invalid neutralColor \"${rawNeutralColor}\" — falling back to the accent-matched family.`,\n )\n }\n const resolvedNeutralColor = neutralColorIsValid\n ? rawNeutralColor\n : getMatchingNeutral(value.accentColor ?? DEFAULT_ACCENT)\n\n // The DOM attribute stays one of the 6 static families `[data-neutral-color]` has CSS\n // for — a raw color (from the canvas-tinted auto path, or an arbitrary neutralColor\n // prop) falls back to its accent-matched family here instead, so the attribute is\n // always CSS-selectable/debuggable rather than a sentinel nothing matches.\n // generateAccentScale still gets the real resolvedNeutralColor for generation, below —\n // this substitution is display-only, and doesn't by itself guarantee the *other*\n // appearance's neutrals in ambient (no explicit `appearance`) mode: that's a\n // pre-existing cross-appearance leak in the same family as review-findings.md #5, not\n // something this attribute fallback fixes or regresses.\n const neutralColorAttr =\n resolvedNeutralColor === undefined\n ? undefined\n : isSparkNeutralFamily(resolvedNeutralColor)\n ? resolvedNeutralColor\n : getMatchingNeutral(value.accentColor ?? DEFAULT_ACCENT)\n\n const accent = React.useMemo(() => {\n const empty = {\n inlineVars: {} as React.CSSProperties,\n css: '',\n scoped: false,\n }\n // A custom canvas generates even with no accent of its own: the neutral ramp is\n // composited against it, and --spark-background has to carry it.\n if (!accentColor && !backgroundColor) return empty\n\n const toVars = (decls: string[]) =>\n Object.fromEntries(\n decls\n .filter((decl) => decl.includes(':'))\n .map((decl) => {\n const i = decl.indexOf(':')\n return [\n decl.slice(0, i).trim(),\n decl\n .slice(i + 1)\n .replace(/;$/, '')\n .trim(),\n ]\n }),\n ) as React.CSSProperties\n\n try {\n const source = value.accentColor ?? DEFAULT_ACCENT\n const hex = CURATED_ACCENTS[source] ?? source\n\n // A canvas has a polarity, unlike an accent hue: a yellow page is a *light*\n // page, and reusing it for the dark scale yields light ink on a light canvas\n // (measured 1.16:1). So the custom canvas applies to the appearance it actually\n // belongs to, and the other keeps its default. One knob still covers the common\n // case — a tenant wanting both sets an explicit appearance per scope.\n const bgAppearance = backgroundColor\n ? appearanceForBackground(backgroundColor)\n : undefined\n\n // Honouring a mismatched canvas would paint light ink on a light page, so it's\n // dropped — but say so, or the prop looks broken.\n if (\n backgroundColor &&\n value.appearance &&\n bgAppearance !== value.appearance\n ) {\n console.warn(\n `[Theme] Ignoring backgroundColor \"${backgroundColor}\": it reads as a ${bgAppearance} canvas on an appearance=\"${value.appearance}\" scope. Pass a ${value.appearance} colour, or set it on a scope whose appearance matches.`,\n )\n }\n\n // Default to slate so a regenerated neutral stays in the family the static\n // `:root` default already points at, rather than the generator's ECP gray seed.\n const optsFor = (appearance: Appearance) =>\n backgroundColor && bgAppearance === appearance\n ? {\n background: backgroundColor,\n neutral: resolvedNeutralColor ?? ('slate' as const),\n }\n : undefined\n\n // Neutrals are only worth regenerating against a custom canvas — see\n // neutralSparkVars. Without one the static Radix families are already correct.\n const emit = (scale: SparkAccentScale, custom: boolean) =>\n custom\n ? [...accentSparkVars(scale), ...neutralSparkVars(scale)]\n : accentSparkVars(scale)\n\n const build = (appearance: Appearance) => {\n const opts = optsFor(appearance)\n const scale = generateAccentScale(hex, appearance, opts)\n // `inverted` re-casts the accent for a solid-accent surface; the neutral ramp is\n // unrelated to that swap, so it passes through untouched.\n return emit(inverted ? invertAccentScale(scale) : scale, opts != null)\n }\n\n // Explicit appearance → single-scale inline vars. Correct for a light\n // island inside a dark page (which must NOT pick up the dark scale).\n if (value.appearance) {\n return {\n inlineVars: toVars(build(value.appearance)),\n css: '',\n scoped: false,\n }\n }\n\n // Ambient appearance → emit BOTH scales in a scoped <style> so the\n // `.dark` class selects the right one. Without this, a single-appearance\n // inline scale (default light) breaks components in dark mode.\n //\n // Both blocks must declare the SAME tokens. A custom canvas only regenerates\n // neutrals for its own appearance (see optsFor), and a custom property the other\n // block leaves undeclared keeps its sibling's value rather than falling back — so\n // the off-canvas appearance would paint this one's canvas-tinted neutrals, and\n // being unlayered they'd beat `[data-neutral-color]`'s @layer base mapping too.\n // Point it at the static family instead: the same seed the canvas side was given,\n // so the two appearances agree on family and differ only in canvas.\n const offCanvasNeutrals = backgroundColor\n ? neutralFamilyVars(resolvedNeutralColor ?? 'slate')\n : []\n const scaleFor = (appearance: Appearance) =>\n bgAppearance === appearance\n ? build(appearance)\n : [...build(appearance), ...offCanvasNeutrals]\n const light = scaleFor('light')\n const dark = scaleFor('dark')\n const sel = `[data-spark-scope=\"${scopeId}\"]`\n const css = `${sel}{${light.join('')}}:is(.dark,.dark-theme) ${sel}{${dark.join('')}}`\n return { inlineVars: {} as React.CSSProperties, css, scoped: true }\n } catch (error) {\n // A bad accentColor/backgroundColor must not throw through render — fall back\n // to the default theme.\n console.warn(\n `[Theme] Ignoring invalid accentColor \"${accentColor}\" / backgroundColor \"${backgroundColor}\".`,\n error,\n )\n return empty\n }\n }, [\n accentColor,\n backgroundColor,\n inverted,\n resolvedNeutralColor,\n value.accentColor,\n value.appearance,\n scopeId,\n ])\n\n const element = useRender({\n defaultTagName: 'div',\n render,\n ref,\n props: mergeProps<'div'>(\n {\n className: cn('spark-theme', appearance, className),\n 'data-neutral-color': neutralColorAttr,\n 'data-radius': radius,\n 'data-scaling': scaling,\n 'data-spacing': spacing,\n 'data-style': styleVariant,\n 'data-high-contrast': highContrast ? '' : undefined,\n 'data-inverted': inverted ? '' : undefined,\n 'data-label-position': labelPosition,\n 'data-input-style': inputStyle,\n 'data-input-color': inputColor,\n 'data-card-variant': cardVariant,\n 'data-card-color': cardColor === 'accent' ? 'accent' : undefined,\n 'data-spark-scope': accent.scoped ? scopeId : undefined,\n style: {\n ...accent.inlineVars,\n // Paint the canvas we were handed, else the prop emits a token and visibly\n // does nothing. Reads the var (not the raw prop) so the scoped <style>'s\n // per-appearance value still wins under ambient appearance.\n ...(backgroundColor\n ? { backgroundColor: 'var(--spark-background)' }\n : null),\n ...(fontHeading ? { '--spark-font-heading': fontHeading } : null),\n ...(fontBody ? { '--spark-font-body': fontBody } : null),\n ...style,\n } as React.CSSProperties,\n children,\n } as React.ComponentProps<'div'>,\n rest,\n ),\n })\n\n return (\n <ThemeContext.Provider value={value}>\n {accent.css ? <style>{accent.css}</style> : null}\n {element}\n </ThemeContext.Provider>\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;;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,GAAI,WAAW,EAAE,qBAAqB,SAAS,IAAI;IACnD,GAAG;GACL;GACA;EACF,GACA,IACF;CACF,CAAC;CAED,OACE,iBAAA,GAAA,kBAAA,MAAC,aAAa,UAAd;EAA8B;YAA9B,CACG,OAAO,MAAM,iBAAA,GAAA,kBAAA,KAAC,SAAD,EAAA,UAAQ,OAAO,IAAW,CAAA,IAAI,MAC3C,OACoB;;AAE3B,CACF"}
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  "use client";
3
- import { cn } from "../utils/cn.js";
4
3
  import { isSparkNeutralFamily } from "../lib/theme-types.js";
5
4
  import { CURATED_ACCENTS, accentSparkVars, appearanceForBackground, generateAccentScale, getMatchingNeutral, invertAccentScale, isParsableColor, neutralFamilyVars, neutralSparkVars, resolveAutoNeutral } from "../lib/accent-theme.js";
5
+ import { cn } from "../utils/cn.js";
6
6
  import * as React$1 from "react";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
  import { mergeProps } from "@base-ui/react/merge-props";
@@ -4,7 +4,7 @@ const require_chunk = require("../chunk-DY84GLCh.cjs");
4
4
  let react = require("react");
5
5
  react = require_chunk.__toESM(react);
6
6
  let react_jsx_runtime = require("react/jsx-runtime");
7
- let cnfast = require("cnfast");
7
+ let cn = require("cn");
8
8
  //#region src/components/thumbnail.tsx
9
9
  const ratioClasses = {
10
10
  "1:1": "aspect-square",
@@ -32,7 +32,7 @@ function Thumbnail({ className, src, alt = "", ratio = "1:1", fit = "cover", rad
32
32
  const showImage = !!src && !errored;
33
33
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
34
34
  "data-slot": "thumbnail",
35
- className: (0, cnfast.cn)("relative flex items-center justify-center overflow-hidden bg-base-gray-soft", ratioClasses[ratio], radiusClasses[radius], className),
35
+ className: (0, cn.cn)("relative flex items-center justify-center overflow-hidden bg-base-gray-soft", ratioClasses[ratio], radiusClasses[radius], className),
36
36
  ...props,
37
37
  children: showImage ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
38
38
  ...imgProps,
@@ -43,7 +43,7 @@ function Thumbnail({ className, src, alt = "", ratio = "1:1", fit = "cover", rad
43
43
  setErrored(true);
44
44
  imgProps?.onError?.(e);
45
45
  },
46
- className: (0, cnfast.cn)("size-full", fit === "contain" ? "object-contain" : "object-cover", imgProps?.className)
46
+ className: (0, cn.cn)("size-full", fit === "contain" ? "object-contain" : "object-cover", imgProps?.className)
47
47
  }) : children
48
48
  });
49
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"thumbnail.cjs","names":["React"],"sources":["../../src/components/thumbnail.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cn } from '../utils/cn'\n\ntype ThumbnailRatio = '1:1' | '3:2' | '4:3' | '16:9' | '3:4' | '2:3'\ntype ThumbnailFit = 'cover' | 'contain'\ntype ThumbnailRadius = 'none' | 'sm' | 'md' | 'lg' | 'full'\n\nconst ratioClasses = {\n '1:1': 'aspect-square',\n '3:2': 'aspect-[3/2]',\n '4:3': 'aspect-[4/3]',\n '16:9': 'aspect-[16/9]',\n '3:4': 'aspect-[3/4]',\n '2:3': 'aspect-[2/3]',\n}\n\nconst radiusClasses = {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n full: 'rounded-full',\n}\n\ninterface ThumbnailProps extends React.ComponentProps<'div'> {\n src?: string\n alt?: string\n ratio?: ThumbnailRatio\n fit?: ThumbnailFit\n radius?: ThumbnailRadius\n imgProps?: React.ComponentProps<'img'>\n}\n\nfunction Thumbnail({\n className,\n src,\n alt = '',\n ratio = '1:1',\n fit = 'cover',\n radius = 'md',\n imgProps,\n children,\n ...props\n}: ThumbnailProps) {\n const [errored, setErrored] = React.useState(false)\n const imgRef = React.useRef<HTMLImageElement>(null)\n\n React.useEffect(() => {\n // A new src must clear a prior error, or a fixed src would stay stuck on the\n // fallback. An image that already failed before React attached onError (SSR\n // hydration, or a cached 404) never fires the event, so also detect that failure\n // straight from the DOM node here.\n setErrored(false)\n const node = imgRef.current\n if (node?.complete && node.naturalWidth === 0) setErrored(true)\n }, [src])\n\n const showImage = !!src && !errored\n\n return (\n <div\n data-slot=\"thumbnail\"\n className={cn(\n 'relative flex items-center justify-center overflow-hidden bg-base-gray-soft',\n ratioClasses[ratio],\n radiusClasses[radius],\n className,\n )}\n {...props}\n >\n {showImage ? (\n <img\n {...imgProps}\n ref={imgRef}\n src={src}\n alt={alt}\n onError={(e) => {\n setErrored(true)\n imgProps?.onError?.(e)\n }}\n className={cn(\n 'size-full',\n fit === 'contain' ? 'object-contain' : 'object-cover',\n imgProps?.className,\n )}\n />\n ) : (\n children\n )}\n </div>\n )\n}\n\nThumbnail.displayName = 'Thumbnail'\n\nexport { Thumbnail }\nexport type { ThumbnailProps, ThumbnailRatio, ThumbnailFit, ThumbnailRadius }\n"],"mappings":";;;;;;;;AAOA,MAAM,eAAe;CACnB,OAAO;CACP,OAAO;CACP,OAAO;CACP,QAAQ;CACR,OAAO;CACP,OAAO;AACT;AAEA,MAAM,gBAAgB;CACpB,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;AACR;AAWA,SAAS,UAAU,EACjB,WACA,KACA,MAAM,IACN,QAAQ,OACR,MAAM,SACN,SAAS,MACT,UACA,UACA,GAAG,SACc;CACjB,MAAM,CAAC,SAAS,cAAcA,MAAM,SAAS,KAAK;CAClD,MAAM,SAASA,MAAM,OAAyB,IAAI;CAElD,MAAM,gBAAgB;EAKpB,WAAW,KAAK;EAChB,MAAM,OAAO,OAAO;EACpB,IAAI,MAAM,YAAY,KAAK,iBAAiB,GAAG,WAAW,IAAI;CAChE,GAAG,CAAC,GAAG,CAAC;CAER,MAAM,YAAY,CAAC,CAAC,OAAO,CAAC;CAE5B,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,YAAA,GAAA,OAAA,IACE,+EACA,aAAa,QACb,cAAc,SACd,SACF;EACA,GAAI;YAEH,YACC,iBAAA,GAAA,kBAAA,KAAC,OAAD;GACE,GAAI;GACJ,KAAK;GACA;GACA;GACL,UAAU,MAAM;IACd,WAAW,IAAI;IACf,UAAU,UAAU,CAAC;GACvB;GACA,YAAA,GAAA,OAAA,IACE,aACA,QAAQ,YAAY,mBAAmB,gBACvC,UAAU,SACZ;EACD,CAAA,IAED;CAEC,CAAA;AAET;AAEA,UAAU,cAAc"}
1
+ {"version":3,"file":"thumbnail.cjs","names":["React"],"sources":["../../src/components/thumbnail.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cn } from '../utils/cn'\n\ntype ThumbnailRatio = '1:1' | '3:2' | '4:3' | '16:9' | '3:4' | '2:3'\ntype ThumbnailFit = 'cover' | 'contain'\ntype ThumbnailRadius = 'none' | 'sm' | 'md' | 'lg' | 'full'\n\nconst ratioClasses = {\n '1:1': 'aspect-square',\n '3:2': 'aspect-[3/2]',\n '4:3': 'aspect-[4/3]',\n '16:9': 'aspect-[16/9]',\n '3:4': 'aspect-[3/4]',\n '2:3': 'aspect-[2/3]',\n}\n\nconst radiusClasses = {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n full: 'rounded-full',\n}\n\ninterface ThumbnailProps extends React.ComponentProps<'div'> {\n src?: string\n alt?: string\n ratio?: ThumbnailRatio\n fit?: ThumbnailFit\n radius?: ThumbnailRadius\n imgProps?: React.ComponentProps<'img'>\n}\n\nfunction Thumbnail({\n className,\n src,\n alt = '',\n ratio = '1:1',\n fit = 'cover',\n radius = 'md',\n imgProps,\n children,\n ...props\n}: ThumbnailProps) {\n const [errored, setErrored] = React.useState(false)\n const imgRef = React.useRef<HTMLImageElement>(null)\n\n React.useEffect(() => {\n // A new src must clear a prior error, or a fixed src would stay stuck on the\n // fallback. An image that already failed before React attached onError (SSR\n // hydration, or a cached 404) never fires the event, so also detect that failure\n // straight from the DOM node here.\n setErrored(false)\n const node = imgRef.current\n if (node?.complete && node.naturalWidth === 0) setErrored(true)\n }, [src])\n\n const showImage = !!src && !errored\n\n return (\n <div\n data-slot=\"thumbnail\"\n className={cn(\n 'relative flex items-center justify-center overflow-hidden bg-base-gray-soft',\n ratioClasses[ratio],\n radiusClasses[radius],\n className,\n )}\n {...props}\n >\n {showImage ? (\n <img\n {...imgProps}\n ref={imgRef}\n src={src}\n alt={alt}\n onError={(e) => {\n setErrored(true)\n imgProps?.onError?.(e)\n }}\n className={cn(\n 'size-full',\n fit === 'contain' ? 'object-contain' : 'object-cover',\n imgProps?.className,\n )}\n />\n ) : (\n children\n )}\n </div>\n )\n}\n\nThumbnail.displayName = 'Thumbnail'\n\nexport { Thumbnail }\nexport type { ThumbnailProps, ThumbnailRatio, ThumbnailFit, ThumbnailRadius }\n"],"mappings":";;;;;;;;AAOA,MAAM,eAAe;CACnB,OAAO;CACP,OAAO;CACP,OAAO;CACP,QAAQ;CACR,OAAO;CACP,OAAO;AACT;AAEA,MAAM,gBAAgB;CACpB,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;AACR;AAWA,SAAS,UAAU,EACjB,WACA,KACA,MAAM,IACN,QAAQ,OACR,MAAM,SACN,SAAS,MACT,UACA,UACA,GAAG,SACc;CACjB,MAAM,CAAC,SAAS,cAAcA,MAAM,SAAS,KAAK;CAClD,MAAM,SAASA,MAAM,OAAyB,IAAI;CAElD,MAAM,gBAAgB;EAKpB,WAAW,KAAK;EAChB,MAAM,OAAO,OAAO;EACpB,IAAI,MAAM,YAAY,KAAK,iBAAiB,GAAG,WAAW,IAAI;CAChE,GAAG,CAAC,GAAG,CAAC;CAER,MAAM,YAAY,CAAC,CAAC,OAAO,CAAC;CAE5B,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IACE,+EACA,aAAa,QACb,cAAc,SACd,SACF;EACA,GAAI;YAEH,YACC,iBAAA,GAAA,kBAAA,KAAC,OAAD;GACE,GAAI;GACJ,KAAK;GACA;GACA;GACL,UAAU,MAAM;IACd,WAAW,IAAI;IACf,UAAU,UAAU,CAAC;GACvB;GACA,YAAA,GAAA,GAAA,IACE,aACA,QAAQ,YAAY,mBAAmB,gBACvC,UAAU,SACZ;EACD,CAAA,IAED;CAEC,CAAA;AAET;AAEA,UAAU,cAAc"}
@@ -4,7 +4,7 @@ const require_chunk = require("../chunk-DY84GLCh.cjs");
4
4
  let react = require("react");
5
5
  react = require_chunk.__toESM(react);
6
6
  let react_jsx_runtime = require("react/jsx-runtime");
7
- let cnfast = require("cnfast");
7
+ let cn = require("cn");
8
8
  //#region src/components/time-picker.tsx
9
9
  const MINUTES_PER_DAY = 1440;
10
10
  /**
@@ -64,13 +64,13 @@ const TimePicker = react.forwardRef(({ "aria-label": ariaLabel, className, disab
64
64
  if (snapped !== event.currentTarget.value) onValueChange(snapped);
65
65
  },
66
66
  "aria-label": ariaLabel,
67
- className: (0, cnfast.cn)("touch-target h-10 w-full rounded-md bg-base-gray-soft px-3 text-base font-medium text-gray tabular-nums transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50", className)
67
+ className: (0, cn.cn)("touch-target h-10 w-full rounded-md bg-base-gray-soft px-3 text-base font-medium text-gray tabular-nums transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50", className)
68
68
  });
69
69
  });
70
70
  TimePicker.displayName = "TimePicker";
71
71
  function TimeRangePicker({ className, disabled, end, endLabel = "End", onEndChange, onStartChange, start, startLabel = "Start", step }) {
72
72
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
73
- className: (0, cnfast.cn)("grid grid-cols-2 gap-2", className),
73
+ className: (0, cn.cn)("grid grid-cols-2 gap-2", className),
74
74
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
75
75
  className: "flex flex-col gap-1.5",
76
76
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
@@ -1 +1 @@
1
- {"version":3,"file":"time-picker.cjs","names":["React"],"sources":["../../src/components/time-picker.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cn } from '../utils/cn'\n\ninterface TimePickerProps {\n /** `HH:MM` 24-hour string. */\n value: string\n onValueChange: (next: string) => void\n disabled?: boolean\n /** Step in seconds (defaults to 60 — minute-resolution). */\n step?: number\n className?: string\n id?: string\n 'aria-label'?: string\n}\n\nconst MINUTES_PER_DAY = 24 * 60\n\n/**\n * Move `HH:mm` one grid step in `direction`, aligning to the `step` grid first.\n * A native `<input type=\"time\">` steps each focused segment by one unit and\n * ignores `step`, so callers that want arrow keys to move by a coarse step\n * (e.g. 5 minutes) route the arrow keys through this instead. Clamped to\n * `00:00`–`23:55` (no wrap); an off-grid start lands on the next grid point in\n * the pressed direction.\n */\nfunction stepGridValue(value: string, step: number, direction: 1 | -1): string {\n const stepMinutes = Math.floor(step / 60)\n if (stepMinutes <= 1) return value\n const match = /^(\\d{1,2}):(\\d{2})/.exec(value)\n const base = match ? Number(match[1]) * 60 + Number(match[2]) : 0\n const next =\n direction === 1\n ? Math.floor(base / stepMinutes) * stepMinutes + stepMinutes\n : Math.ceil(base / stepMinutes) * stepMinutes - stepMinutes\n const lastOnGrid =\n Math.floor((MINUTES_PER_DAY - 1) / stepMinutes) * stepMinutes\n const clamped = Math.max(0, Math.min(next, lastOnGrid))\n const hh = String(Math.floor(clamped / 60)).padStart(2, '0')\n const mm = String(clamped % 60).padStart(2, '0')\n return `${hh}:${mm}`\n}\n\n/**\n * Round `HH:mm` to the nearest multiple of `step` (used to autofix a typed\n * off-grid value on blur). Already-on-grid values pass through unchanged (so a\n * seconds suffix is preserved); anything that isn't `HH:mm(:ss)` passes through.\n */\nfunction snapToNearestStep(value: string, step: number): string {\n const stepMinutes = Math.floor(step / 60)\n if (stepMinutes <= 1) return value\n const match = /^(\\d{1,2}):(\\d{2})/.exec(value)\n if (!match) return value\n const minutes = Number(match[2])\n if (minutes % stepMinutes === 0) return value\n const total = Number(match[1]) * 60 + minutes\n const lastOnGrid =\n Math.floor((MINUTES_PER_DAY - 1) / stepMinutes) * stepMinutes\n const snapped = Math.min(\n Math.round(total / stepMinutes) * stepMinutes,\n lastOnGrid,\n )\n const hh = String(Math.floor(snapped / 60)).padStart(2, '0')\n const mm = String(snapped % 60).padStart(2, '0')\n return `${hh}:${mm}`\n}\n\nconst TimePicker = React.forwardRef<HTMLInputElement, TimePickerProps>(\n (\n {\n 'aria-label': ariaLabel,\n className,\n disabled,\n id,\n onValueChange,\n step = 60,\n value,\n },\n ref,\n ) => {\n const stepMinutes = Math.floor(step / 60)\n return (\n <input\n ref={ref}\n id={id}\n type=\"time\"\n value={value}\n step={step}\n disabled={disabled}\n onChange={(event) => onValueChange(event.target.value)}\n onKeyDown={(event) => {\n // Native arrows step the focused segment by one unit and ignore step;\n // for a coarse grid, drive up/down through the grid instead.\n if (stepMinutes <= 1) return\n if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown') return\n event.preventDefault()\n onValueChange(\n stepGridValue(value, step, event.key === 'ArrowUp' ? 1 : -1),\n )\n }}\n onBlur={(event) => {\n // Autofix a typed off-grid value to the closest grid point on blur.\n if (stepMinutes <= 1) return\n const snapped = snapToNearestStep(event.currentTarget.value, step)\n if (snapped !== event.currentTarget.value) onValueChange(snapped)\n }}\n aria-label={ariaLabel}\n className={cn(\n 'touch-target h-10 w-full rounded-md bg-base-gray-soft px-3 text-base font-medium text-gray tabular-nums transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n />\n )\n },\n)\n\nTimePicker.displayName = 'TimePicker'\n\ninterface TimeRangePickerProps {\n start: string\n end: string\n onStartChange: (next: string) => void\n onEndChange: (next: string) => void\n disabled?: boolean\n startLabel?: string\n endLabel?: string\n /** Step in seconds, forwarded to both inputs (defaults to 60). */\n step?: number\n className?: string\n}\n\nfunction TimeRangePicker({\n className,\n disabled,\n end,\n endLabel = 'End',\n onEndChange,\n onStartChange,\n start,\n startLabel = 'Start',\n step,\n}: TimeRangePickerProps) {\n return (\n <div className={cn('grid grid-cols-2 gap-2', className)}>\n <label className=\"flex flex-col gap-1.5\">\n <span className=\"text-xs font-medium text-gray-light\">\n {startLabel}\n </span>\n <TimePicker\n value={start}\n onValueChange={onStartChange}\n disabled={disabled}\n step={step}\n aria-label={startLabel}\n />\n </label>\n <label className=\"flex flex-col gap-1.5\">\n <span className=\"text-xs font-medium text-gray-light\">{endLabel}</span>\n <TimePicker\n value={end}\n onValueChange={onEndChange}\n disabled={disabled}\n step={step}\n aria-label={endLabel}\n />\n </label>\n </div>\n )\n}\n\nexport { TimePicker, TimeRangePicker }\n"],"mappings":";;;;;;;;AAeA,MAAM,kBAAkB;;;;;;;;;AAUxB,SAAS,cAAc,OAAe,MAAc,WAA2B;CAC7E,MAAM,cAAc,KAAK,MAAM,OAAO,EAAE;CACxC,IAAI,eAAe,GAAG,OAAO;CAC7B,MAAM,QAAQ,qBAAqB,KAAK,KAAK;CAC7C,MAAM,OAAO,QAAQ,OAAO,MAAM,EAAE,IAAI,KAAK,OAAO,MAAM,EAAE,IAAI;CAChE,MAAM,OACJ,cAAc,IACV,KAAK,MAAM,OAAO,WAAW,IAAI,cAAc,cAC/C,KAAK,KAAK,OAAO,WAAW,IAAI,cAAc;CACpD,MAAM,aACJ,KAAK,OAAO,kBAAkB,KAAK,WAAW,IAAI;CACpD,MAAM,UAAU,KAAK,IAAI,GAAG,KAAK,IAAI,MAAM,UAAU,CAAC;CAGtD,OAAO,GAFI,OAAO,KAAK,MAAM,UAAU,EAAE,CAAC,EAAE,SAAS,GAAG,GAE7C,EAAE,GADF,OAAO,UAAU,EAAE,EAAE,SAAS,GAAG,GAC3B;AACnB;;;;;;AAOA,SAAS,kBAAkB,OAAe,MAAsB;CAC9D,MAAM,cAAc,KAAK,MAAM,OAAO,EAAE;CACxC,IAAI,eAAe,GAAG,OAAO;CAC7B,MAAM,QAAQ,qBAAqB,K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;EAAK,YAAA,GAAA,OAAA,IAAc,0BAA0B,SAAS;YAAtD,CACE,iBAAA,GAAA,kBAAA,MAAC,SAAD;GAAO,WAAU;aAAjB,CACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;IAAM,WAAU;cACb;GACG,CAAA,GACN,iBAAA,GAAA,kBAAA,KAAC,YAAD;IACE,OAAO;IACP,eAAe;IACL;IACJ;IACN,cAAY;GACb,CAAA,CACI;MACP,iBAAA,GAAA,kBAAA,MAAC,SAAD;GAAO,WAAU;aAAjB,CACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;IAAM,WAAU;cAAuC;GAAe,CAAA,GACtE,iBAAA,GAAA,kBAAA,KAAC,YAAD;IACE,OAAO;IACP,eAAe;IACL;IACJ;IACN,cAAY;GACb,CAAA,CACI;IACJ;;AAET"}
1
+ {"version":3,"file":"time-picker.cjs","names":["React"],"sources":["../../src/components/time-picker.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cn } from '../utils/cn'\n\ninterface TimePickerProps {\n /** `HH:MM` 24-hour string. */\n value: string\n onValueChange: (next: string) => void\n disabled?: boolean\n /** Step in seconds (defaults to 60 — minute-resolution). */\n step?: number\n className?: string\n id?: string\n 'aria-label'?: string\n}\n\nconst MINUTES_PER_DAY = 24 * 60\n\n/**\n * Move `HH:mm` one grid step in `direction`, aligning to the `step` grid first.\n * A native `<input type=\"time\">` steps each focused segment by one unit and\n * ignores `step`, so callers that want arrow keys to move by a coarse step\n * (e.g. 5 minutes) route the arrow keys through this instead. Clamped to\n * `00:00`–`23:55` (no wrap); an off-grid start lands on the next grid point in\n * the pressed direction.\n */\nfunction stepGridValue(value: string, step: number, direction: 1 | -1): string {\n const stepMinutes = Math.floor(step / 60)\n if (stepMinutes <= 1) return value\n const match = /^(\\d{1,2}):(\\d{2})/.exec(value)\n const base = match ? Number(match[1]) * 60 + Number(match[2]) : 0\n const next =\n direction === 1\n ? Math.floor(base / stepMinutes) * stepMinutes + stepMinutes\n : Math.ceil(base / stepMinutes) * stepMinutes - stepMinutes\n const lastOnGrid =\n Math.floor((MINUTES_PER_DAY - 1) / stepMinutes) * stepMinutes\n const clamped = Math.max(0, Math.min(next, lastOnGrid))\n const hh = String(Math.floor(clamped / 60)).padStart(2, '0')\n const mm = String(clamped % 60).padStart(2, '0')\n return `${hh}:${mm}`\n}\n\n/**\n * Round `HH:mm` to the nearest multiple of `step` (used to autofix a typed\n * off-grid value on blur). Already-on-grid values pass through unchanged (so a\n * seconds suffix is preserved); anything that isn't `HH:mm(:ss)` passes through.\n */\nfunction snapToNearestStep(value: string, step: number): string {\n const stepMinutes = Math.floor(step / 60)\n if (stepMinutes <= 1) return value\n const match = /^(\\d{1,2}):(\\d{2})/.exec(value)\n if (!match) return value\n const minutes = Number(match[2])\n if (minutes % stepMinutes === 0) return value\n const total = Number(match[1]) * 60 + minutes\n const lastOnGrid =\n Math.floor((MINUTES_PER_DAY - 1) / stepMinutes) * stepMinutes\n const snapped = Math.min(\n Math.round(total / stepMinutes) * stepMinutes,\n lastOnGrid,\n )\n const hh = String(Math.floor(snapped / 60)).padStart(2, '0')\n const mm = String(snapped % 60).padStart(2, '0')\n return `${hh}:${mm}`\n}\n\nconst TimePicker = React.forwardRef<HTMLInputElement, TimePickerProps>(\n (\n {\n 'aria-label': ariaLabel,\n className,\n disabled,\n id,\n onValueChange,\n step = 60,\n value,\n },\n ref,\n ) => {\n const stepMinutes = Math.floor(step / 60)\n return (\n <input\n ref={ref}\n id={id}\n type=\"time\"\n value={value}\n step={step}\n disabled={disabled}\n onChange={(event) => onValueChange(event.target.value)}\n onKeyDown={(event) => {\n // Native arrows step the focused segment by one unit and ignore step;\n // for a coarse grid, drive up/down through the grid instead.\n if (stepMinutes <= 1) return\n if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown') return\n event.preventDefault()\n onValueChange(\n stepGridValue(value, step, event.key === 'ArrowUp' ? 1 : -1),\n )\n }}\n onBlur={(event) => {\n // Autofix a typed off-grid value to the closest grid point on blur.\n if (stepMinutes <= 1) return\n const snapped = snapToNearestStep(event.currentTarget.value, step)\n if (snapped !== event.currentTarget.value) onValueChange(snapped)\n }}\n aria-label={ariaLabel}\n className={cn(\n 'touch-target h-10 w-full rounded-md bg-base-gray-soft px-3 text-base font-medium text-gray tabular-nums transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n />\n )\n },\n)\n\nTimePicker.displayName = 'TimePicker'\n\ninterface TimeRangePickerProps {\n start: string\n end: string\n onStartChange: (next: string) => void\n onEndChange: (next: string) => void\n disabled?: boolean\n startLabel?: string\n endLabel?: string\n /** Step in seconds, forwarded to both inputs (defaults to 60). */\n step?: number\n className?: string\n}\n\nfunction TimeRangePicker({\n className,\n disabled,\n end,\n endLabel = 'End',\n onEndChange,\n onStartChange,\n start,\n startLabel = 'Start',\n step,\n}: TimeRangePickerProps) {\n return (\n <div className={cn('grid grid-cols-2 gap-2', className)}>\n <label className=\"flex flex-col gap-1.5\">\n <span className=\"text-xs font-medium text-gray-light\">\n {startLabel}\n </span>\n <TimePicker\n value={start}\n onValueChange={onStartChange}\n disabled={disabled}\n step={step}\n aria-label={startLabel}\n />\n </label>\n <label className=\"flex flex-col gap-1.5\">\n <span className=\"text-xs font-medium text-gray-light\">{endLabel}</span>\n <TimePicker\n value={end}\n onValueChange={onEndChange}\n disabled={disabled}\n step={step}\n aria-label={endLabel}\n />\n </label>\n </div>\n )\n}\n\nexport { TimePicker, TimeRangePicker }\n"],"mappings":";;;;;;;;AAeA,MAAM,kBAAkB;;;;;;;;;AAUxB,SAAS,cAAc,OAAe,MAAc,WAA2B;CAC7E,MAAM,cAAc,KAAK,MAAM,OAAO,EAAE;CACxC,IAAI,eAAe,GAAG,OAAO;CAC7B,MAAM,QAAQ,qBAAqB,KAAK,KAAK;CAC7C,MAAM,OAAO,QAAQ,OAAO,MAAM,EAAE,IAAI,KAAK,OAAO,MAAM,EAAE,IAAI;CAChE,MA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G;GACtB,IAAI,MAAM,QAAQ,aAAa,MAAM,QAAQ,aAAa;GAC1D,MAAM,eAAe;GACrB,cACE,cAAc,OAAO,MAAM,MAAM,QAAQ,YAAY,IAAI,EAAE,CAC7D;EACF;EACA,SAAS,UAAU;GAEjB,IAAI,eAAe,GAAG;GACtB,MAAM,UAAU,kBAAkB,MAAM,cAAc,OAAO,IAAI;GACjE,IAAI,YAAY,MAAM,cAAc,OAAO,cAAc,OAAO;EAClE;EACA,cAAY;EACZ,YAAA,GAAA,GAAA,IACE,2PACA,SACF;CACD,CAAA;AAEL,CACF;AAEA,WAAW,cAAc;AAezB,SAAS,gBAAgB,EACvB,WACA,UACA,KACA,WAAW,OACX,aACA,eACA,OACA,aAAa,SACb,QACuB;CACvB,OACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EAAK,YAAA,GAAA,GAAA,IAAc,0BAA0B,SAAS;YAAtD,CACE,iBAAA,GAAA,kBAAA,MAAC,SAAD;GAAO,WAAU;aAAjB,CACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;IAAM,WAAU;cACb;GACG,CAAA,GACN,iBAAA,GAAA,kBAAA,KAAC,YAAD;IACE,OAAO;IACP,eAAe;IACL;IACJ;IACN,cAAY;GACb,CAAA,CACI;MACP,iBAAA,GAAA,kBAAA,MAAC,SAAD;GAAO,WAAU;aAAjB,CACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;IAAM,WAAU;cAAuC;GAAe,CAAA,GACtE,iBAAA,GAAA,kBAAA,KAAC,YAAD;IACE,OAAO;IACP,eAAe;IACL;IACJ;IACN,cAAY;GACb,CAAA,CACI;IACJ;;AAET"}
@@ -9,7 +9,7 @@ react = require_chunk.__toESM(react);
9
9
  let _epilot_spark_icons = require("@epilot/spark-icons");
10
10
  let react_jsx_runtime = require("react/jsx-runtime");
11
11
  let _base_ui_react_toast = require("@base-ui/react/toast");
12
- let cnfast = require("cnfast");
12
+ let cn = require("cn");
13
13
  //#region src/components/toast.tsx
14
14
  const TOAST_ICONS = {
15
15
  success: {
@@ -108,7 +108,7 @@ function ToastIcon({ type }) {
108
108
  label: "",
109
109
  role: "presentation",
110
110
  size: "sm"
111
- }) : Glyph ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Glyph, { className: (0, cnfast.cn)("[--spark-icon-size:20px]", icon.className) }) : null
111
+ }) : Glyph ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Glyph, { className: (0, cn.cn)("[--spark-icon-size:20px]", icon.className) }) : null
112
112
  });
113
113
  }
114
114
  function ToastItem({ closeButton, richColors, toast: toastObject }) {
@@ -116,7 +116,7 @@ function ToastItem({ closeButton, richColors, toast: toastObject }) {
116
116
  const showClose = toastObject.data?.closeButton ?? closeButton;
117
117
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_base_ui_react_toast.Toast.Root, {
118
118
  "data-slot": "toast",
119
- className: (0, cnfast.cn)("flex items-start gap-2 rounded-lg border border-gray-a5 bg-gray-1 p-3 text-gray shadow-md select-none", richColors && tone),
119
+ className: (0, cn.cn)("flex items-start gap-2 rounded-lg border border-gray-a5 bg-gray-1 p-3 text-gray shadow-md select-none", richColors && tone),
120
120
  swipeDirection: [
121
121
  "up",
122
122
  "down",
@@ -131,12 +131,12 @@ function ToastItem({ closeButton, richColors, toast: toastObject }) {
131
131
  className: "text-sm font-medium",
132
132
  "data-slot": "toast-title"
133
133
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_toast.Toast.Description, {
134
- className: (0, cnfast.cn)("text-sm", richColors && tone ? "text-inherit" : "text-gray-11"),
134
+ className: (0, cn.cn)("text-sm", richColors && tone ? "text-inherit" : "text-gray-11"),
135
135
  "data-slot": "toast-description"
136
136
  })]
137
137
  }),
138
138
  toastObject.actionProps ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_toast.Toast.Action, {
139
- className: (0, cnfast.cn)(require_components_button.buttonVariants({
139
+ className: (0, cn.cn)(require_components_button.buttonVariants({
140
140
  size: "small",
141
141
  variant: "primary"
142
142
  }), "-my-2 shrink-0 self-center rounded-full"),
@@ -144,7 +144,7 @@ function ToastItem({ closeButton, richColors, toast: toastObject }) {
144
144
  }) : null,
145
145
  showClose ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_toast.Toast.Close, {
146
146
  "aria-label": "Close",
147
- className: (0, cnfast.cn)(require_components_button.buttonVariants({
147
+ className: (0, cn.cn)(require_components_button.buttonVariants({
148
148
  size: "icon-small",
149
149
  variant: "tertiary"
150
150
  }), "-my-1 -mr-1 size-7 shrink-0 self-center text-gray-11"),
@@ -171,7 +171,7 @@ function Toaster({ className, closeButton = true, duration = 4e3, limit, mobileP
171
171
  timeout: duration,
172
172
  toastManager: manager,
173
173
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_toast.Toast.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_toast.Toast.Viewport, {
174
- className: (0, cnfast.cn)("fixed inset-x-4 z-50 block h-0 outline-none", mobilePosition === "top" ? "top-4" : "bottom-4", "sm:inset-x-auto sm:w-96 sm:max-w-[calc(100vw-2rem)]", POSITION_CLASSES[position], className),
174
+ className: (0, cn.cn)("fixed inset-x-4 z-50 block h-0 outline-none", mobilePosition === "top" ? "top-4" : "bottom-4", "sm:inset-x-auto sm:w-96 sm:max-w-[calc(100vw-2rem)]", POSITION_CLASSES[position], className),
175
175
  "data-mobile-side": mobilePosition,
176
176
  "data-side": position.startsWith("top") ? "top" : "bottom",
177
177
  "data-slot": "toaster",
@@ -1 +1 @@
1
- {"version":3,"file":"toast.cjs","names":["CheckCircle","Info","Warning","Cancel","ToastPrimitive","Spinner","buttonVariants","Close"],"sources":["../../src/components/toast.tsx"],"sourcesContent":["'use client'\n\nimport { Toast as ToastPrimitive } from '@base-ui/react/toast'\nimport {\n Cancel,\n CheckCircle,\n Close,\n Info,\n Warning,\n type SparkIcon,\n} from '@epilot/spark-icons'\nimport * as React from 'react'\nimport { cn } from '../utils/cn'\nimport { buttonVariants } from './button'\nimport { Spinner } from './spinner'\n\ntype ToastType = 'success' | 'info' | 'warning' | 'error' | 'loading'\n\ntype ToastPosition =\n | 'top-left'\n | 'top-center'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'bottom-right'\n\n// Per-toast overrides Base UI carries through untouched as opaque `data`.\ntype ToastData = { closeButton?: boolean }\n\n// `label` is the button's content; everything else a `<button>` takes passes\n// straight through, so a caller can set `className`, `disabled`, `type`, and\n// the rest without a new prop for each one.\ntype ToastAction = Omit<\n React.ComponentPropsWithoutRef<'button'>,\n 'children'\n> & {\n label: React.ReactNode\n}\n\ntype ToastOptions = {\n description?: React.ReactNode\n /** Auto-dismiss time in ms. `0` keeps the toast until dismissed. */\n duration?: number\n /** Reuse an id to update a toast in place instead of stacking a new one. */\n id?: string\n closeButton?: boolean\n action?: ToastAction\n onDismiss?: () => void\n /** `high` announces urgently (assertive); the default is polite. */\n priority?: 'low' | 'high'\n}\n\ntype ToastPromiseMessages<Value> = {\n loading: string\n success: string | ((value: Value) => string)\n error: string | ((error: unknown) => string)\n}\n\nconst TOAST_ICONS: Record<\n Exclude<ToastType, 'loading'>,\n { icon: SparkIcon; className: string }\n> = {\n success: { icon: CheckCircle, className: 'text-success-light' },\n info: { icon: Info, className: 'text-info-light' },\n warning: { icon: Warning, className: 'text-warning-light' },\n error: { icon: Cancel, className: 'text-error-light' },\n}\n\n// Opaque radix steps (bg 2, border 6, text 11) so a floating toast never lets\n// page content bleed through the way the alpha `-soft` tokens would. The border\n// carries the tone too, otherwise a tinted toast keeps a grey outline.\nconst TONE_CLASSES: Record<Exclude<ToastType, 'loading'>, string> = {\n success: 'border-green-6 bg-green-2 text-green-11',\n info: 'border-blue-6 bg-blue-2 text-blue-11',\n warning: 'border-orange-6 bg-orange-2 text-orange-11',\n error: 'border-red-6 bg-red-2 text-red-11',\n}\n\n// Mobile-first: every position drops to a full-width stack at the top, which\n// is what the end-customer portal ships. `position` only takes effect from the\n// `sm` breakpoint up.\nconst POSITION_CLASSES: Record<ToastPosition, string> = {\n 'top-left': 'sm:top-4 sm:right-auto sm:bottom-auto sm:left-4',\n 'top-center':\n 'sm:top-4 sm:right-auto sm:bottom-auto sm:left-1/2 sm:-translate-x-1/2',\n 'top-right': 'sm:top-4 sm:right-4 sm:bottom-auto sm:left-auto',\n 'bottom-left': 'sm:top-auto sm:right-auto sm:bottom-4 sm:left-4',\n 'bottom-center':\n 'sm:top-auto sm:right-auto sm:bottom-4 sm:left-1/2 sm:-translate-x-1/2',\n 'bottom-right': 'sm:top-auto sm:right-4 sm:bottom-4 sm:left-auto',\n}\n\nconst manager = ToastPrimitive.createToastManager<ToastData>()\n\nlet sequence = 0\n\n// `label` names the content and `onClick` is wrapped, so neither reaches the\n// DOM button as-is; everything else does.\nfunction actionRest({\n label: _label,\n onClick: _onClick,\n ...rest\n}: ToastAction) {\n return rest\n}\n\nfunction toManagerOptions(\n id: string,\n title: React.ReactNode,\n type: ToastType | undefined,\n options: ToastOptions | undefined,\n) {\n const action = options?.action\n return {\n id,\n title,\n type,\n description: options?.description,\n timeout: options?.duration,\n priority: options?.priority,\n onClose: options?.onDismiss,\n // Base UI leaves the toast open after an action; dismissing matches what\n // callers expect from an \"Undo\" button.\n actionProps: action && {\n ...actionRest(action),\n children: action.label,\n onClick: (event: React.MouseEvent<HTMLButtonElement>) => {\n action.onClick?.(event)\n manager.close(id)\n },\n },\n data: { closeButton: options?.closeButton },\n }\n}\n\nconst emit =\n (type?: ToastType) =>\n (message: React.ReactNode, options?: ToastOptions): string => {\n // an id up front lets the action handler close the toast it belongs to\n const id = options?.id ?? `spark-toast-${(sequence += 1)}`\n return manager.add(toManagerOptions(id, message, type, options))\n }\n\n// A string phase becomes a titled toast of that type; an object phase keeps\n// whatever the caller set and only fills in the type.\nconst phase =\n <Value,>(\n value: ToastPromiseMessages<Value>[keyof ToastPromiseMessages<Value>],\n type: ToastType,\n ) =>\n (result: Value) => {\n const resolved = typeof value === 'function' ? value(result) : value\n return { title: resolved, type }\n }\n\nconst toast = Object.assign(emit(), {\n success: emit('success'),\n info: emit('info'),\n warning: emit('warning'),\n error: emit('error'),\n loading: emit('loading'),\n /** Dismiss one toast, or every toast when called without an id. */\n dismiss: (id?: string) => manager.close(id),\n promise: <Value,>(\n promiseValue: Promise<Value>,\n messages: ToastPromiseMessages<Value>,\n ) =>\n manager.promise(promiseValue, {\n loading: { title: messages.loading, type: 'loading' as const },\n success: phase(messages.success, 'success'),\n error: phase(messages.error as never, 'error'),\n }),\n})\n\nfunction ToastIcon({ type }: { type?: string }) {\n const icon = TOAST_ICONS[type as Exclude<ToastType, 'loading'>]\n if (type !== 'loading' && !icon) return null\n\n const Glyph = icon?.icon\n\n // Fixed box matching the title's line height, so the glyph and the spinner\n // both centre on the first line whether or not a description follows.\n return (\n <span\n aria-hidden=\"true\"\n className=\"flex h-5 w-5 shrink-0 items-center justify-center\"\n >\n {type === 'loading' ? (\n // Decorative: the toast already announces the loading message, so the\n // spinner must not add a second status live region.\n <Spinner\n className=\"text-gray-11\"\n label=\"\"\n role=\"presentation\"\n size=\"sm\"\n />\n ) : Glyph ? (\n <Glyph className={cn('[--spark-icon-size:20px]', icon.className)} />\n ) : null}\n </span>\n )\n}\n\nfunction ToastItem({\n closeButton,\n richColors,\n toast: toastObject,\n}: {\n closeButton: boolean\n richColors: boolean\n toast: ToastPrimitive.Root.ToastObject<ToastData>\n}) {\n const tone = TONE_CLASSES[toastObject.type as Exclude<ToastType, 'loading'>]\n const showClose = toastObject.data?.closeButton ?? closeButton\n\n return (\n <ToastPrimitive.Root\n data-slot=\"toast\"\n className={cn(\n // Skin only. All geometry (position, stacking, transitions, the\n // pointer bridge) lives in styles/index.css, because Tailwind's\n // `utilities` layer outranks `components` and a stray `bottom-0` here\n // would beat the stylesheet's `bottom: auto` on top-anchored stacks.\n // The border is what makes the cards behind the front one legible.\n 'flex items-start gap-2 rounded-lg border border-gray-a5 bg-gray-1 p-3 text-gray shadow-md select-none',\n richColors && tone,\n )}\n // the stack is top-anchored on mobile and bottom-anchored above `sm`, so\n // both vertical directions have to dismiss\n swipeDirection={['up', 'down', 'right']}\n toast={toastObject}\n >\n <ToastIcon type={toastObject.type} />\n <ToastPrimitive.Content className=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <ToastPrimitive.Title\n className=\"text-sm font-medium\"\n data-slot=\"toast-title\"\n />\n <ToastPrimitive.Description\n className={cn(\n 'text-sm',\n richColors && tone ? 'text-inherit' : 'text-gray-11',\n )}\n data-slot=\"toast-description\"\n />\n </ToastPrimitive.Content>\n {toastObject.actionProps ? (\n <ToastPrimitive.Action\n // -my-2 keeps the 36px control from stretching a single-line row past\n // the 20px text; self-center then lands it on the title when there is\n // no description, and mid-block when there is one\n className={cn(\n buttonVariants({ size: 'small', variant: 'primary' }),\n '-my-2 shrink-0 self-center rounded-full',\n )}\n data-slot=\"toast-action\"\n />\n ) : null}\n {showClose ? (\n <ToastPrimitive.Close\n aria-label=\"Close\"\n className={cn(\n buttonVariants({ size: 'icon-small', variant: 'tertiary' }),\n // -my-1: same reason as the action, for a 28px control\n '-my-1 -mr-1 size-7 shrink-0 self-center text-gray-11',\n )}\n data-slot=\"toast-close\"\n >\n <Close aria-hidden=\"true\" className=\"[--spark-icon-size:18px]\" />\n </ToastPrimitive.Close>\n ) : null}\n </ToastPrimitive.Root>\n )\n}\n\nfunction ToastList({\n closeButton,\n richColors,\n}: {\n closeButton: boolean\n richColors: boolean\n}) {\n const { toasts } = ToastPrimitive.useToastManager<ToastData>()\n\n return toasts.map((toastObject) => (\n <ToastItem\n closeButton={closeButton}\n key={toastObject.id}\n richColors={richColors}\n toast={toastObject}\n />\n ))\n}\n\ntype ToasterProps = {\n className?: string\n /** Corner or edge the toasts stack in. */\n position?: ToastPosition\n /** Close button on every toast; a per-toast `closeButton` wins. */\n closeButton?: boolean\n /** Tinted surfaces for success/info/warning/error toasts. */\n richColors?: boolean\n /** Default auto-dismiss time in ms. `0` disables auto-dismiss. */\n duration?: number\n /** Toasts visible at once before older ones are marked `data-limited`. */\n limit?: number\n /**\n * Vertical edge below the `sm` breakpoint, where the stack is always\n * full-width and `position` does not apply. Defaults to `top`, matching the\n * end-customer portal.\n */\n mobilePosition?: 'top' | 'bottom'\n}\n\nfunction Toaster({\n className,\n closeButton = true,\n duration = 4000,\n limit,\n mobilePosition = 'top',\n position = 'bottom-right',\n richColors = true,\n}: ToasterProps) {\n return (\n <ToastPrimitive.Provider\n limit={limit}\n timeout={duration}\n toastManager={manager}\n >\n <ToastPrimitive.Portal>\n <ToastPrimitive.Viewport\n // block + zero height: the toasts are absolutely positioned against\n // this box's bottom edge, the way Base UI's stacked example works\n className={cn(\n 'fixed inset-x-4 z-50 block h-0 outline-none',\n mobilePosition === 'top' ? 'top-4' : 'bottom-4',\n 'sm:inset-x-auto sm:w-96 sm:max-w-[calc(100vw-2rem)]',\n POSITION_CLASSES[position],\n className,\n )}\n data-mobile-side={mobilePosition}\n data-side={position.startsWith('top') ? 'top' : 'bottom'}\n data-slot=\"toaster\"\n >\n <ToastList closeButton={closeButton} richColors={richColors} />\n </ToastPrimitive.Viewport>\n </ToastPrimitive.Portal>\n </ToastPrimitive.Provider>\n )\n}\n\nexport { Toaster, toast }\nexport type {\n ToastAction,\n ToasterProps,\n ToastOptions,\n ToastPosition,\n ToastPromiseMessages,\n ToastType,\n}\n"],"mappings":";;;;;;;;;;;;;AA0DA,MAAM,cAGF;CACF,SAAS;EAAE,MAAMA,oBAAAA;EAAa,WAAW;CAAqB;CAC9D,MAAM;EAAE,MAAMC,oBAAAA;EAAM,WAAW;CAAkB;CACjD,SAAS;EAAE,MAAMC,oBAAAA;EAAS,WAAW;CAAqB;CAC1D,OAAO;EAAE,MAAMC,oBAAAA;EAAQ,WAAW;CAAmB;AACvD;AAKA,MAAM,eAA8D;CAClE,SAAS;CACT,MAAM;CACN,SAAS;CACT,OAAO;AACT;AAKA,MAAM,mBAAkD;CACtD,YAAY;CACZ,c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C;GACH,YACC,iBAAA,GAAA,kBAAA,KAACF,qBAAAA,MAAe,OAAhB;IACE,cAAW;IACX,YAAA,GAAA,OAAA,IACEE,0BAAAA,eAAe;KAAE,MAAM;KAAc,SAAS;IAAW,CAAC,GAE1D,sDACF;IACA,aAAU;cAEV,iBAAA,GAAA,kBAAA,KAACC,oBAAAA,OAAD;KAAO,eAAY;KAAO,WAAU;IAA4B,CAAA;GAC5C,CAAA,IACpB;EACe;;AAEzB;AAEA,SAAS,UAAU,EACjB,aACA,cAIC;CACD,MAAM,EAAE,WAAWH,qBAAAA,MAAe,gBAA2B;CAE7D,OAAO,OAAO,KAAK,gBACjB,iBAAA,GAAA,kBAAA,KAAC,WAAD;EACe;EAED;EACZ,OAAO;CACR,GAHM,YAAY,EAGlB,CACF;AACH;AAsBA,SAAS,QAAQ,EACf,WACA,cAAc,MACd,WAAW,KACX,OACA,iBAAiB,OACjB,WAAW,gBACX,aAAa,QACE;CACf,OACE,iBAAA,GAAA,kBAAA,KAACA,qBAAAA,MAAe,UAAhB;EACS;EACP,SAAS;EACT,cAAc;YAEd,iBAAA,GAAA,kBAAA,KAACA,qBAAAA,MAAe,QAAhB,EAAA,UACE,iBAAA,GAAA,kBAAA,KAACA,qBAAAA,MAAe,UAAhB;GAGE,YAAA,GAAA,OAAA,IACE,+CACA,mBAAmB,QAAQ,UAAU,YACrC,uDACA,iBAAiB,WACjB,SACF;GACA,oBAAkB;GAClB,aAAW,SAAS,WAAW,KAAK,IAAI,QAAQ;GAChD,aAAU;aAEV,iBAAA,GAAA,kBAAA,KAAC,WAAD;IAAwB;IAAyB;GAAa,CAAA;EACvC,CAAA,EACJ,CAAA;CACA,CAAA;AAE7B"}
1
+ {"version":3,"file":"toast.cjs","names":["CheckCircle","Info","Warning","Cancel","ToastPrimitive","Spinner","buttonVariants","Close"],"sources":["../../src/components/toast.tsx"],"sourcesContent":["'use client'\n\nimport { Toast as ToastPrimitive } from '@base-ui/react/toast'\nimport {\n Cancel,\n CheckCircle,\n Close,\n Info,\n Warning,\n type SparkIcon,\n} from '@epilot/spark-icons'\nimport * as React from 'react'\nimport { cn } from '../utils/cn'\nimport { buttonVariants } from './button'\nimport { Spinner } from './spinner'\n\ntype ToastType = 'success' | 'info' | 'warning' | 'error' | 'loading'\n\ntype ToastPosition =\n | 'top-left'\n | 'top-center'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'bottom-right'\n\n// Per-toast overrides Base UI carries through untouched as opaque `data`.\ntype ToastData = { closeButton?: boolean }\n\n// `label` is the button's content; everything else a `<button>` takes passes\n// straight through, so a caller can set `className`, `disabled`, `type`, and\n// the rest without a new prop for each one.\ntype ToastAction = Omit<\n React.ComponentPropsWithoutRef<'button'>,\n 'children'\n> & {\n label: React.ReactNode\n}\n\ntype ToastOptions = {\n description?: React.ReactNode\n /** Auto-dismiss time in ms. `0` keeps the toast until dismissed. */\n duration?: number\n /** Reuse an id to update a toast in place instead of stacking a new one. */\n id?: string\n closeButton?: boolean\n action?: ToastAction\n onDismiss?: () => void\n /** `high` announces urgently (assertive); the default is polite. */\n priority?: 'low' | 'high'\n}\n\ntype ToastPromiseMessages<Value> = {\n loading: string\n success: string | ((value: Value) => string)\n error: string | ((error: unknown) => string)\n}\n\nconst TOAST_ICONS: Record<\n Exclude<ToastType, 'loading'>,\n { icon: SparkIcon; className: string }\n> = {\n success: { icon: CheckCircle, className: 'text-success-light' },\n info: { icon: Info, className: 'text-info-light' },\n warning: { icon: Warning, className: 'text-warning-light' },\n error: { icon: Cancel, className: 'text-error-light' },\n}\n\n// Opaque radix steps (bg 2, border 6, text 11) so a floating toast never lets\n// page content bleed through the way the alpha `-soft` tokens would. The border\n// carries the tone too, otherwise a tinted toast keeps a grey outline.\nconst TONE_CLASSES: Record<Exclude<ToastType, 'loading'>, string> = {\n success: 'border-green-6 bg-green-2 text-green-11',\n info: 'border-blue-6 bg-blue-2 text-blue-11',\n warning: 'border-orange-6 bg-orange-2 text-orange-11',\n error: 'border-red-6 bg-red-2 text-red-11',\n}\n\n// Mobile-first: every position drops to a full-width stack at the top, which\n// is what the end-customer portal ships. `position` only takes effect from the\n// `sm` breakpoint up.\nconst POSITION_CLASSES: Record<ToastPosition, string> = {\n 'top-left': 'sm:top-4 sm:right-auto sm:bottom-auto sm:left-4',\n 'top-center':\n 'sm:top-4 sm:right-auto sm:bottom-auto sm:left-1/2 sm:-translate-x-1/2',\n 'top-right': 'sm:top-4 sm:right-4 sm:bottom-auto sm:left-auto',\n 'bottom-left': 'sm:top-auto sm:right-auto sm:bottom-4 sm:left-4',\n 'bottom-center':\n 'sm:top-auto sm:right-auto sm:bottom-4 sm:left-1/2 sm:-translate-x-1/2',\n 'bottom-right': 'sm:top-auto sm:right-4 sm:bottom-4 sm:left-auto',\n}\n\nconst manager = ToastPrimitive.createToastManager<ToastData>()\n\nlet sequence = 0\n\n// `label` names the content and `onClick` is wrapped, so neither reaches the\n// DOM button as-is; everything else does.\nfunction actionRest({\n label: _label,\n onClick: _onClick,\n ...rest\n}: ToastAction) {\n return rest\n}\n\nfunction toManagerOptions(\n id: string,\n title: React.ReactNode,\n type: ToastType | undefined,\n options: ToastOptions | undefined,\n) {\n const action = options?.action\n return {\n id,\n title,\n type,\n description: options?.description,\n timeout: options?.duration,\n priority: options?.priority,\n onClose: options?.onDismiss,\n // Base UI leaves the toast open after an action; dismissing matches what\n // callers expect from an \"Undo\" button.\n actionProps: action && {\n ...actionRest(action),\n children: action.label,\n onClick: (event: React.MouseEvent<HTMLButtonElement>) => {\n action.onClick?.(event)\n manager.close(id)\n },\n },\n data: { closeButton: options?.closeButton },\n }\n}\n\nconst emit =\n (type?: ToastType) =>\n (message: React.ReactNode, options?: ToastOptions): string => {\n // an id up front lets the action handler close the toast it belongs to\n const id = options?.id ?? `spark-toast-${(sequence += 1)}`\n return manager.add(toManagerOptions(id, message, type, options))\n }\n\n// A string phase becomes a titled toast of that type; an object phase keeps\n// whatever the caller set and only fills in the type.\nconst phase =\n <Value,>(\n value: ToastPromiseMessages<Value>[keyof ToastPromiseMessages<Value>],\n type: ToastType,\n ) =>\n (result: Value) => {\n const resolved = typeof value === 'function' ? value(result) : value\n return { title: resolved, type }\n }\n\nconst toast = Object.assign(emit(), {\n success: emit('success'),\n info: emit('info'),\n warning: emit('warning'),\n error: emit('error'),\n loading: emit('loading'),\n /** Dismiss one toast, or every toast when called without an id. */\n dismiss: (id?: string) => manager.close(id),\n promise: <Value,>(\n promiseValue: Promise<Value>,\n messages: ToastPromiseMessages<Value>,\n ) =>\n manager.promise(promiseValue, {\n loading: { title: messages.loading, type: 'loading' as const },\n success: phase(messages.success, 'success'),\n error: phase(messages.error as never, 'error'),\n }),\n})\n\nfunction ToastIcon({ type }: { type?: string }) {\n const icon = TOAST_ICONS[type as Exclude<ToastType, 'loading'>]\n if (type !== 'loading' && !icon) return null\n\n const Glyph = icon?.icon\n\n // Fixed box matching the title's line height, so the glyph and the spinner\n // both centre on the first line whether or not a description follows.\n return (\n <span\n aria-hidden=\"true\"\n className=\"flex h-5 w-5 shrink-0 items-center justify-center\"\n >\n {type === 'loading' ? (\n // Decorative: the toast already announces the loading message, so the\n // spinner must not add a second status live region.\n <Spinner\n className=\"text-gray-11\"\n label=\"\"\n role=\"presentation\"\n size=\"sm\"\n />\n ) : Glyph ? (\n <Glyph className={cn('[--spark-icon-size:20px]', icon.className)} />\n ) : null}\n </span>\n )\n}\n\nfunction ToastItem({\n closeButton,\n richColors,\n toast: toastObject,\n}: {\n closeButton: boolean\n richColors: boolean\n toast: ToastPrimitive.Root.ToastObject<ToastData>\n}) {\n const tone = TONE_CLASSES[toastObject.type as Exclude<ToastType, 'loading'>]\n const showClose = toastObject.data?.closeButton ?? closeButton\n\n return (\n <ToastPrimitive.Root\n data-slot=\"toast\"\n className={cn(\n // Skin only. All geometry (position, stacking, transitions, the\n // pointer bridge) lives in styles/index.css, because Tailwind's\n // `utilities` layer outranks `components` and a stray `bottom-0` here\n // would beat the stylesheet's `bottom: auto` on top-anchored stacks.\n // The border is what makes the cards behind the front one legible.\n 'flex items-start gap-2 rounded-lg border border-gray-a5 bg-gray-1 p-3 text-gray shadow-md select-none',\n richColors && tone,\n )}\n // the stack is top-anchored on mobile and bottom-anchored above `sm`, so\n // both vertical directions have to dismiss\n swipeDirection={['up', 'down', 'right']}\n toast={toastObject}\n >\n <ToastIcon type={toastObject.type} />\n <ToastPrimitive.Content className=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <ToastPrimitive.Title\n className=\"text-sm font-medium\"\n data-slot=\"toast-title\"\n />\n <ToastPrimitive.Description\n className={cn(\n 'text-sm',\n richColors && tone ? 'text-inherit' : 'text-gray-11',\n )}\n data-slot=\"toast-description\"\n />\n </ToastPrimitive.Content>\n {toastObject.actionProps ? (\n <ToastPrimitive.Action\n // -my-2 keeps the 36px control from stretching a single-line row past\n // the 20px text; self-center then lands it on the title when there is\n // no description, and mid-block when there is one\n className={cn(\n buttonVariants({ size: 'small', variant: 'primary' }),\n '-my-2 shrink-0 self-center rounded-full',\n )}\n data-slot=\"toast-action\"\n />\n ) : null}\n {showClose ? (\n <ToastPrimitive.Close\n aria-label=\"Close\"\n className={cn(\n buttonVariants({ size: 'icon-small', variant: 'tertiary' }),\n // -my-1: same reason as the action, for a 28px control\n '-my-1 -mr-1 size-7 shrink-0 self-center text-gray-11',\n )}\n data-slot=\"toast-close\"\n >\n <Close aria-hidden=\"true\" className=\"[--spark-icon-size:18px]\" />\n </ToastPrimitive.Close>\n ) : null}\n </ToastPrimitive.Root>\n )\n}\n\nfunction ToastList({\n closeButton,\n richColors,\n}: {\n closeButton: boolean\n richColors: boolean\n}) {\n const { toasts } = ToastPrimitive.useToastManager<ToastData>()\n\n return toasts.map((toastObject) => (\n <ToastItem\n closeButton={closeButton}\n key={toastObject.id}\n richColors={richColors}\n toast={toastObject}\n />\n ))\n}\n\ntype ToasterProps = {\n className?: string\n /** Corner or edge the toasts stack in. */\n position?: ToastPosition\n /** Close button on every toast; a per-toast `closeButton` wins. */\n closeButton?: boolean\n /** Tinted surfaces for success/info/warning/error toasts. */\n richColors?: boolean\n /** Default auto-dismiss time in ms. `0` disables auto-dismiss. */\n duration?: number\n /** Toasts visible at once before older ones are marked `data-limited`. */\n limit?: number\n /**\n * Vertical edge below the `sm` breakpoint, where the stack is always\n * full-width and `position` does not apply. Defaults to `top`, matching the\n * end-customer portal.\n */\n mobilePosition?: 'top' | 'bottom'\n}\n\nfunction Toaster({\n className,\n closeButton = true,\n duration = 4000,\n limit,\n mobilePosition = 'top',\n position = 'bottom-right',\n richColors = true,\n}: ToasterProps) {\n return (\n <ToastPrimitive.Provider\n limit={limit}\n timeout={duration}\n toastManager={manager}\n >\n <ToastPrimitive.Portal>\n <ToastPrimitive.Viewport\n // block + zero height: the toasts are absolutely positioned against\n // this box's bottom edge, the way Base UI's stacked example works\n className={cn(\n 'fixed inset-x-4 z-50 block h-0 outline-none',\n mobilePosition === 'top' ? 'top-4' : 'bottom-4',\n 'sm:inset-x-auto sm:w-96 sm:max-w-[calc(100vw-2rem)]',\n POSITION_CLASSES[position],\n className,\n )}\n data-mobile-side={mobilePosition}\n data-side={position.startsWith('top') ? 'top' : 'bottom'}\n data-slot=\"toaster\"\n >\n <ToastList closeButton={closeButton} richColors={richColors} />\n </ToastPrimitive.Viewport>\n </ToastPrimitive.Portal>\n </ToastPrimitive.Provider>\n )\n}\n\nexport { Toaster, toast }\nexport type {\n ToastAction,\n ToasterProps,\n ToastOptions,\n ToastPosition,\n ToastPromiseMessages,\n ToastType,\n}\n"],"mappings":";;;;;;;;;;;;;AA0DA,MAAM,cAGF;CACF,SAAS;EAAE,MAAMA,oBAAAA;EAAa,WAAW;CAAqB;CAC9D,MAAM;EAAE,MAAMC,oBAAAA;EAAM,WAAW;CAAkB;CACjD,SAAS;EAAE,MAAMC,oBAAAA;EAAS,WAAW;CAAqB;CAC1D,OAAO;EAAE,MAAMC,oBAAAA;EAAQ,WAAW;CAAmB;AACvD;AAKA,MAAM,eAA8D;CAClE,SAAS;CACT,MAA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E,MAAM;KAAS,SAAS;IAAU,CAAC,GACpD,yCACF;IACA,aAAU;GACX,CAAA,IACC;GACH,YACC,iBAAA,GAAA,kBAAA,KAACF,qBAAAA,MAAe,OAAhB;IACE,cAAW;IACX,YAAA,GAAA,GAAA,IACEE,0BAAAA,eAAe;KAAE,MAAM;KAAc,SAAS;IAAW,CAAC,GAE1D,sDACF;IACA,aAAU;cAEV,iBAAA,GAAA,kBAAA,KAACC,oBAAAA,OAAD;KAAO,eAAY;KAAO,WAAU;IAA4B,CAAA;GAC5C,CAAA,IACpB;EACe;;AAEzB;AAEA,SAAS,UAAU,EACjB,aACA,cAIC;CACD,MAAM,EAAE,WAAWH,qBAAAA,MAAe,gBAA2B;CAE7D,OAAO,OAAO,KAAK,gBACjB,iBAAA,GAAA,kBAAA,KAAC,WAAD;EACe;EAED;EACZ,OAAO;CACR,GAHM,YAAY,EAGlB,CACF;AACH;AAsBA,SAAS,QAAQ,EACf,WACA,cAAc,MACd,WAAW,KACX,OACA,iBAAiB,OACjB,WAAW,gBACX,aAAa,QACE;CACf,OACE,iBAAA,GAAA,kBAAA,KAACA,qBAAAA,MAAe,UAAhB;EACS;EACP,SAAS;EACT,cAAc;YAEd,iBAAA,GAAA,kBAAA,KAACA,qBAAAA,MAAe,QAAhB,EAAA,UACE,iBAAA,GAAA,kBAAA,KAACA,qBAAAA,MAAe,UAAhB;GAGE,YAAA,GAAA,GAAA,IACE,+CACA,mBAAmB,QAAQ,UAAU,YACrC,uDACA,iBAAiB,WACjB,SACF;GACA,oBAAkB;GAClB,aAAW,SAAS,WAAW,KAAK,IAAI,QAAQ;GAChD,aAAU;aAEV,iBAAA,GAAA,kBAAA,KAAC,WAAD;IAAwB;IAAyB;GAAa,CAAA;EACvC,CAAA,EACJ,CAAA;CACA,CAAA;AAE7B"}
@@ -6,7 +6,7 @@ react = require_chunk.__toESM(react);
6
6
  let _epilot_spark_icons = require("@epilot/spark-icons");
7
7
  let react_jsx_runtime = require("react/jsx-runtime");
8
8
  let _base_ui_react_tooltip = require("@base-ui/react/tooltip");
9
- let cnfast = require("cnfast");
9
+ let cn = require("cn");
10
10
  //#region src/components/tooltip.tsx
11
11
  const TooltipProvider = ({ delay = 0, ...props }) => {
12
12
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_tooltip.Tooltip.Provider, {
@@ -39,11 +39,11 @@ const TooltipContent = ({ className, hideArrow = false, variant = "default", chi
39
39
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_base_ui_react_tooltip.Tooltip.Popup, {
40
40
  "data-slot": "tooltip-content",
41
41
  "data-variant": variant,
42
- className: (0, cnfast.cn)("z-50 w-fit origin-(--transform-origin) rounded-lg p-2 text-xs leading-none transition-[opacity,scale,translate] duration-150", "data-starting-style:scale-95 data-starting-style:opacity-0", "data-[side=bottom]:data-starting-style:-translate-y-1 data-[side=left]:data-starting-style:translate-x-1 data-[side=right]:data-starting-style:-translate-x-1 data-[side=top]:data-starting-style:translate-y-1", "data-ending-style:opacity-0 data-ending-style:duration-0", "data-[variant=default]:bg-gray-12 data-[variant=default]:text-gray-1", "data-[variant=destructive]:bg-red-12 data-[variant=destructive]:text-red-1", className),
42
+ className: (0, cn.cn)("z-50 w-fit origin-(--transform-origin) rounded-lg p-2 text-xs leading-none transition-[opacity,scale,translate] duration-150", "data-starting-style:scale-95 data-starting-style:opacity-0", "data-[side=bottom]:data-starting-style:-translate-y-1 data-[side=left]:data-starting-style:translate-x-1 data-[side=right]:data-starting-style:-translate-x-1 data-[side=top]:data-starting-style:translate-y-1", "data-ending-style:opacity-0 data-ending-style:duration-0", "data-[variant=default]:bg-gray-12 data-[variant=default]:text-gray-1", "data-[variant=destructive]:bg-red-12 data-[variant=destructive]:text-red-1", className),
43
43
  ...props,
44
44
  children: [children, !hideArrow && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_tooltip.Tooltip.Arrow, {
45
45
  "data-variant": variant,
46
- className: (0, cnfast.cn)("z-50", "data-[side=bottom]:top-[-8px]", "data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180", "data-[side=left]:right-[-13px] data-[side=left]:rotate-90", "data-[side=right]:left-[-13px] data-[side=right]:-rotate-90", "data-[variant=default]:text-gray-12", "data-[variant=destructive]:text-red-12"),
46
+ className: (0, cn.cn)("z-50", "data-[side=bottom]:top-[-8px]", "data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180", "data-[side=left]:right-[-13px] data-[side=left]:rotate-90", "data-[side=right]:left-[-13px] data-[side=right]:-rotate-90", "data-[variant=default]:text-gray-12", "data-[variant=destructive]:text-red-12"),
47
47
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
48
48
  fill: "none",
49
49
  height: "10",
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.cjs","names":["TooltipPrimitive","Info"],"sources":["../../src/components/tooltip.tsx"],"sourcesContent":["import { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip'\nimport { Info } from '@epilot/spark-icons'\nimport * as React from 'react'\nimport { cn } from '../utils/cn'\n\nconst TooltipProvider = ({\n delay = 0,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) => {\n return <TooltipPrimitive.Provider delay={delay} {...props} />\n}\n\nconst TooltipPortal = ({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Portal>) => {\n return <TooltipPrimitive.Portal data-slot=\"tooltip-portal\" {...props} />\n}\n\ntype TooltipProps = React.ComponentProps<typeof TooltipPrimitive.Root>\n\nconst Tooltip = ({ ...props }: TooltipProps) => {\n return <TooltipPrimitive.Root {...props} />\n}\n\nconst TooltipTrigger = ({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) => {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />\n}\n\ntype TooltipContentProps = React.ComponentProps<typeof TooltipPrimitive.Popup> &\n Pick<\n TooltipPrimitive.Positioner.Props,\n 'align' | 'alignOffset' | 'side' | 'sideOffset'\n > & {\n hideArrow?: boolean\n variant?: 'default' | 'destructive'\n }\n\nconst TooltipContent = ({\n className,\n hideArrow = false,\n variant = 'default',\n children,\n align,\n alignOffset,\n side,\n sideOffset = 4,\n ...props\n}: TooltipContentProps) => {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Positioner\n align={align}\n alignOffset={alignOffset}\n className=\"isolate z-50\"\n side={side}\n sideOffset={sideOffset}\n >\n <TooltipPrimitive.Popup\n data-slot=\"tooltip-content\"\n data-variant={variant}\n className={cn(\n 'z-50 w-fit origin-(--transform-origin) rounded-lg p-2 text-xs leading-none transition-[opacity,scale,translate] duration-150',\n // enter: fade + zoom + a slight per-side slide (was animate-in)\n 'data-starting-style:scale-95 data-starting-style:opacity-0',\n 'data-[side=bottom]:data-starting-style:-translate-y-1 data-[side=left]:data-starting-style:translate-x-1 data-[side=right]:data-starting-style:-translate-x-1 data-[side=top]:data-starting-style:translate-y-1',\n // exit: instant (was data-[state=closed]:duration-0)\n 'data-ending-style:opacity-0 data-ending-style:duration-0',\n 'data-[variant=default]:bg-gray-12 data-[variant=default]:text-gray-1',\n 'data-[variant=destructive]:bg-red-12 data-[variant=destructive]:text-red-1',\n className,\n )}\n {...props}\n >\n {children}\n {!hideArrow && (\n <TooltipPrimitive.Arrow\n data-variant={variant}\n className={cn(\n 'z-50',\n // svg tip points up; rotate per side, overlap 2px for a seamless join\n 'data-[side=bottom]:top-[-8px]',\n 'data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180',\n 'data-[side=left]:right-[-13px] data-[side=left]:rotate-90',\n 'data-[side=right]:left-[-13px] data-[side=right]:-rotate-90',\n 'data-[variant=default]:text-gray-12',\n 'data-[variant=destructive]:text-red-12',\n )}\n >\n <svg fill=\"none\" height=\"10\" viewBox=\"0 0 20 10\" width=\"20\">\n <path\n d=\"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z\"\n fill=\"currentColor\"\n />\n </svg>\n </TooltipPrimitive.Arrow>\n )}\n </TooltipPrimitive.Popup>\n </TooltipPrimitive.Positioner>\n </TooltipPrimitive.Portal>\n )\n}\n\ninterface InfoTooltipProps {\n content: string\n label: string\n 'aria-label'?: string\n}\n\nconst InfoTooltip = ({\n content,\n label,\n 'aria-label': ariaLabel,\n}: InfoTooltipProps) => {\n return (\n <Tooltip>\n <TooltipTrigger\n render={\n <button\n aria-label={ariaLabel ?? label}\n className=\"touch-target inline-flex size-6 min-h-[24px] min-w-[24px] shrink-0 cursor-help items-center justify-center rounded-full p-0 text-gray-light transition-colors hover:text-gray focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none\"\n type=\"button\"\n />\n }\n >\n <Info className=\"text-sm!\" />\n </TooltipTrigger>\n <TooltipContent className=\"max-w-xs whitespace-pre-line\">\n {content}\n </TooltipContent>\n </Tooltip>\n )\n}\n\nexport {\n Tooltip,\n TooltipTrigger,\n TooltipContent,\n TooltipProvider,\n TooltipPortal,\n InfoTooltip,\n}\n"],"mappings":";;;;;;;;;;AAKA,MAAM,mBAAmB,EACvB,QAAQ,GACR,GAAG,YACyD;CAC5D,OAAO,iBAAA,GAAA,kBAAA,KAACA,uBAAAA,QAAiB,UAAlB;EAAkC;EAAO,GAAI;CAAQ,CAAA;AAC9D;AAEA,MAAM,iBAAiB,EACrB,GAAG,YACuD;CAC1D,OAAO,iBAAA,GAAA,kBAAA,KAACA,uBAAAA,QAAiB,QAAlB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;AAIA,MAAM,WAAW,EAAE,GAAG,YAA0B;CAC9C,OAAO,iBAAA,GAAA,kBAAA,KAACA,uBAAAA,QAAiB,MAAlB,EAAuB,GAAI,MAAQ,CAAA;AAC5C;AAEA,MAAM,kBAAkB,EACtB,GAAG,YACwD;CAC3D,OAAO,iBAAA,GAAA,kBAAA,KAACA,uBAAAA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AA,CACT,EAAA,CAAA;AAEb"}
1
+ {"version":3,"file":"tooltip.cjs","names":["TooltipPrimitive","Info"],"sources":["../../src/components/tooltip.tsx"],"sourcesContent":["import { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip'\nimport { Info } from '@epilot/spark-icons'\nimport * as React from 'react'\nimport { cn } from '../utils/cn'\n\nconst TooltipProvider = ({\n delay = 0,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) => {\n return <TooltipPrimitive.Provider delay={delay} {...props} />\n}\n\nconst TooltipPortal = ({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Portal>) => {\n return <TooltipPrimitive.Portal data-slot=\"tooltip-portal\" {...props} />\n}\n\ntype TooltipProps = React.ComponentProps<typeof TooltipPrimitive.Root>\n\nconst Tooltip = ({ ...props }: TooltipProps) => {\n return <TooltipPrimitive.Root {...props} />\n}\n\nconst TooltipTrigger = ({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) => {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />\n}\n\ntype TooltipContentProps = React.ComponentProps<typeof TooltipPrimitive.Popup> &\n Pick<\n TooltipPrimitive.Positioner.Props,\n 'align' | 'alignOffset' | 'side' | 'sideOffset'\n > & {\n hideArrow?: boolean\n variant?: 'default' | 'destructive'\n }\n\nconst TooltipContent = ({\n className,\n hideArrow = false,\n variant = 'default',\n children,\n align,\n alignOffset,\n side,\n sideOffset = 4,\n ...props\n}: TooltipContentProps) => {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Positioner\n align={align}\n alignOffset={alignOffset}\n className=\"isolate z-50\"\n side={side}\n sideOffset={sideOffset}\n >\n <TooltipPrimitive.Popup\n data-slot=\"tooltip-content\"\n data-variant={variant}\n className={cn(\n 'z-50 w-fit origin-(--transform-origin) rounded-lg p-2 text-xs leading-none transition-[opacity,scale,translate] duration-150',\n // enter: fade + zoom + a slight per-side slide (was animate-in)\n 'data-starting-style:scale-95 data-starting-style:opacity-0',\n 'data-[side=bottom]:data-starting-style:-translate-y-1 data-[side=left]:data-starting-style:translate-x-1 data-[side=right]:data-starting-style:-translate-x-1 data-[side=top]:data-starting-style:translate-y-1',\n // exit: instant (was data-[state=closed]:duration-0)\n 'data-ending-style:opacity-0 data-ending-style:duration-0',\n 'data-[variant=default]:bg-gray-12 data-[variant=default]:text-gray-1',\n 'data-[variant=destructive]:bg-red-12 data-[variant=destructive]:text-red-1',\n className,\n )}\n {...props}\n >\n {children}\n {!hideArrow && (\n <TooltipPrimitive.Arrow\n data-variant={variant}\n className={cn(\n 'z-50',\n // svg tip points up; rotate per side, overlap 2px for a seamless join\n 'data-[side=bottom]:top-[-8px]',\n 'data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180',\n 'data-[side=left]:right-[-13px] data-[side=left]:rotate-90',\n 'data-[side=right]:left-[-13px] data-[side=right]:-rotate-90',\n 'data-[variant=default]:text-gray-12',\n 'data-[variant=destructive]:text-red-12',\n )}\n >\n <svg fill=\"none\" height=\"10\" viewBox=\"0 0 20 10\" width=\"20\">\n <path\n d=\"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z\"\n fill=\"currentColor\"\n />\n </svg>\n </TooltipPrimitive.Arrow>\n )}\n </TooltipPrimitive.Popup>\n </TooltipPrimitive.Positioner>\n </TooltipPrimitive.Portal>\n )\n}\n\ninterface InfoTooltipProps {\n content: string\n label: string\n 'aria-label'?: string\n}\n\nconst InfoTooltip = ({\n content,\n label,\n 'aria-label': ariaLabel,\n}: InfoTooltipProps) => {\n return (\n <Tooltip>\n <TooltipTrigger\n render={\n <button\n aria-label={ariaLabel ?? label}\n className=\"touch-target inline-flex size-6 min-h-[24px] min-w-[24px] shrink-0 cursor-help items-center justify-center rounded-full p-0 text-gray-light transition-colors hover:text-gray focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none\"\n type=\"button\"\n />\n }\n >\n <Info className=\"text-sm!\" />\n </TooltipTrigger>\n <TooltipContent className=\"max-w-xs whitespace-pre-line\">\n {content}\n </TooltipContent>\n </Tooltip>\n )\n}\n\nexport {\n Tooltip,\n TooltipTrigger,\n TooltipContent,\n TooltipProvider,\n TooltipPortal,\n InfoTooltip,\n}\n"],"mappings":";;;;;;;;;;AAKA,MAAM,mBAAmB,EACvB,QAAQ,GACR,GAAG,YACyD;CAC5D,OAAO,iBAAA,GAAA,kBAAA,KAACA,uBAAAA,QAAiB,UAAlB;EAAkC;EAAO,GAAI;CAAQ,CAAA;AAC9D;AAEA,MAAM,iBAAiB,EACrB,GAAG,YACuD;CAC1D,OAAO,iBAAA,GAAA,kBAAA,KAACA,uBAAAA,QAAiB,QAAlB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;AAIA,MAAM,WAAW,EAAE,GAAG,YAA0B;CAC9C,OAAO,iBAAA,GAAA,kBAAA,KAACA,uBAAAA,QAAiB,MAAlB,EAAuB,GAAI,MAAQ,CAAA;AAC5C;AAEA,MAAM,kBAAkB,EACtB,GAAG,YACwD;CAC3D,OAAO,iBAAA,GAAA,kBAAA,KAACA,uBAAAA,QAAiB,SAAlB;EAA0B,aAAU;EAAkB,GAAI;CAAQ,CAAA;AAC3E;AAWA,MAAM,kBAAkB,EACtB,WACA,YAAY,OACZ,UAAU,WACV,UACA,OACA,aACA,MACA,aAAa,GACb,GAAG,YACsB;CACzB,OACE,iBAAA,GAAA,kBAAA,KAACA,uBAAAA,QAAiB,QAAlB,EAAA,UACE,iBAAA,GAAA,kBAAA,KAACA,uBAAAA,QAAiB,YAAlB;EACS;EACM;EACb,WAAU;EACJ;EACM;YAEZ,iBAAA,GAAA,kBAAA,MAACA,uBAAAA,QAAiB,OAAlB;GACE,aAAU;GACV,gBAAc;GACd,YAAA,GAAA,GAAA,IACE,gIAEA,8DACA,mNAEA,4DACA,wEACA,8EACA,SACF;GACA,GAAI;aAdN,CAgBG,UACA,CAAC,aACA,iBAAA,GAAA,kBAAA,KAACA,uBAAAA,QAAiB,OAAlB;IACE,gBAAc;IACd,YAAA,GAAA,GAAA,IACE,QAEA,iCACA,4DACA,6DACA,+DACA,uCACA,wCACF;cAEA,iBAAA,GAAA,kBAAA,KAAC,OAAD;KAAK,MAAK;KAAO,QAAO;KAAK,SAAQ;KAAY,OAAM;eACrD,iBAAA,GAAA,kBAAA,KAAC,QAAD;MACE,GAAE;MACF,MAAK;KACN,CAAA;IACE,CAAA;GACiB,CAAA,CAEJ;;CACG,CAAA,EACN,CAAA;AAE7B;AAQA,MAAM,eAAe,EACnB,SACA,OACA,cAAc,gBACQ;CACtB,OACE,iBAAA,GAAA,kBAAA,MAAC,SAAD,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,KAAC,gBAAD;EACE,QACE,iBAAA,GAAA,kBAAA,KAAC,UAAD;GACE,cAAY,aAAa;GACzB,WAAU;GACV,MAAK;EACN,CAAA;YAGH,iBAAA,GAAA,kBAAA,KAACC,oBAAAA,MAAD,EAAM,WAAU,WAAY,CAAA;CACd,CAAA,GAChB,iBAAA,GAAA,kBAAA,KAAC,gBAAD;EAAgB,WAAU;YACvB;CACa,CAAA,CACT,EAAA,CAAA;AAEb"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  let react_jsx_runtime = require("react/jsx-runtime");
4
- let cnfast = require("cnfast");
4
+ let cn = require("cn");
5
5
  //#region src/components/typography.tsx
6
6
  const PowerValue = ({ "aria-label": ariaLabel, ...props }) => {
7
7
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
@@ -12,31 +12,31 @@ const PowerValue = ({ "aria-label": ariaLabel, ...props }) => {
12
12
  };
13
13
  const PageTitle = ({ className, ...props }) => {
14
14
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
15
- className: (0, cnfast.cn)("text-xl font-bold wrap-break-word", className),
15
+ className: (0, cn.cn)("text-xl font-bold wrap-break-word", className),
16
16
  ...props
17
17
  });
18
18
  };
19
19
  const SectionTitle = ({ className, ...props }) => {
20
20
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
21
- className: (0, cnfast.cn)("text-base font-bold text-gray", className),
21
+ className: (0, cn.cn)("text-base font-bold text-gray", className),
22
22
  ...props
23
23
  });
24
24
  };
25
25
  const SectionDescription = ({ className, ...props }) => {
26
26
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
27
- className: (0, cnfast.cn)("text-sm text-gray-light", className),
27
+ className: (0, cn.cn)("text-sm text-gray-light", className),
28
28
  ...props
29
29
  });
30
30
  };
31
31
  const SectionSubtitle = ({ className, ...props }) => {
32
32
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", {
33
- className: (0, cnfast.cn)("text-sm font-bold tracking-wider text-gray-light uppercase", className),
33
+ className: (0, cn.cn)("text-sm font-bold tracking-wider text-gray-light uppercase", className),
34
34
  ...props
35
35
  });
36
36
  };
37
37
  const StateValue = ({ className, ...props }) => {
38
38
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
39
- className: (0, cnfast.cn)("text-xl font-black tabular-nums", className),
39
+ className: (0, cn.cn)("text-xl font-black tabular-nums", className),
40
40
  ...props
41
41
  });
42
42
  };
@@ -1 +1 @@
1
- {"version":3,"file":"typography.cjs","names":[],"sources":["../../src/components/typography.tsx"],"sourcesContent":["import { cn } from '../utils/cn'\n\ntype PowerValueProps = Omit<React.ComponentProps<'h2'>, 'aria-label'> & {\n 'aria-label': string\n}\n\nconst PowerValue = ({ 'aria-label': ariaLabel, ...props }: PowerValueProps) => {\n return (\n <h2\n className=\"text-3xl font-bold text-gray tabular-nums\"\n aria-label={ariaLabel}\n {...props}\n />\n )\n}\n\nconst PageTitle = ({ className, ...props }: React.ComponentProps<'h2'>) => {\n return (\n <h2\n className={cn('text-xl font-bold wrap-break-word', className)}\n {...props}\n />\n )\n}\n\nconst SectionTitle = ({ className, ...props }: React.ComponentProps<'h2'>) => {\n return (\n <h3 className={cn('text-base font-bold text-gray', className)} {...props} />\n )\n}\n\nconst SectionDescription = ({\n className,\n ...props\n}: React.ComponentProps<'p'>) => {\n return <p className={cn('text-sm text-gray-light', className)} {...props} />\n}\n\nconst SectionSubtitle = ({\n className,\n ...props\n}: React.ComponentProps<'h3'>) => {\n return (\n <h4\n className={cn(\n 'text-sm font-bold tracking-wider text-gray-light uppercase',\n className,\n )}\n {...props}\n />\n )\n}\n\nconst StateValue = ({ className, ...props }: React.ComponentProps<'span'>) => {\n return (\n <span\n className={cn('text-xl font-black tabular-nums', className)}\n {...props}\n />\n )\n}\n\nexport {\n PowerValue,\n PageTitle,\n SectionTitle,\n SectionDescription,\n SectionSubtitle,\n StateValue,\n}\n"],"mappings":";;;;;AAMA,MAAM,cAAc,EAAE,cAAc,WAAW,GAAG,YAA6B;CAC7E,OACE,iBAAA,GAAA,kBAAA,KAAC,MAAD;EACE,WAAU;EACV,cAAY;EACZ,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,aAAa,EAAE,WAAW,GAAG,YAAwC;CACzE,OACE,iBAAA,GAAA,kBAAA,KAAC,MAAD;EACE,YAAA,GAAA,OAAA,IAAc,qCAAqC,SAAS;EAC5D,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,gBAAgB,EAAE,WAAW,GAAG,YAAwC;CAC5E,OACE,iBAAA,GAAA,kBAAA,KAAC,MAAD;EAAI,YAAA,GAAA,OAAA,IAAc,iCAAiC,SAAS;EAAG,GAAI;CAAQ,CAAA;AAE/E;AAEA,MAAM,sBAAsB,EAC1B,WACA,GAAG,YAC4B;CAC/B,OAAO,iBAAA,GAAA,kBAAA,KAAC,KAAD;EAAG,YAAA,GAAA,OAAA,IAAc,2BAA2B,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC7E;AAEA,MAAM,mBAAmB,EACvB,WACA,GAAG,YAC6B;CAChC,OACE,iBAAA,GAAA,kBAAA,KAAC,MAAD;EACE,YAAA,GAAA,OAAA,IACE,8DACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,cAAc,EAAE,WAAW,GAAG,YAA0C;CAC5E,OACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;EACE,YAAA,GAAA,OAAA,IAAc,mCAAmC,SAAS;EAC1D,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"typography.cjs","names":[],"sources":["../../src/components/typography.tsx"],"sourcesContent":["import { cn } from '../utils/cn'\n\ntype PowerValueProps = Omit<React.ComponentProps<'h2'>, 'aria-label'> & {\n 'aria-label': string\n}\n\nconst PowerValue = ({ 'aria-label': ariaLabel, ...props }: PowerValueProps) => {\n return (\n <h2\n className=\"text-3xl font-bold text-gray tabular-nums\"\n aria-label={ariaLabel}\n {...props}\n />\n )\n}\n\nconst PageTitle = ({ className, ...props }: React.ComponentProps<'h2'>) => {\n return (\n <h2\n className={cn('text-xl font-bold wrap-break-word', className)}\n {...props}\n />\n )\n}\n\nconst SectionTitle = ({ className, ...props }: React.ComponentProps<'h2'>) => {\n return (\n <h3 className={cn('text-base font-bold text-gray', className)} {...props} />\n )\n}\n\nconst SectionDescription = ({\n className,\n ...props\n}: React.ComponentProps<'p'>) => {\n return <p className={cn('text-sm text-gray-light', className)} {...props} />\n}\n\nconst SectionSubtitle = ({\n className,\n ...props\n}: React.ComponentProps<'h3'>) => {\n return (\n <h4\n className={cn(\n 'text-sm font-bold tracking-wider text-gray-light uppercase',\n className,\n )}\n {...props}\n />\n )\n}\n\nconst StateValue = ({ className, ...props }: React.ComponentProps<'span'>) => {\n return (\n <span\n className={cn('text-xl font-black tabular-nums', className)}\n {...props}\n />\n )\n}\n\nexport {\n PowerValue,\n PageTitle,\n SectionTitle,\n SectionDescription,\n SectionSubtitle,\n StateValue,\n}\n"],"mappings":";;;;;AAMA,MAAM,cAAc,EAAE,cAAc,WAAW,GAAG,YAA6B;CAC7E,OACE,iBAAA,GAAA,kBAAA,KAAC,MAAD;EACE,WAAU;EACV,cAAY;EACZ,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,aAAa,EAAE,WAAW,GAAG,YAAwC;CACzE,OACE,iBAAA,GAAA,kBAAA,KAAC,MAAD;EACE,YAAA,GAAA,GAAA,IAAc,qCAAqC,SAAS;EAC5D,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,gBAAgB,EAAE,WAAW,GAAG,YAAwC;CAC5E,OACE,iBAAA,GAAA,kBAAA,KAAC,MAAD;EAAI,YAAA,GAAA,GAAA,IAAc,iCAAiC,SAAS;EAAG,GAAI;CAAQ,CAAA;AAE/E;AAEA,MAAM,sBAAsB,EAC1B,WACA,GAAG,YAC4B;CAC/B,OAAO,iBAAA,GAAA,kBAAA,KAAC,KAAD;EAAG,YAAA,GAAA,GAAA,IAAc,2BAA2B,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC7E;AAEA,MAAM,mBAAmB,EACvB,WACA,GAAG,YAC6B;CAChC,OACE,iBAAA,GAAA,kBAAA,KAAC,MAAD;EACE,YAAA,GAAA,GAAA,IACE,8DACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,cAAc,EAAE,WAAW,GAAG,YAA0C;CAC5E,OACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;EACE,YAAA,GAAA,GAAA,IAAc,mCAAmC,SAAS;EAC1D,GAAI;CACL,CAAA;AAEL"}
@@ -1,47 +1,47 @@
1
1
  "use client";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  let react_jsx_runtime = require("react/jsx-runtime");
4
- let cnfast = require("cnfast");
4
+ let cn = require("cn");
5
5
  //#region src/components/wizard-layout.tsx
6
6
  const WizardLayout = ({ className, ...rest }) => {
7
7
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8
- className: (0, cnfast.cn)("flex flex-col gap-[calc(var(--spark-layout-gap)*6)]", className),
8
+ className: (0, cn.cn)("flex flex-col gap-[calc(var(--spark-layout-gap)*6)]", className),
9
9
  ...rest
10
10
  });
11
11
  };
12
12
  const WizardLayoutHeader = ({ className, ...rest }) => {
13
13
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
14
- className: (0, cnfast.cn)("flex flex-col gap-[calc(var(--spark-layout-gap)*3)] pt-4", className),
14
+ className: (0, cn.cn)("flex flex-col gap-[calc(var(--spark-layout-gap)*3)] pt-4", className),
15
15
  ...rest
16
16
  });
17
17
  };
18
18
  const WizardLayoutHeading = ({ className, ...rest }) => {
19
19
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
20
- className: (0, cnfast.cn)("flex flex-col gap-[calc(var(--spark-layout-gap)*1)]", className),
20
+ className: (0, cn.cn)("flex flex-col gap-[calc(var(--spark-layout-gap)*1)]", className),
21
21
  ...rest
22
22
  });
23
23
  };
24
24
  const WizardLayoutTitleRow = ({ className, ...rest }) => {
25
25
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
26
- className: (0, cnfast.cn)("flex items-center justify-between", className),
26
+ className: (0, cn.cn)("flex items-center justify-between", className),
27
27
  ...rest
28
28
  });
29
29
  };
30
30
  const WizardLayoutTitle = ({ className, ...rest }) => {
31
31
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
32
- className: (0, cnfast.cn)("text-lg font-bold text-gray", className),
32
+ className: (0, cn.cn)("text-lg font-bold text-gray", className),
33
33
  ...rest
34
34
  });
35
35
  };
36
36
  const WizardLayoutDescription = ({ className, ...rest }) => {
37
37
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
38
- className: (0, cnfast.cn)("text-sm text-gray-light", className),
38
+ className: (0, cn.cn)("text-sm text-gray-light", className),
39
39
  ...rest
40
40
  });
41
41
  };
42
42
  const WizardLayoutFooter = ({ className, ...rest }) => {
43
43
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
44
- className: (0, cnfast.cn)("flex items-center justify-between", className),
44
+ className: (0, cn.cn)("flex items-center justify-between", className),
45
45
  ...rest
46
46
  });
47
47
  };
@@ -1 +1 @@
1
- {"version":3,"file":"wizard-layout.cjs","names":[],"sources":["../../src/components/wizard-layout.tsx"],"sourcesContent":["import { cn } from '../utils/cn'\n\nconst WizardLayout = ({ className, ...rest }: React.ComponentProps<'div'>) => {\n return (\n <div\n className={cn(\n 'flex flex-col gap-[calc(var(--spark-layout-gap)*6)]',\n className,\n )}\n {...rest}\n />\n )\n}\n\nconst WizardLayoutHeader = ({\n className,\n ...rest\n}: React.ComponentProps<'div'>) => {\n return (\n <div\n className={cn(\n 'flex flex-col gap-[calc(var(--spark-layout-gap)*3)] pt-4',\n className,\n )}\n {...rest}\n />\n )\n}\n\nconst WizardLayoutHeading = ({\n className,\n ...rest\n}: React.ComponentProps<'div'>) => {\n return (\n <div\n className={cn(\n 'flex flex-col gap-[calc(var(--spark-layout-gap)*1)]',\n className,\n )}\n {...rest}\n />\n )\n}\n\nconst WizardLayoutTitleRow = ({\n className,\n ...rest\n}: React.ComponentProps<'div'>) => {\n return (\n <div\n className={cn('flex items-center justify-between', className)}\n {...rest}\n />\n )\n}\n\nconst WizardLayoutTitle = ({\n className,\n ...rest\n}: React.ComponentProps<'h2'>) => {\n return (\n <h2 className={cn('text-lg font-bold text-gray', className)} {...rest} />\n )\n}\n\nconst WizardLayoutDescription = ({\n className,\n ...rest\n}: React.ComponentProps<'p'>) => {\n return <p className={cn('text-sm text-gray-light', className)} {...rest} />\n}\n\nconst WizardLayoutFooter = ({\n className,\n ...rest\n}: React.ComponentProps<'div'>) => {\n return (\n <div\n className={cn('flex items-center justify-between', className)}\n {...rest}\n />\n )\n}\n\nexport {\n WizardLayout,\n WizardLayoutHeader,\n WizardLayoutHeading,\n WizardLayoutTitleRow,\n WizardLayoutTitle,\n WizardLayoutDescription,\n WizardLayoutFooter,\n}\n"],"mappings":";;;;;AAEA,MAAM,gBAAgB,EAAE,WAAW,GAAG,WAAwC;CAC5E,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,YAAA,GAAA,OAAA,IACE,uDACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,sBAAsB,EAC1B,WACA,GAAG,WAC8B;CACjC,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,YAAA,GAAA,OAAA,IACE,4DACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,uBAAuB,EAC3B,WACA,GAAG,WAC8B;CACjC,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,YAAA,GAAA,OAAA,IACE,uDACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,wBAAwB,EAC5B,WACA,GAAG,WAC8B;CACjC,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,YAAA,GAAA,OAAA,IAAc,qCAAqC,SAAS;EAC5D,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,qBAAqB,EACzB,WACA,GAAG,WAC6B;CAChC,OACE,iBAAA,GAAA,kBAAA,KAAC,MAAD;EAAI,YAAA,GAAA,OAAA,IAAc,+BAA+B,SAAS;EAAG,GAAI;CAAO,CAAA;AAE5E;AAEA,MAAM,2BAA2B,EAC/B,WACA,GAAG,WAC4B;CAC/B,OAAO,iBAAA,GAAA,kBAAA,KAAC,KAAD;EAAG,YAAA,GAAA,OAAA,IAAc,2BAA2B,SAAS;EAAG,GAAI;CAAO,CAAA;AAC5E;AAEA,MAAM,sBAAsB,EAC1B,WACA,GAAG,WAC8B;CACjC,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,YAAA,GAAA,OAAA,IAAc,qCAAqC,SAAS;EAC5D,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"wizard-layout.cjs","names":[],"sources":["../../src/components/wizard-layout.tsx"],"sourcesContent":["import { cn } from '../utils/cn'\n\nconst WizardLayout = ({ className, ...rest }: React.ComponentProps<'div'>) => {\n return (\n <div\n className={cn(\n 'flex flex-col gap-[calc(var(--spark-layout-gap)*6)]',\n className,\n )}\n {...rest}\n />\n )\n}\n\nconst WizardLayoutHeader = ({\n className,\n ...rest\n}: React.ComponentProps<'div'>) => {\n return (\n <div\n className={cn(\n 'flex flex-col gap-[calc(var(--spark-layout-gap)*3)] pt-4',\n className,\n )}\n {...rest}\n />\n )\n}\n\nconst WizardLayoutHeading = ({\n className,\n ...rest\n}: React.ComponentProps<'div'>) => {\n return (\n <div\n className={cn(\n 'flex flex-col gap-[calc(var(--spark-layout-gap)*1)]',\n className,\n )}\n {...rest}\n />\n )\n}\n\nconst WizardLayoutTitleRow = ({\n className,\n ...rest\n}: React.ComponentProps<'div'>) => {\n return (\n <div\n className={cn('flex items-center justify-between', className)}\n {...rest}\n />\n )\n}\n\nconst WizardLayoutTitle = ({\n className,\n ...rest\n}: React.ComponentProps<'h2'>) => {\n return (\n <h2 className={cn('text-lg font-bold text-gray', className)} {...rest} />\n )\n}\n\nconst WizardLayoutDescription = ({\n className,\n ...rest\n}: React.ComponentProps<'p'>) => {\n return <p className={cn('text-sm text-gray-light', className)} {...rest} />\n}\n\nconst WizardLayoutFooter = ({\n className,\n ...rest\n}: React.ComponentProps<'div'>) => {\n return (\n <div\n className={cn('flex items-center justify-between', className)}\n {...rest}\n />\n )\n}\n\nexport {\n WizardLayout,\n WizardLayoutHeader,\n WizardLayoutHeading,\n WizardLayoutTitleRow,\n WizardLayoutTitle,\n WizardLayoutDescription,\n WizardLayoutFooter,\n}\n"],"mappings":";;;;;AAEA,MAAM,gBAAgB,EAAE,WAAW,GAAG,WAAwC;CAC5E,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,YAAA,GAAA,GAAA,IACE,uDACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,sBAAsB,EAC1B,WACA,GAAG,WAC8B;CACjC,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,YAAA,GAAA,GAAA,IACE,4DACA,SACF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