@camox/ui 0.36.1 → 0.36.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/alert-dialog.d.ts +58 -0
- package/dist/components/alert-dialog.js +96 -0
- package/dist/components/alert.d.ts +28 -0
- package/dist/components/alert.js +45 -0
- package/dist/components/avatar.d.ts +34 -0
- package/dist/components/avatar.js +52 -0
- package/dist/components/badge.d.ts +19 -0
- package/dist/components/badge.js +44 -0
- package/dist/components/button-group.d.ts +28 -0
- package/dist/components/button-group.js +43 -0
- package/dist/components/button.d.ts +18 -0
- package/dist/components/button.js +46 -0
- package/dist/components/command.d.ts +58 -0
- package/dist/components/command.js +89 -0
- package/dist/components/dialog.d.ts +53 -0
- package/dist/components/dialog.js +93 -0
- package/dist/components/dropdown-menu.d.ts +90 -0
- package/dist/components/dropdown-menu.js +138 -0
- package/dist/components/floating-toolbar.d.ts +9 -0
- package/dist/components/floating-toolbar.js +15 -0
- package/dist/components/input-group.d.ts +45 -0
- package/dist/components/input-group.js +82 -0
- package/dist/components/input.d.ts +11 -0
- package/dist/components/input.js +17 -0
- package/dist/components/kbd.d.ts +13 -0
- package/dist/components/kbd.js +21 -0
- package/dist/components/label.d.ts +10 -0
- package/dist/components/label.js +15 -0
- package/dist/components/panel.d.ts +50 -0
- package/dist/components/panel.js +56 -0
- package/dist/components/popover.d.ts +34 -0
- package/dist/components/popover.js +57 -0
- package/dist/components/select.d.ts +55 -0
- package/dist/components/select.js +99 -0
- package/dist/components/separator.d.ts +11 -0
- package/dist/components/separator.js +16 -0
- package/dist/components/sheet.d.ts +46 -0
- package/dist/components/sheet.js +93 -0
- package/dist/components/skeleton.d.ts +9 -0
- package/dist/components/skeleton.js +14 -0
- package/dist/components/spinner.d.ts +9 -0
- package/dist/components/spinner.js +16 -0
- package/dist/components/switch.d.ts +13 -0
- package/dist/components/switch.js +20 -0
- package/dist/components/tabs.d.ts +29 -0
- package/dist/components/tabs.js +46 -0
- package/dist/components/textarea.d.ts +10 -0
- package/dist/components/textarea.js +15 -0
- package/dist/components/toaster.d.ts +11 -0
- package/dist/components/toaster.js +21 -0
- package/dist/components/toggle.d.ts +18 -0
- package/dist/components/toggle.js +37 -0
- package/dist/components/tooltip.d.ts +25 -0
- package/dist/components/tooltip.js +42 -0
- package/dist/lib/utils.d.ts +10 -0
- package/dist/lib/utils.js +14 -0
- package/package.json +61 -58
- package/src/components/alert-dialog.tsx +0 -160
- package/src/components/alert.tsx +0 -73
- package/src/components/avatar.tsx +0 -91
- package/src/components/badge.tsx +0 -56
- package/src/components/button-group.tsx +0 -78
- package/src/components/button.tsx +0 -58
- package/src/components/command.tsx +0 -176
- package/src/components/dialog.tsx +0 -135
- package/src/components/dropdown-menu.tsx +0 -256
- package/src/components/floating-toolbar.tsx +0 -17
- package/src/components/input-group.tsx +0 -146
- package/src/components/input.tsx +0 -20
- package/src/components/kbd.tsx +0 -26
- package/src/components/label.tsx +0 -18
- package/src/components/panel.tsx +0 -109
- package/src/components/popover.tsx +0 -80
- package/src/components/select.tsx +0 -188
- package/src/components/separator.tsx +0 -20
- package/src/components/sheet.tsx +0 -127
- package/src/components/skeleton.tsx +0 -13
- package/src/components/spinner.tsx +0 -16
- package/src/components/switch.tsx +0 -30
- package/src/components/tabs.tsx +0 -73
- package/src/components/textarea.tsx +0 -18
- package/src/components/toaster.tsx +0 -24
- package/src/components/toggle.tsx +0 -43
- package/src/components/tooltip.tsx +0 -52
- package/src/lib/utils.ts +0 -15
- package/src/styles/globals.css +0 -144
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/kbd.tsx
|
|
5
|
+
function Kbd({ className, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx("kbd", {
|
|
7
|
+
"data-slot": "kbd",
|
|
8
|
+
className: cn("pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3", className),
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function KbdGroup({ className, ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx("kbd", {
|
|
14
|
+
"data-slot": "kbd-group",
|
|
15
|
+
className: cn("inline-flex items-center gap-1", className),
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Kbd, KbdGroup };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/label.d.ts
|
|
5
|
+
declare function Label({
|
|
6
|
+
className,
|
|
7
|
+
...props
|
|
8
|
+
}: React.ComponentProps<"label">): _$react_jsx_runtime0.JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Label };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/label.tsx
|
|
6
|
+
function Label({ className, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx("label", {
|
|
8
|
+
"data-slot": "label",
|
|
9
|
+
className: cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className),
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { Label };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/panel.d.ts
|
|
5
|
+
declare const Panel: ({
|
|
6
|
+
children,
|
|
7
|
+
className,
|
|
8
|
+
render,
|
|
9
|
+
...props
|
|
10
|
+
}: Omit<React.ComponentProps<"section">, "children"> & {
|
|
11
|
+
render?: React.ReactElement<{
|
|
12
|
+
className?: string;
|
|
13
|
+
}>;
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
}) => _$react_jsx_runtime0.JSX.Element;
|
|
16
|
+
declare const PanelHeader: ({
|
|
17
|
+
children,
|
|
18
|
+
className,
|
|
19
|
+
render,
|
|
20
|
+
...props
|
|
21
|
+
}: Omit<React.ComponentProps<"header">, "children"> & {
|
|
22
|
+
render?: React.ReactElement<{
|
|
23
|
+
className?: string;
|
|
24
|
+
}>;
|
|
25
|
+
children?: React.ReactNode;
|
|
26
|
+
}) => _$react_jsx_runtime0.JSX.Element;
|
|
27
|
+
declare const PanelTitle: ({
|
|
28
|
+
children,
|
|
29
|
+
className,
|
|
30
|
+
render,
|
|
31
|
+
...props
|
|
32
|
+
}: Omit<React.ComponentProps<"h3">, "children"> & {
|
|
33
|
+
render?: React.ReactElement<{
|
|
34
|
+
className?: string;
|
|
35
|
+
}>;
|
|
36
|
+
children?: React.ReactNode;
|
|
37
|
+
}) => _$react_jsx_runtime0.JSX.Element;
|
|
38
|
+
declare const PanelContent: ({
|
|
39
|
+
children,
|
|
40
|
+
className,
|
|
41
|
+
render,
|
|
42
|
+
...props
|
|
43
|
+
}: Omit<React.ComponentProps<"main">, "children"> & {
|
|
44
|
+
render?: React.ReactElement<{
|
|
45
|
+
className?: string;
|
|
46
|
+
}>;
|
|
47
|
+
children?: React.ReactNode;
|
|
48
|
+
}) => _$react_jsx_runtime0.JSX.Element;
|
|
49
|
+
//#endregion
|
|
50
|
+
export { Panel, PanelContent, PanelHeader, PanelTitle };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/panel.tsx
|
|
6
|
+
const Panel = ({ children, className, render, ...props }) => {
|
|
7
|
+
if (render) return React.cloneElement(render, {
|
|
8
|
+
...props,
|
|
9
|
+
className: cn("flex flex-col bg-background border-2 border-border shadow-xl rounded-lg overflow-hidden", className, render.props.className),
|
|
10
|
+
children
|
|
11
|
+
});
|
|
12
|
+
return /* @__PURE__ */ jsx("section", {
|
|
13
|
+
className: cn("flex flex-col bg-background border-2 border-border shadow-xl rounded-lg overflow-hidden", className),
|
|
14
|
+
...props,
|
|
15
|
+
children
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
const PanelHeader = ({ children, className, render, ...props }) => {
|
|
19
|
+
if (render) return React.cloneElement(render, {
|
|
20
|
+
...props,
|
|
21
|
+
className: cn("p-4 border-b-2 border-border", className, render.props.className),
|
|
22
|
+
children
|
|
23
|
+
});
|
|
24
|
+
return /* @__PURE__ */ jsx("header", {
|
|
25
|
+
className: cn("p-4 border-b-2 border-border", className),
|
|
26
|
+
...props,
|
|
27
|
+
children
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
const PanelTitle = ({ children, className, render, ...props }) => {
|
|
31
|
+
if (render) return React.cloneElement(render, {
|
|
32
|
+
...props,
|
|
33
|
+
className: cn("text-lg leading-none font-semibold", className, render.props.className),
|
|
34
|
+
children
|
|
35
|
+
});
|
|
36
|
+
return /* @__PURE__ */ jsx("h3", {
|
|
37
|
+
className: cn("text-lg leading-none font-semibold", className),
|
|
38
|
+
...props,
|
|
39
|
+
children
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
const PanelContent = ({ children, className, render, ...props }) => {
|
|
43
|
+
if (render) return React.cloneElement(render, {
|
|
44
|
+
...props,
|
|
45
|
+
className: cn("grow overflow-auto", className, render.props.className),
|
|
46
|
+
children
|
|
47
|
+
});
|
|
48
|
+
return /* @__PURE__ */ jsx("main", {
|
|
49
|
+
className: cn("grow overflow-auto", className),
|
|
50
|
+
...props,
|
|
51
|
+
children
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
//#endregion
|
|
56
|
+
export { Panel, PanelContent, PanelHeader, PanelTitle };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { Popover as Popover$1 } from "@base-ui/react/popover";
|
|
4
|
+
|
|
5
|
+
//#region src/components/popover.d.ts
|
|
6
|
+
declare function Popover({
|
|
7
|
+
...props
|
|
8
|
+
}: Popover$1.Root.Props): _$react_jsx_runtime0.JSX.Element;
|
|
9
|
+
declare function PopoverTrigger({
|
|
10
|
+
...props
|
|
11
|
+
}: Popover$1.Trigger.Props): _$react_jsx_runtime0.JSX.Element;
|
|
12
|
+
declare function PopoverContent({
|
|
13
|
+
className,
|
|
14
|
+
align,
|
|
15
|
+
alignOffset,
|
|
16
|
+
side,
|
|
17
|
+
sideOffset,
|
|
18
|
+
anchor,
|
|
19
|
+
...props
|
|
20
|
+
}: Popover$1.Popup.Props & Pick<Popover$1.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset" | "anchor">): _$react_jsx_runtime0.JSX.Element;
|
|
21
|
+
declare function PopoverHeader({
|
|
22
|
+
className,
|
|
23
|
+
...props
|
|
24
|
+
}: React.ComponentProps<"div">): _$react_jsx_runtime0.JSX.Element;
|
|
25
|
+
declare function PopoverTitle({
|
|
26
|
+
className,
|
|
27
|
+
...props
|
|
28
|
+
}: Popover$1.Title.Props): _$react_jsx_runtime0.JSX.Element;
|
|
29
|
+
declare function PopoverDescription({
|
|
30
|
+
className,
|
|
31
|
+
...props
|
|
32
|
+
}: Popover$1.Description.Props): _$react_jsx_runtime0.JSX.Element;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Popover as Popover$1 } from "@base-ui/react/popover";
|
|
5
|
+
|
|
6
|
+
//#region src/components/popover.tsx
|
|
7
|
+
function Popover({ ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Popover$1.Root, {
|
|
9
|
+
"data-slot": "popover",
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function PopoverTrigger({ ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(Popover$1.Trigger, {
|
|
15
|
+
"data-slot": "popover-trigger",
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function PopoverContent({ className, align = "center", alignOffset = 0, side = "bottom", sideOffset = 4, anchor, ...props }) {
|
|
20
|
+
return /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(Popover$1.Positioner, {
|
|
21
|
+
align,
|
|
22
|
+
alignOffset,
|
|
23
|
+
side,
|
|
24
|
+
sideOffset,
|
|
25
|
+
anchor,
|
|
26
|
+
className: "isolate z-50",
|
|
27
|
+
children: /* @__PURE__ */ jsx(Popover$1.Popup, {
|
|
28
|
+
"data-slot": "popover-content",
|
|
29
|
+
className: cn("z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-md bg-popover p-4 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 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),
|
|
30
|
+
...props
|
|
31
|
+
})
|
|
32
|
+
}) });
|
|
33
|
+
}
|
|
34
|
+
function PopoverHeader({ className, ...props }) {
|
|
35
|
+
return /* @__PURE__ */ jsx("div", {
|
|
36
|
+
"data-slot": "popover-header",
|
|
37
|
+
className: cn("flex flex-col gap-1 text-sm", className),
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function PopoverTitle({ className, ...props }) {
|
|
42
|
+
return /* @__PURE__ */ jsx(Popover$1.Title, {
|
|
43
|
+
"data-slot": "popover-title",
|
|
44
|
+
className: cn("font-medium", className),
|
|
45
|
+
...props
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function PopoverDescription({ className, ...props }) {
|
|
49
|
+
return /* @__PURE__ */ jsx(Popover$1.Description, {
|
|
50
|
+
"data-slot": "popover-description",
|
|
51
|
+
className: cn("text-muted-foreground", className),
|
|
52
|
+
...props
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
export { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { Select as Select$1 } from "@base-ui/react/select";
|
|
4
|
+
|
|
5
|
+
//#region src/components/select.d.ts
|
|
6
|
+
declare const Select: typeof Select$1.Root;
|
|
7
|
+
declare function SelectGroup({
|
|
8
|
+
className,
|
|
9
|
+
...props
|
|
10
|
+
}: Select$1.Group.Props): _$react_jsx_runtime0.JSX.Element;
|
|
11
|
+
declare function SelectValue({
|
|
12
|
+
className,
|
|
13
|
+
...props
|
|
14
|
+
}: Select$1.Value.Props): _$react_jsx_runtime0.JSX.Element;
|
|
15
|
+
declare function SelectTrigger({
|
|
16
|
+
className,
|
|
17
|
+
size,
|
|
18
|
+
children,
|
|
19
|
+
...props
|
|
20
|
+
}: Select$1.Trigger.Props & {
|
|
21
|
+
size?: "sm" | "default";
|
|
22
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
23
|
+
declare function SelectContent({
|
|
24
|
+
className,
|
|
25
|
+
children,
|
|
26
|
+
side,
|
|
27
|
+
sideOffset,
|
|
28
|
+
align,
|
|
29
|
+
alignOffset,
|
|
30
|
+
alignItemWithTrigger,
|
|
31
|
+
...props
|
|
32
|
+
}: Select$1.Popup.Props & Pick<Select$1.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset" | "alignItemWithTrigger">): _$react_jsx_runtime0.JSX.Element;
|
|
33
|
+
declare function SelectLabel({
|
|
34
|
+
className,
|
|
35
|
+
...props
|
|
36
|
+
}: Select$1.GroupLabel.Props): _$react_jsx_runtime0.JSX.Element;
|
|
37
|
+
declare function SelectItem({
|
|
38
|
+
className,
|
|
39
|
+
children,
|
|
40
|
+
...props
|
|
41
|
+
}: Select$1.Item.Props): _$react_jsx_runtime0.JSX.Element;
|
|
42
|
+
declare function SelectSeparator({
|
|
43
|
+
className,
|
|
44
|
+
...props
|
|
45
|
+
}: Select$1.Separator.Props): _$react_jsx_runtime0.JSX.Element;
|
|
46
|
+
declare function SelectScrollUpButton({
|
|
47
|
+
className,
|
|
48
|
+
...props
|
|
49
|
+
}: React.ComponentProps<typeof Select$1.ScrollUpArrow>): _$react_jsx_runtime0.JSX.Element;
|
|
50
|
+
declare function SelectScrollDownButton({
|
|
51
|
+
className,
|
|
52
|
+
...props
|
|
53
|
+
}: React.ComponentProps<typeof Select$1.ScrollDownArrow>): _$react_jsx_runtime0.JSX.Element;
|
|
54
|
+
//#endregion
|
|
55
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
5
|
+
import { Select as Select$1 } from "@base-ui/react/select";
|
|
6
|
+
|
|
7
|
+
//#region src/components/select.tsx
|
|
8
|
+
const Select = Select$1.Root;
|
|
9
|
+
function SelectGroup({ className, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsx(Select$1.Group, {
|
|
11
|
+
"data-slot": "select-group",
|
|
12
|
+
className: cn("scroll-my-1 p-1", className),
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function SelectValue({ className, ...props }) {
|
|
17
|
+
return /* @__PURE__ */ jsx(Select$1.Value, {
|
|
18
|
+
"data-slot": "select-value",
|
|
19
|
+
className: cn("flex flex-1 text-left", className),
|
|
20
|
+
...props
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function SelectTrigger({ className, size = "default", children, ...props }) {
|
|
24
|
+
return /* @__PURE__ */ jsxs(Select$1.Trigger, {
|
|
25
|
+
"data-slot": "select-trigger",
|
|
26
|
+
"data-size": size,
|
|
27
|
+
className: cn("flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
28
|
+
...props,
|
|
29
|
+
children: [children, /* @__PURE__ */ jsx(Select$1.Icon, { render: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4" }) })]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function SelectContent({ className, children, side = "bottom", sideOffset = 4, align = "center", alignOffset = 0, alignItemWithTrigger = true, ...props }) {
|
|
33
|
+
return /* @__PURE__ */ jsx(Select$1.Portal, { children: /* @__PURE__ */ jsx(Select$1.Positioner, {
|
|
34
|
+
side,
|
|
35
|
+
sideOffset,
|
|
36
|
+
align,
|
|
37
|
+
alignOffset,
|
|
38
|
+
alignItemWithTrigger,
|
|
39
|
+
className: "isolate z-50",
|
|
40
|
+
children: /* @__PURE__ */ jsxs(Select$1.Popup, {
|
|
41
|
+
"data-slot": "select-content",
|
|
42
|
+
"data-align-trigger": alignItemWithTrigger,
|
|
43
|
+
className: cn("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-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),
|
|
44
|
+
...props,
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
47
|
+
/* @__PURE__ */ jsx(Select$1.List, { children }),
|
|
48
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
49
|
+
]
|
|
50
|
+
})
|
|
51
|
+
}) });
|
|
52
|
+
}
|
|
53
|
+
function SelectLabel({ className, ...props }) {
|
|
54
|
+
return /* @__PURE__ */ jsx(Select$1.GroupLabel, {
|
|
55
|
+
"data-slot": "select-label",
|
|
56
|
+
className: cn("px-2 py-1.5 text-xs text-muted-foreground", className),
|
|
57
|
+
...props
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function SelectItem({ className, children, ...props }) {
|
|
61
|
+
return /* @__PURE__ */ jsxs(Select$1.Item, {
|
|
62
|
+
"data-slot": "select-item",
|
|
63
|
+
className: cn("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
|
|
64
|
+
...props,
|
|
65
|
+
children: [/* @__PURE__ */ jsx(Select$1.ItemText, {
|
|
66
|
+
className: "flex flex-1 shrink-0 gap-2 whitespace-nowrap",
|
|
67
|
+
children
|
|
68
|
+
}), /* @__PURE__ */ jsx(Select$1.ItemIndicator, {
|
|
69
|
+
render: /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center" }),
|
|
70
|
+
children: /* @__PURE__ */ jsx(CheckIcon, { className: "pointer-events-none" })
|
|
71
|
+
})]
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function SelectSeparator({ className, ...props }) {
|
|
75
|
+
return /* @__PURE__ */ jsx(Select$1.Separator, {
|
|
76
|
+
"data-slot": "select-separator",
|
|
77
|
+
className: cn("pointer-events-none -mx-1 my-1 h-px bg-border", className),
|
|
78
|
+
...props
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function SelectScrollUpButton({ className, ...props }) {
|
|
82
|
+
return /* @__PURE__ */ jsx(Select$1.ScrollUpArrow, {
|
|
83
|
+
"data-slot": "select-scroll-up-button",
|
|
84
|
+
className: cn("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className),
|
|
85
|
+
...props,
|
|
86
|
+
children: /* @__PURE__ */ jsx(ChevronUpIcon, {})
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function SelectScrollDownButton({ className, ...props }) {
|
|
90
|
+
return /* @__PURE__ */ jsx(Select$1.ScrollDownArrow, {
|
|
91
|
+
"data-slot": "select-scroll-down-button",
|
|
92
|
+
className: cn("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className),
|
|
93
|
+
...props,
|
|
94
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, {})
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
//#endregion
|
|
99
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import { Separator as Separator$1 } from "@base-ui/react/separator";
|
|
3
|
+
|
|
4
|
+
//#region src/components/separator.d.ts
|
|
5
|
+
declare function Separator({
|
|
6
|
+
className,
|
|
7
|
+
orientation,
|
|
8
|
+
...props
|
|
9
|
+
}: Separator$1.Props): _$react_jsx_runtime0.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Separator };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Separator as Separator$1 } from "@base-ui/react/separator";
|
|
4
|
+
|
|
5
|
+
//#region src/components/separator.tsx
|
|
6
|
+
function Separator({ className, orientation = "horizontal", ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(Separator$1, {
|
|
8
|
+
"data-slot": "separator",
|
|
9
|
+
orientation,
|
|
10
|
+
className: cn("bg-border shrink-0", orientation === "horizontal" ? "h-px w-full" : "w-px self-stretch", className),
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Separator };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { Dialog } from "@base-ui/react/dialog";
|
|
4
|
+
|
|
5
|
+
//#region src/components/sheet.d.ts
|
|
6
|
+
declare function Sheet({
|
|
7
|
+
...props
|
|
8
|
+
}: Dialog.Root.Props): _$react_jsx_runtime0.JSX.Element;
|
|
9
|
+
declare function SheetTrigger({
|
|
10
|
+
...props
|
|
11
|
+
}: Dialog.Trigger.Props): _$react_jsx_runtime0.JSX.Element;
|
|
12
|
+
declare function SheetClose({
|
|
13
|
+
...props
|
|
14
|
+
}: Dialog.Close.Props): _$react_jsx_runtime0.JSX.Element;
|
|
15
|
+
declare function SheetContent({
|
|
16
|
+
className,
|
|
17
|
+
children,
|
|
18
|
+
side,
|
|
19
|
+
showCloseButton,
|
|
20
|
+
showOverlay,
|
|
21
|
+
keepMounted,
|
|
22
|
+
...props
|
|
23
|
+
}: Dialog.Popup.Props & {
|
|
24
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
25
|
+
showCloseButton?: boolean;
|
|
26
|
+
showOverlay?: boolean;
|
|
27
|
+
keepMounted?: boolean;
|
|
28
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
29
|
+
declare function SheetHeader({
|
|
30
|
+
className,
|
|
31
|
+
...props
|
|
32
|
+
}: React.ComponentProps<"div">): _$react_jsx_runtime0.JSX.Element;
|
|
33
|
+
declare function SheetFooter({
|
|
34
|
+
className,
|
|
35
|
+
...props
|
|
36
|
+
}: React.ComponentProps<"div">): _$react_jsx_runtime0.JSX.Element;
|
|
37
|
+
declare function SheetTitle({
|
|
38
|
+
className,
|
|
39
|
+
...props
|
|
40
|
+
}: Dialog.Title.Props): _$react_jsx_runtime0.JSX.Element;
|
|
41
|
+
declare function SheetDescription({
|
|
42
|
+
className,
|
|
43
|
+
...props
|
|
44
|
+
}: Dialog.Description.Props): _$react_jsx_runtime0.JSX.Element;
|
|
45
|
+
//#endregion
|
|
46
|
+
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { Button } from "./button.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { XIcon } from "lucide-react";
|
|
6
|
+
import { Dialog } from "@base-ui/react/dialog";
|
|
7
|
+
|
|
8
|
+
//#region src/components/sheet.tsx
|
|
9
|
+
function Sheet({ ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsx(Dialog.Root, {
|
|
11
|
+
"data-slot": "sheet",
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function SheetTrigger({ ...props }) {
|
|
16
|
+
return /* @__PURE__ */ jsx(Dialog.Trigger, {
|
|
17
|
+
"data-slot": "sheet-trigger",
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function SheetClose({ ...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsx(Dialog.Close, {
|
|
23
|
+
"data-slot": "sheet-close",
|
|
24
|
+
...props
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function SheetPortal({ ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsx(Dialog.Portal, {
|
|
29
|
+
"data-slot": "sheet-portal",
|
|
30
|
+
...props
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function SheetOverlay({ className, ...props }) {
|
|
34
|
+
return /* @__PURE__ */ jsx(Dialog.Backdrop, {
|
|
35
|
+
"data-slot": "sheet-overlay",
|
|
36
|
+
className: cn("fixed inset-0 z-50 bg-black/66 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0", className),
|
|
37
|
+
...props
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function SheetContent({ className, children, side = "right", showCloseButton = true, showOverlay = true, keepMounted = false, ...props }) {
|
|
41
|
+
return /* @__PURE__ */ jsxs(SheetPortal, {
|
|
42
|
+
keepMounted,
|
|
43
|
+
children: [showOverlay && /* @__PURE__ */ jsx(SheetOverlay, {}), /* @__PURE__ */ jsxs(Dialog.Popup, {
|
|
44
|
+
"data-slot": "sheet-content",
|
|
45
|
+
"data-side": side,
|
|
46
|
+
className: cn("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-300 ease-in-out data-open:duration-500 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-full data-[side=bottom]:data-starting-style:translate-y-full data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:-translate-x-full data-[side=left]:data-starting-style:-translate-x-full data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-full data-[side=right]:data-starting-style:translate-x-full data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:-translate-y-full data-[side=top]:data-starting-style:-translate-y-full data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm", className),
|
|
47
|
+
...props,
|
|
48
|
+
children: [children, showCloseButton && /* @__PURE__ */ jsxs(Dialog.Close, {
|
|
49
|
+
"data-slot": "sheet-close",
|
|
50
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
51
|
+
variant: "ghost",
|
|
52
|
+
className: "absolute top-4 right-4",
|
|
53
|
+
size: "icon-sm"
|
|
54
|
+
}),
|
|
55
|
+
children: [/* @__PURE__ */ jsx(XIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
56
|
+
className: "sr-only",
|
|
57
|
+
children: "Close"
|
|
58
|
+
})]
|
|
59
|
+
})]
|
|
60
|
+
})]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function SheetHeader({ className, ...props }) {
|
|
64
|
+
return /* @__PURE__ */ jsx("div", {
|
|
65
|
+
"data-slot": "sheet-header",
|
|
66
|
+
className: cn("flex flex-col gap-1.5 p-4", className),
|
|
67
|
+
...props
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function SheetFooter({ className, ...props }) {
|
|
71
|
+
return /* @__PURE__ */ jsx("div", {
|
|
72
|
+
"data-slot": "sheet-footer",
|
|
73
|
+
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
74
|
+
...props
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function SheetTitle({ className, ...props }) {
|
|
78
|
+
return /* @__PURE__ */ jsx(Dialog.Title, {
|
|
79
|
+
"data-slot": "sheet-title",
|
|
80
|
+
className: cn("font-medium text-foreground", className),
|
|
81
|
+
...props
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function SheetDescription({ className, ...props }) {
|
|
85
|
+
return /* @__PURE__ */ jsx(Dialog.Description, {
|
|
86
|
+
"data-slot": "sheet-description",
|
|
87
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
88
|
+
...props
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
//#endregion
|
|
93
|
+
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/skeleton.tsx
|
|
5
|
+
function Skeleton({ className, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx("div", {
|
|
7
|
+
"data-slot": "skeleton",
|
|
8
|
+
className: cn("animate-pulse rounded-md bg-muted", className),
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Skeleton };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Loader2Icon } from "lucide-react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/spinner.tsx
|
|
6
|
+
function Spinner({ className, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(Loader2Icon, {
|
|
8
|
+
role: "status",
|
|
9
|
+
"aria-label": "Loading",
|
|
10
|
+
className: cn("size-4 animate-spin", className),
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Spinner };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import { Switch as Switch$1 } from "@base-ui/react/switch";
|
|
3
|
+
|
|
4
|
+
//#region src/components/switch.d.ts
|
|
5
|
+
declare function Switch({
|
|
6
|
+
className,
|
|
7
|
+
size,
|
|
8
|
+
...props
|
|
9
|
+
}: Switch$1.Root.Props & {
|
|
10
|
+
size?: "sm" | "default";
|
|
11
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Switch };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Switch as Switch$1 } from "@base-ui/react/switch";
|
|
4
|
+
|
|
5
|
+
//#region src/components/switch.tsx
|
|
6
|
+
function Switch({ className, size = "default", ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(Switch$1.Root, {
|
|
8
|
+
"data-slot": "switch",
|
|
9
|
+
"data-size": size,
|
|
10
|
+
className: cn("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50", className),
|
|
11
|
+
...props,
|
|
12
|
+
children: /* @__PURE__ */ jsx(Switch$1.Thumb, {
|
|
13
|
+
"data-slot": "switch-thumb",
|
|
14
|
+
className: "bg-background dark:data-checked:bg-primary-foreground dark:data-unchecked:bg-foreground pointer-events-none block rounded-full 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"
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { Switch };
|