@adea-ai/ui 0.12.0 → 0.12.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/account-drawer.d.ts +1 -1
- package/dist/components/account-drawer.js +12 -12
- package/dist/components/on-screen-controls.js +12 -12
- package/dist/components/scene-settings.d.ts +3 -3
- package/dist/components/scene-settings.js +11 -11
- package/dist/components/theme-provider.d.ts +1 -1
- package/dist/components/theme-provider.js +2 -2
- package/dist/components/theme-toggle.js +8 -8
- package/dist/components/ui/badge.d.ts +3 -3
- package/dist/components/ui/badge.js +15 -15
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/button.js +19 -19
- package/dist/components/ui/card.d.ts +1 -1
- package/dist/components/ui/card.js +3 -3
- package/dist/components/ui/dialog.d.ts +4 -4
- package/dist/components/ui/dialog.js +10 -10
- package/dist/components/ui/drawer.d.ts +5 -5
- package/dist/components/ui/drawer.js +26 -26
- package/dist/components/ui/dropdown-menu.d.ts +5 -5
- package/dist/components/ui/dropdown-menu.js +12 -12
- package/dist/components/ui/empty.d.ts +7 -7
- package/dist/components/ui/empty.js +11 -11
- package/dist/components/ui/field.d.ts +12 -12
- package/dist/components/ui/field.js +22 -22
- package/dist/components/ui/input.d.ts +2 -2
- package/dist/components/ui/input.js +3 -3
- package/dist/components/ui/label.d.ts +2 -2
- package/dist/components/ui/label.js +3 -3
- package/dist/components/ui/radio-group.d.ts +2 -2
- package/dist/components/ui/radio-group.js +6 -6
- package/dist/components/ui/separator.d.ts +1 -1
- package/dist/components/ui/separator.js +5 -5
- package/dist/components/ui/skeleton.d.ts +1 -1
- package/dist/components/ui/skeleton.js +2 -2
- package/dist/components/ui/spinner.d.ts +2 -2
- package/dist/components/ui/spinner.js +3 -3
- package/dist/components/ui/switch.d.ts +2 -2
- package/dist/components/ui/switch.js +5 -5
- package/dist/components/ui/tabs.d.ts +2 -2
- package/dist/components/ui/tabs.js +13 -13
- package/dist/components/ui/toggle-group.d.ts +6 -6
- package/dist/components/ui/toggle-group.js +13 -13
- package/dist/components/ui/toggle.d.ts +2 -2
- package/dist/components/ui/toggle.js +11 -11
- package/dist/components/ui/tooltip.d.ts +3 -3
- package/dist/components/ui/tooltip.js +5 -5
- package/dist/components/version-dialog.d.ts +1 -1
- package/dist/components/version-dialog.js +33 -33
- package/dist/components/workspace-brand.js +1 -1
- package/dist/components/workspace-logo.d.ts +1 -1
- package/dist/index.d.ts +19 -19
- package/dist/index.js +19 -19
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.js +2 -2
- package/dist/lib/version-notes.js +18 -18
- package/package.json +9 -9
- package/src/components/account-drawer.tsx +27 -27
- package/src/components/on-screen-controls.tsx +45 -45
- package/src/components/scene-settings.tsx +55 -55
- package/src/components/theme-provider.tsx +7 -7
- package/src/components/theme-toggle.tsx +20 -20
- package/src/components/ui/badge.tsx +20 -20
- package/src/components/ui/button.tsx +24 -24
- package/src/components/ui/card.tsx +6 -6
- package/src/components/ui/dialog.tsx +24 -24
- package/src/components/ui/drawer.tsx +55 -55
- package/src/components/ui/dropdown-menu.tsx +39 -39
- package/src/components/ui/empty.tsx +25 -25
- package/src/components/ui/field.tsx +55 -55
- package/src/components/ui/input.tsx +7 -7
- package/src/components/ui/label.tsx +7 -7
- package/src/components/ui/radio-group.tsx +9 -9
- package/src/components/ui/separator.tsx +7 -7
- package/src/components/ui/skeleton.tsx +5 -5
- package/src/components/ui/spinner.tsx +6 -6
- package/src/components/ui/switch.tsx +8 -8
- package/src/components/ui/tabs.tsx +21 -21
- package/src/components/ui/toggle-group.tsx +25 -25
- package/src/components/ui/toggle.tsx +15 -15
- package/src/components/ui/tooltip.tsx +13 -13
- package/src/components/version-dialog.tsx +113 -113
- package/src/components/workspace-brand.tsx +4 -4
- package/src/components/workspace-logo.tsx +2 -2
- package/src/index.tsx +19 -19
- package/src/lib/utils.ts +3 -3
- package/src/lib/version-notes.ts +23 -23
- package/src/styles/conventional-workspace.css +26 -26
- package/src/styles/globals.css +2 -2
- package/src/styles/theme.css +1 -1
- package/src/styles/workspace-shell.css +2 -2
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { Menu as MenuPrimitive } from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Menu as MenuPrimitive } from '@base-ui/react/menu';
|
|
3
3
|
declare function DropdownMenu({ ...props }: MenuPrimitive.Root.Props): React.JSX.Element;
|
|
4
4
|
declare function DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props): React.JSX.Element;
|
|
5
5
|
declare function DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props): React.JSX.Element;
|
|
6
|
-
declare function DropdownMenuContent({ align, alignOffset, side, sideOffset, className, ...props }: MenuPrimitive.Popup.Props & Pick<MenuPrimitive.Positioner.Props,
|
|
6
|
+
declare function DropdownMenuContent({ align, alignOffset, side, sideOffset, className, ...props }: MenuPrimitive.Popup.Props & Pick<MenuPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'>): React.JSX.Element;
|
|
7
7
|
declare function DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props): React.JSX.Element;
|
|
8
8
|
declare function DropdownMenuLabel({ className, inset, ...props }: MenuPrimitive.GroupLabel.Props & {
|
|
9
9
|
inset?: boolean;
|
|
10
10
|
}): React.JSX.Element;
|
|
11
11
|
declare function DropdownMenuItem({ className, inset, variant, ...props }: MenuPrimitive.Item.Props & {
|
|
12
12
|
inset?: boolean;
|
|
13
|
-
variant?:
|
|
13
|
+
variant?: 'default' | 'destructive';
|
|
14
14
|
}): React.JSX.Element;
|
|
15
15
|
declare function DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props): React.JSX.Element;
|
|
16
16
|
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: MenuPrimitive.SubmenuTrigger.Props & {
|
|
@@ -25,5 +25,5 @@ declare function DropdownMenuRadioItem({ className, children, inset, ...props }:
|
|
|
25
25
|
inset?: boolean;
|
|
26
26
|
}): React.JSX.Element;
|
|
27
27
|
declare function DropdownMenuSeparator({ className, ...props }: MenuPrimitive.Separator.Props): React.JSX.Element;
|
|
28
|
-
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<
|
|
28
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
|
|
29
29
|
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Menu as MenuPrimitive } from
|
|
4
|
-
import { cn } from
|
|
5
|
-
import { ChevronRightIcon, CheckIcon } from
|
|
3
|
+
import { Menu as MenuPrimitive } from '@base-ui/react/menu';
|
|
4
|
+
import { cn } from '#lib/utils';
|
|
5
|
+
import { ChevronRightIcon, CheckIcon } from 'lucide-react';
|
|
6
6
|
function DropdownMenu({ ...props }) {
|
|
7
7
|
return _jsx(MenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
8
8
|
}
|
|
@@ -12,16 +12,16 @@ function DropdownMenuPortal({ ...props }) {
|
|
|
12
12
|
function DropdownMenuTrigger({ ...props }) {
|
|
13
13
|
return _jsx(MenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
|
|
14
14
|
}
|
|
15
|
-
function DropdownMenuContent({ align =
|
|
16
|
-
return (_jsx(MenuPrimitive.Portal, { children: _jsx(MenuPrimitive.Positioner, { className: "isolate z-[140] outline-none", align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, children: _jsx(MenuPrimitive.Popup, { "data-slot": "dropdown-menu-content", className: cn(
|
|
15
|
+
function DropdownMenuContent({ align = 'start', alignOffset = 0, side = 'bottom', sideOffset = 4, className, ...props }) {
|
|
16
|
+
return (_jsx(MenuPrimitive.Portal, { children: _jsx(MenuPrimitive.Positioner, { className: "isolate z-[140] outline-none", align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, children: _jsx(MenuPrimitive.Popup, { "data-slot": "dropdown-menu-content", className: cn('z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95', className), ...props }) }) }));
|
|
17
17
|
}
|
|
18
18
|
function DropdownMenuGroup({ ...props }) {
|
|
19
19
|
return _jsx(MenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
20
20
|
}
|
|
21
21
|
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
22
|
-
return (_jsx(MenuPrimitive.GroupLabel, { "data-slot": "dropdown-menu-label", "data-inset": inset, className: cn(
|
|
22
|
+
return (_jsx(MenuPrimitive.GroupLabel, { "data-slot": "dropdown-menu-label", "data-inset": inset, className: cn('px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7', className), ...props }));
|
|
23
23
|
}
|
|
24
|
-
function DropdownMenuItem({ className, inset, variant =
|
|
24
|
+
function DropdownMenuItem({ className, inset, variant = 'default', ...props }) {
|
|
25
25
|
return (_jsx(MenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn("group/dropdown-menu-item relative flex cursor-pointer items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive", className), ...props }));
|
|
26
26
|
}
|
|
27
27
|
function DropdownMenuSub({ ...props }) {
|
|
@@ -30,8 +30,8 @@ function DropdownMenuSub({ ...props }) {
|
|
|
30
30
|
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
31
31
|
return (_jsxs(MenuPrimitive.SubmenuTrigger, { "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset, className: cn("flex cursor-pointer items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto" })] }));
|
|
32
32
|
}
|
|
33
|
-
function DropdownMenuSubContent({ align =
|
|
34
|
-
return (_jsx(DropdownMenuContent, { "data-slot": "dropdown-menu-sub-content", className: cn(
|
|
33
|
+
function DropdownMenuSubContent({ align = 'start', alignOffset = -3, side = 'right', sideOffset = 0, className, ...props }) {
|
|
34
|
+
return (_jsx(DropdownMenuContent, { "data-slot": "dropdown-menu-sub-content", className: cn('w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95', className), align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, ...props }));
|
|
35
35
|
}
|
|
36
36
|
function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }) {
|
|
37
37
|
return (_jsxs(MenuPrimitive.CheckboxItem, { "data-slot": "dropdown-menu-checkbox-item", "data-inset": inset, className: cn("relative flex cursor-pointer items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), checked: checked, ...props, children: [_jsx("span", { className: "pointer-events-none absolute right-2 flex items-center justify-center", "data-slot": "dropdown-menu-checkbox-item-indicator", children: _jsx(MenuPrimitive.CheckboxItemIndicator, { children: _jsx(CheckIcon, {}) }) }), children] }));
|
|
@@ -43,9 +43,9 @@ function DropdownMenuRadioItem({ className, children, inset, ...props }) {
|
|
|
43
43
|
return (_jsxs(MenuPrimitive.RadioItem, { "data-slot": "dropdown-menu-radio-item", "data-inset": inset, className: cn("relative flex cursor-pointer items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [_jsx("span", { className: "pointer-events-none absolute right-2 flex items-center justify-center", "data-slot": "dropdown-menu-radio-item-indicator", children: _jsx(MenuPrimitive.RadioItemIndicator, { children: _jsx(CheckIcon, {}) }) }), children] }));
|
|
44
44
|
}
|
|
45
45
|
function DropdownMenuSeparator({ className, ...props }) {
|
|
46
|
-
return (_jsx(MenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", className: cn(
|
|
46
|
+
return (_jsx(MenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", className: cn('-mx-1 my-1 h-px bg-border', className), ...props }));
|
|
47
47
|
}
|
|
48
48
|
function DropdownMenuShortcut({ className, ...props }) {
|
|
49
|
-
return (_jsx("span", { "data-slot": "dropdown-menu-shortcut", className: cn(
|
|
49
|
+
return (_jsx("span", { "data-slot": "dropdown-menu-shortcut", className: cn('ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground', className), ...props }));
|
|
50
50
|
}
|
|
51
51
|
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type VariantProps } from
|
|
2
|
-
declare function Empty({ className, ...props }: React.ComponentProps<
|
|
3
|
-
declare function EmptyHeader({ className, ...props }: React.ComponentProps<
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
declare function Empty({ className, ...props }: React.ComponentProps<'div'>): import("react").JSX.Element;
|
|
3
|
+
declare function EmptyHeader({ className, ...props }: React.ComponentProps<'div'>): import("react").JSX.Element;
|
|
4
4
|
declare const emptyMediaVariants: (props?: ({
|
|
5
5
|
variant?: "default" | "icon" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
-
declare function EmptyMedia({ className, variant, ...props }: React.ComponentProps<
|
|
8
|
-
declare function EmptyTitle({ className, ...props }: React.ComponentProps<
|
|
9
|
-
declare function EmptyDescription({ className, ...props }: React.ComponentProps<
|
|
10
|
-
declare function EmptyContent({ className, ...props }: React.ComponentProps<
|
|
7
|
+
declare function EmptyMedia({ className, variant, ...props }: React.ComponentProps<'div'> & VariantProps<typeof emptyMediaVariants>): import("react").JSX.Element;
|
|
8
|
+
declare function EmptyTitle({ className, ...props }: React.ComponentProps<'div'>): import("react").JSX.Element;
|
|
9
|
+
declare function EmptyDescription({ className, ...props }: React.ComponentProps<'p'>): import("react").JSX.Element;
|
|
10
|
+
declare function EmptyContent({ className, ...props }: React.ComponentProps<'div'>): import("react").JSX.Element;
|
|
11
11
|
export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia };
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cva } from
|
|
3
|
-
import { cn } from
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
import { cn } from '#lib/utils';
|
|
4
4
|
function Empty({ className, ...props }) {
|
|
5
|
-
return (_jsx("div", { "data-slot": "empty", className: cn(
|
|
5
|
+
return (_jsx("div", { "data-slot": "empty", className: cn('flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance', className), ...props }));
|
|
6
6
|
}
|
|
7
7
|
function EmptyHeader({ className, ...props }) {
|
|
8
|
-
return (_jsx("div", { "data-slot": "empty-header", className: cn(
|
|
8
|
+
return (_jsx("div", { "data-slot": "empty-header", className: cn('flex max-w-sm flex-col items-center gap-2', className), ...props }));
|
|
9
9
|
}
|
|
10
|
-
const emptyMediaVariants = cva(
|
|
10
|
+
const emptyMediaVariants = cva('mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0', {
|
|
11
11
|
variants: {
|
|
12
12
|
variant: {
|
|
13
|
-
default:
|
|
13
|
+
default: 'bg-transparent',
|
|
14
14
|
icon: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4",
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
defaultVariants: {
|
|
18
|
-
variant:
|
|
18
|
+
variant: 'default',
|
|
19
19
|
},
|
|
20
20
|
});
|
|
21
|
-
function EmptyMedia({ className, variant =
|
|
21
|
+
function EmptyMedia({ className, variant = 'default', ...props }) {
|
|
22
22
|
return (_jsx("div", { "data-slot": "empty-icon", "data-variant": variant, className: cn(emptyMediaVariants({ variant, className })), ...props }));
|
|
23
23
|
}
|
|
24
24
|
function EmptyTitle({ className, ...props }) {
|
|
25
|
-
return (_jsx("div", { "data-slot": "empty-title", className: cn(
|
|
25
|
+
return (_jsx("div", { "data-slot": "empty-title", className: cn('text-sm font-medium tracking-tight', className), ...props }));
|
|
26
26
|
}
|
|
27
27
|
function EmptyDescription({ className, ...props }) {
|
|
28
|
-
return (_jsx("div", { "data-slot": "empty-description", className: cn(
|
|
28
|
+
return (_jsx("div", { "data-slot": "empty-description", className: cn('text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary', className), ...props }));
|
|
29
29
|
}
|
|
30
30
|
function EmptyContent({ className, ...props }) {
|
|
31
|
-
return (_jsx("div", { "data-slot": "empty-content", className: cn(
|
|
31
|
+
return (_jsx("div", { "data-slot": "empty-content", className: cn('flex w-full max-w-sm min-w-0 flex-col items-center gap-2.5 text-sm text-balance', className), ...props }));
|
|
32
32
|
}
|
|
33
33
|
export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia };
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { type VariantProps } from
|
|
2
|
-
import { Label } from
|
|
3
|
-
declare function FieldSet({ className, ...props }: React.ComponentProps<
|
|
4
|
-
declare function FieldLegend({ className, variant, ...props }: React.ComponentProps<
|
|
5
|
-
variant?:
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { Label } from '#components/ui/label';
|
|
3
|
+
declare function FieldSet({ className, ...props }: React.ComponentProps<'fieldset'>): import("react").JSX.Element;
|
|
4
|
+
declare function FieldLegend({ className, variant, ...props }: React.ComponentProps<'legend'> & {
|
|
5
|
+
variant?: 'legend' | 'label';
|
|
6
6
|
}): import("react").JSX.Element;
|
|
7
|
-
declare function FieldGroup({ className, ...props }: React.ComponentProps<
|
|
7
|
+
declare function FieldGroup({ className, ...props }: React.ComponentProps<'div'>): import("react").JSX.Element;
|
|
8
8
|
declare const fieldVariants: (props?: ({
|
|
9
9
|
orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
|
|
10
10
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
|
-
declare function Field({ className, orientation, ...props }: React.ComponentProps<
|
|
12
|
-
declare function FieldContent({ className, ...props }: React.ComponentProps<
|
|
11
|
+
declare function Field({ className, orientation, ...props }: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>): import("react").JSX.Element;
|
|
12
|
+
declare function FieldContent({ className, ...props }: React.ComponentProps<'div'>): import("react").JSX.Element;
|
|
13
13
|
declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>): import("react").JSX.Element;
|
|
14
|
-
declare function FieldTitle({ className, ...props }: React.ComponentProps<
|
|
15
|
-
declare function FieldDescription({ className, ...props }: React.ComponentProps<
|
|
16
|
-
declare function FieldSeparator({ children, className, ...props }: React.ComponentProps<
|
|
14
|
+
declare function FieldTitle({ className, ...props }: React.ComponentProps<'div'>): import("react").JSX.Element;
|
|
15
|
+
declare function FieldDescription({ className, ...props }: React.ComponentProps<'p'>): import("react").JSX.Element;
|
|
16
|
+
declare function FieldSeparator({ children, className, ...props }: React.ComponentProps<'div'> & {
|
|
17
17
|
children?: React.ReactNode;
|
|
18
18
|
}): import("react").JSX.Element;
|
|
19
|
-
declare function FieldError({ className, children, errors, ...props }: React.ComponentProps<
|
|
19
|
+
declare function FieldError({ className, children, errors, ...props }: React.ComponentProps<'div'> & {
|
|
20
20
|
errors?: Array<{
|
|
21
21
|
message?: string;
|
|
22
22
|
} | undefined>;
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useMemo } from
|
|
4
|
-
import { cva } from
|
|
5
|
-
import { cn } from
|
|
6
|
-
import { Label } from
|
|
7
|
-
import { Separator } from
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { cn } from '#lib/utils';
|
|
6
|
+
import { Label } from '#components/ui/label';
|
|
7
|
+
import { Separator } from '#components/ui/separator';
|
|
8
8
|
function FieldSet({ className, ...props }) {
|
|
9
|
-
return (_jsx("fieldset", { "data-slot": "field-set", className: cn(
|
|
9
|
+
return (_jsx("fieldset", { "data-slot": "field-set", className: cn('flex flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3', className), ...props }));
|
|
10
10
|
}
|
|
11
|
-
function FieldLegend({ className, variant =
|
|
12
|
-
return (_jsx("legend", { "data-slot": "field-legend", "data-variant": variant, className: cn(
|
|
11
|
+
function FieldLegend({ className, variant = 'legend', ...props }) {
|
|
12
|
+
return (_jsx("legend", { "data-slot": "field-legend", "data-variant": variant, className: cn('mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base', className), ...props }));
|
|
13
13
|
}
|
|
14
14
|
function FieldGroup({ className, ...props }) {
|
|
15
|
-
return (_jsx("div", { "data-slot": "field-group", className: cn(
|
|
15
|
+
return (_jsx("div", { "data-slot": "field-group", className: cn('group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4', className), ...props }));
|
|
16
16
|
}
|
|
17
|
-
const fieldVariants = cva(
|
|
17
|
+
const fieldVariants = cva('group/field flex w-full gap-2 data-[invalid=true]:text-destructive', {
|
|
18
18
|
variants: {
|
|
19
19
|
orientation: {
|
|
20
|
-
vertical:
|
|
21
|
-
horizontal:
|
|
22
|
-
responsive:
|
|
20
|
+
vertical: 'flex-col *:w-full [&>.sr-only]:w-auto',
|
|
21
|
+
horizontal: 'flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',
|
|
22
|
+
responsive: 'flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',
|
|
23
23
|
},
|
|
24
24
|
},
|
|
25
25
|
defaultVariants: {
|
|
26
|
-
orientation:
|
|
26
|
+
orientation: 'vertical',
|
|
27
27
|
},
|
|
28
28
|
});
|
|
29
|
-
function Field({ className, orientation =
|
|
29
|
+
function Field({ className, orientation = 'vertical', ...props }) {
|
|
30
30
|
return (_jsx("div", { role: "group", "data-slot": "field", "data-orientation": orientation, className: cn(fieldVariants({ orientation }), className), ...props }));
|
|
31
31
|
}
|
|
32
32
|
function FieldContent({ className, ...props }) {
|
|
33
|
-
return (_jsx("div", { "data-slot": "field-content", className: cn(
|
|
33
|
+
return (_jsx("div", { "data-slot": "field-content", className: cn('group/field-content flex flex-1 flex-col gap-0.5 leading-snug', className), ...props }));
|
|
34
34
|
}
|
|
35
35
|
function FieldLabel({ className, ...props }) {
|
|
36
|
-
return (_jsx(Label, { "data-slot": "field-label", className: cn(
|
|
36
|
+
return (_jsx(Label, { "data-slot": "field-label", className: cn('group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10', 'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col', className), ...props }));
|
|
37
37
|
}
|
|
38
38
|
function FieldTitle({ className, ...props }) {
|
|
39
|
-
return (_jsx("div", { "data-slot": "field-label", className: cn(
|
|
39
|
+
return (_jsx("div", { "data-slot": "field-label", className: cn('flex w-fit items-center gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50', className), ...props }));
|
|
40
40
|
}
|
|
41
41
|
function FieldDescription({ className, ...props }) {
|
|
42
|
-
return (_jsx("p", { "data-slot": "field-description", className: cn(
|
|
42
|
+
return (_jsx("p", { "data-slot": "field-description", className: cn('text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5', 'last:mt-0 nth-last-2:-mt-1', '[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary', className), ...props }));
|
|
43
43
|
}
|
|
44
44
|
function FieldSeparator({ children, className, ...props }) {
|
|
45
|
-
return (_jsxs("div", { "data-slot": "field-separator", "data-content": !!children, className: cn(
|
|
45
|
+
return (_jsxs("div", { "data-slot": "field-separator", "data-content": !!children, className: cn('relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2', className), ...props, children: [_jsx(Separator, { className: "absolute inset-0 top-1/2" }), children && (_jsx("span", { className: "relative mx-auto block w-fit bg-background px-2 text-muted-foreground", "data-slot": "field-separator-content", children: children }))] }));
|
|
46
46
|
}
|
|
47
47
|
function FieldError({ className, children, errors, ...props }) {
|
|
48
48
|
const content = useMemo(() => {
|
|
@@ -61,6 +61,6 @@ function FieldError({ className, children, errors, ...props }) {
|
|
|
61
61
|
if (!content) {
|
|
62
62
|
return null;
|
|
63
63
|
}
|
|
64
|
-
return (_jsx("div", { role: "alert", "data-slot": "field-error", className: cn(
|
|
64
|
+
return (_jsx("div", { role: "alert", "data-slot": "field-error", className: cn('text-sm font-normal text-destructive', className), ...props, children: content }));
|
|
65
65
|
}
|
|
66
66
|
export { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle, };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
declare function Input({ className, type, ...props }: React.ComponentProps<
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare function Input({ className, type, ...props }: React.ComponentProps<'input'>): React.JSX.Element;
|
|
3
3
|
export { Input };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Input as InputPrimitive } from
|
|
3
|
-
import { cn } from
|
|
2
|
+
import { Input as InputPrimitive } from '@base-ui/react/input';
|
|
3
|
+
import { cn } from '#lib/utils';
|
|
4
4
|
function Input({ className, type, ...props }) {
|
|
5
|
-
return (_jsx(InputPrimitive, { type: type, "data-slot": "input", className: cn(
|
|
5
|
+
return (_jsx(InputPrimitive, { type: type, "data-slot": "input", className: cn('h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40', className), ...props }));
|
|
6
6
|
}
|
|
7
7
|
export { Input };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
declare function Label({ className, ...props }: React.ComponentProps<
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare function Label({ className, ...props }: React.ComponentProps<'label'>): React.JSX.Element;
|
|
3
3
|
export { Label };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from
|
|
3
|
+
import { cn } from '#lib/utils';
|
|
4
4
|
function Label({ className, ...props }) {
|
|
5
|
-
return (_jsx("label", { "data-slot": "label", className: cn(
|
|
5
|
+
return (_jsx("label", { "data-slot": "label", className: cn('flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50', className), ...props }));
|
|
6
6
|
}
|
|
7
7
|
export { Label };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Radio as RadioPrimitive } from
|
|
2
|
-
import { RadioGroup as RadioGroupPrimitive } from
|
|
1
|
+
import { Radio as RadioPrimitive } from '@base-ui/react/radio';
|
|
2
|
+
import { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group';
|
|
3
3
|
declare function RadioGroup({ className, ...props }: RadioGroupPrimitive.Props): import("react").JSX.Element;
|
|
4
4
|
declare function RadioGroupItem({ className, ...props }: RadioPrimitive.Root.Props): import("react").JSX.Element;
|
|
5
5
|
export { RadioGroup, RadioGroupItem };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Radio as RadioPrimitive } from
|
|
4
|
-
import { RadioGroup as RadioGroupPrimitive } from
|
|
5
|
-
import { cn } from
|
|
3
|
+
import { Radio as RadioPrimitive } from '@base-ui/react/radio';
|
|
4
|
+
import { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group';
|
|
5
|
+
import { cn } from '#lib/utils';
|
|
6
6
|
function RadioGroup({ className, ...props }) {
|
|
7
|
-
return (_jsx(RadioGroupPrimitive, { "data-slot": "radio-group", className: cn(
|
|
7
|
+
return (_jsx(RadioGroupPrimitive, { "data-slot": "radio-group", className: cn('grid w-full gap-2', className), ...props }));
|
|
8
8
|
}
|
|
9
9
|
function RadioGroupItem({ className, ...props }) {
|
|
10
|
-
return (_jsx(RadioPrimitive.Root, { "data-slot": "radio-group-item", className: cn(
|
|
10
|
+
return (_jsx(RadioPrimitive.Root, { "data-slot": "radio-group-item", className: cn('group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary', className), ...props, children: _jsx(RadioPrimitive.Indicator, { "data-slot": "radio-group-indicator", className: "flex size-4 items-center justify-center", children: _jsx("span", { className: "absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground" }) }) }));
|
|
11
11
|
}
|
|
12
12
|
export { RadioGroup, RadioGroupItem };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Separator as SeparatorPrimitive } from
|
|
1
|
+
import { Separator as SeparatorPrimitive } from '@base-ui/react/separator';
|
|
2
2
|
declare function Separator({ className, orientation, ...props }: SeparatorPrimitive.Props): import("react").JSX.Element;
|
|
3
3
|
export { Separator };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Separator as SeparatorPrimitive } from
|
|
4
|
-
import { cn } from
|
|
5
|
-
function Separator({ className, orientation =
|
|
6
|
-
return (_jsx(SeparatorPrimitive, { "data-slot": "separator", orientation: orientation, className: cn(
|
|
3
|
+
import { Separator as SeparatorPrimitive } from '@base-ui/react/separator';
|
|
4
|
+
import { cn } from '#lib/utils';
|
|
5
|
+
function Separator({ className, orientation = 'horizontal', ...props }) {
|
|
6
|
+
return (_jsx(SeparatorPrimitive, { "data-slot": "separator", orientation: orientation, className: cn('shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch', className), ...props }));
|
|
7
7
|
}
|
|
8
8
|
export { Separator };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function Skeleton({ className, ...props }: React.ComponentProps<
|
|
1
|
+
declare function Skeleton({ className, ...props }: React.ComponentProps<'div'>): import("react").JSX.Element;
|
|
2
2
|
export { Skeleton };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from
|
|
2
|
+
import { cn } from '#lib/utils';
|
|
3
3
|
function Skeleton({ className, ...props }) {
|
|
4
|
-
return (_jsx("div", { "data-slot": "skeleton", className: cn(
|
|
4
|
+
return (_jsx("div", { "data-slot": "skeleton", className: cn('animate-pulse rounded-md bg-muted', className), ...props }));
|
|
5
5
|
}
|
|
6
6
|
export { Skeleton };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LoaderCircle } from
|
|
2
|
-
import type { ComponentProps } from
|
|
1
|
+
import { LoaderCircle } from 'lucide-react';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
3
|
declare function Spinner({ className, ...props }: ComponentProps<typeof LoaderCircle>): import("react").JSX.Element;
|
|
4
4
|
export { Spinner };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { LoaderCircle } from
|
|
3
|
-
import { cn } from
|
|
2
|
+
import { LoaderCircle } from 'lucide-react';
|
|
3
|
+
import { cn } from '#lib/utils';
|
|
4
4
|
function Spinner({ className, ...props }) {
|
|
5
|
-
return (_jsx(LoaderCircle, { role: "status", "aria-label": "Loading", className: cn(
|
|
5
|
+
return (_jsx(LoaderCircle, { role: "status", "aria-label": "Loading", className: cn('animate-spin', className), ...props }));
|
|
6
6
|
}
|
|
7
7
|
export { Spinner };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Switch as SwitchPrimitive } from
|
|
1
|
+
import { Switch as SwitchPrimitive } from '@base-ui/react/switch';
|
|
2
2
|
declare function Switch({ className, size, ...props }: SwitchPrimitive.Root.Props & {
|
|
3
|
-
size?:
|
|
3
|
+
size?: 'sm' | 'default';
|
|
4
4
|
}): import("react").JSX.Element;
|
|
5
5
|
export { Switch };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Switch as SwitchPrimitive } from
|
|
4
|
-
import { cn } from
|
|
5
|
-
function Switch({ className, size =
|
|
6
|
-
return (_jsx(SwitchPrimitive.Root, { "data-slot": "switch", "data-size": size, className: cn(
|
|
3
|
+
import { Switch as SwitchPrimitive } from '@base-ui/react/switch';
|
|
4
|
+
import { cn } from '#lib/utils';
|
|
5
|
+
function Switch({ className, size = 'default', ...props }) {
|
|
6
|
+
return (_jsx(SwitchPrimitive.Root, { "data-slot": "switch", "data-size": size, className: cn('peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50', className), ...props, children: _jsx(SwitchPrimitive.Thumb, { "data-slot": "switch-thumb", className: "pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground" }) }));
|
|
7
7
|
}
|
|
8
8
|
export { Switch };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Tabs as TabsPrimitive } from
|
|
2
|
-
import { type VariantProps } from
|
|
1
|
+
import { Tabs as TabsPrimitive } from '@base-ui/react/tabs';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare function Tabs({ className, orientation, ...props }: TabsPrimitive.Root.Props): import("react").JSX.Element;
|
|
4
4
|
declare const tabsListVariants: (props?: ({
|
|
5
5
|
variant?: "default" | "line" | null | undefined;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Tabs as TabsPrimitive } from
|
|
4
|
-
import { cva } from
|
|
5
|
-
import { cn } from
|
|
6
|
-
function Tabs({ className, orientation =
|
|
7
|
-
return (_jsx(TabsPrimitive.Root, { "data-slot": "tabs", "data-orientation": orientation, className: cn(
|
|
3
|
+
import { Tabs as TabsPrimitive } from '@base-ui/react/tabs';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { cn } from '#lib/utils';
|
|
6
|
+
function Tabs({ className, orientation = 'horizontal', ...props }) {
|
|
7
|
+
return (_jsx(TabsPrimitive.Root, { "data-slot": "tabs", "data-orientation": orientation, className: cn('group/tabs flex gap-2 data-horizontal:flex-col', className), ...props }));
|
|
8
8
|
}
|
|
9
|
-
const tabsListVariants = cva(
|
|
9
|
+
const tabsListVariants = cva('group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none', {
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
|
-
default:
|
|
13
|
-
line:
|
|
12
|
+
default: 'bg-muted',
|
|
13
|
+
line: 'gap-1 bg-transparent',
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
defaultVariants: {
|
|
17
|
-
variant:
|
|
17
|
+
variant: 'default',
|
|
18
18
|
},
|
|
19
19
|
});
|
|
20
|
-
function TabsList({ className, variant =
|
|
20
|
+
function TabsList({ className, variant = 'default', ...props }) {
|
|
21
21
|
return (_jsx(TabsPrimitive.List, { "data-slot": "tabs-list", "data-variant": variant, className: cn(tabsListVariants({ variant }), className), ...props }));
|
|
22
22
|
}
|
|
23
23
|
function TabsTrigger({ className, ...props }) {
|
|
24
|
-
return (_jsx(TabsPrimitive.Tab, { "data-slot": "tabs-trigger", className: cn("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
24
|
+
return (_jsx(TabsPrimitive.Tab, { "data-slot": "tabs-trigger", className: cn("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", 'group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent', 'data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground', 'after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100', className), ...props }));
|
|
25
25
|
}
|
|
26
26
|
function TabsContent({ className, ...props }) {
|
|
27
|
-
return (_jsx(TabsPrimitive.Panel, { "data-slot": "tabs-content", className: cn(
|
|
27
|
+
return (_jsx(TabsPrimitive.Panel, { "data-slot": "tabs-content", className: cn('flex-1 text-sm outline-none', className), ...props }));
|
|
28
28
|
}
|
|
29
29
|
export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { Toggle as TogglePrimitive } from
|
|
3
|
-
import { ToggleGroup as ToggleGroupPrimitive } from
|
|
4
|
-
import { type VariantProps } from
|
|
5
|
-
import { toggleVariants } from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Toggle as TogglePrimitive } from '@base-ui/react/toggle';
|
|
3
|
+
import { ToggleGroup as ToggleGroupPrimitive } from '@base-ui/react/toggle-group';
|
|
4
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
5
|
+
import { toggleVariants } from '#components/ui/toggle';
|
|
6
6
|
declare function ToggleGroup({ className, variant, size, spacing, orientation, children, ...props }: ToggleGroupPrimitive.Props & VariantProps<typeof toggleVariants> & {
|
|
7
7
|
spacing?: number;
|
|
8
|
-
orientation?:
|
|
8
|
+
orientation?: 'horizontal' | 'vertical';
|
|
9
9
|
}): React.JSX.Element;
|
|
10
10
|
declare function ToggleGroupItem({ className, children, variant, size, ...props }: TogglePrimitive.Props & VariantProps<typeof toggleVariants>): React.JSX.Element;
|
|
11
11
|
export { ToggleGroup, ToggleGroupItem };
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as React from
|
|
4
|
-
import { Toggle as TogglePrimitive } from
|
|
5
|
-
import { ToggleGroup as ToggleGroupPrimitive } from
|
|
6
|
-
import { cn } from
|
|
7
|
-
import { toggleVariants } from
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Toggle as TogglePrimitive } from '@base-ui/react/toggle';
|
|
5
|
+
import { ToggleGroup as ToggleGroupPrimitive } from '@base-ui/react/toggle-group';
|
|
6
|
+
import { cn } from '#lib/utils';
|
|
7
|
+
import { toggleVariants } from '#components/ui/toggle';
|
|
8
8
|
const ToggleGroupContext = React.createContext({
|
|
9
|
-
size:
|
|
10
|
-
variant:
|
|
9
|
+
size: 'default',
|
|
10
|
+
variant: 'default',
|
|
11
11
|
spacing: 2,
|
|
12
|
-
orientation:
|
|
12
|
+
orientation: 'horizontal',
|
|
13
13
|
});
|
|
14
|
-
function ToggleGroup({ className, variant, size, spacing = 2, orientation =
|
|
15
|
-
return (_jsx(ToggleGroupPrimitive, { "data-slot": "toggle-group", "data-variant": variant, "data-size": size, "data-spacing": spacing, "data-orientation": orientation, style: {
|
|
14
|
+
function ToggleGroup({ className, variant, size, spacing = 2, orientation = 'horizontal', children, ...props }) {
|
|
15
|
+
return (_jsx(ToggleGroupPrimitive, { "data-slot": "toggle-group", "data-variant": variant, "data-size": size, "data-spacing": spacing, "data-orientation": orientation, style: { '--gap': spacing }, className: cn('group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch', className), ...props, children: _jsx(ToggleGroupContext.Provider, { value: { variant, size, spacing, orientation }, children: children }) }));
|
|
16
16
|
}
|
|
17
|
-
function ToggleGroupItem({ className, children, variant =
|
|
17
|
+
function ToggleGroupItem({ className, children, variant = 'default', size = 'default', ...props }) {
|
|
18
18
|
const context = React.useContext(ToggleGroupContext);
|
|
19
|
-
return (_jsx(TogglePrimitive, { "data-slot": "toggle-group-item", "data-variant": context.variant || variant, "data-size": context.size || size, "data-spacing": context.spacing, className: cn(
|
|
19
|
+
return (_jsx(TogglePrimitive, { "data-slot": "toggle-group-item", "data-variant": context.variant || variant, "data-size": context.size || size, "data-spacing": context.spacing, className: cn('shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t', toggleVariants({
|
|
20
20
|
variant: context.variant || variant,
|
|
21
21
|
size: context.size || size,
|
|
22
22
|
}), className), ...props, children: children }));
|