@six-vallees/ui-react 0.4.0 → 0.6.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 (79) hide show
  1. package/README.md +3 -3
  2. package/dist/avatar/avatar.d.ts +30 -0
  3. package/dist/avatar/avatar.js +11 -0
  4. package/dist/avatar/avatar.js.map +1 -0
  5. package/dist/badge/badge.d.ts +32 -0
  6. package/dist/badge/badge.js +10 -0
  7. package/dist/badge/badge.js.map +1 -0
  8. package/dist/charts/bar-chart.js +2 -2
  9. package/dist/charts/lib/series.d.ts +4 -2
  10. package/dist/charts/lib/series.js +1 -1
  11. package/dist/charts/line-chart.js +2 -2
  12. package/dist/charts/ring.d.ts +1 -1
  13. package/dist/charts/ring.js +2 -2
  14. package/dist/charts/segmented-bar.js +2 -2
  15. package/dist/chunk-BYZCFI7X.js +32 -0
  16. package/dist/chunk-BYZCFI7X.js.map +1 -0
  17. package/dist/{chunk-OHY4VIKZ.js → chunk-CZ3JB37A.js} +3 -4
  18. package/dist/chunk-CZ3JB37A.js.map +1 -0
  19. package/dist/chunk-DCKWB3EY.js +35 -0
  20. package/dist/chunk-DCKWB3EY.js.map +1 -0
  21. package/dist/{chunk-TI5GM4IR.js → chunk-G2XJK244.js} +7 -7
  22. package/dist/{chunk-TI5GM4IR.js.map → chunk-G2XJK244.js.map} +1 -1
  23. package/dist/chunk-GNHNTI5A.js +30 -0
  24. package/dist/chunk-GNHNTI5A.js.map +1 -0
  25. package/dist/chunk-HHUI32DT.js +36 -0
  26. package/dist/chunk-HHUI32DT.js.map +1 -0
  27. package/dist/chunk-OVF2VS3L.js +42 -0
  28. package/dist/chunk-OVF2VS3L.js.map +1 -0
  29. package/dist/{chunk-N2DFXOTF.js → chunk-OWIUMX76.js} +2 -2
  30. package/dist/chunk-POUL3ZTV.js +60 -0
  31. package/dist/chunk-POUL3ZTV.js.map +1 -0
  32. package/dist/chunk-R7BM6J75.js +93 -0
  33. package/dist/chunk-R7BM6J75.js.map +1 -0
  34. package/dist/chunk-RXDJPRH5.js +39 -0
  35. package/dist/chunk-RXDJPRH5.js.map +1 -0
  36. package/dist/{chunk-PIFHG2WO.js → chunk-S4HVXD6Z.js} +8 -6
  37. package/dist/chunk-S4HVXD6Z.js.map +1 -0
  38. package/dist/chunk-ULEDFFUJ.js +43 -0
  39. package/dist/chunk-ULEDFFUJ.js.map +1 -0
  40. package/dist/chunk-WHD5CSTB.js +52 -0
  41. package/dist/chunk-WHD5CSTB.js.map +1 -0
  42. package/dist/chunk-WHJ4JVO6.js +39 -0
  43. package/dist/chunk-WHJ4JVO6.js.map +1 -0
  44. package/dist/{chunk-65VQL6R2.js → chunk-YX6MSLUB.js} +2 -2
  45. package/dist/chunk-YX6MSLUB.js.map +1 -0
  46. package/dist/index.d.ts +19 -0
  47. package/dist/index.js +118 -12
  48. package/dist/input/input.d.ts +22 -0
  49. package/dist/input/input.js +8 -0
  50. package/dist/input/input.js.map +1 -0
  51. package/dist/input/label.d.ts +32 -0
  52. package/dist/input/label.js +11 -0
  53. package/dist/input/label.js.map +1 -0
  54. package/dist/input/textarea.d.ts +13 -0
  55. package/dist/input/textarea.js +8 -0
  56. package/dist/input/textarea.js.map +1 -0
  57. package/dist/overlay/alert-dialog.d.ts +42 -0
  58. package/dist/overlay/alert-dialog.js +23 -0
  59. package/dist/overlay/alert-dialog.js.map +1 -0
  60. package/dist/overlay/popover.d.ts +42 -0
  61. package/dist/overlay/popover.js +17 -0
  62. package/dist/overlay/popover.js.map +1 -0
  63. package/dist/overlay/sheet.d.ts +47 -0
  64. package/dist/overlay/sheet.js +29 -0
  65. package/dist/overlay/sheet.js.map +1 -0
  66. package/dist/overlay/tooltip.d.ts +31 -0
  67. package/dist/overlay/tooltip.js +15 -0
  68. package/dist/overlay/tooltip.js.map +1 -0
  69. package/dist/tabs/tabs.d.ts +24 -0
  70. package/dist/tabs/tabs.js +15 -0
  71. package/dist/tabs/tabs.js.map +1 -0
  72. package/dist/tabs/toggle-group.d.ts +19 -0
  73. package/dist/tabs/toggle-group.js +11 -0
  74. package/dist/tabs/toggle-group.js.map +1 -0
  75. package/package.json +9 -1
  76. package/dist/chunk-65VQL6R2.js.map +0 -1
  77. package/dist/chunk-OHY4VIKZ.js.map +0 -1
  78. package/dist/chunk-PIFHG2WO.js.map +0 -1
  79. /package/dist/{chunk-N2DFXOTF.js.map → chunk-OWIUMX76.js.map} +0 -0
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # @six-vallees/ui-react
2
2
 
3
- Cairn React components — the Six Vallées design system UI, driven by the Cairn tokens.
3
+ Cairn React components, the Six Vallées design system UI, driven by the Cairn tokens.
4
4
  Neo-grotesque, grayscale-first, WCAG AA, light and dark.
5
5
 
6
6
  > Cairn is Six Vallées' **own** system (Zone C). Client and prospect projects carry their own
7
- > brand — this package is not meant for them.
7
+ > brand, this package is not meant for them.
8
8
 
9
9
  ## Install
10
10
 
@@ -51,4 +51,4 @@ Helpers: `categorical`, `sequential`, `chartToken` (data-viz color, `sys.chart.*
51
51
  ## Notes
52
52
 
53
53
  - Built to ESM + type declarations (tsup); tree-shakeable (`sideEffects: false`).
54
- - No CSS is shipped — components carry Tailwind class strings; your Tailwind generates them.
54
+ - No CSS is shipped, components carry Tailwind class strings; your Tailwind generates them.
@@ -0,0 +1,30 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as React from 'react';
3
+ import * as AvatarPrimitive from '@radix-ui/react-avatar';
4
+ import { VariantProps } from 'class-variance-authority';
5
+
6
+ /**
7
+ * Cairn Avatar. Radix, for the fallback — which is the only hard part.
8
+ *
9
+ * Showing initials until an image loads, and keeping them if it never does, is a
10
+ * three-state problem (idle / loaded / error) that every hand-rolled avatar gets
11
+ * wrong in the same way: it flashes the initials over the loaded image, or it
12
+ * leaves a broken-image icon on a 404. Radix's `Fallback` has the delay and the
13
+ * state machine; we bring the tokens.
14
+ *
15
+ * Neutral by construction. Tinting an avatar per person is a hue with no stated
16
+ * job (rule 3), and it collides with the one signal the system does have.
17
+ */
18
+ declare const avatarVariants: (props?: ({
19
+ size?: "sm" | "md" | "lg" | null | undefined;
20
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
21
+ interface AvatarProps extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>, VariantProps<typeof avatarVariants> {
22
+ size?: 'sm' | 'md' | 'lg';
23
+ /** The person's name. Drives the initials and the accessible label. */
24
+ name: string;
25
+ /** Optional portrait. Absent or failing, the initials stand in. */
26
+ src?: string;
27
+ }
28
+ declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
29
+
30
+ export { Avatar, type AvatarProps, avatarVariants };
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ import {
3
+ Avatar,
4
+ avatarVariants
5
+ } from "../chunk-ULEDFFUJ.js";
6
+ import "../chunk-DXRY7AS4.js";
7
+ export {
8
+ Avatar,
9
+ avatarVariants
10
+ };
11
+ //# sourceMappingURL=avatar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,32 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as React from 'react';
3
+ import { VariantProps } from 'class-variance-authority';
4
+
5
+ /**
6
+ * Cairn Badge. The pill in the `label` role — the one sanctioned kicker
7
+ * (AGENTS.md rule 6), used as a status chip or a section eyebrow.
8
+ *
9
+ * The variants are NOT a palette. `neutral` is the default because the ordinary
10
+ * state of a thing is ordinary, and colouring the ordinary state leaves nothing
11
+ * left to signal with. The four message tones are hue-as-meaning (rule 4) and
12
+ * each is a `-container` fill with its paired, AA-verified `on-*-container` ink
13
+ * — never coloured text on the page ground (rule 1).
14
+ *
15
+ * `main`, the signature accent, is deliberately absent. It is the brand's one
16
+ * signal, a large-format fill with ink on top (rule 3); a small pill is neither
17
+ * large nor a place for 4.04:1 text.
18
+ *
19
+ * Meaning never rests on colour alone (rule 4): the badge always carries its own
20
+ * word. A badge whose only content is a colour is a bug, not a badge.
21
+ */
22
+ declare const badgeVariants: (props?: ({
23
+ tone?: "neutral" | "success" | "info" | "warning" | "error" | "outline" | null | undefined;
24
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
25
+ interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
26
+ tone?: 'neutral' | 'success' | 'info' | 'warning' | 'error' | 'outline';
27
+ /** Render as the child element instead of a `<span>`. */
28
+ asChild?: boolean;
29
+ }
30
+ declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
31
+
32
+ export { Badge, type BadgeProps, badgeVariants };
@@ -0,0 +1,10 @@
1
+ import {
2
+ Badge,
3
+ badgeVariants
4
+ } from "../chunk-RXDJPRH5.js";
5
+ import "../chunk-DXRY7AS4.js";
6
+ export {
7
+ Badge,
8
+ badgeVariants
9
+ };
10
+ //# sourceMappingURL=badge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  BarChart
4
- } from "../chunk-PIFHG2WO.js";
5
- import "../chunk-TI5GM4IR.js";
4
+ } from "../chunk-S4HVXD6Z.js";
5
+ import "../chunk-G2XJK244.js";
6
6
  import "../chunk-DXRY7AS4.js";
7
7
  export {
8
8
  BarChart
@@ -44,8 +44,10 @@ declare function sequentialOn(i: number, n: number): string;
44
44
  declare function categoricalNeedsEdge(i: number): boolean;
45
45
  /** True when `sequential(i, n)` needs a keyline. */
46
46
  declare function sequentialNeedsEdge(i: number, n: number): boolean;
47
- /** True when a mono `tone` fill needs a keyline. Only `muted` (neutral.300, 1.6:1) does. */
48
- declare function toneNeedsEdge(tone: 'ink' | 'muted' | 'accent'): boolean;
47
+ /** True when a mono `tone` fill needs a keyline. None do: `muted` moved to neutral.500 and now
48
+ * clears 3:1 on its own (4.5:1 light / 3.7:1 dark), so mono marks draw no border at all. Kept as
49
+ * a function rather than inlined, so a future tone that IS pale has one place to declare it. */
50
+ declare function toneNeedsEdge(_tone: 'ink' | 'muted' | 'accent'): boolean;
49
51
  /** The keyline itself, or `undefined` when the mark carries its own contrast. Feed straight to
50
52
  * a style `boxShadow`, so a component never hand-writes the inset shadow. */
51
53
  declare function markEdge(needed: boolean): string | undefined;
@@ -11,7 +11,7 @@ import {
11
11
  sequentialOn,
12
12
  toneFill,
13
13
  toneNeedsEdge
14
- } from "../../chunk-TI5GM4IR.js";
14
+ } from "../../chunk-G2XJK244.js";
15
15
  export {
16
16
  CATEGORICAL_MAX,
17
17
  categorical,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  LineChart
3
- } from "../chunk-N2DFXOTF.js";
3
+ } from "../chunk-OWIUMX76.js";
4
4
  import "../chunk-27MWE4F5.js";
5
- import "../chunk-TI5GM4IR.js";
5
+ import "../chunk-G2XJK244.js";
6
6
  import "../chunk-DXRY7AS4.js";
7
7
  export {
8
8
  LineChart
@@ -11,7 +11,7 @@ interface RingProps {
11
11
  tone?: 'ink' | 'accent';
12
12
  /**
13
13
  * Explicit arc colour (a token / CSS colour), overrides `tone`. Pass only colours that
14
- * clear 3:1 against the surface as a thin stroke, ink, blue, or a dark graphite. Acid
14
+ * clear 3:1 against the surface as a thin stroke, ink, blue, or a dark graphite. Silver
15
15
  * and mid-gray are fill-only (they fail as a line); see AGENTS.md rule 9.
16
16
  */
17
17
  color?: string;
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  Ring
4
- } from "../chunk-65VQL6R2.js";
5
- import "../chunk-TI5GM4IR.js";
4
+ } from "../chunk-YX6MSLUB.js";
5
+ import "../chunk-G2XJK244.js";
6
6
  import "../chunk-DXRY7AS4.js";
7
7
  export {
8
8
  Ring
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SegmentedBar
3
- } from "../chunk-OHY4VIKZ.js";
4
- import "../chunk-TI5GM4IR.js";
3
+ } from "../chunk-CZ3JB37A.js";
4
+ import "../chunk-G2XJK244.js";
5
5
  import "../chunk-DXRY7AS4.js";
6
6
  export {
7
7
  SegmentedBar
@@ -0,0 +1,32 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-DXRY7AS4.js";
4
+
5
+ // src/input/input.tsx
6
+ import * as React from "react";
7
+ import { jsx } from "react/jsx-runtime";
8
+ var Input = React.forwardRef(
9
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
10
+ "input",
11
+ {
12
+ ref,
13
+ className: cn(
14
+ "h-11 w-full rounded-field border border-outline-strong bg-surface px-3 sv-body-sm text-on-surface",
15
+ "outline-none placeholder:text-on-surface-variant",
16
+ "focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus",
17
+ "disabled:cursor-not-allowed disabled:opacity-40",
18
+ // Figures in a field align column to column: an amount, a reference or a
19
+ // date is read by its digits, and proportional figures make them dance.
20
+ "tabular-nums",
21
+ className
22
+ ),
23
+ ...props
24
+ }
25
+ )
26
+ );
27
+ Input.displayName = "Input";
28
+
29
+ export {
30
+ Input
31
+ };
32
+ //# sourceMappingURL=chunk-BYZCFI7X.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/input/input.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '@/lib/utils';\n\n/**\n * Cairn Input. A text field, and nothing more.\n *\n * No Radix here on purpose: an `<input>` has no behaviour to borrow. Wrapping a\n * bare element in a primitive would add a dependency and a layer of indirection\n * for a `className`. Radix earns its place where there is focus management,\n * dismissal or ARIA wiring to get right, not here.\n *\n * `field` radius by role (AGENTS.md rule 7), hairline outline in neutral (rule\n * 7 again: border colour is never a hue), and the placeholder sits on\n * `on-surface-variant` so it reads as absent text rather than as entered text.\n * Height matches `Button` at size `md`, so a field and its action align on a row.\n *\n * Pair it with `Label` — a field whose only label is its placeholder loses that\n * label the moment someone types.\n */\nexport type InputProps = React.InputHTMLAttributes<HTMLInputElement>;\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, ...props }, ref) => (\n <input\n ref={ref}\n className={cn(\n 'h-11 w-full rounded-field border border-outline-strong bg-surface px-3 sv-body-sm text-on-surface',\n 'outline-none placeholder:text-on-surface-variant',\n 'focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus',\n 'disabled:cursor-not-allowed disabled:opacity-40',\n // Figures in a field align column to column: an amount, a reference or a\n // date is read by its digits, and proportional figures make them dance.\n 'tabular-nums',\n className\n )}\n {...props}\n />\n )\n);\nInput.displayName = 'Input';\n"],"mappings":";;;;;AAAA,YAAY,WAAW;AAuBnB;AAFG,IAAM,QAAc;AAAA,EACzB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA;AAAA,QAGA;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,MAAM,cAAc;","names":[]}
@@ -8,7 +8,7 @@ import {
8
8
  sequentialNeedsEdge,
9
9
  sequentialOn,
10
10
  toneNeedsEdge
11
- } from "./chunk-TI5GM4IR.js";
11
+ } from "./chunk-G2XJK244.js";
12
12
  import {
13
13
  cn
14
14
  } from "./chunk-DXRY7AS4.js";
@@ -28,8 +28,7 @@ function SegmentedBar({ data, height = 40, scale = "mono", showLegend = true, cl
28
28
  const onFill = (d, i) => {
29
29
  if (scale === "categorical") return categoricalOn(i);
30
30
  if (scale === "sequential") return sequentialOn(i, data.length);
31
- if (!hasActive) return "var(--sv-sys-color-on-primary)";
32
- return d.active ? "var(--sv-sys-color-on-primary)" : "var(--sv-sys-color-on-surface)";
31
+ return "var(--sv-sys-color-on-primary)";
33
32
  };
34
33
  const edge = (d, i) => {
35
34
  if (scale === "categorical") return markEdge(categoricalNeedsEdge(i));
@@ -70,4 +69,4 @@ SegmentedBar.displayName = "SegmentedBar";
70
69
  export {
71
70
  SegmentedBar
72
71
  };
73
- //# sourceMappingURL=chunk-OHY4VIKZ.js.map
72
+ //# sourceMappingURL=chunk-CZ3JB37A.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/charts/segmented-bar.tsx"],"sourcesContent":["import { cn } from '@/lib/utils';\nimport {\n categorical, categoricalOn, categoricalNeedsEdge,\n sequential, sequentialOn, sequentialNeedsEdge,\n toneNeedsEdge, markEdge, chartToken,\n} from './lib/series';\n\nexport interface Segment {\n label: string;\n value: number;\n /** Pull this segment forward (ink) and others recede. */\n active?: boolean;\n}\n\nexport interface SegmentedBarProps {\n data: Segment[];\n /** Bar thickness in px. */\n height?: number;\n /**\n * How segments get colour:\n * - `mono` (default): grayscale, active segment is ink, the rest are muted tints.\n * - `categorical`: the capped unordered palette (≤4 meaningful categories).\n * - `sequential`: single-hue magnitude ramp, in data order.\n */\n scale?: 'mono' | 'categorical' | 'sequential';\n /** Show the label + value row beneath the bar. */\n showLegend?: boolean;\n className?: string;\n}\n\n/**\n * Cairn SegmentedBar, a single horizontal bar split into labelled parts (a share-of-total\n * / stacked bar). Grayscale by default; hue is opt-in via `scale`. Every segment carries a\n * text label + value, so meaning never rests on colour alone (WCAG-safe). Zero-dependency.\n */\nexport function SegmentedBar({ data, height = 40, scale = 'mono', showLegend = true, className }: SegmentedBarProps) {\n // Negative / non-finite segment values would produce invalid or overflowing widths; clamp to 0.\n const safe = (v: number) => (Number.isFinite(v) && v > 0 ? v : 0);\n const total = data.reduce((s, d) => s + safe(d.value), 0) || 1;\n const hasActive = data.some((d) => d.active);\n\n const fill = (d: Segment, i: number): string => {\n if (scale === 'categorical') return categorical(i);\n if (scale === 'sequential') return sequential(i, data.length);\n // mono: ink for the active (or all, when none is active), muted tints otherwise.\n if (!hasActive) return chartToken.ink;\n return d.active ? chartToken.ink : chartToken.muted;\n };\n\n // Accessible foreground paired to each fill, WCAG AA, never a blend mode that guesses.\n const onFill = (d: Segment, i: number): string => {\n if (scale === 'categorical') return categoricalOn(i);\n if (scale === 'sequential') return sequentialOn(i, data.length);\n // mono: white throughout. `muted` is neutral.500 now (it had to darken to carry its own 3:1\n // shape contrast), so it takes white at 4.5:1 — ink on it would be 3.7:1 and fail.\n return 'var(--sv-sys-color-on-primary)';\n };\n\n // A keyline only where the fill cannot carry its own 3:1 shape contrast. Since mono and\n // categorical fills were darkened to clear 3:1 unaided, in practice this fires ONLY on the\n // pale low end of the sequential ramp — every other segment draws no border at all, because\n // boxing every segment turns the bar into a table (rule 9, AGENTS.md).\n const edge = (d: Segment, i: number): string | undefined => {\n if (scale === 'categorical') return markEdge(categoricalNeedsEdge(i));\n if (scale === 'sequential') return markEdge(sequentialNeedsEdge(i, data.length));\n return markEdge(toneNeedsEdge(!hasActive || d.active ? 'ink' : 'muted'));\n };\n\n return (\n <div className={cn('w-full', className)}>\n {/* A thin gap separates adjacent segments, so the keyline is not needed for that job: it\n appears only under a pale fill, which cannot carry the 3:1 shape contrast against the\n surface on its own (AGENTS.md rule 9). */}\n <div\n className=\"flex w-full\"\n style={{ height, gap: 2 }}\n role=\"img\"\n aria-label={data.map((d) => `${d.label} ${d.value}`).join(', ')}\n >\n {data.map((d, i) => (\n <div\n key={d.label}\n className=\"flex items-center justify-end px-2 first:rounded-l-control last:rounded-r-control\"\n style={{\n width: `${(safe(d.value) / total) * 100}%`,\n background: fill(d, i),\n boxShadow: edge(d, i),\n }}\n >\n <span className=\"truncate sv-body-xs font-medium tabular-nums\" style={{ color: onFill(d, i) }}>{d.value}</span>\n </div>\n ))}\n </div>\n {showLegend && (\n <ul className=\"mt-3 flex flex-wrap gap-x-4 gap-y-1\">\n {data.map((d, i) => (\n <li key={d.label} className={cn('flex items-center gap-1.5 sv-body-sm', d.active ? 'text-on-surface' : 'text-on-surface-variant')}>\n <span className=\"size-2 shrink-0 rounded-swatch\" style={{ background: fill(d, i) }} aria-hidden=\"true\" />\n {d.label}\n </li>\n ))}\n </ul>\n )}\n </div>\n );\n}\nSegmentedBar.displayName = 'SegmentedBar';\n"],"mappings":";;;;;;;;;;;;;;;;AAyFY,cAOA,YAPA;AAtDL,SAAS,aAAa,EAAE,MAAM,SAAS,IAAI,QAAQ,QAAQ,aAAa,MAAM,UAAU,GAAsB;AAEnH,QAAM,OAAO,CAAC,MAAe,OAAO,SAAS,CAAC,KAAK,IAAI,IAAI,IAAI;AAC/D,QAAM,QAAQ,KAAK,OAAO,CAAC,GAAG,MAAM,IAAI,KAAK,EAAE,KAAK,GAAG,CAAC,KAAK;AAC7D,QAAM,YAAY,KAAK,KAAK,CAAC,MAAM,EAAE,MAAM;AAE3C,QAAM,OAAO,CAAC,GAAY,MAAsB;AAC9C,QAAI,UAAU,cAAe,QAAO,YAAY,CAAC;AACjD,QAAI,UAAU,aAAc,QAAO,WAAW,GAAG,KAAK,MAAM;AAE5D,QAAI,CAAC,UAAW,QAAO,WAAW;AAClC,WAAO,EAAE,SAAS,WAAW,MAAM,WAAW;AAAA,EAChD;AAGA,QAAM,SAAS,CAAC,GAAY,MAAsB;AAChD,QAAI,UAAU,cAAe,QAAO,cAAc,CAAC;AACnD,QAAI,UAAU,aAAc,QAAO,aAAa,GAAG,KAAK,MAAM;AAG9D,WAAO;AAAA,EACT;AAMA,QAAM,OAAO,CAAC,GAAY,MAAkC;AAC1D,QAAI,UAAU,cAAe,QAAO,SAAS,qBAAqB,CAAC,CAAC;AACpE,QAAI,UAAU,aAAc,QAAO,SAAS,oBAAoB,GAAG,KAAK,MAAM,CAAC;AAC/E,WAAO,SAAS,cAAc,CAAC,aAAa,EAAE,SAAS,QAAQ,OAAO,CAAC;AAAA,EACzE;AAEA,SACE,qBAAC,SAAI,WAAW,GAAG,UAAU,SAAS,GAIpC;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,OAAO,EAAE,QAAQ,KAAK,EAAE;AAAA,QACxB,MAAK;AAAA,QACL,cAAY,KAAK,IAAI,CAAC,MAAM,GAAG,EAAE,KAAK,IAAI,EAAE,KAAK,EAAE,EAAE,KAAK,IAAI;AAAA,QAE7D,eAAK,IAAI,CAAC,GAAG,MACZ;AAAA,UAAC;AAAA;AAAA,YAEC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAO,GAAI,KAAK,EAAE,KAAK,IAAI,QAAS,GAAG;AAAA,cACvC,YAAY,KAAK,GAAG,CAAC;AAAA,cACrB,WAAW,KAAK,GAAG,CAAC;AAAA,YACtB;AAAA,YAEA,8BAAC,UAAK,WAAU,gDAA+C,OAAO,EAAE,OAAO,OAAO,GAAG,CAAC,EAAE,GAAI,YAAE,OAAM;AAAA;AAAA,UARnG,EAAE;AAAA,QAST,CACD;AAAA;AAAA,IACH;AAAA,IACC,cACC,oBAAC,QAAG,WAAU,uCACX,eAAK,IAAI,CAAC,GAAG,MACZ,qBAAC,QAAiB,WAAW,GAAG,wCAAwC,EAAE,SAAS,oBAAoB,yBAAyB,GAC9H;AAAA,0BAAC,UAAK,WAAU,kCAAiC,OAAO,EAAE,YAAY,KAAK,GAAG,CAAC,EAAE,GAAG,eAAY,QAAO;AAAA,MACtG,EAAE;AAAA,SAFI,EAAE,KAGX,CACD,GACH;AAAA,KAEJ;AAEJ;AACA,aAAa,cAAc;","names":[]}
@@ -0,0 +1,35 @@
1
+ 'use client';
2
+
3
+ import {
4
+ cn
5
+ } from "./chunk-DXRY7AS4.js";
6
+
7
+ // src/overlay/tooltip.tsx
8
+ import * as React from "react";
9
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
10
+ import { jsx } from "react/jsx-runtime";
11
+ var TooltipProvider = TooltipPrimitive.Provider;
12
+ var Tooltip = TooltipPrimitive.Root;
13
+ var TooltipTrigger = TooltipPrimitive.Trigger;
14
+ var TooltipContent = React.forwardRef(({ className, sideOffset = 6, collisionPadding = 12, container, ...props }, ref) => /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { container: container ?? void 0, children: /* @__PURE__ */ jsx(
15
+ TooltipPrimitive.Content,
16
+ {
17
+ ref,
18
+ sideOffset,
19
+ collisionPadding,
20
+ className: cn(
21
+ "z-50 max-w-64 rounded-control bg-inverse-surface px-3 py-1 sv-body-xs text-on-inverse-surface shadow-overlay",
22
+ className
23
+ ),
24
+ ...props
25
+ }
26
+ ) }));
27
+ TooltipContent.displayName = "TooltipContent";
28
+
29
+ export {
30
+ TooltipProvider,
31
+ Tooltip,
32
+ TooltipTrigger,
33
+ TooltipContent
34
+ };
35
+ //# sourceMappingURL=chunk-DCKWB3EY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/overlay/tooltip.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\nimport { cn } from '@/lib/utils';\n\n/**\n * Cairn Tooltip. Radix, because the `title` attribute is not an accessible\n * alternative to one.\n *\n * `title` looks like the free version of a tooltip and behaves like nothing at\n * all: it never appears on keyboard focus, most screen readers ignore or\n * duplicate it, it cannot be dismissed, and its delay belongs to the operating\n * system. Any information a sighted mouse user gets from it is information a\n * keyboard user does not get. Radix gives focus and hover parity, Escape to\n * dismiss, and a real `aria-describedby` link.\n *\n * The rule that survives all of it: a tooltip may only ever carry information\n * that is *supplementary*. If the interface does not make sense without it, the\n * text belongs on the surface (rule 4 — meaning never rests on a hover).\n *\n * Inverse surface, not a hue: a tooltip is a small dense mark and the inverse\n * pairing is the one that reads at that size on both themes.\n */\n\nexport const TooltipProvider = TooltipPrimitive.Provider;\nexport const Tooltip = TooltipPrimitive.Root;\nexport const TooltipTrigger = TooltipPrimitive.Trigger;\n\nexport interface TooltipContentProps\n extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> {\n /** Where the portal mounts. Defaults to `document.body`. See `PopoverContent`. */\n container?: HTMLElement | null;\n}\n\nexport const TooltipContent = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Content>,\n TooltipContentProps\n>(({ className, sideOffset = 6, collisionPadding = 12, container, ...props }, ref) => (\n <TooltipPrimitive.Portal container={container ?? undefined}>\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n className={cn(\n 'z-50 max-w-64 rounded-control bg-inverse-surface px-3 py-1 sv-body-xs text-on-inverse-surface shadow-overlay',\n className\n )}\n {...props}\n />\n </TooltipPrimitive.Portal>\n));\nTooltipContent.displayName = 'TooltipContent';\n"],"mappings":";;;;;AAEA,YAAY,WAAW;AACvB,YAAY,sBAAsB;AAqC9B;AAfG,IAAM,kBAAmC;AACzC,IAAM,UAA2B;AACjC,IAAM,iBAAkC;AAQxC,IAAM,iBAAuB,iBAGlC,CAAC,EAAE,WAAW,aAAa,GAAG,mBAAmB,IAAI,WAAW,GAAG,MAAM,GAAG,QAC5E,oBAAkB,yBAAjB,EAAwB,WAAW,aAAa,QAC/C;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,GACF,CACD;AACD,eAAe,cAAc;","names":[]}
@@ -27,10 +27,10 @@ var CATEGORICAL_ON = [
27
27
  // white, on neutral.900 (16.6:1)
28
28
  "var(--sv-sys-color-on-primary)",
29
29
  // white, on main.700 (6.0:1)
30
- "var(--sv-sys-color-on-surface)",
31
- // ink, on neutral.400 (7.0:1)
30
+ "var(--sv-sys-color-on-primary)",
31
+ // white, on neutral.500 (4.5:1)
32
32
  "var(--sv-sys-color-on-surface)"
33
- // ink, on main.300 (6.9:1)
33
+ // ink, on main.400 (5.0:1)
34
34
  ];
35
35
  var SEQUENTIAL_ON = [
36
36
  "var(--sv-sys-color-on-surface)",
@@ -64,7 +64,7 @@ function sequential(i, n) {
64
64
  function sequentialOn(i, n) {
65
65
  return SEQUENTIAL_ON[rampIndex(i, n)];
66
66
  }
67
- var CATEGORICAL_PALE = [false, false, true, true];
67
+ var CATEGORICAL_PALE = [false, false, false, false];
68
68
  var SEQUENTIAL_PALE = [true, true, false, false, false];
69
69
  function categoricalNeedsEdge(i) {
70
70
  return CATEGORICAL_PALE[wrap(i, CATEGORICAL_MAX)];
@@ -72,8 +72,8 @@ function categoricalNeedsEdge(i) {
72
72
  function sequentialNeedsEdge(i, n) {
73
73
  return SEQUENTIAL_PALE[rampIndex(i, n)];
74
74
  }
75
- function toneNeedsEdge(tone) {
76
- return tone === "muted";
75
+ function toneNeedsEdge(_tone) {
76
+ return false;
77
77
  }
78
78
  function markEdge(needed) {
79
79
  return needed ? `inset 0 0 0 1px ${chartToken.markEdge}` : void 0;
@@ -93,4 +93,4 @@ export {
93
93
  toneNeedsEdge,
94
94
  markEdge
95
95
  };
96
- //# sourceMappingURL=chunk-TI5GM4IR.js.map
96
+ //# sourceMappingURL=chunk-G2XJK244.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/charts/lib/series.ts"],"sourcesContent":["/**\n * Cairn data-viz colour, the single place a series gets a colour.\n *\n * Rule: grayscale first. A single series is `ink`; a comparison series is `muted`.\n * Reach for hue only when categories are genuinely unordered (`categorical`, capped\n * at 4) or encode magnitude (`sequential`, single-hue). Never hand-pick a hex, every\n * value here is a `sys.chart.*` token resolved at runtime via its CSS variable, so a\n * theme swap (light↔dark) recolours the charts for free.\n */\n\n/** Semantic chart roles → their CSS variable. The single place a chart hue is named;\n * components consume these, never the raw `--sv-sys-chart-*` var. `accent` is the one\n * opt-in hue (the signature accent) a fixed-shape chart may promote a value to. */\nexport const chartToken = {\n ink: 'var(--sv-sys-chart-ink)',\n muted: 'var(--sv-sys-chart-muted)',\n markEdge: 'var(--sv-sys-chart-mark-edge)',\n accent: 'var(--sv-sys-chart-categorical-2)',\n grid: 'var(--sv-sys-chart-grid)',\n axis: 'var(--sv-sys-chart-axis)',\n track: 'var(--sv-sys-chart-track)',\n} as const;\n\n/** The unordered-category palette. HARD CAP at 4, a 5th category needs a pattern or\n * label, never a 5th hue. Indices wrap so a longer series degrades loudly, not silently. */\nconst CATEGORICAL = [\n 'var(--sv-sys-chart-categorical-1)',\n 'var(--sv-sys-chart-categorical-2)',\n 'var(--sv-sys-chart-categorical-3)',\n 'var(--sv-sys-chart-categorical-4)',\n] as const;\n\n/** Single-hue magnitude ramp (low → high). */\nconst SEQUENTIAL = [\n 'var(--sv-sys-chart-sequential-1)',\n 'var(--sv-sys-chart-sequential-2)',\n 'var(--sv-sys-chart-sequential-3)',\n 'var(--sv-sys-chart-sequential-4)',\n 'var(--sv-sys-chart-sequential-5)',\n] as const;\n\nexport const CATEGORICAL_MAX = CATEGORICAL.length;\n\n/** Accessible foreground for text/marks laid ON each categorical fill. Every pair below\n * clears WCAG AA (≥4.5:1). The accent category is main.700, not the brand main.600: a chart\n * fill carries a small value label, and 600 only clears the 3:1 large-text bar (ink 4.35:1).\n * Index-matched to CATEGORICAL, never guess contrast at runtime. */\nconst CATEGORICAL_ON = [\n 'var(--sv-sys-color-on-primary)', // white, on neutral.900 (16.6:1)\n 'var(--sv-sys-color-on-primary)', // white, on main.700 (6.0:1)\n 'var(--sv-sys-color-on-surface)', // ink, on neutral.400 (7.0:1)\n 'var(--sv-sys-color-on-surface)', // ink, on main.300 (6.9:1)\n] as const;\n\n/** Accessible foreground per sequential step. The ramp is the accent, so it stays legible\n * under ink further up than a blue ramp would: main.100/300/500 take ink, only the darker\n * main.700/900 take white. Index-matched to SEQUENTIAL. */\nconst SEQUENTIAL_ON = [\n 'var(--sv-sys-color-on-surface)', // ink, on main.100 (12.4:1)\n 'var(--sv-sys-color-on-surface)', // ink, on main.300 (6.9:1)\n 'var(--sv-sys-color-on-surface)', // ink, on main.500 (4.8:1)\n 'var(--sv-sys-color-on-primary)', // white, on main.700 (6.0:1)\n 'var(--sv-sys-color-on-primary)', // white, on main.900 (11.4:1)\n] as const;\n\n/** Chart line-mark weights, in px. The single stroke scale for the family: every line mark\n * (sparkline, area line, trend line) uses `line`; reference/guide lines use `guide`. Radial\n * gauges (Ring) set their own arc thickness. Lives here beside `chartToken` so the whole\n * chart visual language (colour + stroke) has one home. */\nexport const chartStroke = { line: 2, guide: 1 } as const;\n\n/** The mono tone of a chart mark → its `sys.chart.*` colour. `ink` = the single/active series,\n * `muted` = a comparison/secondary series, `accent` = the one opt-in hue (the signature accent).\n * The single definition of the `tone` option, shared by every chart in the family. */\nexport function toneFill(tone: 'ink' | 'muted' | 'accent'): string {\n if (tone === 'accent') return chartToken.accent;\n if (tone === 'muted') return chartToken.muted;\n return chartToken.ink;\n}\n\nconst wrap = (i: number, n: number) => ((i % n) + n) % n;\nconst rampIndex = (i: number, n: number) =>\n n <= 1 ? SEQUENTIAL.length - 1 : Math.round(Math.min(Math.max(i / (n - 1), 0), 1) * (SEQUENTIAL.length - 1));\n\n/** Colour for category `i` (0-based). Wraps past the cap, pair with a label/pattern. */\nexport function categorical(i: number): string {\n return CATEGORICAL[wrap(i, CATEGORICAL_MAX)];\n}\n\n/** WCAG-AA foreground for text drawn on `categorical(i)`. */\nexport function categoricalOn(i: number): string {\n return CATEGORICAL_ON[wrap(i, CATEGORICAL_MAX)];\n}\n\n/** Colour for the `i`-th of `n` steps on the single-hue magnitude ramp. */\nexport function sequential(i: number, n: number): string {\n return SEQUENTIAL[rampIndex(i, n)];\n}\n\n/** WCAG-AA foreground for text drawn on `sequential(i, n)`. */\nexport function sequentialOn(i: number, n: number): string {\n return SEQUENTIAL_ON[rampIndex(i, n)];\n}\n\n/** Which fills sit under 3:1 against the surface and therefore need a `mark-edge` keyline to\n * carry their shape contrast (rule 9). Everything else already clears 3:1 on its own and takes\n * **no border at all**: a keyline on a dark or saturated fill is decoration, not accessibility,\n * and a chart where every mark is boxed reads as a table, not as data. Measured per value,\n * index-matched, never guessed at runtime.\n *\n * categorical: neutral.900 (16.6:1), main.700 (6.0:1) carry themselves; neutral.400 (2.6:1) and\n * main.300 (2.6:1) do not. sequential: main.100 (1.4:1) and main.300 (2.6:1) do not; main.500\n * (3.7:1) upward do. */\nconst CATEGORICAL_PALE = [false, false, true, true] as const;\nconst SEQUENTIAL_PALE = [true, true, false, false, false] as const;\n\n/** True when `categorical(i)` needs a keyline. */\nexport function categoricalNeedsEdge(i: number): boolean {\n return CATEGORICAL_PALE[wrap(i, CATEGORICAL_MAX)];\n}\n\n/** True when `sequential(i, n)` needs a keyline. */\nexport function sequentialNeedsEdge(i: number, n: number): boolean {\n return SEQUENTIAL_PALE[rampIndex(i, n)];\n}\n\n/** True when a mono `tone` fill needs a keyline. Only `muted` (neutral.300, 1.6:1) does. */\nexport function toneNeedsEdge(tone: 'ink' | 'muted' | 'accent'): boolean {\n return tone === 'muted';\n}\n\n/** The keyline itself, or `undefined` when the mark carries its own contrast. Feed straight to\n * a style `boxShadow`, so a component never hand-writes the inset shadow. */\nexport function markEdge(needed: boolean): string | undefined {\n return needed ? `inset 0 0 0 1px ${chartToken.markEdge}` : undefined;\n}\n"],"mappings":";AAaO,IAAM,aAAa;AAAA,EACxB,KAAK;AAAA,EACL,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AACT;AAIA,IAAM,cAAc;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGA,IAAM,aAAa;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,kBAAkB,YAAY;AAM3C,IAAM,iBAAiB;AAAA,EACrB;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AACF;AAKA,IAAM,gBAAgB;AAAA,EACpB;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AACF;AAMO,IAAM,cAAc,EAAE,MAAM,GAAG,OAAO,EAAE;AAKxC,SAAS,SAAS,MAA0C;AACjE,MAAI,SAAS,SAAU,QAAO,WAAW;AACzC,MAAI,SAAS,QAAS,QAAO,WAAW;AACxC,SAAO,WAAW;AACpB;AAEA,IAAM,OAAO,CAAC,GAAW,OAAgB,IAAI,IAAK,KAAK;AACvD,IAAM,YAAY,CAAC,GAAW,MAC5B,KAAK,IAAI,WAAW,SAAS,IAAI,KAAK,MAAM,KAAK,IAAI,KAAK,IAAI,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,WAAW,SAAS,EAAE;AAGtG,SAAS,YAAY,GAAmB;AAC7C,SAAO,YAAY,KAAK,GAAG,eAAe,CAAC;AAC7C;AAGO,SAAS,cAAc,GAAmB;AAC/C,SAAO,eAAe,KAAK,GAAG,eAAe,CAAC;AAChD;AAGO,SAAS,WAAW,GAAW,GAAmB;AACvD,SAAO,WAAW,UAAU,GAAG,CAAC,CAAC;AACnC;AAGO,SAAS,aAAa,GAAW,GAAmB;AACzD,SAAO,cAAc,UAAU,GAAG,CAAC,CAAC;AACtC;AAWA,IAAM,mBAAmB,CAAC,OAAO,OAAO,MAAM,IAAI;AAClD,IAAM,kBAAkB,CAAC,MAAM,MAAM,OAAO,OAAO,KAAK;AAGjD,SAAS,qBAAqB,GAAoB;AACvD,SAAO,iBAAiB,KAAK,GAAG,eAAe,CAAC;AAClD;AAGO,SAAS,oBAAoB,GAAW,GAAoB;AACjE,SAAO,gBAAgB,UAAU,GAAG,CAAC,CAAC;AACxC;AAGO,SAAS,cAAc,MAA2C;AACvE,SAAO,SAAS;AAClB;AAIO,SAAS,SAAS,QAAqC;AAC5D,SAAO,SAAS,mBAAmB,WAAW,QAAQ,KAAK;AAC7D;","names":[]}
1
+ {"version":3,"sources":["../src/charts/lib/series.ts"],"sourcesContent":["/**\n * Cairn data-viz colour, the single place a series gets a colour.\n *\n * Rule: grayscale first. A single series is `ink`; a comparison series is `muted`.\n * Reach for hue only when categories are genuinely unordered (`categorical`, capped\n * at 4) or encode magnitude (`sequential`, single-hue). Never hand-pick a hex, every\n * value here is a `sys.chart.*` token resolved at runtime via its CSS variable, so a\n * theme swap (light↔dark) recolours the charts for free.\n */\n\n/** Semantic chart roles → their CSS variable. The single place a chart hue is named;\n * components consume these, never the raw `--sv-sys-chart-*` var. `accent` is the one\n * opt-in hue (the signature accent) a fixed-shape chart may promote a value to. */\nexport const chartToken = {\n ink: 'var(--sv-sys-chart-ink)',\n muted: 'var(--sv-sys-chart-muted)',\n markEdge: 'var(--sv-sys-chart-mark-edge)',\n accent: 'var(--sv-sys-chart-categorical-2)',\n grid: 'var(--sv-sys-chart-grid)',\n axis: 'var(--sv-sys-chart-axis)',\n track: 'var(--sv-sys-chart-track)',\n} as const;\n\n/** The unordered-category palette. HARD CAP at 4, a 5th category needs a pattern or\n * label, never a 5th hue. Indices wrap so a longer series degrades loudly, not silently. */\nconst CATEGORICAL = [\n 'var(--sv-sys-chart-categorical-1)',\n 'var(--sv-sys-chart-categorical-2)',\n 'var(--sv-sys-chart-categorical-3)',\n 'var(--sv-sys-chart-categorical-4)',\n] as const;\n\n/** Single-hue magnitude ramp (low → high). */\nconst SEQUENTIAL = [\n 'var(--sv-sys-chart-sequential-1)',\n 'var(--sv-sys-chart-sequential-2)',\n 'var(--sv-sys-chart-sequential-3)',\n 'var(--sv-sys-chart-sequential-4)',\n 'var(--sv-sys-chart-sequential-5)',\n] as const;\n\nexport const CATEGORICAL_MAX = CATEGORICAL.length;\n\n/** Accessible foreground for text/marks laid ON each categorical fill. Every pair below\n * clears WCAG AA (≥4.5:1). The accent category is main.700, not the brand main.600: a chart\n * fill carries a small value label, and 600 only clears the 3:1 large-text bar (ink 4.04:1).\n * Index-matched to CATEGORICAL, never guess contrast at runtime. */\nconst CATEGORICAL_ON = [\n 'var(--sv-sys-color-on-primary)', // white, on neutral.900 (16.6:1)\n 'var(--sv-sys-color-on-primary)', // white, on main.700 (6.0:1)\n 'var(--sv-sys-color-on-primary)', // white, on neutral.500 (4.5:1)\n 'var(--sv-sys-color-on-surface)', // ink, on main.400 (5.0:1)\n] as const;\n\n/** Accessible foreground per sequential step. The ramp is the accent, so it stays legible\n * under ink further up than a blue ramp would: main.100/300/500 take ink, only the darker\n * main.700/900 take white. Index-matched to SEQUENTIAL. */\nconst SEQUENTIAL_ON = [\n 'var(--sv-sys-color-on-surface)', // ink, on main.100 (12.4:1)\n 'var(--sv-sys-color-on-surface)', // ink, on main.300 (6.9:1)\n 'var(--sv-sys-color-on-surface)', // ink, on main.500 (4.8:1)\n 'var(--sv-sys-color-on-primary)', // white, on main.700 (6.0:1)\n 'var(--sv-sys-color-on-primary)', // white, on main.900 (11.4:1)\n] as const;\n\n/** Chart line-mark weights, in px. The single stroke scale for the family: every line mark\n * (sparkline, area line, trend line) uses `line`; reference/guide lines use `guide`. Radial\n * gauges (Ring) set their own arc thickness. Lives here beside `chartToken` so the whole\n * chart visual language (colour + stroke) has one home. */\nexport const chartStroke = { line: 2, guide: 1 } as const;\n\n/** The mono tone of a chart mark → its `sys.chart.*` colour. `ink` = the single/active series,\n * `muted` = a comparison/secondary series, `accent` = the one opt-in hue (the signature accent).\n * The single definition of the `tone` option, shared by every chart in the family. */\nexport function toneFill(tone: 'ink' | 'muted' | 'accent'): string {\n if (tone === 'accent') return chartToken.accent;\n if (tone === 'muted') return chartToken.muted;\n return chartToken.ink;\n}\n\nconst wrap = (i: number, n: number) => ((i % n) + n) % n;\nconst rampIndex = (i: number, n: number) =>\n n <= 1 ? SEQUENTIAL.length - 1 : Math.round(Math.min(Math.max(i / (n - 1), 0), 1) * (SEQUENTIAL.length - 1));\n\n/** Colour for category `i` (0-based). Wraps past the cap, pair with a label/pattern. */\nexport function categorical(i: number): string {\n return CATEGORICAL[wrap(i, CATEGORICAL_MAX)];\n}\n\n/** WCAG-AA foreground for text drawn on `categorical(i)`. */\nexport function categoricalOn(i: number): string {\n return CATEGORICAL_ON[wrap(i, CATEGORICAL_MAX)];\n}\n\n/** Colour for the `i`-th of `n` steps on the single-hue magnitude ramp. */\nexport function sequential(i: number, n: number): string {\n return SEQUENTIAL[rampIndex(i, n)];\n}\n\n/** WCAG-AA foreground for text drawn on `sequential(i, n)`. */\nexport function sequentialOn(i: number, n: number): string {\n return SEQUENTIAL_ON[rampIndex(i, n)];\n}\n\n/** Which fills sit under 3:1 against the surface and therefore need a `mark-edge` keyline to\n * carry their shape contrast (rule 9). Everything else already clears 3:1 on its own and takes\n * **no border at all**: a keyline on a dark or saturated fill is decoration, not accessibility,\n * and a chart where every mark is boxed reads as a table, not as data. Measured per value,\n * index-matched, never guessed at runtime.\n *\n * Mono and categorical fills were DARKENED so every one of them clears 3:1 unaided — that is why\n * bars and segments carry no border at all any more. categorical: neutral.900 (16.6:1),\n * main.700 (6.0:1), neutral.500 (4.5:1), main.400 (3.3:1) all pass.\n *\n * `sequential` is the one exception, and it is structural rather than an oversight: a magnitude\n * ramp has to start pale, so main.100 (1.4:1) and main.300 (2.6:1) cannot be darkened without\n * destroying the very thing the ramp encodes. Those two keep a keyline; main.500 (3.7:1) up\n * carry themselves. */\nconst CATEGORICAL_PALE = [false, false, false, false] as const;\nconst SEQUENTIAL_PALE = [true, true, false, false, false] as const;\n\n/** True when `categorical(i)` needs a keyline. */\nexport function categoricalNeedsEdge(i: number): boolean {\n return CATEGORICAL_PALE[wrap(i, CATEGORICAL_MAX)];\n}\n\n/** True when `sequential(i, n)` needs a keyline. */\nexport function sequentialNeedsEdge(i: number, n: number): boolean {\n return SEQUENTIAL_PALE[rampIndex(i, n)];\n}\n\n/** True when a mono `tone` fill needs a keyline. None do: `muted` moved to neutral.500 and now\n * clears 3:1 on its own (4.5:1 light / 3.7:1 dark), so mono marks draw no border at all. Kept as\n * a function rather than inlined, so a future tone that IS pale has one place to declare it. */\nexport function toneNeedsEdge(_tone: 'ink' | 'muted' | 'accent'): boolean {\n return false;\n}\n\n/** The keyline itself, or `undefined` when the mark carries its own contrast. Feed straight to\n * a style `boxShadow`, so a component never hand-writes the inset shadow. */\nexport function markEdge(needed: boolean): string | undefined {\n return needed ? `inset 0 0 0 1px ${chartToken.markEdge}` : undefined;\n}\n"],"mappings":";AAaO,IAAM,aAAa;AAAA,EACxB,KAAK;AAAA,EACL,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AACT;AAIA,IAAM,cAAc;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGA,IAAM,aAAa;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,kBAAkB,YAAY;AAM3C,IAAM,iBAAiB;AAAA,EACrB;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AACF;AAKA,IAAM,gBAAgB;AAAA,EACpB;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AACF;AAMO,IAAM,cAAc,EAAE,MAAM,GAAG,OAAO,EAAE;AAKxC,SAAS,SAAS,MAA0C;AACjE,MAAI,SAAS,SAAU,QAAO,WAAW;AACzC,MAAI,SAAS,QAAS,QAAO,WAAW;AACxC,SAAO,WAAW;AACpB;AAEA,IAAM,OAAO,CAAC,GAAW,OAAgB,IAAI,IAAK,KAAK;AACvD,IAAM,YAAY,CAAC,GAAW,MAC5B,KAAK,IAAI,WAAW,SAAS,IAAI,KAAK,MAAM,KAAK,IAAI,KAAK,IAAI,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,WAAW,SAAS,EAAE;AAGtG,SAAS,YAAY,GAAmB;AAC7C,SAAO,YAAY,KAAK,GAAG,eAAe,CAAC;AAC7C;AAGO,SAAS,cAAc,GAAmB;AAC/C,SAAO,eAAe,KAAK,GAAG,eAAe,CAAC;AAChD;AAGO,SAAS,WAAW,GAAW,GAAmB;AACvD,SAAO,WAAW,UAAU,GAAG,CAAC,CAAC;AACnC;AAGO,SAAS,aAAa,GAAW,GAAmB;AACzD,SAAO,cAAc,UAAU,GAAG,CAAC,CAAC;AACtC;AAgBA,IAAM,mBAAmB,CAAC,OAAO,OAAO,OAAO,KAAK;AACpD,IAAM,kBAAkB,CAAC,MAAM,MAAM,OAAO,OAAO,KAAK;AAGjD,SAAS,qBAAqB,GAAoB;AACvD,SAAO,iBAAiB,KAAK,GAAG,eAAe,CAAC;AAClD;AAGO,SAAS,oBAAoB,GAAW,GAAoB;AACjE,SAAO,gBAAgB,UAAU,GAAG,CAAC,CAAC;AACxC;AAKO,SAAS,cAAc,OAA4C;AACxE,SAAO;AACT;AAIO,SAAS,SAAS,QAAqC;AAC5D,SAAO,SAAS,mBAAmB,WAAW,QAAQ,KAAK;AAC7D;","names":[]}
@@ -0,0 +1,30 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-DXRY7AS4.js";
4
+
5
+ // src/input/textarea.tsx
6
+ import * as React from "react";
7
+ import { jsx } from "react/jsx-runtime";
8
+ var Textarea = React.forwardRef(
9
+ ({ className, rows = 3, ...props }, ref) => /* @__PURE__ */ jsx(
10
+ "textarea",
11
+ {
12
+ ref,
13
+ rows,
14
+ className: cn(
15
+ "w-full resize-y rounded-field border border-outline-strong bg-surface p-inset-sm sv-body-sm text-on-surface",
16
+ "outline-none placeholder:text-on-surface-variant",
17
+ "focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus",
18
+ "disabled:cursor-not-allowed disabled:opacity-40",
19
+ className
20
+ ),
21
+ ...props
22
+ }
23
+ )
24
+ );
25
+ Textarea.displayName = "Textarea";
26
+
27
+ export {
28
+ Textarea
29
+ };
30
+ //# sourceMappingURL=chunk-GNHNTI5A.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/input/textarea.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '@/lib/utils';\n\n/**\n * Cairn Textarea. `Input`'s multi-line sibling, same tokens, same radius role.\n *\n * Resize is left to the browser (`resize-y` only): a horizontally resizable\n * field breaks the column it sits in, and a field that cannot grow at all\n * forces the writer to compose inside a slot.\n */\nexport type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>;\n\nexport const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, rows = 3, ...props }, ref) => (\n <textarea\n ref={ref}\n rows={rows}\n className={cn(\n 'w-full resize-y rounded-field border border-outline-strong bg-surface p-inset-sm sv-body-sm text-on-surface',\n 'outline-none placeholder:text-on-surface-variant',\n 'focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus',\n 'disabled:cursor-not-allowed disabled:opacity-40',\n className\n )}\n {...props}\n />\n )\n);\nTextarea.displayName = 'Textarea';\n"],"mappings":";;;;;AAAA,YAAY,WAAW;AAcnB;AAFG,IAAM,WAAiB;AAAA,EAC5B,CAAC,EAAE,WAAW,OAAO,GAAG,GAAG,MAAM,GAAG,QAClC;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,SAAS,cAAc;","names":[]}
@@ -0,0 +1,36 @@
1
+ 'use client';
2
+
3
+ import {
4
+ cn
5
+ } from "./chunk-DXRY7AS4.js";
6
+
7
+ // src/input/label.tsx
8
+ import * as React from "react";
9
+ import * as LabelPrimitive from "@radix-ui/react-label";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ var Label = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
12
+ LabelPrimitive.Root,
13
+ {
14
+ ref,
15
+ className: cn(
16
+ "sv-label-sm text-on-surface-variant",
17
+ "peer-disabled:cursor-not-allowed peer-disabled:opacity-40",
18
+ className
19
+ ),
20
+ ...props
21
+ }
22
+ ));
23
+ Label.displayName = "Label";
24
+ function Field({ label, children, className }) {
25
+ const id = React.useId();
26
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-gap-xs", className), children: [
27
+ /* @__PURE__ */ jsx(Label, { htmlFor: id, children: label }),
28
+ children(id)
29
+ ] });
30
+ }
31
+
32
+ export {
33
+ Label,
34
+ Field
35
+ };
36
+ //# sourceMappingURL=chunk-HHUI32DT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/input/label.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as LabelPrimitive from '@radix-ui/react-label';\nimport { cn } from '@/lib/utils';\n\n/**\n * Cairn Label. Radix, for one reason that is not styling.\n *\n * A plain `<label htmlFor>` works until the control is a composite — a Radix\n * select, a toggle group, anything that is not a single native element — and\n * then the association silently stops working. Radix's Label also stops the\n * text-selection-on-double-click that makes a form feel broken. That is\n * behaviour, so it is a dependency; the styling below is the whole of our part.\n *\n * The `label` type role, neutral ink on `on-surface-variant`: a label is\n * supporting text and its tone says so. It is never coloured (rule 1) and never\n * set in caps (rule 6) — the pill badge is the one sanctioned kicker.\n */\nexport type LabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>;\n\nexport const Label = React.forwardRef<\n React.ComponentRef<typeof LabelPrimitive.Root>,\n LabelProps\n>(({ className, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(\n 'sv-label-sm text-on-surface-variant',\n 'peer-disabled:cursor-not-allowed peer-disabled:opacity-40',\n className\n )}\n {...props}\n />\n));\nLabel.displayName = 'Label';\n\n/**\n * A labelled control in one call: the two are wired by a generated id, so a\n * consumer cannot forget the `htmlFor`/`id` pair — the most common way an\n * accessible form stops being one.\n */\nexport interface FieldProps {\n label: React.ReactNode;\n /** Receives the generated id; render your control with it. */\n children: (id: string) => React.ReactNode;\n className?: string;\n}\n\nexport function Field({ label, children, className }: FieldProps) {\n const id = React.useId();\n return (\n <div className={cn('flex flex-col gap-gap-xs', className)}>\n <Label htmlFor={id}>{label}</Label>\n {children(id)}\n </div>\n );\n}\n"],"mappings":";;;;;AAEA,YAAY,WAAW;AACvB,YAAY,oBAAoB;AAsB9B,cA2BE,YA3BF;AAJK,IAAM,QAAc,iBAGzB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAgB;AAAA,EAAf;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,MAAM,cAAc;AAcb,SAAS,MAAM,EAAE,OAAO,UAAU,UAAU,GAAe;AAChE,QAAM,KAAW,YAAM;AACvB,SACE,qBAAC,SAAI,WAAW,GAAG,4BAA4B,SAAS,GACtD;AAAA,wBAAC,SAAM,SAAS,IAAK,iBAAM;AAAA,IAC1B,SAAS,EAAE;AAAA,KACd;AAEJ;","names":[]}
@@ -0,0 +1,42 @@
1
+ 'use client';
2
+
3
+ import {
4
+ cn
5
+ } from "./chunk-DXRY7AS4.js";
6
+
7
+ // src/tabs/toggle-group.tsx
8
+ import * as React from "react";
9
+ import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
10
+ import { jsx } from "react/jsx-runtime";
11
+ var ToggleGroup = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
12
+ ToggleGroupPrimitive.Root,
13
+ {
14
+ ref,
15
+ className: cn("inline-flex flex-wrap items-center gap-gap-xs", className),
16
+ ...props
17
+ }
18
+ ));
19
+ ToggleGroup.displayName = "ToggleGroup";
20
+ var ToggleGroupItem = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
21
+ ToggleGroupPrimitive.Item,
22
+ {
23
+ ref,
24
+ className: cn(
25
+ "inline-flex min-h-6 items-center rounded-pill border border-outline px-3 py-1 sv-label-sm whitespace-nowrap",
26
+ "text-on-surface-variant transition-[background-color,border-color,color] duration-150",
27
+ "hover:bg-surface-subtle active:bg-surface-muted",
28
+ "data-[state=on]:border-outline-strong data-[state=on]:bg-surface-muted data-[state=on]:text-on-surface",
29
+ "outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",
30
+ "disabled:pointer-events-none disabled:opacity-40",
31
+ className
32
+ ),
33
+ ...props
34
+ }
35
+ ));
36
+ ToggleGroupItem.displayName = "ToggleGroupItem";
37
+
38
+ export {
39
+ ToggleGroup,
40
+ ToggleGroupItem
41
+ };
42
+ //# sourceMappingURL=chunk-OVF2VS3L.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tabs/toggle-group.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { cn } from '@/lib/utils';\n\n/**\n * Cairn ToggleGroup. A row of mutually exclusive choices that are NOT tabs.\n *\n * The distinction matters and is usually missed: tabs switch which panel you are\n * looking at, a toggle group sets a value. They announce themselves differently\n * (`tablist` vs `group` of pressed buttons) and a screen reader user acts on the\n * difference. Reaching for `Tabs` because the pills look alike is how a status\n * control ends up telling people it will change the view.\n *\n * Radix carries the roving tabindex, the arrow keys and the pressed state; the\n * surface ramp carries the selection, like every other state in the system.\n */\n\nexport const ToggleGroup = React.forwardRef<\n React.ComponentRef<typeof ToggleGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <ToggleGroupPrimitive.Root\n ref={ref}\n className={cn('inline-flex flex-wrap items-center gap-gap-xs', className)}\n {...props}\n />\n));\nToggleGroup.displayName = 'ToggleGroup';\n\nexport const ToggleGroupItem = React.forwardRef<\n React.ComponentRef<typeof ToggleGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <ToggleGroupPrimitive.Item\n ref={ref}\n className={cn(\n 'inline-flex min-h-6 items-center rounded-pill border border-outline px-3 py-1 sv-label-sm whitespace-nowrap',\n 'text-on-surface-variant transition-[background-color,border-color,color] duration-150',\n 'hover:bg-surface-subtle active:bg-surface-muted',\n 'data-[state=on]:border-outline-strong data-[state=on]:bg-surface-muted data-[state=on]:text-on-surface',\n 'outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus',\n 'disabled:pointer-events-none disabled:opacity-40',\n className\n )}\n {...props}\n />\n));\nToggleGroupItem.displayName = 'ToggleGroupItem';\n"],"mappings":";;;;;AAEA,YAAY,WAAW;AACvB,YAAY,0BAA0B;AAoBpC;AAJK,IAAM,cAAoB,iBAG/B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAsB;AAAA,EAArB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,iDAAiD,SAAS;AAAA,IACvE,GAAG;AAAA;AACN,CACD;AACD,YAAY,cAAc;AAEnB,IAAM,kBAAwB,iBAGnC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAsB;AAAA,EAArB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,gBAAgB,cAAc;","names":[]}
@@ -7,7 +7,7 @@ import {
7
7
  chartStroke,
8
8
  chartToken,
9
9
  toneFill
10
- } from "./chunk-TI5GM4IR.js";
10
+ } from "./chunk-G2XJK244.js";
11
11
  import {
12
12
  cn
13
13
  } from "./chunk-DXRY7AS4.js";
@@ -88,4 +88,4 @@ LineChart.displayName = "LineChart";
88
88
  export {
89
89
  LineChart
90
90
  };
91
- //# sourceMappingURL=chunk-N2DFXOTF.js.map
91
+ //# sourceMappingURL=chunk-OWIUMX76.js.map
@@ -0,0 +1,60 @@
1
+ 'use client';
2
+
3
+ import {
4
+ cn
5
+ } from "./chunk-DXRY7AS4.js";
6
+
7
+ // src/overlay/alert-dialog.tsx
8
+ import * as React from "react";
9
+ import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ var AlertDialog = AlertDialogPrimitive.Root;
12
+ var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
13
+ var AlertDialogAction = AlertDialogPrimitive.Action;
14
+ var AlertDialogCancel = AlertDialogPrimitive.Cancel;
15
+ var AlertDialogContent = React.forwardRef(({ className, container, overlayClassName, ...props }, ref) => /* @__PURE__ */ jsxs(AlertDialogPrimitive.Portal, { container: container ?? void 0, children: [
16
+ /* @__PURE__ */ jsx(
17
+ AlertDialogPrimitive.Overlay,
18
+ {
19
+ className: cn("fixed inset-0 z-50 bg-ground-deep/40", overlayClassName)
20
+ }
21
+ ),
22
+ /* @__PURE__ */ jsx(
23
+ AlertDialogPrimitive.Content,
24
+ {
25
+ ref,
26
+ className: cn(
27
+ "fixed left-1/2 top-1/2 z-50 flex w-full max-w-sm -translate-x-1/2 -translate-y-1/2 flex-col gap-gap-md",
28
+ "rounded-control border border-outline bg-surface p-inset-lg text-on-surface shadow-floating outline-none",
29
+ className
30
+ ),
31
+ ...props
32
+ }
33
+ )
34
+ ] }));
35
+ AlertDialogContent.displayName = "AlertDialogContent";
36
+ var AlertDialogTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(AlertDialogPrimitive.Title, { ref, className: cn("sv-title-md", className), ...props }));
37
+ AlertDialogTitle.displayName = "AlertDialogTitle";
38
+ var AlertDialogDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
39
+ AlertDialogPrimitive.Description,
40
+ {
41
+ ref,
42
+ className: cn("sv-body-sm text-on-surface-variant", className),
43
+ ...props
44
+ }
45
+ ));
46
+ AlertDialogDescription.displayName = "AlertDialogDescription";
47
+ var AlertDialogFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex items-center justify-end gap-gap-xs", className), ...props }));
48
+ AlertDialogFooter.displayName = "AlertDialogFooter";
49
+
50
+ export {
51
+ AlertDialog,
52
+ AlertDialogTrigger,
53
+ AlertDialogAction,
54
+ AlertDialogCancel,
55
+ AlertDialogContent,
56
+ AlertDialogTitle,
57
+ AlertDialogDescription,
58
+ AlertDialogFooter
59
+ };
60
+ //# sourceMappingURL=chunk-POUL3ZTV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/overlay/alert-dialog.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';\nimport { cn } from '@/lib/utils';\n\n/**\n * Cairn AlertDialog. For the one question you cannot take back.\n *\n * Not a Dialog with different copy. `alertdialog` is its own role: it is\n * announced as an interruption, it is always modal, and focus lands on the\n * safest control rather than the first one — so an accidental Enter cancels\n * instead of destroying. Radix carries that; a Dialog styled to look urgent\n * carries none of it.\n *\n * Use it only where the action is irreversible. A confirmation on a reversible\n * action is a toll booth: it teaches people to click through dialogs, and the\n * one that mattered gets clicked through too.\n *\n * The destructive action is a `danger` Button passed through `asChild`. Danger\n * is a message colour with its own AA-paired ink (rule 4) — it is not the\n * signature accent, and `main` must never stand in for it (rule 3).\n */\n\nexport const AlertDialog = AlertDialogPrimitive.Root;\nexport const AlertDialogTrigger = AlertDialogPrimitive.Trigger;\nexport const AlertDialogAction = AlertDialogPrimitive.Action;\nexport const AlertDialogCancel = AlertDialogPrimitive.Cancel;\n\nexport interface AlertDialogContentProps\n extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content> {\n /** Where the portal mounts. Defaults to `document.body`. See `PopoverContent`. */\n container?: HTMLElement | null;\n /**\n * Classes for the scrim.\n *\n * Exists so the scrim can be raised with the panel. Lifting only the content's\n * z-index leaves the dim layer stranded below whatever it was meant to cover —\n * the dialog reads as urgent while the page behind it stays bright.\n */\n overlayClassName?: string;\n}\n\nexport const AlertDialogContent = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Content>,\n AlertDialogContentProps\n>(({ className, container, overlayClassName, ...props }, ref) => (\n <AlertDialogPrimitive.Portal container={container ?? undefined}>\n {/* The scrim is the ink ground at low alpha. `ground-deep` is deliberately\n not remapped on the dark theme, so one value dims both. */}\n <AlertDialogPrimitive.Overlay\n className={cn('fixed inset-0 z-50 bg-ground-deep/40', overlayClassName)}\n />\n <AlertDialogPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed left-1/2 top-1/2 z-50 flex w-full max-w-sm -translate-x-1/2 -translate-y-1/2 flex-col gap-gap-md',\n 'rounded-control border border-outline bg-surface p-inset-lg text-on-surface shadow-floating outline-none',\n className\n )}\n {...props}\n />\n </AlertDialogPrimitive.Portal>\n));\nAlertDialogContent.displayName = 'AlertDialogContent';\n\nexport const AlertDialogTitle = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title ref={ref} className={cn('sv-title-md', className)} {...props} />\n));\nAlertDialogTitle.displayName = 'AlertDialogTitle';\n\nexport const AlertDialogDescription = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description\n ref={ref}\n className={cn('sv-body-sm text-on-surface-variant', className)}\n {...props}\n />\n));\nAlertDialogDescription.displayName = 'AlertDialogDescription';\n\nexport const AlertDialogFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn('flex items-center justify-end gap-gap-xs', className)} {...props} />\n));\nAlertDialogFooter.displayName = 'AlertDialogFooter';\n"],"mappings":";;;;;AAEA,YAAY,WAAW;AACvB,YAAY,0BAA0B;AA4CpC,SAGE,KAHF;AAvBK,IAAM,cAAmC;AACzC,IAAM,qBAA0C;AAChD,IAAM,oBAAyC;AAC/C,IAAM,oBAAyC;AAgB/C,IAAM,qBAA2B,iBAGtC,CAAC,EAAE,WAAW,WAAW,kBAAkB,GAAG,MAAM,GAAG,QACvD,qBAAsB,6BAArB,EAA4B,WAAW,aAAa,QAGnD;AAAA;AAAA,IAAsB;AAAA,IAArB;AAAA,MACC,WAAW,GAAG,wCAAwC,gBAAgB;AAAA;AAAA,EACxE;AAAA,EACA;AAAA,IAAsB;AAAA,IAArB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAAA,GACF,CACD;AACD,mBAAmB,cAAc;AAE1B,IAAM,mBAAyB,iBAGpC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B,oBAAsB,4BAArB,EAA2B,KAAU,WAAW,GAAG,eAAe,SAAS,GAAI,GAAG,OAAO,CAC3F;AACD,iBAAiB,cAAc;AAExB,IAAM,yBAA+B,iBAG1C,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAsB;AAAA,EAArB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,sCAAsC,SAAS;AAAA,IAC5D,GAAG;AAAA;AACN,CACD;AACD,uBAAuB,cAAc;AAE9B,IAAM,oBAA0B,iBAGrC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B,oBAAC,SAAI,KAAU,WAAW,GAAG,4CAA4C,SAAS,GAAI,GAAG,OAAO,CACjG;AACD,kBAAkB,cAAc;","names":[]}