@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
@@ -0,0 +1,186 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon } from "lucide-react";
4
+ import { getDefaultClassNames, DayPicker } from "react-day-picker";
5
+ import { c as cn } from "./utils-CzDCF-Ah.js";
6
+ import { buttonVariants, Button } from "./button.js";
7
+ function Calendar({
8
+ className,
9
+ classNames,
10
+ showOutsideDays = true,
11
+ captionLayout = "label",
12
+ buttonVariant = "ghost",
13
+ formatters,
14
+ components,
15
+ ...props
16
+ }) {
17
+ const defaultClassNames = getDefaultClassNames();
18
+ return /* @__PURE__ */ jsx(
19
+ DayPicker,
20
+ {
21
+ showOutsideDays,
22
+ className: cn(
23
+ "bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
24
+ String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
25
+ String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
26
+ className
27
+ ),
28
+ captionLayout,
29
+ formatters: {
30
+ formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
31
+ ...formatters
32
+ },
33
+ classNames: {
34
+ root: cn("w-fit", defaultClassNames.root),
35
+ months: cn(
36
+ "flex gap-4 flex-col md:flex-row relative",
37
+ defaultClassNames.months
38
+ ),
39
+ month: cn("flex flex-col w-full gap-4", defaultClassNames.month),
40
+ nav: cn(
41
+ "flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",
42
+ defaultClassNames.nav
43
+ ),
44
+ button_previous: cn(
45
+ buttonVariants({ variant: buttonVariant }),
46
+ "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
47
+ defaultClassNames.button_previous
48
+ ),
49
+ button_next: cn(
50
+ buttonVariants({ variant: buttonVariant }),
51
+ "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
52
+ defaultClassNames.button_next
53
+ ),
54
+ month_caption: cn(
55
+ "flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",
56
+ defaultClassNames.month_caption
57
+ ),
58
+ dropdowns: cn(
59
+ "w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",
60
+ defaultClassNames.dropdowns
61
+ ),
62
+ dropdown_root: cn(
63
+ "relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",
64
+ defaultClassNames.dropdown_root
65
+ ),
66
+ dropdown: cn(
67
+ "absolute bg-popover inset-0 opacity-0",
68
+ defaultClassNames.dropdown
69
+ ),
70
+ caption_label: cn(
71
+ "select-none font-medium",
72
+ captionLayout === "label" ? "text-sm" : "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",
73
+ defaultClassNames.caption_label
74
+ ),
75
+ table: "w-full border-collapse",
76
+ weekdays: cn("flex", defaultClassNames.weekdays),
77
+ weekday: cn(
78
+ "text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",
79
+ defaultClassNames.weekday
80
+ ),
81
+ week: cn("flex w-full mt-2", defaultClassNames.week),
82
+ week_number_header: cn(
83
+ "select-none w-(--cell-size)",
84
+ defaultClassNames.week_number_header
85
+ ),
86
+ week_number: cn(
87
+ "text-[0.8rem] select-none text-muted-foreground",
88
+ defaultClassNames.week_number
89
+ ),
90
+ day: cn(
91
+ "relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",
92
+ defaultClassNames.day
93
+ ),
94
+ range_start: cn(
95
+ "rounded-l-md bg-accent",
96
+ defaultClassNames.range_start
97
+ ),
98
+ range_middle: cn("rounded-none", defaultClassNames.range_middle),
99
+ range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
100
+ today: cn(
101
+ "bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
102
+ defaultClassNames.today
103
+ ),
104
+ outside: cn(
105
+ "text-muted-foreground aria-selected:text-muted-foreground",
106
+ defaultClassNames.outside
107
+ ),
108
+ disabled: cn(
109
+ "text-muted-foreground opacity-50",
110
+ defaultClassNames.disabled
111
+ ),
112
+ hidden: cn("invisible", defaultClassNames.hidden),
113
+ ...classNames
114
+ },
115
+ components: {
116
+ Root: ({ className: className2, rootRef, ...props2 }) => {
117
+ return /* @__PURE__ */ jsx(
118
+ "div",
119
+ {
120
+ "data-slot": "calendar",
121
+ ref: rootRef,
122
+ className: cn(className2),
123
+ ...props2
124
+ }
125
+ );
126
+ },
127
+ Chevron: ({ className: className2, orientation, ...props2 }) => {
128
+ if (orientation === "left") {
129
+ return /* @__PURE__ */ jsx(ChevronLeftIcon, { className: cn("size-4", className2), ...props2 });
130
+ }
131
+ if (orientation === "right") {
132
+ return /* @__PURE__ */ jsx(
133
+ ChevronRightIcon,
134
+ {
135
+ className: cn("size-4", className2),
136
+ ...props2
137
+ }
138
+ );
139
+ }
140
+ return /* @__PURE__ */ jsx(ChevronDownIcon, { className: cn("size-4", className2), ...props2 });
141
+ },
142
+ DayButton: CalendarDayButton,
143
+ WeekNumber: ({ children, ...props2 }) => {
144
+ return /* @__PURE__ */ jsx("td", { ...props2, children: /* @__PURE__ */ jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) });
145
+ },
146
+ ...components
147
+ },
148
+ ...props
149
+ }
150
+ );
151
+ }
152
+ function CalendarDayButton({
153
+ className,
154
+ day,
155
+ modifiers,
156
+ ...props
157
+ }) {
158
+ const defaultClassNames = getDefaultClassNames();
159
+ const ref = React.useRef(null);
160
+ React.useEffect(() => {
161
+ if (modifiers.focused) ref.current?.focus();
162
+ }, [modifiers.focused]);
163
+ return /* @__PURE__ */ jsx(
164
+ Button,
165
+ {
166
+ ref,
167
+ variant: "ghost",
168
+ size: "icon",
169
+ "data-day": day.date.toLocaleDateString(),
170
+ "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
171
+ "data-range-start": modifiers.range_start,
172
+ "data-range-end": modifiers.range_end,
173
+ "data-range-middle": modifiers.range_middle,
174
+ className: cn(
175
+ "data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",
176
+ defaultClassNames.day,
177
+ className
178
+ ),
179
+ ...props
180
+ }
181
+ );
182
+ }
183
+ export {
184
+ Calendar,
185
+ CalendarDayButton
186
+ };
package/dist/card.d.ts CHANGED
@@ -1,18 +1,2 @@
1
- import { JSX } from 'react/jsx-runtime';
2
- import * as React_2 from 'react';
3
-
4
- export declare function Card({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
5
-
6
- export declare function CardAction({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
7
-
8
- export declare function CardContent({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
9
-
10
- export declare function CardDescription({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
11
-
12
- export declare function CardFooter({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
13
-
14
- export declare function CardHeader({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
15
-
16
- export declare function CardTitle({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
17
-
18
- export { }
1
+ export * from './components/ui/card'
2
+ export {}
package/dist/card.js ADDED
@@ -0,0 +1,90 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { c as cn } from "./utils-CzDCF-Ah.js";
3
+ function Card({ className, ...props }) {
4
+ return /* @__PURE__ */ jsx(
5
+ "div",
6
+ {
7
+ "data-slot": "card",
8
+ className: cn(
9
+ "bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
10
+ className
11
+ ),
12
+ ...props
13
+ }
14
+ );
15
+ }
16
+ function CardHeader({ className, ...props }) {
17
+ return /* @__PURE__ */ jsx(
18
+ "div",
19
+ {
20
+ "data-slot": "card-header",
21
+ className: cn(
22
+ "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
23
+ className
24
+ ),
25
+ ...props
26
+ }
27
+ );
28
+ }
29
+ function CardTitle({ className, ...props }) {
30
+ return /* @__PURE__ */ jsx(
31
+ "div",
32
+ {
33
+ "data-slot": "card-title",
34
+ className: cn("leading-none font-semibold", className),
35
+ ...props
36
+ }
37
+ );
38
+ }
39
+ function CardDescription({ className, ...props }) {
40
+ return /* @__PURE__ */ jsx(
41
+ "div",
42
+ {
43
+ "data-slot": "card-description",
44
+ className: cn("text-muted-foreground text-sm", className),
45
+ ...props
46
+ }
47
+ );
48
+ }
49
+ function CardAction({ className, ...props }) {
50
+ return /* @__PURE__ */ jsx(
51
+ "div",
52
+ {
53
+ "data-slot": "card-action",
54
+ className: cn(
55
+ "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
56
+ className
57
+ ),
58
+ ...props
59
+ }
60
+ );
61
+ }
62
+ function CardContent({ className, ...props }) {
63
+ return /* @__PURE__ */ jsx(
64
+ "div",
65
+ {
66
+ "data-slot": "card-content",
67
+ className: cn("px-6", className),
68
+ ...props
69
+ }
70
+ );
71
+ }
72
+ function CardFooter({ className, ...props }) {
73
+ return /* @__PURE__ */ jsx(
74
+ "div",
75
+ {
76
+ "data-slot": "card-footer",
77
+ className: cn("flex items-center px-6 [.border-t]:pt-6", className),
78
+ ...props
79
+ }
80
+ );
81
+ }
82
+ export {
83
+ Card,
84
+ CardAction,
85
+ CardContent,
86
+ CardDescription,
87
+ CardFooter,
88
+ CardHeader,
89
+ CardTitle
90
+ };
@@ -1,42 +1,2 @@
1
- import { ClassProp } from 'class-variance-authority/types';
2
- import { default as default_2 } from 'embla-carousel-react';
3
- import { JSX } from 'react/jsx-runtime';
4
- import * as React_2 from 'react';
5
- import { UseEmblaCarouselType } from 'embla-carousel-react';
6
- import { VariantProps } from 'class-variance-authority';
7
-
8
- declare function Button({ className, variant, size, asChild, ...props }: React_2.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
9
- asChild?: boolean;
10
- }): JSX.Element;
11
-
12
- declare const buttonVariants: (props?: ({
13
- variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
14
- size?: "default" | "sm" | "lg" | "icon" | null | undefined;
15
- } & ClassProp) | undefined) => string;
16
-
17
- export declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: React_2.ComponentProps<"div"> & CarouselProps): JSX.Element;
18
-
19
- export declare type CarouselApi = UseEmblaCarouselType[1];
20
-
21
- export declare function CarouselContent({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
22
-
23
- export declare function CarouselItem({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
24
-
25
- export declare function CarouselNext({ className, variant, size, ...props }: React_2.ComponentProps<typeof Button>): JSX.Element;
26
-
27
- declare type CarouselOptions = UseCarouselParameters[0];
28
-
29
- declare type CarouselPlugin = UseCarouselParameters[1];
30
-
31
- export declare function CarouselPrevious({ className, variant, size, ...props }: React_2.ComponentProps<typeof Button>): JSX.Element;
32
-
33
- declare type CarouselProps = {
34
- opts?: CarouselOptions;
35
- plugins?: CarouselPlugin;
36
- orientation?: "horizontal" | "vertical";
37
- setApi?: (api: CarouselApi) => void;
38
- };
39
-
40
- declare type UseCarouselParameters = Parameters<typeof default_2>;
41
-
42
- export { }
1
+ export * from './components/ui/carousel'
2
+ export {}
@@ -0,0 +1,198 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import useEmblaCarousel from "embla-carousel-react";
4
+ import { ArrowRight, ArrowLeft } from "lucide-react";
5
+ import { c as cn } from "./utils-CzDCF-Ah.js";
6
+ import { Button } from "./button.js";
7
+ const CarouselContext = React.createContext(null);
8
+ function useCarousel() {
9
+ const context = React.useContext(CarouselContext);
10
+ if (!context) {
11
+ throw new Error("useCarousel must be used within a <Carousel />");
12
+ }
13
+ return context;
14
+ }
15
+ function Carousel({
16
+ orientation = "horizontal",
17
+ opts,
18
+ setApi,
19
+ plugins,
20
+ className,
21
+ children,
22
+ ...props
23
+ }) {
24
+ const [carouselRef, api] = useEmblaCarousel(
25
+ {
26
+ ...opts,
27
+ axis: orientation === "horizontal" ? "x" : "y"
28
+ },
29
+ plugins
30
+ );
31
+ const [canScrollPrev, setCanScrollPrev] = React.useState(false);
32
+ const [canScrollNext, setCanScrollNext] = React.useState(false);
33
+ const onSelect = React.useCallback((api2) => {
34
+ if (!api2) return;
35
+ setCanScrollPrev(api2.canScrollPrev());
36
+ setCanScrollNext(api2.canScrollNext());
37
+ }, []);
38
+ const scrollPrev = React.useCallback(() => {
39
+ api?.scrollPrev();
40
+ }, [api]);
41
+ const scrollNext = React.useCallback(() => {
42
+ api?.scrollNext();
43
+ }, [api]);
44
+ const handleKeyDown = React.useCallback(
45
+ (event) => {
46
+ if (event.key === "ArrowLeft") {
47
+ event.preventDefault();
48
+ scrollPrev();
49
+ } else if (event.key === "ArrowRight") {
50
+ event.preventDefault();
51
+ scrollNext();
52
+ }
53
+ },
54
+ [scrollPrev, scrollNext]
55
+ );
56
+ React.useEffect(() => {
57
+ if (!api || !setApi) return;
58
+ setApi(api);
59
+ }, [api, setApi]);
60
+ React.useEffect(() => {
61
+ if (!api) return;
62
+ onSelect(api);
63
+ api.on("reInit", onSelect);
64
+ api.on("select", onSelect);
65
+ return () => {
66
+ api?.off("select", onSelect);
67
+ };
68
+ }, [api, onSelect]);
69
+ return /* @__PURE__ */ jsx(
70
+ CarouselContext.Provider,
71
+ {
72
+ value: {
73
+ carouselRef,
74
+ api,
75
+ opts,
76
+ orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
77
+ scrollPrev,
78
+ scrollNext,
79
+ canScrollPrev,
80
+ canScrollNext
81
+ },
82
+ children: /* @__PURE__ */ jsx(
83
+ "div",
84
+ {
85
+ onKeyDownCapture: handleKeyDown,
86
+ className: cn("relative", className),
87
+ role: "region",
88
+ "aria-roledescription": "carousel",
89
+ "data-slot": "carousel",
90
+ ...props,
91
+ children
92
+ }
93
+ )
94
+ }
95
+ );
96
+ }
97
+ function CarouselContent({ className, ...props }) {
98
+ const { carouselRef, orientation } = useCarousel();
99
+ return /* @__PURE__ */ jsx(
100
+ "div",
101
+ {
102
+ ref: carouselRef,
103
+ className: "overflow-hidden",
104
+ "data-slot": "carousel-content",
105
+ children: /* @__PURE__ */ jsx(
106
+ "div",
107
+ {
108
+ className: cn(
109
+ "flex",
110
+ orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
111
+ className
112
+ ),
113
+ ...props
114
+ }
115
+ )
116
+ }
117
+ );
118
+ }
119
+ function CarouselItem({ className, ...props }) {
120
+ const { orientation } = useCarousel();
121
+ return /* @__PURE__ */ jsx(
122
+ "div",
123
+ {
124
+ role: "group",
125
+ "aria-roledescription": "slide",
126
+ "data-slot": "carousel-item",
127
+ className: cn(
128
+ "min-w-0 shrink-0 grow-0 basis-full",
129
+ orientation === "horizontal" ? "pl-4" : "pt-4",
130
+ className
131
+ ),
132
+ ...props
133
+ }
134
+ );
135
+ }
136
+ function CarouselPrevious({
137
+ className,
138
+ variant = "outline",
139
+ size = "icon",
140
+ ...props
141
+ }) {
142
+ const { orientation, scrollPrev, canScrollPrev } = useCarousel();
143
+ return /* @__PURE__ */ jsxs(
144
+ Button,
145
+ {
146
+ "data-slot": "carousel-previous",
147
+ variant,
148
+ size,
149
+ className: cn(
150
+ "absolute size-8 rounded-full",
151
+ orientation === "horizontal" ? "top-1/2 -left-12 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
152
+ className
153
+ ),
154
+ disabled: !canScrollPrev,
155
+ onClick: scrollPrev,
156
+ ...props,
157
+ children: [
158
+ /* @__PURE__ */ jsx(ArrowLeft, {}),
159
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Previous slide" })
160
+ ]
161
+ }
162
+ );
163
+ }
164
+ function CarouselNext({
165
+ className,
166
+ variant = "outline",
167
+ size = "icon",
168
+ ...props
169
+ }) {
170
+ const { orientation, scrollNext, canScrollNext } = useCarousel();
171
+ return /* @__PURE__ */ jsxs(
172
+ Button,
173
+ {
174
+ "data-slot": "carousel-next",
175
+ variant,
176
+ size,
177
+ className: cn(
178
+ "absolute size-8 rounded-full",
179
+ orientation === "horizontal" ? "top-1/2 -right-12 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
180
+ className
181
+ ),
182
+ disabled: !canScrollNext,
183
+ onClick: scrollNext,
184
+ ...props,
185
+ children: [
186
+ /* @__PURE__ */ jsx(ArrowRight, {}),
187
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Next slide" })
188
+ ]
189
+ }
190
+ );
191
+ }
192
+ export {
193
+ Carousel,
194
+ CarouselContent,
195
+ CarouselItem,
196
+ CarouselNext,
197
+ CarouselPrevious
198
+ };
@@ -1,7 +1,2 @@
1
- import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
2
- import { JSX } from 'react/jsx-runtime';
3
- import * as React_2 from 'react';
4
-
5
- export declare function Checkbox({ className, ...props }: React_2.ComponentProps<typeof CheckboxPrimitive.Root>): JSX.Element;
6
-
7
- export { }
1
+ export * from './components/ui/checkbox'
2
+ export {}
@@ -1,31 +1,31 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import * as e from "@radix-ui/react-checkbox";
3
- import { CheckIcon as a } from "lucide-react";
4
- import { c as o } from "./utils-B7J70Nno.js";
5
- function n({
6
- className: i,
7
- ...t
1
+ import { jsx } from "react/jsx-runtime";
2
+ import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
3
+ import { CheckIcon } from "lucide-react";
4
+ import { c as cn } from "./utils-CzDCF-Ah.js";
5
+ function Checkbox({
6
+ className,
7
+ ...props
8
8
  }) {
9
- return /* @__PURE__ */ r(
10
- e.Root,
9
+ return /* @__PURE__ */ jsx(
10
+ CheckboxPrimitive.Root,
11
11
  {
12
12
  "data-slot": "checkbox",
13
- className: o(
13
+ className: cn(
14
14
  "peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
15
- i
15
+ className
16
16
  ),
17
- ...t,
18
- children: /* @__PURE__ */ r(
19
- e.Indicator,
17
+ ...props,
18
+ children: /* @__PURE__ */ jsx(
19
+ CheckboxPrimitive.Indicator,
20
20
  {
21
21
  "data-slot": "checkbox-indicator",
22
22
  className: "flex items-center justify-center text-current transition-none",
23
- children: /* @__PURE__ */ r(a, { className: "size-3.5" })
23
+ children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-3.5" })
24
24
  }
25
25
  )
26
26
  }
27
27
  );
28
28
  }
29
29
  export {
30
- n as Checkbox
30
+ Checkbox
31
31
  };
@@ -1,10 +1,2 @@
1
- import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
2
- import { JSX } from 'react/jsx-runtime';
3
-
4
- export declare function Collapsible({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>): JSX.Element;
5
-
6
- export declare function CollapsibleContent({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>): JSX.Element;
7
-
8
- export declare function CollapsibleTrigger({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>): JSX.Element;
9
-
10
- export { }
1
+ export * from './components/ui/collapsible'
2
+ export {}
@@ -0,0 +1,34 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
3
+ function Collapsible({
4
+ ...props
5
+ }) {
6
+ return /* @__PURE__ */ jsx(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ...props });
7
+ }
8
+ function CollapsibleTrigger({
9
+ ...props
10
+ }) {
11
+ return /* @__PURE__ */ jsx(
12
+ CollapsiblePrimitive.CollapsibleTrigger,
13
+ {
14
+ "data-slot": "collapsible-trigger",
15
+ ...props
16
+ }
17
+ );
18
+ }
19
+ function CollapsibleContent({
20
+ ...props
21
+ }) {
22
+ return /* @__PURE__ */ jsx(
23
+ CollapsiblePrimitive.CollapsibleContent,
24
+ {
25
+ "data-slot": "collapsible-content",
26
+ ...props
27
+ }
28
+ );
29
+ }
30
+ export {
31
+ Collapsible,
32
+ CollapsibleContent,
33
+ CollapsibleTrigger
34
+ };
package/dist/command.d.ts CHANGED
@@ -1,31 +1,2 @@
1
- import { Command as Command_2 } from 'cmdk';
2
- import * as DialogPrimitive from '@radix-ui/react-dialog';
3
- import { JSX } from 'react/jsx-runtime';
4
- import * as React_2 from 'react';
5
-
6
- export declare function Command({ className, ...props }: React_2.ComponentProps<typeof Command_2>): JSX.Element;
7
-
8
- export declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React_2.ComponentProps<typeof Dialog> & {
9
- title?: string;
10
- description?: string;
11
- className?: string;
12
- showCloseButton?: boolean;
13
- }): JSX.Element;
14
-
15
- export declare function CommandEmpty({ ...props }: React_2.ComponentProps<typeof Command_2.Empty>): JSX.Element;
16
-
17
- export declare function CommandGroup({ className, ...props }: React_2.ComponentProps<typeof Command_2.Group>): JSX.Element;
18
-
19
- export declare function CommandInput({ className, ...props }: React_2.ComponentProps<typeof Command_2.Input>): JSX.Element;
20
-
21
- export declare function CommandItem({ className, ...props }: React_2.ComponentProps<typeof Command_2.Item>): JSX.Element;
22
-
23
- export declare function CommandList({ className, ...props }: React_2.ComponentProps<typeof Command_2.List>): JSX.Element;
24
-
25
- export declare function CommandSeparator({ className, ...props }: React_2.ComponentProps<typeof Command_2.Separator>): JSX.Element;
26
-
27
- export declare function CommandShortcut({ className, ...props }: React_2.ComponentProps<"span">): JSX.Element;
28
-
29
- declare function Dialog({ ...props }: React_2.ComponentProps<typeof DialogPrimitive.Root>): JSX.Element;
30
-
31
- export { }
1
+ export * from './components/ui/command'
2
+ export {}