@locusgraph/components 0.1.0 → 0.2.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/dist/action/button-group.d.ts +1 -1
- package/dist/action/button-group.js +2 -2
- package/dist/action/button.js +3 -3
- package/dist/action/toggle-group.d.ts +1 -1
- package/dist/action/toggle-group.js +3 -3
- package/dist/action/toggle.js +5 -5
- package/dist/display/badge.d.ts +1 -1
- package/dist/display/badge.js +4 -1
- package/dist/display/chart/chart-legend.js +1 -1
- package/dist/display/chart/chart-tooltip.js +3 -3
- package/dist/display/chat/attachment/attachment-parts.d.ts +1 -1
- package/dist/display/chat/attachment/attachment-parts.js +1 -1
- package/dist/display/chat/attachment/attachment.js +1 -1
- package/dist/display/chat/bubble.js +2 -2
- package/dist/display/chat/message-scroller.d.ts +1 -1
- package/dist/display/chat/message-scroller.js +2 -2
- package/dist/display/chat/message.js +2 -2
- package/dist/display/content/item.d.ts +1 -1
- package/dist/display/content/item.js +1 -1
- package/dist/display/content/kbd.js +1 -1
- package/dist/display/media/carousel-controls.d.ts +1 -1
- package/dist/display/media/carousel-controls.js +3 -3
- package/dist/display/rule-grid/rule-grid.d.ts +3 -1
- package/dist/display/rule-grid/rule-grid.js +8 -2
- package/dist/display/skeletons/layouts/skeleton-rule-grid.d.ts +8 -0
- package/dist/display/skeletons/layouts/skeleton-rule-grid.js +10 -0
- package/dist/display/skeletons/layouts/skeleton-table.d.ts +8 -0
- package/dist/display/skeletons/layouts/skeleton-table.js +16 -0
- package/dist/display/skeletons/shapes/skeleton-avatar.d.ts +10 -0
- package/dist/display/skeletons/shapes/skeleton-avatar.js +20 -0
- package/dist/display/skeletons/shapes/skeleton-button.d.ts +10 -0
- package/dist/display/skeletons/shapes/skeleton-button.js +20 -0
- package/dist/display/skeletons/shapes/skeleton-text.d.ts +7 -0
- package/dist/display/skeletons/shapes/skeleton-text.js +13 -0
- package/dist/display/skeletons/skeleton-parts.d.ts +11 -0
- package/dist/display/skeletons/skeleton-parts.js +11 -0
- package/dist/display/status/alert.d.ts +1 -1
- package/dist/display/status/alert.js +4 -2
- package/dist/display/status/empty.js +1 -1
- package/dist/display/status/progress.d.ts +5 -1
- package/dist/display/status/progress.js +19 -2
- package/dist/display/status/skeleton.js +1 -1
- package/dist/display/status/spinner.js +1 -1
- package/dist/display/table.js +1 -1
- package/dist/feedback/toaster.d.ts +1 -1
- package/dist/feedback/toaster.js +12 -14
- package/dist/form/advanced/calendar-day-button.js +2 -2
- package/dist/form/advanced/calendar.d.ts +1 -1
- package/dist/form/advanced/calendar.js +6 -6
- package/dist/form/advanced/combobox/combobox-chips.js +3 -3
- package/dist/form/advanced/combobox/combobox-items.js +2 -2
- package/dist/form/advanced/combobox/combobox.js +3 -3
- package/dist/form/advanced/input-otp.js +2 -2
- package/dist/form/choice/checkbox.js +3 -3
- package/dist/form/choice/radio-group.js +2 -2
- package/dist/form/choice/select.js +5 -5
- package/dist/form/choice/slider.js +1 -1
- package/dist/form/choice/switch.js +1 -1
- package/dist/form/field/field-separator.js +1 -1
- package/dist/form/field/field-text.d.ts +1 -1
- package/dist/form/field/field-text.js +1 -1
- package/dist/form/field/field.js +3 -3
- package/dist/form/hook-form/form.js +2 -2
- package/dist/form/input-group.d.ts +1 -1
- package/dist/form/input-group.js +7 -7
- package/dist/form/native-select.js +2 -2
- package/dist/index.d.ts +101 -95
- package/dist/index.js +100 -94
- package/dist/layout/accordion.js +3 -3
- package/dist/layout/resizable.js +1 -1
- package/dist/layout/scroll/scroll-area.d.ts +1 -1
- package/dist/layout/scroll/scroll-area.js +3 -3
- package/dist/layout/sidebar/sidebar-context.js +2 -2
- package/dist/layout/sidebar/sidebar-menu-sub.js +1 -1
- package/dist/layout/sidebar/sidebar-menu.d.ts +1 -1
- package/dist/layout/sidebar/sidebar-menu.js +2 -2
- package/dist/layout/sidebar/sidebar-sections.d.ts +2 -2
- package/dist/layout/sidebar/sidebar-sections.js +4 -4
- package/dist/layout/sidebar/sidebar.d.ts +1 -1
- package/dist/layout/sidebar/sidebar.js +4 -4
- package/dist/layout/tabs.js +3 -3
- package/dist/navigation/breadcrumb.js +1 -1
- package/dist/navigation/menubar/menubar-items.js +2 -2
- package/dist/navigation/menubar/menubar-sub.js +2 -2
- package/dist/navigation/menubar/menubar.js +2 -2
- package/dist/navigation/navigation-menu.js +3 -3
- package/dist/navigation/pagination.d.ts +1 -1
- package/dist/navigation/pagination.js +6 -5
- package/dist/overlay/alert-dialog.d.ts +1 -1
- package/dist/overlay/alert-dialog.js +4 -4
- package/dist/overlay/context-menu/context-menu-items.js +2 -2
- package/dist/overlay/context-menu/context-menu-sub.js +2 -2
- package/dist/overlay/context-menu/context-menu.js +1 -1
- package/dist/overlay/dialog.js +4 -4
- package/dist/overlay/floating/command.d.ts +1 -1
- package/dist/overlay/floating/command.js +6 -6
- package/dist/overlay/floating/drawer.js +5 -5
- package/dist/overlay/floating/hover-card.js +2 -2
- package/dist/overlay/menu/dropdown-menu-choice.js +1 -1
- package/dist/overlay/menu/dropdown-menu-item.js +1 -1
- package/dist/overlay/menu/dropdown-menu-sub.js +2 -2
- package/dist/overlay/menu/dropdown-menu.js +2 -2
- package/dist/overlay/popover.js +2 -2
- package/dist/overlay/sheet.js +7 -7
- package/dist/shell/app-header.js +2 -2
- package/dist/shell/app-shell.js +2 -2
- package/dist/shell/breadcrumbs.d.ts +1 -1
- package/dist/shell/breadcrumbs.js +1 -1
- package/dist/shell/docs/docs-header.d.ts +1 -1
- package/dist/shell/docs/docs-header.js +3 -3
- package/dist/shell/docs/docs-shell.js +1 -1
- package/dist/shell/docs/docs-sidebar.d.ts +1 -1
- package/dist/shell/docs/docs-sidebar.js +2 -2
- package/dist/shell/docs/on-this-page.js +2 -2
- package/dist/shell/navigation/app-sidebar.d.ts +2 -2
- package/dist/shell/navigation/app-sidebar.js +4 -4
- package/dist/shell/navigation/nav-group.d.ts +1 -1
- package/dist/shell/navigation/nav-group.js +2 -2
- package/dist/shell/theme-toggle.js +2 -2
- package/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { InProgress as Loader2Icon } from "@carbon/icons-react";
|
|
2
3
|
import { cn } from "cn";
|
|
3
|
-
import { Loader2Icon } from "lucide-react";
|
|
4
4
|
function Spinner({ className, ...props }) {
|
|
5
5
|
return (_jsx(Loader2Icon, { role: "status", "aria-label": "Loading", className: cn("size-4 animate-spin", className), ...props }));
|
|
6
6
|
}
|
package/dist/display/table.js
CHANGED
|
@@ -16,7 +16,7 @@ function TableRow({ className, ...props }) {
|
|
|
16
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
17
|
}
|
|
18
18
|
function TableHead({ className, ...props }) {
|
|
19
|
-
return (_jsx("th", { "data-slot": "table-head", className: cn("h-9 px-3 text-left align-middle font-
|
|
19
|
+
return (_jsx("th", { "data-slot": "table-head", className: cn("eyebrow h-9 px-3 text-left align-middle font-normal whitespace-nowrap sm:px-4 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className), ...props }));
|
|
20
20
|
}
|
|
21
21
|
function TableCell({ className, ...props }) {
|
|
22
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 }));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as React from "react";
|
|
2
2
|
import { type ToasterProps } from "sonner";
|
|
3
|
-
declare function Toaster({ theme, ...props }: ToasterProps): React.JSX.Element;
|
|
3
|
+
declare function Toaster({ theme, toastOptions, ...props }: ToasterProps): React.JSX.Element;
|
|
4
4
|
export { toast } from "sonner";
|
|
5
5
|
export { Toaster };
|
package/dist/feedback/toaster.js
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { CircleCheckIcon, InfoIcon, Loader2Icon, OctagonXIcon, TriangleAlertIcon, } from "
|
|
3
|
+
import { CheckmarkOutline as CircleCheckIcon, Information as InfoIcon, InProgress as Loader2Icon, ErrorOutline as OctagonXIcon, WarningAlt as TriangleAlertIcon, } from "@carbon/icons-react";
|
|
4
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
5
|
const toasterColors = {
|
|
13
6
|
"--normal-bg": "var(--popover)",
|
|
14
7
|
"--normal-text": "var(--popover-foreground)",
|
|
15
8
|
"--normal-border": "var(--border)",
|
|
16
9
|
"--border-radius": "var(--radius)",
|
|
17
|
-
...statusColors("success", "--good"),
|
|
18
|
-
...statusColors("info", "--info"),
|
|
19
|
-
...statusColors("warning", "--warn"),
|
|
20
|
-
...statusColors("error", "--bad"),
|
|
21
10
|
};
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
const statusRuleClassNames = {
|
|
12
|
+
success: "border-l-2! border-l-good! [&_[data-icon]]:text-good",
|
|
13
|
+
info: "border-l-2! border-l-info! [&_[data-icon]]:text-info",
|
|
14
|
+
warning: "border-l-2! border-l-warn! [&_[data-icon]]:text-warn",
|
|
15
|
+
error: "border-l-2! border-l-destructive! [&_[data-icon]]:text-destructive",
|
|
16
|
+
};
|
|
17
|
+
function Toaster({ theme = "system", toastOptions, ...props }) {
|
|
18
|
+
return (_jsx(Sonner, { theme: theme, className: "toaster group", toastOptions: {
|
|
19
|
+
...toastOptions,
|
|
20
|
+
classNames: { ...statusRuleClassNames, ...toastOptions?.classNames },
|
|
21
|
+
}, icons: {
|
|
24
22
|
success: _jsx(CircleCheckIcon, { className: "size-4" }),
|
|
25
23
|
info: _jsx(InfoIcon, { className: "size-4" }),
|
|
26
24
|
warning: _jsx(TriangleAlertIcon, { className: "size-4" }),
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { cn } from "cn";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { getDefaultClassNames } from "react-day-picker";
|
|
6
|
-
import { Button } from "../../action/button";
|
|
6
|
+
import { Button } from "../../action/button.js";
|
|
7
7
|
function CalendarDayButton({ className, day, modifiers, ...props }) {
|
|
8
8
|
const defaultClassNames = getDefaultClassNames();
|
|
9
9
|
const ref = React.useRef(null);
|
|
@@ -14,6 +14,6 @@ function CalendarDayButton({ className, day, modifiers, ...props }) {
|
|
|
14
14
|
return (_jsx(Button, { ref: ref, variant: "ghost", size: "icon", "data-day": day.date.toLocaleDateString(), "data-selected-single": modifiers.selected &&
|
|
15
15
|
!modifiers.range_start &&
|
|
16
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:
|
|
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:ring-2 group-data-[focused=true]/day:ring-ring/70 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]:rounded-none 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
18
|
}
|
|
19
19
|
export { CalendarDayButton };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { DayPicker } from "react-day-picker";
|
|
3
|
-
import { Button } from "../../action/button";
|
|
3
|
+
import { Button } from "../../action/button.js";
|
|
4
4
|
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, ...props }: React.ComponentProps<typeof DayPicker> & {
|
|
5
5
|
buttonVariant?: React.ComponentProps<typeof Button>["variant"];
|
|
6
6
|
}): React.JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronDown as ChevronDownIcon, ChevronLeft as ChevronLeftIcon, ChevronRight as ChevronRightIcon, } from "@carbon/icons-react";
|
|
3
4
|
import { cn } from "cn";
|
|
4
|
-
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
5
5
|
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
6
|
-
import { buttonVariants } from "../../action/button";
|
|
7
|
-
import { CalendarDayButton } from "./calendar-day-button";
|
|
6
|
+
import { buttonVariants } from "../../action/button.js";
|
|
7
|
+
import { CalendarDayButton } from "./calendar-day-button.js";
|
|
8
8
|
function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", formatters, components, ...props }) {
|
|
9
9
|
const defaultClassNames = getDefaultClassNames();
|
|
10
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: {
|
|
@@ -19,17 +19,17 @@ function Calendar({ className, classNames, showOutsideDays = true, captionLayout
|
|
|
19
19
|
button_next: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_next),
|
|
20
20
|
month_caption: cn("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", defaultClassNames.month_caption),
|
|
21
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-
|
|
22
|
+
dropdown_root: cn("relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-1 has-focus:ring-ring", defaultClassNames.dropdown_root),
|
|
23
23
|
dropdown: cn("absolute inset-0 bg-popover opacity-0", defaultClassNames.dropdown),
|
|
24
24
|
caption_label: cn("font-medium select-none", captionLayout === "label"
|
|
25
25
|
? "text-sm"
|
|
26
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
27
|
month_grid: cn("w-full border-collapse", defaultClassNames.month_grid),
|
|
28
28
|
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
29
|
-
weekday: cn("flex-1 rounded-md text-
|
|
29
|
+
weekday: cn("flex-1 rounded-md text-xs font-normal text-muted-foreground select-none", defaultClassNames.weekday),
|
|
30
30
|
week: cn("mt-2 flex w-full", defaultClassNames.week),
|
|
31
31
|
week_number_header: cn("w-(--cell-size) select-none", defaultClassNames.week_number_header),
|
|
32
|
-
week_number: cn("text-
|
|
32
|
+
week_number: cn("text-xs text-muted-foreground select-none", defaultClassNames.week_number),
|
|
33
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
34
|
? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md"
|
|
35
35
|
: "[&:first-child[data-selected=true]_button]:rounded-l-md", defaultClassNames.day),
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Combobox as ComboboxPrimitive } from "@base-ui/react";
|
|
4
|
+
import { Close as XIcon } from "@carbon/icons-react";
|
|
4
5
|
import { cn } from "cn";
|
|
5
|
-
import { XIcon } from "lucide-react";
|
|
6
6
|
import * as React from "react";
|
|
7
|
-
import { Button } from "../../../action/button";
|
|
7
|
+
import { Button } from "../../../action/button.js";
|
|
8
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-
|
|
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-1 focus-within:ring-ring has-aria-invalid:border-destructive 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
10
|
}
|
|
11
11
|
function ComboboxChip({ className, children, showRemove = true, ...props }) {
|
|
12
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" }) }))] }));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Combobox as ComboboxPrimitive } from "@base-ui/react";
|
|
4
|
+
import { Checkmark as CheckIcon } from "@carbon/icons-react";
|
|
4
5
|
import { cn } from "cn";
|
|
5
|
-
import { CheckIcon } from "lucide-react";
|
|
6
6
|
function ComboboxItem({ className, children, ...props }) {
|
|
7
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
8
|
}
|
|
@@ -10,7 +10,7 @@ function ComboboxGroup({ className, ...props }) {
|
|
|
10
10
|
return (_jsx(ComboboxPrimitive.Group, { "data-slot": "combobox-group", className: cn(className), ...props }));
|
|
11
11
|
}
|
|
12
12
|
function ComboboxLabel({ className, ...props }) {
|
|
13
|
-
return (_jsx(ComboboxPrimitive.GroupLabel, { "data-slot": "combobox-label", className: cn("px-2
|
|
13
|
+
return (_jsx(ComboboxPrimitive.GroupLabel, { "data-slot": "combobox-label", className: cn("eyebrow px-2 pt-2 pb-1 pointer-coarse:px-3", className), ...props }));
|
|
14
14
|
}
|
|
15
15
|
function ComboboxCollection({ ...props }) {
|
|
16
16
|
return _jsx(ComboboxPrimitive.Collection, { "data-slot": "combobox-collection", ...props });
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Combobox as ComboboxPrimitive } from "@base-ui/react";
|
|
4
|
+
import { ChevronDown as ChevronDownIcon, Close as XIcon } from "@carbon/icons-react";
|
|
4
5
|
import { cn } from "cn";
|
|
5
|
-
import {
|
|
6
|
-
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "../../input-group";
|
|
6
|
+
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "../../input-group.js";
|
|
7
7
|
const Combobox = ComboboxPrimitive.Root;
|
|
8
8
|
function ComboboxValue({ ...props }) {
|
|
9
9
|
return _jsx(ComboboxPrimitive.Value, { "data-slot": "combobox-value", ...props });
|
|
@@ -18,7 +18,7 @@ function ComboboxInput({ className, children, disabled = false, showTrigger = tr
|
|
|
18
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
19
|
}
|
|
20
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-
|
|
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-overlay ring-1 ring-border 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-overlay 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
22
|
}
|
|
23
23
|
function ComboboxList({ className, ...props }) {
|
|
24
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 }));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Subtract as MinusIcon } from "@carbon/icons-react";
|
|
3
4
|
import { cn } from "cn";
|
|
4
5
|
import { OTPInput, OTPInputContext } from "input-otp";
|
|
5
|
-
import { MinusIcon } from "lucide-react";
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
function InputOTP({ className, containerClassName, ...props }) {
|
|
8
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 }));
|
|
@@ -13,7 +13,7 @@ function InputOTPGroup({ className, ...props }) {
|
|
|
13
13
|
function InputOTPSlot({ index, className, ...props }) {
|
|
14
14
|
const inputOTPContext = React.useContext(OTPInputContext);
|
|
15
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-
|
|
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 font-mono text-base tabular-nums 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-1 data-[active=true]:ring-ring 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
17
|
}
|
|
18
18
|
function InputOTPSeparator({ ...props }) {
|
|
19
19
|
return (_jsx("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: _jsx(MinusIcon, {}) }));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Checkmark as CheckIcon, Subtract as MinusIcon } from "@carbon/icons-react";
|
|
3
4
|
import { cn } from "cn";
|
|
4
|
-
import { CheckIcon } from "lucide-react";
|
|
5
5
|
import * as CheckboxPrimitive from "radix-ui/checkbox";
|
|
6
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:
|
|
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", "data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]: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: _jsxs(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "group/indicator flex items-center justify-center text-current", children: [_jsx(CheckIcon, { className: "size-3.5 group-data-[state=indeterminate]/indicator:hidden" }), _jsx(MinusIcon, { className: "hidden size-3.5 group-data-[state=indeterminate]/indicator:block" })] }) }));
|
|
8
8
|
}
|
|
9
9
|
export { Checkbox };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { CircleSolid as CircleIcon } from "@carbon/icons-react";
|
|
3
4
|
import { cn } from "cn";
|
|
4
|
-
import { CircleIcon } from "lucide-react";
|
|
5
5
|
import * as RadioGroupPrimitive from "radix-ui/radio-group";
|
|
6
6
|
function RadioGroup({ className, ...props }) {
|
|
7
7
|
return (_jsx(RadioGroupPrimitive.Root, { "data-slot": "radio-group", className: cn("grid gap-3", className), ...props }));
|
|
8
8
|
}
|
|
9
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:
|
|
10
|
+
return (_jsx(RadioGroupPrimitive.Item, { "data-slot": "radio-group-item", className: cn("peer aspect-square size-4 shrink-0 rounded-full border border-input text-primary shadow-xs transition-[color,box-shadow] outline-none data-[state=checked]:border-primary 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: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
11
|
}
|
|
12
12
|
export { RadioGroup, RadioGroupItem };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Checkmark as CheckIcon, ChevronDown as ChevronDownIcon, ChevronUp as ChevronUpIcon, } from "@carbon/icons-react";
|
|
3
4
|
import { cn } from "cn";
|
|
4
|
-
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
5
5
|
import * as SelectPrimitive from "radix-ui/select";
|
|
6
6
|
function Select({ ...props }) {
|
|
7
7
|
return _jsx(SelectPrimitive.Root, { "data-slot": "select", ...props });
|
|
@@ -13,15 +13,15 @@ function SelectValue({ ...props }) {
|
|
|
13
13
|
return _jsx(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
14
14
|
}
|
|
15
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
|
|
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 text-muted-foreground" }) })] }));
|
|
17
17
|
}
|
|
18
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
|
|
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" &&
|
|
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 bg-popover text-popover-foreground shadow-overlay ring-1 ring-border 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.5 data-[side=left]:-translate-x-1.5 data-[side=right]:translate-x-1.5 data-[side=top]:-translate-y-1.5", className), position: position, align: align, ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { className: cn("p-1", position === "popper" &&
|
|
21
21
|
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"), children: children }), _jsx(SelectScrollDownButton, {})] }) }));
|
|
22
22
|
}
|
|
23
23
|
function SelectLabel({ className, ...props }) {
|
|
24
|
-
return (_jsx(SelectPrimitive.Label, { "data-slot": "select-label", className: cn("px-2
|
|
24
|
+
return (_jsx(SelectPrimitive.Label, { "data-slot": "select-label", className: cn("eyebrow px-2 pt-2 pb-1", className), ...props }));
|
|
25
25
|
}
|
|
26
26
|
function SelectItem({ className, children, ...props }) {
|
|
27
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 })] }));
|
|
@@ -5,6 +5,6 @@ import * as SliderPrimitive from "radix-ui/slider";
|
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
function Slider({ className, defaultValue, value, min = 0, max = 100, ...props }) {
|
|
7
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-
|
|
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-input 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-background shadow-sm transition-[color,box-shadow] focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50" }, index)))] }));
|
|
9
9
|
}
|
|
10
10
|
export { Slider };
|
|
@@ -3,6 +3,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { cn } from "cn";
|
|
4
4
|
import * as SwitchPrimitive from "radix-ui/switch";
|
|
5
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-
|
|
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 px-px transition-all outline-none", "data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", "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-background shadow-sm ring-0 transition-transform", "data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0") }) }));
|
|
7
7
|
}
|
|
8
8
|
export { Switch };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "cn";
|
|
3
|
-
import { Separator } from "../../display/separator";
|
|
3
|
+
import { Separator } from "../../display/separator.js";
|
|
4
4
|
function FieldSeparator({ children, className, ...props }) {
|
|
5
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
6
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as React from "react";
|
|
2
|
-
import { Label } from "../label";
|
|
2
|
+
import { Label } from "../label.js";
|
|
3
3
|
declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>): React.JSX.Element;
|
|
4
4
|
declare function FieldTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
5
5
|
declare function FieldDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "cn";
|
|
3
|
-
import { Label } from "../label";
|
|
3
|
+
import { Label } from "../label.js";
|
|
4
4
|
function FieldLabel({ className, ...props }) {
|
|
5
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
6
|
}
|
package/dist/form/field/field.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
3
|
import { cn } from "cn";
|
|
4
|
-
const fieldVariants = cva("group/field flex w-full gap-3
|
|
4
|
+
const fieldVariants = cva("group/field flex w-full gap-3", {
|
|
5
5
|
variants: {
|
|
6
6
|
orientation: {
|
|
7
|
-
vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
|
|
7
|
+
vertical: ["flex-col gap-2 [&>*]:w-full [&>.sr-only]:w-auto"],
|
|
8
8
|
horizontal: [
|
|
9
9
|
"flex-row items-center",
|
|
10
10
|
"[&>[data-slot=field-label]]:flex-auto",
|
|
11
11
|
"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
12
12
|
],
|
|
13
13
|
responsive: [
|
|
14
|
-
"flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto",
|
|
14
|
+
"flex-col gap-2 @md/field-group:flex-row @md/field-group:gap-3 @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto",
|
|
15
15
|
"@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
|
16
16
|
"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
17
17
|
],
|
|
@@ -4,7 +4,7 @@ import { cn } from "cn";
|
|
|
4
4
|
import * as Slot from "radix-ui/slot";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { Controller, FormProvider, useFormContext, useFormState, } from "react-hook-form";
|
|
7
|
-
import { Label } from "../label";
|
|
7
|
+
import { Label } from "../label.js";
|
|
8
8
|
const Form = FormProvider;
|
|
9
9
|
const FormFieldContext = React.createContext({});
|
|
10
10
|
const FormField = ({ ...props }) => {
|
|
@@ -36,7 +36,7 @@ function FormItem({ className, ...props }) {
|
|
|
36
36
|
}
|
|
37
37
|
function FormLabel({ className, ...props }) {
|
|
38
38
|
const { error, formItemId } = useFormField();
|
|
39
|
-
return (_jsx(Label, { "data-slot": "form-label", "data-error": !!error, className:
|
|
39
|
+
return (_jsx(Label, { "data-slot": "form-label", "data-error": !!error, className: className, htmlFor: formItemId, ...props }));
|
|
40
40
|
}
|
|
41
41
|
function FormControl({ ...props }) {
|
|
42
42
|
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { Button } from "../action/button";
|
|
3
|
+
import { Button } from "../action/button.js";
|
|
4
4
|
declare function InputGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
5
5
|
declare const inputGroupAddonVariants: (props?: ({
|
|
6
6
|
align?: "block-end" | "block-start" | "inline-end" | "inline-start" | null | undefined;
|
package/dist/form/input-group.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
import { cn } from "cn";
|
|
5
|
-
import { Button } from "../action/button";
|
|
6
|
-
import { Input } from "./input";
|
|
7
|
-
import { Textarea } from "./textarea";
|
|
5
|
+
import { Button } from "../action/button.js";
|
|
6
|
+
import { Input } from "./input.js";
|
|
7
|
+
import { Textarea } from "./textarea.js";
|
|
8
8
|
const inputGroupAlignmentClasses = [
|
|
9
9
|
"has-[>[data-align=inline-start]]:[&>input]:pl-2",
|
|
10
10
|
"has-[>[data-align=inline-end]]:[&>input]:pr-2",
|
|
@@ -40,10 +40,10 @@ function InputGroupAddon({ className, align = "inline-start", ...props }) {
|
|
|
40
40
|
const inputGroupButtonVariants = cva("flex items-center gap-2 text-sm shadow-none", {
|
|
41
41
|
variants: {
|
|
42
42
|
size: {
|
|
43
|
-
xs: "h-6 gap-1 rounded-
|
|
44
|
-
sm: "h-8 gap-1.5 rounded-
|
|
45
|
-
"icon-xs": "size-6 rounded-
|
|
46
|
-
"icon-sm": "size-8 p-0 has-[>svg]:p-0",
|
|
43
|
+
xs: "h-6 gap-1 rounded-full px-2.5 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",
|
|
44
|
+
sm: "h-8 gap-1.5 rounded-full px-3 has-[>svg]:px-2.5",
|
|
45
|
+
"icon-xs": "size-6 rounded-full p-0 has-[>svg]:p-0",
|
|
46
|
+
"icon-sm": "size-8 rounded-full p-0 has-[>svg]:p-0",
|
|
47
47
|
},
|
|
48
48
|
},
|
|
49
49
|
defaultVariants: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronDown as ChevronDownIcon } from "@carbon/icons-react";
|
|
2
3
|
import { cn } from "cn";
|
|
3
|
-
import { ChevronDownIcon } from "lucide-react";
|
|
4
4
|
function NativeSelect({ className, size = "default", ...props }) {
|
|
5
|
-
return (_jsxs("div", { className: "group/native-select relative w-fit has-[select:disabled]:opacity-50", "data-slot": "native-select-wrapper", children: [_jsx("select", { "data-slot": "native-select", "data-size": size, className: cn("h-9 w-full min-w-0 appearance-none rounded-md border border-input bg-transparent px-3 py-2 pr-9 text-sm shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed data-[size=sm]:h-8 data-[size=sm]:py-1 dark:bg-input/30 dark:hover:bg-input/50", "focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring", "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", className), ...props }), _jsx(ChevronDownIcon, { className: "pointer-events-none absolute top-1/2 right-3.5 size-4 -translate-y-1/2 text-muted-foreground
|
|
5
|
+
return (_jsxs("div", { className: "group/native-select relative w-fit has-[select:disabled]:opacity-50", "data-slot": "native-select-wrapper", children: [_jsx("select", { "data-slot": "native-select", "data-size": size, className: cn("h-9 w-full min-w-0 appearance-none rounded-md border border-input bg-transparent px-3 py-2 pr-9 text-sm shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground has-[option[value='']:checked]:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed data-[size=sm]:h-8 data-[size=sm]:py-1 dark:bg-input/30 dark:hover:bg-input/50", "focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring", "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", className), ...props }), _jsx(ChevronDownIcon, { className: "pointer-events-none absolute top-1/2 right-3.5 size-4 -translate-y-1/2 text-muted-foreground select-none", "aria-hidden": "true", "data-slot": "native-select-icon" })] }));
|
|
6
6
|
}
|
|
7
7
|
function NativeSelectOption({ className, ...props }) {
|
|
8
8
|
return (_jsx("option", { "data-slot": "native-select-option", className: cn("bg-[Canvas] text-[CanvasText]", className), ...props }));
|