@six-vallees/ui-react 0.5.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 (59) 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/chunk-BYZCFI7X.js +32 -0
  9. package/dist/chunk-BYZCFI7X.js.map +1 -0
  10. package/dist/chunk-DCKWB3EY.js +35 -0
  11. package/dist/chunk-DCKWB3EY.js.map +1 -0
  12. package/dist/chunk-GNHNTI5A.js +30 -0
  13. package/dist/chunk-GNHNTI5A.js.map +1 -0
  14. package/dist/chunk-HHUI32DT.js +36 -0
  15. package/dist/chunk-HHUI32DT.js.map +1 -0
  16. package/dist/chunk-OVF2VS3L.js +42 -0
  17. package/dist/chunk-OVF2VS3L.js.map +1 -0
  18. package/dist/chunk-POUL3ZTV.js +60 -0
  19. package/dist/chunk-POUL3ZTV.js.map +1 -0
  20. package/dist/chunk-R7BM6J75.js +93 -0
  21. package/dist/chunk-R7BM6J75.js.map +1 -0
  22. package/dist/chunk-RXDJPRH5.js +39 -0
  23. package/dist/chunk-RXDJPRH5.js.map +1 -0
  24. package/dist/chunk-ULEDFFUJ.js +43 -0
  25. package/dist/chunk-ULEDFFUJ.js.map +1 -0
  26. package/dist/chunk-WHD5CSTB.js +52 -0
  27. package/dist/chunk-WHD5CSTB.js.map +1 -0
  28. package/dist/chunk-WHJ4JVO6.js +39 -0
  29. package/dist/chunk-WHJ4JVO6.js.map +1 -0
  30. package/dist/index.d.ts +19 -0
  31. package/dist/index.js +120 -14
  32. package/dist/input/input.d.ts +22 -0
  33. package/dist/input/input.js +8 -0
  34. package/dist/input/input.js.map +1 -0
  35. package/dist/input/label.d.ts +32 -0
  36. package/dist/input/label.js +11 -0
  37. package/dist/input/label.js.map +1 -0
  38. package/dist/input/textarea.d.ts +13 -0
  39. package/dist/input/textarea.js +8 -0
  40. package/dist/input/textarea.js.map +1 -0
  41. package/dist/overlay/alert-dialog.d.ts +42 -0
  42. package/dist/overlay/alert-dialog.js +23 -0
  43. package/dist/overlay/alert-dialog.js.map +1 -0
  44. package/dist/overlay/popover.d.ts +42 -0
  45. package/dist/overlay/popover.js +17 -0
  46. package/dist/overlay/popover.js.map +1 -0
  47. package/dist/overlay/sheet.d.ts +47 -0
  48. package/dist/overlay/sheet.js +29 -0
  49. package/dist/overlay/sheet.js.map +1 -0
  50. package/dist/overlay/tooltip.d.ts +31 -0
  51. package/dist/overlay/tooltip.js +15 -0
  52. package/dist/overlay/tooltip.js.map +1 -0
  53. package/dist/tabs/tabs.d.ts +24 -0
  54. package/dist/tabs/tabs.js +15 -0
  55. package/dist/tabs/tabs.js.map +1 -0
  56. package/dist/tabs/toggle-group.d.ts +19 -0
  57. package/dist/tabs/toggle-group.js +11 -0
  58. package/dist/tabs/toggle-group.js.map +1 -0
  59. package/package.json +9 -1
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":[]}
@@ -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":[]}
@@ -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":[]}
@@ -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":[]}
@@ -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":[]}
@@ -0,0 +1,93 @@
1
+ 'use client';
2
+
3
+ import {
4
+ cn
5
+ } from "./chunk-DXRY7AS4.js";
6
+
7
+ // src/overlay/sheet.tsx
8
+ import * as React from "react";
9
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
10
+ import { cva } from "class-variance-authority";
11
+ import { jsx, jsxs } from "react/jsx-runtime";
12
+ var sheetVariants = cva(
13
+ // No radius on a sheet: it is flush with the viewport edge, and rounding the
14
+ // two outer corners against nothing reads as a rendering mistake.
15
+ //
16
+ // `overflow-hidden` is load-bearing, not tidiness. Without it the sheet itself
17
+ // scrolls: focus moving to a control near the bottom makes the browser scroll
18
+ // the nearest scrollable ancestor into view, and that ancestor is the sheet —
19
+ // so the header slides off the top and the panel loses its title and its tabs.
20
+ // Only `SheetBody` scrolls, which is why it and only it carries the overflow.
21
+ "fixed z-50 flex flex-col overflow-hidden bg-surface text-on-surface shadow-floating outline-none",
22
+ {
23
+ variants: {
24
+ side: {
25
+ right: "inset-y-0 right-0 h-dvh w-96 max-w-full border-l border-outline",
26
+ left: "inset-y-0 left-0 h-dvh w-96 max-w-full border-r border-outline",
27
+ bottom: "inset-x-0 bottom-0 max-h-[80dvh] w-full border-t border-outline"
28
+ }
29
+ },
30
+ defaultVariants: { side: "right" }
31
+ }
32
+ );
33
+ var Sheet = DialogPrimitive.Root;
34
+ var SheetTrigger = DialogPrimitive.Trigger;
35
+ var SheetClose = DialogPrimitive.Close;
36
+ var SheetPortal = DialogPrimitive.Portal;
37
+ var SheetContent = React.forwardRef(({ className, side, overlay = false, container, children, ...props }, ref) => /* @__PURE__ */ jsxs(SheetPortal, { container: container ?? void 0, children: [
38
+ overlay ? /* @__PURE__ */ jsx(DialogPrimitive.Overlay, { className: "fixed inset-0 z-50 bg-ground-deep/40" }) : null,
39
+ /* @__PURE__ */ jsx(DialogPrimitive.Content, { ref, className: cn(sheetVariants({ side }), className), ...props, children })
40
+ ] }));
41
+ SheetContent.displayName = "SheetContent";
42
+ var SheetHeader = React.forwardRef(
43
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
44
+ "div",
45
+ {
46
+ ref,
47
+ className: cn("flex shrink-0 flex-col gap-gap-sm border-b border-outline p-inset-md", className),
48
+ ...props
49
+ }
50
+ )
51
+ );
52
+ SheetHeader.displayName = "SheetHeader";
53
+ var SheetBody = React.forwardRef(
54
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("min-h-0 flex-1 overflow-y-auto", className), ...props })
55
+ );
56
+ SheetBody.displayName = "SheetBody";
57
+ var SheetFooter = React.forwardRef(
58
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
59
+ "div",
60
+ {
61
+ ref,
62
+ className: cn("flex shrink-0 flex-col gap-gap-xs border-t border-outline p-inset-md", className),
63
+ ...props
64
+ }
65
+ )
66
+ );
67
+ SheetFooter.displayName = "SheetFooter";
68
+ var SheetTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Title, { ref, className: cn("sv-title-md", className), ...props }));
69
+ SheetTitle.displayName = "SheetTitle";
70
+ var SheetDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
71
+ DialogPrimitive.Description,
72
+ {
73
+ ref,
74
+ className: cn("sv-body-sm text-on-surface-variant", className),
75
+ ...props
76
+ }
77
+ ));
78
+ SheetDescription.displayName = "SheetDescription";
79
+
80
+ export {
81
+ sheetVariants,
82
+ Sheet,
83
+ SheetTrigger,
84
+ SheetClose,
85
+ SheetPortal,
86
+ SheetContent,
87
+ SheetHeader,
88
+ SheetBody,
89
+ SheetFooter,
90
+ SheetTitle,
91
+ SheetDescription
92
+ };
93
+ //# sourceMappingURL=chunk-R7BM6J75.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/overlay/sheet.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '@/lib/utils';\n\n/**\n * Cairn Sheet. A panel anchored to one edge, on Radix Dialog.\n *\n * The prop that matters is `modal`, and the default here is deliberately the\n * opposite of Radix's. A **modal** sheet takes the page hostage: focus is\n * trapped, everything behind it is inert, and the rest of the screen is dimmed.\n * That is right for a form you must finish. It is wrong for a companion panel —\n * an inspector, a comment thread, a filter rail — where the whole point is to\n * keep working in the page while the panel is open. Ship the modal default and\n * every companion panel in the system becomes a trap.\n *\n * So `modal` defaults to false, and Escape-to-close, the labelled dialog role and\n * the focus return still come from Radix. Pass `modal` explicitly when the panel\n * really must be answered before anything else.\n *\n * A `Title` is not optional. Radix warns when one is missing, and it is right to:\n * a dialog with no accessible name is announced as \"dialog\", which tells the user\n * nothing. Use `SheetTitle` — wrap it in `sr-only` if the design has no visible\n * heading, never drop it.\n */\n\nconst sheetVariants = cva(\n // No radius on a sheet: it is flush with the viewport edge, and rounding the\n // two outer corners against nothing reads as a rendering mistake.\n //\n // `overflow-hidden` is load-bearing, not tidiness. Without it the sheet itself\n // scrolls: focus moving to a control near the bottom makes the browser scroll\n // the nearest scrollable ancestor into view, and that ancestor is the sheet —\n // so the header slides off the top and the panel loses its title and its tabs.\n // Only `SheetBody` scrolls, which is why it and only it carries the overflow.\n 'fixed z-50 flex flex-col overflow-hidden bg-surface text-on-surface shadow-floating outline-none',\n {\n variants: {\n side: {\n right: 'inset-y-0 right-0 h-dvh w-96 max-w-full border-l border-outline',\n left: 'inset-y-0 left-0 h-dvh w-96 max-w-full border-r border-outline',\n bottom: 'inset-x-0 bottom-0 max-h-[80dvh] w-full border-t border-outline',\n },\n },\n defaultVariants: { side: 'right' },\n }\n);\n\nexport const Sheet = DialogPrimitive.Root;\nexport const SheetTrigger = DialogPrimitive.Trigger;\nexport const SheetClose = DialogPrimitive.Close;\nexport const SheetPortal = DialogPrimitive.Portal;\n\nexport interface SheetContentProps\n extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,\n VariantProps<typeof sheetVariants> {\n side?: 'right' | 'left' | 'bottom';\n /** Dim and inert the page behind. Only for a panel that must be answered. */\n overlay?: boolean;\n /** Where the portal mounts. Defaults to `document.body`. See `PopoverContent`. */\n container?: HTMLElement | null;\n}\n\nexport const SheetContent = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Content>,\n SheetContentProps\n>(({ className, side, overlay = false, container, children, ...props }, ref) => (\n <SheetPortal container={container ?? undefined}>\n {overlay ? (\n <DialogPrimitive.Overlay className=\"fixed inset-0 z-50 bg-ground-deep/40\" />\n ) : null}\n <DialogPrimitive.Content ref={ref} className={cn(sheetVariants({ side }), className)} {...props}>\n {children}\n </DialogPrimitive.Content>\n </SheetPortal>\n));\nSheetContent.displayName = 'SheetContent';\n\nexport const SheetHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex shrink-0 flex-col gap-gap-sm border-b border-outline p-inset-md', className)}\n {...props}\n />\n )\n);\nSheetHeader.displayName = 'SheetHeader';\n\nexport const SheetBody = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn('min-h-0 flex-1 overflow-y-auto', className)} {...props} />\n )\n);\nSheetBody.displayName = 'SheetBody';\n\nexport const SheetFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex shrink-0 flex-col gap-gap-xs border-t border-outline p-inset-md', className)}\n {...props}\n />\n )\n);\nSheetFooter.displayName = 'SheetFooter';\n\nexport const SheetTitle = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title ref={ref} className={cn('sv-title-md', className)} {...props} />\n));\nSheetTitle.displayName = 'SheetTitle';\n\nexport const SheetDescription = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('sv-body-sm text-on-surface-variant', className)}\n {...props}\n />\n));\nSheetDescription.displayName = 'SheetDescription';\n\nexport { sheetVariants };\n"],"mappings":";;;;;AAEA,YAAY,WAAW;AACvB,YAAY,qBAAqB;AACjC,SAAS,WAA8B;AAiErC,SAEI,KAFJ;AAzCF,IAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,OAAO;AAAA,QACP,MAAM;AAAA,QACN,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,IACA,iBAAiB,EAAE,MAAM,QAAQ;AAAA,EACnC;AACF;AAEO,IAAM,QAAwB;AAC9B,IAAM,eAA+B;AACrC,IAAM,aAA6B;AACnC,IAAM,cAA8B;AAYpC,IAAM,eAAqB,iBAGhC,CAAC,EAAE,WAAW,MAAM,UAAU,OAAO,WAAW,UAAU,GAAG,MAAM,GAAG,QACtE,qBAAC,eAAY,WAAW,aAAa,QAClC;AAAA,YACC,oBAAiB,yBAAhB,EAAwB,WAAU,wCAAuC,IACxE;AAAA,EACJ,oBAAiB,yBAAhB,EAAwB,KAAU,WAAW,GAAG,cAAc,EAAE,KAAK,CAAC,GAAG,SAAS,GAAI,GAAG,OACvF,UACH;AAAA,GACF,CACD;AACD,aAAa,cAAc;AAEpB,IAAM,cAAoB;AAAA,EAC/B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW,GAAG,wEAAwE,SAAS;AAAA,MAC9F,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,YAAY,cAAc;AAEnB,IAAM,YAAkB;AAAA,EAC7B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB,oBAAC,SAAI,KAAU,WAAW,GAAG,kCAAkC,SAAS,GAAI,GAAG,OAAO;AAE1F;AACA,UAAU,cAAc;AAEjB,IAAM,cAAoB;AAAA,EAC/B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW,GAAG,wEAAwE,SAAS;AAAA,MAC9F,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,YAAY,cAAc;AAEnB,IAAM,aAAmB,iBAG9B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B,oBAAiB,uBAAhB,EAAsB,KAAU,WAAW,GAAG,eAAe,SAAS,GAAI,GAAG,OAAO,CACtF;AACD,WAAW,cAAc;AAElB,IAAM,mBAAyB,iBAGpC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAiB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,sCAAsC,SAAS;AAAA,IAC5D,GAAG;AAAA;AACN,CACD;AACD,iBAAiB,cAAc;","names":[]}
@@ -0,0 +1,39 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-DXRY7AS4.js";
4
+
5
+ // src/badge/badge.tsx
6
+ import * as React from "react";
7
+ import { Slot } from "@radix-ui/react-slot";
8
+ import { cva } from "class-variance-authority";
9
+ import { jsx } from "react/jsx-runtime";
10
+ var badgeVariants = cva(
11
+ "inline-flex items-center gap-1 rounded-pill px-2 py-1 sv-label-sm whitespace-nowrap",
12
+ {
13
+ variants: {
14
+ tone: {
15
+ neutral: "bg-surface-muted text-on-surface",
16
+ success: "bg-success-container text-on-success-container",
17
+ info: "bg-info-container text-on-info-container",
18
+ warning: "bg-warning-container text-on-warning-container",
19
+ error: "bg-error-container text-on-error-container",
20
+ /** Hairline chip for a quiet count or a section kicker on a busy row. */
21
+ outline: "border border-outline text-on-surface-variant"
22
+ }
23
+ },
24
+ defaultVariants: { tone: "neutral" }
25
+ }
26
+ );
27
+ var Badge = React.forwardRef(
28
+ ({ className, tone, asChild = false, ...props }, ref) => {
29
+ const Comp = asChild ? Slot : "span";
30
+ return /* @__PURE__ */ jsx(Comp, { ref, className: cn(badgeVariants({ tone }), className), ...props });
31
+ }
32
+ );
33
+ Badge.displayName = "Badge";
34
+
35
+ export {
36
+ badgeVariants,
37
+ Badge
38
+ };
39
+ //# sourceMappingURL=chunk-RXDJPRH5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/badge/badge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '@/lib/utils';\n\n/**\n * Cairn Badge. The pill in the `label` role — the one sanctioned kicker\n * (AGENTS.md rule 6), used as a status chip or a section eyebrow.\n *\n * The variants are NOT a palette. `neutral` is the default because the ordinary\n * state of a thing is ordinary, and colouring the ordinary state leaves nothing\n * left to signal with. The four message tones are hue-as-meaning (rule 4) and\n * each is a `-container` fill with its paired, AA-verified `on-*-container` ink\n * — never coloured text on the page ground (rule 1).\n *\n * `main`, the signature accent, is deliberately absent. It is the brand's one\n * signal, a large-format fill with ink on top (rule 3); a small pill is neither\n * large nor a place for 4.04:1 text.\n *\n * Meaning never rests on colour alone (rule 4): the badge always carries its own\n * word. A badge whose only content is a colour is a bug, not a badge.\n */\nconst badgeVariants = cva(\n 'inline-flex items-center gap-1 rounded-pill px-2 py-1 sv-label-sm whitespace-nowrap',\n {\n variants: {\n tone: {\n neutral: 'bg-surface-muted text-on-surface',\n success: 'bg-success-container text-on-success-container',\n info: 'bg-info-container text-on-info-container',\n warning: 'bg-warning-container text-on-warning-container',\n error: 'bg-error-container text-on-error-container',\n /** Hairline chip for a quiet count or a section kicker on a busy row. */\n outline: 'border border-outline text-on-surface-variant',\n },\n },\n defaultVariants: { tone: 'neutral' },\n }\n);\n\nexport interface BadgeProps\n extends React.HTMLAttributes<HTMLSpanElement>,\n VariantProps<typeof badgeVariants> {\n tone?: 'neutral' | 'success' | 'info' | 'warning' | 'error' | 'outline';\n /** Render as the child element instead of a `<span>`. */\n asChild?: boolean;\n}\n\nexport const Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(\n ({ className, tone, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : 'span';\n return <Comp ref={ref} className={cn(badgeVariants({ tone }), className)} {...props} />;\n }\n);\nBadge.displayName = 'Badge';\n\nexport { badgeVariants };\n"],"mappings":";;;;;AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB,SAAS,WAA8B;AAiD5B;AA7BX,IAAM,gBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,SAAS;AAAA,QACT,MAAM;AAAA,QACN,SAAS;AAAA,QACT,OAAO;AAAA;AAAA,QAEP,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,iBAAiB,EAAE,MAAM,UAAU;AAAA,EACrC;AACF;AAUO,IAAM,QAAc;AAAA,EACzB,CAAC,EAAE,WAAW,MAAM,UAAU,OAAO,GAAG,MAAM,GAAG,QAAQ;AACvD,UAAM,OAAO,UAAU,OAAO;AAC9B,WAAO,oBAAC,QAAK,KAAU,WAAW,GAAG,cAAc,EAAE,KAAK,CAAC,GAAG,SAAS,GAAI,GAAG,OAAO;AAAA,EACvF;AACF;AACA,MAAM,cAAc;","names":[]}
@@ -0,0 +1,43 @@
1
+ 'use client';
2
+
3
+ import {
4
+ cn
5
+ } from "./chunk-DXRY7AS4.js";
6
+
7
+ // src/avatar/avatar.tsx
8
+ import * as React from "react";
9
+ import * as AvatarPrimitive from "@radix-ui/react-avatar";
10
+ import { cva } from "class-variance-authority";
11
+ import { jsx, jsxs } from "react/jsx-runtime";
12
+ var avatarVariants = cva(
13
+ "relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-surface-muted text-on-surface",
14
+ {
15
+ variants: {
16
+ size: {
17
+ // 24px is the floor for a hit target (rule 9); `sm` is display-only, so
18
+ // never wrap it in a button without padding the target out.
19
+ sm: "size-6 sv-label-sm",
20
+ md: "size-8 sv-label-sm",
21
+ lg: "size-11 sv-label-lg"
22
+ }
23
+ },
24
+ defaultVariants: { size: "md" }
25
+ }
26
+ );
27
+ function initials(name) {
28
+ return name.split(/\s+/).filter(Boolean).slice(0, 2).map((part) => part[0]?.toUpperCase() ?? "").join("");
29
+ }
30
+ var Avatar = React.forwardRef(({ className, size, name, src, ...props }, ref) => /* @__PURE__ */ jsxs(AvatarPrimitive.Root, { ref, className: cn(avatarVariants({ size }), className), ...props, children: [
31
+ src ? /* @__PURE__ */ jsx(AvatarPrimitive.Image, { src, alt: name, className: "size-full object-cover" }) : null,
32
+ /* @__PURE__ */ jsxs(AvatarPrimitive.Fallback, { delayMs: src ? 300 : 0, className: "tabular-nums", children: [
33
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: initials(name) }),
34
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: name })
35
+ ] })
36
+ ] }));
37
+ Avatar.displayName = "Avatar";
38
+
39
+ export {
40
+ avatarVariants,
41
+ Avatar
42
+ };
43
+ //# sourceMappingURL=chunk-ULEDFFUJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/avatar/avatar.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as AvatarPrimitive from '@radix-ui/react-avatar';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '@/lib/utils';\n\n/**\n * Cairn Avatar. Radix, for the fallback — which is the only hard part.\n *\n * Showing initials until an image loads, and keeping them if it never does, is a\n * three-state problem (idle / loaded / error) that every hand-rolled avatar gets\n * wrong in the same way: it flashes the initials over the loaded image, or it\n * leaves a broken-image icon on a 404. Radix's `Fallback` has the delay and the\n * state machine; we bring the tokens.\n *\n * Neutral by construction. Tinting an avatar per person is a hue with no stated\n * job (rule 3), and it collides with the one signal the system does have.\n */\nconst avatarVariants = cva(\n 'relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-surface-muted text-on-surface',\n {\n variants: {\n size: {\n // 24px is the floor for a hit target (rule 9); `sm` is display-only, so\n // never wrap it in a button without padding the target out.\n sm: 'size-6 sv-label-sm',\n md: 'size-8 sv-label-sm',\n lg: 'size-11 sv-label-lg',\n },\n },\n defaultVariants: { size: 'md' },\n }\n);\n\nexport interface AvatarProps\n extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>,\n VariantProps<typeof avatarVariants> {\n size?: 'sm' | 'md' | 'lg';\n /** The person's name. Drives the initials and the accessible label. */\n name: string;\n /** Optional portrait. Absent or failing, the initials stand in. */\n src?: string;\n}\n\n/** Two initials at most: three is a monogram, and a monogram is not a name. */\nfunction initials(name: string): string {\n return name\n .split(/\\s+/)\n .filter(Boolean)\n .slice(0, 2)\n .map((part) => part[0]?.toUpperCase() ?? '')\n .join('');\n}\n\nexport const Avatar = React.forwardRef<\n React.ComponentRef<typeof AvatarPrimitive.Root>,\n AvatarProps\n>(({ className, size, name, src, ...props }, ref) => (\n <AvatarPrimitive.Root ref={ref} className={cn(avatarVariants({ size }), className)} {...props}>\n {src ? (\n <AvatarPrimitive.Image src={src} alt={name} className=\"size-full object-cover\" />\n ) : null}\n {/* `delayMs` avoids the flicker of initials appearing for one frame under an\n image that was already cached. */}\n <AvatarPrimitive.Fallback delayMs={src ? 300 : 0} className=\"tabular-nums\">\n <span aria-hidden=\"true\">{initials(name)}</span>\n <span className=\"sr-only\">{name}</span>\n </AvatarPrimitive.Fallback>\n </AvatarPrimitive.Root>\n));\nAvatar.displayName = 'Avatar';\n\nexport { avatarVariants };\n"],"mappings":";;;;;AAEA,YAAY,WAAW;AACvB,YAAY,qBAAqB;AACjC,SAAS,WAA8B;AAyDjC,cAIF,YAJE;AA1CN,IAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA;AAAA;AAAA,QAGJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,IACF;AAAA,IACA,iBAAiB,EAAE,MAAM,KAAK;AAAA,EAChC;AACF;AAaA,SAAS,SAAS,MAAsB;AACtC,SAAO,KACJ,MAAM,KAAK,EACX,OAAO,OAAO,EACd,MAAM,GAAG,CAAC,EACV,IAAI,CAAC,SAAS,KAAK,CAAC,GAAG,YAAY,KAAK,EAAE,EAC1C,KAAK,EAAE;AACZ;AAEO,IAAM,SAAe,iBAG1B,CAAC,EAAE,WAAW,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,QAC3C,qBAAiB,sBAAhB,EAAqB,KAAU,WAAW,GAAG,eAAe,EAAE,KAAK,CAAC,GAAG,SAAS,GAAI,GAAG,OACrF;AAAA,QACC,oBAAiB,uBAAhB,EAAsB,KAAU,KAAK,MAAM,WAAU,0BAAyB,IAC7E;AAAA,EAGJ,qBAAiB,0BAAhB,EAAyB,SAAS,MAAM,MAAM,GAAG,WAAU,gBAC1D;AAAA,wBAAC,UAAK,eAAY,QAAQ,mBAAS,IAAI,GAAE;AAAA,IACzC,oBAAC,UAAK,WAAU,WAAW,gBAAK;AAAA,KAClC;AAAA,GACF,CACD;AACD,OAAO,cAAc;","names":[]}