@nadicodeai/ui 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +2 -1
- package/README.md +4 -2
- package/dist/components/accordion.d.ts +5 -6
- package/dist/components/accordion.d.ts.map +1 -1
- package/dist/components/accordion.js +7 -8
- package/dist/components/agent-message.js +1 -1
- package/dist/components/agent-tool-approval.d.ts.map +1 -1
- package/dist/components/agent-tool-approval.js +9 -6
- package/dist/components/ai-elements/artifact.js +1 -1
- package/dist/components/ai-elements/attachments.d.ts +1 -1
- package/dist/components/ai-elements/attachments.d.ts.map +1 -1
- package/dist/components/ai-elements/attachments.js +2 -2
- package/dist/components/ai-elements/audio-player.d.ts.map +1 -1
- package/dist/components/ai-elements/audio-player.js +8 -8
- package/dist/components/ai-elements/chain-of-thought.js +2 -2
- package/dist/components/ai-elements/checkpoint.d.ts +1 -1
- package/dist/components/ai-elements/checkpoint.d.ts.map +1 -1
- package/dist/components/ai-elements/checkpoint.js +1 -1
- package/dist/components/ai-elements/commit.d.ts.map +1 -1
- package/dist/components/ai-elements/commit.js +1 -1
- package/dist/components/ai-elements/context.d.ts +4 -4
- package/dist/components/ai-elements/context.d.ts.map +1 -1
- package/dist/components/ai-elements/context.js +4 -3
- package/dist/components/ai-elements/file-tree.d.ts.map +1 -1
- package/dist/components/ai-elements/file-tree.js +1 -1
- package/dist/components/ai-elements/inline-citation.d.ts.map +1 -1
- package/dist/components/ai-elements/inline-citation.js +2 -2
- package/dist/components/ai-elements/message.js +1 -1
- package/dist/components/ai-elements/mic-selector.d.ts.map +1 -1
- package/dist/components/ai-elements/mic-selector.js +2 -2
- package/dist/components/ai-elements/model-selector.d.ts +1 -1
- package/dist/components/ai-elements/model-selector.d.ts.map +1 -1
- package/dist/components/ai-elements/model-selector.js +1 -1
- package/dist/components/ai-elements/open-in-chat.d.ts.map +1 -1
- package/dist/components/ai-elements/open-in-chat.js +8 -5
- package/dist/components/ai-elements/plan.d.ts +3 -2
- package/dist/components/ai-elements/plan.d.ts.map +1 -1
- package/dist/components/ai-elements/plan.js +3 -3
- package/dist/components/ai-elements/prompt-input.d.ts +2 -2
- package/dist/components/ai-elements/prompt-input.d.ts.map +1 -1
- package/dist/components/ai-elements/prompt-input.js +12 -12
- package/dist/components/ai-elements/queue.d.ts.map +1 -1
- package/dist/components/ai-elements/queue.js +2 -2
- package/dist/components/ai-elements/reasoning.js +2 -2
- package/dist/components/ai-elements/sandbox.js +3 -3
- package/dist/components/ai-elements/schema-display.js +4 -4
- package/dist/components/ai-elements/sources.js +1 -1
- package/dist/components/ai-elements/stack-trace.d.ts.map +1 -1
- package/dist/components/ai-elements/stack-trace.js +3 -3
- package/dist/components/ai-elements/task.d.ts.map +1 -1
- package/dist/components/ai-elements/task.js +3 -3
- package/dist/components/ai-elements/test-results.js +1 -1
- package/dist/components/ai-elements/tool.js +2 -2
- package/dist/components/ai-elements/transcription.js +1 -1
- package/dist/components/ai-elements/voice-selector.d.ts +3 -2
- package/dist/components/ai-elements/voice-selector.d.ts.map +1 -1
- package/dist/components/ai-elements/voice-selector.js +2 -2
- package/dist/components/ai-elements/web-preview.d.ts.map +1 -1
- package/dist/components/ai-elements/web-preview.js +2 -2
- package/dist/components/alert-dialog.d.ts +9 -9
- package/dist/components/alert-dialog.d.ts.map +1 -1
- package/dist/components/alert-dialog.js +14 -12
- package/dist/components/alert.d.ts +2 -1
- package/dist/components/alert.d.ts.map +1 -1
- package/dist/components/alert.js +8 -5
- package/dist/components/aspect-ratio.d.ts +3 -2
- package/dist/components/aspect-ratio.d.ts.map +1 -1
- package/dist/components/aspect-ratio.js +6 -4
- package/dist/components/avatar.d.ts +5 -5
- package/dist/components/avatar.d.ts.map +1 -1
- package/dist/components/avatar.js +5 -6
- package/dist/components/badge.d.ts +2 -4
- package/dist/components/badge.d.ts.map +1 -1
- package/dist/components/badge.js +21 -13
- package/dist/components/breadcrumb.d.ts +3 -4
- package/dist/components/breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb.js +20 -12
- package/dist/components/button-group.d.ts +2 -3
- package/dist/components/button-group.d.ts.map +1 -1
- package/dist/components/button-group.js +17 -9
- package/dist/components/button.d.ts +2 -4
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +17 -19
- package/dist/components/calendar.d.ts +5 -3
- package/dist/components/calendar.d.ts.map +1 -1
- package/dist/components/calendar.js +17 -17
- package/dist/components/card.d.ts +3 -1
- package/dist/components/card.d.ts.map +1 -1
- package/dist/components/card.js +6 -6
- package/dist/components/carousel.d.ts +10 -1
- package/dist/components/carousel.d.ts.map +1 -1
- package/dist/components/carousel.js +10 -10
- package/dist/components/chart.d.ts.map +1 -1
- package/dist/components/chart.js +2 -3
- package/dist/components/checkbox.d.ts +2 -3
- package/dist/components/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox.js +3 -3
- package/dist/components/collapsible.d.ts +4 -4
- package/dist/components/collapsible.d.ts.map +1 -1
- package/dist/components/collapsible.js +3 -4
- package/dist/components/combobox.d.ts +1 -1
- package/dist/components/combobox.d.ts.map +1 -1
- package/dist/components/combobox.js +10 -11
- package/dist/components/command.d.ts +4 -3
- package/dist/components/command.d.ts.map +1 -1
- package/dist/components/command.js +13 -12
- package/dist/components/context-menu.d.ts +19 -15
- package/dist/components/context-menu.d.ts.map +1 -1
- package/dist/components/context-menu.js +26 -26
- package/dist/components/dialog.d.ts +9 -9
- package/dist/components/dialog.d.ts.map +1 -1
- package/dist/components/dialog.js +8 -9
- package/dist/components/direction.d.ts +1 -7
- package/dist/components/direction.d.ts.map +1 -1
- package/dist/components/direction.js +1 -8
- package/dist/components/drawer.d.ts +13 -10
- package/dist/components/drawer.d.ts.map +1 -1
- package/dist/components/drawer.js +51 -10
- package/dist/components/dropdown-menu.d.ts +20 -16
- package/dist/components/dropdown-menu.d.ts.map +1 -1
- package/dist/components/dropdown-menu.js +28 -29
- package/dist/components/empty.d.ts.map +1 -1
- package/dist/components/empty.js +5 -5
- package/dist/components/field.d.ts.map +1 -1
- package/dist/components/field.js +11 -19
- package/dist/components/form.d.ts +4 -4
- package/dist/components/form.d.ts.map +1 -1
- package/dist/components/form.js +17 -5
- package/dist/components/hover-card.d.ts +4 -5
- package/dist/components/hover-card.d.ts.map +1 -1
- package/dist/components/hover-card.js +5 -5
- package/dist/components/input-group.d.ts +3 -1
- package/dist/components/input-group.d.ts.map +1 -1
- package/dist/components/input-group.js +10 -16
- package/dist/components/input-otp.d.ts.map +1 -1
- package/dist/components/input-otp.js +5 -5
- package/dist/components/input.d.ts.map +1 -1
- package/dist/components/input.js +2 -1
- package/dist/components/item.d.ts +3 -4
- package/dist/components/item.d.ts.map +1 -1
- package/dist/components/item.js +29 -18
- package/dist/components/kbd.d.ts.map +1 -1
- package/dist/components/kbd.js +1 -1
- package/dist/components/label.d.ts +1 -2
- package/dist/components/label.d.ts.map +1 -1
- package/dist/components/label.js +1 -2
- package/dist/components/menubar.d.ts +21 -18
- package/dist/components/menubar.d.ts.map +1 -1
- package/dist/components/menubar.js +28 -23
- package/dist/components/native-select.d.ts +3 -2
- package/dist/components/native-select.d.ts.map +1 -1
- package/dist/components/native-select.js +2 -2
- package/dist/components/navigation-menu.d.ts +10 -13
- package/dist/components/navigation-menu.d.ts.map +1 -1
- package/dist/components/navigation-menu.js +13 -14
- package/dist/components/pagination.d.ts +8 -4
- package/dist/components/pagination.d.ts.map +1 -1
- package/dist/components/pagination.js +10 -13
- package/dist/components/popover.d.ts +7 -8
- package/dist/components/popover.d.ts.map +1 -1
- package/dist/components/popover.js +7 -11
- package/dist/components/progress.d.ts +7 -4
- package/dist/components/progress.d.ts.map +1 -1
- package/dist/components/progress.js +17 -5
- package/dist/components/radio-group.d.ts +4 -4
- package/dist/components/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group.js +4 -5
- package/dist/components/resizable.d.ts.map +1 -1
- package/dist/components/resizable.js +2 -2
- package/dist/components/scroll-area.d.ts +3 -3
- package/dist/components/scroll-area.d.ts.map +1 -1
- package/dist/components/scroll-area.js +2 -5
- package/dist/components/select.d.ts +11 -11
- package/dist/components/select.d.ts.map +1 -1
- package/dist/components/select.js +14 -18
- package/dist/components/separator.d.ts +2 -3
- package/dist/components/separator.d.ts.map +1 -1
- package/dist/components/separator.js +3 -4
- package/dist/components/sheet.d.ts +7 -7
- package/dist/components/sheet.d.ts.map +1 -1
- package/dist/components/sheet.js +7 -10
- package/dist/components/sidebar.d.ts +9 -15
- package/dist/components/sidebar.d.ts.map +1 -1
- package/dist/components/sidebar.js +85 -41
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.d.ts +2 -3
- package/dist/components/slider.d.ts.map +1 -1
- package/dist/components/slider.js +4 -6
- package/dist/components/sonner.d.ts +1 -1
- package/dist/components/sonner.d.ts.map +1 -1
- package/dist/components/sonner.js +15 -9
- package/dist/components/spinner.d.ts.map +1 -1
- package/dist/components/spinner.js +2 -2
- package/dist/components/switch.d.ts +3 -4
- package/dist/components/switch.d.ts.map +1 -1
- package/dist/components/switch.js +2 -3
- package/dist/components/table.js +2 -2
- package/dist/components/tabs.d.ts +5 -6
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/tabs.js +5 -6
- package/dist/components/textarea.js +1 -1
- package/dist/components/theme-mode-switcher.js +4 -3
- package/dist/components/toggle-group.d.ts +5 -3
- package/dist/components/toggle-group.d.ts.map +1 -1
- package/dist/components/toggle-group.js +12 -7
- package/dist/components/toggle.d.ts +2 -3
- package/dist/components/toggle.d.ts.map +1 -1
- package/dist/components/toggle.js +8 -8
- package/dist/components/tooltip.d.ts +5 -6
- package/dist/components/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip.js +5 -6
- package/dist/hooks/use-controllable-state.d.ts +9 -0
- package/dist/hooks/use-controllable-state.d.ts.map +1 -0
- package/dist/hooks/use-controllable-state.js +25 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -1
- package/dist/hooks/use-mobile.js +0 -1
- package/docs/agents/nadicodeai-ui.md +1 -1
- package/docs/migration/base-ui-migration.md +73 -0
- package/llms.txt +2 -2
- package/package.json +4 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
3
|
function Skeleton({ className, ...props }) {
|
|
4
|
-
return (_jsx("div", { "data-slot": "skeleton", className: cn("animate-pulse rounded-md bg-
|
|
4
|
+
return (_jsx("div", { "data-slot": "skeleton", className: cn("animate-pulse rounded-md bg-muted", className), ...props }));
|
|
5
5
|
}
|
|
6
6
|
export { Skeleton };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
declare function Slider({ className, defaultValue, value, min, max, ...props }: React.ComponentProps<typeof SliderPrimitive.Root>): React.JSX.Element;
|
|
1
|
+
import { Slider as SliderPrimitive } from "@base-ui/react/slider";
|
|
2
|
+
declare function Slider({ className, defaultValue, value, min, max, ...props }: SliderPrimitive.Root.Props): import("react").JSX.Element;
|
|
4
3
|
export { Slider };
|
|
5
4
|
//# sourceMappingURL=slider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../src/components/slider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../src/components/slider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAIjE,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,YAAY,EACZ,KAAK,EACL,GAAO,EACP,GAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,IAAI,CAAC,KAAK,+BAsC5B;AAED,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import { Slider as SliderPrimitive } from "radix-ui";
|
|
2
|
+
import { Slider as SliderPrimitive } from "@base-ui/react/slider";
|
|
5
3
|
import { cn } from "../lib/utils.js";
|
|
6
4
|
function Slider({ className, defaultValue, value, min = 0, max = 100, ...props }) {
|
|
7
|
-
const _values =
|
|
5
|
+
const _values = Array.isArray(value)
|
|
8
6
|
? value
|
|
9
7
|
: Array.isArray(defaultValue)
|
|
10
8
|
? defaultValue
|
|
11
|
-
: [min, max]
|
|
12
|
-
return (
|
|
9
|
+
: [min, max];
|
|
10
|
+
return (_jsx(SliderPrimitive.Root, { className: cn("data-horizontal:w-full data-vertical:h-full", className), "data-slot": "slider", defaultValue: defaultValue, value: value, min: min, max: max, thumbAlignment: "edge", ...props, children: _jsxs(SliderPrimitive.Control, { className: "relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col", children: [_jsx(SliderPrimitive.Track, { "data-slot": "slider-track", className: "relative grow overflow-hidden rounded-full bg-muted select-none data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1", children: _jsx(SliderPrimitive.Indicator, { "data-slot": "slider-range", className: "bg-primary select-none data-horizontal:h-full data-vertical:w-full" }) }), Array.from({ length: _values.length }, (_, index) => (_jsx(SliderPrimitive.Thumb, { "data-slot": "slider-thumb", className: "relative block size-3 shrink-0 rounded-full border border-ring bg-background ring-ring/50 transition-[color,box-shadow] select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 disabled:pointer-events-none disabled:opacity-50" }, index)))] }) }));
|
|
13
11
|
}
|
|
14
12
|
export { Slider };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type ToasterProps } from "sonner";
|
|
2
|
-
declare const Toaster: ({
|
|
2
|
+
declare const Toaster: ({ ...props }: ToasterProps) => import("react").JSX.Element;
|
|
3
3
|
export { Toaster };
|
|
4
4
|
//# sourceMappingURL=sonner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sonner.d.ts","sourceRoot":"","sources":["../../src/components/sonner.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sonner.d.ts","sourceRoot":"","sources":["../../src/components/sonner.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAA;AAG7D,QAAA,MAAM,OAAO,GAAI,cAAc,YAAY,gCAwC1C,CAAA;AAED,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useTheme } from "next-themes";
|
|
4
4
|
import { Toaster as Sonner } from "sonner";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
import { CircleCheckIcon, InfoIcon, TriangleAlertIcon, OctagonXIcon, Loader2Icon } from "lucide-react";
|
|
6
|
+
const Toaster = ({ ...props }) => {
|
|
7
|
+
const { theme = "system" } = useTheme();
|
|
8
|
+
return (_jsx(Sonner, { theme: theme, className: "toaster group", icons: {
|
|
9
|
+
success: (_jsx(CircleCheckIcon, { className: "size-4" })),
|
|
10
|
+
info: (_jsx(InfoIcon, { className: "size-4" })),
|
|
11
|
+
warning: (_jsx(TriangleAlertIcon, { className: "size-4" })),
|
|
12
|
+
error: (_jsx(OctagonXIcon, { className: "size-4" })),
|
|
13
|
+
loading: (_jsx(Loader2Icon, { className: "size-4 animate-spin" })),
|
|
12
14
|
}, style: {
|
|
13
15
|
"--normal-bg": "var(--popover)",
|
|
14
16
|
"--normal-text": "var(--popover-foreground)",
|
|
15
17
|
"--normal-border": "var(--border)",
|
|
16
18
|
"--border-radius": "var(--radius)",
|
|
17
|
-
},
|
|
19
|
+
}, toastOptions: {
|
|
20
|
+
classNames: {
|
|
21
|
+
toast: "cn-toast",
|
|
22
|
+
},
|
|
23
|
+
}, ...props }));
|
|
18
24
|
};
|
|
19
25
|
export { Toaster };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../src/components/spinner.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../src/components/spinner.tsx"],"names":[],"mappings":"AAGA,iBAAS,OAAO,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+BAIpE;AAED,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Loader2Icon } from "lucide-react";
|
|
3
2
|
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { Loader2Icon } from "lucide-react";
|
|
4
4
|
function Spinner({ className, ...props }) {
|
|
5
|
-
return (_jsx(Loader2Icon, { role: "status", "aria-label": "Loading", className: cn("size-4 animate-spin", className), ...props }));
|
|
5
|
+
return (_jsx(Loader2Icon, { "data-slot": "spinner", role: "status", "aria-label": "Loading", className: cn("size-4 animate-spin", className), ...props }));
|
|
6
6
|
}
|
|
7
7
|
export { Spinner };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
declare function Switch({ className, size, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root> & {
|
|
1
|
+
import { Switch as SwitchPrimitive } from "@base-ui/react/switch";
|
|
2
|
+
declare function Switch({ className, size, ...props }: SwitchPrimitive.Root.Props & {
|
|
4
3
|
size?: "sm" | "default";
|
|
5
|
-
}):
|
|
4
|
+
}): import("react").JSX.Element;
|
|
6
5
|
export { Switch };
|
|
7
6
|
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/components/switch.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/components/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAIjE,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,IAAI,CAAC,KAAK,GAAG;IAC9B,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;CACxB,+BAiBA;AAED,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Switch as SwitchPrimitive } from "
|
|
2
|
+
import { Switch as SwitchPrimitive } from "@base-ui/react/switch";
|
|
4
3
|
import { cn } from "../lib/utils.js";
|
|
5
4
|
function Switch({ className, size = "default", ...props }) {
|
|
6
|
-
return (_jsx(SwitchPrimitive.Root, { "data-slot": "switch", "data-size": size, className: cn("peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent
|
|
5
|
+
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] data-checked:bg-primary data-unchecked:bg-input 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)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0" }) }));
|
|
7
6
|
}
|
|
8
7
|
export { Switch };
|
package/dist/components/table.js
CHANGED
|
@@ -17,10 +17,10 @@ function TableRow({ className, ...props }) {
|
|
|
17
17
|
return (_jsx("tr", { "data-slot": "table-row", className: cn("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted", className), ...props }));
|
|
18
18
|
}
|
|
19
19
|
function TableHead({ className, ...props }) {
|
|
20
|
-
return (_jsx("th", { "data-slot": "table-head", className: cn("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0
|
|
20
|
+
return (_jsx("th", { "data-slot": "table-head", className: cn("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0", className), ...props }));
|
|
21
21
|
}
|
|
22
22
|
function TableCell({ className, ...props }) {
|
|
23
|
-
return (_jsx("td", { "data-slot": "table-cell", className: cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0
|
|
23
|
+
return (_jsx("td", { "data-slot": "table-cell", className: cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0", className), ...props }));
|
|
24
24
|
}
|
|
25
25
|
function TableCaption({ className, ...props }) {
|
|
26
26
|
return (_jsx("caption", { "data-slot": "table-caption", className: cn("mt-4 text-sm text-muted-foreground", className), ...props }));
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
|
-
|
|
4
|
-
declare function Tabs({ className, orientation, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): React.JSX.Element;
|
|
3
|
+
declare function Tabs({ className, orientation, ...props }: TabsPrimitive.Root.Props): import("react").JSX.Element;
|
|
5
4
|
declare const tabsListVariants: (props?: ({
|
|
6
5
|
variant?: "line" | "default" | null | undefined;
|
|
7
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
-
declare function TabsList({ className, variant, ...props }:
|
|
9
|
-
declare function TabsTrigger({ className, ...props }:
|
|
10
|
-
declare function TabsContent({ className, ...props }:
|
|
7
|
+
declare function TabsList({ className, variant, ...props }: TabsPrimitive.List.Props & VariantProps<typeof tabsListVariants>): import("react").JSX.Element;
|
|
8
|
+
declare function TabsTrigger({ className, ...props }: TabsPrimitive.Tab.Props): import("react").JSX.Element;
|
|
9
|
+
declare function TabsContent({ className, ...props }: TabsPrimitive.Panel.Props): import("react").JSX.Element;
|
|
11
10
|
export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants };
|
|
12
11
|
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/components/tabs.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/components/tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,iBAAS,IAAI,CAAC,EACZ,SAAS,EACT,WAA0B,EAC1B,GAAG,KAAK,EACT,EAAE,aAAa,CAAC,IAAI,CAAC,KAAK,+BAa1B;AAED,QAAA,MAAM,gBAAgB;;8EAarB,CAAA;AAED,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,aAAa,CAAC,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,+BASlE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,CAAC,GAAG,CAAC,KAAK,+BAcpE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,CAAC,KAAK,CAAC,KAAK,+BAQtE;AAED,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAA"}
|
package/dist/components/tabs.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
|
-
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
5
4
|
import { cn } from "../lib/utils.js";
|
|
6
5
|
function Tabs({ className, orientation = "horizontal", ...props }) {
|
|
7
|
-
return (_jsx(TabsPrimitive.Root, { "data-slot": "tabs", "data-orientation": orientation, orientation: orientation, className: cn("group/tabs flex gap-2 data-
|
|
6
|
+
return (_jsx(TabsPrimitive.Root, { "data-slot": "tabs", "data-orientation": orientation, orientation: orientation, className: cn("group/tabs flex gap-2 data-horizontal:flex-col", className), ...props }));
|
|
8
7
|
}
|
|
9
|
-
const tabsListVariants = cva("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-
|
|
8
|
+
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
9
|
variants: {
|
|
11
10
|
variant: {
|
|
12
11
|
default: "bg-muted",
|
|
@@ -21,9 +20,9 @@ function TabsList({ className, variant = "default", ...props }) {
|
|
|
21
20
|
return (_jsx(TabsPrimitive.List, { "data-slot": "tabs-list", "data-variant": variant, className: cn(tabsListVariants({ variant }), className), ...props }));
|
|
22
21
|
}
|
|
23
22
|
function TabsTrigger({ className, ...props }) {
|
|
24
|
-
return (_jsx(TabsPrimitive.
|
|
23
|
+
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 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", "data-active:bg-background 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
24
|
}
|
|
26
25
|
function TabsContent({ className, ...props }) {
|
|
27
|
-
return (_jsx(TabsPrimitive.
|
|
26
|
+
return (_jsx(TabsPrimitive.Panel, { "data-slot": "tabs-content", className: cn("flex-1 text-sm outline-none", className), ...props }));
|
|
28
27
|
}
|
|
29
28
|
export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
3
|
function Textarea({ className, ...props }) {
|
|
4
|
-
return (_jsx("textarea", { "data-slot": "textarea", className: cn("flex field-sizing-content min-h-16 w-full rounded-
|
|
4
|
+
return (_jsx("textarea", { "data-slot": "textarea", className: cn("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 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", className), ...props }));
|
|
5
5
|
}
|
|
6
6
|
export { Textarea };
|
|
@@ -12,10 +12,11 @@ const themeModeIcons = {
|
|
|
12
12
|
};
|
|
13
13
|
function ThemeModeSwitcher({ "aria-label": ariaLabel, className, compact = false, disabled, itemClassName, labels, onValueChange, value, ...props }) {
|
|
14
14
|
return (_jsx(ToggleGroup, { "aria-label": ariaLabel, className: cn("max-w-full", className), disabled: disabled, onValueChange: (nextValue) => {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const nextMode = nextValue[0];
|
|
16
|
+
if (isThemeMode(nextMode)) {
|
|
17
|
+
onValueChange(nextMode);
|
|
17
18
|
}
|
|
18
|
-
},
|
|
19
|
+
}, value: [value], variant: "outline", ...props, children: themeModes.map((mode) => {
|
|
19
20
|
const Icon = themeModeIcons[mode];
|
|
20
21
|
const label = labels[mode];
|
|
21
22
|
return (_jsxs(ToggleGroupItem, { "aria-label": label, className: cn("min-w-0 gap-1.5 px-2.5", compact ? "h-8 text-xs" : "h-9", itemClassName), disabled: disabled, value: mode, children: [_jsx(Icon, { "aria-hidden": "true", className: "size-4", "data-icon": true }), _jsx("span", { className: "min-w-0 truncate", children: label })] }, mode));
|
|
@@ -1,10 +1,12 @@
|
|
|
1
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";
|
|
2
4
|
import { type VariantProps } from "class-variance-authority";
|
|
3
|
-
import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
4
5
|
import { toggleVariants } from "./toggle";
|
|
5
|
-
declare function ToggleGroup({ className, variant, size, spacing, children, ...props }:
|
|
6
|
+
declare function ToggleGroup({ className, variant, size, spacing, orientation, style, children, ...props }: ToggleGroupPrimitive.Props & VariantProps<typeof toggleVariants> & {
|
|
6
7
|
spacing?: number;
|
|
8
|
+
orientation?: "horizontal" | "vertical";
|
|
7
9
|
}): React.JSX.Element;
|
|
8
|
-
declare function ToggleGroupItem({ className, children, variant, size, ...props }:
|
|
10
|
+
declare function ToggleGroupItem({ className, children, variant, size, ...props }: TogglePrimitive.Props & VariantProps<typeof toggleVariants>): React.JSX.Element;
|
|
9
11
|
export { ToggleGroup, ToggleGroupItem };
|
|
10
12
|
//# sourceMappingURL=toggle-group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle-group.d.ts","sourceRoot":"","sources":["../../src/components/toggle-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"toggle-group.d.ts","sourceRoot":"","sources":["../../src/components/toggle-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AACjF,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAG5D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAcpD,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,OAAO,EACP,IAAI,EACJ,OAAW,EACX,WAA0B,EAC1B,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,oBAAoB,CAAC,KAAK,GAC3B,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;CACxC,qBA4BF;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,QAAQ,EACR,OAAmB,EACnB,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,KAAK,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,qBAsB7D;AAED,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
|
|
5
|
+
import { ToggleGroup as ToggleGroupPrimitive } from "@base-ui/react/toggle-group";
|
|
5
6
|
import { cn } from "../lib/utils.js";
|
|
6
7
|
import { toggleVariants } from "./toggle.js";
|
|
7
8
|
const ToggleGroupContext = React.createContext({
|
|
8
9
|
size: "default",
|
|
9
10
|
variant: "default",
|
|
10
|
-
spacing:
|
|
11
|
+
spacing: 2,
|
|
12
|
+
orientation: "horizontal",
|
|
11
13
|
});
|
|
12
|
-
function ToggleGroup({ className, variant, size, spacing =
|
|
13
|
-
return (_jsx(ToggleGroupPrimitive
|
|
14
|
+
function ToggleGroup({ className, variant, size, spacing = 2, orientation = "horizontal", style, children, ...props }) {
|
|
15
|
+
return (_jsx(ToggleGroupPrimitive, { "data-slot": "toggle-group", "data-variant": variant, "data-size": size, "data-spacing": spacing, "data-orientation": orientation, orientation: orientation, style: {
|
|
16
|
+
...style,
|
|
17
|
+
"--gap": spacing,
|
|
18
|
+
}, 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 }) }));
|
|
14
19
|
}
|
|
15
|
-
function ToggleGroupItem({ className, children, variant, size, ...props }) {
|
|
20
|
+
function ToggleGroupItem({ className, children, variant = "default", size = "default", ...props }) {
|
|
16
21
|
const context = React.useContext(ToggleGroupContext);
|
|
17
|
-
return (_jsx(
|
|
22
|
+
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({
|
|
18
23
|
variant: context.variant || variant,
|
|
19
24
|
size: context.size || size,
|
|
20
|
-
}),
|
|
25
|
+
}), className), ...props, children: children }));
|
|
21
26
|
}
|
|
22
27
|
export { ToggleGroup, ToggleGroupItem };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
|
-
import { Toggle as TogglePrimitive } from "radix-ui";
|
|
4
3
|
declare const toggleVariants: (props?: ({
|
|
5
4
|
variant?: "default" | "outline" | null | undefined;
|
|
6
5
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
7
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
-
declare function Toggle({ className, variant, size, ...props }:
|
|
7
|
+
declare function Toggle({ className, variant, size, ...props }: TogglePrimitive.Props & VariantProps<typeof toggleVariants>): import("react").JSX.Element;
|
|
9
8
|
export { Toggle, toggleVariants };
|
|
10
9
|
//# sourceMappingURL=toggle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../src/components/toggle.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../src/components/toggle.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,cAAc;;;8EAoBnB,CAAA;AAED,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,KAAK,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,+BAQ7D;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
|
|
3
4
|
import { cva } from "class-variance-authority";
|
|
4
|
-
import { Toggle as TogglePrimitive } from "radix-ui";
|
|
5
5
|
import { cn } from "../lib/utils.js";
|
|
6
|
-
const toggleVariants = cva("inline-flex items-center justify-center gap-
|
|
6
|
+
const toggleVariants = cva("group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-pressed:bg-muted [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
7
7
|
variants: {
|
|
8
8
|
variant: {
|
|
9
9
|
default: "bg-transparent",
|
|
10
|
-
outline: "border border-input bg-transparent
|
|
10
|
+
outline: "border border-input bg-transparent hover:bg-muted",
|
|
11
11
|
},
|
|
12
12
|
size: {
|
|
13
|
-
default: "h-
|
|
14
|
-
sm: "h-
|
|
15
|
-
lg: "h-
|
|
13
|
+
default: "h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
14
|
+
sm: "h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
15
|
+
lg: "h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
defaultVariants: {
|
|
@@ -20,7 +20,7 @@ const toggleVariants = cva("inline-flex items-center justify-center gap-2 rounde
|
|
|
20
20
|
size: "default",
|
|
21
21
|
},
|
|
22
22
|
});
|
|
23
|
-
function Toggle({ className, variant, size, ...props }) {
|
|
24
|
-
return (_jsx(TogglePrimitive
|
|
23
|
+
function Toggle({ className, variant = "default", size = "default", ...props }) {
|
|
24
|
+
return (_jsx(TogglePrimitive, { "data-slot": "toggle", className: cn(toggleVariants({ variant, size, className })), ...props }));
|
|
25
25
|
}
|
|
26
26
|
export { Toggle, toggleVariants };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
declare function
|
|
4
|
-
declare function
|
|
5
|
-
declare function
|
|
6
|
-
declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): React.JSX.Element;
|
|
1
|
+
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
|
|
2
|
+
declare function TooltipProvider({ delay, ...props }: TooltipPrimitive.Provider.Props): import("react").JSX.Element;
|
|
3
|
+
declare function Tooltip({ ...props }: TooltipPrimitive.Root.Props): import("react").JSX.Element;
|
|
4
|
+
declare function TooltipTrigger({ ...props }: TooltipPrimitive.Trigger.Props): import("react").JSX.Element;
|
|
5
|
+
declare function TooltipContent({ className, side, sideOffset, align, alignOffset, children, ...props }: TooltipPrimitive.Popup.Props & Pick<TooltipPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): import("react").JSX.Element;
|
|
7
6
|
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
8
7
|
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/components/tooltip.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/components/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAIpE,iBAAS,eAAe,CAAC,EACvB,KAAS,EACT,GAAG,KAAK,EACT,EAAE,gBAAgB,CAAC,QAAQ,CAAC,KAAK,+BAQjC;AAED,iBAAS,OAAO,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,CAAC,IAAI,CAAC,KAAK,+BAEzD;AAED,iBAAS,cAAc,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,CAAC,OAAO,CAAC,KAAK,+BAEnE;AAED,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,IAAY,EACZ,UAAc,EACd,KAAgB,EAChB,WAAe,EACf,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,gBAAgB,CAAC,KAAK,CAAC,KAAK,GAC7B,IAAI,CACF,gBAAgB,CAAC,UAAU,CAAC,KAAK,EACjC,OAAO,GAAG,aAAa,GAAG,MAAM,GAAG,YAAY,CAChD,+BAwBF;AAED,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Tooltip as TooltipPrimitive } from "
|
|
2
|
+
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
|
|
4
3
|
import { cn } from "../lib/utils.js";
|
|
5
|
-
function TooltipProvider({
|
|
6
|
-
return (_jsx(TooltipPrimitive.Provider, { "data-slot": "tooltip-provider",
|
|
4
|
+
function TooltipProvider({ delay = 0, ...props }) {
|
|
5
|
+
return (_jsx(TooltipPrimitive.Provider, { "data-slot": "tooltip-provider", delay: delay, ...props }));
|
|
7
6
|
}
|
|
8
7
|
function Tooltip({ ...props }) {
|
|
9
8
|
return _jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props });
|
|
@@ -11,7 +10,7 @@ function Tooltip({ ...props }) {
|
|
|
11
10
|
function TooltipTrigger({ ...props }) {
|
|
12
11
|
return _jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
13
12
|
}
|
|
14
|
-
function TooltipContent({ className, sideOffset = 0, children, ...props }) {
|
|
15
|
-
return (_jsx(TooltipPrimitive.Portal, { children: _jsxs(TooltipPrimitive.
|
|
13
|
+
function TooltipContent({ className, side = "top", sideOffset = 4, align = "center", alignOffset = 0, children, ...props }) {
|
|
14
|
+
return (_jsx(TooltipPrimitive.Portal, { children: _jsx(TooltipPrimitive.Positioner, { align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, className: "isolate z-50", children: _jsxs(TooltipPrimitive.Popup, { "data-slot": "tooltip-content", className: cn("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 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-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props, children: [children, _jsx(TooltipPrimitive.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" })] }) }) }));
|
|
16
15
|
}
|
|
17
16
|
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type SetStateAction<T> = T | ((previousValue: T) => T);
|
|
2
|
+
type UseControllableStateParams<T> = {
|
|
3
|
+
defaultProp?: T;
|
|
4
|
+
onChange?: (value: T) => void;
|
|
5
|
+
prop?: T;
|
|
6
|
+
};
|
|
7
|
+
declare function useControllableState<T>({ defaultProp, onChange, prop, }: UseControllableStateParams<T>): readonly [T, (nextValue: SetStateAction<T>) => void];
|
|
8
|
+
export { useControllableState };
|
|
9
|
+
//# sourceMappingURL=use-controllable-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-controllable-state.d.ts","sourceRoot":"","sources":["../../src/hooks/use-controllable-state.ts"],"names":[],"mappings":"AAIA,KAAK,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;AAEtD,KAAK,0BAA0B,CAAC,CAAC,IAAI;IACnC,WAAW,CAAC,EAAE,CAAC,CAAA;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAA;IAC7B,IAAI,CAAC,EAAE,CAAC,CAAA;CACT,CAAA;AAED,iBAAS,oBAAoB,CAAC,CAAC,EAAE,EAC/B,WAAW,EACX,QAAQ,EACR,IAAI,GACL,EAAE,0BAA0B,CAAC,CAAC,CAAC,4BAWhB,cAAc,CAAC,CAAC,CAAC,WAoBhC;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
function useControllableState({ defaultProp, onChange, prop, }) {
|
|
4
|
+
const [uncontrolledValue, setUncontrolledValue] = React.useState(defaultProp);
|
|
5
|
+
const isControlled = prop !== undefined;
|
|
6
|
+
const value = isControlled ? prop : uncontrolledValue;
|
|
7
|
+
const onChangeRef = React.useRef(onChange);
|
|
8
|
+
React.useEffect(() => {
|
|
9
|
+
onChangeRef.current = onChange;
|
|
10
|
+
}, [onChange]);
|
|
11
|
+
const setValue = React.useCallback((nextValue) => {
|
|
12
|
+
const resolvedValue = typeof nextValue === "function"
|
|
13
|
+
? nextValue(value)
|
|
14
|
+
: nextValue;
|
|
15
|
+
if (Object.is(value, resolvedValue)) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (!isControlled) {
|
|
19
|
+
setUncontrolledValue(resolvedValue);
|
|
20
|
+
}
|
|
21
|
+
onChangeRef.current?.(resolvedValue);
|
|
22
|
+
}, [isControlled, value]);
|
|
23
|
+
return [value, setValue];
|
|
24
|
+
}
|
|
25
|
+
export { useControllableState };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-mobile.d.ts","sourceRoot":"","sources":["../../src/hooks/use-mobile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-mobile.d.ts","sourceRoot":"","sources":["../../src/hooks/use-mobile.ts"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,YAc1B"}
|
package/dist/hooks/use-mobile.js
CHANGED
|
@@ -217,7 +217,7 @@ npx shadcn@latest add @ai-elements/message --dry-run
|
|
|
217
217
|
|
|
218
218
|
`info --json` is the project-aware source for `tailwindVersion`, `base`,
|
|
219
219
|
`iconLibrary`, aliases, `resolvedPaths`, and configured registries. Current
|
|
220
|
-
package context should report Tailwind v4,
|
|
220
|
+
package context should report Tailwind v4, Base UI primitives, lucide icons,
|
|
221
221
|
source paths under `src/*`, and configured `@shadcn`/`@ai-elements` registry
|
|
222
222
|
access. Use `search` to find current registry items, `docs` to fetch component
|
|
223
223
|
documentation and example/API links, `view` to inspect item contents, and
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Base UI Migration
|
|
2
|
+
|
|
3
|
+
`@nadicodeai/ui` now uses Base UI as its active shadcn primitive base.
|
|
4
|
+
|
|
5
|
+
Current invariants:
|
|
6
|
+
|
|
7
|
+
- `components.json` uses `base-nova`, and `npx shadcn@latest info --json` should report `base: "base"`.
|
|
8
|
+
- Package source must not import `radix-ui`, `@radix-ui/*`, or `vaul`.
|
|
9
|
+
- `cmdk` is allowed only for the stock shadcn Command component while the current `base-nova` registry declares it.
|
|
10
|
+
- `@nadicodeai/ui/package.json` must not depend on `radix-ui`, `@radix-ui/react-use-controllable-state`, or `vaul`.
|
|
11
|
+
- Website and portal Next config must optimize `@base-ui/react`, not `radix-ui`.
|
|
12
|
+
- Public shadcn primitive usage follows the current Base UI registry API. Base UI composition uses `render`; do not add package-local `asChild` adapters for registry-owned primitives.
|
|
13
|
+
- AI Elements use the package-local `useControllableState` helper instead of Radix's hook.
|
|
14
|
+
|
|
15
|
+
## Migration Catalog
|
|
16
|
+
|
|
17
|
+
Direct Base-backed shadcn replacements:
|
|
18
|
+
|
|
19
|
+
- `accordion`, `alert-dialog`, `aspect-ratio`, `avatar`, `checkbox`, `collapsible`, `context-menu`, `dialog`, `drawer`, `dropdown-menu`, `hover-card`, `label`, `menubar`, `navigation-menu`, `popover`, `progress`, `radio-group`, `scroll-area`, `select`, `separator`, `sheet`, `slider`, `switch`, `tabs`, `toggle`, `toggle-group`, and `tooltip`.
|
|
20
|
+
|
|
21
|
+
Package-owned helpers:
|
|
22
|
+
|
|
23
|
+
- Wrapper-only components (`badge`, `breadcrumb`, `button-group`, `item`, `sidebar`, `form`) compose through Base UI's `useRender`/`mergeProps` directly; the transitional `src/lib/slot.tsx` and `src/lib/base-render.tsx` shims are removed.
|
|
24
|
+
|
|
25
|
+
Removed non-shadcn Radix carriers:
|
|
26
|
+
|
|
27
|
+
- `command` stays backed by shadcn's stock `cmdk` implementation while the `base-nova` registry declares that dependency.
|
|
28
|
+
- `drawer` replaces `vaul` with Base UI Drawer.
|
|
29
|
+
- AI Elements replace `@radix-ui/react-use-controllable-state` with `src/hooks/use-controllable-state.ts`.
|
|
30
|
+
|
|
31
|
+
AI Elements using the local controlled/uncontrolled helper:
|
|
32
|
+
|
|
33
|
+
- `chain-of-thought`
|
|
34
|
+
- `mic-selector`
|
|
35
|
+
- `reasoning`
|
|
36
|
+
- `stack-trace`
|
|
37
|
+
- `transcription`
|
|
38
|
+
- `voice-selector`
|
|
39
|
+
|
|
40
|
+
## Breaking in 0.5.0
|
|
41
|
+
|
|
42
|
+
`@nadicodeai/ui@0.5.0` removes the Radix-era compatibility layer that 0.4.x
|
|
43
|
+
carried. Consumers upgrading from 0.4.x must migrate:
|
|
44
|
+
|
|
45
|
+
- `asChild` is removed on every primitive (Button, triggers, closes, menu
|
|
46
|
+
items). Use Base UI's `render` prop instead; when the rendered element is
|
|
47
|
+
not a native `<button>`, also pass `nativeButton={false}` (for example
|
|
48
|
+
`<Button nativeButton={false} render={<a href="…" />}>`).
|
|
49
|
+
- `DropdownMenuItem` / `ContextMenuItem` / `MenubarItem` no longer accept
|
|
50
|
+
`onSelect`. Use `onClick`, and `closeOnClick={false}` to keep the menu open
|
|
51
|
+
(replaces the `onSelect` + `event.preventDefault()` pattern).
|
|
52
|
+
- `PromptInputActionAddScreenshot`'s `onSelect` prop is renamed `onClick`.
|
|
53
|
+
- `Accordion` and `ToggleGroup` drop `type="single" | "multiple"` and string
|
|
54
|
+
values. Values are always arrays; pass `multiple` for multi-select.
|
|
55
|
+
- `TooltipProvider` drops the `delayDuration` alias — use `delay`. HoverCard
|
|
56
|
+
open/close delays live on `HoverCardTrigger` (`delay` / `closeDelay`), not
|
|
57
|
+
the root.
|
|
58
|
+
- `Drawer` drops the vaul-era `direction` / `activeSnapPoint` /
|
|
59
|
+
`setActiveSnapPoint` aliases — use Base UI's `swipeDirection` /
|
|
60
|
+
`snapPoint` / `onSnapPointChange`.
|
|
61
|
+
- `DirectionProvider` drops the `dir` alias — use `direction`.
|
|
62
|
+
- `NavigationMenuViewport` and `PopoverAnchor` are no longer exported; they
|
|
63
|
+
have no stock base-nova equivalent.
|
|
64
|
+
- `CollapsibleContent` / disclosure panels drop the `forceMount` alias — use
|
|
65
|
+
Base UI's `keepMounted`.
|
|
66
|
+
|
|
67
|
+
Verification:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npm run build -w @nadicodeai/ui
|
|
71
|
+
npm run test -w @nadicodeai/ui
|
|
72
|
+
rg 'radix-ui|@radix-ui|vaul' @nadicodeai/ui/src @nadicodeai/ui/package.json website/next.config.ts portal/next.config.ts
|
|
73
|
+
```
|
package/llms.txt
CHANGED
|
@@ -20,7 +20,7 @@ Runtime imports:
|
|
|
20
20
|
- AI Elements subpath: `import { Message } from "@nadicodeai/ui/components/ai-elements/message";`
|
|
21
21
|
|
|
22
22
|
Component surface:
|
|
23
|
-
- shadcn source components are shipped from `@nadicodeai/ui/components
|
|
23
|
+
- shadcn source components are shipped from `@nadicodeai/ui/components/*`; the active primitive base is Base UI.
|
|
24
24
|
- Vercel AI Elements source components are shipped from `@nadicodeai/ui/components/ai-elements/*`.
|
|
25
25
|
- React adapters over design-system grammar and assets ship from component subpaths.
|
|
26
26
|
- Reusable marketing/section compositions belong in this package.
|
|
@@ -66,7 +66,7 @@ shadcn / AI Elements discovery:
|
|
|
66
66
|
- Use live MCP/CLI discovery from `@nadicodeai/ui`; do not maintain a committed upstream registry inventory, snapshot, or inventory update script.
|
|
67
67
|
- Codex MCP setup when supported: `npx shadcn@latest mcp init --client codex`.
|
|
68
68
|
- CLI fallbacks: `npx shadcn@latest info --json`, `npx shadcn@latest search @shadcn -q "select" --json`, `npx shadcn@latest search @ai-elements -q "message" --json`, `npx shadcn@latest docs button select dialog --json`, `npx shadcn@latest view @shadcn/button`, `npx shadcn@latest add @shadcn/button --dry-run`, `npx shadcn@latest add @ai-elements/message --dry-run`.
|
|
69
|
-
- Use `info --json` for aliases, Tailwind version, base primitive library, icon library, source paths, and configured registries. Use `search`, `docs`, and `view` before adding source; use `add --dry-run` or `add --diff` before changing files.
|
|
69
|
+
- Use `info --json` for aliases, Tailwind version, base primitive library, icon library, source paths, and configured registries. It should report Base UI, not Radix. Use `search`, `docs`, and `view` before adding source; use `add --dry-run` or `add --diff` before changing files.
|
|
70
70
|
|
|
71
71
|
Agent references shipped in this package:
|
|
72
72
|
- `AGENTS.md`
|