@getgreenline/blaze-ui 1.0.49-beta.0 → 1.0.49-beta.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/dist/components/badge.js +6 -6
- package/dist/components/button-group.js +5 -5
- package/dist/components/button.js +10 -10
- package/dist/components/chart.js +3 -3
- package/dist/components/command.js +4 -4
- package/dist/components/data-table.js +7 -7
- package/dist/components/dropdown-menu.js +6 -6
- package/dist/components/field.js +14 -14
- package/dist/components/form.js +1 -1
- package/dist/components/header-app-switcher.js +2 -2
- package/dist/components/hierarchical-select.js +3 -3
- package/dist/components/item.js +6 -6
- package/dist/components/login-screen.js +3 -3
- package/dist/components/login-screen.views.js +3 -3
- package/dist/components/multi-search-select.js +3 -3
- package/dist/components/multi-select.js +3 -3
- package/dist/components/navigation-menu.js +6 -6
- package/dist/components/pagination.js +3 -3
- package/dist/components/popover.js +1 -1
- package/dist/components/resizable.js +2 -2
- package/dist/components/search-bar.js +1 -1
- package/dist/components/select.js +4 -4
- package/dist/components/sidebar.js +25 -25
- package/dist/components/slider.js +2 -2
- package/dist/components/table.js +6 -6
- package/dist/components/tabs.js +1 -1
- package/dist/components/toggle-group.js +2 -2
- package/dist/components/toggle.js +1 -1
- package/dist/components/tooltip.js +1 -1
- package/package.json +1 -1
package/dist/components/badge.js
CHANGED
|
@@ -3,14 +3,14 @@ import { Slot } from '@radix-ui/react-slot';
|
|
|
3
3
|
import { cva } from 'class-variance-authority';
|
|
4
4
|
import { cn } from '../lib/utils.js';
|
|
5
5
|
|
|
6
|
-
const badgeVariants = cva("tw:!inline-flex tw:!items-center tw:!justify-center tw:!rounded-md tw:!border tw:!px-2 tw:!py-0.5 tw:!text-[12px] tw:!font-medium tw:!w-fit tw:!whitespace-nowrap tw:!shrink-0 [&>svg]
|
|
6
|
+
const badgeVariants = cva("tw:!inline-flex tw:!items-center tw:!justify-center tw:!rounded-md tw:!border tw:!px-2 tw:!py-0.5 tw:!text-[12px] tw:!font-medium tw:!w-fit tw:!whitespace-nowrap tw:!shrink-0 tw:[&>svg]:!size-3 tw:!gap-1 tw:[&>svg]:!pointer-events-none tw:focus-visible:!border-ring tw:focus-visible:!ring-ring/50 tw:focus-visible:!ring-[3px] tw:aria-invalid:!ring-destructive/20 tw:dark:aria-invalid:!ring-destructive/40 tw:aria-invalid:!border-destructive tw:!transition-[color,box-shadow] tw:!overflow-hidden", {
|
|
7
7
|
variants: {
|
|
8
8
|
variant: {
|
|
9
|
-
default: "tw:!border-transparent tw:!bg-primary tw:!text-primary-foreground [a&]:hover
|
|
10
|
-
secondary: "tw:!border-transparent tw:!bg-secondary tw:!text-secondary-foreground [a&]:hover
|
|
11
|
-
soft: "tw:!border-primary/20 tw:!bg-primary/10 tw:!text-primary dark
|
|
12
|
-
destructive: "tw:!border-transparent tw:!bg-destructive tw:!text-white [a&]:hover
|
|
13
|
-
outline: "tw:!text-foreground [a&]:hover
|
|
9
|
+
default: "tw:!border-transparent tw:!bg-primary tw:!text-primary-foreground tw:[a&]:hover:!bg-primary/90",
|
|
10
|
+
secondary: "tw:!border-transparent tw:!bg-secondary tw:!text-secondary-foreground tw:[a&]:hover:!bg-secondary/90",
|
|
11
|
+
soft: "tw:!border-primary/20 tw:!bg-primary/10 tw:!text-primary tw:dark:!border-primary/30 tw:dark:!bg-primary/20",
|
|
12
|
+
destructive: "tw:!border-transparent tw:!bg-destructive tw:!text-white tw:[a&]:hover:!bg-destructive/90 tw:focus-visible:!ring-destructive/20 tw:dark:focus-visible:!ring-destructive/40 tw:dark:!bg-destructive/60",
|
|
13
|
+
outline: "tw:!text-foreground tw:[a&]:hover:!bg-accent tw:[a&]:hover:!text-accent-foreground",
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
defaultVariants: {
|
|
@@ -4,11 +4,11 @@ import { cva } from 'class-variance-authority';
|
|
|
4
4
|
import { cn } from '../lib/utils.js';
|
|
5
5
|
import { Separator } from './separator.js';
|
|
6
6
|
|
|
7
|
-
const buttonGroupVariants = cva("tw:flex tw:w-fit tw:items-stretch [&>*]:focus-visible:
|
|
7
|
+
const buttonGroupVariants = cva("tw:flex tw:w-fit tw:items-stretch tw:[&>*]:focus-visible:z-10 tw:[&>*]:focus-visible:relative tw:[&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit tw:[&>input]:flex-1 tw:has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md tw:has-[>[data-slot=button-group]]:gap-2", {
|
|
8
8
|
variants: {
|
|
9
9
|
orientation: {
|
|
10
|
-
horizontal: "[&>*:not(:first-child)]:
|
|
11
|
-
vertical: "tw:flex-col [&>*:not(:first-child)]:
|
|
10
|
+
horizontal: "tw:[&>*:not(:first-child)]:rounded-l-none tw:[&>*:not(:first-child)]:border-l-0 tw:[&>*:not(:last-child)]:rounded-r-none",
|
|
11
|
+
vertical: "tw:flex-col tw:[&>*:not(:first-child)]:rounded-t-none tw:[&>*:not(:first-child)]:border-t-0 tw:[&>*:not(:last-child)]:rounded-b-none",
|
|
12
12
|
},
|
|
13
13
|
},
|
|
14
14
|
defaultVariants: {
|
|
@@ -20,10 +20,10 @@ function ButtonGroup({ className, orientation, ...props }) {
|
|
|
20
20
|
}
|
|
21
21
|
function ButtonGroupText({ className, asChild = false, ...props }) {
|
|
22
22
|
const Comp = asChild ? Slot : "div";
|
|
23
|
-
return (jsx(Comp, { className: cn("tw:bg-muted tw:flex tw:items-center tw:gap-2 tw:rounded-md tw:border tw:px-4 tw:text-sm tw:font-medium tw:shadow-xs [&_svg]:
|
|
23
|
+
return (jsx(Comp, { className: cn("tw:bg-muted tw:flex tw:items-center tw:gap-2 tw:rounded-md tw:border tw:px-4 tw:text-sm tw:font-medium tw:shadow-xs tw:[&_svg]:pointer-events-none tw:[&_svg:not([class*='size-'])]:size-4", className), ...props }));
|
|
24
24
|
}
|
|
25
25
|
function ButtonGroupSeparator({ className, orientation = "vertical", ...props }) {
|
|
26
|
-
return (jsx(Separator, { "data-slot": "button-group-separator", orientation: orientation, className: cn("tw:bg-input tw:relative
|
|
26
|
+
return (jsx(Separator, { "data-slot": "button-group-separator", orientation: orientation, className: cn("tw:bg-input tw:relative tw:!m-0 tw:self-stretch tw:data-[orientation=vertical]:h-auto", className), ...props }));
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };
|
|
@@ -5,20 +5,20 @@ import { cva } from 'class-variance-authority';
|
|
|
5
5
|
import { LoaderCircleIcon } from 'lucide-react';
|
|
6
6
|
import { cn } from '../lib/utils.js';
|
|
7
7
|
|
|
8
|
-
const buttonVariants = cva("tw:!relative tw:!inline-flex tw:!items-center tw:!justify-center tw:!gap-2 tw:!whitespace-nowrap tw:rounded-md tw:text-sm tw:!font-medium tw:!transition-all tw:!cursor-pointer disabled
|
|
8
|
+
const buttonVariants = cva("tw:!relative tw:!inline-flex tw:!items-center tw:!justify-center tw:!gap-2 tw:!whitespace-nowrap tw:rounded-md tw:text-sm tw:!font-medium tw:!transition-all tw:!cursor-pointer tw:disabled:!cursor-not-allowed tw:disabled:!pointer-events-none tw:data-[disabled]:!pointer-events-none tw:data-[loading]:!pointer-events-none tw:disabled:!opacity-50 tw:data-[disabled]:!opacity-50 tw:[&_svg]:!pointer-events-none tw:[&_svg:not([class*='size-'])]:!size-4 tw:!shrink-0 tw:[&_svg]:!shrink-0 tw:!outline-none tw:focus-visible:!border-ring tw:focus-visible:!ring-ring/50 tw:focus-visible:!ring-[3px] tw:aria-invalid:!ring-destructive/20 tw:dark:aria-invalid:!ring-destructive/40 tw:aria-invalid:!border-destructive", {
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
|
-
default: "tw:!bg-primary tw:!text-primary-foreground tw:!shadow-xs hover
|
|
12
|
-
destructive: "tw:!bg-destructive tw:!text-white tw:!shadow-xs hover
|
|
13
|
-
outline: "tw:!border tw:!bg-background tw:!shadow-xs hover
|
|
14
|
-
secondary: "tw:!bg-secondary tw:!text-secondary-foreground tw:!shadow-xs hover
|
|
15
|
-
ghost: "hover
|
|
16
|
-
link: "tw:!text-primary tw:!underline-offset-4 hover
|
|
11
|
+
default: "tw:!bg-primary tw:!text-primary-foreground tw:!shadow-xs tw:hover:!bg-primary/90",
|
|
12
|
+
destructive: "tw:!bg-destructive tw:!text-white tw:!shadow-xs tw:hover:!bg-destructive/90 tw:focus-visible:!ring-destructive/20 tw:dark:focus-visible:!ring-destructive/40 tw:dark:!bg-destructive/60",
|
|
13
|
+
outline: "tw:!border tw:!bg-background tw:!shadow-xs tw:hover:!bg-accent tw:hover:!text-accent-foreground tw:dark:!bg-input/30 tw:dark:!border-input tw:dark:hover:!bg-input/50",
|
|
14
|
+
secondary: "tw:!bg-secondary tw:!text-secondary-foreground tw:!shadow-xs tw:hover:!bg-secondary/80",
|
|
15
|
+
ghost: "tw:hover:!bg-accent tw:hover:!text-accent-foreground tw:dark:hover:!bg-accent/50",
|
|
16
|
+
link: "tw:!text-primary tw:!underline-offset-4 tw:hover:!underline",
|
|
17
17
|
},
|
|
18
18
|
size: {
|
|
19
|
-
default: "tw:!h-9 tw:!px-4 tw:!py-2 has-[>svg]
|
|
20
|
-
sm: "tw:!h-8 tw:!rounded-md tw:!gap-1.5 tw:!px-3 has-[>svg]
|
|
21
|
-
lg: "tw:!h-10 tw:!rounded-md tw:!px-6 has-[>svg]
|
|
19
|
+
default: "tw:!h-9 tw:!px-4 tw:!py-2 tw:has-[>svg]:!px-3",
|
|
20
|
+
sm: "tw:!h-8 tw:!rounded-md tw:!gap-1.5 tw:!px-3 tw:has-[>svg]:!px-2.5",
|
|
21
|
+
lg: "tw:!h-10 tw:!rounded-md tw:!px-6 tw:has-[>svg]:!px-4",
|
|
22
22
|
icon: "tw:!size-9",
|
|
23
23
|
},
|
|
24
24
|
},
|
package/dist/components/chart.js
CHANGED
|
@@ -16,7 +16,7 @@ function useChart() {
|
|
|
16
16
|
function ChartContainer({ id, className, children, config, ...props }) {
|
|
17
17
|
const uniqueId = React.useId();
|
|
18
18
|
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
19
|
-
return (jsx(ChartContext.Provider, { value: { config }, children: jsxs("div", { "data-slot": "chart", "data-chart": chartId, className: cn("[&_.recharts-cartesian-axis-tick_text]:
|
|
19
|
+
return (jsx(ChartContext.Provider, { value: { config }, children: jsxs("div", { "data-slot": "chart", "data-chart": chartId, className: cn("tw:[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground tw:[&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 tw:[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border tw:[&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border tw:[&_.recharts-radial-bar-background-sector]:fill-muted tw:[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted tw:[&_.recharts-reference-line_[stroke='#ccc']]:stroke-border tw:flex tw:aspect-video tw:justify-center tw:text-xs tw:[&_.recharts-dot[stroke='#fff']]:stroke-transparent tw:[&_.recharts-layer]:outline-hidden tw:[&_.recharts-sector]:outline-hidden tw:[&_.recharts-sector[stroke='#fff']]:stroke-transparent tw:[&_.recharts-surface]:outline-hidden", className), ...props, children: [jsx(ChartStyle, { id: chartId, config: config }), jsx(RechartsPrimitive.ResponsiveContainer, { children: children })] }) }));
|
|
20
20
|
}
|
|
21
21
|
const ChartStyle = ({ id, config }) => {
|
|
22
22
|
const colorConfig = Object.entries(config).filter(([, config]) => config.theme || config.color);
|
|
@@ -78,7 +78,7 @@ function ChartTooltipContent({ active, payload, className, indicator = "dot", hi
|
|
|
78
78
|
const key = `${nameKey || item.name || item.dataKey || "value"}`;
|
|
79
79
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
80
80
|
const indicatorColor = color || item.payload?.fill || item.color;
|
|
81
|
-
return (jsx("div", { className: cn("[&>svg]:
|
|
81
|
+
return (jsx("div", { className: cn("tw:[&>svg]:text-muted-foreground tw:flex tw:w-full tw:flex-wrap tw:items-stretch tw:gap-2 tw:[&>svg]:h-2.5 tw:[&>svg]:w-2.5", indicator === "dot" && "tw:items-center"), children: formatter && item?.value !== undefined && item.name ? (formatter(item.value, item.name, item, index, item.payload)) : (jsxs(Fragment, { children: [itemConfig?.icon ? (jsx(itemConfig.icon, {})) : (!hideIndicator && (jsx("div", { className: cn("tw:shrink-0 tw:rounded-[2px] tw:border-(--color-border) tw:bg-(--color-bg)", {
|
|
82
82
|
"tw:h-2.5 tw:w-2.5": indicator === "dot",
|
|
83
83
|
"tw:w-1": indicator === "line",
|
|
84
84
|
"tw:w-0 tw:border-[1.5px] tw:border-dashed tw:bg-transparent": indicator === "dashed",
|
|
@@ -100,7 +100,7 @@ function ChartLegendContent({ className, hideIcon = false, payload, verticalAlig
|
|
|
100
100
|
.map((item) => {
|
|
101
101
|
const key = `${nameKey || item.dataKey || "value"}`;
|
|
102
102
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
103
|
-
return (jsxs("div", { className: cn("[&>svg]:
|
|
103
|
+
return (jsxs("div", { className: cn("tw:[&>svg]:text-muted-foreground tw:flex tw:items-center tw:gap-1.5 tw:[&>svg]:h-3 tw:[&>svg]:w-3"), children: [itemConfig?.icon && !hideIcon ? (jsx(itemConfig.icon, {})) : (jsx("div", { className: "tw:h-2 tw:w-2 tw:shrink-0 tw:rounded-[2px]", style: {
|
|
104
104
|
backgroundColor: item.color,
|
|
105
105
|
} })), itemConfig?.label] }, String(item.value ?? item.dataKey ?? item.name)));
|
|
106
106
|
}) }));
|
|
@@ -8,10 +8,10 @@ function Command({ className, ...props }) {
|
|
|
8
8
|
return (jsx(Command$1, { "data-slot": "command", className: cn("tw:bg-popover tw:text-popover-foreground tw:flex tw:h-full tw:w-full tw:flex-col tw:overflow-hidden tw:rounded-md", className), ...props }));
|
|
9
9
|
}
|
|
10
10
|
function CommandDialog({ title = "Command Palette", description = "Search for a command to run...", children, className, showCloseButton = true, ...props }) {
|
|
11
|
-
return (jsxs(Dialog, { ...props, children: [jsxs(DialogHeader, { className: "tw:sr-only", children: [jsx(DialogTitle, { children: title }), jsx(DialogDescription, { children: description })] }), jsx(DialogContent, { className: cn("tw:overflow-hidden tw:p-0", className), showCloseButton: showCloseButton, children: jsx(Command, { className: "[&_[cmdk-group-heading]]:
|
|
11
|
+
return (jsxs(Dialog, { ...props, children: [jsxs(DialogHeader, { className: "tw:sr-only", children: [jsx(DialogTitle, { children: title }), jsx(DialogDescription, { children: description })] }), jsx(DialogContent, { className: cn("tw:overflow-hidden tw:p-0", className), showCloseButton: showCloseButton, children: jsx(Command, { className: "tw:[&_[cmdk-group-heading]]:text-muted-foreground tw:**:data-[slot=command-input-wrapper]:h-12 tw:[&_[cmdk-group-heading]]:px-2 tw:[&_[cmdk-group-heading]]:font-medium tw:[&_[cmdk-group]]:px-2 tw:[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 tw:[&_[cmdk-input-wrapper]_svg]:h-5 tw:[&_[cmdk-input-wrapper]_svg]:w-5 tw:[&_[cmdk-input]]:h-12 tw:[&_[cmdk-item]]:px-2 tw:[&_[cmdk-item]]:py-3 tw:[&_[cmdk-item]_svg]:h-5 tw:[&_[cmdk-item]_svg]:w-5", children: children }) })] }));
|
|
12
12
|
}
|
|
13
13
|
function CommandInput({ className, ...props }) {
|
|
14
|
-
return (jsxs("div", { "data-slot": "command-input-wrapper", className: "tw:flex tw:h-9 tw:items-center tw:gap-2 tw:border-b tw:px-3", children: [jsx(SearchIcon, { className: "tw:size-4 tw:shrink-0 tw:opacity-50" }), jsx(Command$1.Input, { "data-slot": "command-input", className: cn("placeholder:
|
|
14
|
+
return (jsxs("div", { "data-slot": "command-input-wrapper", className: "tw:flex tw:h-9 tw:items-center tw:gap-2 tw:border-b tw:px-3", children: [jsx(SearchIcon, { className: "tw:size-4 tw:shrink-0 tw:opacity-50" }), jsx(Command$1.Input, { "data-slot": "command-input", className: cn("tw:placeholder:text-muted-foreground tw:flex tw:h-10 tw:w-full tw:rounded-md tw:bg-transparent tw:py-3 tw:text-sm tw:outline-hidden tw:disabled:cursor-not-allowed tw:disabled:opacity-50", className), ...props })] }));
|
|
15
15
|
}
|
|
16
16
|
function CommandList({ className, ...props }) {
|
|
17
17
|
return (jsx(Command$1.List, { "data-slot": "command-list", className: cn("tw:max-h-[300px] tw:scroll-py-1 tw:overflow-x-hidden tw:overflow-y-auto", className), ...props }));
|
|
@@ -20,13 +20,13 @@ function CommandEmpty({ ...props }) {
|
|
|
20
20
|
return (jsx(Command$1.Empty, { "data-slot": "command-empty", className: "tw:py-6 tw:text-center tw:text-sm", ...props }));
|
|
21
21
|
}
|
|
22
22
|
function CommandGroup({ className, ...props }) {
|
|
23
|
-
return (jsx(Command$1.Group, { "data-slot": "command-group", className: cn("tw:text-foreground [&_[cmdk-group-heading]]:
|
|
23
|
+
return (jsx(Command$1.Group, { "data-slot": "command-group", className: cn("tw:text-foreground tw:[&_[cmdk-group-heading]]:text-muted-foreground tw:overflow-hidden tw:p-1 tw:[&_[cmdk-group-heading]]:px-2 tw:[&_[cmdk-group-heading]]:py-1.5 tw:[&_[cmdk-group-heading]]:text-xs tw:[&_[cmdk-group-heading]]:font-medium", className), ...props }));
|
|
24
24
|
}
|
|
25
25
|
function CommandSeparator({ className, ...props }) {
|
|
26
26
|
return (jsx(Command$1.Separator, { "data-slot": "command-separator", className: cn("tw:bg-border tw:-mx-1 tw:h-px", className), ...props }));
|
|
27
27
|
}
|
|
28
28
|
function CommandItem({ className, ...props }) {
|
|
29
|
-
return (jsx(Command$1.Item, { "data-slot": "command-item", className: cn("data-[selected=true]:
|
|
29
|
+
return (jsx(Command$1.Item, { "data-slot": "command-item", className: cn("tw:data-[selected=true]:bg-accent tw:data-[selected=true]:text-accent-foreground tw:[&_svg:not([class*='text-'])]:text-muted-foreground tw:relative tw:flex tw:cursor-default tw:items-center tw:gap-2 tw:rounded-sm tw:px-2 tw:py-1.5 tw:text-sm tw:outline-hidden tw:select-none tw:data-[disabled=true]:pointer-events-none tw:data-[disabled=true]:opacity-50 tw:[&_svg]:pointer-events-none tw:[&_svg]:shrink-0 tw:[&_svg:not([class*='size-'])]:size-4", className), ...props }));
|
|
30
30
|
}
|
|
31
31
|
function CommandShortcut({ className, ...props }) {
|
|
32
32
|
return (jsx("span", { "data-slot": "command-shortcut", className: cn("tw:text-muted-foreground tw:ml-auto tw:text-xs tw:tracking-widest", className), ...props }));
|
|
@@ -229,8 +229,8 @@ function DataTable({ columns, data, onRowClick, onSelectionChange, selectedRowId
|
|
|
229
229
|
setDraggedRowId(null);
|
|
230
230
|
setDragOverRowId(null);
|
|
231
231
|
};
|
|
232
|
-
return (jsxs(React.Fragment, { children: [jsxs("tr", { className: cn("tw:border-b tw:transition-colors hover:
|
|
233
|
-
"tw:cursor-pointer tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:focus-visible:ring-inset", rowBgClass, isDragging && "tw:opacity-50", isDragOver && "tw:ring-2 tw:ring-primary tw:ring-inset"), tabIndex: isRowClickable ? 0 : undefined, onClick: isRowClickable ? handleRowClick : undefined, onKeyDown: isRowClickable ? handleRowKeyDown : undefined, draggable: reorderable, onDragStart: reorderable ? handleDragStart : undefined, onDragEnd: reorderable ? handleDragEnd : undefined, onDragOver: reorderable ? handleDragOver : undefined, onDragLeave: reorderable ? handleDragLeave : undefined, onDrop: reorderable ? handleDrop : undefined, children: [isExpandable && (jsx("td", { className: cn("tw:p-2 tw:w-12", rowBgClass), onClick: (event) => event.stopPropagation(), children: jsx("div", { style: { paddingLeft: indentPadding }, children: canExpand ? (jsx("button", { onClick: () => toggleRowExpansion(row.id), className: "tw:flex tw:items-center tw:justify-center hover:
|
|
232
|
+
return (jsxs(React.Fragment, { children: [jsxs("tr", { className: cn("tw:border-b tw:transition-colors tw:hover:bg-accent/50", isRowClickable &&
|
|
233
|
+
"tw:cursor-pointer tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:focus-visible:ring-inset", rowBgClass, isDragging && "tw:opacity-50", isDragOver && "tw:ring-2 tw:ring-primary tw:ring-inset"), tabIndex: isRowClickable ? 0 : undefined, onClick: isRowClickable ? handleRowClick : undefined, onKeyDown: isRowClickable ? handleRowKeyDown : undefined, draggable: reorderable, onDragStart: reorderable ? handleDragStart : undefined, onDragEnd: reorderable ? handleDragEnd : undefined, onDragOver: reorderable ? handleDragOver : undefined, onDragLeave: reorderable ? handleDragLeave : undefined, onDrop: reorderable ? handleDrop : undefined, children: [isExpandable && (jsx("td", { className: cn("tw:p-2 tw:w-12", rowBgClass), onClick: (event) => event.stopPropagation(), children: jsx("div", { style: { paddingLeft: indentPadding }, children: canExpand ? (jsx("button", { onClick: () => toggleRowExpansion(row.id), className: "tw:flex tw:items-center tw:justify-center tw:hover:bg-accent tw:rounded tw:p-1", "aria-label": isExpanded ? "Collapse row" : "Expand row", "aria-expanded": isExpanded, children: isExpanded ? (jsx(ChevronDownIcon, { className: "tw:text-muted-foreground tw:size-4 tw:shrink-0 tw:transition-transform tw:duration-200" })) : (jsx(ChevronRightIcon, { className: "tw:text-muted-foreground tw:size-4 tw:shrink-0 tw:transition-transform tw:duration-200" })) })) : (jsx("span", { className: "tw:w-6" })) }) })), hasRowSelection && (jsx("td", { className: cn("tw:p-2 tw:w-12", rowBgClass), onClick: (event) => event.stopPropagation(), children: jsx("div", { className: "tw:flex tw:items-center tw:justify-center", children: jsx(Checkbox, { checked: selectedRows.has(row.id), onCheckedChange: () => toggleRowSelection(row.id), "aria-label": `Select row ${rowIndex + 1}`, className: "tw:h-[22px] tw:w-[22px]" }) }) })), reorderable && (jsx("td", { className: cn("tw:p-2 tw:w-12", rowBgClass), onClick: (event) => event.stopPropagation(), children: jsxs("div", { className: "tw:flex tw:flex-col tw:items-center tw:gap-0.5", children: [jsx("button", { onClick: () => onReorder?.(row.id, "up", parentRow?.id), className: "tw:flex tw:items-center tw:justify-center tw:hover:bg-accent tw:rounded tw:p-0.5 tw:text-muted-foreground tw:hover:text-foreground tw:transition-colors", disabled: rowIndex === 0, "aria-label": "Move row up", children: jsx(ChevronUpIcon, { className: cn("tw:size-4", rowIndex === 0 && "tw:opacity-30") }) }), jsx("button", { onClick: () => onReorder?.(row.id, "down", parentRow?.id), className: "tw:flex tw:items-center tw:justify-center tw:hover:bg-accent tw:rounded tw:p-0.5 tw:text-muted-foreground tw:hover:text-foreground tw:transition-colors", disabled: rowIndex === totalSiblings - 1, "aria-label": "Move row down", children: jsx(ChevronDownIcon, { className: cn("tw:size-4", rowIndex === totalSiblings - 1 && "tw:opacity-30") }) })] }) })), visibleColumns.map((column, colIndex) => {
|
|
234
234
|
const clickableField = getClickableField(column.key);
|
|
235
235
|
const cellContent = column.render
|
|
236
236
|
? column.render(row[column.key], row, rowIndex, depth)
|
|
@@ -246,9 +246,9 @@ function DataTable({ columns, data, onRowClick, onSelectionChange, selectedRowId
|
|
|
246
246
|
}, children: clickableField ? (jsx("button", { type: "button", onClick: (event) => {
|
|
247
247
|
event.stopPropagation();
|
|
248
248
|
clickableField.onClick(row);
|
|
249
|
-
}, className: "tw:inline tw:cursor-pointer tw:appearance-none tw:border-0 tw:bg-transparent tw:p-0 tw:text-inherit tw:font-[inherit] tw:transition-colors hover
|
|
249
|
+
}, className: "tw:inline tw:cursor-pointer tw:appearance-none tw:border-0 tw:bg-transparent tw:p-0 tw:text-inherit tw:font-[inherit] tw:transition-colors tw:hover:!text-primary/80 tw:hover:underline", children: cellContent })) : (cellContent) }) }, column.key));
|
|
250
250
|
}), showActionsColumn && (jsx("td", { className: cn("tw:p-2 tw:text-right tw:sticky tw:right-0", rowBgClass), onClick: (event) => event.stopPropagation(), children: visibleActionsForRow.length > 0 && (jsxs(Menu.Root, { modal: false, children: [jsx(Menu.Trigger, { id: `base-ui-row-action-${row.id}`, render: (props) => (jsx(Button, { variant: "ghost", size: "icon", className: "tw:h-8 tw:w-8", "aria-label": "Row actions", ...props, id: `base-ui-row-action-${row.id}`, children: jsx(MoreHorizontalIcon, { className: "tw:size-4" }) })) }), jsx(Menu.Portal, { children: jsx(Menu.Positioner, { side: "bottom", align: "end", sideOffset: 4, collisionPadding: 8, children: jsx(Menu.Popup, { "aria-labelledby": "base-ui-toggle-columns-trigger", className: cn("tw:bg-popover tw:font-sans tw:text-popover-foreground tw:data-[state=open]:animate-in tw:data-[state=closed]:animate-out tw:data-[state=closed]:fade-out-0 tw:data-[state=open]:fade-in-0 tw:data-[state=closed]:zoom-out-95 tw:data-[state=open]:zoom-in-95 tw:data-[side=bottom]:slide-in-from-top-2 tw:data-[side=left]:slide-in-from-right-2 tw:data-[side=right]:slide-in-from-left-2 tw:data-[side=top]:slide-in-from-bottom-2 tw:z-50 tw:min-w-[8rem] tw:overflow-x-hidden tw:overflow-y-auto tw:rounded-md tw:border tw:p-1 tw:shadow-md"), children: visibleActionsForRow.map((action, index) => (jsxs(Menu.Item, { onClick: () => action.onClick(row), className: cn("tw:focus:bg-accent tw:focus:text-accent-foreground tw:relative tw:flex tw:cursor-default tw:items-center tw:gap-2 tw:rounded-sm tw:px-2 tw:py-1.5 tw:text-[14px] tw:outline-hidden tw:select-none tw:data-[disabled]:pointer-events-none tw:data-[disabled]:opacity-50", action.variant === "destructive" &&
|
|
251
|
-
"tw:text-destructive focus:
|
|
251
|
+
"tw:text-destructive tw:focus:text-destructive"), children: [action.icon && (jsx("span", { className: "tw:mr-2", children: action.icon })), action.label] }, index))) }) }) })] })) }))] }), expandable && !treeData && isExpanded && renderExpandedRow && (jsx("tr", { className: "tw:border-b tw:bg-muted/30", children: jsx("td", { colSpan: visibleColumns.length +
|
|
252
252
|
(showActionsColumn ? 1 : 0) +
|
|
253
253
|
(hasRowSelection ? 1 : 0) +
|
|
254
254
|
(isExpandable ? 1 : 0) +
|
|
@@ -328,7 +328,7 @@ function DataTable({ columns, data, onRowClick, onSelectionChange, selectedRowId
|
|
|
328
328
|
});
|
|
329
329
|
return `${totalWidth}px`;
|
|
330
330
|
};
|
|
331
|
-
return (jsxs("div", { className: cn("tw:w-full tw:h-full tw:flex tw:flex-col", className), children: [jsxs("div", { className: "tw:relative tw:flex-1 tw:flex tw:flex-col tw:min-h-0 tw:overflow-hidden tw:rounded-md tw:border", children: [jsx("div", { ref: scrollContainerRef, className: "tw:flex-1 tw:overflow-auto tw:bg-card [&::-webkit-scrollbar]:
|
|
331
|
+
return (jsxs("div", { className: cn("tw:w-full tw:h-full tw:flex tw:flex-col", className), children: [jsxs("div", { className: "tw:relative tw:flex-1 tw:flex tw:flex-col tw:min-h-0 tw:overflow-hidden tw:rounded-md tw:border", children: [jsx("div", { ref: scrollContainerRef, className: "tw:flex-1 tw:overflow-auto tw:bg-card tw:[&::-webkit-scrollbar]:h-2 tw:[&::-webkit-scrollbar]:w-2 tw:[&::-webkit-scrollbar-track]:bg-muted tw:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/30 tw:[&::-webkit-scrollbar-thumb]:rounded-full tw:hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/50", children: jsxs("table", { className: "tw:w-full tw:table-fixed tw:caption-bottom tw:text-sm", role: "grid", "aria-busy": loading, style: { minWidth: calculateMinTableWidth() }, children: [jsx("thead", { className: "tw:border-b tw:sticky tw:top-0 tw:z-10 tw:bg-card", children: jsxs("tr", { children: [isExpandable && (jsx("th", { scope: "col", className: "tw:h-10 tw:w-12 tw:px-2" })), hasRowSelection && (jsx("th", { scope: "col", className: "tw:h-10 tw:w-12 tw:px-2", children: jsx("div", { className: "tw:flex tw:items-center tw:justify-center", children: jsx(Checkbox, { checked: data.length > 0 &&
|
|
332
332
|
data.every((row) => selectedRows.has(row.id)), onCheckedChange: toggleAllRows, "aria-label": "Select all rows", className: "tw:h-[22px] tw:w-[22px]" }) }) })), reorderable && (jsx("th", { scope: "col", className: "tw:h-10 tw:w-12 tw:px-2" })), visibleColumns.map((column) => (jsx("th", { scope: "col", "aria-sort": column.sortable && sortConfig.key === column.key
|
|
333
333
|
? sortConfig.direction === "asc"
|
|
334
334
|
? "ascending"
|
|
@@ -341,7 +341,7 @@ function DataTable({ columns, data, onRowClick, onSelectionChange, selectedRowId
|
|
|
341
341
|
: sortConfig.direction === "desc"
|
|
342
342
|
? ", currently sorted descending"
|
|
343
343
|
: ""
|
|
344
|
-
: ""}`, className: cn("tw:flex tw:items-center hover:
|
|
344
|
+
: ""}`, className: cn("tw:flex tw:items-center tw:hover:text-foreground/80 tw:transition-colors", loading && "tw:opacity-50 tw:cursor-not-allowed"), children: [column.label, getSortIcon(column.key)] })) : (column.label) }, column.key))), showActionsColumn && (jsx("th", { scope: "col", className: "tw:h-10 tw:w-20 tw:px-2 tw:sticky tw:right-0 tw:bg-card", children: jsx("div", { className: "tw:flex tw:items-center tw:justify-end tw:pr-1", children: showColumnVisibility && (jsxs(Menu.Root, { modal: false, children: [jsx(Menu.Trigger, { id: "base-ui-toggle-columns-trigger", render: (props) => (jsx(Button, { variant: "ghost", size: "icon", className: "tw:h-8 tw:w-8", "aria-label": "Toggle column visibility", ...props, id: "base-ui-toggle-columns-trigger", children: jsx(SettingsIcon, { className: "tw:size-5 tw:text-muted-foreground" }) })) }), jsx(Menu.Portal, { children: jsx(Menu.Positioner, { side: "bottom", align: "end", sideOffset: 4, collisionPadding: 8, children: jsx(Menu.Popup, { "aria-labelledby": `base-ui-toggle-columns-trigger`, className: cn("tw:bg-popover tw:font-sans tw:text-popover-foreground tw:data-[state=open]:animate-in tw:data-[state=closed]:animate-out tw:data-[state=closed]:fade-out-0 tw:data-[state=open]:fade-in-0 tw:data-[state=closed]:zoom-out-95 tw:data-[state=open]:zoom-in-95 tw:data-[side=bottom]:slide-in-from-top-2 tw:data-[side=left]:slide-in-from-right-2 tw:data-[side=right]:slide-in-from-left-2 tw:data-[side=top]:slide-in-from-bottom-2 tw:z-50 tw:min-w-[8rem] tw:overflow-x-hidden tw:overflow-y-auto tw:rounded-md tw:border tw:p-1 tw:shadow-md", menuPopupClassName), children: jsxs(Menu.Group, { children: [jsx(Menu.GroupLabel, { className: "tw:px-2 tw:py-1.5 tw:text-[14px] tw:font-medium", children: "Toggle Columns" }), jsx("div", { className: "tw:bg-border tw:-mx-1 tw:my-1 tw:h-px" }), filterableColumns.map((column) => {
|
|
345
345
|
const isVisible = !hiddenColumns.includes(column.key);
|
|
346
346
|
return (jsxs(Menu.Item, { onClick: () => toggleColumnVisibility(column.key), closeOnClick: false, className: cn("tw:focus:bg-accent tw:focus:text-accent-foreground tw:relative tw:flex tw:cursor-default tw:items-center tw:gap-2 tw:rounded-sm tw:py-1.5 tw:pr-2 tw:pl-8 tw:text-[14px] tw:outline-hidden tw:select-none tw:data-[disabled]:pointer-events-none tw:data-[disabled]:opacity-50"), children: [jsx("span", { className: "tw:pointer-events-none tw:absolute tw:left-2 tw:flex tw:size-3.5 tw:items-center tw:justify-center", children: isVisible && (jsx(CheckIcon, { className: "tw:size-4" })) }), column.label] }, column.key));
|
|
347
347
|
})] }) }) }) })] })) }) }))] }) }), jsx("tbody", { className: "tw:relative", children: data.length === 0 && !loading ? (jsx("tr", { children: jsx("td", { colSpan: visibleColumns.length +
|
|
@@ -358,7 +358,7 @@ function DataTable({ columns, data, onRowClick, onSelectionChange, selectedRowId
|
|
|
358
358
|
const options = pagination.pageSizeOptions ?? DEFAULT_PAGE_SIZE_OPTIONS;
|
|
359
359
|
if (options.length === 0)
|
|
360
360
|
return jsx("div", {});
|
|
361
|
-
return (jsxs("div", { className: "tw:flex tw:items-center tw:gap-2 tw:z-10", children: [jsx("span", { className: "tw:text-[14px] tw:text-muted-foreground tw:whitespace-nowrap", id: "rows-per-page-label", children: "Rows per page:" }), jsxs(Select, { value: String(pagination.pageSize ?? options[0]), onValueChange: (val) => !loading && pagination.onPageSizeChange?.(Number(val)), disabled: loading, children: [jsx(SelectTrigger, { id: "base-ui-pagination-trigger", className: "tw:flex tw:h-[32px] tw:w-[70px] tw:items-center tw:justify-between tw:rounded-md tw:border tw:border-input tw:bg-transparent tw:px-3 tw:py-2 tw:text-[14px] tw:shadow-sm tw:ring-offset-background placeholder:
|
|
361
|
+
return (jsxs("div", { className: "tw:flex tw:items-center tw:gap-2 tw:z-10", children: [jsx("span", { className: "tw:text-[14px] tw:text-muted-foreground tw:whitespace-nowrap", id: "rows-per-page-label", children: "Rows per page:" }), jsxs(Select, { value: String(pagination.pageSize ?? options[0]), onValueChange: (val) => !loading && pagination.onPageSizeChange?.(Number(val)), disabled: loading, children: [jsx(SelectTrigger, { id: "base-ui-pagination-trigger", className: "tw:flex tw:h-[32px] tw:w-[70px] tw:items-center tw:justify-between tw:rounded-md tw:border tw:border-input tw:bg-transparent tw:px-3 tw:py-2 tw:text-[14px] tw:shadow-sm tw:ring-offset-background tw:placeholder:text-muted-foreground tw:focus:outline-none tw:focus:ring-1 tw:focus:ring-ring tw:disabled:cursor-not-allowed tw:disabled:opacity-50", children: jsx(SelectValue, {}) }), jsx(SelectContent, { side: "top", align: "end", className: selectContentClassName, children: options.map((size) => (jsx(SelectItem, { value: String(size), children: size }, size))) })] })] }));
|
|
362
362
|
})(), pagination.showTotalItems &&
|
|
363
363
|
pagination.totalItems !== undefined && (jsx("div", { className: "tw:absolute tw:left-1/2 tw:-translate-x-1/2 tw:flex tw:justify-center tw:items-center", children: jsxs("span", { className: "tw:text-[14px] tw:text-muted-foreground", children: ["Total: ", pagination.totalItems] }) })), jsx("div", { className: "tw:z-10", children: jsx(Pagination, { className: "tw:!mx-0 tw:!w-auto", "aria-label": "Table pagination", children: jsxs(PaginationContent, { children: [jsx(PaginationItem, { children: jsx(PaginationPrevious, { href: "#", onClick: (e) => {
|
|
364
364
|
e.preventDefault();
|
|
@@ -13,13 +13,13 @@ function DropdownMenuTrigger({ ...props }) {
|
|
|
13
13
|
return (jsx(DropdownMenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props }));
|
|
14
14
|
}
|
|
15
15
|
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
16
|
-
return (jsx(DropdownMenuPrimitive.Portal, { children: jsx(DropdownMenuPrimitive.Content, { "data-slot": "dropdown-menu-content", sideOffset: sideOffset, className: cn("tw:!bg-popover tw:!text-popover-foreground data-[state=open]
|
|
16
|
+
return (jsx(DropdownMenuPrimitive.Portal, { children: jsx(DropdownMenuPrimitive.Content, { "data-slot": "dropdown-menu-content", sideOffset: sideOffset, className: cn("tw:!bg-popover tw:!text-popover-foreground tw:data-[state=open]:!animate-in tw:data-[state=closed]:!animate-out tw:data-[state=closed]:!fade-out-0 tw:data-[state=open]:!fade-in-0 tw:data-[state=closed]:!zoom-out-95 tw:data-[state=open]:!zoom-in-95 tw:data-[side=bottom]:!slide-in-from-top-2 tw:data-[side=left]:!slide-in-from-right-2 tw:data-[side=right]:!slide-in-from-left-2 tw:data-[side=top]:!slide-in-from-bottom-2 tw:!z-50 tw:!max-h-(--radix-dropdown-menu-content-available-height) tw:!min-w-[8rem] tw:!origin-(--radix-dropdown-menu-content-transform-origin) tw:!overflow-x-hidden tw:!overflow-y-auto tw:!rounded-md tw:!border tw:!p-1 tw:!shadow-md", className), ...props }) }));
|
|
17
17
|
}
|
|
18
18
|
function DropdownMenuGroup({ ...props }) {
|
|
19
19
|
return (jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props }));
|
|
20
20
|
}
|
|
21
21
|
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
22
|
-
return (jsx(DropdownMenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn("focus
|
|
22
|
+
return (jsx(DropdownMenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn("tw:focus:!bg-accent tw:focus:!text-accent-foreground tw:data-[variant=destructive]:!text-destructive tw:data-[variant=destructive]:focus:!bg-destructive/10 tw:dark:data-[variant=destructive]:focus:!bg-destructive/20 tw:data-[variant=destructive]:focus:!text-destructive tw:data-[variant=destructive]:*:svg:!text-destructive tw:[&_svg:not([class*='text-'])]:!text-muted-foreground tw:!relative tw:!flex tw:!cursor-default tw:!items-center tw:!gap-2 tw:!rounded-sm tw:!px-2 tw:!py-1.5 tw:!text-[14px] tw:!outline-hidden tw:!select-none tw:data-[disabled]:!pointer-events-none tw:data-[disabled]:!opacity-50 tw:data-[inset]:!pl-8 tw:[&_svg]:!pointer-events-none tw:[&_svg]:!shrink-0 tw:[&_svg:not([class*='size-'])]:!size-4", className), ...props }));
|
|
23
23
|
}
|
|
24
24
|
function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
25
25
|
return (jsxs(DropdownMenuPrimitive.CheckboxItem, { "data-slot": "dropdown-menu-checkbox-item", className: cn("tw:focus:bg-accent tw:focus:text-accent-foreground tw:relative tw:flex tw:cursor-default tw:items-center tw:gap-2 tw:rounded-sm tw:py-1.5 tw:pr-2 tw:pl-8 tw:text-[14px] tw:outline-hidden tw:select-none tw:data-[disabled]:pointer-events-none tw:data-[disabled]:opacity-50 tw:[&_svg]:pointer-events-none tw:[&_svg]:shrink-0 tw:[&_svg:not([class*='size-'])]:size-4", className), checked: checked, ...props, children: [jsx("span", { className: "tw:!pointer-events-none tw:!absolute tw:!left-2 tw:!flex tw:!size-3.5 tw:!items-center tw:!justify-center", children: jsx(DropdownMenuPrimitive.ItemIndicator, { children: jsx(CheckIcon, { className: "tw:!size-4" }) }) }), children] }));
|
|
@@ -28,10 +28,10 @@ function DropdownMenuRadioGroup({ ...props }) {
|
|
|
28
28
|
return (jsx(DropdownMenuPrimitive.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props }));
|
|
29
29
|
}
|
|
30
30
|
function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
31
|
-
return (jsxs(DropdownMenuPrimitive.RadioItem, { "data-slot": "dropdown-menu-radio-item", className: cn("focus
|
|
31
|
+
return (jsxs(DropdownMenuPrimitive.RadioItem, { "data-slot": "dropdown-menu-radio-item", className: cn("tw:focus:!bg-accent tw:focus:!text-accent-foreground tw:!relative tw:!flex tw:!cursor-default tw:!items-center tw:!gap-2 tw:!rounded-sm tw:!py-1.5 tw:!pr-2 tw:!pl-8 tw:!text-[14px] tw:!outline-hidden tw:!select-none tw:data-[disabled]:!pointer-events-none tw:data-[disabled]:!opacity-50 tw:[&_svg]:!pointer-events-none tw:[&_svg]:!shrink-0 tw:[&_svg:not([class*='size-'])]:!size-4", className), ...props, children: [jsx("span", { className: "tw:!pointer-events-none tw:!absolute tw:!left-2 tw:!flex tw:!size-3.5 tw:!items-center tw:!justify-center", children: jsx(DropdownMenuPrimitive.ItemIndicator, { children: jsx(CircleIcon, { className: "tw:!size-2 tw:!fill-current" }) }) }), children] }));
|
|
32
32
|
}
|
|
33
33
|
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
34
|
-
return (jsx(DropdownMenuPrimitive.Label, { "data-slot": "dropdown-menu-label", "data-inset": inset, className: cn("tw:!px-2 tw:!py-1.5 tw:!text-[14px] tw:!font-medium data-[inset]
|
|
34
|
+
return (jsx(DropdownMenuPrimitive.Label, { "data-slot": "dropdown-menu-label", "data-inset": inset, className: cn("tw:!px-2 tw:!py-1.5 tw:!text-[14px] tw:!font-medium tw:data-[inset]:!pl-8", className), ...props }));
|
|
35
35
|
}
|
|
36
36
|
function DropdownMenuSeparator({ className, ...props }) {
|
|
37
37
|
return (jsx(DropdownMenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", className: cn("tw:!bg-border tw:!-mx-1 tw:!my-1 tw:!h-px", className), ...props }));
|
|
@@ -43,10 +43,10 @@ function DropdownMenuSub({ ...props }) {
|
|
|
43
43
|
return jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
44
44
|
}
|
|
45
45
|
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
46
|
-
return (jsxs(DropdownMenuPrimitive.SubTrigger, { "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset, className: cn("focus
|
|
46
|
+
return (jsxs(DropdownMenuPrimitive.SubTrigger, { "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset, className: cn("tw:focus:!bg-accent tw:focus:!text-accent-foreground tw:data-[state=open]:!bg-accent tw:data-[state=open]:!text-accent-foreground tw:[&_svg:not([class*='text-'])]:!text-muted-foreground tw:!flex tw:!cursor-default tw:!items-center tw:!gap-2 tw:!rounded-sm tw:!px-2 tw:!py-1.5 tw:!text-[14px] tw:!outline-hidden tw:!select-none tw:data-[inset]:!pl-8 tw:[&_svg]:!pointer-events-none tw:[&_svg]:!shrink-0 tw:[&_svg:not([class*='size-'])]:!size-4", className), ...props, children: [children, jsx(ChevronRightIcon, { className: "tw:ml-auto tw:size-4" })] }));
|
|
47
47
|
}
|
|
48
48
|
function DropdownMenuSubContent({ className, ...props }) {
|
|
49
|
-
return (jsx(DropdownMenuPrimitive.SubContent, { "data-slot": "dropdown-menu-sub-content", className: cn("tw:!bg-popover tw:!text-popover-foreground data-[state=open]
|
|
49
|
+
return (jsx(DropdownMenuPrimitive.SubContent, { "data-slot": "dropdown-menu-sub-content", className: cn("tw:!bg-popover tw:!text-popover-foreground tw:data-[state=open]:!animate-in tw:data-[state=closed]:!animate-out tw:data-[state=closed]:!fade-out-0 tw:data-[state=open]:!fade-in-0 tw:data-[state=closed]:!zoom-out-95 tw:data-[state=open]:!zoom-in-95 tw:data-[side=bottom]:!slide-in-from-top-2 tw:data-[side=left]:!slide-in-from-right-2 tw:data-[side=right]:!slide-in-from-left-2 tw:data-[side=top]:!slide-in-from-bottom-2 tw:!z-50 tw:!min-w-[8rem] tw:!origin-(--radix-dropdown-menu-content-transform-origin) tw:!overflow-hidden tw:!rounded-md tw:!border tw:!p-1 tw:!shadow-lg", className), ...props }));
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
|
package/dist/components/field.js
CHANGED
|
@@ -6,27 +6,27 @@ import { Label } from './label.js';
|
|
|
6
6
|
import { Separator } from './separator.js';
|
|
7
7
|
|
|
8
8
|
function FieldSet({ className, ...props }) {
|
|
9
|
-
return (jsx("fieldset", { "data-slot": "field-set", className: cn("tw:flex tw:flex-col tw:gap-6", "has-[>[data-slot=checkbox-group]]:
|
|
9
|
+
return (jsx("fieldset", { "data-slot": "field-set", className: cn("tw:flex tw:flex-col tw:gap-6", "tw:has-[>[data-slot=checkbox-group]]:gap-3 tw:has-[>[data-slot=radio-group]]:gap-3", className), ...props }));
|
|
10
10
|
}
|
|
11
11
|
function FieldLegend({ className, variant = "legend", ...props }) {
|
|
12
|
-
return (jsx("legend", { "data-slot": "field-legend", "data-variant": variant, className: cn("tw:mb-3 tw:font-medium", "data-[variant=legend]:
|
|
12
|
+
return (jsx("legend", { "data-slot": "field-legend", "data-variant": variant, className: cn("tw:mb-3 tw:font-medium", "tw:data-[variant=legend]:text-base", "tw:data-[variant=label]:text-sm", className), ...props }));
|
|
13
13
|
}
|
|
14
14
|
function FieldGroup({ className, ...props }) {
|
|
15
|
-
return (jsx("div", { "data-slot": "field-group", className: cn("group/field-group @container/field-group tw:flex tw:w-full tw:flex-col tw:gap-7 data-[slot=checkbox-group]:
|
|
15
|
+
return (jsx("div", { "data-slot": "field-group", className: cn("group/field-group @container/field-group tw:flex tw:w-full tw:flex-col tw:gap-7 tw:data-[slot=checkbox-group]:gap-3 tw:[&>[data-slot=field-group]]:gap-4", className), ...props }));
|
|
16
16
|
}
|
|
17
|
-
const fieldVariants = cva("group/field tw:flex tw:w-full tw:gap-3 data-[invalid=true]:
|
|
17
|
+
const fieldVariants = cva("group/field tw:flex tw:w-full tw:gap-3 tw:data-[invalid=true]:text-destructive", {
|
|
18
18
|
variants: {
|
|
19
19
|
orientation: {
|
|
20
|
-
vertical: ["tw:flex-col [&>*]:
|
|
20
|
+
vertical: ["tw:flex-col tw:[&>*]:w-full tw:[&>.tw:sr-only]:w-auto"],
|
|
21
21
|
horizontal: [
|
|
22
22
|
"tw:flex-row tw:items-center",
|
|
23
|
-
"[&>[data-slot=field-label]]:
|
|
24
|
-
"has-[>[data-slot=field-content]]:
|
|
23
|
+
"tw:[&>[data-slot=field-label]]:flex-auto",
|
|
24
|
+
"tw:has-[>[data-slot=field-content]]:items-start tw:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
25
25
|
],
|
|
26
26
|
responsive: [
|
|
27
|
-
"tw:flex-col [&>*]:
|
|
28
|
-
"
|
|
29
|
-
"
|
|
27
|
+
"tw:flex-col tw:[&>*]:w-full tw:[&>.tw:sr-only]:w-auto tw:@md/field-group:flex-row tw:@md/field-group:items-center tw:@md/field-group:[&>*]:w-auto",
|
|
28
|
+
"tw:@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
|
29
|
+
"tw:@md/field-group:has-[>[data-slot=field-content]]:items-start tw:@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
30
30
|
],
|
|
31
31
|
},
|
|
32
32
|
},
|
|
@@ -41,16 +41,16 @@ function FieldContent({ className, ...props }) {
|
|
|
41
41
|
return (jsx("div", { "data-slot": "field-content", className: cn("group/field-content tw:flex tw:flex-1 tw:flex-col tw:gap-1.5 tw:leading-snug", className), ...props }));
|
|
42
42
|
}
|
|
43
43
|
function FieldLabel({ className, ...props }) {
|
|
44
|
-
return (jsx(Label, { "data-slot": "field-label", className: cn("group/field-label peer/field-label tw:flex tw:w-fit tw:gap-2 tw:leading-snug group-data-[disabled=true]/field
|
|
44
|
+
return (jsx(Label, { "data-slot": "field-label", className: cn("group/field-label peer/field-label tw:flex tw:w-fit tw:gap-2 tw:leading-snug tw:group-data-[disabled=true]/field:!cursor-not-allowed tw:group-data-[disabled=true]/field:!opacity-50", "tw:has-[>[data-slot=field]]:w-full tw:has-[>[data-slot=field]]:flex-col tw:has-[>[data-slot=field]]:rounded-md tw:has-[>[data-slot=field]]:border tw:[&>*]:data-[slot=field]:p-4", "tw:has-data-[state=checked]:bg-primary/5 tw:has-data-[state=checked]:border-primary tw:dark:has-data-[state=checked]:bg-primary/10", className), ...props }));
|
|
45
45
|
}
|
|
46
46
|
function FieldTitle({ className, ...props }) {
|
|
47
|
-
return (jsx("div", { "data-slot": "field-label", className: cn("tw:flex tw:w-fit tw:items-center tw:gap-2 tw:text-sm tw:leading-snug tw:font-medium group-data-[disabled=true]/field
|
|
47
|
+
return (jsx("div", { "data-slot": "field-label", className: cn("tw:flex tw:w-fit tw:items-center tw:gap-2 tw:text-sm tw:leading-snug tw:font-medium tw:group-data-[disabled=true]/field:!cursor-not-allowed tw:group-data-[disabled=true]/field:!opacity-50", className), ...props }));
|
|
48
48
|
}
|
|
49
49
|
function FieldDescription({ className, ...props }) {
|
|
50
|
-
return (jsx("p", { "data-slot": "field-description", className: cn("tw:text-muted-foreground tw:text-sm tw:leading-normal tw:font-normal group-has-[[data-orientation=horizontal]]/field:
|
|
50
|
+
return (jsx("p", { "data-slot": "field-description", className: cn("tw:text-muted-foreground tw:text-sm tw:leading-normal tw:font-normal tw:group-has-[[data-orientation=horizontal]]/field:text-balance", "tw:last:mt-0 tw:nth-last-2:-mt-1 tw:[[data-variant=legend]+&]:-mt-1.5", "tw:[&>a:hover]:text-primary tw:[&>a]:underline tw:[&>a]:underline-offset-4", className), ...props }));
|
|
51
51
|
}
|
|
52
52
|
function FieldSeparator({ children, className, ...props }) {
|
|
53
|
-
return (jsxs("div", { "data-slot": "field-separator", "data-content": !!children, className: cn("tw:relative tw:-my-2 tw:h-5 tw:text-sm group-data-[variant=outline]/field-group
|
|
53
|
+
return (jsxs("div", { "data-slot": "field-separator", "data-content": !!children, className: cn("tw:relative tw:-my-2 tw:h-5 tw:text-sm tw:group-data-[variant=outline]/field-group:-mb-2", className), ...props, children: [jsx(Separator, { className: "tw:absolute tw:inset-0 tw:top-1/2" }), children && (jsx("span", { className: "tw:bg-background tw:text-muted-foreground tw:relative tw:mx-auto tw:block tw:w-fit tw:px-2", "data-slot": "field-separator-content", children: children }))] }));
|
|
54
54
|
}
|
|
55
55
|
function FieldError({ className, children, errors, ...props }) {
|
|
56
56
|
const content = useMemo(() => {
|
package/dist/components/form.js
CHANGED
|
@@ -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: cn("data-[error=true]:
|
|
39
|
+
return (jsx(Label, { "data-slot": "form-label", "data-error": !!error, className: cn("tw:data-[error=true]:text-destructive", className), htmlFor: formItemId, ...props }));
|
|
40
40
|
}
|
|
41
41
|
function FormControl({ ...props }) {
|
|
42
42
|
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
@@ -111,7 +111,7 @@ const getTileClassName = (isCurrent, isDisabled) => {
|
|
|
111
111
|
if (isCurrent) {
|
|
112
112
|
return "tw:cursor-default";
|
|
113
113
|
}
|
|
114
|
-
return "hover:
|
|
114
|
+
return "tw:hover:bg-accent tw:cursor-pointer";
|
|
115
115
|
};
|
|
116
116
|
const gridColsClass = {
|
|
117
117
|
1: "tw:grid-cols-1",
|
|
@@ -137,7 +137,7 @@ function HeaderAppSwitcher({ commonHost, currentApp = "Retail", visibleApps, col
|
|
|
137
137
|
const isDisabled = Boolean(app.disabled);
|
|
138
138
|
const isCurrent = Boolean(app.isCurrent);
|
|
139
139
|
const tileClassName = getTileClassName(isCurrent, isDisabled);
|
|
140
|
-
const tileContent = (jsxs(Fragment, { children: [jsxs("span", { className: "tw:relative tw:flex tw:size-9 tw:items-center tw:justify-center tw:[&>svg]:
|
|
140
|
+
const tileContent = (jsxs(Fragment, { children: [jsxs("span", { className: "tw:relative tw:flex tw:size-9 tw:items-center tw:justify-center tw:[&>svg]:size-9 tw:[&>svg]:shrink-0", children: [app.logo, app.badge ? (jsx(Badge, { variant: "soft", className: appBadgeClassName, children: app.badge })) : null] }), jsx("span", { className: cn("tw:text-center tw:text-xs tw:font-normal tw:leading-4 tw:text-popover-foreground", isDisabled && "tw:text-muted-foreground"), children: app.name })] }));
|
|
141
141
|
const baseClassName = `tw:relative tw:flex tw:min-h-14 tw:flex-col tw:items-center tw:gap-2.5 tw:rounded-md tw:p-0 tw:transition-colors ${tileClassName}`;
|
|
142
142
|
const Wrapper = isDisabled || isCurrent ? "div" : "a";
|
|
143
143
|
const wrapperProps = isDisabled || isCurrent
|
|
@@ -134,9 +134,9 @@ function HierarchicalSelect(props) {
|
|
|
134
134
|
e.preventDefault();
|
|
135
135
|
e.currentTarget.click();
|
|
136
136
|
}
|
|
137
|
-
}, className: cn("tw:!flex tw:!w-full tw:!items-center tw:!justify-between tw:!gap-2 tw:!rounded-md tw:!border tw:!border-input tw:!bg-transparent tw:px-3 tw:py-2 tw:!text-[length:var(--hs-font-size,14px)] tw:!whitespace-nowrap tw:!shadow-xs tw:!transition-[color,box-shadow] tw:!outline-none tw:h-9 tw:!cursor-default", "focus-visible
|
|
138
|
-
"tw:!cursor-not-allowed tw:!opacity-50 tw:!pointer-events-none", "dark
|
|
139
|
-
"tw:!bg-accent tw:!text-accent-foreground"), children: [jsx(FolderTreeIcon, { "aria-hidden": true, className: "tw:!size-4 tw:!shrink-0 tw:!text-muted-foreground" }), jsx("span", { className: "tw:!flex-1 tw:!text-left tw:!truncate", children: group.parent.label }), group.children.length > 0 && (jsx("span", { "data-slot": "hierarchical-select-badge", className: "tw:!inline-flex tw:!items-center tw:!justify-center tw:!rounded-full tw:!bg-muted tw:!px-1.5 tw:!py-0.5 tw:!text-[10px] tw:!font-medium tw:!text-muted-foreground tw:!leading-none", children: group.children.length })), isSelected(group.parent.id) && (jsx(CheckIcon, { "aria-hidden": true, className: "tw:!size-4 tw:!shrink-0" }))] }), group.children.length > 0 && (jsx("div", { "data-slot": "hierarchical-select-children", role: "group", "aria-label": `${group.parent.label} subcategories`, className: "tw:!ml-4 tw:!border-l tw:!border-border tw:!pl-2", children: group.children.map((child) => (jsxs("button", { type: "button", "data-slot": "hierarchical-select-child", role: "option", "aria-selected": isSelected(child.id), onClick: () => handleSelect(child.id), className: cn("tw:!relative tw:!flex tw:!w-full tw:!cursor-default tw:!items-center tw:!gap-2 tw:!rounded-sm tw:!px-2 tw:!py-1.5 tw:!text-[14px] tw:!outline-hidden tw:!select-none tw:!transition-colors", "hover
|
|
137
|
+
}, className: cn("tw:!flex tw:!w-full tw:!items-center tw:!justify-between tw:!gap-2 tw:!rounded-md tw:!border tw:!border-input tw:!bg-transparent tw:px-3 tw:py-2 tw:!text-[length:var(--hs-font-size,14px)] tw:!whitespace-nowrap tw:!shadow-xs tw:!transition-[color,box-shadow] tw:!outline-none tw:h-9 tw:!cursor-default", "tw:focus-visible:!border-ring tw:focus-visible:!ring-ring/50 tw:focus-visible:!ring-[3px]", disabled &&
|
|
138
|
+
"tw:!cursor-not-allowed tw:!opacity-50 tw:!pointer-events-none", "tw:dark:!bg-input/30 tw:dark:hover:!bg-input/50", !displayValue && "tw:!text-muted-foreground", className), style: triggerStyle, children: [jsx("span", { "data-slot": "hierarchical-select-value", className: "tw:!truncate tw:!flex-1 tw:!text-left", children: displayValue ?? placeholder }), isMulti && hasSelection && (jsx("button", { type: "button", "data-slot": "hierarchical-select-clear", "aria-label": "Clear selection", onClick: handleClear, className: "tw:!shrink-0 tw:!flex tw:!items-center tw:!justify-center tw:!size-4 tw:!rounded-sm tw:!text-muted-foreground tw:hover:!text-foreground tw:!transition-colors tw:!pointer-events-auto", children: jsx(XIcon, { className: "tw:!size-3" }) })), jsx(ChevronDownIcon, { "data-slot": "hierarchical-select-chevron", "aria-hidden": true, className: cn("tw:!size-4 tw:!shrink-0 tw:!opacity-50 tw:!transition-transform tw:!duration-200", open && "tw:!rotate-180") })] }) }), jsx(PopoverPrimitive.Portal, { container: portalContainer, children: jsxs(PopoverPrimitive.Content, { "data-slot": "hierarchical-select-content", align: "start", sideOffset: 4, className: cn("tw:!bg-popover tw:!text-popover-foreground tw:!z-[9999] tw:!w-[var(--radix-popover-trigger-width)] tw:!origin-(--radix-popover-content-transform-origin) tw:!rounded-md tw:!border tw:!shadow-md tw:!outline-hidden", "tw:data-[state=open]:!animate-in tw:data-[state=closed]:!animate-out tw:data-[state=closed]:!fade-out-0 tw:data-[state=open]:!fade-in-0 tw:data-[state=closed]:!zoom-out-95 tw:data-[state=open]:!zoom-in-95", "tw:data-[side=bottom]:!slide-in-from-top-2 tw:data-[side=left]:!slide-in-from-right-2 tw:data-[side=right]:!slide-in-from-left-2 tw:data-[side=top]:!slide-in-from-bottom-2"), children: [jsxs("div", { "data-slot": "hierarchical-select-search", className: "tw:!flex tw:!items-center tw:!gap-2 tw:!border-b tw:!px-3 tw:!sticky tw:!top-0 tw:!bg-popover tw:!z-10", children: [jsx(SearchIcon, { className: "tw:!size-4 tw:!shrink-0 tw:!text-muted-foreground" }), jsx("input", { ref: searchInputRef, id: searchId, "data-slot": "hierarchical-select-search-input", type: "text", role: "searchbox", "aria-label": searchPlaceholder, "aria-autocomplete": "list", value: search, onChange: (e) => setSearch(e.target.value), placeholder: searchPlaceholder, className: "tw:!flex tw:!h-9 tw:!w-full tw:!bg-transparent tw:!py-2 tw:!text-[14px] tw:!outline-none tw:placeholder:!text-muted-foreground" })] }), jsx("div", { id: listboxId, "data-slot": "hierarchical-select-list", role: "listbox", "aria-multiselectable": isMulti, "aria-label": label ?? placeholder, className: "tw:!max-h-[320px] tw:!overflow-y-auto tw:!overflow-x-hidden tw:!p-1", children: filtered.length === 0 ? (jsxs("div", { "data-slot": "hierarchical-select-empty", role: "status", "aria-live": "polite", className: "tw:!flex tw:!flex-col tw:!items-center tw:!justify-center tw:!gap-2 tw:!py-8 tw:!text-center", children: [jsx("div", { className: "tw:!flex tw:!size-10 tw:!items-center tw:!justify-center tw:!rounded-full tw:!bg-muted", children: jsx(SearchIcon, { "aria-hidden": true, className: "tw:!size-4 tw:!text-muted-foreground" }) }), jsx("div", { className: "tw:!text-[14px] tw:!font-medium", children: emptyMessage }), jsx("p", { className: "tw:!text-[12px] tw:!text-muted-foreground", children: "Try adjusting your search query" })] })) : (filtered.map((group) => (jsxs("div", { "data-slot": "hierarchical-select-group", role: "group", "aria-label": group.parent.label, className: "tw:!mb-1", children: [jsxs("button", { type: "button", "data-slot": "hierarchical-select-parent", role: "option", "aria-selected": isSelected(group.parent.id), onClick: () => handleSelect(group.parent.id), className: cn("tw:!relative tw:!flex tw:!w-full tw:!cursor-default tw:!items-center tw:!gap-2 tw:!rounded-sm tw:!px-2 tw:!py-1.5 tw:!text-[14px] tw:!font-semibold tw:!outline-hidden tw:!select-none tw:!transition-colors", "tw:hover:!bg-accent tw:hover:!text-accent-foreground", isSelected(group.parent.id) &&
|
|
139
|
+
"tw:!bg-accent tw:!text-accent-foreground"), children: [jsx(FolderTreeIcon, { "aria-hidden": true, className: "tw:!size-4 tw:!shrink-0 tw:!text-muted-foreground" }), jsx("span", { className: "tw:!flex-1 tw:!text-left tw:!truncate", children: group.parent.label }), group.children.length > 0 && (jsx("span", { "data-slot": "hierarchical-select-badge", className: "tw:!inline-flex tw:!items-center tw:!justify-center tw:!rounded-full tw:!bg-muted tw:!px-1.5 tw:!py-0.5 tw:!text-[10px] tw:!font-medium tw:!text-muted-foreground tw:!leading-none", children: group.children.length })), isSelected(group.parent.id) && (jsx(CheckIcon, { "aria-hidden": true, className: "tw:!size-4 tw:!shrink-0" }))] }), group.children.length > 0 && (jsx("div", { "data-slot": "hierarchical-select-children", role: "group", "aria-label": `${group.parent.label} subcategories`, className: "tw:!ml-4 tw:!border-l tw:!border-border tw:!pl-2", children: group.children.map((child) => (jsxs("button", { type: "button", "data-slot": "hierarchical-select-child", role: "option", "aria-selected": isSelected(child.id), onClick: () => handleSelect(child.id), className: cn("tw:!relative tw:!flex tw:!w-full tw:!cursor-default tw:!items-center tw:!gap-2 tw:!rounded-sm tw:!px-2 tw:!py-1.5 tw:!text-[14px] tw:!outline-hidden tw:!select-none tw:!transition-colors", "tw:hover:!bg-accent tw:hover:!text-accent-foreground", "tw:!text-muted-foreground", isSelected(child.id) &&
|
|
140
140
|
"tw:!bg-accent tw:!text-accent-foreground"), children: [jsx("span", { "aria-hidden": true, className: "tw:!size-1.5 tw:!rounded-full tw:!bg-muted-foreground/50 tw:!shrink-0" }), jsx("span", { className: "tw:!flex-1 tw:!text-left tw:!truncate", children: child.label }), isSelected(child.id) && (jsx(CheckIcon, { "aria-hidden": true, className: "tw:!size-4 tw:!shrink-0" }))] }, child.id))) }))] }, group.parent.id)))) }), jsx("div", { "data-slot": "hierarchical-select-footer", "aria-live": "polite", "aria-atomic": "true", className: "tw:!border-t tw:!px-3 tw:!py-2 tw:!text-[12px] tw:!text-muted-foreground", children: search ? (jsxs("span", { children: [visibleCount, " result", visibleCount !== 1 ? "s" : "", " for \u201C", search, "\u201D"] })) : (jsxs("span", { children: [visibleCount, " categor", visibleCount !== 1 ? "ies" : "y"] })) })] }) })] }));
|
|
141
141
|
}
|
|
142
142
|
|
package/dist/components/item.js
CHANGED
|
@@ -10,7 +10,7 @@ function ItemGroup({ className, ...props }) {
|
|
|
10
10
|
function ItemSeparator({ className, ...props }) {
|
|
11
11
|
return (jsx(Separator, { "data-slot": "item-separator", orientation: "horizontal", className: cn("tw:my-0", className), ...props }));
|
|
12
12
|
}
|
|
13
|
-
const itemVariants = cva("group/item tw:flex tw:items-center tw:border tw:border-transparent tw:text-sm tw:rounded-md tw:transition-colors [a]:hover:
|
|
13
|
+
const itemVariants = cva("group/item tw:flex tw:items-center tw:border tw:border-transparent tw:text-sm tw:rounded-md tw:transition-colors tw:[a]:hover:bg-accent/50 tw:[a]:transition-colors tw:duration-100 tw:flex-wrap tw:outline-none tw:focus-visible:border-ring tw:focus-visible:ring-ring/50 tw:focus-visible:ring-[3px]", {
|
|
14
14
|
variants: {
|
|
15
15
|
variant: {
|
|
16
16
|
default: "tw:bg-transparent",
|
|
@@ -31,12 +31,12 @@ function Item({ className, variant = "default", size = "default", asChild = fals
|
|
|
31
31
|
const Comp = asChild ? Slot : "div";
|
|
32
32
|
return (jsx(Comp, { "data-slot": "item", "data-variant": variant, "data-size": size, className: cn(itemVariants({ variant, size, className })), ...props }));
|
|
33
33
|
}
|
|
34
|
-
const itemMediaVariants = cva("tw:flex tw:shrink-0 tw:items-center tw:justify-center tw:gap-2 group-has-[[data-slot=item-description]]/item:
|
|
34
|
+
const itemMediaVariants = cva("tw:flex tw:shrink-0 tw:items-center tw:justify-center tw:gap-2 tw:group-has-[[data-slot=item-description]]/item:self-start tw:[&_svg]:pointer-events-none tw:group-has-[[data-slot=item-description]]/item:translate-y-0.5", {
|
|
35
35
|
variants: {
|
|
36
36
|
variant: {
|
|
37
37
|
default: "tw:bg-transparent",
|
|
38
|
-
icon: "tw:size-8 tw:border tw:rounded-sm tw:bg-muted [&_svg:not([class*='size-'])]:
|
|
39
|
-
image: "tw:size-10 tw:rounded-sm tw:overflow-hidden [&_img]:
|
|
38
|
+
icon: "tw:size-8 tw:border tw:rounded-sm tw:bg-muted tw:[&_svg:not([class*='size-'])]:size-4",
|
|
39
|
+
image: "tw:size-10 tw:rounded-sm tw:overflow-hidden tw:[&_img]:size-full tw:[&_img]:object-cover",
|
|
40
40
|
},
|
|
41
41
|
},
|
|
42
42
|
defaultVariants: {
|
|
@@ -47,13 +47,13 @@ function ItemMedia({ className, variant = "default", ...props }) {
|
|
|
47
47
|
return (jsx("div", { "data-slot": "item-media", "data-variant": variant, className: cn(itemMediaVariants({ variant, className })), ...props }));
|
|
48
48
|
}
|
|
49
49
|
function ItemContent({ className, ...props }) {
|
|
50
|
-
return (jsx("div", { "data-slot": "item-content", className: cn("tw:flex tw:flex-1 tw:flex-col tw:gap-1 [&+[data-slot=item-content]]:
|
|
50
|
+
return (jsx("div", { "data-slot": "item-content", className: cn("tw:flex tw:flex-1 tw:flex-col tw:gap-1 tw:[&+[data-slot=item-content]]:flex-none", className), ...props }));
|
|
51
51
|
}
|
|
52
52
|
function ItemTitle({ className, ...props }) {
|
|
53
53
|
return (jsx("div", { "data-slot": "item-title", className: cn("tw:flex tw:w-fit tw:items-center tw:gap-2 tw:text-sm tw:leading-snug tw:font-medium", className), ...props }));
|
|
54
54
|
}
|
|
55
55
|
function ItemDescription({ className, ...props }) {
|
|
56
|
-
return (jsx("p", { "data-slot": "item-description", className: cn("tw:text-muted-foreground tw:line-clamp-2 tw:text-sm tw:leading-normal tw:font-normal tw:text-balance", "[&>a:hover]:
|
|
56
|
+
return (jsx("p", { "data-slot": "item-description", className: cn("tw:text-muted-foreground tw:line-clamp-2 tw:text-sm tw:leading-normal tw:font-normal tw:text-balance", "tw:[&>a:hover]:text-primary tw:[&>a]:underline tw:[&>a]:underline-offset-4", className), ...props }));
|
|
57
57
|
}
|
|
58
58
|
function ItemActions({ className, ...props }) {
|
|
59
59
|
return (jsx("div", { "data-slot": "item-actions", className: cn("tw:flex tw:items-center tw:gap-2", className), ...props }));
|
|
@@ -290,11 +290,11 @@ function LoginScreen({ className, splitLayout = true, splitImageWidthPercent = 4
|
|
|
290
290
|
};
|
|
291
291
|
}, [mode, resendCountdown]);
|
|
292
292
|
const modeView = mode === "sign-in" ? (jsx(SignInView, { tabs: tabs, activeTabId: activeTabId, tabListRef: tabListRef, onTabClick: (tab) => handleTabClick(tab), onTabKeyDown: handleTabKeyDown, identifierId: identifierId, identifierLabel: resolvedIdentifierLabel, identifierType: getIdentifierInputType(identifierMode), identifierPlaceholder: resolvedIdentifierPlaceholder, identifier: identifier, onIdentifierChange: setIdentifier, passwordId: passwordId, passwordLabel: passwordLabel, passwordPlaceholder: passwordPlaceholder, password: password, onPasswordChange: setPassword, showPassword: showPassword, onTogglePassword: () => setShowPassword((previous) => !previous), rememberId: rememberId, rememberMe: rememberMe, onRememberMeChange: setRememberMe, rememberMeLabel: rememberMeLabel, forgotPasswordLabel: forgotPasswordLabel, onForgotPasswordClick: handleForgotPasswordClick, isSubmitting: isSubmitting, submitLabel: submitLabel, submitLoadingLabel: submitLoadingLabel, onSubmit: handleSignInSubmit, ssoLabel: ssoLabel, ssoButtonLabel: ssoButtonLabel, onSsoClick: handleSsoClick, legalNotice: legalNotice ?? DEFAULT_LEGAL_NOTICE, logo: logo, logoLoadError: logoLoadError, onLogoError: () => setLogoLoadError(true), title: title, description: description, autoCompleteIdentifier: identifierMode === "phone" ? "tel" : "email" })) : mode === "forgot-password" ? (jsx(ForgotPasswordView, { title: forgotPasswordTitle, description: forgotPasswordDescription, emailId: forgotEmailId, emailLabel: forgotPasswordEmailLabel, email: forgotEmail, onEmailChange: setForgotEmail, emailPlaceholder: forgotPasswordEmailPlaceholder, submitLabel: forgotPasswordSubmitLabel, backLabel: forgotPasswordBackLabel, isSubmitting: isForgotPasswordSubmitting, onSubmit: handleForgotPasswordSubmit, onBack: handleBackToSignIn, error: forgotPasswordError })) : mode === "forgot-password-sent" ? (jsx(ForgotPasswordSentView, { backAriaLabel: ssoEmailBackAriaLabel, onBack: handleBackToSignIn, title: forgotPasswordSentTitle, descriptionPrefix: forgotPasswordSentDescriptionPrefix, email: forgotEmail, instructions: forgotPasswordSentInstructions, resendLabel: forgotPasswordResendLabel, resendCountdown: resendCountdown, onResend: handleResendEmail, isResending: isResending, error: forgotPasswordError, backLabel: forgotPasswordBackLabel })) : (jsx(SsoEmailView, { backAriaLabel: ssoEmailBackAriaLabel, onBack: () => setMode("sign-in"), title: ssoEmailTitle, description: ssoEmailDescription, emailId: ssoEmailId, emailLabel: ssoEmailLabel, email: ssoEmail, onEmailChange: setSsoEmail, emailPlaceholder: ssoEmailPlaceholder, submitLabel: ssoEmailSubmitLabel, isSubmitting: isSsoSubmitting, onSubmit: handleSsoEmailSubmit, hint: ssoEmailHint }));
|
|
293
|
-
const content = (jsxs("div", { className: "tw:w-full tw:max-w-md", children: [jsx("div", { className: "tw:rounded-xl tw:border tw:border-border tw:bg-card tw:p-6 tw:shadow-sm sm:
|
|
293
|
+
const content = (jsxs("div", { className: "tw:w-full tw:max-w-md", children: [jsx("div", { className: "tw:rounded-xl tw:border tw:border-border tw:bg-card tw:p-6 tw:shadow-sm tw:sm:p-8", children: jsx("div", { className: "tw:flex tw:flex-col tw:gap-8", children: modeView }) }), jsx(FooterLinks, { links: footerLinks })] }));
|
|
294
294
|
if (!splitLayout) {
|
|
295
|
-
return (jsx("div", { className: cn("tw:min-h-svh tw:w-full tw:bg-background", className), children: jsx("div", { className: "tw:flex tw:min-h-svh tw:w-full tw:items-center tw:justify-center tw:p-6 sm:
|
|
295
|
+
return (jsx("div", { className: cn("tw:min-h-svh tw:w-full tw:bg-background", className), children: jsx("div", { className: "tw:flex tw:min-h-svh tw:w-full tw:items-center tw:justify-center tw:p-6 tw:sm:p-12", children: content }) }));
|
|
296
296
|
}
|
|
297
|
-
return (jsx("div", { className: cn("tw:min-h-svh tw:w-full tw:bg-background", className), children: jsxs("div", { className: "tw:flex tw:min-h-svh tw:w-full", children: [shouldShowSplitPane ? (jsx(SplitMediaPane, { widthPercent: imageWidth, hasSplitImage: hasSplitImage, imageSrc: imageSrc, imageAlt: imageAlt, onImageError: () => setImageLoadError(true), overlayOpacity: overlayOpacity, imageOverlayContent: imageOverlayContent, testimonial: resolvedTestimonial })) : null, jsx("div", { className: cn("tw:flex tw:w-full tw:items-center tw:justify-center tw:p-6 sm:
|
|
297
|
+
return (jsx("div", { className: cn("tw:min-h-svh tw:w-full tw:bg-background", className), children: jsxs("div", { className: "tw:flex tw:min-h-svh tw:w-full", children: [shouldShowSplitPane ? (jsx(SplitMediaPane, { widthPercent: imageWidth, hasSplitImage: hasSplitImage, imageSrc: imageSrc, imageAlt: imageAlt, onImageError: () => setImageLoadError(true), overlayOpacity: overlayOpacity, imageOverlayContent: imageOverlayContent, testimonial: resolvedTestimonial })) : null, jsx("div", { className: cn("tw:flex tw:w-full tw:items-center tw:justify-center tw:p-6 tw:sm:p-12", shouldShowSplitPane && "tw:flex-1"), children: content })] }) }));
|
|
298
298
|
}
|
|
299
299
|
|
|
300
300
|
export { LoginScreen };
|
|
@@ -25,8 +25,8 @@ function SignInView({ tabs, activeTabId, tabListRef, onTabClick, onTabKeyDown, i
|
|
|
25
25
|
const isActive = tab.id === activeTabId;
|
|
26
26
|
return (jsx("button", { type: "button", role: "tab", "aria-selected": isActive, "aria-disabled": tab.disabled, tabIndex: isActive ? 0 : -1, disabled: tab.disabled, onClick: () => onTabClick(tab), onKeyDown: (event) => onTabKeyDown(event, index), className: cn("tw:flex-1 tw:rounded-md tw:px-3 tw:py-2 tw:text-sm tw:font-medium tw:transition-colors", "tw:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:focus-visible:ring-offset-2", isActive
|
|
27
27
|
? "tw:bg-background tw:text-foreground tw:shadow-sm"
|
|
28
|
-
: "tw:text-muted-foreground hover:
|
|
29
|
-
}) })) : null, jsxs("form", { onSubmit: onSubmit, className: "tw:flex tw:flex-col tw:gap-5", children: [jsxs("div", { className: "tw:flex tw:flex-col tw:gap-2", children: [jsx(Label, { htmlFor: identifierId, children: identifierLabel }), jsx(Input, { id: identifierId, type: identifierType, placeholder: identifierPlaceholder, value: identifier, onChange: (event) => onIdentifierChange(event.target.value), autoComplete: autoCompleteIdentifier, className: "tw:h-12", disabled: isSubmitting, required: true })] }), jsxs("div", { className: "tw:flex tw:flex-col tw:gap-2", children: [jsx(Label, { htmlFor: passwordId, children: passwordLabel }), jsxs("div", { className: "tw:relative", children: [jsx(Input, { id: passwordId, type: showPassword ? "text" : "password", placeholder: passwordPlaceholder, value: password, onChange: (event) => onPasswordChange(event.target.value), autoComplete: "current-password", className: "tw:h-12 tw:pr-10", disabled: isSubmitting, required: true }), jsx("button", { type: "button", className: "tw:absolute tw:right-3 tw:top-1/2 tw:-translate-y-1/2 tw:text-muted-foreground hover:
|
|
28
|
+
: "tw:text-muted-foreground tw:hover:text-foreground", tab.disabled && "tw:cursor-not-allowed tw:opacity-50"), children: tab.label }, tab.id));
|
|
29
|
+
}) })) : null, jsxs("form", { onSubmit: onSubmit, className: "tw:flex tw:flex-col tw:gap-5", children: [jsxs("div", { className: "tw:flex tw:flex-col tw:gap-2", children: [jsx(Label, { htmlFor: identifierId, children: identifierLabel }), jsx(Input, { id: identifierId, type: identifierType, placeholder: identifierPlaceholder, value: identifier, onChange: (event) => onIdentifierChange(event.target.value), autoComplete: autoCompleteIdentifier, className: "tw:h-12", disabled: isSubmitting, required: true })] }), jsxs("div", { className: "tw:flex tw:flex-col tw:gap-2", children: [jsx(Label, { htmlFor: passwordId, children: passwordLabel }), jsxs("div", { className: "tw:relative", children: [jsx(Input, { id: passwordId, type: showPassword ? "text" : "password", placeholder: passwordPlaceholder, value: password, onChange: (event) => onPasswordChange(event.target.value), autoComplete: "current-password", className: "tw:h-12 tw:pr-10", disabled: isSubmitting, required: true }), jsx("button", { type: "button", className: "tw:absolute tw:right-3 tw:top-1/2 tw:-translate-y-1/2 tw:text-muted-foreground tw:hover:text-foreground", onClick: onTogglePassword, "aria-label": showPassword ? "Hide password" : "Show password", children: showPassword ? (jsx(EyeOff, { className: "tw:size-4" })) : (jsx(Eye, { className: "tw:size-4" })) })] })] }), jsxs("div", { className: "tw:flex tw:items-center tw:justify-between", children: [jsxs("div", { className: "tw:flex tw:items-center tw:gap-2", children: [jsx(Checkbox, { id: rememberId, checked: rememberMe, onCheckedChange: (checked) => onRememberMeChange(checked === true), disabled: isSubmitting }), jsx(Label, { htmlFor: rememberId, className: "tw:cursor-pointer tw:text-sm tw:font-normal", children: rememberMeLabel })] }), jsx("button", { type: "button", className: "tw:text-sm tw:text-primary tw:hover:underline", onClick: onForgotPasswordClick, disabled: isSubmitting, children: forgotPasswordLabel })] }), jsx(Button, { type: "submit", className: "tw:h-12 tw:w-full", loading: isSubmitting, loadingText: submitLoadingLabel, disabled: !identifier.trim() || !password.trim(), children: submitLabel })] }), ssoLabel !== null ? (jsxs(Fragment, { children: [jsxs("div", { className: "tw:relative", children: [jsx("div", { className: "tw:absolute tw:inset-0 tw:flex tw:items-center", children: jsx("span", { className: "tw:w-full tw:border-t tw:border-border" }) }), jsx("div", { className: "tw:relative tw:flex tw:justify-center tw:text-xs tw:uppercase", children: jsx("span", { className: "tw:bg-card tw:px-2 tw:text-muted-foreground", children: ssoLabel }) })] }), jsxs(Button, { type: "button", variant: "outline", className: "tw:h-12 tw:w-full", onClick: onSsoClick, disabled: isSubmitting, children: [jsx(Building2, { className: "tw:size-4" }), ssoButtonLabel] })] })) : null, jsx("p", { className: "tw:text-center tw:text-xs tw:text-muted-foreground", children: legalNotice })] }));
|
|
30
30
|
}
|
|
31
31
|
function ForgotPasswordView({ title, description, emailId, emailLabel, email, onEmailChange, emailPlaceholder, submitLabel, backLabel, isSubmitting, onSubmit, onBack, error, }) {
|
|
32
32
|
return (jsxs("form", { onSubmit: onSubmit, className: "tw:flex tw:flex-col tw:gap-5", children: [jsxs("div", { className: "tw:space-y-2 tw:text-center", children: [jsx("h2", { className: "tw:text-xl tw:font-semibold", children: title }), jsx("p", { className: "tw:text-sm tw:text-muted-foreground", children: description })] }), jsxs("div", { className: "tw:flex tw:flex-col tw:gap-2", children: [jsx(Label, { htmlFor: emailId, children: emailLabel }), jsx(Input, { id: emailId, type: "email", value: email, onChange: (event) => onEmailChange(event.target.value), placeholder: emailPlaceholder, autoComplete: "email", className: "tw:h-12", disabled: isSubmitting, required: true })] }), jsx(Button, { type: "submit", className: "tw:h-12 tw:w-full", loading: isSubmitting, loadingText: submitLabel, disabled: !email.trim(), children: submitLabel }), error ? (jsx("p", { className: "tw:text-center tw:text-sm tw:text-destructive", children: error })) : null, jsx(Button, { type: "button", variant: "ghost", className: "tw:w-full", onClick: onBack, disabled: isSubmitting, children: backLabel })] }));
|
|
@@ -47,7 +47,7 @@ function FooterLinks({ links }) {
|
|
|
47
47
|
if (links.length === 0) {
|
|
48
48
|
return null;
|
|
49
49
|
}
|
|
50
|
-
return (jsx("div", { className: "tw:mt-6 tw:flex tw:flex-wrap tw:items-center tw:justify-center tw:gap-4 tw:text-xs tw:text-muted-foreground", children: links.map((link, index) => (jsxs(React.Fragment, { children: [index > 0 ? jsx("span", { "aria-hidden": "true", children: "·" }) : null, jsx("a", { href: link.href, ...getLinkAttributes(link.external), className: "hover:
|
|
50
|
+
return (jsx("div", { className: "tw:mt-6 tw:flex tw:flex-wrap tw:items-center tw:justify-center tw:gap-4 tw:text-xs tw:text-muted-foreground", children: links.map((link, index) => (jsxs(React.Fragment, { children: [index > 0 ? jsx("span", { "aria-hidden": "true", children: "·" }) : null, jsx("a", { href: link.href, ...getLinkAttributes(link.external), className: "tw:hover:text-foreground tw:hover:underline", children: link.label })] }, `${link.label}-${index}`))) }));
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
export { BrandHeader, FooterLinks, ForgotPasswordSentView, ForgotPasswordView, SignInView, SplitMediaPane, SsoEmailView };
|
|
@@ -119,12 +119,12 @@ function MultiSearchSelect({ className, options, value, onValueChange, placehold
|
|
|
119
119
|
setOpen(nextOpen);
|
|
120
120
|
if (!nextOpen)
|
|
121
121
|
setSearch("");
|
|
122
|
-
}, children: [jsx(PopoverPrimitive.Trigger, { asChild: true, children: jsxs("button", { type: "button", id: triggerId, "data-slot": "multi-search-select-trigger", disabled: disabled, "aria-haspopup": "listbox", "aria-expanded": open, "aria-controls": listboxId, className: cn("tw:!flex tw:!w-full tw:!min-h-9 tw:!items-center tw:!justify-between tw:!gap-2 tw:!rounded-md tw:!border tw:!border-input tw:!bg-transparent tw:!px-3 tw:!py-2 tw:!text-[14px] tw:!shadow-xs tw:!outline-none", "focus-visible
|
|
122
|
+
}, children: [jsx(PopoverPrimitive.Trigger, { asChild: true, children: jsxs("button", { type: "button", id: triggerId, "data-slot": "multi-search-select-trigger", disabled: disabled, "aria-haspopup": "listbox", "aria-expanded": open, "aria-controls": listboxId, className: cn("tw:!flex tw:!w-full tw:!min-h-9 tw:!items-center tw:!justify-between tw:!gap-2 tw:!rounded-md tw:!border tw:!border-input tw:!bg-transparent tw:!px-3 tw:!py-2 tw:!text-[14px] tw:!shadow-xs tw:!outline-none", "tw:focus-visible:!border-ring tw:focus-visible:!ring-ring/50 tw:focus-visible:!ring-[3px]", "tw:disabled:!cursor-not-allowed tw:disabled:!opacity-50", className), ...props, children: [jsx("div", { className: "tw:!flex tw:!min-w-0 tw:!flex-1 tw:!flex-wrap tw:!items-center tw:!gap-1.5", children: selectedOptions.length === 0 ? (jsx("span", { className: "tw:!text-muted-foreground", children: placeholder })) : (jsxs(Fragment, { children: [visibleSelectedOptions.map((option) => (jsxs(Badge, { variant: "secondary", className: "tw:!max-w-full tw:!pr-1", children: [jsx("span", { className: "tw:!max-w-[140px] tw:!truncate", children: option.label }), jsx("button", { type: "button", "aria-label": `Remove ${option.label}`, onClick: (event) => removeValue(option.value, event), className: "tw:!ml-1 tw:!inline-flex tw:!items-center tw:!justify-center", children: jsx(XIcon, { className: "tw:!size-3" }) })] }, option.value))), hiddenSelectedCount > 0 && (jsx("span", { className: "tw:!text-sm tw:!text-muted-foreground tw:!truncate", children: selectedCountText }))] })) }), jsx(ChevronDownIcon, { className: "tw:!size-4 tw:!shrink-0 tw:!opacity-50" })] }) }), jsx(PopoverPrimitive.Portal, { children: jsxs(PopoverPrimitive.Content, { "data-slot": "multi-search-select-content", align: "start", sideOffset: 4, className: "tw:!z-50 tw:!w-[var(--radix-popover-trigger-width)] tw:!rounded-md tw:!border tw:!bg-popover tw:!text-popover-foreground tw:!shadow-md tw:!outline-none", children: [jsxs("div", { className: "tw:!flex tw:!items-center tw:!gap-2 tw:!border-b tw:!px-3", children: [jsx(SearchIcon, { className: "tw:!size-4 tw:!shrink-0 tw:!text-muted-foreground" }), jsx("input", { id: searchInputId, type: "text", value: search, onChange: (event) => setSearch(event.target.value), placeholder: searchPlaceholder, "aria-label": searchPlaceholder, className: "tw:!h-9 tw:!w-full tw:!bg-transparent tw:!text-[14px] tw:!outline-none tw:placeholder:!text-muted-foreground" })] }), jsxs("div", { id: listboxId, role: "listbox", "aria-labelledby": triggerId, "aria-describedby": searchInputId, "aria-multiselectable": "true", className: "tw:!max-h-72 tw:!overflow-y-auto tw:!p-1", children: [shouldShowMinSearchHint ? (jsx("div", { role: "status", "aria-live": "polite", className: "tw:!px-2 tw:!py-2 tw:!text-[14px] tw:!text-muted-foreground", children: resolvedMinSearchMessage })) : null, isSearching ? (jsx("div", { role: "status", "aria-live": "polite", className: "tw:!px-2 tw:!py-2 tw:!text-[14px] tw:!text-muted-foreground", children: "Searching..." })) : null, !isSearching &&
|
|
123
123
|
!shouldShowMinSearchHint &&
|
|
124
124
|
filteredOptions.length === 0 ? (jsx("div", { role: "status", "aria-live": "polite", className: "tw:!px-2 tw:!py-2 tw:!text-[14px] tw:!text-muted-foreground", children: emptyMessage })) : !isSearching ? (filteredOptions.map((option) => {
|
|
125
125
|
const isSelected = value.includes(option.value);
|
|
126
|
-
return (jsxs("button", { type: "button", disabled: option.disabled, role: "option", "aria-selected": isSelected, onClick: () => toggleValue(option.value), className: cn("tw:!flex tw:!w-full tw:!items-center tw:!gap-2 tw:!rounded-sm tw:!px-2 tw:!py-1.5 tw:!text-left tw:!text-[14px]", "hover
|
|
127
|
-
"tw:!cursor-not-allowed tw:!opacity-50 hover
|
|
126
|
+
return (jsxs("button", { type: "button", disabled: option.disabled, role: "option", "aria-selected": isSelected, onClick: () => toggleValue(option.value), className: cn("tw:!flex tw:!w-full tw:!items-center tw:!gap-2 tw:!rounded-sm tw:!px-2 tw:!py-1.5 tw:!text-left tw:!text-[14px]", "tw:hover:!bg-accent tw:hover:!text-accent-foreground", option.disabled &&
|
|
127
|
+
"tw:!cursor-not-allowed tw:!opacity-50 tw:hover:!bg-transparent tw:hover:!text-foreground"), children: [jsx("span", { className: cn("tw:!inline-flex tw:!size-4 tw:!items-center tw:!justify-center tw:!rounded-[4px] tw:!border tw:!border-border", isSelected &&
|
|
128
128
|
"tw:!border-primary tw:!bg-primary tw:!text-primary-foreground"), children: isSelected ? jsx(CheckIcon, { className: "tw:!size-3" }) : null }), jsx("span", { className: "tw:!min-w-0 tw:!flex-1 tw:!truncate", children: option.label })] }, option.value));
|
|
129
129
|
})) : null] })] }) })] }));
|
|
130
130
|
}
|
|
@@ -39,10 +39,10 @@ function MultiSelect({ className, options, value, onValueChange, attentionKey, p
|
|
|
39
39
|
: [...value, optionValue];
|
|
40
40
|
onValueChange(nextValue);
|
|
41
41
|
}
|
|
42
|
-
return (jsxs(PopoverPrimitive.Root, { children: [jsx(PopoverPrimitive.Trigger, { asChild: true, children: jsxs("button", { type: "button", "data-slot": "multi-select-trigger", "data-size": size, disabled: disabled, className: cn("tw:!flex tw:!w-fit tw:!min-w-0 tw:!items-center tw:!justify-between tw:!gap-2 tw:!rounded-md tw:!border tw:!border-border tw:!bg-transparent tw:!px-3 tw:!py-2 tw:!text-[14px] tw:shadow-xs tw:!transition-[color,box-shadow] tw:!outline-none", "focus-visible
|
|
42
|
+
return (jsxs(PopoverPrimitive.Root, { children: [jsx(PopoverPrimitive.Trigger, { asChild: true, children: jsxs("button", { type: "button", "data-slot": "multi-select-trigger", "data-size": size, disabled: disabled, className: cn("tw:!flex tw:!w-fit tw:!min-w-0 tw:!items-center tw:!justify-between tw:!gap-2 tw:!rounded-md tw:!border tw:!border-border tw:!bg-transparent tw:!px-3 tw:!py-2 tw:!text-[14px] tw:shadow-xs tw:!transition-[color,box-shadow] tw:!outline-none", "tw:focus-visible:!border-ring tw:focus-visible:!ring-ring/50 tw:focus-visible:!ring-[3px]", "tw:aria-invalid:!border-destructive tw:aria-invalid:!ring-destructive/20 tw:dark:aria-invalid:!ring-destructive/40", "tw:dark:!bg-input/30 tw:dark:hover:!bg-input/50", "tw:disabled:!cursor-not-allowed tw:disabled:!opacity-50", "tw:data-[size=default]:!min-h-9 tw:data-[size=sm]:!min-h-8", isInvalid && "tw:!border-destructive", className), "aria-invalid": isInvalid || undefined, style: attentionProps.style, ...props, children: [jsx("span", { ref: valueRef, "data-slot": "multi-select-value", className: cn("tw:!block tw:!min-w-0 tw:!flex-1 tw:!truncate tw:!text-left", selectedOptions.length === 0 && "tw:!text-muted-foreground"), children: selectedOptions.length === 0 ? placeholder : displayValue }), jsx(ChevronDownIcon, { className: "tw:!size-4 tw:!shrink-0 tw:!opacity-50" })] }) }), jsx(PopoverPrimitive.Portal, { children: jsx(PopoverPrimitive.Content, { "data-slot": "multi-select-content", align: "start", sideOffset: 4, className: "tw:!z-50 tw:!max-h-72 tw:!min-w-[var(--radix-popover-trigger-width)] tw:!overflow-y-auto tw:!rounded-md tw:!border tw:!bg-popover tw:!p-1 tw:!text-popover-foreground tw:!shadow-md tw:!outline-none tw:data-[state=open]:!animate-in tw:data-[state=closed]:!animate-out tw:data-[state=closed]:!fade-out-0 tw:data-[state=open]:!fade-in-0 tw:data-[state=closed]:!zoom-out-95 tw:data-[state=open]:!zoom-in-95", children: options.length === 0 ? (jsx("div", { className: "tw:!px-2 tw:!py-1.5 tw:!text-[14px] tw:!text-muted-foreground", children: emptyMessage })) : (options.map((option) => {
|
|
43
43
|
const isSelected = value.includes(option.value);
|
|
44
|
-
return (jsxs("button", { type: "button", "data-slot": "multi-select-item", disabled: option.disabled, className: cn("tw:!relative tw:!flex tw:!w-full tw:!cursor-default tw:!items-center tw:!gap-2 tw:!rounded-sm tw:!py-1.5 tw:!pl-2 tw:!pr-8 tw:!text-left tw:!text-[14px] tw:!outline-hidden tw:!select-none tw:!transition-colors", "hover
|
|
45
|
-
"tw:!cursor-not-allowed tw:!bg-muted/50 tw:!text-muted-foreground tw:!opacity-60 hover
|
|
44
|
+
return (jsxs("button", { type: "button", "data-slot": "multi-select-item", disabled: option.disabled, className: cn("tw:!relative tw:!flex tw:!w-full tw:!cursor-default tw:!items-center tw:!gap-2 tw:!rounded-sm tw:!py-1.5 tw:!pl-2 tw:!pr-8 tw:!text-left tw:!text-[14px] tw:!outline-hidden tw:!select-none tw:!transition-colors", "tw:hover:!bg-accent tw:hover:!text-accent-foreground tw:focus:!bg-accent tw:focus:!text-accent-foreground", option.disabled &&
|
|
45
|
+
"tw:!cursor-not-allowed tw:!bg-muted/50 tw:!text-muted-foreground tw:!opacity-60 tw:hover:!bg-muted/50 tw:hover:!text-muted-foreground"), onClick: () => toggleValue(option.value), children: [jsx("span", { className: "tw:!absolute tw:!right-2 tw:!flex tw:!size-3.5 tw:!items-center tw:!justify-center", children: isSelected ? jsx(CheckIcon, { className: "tw:!size-4" }) : null }), jsx("span", { className: "tw:!min-w-0 tw:!flex-1 tw:!truncate", children: option.label })] }, option.value));
|
|
46
46
|
})) }) })] }));
|
|
47
47
|
}
|
|
48
48
|
function getCollapsedDisplayValue(labels, availableWidth, valueElement) {
|
|
@@ -13,21 +13,21 @@ function NavigationMenuList({ className, ...props }) {
|
|
|
13
13
|
function NavigationMenuItem({ className, ...props }) {
|
|
14
14
|
return (jsx(NavigationMenuPrimitive.Item, { "data-slot": "navigation-menu-item", className: cn("tw:relative", className), ...props }));
|
|
15
15
|
}
|
|
16
|
-
const navigationMenuTriggerStyle = cva("tw:group tw:inline-flex tw:h-9 tw:w-max tw:items-center tw:justify-center tw:rounded-md tw:bg-background tw:px-4 tw:py-2 tw:text-sm tw:font-medium hover:
|
|
16
|
+
const navigationMenuTriggerStyle = cva("tw:group tw:inline-flex tw:h-9 tw:w-max tw:items-center tw:justify-center tw:rounded-md tw:bg-background tw:px-4 tw:py-2 tw:text-sm tw:font-medium tw:hover:bg-accent tw:hover:text-accent-foreground tw:focus:bg-accent tw:focus:text-accent-foreground tw:disabled:pointer-events-none tw:disabled:opacity-50 tw:data-[state=open]:hover:bg-accent tw:data-[state=open]:text-accent-foreground tw:data-[state=open]:focus:bg-accent tw:data-[state=open]:bg-accent/50 tw:focus-visible:ring-ring/50 tw:outline-none tw:transition-[color,box-shadow] tw:focus-visible:ring-[3px] tw:focus-visible:outline-1");
|
|
17
17
|
function NavigationMenuTrigger({ className, children, ...props }) {
|
|
18
|
-
return (jsxs(NavigationMenuPrimitive.Trigger, { "data-slot": "navigation-menu-trigger", className: cn(navigationMenuTriggerStyle(), "tw:group", className), ...props, children: [children, " ", jsx(ChevronDownIcon, { className: "tw:relative tw:top-[1px] tw:ml-1 tw:size-3 tw:transition tw:duration-300 group-data-[state=open]:
|
|
18
|
+
return (jsxs(NavigationMenuPrimitive.Trigger, { "data-slot": "navigation-menu-trigger", className: cn(navigationMenuTriggerStyle(), "tw:group", className), ...props, children: [children, " ", jsx(ChevronDownIcon, { className: "tw:relative tw:top-[1px] tw:ml-1 tw:size-3 tw:transition tw:duration-300 tw:group-data-[state=open]:rotate-180", "aria-hidden": "true" })] }));
|
|
19
19
|
}
|
|
20
20
|
function NavigationMenuContent({ className, ...props }) {
|
|
21
|
-
return (jsx(NavigationMenuPrimitive.Content, { "data-slot": "navigation-menu-content", className: cn("data-[motion^=from-]:
|
|
21
|
+
return (jsx(NavigationMenuPrimitive.Content, { "data-slot": "navigation-menu-content", className: cn("tw:data-[motion^=from-]:animate-in tw:data-[motion^=to-]:animate-out tw:data-[motion^=from-]:fade-in tw:data-[motion^=to-]:fade-out tw:data-[motion=from-end]:slide-in-from-right-52 tw:data-[motion=from-start]:slide-in-from-left-52 tw:data-[motion=to-end]:slide-out-to-right-52 tw:data-[motion=to-start]:slide-out-to-left-52 tw:top-0 tw:left-0 tw:w-full tw:p-2 tw:pr-2.5 tw:md:absolute tw:md:w-auto", "tw:group-data-[viewport=false]/navigation-menu:bg-popover tw:group-data-[viewport=false]/navigation-menu:text-popover-foreground tw:group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in tw:group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out tw:group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 tw:group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 tw:group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 tw:group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 tw:group-data-[viewport=false]/navigation-menu:top-full tw:group-data-[viewport=false]/navigation-menu:mt-1.5 tw:group-data-[viewport=false]/navigation-menu:overflow-hidden tw:group-data-[viewport=false]/navigation-menu:rounded-md tw:group-data-[viewport=false]/navigation-menu:border tw:group-data-[viewport=false]/navigation-menu:shadow tw:group-data-[viewport=false]/navigation-menu:duration-200 tw:**:data-[slot=navigation-menu-link]:focus:ring-0 tw:**:data-[slot=navigation-menu-link]:focus:outline-none", className), ...props }));
|
|
22
22
|
}
|
|
23
23
|
function NavigationMenuViewport({ className, ...props }) {
|
|
24
|
-
return (jsx("div", { className: cn("tw:absolute tw:top-full tw:left-0 tw:isolate tw:z-50 tw:flex tw:justify-center"), children: jsx(NavigationMenuPrimitive.Viewport, { "data-slot": "navigation-menu-viewport", className: cn("tw:origin-top-center tw:bg-popover tw:text-popover-foreground data-[state=open]:
|
|
24
|
+
return (jsx("div", { className: cn("tw:absolute tw:top-full tw:left-0 tw:isolate tw:z-50 tw:flex tw:justify-center"), children: jsx(NavigationMenuPrimitive.Viewport, { "data-slot": "navigation-menu-viewport", className: cn("tw:origin-top-center tw:bg-popover tw:text-popover-foreground tw:data-[state=open]:animate-in tw:data-[state=closed]:animate-out tw:data-[state=closed]:zoom-out-95 tw:data-[state=open]:zoom-in-90 tw:relative tw:mt-1.5 tw:h-[var(--radix-navigation-menu-viewport-height)] tw:w-full tw:overflow-hidden tw:rounded-md tw:border tw:shadow tw:md:w-[var(--radix-navigation-menu-viewport-width)]", className), ...props }) }));
|
|
25
25
|
}
|
|
26
26
|
function NavigationMenuLink({ className, ...props }) {
|
|
27
|
-
return (jsx(NavigationMenuPrimitive.Link, { "data-slot": "navigation-menu-link", className: cn("data-[active=true]:focus:
|
|
27
|
+
return (jsx(NavigationMenuPrimitive.Link, { "data-slot": "navigation-menu-link", className: cn("tw:data-[active=true]:focus:bg-accent tw:data-[active=true]:hover:bg-accent tw:data-[active=true]:bg-accent/50 tw:data-[active=true]:text-accent-foreground tw:hover:bg-accent tw:hover:text-accent-foreground tw:focus:bg-accent tw:focus:text-accent-foreground tw:focus-visible:ring-ring/50 tw:[&_svg:not([class*='text-'])]:text-muted-foreground tw:flex tw:flex-col tw:gap-1 tw:rounded-sm tw:p-2 tw:text-sm tw:transition-all tw:outline-none tw:focus-visible:ring-[3px] tw:focus-visible:outline-1 tw:[&_svg:not([class*='size-'])]:size-4", className), ...props }));
|
|
28
28
|
}
|
|
29
29
|
function NavigationMenuIndicator({ className, ...props }) {
|
|
30
|
-
return (jsx(NavigationMenuPrimitive.Indicator, { "data-slot": "navigation-menu-indicator", className: cn("data-[state=visible]:
|
|
30
|
+
return (jsx(NavigationMenuPrimitive.Indicator, { "data-slot": "navigation-menu-indicator", className: cn("tw:data-[state=visible]:animate-in tw:data-[state=hidden]:animate-out tw:data-[state=hidden]:fade-out tw:data-[state=visible]:fade-in tw:top-full tw:z-[1] tw:flex tw:h-1.5 tw:items-end tw:justify-center tw:overflow-hidden", className), ...props, children: jsx("div", { className: "tw:bg-border tw:relative tw:top-[60%] tw:h-2 tw:w-2 tw:rotate-45 tw:rounded-tl-sm tw:shadow-md" }) }));
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
export { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, navigationMenuTriggerStyle };
|
|
@@ -16,13 +16,13 @@ function PaginationLink({ className, isActive, size = "icon", ...props }) {
|
|
|
16
16
|
return (jsx("a", { "aria-current": isActive ? "page" : undefined, "data-slot": "pagination-link", "data-active": isActive, className: cn(buttonVariants({
|
|
17
17
|
variant: isActive ? "outline" : "ghost",
|
|
18
18
|
size,
|
|
19
|
-
}), "tw:!text-foreground tw:!text-[14px] tw:!no-underline hover
|
|
19
|
+
}), "tw:!text-foreground tw:!text-[14px] tw:!no-underline tw:hover:!bg-accent tw:hover:!text-accent-foreground tw:data-[active=true]:!text-accent-foreground tw:data-[active=true]:!border tw:data-[active=true]:!border-input tw:!h-[32px]", size === "icon" && "tw:!w-[32px]", className), ...props }));
|
|
20
20
|
}
|
|
21
21
|
function PaginationPrevious({ className, ...props }) {
|
|
22
|
-
return (jsxs(PaginationLink, { "aria-label": "Go to previous page", size: "default", className: cn("tw:!gap-1 tw:!px-2.5 sm
|
|
22
|
+
return (jsxs(PaginationLink, { "aria-label": "Go to previous page", size: "default", className: cn("tw:!gap-1 tw:!px-2.5 tw:sm:!pl-2.5 tw:!h-[32px]", className), ...props, children: [jsx(ChevronLeftIcon, { className: "tw:!size-4" }), jsx("span", { className: "tw:!hidden tw:sm:!block", children: "Previous" })] }));
|
|
23
23
|
}
|
|
24
24
|
function PaginationNext({ className, ...props }) {
|
|
25
|
-
return (jsxs(PaginationLink, { "aria-label": "Go to next page", size: "default", className: cn("tw:!gap-1 tw:!px-2.5 sm
|
|
25
|
+
return (jsxs(PaginationLink, { "aria-label": "Go to next page", size: "default", className: cn("tw:!gap-1 tw:!px-2.5 tw:sm:!pr-2.5 tw:!h-8", className), ...props, children: [jsx("span", { className: "tw:!hidden tw:sm:!block", children: "Next" }), jsx(ChevronRightIcon, { className: "tw:!size-4" })] }));
|
|
26
26
|
}
|
|
27
27
|
function PaginationEllipsis({ className, ...props }) {
|
|
28
28
|
return (jsxs("span", { "aria-hidden": true, "data-slot": "pagination-ellipsis", className: cn("tw:!flex tw:!size-9 tw:!items-center tw:!justify-center", className), ...props, children: [jsx(MoreHorizontalIcon, { className: "tw:!size-4" }), jsx("span", { className: "tw:sr-only", children: "More pages" })] }));
|
|
@@ -9,7 +9,7 @@ function PopoverTrigger({ ...props }) {
|
|
|
9
9
|
return jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
10
10
|
}
|
|
11
11
|
function PopoverContent({ className, align = "center", sideOffset = 4, ...props }) {
|
|
12
|
-
return (jsx(PopoverPrimitive.Portal, { children: jsx(PopoverPrimitive.Content, { "data-slot": "popover-content", align: align, sideOffset: sideOffset, className: cn("tw:!bg-popover tw:!text-popover-foreground data-[state=open]
|
|
12
|
+
return (jsx(PopoverPrimitive.Portal, { children: jsx(PopoverPrimitive.Content, { "data-slot": "popover-content", align: align, sideOffset: sideOffset, className: cn("tw:!bg-popover tw:!text-popover-foreground tw:data-[state=open]:!animate-in tw:data-[state=closed]:!animate-out tw:data-[state=closed]:!fade-out-0 tw:data-[state=open]:!fade-in-0 tw:data-[state=closed]:!zoom-out-95 tw:data-[state=open]:!zoom-in-95 tw:data-[side=bottom]:!slide-in-from-top-2 tw:data-[side=left]:!slide-in-from-right-2 tw:data-[side=right]:!slide-in-from-left-2 tw:data-[side=top]:!slide-in-from-bottom-2 tw:!z-50 tw:!w-72 tw:!origin-(--radix-popover-content-transform-origin) tw:!rounded-md tw:!border tw:!p-4 tw:!shadow-md tw:!outline-hidden", className), ...props }) }));
|
|
13
13
|
}
|
|
14
14
|
function PopoverAnchor({ ...props }) {
|
|
15
15
|
return jsx(PopoverPrimitive.Anchor, { "data-slot": "popover-anchor", ...props });
|
|
@@ -4,13 +4,13 @@ import { Separator, Panel, Group } from 'react-resizable-panels';
|
|
|
4
4
|
import { cn } from '../lib/utils.js';
|
|
5
5
|
|
|
6
6
|
function ResizablePanelGroup({ className, ...props }) {
|
|
7
|
-
return (jsx(Group, { "data-slot": "resizable-panel-group", className: cn("tw:flex tw:h-full tw:w-full data-[panel-group-direction=vertical]:
|
|
7
|
+
return (jsx(Group, { "data-slot": "resizable-panel-group", className: cn("tw:flex tw:h-full tw:w-full tw:data-[panel-group-direction=vertical]:flex-col", className), ...props }));
|
|
8
8
|
}
|
|
9
9
|
function ResizablePanel({ ...props }) {
|
|
10
10
|
return jsx(Panel, { "data-slot": "resizable-panel", ...props });
|
|
11
11
|
}
|
|
12
12
|
function ResizableHandle({ withHandle, className, ...props }) {
|
|
13
|
-
return (jsx(Separator, { "data-slot": "resizable-handle", className: cn("tw:bg-border focus-visible:
|
|
13
|
+
return (jsx(Separator, { "data-slot": "resizable-handle", className: cn("tw:bg-border tw:focus-visible:ring-ring tw:relative tw:flex tw:w-px tw:items-center tw:justify-center tw:after:absolute tw:after:inset-y-0 tw:after:left-1/2 tw:after:w-1 tw:after:-translate-x-1/2 tw:focus-visible:ring-1 tw:focus-visible:ring-offset-1 tw:focus-visible:outline-hidden tw:data-[panel-group-direction=vertical]:h-px tw:data-[panel-group-direction=vertical]:w-full tw:data-[panel-group-direction=vertical]:after:left-0 tw:data-[panel-group-direction=vertical]:after:h-1 tw:data-[panel-group-direction=vertical]:after:w-full tw:data-[panel-group-direction=vertical]:after:translate-x-0 tw:data-[panel-group-direction=vertical]:after:-translate-y-1/2 tw:[&[data-panel-group-direction=vertical]>div]:rotate-90", className), ...props, children: withHandle && (jsx("div", { className: "tw:bg-border tw:z-10 tw:flex tw:h-4 tw:w-3 tw:items-center tw:justify-center tw:rounded-xs tw:border", children: jsx(GripVerticalIcon, { className: "tw:size-2.5" }) })) }));
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export { ResizableHandle, ResizablePanel, ResizablePanelGroup };
|
|
@@ -19,7 +19,7 @@ function SearchBar({ value, onChange, onSearch, onClear, placeholder = "Search..
|
|
|
19
19
|
onChange("");
|
|
20
20
|
onClear();
|
|
21
21
|
};
|
|
22
|
-
return (jsxs("div", { "data-slot": "search-bar", className: cn("tw:!flex tw:!w-full tw:!gap-2", className), children: [jsxs("div", { className: "tw:!relative tw:!flex-1", children: [jsx(SearchIcon, { className: "tw:!absolute tw:!left-3 tw:!top-1/2 tw:!-translate-y-1/2 tw:!h-4 tw:!w-4 tw:text-muted-foreground tw:!pointer-events-none", "aria-hidden": "true" }), jsx(Input, { type: "text", value: value, onChange: (e) => onChange(e.target.value), onKeyDown: handleKeyDown, placeholder: placeholder, disabled: disabled, className: "tw:!pl-9", "aria-label": inputAriaLabel }), value && !disabled && (jsx("button", { type: "button", onClick: handleClearClick, className: "tw:!absolute tw:!right-3 tw:!top-1/2 tw:!-translate-y-1/2 tw:!h-4 tw:!w-4 tw:text-muted-foreground hover:
|
|
22
|
+
return (jsxs("div", { "data-slot": "search-bar", className: cn("tw:!flex tw:!w-full tw:!gap-2", className), children: [jsxs("div", { className: "tw:!relative tw:!flex-1", children: [jsx(SearchIcon, { className: "tw:!absolute tw:!left-3 tw:!top-1/2 tw:!-translate-y-1/2 tw:!h-4 tw:!w-4 tw:text-muted-foreground tw:!pointer-events-none", "aria-hidden": "true" }), jsx(Input, { type: "text", value: value, onChange: (e) => onChange(e.target.value), onKeyDown: handleKeyDown, placeholder: placeholder, disabled: disabled, className: "tw:!pl-9", "aria-label": inputAriaLabel }), value && !disabled && (jsx("button", { type: "button", onClick: handleClearClick, className: "tw:!absolute tw:!right-3 tw:!top-1/2 tw:!-translate-y-1/2 tw:!h-4 tw:!w-4 tw:text-muted-foreground tw:hover:text-foreground tw:transition-colors tw:!cursor-pointer", "aria-label": "Clear search", children: jsx(XIcon, { className: "tw:!h-4 tw:!w-4" }) }))] }), jsx(Button, { variant: "default", size: "sm", onClick: () => onSearch(value), disabled: disabled || !value, loading: loading, className: cn("tw:!min-w-[80px]", (disabled || !value) && "tw:!opacity-50 tw:!cursor-not-allowed"), "aria-label": "Apply search", children: applyLabel }), jsx(Button, { variant: "outline", size: "sm", onClick: handleClearClick, disabled: disabled || !value, className: cn("tw:!min-w-[80px]", (disabled || !value) && "tw:!opacity-50 tw:!cursor-not-allowed"), "aria-label": "Clear search", children: clearLabel })] }));
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export { SearchBar };
|
|
@@ -13,18 +13,18 @@ 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("tw:!flex tw:!w-fit tw:!items-center tw:!justify-between tw:!gap-2 tw:!rounded-md tw:!border tw:!border-border tw:!bg-transparent tw:!px-3 tw:!py-2 tw:!text-[14px] tw:!whitespace-nowrap tw:!shadow-xs tw:!transition-[color,box-shadow] tw:!outline-none", "data-[placeholder]
|
|
16
|
+
return (jsxs(SelectPrimitive.Trigger, { "data-slot": "select-trigger", "data-size": size, className: cn("tw:!flex tw:!w-fit tw:!items-center tw:!justify-between tw:!gap-2 tw:!rounded-md tw:!border tw:!border-border tw:!bg-transparent tw:!px-3 tw:!py-2 tw:!text-[14px] tw:!whitespace-nowrap tw:!shadow-xs tw:!transition-[color,box-shadow] tw:!outline-none", "tw:data-[placeholder]:!text-muted-foreground tw:[&_svg:not([class*='text-'])]:!text-muted-foreground", "tw:focus-visible:!border-ring tw:focus-visible:!ring-ring/50 tw:focus-visible:!ring-[3px]", "tw:aria-invalid:!border-destructive tw:aria-invalid:!ring-destructive/20 tw:dark:aria-invalid:!ring-destructive/40", "tw:dark:!bg-input/30 tw:dark:hover:!bg-input/50", "tw:disabled:!cursor-not-allowed tw:disabled:!opacity-50", "tw:data-[size=default]:!h-9 tw:data-[size=sm]:!h-8", "tw:*:data-[slot=select-value]:!line-clamp-1 tw:*:data-[slot=select-value]:!flex tw:*:data-[slot=select-value]:!items-center tw:*:data-[slot=select-value]:!gap-2", "tw:[&_svg]:!pointer-events-none tw:[&_svg]:!shrink-0 tw:[&_svg:not([class*='size-'])]:!size-4", className), ...props, children: [children, jsx(SelectPrimitive.Icon, { asChild: true, children: jsx(ChevronDownIcon, { className: "tw:!size-4 tw:!opacity-50" }) })] }));
|
|
17
17
|
}
|
|
18
18
|
function SelectContent({ className, children, position = "popper", ...props }) {
|
|
19
|
-
return (jsx(SelectPrimitive.Portal, { children: jsxs(SelectPrimitive.Content, { "data-slot": "select-content", className: cn("tw:!relative tw:!z-50 tw:!min-w-[8rem] tw:!max-h-(--radix-select-content-available-height) tw:!origin-(--radix-select-content-transform-origin) tw:!overflow-x-hidden tw:!overflow-y-auto tw:!rounded-md tw:!border tw:!bg-popover tw:!text-popover-foreground tw:!shadow-md", "data-[state=open]
|
|
20
|
-
"data-[side=bottom]
|
|
19
|
+
return (jsx(SelectPrimitive.Portal, { children: jsxs(SelectPrimitive.Content, { "data-slot": "select-content", className: cn("tw:!relative tw:!z-50 tw:!min-w-[8rem] tw:!max-h-(--radix-select-content-available-height) tw:!origin-(--radix-select-content-transform-origin) tw:!overflow-x-hidden tw:!overflow-y-auto tw:!rounded-md tw:!border tw:!bg-popover tw:!text-popover-foreground tw:!shadow-md", "tw:data-[state=open]:!animate-in tw:data-[state=closed]:!animate-out tw:data-[state=closed]:!fade-out-0 tw:data-[state=open]:!fade-in-0 tw:data-[state=closed]:!zoom-out-95 tw:data-[state=open]:!zoom-in-95", "tw:data-[side=bottom]:!slide-in-from-top-2 tw:data-[side=left]:!slide-in-from-right-2 tw:data-[side=right]:!slide-in-from-left-2 tw:data-[side=top]:!slide-in-from-bottom-2", position === "popper" &&
|
|
20
|
+
"tw:data-[side=bottom]:!translate-y-1 tw:data-[side=left]:!-translate-x-1 tw:data-[side=right]:!translate-x-1 tw:data-[side=top]:!-translate-y-1", className), position: position, ...props, children: [jsx(SelectScrollUpButton, {}), jsx(SelectPrimitive.Viewport, { className: cn("tw:!p-1", position === "popper" &&
|
|
21
21
|
"tw:!h-[var(--radix-select-trigger-height)] tw:!w-full tw:!min-w-[var(--radix-select-trigger-width)] tw:!scroll-my-1"), children: children }), jsx(SelectScrollDownButton, {})] }) }));
|
|
22
22
|
}
|
|
23
23
|
function SelectLabel({ className, ...props }) {
|
|
24
24
|
return (jsx(SelectPrimitive.Label, { "data-slot": "select-label", className: cn("tw:!text-muted-foreground tw:!px-2 tw:!py-1.5 tw:!text-[12px]", className), ...props }));
|
|
25
25
|
}
|
|
26
26
|
function SelectItem({ className, children, ...props }) {
|
|
27
|
-
return (jsxs(SelectPrimitive.Item, { "data-slot": "select-item", className: cn("tw:!relative tw:!flex tw:!w-full tw:!cursor-default tw:!items-center tw:!gap-2 tw:!rounded-sm tw:!py-1.5 tw:!pl-2 tw:!pr-8 tw:!text-[14px] tw:!outline-hidden tw:!select-none tw:!transition-colors", "focus
|
|
27
|
+
return (jsxs(SelectPrimitive.Item, { "data-slot": "select-item", className: cn("tw:!relative tw:!flex tw:!w-full tw:!cursor-default tw:!items-center tw:!gap-2 tw:!rounded-sm tw:!py-1.5 tw:!pl-2 tw:!pr-8 tw:!text-[14px] tw:!outline-hidden tw:!select-none tw:!transition-colors", "tw:focus:!bg-accent tw:focus:!text-accent-foreground", "tw:data-[disabled]:!pointer-events-none tw:data-[disabled]:!opacity-50", "tw:[&>span]:!line-clamp-1 tw:[&>span]:!flex tw:[&>span]:!items-center tw:[&>span]:!gap-2", "tw:[&_svg]:!pointer-events-none tw:[&_svg]:!shrink-0 tw:[&_svg:not([class*='size-'])]:!size-4 tw:[&_svg:not([class*='text-'])]:!text-muted-foreground", className), ...props, children: [jsx("span", { className: "tw:!absolute tw:!right-2 tw:!flex tw:!size-3.5 tw:!items-center tw:!justify-center", children: jsx(SelectPrimitive.ItemIndicator, { children: jsx(CheckIcon, { className: "tw:!size-4" }) }) }), jsx(SelectPrimitive.ItemText, { children: children })] }));
|
|
28
28
|
}
|
|
29
29
|
function SelectSeparator({ className, ...props }) {
|
|
30
30
|
return (jsx(SelectPrimitive.Separator, { "data-slot": "select-separator", className: cn("tw:!bg-border tw:!pointer-events-none tw:!-mx-1 tw:!my-1 tw:!h-px", className), ...props }));
|
|
@@ -76,7 +76,7 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
76
76
|
"--sidebar-width": SIDEBAR_WIDTH,
|
|
77
77
|
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
78
78
|
...style,
|
|
79
|
-
}, className: cn("group/sidebar-wrapper has-data-[variant=inset]:
|
|
79
|
+
}, className: cn("group/sidebar-wrapper tw:has-data-[variant=inset]:bg-sidebar tw:flex tw:min-h-svh tw:w-full", className), ...props, children: children }) }) }));
|
|
80
80
|
}
|
|
81
81
|
function Sidebar({ side = "left", variant = "sidebar", collapsible = "offcanvas", className, children, ...props }) {
|
|
82
82
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
@@ -84,19 +84,19 @@ function Sidebar({ side = "left", variant = "sidebar", collapsible = "offcanvas"
|
|
|
84
84
|
return (jsx("div", { "data-slot": "sidebar", className: cn("tw:bg-sidebar tw:text-sidebar-foreground tw:flex tw:h-full tw:w-(--sidebar-width) tw:flex-col", className), ...props, children: children }));
|
|
85
85
|
}
|
|
86
86
|
if (isMobile) {
|
|
87
|
-
return (jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: jsxs(SheetContent, { "data-sidebar": "sidebar", "data-slot": "sidebar", "data-mobile": "true", className: "tw:bg-sidebar tw:text-sidebar-foreground tw:w-(--sidebar-width) tw:p-0 [&>button]:
|
|
87
|
+
return (jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: jsxs(SheetContent, { "data-sidebar": "sidebar", "data-slot": "sidebar", "data-mobile": "true", className: "tw:bg-sidebar tw:text-sidebar-foreground tw:w-(--sidebar-width) tw:p-0 tw:[&>button]:hidden", style: {
|
|
88
88
|
"--sidebar-width": SIDEBAR_WIDTH_MOBILE,
|
|
89
89
|
}, side: side, children: [jsxs(SheetHeader, { className: "tw:sr-only", children: [jsx(SheetTitle, { children: "Sidebar" }), jsx(SheetDescription, { children: "Displays the mobile sidebar." })] }), jsx("div", { className: "tw:flex tw:h-full tw:w-full tw:flex-col", children: children })] }) }));
|
|
90
90
|
}
|
|
91
|
-
return (jsxs("div", { className: "group peer tw:text-sidebar-foreground tw:hidden md:
|
|
92
|
-
? "group-data-[collapsible=icon]:
|
|
93
|
-
: "group-data-[collapsible=icon]:
|
|
94
|
-
? "tw:left-0 group-data-[collapsible=offcanvas]:
|
|
95
|
-
: "tw:right-0 group-data-[collapsible=offcanvas]:
|
|
91
|
+
return (jsxs("div", { className: "group peer tw:text-sidebar-foreground tw:hidden tw:md:block", "data-state": state, "data-collapsible": state === "collapsed" ? collapsible : "", "data-variant": variant, "data-side": side, "data-slot": "sidebar", children: [jsx("div", { "data-slot": "sidebar-gap", className: cn("tw:relative tw:w-(--sidebar-width) tw:bg-transparent tw:transition-[width] tw:duration-200 tw:ease-linear", "tw:group-data-[collapsible=offcanvas]:w-0", "tw:group-data-[side=right]:rotate-180", variant === "floating" || variant === "inset"
|
|
92
|
+
? "tw:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]"
|
|
93
|
+
: "tw:group-data-[collapsible=icon]:w-(--sidebar-width-icon)") }), jsx("div", { "data-slot": "sidebar-container", className: cn("tw:fixed tw:inset-y-0 tw:z-10 tw:hidden tw:h-svh tw:w-(--sidebar-width) tw:transition-[left,right,width] tw:duration-200 tw:ease-linear tw:md:flex", side === "left"
|
|
94
|
+
? "tw:left-0 tw:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]"
|
|
95
|
+
: "tw:right-0 tw:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
|
|
96
96
|
// Adjust the padding for floating and inset variants.
|
|
97
97
|
variant === "floating" || variant === "inset"
|
|
98
|
-
? "tw:p-2 group-data-[collapsible=icon]:
|
|
99
|
-
: "group-data-[collapsible=icon]:
|
|
98
|
+
? "tw:p-2 tw:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]"
|
|
99
|
+
: "tw:group-data-[collapsible=icon]:w-(--sidebar-width-icon) tw:group-data-[side=left]:border-r tw:group-data-[side=right]:border-l", className), ...props, children: jsx("div", { "data-sidebar": "sidebar", "data-slot": "sidebar-inner", className: "tw:bg-sidebar tw:group-data-[variant=floating]:border-sidebar-border tw:flex tw:h-full tw:w-full tw:flex-col tw:group-data-[variant=floating]:rounded-lg tw:group-data-[variant=floating]:border tw:group-data-[variant=floating]:shadow-sm", children: children }) })] }));
|
|
100
100
|
}
|
|
101
101
|
function SidebarTrigger({ className, onClick, ...props }) {
|
|
102
102
|
const { toggleSidebar } = useSidebar();
|
|
@@ -107,10 +107,10 @@ function SidebarTrigger({ className, onClick, ...props }) {
|
|
|
107
107
|
}
|
|
108
108
|
function SidebarRail({ className, ...props }) {
|
|
109
109
|
const { toggleSidebar } = useSidebar();
|
|
110
|
-
return (jsx("button", { "data-sidebar": "rail", "data-slot": "sidebar-rail", "aria-label": "Toggle Sidebar", tabIndex: -1, onClick: toggleSidebar, title: "Toggle Sidebar", className: cn("hover:after:
|
|
110
|
+
return (jsx("button", { "data-sidebar": "rail", "data-slot": "sidebar-rail", "aria-label": "Toggle Sidebar", tabIndex: -1, onClick: toggleSidebar, title: "Toggle Sidebar", className: cn("tw:hover:after:bg-sidebar-border tw:absolute tw:inset-y-0 tw:z-20 tw:hidden tw:w-4 tw:-translate-x-1/2 tw:transition-all tw:ease-linear tw:group-data-[side=left]:-right-4 tw:group-data-[side=right]:left-0 tw:after:absolute tw:after:inset-y-0 tw:after:left-1/2 tw:after:w-[2px] tw:sm:flex", "tw:in-data-[side=left]:cursor-w-resize tw:in-data-[side=right]:cursor-e-resize", "tw:[[data-side=left][data-state=collapsed]_&]:cursor-e-resize tw:[[data-side=right][data-state=collapsed]_&]:cursor-w-resize", "tw:hover:group-data-[collapsible=offcanvas]:bg-sidebar tw:group-data-[collapsible=offcanvas]:translate-x-0 tw:group-data-[collapsible=offcanvas]:after:left-full", "tw:[[data-side=left][data-collapsible=offcanvas]_&]:-right-2", "tw:[[data-side=right][data-collapsible=offcanvas]_&]:-left-2", className), ...props }));
|
|
111
111
|
}
|
|
112
112
|
function SidebarInset({ className, ...props }) {
|
|
113
|
-
return (jsx("main", { "data-slot": "sidebar-inset", className: cn("tw:bg-background tw:relative tw:flex tw:w-full tw:flex-1 tw:flex-col", "md:peer-data-[variant=inset]:
|
|
113
|
+
return (jsx("main", { "data-slot": "sidebar-inset", className: cn("tw:bg-background tw:relative tw:flex tw:w-full tw:flex-1 tw:flex-col", "tw:md:peer-data-[variant=inset]:m-2 tw:md:peer-data-[variant=inset]:ml-0 tw:md:peer-data-[variant=inset]:rounded-xl tw:md:peer-data-[variant=inset]:shadow-sm tw:md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2", className), ...props }));
|
|
114
114
|
}
|
|
115
115
|
function SidebarInput({ className, ...props }) {
|
|
116
116
|
return (jsx(Input, { "data-slot": "sidebar-input", "data-sidebar": "input", className: cn("tw:bg-background tw:h-8 tw:w-full tw:shadow-none", className), ...props }));
|
|
@@ -125,20 +125,20 @@ function SidebarSeparator({ className, ...props }) {
|
|
|
125
125
|
return (jsx(Separator, { "data-slot": "sidebar-separator", "data-sidebar": "separator", className: cn("tw:bg-sidebar-border tw:mx-2 tw:w-auto", className), ...props }));
|
|
126
126
|
}
|
|
127
127
|
function SidebarContent({ className, ...props }) {
|
|
128
|
-
return (jsx("div", { "data-slot": "sidebar-content", "data-sidebar": "content", className: cn("tw:flex tw:min-h-0 tw:flex-1 tw:flex-col tw:gap-2 tw:overflow-auto group-data-[collapsible=icon]:
|
|
128
|
+
return (jsx("div", { "data-slot": "sidebar-content", "data-sidebar": "content", className: cn("tw:flex tw:min-h-0 tw:flex-1 tw:flex-col tw:gap-2 tw:overflow-auto tw:group-data-[collapsible=icon]:overflow-hidden", className), ...props }));
|
|
129
129
|
}
|
|
130
130
|
function SidebarGroup({ className, ...props }) {
|
|
131
131
|
return (jsx("div", { "data-slot": "sidebar-group", "data-sidebar": "group", className: cn("tw:relative tw:flex tw:w-full tw:min-w-0 tw:flex-col tw:p-2", className), ...props }));
|
|
132
132
|
}
|
|
133
133
|
function SidebarGroupLabel({ className, asChild = false, ...props }) {
|
|
134
134
|
const Comp = asChild ? Slot : "div";
|
|
135
|
-
return (jsx(Comp, { "data-slot": "sidebar-group-label", "data-sidebar": "group-label", className: cn("tw:text-sidebar-foreground/70 tw:ring-sidebar-ring tw:flex tw:h-8 tw:shrink-0 tw:items-center tw:rounded-md tw:px-2 tw:text-xs tw:font-medium tw:outline-hidden tw:transition-[margin,opacity] tw:duration-200 tw:ease-linear focus-visible:
|
|
135
|
+
return (jsx(Comp, { "data-slot": "sidebar-group-label", "data-sidebar": "group-label", className: cn("tw:text-sidebar-foreground/70 tw:ring-sidebar-ring tw:flex tw:h-8 tw:shrink-0 tw:items-center tw:rounded-md tw:px-2 tw:text-xs tw:font-medium tw:outline-hidden tw:transition-[margin,opacity] tw:duration-200 tw:ease-linear tw:focus-visible:ring-2 tw:[&>svg]:size-4 tw:[&>svg]:shrink-0", "tw:group-data-[collapsible=icon]:-mt-8 tw:group-data-[collapsible=icon]:opacity-0", className), ...props }));
|
|
136
136
|
}
|
|
137
137
|
function SidebarGroupAction({ className, asChild = false, ...props }) {
|
|
138
138
|
const Comp = asChild ? Slot : "button";
|
|
139
|
-
return (jsx(Comp, { "data-slot": "sidebar-group-action", "data-sidebar": "group-action", className: cn("tw:text-sidebar-foreground tw:ring-sidebar-ring hover:
|
|
139
|
+
return (jsx(Comp, { "data-slot": "sidebar-group-action", "data-sidebar": "group-action", className: cn("tw:text-sidebar-foreground tw:ring-sidebar-ring tw:hover:bg-sidebar-accent tw:hover:text-sidebar-accent-foreground tw:absolute tw:top-3.5 tw:right-3 tw:flex tw:aspect-square tw:w-5 tw:items-center tw:justify-center tw:rounded-md tw:p-0 tw:outline-hidden tw:transition-transform tw:focus-visible:ring-2 tw:[&>svg]:size-4 tw:[&>svg]:shrink-0",
|
|
140
140
|
// Increases the hit area of the button on mobile.
|
|
141
|
-
"after:tw:
|
|
141
|
+
"tw:after:absolute tw:after:-inset-2 tw:md:after:hidden", "tw:group-data-[collapsible=icon]:hidden", className), ...props }));
|
|
142
142
|
}
|
|
143
143
|
function SidebarGroupContent({ className, ...props }) {
|
|
144
144
|
return (jsx("div", { "data-slot": "sidebar-group-content", "data-sidebar": "group-content", className: cn("tw:w-full tw:text-sm", className), ...props }));
|
|
@@ -149,16 +149,16 @@ function SidebarMenu({ className, ...props }) {
|
|
|
149
149
|
function SidebarMenuItem({ className, ...props }) {
|
|
150
150
|
return (jsx("li", { "data-slot": "sidebar-menu-item", "data-sidebar": "menu-item", className: cn("group/menu-item tw:relative", className), ...props }));
|
|
151
151
|
}
|
|
152
|
-
const sidebarMenuButtonVariants = cva("peer/menu-button tw:flex tw:w-full tw:items-center tw:gap-2 tw:overflow-hidden tw:rounded-md tw:p-2 tw:text-left tw:text-sm tw:outline-hidden tw:ring-sidebar-ring tw:transition-[width,height,padding] hover:
|
|
152
|
+
const sidebarMenuButtonVariants = cva("peer/menu-button tw:flex tw:w-full tw:items-center tw:gap-2 tw:overflow-hidden tw:rounded-md tw:p-2 tw:text-left tw:text-sm tw:outline-hidden tw:ring-sidebar-ring tw:transition-[width,height,padding] tw:hover:bg-sidebar-accent tw:hover:text-sidebar-accent-foreground tw:focus-visible:ring-2 tw:active:bg-sidebar-accent tw:active:text-sidebar-accent-foreground tw:disabled:pointer-events-none tw:disabled:opacity-50 tw:group-has-data-[sidebar=menu-action]/menu-item:pr-8 tw:aria-disabled:pointer-events-none tw:aria-disabled:opacity-50 tw:data-[active=true]:bg-sidebar-accent tw:data-[active=true]:font-medium tw:data-[active=true]:text-sidebar-accent-foreground tw:data-[state=open]:hover:bg-sidebar-accent tw:data-[state=open]:hover:text-sidebar-accent-foreground tw:group-data-[collapsible=icon]:size-8! tw:group-data-[collapsible=icon]:p-2! tw:[&>span:last-child]:truncate tw:[&>svg]:size-4 tw:[&>svg]:shrink-0", {
|
|
153
153
|
variants: {
|
|
154
154
|
variant: {
|
|
155
|
-
default: "hover:
|
|
156
|
-
outline: "tw:bg-background tw:shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:
|
|
155
|
+
default: "tw:hover:bg-sidebar-accent tw:hover:text-sidebar-accent-foreground",
|
|
156
|
+
outline: "tw:bg-background tw:shadow-[0_0_0_1px_hsl(var(--sidebar-border))] tw:hover:bg-sidebar-accent tw:hover:text-sidebar-accent-foreground tw:hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]",
|
|
157
157
|
},
|
|
158
158
|
size: {
|
|
159
159
|
default: "tw:h-8 tw:text-sm",
|
|
160
160
|
sm: "tw:h-7 tw:text-xs",
|
|
161
|
-
lg: "tw:h-12 tw:text-sm group-data-[collapsible=icon]:
|
|
161
|
+
lg: "tw:h-12 tw:text-sm tw:group-data-[collapsible=icon]:p-0!",
|
|
162
162
|
},
|
|
163
163
|
},
|
|
164
164
|
defaultVariants: {
|
|
@@ -182,13 +182,13 @@ function SidebarMenuButton({ asChild = false, isActive = false, variant = "defau
|
|
|
182
182
|
}
|
|
183
183
|
function SidebarMenuAction({ className, asChild = false, showOnHover = false, ...props }) {
|
|
184
184
|
const Comp = asChild ? Slot : "button";
|
|
185
|
-
return (jsx(Comp, { "data-slot": "sidebar-menu-action", "data-sidebar": "menu-action", className: cn("tw:text-sidebar-foreground tw:ring-sidebar-ring hover:
|
|
185
|
+
return (jsx(Comp, { "data-slot": "sidebar-menu-action", "data-sidebar": "menu-action", className: cn("tw:text-sidebar-foreground tw:ring-sidebar-ring tw:hover:bg-sidebar-accent tw:hover:text-sidebar-accent-foreground tw:peer-hover/menu-button:text-sidebar-accent-foreground tw:absolute tw:top-1.5 tw:right-1 tw:flex tw:aspect-square tw:w-5 tw:items-center tw:justify-center tw:rounded-md tw:p-0 tw:outline-hidden tw:transition-transform tw:focus-visible:ring-2 tw:[&>svg]:size-4 tw:[&>svg]:shrink-0",
|
|
186
186
|
// Increases the hit area of the button on mobile.
|
|
187
|
-
"after:tw:
|
|
188
|
-
"peer-data-[active=true]/menu-button:
|
|
187
|
+
"tw:after:absolute tw:after:-inset-2 tw:md:after:hidden", "tw:peer-data-[size=sm]/menu-button:top-1", "tw:peer-data-[size=default]/menu-button:top-1.5", "tw:peer-data-[size=lg]/menu-button:top-2.5", "tw:group-data-[collapsible=icon]:hidden", showOnHover &&
|
|
188
|
+
"tw:peer-data-[active=true]/menu-button:text-sidebar-accent-foreground tw:group-focus-within/menu-item:opacity-100 tw:group-hover/menu-item:opacity-100 tw:data-[state=open]:opacity-100 tw:md:opacity-0", className), ...props }));
|
|
189
189
|
}
|
|
190
190
|
function SidebarMenuBadge({ className, ...props }) {
|
|
191
|
-
return (jsx("div", { "data-slot": "sidebar-menu-badge", "data-sidebar": "menu-badge", className: cn("tw:text-sidebar-foreground tw:pointer-events-none tw:absolute tw:right-1 tw:flex tw:h-5 tw:min-w-5 tw:items-center tw:justify-center tw:rounded-md tw:px-1 tw:text-xs tw:font-medium tw:tabular-nums tw:select-none", "peer-hover/menu-button:
|
|
191
|
+
return (jsx("div", { "data-slot": "sidebar-menu-badge", "data-sidebar": "menu-badge", className: cn("tw:text-sidebar-foreground tw:pointer-events-none tw:absolute tw:right-1 tw:flex tw:h-5 tw:min-w-5 tw:items-center tw:justify-center tw:rounded-md tw:px-1 tw:text-xs tw:font-medium tw:tabular-nums tw:select-none", "tw:peer-hover/menu-button:text-sidebar-accent-foreground tw:peer-data-[active=true]/menu-button:text-sidebar-accent-foreground", "tw:peer-data-[size=sm]/menu-button:top-1", "tw:peer-data-[size=default]/menu-button:top-1.5", "tw:peer-data-[size=lg]/menu-button:top-2.5", "tw:group-data-[collapsible=icon]:hidden", className), ...props }));
|
|
192
192
|
}
|
|
193
193
|
function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
|
|
194
194
|
// Random width between 50 to 90%.
|
|
@@ -200,14 +200,14 @@ function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
|
|
|
200
200
|
} })] }));
|
|
201
201
|
}
|
|
202
202
|
function SidebarMenuSub({ className, ...props }) {
|
|
203
|
-
return (jsx("ul", { "data-slot": "sidebar-menu-sub", "data-sidebar": "menu-sub", className: cn("tw:border-sidebar-border tw:mx-3.5 tw:flex tw:min-w-0 tw:translate-x-px tw:flex-col tw:gap-1 tw:border-l tw:px-2.5 tw:py-0.5", "group-data-[collapsible=icon]:
|
|
203
|
+
return (jsx("ul", { "data-slot": "sidebar-menu-sub", "data-sidebar": "menu-sub", className: cn("tw:border-sidebar-border tw:mx-3.5 tw:flex tw:min-w-0 tw:translate-x-px tw:flex-col tw:gap-1 tw:border-l tw:px-2.5 tw:py-0.5", "tw:group-data-[collapsible=icon]:hidden", className), ...props }));
|
|
204
204
|
}
|
|
205
205
|
function SidebarMenuSubItem({ className, ...props }) {
|
|
206
206
|
return (jsx("li", { "data-slot": "sidebar-menu-sub-item", "data-sidebar": "menu-sub-item", className: cn("group/menu-sub-item tw:relative", className), ...props }));
|
|
207
207
|
}
|
|
208
208
|
function SidebarMenuSubButton({ asChild = false, size = "md", isActive = false, className, ...props }) {
|
|
209
209
|
const Comp = asChild ? Slot : "a";
|
|
210
|
-
return (jsx(Comp, { "data-slot": "sidebar-menu-sub-button", "data-sidebar": "menu-sub-button", "data-size": size, "data-active": isActive, className: cn("tw:text-sidebar-foreground tw:ring-sidebar-ring hover:
|
|
210
|
+
return (jsx(Comp, { "data-slot": "sidebar-menu-sub-button", "data-sidebar": "menu-sub-button", "data-size": size, "data-active": isActive, className: cn("tw:text-sidebar-foreground tw:ring-sidebar-ring tw:hover:bg-sidebar-accent tw:hover:text-sidebar-accent-foreground tw:active:bg-sidebar-accent tw:active:text-sidebar-accent-foreground tw:[&>svg]:text-sidebar-accent-foreground tw:flex tw:h-7 tw:min-w-0 tw:-translate-x-px tw:items-center tw:gap-2 tw:overflow-hidden tw:rounded-md tw:px-2 tw:outline-hidden tw:focus-visible:ring-2 tw:disabled:pointer-events-none tw:disabled:opacity-50 tw:aria-disabled:pointer-events-none tw:aria-disabled:opacity-50 tw:[&>span:last-child]:truncate tw:[&>svg]:size-4 tw:[&>svg]:shrink-0", "tw:data-[active=true]:bg-sidebar-accent tw:data-[active=true]:text-sidebar-accent-foreground", size === "sm" && "tw:text-xs", size === "md" && "tw:text-sm", "tw:group-data-[collapsible=icon]:hidden", className), ...props }));
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar };
|
|
@@ -9,11 +9,11 @@ function Slider({ className, defaultValue, value, min = 0, max = 100, orientatio
|
|
|
9
9
|
: Array.isArray(defaultValue)
|
|
10
10
|
? defaultValue
|
|
11
11
|
: [min, max], [value, defaultValue, min, max]);
|
|
12
|
-
return (jsxs(SliderPrimitive.Root, { "data-slot": "slider", defaultValue: defaultValue, value: value, min: min, max: max, orientation: orientation, className: cn("tw:relative tw:flex tw:w-full tw:touch-none tw:select-none data-[disabled]:
|
|
12
|
+
return (jsxs(SliderPrimitive.Root, { "data-slot": "slider", defaultValue: defaultValue, value: value, min: min, max: max, orientation: orientation, className: cn("tw:relative tw:flex tw:w-full tw:touch-none tw:select-none tw:data-[disabled]:opacity-50", orientation === "horizontal"
|
|
13
13
|
? "tw:items-center"
|
|
14
14
|
: "tw:h-full tw:w-auto tw:min-h-44 tw:flex-col", className), ...props, children: [jsx(SliderPrimitive.Track, { "data-slot": "slider-track", className: cn("tw:bg-muted tw:relative tw:grow tw:overflow-hidden tw:rounded-full", orientation === "horizontal"
|
|
15
15
|
? "tw:h-1.5 tw:w-full"
|
|
16
|
-
: "tw:h-full tw:w-1.5"), children: jsx(SliderPrimitive.Range, { "data-slot": "slider-range", className: cn("tw:bg-primary tw:absolute", orientation === "horizontal" ? "tw:h-full" : "tw:w-full") }) }), Array.from({ length: _values.length }, (_, index) => (jsx(SliderPrimitive.Thumb, { "data-slot": "slider-thumb", className: "tw:border-primary tw:ring-ring/50 tw:block tw:size-4 tw:shrink-0 tw:rounded-full tw:border tw:bg-white tw:shadow-sm tw:transition-[color,box-shadow] hover:
|
|
16
|
+
: "tw:h-full tw:w-1.5"), children: jsx(SliderPrimitive.Range, { "data-slot": "slider-range", className: cn("tw:bg-primary tw:absolute", orientation === "horizontal" ? "tw:h-full" : "tw:w-full") }) }), Array.from({ length: _values.length }, (_, index) => (jsx(SliderPrimitive.Thumb, { "data-slot": "slider-thumb", className: "tw:border-primary tw:ring-ring/50 tw:block tw:size-4 tw:shrink-0 tw:rounded-full tw:border tw:bg-white tw:shadow-sm tw:transition-[color,box-shadow] tw:hover:ring-4 tw:focus-visible:ring-4 tw:focus-visible:outline-hidden tw:disabled:pointer-events-none tw:disabled:opacity-50" }, index)))] }));
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export { Slider };
|
package/dist/components/table.js
CHANGED
|
@@ -5,22 +5,22 @@ function Table({ className, ...props }) {
|
|
|
5
5
|
return (jsx("div", { "data-slot": "table-container", className: "tw:!relative tw:!w-full tw:!overflow-x-auto", children: jsx("table", { "data-slot": "table", className: cn("tw:!w-full tw:!caption-bottom tw:!text-sm", className), ...props }) }));
|
|
6
6
|
}
|
|
7
7
|
function TableHeader({ className, ...props }) {
|
|
8
|
-
return (jsx("thead", { "data-slot": "table-header", className: cn("[&_tr]
|
|
8
|
+
return (jsx("thead", { "data-slot": "table-header", className: cn("tw:[&_tr]:!border-b", className), ...props }));
|
|
9
9
|
}
|
|
10
10
|
function TableBody({ className, ...props }) {
|
|
11
|
-
return (jsx("tbody", { "data-slot": "table-body", className: cn("[&_tr:last-child]
|
|
11
|
+
return (jsx("tbody", { "data-slot": "table-body", className: cn("tw:[&_tr:last-child]:!border-0", className), ...props }));
|
|
12
12
|
}
|
|
13
13
|
function TableFooter({ className, ...props }) {
|
|
14
|
-
return (jsx("tfoot", { "data-slot": "table-footer", className: cn("tw:!bg-muted/50 tw:!border-t tw:!font-medium [&>tr]:last
|
|
14
|
+
return (jsx("tfoot", { "data-slot": "table-footer", className: cn("tw:!bg-muted/50 tw:!border-t tw:!font-medium tw:[&>tr]:last:!border-b-0", className), ...props }));
|
|
15
15
|
}
|
|
16
16
|
function TableRow({ className, ...props }) {
|
|
17
|
-
return (jsx("tr", { "data-slot": "table-row", className: cn("hover
|
|
17
|
+
return (jsx("tr", { "data-slot": "table-row", className: cn("tw:hover:!bg-muted/50 tw:data-[state=selected]:!bg-muted tw:!border-b tw:!transition-colors", className), ...props }));
|
|
18
18
|
}
|
|
19
19
|
function TableHead({ className, ...props }) {
|
|
20
|
-
return (jsx("th", { "data-slot": "table-head", className: cn("tw:!text-foreground tw:!h-10 tw:!px-2 tw:!text-left tw:!align-middle tw:!font-medium tw:!whitespace-nowrap [&:has([role=checkbox])]
|
|
20
|
+
return (jsx("th", { "data-slot": "table-head", className: cn("tw:!text-foreground tw:!h-10 tw:!px-2 tw:!text-left tw:!align-middle tw:!font-medium tw:!whitespace-nowrap tw:[&:has([role=checkbox])]:!pr-0 tw:[&>[role=checkbox]]:!translate-y-[2px]", className), ...props }));
|
|
21
21
|
}
|
|
22
22
|
function TableCell({ className, ...props }) {
|
|
23
|
-
return (jsx("td", { "data-slot": "table-cell", className: cn("tw:!p-2 tw:!align-middle tw:!whitespace-nowrap [&:has([role=checkbox])]
|
|
23
|
+
return (jsx("td", { "data-slot": "table-cell", className: cn("tw:!p-2 tw:!align-middle tw:!whitespace-nowrap tw:[&:has([role=checkbox])]:!pr-0 tw:[&>[role=checkbox]]:!translate-y-[2px]", className), ...props }));
|
|
24
24
|
}
|
|
25
25
|
function TableCaption({ className, ...props }) {
|
|
26
26
|
return (jsx("caption", { "data-slot": "table-caption", className: cn("tw:!text-muted-foreground tw:!mt-4 tw:!text-sm", className), ...props }));
|
package/dist/components/tabs.js
CHANGED
|
@@ -9,7 +9,7 @@ function TabsList({ className, ...props }) {
|
|
|
9
9
|
return (jsx(TabsPrimitive.List, { "data-slot": "tabs-list", className: cn("tw:bg-muted tw:text-muted-foreground tw:inline-flex tw:h-9 tw:w-fit tw:items-center tw:justify-center tw:rounded-lg tw:p-[3px]", className), ...props }));
|
|
10
10
|
}
|
|
11
11
|
function TabsTrigger({ className, ...props }) {
|
|
12
|
-
return (jsx(TabsPrimitive.Trigger, { "data-slot": "tabs-trigger", className: cn("tw:bg-transparent tw:text-muted-foreground tw:opacity-70 tw:data-[state=active]:bg-primary-foreground tw:dark:data-[state=active]:bg-background tw:data-[state=active]:text-foreground tw:data-[state=active]:ring-1 tw:data-[state=active]:ring-border tw:data-[state=active]:font-semibold tw:data-[state=active]:opacity-100 tw:data-[state=active]:shadow-sm tw:focus-visible:border-ring tw:focus-visible:ring-ring/50 tw:focus-visible:outline-ring tw:inline-flex tw:h-[calc(100%-1px)] tw:flex-1 tw:items-center tw:justify-center tw:gap-1.5 tw:rounded-md tw:border tw:border-transparent tw:px-2 tw:py-1 tw:text-sm tw:font-medium tw:whitespace-nowrap tw:transition-[color,box-shadow,background-color,border-color,opacity] tw:focus-visible:ring-[3px] tw:focus-visible:outline-1 tw:disabled:pointer-events-none tw:disabled:opacity-50 [&_svg]:
|
|
12
|
+
return (jsx(TabsPrimitive.Trigger, { "data-slot": "tabs-trigger", className: cn("tw:bg-transparent tw:text-muted-foreground tw:opacity-70 tw:data-[state=active]:bg-primary-foreground tw:dark:data-[state=active]:bg-background tw:data-[state=active]:text-foreground tw:data-[state=active]:ring-1 tw:data-[state=active]:ring-border tw:data-[state=active]:font-semibold tw:data-[state=active]:opacity-100 tw:data-[state=active]:shadow-sm tw:focus-visible:border-ring tw:focus-visible:ring-ring/50 tw:focus-visible:outline-ring tw:inline-flex tw:h-[calc(100%-1px)] tw:flex-1 tw:items-center tw:justify-center tw:gap-1.5 tw:rounded-md tw:border tw:border-transparent tw:px-2 tw:py-1 tw:text-sm tw:font-medium tw:whitespace-nowrap tw:transition-[color,box-shadow,background-color,border-color,opacity] tw:focus-visible:ring-[3px] tw:focus-visible:outline-1 tw:disabled:pointer-events-none tw:disabled:opacity-50 tw:[&_svg]:pointer-events-none tw:[&_svg]:shrink-0 tw:[&_svg:not([class*='size-'])]:size-4", className), ...props }));
|
|
13
13
|
}
|
|
14
14
|
function TabsContent({ className, ...props }) {
|
|
15
15
|
return (jsx(TabsPrimitive.Content, { "data-slot": "tabs-content", className: cn("tw:flex-1 tw:outline-none", className), ...props }));
|
|
@@ -9,14 +9,14 @@ const ToggleGroupContext = React.createContext({
|
|
|
9
9
|
variant: "default",
|
|
10
10
|
});
|
|
11
11
|
function ToggleGroup({ className, variant, size, children, ...props }) {
|
|
12
|
-
return (jsx(ToggleGroupPrimitive.Root, { "data-slot": "toggle-group", "data-variant": variant, "data-size": size, className: cn("group/toggle-group tw:flex tw:w-fit tw:items-center tw:rounded-md data-[variant=outline]:
|
|
12
|
+
return (jsx(ToggleGroupPrimitive.Root, { "data-slot": "toggle-group", "data-variant": variant, "data-size": size, className: cn("group/toggle-group tw:flex tw:w-fit tw:items-center tw:rounded-md tw:data-[variant=outline]:shadow-xs", className), ...props, children: jsx(ToggleGroupContext.Provider, { value: { variant, size }, children: children }) }));
|
|
13
13
|
}
|
|
14
14
|
function ToggleGroupItem({ className, children, variant, size, ...props }) {
|
|
15
15
|
const context = React.useContext(ToggleGroupContext);
|
|
16
16
|
return (jsx(ToggleGroupPrimitive.Item, { "data-slot": "toggle-group-item", "data-variant": context.variant || variant, "data-size": context.size || size, className: cn(toggleVariants({
|
|
17
17
|
variant: context.variant || variant,
|
|
18
18
|
size: context.size || size,
|
|
19
|
-
}), "tw:min-w-0 tw:flex-1 tw:shrink-0 tw:rounded-none tw:shadow-none first:
|
|
19
|
+
}), "tw:min-w-0 tw:flex-1 tw:shrink-0 tw:rounded-none tw:shadow-none tw:first:rounded-l-md tw:last:rounded-r-md tw:focus:z-10 tw:focus-visible:z-10 tw:data-[variant=outline]:border-l-0 tw:data-[variant=outline]:first:border-l", className), ...props, children: children }));
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export { ToggleGroup, ToggleGroupItem };
|
|
@@ -3,7 +3,7 @@ import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
|
3
3
|
import { cva } from 'class-variance-authority';
|
|
4
4
|
import { cn } from '../lib/utils.js';
|
|
5
5
|
|
|
6
|
-
const toggleVariants = cva("tw:inline-flex tw:items-center tw:justify-center tw:gap-2 tw:rounded-md tw:border tw:border-input tw:bg-background tw:text-sm tw:font-medium tw:text-foreground tw:shadow-xs tw:hover:bg-accent tw:hover:text-accent-foreground tw:disabled:pointer-events-none tw:disabled:opacity-50 tw:data-[state=on]:border-primary tw:data-[state=on]:bg-primary tw:data-[state=on]:text-primary-foreground tw:data-[state=on]:hover:bg-primary/90 tw:data-[state=on]:hover:text-primary-foreground [&_svg]:
|
|
6
|
+
const toggleVariants = cva("tw:inline-flex tw:items-center tw:justify-center tw:gap-2 tw:rounded-md tw:border tw:border-input tw:bg-background tw:text-sm tw:font-medium tw:text-foreground tw:shadow-xs tw:hover:bg-accent tw:hover:text-accent-foreground tw:disabled:pointer-events-none tw:disabled:opacity-50 tw:data-[state=on]:border-primary tw:data-[state=on]:bg-primary tw:data-[state=on]:text-primary-foreground tw:data-[state=on]:hover:bg-primary/90 tw:data-[state=on]:hover:text-primary-foreground tw:[&_svg]:pointer-events-none tw:[&_svg:not([class*='size-'])]:size-4 tw:[&_svg]:shrink-0 tw:focus-visible:border-ring tw:focus-visible:ring-ring/50 tw:focus-visible:ring-[3px] tw:outline-none tw:transition-[color,box-shadow,background-color,border-color] tw:aria-invalid:ring-destructive/20 tw:dark:aria-invalid:ring-destructive/40 tw:aria-invalid:border-destructive tw:whitespace-nowrap", {
|
|
7
7
|
variants: {
|
|
8
8
|
variant: {
|
|
9
9
|
default: "",
|
|
@@ -12,7 +12,7 @@ function TooltipTrigger({ ...props }) {
|
|
|
12
12
|
return jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
13
13
|
}
|
|
14
14
|
function TooltipContent({ className, sideOffset = 0, children, ...props }) {
|
|
15
|
-
return (jsx(TooltipPrimitive.Portal, { children: jsxs(TooltipPrimitive.Content, { "data-slot": "tooltip-content", sideOffset: sideOffset, className: cn("tw:bg-foreground tw:text-background tw:animate-in tw:fade-in-0 tw:zoom-in-95 data-[state=closed]:
|
|
15
|
+
return (jsx(TooltipPrimitive.Portal, { children: jsxs(TooltipPrimitive.Content, { "data-slot": "tooltip-content", sideOffset: sideOffset, className: cn("tw:bg-foreground tw:text-background tw:animate-in tw:fade-in-0 tw:zoom-in-95 tw:data-[state=closed]:animate-out tw:data-[state=closed]:fade-out-0 tw:data-[state=closed]:zoom-out-95 tw:data-[side=bottom]:slide-in-from-top-2 tw:data-[side=left]:slide-in-from-right-2 tw:data-[side=right]:slide-in-from-left-2 tw:data-[side=top]:slide-in-from-bottom-2 tw:z-50 tw:w-fit tw:origin-(--radix-tooltip-content-transform-origin) tw:rounded-md tw:px-3 tw:py-1.5 tw:text-xs tw:text-balance", className), ...props, children: [children, jsx(TooltipPrimitive.Arrow, { className: "tw:bg-foreground tw:fill-foreground tw:z-50 tw:size-2.5 tw:translate-y-[calc(-50%_-_2px)] tw:rotate-45 tw:rounded-[2px]" })] }) }));
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|