@camox/ui 0.36.0 → 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.
Files changed (86) hide show
  1. package/dist/components/alert-dialog.d.ts +58 -0
  2. package/dist/components/alert-dialog.js +96 -0
  3. package/dist/components/alert.d.ts +28 -0
  4. package/dist/components/alert.js +45 -0
  5. package/dist/components/avatar.d.ts +34 -0
  6. package/dist/components/avatar.js +52 -0
  7. package/dist/components/badge.d.ts +19 -0
  8. package/dist/components/badge.js +44 -0
  9. package/dist/components/button-group.d.ts +28 -0
  10. package/dist/components/button-group.js +43 -0
  11. package/dist/components/button.d.ts +18 -0
  12. package/dist/components/button.js +46 -0
  13. package/dist/components/command.d.ts +58 -0
  14. package/dist/components/command.js +89 -0
  15. package/dist/components/dialog.d.ts +53 -0
  16. package/dist/components/dialog.js +93 -0
  17. package/dist/components/dropdown-menu.d.ts +90 -0
  18. package/dist/components/dropdown-menu.js +138 -0
  19. package/dist/components/floating-toolbar.d.ts +9 -0
  20. package/dist/components/floating-toolbar.js +15 -0
  21. package/dist/components/input-group.d.ts +45 -0
  22. package/dist/components/input-group.js +82 -0
  23. package/dist/components/input.d.ts +11 -0
  24. package/dist/components/input.js +17 -0
  25. package/dist/components/kbd.d.ts +13 -0
  26. package/dist/components/kbd.js +21 -0
  27. package/dist/components/label.d.ts +10 -0
  28. package/dist/components/label.js +15 -0
  29. package/dist/components/panel.d.ts +50 -0
  30. package/dist/components/panel.js +56 -0
  31. package/dist/components/popover.d.ts +34 -0
  32. package/dist/components/popover.js +57 -0
  33. package/dist/components/select.d.ts +55 -0
  34. package/dist/components/select.js +99 -0
  35. package/dist/components/separator.d.ts +11 -0
  36. package/dist/components/separator.js +16 -0
  37. package/dist/components/sheet.d.ts +46 -0
  38. package/dist/components/sheet.js +93 -0
  39. package/dist/components/skeleton.d.ts +9 -0
  40. package/dist/components/skeleton.js +14 -0
  41. package/dist/components/spinner.d.ts +9 -0
  42. package/dist/components/spinner.js +16 -0
  43. package/dist/components/switch.d.ts +13 -0
  44. package/dist/components/switch.js +20 -0
  45. package/dist/components/tabs.d.ts +29 -0
  46. package/dist/components/tabs.js +46 -0
  47. package/dist/components/textarea.d.ts +10 -0
  48. package/dist/components/textarea.js +15 -0
  49. package/dist/components/toaster.d.ts +11 -0
  50. package/dist/components/toaster.js +21 -0
  51. package/dist/components/toggle.d.ts +18 -0
  52. package/dist/components/toggle.js +37 -0
  53. package/dist/components/tooltip.d.ts +25 -0
  54. package/dist/components/tooltip.js +42 -0
  55. package/dist/lib/utils.d.ts +10 -0
  56. package/dist/lib/utils.js +14 -0
  57. package/package.json +61 -58
  58. package/src/components/alert-dialog.tsx +0 -160
  59. package/src/components/alert.tsx +0 -73
  60. package/src/components/avatar.tsx +0 -91
  61. package/src/components/badge.tsx +0 -56
  62. package/src/components/button-group.tsx +0 -78
  63. package/src/components/button.tsx +0 -58
  64. package/src/components/command.tsx +0 -176
  65. package/src/components/dialog.tsx +0 -135
  66. package/src/components/dropdown-menu.tsx +0 -256
  67. package/src/components/floating-toolbar.tsx +0 -17
  68. package/src/components/input-group.tsx +0 -146
  69. package/src/components/input.tsx +0 -20
  70. package/src/components/kbd.tsx +0 -26
  71. package/src/components/label.tsx +0 -18
  72. package/src/components/panel.tsx +0 -109
  73. package/src/components/popover.tsx +0 -80
  74. package/src/components/select.tsx +0 -188
  75. package/src/components/separator.tsx +0 -20
  76. package/src/components/sheet.tsx +0 -127
  77. package/src/components/skeleton.tsx +0 -13
  78. package/src/components/spinner.tsx +0 -16
  79. package/src/components/switch.tsx +0 -30
  80. package/src/components/tabs.tsx +0 -73
  81. package/src/components/textarea.tsx +0 -18
  82. package/src/components/toaster.tsx +0 -24
  83. package/src/components/toggle.tsx +0 -43
  84. package/src/components/tooltip.tsx +0 -52
  85. package/src/lib/utils.ts +0 -15
  86. package/src/styles/globals.css +0 -144
@@ -0,0 +1,89 @@
1
+ import { cn } from "../lib/utils.js";
2
+ import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "./dialog.js";
3
+ import { InputGroup, InputGroupAddon } from "./input-group.js";
4
+ import "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { Command as Command$1 } from "cmdk";
7
+ import { CheckIcon, SearchIcon } from "lucide-react";
8
+
9
+ //#region src/components/command.tsx
10
+ function Command({ className, ...props }) {
11
+ return /* @__PURE__ */ jsx(Command$1, {
12
+ "data-slot": "command",
13
+ className: cn("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground", className),
14
+ ...props
15
+ });
16
+ }
17
+ function CommandDialog({ title = "Command Palette", description = "Search for a command to run...", children, className, showCloseButton = false, ...props }) {
18
+ return /* @__PURE__ */ jsxs(Dialog, {
19
+ ...props,
20
+ children: [/* @__PURE__ */ jsxs(DialogHeader, {
21
+ className: "sr-only",
22
+ children: [/* @__PURE__ */ jsx(DialogTitle, { children: title }), /* @__PURE__ */ jsx(DialogDescription, { children: description })]
23
+ }), /* @__PURE__ */ jsx(DialogContent, {
24
+ className: cn("top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0", className),
25
+ showCloseButton,
26
+ children
27
+ })]
28
+ });
29
+ }
30
+ function CommandInput({ className, ...props }) {
31
+ return /* @__PURE__ */ jsx("div", {
32
+ "data-slot": "command-input-wrapper",
33
+ className: "p-1 pb-0",
34
+ children: /* @__PURE__ */ jsxs(InputGroup, {
35
+ className: "border-input/30 bg-input/30 h-8! rounded-lg! shadow-none! *:data-[slot=input-group-addon]:pl-2!",
36
+ children: [/* @__PURE__ */ jsx(Command$1.Input, {
37
+ "data-slot": "command-input",
38
+ className: cn("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", className),
39
+ ...props
40
+ }), /* @__PURE__ */ jsx(InputGroupAddon, { children: /* @__PURE__ */ jsx(SearchIcon, { className: "size-4 shrink-0 opacity-50" }) })]
41
+ })
42
+ });
43
+ }
44
+ function CommandList({ className, ...props }) {
45
+ return /* @__PURE__ */ jsx(Command$1.List, {
46
+ "data-slot": "command-list",
47
+ className: cn("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none", className),
48
+ ...props
49
+ });
50
+ }
51
+ function CommandEmpty({ className, ...props }) {
52
+ return /* @__PURE__ */ jsx(Command$1.Empty, {
53
+ "data-slot": "command-empty",
54
+ className: cn("py-6 text-center text-sm", className),
55
+ ...props
56
+ });
57
+ }
58
+ function CommandGroup({ className, ...props }) {
59
+ return /* @__PURE__ */ jsx(Command$1.Group, {
60
+ "data-slot": "command-group",
61
+ className: cn("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground", className),
62
+ ...props
63
+ });
64
+ }
65
+ function CommandSeparator({ className, ...props }) {
66
+ return /* @__PURE__ */ jsx(Command$1.Separator, {
67
+ "data-slot": "command-separator",
68
+ className: cn("-mx-1 h-px w-auto bg-border", className),
69
+ ...props
70
+ });
71
+ }
72
+ function CommandItem({ className, children, hideCheck, ...props }) {
73
+ return /* @__PURE__ */ jsxs(Command$1.Item, {
74
+ "data-slot": "command-item",
75
+ className: cn("group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
76
+ ...props,
77
+ children: [children, !hideCheck && /* @__PURE__ */ jsx(CheckIcon, { className: "ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" })]
78
+ });
79
+ }
80
+ function CommandShortcut({ className, ...props }) {
81
+ return /* @__PURE__ */ jsx("span", {
82
+ "data-slot": "command-shortcut",
83
+ className: cn("ml-auto text-xs text-muted-foreground group-data-selected/command-item:text-foreground *:data-[slot=kbd]:bg-transparent *:data-[slot=kbd]:p-0 *:data-[slot=kbd]:min-w-0", className),
84
+ ...props
85
+ });
86
+ }
87
+
88
+ //#endregion
89
+ export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
@@ -0,0 +1,53 @@
1
+ import * as React from "react";
2
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
+ import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
4
+
5
+ //#region src/components/dialog.d.ts
6
+ declare function Dialog({
7
+ ...props
8
+ }: Dialog$1.Root.Props): _$react_jsx_runtime0.JSX.Element;
9
+ declare function DialogTrigger({
10
+ ...props
11
+ }: Dialog$1.Trigger.Props): _$react_jsx_runtime0.JSX.Element;
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 & {
29
+ showCloseButton?: boolean;
30
+ forceOverlay?: boolean;
31
+ }): _$react_jsx_runtime0.JSX.Element;
32
+ declare function DialogHeader({
33
+ className,
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"> & {
42
+ showCloseButton?: boolean;
43
+ }): _$react_jsx_runtime0.JSX.Element;
44
+ declare function DialogTitle({
45
+ className,
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;
52
+ //#endregion
53
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
@@ -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 as Dialog$1 } from "@base-ui/react/dialog";
7
+
8
+ //#region src/components/dialog.tsx
9
+ function Dialog({ ...props }) {
10
+ return /* @__PURE__ */ jsx(Dialog$1.Root, {
11
+ "data-slot": "dialog",
12
+ ...props
13
+ });
14
+ }
15
+ function DialogTrigger({ ...props }) {
16
+ return /* @__PURE__ */ jsx(Dialog$1.Trigger, {
17
+ "data-slot": "dialog-trigger",
18
+ ...props
19
+ });
20
+ }
21
+ function DialogPortal({ ...props }) {
22
+ return /* @__PURE__ */ jsx(Dialog$1.Portal, {
23
+ "data-slot": "dialog-portal",
24
+ ...props
25
+ });
26
+ }
27
+ function DialogClose({ ...props }) {
28
+ return /* @__PURE__ */ jsx(Dialog$1.Close, {
29
+ "data-slot": "dialog-close",
30
+ ...props
31
+ });
32
+ }
33
+ function DialogOverlay({ className, ...props }) {
34
+ return /* @__PURE__ */ jsx(Dialog$1.Backdrop, {
35
+ "data-slot": "dialog-overlay",
36
+ className: cn("fixed inset-0 isolate z-50 bg-black/66 duration-100 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className),
37
+ ...props
38
+ });
39
+ }
40
+ function DialogContent({ className, children, showCloseButton = true, forceOverlay = false, ...props }) {
41
+ return /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogOverlay, { forceRender: forceOverlay || void 0 }), /* @__PURE__ */ jsxs(Dialog$1.Popup, {
42
+ "data-slot": "dialog-content",
43
+ className: cn("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-md 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: [children, showCloseButton && /* @__PURE__ */ jsxs(Dialog$1.Close, {
46
+ "data-slot": "dialog-close",
47
+ render: /* @__PURE__ */ jsx(Button, {
48
+ variant: "ghost",
49
+ className: "absolute top-4 right-4",
50
+ size: "icon-sm"
51
+ }),
52
+ children: [/* @__PURE__ */ jsx(XIcon, {}), /* @__PURE__ */ jsx("span", {
53
+ className: "sr-only",
54
+ children: "Close"
55
+ })]
56
+ })]
57
+ })] });
58
+ }
59
+ function DialogHeader({ className, ...props }) {
60
+ return /* @__PURE__ */ jsx("div", {
61
+ "data-slot": "dialog-header",
62
+ className: cn("flex flex-col gap-2", className),
63
+ ...props
64
+ });
65
+ }
66
+ function DialogFooter({ className, showCloseButton = false, children, ...props }) {
67
+ return /* @__PURE__ */ jsxs("div", {
68
+ "data-slot": "dialog-footer",
69
+ className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
70
+ ...props,
71
+ children: [children, showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, {
72
+ render: /* @__PURE__ */ jsx(Button, { variant: "outline" }),
73
+ children: "Close"
74
+ })]
75
+ });
76
+ }
77
+ function DialogTitle({ className, ...props }) {
78
+ return /* @__PURE__ */ jsx(Dialog$1.Title, {
79
+ "data-slot": "dialog-title",
80
+ className: cn("leading-none font-medium", className),
81
+ ...props
82
+ });
83
+ }
84
+ function DialogDescription({ className, ...props }) {
85
+ return /* @__PURE__ */ jsx(Dialog$1.Description, {
86
+ "data-slot": "dialog-description",
87
+ className: cn("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className),
88
+ ...props
89
+ });
90
+ }
91
+
92
+ //#endregion
93
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
@@ -0,0 +1,90 @@
1
+ import * as React from "react";
2
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
+ import { Menu } from "@base-ui/react/menu";
4
+
5
+ //#region src/components/dropdown-menu.d.ts
6
+ declare function DropdownMenu({
7
+ ...props
8
+ }: Menu.Root.Props): _$react_jsx_runtime0.JSX.Element;
9
+ declare function DropdownMenuPortal({
10
+ ...props
11
+ }: Menu.Portal.Props): _$react_jsx_runtime0.JSX.Element;
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 & {
31
+ inset?: boolean;
32
+ }): _$react_jsx_runtime0.JSX.Element;
33
+ declare function DropdownMenuItem({
34
+ className,
35
+ inset,
36
+ variant,
37
+ ...props
38
+ }: Menu.Item.Props & {
39
+ inset?: boolean;
40
+ variant?: "default" | "destructive";
41
+ }): _$react_jsx_runtime0.JSX.Element;
42
+ declare function DropdownMenuSub({
43
+ ...props
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 & {
51
+ inset?: boolean;
52
+ }): _$react_jsx_runtime0.JSX.Element;
53
+ declare function DropdownMenuSubContent({
54
+ align,
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 & {
68
+ inset?: boolean;
69
+ }): _$react_jsx_runtime0.JSX.Element;
70
+ declare function DropdownMenuRadioGroup({
71
+ ...props
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 & {
79
+ inset?: boolean;
80
+ }): _$react_jsx_runtime0.JSX.Element;
81
+ declare function DropdownMenuSeparator({
82
+ className,
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;
89
+ //#endregion
90
+ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
@@ -0,0 +1,138 @@
1
+ import { cn } from "../lib/utils.js";
2
+ import "react";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { CheckIcon, ChevronRightIcon } from "lucide-react";
5
+ import { Menu } from "@base-ui/react/menu";
6
+
7
+ //#region src/components/dropdown-menu.tsx
8
+ function DropdownMenu({ ...props }) {
9
+ return /* @__PURE__ */ jsx(Menu.Root, {
10
+ "data-slot": "dropdown-menu",
11
+ ...props
12
+ });
13
+ }
14
+ function DropdownMenuPortal({ ...props }) {
15
+ return /* @__PURE__ */ jsx(Menu.Portal, {
16
+ "data-slot": "dropdown-menu-portal",
17
+ ...props
18
+ });
19
+ }
20
+ function DropdownMenuTrigger({ ...props }) {
21
+ return /* @__PURE__ */ jsx(Menu.Trigger, {
22
+ "data-slot": "dropdown-menu-trigger",
23
+ ...props
24
+ });
25
+ }
26
+ function DropdownMenuContent({ align = "start", alignOffset = 0, side = "bottom", sideOffset = 4, className, ...props }) {
27
+ return /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, {
28
+ className: "isolate z-50 outline-none",
29
+ align,
30
+ alignOffset,
31
+ side,
32
+ sideOffset,
33
+ children: /* @__PURE__ */ jsx(Menu.Popup, {
34
+ "data-slot": "dropdown-menu-content",
35
+ className: cn("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md 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),
36
+ ...props
37
+ })
38
+ }) });
39
+ }
40
+ function DropdownMenuGroup({ ...props }) {
41
+ return /* @__PURE__ */ jsx(Menu.Group, {
42
+ "data-slot": "dropdown-menu-group",
43
+ ...props
44
+ });
45
+ }
46
+ function DropdownMenuLabel({ className, inset, ...props }) {
47
+ return /* @__PURE__ */ jsx(Menu.GroupLabel, {
48
+ "data-slot": "dropdown-menu-label",
49
+ "data-inset": inset,
50
+ className: cn("px-2 py-1.5 text-xs font-medium text-muted-foreground data-inset:pl-8", className),
51
+ ...props
52
+ });
53
+ }
54
+ function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
55
+ return /* @__PURE__ */ jsx(Menu.Item, {
56
+ "data-slot": "dropdown-menu-item",
57
+ "data-inset": inset,
58
+ "data-variant": variant,
59
+ className: cn("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive", className),
60
+ ...props
61
+ });
62
+ }
63
+ function DropdownMenuSub({ ...props }) {
64
+ return /* @__PURE__ */ jsx(Menu.SubmenuRoot, {
65
+ "data-slot": "dropdown-menu-sub",
66
+ ...props
67
+ });
68
+ }
69
+ function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
70
+ return /* @__PURE__ */ jsxs(Menu.SubmenuTrigger, {
71
+ "data-slot": "dropdown-menu-sub-trigger",
72
+ "data-inset": inset,
73
+ className: cn("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
74
+ ...props,
75
+ children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto" })]
76
+ });
77
+ }
78
+ function DropdownMenuSubContent({ align = "start", alignOffset = -3, side = "right", sideOffset = 0, className, ...props }) {
79
+ return /* @__PURE__ */ jsx(DropdownMenuContent, {
80
+ "data-slot": "dropdown-menu-sub-content",
81
+ className: cn("w-auto min-w-[96px] rounded-md 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),
82
+ align,
83
+ alignOffset,
84
+ side,
85
+ sideOffset,
86
+ ...props
87
+ });
88
+ }
89
+ function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }) {
90
+ return /* @__PURE__ */ jsxs(Menu.CheckboxItem, {
91
+ "data-slot": "dropdown-menu-checkbox-item",
92
+ "data-inset": inset,
93
+ className: cn("relative flex 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 focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
94
+ checked,
95
+ ...props,
96
+ children: [/* @__PURE__ */ jsx("span", {
97
+ className: "pointer-events-none absolute right-2 flex items-center justify-center",
98
+ "data-slot": "dropdown-menu-checkbox-item-indicator",
99
+ children: /* @__PURE__ */ jsx(Menu.CheckboxItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
100
+ }), children]
101
+ });
102
+ }
103
+ function DropdownMenuRadioGroup({ ...props }) {
104
+ return /* @__PURE__ */ jsx(Menu.RadioGroup, {
105
+ "data-slot": "dropdown-menu-radio-group",
106
+ ...props
107
+ });
108
+ }
109
+ function DropdownMenuRadioItem({ className, children, inset, ...props }) {
110
+ return /* @__PURE__ */ jsxs(Menu.RadioItem, {
111
+ "data-slot": "dropdown-menu-radio-item",
112
+ "data-inset": inset,
113
+ className: cn("relative flex 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 focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
114
+ ...props,
115
+ children: [/* @__PURE__ */ jsx("span", {
116
+ className: "pointer-events-none absolute right-2 flex items-center justify-center",
117
+ "data-slot": "dropdown-menu-radio-item-indicator",
118
+ children: /* @__PURE__ */ jsx(Menu.RadioItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
119
+ }), children]
120
+ });
121
+ }
122
+ function DropdownMenuSeparator({ className, ...props }) {
123
+ return /* @__PURE__ */ jsx(Menu.Separator, {
124
+ "data-slot": "dropdown-menu-separator",
125
+ className: cn("-mx-1 my-1 h-px bg-border", className),
126
+ ...props
127
+ });
128
+ }
129
+ function DropdownMenuShortcut({ className, ...props }) {
130
+ return /* @__PURE__ */ jsx("span", {
131
+ "data-slot": "dropdown-menu-shortcut",
132
+ className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground", className),
133
+ ...props
134
+ });
135
+ }
136
+
137
+ //#endregion
138
+ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
@@ -0,0 +1,9 @@
1
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
2
+
3
+ //#region src/components/floating-toolbar.d.ts
4
+ declare function FloatingToolbar({
5
+ className,
6
+ ...props
7
+ }: React.ComponentProps<"menu">): _$react_jsx_runtime0.JSX.Element;
8
+ //#endregion
9
+ export { FloatingToolbar };
@@ -0,0 +1,15 @@
1
+ import { cn } from "../lib/utils.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+
4
+ //#region src/components/floating-toolbar.tsx
5
+ function FloatingToolbar({ className, ...props }) {
6
+ return /* @__PURE__ */ jsx("menu", {
7
+ role: "toolbar",
8
+ "data-slot": "floating-toolbar",
9
+ className: cn("absolute left-[50%] z-30 flex translate-x-[-50%] items-center rounded-xl border-1 bg-background p-2 shadow-2xl transition-all duration-200", className),
10
+ ...props
11
+ });
12
+ }
13
+
14
+ //#endregion
15
+ export { FloatingToolbar };
@@ -0,0 +1,45 @@
1
+ import { Button } from "./button.js";
2
+ import * as React from "react";
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
+ //#region src/components/input-group.d.ts
8
+ declare function InputGroup({
9
+ className,
10
+ ...props
11
+ }: React.ComponentProps<"div">): _$react_jsx_runtime0.JSX.Element;
12
+ declare const inputGroupAddonVariants: (props?: ({
13
+ align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
14
+ } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
15
+ declare function InputGroupAddon({
16
+ className,
17
+ align,
18
+ ...props
19
+ }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): _$react_jsx_runtime0.JSX.Element;
20
+ declare const inputGroupButtonVariants: (props?: ({
21
+ size?: "sm" | "xs" | "icon-xs" | "icon-sm" | null | undefined;
22
+ } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
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> & {
30
+ type?: "button" | "submit" | "reset";
31
+ }): _$react_jsx_runtime0.JSX.Element;
32
+ declare function InputGroupText({
33
+ className,
34
+ ...props
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;
44
+ //#endregion
45
+ export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
@@ -0,0 +1,82 @@
1
+ "use client";
2
+
3
+ import { cn } from "../lib/utils.js";
4
+ import { Button } from "./button.js";
5
+ import { Input } from "./input.js";
6
+ import { Textarea } from "./textarea.js";
7
+ import "react";
8
+ import { cva } from "class-variance-authority";
9
+ import { jsx } from "react/jsx-runtime";
10
+
11
+ //#region src/components/input-group.tsx
12
+ function InputGroup({ className, ...props }) {
13
+ return /* @__PURE__ */ jsx("div", {
14
+ "data-slot": "input-group",
15
+ role: "group",
16
+ className: cn("group/input-group relative flex h-9 w-full min-w-0 items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5", className),
17
+ ...props
18
+ });
19
+ }
20
+ const inputGroupAddonVariants = cva("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4", {
21
+ variants: { align: {
22
+ "inline-start": "order-first pl-2 has-[>button]:-ml-1 has-[>kbd]:ml-[-0.15rem]",
23
+ "inline-end": "order-last pr-2 has-[>button]:-mr-1 has-[>kbd]:mr-[-0.15rem]",
24
+ "block-start": "order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
25
+ "block-end": "order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"
26
+ } },
27
+ defaultVariants: { align: "inline-start" }
28
+ });
29
+ function InputGroupAddon({ className, align = "inline-start", ...props }) {
30
+ return /* @__PURE__ */ jsx("div", {
31
+ role: "group",
32
+ "data-slot": "input-group-addon",
33
+ "data-align": align,
34
+ className: cn(inputGroupAddonVariants({ align }), className),
35
+ onClick: (e) => {
36
+ if (e.target.closest("button")) return;
37
+ e.currentTarget.parentElement?.querySelector("input")?.focus();
38
+ },
39
+ ...props
40
+ });
41
+ }
42
+ const inputGroupButtonVariants = cva("flex items-center gap-2 text-sm shadow-none", {
43
+ variants: { size: {
44
+ xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
45
+ sm: "",
46
+ "icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
47
+ "icon-sm": "size-8 p-0 has-[>svg]:p-0"
48
+ } },
49
+ defaultVariants: { size: "xs" }
50
+ });
51
+ function InputGroupButton({ className, type = "button", variant = "ghost", size = "xs", ...props }) {
52
+ return /* @__PURE__ */ jsx(Button, {
53
+ type,
54
+ "data-size": size,
55
+ variant,
56
+ className: cn(inputGroupButtonVariants({ size }), className),
57
+ ...props
58
+ });
59
+ }
60
+ function InputGroupText({ className, ...props }) {
61
+ return /* @__PURE__ */ jsx("span", {
62
+ className: cn("flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className),
63
+ ...props
64
+ });
65
+ }
66
+ function InputGroupInput({ className, ...props }) {
67
+ return /* @__PURE__ */ jsx(Input, {
68
+ "data-slot": "input-group-control",
69
+ className: cn("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent", className),
70
+ ...props
71
+ });
72
+ }
73
+ function InputGroupTextarea({ className, ...props }) {
74
+ return /* @__PURE__ */ jsx(Textarea, {
75
+ "data-slot": "input-group-control",
76
+ className: cn("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent", className),
77
+ ...props
78
+ });
79
+ }
80
+
81
+ //#endregion
82
+ export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
+
4
+ //#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;
10
+ //#endregion
11
+ export { Input };
@@ -0,0 +1,17 @@
1
+ import { cn } from "../lib/utils.js";
2
+ import "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { Input as Input$1 } from "@base-ui/react/input";
5
+
6
+ //#region src/components/input.tsx
7
+ function Input({ className, type, ...props }) {
8
+ return /* @__PURE__ */ jsx(Input$1, {
9
+ type,
10
+ "data-slot": "input",
11
+ className: cn("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className),
12
+ ...props
13
+ });
14
+ }
15
+
16
+ //#endregion
17
+ export { Input };
@@ -0,0 +1,13 @@
1
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
2
+
3
+ //#region src/components/kbd.d.ts
4
+ declare function Kbd({
5
+ className,
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;
12
+ //#endregion
13
+ export { Kbd, KbdGroup };