@nadicodeai/ui 0.4.1 → 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 +1 -1
- package/README.md +2 -2
- package/dist/components/accordion.d.ts +4 -15
- package/dist/components/accordion.d.ts.map +1 -1
- package/dist/components/accordion.js +5 -31
- 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 +1 -1
- 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 +1 -1
- 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.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 +1 -1
- 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 +2 -2
- 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/voice-selector.d.ts +1 -1
- package/dist/components/ai-elements/voice-selector.d.ts.map +1 -1
- package/dist/components/ai-elements/voice-selector.js +1 -1
- 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 +1 -2
- package/dist/components/alert-dialog.d.ts.map +1 -1
- package/dist/components/alert-dialog.js +2 -3
- 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.map +1 -1
- package/dist/components/aspect-ratio.js +0 -1
- package/dist/components/avatar.d.ts.map +1 -1
- package/dist/components/avatar.js +0 -1
- 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 +1 -5
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +2 -8
- 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/collapsible.d.ts +3 -7
- package/dist/components/collapsible.d.ts.map +1 -1
- package/dist/components/collapsible.js +5 -16
- 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.map +1 -1
- package/dist/components/command.js +1 -1
- package/dist/components/context-menu.d.ts +4 -9
- package/dist/components/context-menu.d.ts.map +1 -1
- package/dist/components/context-menu.js +6 -16
- package/dist/components/dialog.d.ts +2 -3
- package/dist/components/dialog.d.ts.map +1 -1
- package/dist/components/dialog.js +2 -4
- package/dist/components/direction.d.ts +1 -8
- package/dist/components/direction.d.ts.map +1 -1
- package/dist/components/direction.js +1 -7
- package/dist/components/drawer.d.ts +4 -13
- package/dist/components/drawer.d.ts.map +1 -1
- package/dist/components/drawer.js +5 -22
- package/dist/components/dropdown-menu.d.ts +4 -9
- package/dist/components/dropdown-menu.d.ts.map +1 -1
- package/dist/components/dropdown-menu.js +6 -17
- 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 +2 -2
- package/dist/components/form.d.ts.map +1 -1
- package/dist/components/form.js +17 -5
- package/dist/components/hover-card.d.ts +3 -8
- package/dist/components/hover-card.d.ts.map +1 -1
- package/dist/components/hover-card.js +4 -9
- 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/menubar.d.ts.map +1 -1
- package/dist/components/menubar.js +4 -1
- 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 +2 -9
- package/dist/components/navigation-menu.d.ts.map +1 -1
- package/dist/components/navigation-menu.js +4 -8
- 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 +3 -7
- package/dist/components/popover.d.ts.map +1 -1
- package/dist/components/popover.js +5 -30
- package/dist/components/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group.js +0 -1
- package/dist/components/resizable.d.ts.map +1 -1
- package/dist/components/resizable.js +2 -2
- package/dist/components/scroll-area.d.ts.map +1 -1
- package/dist/components/scroll-area.js +0 -1
- package/dist/components/separator.d.ts.map +1 -1
- package/dist/components/separator.js +0 -1
- package/dist/components/sheet.d.ts +2 -3
- package/dist/components/sheet.d.ts.map +1 -1
- package/dist/components/sheet.js +2 -3
- 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.map +1 -1
- package/dist/components/slider.js +3 -8
- 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.map +1 -1
- package/dist/components/switch.js +0 -1
- package/dist/components/table.js +2 -2
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/tabs.js +0 -1
- package/dist/components/textarea.js +1 -1
- package/dist/components/theme-mode-switcher.js +4 -3
- package/dist/components/toggle-group.d.ts +3 -9
- package/dist/components/toggle-group.d.ts.map +1 -1
- package/dist/components/toggle-group.js +5 -22
- package/dist/components/toggle.d.ts +1 -2
- package/dist/components/toggle.d.ts.map +1 -1
- package/dist/components/toggle.js +2 -3
- package/dist/components/tooltip.d.ts +2 -5
- package/dist/components/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip.js +4 -6
- package/dist/hooks/use-mobile.d.ts.map +1 -1
- package/dist/hooks/use-mobile.js +0 -1
- package/docs/migration/base-ui-migration.md +33 -9
- package/package.json +3 -2
- package/dist/lib/base-render.d.ts +0 -14
- package/dist/lib/base-render.d.ts.map +0 -1
- package/dist/lib/base-render.js +0 -16
- package/dist/lib/slot.d.ts +0 -8
- package/dist/lib/slot.d.ts.map +0 -1
- package/dist/lib/slot.js +0 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../src/components/collapsible.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../src/components/collapsible.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAEhF,iBAAS,WAAW,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,+BAEjE;AAED,iBAAS,kBAAkB,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,CAAC,OAAO,CAAC,KAAK,+BAI3E;AAED,iBAAS,kBAAkB,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,CAAC,KAAK,CAAC,KAAK,+BAIzE;AAED,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -1,23 +1,12 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as React from "react";
|
|
4
2
|
import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible";
|
|
5
|
-
import { withAsChildRender } from "../lib/base-render.js";
|
|
6
3
|
function Collapsible({ ...props }) {
|
|
7
|
-
return
|
|
4
|
+
return _jsx(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ...props });
|
|
8
5
|
}
|
|
9
|
-
function CollapsibleTrigger({
|
|
10
|
-
|
|
11
|
-
React.isValidElement(children) &&
|
|
12
|
-
typeof children.type === "string" &&
|
|
13
|
-
children.type !== "button";
|
|
14
|
-
return (_jsx(CollapsiblePrimitive.Trigger, { "data-slot": "collapsible-trigger", nativeButton: nativeButton ?? (rendersLiteralNonButton ? false : undefined), ...withAsChildRender({
|
|
15
|
-
asChild,
|
|
16
|
-
children,
|
|
17
|
-
...props,
|
|
18
|
-
}) }));
|
|
6
|
+
function CollapsibleTrigger({ ...props }) {
|
|
7
|
+
return (_jsx(CollapsiblePrimitive.Trigger, { "data-slot": "collapsible-trigger", ...props }));
|
|
19
8
|
}
|
|
20
|
-
function CollapsibleContent({
|
|
21
|
-
return (_jsx(CollapsiblePrimitive.Panel, { "data-slot": "collapsible-content",
|
|
9
|
+
function CollapsibleContent({ ...props }) {
|
|
10
|
+
return (_jsx(CollapsiblePrimitive.Panel, { "data-slot": "collapsible-content", ...props }));
|
|
22
11
|
}
|
|
23
12
|
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -19,7 +19,7 @@ declare function ComboboxChips({ className, ...props }: React.ComponentPropsWith
|
|
|
19
19
|
declare function ComboboxChip({ className, children, showRemove, ...props }: ComboboxPrimitive.Chip.Props & {
|
|
20
20
|
showRemove?: boolean;
|
|
21
21
|
}): React.JSX.Element;
|
|
22
|
-
declare function ComboboxChipsInput({ className,
|
|
22
|
+
declare function ComboboxChipsInput({ className, ...props }: ComboboxPrimitive.Input.Props): React.JSX.Element;
|
|
23
23
|
declare function useComboboxAnchor(): React.RefObject<HTMLDivElement | null>;
|
|
24
24
|
export { Combobox, ComboboxInput, ComboboxContent, ComboboxList, ComboboxItem, ComboboxGroup, ComboboxLabel, ComboboxCollection, ComboboxEmpty, ComboboxSeparator, ComboboxChips, ComboboxChip, ComboboxChipsInput, ComboboxTrigger, ComboboxValue, useComboboxAnchor, };
|
|
25
25
|
//# sourceMappingURL=combobox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../src/components/combobox.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../src/components/combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAY9D,QAAA,MAAM,QAAQ,+BAAyB,CAAA;AAEvC,iBAAS,aAAa,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,CAAC,KAAK,CAAC,KAAK,qBAEjE;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,iBAAiB,CAAC,OAAO,CAAC,KAAK,qBAWjC;AAeD,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,QAAgB,EAChB,WAAkB,EAClB,SAAiB,EACjB,GAAG,KAAK,EACT,EAAE,iBAAiB,CAAC,KAAK,CAAC,KAAK,GAAG;IACjC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,qBAuBA;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,IAAe,EACf,UAAc,EAC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iB,CAAC,IAAI,CAAC,KAAK,GAAG;IAChC,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,qBAsBA;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,iBAAiB,CAAC,KAAK,CAAC,KAAK,qBAQ/B;AAED,iBAAS,iBAAiB,2CAEzB;AAED,OAAO,EACL,QAAQ,EACR,aAAa,EACb,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,iBAAiB,GAClB,CAAA"}
|
|
@@ -1,38 +1,37 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
2
|
import * as React from "react";
|
|
4
3
|
import { Combobox as ComboboxPrimitive } from "@base-ui/react";
|
|
5
|
-
import { CheckIcon, ChevronDownIcon, XIcon } from "lucide-react";
|
|
6
4
|
import { cn } from "../lib/utils.js";
|
|
7
5
|
import { Button } from "./button.js";
|
|
8
6
|
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, } from "./input-group.js";
|
|
7
|
+
import { ChevronDownIcon, XIcon, CheckIcon } from "lucide-react";
|
|
9
8
|
const Combobox = ComboboxPrimitive.Root;
|
|
10
9
|
function ComboboxValue({ ...props }) {
|
|
11
10
|
return _jsx(ComboboxPrimitive.Value, { "data-slot": "combobox-value", ...props });
|
|
12
11
|
}
|
|
13
12
|
function ComboboxTrigger({ className, children, ...props }) {
|
|
14
|
-
return (_jsxs(ComboboxPrimitive.Trigger, { "data-slot": "combobox-trigger", className: cn("[&_svg:not([class*='size-'])]:size-4", className), ...props, children: [children, _jsx(ChevronDownIcon, {
|
|
13
|
+
return (_jsxs(ComboboxPrimitive.Trigger, { "data-slot": "combobox-trigger", className: cn("[&_svg:not([class*='size-'])]:size-4", className), ...props, children: [children, _jsx(ChevronDownIcon, { className: "pointer-events-none size-4 text-muted-foreground" })] }));
|
|
15
14
|
}
|
|
16
15
|
function ComboboxClear({ className, ...props }) {
|
|
17
16
|
return (_jsx(ComboboxPrimitive.Clear, { "data-slot": "combobox-clear", render: _jsx(InputGroupButton, { variant: "ghost", size: "icon-xs" }), className: cn(className), ...props, children: _jsx(XIcon, { className: "pointer-events-none" }) }));
|
|
18
17
|
}
|
|
19
18
|
function ComboboxInput({ className, children, disabled = false, showTrigger = true, showClear = false, ...props }) {
|
|
20
|
-
return (_jsxs(InputGroup, { className: cn("w-auto", className), children: [_jsx(ComboboxPrimitive.Input, { render: _jsx(InputGroupInput, { disabled: disabled }), ...props }), _jsxs(InputGroupAddon, { align: "inline-end", children: [showTrigger && (_jsx(InputGroupButton, { size: "icon-xs", variant: "ghost",
|
|
19
|
+
return (_jsxs(InputGroup, { className: cn("w-auto", className), children: [_jsx(ComboboxPrimitive.Input, { render: _jsx(InputGroupInput, { disabled: disabled }), ...props }), _jsxs(InputGroupAddon, { align: "inline-end", children: [showTrigger && (_jsx(InputGroupButton, { size: "icon-xs", variant: "ghost", render: _jsx(ComboboxTrigger, {}), "data-slot": "input-group-button", className: "group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent", disabled: disabled })), showClear && _jsx(ComboboxClear, { disabled: disabled })] }), children] }));
|
|
21
20
|
}
|
|
22
21
|
function ComboboxContent({ className, side = "bottom", sideOffset = 6, align = "start", alignOffset = 0, anchor, ...props }) {
|
|
23
|
-
return (_jsx(ComboboxPrimitive.Portal, { children: _jsx(ComboboxPrimitive.Positioner, { side: side, sideOffset: sideOffset, align: align, alignOffset: alignOffset, anchor: anchor, className: "isolate z-50", children: _jsx(ComboboxPrimitive.Popup, { "data-slot": "combobox-content", "data-chips": !!anchor, className: cn("group/combobox-content relative max-h-
|
|
22
|
+
return (_jsx(ComboboxPrimitive.Portal, { children: _jsx(ComboboxPrimitive.Positioner, { side: side, sideOffset: sideOffset, align: align, alignOffset: alignOffset, anchor: anchor, className: "isolate z-50", children: _jsx(ComboboxPrimitive.Popup, { "data-slot": "combobox-content", "data-chips": !!anchor, className: cn("group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=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=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props }) }) }));
|
|
24
23
|
}
|
|
25
24
|
function ComboboxList({ className, ...props }) {
|
|
26
|
-
return (_jsx(ComboboxPrimitive.List, { "data-slot": "combobox-list", className: cn("max-h-[min(calc(--spacing(
|
|
25
|
+
return (_jsx(ComboboxPrimitive.List, { "data-slot": "combobox-list", className: cn("no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0", className), ...props }));
|
|
27
26
|
}
|
|
28
27
|
function ComboboxItem({ className, children, ...props }) {
|
|
29
|
-
return (_jsxs(ComboboxPrimitive.Item, { "data-slot": "combobox-item", className: cn("relative flex w-full cursor-default items-center gap-2 rounded-
|
|
28
|
+
return (_jsxs(ComboboxPrimitive.Item, { "data-slot": "combobox-item", className: cn("relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [children, _jsx(ComboboxPrimitive.ItemIndicator, { render: _jsx("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center" }), children: _jsx(CheckIcon, { className: "pointer-events-none" }) })] }));
|
|
30
29
|
}
|
|
31
30
|
function ComboboxGroup({ className, ...props }) {
|
|
32
31
|
return (_jsx(ComboboxPrimitive.Group, { "data-slot": "combobox-group", className: cn(className), ...props }));
|
|
33
32
|
}
|
|
34
33
|
function ComboboxLabel({ className, ...props }) {
|
|
35
|
-
return (_jsx(ComboboxPrimitive.GroupLabel, { "data-slot": "combobox-label", className: cn("px-2 py-1.5 text-xs text-muted-foreground
|
|
34
|
+
return (_jsx(ComboboxPrimitive.GroupLabel, { "data-slot": "combobox-label", className: cn("px-2 py-1.5 text-xs text-muted-foreground", className), ...props }));
|
|
36
35
|
}
|
|
37
36
|
function ComboboxCollection({ ...props }) {
|
|
38
37
|
return (_jsx(ComboboxPrimitive.Collection, { "data-slot": "combobox-collection", ...props }));
|
|
@@ -44,12 +43,12 @@ function ComboboxSeparator({ className, ...props }) {
|
|
|
44
43
|
return (_jsx(ComboboxPrimitive.Separator, { "data-slot": "combobox-separator", className: cn("-mx-1 my-1 h-px bg-border", className), ...props }));
|
|
45
44
|
}
|
|
46
45
|
function ComboboxChips({ className, ...props }) {
|
|
47
|
-
return (_jsx(ComboboxPrimitive.Chips, { "data-slot": "combobox-chips", className: cn("flex min-h-
|
|
46
|
+
return (_jsx(ComboboxPrimitive.Chips, { "data-slot": "combobox-chips", className: cn("flex min-h-8 flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1", className), ...props }));
|
|
48
47
|
}
|
|
49
48
|
function ComboboxChip({ className, children, showRemove = true, ...props }) {
|
|
50
|
-
return (_jsxs(ComboboxPrimitive.Chip, { "data-slot": "combobox-chip", className: cn("flex h-[calc(--spacing(5.
|
|
49
|
+
return (_jsxs(ComboboxPrimitive.Chip, { "data-slot": "combobox-chip", className: cn("flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0", className), ...props, children: [children, showRemove && (_jsx(ComboboxPrimitive.ChipRemove, { render: _jsx(Button, { variant: "ghost", size: "icon-xs" }), className: "-ml-1 opacity-50 hover:opacity-100", "data-slot": "combobox-chip-remove", children: _jsx(XIcon, { className: "pointer-events-none" }) }))] }));
|
|
51
50
|
}
|
|
52
|
-
function ComboboxChipsInput({ className,
|
|
51
|
+
function ComboboxChipsInput({ className, ...props }) {
|
|
53
52
|
return (_jsx(ComboboxPrimitive.Input, { "data-slot": "combobox-chip-input", className: cn("min-w-16 flex-1 outline-none", className), ...props }));
|
|
54
53
|
}
|
|
55
54
|
function useComboboxAnchor() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/components/command.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/components/command.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,MAAM,CAAA;AAGl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EACnB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,qBAcpD;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,qBAW9B;AAED,OAAO,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,gBAAgB,GACjB,CAAA"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Command as CommandPrimitive } from "cmdk";
|
|
4
|
-
import { CheckIcon, SearchIcon } from "lucide-react";
|
|
5
4
|
import { cn } from "../lib/utils.js";
|
|
6
5
|
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "./dialog.js";
|
|
7
6
|
import { InputGroup, InputGroupAddon, } from "./input-group.js";
|
|
7
|
+
import { SearchIcon, CheckIcon } from "lucide-react";
|
|
8
8
|
function Command({ className, ...props }) {
|
|
9
9
|
return (_jsx(CommandPrimitive, { "data-slot": "command", className: cn("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground", className), ...props }));
|
|
10
10
|
}
|
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { ContextMenu as ContextMenuPrimitive } from "@base-ui/react/context-menu";
|
|
3
|
-
import { type WithAsChild } from "../lib/base-render";
|
|
4
3
|
declare function ContextMenu({ ...props }: ContextMenuPrimitive.Root.Props): React.JSX.Element;
|
|
5
4
|
declare function ContextMenuPortal({ ...props }: ContextMenuPrimitive.Portal.Props): React.JSX.Element;
|
|
6
|
-
declare function ContextMenuTrigger({ className, ...props }:
|
|
5
|
+
declare function ContextMenuTrigger({ className, ...props }: ContextMenuPrimitive.Trigger.Props): React.JSX.Element;
|
|
7
6
|
declare function ContextMenuContent({ className, align, alignOffset, side, sideOffset, ...props }: ContextMenuPrimitive.Popup.Props & Pick<ContextMenuPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): React.JSX.Element;
|
|
8
7
|
declare function ContextMenuGroup({ ...props }: ContextMenuPrimitive.Group.Props): React.JSX.Element;
|
|
9
8
|
declare function ContextMenuLabel({ className, inset, ...props }: ContextMenuPrimitive.GroupLabel.Props & {
|
|
10
9
|
inset?: boolean;
|
|
11
10
|
}): React.JSX.Element;
|
|
12
|
-
|
|
13
|
-
type ContextMenuItemProps = WithAsChild<Omit<ContextMenuPrimitive.Item.Props, "onClick" | "onSelect">> & {
|
|
11
|
+
declare function ContextMenuItem({ className, inset, variant, ...props }: ContextMenuPrimitive.Item.Props & {
|
|
14
12
|
inset?: boolean;
|
|
15
|
-
onClick?: ContextMenuPrimitive.Item.Props["onClick"];
|
|
16
|
-
onSelect?: ContextMenuSelectEventHandler;
|
|
17
13
|
variant?: "default" | "destructive";
|
|
18
|
-
};
|
|
19
|
-
declare function ContextMenuItem({ className, inset, onClick, onSelect, variant, ...props }: ContextMenuItemProps): React.JSX.Element;
|
|
14
|
+
}): React.JSX.Element;
|
|
20
15
|
declare function ContextMenuSub({ ...props }: ContextMenuPrimitive.SubmenuRoot.Props): React.JSX.Element;
|
|
21
|
-
declare function ContextMenuSubTrigger({ className, inset, children,
|
|
16
|
+
declare function ContextMenuSubTrigger({ className, inset, children, ...props }: ContextMenuPrimitive.SubmenuTrigger.Props & {
|
|
22
17
|
inset?: boolean;
|
|
23
18
|
}): React.JSX.Element;
|
|
24
19
|
declare function ContextMenuSubContent({ ...props }: React.ComponentProps<typeof ContextMenuContent>): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../src/components/context-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAA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AuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GACtB,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx,
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { ContextMenu as ContextMenuPrimitive } from "@base-ui/react/context-menu";
|
|
4
|
-
import { withAsChildRender } from "../lib/base-render.js";
|
|
5
4
|
import { cn } from "../lib/utils.js";
|
|
6
5
|
import { ChevronRightIcon, CheckIcon } from "lucide-react";
|
|
7
6
|
function ContextMenu({ ...props }) {
|
|
@@ -11,7 +10,7 @@ function ContextMenuPortal({ ...props }) {
|
|
|
11
10
|
return (_jsx(ContextMenuPrimitive.Portal, { "data-slot": "context-menu-portal", ...props }));
|
|
12
11
|
}
|
|
13
12
|
function ContextMenuTrigger({ className, ...props }) {
|
|
14
|
-
return (_jsx(ContextMenuPrimitive.Trigger, { "data-slot": "context-menu-trigger", className: cn("select-none", className), ...
|
|
13
|
+
return (_jsx(ContextMenuPrimitive.Trigger, { "data-slot": "context-menu-trigger", className: cn("select-none", className), ...props }));
|
|
15
14
|
}
|
|
16
15
|
function ContextMenuContent({ className, align = "start", alignOffset = 4, side = "right", sideOffset = 0, ...props }) {
|
|
17
16
|
return (_jsx(ContextMenuPrimitive.Portal, { children: _jsx(ContextMenuPrimitive.Positioner, { className: "isolate z-50 outline-none", align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, children: _jsx(ContextMenuPrimitive.Popup, { "data-slot": "context-menu-content", className: cn("z-50 max-h-(--available-height) min-w-36 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:fade-out-0 data-closed:zoom-out-95", className), ...props }) }) }));
|
|
@@ -22,23 +21,14 @@ function ContextMenuGroup({ ...props }) {
|
|
|
22
21
|
function ContextMenuLabel({ className, inset, ...props }) {
|
|
23
22
|
return (_jsx(ContextMenuPrimitive.GroupLabel, { "data-slot": "context-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 }));
|
|
24
23
|
}
|
|
25
|
-
function ContextMenuItem({ className, inset,
|
|
26
|
-
|
|
27
|
-
onSelect?.(event.nativeEvent);
|
|
28
|
-
if (event.nativeEvent.defaultPrevented) {
|
|
29
|
-
event.preventBaseUIHandler?.();
|
|
30
|
-
event.preventDefault();
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
onClick?.(event);
|
|
34
|
-
};
|
|
35
|
-
return (_jsx(ContextMenuPrimitive.Item, { "data-slot": "context-menu-item", "data-inset": inset, "data-variant": variant, className: cn("group/context-menu-item relative flex cursor-default 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 data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive", className), onClick: handleClick, ...withAsChildRender(props) }));
|
|
24
|
+
function ContextMenuItem({ className, inset, variant = "default", ...props }) {
|
|
25
|
+
return (_jsx(ContextMenuPrimitive.Item, { "data-slot": "context-menu-item", "data-inset": inset, "data-variant": variant, className: cn("group/context-menu-item relative flex cursor-default 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 data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive", className), ...props }));
|
|
36
26
|
}
|
|
37
27
|
function ContextMenuSub({ ...props }) {
|
|
38
28
|
return (_jsx(ContextMenuPrimitive.SubmenuRoot, { "data-slot": "context-menu-sub", ...props }));
|
|
39
29
|
}
|
|
40
|
-
function ContextMenuSubTrigger({ className, inset, children,
|
|
41
|
-
return (
|
|
30
|
+
function ContextMenuSubTrigger({ className, inset, children, ...props }) {
|
|
31
|
+
return (_jsxs(ContextMenuPrimitive.SubmenuTrigger, { "data-slot": "context-menu-sub-trigger", "data-inset": inset, className: cn("flex cursor-default 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 data-inset:pl-7 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" })] }));
|
|
42
32
|
}
|
|
43
33
|
function ContextMenuSubContent({ ...props }) {
|
|
44
34
|
return (_jsx(ContextMenuContent, { "data-slot": "context-menu-sub-content", className: "shadow-lg", side: "right", ...props }));
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
|
3
|
-
import { type WithAsChild } from "../lib/base-render";
|
|
4
3
|
declare function Dialog({ ...props }: DialogPrimitive.Root.Props): React.JSX.Element;
|
|
5
|
-
declare function DialogTrigger({ ...props }:
|
|
4
|
+
declare function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props): React.JSX.Element;
|
|
6
5
|
declare function DialogPortal({ ...props }: DialogPrimitive.Portal.Props): React.JSX.Element;
|
|
7
|
-
declare function DialogClose({ ...props }:
|
|
6
|
+
declare function DialogClose({ ...props }: DialogPrimitive.Close.Props): React.JSX.Element;
|
|
8
7
|
declare function DialogOverlay({ className, ...props }: DialogPrimitive.Backdrop.Props): React.JSX.Element;
|
|
9
8
|
declare function DialogContent({ className, children, showCloseButton, ...props }: DialogPrimitive.Popup.Props & {
|
|
10
9
|
showCloseButton?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/components/dialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/components/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAMjE,iBAAS,MAAM,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,IAAI,CAAC,KAAK,qBAEvD;AAED,iBAAS,aAAa,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,OAAO,CAAC,KAAK,qBAEjE;AAED,iBAAS,YAAY,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,MAAM,CAAC,KAAK,qBAE/D;AAED,iBAAS,WAAW,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,qBAE7D;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,QAAQ,CAAC,KAAK,qBAWhC;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,eAAsB,EACtB,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,GAAG;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,qBAgCA;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQzE;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,eAAuB,EACvB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,qBAkBA;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,qBAWxE;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,WAAW,CAAC,KAAK,qBAWnC;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAA"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
2
|
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
|
4
|
-
import { withAsChildRender } from "../lib/base-render.js";
|
|
5
3
|
import { cn } from "../lib/utils.js";
|
|
6
4
|
import { Button } from "./button.js";
|
|
7
5
|
import { XIcon } from "lucide-react";
|
|
@@ -9,13 +7,13 @@ function Dialog({ ...props }) {
|
|
|
9
7
|
return _jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
10
8
|
}
|
|
11
9
|
function DialogTrigger({ ...props }) {
|
|
12
|
-
return
|
|
10
|
+
return _jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
13
11
|
}
|
|
14
12
|
function DialogPortal({ ...props }) {
|
|
15
13
|
return _jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
16
14
|
}
|
|
17
15
|
function DialogClose({ ...props }) {
|
|
18
|
-
return
|
|
16
|
+
return _jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
19
17
|
}
|
|
20
18
|
function DialogOverlay({ className, ...props }) {
|
|
21
19
|
return (_jsx(DialogPrimitive.Backdrop, { "data-slot": "dialog-overlay", className: cn("fixed inset-0 isolate z-50 bg-foreground/50 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className), ...props }));
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { type DirectionProviderProps as DirectionProviderPrimitiveProps, useDirection } from "@base-ui/react/direction-provider";
|
|
3
|
-
type DirectionProviderProps = Omit<DirectionProviderPrimitiveProps, "direction"> & {
|
|
4
|
-
direction?: DirectionProviderPrimitiveProps["direction"];
|
|
5
|
-
dir?: DirectionProviderPrimitiveProps["direction"];
|
|
6
|
-
};
|
|
7
|
-
declare function DirectionProvider({ dir, direction, ...props }: DirectionProviderProps): React.JSX.Element;
|
|
8
|
-
export { DirectionProvider, useDirection };
|
|
1
|
+
export { DirectionProvider, useDirection, } from "@base-ui/react/direction-provider";
|
|
9
2
|
//# sourceMappingURL=direction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"direction.d.ts","sourceRoot":"","sources":["../../src/components/direction.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"direction.d.ts","sourceRoot":"","sources":["../../src/components/direction.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,YAAY,GACb,MAAM,mCAAmC,CAAA"}
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { DirectionProvider as DirectionProviderPrimitive, useDirection, } from "@base-ui/react/direction-provider";
|
|
4
|
-
function DirectionProvider({ dir, direction, ...props }) {
|
|
5
|
-
return (_jsx(DirectionProviderPrimitive, { "data-slot": "direction-provider", direction: direction ?? dir, ...props }));
|
|
6
|
-
}
|
|
7
|
-
export { DirectionProvider, useDirection };
|
|
1
|
+
export { DirectionProvider, useDirection, } from "@base-ui/react/direction-provider";
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer";
|
|
3
|
-
|
|
4
|
-
type DrawerDirection = "top" | "right" | "bottom" | "left";
|
|
5
|
-
type DrawerProps = Omit<DrawerPrimitive.Root.Props, "onSnapPointChange" | "snapPoint" | "swipeDirection"> & {
|
|
6
|
-
activeSnapPoint?: DrawerPrimitive.Root.Props["snapPoint"];
|
|
7
|
-
direction?: DrawerDirection;
|
|
8
|
-
onSnapPointChange?: DrawerPrimitive.Root.Props["onSnapPointChange"];
|
|
9
|
-
setActiveSnapPoint?: DrawerPrimitive.Root.Props["onSnapPointChange"];
|
|
3
|
+
declare function Drawer({ modal, showSwipeHandle, snapPoints, swipeDirection, ...props }: DrawerPrimitive.Root.Props & {
|
|
10
4
|
showSwipeHandle?: boolean;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
declare function Drawer({ activeSnapPoint, direction, modal, onSnapPointChange, setActiveSnapPoint, showSwipeHandle, snapPoints, snapPoint, swipeDirection, ...props }: DrawerProps): React.JSX.Element;
|
|
15
|
-
declare function DrawerTrigger({ ...props }: WithAsChild<DrawerPrimitive.Trigger.Props>): React.JSX.Element;
|
|
5
|
+
}): React.JSX.Element;
|
|
6
|
+
declare function DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props): React.JSX.Element;
|
|
16
7
|
declare function DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props): React.JSX.Element;
|
|
17
|
-
declare function DrawerClose({ ...props }:
|
|
8
|
+
declare function DrawerClose({ ...props }: DrawerPrimitive.Close.Props): React.JSX.Element;
|
|
18
9
|
declare function DrawerOverlay({ className, ...props }: DrawerPrimitive.Backdrop.Props): React.JSX.Element;
|
|
19
10
|
declare function DrawerSwipeHandle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
20
11
|
declare function DrawerContent({ className, children, ...props }: DrawerPrimitive.Popup.Props): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../src/components/drawer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../src/components/drawer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAuBjE,iBAAS,MAAM,CAAC,EACd,KAAY,EACZ,eAAuB,EACvB,UAAU,EACV,cAAuB,EACvB,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,IAAI,CAAC,KAAK,GAAG;IAC9B,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,qBAkBA;AAED,iBAAS,aAAa,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,OAAO,CAAC,KAAK,qBAEjE;AAED,iBAAS,YAAY,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,MAAM,CAAC,KAAK,qBAE/D;AAED,iBAAS,WAAW,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,qBAE7D;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,QAAQ,CAAC,KAAK,qBAWhC;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAY7B;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,qBA6D7B;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAWzE;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQzE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,qBAWxE;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,WAAW,CAAC,KAAK,qBAQnC;AAED,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,CAAA"}
|
|
@@ -2,14 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer";
|
|
5
|
-
import { withAsChildRender } from "../lib/base-render.js";
|
|
6
5
|
import { cn } from "../lib/utils.js";
|
|
7
|
-
const drawerDirectionToSwipeDirection = {
|
|
8
|
-
bottom: "down",
|
|
9
|
-
left: "left",
|
|
10
|
-
right: "right",
|
|
11
|
-
top: "up",
|
|
12
|
-
};
|
|
13
6
|
const DrawerContext = React.createContext(null);
|
|
14
7
|
function useDrawer() {
|
|
15
8
|
const context = React.useContext(DrawerContext);
|
|
@@ -18,29 +11,19 @@ function useDrawer() {
|
|
|
18
11
|
}
|
|
19
12
|
return context;
|
|
20
13
|
}
|
|
21
|
-
function Drawer({
|
|
22
|
-
const resolvedSnapPoint = snapPoint ?? activeSnapPoint;
|
|
23
|
-
const resolvedSwipeDirection = direction
|
|
24
|
-
? drawerDirectionToSwipeDirection[direction]
|
|
25
|
-
: swipeDirection;
|
|
26
|
-
const handleSnapPointChange = onSnapPointChange ?? setActiveSnapPoint;
|
|
14
|
+
function Drawer({ modal = true, showSwipeHandle = false, snapPoints, swipeDirection = "down", ...props }) {
|
|
27
15
|
const hasSnapPoints = snapPoints != null && snapPoints.length > 0;
|
|
28
|
-
const contextValue = React.useMemo(() => ({
|
|
29
|
-
|
|
30
|
-
modal,
|
|
31
|
-
showSwipeHandle,
|
|
32
|
-
swipeDirection: resolvedSwipeDirection,
|
|
33
|
-
}), [hasSnapPoints, modal, resolvedSwipeDirection, showSwipeHandle]);
|
|
34
|
-
return (_jsx(DrawerContext.Provider, { value: contextValue, children: _jsx(DrawerPrimitive.Root, { "data-slot": "drawer", modal: modal, onSnapPointChange: handleSnapPointChange, snapPoint: resolvedSnapPoint, snapPoints: snapPoints, swipeDirection: resolvedSwipeDirection, ...props }) }));
|
|
16
|
+
const contextValue = React.useMemo(() => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }), [hasSnapPoints, modal, showSwipeHandle, swipeDirection]);
|
|
17
|
+
return (_jsx(DrawerContext.Provider, { value: contextValue, children: _jsx(DrawerPrimitive.Root, { "data-slot": "drawer", modal: modal, snapPoints: snapPoints, swipeDirection: swipeDirection, ...props }) }));
|
|
35
18
|
}
|
|
36
19
|
function DrawerTrigger({ ...props }) {
|
|
37
|
-
return
|
|
20
|
+
return _jsx(DrawerPrimitive.Trigger, { "data-slot": "drawer-trigger", ...props });
|
|
38
21
|
}
|
|
39
22
|
function DrawerPortal({ ...props }) {
|
|
40
23
|
return _jsx(DrawerPrimitive.Portal, { "data-slot": "drawer-portal", ...props });
|
|
41
24
|
}
|
|
42
25
|
function DrawerClose({ ...props }) {
|
|
43
|
-
return
|
|
26
|
+
return _jsx(DrawerPrimitive.Close, { "data-slot": "drawer-close", ...props });
|
|
44
27
|
}
|
|
45
28
|
function DrawerOverlay({ className, ...props }) {
|
|
46
29
|
return (_jsx(DrawerPrimitive.Backdrop, { "data-slot": "drawer-overlay", className: cn("fixed inset-0 z-50 min-h-dvh bg-foreground/50 opacity-[max(var(--drawer-overlay-min-opacity,0),calc(1-var(--drawer-swipe-progress)))] transition-opacity duration-450 ease-[cubic-bezier(0.32,0.72,0,1)] select-none data-ending-style:pointer-events-none data-ending-style:opacity-0 data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-snap-points:[--drawer-overlay-min-opacity:0.5] data-starting-style:opacity-0 data-swiping:duration-0 supports-backdrop-filter:backdrop-blur-xs supports-[-webkit-touch-callout:none]:absolute", className), ...props }));
|
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
3
|
-
import { type WithAsChild } from "../lib/base-render";
|
|
4
3
|
declare function DropdownMenu({ ...props }: MenuPrimitive.Root.Props): React.JSX.Element;
|
|
5
4
|
declare function DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props): React.JSX.Element;
|
|
6
|
-
declare function DropdownMenuTrigger({ ...props }:
|
|
5
|
+
declare function DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props): React.JSX.Element;
|
|
7
6
|
declare function DropdownMenuContent({ align, alignOffset, side, sideOffset, className, ...props }: MenuPrimitive.Popup.Props & Pick<MenuPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): React.JSX.Element;
|
|
8
7
|
declare function DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props): React.JSX.Element;
|
|
9
8
|
declare function DropdownMenuLabel({ className, inset, ...props }: MenuPrimitive.GroupLabel.Props & {
|
|
10
9
|
inset?: boolean;
|
|
11
10
|
}): React.JSX.Element;
|
|
12
|
-
|
|
13
|
-
type DropdownMenuItemProps = WithAsChild<Omit<MenuPrimitive.Item.Props, "onClick" | "onSelect">> & {
|
|
11
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: MenuPrimitive.Item.Props & {
|
|
14
12
|
inset?: boolean;
|
|
15
|
-
onClick?: MenuPrimitive.Item.Props["onClick"];
|
|
16
|
-
onSelect?: DropdownMenuSelectEventHandler;
|
|
17
13
|
variant?: "default" | "destructive";
|
|
18
|
-
};
|
|
19
|
-
declare function DropdownMenuItem({ className, inset, onClick, onSelect, variant, ...props }: DropdownMenuItemProps): React.JSX.Element;
|
|
14
|
+
}): React.JSX.Element;
|
|
20
15
|
declare function DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props): React.JSX.Element;
|
|
21
|
-
declare function DropdownMenuSubTrigger({ className, inset, children,
|
|
16
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: MenuPrimitive.SubmenuTrigger.Props & {
|
|
22
17
|
inset?: boolean;
|
|
23
18
|
}): React.JSX.Element;
|
|
24
19
|
declare function DropdownMenuSubContent({ align, alignOffset, side, sideOffset, className, ...props }: React.ComponentProps<typeof DropdownMenuContent>): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../src/components/dropdown-menu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../src/components/dropdown-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAK3D,iBAAS,YAAY,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,CAAC,IA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B,CAAC,EAC9B,KAAe,EACf,WAAgB,EAChB,IAAc,EACd,UAAc,EACd,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,qBAYlD;AAED,iBAAS,wBAAwB,CAAC,EAChC,SAAS,EACT,QAAQ,EACR,OAAO,EACP,KAAK,EACL,GAAG,KAAK,EACT,EAAE,aAAa,CAAC,YAAY,CAAC,KAAK,GAAG;IACpC,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,qBAwBA;AAED,iBAAS,sBAAsB,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,CAAC,UAAU,CAAC,KAAK,qBAO3E;AAED,iBAAS,qBAAqB,CAAC,EAC7B,SAAS,EACT,QAAQ,EACR,KAAK,EACL,GAAG,KAAK,EACT,EAAE,aAAa,CAAC,SAAS,CAAC,KAAK,GAAG;IACjC,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,qBAuBA;AAED,iBAAS,qBAAqB,CAAC,EAC7B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,aAAa,CAAC,SAAS,CAAC,KAAK,qBAQ/B;AAED,iBAAS,oBAAoB,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,qBAW9B;AAED,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,GACvB,CAAA"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
2
|
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
4
|
-
import { withAsChildRender } from "../lib/base-render.js";
|
|
5
3
|
import { cn } from "../lib/utils.js";
|
|
6
4
|
import { ChevronRightIcon, CheckIcon } from "lucide-react";
|
|
7
5
|
function DropdownMenu({ ...props }) {
|
|
@@ -11,7 +9,7 @@ function DropdownMenuPortal({ ...props }) {
|
|
|
11
9
|
return _jsx(MenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
|
|
12
10
|
}
|
|
13
11
|
function DropdownMenuTrigger({ ...props }) {
|
|
14
|
-
return
|
|
12
|
+
return _jsx(MenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
|
|
15
13
|
}
|
|
16
14
|
function DropdownMenuContent({ align = "start", alignOffset = 0, side = "bottom", sideOffset = 4, className, ...props }) {
|
|
17
15
|
return (_jsx(MenuPrimitive.Portal, { children: _jsx(MenuPrimitive.Positioner, { className: "isolate z-50 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 }) }) }));
|
|
@@ -22,23 +20,14 @@ function DropdownMenuGroup({ ...props }) {
|
|
|
22
20
|
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
23
21
|
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 }));
|
|
24
22
|
}
|
|
25
|
-
function DropdownMenuItem({ className, inset,
|
|
26
|
-
|
|
27
|
-
onSelect?.(event.nativeEvent);
|
|
28
|
-
if (event.nativeEvent.defaultPrevented) {
|
|
29
|
-
event.preventBaseUIHandler?.();
|
|
30
|
-
event.preventDefault();
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
onClick?.(event);
|
|
34
|
-
};
|
|
35
|
-
return (_jsx(MenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn("group/dropdown-menu-item relative flex cursor-default 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 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), onClick: handleClick, ...withAsChildRender(props) }));
|
|
23
|
+
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
24
|
+
return (_jsx(MenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn("group/dropdown-menu-item relative flex cursor-default 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 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 }));
|
|
36
25
|
}
|
|
37
26
|
function DropdownMenuSub({ ...props }) {
|
|
38
27
|
return _jsx(MenuPrimitive.SubmenuRoot, { "data-slot": "dropdown-menu-sub", ...props });
|
|
39
28
|
}
|
|
40
|
-
function DropdownMenuSubTrigger({ className, inset, children,
|
|
41
|
-
return (
|
|
29
|
+
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
30
|
+
return (_jsxs(MenuPrimitive.SubmenuTrigger, { "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset, className: cn("flex cursor-default 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" })] }));
|
|
42
31
|
}
|
|
43
32
|
function DropdownMenuSubContent({ align = "start", alignOffset = -3, side = "right", sideOffset = 0, className, ...props }) {
|
|
44
33
|
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 }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty.d.ts","sourceRoot":"","sources":["../../src/components/empty.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+BAWlE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+
|
|
1
|
+
{"version":3,"file":"empty.d.ts","sourceRoot":"","sources":["../../src/components/empty.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+BAWlE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+BAQxE;AAED,QAAA,MAAM,kBAAkB;;8EAavB,CAAA;AAED,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,kBAAkB,CAAC,+BASvE;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+BAWvE;AAED,iBAAS,gBAAgB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,+BAW3E;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+BAWzE;AAED,OAAO,EACL,KAAK,EACL,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,UAAU,GACX,CAAA"}
|
package/dist/components/empty.js
CHANGED
|
@@ -2,16 +2,16 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
3
|
import { cn } from "../lib/utils.js";
|
|
4
4
|
function Empty({ className, ...props }) {
|
|
5
|
-
return (_jsx("div", { "data-slot": "empty", className: cn("flex min-w-0 flex-1 flex-col items-center justify-center gap-
|
|
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("flex max-w-sm flex-col items-center gap-2
|
|
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
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
13
|
default: "bg-transparent",
|
|
14
|
-
icon: "flex size-
|
|
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: {
|
|
@@ -22,12 +22,12 @@ 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("text-
|
|
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
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("flex w-full max-w-sm min-w-0 flex-col items-center gap-
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../src/components/field.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAG1C,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,+
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../src/components/field.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAG1C,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,+BAW1E;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,OAAkB,EAClB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;CAAE,+BAYnE;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,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