tokka-ui 0.1.0 → 0.2.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.
Files changed (157) hide show
  1. package/dist/accordion.d.ts +9 -0
  2. package/dist/accordion.js +51 -0
  3. package/dist/alert-dialog.d.ts +23 -0
  4. package/dist/alert-dialog.js +122 -0
  5. package/dist/alert.d.ts +11 -0
  6. package/dist/alert.js +55 -0
  7. package/dist/aspect-ratio.d.ts +6 -0
  8. package/dist/aspect-ratio.js +6 -0
  9. package/dist/avatar.d.ts +8 -0
  10. package/dist/avatar.js +46 -0
  11. package/dist/badge.d.ts +13 -0
  12. package/dist/badge.js +31 -0
  13. package/dist/breadcrumb.d.ts +22 -0
  14. package/dist/breadcrumb.js +97 -0
  15. package/dist/button.d.ts +1 -1
  16. package/dist/button.js +4 -51
  17. package/dist/calendar.d.ts +11 -0
  18. package/dist/calendar.js +8 -0
  19. package/dist/carousel.d.ts +23 -0
  20. package/dist/carousel.js +200 -0
  21. package/dist/chart.d.ts +1 -0
  22. package/dist/chart.js +2 -0
  23. package/dist/checkbox.d.ts +6 -0
  24. package/dist/checkbox.js +31 -0
  25. package/dist/chunk-63HUTNB3.js +92 -0
  26. package/dist/chunk-7BHODGBN.js +25 -0
  27. package/dist/chunk-A4HW2TQU.js +66 -0
  28. package/dist/chunk-BOKKBA25.js +30 -0
  29. package/dist/chunk-DVPPDIDA.js +57 -0
  30. package/dist/chunk-FJGEWLIV.js +109 -0
  31. package/dist/chunk-KDTBFEE2.js +123 -0
  32. package/dist/chunk-PLLTYLGO.js +120 -0
  33. package/dist/chunk-QBAV4RWS.js +43 -0
  34. package/dist/collapsible.d.ts +8 -0
  35. package/dist/collapsible.js +10 -0
  36. package/dist/combobox.d.ts +6 -0
  37. package/dist/combobox.js +32 -0
  38. package/dist/command.d.ts +85 -0
  39. package/dist/command.js +24 -0
  40. package/dist/context-menu.d.ts +30 -0
  41. package/dist/context-menu.js +157 -0
  42. package/dist/data-table.d.ts +2 -0
  43. package/dist/data-table.js +21 -0
  44. package/dist/date-picker.d.ts +6 -0
  45. package/dist/date-picker.js +16 -0
  46. package/dist/dialog.d.ts +22 -0
  47. package/dist/dialog.js +25 -0
  48. package/dist/drawer.d.ts +27 -0
  49. package/dist/drawer.js +105 -0
  50. package/dist/dropdown-menu.d.ts +30 -0
  51. package/dist/dropdown-menu.js +155 -0
  52. package/dist/form.d.ts +28 -0
  53. package/dist/form.js +120 -0
  54. package/dist/hover-card.d.ts +8 -0
  55. package/dist/hover-card.js +29 -0
  56. package/dist/input-otp.d.ts +37 -0
  57. package/dist/input-otp.js +53 -0
  58. package/dist/label.d.ts +8 -0
  59. package/dist/label.js +7 -0
  60. package/dist/menubar.d.ts +31 -0
  61. package/dist/menubar.js +186 -0
  62. package/dist/native-select.d.ts +7 -0
  63. package/dist/native-select.js +31 -0
  64. package/dist/navigation-menu.d.ts +15 -0
  65. package/dist/navigation-menu.js +111 -0
  66. package/dist/pagination.d.ts +33 -0
  67. package/dist/pagination.js +111 -0
  68. package/dist/popover.d.ts +8 -0
  69. package/dist/popover.js +11 -0
  70. package/dist/progress.d.ts +6 -0
  71. package/dist/progress.js +30 -0
  72. package/dist/radio-group.d.ts +7 -0
  73. package/dist/radio-group.js +39 -0
  74. package/dist/resizable.d.ts +27 -0
  75. package/dist/resizable.js +42 -0
  76. package/dist/scroll-area.d.ts +7 -0
  77. package/dist/scroll-area.js +42 -0
  78. package/dist/select.d.ts +15 -0
  79. package/dist/select.js +128 -0
  80. package/dist/separator.d.ts +6 -0
  81. package/dist/separator.js +28 -0
  82. package/dist/sheet.d.ts +29 -0
  83. package/dist/sheet.js +25 -0
  84. package/dist/sidebar.d.ts +30 -0
  85. package/dist/sidebar.js +203 -0
  86. package/dist/skeleton.d.ts +5 -0
  87. package/dist/skeleton.js +21 -0
  88. package/dist/slider.d.ts +6 -0
  89. package/dist/slider.js +27 -0
  90. package/dist/sonner.d.ts +7 -0
  91. package/dist/sonner.js +23 -0
  92. package/dist/spinner.d.ts +12 -0
  93. package/dist/spinner.js +29 -0
  94. package/dist/switch.d.ts +6 -0
  95. package/dist/switch.js +31 -0
  96. package/dist/table.d.ts +12 -0
  97. package/dist/table.js +21 -0
  98. package/dist/tabs.d.ts +9 -0
  99. package/dist/tabs.js +51 -0
  100. package/dist/textarea.d.ts +7 -0
  101. package/dist/textarea.js +26 -0
  102. package/dist/toggle-group.d.ts +15 -0
  103. package/dist/toggle-group.js +49 -0
  104. package/dist/toggle.d.ts +15 -0
  105. package/dist/toggle.js +9 -0
  106. package/dist/tooltip.d.ts +9 -0
  107. package/dist/tooltip.js +30 -0
  108. package/package.json +237 -8
  109. package/src/accordion.tsx +55 -0
  110. package/src/alert-dialog.tsx +138 -0
  111. package/src/alert.tsx +58 -0
  112. package/src/aspect-ratio.tsx +5 -0
  113. package/src/avatar.tsx +47 -0
  114. package/src/badge.tsx +35 -0
  115. package/src/breadcrumb.tsx +114 -0
  116. package/src/calendar.tsx +63 -0
  117. package/src/carousel.tsx +259 -0
  118. package/src/chart.tsx +9 -0
  119. package/src/checkbox.tsx +27 -0
  120. package/src/collapsible.tsx +9 -0
  121. package/src/combobox.tsx +8 -0
  122. package/src/command.tsx +152 -0
  123. package/src/context-menu.tsx +197 -0
  124. package/src/data-table.tsx +9 -0
  125. package/src/date-picker.tsx +8 -0
  126. package/src/dialog.tsx +119 -0
  127. package/src/drawer.tsx +115 -0
  128. package/src/dropdown-menu.tsx +197 -0
  129. package/src/form.tsx +175 -0
  130. package/src/hover-card.tsx +26 -0
  131. package/src/input-otp.tsx +68 -0
  132. package/src/label.tsx +23 -0
  133. package/src/menubar.tsx +233 -0
  134. package/src/native-select.tsx +29 -0
  135. package/src/navigation-menu.tsx +127 -0
  136. package/src/pagination.tsx +116 -0
  137. package/src/popover.tsx +28 -0
  138. package/src/progress.tsx +25 -0
  139. package/src/radio-group.tsx +41 -0
  140. package/src/resizable.tsx +42 -0
  141. package/src/scroll-area.tsx +45 -0
  142. package/src/select.tsx +157 -0
  143. package/src/separator.tsx +28 -0
  144. package/src/sheet.tsx +137 -0
  145. package/src/sidebar.tsx +249 -0
  146. package/src/skeleton.tsx +15 -0
  147. package/src/slider.tsx +25 -0
  148. package/src/sonner.tsx +25 -0
  149. package/src/spinner.tsx +33 -0
  150. package/src/switch.tsx +26 -0
  151. package/src/table.tsx +116 -0
  152. package/src/tabs.tsx +52 -0
  153. package/src/textarea.tsx +23 -0
  154. package/src/toggle-group.tsx +58 -0
  155. package/src/toggle.tsx +42 -0
  156. package/src/tooltip.tsx +27 -0
  157. package/LICENSE +0 -21
@@ -0,0 +1,6 @@
1
+ export { Calendar, CalendarProps } from './calendar.js';
2
+ export { Popover, PopoverContent, PopoverTrigger } from './popover.js';
3
+ import 'react/jsx-runtime';
4
+ import 'react';
5
+ import 'react-day-picker';
6
+ import '@radix-ui/react-popover';
@@ -0,0 +1,16 @@
1
+ import {
2
+ Calendar
3
+ } from "./chunk-A4HW2TQU.js";
4
+ import {
5
+ Popover,
6
+ PopoverContent,
7
+ PopoverTrigger
8
+ } from "./chunk-BOKKBA25.js";
9
+ import "./chunk-DVPPDIDA.js";
10
+ import "./chunk-RQHJBTEU.js";
11
+ export {
12
+ Calendar,
13
+ Popover,
14
+ PopoverContent,
15
+ PopoverTrigger
16
+ };
@@ -0,0 +1,22 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
4
+
5
+ declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
6
+ declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
8
+ declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
9
+ declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
10
+ declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
+ declare const DialogHeader: {
12
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
13
+ displayName: string;
14
+ };
15
+ declare const DialogFooter: {
16
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
17
+ displayName: string;
18
+ };
19
+ declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
20
+ declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
21
+
22
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
package/dist/dialog.js ADDED
@@ -0,0 +1,25 @@
1
+ import {
2
+ Dialog,
3
+ DialogClose,
4
+ DialogContent,
5
+ DialogDescription,
6
+ DialogFooter,
7
+ DialogHeader,
8
+ DialogOverlay,
9
+ DialogPortal,
10
+ DialogTitle,
11
+ DialogTrigger
12
+ } from "./chunk-FJGEWLIV.js";
13
+ import "./chunk-RQHJBTEU.js";
14
+ export {
15
+ Dialog,
16
+ DialogClose,
17
+ DialogContent,
18
+ DialogDescription,
19
+ DialogFooter,
20
+ DialogHeader,
21
+ DialogOverlay,
22
+ DialogPortal,
23
+ DialogTitle,
24
+ DialogTrigger
25
+ };
@@ -0,0 +1,27 @@
1
+ import * as vaul from 'vaul';
2
+ import { Drawer as Drawer$1 } from 'vaul';
3
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
4
+ import * as react_jsx_runtime from 'react/jsx-runtime';
5
+ import * as React from 'react';
6
+
7
+ declare const Drawer: {
8
+ ({ shouldScaleBackground, ...props }: React.ComponentProps<typeof Drawer$1.Root>): react_jsx_runtime.JSX.Element;
9
+ displayName: string;
10
+ };
11
+ declare const DrawerTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
12
+ declare const DrawerPortal: typeof vaul.Portal;
13
+ declare const DrawerClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
14
+ declare const DrawerOverlay: React.ForwardRefExoticComponent<Omit<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
15
+ declare const DrawerContent: React.ForwardRefExoticComponent<Omit<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
16
+ declare const DrawerHeader: {
17
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
18
+ displayName: string;
19
+ };
20
+ declare const DrawerFooter: {
21
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
22
+ displayName: string;
23
+ };
24
+ declare const DrawerTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
25
+ declare const DrawerDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
26
+
27
+ export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };
package/dist/drawer.js ADDED
@@ -0,0 +1,105 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-RQHJBTEU.js";
4
+
5
+ // src/drawer.tsx
6
+ import * as React from "react";
7
+ import { Drawer as DrawerPrimitive } from "vaul";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ var Drawer = ({
10
+ shouldScaleBackground = true,
11
+ ...props
12
+ }) => /* @__PURE__ */ jsx(
13
+ DrawerPrimitive.Root,
14
+ {
15
+ shouldScaleBackground,
16
+ ...props
17
+ }
18
+ );
19
+ Drawer.displayName = "Drawer";
20
+ var DrawerTrigger = DrawerPrimitive.Trigger;
21
+ var DrawerPortal = DrawerPrimitive.Portal;
22
+ var DrawerClose = DrawerPrimitive.Close;
23
+ var DrawerOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
24
+ DrawerPrimitive.Overlay,
25
+ {
26
+ ref,
27
+ className: cn("fixed inset-0 z-50 bg-black/80", className),
28
+ ...props
29
+ }
30
+ ));
31
+ DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
32
+ var DrawerContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DrawerPortal, { children: [
33
+ /* @__PURE__ */ jsx(DrawerOverlay, {}),
34
+ /* @__PURE__ */ jsxs(
35
+ DrawerPrimitive.Content,
36
+ {
37
+ ref,
38
+ className: cn(
39
+ "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
40
+ className
41
+ ),
42
+ ...props,
43
+ children: [
44
+ /* @__PURE__ */ jsx("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }),
45
+ children
46
+ ]
47
+ }
48
+ )
49
+ ] }));
50
+ DrawerContent.displayName = "DrawerContent";
51
+ var DrawerHeader = ({
52
+ className,
53
+ ...props
54
+ }) => /* @__PURE__ */ jsx(
55
+ "div",
56
+ {
57
+ className: cn("grid gap-1.5 p-4 text-center sm:text-left", className),
58
+ ...props
59
+ }
60
+ );
61
+ DrawerHeader.displayName = "DrawerHeader";
62
+ var DrawerFooter = ({
63
+ className,
64
+ ...props
65
+ }) => /* @__PURE__ */ jsx(
66
+ "div",
67
+ {
68
+ className: cn("mt-auto flex flex-col gap-2 p-4", className),
69
+ ...props
70
+ }
71
+ );
72
+ DrawerFooter.displayName = "DrawerFooter";
73
+ var DrawerTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
74
+ DrawerPrimitive.Title,
75
+ {
76
+ ref,
77
+ className: cn(
78
+ "text-lg font-semibold leading-none tracking-tight",
79
+ className
80
+ ),
81
+ ...props
82
+ }
83
+ ));
84
+ DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
85
+ var DrawerDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
86
+ DrawerPrimitive.Description,
87
+ {
88
+ ref,
89
+ className: cn("text-sm text-muted-foreground", className),
90
+ ...props
91
+ }
92
+ ));
93
+ DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
94
+ export {
95
+ Drawer,
96
+ DrawerClose,
97
+ DrawerContent,
98
+ DrawerDescription,
99
+ DrawerFooter,
100
+ DrawerHeader,
101
+ DrawerOverlay,
102
+ DrawerPortal,
103
+ DrawerTitle,
104
+ DrawerTrigger
105
+ };
@@ -0,0 +1,30 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
4
+
5
+ declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
6
+ declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
8
+ declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
9
+ declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
10
+ declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
11
+ declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
12
+ inset?: boolean;
13
+ } & React.RefAttributes<HTMLDivElement>>;
14
+ declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
15
+ declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
16
+ declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
17
+ inset?: boolean;
18
+ } & React.RefAttributes<HTMLDivElement>>;
19
+ declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
20
+ declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
21
+ declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
22
+ inset?: boolean;
23
+ } & React.RefAttributes<HTMLDivElement>>;
24
+ declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
25
+ declare const DropdownMenuShortcut: {
26
+ ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): react_jsx_runtime.JSX.Element;
27
+ displayName: string;
28
+ };
29
+
30
+ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
@@ -0,0 +1,155 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-RQHJBTEU.js";
4
+
5
+ // src/dropdown-menu.tsx
6
+ import * as React from "react";
7
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
8
+ import { Check, ChevronRight, Circle } from "lucide-react";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
+ var DropdownMenu = DropdownMenuPrimitive.Root;
11
+ var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
12
+ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
13
+ var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
14
+ var DropdownMenuSub = DropdownMenuPrimitive.Sub;
15
+ var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
16
+ var DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
17
+ DropdownMenuPrimitive.SubTrigger,
18
+ {
19
+ ref,
20
+ className: cn(
21
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
22
+ inset && "pl-8",
23
+ className
24
+ ),
25
+ ...props,
26
+ children: [
27
+ children,
28
+ /* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto size-4" })
29
+ ]
30
+ }
31
+ ));
32
+ DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
33
+ var DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
34
+ DropdownMenuPrimitive.SubContent,
35
+ {
36
+ ref,
37
+ className: cn(
38
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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",
39
+ className
40
+ ),
41
+ ...props
42
+ }
43
+ ));
44
+ DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
45
+ var DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
46
+ DropdownMenuPrimitive.Content,
47
+ {
48
+ ref,
49
+ sideOffset,
50
+ className: cn(
51
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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",
52
+ className
53
+ ),
54
+ ...props
55
+ }
56
+ ) }));
57
+ DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
58
+ var DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
59
+ DropdownMenuPrimitive.Item,
60
+ {
61
+ ref,
62
+ className: cn(
63
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
64
+ inset && "pl-8",
65
+ className
66
+ ),
67
+ ...props
68
+ }
69
+ ));
70
+ DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
71
+ var DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
72
+ DropdownMenuPrimitive.CheckboxItem,
73
+ {
74
+ ref,
75
+ className: cn(
76
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
77
+ className
78
+ ),
79
+ checked,
80
+ ...props,
81
+ children: [
82
+ /* @__PURE__ */ jsx("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "size-4" }) }) }),
83
+ children
84
+ ]
85
+ }
86
+ ));
87
+ DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
88
+ var DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
89
+ DropdownMenuPrimitive.RadioItem,
90
+ {
91
+ ref,
92
+ className: cn(
93
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
94
+ className
95
+ ),
96
+ ...props,
97
+ children: [
98
+ /* @__PURE__ */ jsx("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Circle, { className: "size-2 fill-current" }) }) }),
99
+ children
100
+ ]
101
+ }
102
+ ));
103
+ DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
104
+ var DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
105
+ DropdownMenuPrimitive.Label,
106
+ {
107
+ ref,
108
+ className: cn(
109
+ "px-2 py-1.5 text-sm font-semibold",
110
+ inset && "pl-8",
111
+ className
112
+ ),
113
+ ...props
114
+ }
115
+ ));
116
+ DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
117
+ var DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
118
+ DropdownMenuPrimitive.Separator,
119
+ {
120
+ ref,
121
+ className: cn("-mx-1 my-1 h-px bg-muted", className),
122
+ ...props
123
+ }
124
+ ));
125
+ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
126
+ var DropdownMenuShortcut = ({
127
+ className,
128
+ ...props
129
+ }) => {
130
+ return /* @__PURE__ */ jsx(
131
+ "span",
132
+ {
133
+ className: cn("ml-auto text-xs tracking-widest opacity-60", className),
134
+ ...props
135
+ }
136
+ );
137
+ };
138
+ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
139
+ export {
140
+ DropdownMenu,
141
+ DropdownMenuCheckboxItem,
142
+ DropdownMenuContent,
143
+ DropdownMenuGroup,
144
+ DropdownMenuItem,
145
+ DropdownMenuLabel,
146
+ DropdownMenuPortal,
147
+ DropdownMenuRadioGroup,
148
+ DropdownMenuRadioItem,
149
+ DropdownMenuSeparator,
150
+ DropdownMenuShortcut,
151
+ DropdownMenuSub,
152
+ DropdownMenuSubContent,
153
+ DropdownMenuSubTrigger,
154
+ DropdownMenuTrigger
155
+ };
package/dist/form.d.ts ADDED
@@ -0,0 +1,28 @@
1
+ import * as _radix_ui_react_slot from '@radix-ui/react-slot';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import * as react_hook_form from 'react-hook-form';
4
+ import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
5
+ import * as React from 'react';
6
+ import * as LabelPrimitive from '@radix-ui/react-label';
7
+
8
+ declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
9
+ declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
10
+ declare const useFormField: () => {
11
+ invalid: boolean;
12
+ isDirty: boolean;
13
+ isTouched: boolean;
14
+ isValidating: boolean;
15
+ error?: react_hook_form.FieldError;
16
+ id: string;
17
+ name: string;
18
+ formItemId: string;
19
+ formDescriptionId: string;
20
+ formMessageId: string;
21
+ };
22
+ declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
23
+ declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
24
+ declare const FormControl: React.ForwardRefExoticComponent<Omit<_radix_ui_react_slot.SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
25
+ declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
26
+ declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
27
+
28
+ export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };
package/dist/form.js ADDED
@@ -0,0 +1,120 @@
1
+ import {
2
+ Label
3
+ } from "./chunk-7BHODGBN.js";
4
+ import {
5
+ cn
6
+ } from "./chunk-RQHJBTEU.js";
7
+
8
+ // src/form.tsx
9
+ import * as React from "react";
10
+ import "@radix-ui/react-label";
11
+ import { Slot } from "@radix-ui/react-slot";
12
+ import {
13
+ Controller,
14
+ FormProvider,
15
+ useFormContext
16
+ } from "react-hook-form";
17
+ import { jsx } from "react/jsx-runtime";
18
+ var Form = FormProvider;
19
+ var FormFieldContext = React.createContext(
20
+ {}
21
+ );
22
+ var FormField = ({
23
+ ...props
24
+ }) => {
25
+ return /* @__PURE__ */ jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx(Controller, { ...props }) });
26
+ };
27
+ var useFormField = () => {
28
+ const fieldContext = React.useContext(FormFieldContext);
29
+ const itemContext = React.useContext(FormItemContext);
30
+ const { getFieldState, formState } = useFormContext();
31
+ const fieldState = getFieldState(fieldContext.name, formState);
32
+ if (!fieldContext) {
33
+ throw new Error("useFormField should be used within <FormField>");
34
+ }
35
+ const { id } = itemContext;
36
+ return {
37
+ id,
38
+ name: fieldContext.name,
39
+ formItemId: `${id}-form-item`,
40
+ formDescriptionId: `${id}-form-item-description`,
41
+ formMessageId: `${id}-form-item-message`,
42
+ ...fieldState
43
+ };
44
+ };
45
+ var FormItemContext = React.createContext(
46
+ {}
47
+ );
48
+ var FormItem = React.forwardRef(({ className, ...props }, ref) => {
49
+ const id = React.useId();
50
+ return /* @__PURE__ */ jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx("div", { ref, className: cn("space-y-2", className), ...props }) });
51
+ });
52
+ FormItem.displayName = "FormItem";
53
+ var FormLabel = React.forwardRef(({ className, ...props }, ref) => {
54
+ const { error, formItemId } = useFormField();
55
+ return /* @__PURE__ */ jsx(
56
+ Label,
57
+ {
58
+ ref,
59
+ className: cn(error && "text-destructive", className),
60
+ htmlFor: formItemId,
61
+ ...props
62
+ }
63
+ );
64
+ });
65
+ FormLabel.displayName = "FormLabel";
66
+ var FormControl = React.forwardRef(({ ...props }, ref) => {
67
+ const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
68
+ return /* @__PURE__ */ jsx(
69
+ Slot,
70
+ {
71
+ ref,
72
+ id: formItemId,
73
+ "aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
74
+ "aria-invalid": !!error,
75
+ ...props
76
+ }
77
+ );
78
+ });
79
+ FormControl.displayName = "FormControl";
80
+ var FormDescription = React.forwardRef(({ className, ...props }, ref) => {
81
+ const { formDescriptionId } = useFormField();
82
+ return /* @__PURE__ */ jsx(
83
+ "p",
84
+ {
85
+ ref,
86
+ id: formDescriptionId,
87
+ className: cn("text-sm text-muted-foreground", className),
88
+ ...props
89
+ }
90
+ );
91
+ });
92
+ FormDescription.displayName = "FormDescription";
93
+ var FormMessage = React.forwardRef(({ className, children, ...props }, ref) => {
94
+ const { error, formMessageId } = useFormField();
95
+ const body = error ? String(error?.message) : children;
96
+ if (!body) {
97
+ return null;
98
+ }
99
+ return /* @__PURE__ */ jsx(
100
+ "p",
101
+ {
102
+ ref,
103
+ id: formMessageId,
104
+ className: cn("text-sm font-medium text-destructive", className),
105
+ ...props,
106
+ children: body
107
+ }
108
+ );
109
+ });
110
+ FormMessage.displayName = "FormMessage";
111
+ export {
112
+ Form,
113
+ FormControl,
114
+ FormDescription,
115
+ FormField,
116
+ FormItem,
117
+ FormLabel,
118
+ FormMessage,
119
+ useFormField
120
+ };
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
3
+
4
+ declare const HoverCard: React.FC<HoverCardPrimitive.HoverCardProps>;
5
+ declare const HoverCardTrigger: React.ForwardRefExoticComponent<HoverCardPrimitive.HoverCardTriggerProps & React.RefAttributes<HTMLAnchorElement>>;
6
+ declare const HoverCardContent: React.ForwardRefExoticComponent<Omit<HoverCardPrimitive.HoverCardContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
+
8
+ export { HoverCard, HoverCardContent, HoverCardTrigger };
@@ -0,0 +1,29 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-RQHJBTEU.js";
4
+
5
+ // src/hover-card.tsx
6
+ import * as React from "react";
7
+ import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
8
+ import { jsx } from "react/jsx-runtime";
9
+ var HoverCard = HoverCardPrimitive.Root;
10
+ var HoverCardTrigger = HoverCardPrimitive.Trigger;
11
+ var HoverCardContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(
12
+ HoverCardPrimitive.Content,
13
+ {
14
+ ref,
15
+ align,
16
+ sideOffset,
17
+ className: cn(
18
+ "z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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",
19
+ className
20
+ ),
21
+ ...props
22
+ }
23
+ ));
24
+ HoverCardContent.displayName = HoverCardPrimitive.Content.displayName;
25
+ export {
26
+ HoverCard,
27
+ HoverCardContent,
28
+ HoverCardTrigger
29
+ };
@@ -0,0 +1,37 @@
1
+ import * as input_otp from 'input-otp';
2
+ import * as React from 'react';
3
+
4
+ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
5
+ value?: string;
6
+ onChange?: (newValue: string) => unknown;
7
+ maxLength: number;
8
+ textAlign?: "left" | "center" | "right";
9
+ onComplete?: (...args: any[]) => unknown;
10
+ pushPasswordManagerStrategy?: "increase-width" | "none";
11
+ pasteTransformer?: (pasted: string) => string;
12
+ containerClassName?: string;
13
+ noScriptCSSFallback?: string | null;
14
+ } & {
15
+ render: (props: input_otp.RenderProps) => React.ReactNode;
16
+ children?: never;
17
+ } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
18
+ value?: string;
19
+ onChange?: (newValue: string) => unknown;
20
+ maxLength: number;
21
+ textAlign?: "left" | "center" | "right";
22
+ onComplete?: (...args: any[]) => unknown;
23
+ pushPasswordManagerStrategy?: "increase-width" | "none";
24
+ pasteTransformer?: (pasted: string) => string;
25
+ containerClassName?: string;
26
+ noScriptCSSFallback?: string | null;
27
+ } & {
28
+ render?: never;
29
+ children: React.ReactNode;
30
+ } & React.RefAttributes<HTMLInputElement>, "ref">) & React.RefAttributes<HTMLInputElement>>;
31
+ declare const InputOTPGroup: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
32
+ declare const InputOTPSlot: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
33
+ index: number;
34
+ } & React.RefAttributes<HTMLDivElement>>;
35
+ declare const InputOTPSeparator: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
36
+
37
+ export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };