@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.
- package/README.md +3 -3
- package/dist/avatar/avatar.d.ts +30 -0
- package/dist/avatar/avatar.js +11 -0
- package/dist/avatar/avatar.js.map +1 -0
- package/dist/badge/badge.d.ts +32 -0
- package/dist/badge/badge.js +10 -0
- package/dist/badge/badge.js.map +1 -0
- package/dist/charts/bar-chart.js +2 -2
- package/dist/charts/lib/series.d.ts +4 -2
- package/dist/charts/lib/series.js +1 -1
- package/dist/charts/line-chart.js +2 -2
- package/dist/charts/ring.d.ts +1 -1
- package/dist/charts/ring.js +2 -2
- package/dist/charts/segmented-bar.js +2 -2
- package/dist/chunk-BYZCFI7X.js +32 -0
- package/dist/chunk-BYZCFI7X.js.map +1 -0
- package/dist/{chunk-OHY4VIKZ.js → chunk-CZ3JB37A.js} +3 -4
- package/dist/chunk-CZ3JB37A.js.map +1 -0
- package/dist/chunk-DCKWB3EY.js +35 -0
- package/dist/chunk-DCKWB3EY.js.map +1 -0
- package/dist/{chunk-TI5GM4IR.js → chunk-G2XJK244.js} +7 -7
- package/dist/{chunk-TI5GM4IR.js.map → chunk-G2XJK244.js.map} +1 -1
- package/dist/chunk-GNHNTI5A.js +30 -0
- package/dist/chunk-GNHNTI5A.js.map +1 -0
- package/dist/chunk-HHUI32DT.js +36 -0
- package/dist/chunk-HHUI32DT.js.map +1 -0
- package/dist/chunk-OVF2VS3L.js +42 -0
- package/dist/chunk-OVF2VS3L.js.map +1 -0
- package/dist/{chunk-N2DFXOTF.js → chunk-OWIUMX76.js} +2 -2
- package/dist/chunk-POUL3ZTV.js +60 -0
- package/dist/chunk-POUL3ZTV.js.map +1 -0
- package/dist/chunk-R7BM6J75.js +93 -0
- package/dist/chunk-R7BM6J75.js.map +1 -0
- package/dist/chunk-RXDJPRH5.js +39 -0
- package/dist/chunk-RXDJPRH5.js.map +1 -0
- package/dist/{chunk-PIFHG2WO.js → chunk-S4HVXD6Z.js} +8 -6
- package/dist/chunk-S4HVXD6Z.js.map +1 -0
- package/dist/chunk-ULEDFFUJ.js +43 -0
- package/dist/chunk-ULEDFFUJ.js.map +1 -0
- package/dist/chunk-WHD5CSTB.js +52 -0
- package/dist/chunk-WHD5CSTB.js.map +1 -0
- package/dist/chunk-WHJ4JVO6.js +39 -0
- package/dist/chunk-WHJ4JVO6.js.map +1 -0
- package/dist/{chunk-65VQL6R2.js → chunk-YX6MSLUB.js} +2 -2
- package/dist/chunk-YX6MSLUB.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +118 -12
- package/dist/input/input.d.ts +22 -0
- package/dist/input/input.js +8 -0
- package/dist/input/input.js.map +1 -0
- package/dist/input/label.d.ts +32 -0
- package/dist/input/label.js +11 -0
- package/dist/input/label.js.map +1 -0
- package/dist/input/textarea.d.ts +13 -0
- package/dist/input/textarea.js +8 -0
- package/dist/input/textarea.js.map +1 -0
- package/dist/overlay/alert-dialog.d.ts +42 -0
- package/dist/overlay/alert-dialog.js +23 -0
- package/dist/overlay/alert-dialog.js.map +1 -0
- package/dist/overlay/popover.d.ts +42 -0
- package/dist/overlay/popover.js +17 -0
- package/dist/overlay/popover.js.map +1 -0
- package/dist/overlay/sheet.d.ts +47 -0
- package/dist/overlay/sheet.js +29 -0
- package/dist/overlay/sheet.js.map +1 -0
- package/dist/overlay/tooltip.d.ts +31 -0
- package/dist/overlay/tooltip.js +15 -0
- package/dist/overlay/tooltip.js.map +1 -0
- package/dist/tabs/tabs.d.ts +24 -0
- package/dist/tabs/tabs.js +15 -0
- package/dist/tabs/tabs.js.map +1 -0
- package/dist/tabs/toggle-group.d.ts +19 -0
- package/dist/tabs/toggle-group.js +11 -0
- package/dist/tabs/toggle-group.js.map +1 -0
- package/package.json +9 -1
- package/dist/chunk-65VQL6R2.js.map +0 -1
- package/dist/chunk-OHY4VIKZ.js.map +0 -1
- package/dist/chunk-PIFHG2WO.js.map +0 -1
- /package/dist/{chunk-N2DFXOTF.js.map → chunk-OWIUMX76.js.map} +0 -0
|
@@ -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":[]}
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
import {
|
|
4
4
|
chartToken,
|
|
5
5
|
markEdge,
|
|
6
|
-
toneFill
|
|
7
|
-
|
|
6
|
+
toneFill,
|
|
7
|
+
toneNeedsEdge
|
|
8
|
+
} from "./chunk-G2XJK244.js";
|
|
8
9
|
import {
|
|
9
10
|
cn
|
|
10
11
|
} from "./chunk-DXRY7AS4.js";
|
|
@@ -57,9 +58,10 @@ function BarChart({ data, height = 200, showValue = true, tone = "ink", classNam
|
|
|
57
58
|
style: {
|
|
58
59
|
height: `${Math.max(2, h / max * 100)}%`,
|
|
59
60
|
background: on ? activeFill : mutedFill,
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
|
|
61
|
+
// No keyline: `muted` is neutral.500 now and clears 3:1 against the surface on
|
|
62
|
+
// its own, as does the active ink bar. Routed through `toneNeedsEdge` rather
|
|
63
|
+
// than hardcoded so the pale-fill decision stays in one place (rule 9).
|
|
64
|
+
boxShadow: markEdge(toneNeedsEdge(on ? "ink" : "muted"))
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
67
|
)
|
|
@@ -87,4 +89,4 @@ BarChart.displayName = "BarChart";
|
|
|
87
89
|
export {
|
|
88
90
|
BarChart
|
|
89
91
|
};
|
|
90
|
-
//# sourceMappingURL=chunk-
|
|
92
|
+
//# sourceMappingURL=chunk-S4HVXD6Z.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/charts/bar-chart.tsx"],"sourcesContent":["'use client';\nimport * as React from 'react';\nimport { cn } from '@/lib/utils';\nimport { chartToken, toneFill, markEdge, toneNeedsEdge } from './lib/series';\n\nexport interface BarDatum {\n label: string;\n value: number;\n /** Highlight this bar (ink) and show its value by default. */\n active?: boolean;\n}\n\nexport interface BarChartProps {\n data: BarDatum[];\n height?: number;\n showValue?: boolean;\n /** Colour of the promoted bar. Defaults to ink; `accent` uses the signature accent. */\n tone?: 'ink' | 'accent';\n className?: string;\n}\n\n/**\n * Cairn BarChart, grayscale-first: muted neutral bars, the active bar promoted to ink\n * (or the signature accent via `tone=\"accent\"`) with a value pill. Interactive: hover any\n * bar to promote it and reveal its value. Colours resolve from `sys.chart.*` tokens (via\n * `chartToken`), so a theme swap recolours the chart for free. The chart carries a text\n * `aria-label` listing every label/value, so the data is never mouse-only (WCAG-safe).\n */\nexport function BarChart({ data, height = 200, showValue = true, tone = 'ink', className }: BarChartProps) {\n const max = Math.max(...data.map((d) => (Number.isFinite(d.value) ? d.value : 0)), 1);\n const [hover, setHover] = React.useState<number | null>(null);\n\n const activeFill = toneFill(tone);\n const mutedFill = chartToken.muted;\n\n return (\n <div className={cn('w-full', className)} role=\"group\" aria-label=\"Bar chart\">\n <div className=\"flex items-end gap-2\" style={{ height }} onMouseLeave={() => setHover(null)}>\n {data.map((d, i) => {\n const on = d.active || hover === i;\n const dim = hover != null && hover !== i;\n const h = Number.isFinite(d.value) ? d.value : 0;\n return (\n // Each bar is a focusable graphical object: keyboard + screen-reader parity with hover,\n // so its value is never mouse-only (rule 9). Focus mirrors hover to reveal the pill.\n <div\n key={d.label}\n role=\"img\"\n aria-label={`${d.label}: ${d.value}`}\n tabIndex={0}\n className=\"flex h-full flex-1 flex-col items-center justify-end gap-2 rounded-control outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus\"\n onMouseEnter={() => setHover(i)}\n onFocus={() => setHover(i)}\n onBlur={() => setHover(null)}\n >\n <span\n className={cn(\n 'rounded-pill px-2 py-0.5 sv-body-xs font-medium tabular-nums transition-opacity duration-150',\n on && showValue ? 'opacity-100' : 'opacity-0'\n )}\n style={{ background: activeFill, color: 'var(--sv-sys-color-on-primary)' }}\n >\n {d.value}\n </span>\n <div\n className={cn(\n 'w-full rounded-t-control transition-[height,background-color,opacity] duration-500 ease-out',\n dim && 'opacity-60'\n )}\n style={{\n height: `${Math.max(2, (h / max) * 100)}%`,\n background: on ? activeFill : mutedFill,\n // No keyline: `muted` is neutral.500 now and clears 3:1 against the surface on\n // its own, as does the active ink bar. Routed through `toneNeedsEdge` rather\n // than hardcoded so the pale-fill decision stays in one place (rule 9).\n boxShadow: markEdge(toneNeedsEdge(on ? 'ink' : 'muted')),\n }}\n />\n </div>\n );\n })}\n </div>\n <div className=\"mt-3 flex gap-2\" aria-hidden=\"true\">\n {data.map((d, i) => (\n <span\n key={d.label}\n className={cn(\n 'flex-1 text-center sv-body-sm transition-colors',\n d.active || hover === i ? 'text-on-surface' : 'text-on-surface-variant'\n )}\n >\n {d.label}\n </span>\n ))}\n </div>\n </div>\n );\n}\nBarChart.displayName = 'BarChart';\n"],"mappings":";;;;;;;;;;;AACA,YAAY,WAAW;AA4CX,SAUE,KAVF;AAjBL,SAAS,SAAS,EAAE,MAAM,SAAS,KAAK,YAAY,MAAM,OAAO,OAAO,UAAU,GAAkB;AACzG,QAAM,MAAM,KAAK,IAAI,GAAG,KAAK,IAAI,CAAC,MAAO,OAAO,SAAS,EAAE,KAAK,IAAI,EAAE,QAAQ,CAAE,GAAG,CAAC;AACpF,QAAM,CAAC,OAAO,QAAQ,IAAU,eAAwB,IAAI;AAE5D,QAAM,aAAa,SAAS,IAAI;AAChC,QAAM,YAAY,WAAW;AAE7B,SACE,qBAAC,SAAI,WAAW,GAAG,UAAU,SAAS,GAAG,MAAK,SAAQ,cAAW,aAC/D;AAAA,wBAAC,SAAI,WAAU,wBAAuB,OAAO,EAAE,OAAO,GAAG,cAAc,MAAM,SAAS,IAAI,GACvF,eAAK,IAAI,CAAC,GAAG,MAAM;AAClB,YAAM,KAAK,EAAE,UAAU,UAAU;AACjC,YAAM,MAAM,SAAS,QAAQ,UAAU;AACvC,YAAM,IAAI,OAAO,SAAS,EAAE,KAAK,IAAI,EAAE,QAAQ;AAC/C;AAAA;AAAA;AAAA,QAGE;AAAA,UAAC;AAAA;AAAA,YAEC,MAAK;AAAA,YACL,cAAY,GAAG,EAAE,KAAK,KAAK,EAAE,KAAK;AAAA,YAClC,UAAU;AAAA,YACV,WAAU;AAAA,YACV,cAAc,MAAM,SAAS,CAAC;AAAA,YAC9B,SAAS,MAAM,SAAS,CAAC;AAAA,YACzB,QAAQ,MAAM,SAAS,IAAI;AAAA,YAE3B;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACC,WAAW;AAAA,oBACT;AAAA,oBACA,MAAM,YAAY,gBAAgB;AAAA,kBACpC;AAAA,kBACA,OAAO,EAAE,YAAY,YAAY,OAAO,iCAAiC;AAAA,kBAExE,YAAE;AAAA;AAAA,cACL;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACC,WAAW;AAAA,oBACT;AAAA,oBACA,OAAO;AAAA,kBACT;AAAA,kBACA,OAAO;AAAA,oBACL,QAAQ,GAAG,KAAK,IAAI,GAAI,IAAI,MAAO,GAAG,CAAC;AAAA,oBACvC,YAAY,KAAK,aAAa;AAAA;AAAA;AAAA;AAAA,oBAI9B,WAAW,SAAS,cAAc,KAAK,QAAQ,OAAO,CAAC;AAAA,kBACzD;AAAA;AAAA,cACF;AAAA;AAAA;AAAA,UA/BK,EAAE;AAAA,QAgCT;AAAA;AAAA,IAEJ,CAAC,GACH;AAAA,IACA,oBAAC,SAAI,WAAU,mBAAkB,eAAY,QAC1C,eAAK,IAAI,CAAC,GAAG,MACZ;AAAA,MAAC;AAAA;AAAA,QAEC,WAAW;AAAA,UACT;AAAA,UACA,EAAE,UAAU,UAAU,IAAI,oBAAoB;AAAA,QAChD;AAAA,QAEC,YAAE;AAAA;AAAA,MANE,EAAE;AAAA,IAOT,CACD,GACH;AAAA,KACF;AAEJ;AACA,SAAS,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":[]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
cn
|
|
5
|
+
} from "./chunk-DXRY7AS4.js";
|
|
6
|
+
|
|
7
|
+
// src/tabs/tabs.tsx
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
var Tabs = TabsPrimitive.Root;
|
|
12
|
+
var TabsList = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(TabsPrimitive.List, { ref, className: cn("inline-flex items-center gap-gap-xs", className), ...props }));
|
|
13
|
+
TabsList.displayName = "TabsList";
|
|
14
|
+
var TabsTrigger = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
15
|
+
TabsPrimitive.Trigger,
|
|
16
|
+
{
|
|
17
|
+
ref,
|
|
18
|
+
className: cn(
|
|
19
|
+
// min-h-6: the hit target floor (rule 9). A tab is small by nature and
|
|
20
|
+
// this is the line under which it stops being usable on a touch screen.
|
|
21
|
+
"inline-flex min-h-6 items-center rounded-pill px-3 py-1 sv-label-sm whitespace-nowrap",
|
|
22
|
+
"text-on-surface-variant transition-[background-color,color] duration-150",
|
|
23
|
+
"hover:bg-surface-subtle active:bg-surface-muted",
|
|
24
|
+
"data-[state=active]:bg-surface-muted data-[state=active]:text-on-surface",
|
|
25
|
+
"outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",
|
|
26
|
+
"disabled:pointer-events-none disabled:opacity-40",
|
|
27
|
+
className
|
|
28
|
+
),
|
|
29
|
+
...props
|
|
30
|
+
}
|
|
31
|
+
));
|
|
32
|
+
TabsTrigger.displayName = "TabsTrigger";
|
|
33
|
+
var TabsContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
34
|
+
TabsPrimitive.Content,
|
|
35
|
+
{
|
|
36
|
+
ref,
|
|
37
|
+
className: cn(
|
|
38
|
+
"outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",
|
|
39
|
+
className
|
|
40
|
+
),
|
|
41
|
+
...props
|
|
42
|
+
}
|
|
43
|
+
));
|
|
44
|
+
TabsContent.displayName = "TabsContent";
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
Tabs,
|
|
48
|
+
TabsList,
|
|
49
|
+
TabsTrigger,
|
|
50
|
+
TabsContent
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=chunk-WHD5CSTB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tabs/tabs.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as TabsPrimitive from '@radix-ui/react-tabs';\nimport { cn } from '@/lib/utils';\n\n/**\n * Cairn Tabs. Radix, and this one is not negotiable.\n *\n * `role=\"tablist\"` on a row of buttons is the most common accessibility lie in a\n * codebase: it announces a tab list to a screen reader and then ships none of\n * the behaviour that word promises — a single tab stop for the whole set, arrow\n * keys to move between tabs, Home/End, and the selected tab bound to its panel\n * by id. Writing the role without the behaviour is worse than writing no role at\n * all, because it tells the user a lie they will act on. Radix has all of it.\n *\n * The selected tab is marked by the surface ramp, not by hue and not by an\n * underline: `surface-muted` is the selected step, `surface-subtle` the hover\n * step, exactly as `sv-state` uses them elsewhere. One mechanism for state\n * across the system (BRAND.md, law 5).\n */\n\nexport const Tabs = TabsPrimitive.Root;\n\nexport const TabsList = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.List ref={ref} className={cn('inline-flex items-center gap-gap-xs', className)} {...props} />\n));\nTabsList.displayName = 'TabsList';\n\nexport const TabsTrigger = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n // min-h-6: the hit target floor (rule 9). A tab is small by nature and\n // this is the line under which it stops being usable on a touch screen.\n 'inline-flex min-h-6 items-center rounded-pill px-3 py-1 sv-label-sm whitespace-nowrap',\n 'text-on-surface-variant transition-[background-color,color] duration-150',\n 'hover:bg-surface-subtle active:bg-surface-muted',\n 'data-[state=active]:bg-surface-muted data-[state=active]: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));\nTabsTrigger.displayName = 'TabsTrigger';\n\nexport const TabsContent = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(\n 'outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus',\n className\n )}\n {...props}\n />\n));\nTabsContent.displayName = 'TabsContent';\n"],"mappings":";;;;;AAEA,YAAY,WAAW;AACvB,YAAY,mBAAmB;AAyB7B;AANK,IAAM,OAAqB;AAE3B,IAAM,WAAiB,iBAG5B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B,oBAAe,oBAAd,EAAmB,KAAU,WAAW,GAAG,uCAAuC,SAAS,GAAI,GAAG,OAAO,CAC3G;AACD,SAAS,cAAc;AAEhB,IAAM,cAAoB,iBAG/B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAe;AAAA,EAAd;AAAA,IACC;AAAA,IACA,WAAW;AAAA;AAAA;AAAA,MAGT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,YAAY,cAAc;AAEnB,IAAM,cAAoB,iBAG/B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAe;AAAA,EAAd;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,YAAY,cAAc;","names":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
cn
|
|
5
|
+
} from "./chunk-DXRY7AS4.js";
|
|
6
|
+
|
|
7
|
+
// src/overlay/popover.tsx
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
var Popover = PopoverPrimitive.Root;
|
|
12
|
+
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
13
|
+
var PopoverAnchor = PopoverPrimitive.Anchor;
|
|
14
|
+
var PopoverClose = PopoverPrimitive.Close;
|
|
15
|
+
var PopoverContent = React.forwardRef(({ className, align = "start", sideOffset = 8, collisionPadding = 12, container, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { container: container ?? void 0, children: /* @__PURE__ */ jsx(
|
|
16
|
+
PopoverPrimitive.Content,
|
|
17
|
+
{
|
|
18
|
+
ref,
|
|
19
|
+
align,
|
|
20
|
+
sideOffset,
|
|
21
|
+
collisionPadding,
|
|
22
|
+
className: cn(
|
|
23
|
+
"z-50 w-72 rounded-control border border-outline bg-surface p-inset-sm text-on-surface shadow-overlay",
|
|
24
|
+
"outline-none",
|
|
25
|
+
className
|
|
26
|
+
),
|
|
27
|
+
...props
|
|
28
|
+
}
|
|
29
|
+
) }));
|
|
30
|
+
PopoverContent.displayName = "PopoverContent";
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
Popover,
|
|
34
|
+
PopoverTrigger,
|
|
35
|
+
PopoverAnchor,
|
|
36
|
+
PopoverClose,
|
|
37
|
+
PopoverContent
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=chunk-WHJ4JVO6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/overlay/popover.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { cn } from '@/lib/utils';\n\n/**\n * Cairn Popover. Radix, for the positioning — which is never as simple as it looks.\n *\n * The hand-rolled version is always the same: absolute coordinates, then a\n * `Math.min/max` to keep the card on screen. It works until the trigger is near\n * an edge and the card should flip to the other side, or the page scrolls under\n * it, or the trigger sits inside its own scroll container. Radix's collision\n * handling covers all of that, and brings what the maths never does: focus moves\n * into the panel on open and returns to the trigger on close, Escape dismisses,\n * an outside click dismisses, and the trigger is wired to the panel with\n * `aria-expanded` / `aria-controls`.\n *\n * `Anchor` is exported because a popover does not always hang off a button: a\n * pin dropped on a page has a position but no trigger element.\n *\n * `control` radius, not `card`: the card radius is reserved for feature cards and\n * metric tiles (rule 7). Elevation AND a hairline, deliberately: the shadow\n * carries the lift on the light theme, the hairline is what separates the surface\n * on the dark one, where a black shadow does nothing.\n */\n\nexport const Popover = PopoverPrimitive.Root;\nexport const PopoverTrigger = PopoverPrimitive.Trigger;\nexport const PopoverAnchor = PopoverPrimitive.Anchor;\nexport const PopoverClose = PopoverPrimitive.Close;\n\nexport interface PopoverContentProps\n extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> {\n /**\n * Where the portal mounts. Defaults to `document.body`.\n *\n * Override it whenever the theme lives on a subtree rather than on the\n * document — a scoped overlay root, a `data-theme` wrapper, a shadow host.\n * Portalled to the body by default, the panel escapes that subtree and renders\n * with none of its tokens: correct behaviour, no styling, and nothing in the\n * console to say why.\n */\n container?: HTMLElement | null;\n}\n\nexport const PopoverContent = React.forwardRef<\n React.ComponentRef<typeof PopoverPrimitive.Content>,\n PopoverContentProps\n>(({ className, align = 'start', sideOffset = 8, collisionPadding = 12, container, ...props }, ref) => (\n <PopoverPrimitive.Portal container={container ?? undefined}>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n className={cn(\n 'z-50 w-72 rounded-control border border-outline bg-surface p-inset-sm text-on-surface shadow-overlay',\n 'outline-none',\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n));\nPopoverContent.displayName = 'PopoverContent';\n"],"mappings":";;;;;AAEA,YAAY,WAAW;AACvB,YAAY,sBAAsB;AAgD9B;AAxBG,IAAM,UAA2B;AACjC,IAAM,iBAAkC;AACxC,IAAM,gBAAiC;AACvC,IAAM,eAAgC;AAgBtC,IAAM,iBAAuB,iBAGlC,CAAC,EAAE,WAAW,QAAQ,SAAS,aAAa,GAAG,mBAAmB,IAAI,WAAW,GAAG,MAAM,GAAG,QAC7F,oBAAkB,yBAAjB,EAAwB,WAAW,aAAa,QAC/C;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,GACF,CACD;AACD,eAAe,cAAc;","names":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import {
|
|
4
4
|
chartToken,
|
|
5
5
|
toneFill
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-G2XJK244.js";
|
|
7
7
|
import {
|
|
8
8
|
cn
|
|
9
9
|
} from "./chunk-DXRY7AS4.js";
|
|
@@ -95,4 +95,4 @@ Ring.displayName = "Ring";
|
|
|
95
95
|
export {
|
|
96
96
|
Ring
|
|
97
97
|
};
|
|
98
|
-
//# sourceMappingURL=chunk-
|
|
98
|
+
//# sourceMappingURL=chunk-YX6MSLUB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/charts/ring.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '@/lib/utils';\nimport { chartToken, toneFill } from './lib/series';\n\nexport interface RingProps {\n /** Progress, 0-100. */\n value: number;\n /** Outer diameter in px. */\n size?: number;\n /** Ring thickness in px. */\n thickness?: number;\n /** Colour of the filled arc. Defaults to ink; `accent` uses the signature accent. */\n tone?: 'ink' | 'accent';\n /**\n * Explicit arc colour (a token / CSS colour), overrides `tone`. Pass only colours that\n * clear 3:1 against the surface as a thin stroke, ink, blue, or a dark graphite. Silver\n * and mid-gray are fill-only (they fail as a line); see AGENTS.md rule 9.\n */\n color?: string;\n /**\n * Draw a darker keyline under the arc so a light, low-contrast colour (a pale accent step) stays\n * perceptible, the rim carries the 3:1 shape contrast the fill can't (AGENTS.md rule 9).\n * `true` uses ink; pass a colour (e.g. `sys.color.accent-edge`) for a tonal, in-family rim.\n */\n casing?: boolean | string;\n /** Fill the arc from empty on mount. Honours `prefers-reduced-motion`. */\n animate?: boolean;\n /** Centre content, e.g. the value. Omit for a bare ring. */\n children?: React.ReactNode;\n /** Accessible label; falls back to \"<value>%\". */\n 'aria-label'?: string;\n className?: string;\n}\n\n/**\n * Cairn Ring, single-value radial progress. Grayscale by default (ink arc on a\n * neutral track); `tone=\"accent\"` opts into the signature accent, or pass an explicit\n * `color`. The arc fills from empty on mount (rounded cap, 12 o'clock, clockwise).\n * Zero-dependency SVG. A client component (`'use client'`): the mount animation uses state;\n * pass `animate={false}` to render it statically.\n */\nexport function Ring({\n value,\n size = 160,\n thickness = 14,\n tone = 'ink',\n color,\n casing = false,\n animate = true,\n children,\n className,\n 'aria-label': ariaLabel,\n}: RingProps) {\n const pct = Math.min(Math.max(Number.isFinite(value) ? value : 0, 0), 100);\n const r = (size - thickness) / 2;\n const c = 2 * Math.PI * r;\n\n // Fill from empty on mount: first client paint is 0, then rAF advances to the value so the\n // CSS transition animates. Under prefers-reduced-motion we jump straight to the value with the\n // transition removed — self-contained, never relying on a global reduced-motion rule existing.\n const [progress, setProgress] = React.useState(animate ? 0 : pct);\n const [instant, setInstant] = React.useState(!animate);\n React.useEffect(() => {\n if (!animate) {\n setProgress(pct);\n return;\n }\n const reduce =\n typeof window !== 'undefined' && window.matchMedia?.('(prefers-reduced-motion: reduce)').matches;\n if (reduce) {\n setInstant(true);\n setProgress(pct);\n return;\n }\n setInstant(false);\n const id = requestAnimationFrame(() => setProgress(pct));\n return () => cancelAnimationFrame(id);\n }, [pct, animate]);\n\n const arc = (progress / 100) * c;\n const motion = instant ? undefined : 'transition-[stroke-dasharray] duration-[900ms] ease-out';\n const stroke = color ?? toneFill(tone);\n return (\n <div\n className={cn('relative inline-grid place-items-center', className)}\n style={{ width: size, height: size }}\n role=\"img\"\n aria-label={ariaLabel ?? `${Math.round(pct)}%`}\n >\n <svg width={size} height={size} viewBox={`0 0 ${size} ${size}`} className=\"rotate-[-90deg]\" aria-hidden=\"true\">\n <circle cx={size / 2} cy={size / 2} r={r} fill=\"none\" stroke={chartToken.track} strokeWidth={thickness} />\n {casing && (\n <circle\n cx={size / 2}\n cy={size / 2}\n r={r}\n fill=\"none\"\n stroke={typeof casing === 'string' ? casing : 'var(--sv-sys-color-on-surface)'}\n strokeWidth={thickness + 2}\n strokeLinecap=\"round\"\n strokeDasharray={`${arc} ${c - arc}`}\n className={motion}\n />\n )}\n <circle\n cx={size / 2}\n cy={size / 2}\n r={r}\n fill=\"none\"\n stroke={stroke}\n strokeWidth={thickness}\n strokeLinecap=\"round\"\n strokeDasharray={`${arc} ${c - arc}`}\n className={motion}\n />\n </svg>\n {children != null && <div className=\"absolute inset-0 grid place-items-center\">{children}</div>}\n </div>\n );\n}\nRing.displayName = 'Ring';\n"],"mappings":";;;;;;;;;AAEA,YAAY,WAAW;AAyFjB,SACE,KADF;AAhDC,SAAS,KAAK;AAAA,EACnB;AAAA,EACA,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,OAAO;AAAA,EACP;AAAA,EACA,SAAS;AAAA,EACT,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA,cAAc;AAChB,GAAc;AACZ,QAAM,MAAM,KAAK,IAAI,KAAK,IAAI,OAAO,SAAS,KAAK,IAAI,QAAQ,GAAG,CAAC,GAAG,GAAG;AACzE,QAAM,KAAK,OAAO,aAAa;AAC/B,QAAM,IAAI,IAAI,KAAK,KAAK;AAKxB,QAAM,CAAC,UAAU,WAAW,IAAU,eAAS,UAAU,IAAI,GAAG;AAChE,QAAM,CAAC,SAAS,UAAU,IAAU,eAAS,CAAC,OAAO;AACrD,EAAM,gBAAU,MAAM;AACpB,QAAI,CAAC,SAAS;AACZ,kBAAY,GAAG;AACf;AAAA,IACF;AACA,UAAM,SACJ,OAAO,WAAW,eAAe,OAAO,aAAa,kCAAkC,EAAE;AAC3F,QAAI,QAAQ;AACV,iBAAW,IAAI;AACf,kBAAY,GAAG;AACf;AAAA,IACF;AACA,eAAW,KAAK;AAChB,UAAM,KAAK,sBAAsB,MAAM,YAAY,GAAG,CAAC;AACvD,WAAO,MAAM,qBAAqB,EAAE;AAAA,EACtC,GAAG,CAAC,KAAK,OAAO,CAAC;AAEjB,QAAM,MAAO,WAAW,MAAO;AAC/B,QAAM,SAAS,UAAU,SAAY;AACrC,QAAM,SAAS,SAAS,SAAS,IAAI;AACrC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,2CAA2C,SAAS;AAAA,MAClE,OAAO,EAAE,OAAO,MAAM,QAAQ,KAAK;AAAA,MACnC,MAAK;AAAA,MACL,cAAY,aAAa,GAAG,KAAK,MAAM,GAAG,CAAC;AAAA,MAE3C;AAAA,6BAAC,SAAI,OAAO,MAAM,QAAQ,MAAM,SAAS,OAAO,IAAI,IAAI,IAAI,IAAI,WAAU,mBAAkB,eAAY,QACtG;AAAA,8BAAC,YAAO,IAAI,OAAO,GAAG,IAAI,OAAO,GAAG,GAAM,MAAK,QAAO,QAAQ,WAAW,OAAO,aAAa,WAAW;AAAA,UACvG,UACC;AAAA,YAAC;AAAA;AAAA,cACC,IAAI,OAAO;AAAA,cACX,IAAI,OAAO;AAAA,cACX;AAAA,cACA,MAAK;AAAA,cACL,QAAQ,OAAO,WAAW,WAAW,SAAS;AAAA,cAC9C,aAAa,YAAY;AAAA,cACzB,eAAc;AAAA,cACd,iBAAiB,GAAG,GAAG,IAAI,IAAI,GAAG;AAAA,cAClC,WAAW;AAAA;AAAA,UACb;AAAA,UAEF;AAAA,YAAC;AAAA;AAAA,cACC,IAAI,OAAO;AAAA,cACX,IAAI,OAAO;AAAA,cACX;AAAA,cACA,MAAK;AAAA,cACL;AAAA,cACA,aAAa;AAAA,cACb,eAAc;AAAA,cACd,iBAAiB,GAAG,GAAG,IAAI,IAAI,GAAG;AAAA,cAClC,WAAW;AAAA;AAAA,UACb;AAAA,WACF;AAAA,QACC,YAAY,QAAQ,oBAAC,SAAI,WAAU,4CAA4C,UAAS;AAAA;AAAA;AAAA,EAC3F;AAEJ;AACA,KAAK,cAAc;","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
export { Button, ButtonProps, buttonVariants } from './button/button.js';
|
|
2
2
|
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardProps, CardTitle, CardTitleProps } from './card/card.js';
|
|
3
|
+
export { Input, InputProps } from './input/input.js';
|
|
4
|
+
export { Textarea, TextareaProps } from './input/textarea.js';
|
|
5
|
+
export { Field, FieldProps, Label, LabelProps } from './input/label.js';
|
|
6
|
+
export { Badge, BadgeProps, badgeVariants } from './badge/badge.js';
|
|
7
|
+
export { Avatar, AvatarProps, avatarVariants } from './avatar/avatar.js';
|
|
8
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger } from './tabs/tabs.js';
|
|
9
|
+
export { ToggleGroup, ToggleGroupItem } from './tabs/toggle-group.js';
|
|
10
|
+
export { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverContentProps, PopoverTrigger } from './overlay/popover.js';
|
|
11
|
+
export { Sheet, SheetBody, SheetClose, SheetContent, SheetContentProps, SheetDescription, SheetFooter, SheetHeader, SheetPortal, SheetTitle, SheetTrigger, sheetVariants } from './overlay/sheet.js';
|
|
12
|
+
export { Tooltip, TooltipContent, TooltipContentProps, TooltipProvider, TooltipTrigger } from './overlay/tooltip.js';
|
|
13
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogContentProps, AlertDialogDescription, AlertDialogFooter, AlertDialogTitle, AlertDialogTrigger } from './overlay/alert-dialog.js';
|
|
3
14
|
export { Icon, IconProps } from './icon/icon.js';
|
|
4
15
|
export { Logo, LogoProps } from './logo/logo.js';
|
|
5
16
|
export { LogoMark, LogoMarkProps } from './logo/logo-mark.js';
|
|
@@ -12,4 +23,12 @@ export { CATEGORICAL_MAX, categorical, categoricalOn, chartStroke, chartToken, s
|
|
|
12
23
|
import 'class-variance-authority/types';
|
|
13
24
|
import 'react';
|
|
14
25
|
import 'class-variance-authority';
|
|
26
|
+
import '@radix-ui/react-label';
|
|
27
|
+
import '@radix-ui/react-avatar';
|
|
28
|
+
import '@radix-ui/react-tabs';
|
|
29
|
+
import '@radix-ui/react-toggle-group';
|
|
30
|
+
import '@radix-ui/react-popover';
|
|
31
|
+
import '@radix-ui/react-dialog';
|
|
32
|
+
import '@radix-ui/react-tooltip';
|
|
33
|
+
import '@radix-ui/react-alert-dialog';
|
|
15
34
|
import '@phosphor-icons/react';
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,82 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Logo
|
|
3
|
+
} from "./chunk-QZYA5GS2.js";
|
|
4
|
+
import {
|
|
5
|
+
AlertDialog,
|
|
6
|
+
AlertDialogAction,
|
|
7
|
+
AlertDialogCancel,
|
|
8
|
+
AlertDialogContent,
|
|
9
|
+
AlertDialogDescription,
|
|
10
|
+
AlertDialogFooter,
|
|
11
|
+
AlertDialogTitle,
|
|
12
|
+
AlertDialogTrigger
|
|
13
|
+
} from "./chunk-POUL3ZTV.js";
|
|
14
|
+
import {
|
|
15
|
+
Popover,
|
|
16
|
+
PopoverAnchor,
|
|
17
|
+
PopoverClose,
|
|
18
|
+
PopoverContent,
|
|
19
|
+
PopoverTrigger
|
|
20
|
+
} from "./chunk-WHJ4JVO6.js";
|
|
21
|
+
import {
|
|
22
|
+
Sheet,
|
|
23
|
+
SheetBody,
|
|
24
|
+
SheetClose,
|
|
25
|
+
SheetContent,
|
|
26
|
+
SheetDescription,
|
|
27
|
+
SheetFooter,
|
|
28
|
+
SheetHeader,
|
|
29
|
+
SheetPortal,
|
|
30
|
+
SheetTitle,
|
|
31
|
+
SheetTrigger,
|
|
32
|
+
sheetVariants
|
|
33
|
+
} from "./chunk-R7BM6J75.js";
|
|
34
|
+
import {
|
|
35
|
+
Tooltip,
|
|
36
|
+
TooltipContent,
|
|
37
|
+
TooltipProvider,
|
|
38
|
+
TooltipTrigger
|
|
39
|
+
} from "./chunk-DCKWB3EY.js";
|
|
40
|
+
import {
|
|
41
|
+
Tabs,
|
|
42
|
+
TabsContent,
|
|
43
|
+
TabsList,
|
|
44
|
+
TabsTrigger
|
|
45
|
+
} from "./chunk-WHD5CSTB.js";
|
|
46
|
+
import {
|
|
47
|
+
ToggleGroup,
|
|
48
|
+
ToggleGroupItem
|
|
49
|
+
} from "./chunk-OVF2VS3L.js";
|
|
50
|
+
import {
|
|
51
|
+
SegmentedBar
|
|
52
|
+
} from "./chunk-CZ3JB37A.js";
|
|
53
|
+
import {
|
|
54
|
+
Stat
|
|
55
|
+
} from "./chunk-XGYKA3GE.js";
|
|
1
56
|
import {
|
|
2
57
|
Icon
|
|
3
58
|
} from "./chunk-N5ZJZ7I3.js";
|
|
59
|
+
import {
|
|
60
|
+
Input
|
|
61
|
+
} from "./chunk-BYZCFI7X.js";
|
|
62
|
+
import {
|
|
63
|
+
Field,
|
|
64
|
+
Label
|
|
65
|
+
} from "./chunk-HHUI32DT.js";
|
|
66
|
+
import {
|
|
67
|
+
Textarea
|
|
68
|
+
} from "./chunk-GNHNTI5A.js";
|
|
4
69
|
import {
|
|
5
70
|
LogoMark
|
|
6
71
|
} from "./chunk-IVQKYAL6.js";
|
|
7
72
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
73
|
+
Avatar,
|
|
74
|
+
avatarVariants
|
|
75
|
+
} from "./chunk-ULEDFFUJ.js";
|
|
76
|
+
import {
|
|
77
|
+
Badge,
|
|
78
|
+
badgeVariants
|
|
79
|
+
} from "./chunk-RXDJPRH5.js";
|
|
10
80
|
import {
|
|
11
81
|
Button,
|
|
12
82
|
buttonVariants
|
|
@@ -21,17 +91,14 @@ import {
|
|
|
21
91
|
} from "./chunk-7GXL7U5X.js";
|
|
22
92
|
import {
|
|
23
93
|
BarChart
|
|
24
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-S4HVXD6Z.js";
|
|
25
95
|
import {
|
|
26
96
|
LineChart
|
|
27
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-OWIUMX76.js";
|
|
28
98
|
import "./chunk-27MWE4F5.js";
|
|
29
99
|
import {
|
|
30
100
|
Ring
|
|
31
|
-
} from "./chunk-
|
|
32
|
-
import {
|
|
33
|
-
SegmentedBar
|
|
34
|
-
} from "./chunk-OHY4VIKZ.js";
|
|
101
|
+
} from "./chunk-YX6MSLUB.js";
|
|
35
102
|
import {
|
|
36
103
|
CATEGORICAL_MAX,
|
|
37
104
|
categorical,
|
|
@@ -41,12 +108,19 @@ import {
|
|
|
41
108
|
sequential,
|
|
42
109
|
sequentialOn,
|
|
43
110
|
toneFill
|
|
44
|
-
} from "./chunk-
|
|
45
|
-
import {
|
|
46
|
-
Stat
|
|
47
|
-
} from "./chunk-XGYKA3GE.js";
|
|
111
|
+
} from "./chunk-G2XJK244.js";
|
|
48
112
|
import "./chunk-DXRY7AS4.js";
|
|
49
113
|
export {
|
|
114
|
+
AlertDialog,
|
|
115
|
+
AlertDialogAction,
|
|
116
|
+
AlertDialogCancel,
|
|
117
|
+
AlertDialogContent,
|
|
118
|
+
AlertDialogDescription,
|
|
119
|
+
AlertDialogFooter,
|
|
120
|
+
AlertDialogTitle,
|
|
121
|
+
AlertDialogTrigger,
|
|
122
|
+
Avatar,
|
|
123
|
+
Badge,
|
|
50
124
|
BarChart,
|
|
51
125
|
Button,
|
|
52
126
|
CATEGORICAL_MAX,
|
|
@@ -56,13 +130,44 @@ export {
|
|
|
56
130
|
CardFooter,
|
|
57
131
|
CardHeader,
|
|
58
132
|
CardTitle,
|
|
133
|
+
Field,
|
|
59
134
|
Icon,
|
|
135
|
+
Input,
|
|
136
|
+
Label,
|
|
60
137
|
LineChart,
|
|
61
138
|
Logo,
|
|
62
139
|
LogoMark,
|
|
140
|
+
Popover,
|
|
141
|
+
PopoverAnchor,
|
|
142
|
+
PopoverClose,
|
|
143
|
+
PopoverContent,
|
|
144
|
+
PopoverTrigger,
|
|
63
145
|
Ring,
|
|
64
146
|
SegmentedBar,
|
|
147
|
+
Sheet,
|
|
148
|
+
SheetBody,
|
|
149
|
+
SheetClose,
|
|
150
|
+
SheetContent,
|
|
151
|
+
SheetDescription,
|
|
152
|
+
SheetFooter,
|
|
153
|
+
SheetHeader,
|
|
154
|
+
SheetPortal,
|
|
155
|
+
SheetTitle,
|
|
156
|
+
SheetTrigger,
|
|
65
157
|
Stat,
|
|
158
|
+
Tabs,
|
|
159
|
+
TabsContent,
|
|
160
|
+
TabsList,
|
|
161
|
+
TabsTrigger,
|
|
162
|
+
Textarea,
|
|
163
|
+
ToggleGroup,
|
|
164
|
+
ToggleGroupItem,
|
|
165
|
+
Tooltip,
|
|
166
|
+
TooltipContent,
|
|
167
|
+
TooltipProvider,
|
|
168
|
+
TooltipTrigger,
|
|
169
|
+
avatarVariants,
|
|
170
|
+
badgeVariants,
|
|
66
171
|
buttonVariants,
|
|
67
172
|
categorical,
|
|
68
173
|
categoricalOn,
|
|
@@ -70,6 +175,7 @@ export {
|
|
|
70
175
|
chartToken,
|
|
71
176
|
sequential,
|
|
72
177
|
sequentialOn,
|
|
178
|
+
sheetVariants,
|
|
73
179
|
toneFill
|
|
74
180
|
};
|
|
75
181
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Cairn Input. A text field, and nothing more.
|
|
5
|
+
*
|
|
6
|
+
* No Radix here on purpose: an `<input>` has no behaviour to borrow. Wrapping a
|
|
7
|
+
* bare element in a primitive would add a dependency and a layer of indirection
|
|
8
|
+
* for a `className`. Radix earns its place where there is focus management,
|
|
9
|
+
* dismissal or ARIA wiring to get right, not here.
|
|
10
|
+
*
|
|
11
|
+
* `field` radius by role (AGENTS.md rule 7), hairline outline in neutral (rule
|
|
12
|
+
* 7 again: border colour is never a hue), and the placeholder sits on
|
|
13
|
+
* `on-surface-variant` so it reads as absent text rather than as entered text.
|
|
14
|
+
* Height matches `Button` at size `md`, so a field and its action align on a row.
|
|
15
|
+
*
|
|
16
|
+
* Pair it with `Label` — a field whose only label is its placeholder loses that
|
|
17
|
+
* label the moment someone types.
|
|
18
|
+
*/
|
|
19
|
+
type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
|
|
20
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
21
|
+
|
|
22
|
+
export { Input, type InputProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|