@0xchain/ui 1.1.0-beta.4 → 1.1.0-beta.43

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 (198) hide show
  1. package/LICENSE +21 -0
  2. package/dist/accordion.js +64 -0
  3. package/dist/alert-dialog.js +146 -0
  4. package/dist/{alert.mjs → alert.js} +26 -26
  5. package/dist/aspect-ratio.js +10 -0
  6. package/dist/avatar.js +53 -0
  7. package/dist/{badge.mjs → badge.js} +17 -16
  8. package/dist/breadcrumb.d.ts +2 -20
  9. package/dist/breadcrumb.js +103 -0
  10. package/dist/button.d.ts +2 -15
  11. package/dist/{button.mjs → button.js} +18 -17
  12. package/dist/calendar.d.ts +2 -23
  13. package/dist/calendar.js +186 -0
  14. package/dist/card.d.ts +2 -18
  15. package/dist/card.js +90 -0
  16. package/dist/carousel.d.ts +2 -42
  17. package/dist/carousel.js +198 -0
  18. package/dist/checkbox.d.ts +2 -7
  19. package/dist/{checkbox.mjs → checkbox.js} +16 -16
  20. package/dist/collapsible.d.ts +2 -10
  21. package/dist/collapsible.js +34 -0
  22. package/dist/command.d.ts +2 -31
  23. package/dist/command.js +170 -0
  24. package/dist/components/ui/accordion.d.ts +8 -0
  25. package/dist/components/ui/accordion.d.ts.map +1 -0
  26. package/dist/components/ui/alert-dialog.d.ts +15 -0
  27. package/dist/components/ui/alert-dialog.d.ts.map +1 -0
  28. package/dist/components/ui/alert.d.ts +10 -0
  29. package/dist/components/ui/alert.d.ts.map +1 -0
  30. package/dist/components/ui/aspect-ratio.d.ts +4 -0
  31. package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
  32. package/dist/components/ui/avatar.d.ts +7 -0
  33. package/dist/components/ui/avatar.d.ts.map +1 -0
  34. package/dist/components/ui/badge.d.ts +10 -0
  35. package/dist/components/ui/badge.d.ts.map +1 -0
  36. package/dist/components/ui/breadcrumb.d.ts +12 -0
  37. package/dist/components/ui/breadcrumb.d.ts.map +1 -0
  38. package/dist/components/ui/button.d.ts +11 -0
  39. package/dist/components/ui/button.d.ts.map +1 -0
  40. package/dist/components/ui/calendar.d.ts +9 -0
  41. package/dist/components/ui/calendar.d.ts.map +1 -0
  42. package/dist/components/ui/card.d.ts +10 -0
  43. package/dist/components/ui/card.d.ts.map +1 -0
  44. package/dist/components/ui/carousel.d.ts +20 -0
  45. package/dist/components/ui/carousel.d.ts.map +1 -0
  46. package/dist/components/ui/checkbox.d.ts +5 -0
  47. package/dist/components/ui/checkbox.d.ts.map +1 -0
  48. package/dist/components/ui/collapsible.d.ts +6 -0
  49. package/dist/components/ui/collapsible.d.ts.map +1 -0
  50. package/dist/components/ui/command.d.ts +19 -0
  51. package/dist/components/ui/command.d.ts.map +1 -0
  52. package/dist/components/ui/context-menu.d.ts +26 -0
  53. package/dist/components/ui/context-menu.d.ts.map +1 -0
  54. package/dist/components/ui/dialog.d.ts +16 -0
  55. package/dist/components/ui/dialog.d.ts.map +1 -0
  56. package/dist/components/ui/dropdown-menu.d.ts +26 -0
  57. package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
  58. package/dist/components/ui/hover-card.d.ts +7 -0
  59. package/dist/components/ui/hover-card.d.ts.map +1 -0
  60. package/dist/components/ui/input.d.ts +4 -0
  61. package/dist/components/ui/input.d.ts.map +1 -0
  62. package/dist/components/ui/label.d.ts +5 -0
  63. package/dist/components/ui/label.d.ts.map +1 -0
  64. package/dist/components/ui/menubar.d.ts +27 -0
  65. package/dist/components/ui/menubar.d.ts.map +1 -0
  66. package/dist/components/ui/navigation-menu.d.ts +15 -0
  67. package/dist/components/ui/navigation-menu.d.ts.map +1 -0
  68. package/dist/components/ui/pagination.d.ts +14 -0
  69. package/dist/components/ui/pagination.d.ts.map +1 -0
  70. package/dist/components/ui/popover.d.ts +8 -0
  71. package/dist/components/ui/popover.d.ts.map +1 -0
  72. package/dist/components/ui/progress.d.ts +5 -0
  73. package/dist/components/ui/progress.d.ts.map +1 -0
  74. package/dist/components/ui/radio-group.d.ts +6 -0
  75. package/dist/components/ui/radio-group.d.ts.map +1 -0
  76. package/dist/components/ui/resizable.d.ts +9 -0
  77. package/dist/components/ui/resizable.d.ts.map +1 -0
  78. package/dist/components/ui/scroll-area.d.ts +6 -0
  79. package/dist/components/ui/scroll-area.d.ts.map +1 -0
  80. package/dist/components/ui/select.d.ts +16 -0
  81. package/dist/components/ui/select.d.ts.map +1 -0
  82. package/dist/components/ui/separator.d.ts +5 -0
  83. package/dist/components/ui/separator.d.ts.map +1 -0
  84. package/dist/components/ui/sheet.d.ts +14 -0
  85. package/dist/components/ui/sheet.d.ts.map +1 -0
  86. package/dist/components/ui/skeleton.d.ts +3 -0
  87. package/dist/components/ui/skeleton.d.ts.map +1 -0
  88. package/dist/components/ui/slider.d.ts +5 -0
  89. package/dist/components/ui/slider.d.ts.map +1 -0
  90. package/dist/components/ui/sonner.d.ts +4 -0
  91. package/dist/components/ui/sonner.d.ts.map +1 -0
  92. package/dist/components/ui/switch.d.ts +5 -0
  93. package/dist/components/ui/switch.d.ts.map +1 -0
  94. package/dist/components/ui/table.d.ts +11 -0
  95. package/dist/components/ui/table.d.ts.map +1 -0
  96. package/dist/components/ui/tabs.d.ts +8 -0
  97. package/dist/components/ui/tabs.d.ts.map +1 -0
  98. package/dist/components/ui/textarea.d.ts +4 -0
  99. package/dist/components/ui/textarea.d.ts.map +1 -0
  100. package/dist/components/ui/toggle-group.d.ts +8 -0
  101. package/dist/components/ui/toggle-group.d.ts.map +1 -0
  102. package/dist/components/ui/toggle.d.ts +10 -0
  103. package/dist/components/ui/toggle.d.ts.map +1 -0
  104. package/dist/components/ui/tooltip.d.ts +8 -0
  105. package/dist/components/ui/tooltip.d.ts.map +1 -0
  106. package/dist/context-menu.d.ts +2 -42
  107. package/dist/context-menu.js +223 -0
  108. package/dist/dialog.d.ts +2 -27
  109. package/dist/dialog.js +136 -0
  110. package/dist/dropdown-menu.d.ts +2 -42
  111. package/dist/dropdown-menu.js +231 -0
  112. package/dist/form.d.ts +1 -38
  113. package/dist/form.js +116 -0
  114. package/dist/hover-card.d.ts +2 -11
  115. package/dist/hover-card.js +38 -0
  116. package/dist/index.d.ts +44 -0
  117. package/dist/index.d.ts.map +1 -0
  118. package/dist/input.d.ts +2 -6
  119. package/dist/{input.mjs → input.js} +9 -9
  120. package/dist/label.d.ts +2 -7
  121. package/dist/{label.mjs → label.js} +12 -12
  122. package/dist/lib/utils.d.ts +3 -0
  123. package/dist/lib/utils.d.ts.map +1 -0
  124. package/dist/menubar.d.ts +2 -44
  125. package/dist/menubar.js +251 -0
  126. package/dist/navigation-menu.d.ts +2 -26
  127. package/dist/{navigation-menu.mjs → navigation-menu.js} +89 -89
  128. package/dist/pagination.d.ts +2 -33
  129. package/dist/pagination.js +116 -0
  130. package/dist/popover.d.ts +2 -13
  131. package/dist/popover.js +44 -0
  132. package/dist/progress.d.ts +2 -7
  133. package/dist/progress.js +31 -0
  134. package/dist/radio-group.d.ts +2 -9
  135. package/dist/radio-group.js +45 -0
  136. package/dist/resizable.d.ts +2 -13
  137. package/dist/resizable.js +48 -0
  138. package/dist/scroll-area.d.ts +2 -9
  139. package/dist/scroll-area.js +60 -0
  140. package/dist/select.d.ts +2 -27
  141. package/dist/select.js +169 -0
  142. package/dist/separator.d.ts +2 -7
  143. package/dist/separator.js +26 -0
  144. package/dist/sheet.d.ts +2 -23
  145. package/dist/sheet.js +126 -0
  146. package/dist/skeleton.d.ts +2 -5
  147. package/dist/skeleton.js +15 -0
  148. package/dist/slider.d.ts +2 -7
  149. package/dist/{slider.mjs → slider.js} +33 -33
  150. package/dist/sonner.d.ts +2 -6
  151. package/dist/sonner.js +22 -0
  152. package/dist/switch.d.ts +2 -7
  153. package/dist/{switch.mjs → switch.js} +15 -15
  154. package/dist/table.d.ts +2 -20
  155. package/dist/table.js +114 -0
  156. package/dist/tabs.d.ts +2 -13
  157. package/dist/{tabs.mjs → tabs.js} +37 -37
  158. package/dist/textarea.d.ts +2 -6
  159. package/dist/{textarea.mjs → textarea.js} +8 -8
  160. package/dist/toggle-group.d.ts +2 -16
  161. package/dist/toggle-group.js +62 -0
  162. package/dist/toggle.d.ts +2 -14
  163. package/dist/{toggle.mjs → toggle.js} +16 -16
  164. package/dist/tooltip.d.ts +2 -13
  165. package/dist/tooltip.js +55 -0
  166. package/dist/utils-CzDCF-Ah.js +8 -0
  167. package/package.json +138 -89
  168. package/dist/accordion.mjs +0 -64
  169. package/dist/alert-dialog.mjs +0 -146
  170. package/dist/aspect-ratio.mjs +0 -10
  171. package/dist/avatar.mjs +0 -53
  172. package/dist/breadcrumb.mjs +0 -102
  173. package/dist/calendar.mjs +0 -173
  174. package/dist/card.mjs +0 -90
  175. package/dist/carousel.mjs +0 -177
  176. package/dist/collapsible.mjs +0 -34
  177. package/dist/command.mjs +0 -170
  178. package/dist/context-menu.mjs +0 -223
  179. package/dist/dialog.mjs +0 -136
  180. package/dist/dropdown-menu.mjs +0 -231
  181. package/dist/form.mjs +0 -101
  182. package/dist/hover-card.mjs +0 -38
  183. package/dist/menubar.mjs +0 -251
  184. package/dist/pagination.mjs +0 -116
  185. package/dist/popover.mjs +0 -44
  186. package/dist/progress.mjs +0 -31
  187. package/dist/radio-group.mjs +0 -45
  188. package/dist/resizable.mjs +0 -48
  189. package/dist/scroll-area.mjs +0 -60
  190. package/dist/select.mjs +0 -169
  191. package/dist/separator.mjs +0 -26
  192. package/dist/sheet.mjs +0 -126
  193. package/dist/skeleton.mjs +0 -15
  194. package/dist/sonner.mjs +0 -22
  195. package/dist/table.mjs +0 -114
  196. package/dist/toggle-group.mjs +0 -62
  197. package/dist/tooltip.mjs +0 -55
  198. package/dist/utils-B7J70Nno.js +0 -8
package/dist/dialog.js ADDED
@@ -0,0 +1,136 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
3
+ import { XIcon } from "lucide-react";
4
+ import { c as cn } from "./utils-CzDCF-Ah.js";
5
+ function Dialog({
6
+ ...props
7
+ }) {
8
+ return /* @__PURE__ */ jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
9
+ }
10
+ function DialogTrigger({
11
+ ...props
12
+ }) {
13
+ return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
14
+ }
15
+ function DialogPortal({
16
+ ...props
17
+ }) {
18
+ return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
19
+ }
20
+ function DialogClose({
21
+ ...props
22
+ }) {
23
+ return /* @__PURE__ */ jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
24
+ }
25
+ function DialogOverlay({
26
+ className,
27
+ ...props
28
+ }) {
29
+ return /* @__PURE__ */ jsx(
30
+ DialogPrimitive.Overlay,
31
+ {
32
+ "data-slot": "dialog-overlay",
33
+ className: cn(
34
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
35
+ className
36
+ ),
37
+ ...props
38
+ }
39
+ );
40
+ }
41
+ function DialogContent({
42
+ className,
43
+ children,
44
+ showCloseButton = true,
45
+ ...props
46
+ }) {
47
+ return /* @__PURE__ */ jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
48
+ /* @__PURE__ */ jsx(DialogOverlay, {}),
49
+ /* @__PURE__ */ jsxs(
50
+ DialogPrimitive.Content,
51
+ {
52
+ "data-slot": "dialog-content",
53
+ className: cn(
54
+ "bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
55
+ className
56
+ ),
57
+ ...props,
58
+ children: [
59
+ children,
60
+ showCloseButton && /* @__PURE__ */ jsxs(
61
+ DialogPrimitive.Close,
62
+ {
63
+ "data-slot": "dialog-close",
64
+ className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
65
+ children: [
66
+ /* @__PURE__ */ jsx(XIcon, {}),
67
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
68
+ ]
69
+ }
70
+ )
71
+ ]
72
+ }
73
+ )
74
+ ] });
75
+ }
76
+ function DialogHeader({ className, ...props }) {
77
+ return /* @__PURE__ */ jsx(
78
+ "div",
79
+ {
80
+ "data-slot": "dialog-header",
81
+ className: cn("flex flex-col gap-2 text-center sm:text-left", className),
82
+ ...props
83
+ }
84
+ );
85
+ }
86
+ function DialogFooter({ className, ...props }) {
87
+ return /* @__PURE__ */ jsx(
88
+ "div",
89
+ {
90
+ "data-slot": "dialog-footer",
91
+ className: cn(
92
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
93
+ className
94
+ ),
95
+ ...props
96
+ }
97
+ );
98
+ }
99
+ function DialogTitle({
100
+ className,
101
+ ...props
102
+ }) {
103
+ return /* @__PURE__ */ jsx(
104
+ DialogPrimitive.Title,
105
+ {
106
+ "data-slot": "dialog-title",
107
+ className: cn("text-lg leading-none font-semibold", className),
108
+ ...props
109
+ }
110
+ );
111
+ }
112
+ function DialogDescription({
113
+ className,
114
+ ...props
115
+ }) {
116
+ return /* @__PURE__ */ jsx(
117
+ DialogPrimitive.Description,
118
+ {
119
+ "data-slot": "dialog-description",
120
+ className: cn("text-muted-foreground text-sm", className),
121
+ ...props
122
+ }
123
+ );
124
+ }
125
+ export {
126
+ Dialog,
127
+ DialogClose,
128
+ DialogContent,
129
+ DialogDescription,
130
+ DialogFooter,
131
+ DialogHeader,
132
+ DialogOverlay,
133
+ DialogPortal,
134
+ DialogTitle,
135
+ DialogTrigger
136
+ };
@@ -1,42 +1,2 @@
1
- import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
2
- import { JSX } from 'react/jsx-runtime';
3
- import * as React_2 from 'react';
4
-
5
- export declare function DropdownMenu({ ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.Root>): JSX.Element;
6
-
7
- export declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): JSX.Element;
8
-
9
- export declare function DropdownMenuContent({ className, sideOffset, ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.Content>): JSX.Element;
10
-
11
- export declare function DropdownMenuGroup({ ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.Group>): JSX.Element;
12
-
13
- export declare function DropdownMenuItem({ className, inset, variant, ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
14
- inset?: boolean;
15
- variant?: "default" | "destructive";
16
- }): JSX.Element;
17
-
18
- export declare function DropdownMenuLabel({ className, inset, ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
19
- inset?: boolean;
20
- }): JSX.Element;
21
-
22
- export declare function DropdownMenuPortal({ ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.Portal>): JSX.Element;
23
-
24
- export declare function DropdownMenuRadioGroup({ ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): JSX.Element;
25
-
26
- export declare function DropdownMenuRadioItem({ className, children, ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): JSX.Element;
27
-
28
- export declare function DropdownMenuSeparator({ className, ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.Separator>): JSX.Element;
29
-
30
- export declare function DropdownMenuShortcut({ className, ...props }: React_2.ComponentProps<"span">): JSX.Element;
31
-
32
- export declare function DropdownMenuSub({ ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.Sub>): JSX.Element;
33
-
34
- export declare function DropdownMenuSubContent({ className, ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): JSX.Element;
35
-
36
- export declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
37
- inset?: boolean;
38
- }): JSX.Element;
39
-
40
- export declare function DropdownMenuTrigger({ ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): JSX.Element;
41
-
42
- export { }
1
+ export * from './components/ui/dropdown-menu'
2
+ export {}
@@ -0,0 +1,231 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
3
+ import { CheckIcon, CircleIcon, ChevronRightIcon } from "lucide-react";
4
+ import { c as cn } from "./utils-CzDCF-Ah.js";
5
+ function DropdownMenu({
6
+ ...props
7
+ }) {
8
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
9
+ }
10
+ function DropdownMenuPortal({
11
+ ...props
12
+ }) {
13
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
14
+ }
15
+ function DropdownMenuTrigger({
16
+ ...props
17
+ }) {
18
+ return /* @__PURE__ */ jsx(
19
+ DropdownMenuPrimitive.Trigger,
20
+ {
21
+ "data-slot": "dropdown-menu-trigger",
22
+ ...props
23
+ }
24
+ );
25
+ }
26
+ function DropdownMenuContent({
27
+ className,
28
+ sideOffset = 4,
29
+ ...props
30
+ }) {
31
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
32
+ DropdownMenuPrimitive.Content,
33
+ {
34
+ "data-slot": "dropdown-menu-content",
35
+ sideOffset,
36
+ className: cn(
37
+ "bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
38
+ className
39
+ ),
40
+ ...props
41
+ }
42
+ ) });
43
+ }
44
+ function DropdownMenuGroup({
45
+ ...props
46
+ }) {
47
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
48
+ }
49
+ function DropdownMenuItem({
50
+ className,
51
+ inset,
52
+ variant = "default",
53
+ ...props
54
+ }) {
55
+ return /* @__PURE__ */ jsx(
56
+ DropdownMenuPrimitive.Item,
57
+ {
58
+ "data-slot": "dropdown-menu-item",
59
+ "data-inset": inset,
60
+ "data-variant": variant,
61
+ className: cn(
62
+ "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
63
+ className
64
+ ),
65
+ ...props
66
+ }
67
+ );
68
+ }
69
+ function DropdownMenuCheckboxItem({
70
+ className,
71
+ children,
72
+ checked,
73
+ ...props
74
+ }) {
75
+ return /* @__PURE__ */ jsxs(
76
+ DropdownMenuPrimitive.CheckboxItem,
77
+ {
78
+ "data-slot": "dropdown-menu-checkbox-item",
79
+ className: cn(
80
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
81
+ className
82
+ ),
83
+ checked,
84
+ ...props,
85
+ children: [
86
+ /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
87
+ children
88
+ ]
89
+ }
90
+ );
91
+ }
92
+ function DropdownMenuRadioGroup({
93
+ ...props
94
+ }) {
95
+ return /* @__PURE__ */ jsx(
96
+ DropdownMenuPrimitive.RadioGroup,
97
+ {
98
+ "data-slot": "dropdown-menu-radio-group",
99
+ ...props
100
+ }
101
+ );
102
+ }
103
+ function DropdownMenuRadioItem({
104
+ className,
105
+ children,
106
+ ...props
107
+ }) {
108
+ return /* @__PURE__ */ jsxs(
109
+ DropdownMenuPrimitive.RadioItem,
110
+ {
111
+ "data-slot": "dropdown-menu-radio-item",
112
+ className: cn(
113
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
114
+ className
115
+ ),
116
+ ...props,
117
+ children: [
118
+ /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CircleIcon, { className: "size-2 fill-current" }) }) }),
119
+ children
120
+ ]
121
+ }
122
+ );
123
+ }
124
+ function DropdownMenuLabel({
125
+ className,
126
+ inset,
127
+ ...props
128
+ }) {
129
+ return /* @__PURE__ */ jsx(
130
+ DropdownMenuPrimitive.Label,
131
+ {
132
+ "data-slot": "dropdown-menu-label",
133
+ "data-inset": inset,
134
+ className: cn(
135
+ "px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
136
+ className
137
+ ),
138
+ ...props
139
+ }
140
+ );
141
+ }
142
+ function DropdownMenuSeparator({
143
+ className,
144
+ ...props
145
+ }) {
146
+ return /* @__PURE__ */ jsx(
147
+ DropdownMenuPrimitive.Separator,
148
+ {
149
+ "data-slot": "dropdown-menu-separator",
150
+ className: cn("bg-border -mx-1 my-1 h-px", className),
151
+ ...props
152
+ }
153
+ );
154
+ }
155
+ function DropdownMenuShortcut({
156
+ className,
157
+ ...props
158
+ }) {
159
+ return /* @__PURE__ */ jsx(
160
+ "span",
161
+ {
162
+ "data-slot": "dropdown-menu-shortcut",
163
+ className: cn(
164
+ "text-muted-foreground ml-auto text-xs tracking-widest",
165
+ className
166
+ ),
167
+ ...props
168
+ }
169
+ );
170
+ }
171
+ function DropdownMenuSub({
172
+ ...props
173
+ }) {
174
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
175
+ }
176
+ function DropdownMenuSubTrigger({
177
+ className,
178
+ inset,
179
+ children,
180
+ ...props
181
+ }) {
182
+ return /* @__PURE__ */ jsxs(
183
+ DropdownMenuPrimitive.SubTrigger,
184
+ {
185
+ "data-slot": "dropdown-menu-sub-trigger",
186
+ "data-inset": inset,
187
+ className: cn(
188
+ "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",
189
+ className
190
+ ),
191
+ ...props,
192
+ children: [
193
+ children,
194
+ /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto size-4" })
195
+ ]
196
+ }
197
+ );
198
+ }
199
+ function DropdownMenuSubContent({
200
+ className,
201
+ ...props
202
+ }) {
203
+ return /* @__PURE__ */ jsx(
204
+ DropdownMenuPrimitive.SubContent,
205
+ {
206
+ "data-slot": "dropdown-menu-sub-content",
207
+ className: cn(
208
+ "bg-popover text-popover-foreground 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 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
209
+ className
210
+ ),
211
+ ...props
212
+ }
213
+ );
214
+ }
215
+ export {
216
+ DropdownMenu,
217
+ DropdownMenuCheckboxItem,
218
+ DropdownMenuContent,
219
+ DropdownMenuGroup,
220
+ DropdownMenuItem,
221
+ DropdownMenuLabel,
222
+ DropdownMenuPortal,
223
+ DropdownMenuRadioGroup,
224
+ DropdownMenuRadioItem,
225
+ DropdownMenuSeparator,
226
+ DropdownMenuShortcut,
227
+ DropdownMenuSub,
228
+ DropdownMenuSubContent,
229
+ DropdownMenuSubTrigger,
230
+ DropdownMenuTrigger
231
+ };
package/dist/form.d.ts CHANGED
@@ -1,38 +1 @@
1
- import { ControllerProps } from 'react-hook-form';
2
- import { FieldError } from 'react-hook-form';
3
- import { FieldPath } from 'react-hook-form';
4
- import { FieldValues } from 'react-hook-form';
5
- import { FormProviderProps } from 'react-hook-form';
6
- import { JSX } from 'react/jsx-runtime';
7
- import * as LabelPrimitive from '@radix-ui/react-label';
8
- import * as React_2 from 'react';
9
- import { Slot } from '@radix-ui/react-slot';
10
-
11
- export declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React_2.JSX.Element;
12
-
13
- export declare function FormControl({ ...props }: React_2.ComponentProps<typeof Slot>): JSX.Element;
14
-
15
- export declare function FormDescription({ className, ...props }: React_2.ComponentProps<"p">): JSX.Element;
16
-
17
- export declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => JSX.Element;
18
-
19
- export declare function FormItem({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
20
-
21
- export declare function FormLabel({ className, ...props }: React_2.ComponentProps<typeof LabelPrimitive.Root>): JSX.Element;
22
-
23
- export declare function FormMessage({ className, ...props }: React_2.ComponentProps<"p">): JSX.Element | null;
24
-
25
- export declare const useFormField: () => {
26
- invalid: boolean;
27
- isDirty: boolean;
28
- isTouched: boolean;
29
- isValidating: boolean;
30
- error?: FieldError;
31
- id: string;
32
- name: string;
33
- formItemId: string;
34
- formDescriptionId: string;
35
- formMessageId: string;
36
- };
37
-
38
- export { }
1
+ export {}
package/dist/form.js ADDED
@@ -0,0 +1,116 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { Slot } from "@radix-ui/react-slot";
4
+ import { FormProvider, Controller, useFormContext, useFormState } from "react-hook-form";
5
+ import { c as cn } from "./utils-CzDCF-Ah.js";
6
+ import { Label } from "./label.js";
7
+ const Form = FormProvider;
8
+ const FormFieldContext = React.createContext(
9
+ {}
10
+ );
11
+ const FormField = ({
12
+ ...props
13
+ }) => {
14
+ return /* @__PURE__ */ jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx(Controller, { ...props }) });
15
+ };
16
+ const useFormField = () => {
17
+ const fieldContext = React.useContext(FormFieldContext);
18
+ const itemContext = React.useContext(FormItemContext);
19
+ const { getFieldState } = useFormContext();
20
+ const formState = useFormState({ name: fieldContext.name });
21
+ const fieldState = getFieldState(fieldContext.name, formState);
22
+ if (!fieldContext) {
23
+ throw new Error("useFormField should be used within <FormField>");
24
+ }
25
+ const { id } = itemContext;
26
+ return {
27
+ id,
28
+ name: fieldContext.name,
29
+ formItemId: `${id}-form-item`,
30
+ formDescriptionId: `${id}-form-item-description`,
31
+ formMessageId: `${id}-form-item-message`,
32
+ ...fieldState
33
+ };
34
+ };
35
+ const FormItemContext = React.createContext(
36
+ {}
37
+ );
38
+ function FormItem({ className, ...props }) {
39
+ const id = React.useId();
40
+ return /* @__PURE__ */ jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx(
41
+ "div",
42
+ {
43
+ "data-slot": "form-item",
44
+ className: cn("grid gap-2", className),
45
+ ...props
46
+ }
47
+ ) });
48
+ }
49
+ function FormLabel({
50
+ className,
51
+ ...props
52
+ }) {
53
+ const { error, formItemId } = useFormField();
54
+ return /* @__PURE__ */ jsx(
55
+ Label,
56
+ {
57
+ "data-slot": "form-label",
58
+ "data-error": !!error,
59
+ className: cn("data-[error=true]:text-destructive", className),
60
+ htmlFor: formItemId,
61
+ ...props
62
+ }
63
+ );
64
+ }
65
+ function FormControl({ ...props }) {
66
+ const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
67
+ return /* @__PURE__ */ jsx(
68
+ Slot,
69
+ {
70
+ "data-slot": "form-control",
71
+ id: formItemId,
72
+ "aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
73
+ "aria-invalid": !!error,
74
+ ...props
75
+ }
76
+ );
77
+ }
78
+ function FormDescription({ className, ...props }) {
79
+ const { formDescriptionId } = useFormField();
80
+ return /* @__PURE__ */ jsx(
81
+ "p",
82
+ {
83
+ "data-slot": "form-description",
84
+ id: formDescriptionId,
85
+ className: cn("text-muted-foreground text-sm", className),
86
+ ...props
87
+ }
88
+ );
89
+ }
90
+ function FormMessage({ className, ...props }) {
91
+ const { error, formMessageId } = useFormField();
92
+ const body = error ? String(error?.message ?? "") : props.children;
93
+ if (!body) {
94
+ return null;
95
+ }
96
+ return /* @__PURE__ */ jsx(
97
+ "p",
98
+ {
99
+ "data-slot": "form-message",
100
+ id: formMessageId,
101
+ className: cn("text-destructive text-sm", className),
102
+ ...props,
103
+ children: body
104
+ }
105
+ );
106
+ }
107
+ export {
108
+ Form,
109
+ FormControl,
110
+ FormDescription,
111
+ FormField,
112
+ FormItem,
113
+ FormLabel,
114
+ FormMessage,
115
+ useFormField
116
+ };
@@ -1,11 +1,2 @@
1
- import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
2
- import { JSX } from 'react/jsx-runtime';
3
- import * as React_2 from 'react';
4
-
5
- export declare function HoverCard({ ...props }: React_2.ComponentProps<typeof HoverCardPrimitive.Root>): JSX.Element;
6
-
7
- export declare function HoverCardContent({ className, align, sideOffset, ...props }: React_2.ComponentProps<typeof HoverCardPrimitive.Content>): JSX.Element;
8
-
9
- export declare function HoverCardTrigger({ ...props }: React_2.ComponentProps<typeof HoverCardPrimitive.Trigger>): JSX.Element;
10
-
11
- export { }
1
+ export * from './components/ui/hover-card'
2
+ export {}
@@ -0,0 +1,38 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
3
+ import { c as cn } from "./utils-CzDCF-Ah.js";
4
+ function HoverCard({
5
+ ...props
6
+ }) {
7
+ return /* @__PURE__ */ jsx(HoverCardPrimitive.Root, { "data-slot": "hover-card", ...props });
8
+ }
9
+ function HoverCardTrigger({
10
+ ...props
11
+ }) {
12
+ return /* @__PURE__ */ jsx(HoverCardPrimitive.Trigger, { "data-slot": "hover-card-trigger", ...props });
13
+ }
14
+ function HoverCardContent({
15
+ className,
16
+ align = "center",
17
+ sideOffset = 4,
18
+ ...props
19
+ }) {
20
+ return /* @__PURE__ */ jsx(HoverCardPrimitive.Portal, { "data-slot": "hover-card-portal", children: /* @__PURE__ */ jsx(
21
+ HoverCardPrimitive.Content,
22
+ {
23
+ "data-slot": "hover-card-content",
24
+ align,
25
+ sideOffset,
26
+ className: cn(
27
+ "bg-popover text-popover-foreground 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 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
28
+ className
29
+ ),
30
+ ...props
31
+ }
32
+ ) });
33
+ }
34
+ export {
35
+ HoverCard,
36
+ HoverCardContent,
37
+ HoverCardTrigger
38
+ };
@@ -0,0 +1,44 @@
1
+ export * from './components/ui/accordion';
2
+ export * from './components/ui/alert';
3
+ export * from './components/ui/alert-dialog';
4
+ export * from './components/ui/aspect-ratio';
5
+ export * from './components/ui/avatar';
6
+ export * from './components/ui/badge';
7
+ export * from './components/ui/breadcrumb';
8
+ export * from './components/ui/button';
9
+ export * from './components/ui/calendar';
10
+ export * from './components/ui/card';
11
+ export * from './components/ui/carousel';
12
+ export * from './components/ui/checkbox';
13
+ export * from './components/ui/collapsible';
14
+ export * from './components/ui/command';
15
+ export * from './components/ui/context-menu';
16
+ export * from './components/ui/dialog';
17
+ export * from './components/ui/dropdown-menu';
18
+ export * from './components/ui/form';
19
+ export * from './components/ui/hover-card';
20
+ export * from './components/ui/input';
21
+ export * from './components/ui/label';
22
+ export * from './components/ui/menubar';
23
+ export * from './components/ui/navigation-menu';
24
+ export * from './components/ui/pagination';
25
+ export * from './components/ui/popover';
26
+ export * from './components/ui/progress';
27
+ export * from './components/ui/radio-group';
28
+ export * from './components/ui/resizable';
29
+ export * from './components/ui/scroll-area';
30
+ export * from './components/ui/select';
31
+ export * from './components/ui/separator';
32
+ export * from './components/ui/sheet';
33
+ export * from './components/ui/skeleton';
34
+ export * from './components/ui/slider';
35
+ export * from './components/ui/sonner';
36
+ export * from './components/ui/switch';
37
+ export * from './components/ui/table';
38
+ export * from './components/ui/tabs';
39
+ export * from './components/ui/textarea';
40
+ export * from './components/ui/toggle';
41
+ export * from './components/ui/toggle-group';
42
+ export * from './components/ui/tooltip';
43
+ export * from './lib/utils';
44
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AAGxC,cAAc,aAAa,CAAC"}
package/dist/input.d.ts CHANGED
@@ -1,6 +1,2 @@
1
- import { JSX } from 'react/jsx-runtime';
2
- import * as React_2 from 'react';
3
-
4
- export declare function Input({ className, type, ...props }: React_2.ComponentProps<"input">): JSX.Element;
5
-
6
- export { }
1
+ export * from './components/ui/input'
2
+ export {}