skyloom-ui 0.0.0-stage → 0.1.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 (68) hide show
  1. package/README.md +101 -3
  2. package/dist/components/accordion.d.ts +6 -0
  3. package/dist/components/accordion.js +14 -0
  4. package/dist/components/alert.d.ts +6 -0
  5. package/dist/components/alert.js +13 -0
  6. package/dist/components/avatar.d.ts +5 -0
  7. package/dist/components/avatar.js +13 -0
  8. package/dist/components/badge.d.ts +7 -0
  9. package/dist/components/badge.js +15 -0
  10. package/dist/components/breadcrumb.d.ts +7 -0
  11. package/dist/components/breadcrumb.js +8 -0
  12. package/dist/components/button.d.ts +11 -0
  13. package/dist/components/button.js +20 -0
  14. package/dist/components/card.d.ts +7 -0
  15. package/dist/components/card.js +20 -0
  16. package/dist/components/chart.d.ts +69 -0
  17. package/dist/components/chart.js +45 -0
  18. package/dist/components/data-table.d.ts +21 -0
  19. package/dist/components/data-table.js +25 -0
  20. package/dist/components/dialog.d.ts +11 -0
  21. package/dist/components/dialog.js +20 -0
  22. package/dist/components/dropdown-menu.d.ts +9 -0
  23. package/dist/components/dropdown-menu.js +19 -0
  24. package/dist/components/empty-state.d.ts +6 -0
  25. package/dist/components/empty-state.js +4 -0
  26. package/dist/components/fields.d.ts +5 -0
  27. package/dist/components/fields.js +15 -0
  28. package/dist/components/form-field.d.ts +7 -0
  29. package/dist/components/form-field.js +5 -0
  30. package/dist/components/layout.d.ts +4 -0
  31. package/dist/components/layout.js +11 -0
  32. package/dist/components/loading.d.ts +5 -0
  33. package/dist/components/loading.js +8 -0
  34. package/dist/components/multi-select.d.ts +13 -0
  35. package/dist/components/multi-select.js +26 -0
  36. package/dist/components/pagination.d.ts +6 -0
  37. package/dist/components/pagination.js +8 -0
  38. package/dist/components/popover.d.ts +6 -0
  39. package/dist/components/popover.js +10 -0
  40. package/dist/components/progress.d.ts +3 -0
  41. package/dist/components/progress.js +9 -0
  42. package/dist/components/radio-group.d.ts +4 -0
  43. package/dist/components/radio-group.js +10 -0
  44. package/dist/components/select-field.d.ts +14 -0
  45. package/dist/components/select-field.js +7 -0
  46. package/dist/components/select.d.ts +9 -0
  47. package/dist/components/select.js +17 -0
  48. package/dist/components/separator.d.ts +3 -0
  49. package/dist/components/separator.js +7 -0
  50. package/dist/components/sheet.d.ts +10 -0
  51. package/dist/components/sheet.js +12 -0
  52. package/dist/components/slider.d.ts +5 -0
  53. package/dist/components/slider.js +7 -0
  54. package/dist/components/switch.d.ts +3 -0
  55. package/dist/components/switch.js +7 -0
  56. package/dist/components/table.d.ts +9 -0
  57. package/dist/components/table.js +12 -0
  58. package/dist/components/tabs.d.ts +6 -0
  59. package/dist/components/tabs.js +14 -0
  60. package/dist/components/tooltip.d.ts +6 -0
  61. package/dist/components/tooltip.js +10 -0
  62. package/dist/index.d.ts +31 -0
  63. package/dist/index.js +31 -0
  64. package/dist/lib/utils.d.ts +2 -0
  65. package/dist/lib/utils.js +3 -0
  66. package/dist/styles.css +107 -0
  67. package/dist/tokens.css +153 -0
  68. package/package.json +55 -6
package/README.md CHANGED
@@ -1,3 +1,101 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
1
+ # skyloom-ui
2
+
3
+ The frontend's single shared UI package. All controls and compositions live in `src/components`, exported from `skyloom-ui`. There is no separate commoncomponents package or folder. These are locally authored shadcn-style wrappers, with Radix primitives providing interactive accessibility behavior.
4
+
5
+ ```tsx
6
+ import { Button, SelectField, MultiSelect, Card, Dialog, Sheet, ResponsiveGrid } from "skyloom-ui";
7
+ ```
8
+
9
+ ## Theme and tokens
10
+
11
+ The design follows [shadcn semantic CSS variables](https://ui.shadcn.com/docs/theming) and [Tailwind v4 theme aliases](https://tailwindcss.com/docs/theme). Foundation values, semantic roles, and component decisions are separated using CSS references. This uses the aliasing principle described by [DTCG](https://www.designtokens.org/tr/2025.10/format/), without maintaining a duplicate JSON token source.
12
+
13
+ - `src/tokens.css`: OKLCH palette, rem dimensions, typography, spacing, focus/border widths, radii, shadows, layers, opacity, motion, and runtime light/dark and density roles.
14
+ - `src/styles.css`: Tailwind inline mappings, static breakpoint tokens, shared state styles, and reduced-motion rules.
15
+ - Components: semantic utilities such as `bg-card`, `text-muted-foreground`, `p-panel`, `gap-control`, `h-field`, and `rounded-control`.
16
+
17
+ No pixel literals or raw palette colors are used in authored components. Foundation dimensions are defined centrally in rem. Zero, percentage/viewport layout, grid counts, and Radix's computed positioning values remain layout behavior. Generated Tailwind CSS and dependency internals are not authored token definitions.
18
+
19
+ Apply theme and density to the document root so body portals receive the same values:
20
+
21
+ ```tsx
22
+ <html lang="en" data-theme="dark" data-density="comfortable">
23
+ ```
24
+
25
+ Use `light` or `dark`; use `comfortable` (default) or `compact`. Existing `.dark` works too, but explicit `data-theme="light"` takes precedence. Brand overrides belong after the package stylesheet; override the appropriate `--sky-brand-light` and `--sky-brand-dark` foundation values and verify contrast. This package supplies themes, not preference persistence or a system-theme provider.
26
+
27
+ ## Responsive behavior
28
+
29
+ | Screen | Token | Default behavior |
30
+ | --- | --- | --- |
31
+ | Mobile | Base styles | Single-column grid, full-width sheets, stacked dialog actions, touch-size controls |
32
+ | Tablet | `tablet:` / 48rem | Two-column grid, constrained dialogs/sheets, optional compact control density |
33
+ | Laptop | `laptop:` / 64rem | Three-column grid, centered max-width container |
34
+
35
+ Breakpoints are defined once in `@theme`; CSS media queries cannot resolve runtime custom properties. Use Container, Stack, and ResponsiveGrid for shared layouts. Inputs use body-size text on mobile, panels scroll within the dynamic viewport, and tabs scroll when needed. Components allow className overrides for intentional composition.
36
+
37
+ ```tsx
38
+ <Container>
39
+ <ResponsiveGrid>
40
+ <Card><CardHeader><CardTitle>Product</CardTitle></CardHeader></Card>
41
+ </ResponsiveGrid>
42
+ </Container>
43
+ ```
44
+
45
+ ## Components
46
+
47
+ - Forms: Button, Input, Textarea, Label, Checkbox, Select (composable parts), SelectField, FormField, MultiSelect, Switch.
48
+ - Surfaces: Card and parts, Badge, Alert and parts, EmptyState, Separator.
49
+ - Overlays/navigation: Dialog and parts, Sheet and parts, Tabs and parts, Accordion and parts, Tooltip and provider.
50
+ - Loading/layout: Skeleton, Spinner, Container, Stack, ResponsiveGrid.
51
+ - Data: Avatar, Table, DataTable with pagination/search/page sizes, Progress, Breadcrumb, Pagination.
52
+ - Additional overlays: DropdownMenu and Popover.
53
+ - Analytics: ChartContainer, ChartTooltipContent, CartesianChart (line/area/bar), DonutChart, ScatterPlot, Heatmap. Chart height, palettes, and emphasis use theme tokens; exact values are available in HTML data tables.
54
+
55
+ ### Paginated data
56
+
57
+ ```tsx
58
+ import { DataTable, type DataTableColumn } from "skyloom-ui";
59
+
60
+ type Item = { id: string; name: string };
61
+ const columns: DataTableColumn<Item>[] = [
62
+ { id: "name", header: "Name", cell: row => row.name },
63
+ ];
64
+ // Client component: supply the complete dataset, not a single server page.
65
+ <DataTable data={items} columns={columns} getRowId={row => row.id}
66
+ caption="Items" initialPageSize={10} searchText={row => row.name} />;
67
+ ```
68
+
69
+ Pagination follows filtering, and page indices are clamped after data shrinks. `loading` and `error` display distinct states. This version does not claim server pagination, sorting, selection, or virtualization.
70
+
71
+ ### Charts
72
+
73
+ ```tsx
74
+ import { CartesianChart } from "skyloom-ui";
75
+
76
+ <CartesianChart title="Token usage" unit="tokens" kind="area" stacked
77
+ data={[{ label: "Monday", input: 1200, output: 400 }]}
78
+ series={[
79
+ { key: "input", label: "Input", color: "chart-1" },
80
+ { key: "output", label: "Output", color: "chart-2" },
81
+ ]} />;
82
+ ```
83
+
84
+ Use finite numeric values or null for missing observations; keep units consistent within a Cartesian chart. Supply percentages on a 0–100 scale. Charts include labeled series and data-table alternatives; legend buttons toggle Cartesian series. Donut values must be nonnegative. ScatterPlot currently specializes in cost/quality comparisons with a 0–100 quality axis. Aggregation belongs in app features, not sky-ui.
85
+
86
+ MultiSelect supports Select all, mixed state, disabled options, and empty options. Select is single-choice; option values must be unique and nonempty, with an empty current value representing no selection. FormField labels a matching child id; connect child aria-describedby to `<id>-error` and aria-invalid when rendering an error. SelectField does this automatically.
87
+
88
+ Supply DialogTitle/SheetTitle and descriptions in overlays. Label switches and icon-only buttons. Tooltips require TooltipProvider and must not hold essential information available only on hover. Button defaults to type="button"; pass type="submit" explicitly. Button asChild expects one appropriate interactive child, such as a link; native button disabled semantics do not automatically apply to links. Accordion accepts Radix single/multiple modes. Keep business logic out of these wrappers.
89
+
90
+ ## Integration and checks
91
+
92
+ Install workspace dependencies from frontend with `npm install`. Add `skyloom-ui` to the Next.js `transpilePackages` array. In the consuming app's global stylesheet:
93
+
94
+ ```css
95
+ @import "tailwindcss";
96
+ @import "skyloom-ui/styles.css";
97
+ ```
98
+
99
+ The stylesheet registers package sources for Tailwind class scanning. Run `npm run check` from frontend for TypeScript, compiled token/responsive checks, and component interaction tests. The optional Windows Rolldown binding is pinned to the runner's version to work around npm omitting it during install.
100
+
101
+ The skill source is `frontend/skills/sky-ui-tokens/SKILL.md`. Browse `/design-system` or `/design-system/analytics` in the Next.js app. The ecommerce app is still planned. Use the frontend Playwright tests for real viewport verification; jsdom tests do not replace it.
@@ -0,0 +1,6 @@
1
+ import type { ComponentPropsWithRef } from "react";
2
+ import * as Primitive from "@radix-ui/react-accordion";
3
+ export declare const Accordion: import("react").ForwardRefExoticComponent<(Primitive.AccordionSingleProps | Primitive.AccordionMultipleProps) & import("react").RefAttributes<HTMLDivElement>>;
4
+ export declare function AccordionItem({ className, ...props }: ComponentPropsWithRef<typeof Primitive.Item>): import("react").JSX.Element;
5
+ export declare function AccordionTrigger({ className, children, ...props }: ComponentPropsWithRef<typeof Primitive.Trigger>): import("react").JSX.Element;
6
+ export declare function AccordionContent({ className, ...props }: ComponentPropsWithRef<typeof Primitive.Content>): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as Primitive from "@radix-ui/react-accordion";
4
+ import { cn } from "../lib/utils.js";
5
+ export const Accordion = Primitive.Root;
6
+ export function AccordionItem({ className, ...props }) {
7
+ return _jsx(Primitive.Item, { className: cn("sky-border rounded-control border-border", className), ...props });
8
+ }
9
+ export function AccordionTrigger({ className, children, ...props }) {
10
+ return _jsx(Primitive.Header, { children: _jsxs(Primitive.Trigger, { className: cn("sky-focus sky-disabled flex min-h-touch w-full items-center justify-between gap-control rounded-control px-panel py-control text-start text-label font-medium", className), ...props, children: [children, _jsx("span", { "aria-hidden": "true", children: "\u2304" })] }) });
11
+ }
12
+ export function AccordionContent({ className, ...props }) {
13
+ return _jsx(Primitive.Content, { className: cn("px-panel pb-panel text-label leading-body text-muted-foreground", className), ...props });
14
+ }
@@ -0,0 +1,6 @@
1
+ import type { ComponentPropsWithRef } from "react";
2
+ export declare function Alert({ className, variant, role, ...props }: ComponentPropsWithRef<"div"> & {
3
+ variant?: "default" | "destructive" | "success";
4
+ }): import("react").JSX.Element;
5
+ export declare function AlertTitle({ className, ...props }: ComponentPropsWithRef<"h3">): import("react").JSX.Element;
6
+ export declare function AlertDescription({ className, ...props }: ComponentPropsWithRef<"div">): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "../lib/utils.js";
3
+ export function Alert({ className, variant = "default", role = "status", ...props }) {
4
+ return _jsx("div", { role: role, className: cn("sky-border grid gap-control rounded-surface bg-card p-panel", {
5
+ default: "border-border text-card-foreground", destructive: "border-destructive text-destructive", success: "border-success text-success",
6
+ }[variant], className), ...props });
7
+ }
8
+ export function AlertTitle({ className, ...props }) {
9
+ return _jsx("h3", { className: cn("text-label font-semibold", className), ...props });
10
+ }
11
+ export function AlertDescription({ className, ...props }) {
12
+ return _jsx("div", { className: cn("text-label leading-body", className), ...props });
13
+ }
@@ -0,0 +1,5 @@
1
+ import type { ComponentPropsWithRef } from "react";
2
+ import * as Primitive from "@radix-ui/react-avatar";
3
+ export declare function Avatar({ className, ...props }: ComponentPropsWithRef<typeof Primitive.Root>): import("react").JSX.Element;
4
+ export declare function AvatarImage({ className, ...props }: ComponentPropsWithRef<typeof Primitive.Image>): import("react").JSX.Element;
5
+ export declare function AvatarFallback({ className, ...props }: ComponentPropsWithRef<typeof Primitive.Fallback>): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import * as Primitive from "@radix-ui/react-avatar";
4
+ import { cn } from "../lib/utils.js";
5
+ export function Avatar({ className, ...props }) {
6
+ return _jsx(Primitive.Root, { className: cn("relative flex size-field shrink-0 overflow-hidden rounded-full", className), ...props });
7
+ }
8
+ export function AvatarImage({ className, ...props }) {
9
+ return _jsx(Primitive.Image, { className: cn("aspect-square size-full object-cover", className), ...props });
10
+ }
11
+ export function AvatarFallback({ className, ...props }) {
12
+ return _jsx(Primitive.Fallback, { className: cn("flex size-full items-center justify-center rounded-full bg-secondary text-label font-medium text-secondary-foreground", className), ...props });
13
+ }
@@ -0,0 +1,7 @@
1
+ import type { ComponentPropsWithRef } from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const variants: (props?: ({
4
+ variant?: "default" | "secondary" | "outline" | "destructive" | "success" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ export declare function Badge({ className, variant, ...props }: ComponentPropsWithRef<"span"> & VariantProps<typeof variants>): import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cva } from "class-variance-authority";
3
+ import { cn } from "../lib/utils.js";
4
+ const variants = cva("inline-flex items-center gap-control rounded-control px-inline py-control text-caption font-medium", {
5
+ variants: { variant: {
6
+ default: "bg-primary text-primary-foreground",
7
+ secondary: "bg-secondary text-secondary-foreground",
8
+ destructive: "bg-destructive text-destructive-foreground",
9
+ success: "bg-success text-success-foreground",
10
+ outline: "sky-border border-border text-foreground",
11
+ } }, defaultVariants: { variant: "default" },
12
+ });
13
+ export function Badge({ className, variant, ...props }) {
14
+ return _jsx("span", { className: cn(variants({ variant }), className), ...props });
15
+ }
@@ -0,0 +1,7 @@
1
+ import type { ComponentPropsWithRef } from "react";
2
+ export declare function Breadcrumb(props: ComponentPropsWithRef<"nav">): import("react").JSX.Element;
3
+ export declare function BreadcrumbList({ className, ...props }: ComponentPropsWithRef<"ol">): import("react").JSX.Element;
4
+ export declare function BreadcrumbItem({ className, ...props }: ComponentPropsWithRef<"li">): import("react").JSX.Element;
5
+ export declare function BreadcrumbLink({ className, ...props }: ComponentPropsWithRef<"a">): import("react").JSX.Element;
6
+ export declare function BreadcrumbPage({ className, ...props }: ComponentPropsWithRef<"span">): import("react").JSX.Element;
7
+ export declare function BreadcrumbSeparator({ children, ...props }: ComponentPropsWithRef<"li">): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "../lib/utils.js";
3
+ export function Breadcrumb(props) { return _jsx("nav", { "aria-label": "Breadcrumb", ...props }); }
4
+ export function BreadcrumbList({ className, ...props }) { return _jsx("ol", { className: cn("flex flex-wrap items-center gap-control text-label text-muted-foreground", className), ...props }); }
5
+ export function BreadcrumbItem({ className, ...props }) { return _jsx("li", { className: cn("inline-flex items-center gap-control", className), ...props }); }
6
+ export function BreadcrumbLink({ className, ...props }) { return _jsx("a", { className: cn("sky-focus inline-flex min-h-touch items-center hover:text-foreground", className), ...props }); }
7
+ export function BreadcrumbPage({ className, ...props }) { return _jsx("span", { "aria-current": "page", className: cn("text-foreground", className), ...props }); }
8
+ export function BreadcrumbSeparator({ children = "/", ...props }) { return _jsx("li", { "aria-hidden": "true", role: "presentation", ...props, children: children }); }
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "default" | "secondary" | "outline" | "ghost" | "destructive" | "link" | null | undefined;
5
+ size?: "default" | "sm" | "lg" | "icon" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ export type ButtonProps = React.ComponentPropsWithRef<"button"> & VariantProps<typeof buttonVariants> & {
8
+ asChild?: boolean;
9
+ };
10
+ export declare function Button({ className, variant, size, asChild, type, ...props }: ButtonProps): React.JSX.Element;
11
+ export {};
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Slot } from "@radix-ui/react-slot";
4
+ import { cva } from "class-variance-authority";
5
+ import { cn } from "../lib/utils.js";
6
+ const buttonVariants = cva("inline-flex items-center justify-center gap-control rounded-control text-label font-medium sky-transition sky-focus disabled:pointer-events-none sky-disabled", { variants: {
7
+ variant: {
8
+ default: "bg-primary text-primary-foreground sky-hover",
9
+ secondary: "bg-secondary text-secondary-foreground sky-hover",
10
+ outline: "sky-border border-input bg-background hover:bg-secondary",
11
+ ghost: "hover:bg-secondary",
12
+ destructive: "bg-destructive text-destructive-foreground sky-hover",
13
+ link: "sky-link text-primary hover:underline",
14
+ },
15
+ size: { default: "h-field min-h-touch tablet:min-h-field px-panel", sm: "h-field-sm min-h-touch tablet:min-h-field-sm px-inline", lg: "h-field-lg px-panel", icon: "size-field min-h-touch min-w-touch" },
16
+ }, defaultVariants: { variant: "default", size: "default" } });
17
+ export function Button({ className, variant, size, asChild = false, type, ...props }) {
18
+ const Component = asChild ? Slot : "button";
19
+ return _jsx(Component, { type: asChild ? type : (type ?? "button"), className: cn(buttonVariants({ variant, size }), className), ...props });
20
+ }
@@ -0,0 +1,7 @@
1
+ import type { ComponentPropsWithRef } from "react";
2
+ export declare function Card({ className, ...props }: ComponentPropsWithRef<"div">): import("react").JSX.Element;
3
+ export declare function CardHeader({ className, ...props }: ComponentPropsWithRef<"div">): import("react").JSX.Element;
4
+ export declare function CardTitle({ className, ...props }: ComponentPropsWithRef<"h2">): import("react").JSX.Element;
5
+ export declare function CardDescription({ className, ...props }: ComponentPropsWithRef<"p">): import("react").JSX.Element;
6
+ export declare function CardContent({ className, ...props }: ComponentPropsWithRef<"div">): import("react").JSX.Element;
7
+ export declare function CardFooter({ className, ...props }: ComponentPropsWithRef<"div">): import("react").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "../lib/utils.js";
3
+ export function Card({ className, ...props }) {
4
+ return _jsx("div", { className: cn("sky-border min-w-0 rounded-surface border-border bg-card text-card-foreground shadow-raised", className), ...props });
5
+ }
6
+ export function CardHeader({ className, ...props }) {
7
+ return _jsx("div", { className: cn("grid gap-control p-panel", className), ...props });
8
+ }
9
+ export function CardTitle({ className, ...props }) {
10
+ return _jsx("h2", { className: cn("text-title font-semibold leading-title wrap-break-word", className), ...props });
11
+ }
12
+ export function CardDescription({ className, ...props }) {
13
+ return _jsx("p", { className: cn("text-label leading-body text-muted-foreground", className), ...props });
14
+ }
15
+ export function CardContent({ className, ...props }) {
16
+ return _jsx("div", { className: cn("p-panel pt-0", className), ...props });
17
+ }
18
+ export function CardFooter({ className, ...props }) {
19
+ return _jsx("div", { className: cn("flex flex-col gap-control p-panel pt-0 tablet:flex-row tablet:items-center", className), ...props });
20
+ }
@@ -0,0 +1,69 @@
1
+ import { type ReactElement, type ReactNode } from "react";
2
+ export type ChartColor = "chart-1" | "chart-2" | "chart-3" | "chart-4" | "chart-5";
3
+ export type ChartSeries = {
4
+ key: string;
5
+ label: string;
6
+ color: ChartColor;
7
+ };
8
+ export type ChartDatum = {
9
+ label: string;
10
+ } & Record<string, string | number | null>;
11
+ export declare function ChartContainer({ children, className, label }: {
12
+ children: ReactElement;
13
+ className?: string;
14
+ label: string;
15
+ }): import("react").JSX.Element;
16
+ type TooltipEntry = {
17
+ name?: string | number;
18
+ value?: string | number | (string | number)[];
19
+ color?: string;
20
+ };
21
+ export declare function ChartTooltipContent({ active, payload, label, formatValue }: {
22
+ active?: boolean;
23
+ payload?: readonly TooltipEntry[];
24
+ label?: ReactNode;
25
+ formatValue?: (value: number) => string;
26
+ }): import("react").JSX.Element | null;
27
+ export type CartesianChartProps = {
28
+ title: string;
29
+ description?: string;
30
+ data: ChartDatum[];
31
+ series: ChartSeries[];
32
+ kind?: "line" | "area" | "bar";
33
+ stacked?: boolean;
34
+ unit: string;
35
+ domain?: [number, number];
36
+ formatValue?: (value: number) => string;
37
+ };
38
+ export declare function CartesianChart({ title, description, data, series, kind, stacked, unit, domain, formatValue }: CartesianChartProps): import("react").JSX.Element;
39
+ export declare function DonutChart({ title, description, data, unit }: {
40
+ title: string;
41
+ description?: string;
42
+ unit: string;
43
+ data: {
44
+ label: string;
45
+ value: number;
46
+ color: ChartColor;
47
+ }[];
48
+ }): import("react").JSX.Element;
49
+ export declare function ScatterPlot({ title, description, data, xLabel, yLabel }: {
50
+ title: string;
51
+ description?: string;
52
+ data: {
53
+ label: string;
54
+ x: number;
55
+ y: number;
56
+ }[];
57
+ xLabel: string;
58
+ yLabel: string;
59
+ }): import("react").JSX.Element;
60
+ export declare function Heatmap({ title, description, columns, rows }: {
61
+ title: string;
62
+ description?: string;
63
+ columns: string[];
64
+ rows: {
65
+ label: string;
66
+ values: (number | null)[];
67
+ }[];
68
+ }): import("react").JSX.Element;
69
+ export {};
@@ -0,0 +1,45 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useId, useState } from "react";
4
+ import { Area, AreaChart, Bar, BarChart, CartesianGrid, Cell, Line, LineChart, Pie, PieChart, ResponsiveContainer, Scatter, ScatterChart, Tooltip, XAxis, YAxis } from "recharts";
5
+ import { cn } from "../lib/utils.js";
6
+ import { Table, TableHeader, TableBody, TableRow, TableHead, TableCell, TableCaption } from "./table.js";
7
+ import { Button } from "./button.js";
8
+ const numberFormat = (value) => new Intl.NumberFormat("en", { maximumFractionDigits: 2 }).format(value);
9
+ export function ChartContainer({ children, className, label }) {
10
+ return _jsx("div", { "aria-label": label, className: cn("sky-chart h-chart min-w-0 w-full text-caption", className), children: _jsx(ResponsiveContainer, { width: "100%", height: "100%", minWidth: 0, children: children }) });
11
+ }
12
+ export function ChartTooltipContent({ active, payload, label, formatValue = numberFormat }) {
13
+ if (!active || !payload?.length)
14
+ return null;
15
+ return _jsxs("div", { className: "sky-border grid gap-control rounded-control border-border bg-popover p-inline text-caption text-popover-foreground shadow-raised", children: [_jsx("p", { className: "font-medium", children: label }), payload.map((entry, index) => _jsxs("div", { className: "flex items-center justify-between gap-panel", children: [_jsx("span", { children: entry.name }), _jsx("strong", { children: typeof entry.value === "number" ? formatValue(entry.value) : String(entry.value ?? "No data") })] }, `${entry.name}-${index}`))] });
16
+ }
17
+ function ChartFrame({ title, description, children, rows, columns }) {
18
+ const id = useId();
19
+ return _jsxs("figure", { "aria-labelledby": id, className: "grid min-w-0 gap-stack", children: [_jsxs("figcaption", { children: [_jsx("h3", { id: id, className: "text-body font-semibold", children: title }), description && _jsx("p", { className: "mt-control text-caption leading-body text-muted-foreground", children: description })] }), rows.length ? children : _jsx("p", { role: "status", className: "p-panel text-label text-muted-foreground", children: "No data for this selection." }), !!rows.length && _jsxs("details", { children: [_jsx("summary", { className: "sky-focus w-fit cursor-pointer rounded-control py-control text-caption text-muted-foreground", children: "View data table" }), _jsxs(Table, { children: [_jsxs(TableCaption, { children: [title, " values"] }), _jsx(TableHeader, { children: _jsx(TableRow, { children: columns.map((label, i) => _jsx(TableHead, { children: label }, i)) }) }), _jsx(TableBody, { children: rows.map((row, i) => _jsx(TableRow, { children: row.map((value, j) => _jsx(TableCell, { children: value ?? "No data" }, j)) }, i)) })] })] })] });
20
+ }
21
+ export function CartesianChart({ title, description, data, series, kind = "line", stacked = false, unit, domain, formatValue = numberFormat }) {
22
+ const [hidden, setHidden] = useState([]);
23
+ const visible = series.filter(item => !hidden.includes(item.key));
24
+ const axis = _jsxs(_Fragment, { children: [_jsx(CartesianGrid, { vertical: false, stroke: "var(--border)" }), _jsx(XAxis, { dataKey: "label", tickLine: false, axisLine: false, tick: { fill: "var(--muted-foreground)" } }), _jsx(YAxis, { width: "auto", domain: domain ?? [0, "auto"], tickLine: false, axisLine: false, tickFormatter: formatValue, tick: { fill: "var(--muted-foreground)" } }), _jsx(Tooltip, { content: _jsx(ChartTooltipContent, { formatValue: value => `${formatValue(value)} ${unit}` }) })] });
25
+ const marks = visible.map(item => {
26
+ const shared = { dataKey: item.key, name: item.label, stroke: `var(--${item.color})`, fill: `var(--${item.color})`, isAnimationActive: false };
27
+ if (kind === "bar")
28
+ return _jsx(Bar, { ...shared, stackId: stacked ? "total" : undefined }, item.key);
29
+ if (kind === "area")
30
+ return _jsx(Area, { ...shared, type: "linear", stackId: stacked ? "total" : undefined, className: "sky-chart-area", connectNulls: false }, item.key);
31
+ return _jsx(Line, { ...shared, type: "linear", dot: false, connectNulls: false, className: "sky-chart-line" }, item.key);
32
+ });
33
+ const Chart = kind === "line" ? LineChart : kind === "area" ? AreaChart : BarChart;
34
+ return _jsxs(ChartFrame, { title: title, description: description, columns: ["Period / category", ...series.map(item => `${item.label} (${unit})`)], rows: data.map(row => [row.label, ...series.map(item => row[item.key] == null ? null : formatValue(Number(row[item.key])))]), children: [_jsx("p", { className: "text-caption text-muted-foreground", children: unit }), _jsx(ChartContainer, { label: `${title}, ${unit}`, children: _jsxs(Chart, { data: data, accessibilityLayer: true, children: [axis, marks] }) }), _jsx("div", { className: "flex flex-wrap gap-control", "aria-label": `${title} series`, children: series.map(item => _jsxs(Button, { size: "sm", variant: "ghost", "aria-pressed": !hidden.includes(item.key), disabled: visible.length === 1 && visible[0].key === item.key, onClick: () => setHidden(current => current.includes(item.key) ? current.filter(key => key !== item.key) : [...current, item.key]), children: [_jsx("span", { className: "size-control rounded-full", style: { background: `var(--${item.color})` } }), item.label] }, item.key)) })] });
35
+ }
36
+ export function DonutChart({ title, description, data, unit }) {
37
+ const total = data.reduce((sum, item) => sum + Math.max(0, item.value), 0);
38
+ return _jsxs(ChartFrame, { title: title, description: description, columns: ["Category", unit], rows: data.map(item => [item.label, item.value]), children: [total > 0 ? _jsx(ChartContainer, { label: title, children: _jsxs(PieChart, { accessibilityLayer: true, children: [_jsx(Pie, { data: data, dataKey: "value", nameKey: "label", innerRadius: "55%", outerRadius: "80%", isAnimationActive: false, stroke: "var(--background)", children: data.map(item => _jsx(Cell, { fill: `var(--${item.color})` }, item.label)) }), _jsx(Tooltip, { content: _jsx(ChartTooltipContent, { formatValue: value => `${numberFormat(value)} ${unit}` }) })] }) }) : _jsx("p", { role: "status", className: "p-panel text-label", children: "No nonzero values to display." }), _jsx("ul", { className: "grid gap-control text-caption", children: data.map(item => _jsxs("li", { className: "flex items-center gap-control", children: [_jsx("span", { className: "size-control rounded-full", style: { background: `var(--${item.color})` } }), item.label, _jsxs("strong", { className: "ms-auto", children: [numberFormat(item.value), " ", unit] })] }, item.label)) })] });
39
+ }
40
+ export function ScatterPlot({ title, description, data, xLabel, yLabel }) {
41
+ return _jsxs(ChartFrame, { title: title, description: description, columns: ["Configuration", xLabel, yLabel], rows: data.map(item => [item.label, item.x, item.y]), children: [_jsxs("p", { className: "text-caption text-muted-foreground", children: ["X: ", xLabel, " \u00B7 Y: ", yLabel] }), _jsx(ChartContainer, { label: title, children: _jsxs(ScatterChart, { accessibilityLayer: true, children: [_jsx(CartesianGrid, { stroke: "var(--border)" }), _jsx(XAxis, { type: "number", dataKey: "x", name: xLabel, domain: [0, "auto"], tickLine: false, axisLine: false }), _jsx(YAxis, { type: "number", dataKey: "y", name: yLabel, width: "auto", domain: [0, 100], tickLine: false, axisLine: false }), _jsx(Tooltip, { cursor: false, content: _jsx(ChartTooltipContent, {}) }), _jsx(Scatter, { name: "Configuration", data: data, fill: "var(--chart-2)", isAnimationActive: false })] }) })] });
42
+ }
43
+ export function Heatmap({ title, description, columns, rows }) {
44
+ return _jsxs("figure", { className: "grid gap-stack", children: [_jsxs("figcaption", { children: [_jsx("h3", { className: "font-semibold", children: title }), _jsx("p", { className: "mt-control text-caption text-muted-foreground", children: description })] }), _jsxs(Table, { children: [_jsx(TableCaption, { children: "Score 0\u2013100; higher is better. Missing values are not scored." }), _jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: "Configuration" }), columns.map(column => _jsx(TableHead, { children: column }, column))] }) }), _jsx(TableBody, { children: rows.length ? rows.map(row => _jsxs(TableRow, { children: [_jsx(TableHead, { scope: "row", children: row.label }), columns.map((column, index) => { const value = row.values[index] ?? null; return _jsx(TableCell, { children: _jsx("span", { className: "sky-heat-cell block rounded-control p-control text-center font-medium", style: { "--heat-weight": `${value == null ? 0 : Math.min(100, Math.max(0, value))}%` }, children: value == null ? "No data" : `${value}%` }) }, column); })] }, row.label)) : _jsx(TableRow, { children: _jsx(TableCell, { colSpan: columns.length + 1, children: "No data for this selection." }) }) })] })] });
45
+ }
@@ -0,0 +1,21 @@
1
+ import { type ReactNode } from "react";
2
+ import { type RowData } from "@tanstack/react-table";
3
+ export type DataTableColumn<T> = {
4
+ id: string;
5
+ header: string;
6
+ cell: (row: T) => ReactNode;
7
+ };
8
+ export type DataTableProps<T extends RowData> = {
9
+ data: T[];
10
+ columns: DataTableColumn<T>[];
11
+ getRowId: (row: T) => string;
12
+ caption: string;
13
+ initialPageSize?: number;
14
+ pageSizeOptions?: number[];
15
+ searchText?: (row: T) => string;
16
+ searchLabel?: string;
17
+ loading?: boolean;
18
+ error?: string;
19
+ };
20
+ /** Client pagination: pass the complete dataset. Filter before paginating. */
21
+ export declare function DataTable<T extends RowData>({ data, columns, getRowId, caption, initialPageSize, pageSizeOptions, searchText, searchLabel, loading, error }: DataTableProps<T>): import("react").JSX.Element;
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useId, useMemo, useState } from "react";
4
+ import { createPaginatedRowModel, rowPaginationFeature, tableFeatures, useTable } from "@tanstack/react-table";
5
+ import { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow } from "./table.js";
6
+ import { Pagination } from "./pagination.js";
7
+ import { Input, Label } from "./fields.js";
8
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./select.js";
9
+ const features = tableFeatures({ rowPaginationFeature, paginatedRowModel: createPaginatedRowModel() });
10
+ /** Client pagination: pass the complete dataset. Filter before paginating. */
11
+ export function DataTable({ data, columns, getRowId, caption, initialPageSize = 10, pageSizeOptions = [5, 10, 25, 50], searchText, searchLabel = "Search rows", loading = false, error }) {
12
+ const id = useId();
13
+ const [query, setQuery] = useState("");
14
+ const [pagination, setPagination] = useState({ pageIndex: 0, pageSize: Number.isInteger(initialPageSize) && initialPageSize > 0 ? initialPageSize : 10 });
15
+ const filtered = useMemo(() => searchText ? data.filter(row => searchText(row).toLowerCase().includes(query.trim().toLowerCase())) : data, [data, query, searchText]);
16
+ const pageCount = Math.max(1, Math.ceil(filtered.length / pagination.pageSize));
17
+ const safePagination = { ...pagination, pageIndex: Math.min(pagination.pageIndex, pageCount - 1) };
18
+ const definitions = useMemo(() => columns.map(column => ({ id: column.id, header: column.header, cell: ({ row }) => column.cell(row.original) })), [columns]);
19
+ const table = useTable({ features, data: filtered, columns: definitions, getRowId, state: { pagination: safePagination }, onPaginationChange: setPagination, autoResetPageIndex: false });
20
+ const options = [...new Set([...pageSizeOptions, pagination.pageSize])].filter(size => Number.isInteger(size) && size > 0).sort((a, b) => a - b);
21
+ const unavailable = loading || !!error;
22
+ const start = filtered.length ? safePagination.pageIndex * pagination.pageSize + 1 : 0;
23
+ const end = Math.min((safePagination.pageIndex + 1) * pagination.pageSize, filtered.length);
24
+ return _jsxs("div", { className: "grid min-w-0 gap-stack", "aria-busy": loading, children: [_jsxs("div", { className: "flex flex-col gap-stack tablet:flex-row tablet:items-end tablet:justify-between", children: [searchText && _jsxs("div", { className: "grid w-full gap-control tablet:max-w-preview-wide", children: [_jsx(Label, { htmlFor: `${id}-search`, children: searchLabel }), _jsx(Input, { id: `${id}-search`, value: query, disabled: unavailable, placeholder: "Filter results\u2026", onChange: event => { setQuery(event.target.value); setPagination(current => ({ ...current, pageIndex: 0 })); } })] }), _jsxs("div", { className: "grid gap-control", children: [_jsx(Label, { htmlFor: `${id}-size`, children: "Rows per page" }), _jsxs(Select, { value: String(pagination.pageSize), disabled: unavailable, onValueChange: value => setPagination({ pageIndex: 0, pageSize: Number(value) }), children: [_jsx(SelectTrigger, { id: `${id}-size`, className: "w-auto", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: options.map(size => _jsx(SelectItem, { value: String(size), children: size }, size)) })] })] })] }), _jsx("div", { className: "sky-border min-w-0 overflow-hidden rounded-surface border-border", children: _jsxs(Table, { children: [_jsx(TableCaption, { children: caption }), _jsx(TableHeader, { children: table.getHeaderGroups().map(group => _jsx(TableRow, { children: group.headers.map(header => _jsx(TableHead, { children: _jsx(table.FlexRender, { header: header }) }, header.id)) }, group.id)) }), _jsx(TableBody, { children: unavailable || !filtered.length ? _jsx(TableRow, { children: _jsx(TableCell, { colSpan: Math.max(1, columns.length), className: "p-panel text-center", children: _jsx("span", { role: error ? "alert" : "status", children: loading ? "Loading rows…" : error ?? "No matching rows." }) }) }) : table.getRowModel().rows.map(row => _jsx(TableRow, { children: row.getAllCells().map(cell => _jsx(TableCell, { children: _jsx(table.FlexRender, { cell: cell }) }, cell.id)) }, row.id)) })] }) }), !unavailable && _jsxs(_Fragment, { children: [_jsxs("p", { role: "status", className: "text-caption text-muted-foreground", children: ["Showing ", start, "\u2013", end, " of ", filtered.length, " rows"] }), _jsx(Pagination, { page: safePagination.pageIndex + 1, pageCount: pageCount, onPageChange: page => setPagination(current => ({ ...current, pageIndex: page - 1 })), label: `${caption} pagination` })] })] });
25
+ }
@@ -0,0 +1,11 @@
1
+ import type { ComponentPropsWithRef } from "react";
2
+ import * as Primitive from "@radix-ui/react-dialog";
3
+ export declare const Dialog: import("react").FC<Primitive.DialogProps>;
4
+ export declare const DialogTrigger: import("react").ForwardRefExoticComponent<Primitive.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
5
+ export declare const DialogClose: import("react").ForwardRefExoticComponent<Primitive.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
6
+ export declare function DialogContent({ children, className, closeLabel, ...props }: ComponentPropsWithRef<typeof Primitive.Content> & {
7
+ closeLabel?: string;
8
+ }): import("react").JSX.Element;
9
+ export declare function DialogTitle({ className, ...props }: ComponentPropsWithRef<typeof Primitive.Title>): import("react").JSX.Element;
10
+ export declare function DialogDescription({ className, ...props }: ComponentPropsWithRef<typeof Primitive.Description>): import("react").JSX.Element;
11
+ export declare function DialogFooter({ className, ...props }: ComponentPropsWithRef<"div">): import("react").JSX.Element;
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as Primitive from "@radix-ui/react-dialog";
4
+ import { Button } from "./button.js";
5
+ import { cn } from "../lib/utils.js";
6
+ export const Dialog = Primitive.Root;
7
+ export const DialogTrigger = Primitive.Trigger;
8
+ export const DialogClose = Primitive.Close;
9
+ export function DialogContent({ children, className, closeLabel = "Close dialog", ...props }) {
10
+ return _jsxs(Primitive.Portal, { children: [_jsx(Primitive.Overlay, { className: "sky-overlay fixed inset-0 bg-overlay" }), _jsxs(Primitive.Content, { className: cn("sky-modal sky-modal-fit sky-border fixed start-1/2 top-1/2 grid -translate-x-1/2 -translate-y-1/2 gap-stack overflow-y-auto rounded-modal border-border bg-popover p-panel text-popover-foreground shadow-floating tablet:max-w-dialog", className), ...props, children: [_jsx(Primitive.Close, { asChild: true, children: _jsx(Button, { variant: "ghost", className: "justify-self-end", "aria-label": closeLabel, children: closeLabel }) }), children] })] });
11
+ }
12
+ export function DialogTitle({ className, ...props }) {
13
+ return _jsx(Primitive.Title, { className: cn("text-title font-semibold leading-title", className), ...props });
14
+ }
15
+ export function DialogDescription({ className, ...props }) {
16
+ return _jsx(Primitive.Description, { className: cn("text-label leading-body text-muted-foreground", className), ...props });
17
+ }
18
+ export function DialogFooter({ className, ...props }) {
19
+ return _jsx("div", { className: cn("flex flex-col gap-control tablet:flex-row tablet:justify-end", className), ...props });
20
+ }
@@ -0,0 +1,9 @@
1
+ import type { ComponentPropsWithRef } from "react";
2
+ import * as Primitive from "@radix-ui/react-dropdown-menu";
3
+ export declare const DropdownMenu: import("react").FC<Primitive.DropdownMenuProps>;
4
+ export declare const DropdownMenuTrigger: import("react").ForwardRefExoticComponent<Primitive.DropdownMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
5
+ export declare const DropdownMenuGroup: import("react").ForwardRefExoticComponent<Primitive.DropdownMenuGroupProps & import("react").RefAttributes<HTMLDivElement>>;
6
+ export declare function DropdownMenuContent({ className, ...props }: ComponentPropsWithRef<typeof Primitive.Content>): import("react").JSX.Element;
7
+ export declare function DropdownMenuItem({ className, ...props }: ComponentPropsWithRef<typeof Primitive.Item>): import("react").JSX.Element;
8
+ export declare function DropdownMenuLabel({ className, ...props }: ComponentPropsWithRef<typeof Primitive.Label>): import("react").JSX.Element;
9
+ export declare function DropdownMenuSeparator({ className, ...props }: ComponentPropsWithRef<typeof Primitive.Separator>): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import * as Primitive from "@radix-ui/react-dropdown-menu";
4
+ import { cn } from "../lib/utils.js";
5
+ export const DropdownMenu = Primitive.Root;
6
+ export const DropdownMenuTrigger = Primitive.Trigger;
7
+ export const DropdownMenuGroup = Primitive.Group;
8
+ export function DropdownMenuContent({ className, ...props }) {
9
+ return _jsx(Primitive.Portal, { children: _jsx(Primitive.Content, { className: cn("sky-popover sky-border min-w-preview overflow-y-auto rounded-surface border-border bg-popover p-control text-popover-foreground shadow-floating", className), ...props }) });
10
+ }
11
+ export function DropdownMenuItem({ className, ...props }) {
12
+ return _jsx(Primitive.Item, { className: cn("sky-disabled flex min-h-touch cursor-default items-center gap-control rounded-control px-inline py-control text-label outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none tablet:min-h-field", className), ...props });
13
+ }
14
+ export function DropdownMenuLabel({ className, ...props }) {
15
+ return _jsx(Primitive.Label, { className: cn("px-inline py-control text-caption font-semibold text-muted-foreground", className), ...props });
16
+ }
17
+ export function DropdownMenuSeparator({ className, ...props }) {
18
+ return _jsx(Primitive.Separator, { className: cn("my-control h-hairline bg-border", className), ...props });
19
+ }
@@ -0,0 +1,6 @@
1
+ import type { ReactNode } from "react";
2
+ export declare function EmptyState({ title, description, action }: {
3
+ title: string;
4
+ description?: string;
5
+ action?: ReactNode;
6
+ }): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function EmptyState({ title, description, action }) {
3
+ return _jsxs("div", { className: "grid justify-items-center gap-stack p-page-wide text-center", children: [_jsx("h2", { className: "text-title font-semibold", children: title }), description && _jsx("p", { className: "text-label", children: description }), action] });
4
+ }
@@ -0,0 +1,5 @@
1
+ import type { ComponentPropsWithRef } from "react";
2
+ export declare function Input({ className, ...props }: ComponentPropsWithRef<"input">): import("react").JSX.Element;
3
+ export declare function Textarea({ className, ...props }: ComponentPropsWithRef<"textarea">): import("react").JSX.Element;
4
+ export declare function Label({ className, ...props }: ComponentPropsWithRef<"label">): import("react").JSX.Element;
5
+ export declare function Checkbox({ className, ...props }: Omit<ComponentPropsWithRef<"input">, "type">): import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "../lib/utils.js";
3
+ const fieldClass = "w-full min-w-0 rounded-control sky-border border-input bg-background px-inline py-control text-body tablet:text-label sky-focus disabled:cursor-not-allowed sky-disabled aria-invalid:border-destructive";
4
+ export function Input({ className, ...props }) {
5
+ return _jsx("input", { className: cn(fieldClass, "h-field min-h-touch tablet:min-h-field", className), ...props });
6
+ }
7
+ export function Textarea({ className, ...props }) {
8
+ return _jsx("textarea", { className: cn(fieldClass, "min-h-textarea", className), ...props });
9
+ }
10
+ export function Label({ className, ...props }) {
11
+ return _jsx("label", { className: cn("text-label font-medium", className), ...props });
12
+ }
13
+ export function Checkbox({ className, ...props }) {
14
+ return _jsx("input", { type: "checkbox", className: cn("size-choice accent-primary sky-focus sky-disabled", className), ...props });
15
+ }
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from "react";
2
+ export declare function FormField({ id, label, error, children }: {
3
+ id: string;
4
+ label: string;
5
+ error?: string;
6
+ children: ReactNode;
7
+ }): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Label } from "./fields.js";
3
+ export function FormField({ id, label, error, children }) {
4
+ return _jsxs("div", { className: "grid gap-control", children: [_jsx(Label, { htmlFor: id, children: label }), children, error && _jsx("p", { id: `${id}-error`, role: "alert", className: "text-label text-destructive", children: error })] });
5
+ }
@@ -0,0 +1,4 @@
1
+ import type { ComponentPropsWithRef } from "react";
2
+ export declare function Container({ className, ...props }: ComponentPropsWithRef<"div">): import("react").JSX.Element;
3
+ export declare function Stack({ className, ...props }: ComponentPropsWithRef<"div">): import("react").JSX.Element;
4
+ export declare function ResponsiveGrid({ className, ...props }: ComponentPropsWithRef<"div">): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "../lib/utils.js";
3
+ export function Container({ className, ...props }) {
4
+ return _jsx("div", { className: cn("mx-auto w-full min-w-0 max-w-container px-page tablet:px-page-wide", className), ...props });
5
+ }
6
+ export function Stack({ className, ...props }) {
7
+ return _jsx("div", { className: cn("flex min-w-0 flex-col gap-stack", className), ...props });
8
+ }
9
+ export function ResponsiveGrid({ className, ...props }) {
10
+ return _jsx("div", { className: cn("grid min-w-0 grid-cols-1 gap-panel tablet:grid-cols-2 laptop:grid-cols-3 [&>*]:min-w-0", className), ...props });
11
+ }