@camox/ui 0.43.0 → 0.45.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/dist/components/accordion.d.ts +10 -0
- package/dist/components/accordion.js +40 -0
- package/dist/components/alert-dialog.d.ts +13 -51
- package/dist/components/alert-dialog.js +1 -1
- package/dist/components/alert.d.ts +6 -22
- package/dist/components/alert.js +3 -2
- package/dist/components/avatar.d.ts +7 -28
- package/dist/components/avatar.js +1 -1
- package/dist/components/badge.d.ts +3 -12
- package/dist/components/bubble.d.ts +18 -0
- package/dist/components/bubble.js +75 -0
- package/dist/components/button-group.d.ts +4 -20
- package/dist/components/button-group.js +1 -1
- package/dist/components/button.d.ts +4 -12
- package/dist/components/button.js +3 -3
- package/dist/components/checkbox.d.ts +5 -0
- package/dist/components/checkbox.js +21 -0
- package/dist/components/command.d.ts +14 -50
- package/dist/components/command.js +3 -3
- package/dist/components/dialog.d.ts +12 -45
- package/dist/components/dialog.js +1 -1
- package/dist/components/dropdown-menu.d.ts +20 -79
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/favicon-drop-zone.d.ts +17 -0
- package/dist/components/favicon-drop-zone.js +97 -0
- package/dist/components/floating-toolbar.d.ts +1 -6
- package/dist/components/input-group.d.ts +9 -34
- package/dist/components/input-group.js +1 -3
- package/dist/components/input.d.ts +1 -7
- package/dist/components/input.js +1 -1
- package/dist/components/kbd.d.ts +2 -10
- package/dist/components/label.d.ts +1 -6
- package/dist/components/label.js +1 -1
- package/dist/components/message-scroller.d.ts +12 -0
- package/dist/components/message-scroller.js +62 -0
- package/dist/components/message.d.ts +12 -0
- package/dist/components/message.js +51 -0
- package/dist/components/panel.d.ts +9 -32
- package/dist/components/panel.js +1 -1
- package/dist/components/popover.d.ts +6 -29
- package/dist/components/popover.js +1 -1
- package/dist/components/select.d.ts +10 -48
- package/dist/components/select.js +1 -1
- package/dist/components/separator.d.ts +1 -7
- package/dist/components/sheet.d.ts +9 -37
- package/dist/components/sheet.js +1 -1
- package/dist/components/skeleton.d.ts +1 -6
- package/dist/components/spinner.d.ts +1 -6
- package/dist/components/switch.d.ts +2 -8
- package/dist/components/tabs.d.ts +5 -22
- package/dist/components/tabs.js +1 -1
- package/dist/components/textarea.d.ts +1 -6
- package/dist/components/textarea.js +1 -1
- package/dist/components/toaster.d.ts +1 -7
- package/dist/components/toggle.d.ts +2 -10
- package/dist/components/toggle.js +1 -1
- package/dist/components/tooltip.d.ts +4 -21
- package/dist/lib/utils.d.ts +4 -6
- package/package.json +34 -9
|
@@ -1,53 +1,20 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
2
|
import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
|
|
4
|
-
|
|
5
3
|
//#region src/components/dialog.d.ts
|
|
6
|
-
declare function Dialog({
|
|
7
|
-
|
|
8
|
-
}: Dialog$1.
|
|
9
|
-
declare function
|
|
10
|
-
|
|
11
|
-
}: Dialog$1.
|
|
12
|
-
declare function DialogPortal({
|
|
13
|
-
...props
|
|
14
|
-
}: Dialog$1.Portal.Props): _$react_jsx_runtime0.JSX.Element;
|
|
15
|
-
declare function DialogClose({
|
|
16
|
-
...props
|
|
17
|
-
}: Dialog$1.Close.Props): _$react_jsx_runtime0.JSX.Element;
|
|
18
|
-
declare function DialogOverlay({
|
|
19
|
-
className,
|
|
20
|
-
...props
|
|
21
|
-
}: Dialog$1.Backdrop.Props): _$react_jsx_runtime0.JSX.Element;
|
|
22
|
-
declare function DialogContent({
|
|
23
|
-
className,
|
|
24
|
-
children,
|
|
25
|
-
showCloseButton,
|
|
26
|
-
forceOverlay,
|
|
27
|
-
...props
|
|
28
|
-
}: Dialog$1.Popup.Props & {
|
|
4
|
+
declare function Dialog({ ...props }: Dialog$1.Root.Props): React.JSX.Element;
|
|
5
|
+
declare function DialogTrigger({ ...props }: Dialog$1.Trigger.Props): React.JSX.Element;
|
|
6
|
+
declare function DialogPortal({ ...props }: Dialog$1.Portal.Props): React.JSX.Element;
|
|
7
|
+
declare function DialogClose({ ...props }: Dialog$1.Close.Props): React.JSX.Element;
|
|
8
|
+
declare function DialogOverlay({ className, ...props }: Dialog$1.Backdrop.Props): React.JSX.Element;
|
|
9
|
+
declare function DialogContent({ className, children, showCloseButton, forceOverlay, ...props }: Dialog$1.Popup.Props & {
|
|
29
10
|
showCloseButton?: boolean;
|
|
30
11
|
forceOverlay?: boolean;
|
|
31
|
-
}):
|
|
32
|
-
declare function DialogHeader({
|
|
33
|
-
|
|
34
|
-
...props
|
|
35
|
-
}: React.ComponentProps<"div">): _$react_jsx_runtime0.JSX.Element;
|
|
36
|
-
declare function DialogFooter({
|
|
37
|
-
className,
|
|
38
|
-
showCloseButton,
|
|
39
|
-
children,
|
|
40
|
-
...props
|
|
41
|
-
}: React.ComponentProps<"div"> & {
|
|
12
|
+
}): React.JSX.Element;
|
|
13
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
14
|
+
declare function DialogFooter({ className, showCloseButton, children, ...props }: React.ComponentProps<"div"> & {
|
|
42
15
|
showCloseButton?: boolean;
|
|
43
|
-
}):
|
|
44
|
-
declare function DialogTitle({
|
|
45
|
-
|
|
46
|
-
...props
|
|
47
|
-
}: Dialog$1.Title.Props): _$react_jsx_runtime0.JSX.Element;
|
|
48
|
-
declare function DialogDescription({
|
|
49
|
-
className,
|
|
50
|
-
...props
|
|
51
|
-
}: Dialog$1.Description.Props): _$react_jsx_runtime0.JSX.Element;
|
|
16
|
+
}): React.JSX.Element;
|
|
17
|
+
declare function DialogTitle({ className, ...props }: Dialog$1.Title.Props): React.JSX.Element;
|
|
18
|
+
declare function DialogDescription({ className, ...props }: Dialog$1.Description.Props): React.JSX.Element;
|
|
52
19
|
//#endregion
|
|
53
20
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.js";
|
|
2
2
|
import { Button } from "./button.js";
|
|
3
|
-
import "react";
|
|
4
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import "react";
|
|
5
5
|
import { XIcon } from "lucide-react";
|
|
6
6
|
import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
|
|
7
7
|
|
|
@@ -1,90 +1,31 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
2
|
import { Menu } from "@base-ui/react/menu";
|
|
4
|
-
|
|
5
3
|
//#region src/components/dropdown-menu.d.ts
|
|
6
|
-
declare function DropdownMenu({
|
|
7
|
-
|
|
8
|
-
}: Menu.
|
|
9
|
-
declare function
|
|
10
|
-
|
|
11
|
-
}: Menu.
|
|
12
|
-
declare function DropdownMenuTrigger({
|
|
13
|
-
...props
|
|
14
|
-
}: Menu.Trigger.Props): _$react_jsx_runtime0.JSX.Element;
|
|
15
|
-
declare function DropdownMenuContent({
|
|
16
|
-
align,
|
|
17
|
-
alignOffset,
|
|
18
|
-
side,
|
|
19
|
-
sideOffset,
|
|
20
|
-
className,
|
|
21
|
-
...props
|
|
22
|
-
}: Menu.Popup.Props & Pick<Menu.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): _$react_jsx_runtime0.JSX.Element;
|
|
23
|
-
declare function DropdownMenuGroup({
|
|
24
|
-
...props
|
|
25
|
-
}: Menu.Group.Props): _$react_jsx_runtime0.JSX.Element;
|
|
26
|
-
declare function DropdownMenuLabel({
|
|
27
|
-
className,
|
|
28
|
-
inset,
|
|
29
|
-
...props
|
|
30
|
-
}: Menu.GroupLabel.Props & {
|
|
4
|
+
declare function DropdownMenu({ ...props }: Menu.Root.Props): React.JSX.Element;
|
|
5
|
+
declare function DropdownMenuPortal({ ...props }: Menu.Portal.Props): React.JSX.Element;
|
|
6
|
+
declare function DropdownMenuTrigger({ ...props }: Menu.Trigger.Props): React.JSX.Element;
|
|
7
|
+
declare function DropdownMenuContent({ align, alignOffset, side, sideOffset, className, ...props }: Menu.Popup.Props & Pick<Menu.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): React.JSX.Element;
|
|
8
|
+
declare function DropdownMenuGroup({ ...props }: Menu.Group.Props): React.JSX.Element;
|
|
9
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: Menu.GroupLabel.Props & {
|
|
31
10
|
inset?: boolean;
|
|
32
|
-
}):
|
|
33
|
-
declare function DropdownMenuItem({
|
|
34
|
-
className,
|
|
35
|
-
inset,
|
|
36
|
-
variant,
|
|
37
|
-
...props
|
|
38
|
-
}: Menu.Item.Props & {
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: Menu.Item.Props & {
|
|
39
13
|
inset?: boolean;
|
|
40
14
|
variant?: "default" | "destructive";
|
|
41
|
-
}):
|
|
42
|
-
declare function DropdownMenuSub({
|
|
43
|
-
|
|
44
|
-
}: Menu.SubmenuRoot.Props): _$react_jsx_runtime0.JSX.Element;
|
|
45
|
-
declare function DropdownMenuSubTrigger({
|
|
46
|
-
className,
|
|
47
|
-
inset,
|
|
48
|
-
children,
|
|
49
|
-
...props
|
|
50
|
-
}: Menu.SubmenuTrigger.Props & {
|
|
15
|
+
}): React.JSX.Element;
|
|
16
|
+
declare function DropdownMenuSub({ ...props }: Menu.SubmenuRoot.Props): React.JSX.Element;
|
|
17
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: Menu.SubmenuTrigger.Props & {
|
|
51
18
|
inset?: boolean;
|
|
52
|
-
}):
|
|
53
|
-
declare function DropdownMenuSubContent({
|
|
54
|
-
|
|
55
|
-
alignOffset,
|
|
56
|
-
side,
|
|
57
|
-
sideOffset,
|
|
58
|
-
className,
|
|
59
|
-
...props
|
|
60
|
-
}: React.ComponentProps<typeof DropdownMenuContent>): _$react_jsx_runtime0.JSX.Element;
|
|
61
|
-
declare function DropdownMenuCheckboxItem({
|
|
62
|
-
className,
|
|
63
|
-
children,
|
|
64
|
-
checked,
|
|
65
|
-
inset,
|
|
66
|
-
...props
|
|
67
|
-
}: Menu.CheckboxItem.Props & {
|
|
19
|
+
}): React.JSX.Element;
|
|
20
|
+
declare function DropdownMenuSubContent({ align, alignOffset, side, sideOffset, className, ...props }: React.ComponentProps<typeof DropdownMenuContent>): React.JSX.Element;
|
|
21
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }: Menu.CheckboxItem.Props & {
|
|
68
22
|
inset?: boolean;
|
|
69
|
-
}):
|
|
70
|
-
declare function DropdownMenuRadioGroup({
|
|
71
|
-
|
|
72
|
-
}: Menu.RadioGroup.Props): _$react_jsx_runtime0.JSX.Element;
|
|
73
|
-
declare function DropdownMenuRadioItem({
|
|
74
|
-
className,
|
|
75
|
-
children,
|
|
76
|
-
inset,
|
|
77
|
-
...props
|
|
78
|
-
}: Menu.RadioItem.Props & {
|
|
23
|
+
}): React.JSX.Element;
|
|
24
|
+
declare function DropdownMenuRadioGroup({ ...props }: Menu.RadioGroup.Props): React.JSX.Element;
|
|
25
|
+
declare function DropdownMenuRadioItem({ className, children, inset, ...props }: Menu.RadioItem.Props & {
|
|
79
26
|
inset?: boolean;
|
|
80
|
-
}):
|
|
81
|
-
declare function DropdownMenuSeparator({
|
|
82
|
-
|
|
83
|
-
...props
|
|
84
|
-
}: Menu.Separator.Props): _$react_jsx_runtime0.JSX.Element;
|
|
85
|
-
declare function DropdownMenuShortcut({
|
|
86
|
-
className,
|
|
87
|
-
...props
|
|
88
|
-
}: React.ComponentProps<"span">): _$react_jsx_runtime0.JSX.Element;
|
|
27
|
+
}): React.JSX.Element;
|
|
28
|
+
declare function DropdownMenuSeparator({ className, ...props }: Menu.Separator.Props): React.JSX.Element;
|
|
29
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
89
30
|
//#endregion
|
|
90
31
|
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
//#region src/components/favicon-drop-zone.d.ts
|
|
3
|
+
/** Why `file` can't be a favicon, or `null` when it can. Mirrors the API's own checks. */
|
|
4
|
+
declare function validateFaviconFile(file: File): "Use a PNG, SVG, or ICO file." | "Favicon must be 500 KB or smaller." | null;
|
|
5
|
+
/**
|
|
6
|
+
* A large area to drop or browse for a favicon, which previews `previewUrl` in its center.
|
|
7
|
+
* It only picks the file: saving it is up to the caller.
|
|
8
|
+
*/
|
|
9
|
+
declare function FaviconDropZone({ previewUrl, prompt, disabled, onFileSelected, className }: {
|
|
10
|
+
previewUrl: string;
|
|
11
|
+
prompt: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
onFileSelected: (file: File) => void;
|
|
14
|
+
className?: string;
|
|
15
|
+
}): React.JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { FaviconDropZone, validateFaviconFile };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Upload } from "lucide-react";
|
|
5
|
+
|
|
6
|
+
//#region src/components/favicon-drop-zone.tsx
|
|
7
|
+
const FAVICON_MIME_TYPES = /* @__PURE__ */ new Set([
|
|
8
|
+
"image/png",
|
|
9
|
+
"image/svg+xml",
|
|
10
|
+
"image/x-icon",
|
|
11
|
+
"image/vnd.microsoft.icon"
|
|
12
|
+
]);
|
|
13
|
+
const FAVICON_ACCEPT = [...FAVICON_MIME_TYPES, ".ico"].join(",");
|
|
14
|
+
const FAVICON_MAX_BYTES = 512e3;
|
|
15
|
+
/** Why `file` can't be a favicon, or `null` when it can. Mirrors the API's own checks. */
|
|
16
|
+
function validateFaviconFile(file) {
|
|
17
|
+
if (!FAVICON_MIME_TYPES.has(file.type) && !file.name.toLowerCase().endsWith(".ico")) return "Use a PNG, SVG, or ICO file.";
|
|
18
|
+
if (file.size > FAVICON_MAX_BYTES) return "Favicon must be 500 KB or smaller.";
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A large area to drop or browse for a favicon, which previews `previewUrl` in its center.
|
|
23
|
+
* It only picks the file: saving it is up to the caller.
|
|
24
|
+
*/
|
|
25
|
+
function FaviconDropZone({ previewUrl, prompt, disabled, onFileSelected, className }) {
|
|
26
|
+
const fileInputRef = React.useRef(null);
|
|
27
|
+
const [isDragging, setIsDragging] = React.useState(false);
|
|
28
|
+
const dragCounter = React.useRef(0);
|
|
29
|
+
const select = (file) => {
|
|
30
|
+
if (file && !disabled) onFileSelected(file);
|
|
31
|
+
};
|
|
32
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
33
|
+
className: cn("relative", className),
|
|
34
|
+
onDragEnter: (event) => {
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
dragCounter.current++;
|
|
37
|
+
setIsDragging(true);
|
|
38
|
+
},
|
|
39
|
+
onDragLeave: (event) => {
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
dragCounter.current--;
|
|
42
|
+
if (dragCounter.current === 0) setIsDragging(false);
|
|
43
|
+
},
|
|
44
|
+
onDragOver: (event) => event.preventDefault(),
|
|
45
|
+
onDrop: (event) => {
|
|
46
|
+
event.preventDefault();
|
|
47
|
+
dragCounter.current = 0;
|
|
48
|
+
setIsDragging(false);
|
|
49
|
+
select(event.dataTransfer.files[0]);
|
|
50
|
+
},
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ jsx("input", {
|
|
53
|
+
ref: fileInputRef,
|
|
54
|
+
type: "file",
|
|
55
|
+
accept: FAVICON_ACCEPT,
|
|
56
|
+
className: "hidden",
|
|
57
|
+
onChange: (event) => {
|
|
58
|
+
select(event.target.files?.[0]);
|
|
59
|
+
event.target.value = "";
|
|
60
|
+
}
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ jsxs("button", {
|
|
63
|
+
type: "button",
|
|
64
|
+
disabled,
|
|
65
|
+
onClick: () => fileInputRef.current?.click(),
|
|
66
|
+
className: "hover:bg-accent/50 focus-visible:ring-ring/50 flex w-full flex-col items-center gap-5 rounded-xl border-2 border-dashed px-6 py-10 transition-colors outline-none focus-visible:ring-3 disabled:pointer-events-none disabled:opacity-50",
|
|
67
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
68
|
+
className: "bg-background flex size-20 items-center justify-center rounded-2xl border shadow-xs",
|
|
69
|
+
children: /* @__PURE__ */ jsx("img", {
|
|
70
|
+
src: previewUrl,
|
|
71
|
+
alt: "",
|
|
72
|
+
className: "size-12 object-contain"
|
|
73
|
+
})
|
|
74
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
75
|
+
className: "space-y-1 text-center",
|
|
76
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
77
|
+
className: "mx-auto block max-w-72 truncate text-sm font-medium",
|
|
78
|
+
children: prompt
|
|
79
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
80
|
+
className: "text-muted-foreground block text-xs",
|
|
81
|
+
children: "PNG, SVG, or ICO up to 500 KB. Square images work best."
|
|
82
|
+
})]
|
|
83
|
+
})]
|
|
84
|
+
}),
|
|
85
|
+
isDragging && /* @__PURE__ */ jsxs("div", {
|
|
86
|
+
className: "bg-background border-primary pointer-events-none absolute inset-0 flex flex-col items-center justify-center gap-2 rounded-xl border-3 border-dashed",
|
|
87
|
+
children: [/* @__PURE__ */ jsx(Upload, { className: "text-primary size-8" }), /* @__PURE__ */ jsx("p", {
|
|
88
|
+
className: "text-sm font-medium",
|
|
89
|
+
children: "Drop to use as favicon"
|
|
90
|
+
})]
|
|
91
|
+
})
|
|
92
|
+
]
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
//#endregion
|
|
97
|
+
export { FaviconDropZone, validateFaviconFile };
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
-
|
|
3
1
|
//#region src/components/floating-toolbar.d.ts
|
|
4
|
-
declare function FloatingToolbar({
|
|
5
|
-
className,
|
|
6
|
-
...props
|
|
7
|
-
}: React.ComponentProps<"menu">): _$react_jsx_runtime0.JSX.Element;
|
|
2
|
+
declare function FloatingToolbar({ className, ...props }: React.ComponentProps<"menu">): import("react").JSX.Element;
|
|
8
3
|
//#endregion
|
|
9
4
|
export { FloatingToolbar };
|
|
@@ -1,45 +1,20 @@
|
|
|
1
1
|
import { Button } from "./button.js";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
-
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
6
|
-
|
|
7
4
|
//#region src/components/input-group.d.ts
|
|
8
|
-
declare function InputGroup({
|
|
9
|
-
className,
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<"div">): _$react_jsx_runtime0.JSX.Element;
|
|
5
|
+
declare function InputGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
6
|
declare const inputGroupAddonVariants: (props?: ({
|
|
13
7
|
align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
|
|
14
|
-
} &
|
|
15
|
-
declare function InputGroupAddon({
|
|
16
|
-
className,
|
|
17
|
-
align,
|
|
18
|
-
...props
|
|
19
|
-
}: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): _$react_jsx_runtime0.JSX.Element;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): React.JSX.Element;
|
|
20
10
|
declare const inputGroupButtonVariants: (props?: ({
|
|
21
11
|
size?: "sm" | "xs" | "icon-xs" | "icon-sm" | null | undefined;
|
|
22
|
-
} &
|
|
23
|
-
declare function InputGroupButton({
|
|
24
|
-
className,
|
|
25
|
-
type,
|
|
26
|
-
variant,
|
|
27
|
-
size,
|
|
28
|
-
...props
|
|
29
|
-
}: Omit<React.ComponentProps<typeof Button>, "size" | "type"> & VariantProps<typeof inputGroupButtonVariants> & {
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
|
+
declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React.ComponentProps<typeof Button>, "size" | "type"> & VariantProps<typeof inputGroupButtonVariants> & {
|
|
30
14
|
type?: "button" | "submit" | "reset";
|
|
31
|
-
}):
|
|
32
|
-
declare function InputGroupText({
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}: React.ComponentProps<"span">): _$react_jsx_runtime0.JSX.Element;
|
|
36
|
-
declare function InputGroupInput({
|
|
37
|
-
className,
|
|
38
|
-
...props
|
|
39
|
-
}: React.ComponentProps<"input">): _$react_jsx_runtime0.JSX.Element;
|
|
40
|
-
declare function InputGroupTextarea({
|
|
41
|
-
className,
|
|
42
|
-
...props
|
|
43
|
-
}: React.ComponentProps<"textarea">): _$react_jsx_runtime0.JSX.Element;
|
|
15
|
+
}): React.JSX.Element;
|
|
16
|
+
declare function InputGroupText({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
17
|
+
declare function InputGroupInput({ className, ...props }: React.ComponentProps<"input">): React.JSX.Element;
|
|
18
|
+
declare function InputGroupTextarea({ className, ...props }: React.ComponentProps<"textarea">): React.JSX.Element;
|
|
44
19
|
//#endregion
|
|
45
20
|
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
1
|
import { cn } from "../lib/utils.js";
|
|
4
2
|
import { Button } from "./button.js";
|
|
5
3
|
import { Input } from "./input.js";
|
|
6
4
|
import { Textarea } from "./textarea.js";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
6
|
import "react";
|
|
8
7
|
import { cva } from "class-variance-authority";
|
|
9
|
-
import { jsx } from "react/jsx-runtime";
|
|
10
8
|
|
|
11
9
|
//#region src/components/input-group.tsx
|
|
12
10
|
function InputGroup({ className, ...props }) {
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
-
|
|
4
2
|
//#region src/components/input.d.ts
|
|
5
|
-
declare function Input({
|
|
6
|
-
className,
|
|
7
|
-
type,
|
|
8
|
-
...props
|
|
9
|
-
}: React.ComponentProps<"input">): _$react_jsx_runtime0.JSX.Element;
|
|
3
|
+
declare function Input({ className, type, ...props }: React.ComponentProps<"input">): React.JSX.Element;
|
|
10
4
|
//#endregion
|
|
11
5
|
export { Input };
|
package/dist/components/input.js
CHANGED
package/dist/components/kbd.d.ts
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
-
|
|
3
1
|
//#region src/components/kbd.d.ts
|
|
4
|
-
declare function Kbd({
|
|
5
|
-
|
|
6
|
-
...props
|
|
7
|
-
}: React.ComponentProps<"kbd">): _$react_jsx_runtime0.JSX.Element;
|
|
8
|
-
declare function KbdGroup({
|
|
9
|
-
className,
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<"div">): _$react_jsx_runtime0.JSX.Element;
|
|
2
|
+
declare function Kbd({ className, ...props }: React.ComponentProps<"kbd">): import("react").JSX.Element;
|
|
3
|
+
declare function KbdGroup({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
|
12
4
|
//#endregion
|
|
13
5
|
export { Kbd, KbdGroup };
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
-
|
|
4
2
|
//#region src/components/label.d.ts
|
|
5
|
-
declare function Label({
|
|
6
|
-
className,
|
|
7
|
-
...props
|
|
8
|
-
}: React.ComponentProps<"label">): _$react_jsx_runtime0.JSX.Element;
|
|
3
|
+
declare function Label({ className, ...props }: React.ComponentProps<"label">): React.JSX.Element;
|
|
9
4
|
//#endregion
|
|
10
5
|
export { Label };
|
package/dist/components/label.js
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Button } from "./button.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { MessageScroller as MessageScroller$1, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility } from "@shadcn/react/message-scroller";
|
|
4
|
+
//#region src/components/message-scroller.d.ts
|
|
5
|
+
declare function MessageScrollerProvider(props: React.ComponentProps<typeof MessageScroller$1.Provider>): React.JSX.Element;
|
|
6
|
+
declare function MessageScroller({ className, ...props }: React.ComponentProps<typeof MessageScroller$1.Root>): React.JSX.Element;
|
|
7
|
+
declare function MessageScrollerViewport({ className, ...props }: React.ComponentProps<typeof MessageScroller$1.Viewport>): React.JSX.Element;
|
|
8
|
+
declare function MessageScrollerContent({ className, ...props }: React.ComponentProps<typeof MessageScroller$1.Content>): React.JSX.Element;
|
|
9
|
+
declare function MessageScrollerItem({ className, scrollAnchor, ...props }: React.ComponentProps<typeof MessageScroller$1.Item>): React.JSX.Element;
|
|
10
|
+
declare function MessageScrollerButton({ direction, className, children, render, variant, size, ...props }: React.ComponentProps<typeof MessageScroller$1.Button> & Pick<React.ComponentProps<typeof Button>, "variant" | "size">): React.JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { Button } from "./button.js";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import "react";
|
|
5
|
+
import { ArrowDownIcon } from "lucide-react";
|
|
6
|
+
import { MessageScroller as MessageScroller$1, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility } from "@shadcn/react/message-scroller";
|
|
7
|
+
|
|
8
|
+
//#region src/components/message-scroller.tsx
|
|
9
|
+
function MessageScrollerProvider(props) {
|
|
10
|
+
return /* @__PURE__ */ jsx(MessageScroller$1.Provider, { ...props });
|
|
11
|
+
}
|
|
12
|
+
function MessageScroller({ className, ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx(MessageScroller$1.Root, {
|
|
14
|
+
"data-slot": "message-scroller",
|
|
15
|
+
className: cn("group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden", className),
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function MessageScrollerViewport({ className, ...props }) {
|
|
20
|
+
return /* @__PURE__ */ jsx(MessageScroller$1.Viewport, {
|
|
21
|
+
"data-slot": "message-scroller-viewport",
|
|
22
|
+
className: cn("size-full min-h-0 min-w-0 scroll-fade-b scrollbar-thin scrollbar-gutter-stable overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent data-pending-scroll:invisible", className),
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function MessageScrollerContent({ className, ...props }) {
|
|
27
|
+
return /* @__PURE__ */ jsx(MessageScroller$1.Content, {
|
|
28
|
+
"data-slot": "message-scroller-content",
|
|
29
|
+
className: cn("flex h-max min-h-full flex-col gap-8", className),
|
|
30
|
+
...props
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function MessageScrollerItem({ className, scrollAnchor = false, ...props }) {
|
|
34
|
+
return /* @__PURE__ */ jsx(MessageScroller$1.Item, {
|
|
35
|
+
"data-slot": "message-scroller-item",
|
|
36
|
+
scrollAnchor,
|
|
37
|
+
className: cn("min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]", className),
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function MessageScrollerButton({ direction = "end", className, children, render, variant = "secondary", size = "icon-sm", ...props }) {
|
|
42
|
+
return /* @__PURE__ */ jsx(MessageScroller$1.Button, {
|
|
43
|
+
"data-slot": "message-scroller-button",
|
|
44
|
+
"data-direction": direction,
|
|
45
|
+
"data-variant": variant,
|
|
46
|
+
"data-size": size,
|
|
47
|
+
direction,
|
|
48
|
+
className: cn("absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180", className),
|
|
49
|
+
render: render ?? /* @__PURE__ */ jsx(Button, {
|
|
50
|
+
variant,
|
|
51
|
+
size
|
|
52
|
+
}),
|
|
53
|
+
...props,
|
|
54
|
+
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ArrowDownIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
55
|
+
className: "sr-only",
|
|
56
|
+
children: direction === "end" ? "Scroll to end" : "Scroll to start"
|
|
57
|
+
})] })
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
//#endregion
|
|
62
|
+
export { MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
//#region src/components/message.d.ts
|
|
3
|
+
declare function MessageGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
4
|
+
declare function Message({ className, align, ...props }: React.ComponentProps<"div"> & {
|
|
5
|
+
align?: "start" | "end";
|
|
6
|
+
}): React.JSX.Element;
|
|
7
|
+
declare function MessageAvatar({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
8
|
+
declare function MessageContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
|
+
declare function MessageHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
10
|
+
declare function MessageFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Message, MessageAvatar, MessageContent, MessageFooter, MessageGroup, MessageHeader };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/message.tsx
|
|
6
|
+
function MessageGroup({ className, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx("div", {
|
|
8
|
+
"data-slot": "message-group",
|
|
9
|
+
className: cn("flex min-w-0 flex-col gap-2", className),
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function Message({ className, align = "start", ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx("div", {
|
|
15
|
+
"data-slot": "message",
|
|
16
|
+
"data-align": align,
|
|
17
|
+
className: cn("group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse", className),
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function MessageAvatar({ className, ...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsx("div", {
|
|
23
|
+
"data-slot": "message-avatar",
|
|
24
|
+
className: cn("flex w-fit min-w-8 shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted group-has-data-[slot=message-footer]/message:-translate-y-8", className),
|
|
25
|
+
...props
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function MessageContent({ className, ...props }) {
|
|
29
|
+
return /* @__PURE__ */ jsx("div", {
|
|
30
|
+
"data-slot": "message-content",
|
|
31
|
+
className: cn("flex w-full min-w-0 flex-col gap-2.5 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end", className),
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function MessageHeader({ className, ...props }) {
|
|
36
|
+
return /* @__PURE__ */ jsx("div", {
|
|
37
|
+
"data-slot": "message-header",
|
|
38
|
+
className: cn("flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0", className),
|
|
39
|
+
...props
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function MessageFooter({ className, ...props }) {
|
|
43
|
+
return /* @__PURE__ */ jsx("div", {
|
|
44
|
+
"data-slot": "message-footer",
|
|
45
|
+
className: cn("flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0 group-data-[align=end]/message:justify-end", className),
|
|
46
|
+
...props
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
export { Message, MessageAvatar, MessageContent, MessageFooter, MessageGroup, MessageHeader };
|