@locusgraph/components 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +51 -2
- package/dist/action/button-group.d.ts +11 -0
- package/dist/action/button-group.js +27 -0
- package/dist/action/button.d.ts +10 -0
- package/dist/action/button.js +35 -0
- package/dist/action/toggle-group.d.ts +9 -0
- package/dist/action/toggle-group.js +22 -0
- package/dist/action/toggle.d.ts +9 -0
- package/dist/action/toggle.js +26 -0
- package/dist/display/avatar.d.ts +6 -0
- package/dist/display/avatar.js +14 -0
- package/dist/display/badge.d.ts +9 -0
- package/dist/display/badge.js +24 -0
- package/dist/display/chart/chart-container.d.ts +43 -0
- package/dist/display/chart/chart-container.js +59 -0
- package/dist/display/chart/chart-legend.d.ts +8 -0
- package/dist/display/chart/chart-legend.js +22 -0
- package/dist/display/chart/chart-tooltip.d.ts +13 -0
- package/dist/display/chart/chart-tooltip.js +49 -0
- package/dist/display/chat/attachment/attachment-parts.d.ts +10 -0
- package/dist/display/chat/attachment/attachment-parts.js +21 -0
- package/dist/display/chat/attachment/attachment.d.ts +16 -0
- package/dist/display/chat/attachment/attachment.js +40 -0
- package/dist/display/chat/bubble.d.ts +17 -0
- package/dist/display/chat/bubble.js +50 -0
- package/dist/display/chat/marker.d.ts +11 -0
- package/dist/display/chat/marker.js +24 -0
- package/dist/display/chat/message-scroller.d.ts +10 -0
- package/dist/display/chat/message-scroller.js +25 -0
- package/dist/display/chat/message.d.ts +10 -0
- package/dist/display/chat/message.js +21 -0
- package/dist/display/content/item.d.ts +23 -0
- package/dist/display/content/item.js +66 -0
- package/dist/display/content/kbd.d.ts +3 -0
- package/dist/display/content/kbd.js +9 -0
- package/dist/display/media/aspect-ratio.d.ts +3 -0
- package/dist/display/media/aspect-ratio.js +7 -0
- package/dist/display/media/carousel-controls.d.ts +5 -0
- package/dist/display/media/carousel-controls.js +19 -0
- package/dist/display/media/carousel.d.ts +25 -0
- package/dist/display/media/carousel.js +77 -0
- package/dist/display/rule-grid/rule-grid.d.ts +14 -0
- package/dist/display/rule-grid/rule-grid.js +35 -0
- package/dist/display/separator.d.ts +4 -0
- package/dist/display/separator.js +8 -0
- package/dist/display/status/alert.d.ts +9 -0
- package/dist/display/status/alert.js +24 -0
- package/dist/display/status/empty.d.ts +11 -0
- package/dist/display/status/empty.js +33 -0
- package/dist/display/status/progress.d.ts +4 -0
- package/dist/display/status/progress.js +8 -0
- package/dist/display/status/skeleton.d.ts +2 -0
- package/dist/display/status/skeleton.js +6 -0
- package/dist/display/status/spinner.d.ts +2 -0
- package/dist/display/status/spinner.js +7 -0
- package/dist/display/table.d.ts +10 -0
- package/dist/display/table.js +27 -0
- package/dist/feedback/toaster.d.ts +5 -0
- package/dist/feedback/toaster.js +32 -0
- package/dist/form/advanced/calendar-day-button.d.ts +4 -0
- package/dist/form/advanced/calendar-day-button.js +19 -0
- package/dist/form/advanced/calendar.d.ts +7 -0
- package/dist/form/advanced/calendar.js +64 -0
- package/dist/form/advanced/combobox/combobox-chips.d.ts +9 -0
- package/dist/form/advanced/combobox/combobox-chips.js +20 -0
- package/dist/form/advanced/combobox/combobox-items.d.ts +8 -0
- package/dist/form/advanced/combobox/combobox-items.js +24 -0
- package/dist/form/advanced/combobox/combobox.d.ts +11 -0
- package/dist/form/advanced/combobox/combobox.js +26 -0
- package/dist/form/advanced/input-otp.d.ts +11 -0
- package/dist/form/advanced/input-otp.js +21 -0
- package/dist/form/choice/checkbox.d.ts +4 -0
- package/dist/form/choice/checkbox.js +9 -0
- package/dist/form/choice/radio-group.d.ts +5 -0
- package/dist/form/choice/radio-group.js +12 -0
- package/dist/form/choice/select.d.ts +15 -0
- package/dist/form/choice/select.js +38 -0
- package/dist/form/choice/slider.d.ts +4 -0
- package/dist/form/choice/slider.js +10 -0
- package/dist/form/choice/switch.d.ts +4 -0
- package/dist/form/choice/switch.js +8 -0
- package/dist/form/field/field-error.d.ts +8 -0
- package/dist/form/field/field-error.js +20 -0
- package/dist/form/field/field-separator.d.ts +3 -0
- package/dist/form/field/field-separator.js +7 -0
- package/dist/form/field/field-set.d.ts +6 -0
- package/dist/form/field/field-set.js +9 -0
- package/dist/form/field/field-text.d.ts +6 -0
- package/dist/form/field/field-text.js +13 -0
- package/dist/form/field/field.d.ts +9 -0
- package/dist/form/field/field.js +33 -0
- package/dist/form/hook-form/form.d.ts +24 -0
- package/dist/form/hook-form/form.js +57 -0
- package/dist/form/input-group.d.ts +16 -0
- package/dist/form/input-group.js +65 -0
- package/dist/form/input.d.ts +3 -0
- package/dist/form/input.js +6 -0
- package/dist/form/label.d.ts +4 -0
- package/dist/form/label.js +8 -0
- package/dist/form/native-select.d.ts +7 -0
- package/dist/form/native-select.js +13 -0
- package/dist/form/textarea.d.ts +3 -0
- package/dist/form/textarea.js +6 -0
- package/dist/index.d.ts +96 -0
- package/dist/index.js +95 -0
- package/dist/layout/accordion.d.ts +7 -0
- package/dist/layout/accordion.js +18 -0
- package/dist/layout/collapsible.d.ts +5 -0
- package/dist/layout/collapsible.js +13 -0
- package/dist/layout/resizable.d.ts +7 -0
- package/dist/layout/resizable.js +15 -0
- package/dist/layout/scroll/direction.d.ts +7 -0
- package/dist/layout/scroll/direction.js +8 -0
- package/dist/layout/scroll/scroll-area.d.ts +5 -0
- package/dist/layout/scroll/scroll-area.js +11 -0
- package/dist/layout/sidebar/sidebar-context.d.ts +19 -0
- package/dist/layout/sidebar/sidebar-context.js +72 -0
- package/dist/layout/sidebar/sidebar-menu-sub.d.ts +12 -0
- package/dist/layout/sidebar/sidebar-menu-sub.js +26 -0
- package/dist/layout/sidebar/sidebar-menu.d.ts +20 -0
- package/dist/layout/sidebar/sidebar-menu.js +53 -0
- package/dist/layout/sidebar/sidebar-sections.d.ts +17 -0
- package/dist/layout/sidebar/sidebar-sections.js +37 -0
- package/dist/layout/sidebar/sidebar.d.ts +11 -0
- package/dist/layout/sidebar/sidebar.js +40 -0
- package/dist/layout/tabs.d.ts +11 -0
- package/dist/layout/tabs.js +30 -0
- package/dist/layout/use-mobile.d.ts +1 -0
- package/dist/layout/use-mobile.js +15 -0
- package/dist/navigation/breadcrumb.d.ts +11 -0
- package/dist/navigation/breadcrumb.js +27 -0
- package/dist/navigation/menubar/menubar-items.d.ts +15 -0
- package/dist/navigation/menubar/menubar-items.js +27 -0
- package/dist/navigation/menubar/menubar-sub.d.ts +8 -0
- package/dist/navigation/menubar/menubar-sub.js +15 -0
- package/dist/navigation/menubar/menubar.d.ts +9 -0
- package/dist/navigation/menubar/menubar.js +23 -0
- package/dist/navigation/navigation-menu.d.ts +14 -0
- package/dist/navigation/navigation-menu.js +31 -0
- package/dist/navigation/pagination.d.ts +13 -0
- package/dist/navigation/pagination.js +29 -0
- package/dist/overlay/alert-dialog.d.ts +18 -0
- package/dist/overlay/alert-dialog.js +42 -0
- package/dist/overlay/context-menu/context-menu-items.d.ts +15 -0
- package/dist/overlay/context-menu/context-menu-items.js +27 -0
- package/dist/overlay/context-menu/context-menu-sub.d.ts +8 -0
- package/dist/overlay/context-menu/context-menu-sub.js +15 -0
- package/dist/overlay/context-menu/context-menu.d.ts +8 -0
- package/dist/overlay/context-menu/context-menu.js +20 -0
- package/dist/overlay/dialog.d.ts +16 -0
- package/dist/overlay/dialog.js +40 -0
- package/dist/overlay/floating/command.d.ts +18 -0
- package/dist/overlay/floating/command.js +34 -0
- package/dist/overlay/floating/drawer.d.ts +13 -0
- package/dist/overlay/floating/drawer.js +35 -0
- package/dist/overlay/floating/hover-card.d.ts +6 -0
- package/dist/overlay/floating/hover-card.js +14 -0
- package/dist/overlay/menu/dropdown-menu-choice.d.ts +6 -0
- package/dist/overlay/menu/dropdown-menu-choice.js +15 -0
- package/dist/overlay/menu/dropdown-menu-item.d.ts +12 -0
- package/dist/overlay/menu/dropdown-menu-item.js +17 -0
- package/dist/overlay/menu/dropdown-menu-sub.d.ts +8 -0
- package/dist/overlay/menu/dropdown-menu-sub.js +15 -0
- package/dist/overlay/menu/dropdown-menu.d.ts +8 -0
- package/dist/overlay/menu/dropdown-menu.js +20 -0
- package/dist/overlay/popover.d.ts +6 -0
- package/dist/overlay/popover.js +14 -0
- package/dist/overlay/sheet.d.ts +14 -0
- package/dist/overlay/sheet.js +40 -0
- package/dist/overlay/tooltip.d.ts +7 -0
- package/dist/overlay/tooltip.js +17 -0
- package/dist/shell/app-header.d.ts +11 -0
- package/dist/shell/app-header.js +10 -0
- package/dist/shell/app-shell.d.ts +10 -0
- package/dist/shell/app-shell.js +8 -0
- package/dist/shell/breadcrumbs.d.ts +12 -0
- package/dist/shell/breadcrumbs.js +18 -0
- package/dist/shell/docs/docs-header.d.ts +22 -0
- package/dist/shell/docs/docs-header.js +20 -0
- package/dist/shell/docs/docs-shell.d.ts +9 -0
- package/dist/shell/docs/docs-shell.js +7 -0
- package/dist/shell/docs/docs-sidebar.d.ts +17 -0
- package/dist/shell/docs/docs-sidebar.js +12 -0
- package/dist/shell/docs/on-this-page.d.ts +11 -0
- package/dist/shell/docs/on-this-page.js +12 -0
- package/dist/shell/docs/use-active-section.d.ts +2 -0
- package/dist/shell/docs/use-active-section.js +54 -0
- package/dist/shell/link.d.ts +4 -0
- package/dist/shell/link.js +1 -0
- package/dist/shell/navigation/app-sidebar.d.ts +19 -0
- package/dist/shell/navigation/app-sidebar.js +12 -0
- package/dist/shell/navigation/nav-group.d.ts +23 -0
- package/dist/shell/navigation/nav-group.js +17 -0
- package/dist/shell/theme-toggle.d.ts +7 -0
- package/dist/shell/theme-toggle.js +9 -0
- package/dist/styles/theme.css +4 -0
- package/package.json +65 -3
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
declare function Table({ className, ...props }: React.ComponentProps<"table">): React.JSX.Element;
|
|
3
|
+
declare function TableHeader({ className, ...props }: React.ComponentProps<"thead">): React.JSX.Element;
|
|
4
|
+
declare function TableBody({ className, ...props }: React.ComponentProps<"tbody">): React.JSX.Element;
|
|
5
|
+
declare function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">): React.JSX.Element;
|
|
6
|
+
declare function TableRow({ className, ...props }: React.ComponentProps<"tr">): React.JSX.Element;
|
|
7
|
+
declare function TableHead({ className, ...props }: React.ComponentProps<"th">): React.JSX.Element;
|
|
8
|
+
declare function TableCell({ className, ...props }: React.ComponentProps<"td">): React.JSX.Element;
|
|
9
|
+
declare function TableCaption({ className, ...props }: React.ComponentProps<"caption">): React.JSX.Element;
|
|
10
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
function Table({ className, ...props }) {
|
|
4
|
+
return (_jsx("div", { "data-slot": "table-container", className: "relative w-full overflow-x-auto scroll-fade-x", children: _jsx("table", { "data-slot": "table", className: cn("w-full caption-bottom text-sm", className), ...props }) }));
|
|
5
|
+
}
|
|
6
|
+
function TableHeader({ className, ...props }) {
|
|
7
|
+
return _jsx("thead", { "data-slot": "table-header", className: cn("[&_tr]:border-b", className), ...props });
|
|
8
|
+
}
|
|
9
|
+
function TableBody({ className, ...props }) {
|
|
10
|
+
return (_jsx("tbody", { "data-slot": "table-body", className: cn("[&_tr:last-child]:border-0", className), ...props }));
|
|
11
|
+
}
|
|
12
|
+
function TableFooter({ className, ...props }) {
|
|
13
|
+
return (_jsx("tfoot", { "data-slot": "table-footer", className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className), ...props }));
|
|
14
|
+
}
|
|
15
|
+
function TableRow({ className, ...props }) {
|
|
16
|
+
return (_jsx("tr", { "data-slot": "table-row", className: cn("border-b transition-colors duration-150 ease-out hover:bg-muted/40 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted", className), ...props }));
|
|
17
|
+
}
|
|
18
|
+
function TableHead({ className, ...props }) {
|
|
19
|
+
return (_jsx("th", { "data-slot": "table-head", className: cn("h-9 px-3 text-left align-middle font-mono sm:px-4 text-[11.5px] font-normal whitespace-nowrap text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className), ...props }));
|
|
20
|
+
}
|
|
21
|
+
function TableCell({ className, ...props }) {
|
|
22
|
+
return (_jsx("td", { "data-slot": "table-cell", className: cn("px-3 py-2.5 align-middle whitespace-nowrap tabular-nums sm:px-4 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className), ...props }));
|
|
23
|
+
}
|
|
24
|
+
function TableCaption({ className, ...props }) {
|
|
25
|
+
return (_jsx("caption", { "data-slot": "table-caption", className: cn("mt-4 text-sm text-muted-foreground", className), ...props }));
|
|
26
|
+
}
|
|
27
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { CircleCheckIcon, InfoIcon, Loader2Icon, OctagonXIcon, TriangleAlertIcon, } from "lucide-react";
|
|
4
|
+
import { Toaster as Sonner } from "sonner";
|
|
5
|
+
function statusColors(type, color) {
|
|
6
|
+
return {
|
|
7
|
+
[`--${type}-bg`]: `color-mix(in srgb, var(${color}) 8%, var(--popover))`,
|
|
8
|
+
[`--${type}-border`]: `color-mix(in srgb, var(${color}) 30%, var(--popover))`,
|
|
9
|
+
[`--${type}-text`]: `var(${color})`,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
const toasterColors = {
|
|
13
|
+
"--normal-bg": "var(--popover)",
|
|
14
|
+
"--normal-text": "var(--popover-foreground)",
|
|
15
|
+
"--normal-border": "var(--border)",
|
|
16
|
+
"--border-radius": "var(--radius)",
|
|
17
|
+
...statusColors("success", "--good"),
|
|
18
|
+
...statusColors("info", "--info"),
|
|
19
|
+
...statusColors("warning", "--warn"),
|
|
20
|
+
...statusColors("error", "--bad"),
|
|
21
|
+
};
|
|
22
|
+
function Toaster({ theme = "system", ...props }) {
|
|
23
|
+
return (_jsx(Sonner, { theme: theme, richColors: true, className: "toaster group", icons: {
|
|
24
|
+
success: _jsx(CircleCheckIcon, { className: "size-4" }),
|
|
25
|
+
info: _jsx(InfoIcon, { className: "size-4" }),
|
|
26
|
+
warning: _jsx(TriangleAlertIcon, { className: "size-4" }),
|
|
27
|
+
error: _jsx(OctagonXIcon, { className: "size-4" }),
|
|
28
|
+
loading: _jsx(Loader2Icon, { className: "size-4 animate-spin" }),
|
|
29
|
+
}, style: toasterColors, ...props }));
|
|
30
|
+
}
|
|
31
|
+
export { toast } from "sonner";
|
|
32
|
+
export { Toaster };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { getDefaultClassNames } from "react-day-picker";
|
|
6
|
+
import { Button } from "../../action/button.js";
|
|
7
|
+
function CalendarDayButton({ className, day, modifiers, ...props }) {
|
|
8
|
+
const defaultClassNames = getDefaultClassNames();
|
|
9
|
+
const ref = React.useRef(null);
|
|
10
|
+
React.useEffect(() => {
|
|
11
|
+
if (modifiers.focused)
|
|
12
|
+
ref.current?.focus();
|
|
13
|
+
}, [modifiers.focused]);
|
|
14
|
+
return (_jsx(Button, { ref: ref, variant: "ghost", size: "icon", "data-day": day.date.toLocaleDateString(), "data-selected-single": modifiers.selected &&
|
|
15
|
+
!modifiers.range_start &&
|
|
16
|
+
!modifiers.range_end &&
|
|
17
|
+
!modifiers.range_middle, "data-range-start": modifiers.range_start, "data-range-end": modifiers.range_end, "data-range-middle": modifiers.range_middle, className: cn("flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70", defaultClassNames.day, className), ...props }));
|
|
18
|
+
}
|
|
19
|
+
export { CalendarDayButton };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DayPicker } from "react-day-picker";
|
|
3
|
+
import { Button } from "../../action/button.js";
|
|
4
|
+
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, ...props }: React.ComponentProps<typeof DayPicker> & {
|
|
5
|
+
buttonVariant?: React.ComponentProps<typeof Button>["variant"];
|
|
6
|
+
}): React.JSX.Element;
|
|
7
|
+
export { Calendar };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
5
|
+
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
6
|
+
import { buttonVariants } from "../../action/button.js";
|
|
7
|
+
import { CalendarDayButton } from "./calendar-day-button.js";
|
|
8
|
+
function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", formatters, components, ...props }) {
|
|
9
|
+
const defaultClassNames = getDefaultClassNames();
|
|
10
|
+
return (_jsx(DayPicker, { showOutsideDays: showOutsideDays, className: cn("group/calendar bg-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent", String.raw `rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw `rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className), captionLayout: captionLayout, formatters: {
|
|
11
|
+
formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
|
|
12
|
+
...formatters,
|
|
13
|
+
}, classNames: {
|
|
14
|
+
root: cn("w-fit", defaultClassNames.root),
|
|
15
|
+
months: cn("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months),
|
|
16
|
+
month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
17
|
+
nav: cn("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", defaultClassNames.nav),
|
|
18
|
+
button_previous: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_previous),
|
|
19
|
+
button_next: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_next),
|
|
20
|
+
month_caption: cn("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", defaultClassNames.month_caption),
|
|
21
|
+
dropdowns: cn("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns),
|
|
22
|
+
dropdown_root: cn("relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50", defaultClassNames.dropdown_root),
|
|
23
|
+
dropdown: cn("absolute inset-0 bg-popover opacity-0", defaultClassNames.dropdown),
|
|
24
|
+
caption_label: cn("font-medium select-none", captionLayout === "label"
|
|
25
|
+
? "text-sm"
|
|
26
|
+
: "flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground", defaultClassNames.caption_label),
|
|
27
|
+
month_grid: cn("w-full border-collapse", defaultClassNames.month_grid),
|
|
28
|
+
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
29
|
+
weekday: cn("flex-1 rounded-md text-[0.8rem] font-normal text-muted-foreground select-none", defaultClassNames.weekday),
|
|
30
|
+
week: cn("mt-2 flex w-full", defaultClassNames.week),
|
|
31
|
+
week_number_header: cn("w-(--cell-size) select-none", defaultClassNames.week_number_header),
|
|
32
|
+
week_number: cn("text-[0.8rem] text-muted-foreground select-none", defaultClassNames.week_number),
|
|
33
|
+
day: cn("group/day relative aspect-square h-full w-full p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-md", props.showWeekNumber
|
|
34
|
+
? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md"
|
|
35
|
+
: "[&:first-child[data-selected=true]_button]:rounded-l-md", defaultClassNames.day),
|
|
36
|
+
range_start: cn("rounded-l-md bg-accent", defaultClassNames.range_start),
|
|
37
|
+
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
38
|
+
range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
|
|
39
|
+
today: cn("rounded-md bg-accent text-accent-foreground data-[selected=true]:rounded-none", defaultClassNames.today),
|
|
40
|
+
outside: cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
|
|
41
|
+
disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled),
|
|
42
|
+
hidden: cn("invisible", defaultClassNames.hidden),
|
|
43
|
+
...classNames,
|
|
44
|
+
}, components: {
|
|
45
|
+
Root: ({ className, rootRef, ...props }) => {
|
|
46
|
+
return _jsx("div", { "data-slot": "calendar", ref: rootRef, className: cn(className), ...props });
|
|
47
|
+
},
|
|
48
|
+
Chevron: ({ className, orientation, ...props }) => {
|
|
49
|
+
if (orientation === "left") {
|
|
50
|
+
return _jsx(ChevronLeftIcon, { className: cn("size-4", className), ...props });
|
|
51
|
+
}
|
|
52
|
+
if (orientation === "right") {
|
|
53
|
+
return _jsx(ChevronRightIcon, { className: cn("size-4", className), ...props });
|
|
54
|
+
}
|
|
55
|
+
return _jsx(ChevronDownIcon, { className: cn("size-4", className), ...props });
|
|
56
|
+
},
|
|
57
|
+
DayButton: CalendarDayButton,
|
|
58
|
+
WeekNumber: ({ children, ...props }) => {
|
|
59
|
+
return (_jsx("td", { ...props, children: _jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: children }) }));
|
|
60
|
+
},
|
|
61
|
+
...components,
|
|
62
|
+
}, ...props }));
|
|
63
|
+
}
|
|
64
|
+
export { Calendar };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Combobox as ComboboxPrimitive } from "@base-ui/react";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function ComboboxChips({ className, ...props }: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> & ComboboxPrimitive.Chips.Props): React.JSX.Element;
|
|
4
|
+
declare function ComboboxChip({ className, children, showRemove, ...props }: ComboboxPrimitive.Chip.Props & {
|
|
5
|
+
showRemove?: boolean;
|
|
6
|
+
}): React.JSX.Element;
|
|
7
|
+
declare function ComboboxChipsInput({ className, children, ...props }: ComboboxPrimitive.Input.Props): React.JSX.Element;
|
|
8
|
+
declare function useComboboxAnchor(): React.RefObject<HTMLDivElement | null>;
|
|
9
|
+
export { ComboboxChip, ComboboxChips, ComboboxChipsInput, useComboboxAnchor };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Combobox as ComboboxPrimitive } from "@base-ui/react";
|
|
4
|
+
import { cn } from "cn";
|
|
5
|
+
import { XIcon } from "lucide-react";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { Button } from "../../../action/button.js";
|
|
8
|
+
function ComboboxChips({ className, ...props }) {
|
|
9
|
+
return (_jsx(ComboboxPrimitive.Chips, { "data-slot": "combobox-chips", className: cn("flex min-h-9 flex-wrap items-center gap-1.5 rounded-md border border-input bg-transparent bg-clip-padding px-2.5 py-1.5 text-sm shadow-xs transition-[color,box-shadow] focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-[3px] has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1.5 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40", className), ...props }));
|
|
10
|
+
}
|
|
11
|
+
function ComboboxChip({ className, children, showRemove = true, ...props }) {
|
|
12
|
+
return (_jsxs(ComboboxPrimitive.Chip, { "data-slot": "combobox-chip", className: cn("flex h-[calc(--spacing(5.5))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0", className), ...props, children: [children, showRemove && (_jsx(ComboboxPrimitive.ChipRemove, { render: _jsx(Button, { variant: "ghost", size: "icon-xs" }), className: "-ml-1 opacity-50 hover:opacity-100", "data-slot": "combobox-chip-remove", children: _jsx(XIcon, { className: "pointer-events-none" }) }))] }));
|
|
13
|
+
}
|
|
14
|
+
function ComboboxChipsInput({ className, children, ...props }) {
|
|
15
|
+
return (_jsx(ComboboxPrimitive.Input, { "data-slot": "combobox-chip-input", className: cn("min-w-16 flex-1 outline-none", className), ...props }));
|
|
16
|
+
}
|
|
17
|
+
function useComboboxAnchor() {
|
|
18
|
+
return React.useRef(null);
|
|
19
|
+
}
|
|
20
|
+
export { ComboboxChip, ComboboxChips, ComboboxChipsInput, useComboboxAnchor };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Combobox as ComboboxPrimitive } from "@base-ui/react";
|
|
2
|
+
declare function ComboboxItem({ className, children, ...props }: ComboboxPrimitive.Item.Props): import("react").JSX.Element;
|
|
3
|
+
declare function ComboboxGroup({ className, ...props }: ComboboxPrimitive.Group.Props): import("react").JSX.Element;
|
|
4
|
+
declare function ComboboxLabel({ className, ...props }: ComboboxPrimitive.GroupLabel.Props): import("react").JSX.Element;
|
|
5
|
+
declare function ComboboxCollection({ ...props }: ComboboxPrimitive.Collection.Props): import("react").JSX.Element;
|
|
6
|
+
declare function ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props): import("react").JSX.Element;
|
|
7
|
+
declare function ComboboxSeparator({ className, ...props }: ComboboxPrimitive.Separator.Props): import("react").JSX.Element;
|
|
8
|
+
export { ComboboxCollection, ComboboxEmpty, ComboboxGroup, ComboboxItem, ComboboxLabel, ComboboxSeparator, };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Combobox as ComboboxPrimitive } from "@base-ui/react";
|
|
4
|
+
import { cn } from "cn";
|
|
5
|
+
import { CheckIcon } from "lucide-react";
|
|
6
|
+
function ComboboxItem({ className, children, ...props }) {
|
|
7
|
+
return (_jsxs(ComboboxPrimitive.Item, { "data-slot": "combobox-item", className: cn("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [children, _jsx(ComboboxPrimitive.ItemIndicator, { "data-slot": "combobox-item-indicator", render: _jsx("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center" }), children: _jsx(CheckIcon, { className: "pointer-events-none size-4 pointer-coarse:size-5" }) })] }));
|
|
8
|
+
}
|
|
9
|
+
function ComboboxGroup({ className, ...props }) {
|
|
10
|
+
return (_jsx(ComboboxPrimitive.Group, { "data-slot": "combobox-group", className: cn(className), ...props }));
|
|
11
|
+
}
|
|
12
|
+
function ComboboxLabel({ className, ...props }) {
|
|
13
|
+
return (_jsx(ComboboxPrimitive.GroupLabel, { "data-slot": "combobox-label", className: cn("px-2 py-1.5 text-xs text-muted-foreground pointer-coarse:px-3 pointer-coarse:py-2 pointer-coarse:text-sm", className), ...props }));
|
|
14
|
+
}
|
|
15
|
+
function ComboboxCollection({ ...props }) {
|
|
16
|
+
return _jsx(ComboboxPrimitive.Collection, { "data-slot": "combobox-collection", ...props });
|
|
17
|
+
}
|
|
18
|
+
function ComboboxEmpty({ className, ...props }) {
|
|
19
|
+
return (_jsx(ComboboxPrimitive.Empty, { "data-slot": "combobox-empty", className: cn("hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex", className), ...props }));
|
|
20
|
+
}
|
|
21
|
+
function ComboboxSeparator({ className, ...props }) {
|
|
22
|
+
return (_jsx(ComboboxPrimitive.Separator, { "data-slot": "combobox-separator", className: cn("-mx-1 my-1 h-px bg-border", className), ...props }));
|
|
23
|
+
}
|
|
24
|
+
export { ComboboxCollection, ComboboxEmpty, ComboboxGroup, ComboboxItem, ComboboxLabel, ComboboxSeparator, };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Combobox as ComboboxPrimitive } from "@base-ui/react";
|
|
2
|
+
declare const Combobox: typeof ComboboxPrimitive.Root;
|
|
3
|
+
declare function ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props): import("react").JSX.Element;
|
|
4
|
+
declare function ComboboxTrigger({ className, children, ...props }: ComboboxPrimitive.Trigger.Props): import("react").JSX.Element;
|
|
5
|
+
declare function ComboboxInput({ className, children, disabled, showTrigger, showClear, ...props }: ComboboxPrimitive.Input.Props & {
|
|
6
|
+
showTrigger?: boolean;
|
|
7
|
+
showClear?: boolean;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
declare function ComboboxContent({ className, side, sideOffset, align, alignOffset, anchor, ...props }: ComboboxPrimitive.Popup.Props & Pick<ComboboxPrimitive.Positioner.Props, "side" | "align" | "sideOffset" | "alignOffset" | "anchor">): import("react").JSX.Element;
|
|
10
|
+
declare function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props): import("react").JSX.Element;
|
|
11
|
+
export { Combobox, ComboboxContent, ComboboxInput, ComboboxList, ComboboxTrigger, ComboboxValue };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Combobox as ComboboxPrimitive } from "@base-ui/react";
|
|
4
|
+
import { cn } from "cn";
|
|
5
|
+
import { ChevronDownIcon, XIcon } from "lucide-react";
|
|
6
|
+
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "../../input-group.js";
|
|
7
|
+
const Combobox = ComboboxPrimitive.Root;
|
|
8
|
+
function ComboboxValue({ ...props }) {
|
|
9
|
+
return _jsx(ComboboxPrimitive.Value, { "data-slot": "combobox-value", ...props });
|
|
10
|
+
}
|
|
11
|
+
function ComboboxTrigger({ className, children, ...props }) {
|
|
12
|
+
return (_jsxs(ComboboxPrimitive.Trigger, { "data-slot": "combobox-trigger", className: cn("[&_svg:not([class*='size-'])]:size-4", className), ...props, children: [children, _jsx(ChevronDownIcon, { "data-slot": "combobox-trigger-icon", className: "pointer-events-none size-4 text-muted-foreground" })] }));
|
|
13
|
+
}
|
|
14
|
+
function ComboboxClear({ className, ...props }) {
|
|
15
|
+
return (_jsx(ComboboxPrimitive.Clear, { "data-slot": "combobox-clear", render: _jsx(InputGroupButton, { variant: "ghost", size: "icon-xs" }), className: cn(className), ...props, children: _jsx(XIcon, { className: "pointer-events-none" }) }));
|
|
16
|
+
}
|
|
17
|
+
function ComboboxInput({ className, children, disabled = false, showTrigger = true, showClear = false, ...props }) {
|
|
18
|
+
return (_jsxs(InputGroup, { className: cn("w-auto", className), children: [_jsx(ComboboxPrimitive.Input, { render: _jsx(InputGroupInput, { disabled: disabled }), ...props }), _jsxs(InputGroupAddon, { align: "inline-end", children: [showTrigger && (_jsx(InputGroupButton, { size: "icon-xs", variant: "ghost", asChild: true, "data-slot": "input-group-button", className: "group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent", disabled: disabled, children: _jsx(ComboboxTrigger, {}) })), showClear && _jsx(ComboboxClear, { disabled: disabled })] }), children] }));
|
|
19
|
+
}
|
|
20
|
+
function ComboboxContent({ className, side = "bottom", sideOffset = 6, align = "start", alignOffset = 0, anchor, ...props }) {
|
|
21
|
+
return (_jsx(ComboboxPrimitive.Portal, { children: _jsx(ComboboxPrimitive.Positioner, { side: side, sideOffset: sideOffset, align: align, alignOffset: alignOffset, anchor: anchor, className: "isolate z-50", children: _jsx(ComboboxPrimitive.Popup, { "data-slot": "combobox-content", "data-chips": !!anchor, className: cn("group/combobox-content relative max-h-96 w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props }) }) }));
|
|
22
|
+
}
|
|
23
|
+
function ComboboxList({ className, ...props }) {
|
|
24
|
+
return (_jsx(ComboboxPrimitive.List, { "data-slot": "combobox-list", className: cn("max-h-[min(calc(--spacing(96)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto p-1 data-empty:p-0", className), ...props }));
|
|
25
|
+
}
|
|
26
|
+
export { Combobox, ComboboxContent, ComboboxInput, ComboboxList, ComboboxTrigger, ComboboxValue };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OTPInput } from "input-otp";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function InputOTP({ className, containerClassName, ...props }: React.ComponentProps<typeof OTPInput> & {
|
|
4
|
+
containerClassName?: string;
|
|
5
|
+
}): React.JSX.Element;
|
|
6
|
+
declare function InputOTPGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
7
|
+
declare function InputOTPSlot({ index, className, ...props }: React.ComponentProps<"div"> & {
|
|
8
|
+
index: number;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
declare function InputOTPSeparator({ ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
11
|
+
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import { OTPInput, OTPInputContext } from "input-otp";
|
|
5
|
+
import { MinusIcon } from "lucide-react";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
function InputOTP({ className, containerClassName, ...props }) {
|
|
8
|
+
return (_jsx(OTPInput, { "data-slot": "input-otp", containerClassName: cn("flex items-center gap-2 has-disabled:opacity-50", containerClassName), className: cn("disabled:cursor-not-allowed", className), ...props }));
|
|
9
|
+
}
|
|
10
|
+
function InputOTPGroup({ className, ...props }) {
|
|
11
|
+
return (_jsx("div", { "data-slot": "input-otp-group", className: cn("flex items-center", className), ...props }));
|
|
12
|
+
}
|
|
13
|
+
function InputOTPSlot({ index, className, ...props }) {
|
|
14
|
+
const inputOTPContext = React.useContext(OTPInputContext);
|
|
15
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
16
|
+
return (_jsxs("div", { "data-slot": "input-otp-slot", "data-active": isActive, className: cn("relative flex h-9 w-9 items-center justify-center border-y border-r border-input text-sm shadow-xs transition-[color,background-color,border-color,box-shadow] duration-150 ease-out outline-none first:rounded-l-md first:border-l last:rounded-r-md aria-invalid:border-destructive data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-[3px] data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:data-[active=true]:aria-invalid:ring-destructive/40", className), ...props, children: [char, hasFakeCaret && (_jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: _jsx("div", { className: "h-4 w-px animate-caret-blink bg-foreground duration-1000" }) }))] }));
|
|
17
|
+
}
|
|
18
|
+
function InputOTPSeparator({ ...props }) {
|
|
19
|
+
return (_jsx("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: _jsx(MinusIcon, {}) }));
|
|
20
|
+
}
|
|
21
|
+
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import { CheckIcon } from "lucide-react";
|
|
5
|
+
import * as CheckboxPrimitive from "radix-ui/checkbox";
|
|
6
|
+
function Checkbox({ className, ...props }) {
|
|
7
|
+
return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn("peer size-4 shrink-0 rounded-none border border-input shadow-xs transition-shadow outline-none", "data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground", "focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50", className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "flex items-center justify-center text-current", children: _jsx(CheckIcon, { className: "size-3.5" }) }) }));
|
|
8
|
+
}
|
|
9
|
+
export { Checkbox };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as RadioGroupPrimitive from "radix-ui/radio-group";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function RadioGroupItem({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>): React.JSX.Element;
|
|
5
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import { CircleIcon } from "lucide-react";
|
|
5
|
+
import * as RadioGroupPrimitive from "radix-ui/radio-group";
|
|
6
|
+
function RadioGroup({ className, ...props }) {
|
|
7
|
+
return (_jsx(RadioGroupPrimitive.Root, { "data-slot": "radio-group", className: cn("grid gap-3", className), ...props }));
|
|
8
|
+
}
|
|
9
|
+
function RadioGroupItem({ className, ...props }) {
|
|
10
|
+
return (_jsx(RadioGroupPrimitive.Item, { "data-slot": "radio-group-item", className: cn("aspect-square size-4 shrink-0 rounded-full border border-input text-primary shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40", className), ...props, children: _jsx(RadioGroupPrimitive.Indicator, { "data-slot": "radio-group-indicator", className: "relative flex items-center justify-center", children: _jsx(CircleIcon, { className: "absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-primary" }) }) }));
|
|
11
|
+
}
|
|
12
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as SelectPrimitive from "radix-ui/select";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): React.JSX.Element;
|
|
5
|
+
declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): React.JSX.Element;
|
|
6
|
+
declare function SelectTrigger({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
7
|
+
size?: "sm" | "default";
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
declare function SelectContent({ className, children, position, align, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): React.JSX.Element;
|
|
10
|
+
declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): React.JSX.Element;
|
|
11
|
+
declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): React.JSX.Element;
|
|
12
|
+
declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): React.JSX.Element;
|
|
13
|
+
declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): React.JSX.Element;
|
|
14
|
+
declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): React.JSX.Element;
|
|
15
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
5
|
+
import * as SelectPrimitive from "radix-ui/select";
|
|
6
|
+
function Select({ ...props }) {
|
|
7
|
+
return _jsx(SelectPrimitive.Root, { "data-slot": "select", ...props });
|
|
8
|
+
}
|
|
9
|
+
function SelectGroup({ ...props }) {
|
|
10
|
+
return _jsx(SelectPrimitive.Group, { "data-slot": "select-group", ...props });
|
|
11
|
+
}
|
|
12
|
+
function SelectValue({ ...props }) {
|
|
13
|
+
return _jsx(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
14
|
+
}
|
|
15
|
+
function SelectTrigger({ className, size = "default", children, ...props }) {
|
|
16
|
+
return (_jsxs(SelectPrimitive.Trigger, { "data-slot": "select-trigger", "data-size": size, className: cn("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDownIcon, { className: "size-4 opacity-50" }) })] }));
|
|
17
|
+
}
|
|
18
|
+
function SelectContent({ className, children, position = "item-aligned", align = "center", ...props }) {
|
|
19
|
+
return (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { "data-slot": "select-content", className: cn("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", position === "popper" &&
|
|
20
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className), position: position, align: align, ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { className: cn("p-1", position === "popper" &&
|
|
21
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"), children: children }), _jsx(SelectScrollDownButton, {})] }) }));
|
|
22
|
+
}
|
|
23
|
+
function SelectLabel({ className, ...props }) {
|
|
24
|
+
return (_jsx(SelectPrimitive.Label, { "data-slot": "select-label", className: cn("px-2 py-1.5 text-xs text-muted-foreground", className), ...props }));
|
|
25
|
+
}
|
|
26
|
+
function SelectItem({ className, children, ...props }) {
|
|
27
|
+
return (_jsxs(SelectPrimitive.Item, { "data-slot": "select-item", className: cn("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className), ...props, children: [_jsx("span", { "data-slot": "select-item-indicator", className: "absolute right-2 flex size-3.5 items-center justify-center", children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "size-4" }) }) }), _jsx(SelectPrimitive.ItemText, { children: children })] }));
|
|
28
|
+
}
|
|
29
|
+
function SelectSeparator({ className, ...props }) {
|
|
30
|
+
return (_jsx(SelectPrimitive.Separator, { "data-slot": "select-separator", className: cn("pointer-events-none -mx-1 my-1 h-px bg-border", className), ...props }));
|
|
31
|
+
}
|
|
32
|
+
function SelectScrollUpButton({ className, ...props }) {
|
|
33
|
+
return (_jsx(SelectPrimitive.ScrollUpButton, { "data-slot": "select-scroll-up-button", className: cn("flex cursor-default items-center justify-center py-1", className), ...props, children: _jsx(ChevronUpIcon, { className: "size-4" }) }));
|
|
34
|
+
}
|
|
35
|
+
function SelectScrollDownButton({ className, ...props }) {
|
|
36
|
+
return (_jsx(SelectPrimitive.ScrollDownButton, { "data-slot": "select-scroll-down-button", className: cn("flex cursor-default items-center justify-center py-1", className), ...props, children: _jsx(ChevronDownIcon, { className: "size-4" }) }));
|
|
37
|
+
}
|
|
38
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import * as SliderPrimitive from "radix-ui/slider";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
function Slider({ className, defaultValue, value, min = 0, max = 100, ...props }) {
|
|
7
|
+
const _values = React.useMemo(() => (Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max]), [value, defaultValue, min, max]);
|
|
8
|
+
return (_jsxs(SliderPrimitive.Root, { "data-slot": "slider", defaultValue: defaultValue, value: value, min: min, max: max, className: cn("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col", className), ...props, children: [_jsx(SliderPrimitive.Track, { "data-slot": "slider-track", className: cn("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"), children: _jsx(SliderPrimitive.Range, { "data-slot": "slider-range", className: cn("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full") }) }), Array.from({ length: _values.length }, (_, index) => (_jsx(SliderPrimitive.Thumb, { "data-slot": "slider-thumb", className: "block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50" }, index)))] }));
|
|
9
|
+
}
|
|
10
|
+
export { Slider };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import * as SwitchPrimitive from "radix-ui/switch";
|
|
5
|
+
function Switch({ className, ...props }) {
|
|
6
|
+
return (_jsx(SwitchPrimitive.Root, { "data-slot": "switch", className: cn("peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent transition-all outline-none", "data-[state=checked]:bg-primary data-[state=unchecked]:bg-ghost", "focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50", className), ...props, children: _jsx(SwitchPrimitive.Thumb, { "data-slot": "switch-thumb", className: cn("pointer-events-none block size-4 rounded-full bg-surface ring-0 transition-transform", "data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0") }) }));
|
|
7
|
+
}
|
|
8
|
+
export { Switch };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
type FieldErrorMessage = {
|
|
3
|
+
message?: string;
|
|
4
|
+
} | undefined;
|
|
5
|
+
declare function FieldError({ className, children, errors, ...props }: React.ComponentProps<"div"> & {
|
|
6
|
+
errors?: FieldErrorMessage[];
|
|
7
|
+
}): React.JSX.Element | null;
|
|
8
|
+
export { FieldError };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
function uniqueMessages(errors) {
|
|
4
|
+
const messages = errors.map((error) => error?.message).filter((message) => !!message);
|
|
5
|
+
return [...new Set(messages)];
|
|
6
|
+
}
|
|
7
|
+
function FieldErrorContent({ messages }) {
|
|
8
|
+
if (messages.length === 1) {
|
|
9
|
+
return messages[0];
|
|
10
|
+
}
|
|
11
|
+
return (_jsx("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: messages.map((message) => (_jsx("li", { children: message }, message))) }));
|
|
12
|
+
}
|
|
13
|
+
function FieldError({ className, children, errors, ...props }) {
|
|
14
|
+
const messages = uniqueMessages(errors ?? []);
|
|
15
|
+
if (!children && messages.length === 0) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
return (_jsx("div", { role: "alert", "data-slot": "field-error", className: cn("text-sm font-normal text-destructive", className), ...props, children: children ?? _jsx(FieldErrorContent, { messages: messages }) }));
|
|
19
|
+
}
|
|
20
|
+
export { FieldError };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { Separator } from "../../display/separator.js";
|
|
4
|
+
function FieldSeparator({ children, className, ...props }) {
|
|
5
|
+
return (_jsxs("div", { "data-slot": "field-separator", "data-content": !!children, className: cn("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className), ...props, children: [_jsx(Separator, { className: "absolute inset-0 top-1/2" }), children && (_jsx("span", { className: "relative mx-auto block w-fit bg-background px-2 text-muted-foreground", "data-slot": "field-separator-content", children: children }))] }));
|
|
6
|
+
}
|
|
7
|
+
export { FieldSeparator };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
declare function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">): React.JSX.Element;
|
|
3
|
+
declare function FieldLegend({ className, variant, ...props }: React.ComponentProps<"legend"> & {
|
|
4
|
+
variant?: "legend" | "label";
|
|
5
|
+
}): React.JSX.Element;
|
|
6
|
+
export { FieldLegend, FieldSet };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
function FieldSet({ className, ...props }) {
|
|
4
|
+
return (_jsx("fieldset", { "data-slot": "field-set", className: cn("flex flex-col gap-6", "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", className), ...props }));
|
|
5
|
+
}
|
|
6
|
+
function FieldLegend({ className, variant = "legend", ...props }) {
|
|
7
|
+
return (_jsx("legend", { "data-slot": "field-legend", "data-variant": variant, className: cn("mb-3 font-medium", "data-[variant=legend]:text-base", "data-[variant=label]:text-sm", className), ...props }));
|
|
8
|
+
}
|
|
9
|
+
export { FieldLegend, FieldSet };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import { Label } from "../label.js";
|
|
3
|
+
declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>): React.JSX.Element;
|
|
4
|
+
declare function FieldTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
5
|
+
declare function FieldDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
|
6
|
+
export { FieldDescription, FieldLabel, FieldTitle };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { Label } from "../label.js";
|
|
4
|
+
function FieldLabel({ className, ...props }) {
|
|
5
|
+
return (_jsx(Label, { "data-slot": "field-label", className: cn("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4", "has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10", className), ...props }));
|
|
6
|
+
}
|
|
7
|
+
function FieldTitle({ className, ...props }) {
|
|
8
|
+
return (_jsx("div", { "data-slot": "field-label", className: cn("flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50", className), ...props }));
|
|
9
|
+
}
|
|
10
|
+
function FieldDescription({ className, ...props }) {
|
|
11
|
+
return (_jsx("p", { "data-slot": "field-description", className: cn("text-sm leading-normal font-normal text-muted-foreground group-has-[[data-orientation=horizontal]]/field:text-balance", "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className), ...props }));
|
|
12
|
+
}
|
|
13
|
+
export { FieldDescription, FieldLabel, FieldTitle };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
declare const fieldVariants: (props?: ({
|
|
4
|
+
orientation?: "horizontal" | "responsive" | "vertical" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare function Field({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>): React.JSX.Element;
|
|
7
|
+
declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
8
|
+
declare function FieldContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
|
+
export { Field, FieldContent, FieldGroup, fieldVariants };
|