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.
- package/README.md +101 -3
- package/dist/components/accordion.d.ts +6 -0
- package/dist/components/accordion.js +14 -0
- package/dist/components/alert.d.ts +6 -0
- package/dist/components/alert.js +13 -0
- package/dist/components/avatar.d.ts +5 -0
- package/dist/components/avatar.js +13 -0
- package/dist/components/badge.d.ts +7 -0
- package/dist/components/badge.js +15 -0
- package/dist/components/breadcrumb.d.ts +7 -0
- package/dist/components/breadcrumb.js +8 -0
- package/dist/components/button.d.ts +11 -0
- package/dist/components/button.js +20 -0
- package/dist/components/card.d.ts +7 -0
- package/dist/components/card.js +20 -0
- package/dist/components/chart.d.ts +69 -0
- package/dist/components/chart.js +45 -0
- package/dist/components/data-table.d.ts +21 -0
- package/dist/components/data-table.js +25 -0
- package/dist/components/dialog.d.ts +11 -0
- package/dist/components/dialog.js +20 -0
- package/dist/components/dropdown-menu.d.ts +9 -0
- package/dist/components/dropdown-menu.js +19 -0
- package/dist/components/empty-state.d.ts +6 -0
- package/dist/components/empty-state.js +4 -0
- package/dist/components/fields.d.ts +5 -0
- package/dist/components/fields.js +15 -0
- package/dist/components/form-field.d.ts +7 -0
- package/dist/components/form-field.js +5 -0
- package/dist/components/layout.d.ts +4 -0
- package/dist/components/layout.js +11 -0
- package/dist/components/loading.d.ts +5 -0
- package/dist/components/loading.js +8 -0
- package/dist/components/multi-select.d.ts +13 -0
- package/dist/components/multi-select.js +26 -0
- package/dist/components/pagination.d.ts +6 -0
- package/dist/components/pagination.js +8 -0
- package/dist/components/popover.d.ts +6 -0
- package/dist/components/popover.js +10 -0
- package/dist/components/progress.d.ts +3 -0
- package/dist/components/progress.js +9 -0
- package/dist/components/radio-group.d.ts +4 -0
- package/dist/components/radio-group.js +10 -0
- package/dist/components/select-field.d.ts +14 -0
- package/dist/components/select-field.js +7 -0
- package/dist/components/select.d.ts +9 -0
- package/dist/components/select.js +17 -0
- package/dist/components/separator.d.ts +3 -0
- package/dist/components/separator.js +7 -0
- package/dist/components/sheet.d.ts +10 -0
- package/dist/components/sheet.js +12 -0
- package/dist/components/slider.d.ts +5 -0
- package/dist/components/slider.js +7 -0
- package/dist/components/switch.d.ts +3 -0
- package/dist/components/switch.js +7 -0
- package/dist/components/table.d.ts +9 -0
- package/dist/components/table.js +12 -0
- package/dist/components/tabs.d.ts +6 -0
- package/dist/components/tabs.js +14 -0
- package/dist/components/tooltip.d.ts +6 -0
- package/dist/components/tooltip.js +10 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +31 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +3 -0
- package/dist/styles.css +107 -0
- package/dist/tokens.css +153 -0
- package/package.json +55 -6
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
export declare function Skeleton({ className, ...props }: ComponentPropsWithRef<"div">): import("react").JSX.Element;
|
|
3
|
+
export declare function Spinner({ className, label, ...props }: ComponentPropsWithRef<"span"> & {
|
|
4
|
+
label?: string;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
export function Skeleton({ className, ...props }) {
|
|
4
|
+
return _jsx("div", { "aria-hidden": "true", className: cn("sky-skeleton h-field rounded-control bg-muted", className), ...props });
|
|
5
|
+
}
|
|
6
|
+
export function Spinner({ className, label = "Loading", ...props }) {
|
|
7
|
+
return _jsxs("span", { role: "status", className: cn("inline-flex items-center gap-control", className), ...props, children: [_jsx("span", { "aria-hidden": "true", className: "sky-spinner size-icon" }), _jsx("span", { className: "sr-only", children: label })] });
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type MultiSelectOption = {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
};
|
|
6
|
+
/** Select all affects enabled options only; disabled selections are preserved. */
|
|
7
|
+
export declare function MultiSelect({ label, options, value, onValueChange, disabled }: {
|
|
8
|
+
label: string;
|
|
9
|
+
options: readonly MultiSelectOption[];
|
|
10
|
+
value: readonly string[];
|
|
11
|
+
onValueChange: (value: string[]) => void;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useId, useLayoutEffect, useRef } from "react";
|
|
4
|
+
import { Checkbox, Label } from "./fields.js";
|
|
5
|
+
/** Select all affects enabled options only; disabled selections are preserved. */
|
|
6
|
+
export function MultiSelect({ label, options, value, onValueChange, disabled = false }) {
|
|
7
|
+
const id = useId();
|
|
8
|
+
const allRef = useRef(null);
|
|
9
|
+
const enabled = options.filter(option => !option.disabled);
|
|
10
|
+
const selected = new Set(value);
|
|
11
|
+
const count = enabled.filter(option => selected.has(option.value)).length;
|
|
12
|
+
const all = enabled.length > 0 && count === enabled.length;
|
|
13
|
+
const mixed = count > 0 && !all;
|
|
14
|
+
useLayoutEffect(() => { if (allRef.current)
|
|
15
|
+
allRef.current.indeterminate = mixed; }, [mixed]);
|
|
16
|
+
return _jsxs("fieldset", { disabled: disabled, className: "grid gap-stack rounded-control sky-border border-input p-panel", children: [_jsx("legend", { className: "px-control text-label font-medium", children: label }), _jsxs("div", { className: "sky-choice-row flex items-center gap-control", children: [_jsx(Checkbox, { ref: allRef, id: `${id}-all`, checked: all, disabled: !enabled.length, onChange: event => {
|
|
17
|
+
const next = new Set(value);
|
|
18
|
+
for (const option of enabled)
|
|
19
|
+
event.target.checked ? next.add(option.value) : next.delete(option.value);
|
|
20
|
+
onValueChange([...next]);
|
|
21
|
+
} }), _jsx(Label, { className: "flex min-h-touch flex-1 items-center", htmlFor: `${id}-all`, children: "Select all" })] }), options.map((option, index) => _jsxs("div", { className: "sky-choice-row flex items-center gap-control", children: [_jsx(Checkbox, { id: `${id}-${index}`, checked: selected.has(option.value), disabled: option.disabled, onChange: event => {
|
|
22
|
+
const next = new Set(value);
|
|
23
|
+
event.target.checked ? next.add(option.value) : next.delete(option.value);
|
|
24
|
+
onValueChange([...next]);
|
|
25
|
+
} }), _jsx(Label, { className: "flex min-h-touch flex-1 items-center", htmlFor: `${id}-${index}`, children: option.label })] }, option.value)), !options.length && _jsx("p", { className: "text-label", children: "No options available." })] });
|
|
26
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Button } from "./button.js";
|
|
4
|
+
export function Pagination({ page, pageCount, onPageChange, label = "Pagination" }) {
|
|
5
|
+
const count = Math.max(1, Math.floor(pageCount) || 1);
|
|
6
|
+
const current = Math.min(count, Math.max(1, Math.floor(page) || 1));
|
|
7
|
+
return _jsxs("nav", { "aria-label": label, className: "flex flex-wrap items-center justify-between gap-control", children: [_jsx(Button, { variant: "outline", disabled: current <= 1, onClick: () => onPageChange(current - 1), children: "Previous" }), _jsxs("span", { className: "text-label text-muted-foreground", "aria-live": "polite", children: ["Page ", current, " of ", count] }), _jsx(Button, { variant: "outline", disabled: current >= count, onClick: () => onPageChange(current + 1), children: "Next" })] });
|
|
8
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
import * as Primitive from "@radix-ui/react-popover";
|
|
3
|
+
export declare const Popover: import("react").FC<Primitive.PopoverProps>;
|
|
4
|
+
export declare const PopoverTrigger: import("react").ForwardRefExoticComponent<Primitive.PopoverTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
export declare const PopoverClose: import("react").ForwardRefExoticComponent<Primitive.PopoverCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
export declare function PopoverContent({ className, ...props }: ComponentPropsWithRef<typeof Primitive.Content>): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as Primitive from "@radix-ui/react-popover";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
export const Popover = Primitive.Root;
|
|
6
|
+
export const PopoverTrigger = Primitive.Trigger;
|
|
7
|
+
export const PopoverClose = Primitive.Close;
|
|
8
|
+
export function PopoverContent({ className, ...props }) {
|
|
9
|
+
return _jsx(Primitive.Portal, { children: _jsx(Primitive.Content, { className: cn("sky-popover sky-border sky-floating-fit w-preview-wide rounded-surface border-border bg-popover p-panel text-popover-foreground shadow-floating", className), ...props }) });
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as Primitive from "@radix-ui/react-progress";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
export function Progress({ className, value, max = 100, ...props }) {
|
|
6
|
+
const safeMax = Number.isFinite(max) && max > 0 ? max : 100;
|
|
7
|
+
const safeValue = value == null || !Number.isFinite(value) ? null : Math.min(safeMax, Math.max(0, value));
|
|
8
|
+
return _jsx(Primitive.Root, { value: safeValue, max: safeMax, className: cn("relative h-control w-full overflow-hidden rounded-full bg-secondary", className), ...props, children: _jsx(Primitive.Indicator, { className: cn("h-full bg-primary", safeValue === null && "sky-skeleton w-full"), style: safeValue === null ? undefined : { width: `${safeValue / safeMax * 100}%` } }) });
|
|
9
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
import * as Primitive from "@radix-ui/react-radio-group";
|
|
3
|
+
export declare function RadioGroup({ className, ...props }: ComponentPropsWithRef<typeof Primitive.Root>): import("react").JSX.Element;
|
|
4
|
+
export declare function RadioGroupItem({ className, ...props }: ComponentPropsWithRef<typeof Primitive.Item>): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as Primitive from "@radix-ui/react-radio-group";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
export function RadioGroup({ className, ...props }) {
|
|
6
|
+
return _jsx(Primitive.Root, { className: cn("grid gap-control", className), ...props });
|
|
7
|
+
}
|
|
8
|
+
export function RadioGroupItem({ className, ...props }) {
|
|
9
|
+
return _jsx(Primitive.Item, { className: cn("sky-focus sky-disabled sky-border size-choice shrink-0 rounded-full border-input text-primary", className), ...props, children: _jsx(Primitive.Indicator, { className: "flex size-full items-center justify-center", children: _jsx("span", { className: "size-control rounded-full bg-primary" }) }) });
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare function SelectField({ id, label, value, onValueChange, options, placeholder, disabled, error }: {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
onValueChange: (value: string) => void;
|
|
6
|
+
options: readonly {
|
|
7
|
+
value: string;
|
|
8
|
+
label: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}[];
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
error?: string;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./select.js";
|
|
4
|
+
import { FormField } from "./form-field.js";
|
|
5
|
+
export function SelectField({ id, label, value, onValueChange, options, placeholder = "Choose an option", disabled, error }) {
|
|
6
|
+
return _jsx(FormField, { id: id, label: label, error: error, children: _jsxs(Select, { value: value, onValueChange: onValueChange, disabled: disabled, children: [_jsx(SelectTrigger, { id: id, "aria-invalid": !!error, "aria-describedby": error ? `${id}-error` : undefined, children: _jsx(SelectValue, { placeholder: placeholder }) }), _jsx(SelectContent, { children: options.map(option => _jsx(SelectItem, { value: option.value, disabled: option.disabled, children: option.label }, option.value)) })] }) });
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as Primitive from "@radix-ui/react-select";
|
|
3
|
+
export declare const Select: React.FC<Primitive.SelectProps>;
|
|
4
|
+
export declare const SelectValue: React.ForwardRefExoticComponent<Primitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
5
|
+
export declare const SelectGroup: React.ForwardRefExoticComponent<Primitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export declare const SelectLabel: React.ForwardRefExoticComponent<Primitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export declare function SelectTrigger({ children, className, ...props }: React.ComponentPropsWithRef<typeof Primitive.Trigger>): React.JSX.Element;
|
|
8
|
+
export declare function SelectContent({ children, className, position, ...props }: React.ComponentPropsWithRef<typeof Primitive.Content>): React.JSX.Element;
|
|
9
|
+
export declare function SelectItem({ children, className, ...props }: React.ComponentPropsWithRef<typeof Primitive.Item>): React.JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as Primitive from "@radix-ui/react-select";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
export const Select = Primitive.Root;
|
|
6
|
+
export const SelectValue = Primitive.Value;
|
|
7
|
+
export const SelectGroup = Primitive.Group;
|
|
8
|
+
export const SelectLabel = Primitive.Label;
|
|
9
|
+
export function SelectTrigger({ children, className, ...props }) {
|
|
10
|
+
return _jsxs(Primitive.Trigger, { className: cn("flex h-field min-h-touch tablet:min-h-field w-full items-center justify-between gap-control rounded-control sky-border border-input bg-background px-inline text-label sky-focus sky-disabled", className), ...props, children: [children, _jsx(Primitive.Icon, { "aria-hidden": true, children: "\u25BE" })] });
|
|
11
|
+
}
|
|
12
|
+
export function SelectContent({ children, className, position = "popper", ...props }) {
|
|
13
|
+
return _jsx(Primitive.Portal, { children: _jsxs(Primitive.Content, { position: position, className: cn("sky-popover sky-select-content overflow-hidden rounded-control sky-border border-input bg-popover text-popover-foreground shadow-raised", className), ...props, children: [_jsx(Primitive.ScrollUpButton, { className: "text-center", children: "\u25B4" }), _jsx(Primitive.Viewport, { className: "p-control", children: children }), _jsx(Primitive.ScrollDownButton, { className: "text-center", children: "\u25BE" })] }) });
|
|
14
|
+
}
|
|
15
|
+
export function SelectItem({ children, className, ...props }) {
|
|
16
|
+
return _jsxs(Primitive.Item, { className: cn("relative flex min-h-touch tablet:min-h-field cursor-default select-none items-center rounded-control py-control sky-select-item pe-inline text-label outline-none focus:bg-secondary data-[disabled]:pointer-events-none sky-disabled", className), ...props, children: [_jsx("span", { className: "absolute start-inline", children: _jsx(Primitive.ItemIndicator, { children: "\u2713" }) }), _jsx(Primitive.ItemText, { children: children })] });
|
|
17
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as Primitive from "@radix-ui/react-separator";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
export function Separator({ className, orientation = "horizontal", decorative = true, ...props }) {
|
|
6
|
+
return _jsx(Primitive.Root, { orientation: orientation, decorative: decorative, className: cn("shrink-0 bg-border data-[orientation=horizontal]:h-hairline data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-hairline", className), ...props });
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
import * as Primitive from "@radix-ui/react-dialog";
|
|
3
|
+
export { DialogTitle as SheetTitle, DialogDescription as SheetDescription, DialogFooter as SheetFooter } from "./dialog.js";
|
|
4
|
+
export declare const Sheet: import("react").FC<Primitive.DialogProps>;
|
|
5
|
+
export declare const SheetTrigger: import("react").ForwardRefExoticComponent<Primitive.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
export declare const SheetClose: import("react").ForwardRefExoticComponent<Primitive.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
export declare function SheetContent({ children, className, side, closeLabel, ...props }: ComponentPropsWithRef<typeof Primitive.Content> & {
|
|
8
|
+
side?: "left" | "right";
|
|
9
|
+
closeLabel?: string;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
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 { DialogTitle as SheetTitle, DialogDescription as SheetDescription, DialogFooter as SheetFooter } from "./dialog.js";
|
|
7
|
+
export const Sheet = Primitive.Root;
|
|
8
|
+
export const SheetTrigger = Primitive.Trigger;
|
|
9
|
+
export const SheetClose = Primitive.Close;
|
|
10
|
+
export function SheetContent({ children, className, side = "right", closeLabel = "Close panel", ...props }) {
|
|
11
|
+
return _jsxs(Primitive.Portal, { children: [_jsx(Primitive.Overlay, { className: "sky-overlay fixed inset-0 bg-overlay" }), _jsxs(Primitive.Content, { className: cn("sky-modal fixed inset-y-0 grid h-dvh w-full content-start gap-stack overflow-y-auto bg-popover p-panel text-popover-foreground shadow-floating tablet:max-w-sheet", side === "right" ? "right-0" : "left-0", className), ...props, children: [_jsx(Primitive.Close, { asChild: true, children: _jsx(Button, { variant: "ghost", className: "justify-self-end", "aria-label": closeLabel, children: closeLabel }) }), children] })] });
|
|
12
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
import * as Primitive from "@radix-ui/react-slider";
|
|
3
|
+
export declare function Slider({ className, value, defaultValue, thumbLabels, ...props }: ComponentPropsWithRef<typeof Primitive.Root> & {
|
|
4
|
+
thumbLabels?: string[];
|
|
5
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as Primitive from "@radix-ui/react-slider";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
export function Slider({ className, value, defaultValue = [0], thumbLabels, ...props }) {
|
|
6
|
+
return _jsxs(Primitive.Root, { value: value, defaultValue: defaultValue, className: cn("sky-disabled relative flex min-h-touch w-full touch-none select-none items-center data-[orientation=vertical]:h-preview data-[orientation=vertical]:min-w-touch data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col", className), ...props, children: [_jsx(Primitive.Track, { className: "relative grow overflow-hidden rounded-full bg-secondary data-[orientation=horizontal]:h-track data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-track", children: _jsx(Primitive.Range, { className: "absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full" }) }), (value ?? defaultValue).map((_, index) => _jsx(Primitive.Thumb, { "aria-label": thumbLabels?.[index] ?? props["aria-label"] ?? `Value ${index + 1}`, className: "sky-focus sky-border block size-choice rounded-full border-primary bg-background shadow-raised" }, index))] });
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as Primitive from "@radix-ui/react-switch";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
export function Switch({ className, ...props }) {
|
|
6
|
+
return _jsx(Primitive.Root, { className: cn("sky-focus sky-disabled group inline-flex min-h-touch min-w-touch items-center", className), ...props, children: _jsx("span", { className: "sky-switch sky-transition flex bg-input group-data-[state=checked]:bg-primary", children: _jsx(Primitive.Thumb, { className: "sky-switch-thumb block bg-background group-data-[state=checked]:bg-primary-foreground" }) }) });
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
export declare function Table({ className, ...props }: ComponentPropsWithRef<"table">): import("react").JSX.Element;
|
|
3
|
+
export declare function TableHeader(props: ComponentPropsWithRef<"thead">): import("react").JSX.Element;
|
|
4
|
+
export declare function TableBody(props: ComponentPropsWithRef<"tbody">): import("react").JSX.Element;
|
|
5
|
+
export declare function TableFooter({ className, ...props }: ComponentPropsWithRef<"tfoot">): import("react").JSX.Element;
|
|
6
|
+
export declare function TableRow({ className, ...props }: ComponentPropsWithRef<"tr">): import("react").JSX.Element;
|
|
7
|
+
export declare function TableHead({ className, scope, ...props }: ComponentPropsWithRef<"th">): import("react").JSX.Element;
|
|
8
|
+
export declare function TableCell({ className, ...props }: ComponentPropsWithRef<"td">): import("react").JSX.Element;
|
|
9
|
+
export declare function TableCaption({ className, ...props }: ComponentPropsWithRef<"caption">): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
export function Table({ className, ...props }) {
|
|
4
|
+
return _jsx("div", { className: "w-full overflow-x-auto", children: _jsx("table", { className: cn("w-full text-label", className), ...props }) });
|
|
5
|
+
}
|
|
6
|
+
export function TableHeader(props) { return _jsx("thead", { ...props }); }
|
|
7
|
+
export function TableBody(props) { return _jsx("tbody", { ...props }); }
|
|
8
|
+
export function TableFooter({ className, ...props }) { return _jsx("tfoot", { className: cn("bg-muted font-medium", className), ...props }); }
|
|
9
|
+
export function TableRow({ className, ...props }) { return _jsx("tr", { className: cn("sky-table-row hover:bg-muted", className), ...props }); }
|
|
10
|
+
export function TableHead({ className, scope = "col", ...props }) { return _jsx("th", { scope: scope, className: cn("px-inline py-control text-start font-medium text-muted-foreground", className), ...props }); }
|
|
11
|
+
export function TableCell({ className, ...props }) { return _jsx("td", { className: cn("px-inline py-stack", className), ...props }); }
|
|
12
|
+
export function TableCaption({ className, ...props }) { return _jsx("caption", { className: cn("caption-bottom py-stack text-caption text-muted-foreground", className), ...props }); }
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
import * as Primitive from "@radix-ui/react-tabs";
|
|
3
|
+
export declare const Tabs: import("react").ForwardRefExoticComponent<Primitive.TabsProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export declare function TabsList({ className, ...props }: ComponentPropsWithRef<typeof Primitive.List>): import("react").JSX.Element;
|
|
5
|
+
export declare function TabsTrigger({ className, ...props }: ComponentPropsWithRef<typeof Primitive.Trigger>): import("react").JSX.Element;
|
|
6
|
+
export declare function TabsContent({ className, ...props }: ComponentPropsWithRef<typeof Primitive.Content>): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as Primitive from "@radix-ui/react-tabs";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
export const Tabs = Primitive.Root;
|
|
6
|
+
export function TabsList({ className, ...props }) {
|
|
7
|
+
return _jsx(Primitive.List, { className: cn("flex w-full gap-control overflow-x-auto rounded-control bg-muted p-control data-[orientation=vertical]:flex-col", className), ...props });
|
|
8
|
+
}
|
|
9
|
+
export function TabsTrigger({ className, ...props }) {
|
|
10
|
+
return _jsx(Primitive.Trigger, { className: cn("sky-focus sky-disabled sky-transition min-h-touch shrink-0 rounded-control px-inline py-control text-label text-muted-foreground data-[state=active]:bg-card data-[state=active]:text-card-foreground tablet:min-h-field", className), ...props });
|
|
11
|
+
}
|
|
12
|
+
export function TabsContent({ className, ...props }) {
|
|
13
|
+
return _jsx(Primitive.Content, { className: cn("sky-focus min-w-0 py-panel", className), ...props });
|
|
14
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
import * as Primitive from "@radix-ui/react-tooltip";
|
|
3
|
+
export declare const TooltipProvider: import("react").FC<Primitive.TooltipProviderProps>;
|
|
4
|
+
export declare const Tooltip: import("react").FC<Primitive.TooltipProps>;
|
|
5
|
+
export declare const TooltipTrigger: import("react").ForwardRefExoticComponent<Primitive.TooltipTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
export declare function TooltipContent({ className, children, ...props }: ComponentPropsWithRef<typeof Primitive.Content>): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as Primitive from "@radix-ui/react-tooltip";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
export const TooltipProvider = Primitive.Provider;
|
|
6
|
+
export const Tooltip = Primitive.Root;
|
|
7
|
+
export const TooltipTrigger = Primitive.Trigger;
|
|
8
|
+
export function TooltipContent({ className, children, ...props }) {
|
|
9
|
+
return _jsx(Primitive.Portal, { children: _jsxs(Primitive.Content, { className: cn("sky-tooltip max-w-tooltip rounded-control bg-foreground px-inline py-control text-label text-background shadow-raised", className), ...props, children: [children, _jsx(Primitive.Arrow, { className: "fill-foreground" })] }) });
|
|
10
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export { Button, type ButtonProps } from "./components/button.js";
|
|
2
|
+
export { Input, Textarea, Label, Checkbox } from "./components/fields.js";
|
|
3
|
+
export { Select, SelectValue, SelectGroup, SelectLabel, SelectTrigger, SelectContent, SelectItem } from "./components/select.js";
|
|
4
|
+
export { cn } from "./lib/utils.js";
|
|
5
|
+
export { FormField } from "./components/form-field.js";
|
|
6
|
+
export { SelectField } from "./components/select-field.js";
|
|
7
|
+
export { MultiSelect, type MultiSelectOption } from "./components/multi-select.js";
|
|
8
|
+
export { EmptyState } from "./components/empty-state.js";
|
|
9
|
+
export { Container, Stack, ResponsiveGrid } from "./components/layout.js";
|
|
10
|
+
export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from "./components/card.js";
|
|
11
|
+
export { Badge } from "./components/badge.js";
|
|
12
|
+
export { Alert, AlertTitle, AlertDescription } from "./components/alert.js";
|
|
13
|
+
export { Skeleton, Spinner } from "./components/loading.js";
|
|
14
|
+
export { Dialog, DialogTrigger, DialogClose, DialogContent, DialogTitle, DialogDescription, DialogFooter } from "./components/dialog.js";
|
|
15
|
+
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetTitle, SheetDescription, SheetFooter } from "./components/sheet.js";
|
|
16
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent } from "./components/tabs.js";
|
|
17
|
+
export { Switch } from "./components/switch.js";
|
|
18
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from "./components/accordion.js";
|
|
19
|
+
export { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from "./components/tooltip.js";
|
|
20
|
+
export { Separator } from "./components/separator.js";
|
|
21
|
+
export { Avatar, AvatarImage, AvatarFallback } from "./components/avatar.js";
|
|
22
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuGroup, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator } from "./components/dropdown-menu.js";
|
|
23
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverClose } from "./components/popover.js";
|
|
24
|
+
export { RadioGroup, RadioGroupItem } from "./components/radio-group.js";
|
|
25
|
+
export { Slider } from "./components/slider.js";
|
|
26
|
+
export { Progress } from "./components/progress.js";
|
|
27
|
+
export { Table, TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell, TableCaption } from "./components/table.js";
|
|
28
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator } from "./components/breadcrumb.js";
|
|
29
|
+
export { Pagination } from "./components/pagination.js";
|
|
30
|
+
export { DataTable, type DataTableColumn, type DataTableProps } from "./components/data-table.js";
|
|
31
|
+
export { ChartContainer, ChartTooltipContent, CartesianChart, DonutChart, ScatterPlot, Heatmap, type ChartColor, type ChartDatum, type ChartSeries, type CartesianChartProps } from "./components/chart.js";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export { Button } from "./components/button.js";
|
|
2
|
+
export { Input, Textarea, Label, Checkbox } from "./components/fields.js";
|
|
3
|
+
export { Select, SelectValue, SelectGroup, SelectLabel, SelectTrigger, SelectContent, SelectItem } from "./components/select.js";
|
|
4
|
+
export { cn } from "./lib/utils.js";
|
|
5
|
+
export { FormField } from "./components/form-field.js";
|
|
6
|
+
export { SelectField } from "./components/select-field.js";
|
|
7
|
+
export { MultiSelect } from "./components/multi-select.js";
|
|
8
|
+
export { EmptyState } from "./components/empty-state.js";
|
|
9
|
+
export { Container, Stack, ResponsiveGrid } from "./components/layout.js";
|
|
10
|
+
export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from "./components/card.js";
|
|
11
|
+
export { Badge } from "./components/badge.js";
|
|
12
|
+
export { Alert, AlertTitle, AlertDescription } from "./components/alert.js";
|
|
13
|
+
export { Skeleton, Spinner } from "./components/loading.js";
|
|
14
|
+
export { Dialog, DialogTrigger, DialogClose, DialogContent, DialogTitle, DialogDescription, DialogFooter } from "./components/dialog.js";
|
|
15
|
+
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetTitle, SheetDescription, SheetFooter } from "./components/sheet.js";
|
|
16
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent } from "./components/tabs.js";
|
|
17
|
+
export { Switch } from "./components/switch.js";
|
|
18
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from "./components/accordion.js";
|
|
19
|
+
export { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from "./components/tooltip.js";
|
|
20
|
+
export { Separator } from "./components/separator.js";
|
|
21
|
+
export { Avatar, AvatarImage, AvatarFallback } from "./components/avatar.js";
|
|
22
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuGroup, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator } from "./components/dropdown-menu.js";
|
|
23
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverClose } from "./components/popover.js";
|
|
24
|
+
export { RadioGroup, RadioGroupItem } from "./components/radio-group.js";
|
|
25
|
+
export { Slider } from "./components/slider.js";
|
|
26
|
+
export { Progress } from "./components/progress.js";
|
|
27
|
+
export { Table, TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell, TableCaption } from "./components/table.js";
|
|
28
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator } from "./components/breadcrumb.js";
|
|
29
|
+
export { Pagination } from "./components/pagination.js";
|
|
30
|
+
export { DataTable } from "./components/data-table.js";
|
|
31
|
+
export { ChartContainer, ChartTooltipContent, CartesianChart, DonutChart, ScatterPlot, Heatmap } from "./components/chart.js";
|
package/dist/styles.css
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
@import "./tokens.css";
|
|
2
|
+
@source "./**/*.{js,ts,tsx}";
|
|
3
|
+
/* Static rem breakpoint tokens: media queries cannot resolve runtime var(). */
|
|
4
|
+
@theme {
|
|
5
|
+
--breakpoint-tablet: 48rem;
|
|
6
|
+
--breakpoint-laptop: 64rem;
|
|
7
|
+
}
|
|
8
|
+
@theme inline {
|
|
9
|
+
--color-background: var(--background);
|
|
10
|
+
--color-foreground: var(--foreground);
|
|
11
|
+
--color-card: var(--card);
|
|
12
|
+
--color-card-foreground: var(--card-foreground);
|
|
13
|
+
--color-popover: var(--popover);
|
|
14
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
15
|
+
--color-primary: var(--primary);
|
|
16
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
17
|
+
--color-secondary: var(--secondary);
|
|
18
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
19
|
+
--color-muted: var(--muted);
|
|
20
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
21
|
+
--color-accent: var(--accent);
|
|
22
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
23
|
+
--color-destructive: var(--destructive);
|
|
24
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
25
|
+
--color-success: var(--success);
|
|
26
|
+
--color-success-foreground: var(--success-foreground);
|
|
27
|
+
--color-border: var(--border);
|
|
28
|
+
--color-input: var(--input);
|
|
29
|
+
--color-ring: var(--ring);
|
|
30
|
+
--color-overlay: var(--overlay);
|
|
31
|
+
--spacing-inline: var(--sky-space-inline);
|
|
32
|
+
--spacing-control: var(--sky-space-control);
|
|
33
|
+
--spacing-stack: var(--sky-space-stack);
|
|
34
|
+
--spacing-panel: var(--sky-space-panel);
|
|
35
|
+
--spacing-page: var(--sky-space-page);
|
|
36
|
+
--spacing-page-wide: var(--sky-space-page-wide);
|
|
37
|
+
--spacing-hairline: var(--sky-stroke);
|
|
38
|
+
--spacing-touch: var(--sky-touch-target);
|
|
39
|
+
--spacing-icon: var(--sky-icon);
|
|
40
|
+
--spacing-choice: var(--sky-choice);
|
|
41
|
+
--spacing-field: var(--sky-control-height);
|
|
42
|
+
--spacing-field-sm: var(--sky-control-sm);
|
|
43
|
+
--spacing-field-lg: var(--sky-control-lg);
|
|
44
|
+
--spacing-textarea: var(--sky-textarea);
|
|
45
|
+
--spacing-dialog: var(--sky-dialog);
|
|
46
|
+
--spacing-sheet: var(--sky-sheet);
|
|
47
|
+
--spacing-tooltip: var(--sky-tooltip);
|
|
48
|
+
--spacing-container: var(--sky-container);
|
|
49
|
+
--spacing-sidebar: var(--sky-sidebar);
|
|
50
|
+
--spacing-header: var(--sky-header-height);
|
|
51
|
+
--spacing-preview: var(--sky-preview);
|
|
52
|
+
--spacing-preview-wide: var(--sky-preview-wide);
|
|
53
|
+
--spacing-track: var(--sky-track);
|
|
54
|
+
--spacing-chart: var(--sky-chart-height);
|
|
55
|
+
--radius-control: var(--sky-radius-control);
|
|
56
|
+
--radius-surface: var(--sky-radius-surface);
|
|
57
|
+
--radius-modal: var(--sky-radius-modal);
|
|
58
|
+
--text-caption: var(--sky-text-caption);
|
|
59
|
+
--text-label: var(--sky-text-label);
|
|
60
|
+
--text-body: var(--sky-text-body);
|
|
61
|
+
--text-title: var(--sky-text-title);
|
|
62
|
+
--font-sans: var(--sky-font-family);
|
|
63
|
+
--leading-body: var(--sky-leading-body);
|
|
64
|
+
--leading-title: var(--sky-leading-title);
|
|
65
|
+
--font-weight-medium: var(--sky-weight-medium);
|
|
66
|
+
--font-weight-semibold: var(--sky-weight-semibold);
|
|
67
|
+
--shadow-raised: var(--sky-shadow-raised);
|
|
68
|
+
--shadow-floating: var(--sky-shadow-floating);
|
|
69
|
+
}
|
|
70
|
+
@layer base {
|
|
71
|
+
body { background: var(--background); color: var(--foreground); font-family: var(--sky-font-family); }
|
|
72
|
+
}
|
|
73
|
+
@layer components {
|
|
74
|
+
.sky-border { border-width: var(--sky-stroke); border-style: solid; }
|
|
75
|
+
.sky-focus:focus-visible { outline: var(--sky-focus-width) solid var(--ring); outline-offset: var(--sky-focus-offset); }
|
|
76
|
+
.sky-disabled:disabled, .sky-disabled[data-disabled], .sky-disabled[aria-disabled="true"] { opacity: var(--sky-opacity-disabled); cursor: not-allowed; }
|
|
77
|
+
.sky-transition { transition: background-color var(--sky-duration-fast) var(--sky-ease), color var(--sky-duration-fast) var(--sky-ease); }
|
|
78
|
+
.sky-hover:hover { filter: brightness(var(--sky-brightness-hover)); }
|
|
79
|
+
.sky-link { text-underline-offset: var(--sky-space-xs); }
|
|
80
|
+
.sky-popover { z-index: var(--sky-layer-popover); }
|
|
81
|
+
.sky-overlay { z-index: var(--sky-layer-overlay); }
|
|
82
|
+
.sky-modal { z-index: var(--sky-layer-modal); }
|
|
83
|
+
.sky-tooltip { z-index: var(--sky-layer-tooltip); }
|
|
84
|
+
.sky-modal-fit { max-height: calc(100dvh - var(--sky-space-page) * 2); width: calc(100% - var(--sky-space-page) * 2); }
|
|
85
|
+
.sky-select-content { max-height: var(--radix-select-content-available-height); min-width: var(--radix-select-trigger-width); }
|
|
86
|
+
.sky-floating-fit { max-width: calc(100vw - var(--sky-space-page) * 2); max-height: var(--radix-popover-content-available-height); overflow-y: auto; }
|
|
87
|
+
.sky-table-row { border-bottom: var(--sky-stroke) solid var(--border); }
|
|
88
|
+
.sky-chart { font-family: var(--sky-font-family); }
|
|
89
|
+
.sky-chart .recharts-cartesian-axis-tick text { fill: var(--muted-foreground); font-size: var(--sky-text-caption); }
|
|
90
|
+
.sky-chart .recharts-line-curve, .sky-chart .recharts-area-curve { stroke-width: var(--sky-focus-width); }
|
|
91
|
+
.sky-chart .recharts-area-area { fill-opacity: var(--sky-chart-area-opacity); }
|
|
92
|
+
.sky-heat-cell { background: color-mix(in oklch, var(--chart-1) calc(var(--heat-weight) * var(--sky-heat-intensity)), var(--background)); color: var(--foreground); }
|
|
93
|
+
.sky-select-item { padding-inline-start: calc(var(--sky-space-inline) * 2 + var(--sky-icon)); }
|
|
94
|
+
.sky-choice-row { min-height: var(--sky-touch-target); }
|
|
95
|
+
.sky-switch { width: var(--sky-switch-width); height: var(--sky-switch-height); padding: var(--sky-switch-inset); border-radius: var(--sky-switch-height); }
|
|
96
|
+
.sky-switch-thumb { width: var(--sky-switch-thumb); height: var(--sky-switch-thumb); border-radius: var(--sky-radius-pill); transition: transform var(--sky-duration-fast) var(--sky-ease); }
|
|
97
|
+
.sky-switch-thumb[data-state="checked"] { transform: translateX(calc(var(--sky-switch-width) - var(--sky-switch-thumb) - var(--sky-switch-inset) * 2)); }
|
|
98
|
+
.sky-switch:dir(rtl) .sky-switch-thumb[data-state="checked"] { transform: translateX(calc(-1 * (var(--sky-switch-width) - var(--sky-switch-thumb) - var(--sky-switch-inset) * 2))); }
|
|
99
|
+
.sky-spinner { border-width: var(--sky-focus-width); border-style: solid; border-color: currentColor; border-inline-end-color: transparent; border-radius: var(--sky-radius-pill); animation: sky-spin var(--sky-duration-loading) linear infinite; }
|
|
100
|
+
.sky-skeleton { animation: sky-pulse var(--sky-duration-loading) var(--sky-ease) infinite alternate; }
|
|
101
|
+
@keyframes sky-spin { to { transform: rotate(1turn); } }
|
|
102
|
+
@keyframes sky-pulse { to { opacity: var(--sky-opacity-disabled); } }
|
|
103
|
+
@media (prefers-reduced-motion: reduce) {
|
|
104
|
+
.sky-transition, .sky-switch-thumb { transition: none; }
|
|
105
|
+
.sky-spinner, .sky-skeleton { animation: none; }
|
|
106
|
+
}
|
|
107
|
+
}
|