@codefast/ui 0.3.11-canary.0 → 0.3.11-canary.1

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 (75) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/package.json +79 -153
  3. package/dist/components/accordion.cjs +0 -98
  4. package/dist/components/alert-dialog.cjs +0 -156
  5. package/dist/components/alert.cjs +0 -84
  6. package/dist/components/aspect-ratio.cjs +0 -44
  7. package/dist/components/avatar.cjs +0 -66
  8. package/dist/components/badge.cjs +0 -67
  9. package/dist/components/breadcrumb.cjs +0 -125
  10. package/dist/components/button-group.cjs +0 -87
  11. package/dist/components/button.cjs +0 -92
  12. package/dist/components/calendar.cjs +0 -151
  13. package/dist/components/card.cjs +0 -105
  14. package/dist/components/carousel.cjs +0 -211
  15. package/dist/components/chart.cjs +0 -251
  16. package/dist/components/checkbox-cards.cjs +0 -70
  17. package/dist/components/checkbox-group.cjs +0 -64
  18. package/dist/components/checkbox.cjs +0 -54
  19. package/dist/components/collapsible.cjs +0 -62
  20. package/dist/components/command.cjs +0 -168
  21. package/dist/components/context-menu.cjs +0 -219
  22. package/dist/components/dialog.cjs +0 -165
  23. package/dist/components/drawer.cjs +0 -144
  24. package/dist/components/dropdown-menu.cjs +0 -222
  25. package/dist/components/empty.cjs +0 -113
  26. package/dist/components/field.cjs +0 -194
  27. package/dist/components/form.cjs +0 -152
  28. package/dist/components/hover-card.cjs +0 -78
  29. package/dist/components/input-group.cjs +0 -156
  30. package/dist/components/input-number.cjs +0 -99
  31. package/dist/components/input-otp.cjs +0 -102
  32. package/dist/components/input-password.cjs +0 -72
  33. package/dist/components/input-search.cjs +0 -81
  34. package/dist/components/input.cjs +0 -46
  35. package/dist/components/item.cjs +0 -186
  36. package/dist/components/kbd.cjs +0 -54
  37. package/dist/components/label.cjs +0 -46
  38. package/dist/components/menubar.cjs +0 -233
  39. package/dist/components/native-select.cjs +0 -75
  40. package/dist/components/navigation-menu.cjs +0 -146
  41. package/dist/components/pagination.cjs +0 -138
  42. package/dist/components/popover.cjs +0 -87
  43. package/dist/components/progress-circle.cjs +0 -185
  44. package/dist/components/progress.cjs +0 -53
  45. package/dist/components/radio-cards.cjs +0 -67
  46. package/dist/components/radio-group.cjs +0 -60
  47. package/dist/components/radio.cjs +0 -48
  48. package/dist/components/resizable.cjs +0 -72
  49. package/dist/components/scroll-area.cjs +0 -141
  50. package/dist/components/select.cjs +0 -181
  51. package/dist/components/separator.cjs +0 -83
  52. package/dist/components/sheet.cjs +0 -185
  53. package/dist/components/sidebar.cjs +0 -507
  54. package/dist/components/skeleton.cjs +0 -44
  55. package/dist/components/slider.cjs +0 -80
  56. package/dist/components/sonner.cjs +0 -58
  57. package/dist/components/spinner.cjs +0 -76
  58. package/dist/components/switch.cjs +0 -50
  59. package/dist/components/table.cjs +0 -118
  60. package/dist/components/tabs.cjs +0 -76
  61. package/dist/components/textarea.cjs +0 -44
  62. package/dist/components/toggle-group.cjs +0 -91
  63. package/dist/components/toggle.cjs +0 -72
  64. package/dist/components/tooltip.cjs +0 -91
  65. package/dist/hooks/use-animated-value.cjs +0 -75
  66. package/dist/hooks/use-copy-to-clipboard.cjs +0 -58
  67. package/dist/hooks/use-is-mobile.cjs +0 -40
  68. package/dist/hooks/use-media-query.cjs +0 -57
  69. package/dist/hooks/use-mutation-observer.cjs +0 -57
  70. package/dist/hooks/use-pagination.cjs +0 -93
  71. package/dist/index.cjs +0 -1081
  72. package/dist/primitives/checkbox-group.cjs +0 -151
  73. package/dist/primitives/input-number.cjs +0 -439
  74. package/dist/primitives/input.cjs +0 -99
  75. package/dist/primitives/progress-circle.cjs +0 -199
@@ -1,507 +0,0 @@
1
- "use strict";
2
- "use client";
3
- var __webpack_require__ = {};
4
- (()=>{
5
- __webpack_require__.d = (exports1, definition)=>{
6
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
7
- enumerable: true,
8
- get: definition[key]
9
- });
10
- };
11
- })();
12
- (()=>{
13
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
14
- })();
15
- (()=>{
16
- __webpack_require__.r = (exports1)=>{
17
- if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
18
- value: 'Module'
19
- });
20
- Object.defineProperty(exports1, '__esModule', {
21
- value: true
22
- });
23
- };
24
- })();
25
- var __webpack_exports__ = {};
26
- __webpack_require__.r(__webpack_exports__);
27
- __webpack_require__.d(__webpack_exports__, {
28
- SidebarFooter: ()=>SidebarFooter,
29
- SidebarMenuSub: ()=>SidebarMenuSub,
30
- SidebarMenuSubButton: ()=>SidebarMenuSubButton,
31
- SidebarProvider: ()=>SidebarProvider,
32
- SidebarContent: ()=>SidebarContent,
33
- SidebarGroupAction: ()=>SidebarGroupAction,
34
- SidebarHeader: ()=>SidebarHeader,
35
- SidebarMenuBadge: ()=>SidebarMenuBadge,
36
- SidebarMenuSkeleton: ()=>SidebarMenuSkeleton,
37
- SidebarMenu: ()=>SidebarMenu,
38
- Sidebar: ()=>Sidebar,
39
- SidebarSeparator: ()=>SidebarSeparator,
40
- SidebarTrigger: ()=>SidebarTrigger,
41
- SidebarGroupContent: ()=>SidebarGroupContent,
42
- SidebarMenuItem: ()=>SidebarMenuItem,
43
- SidebarGroupLabel: ()=>SidebarGroupLabel,
44
- sidebarMenuButtonVariants: ()=>sidebarMenuButtonVariants,
45
- useSidebar: ()=>useSidebar,
46
- SidebarInput: ()=>SidebarInput,
47
- SidebarMenuButton: ()=>SidebarMenuButton,
48
- SidebarInset: ()=>SidebarInset,
49
- SidebarMenuAction: ()=>SidebarMenuAction,
50
- SidebarMenuSubItem: ()=>SidebarMenuSubItem,
51
- SidebarRail: ()=>SidebarRail,
52
- SidebarGroup: ()=>SidebarGroup
53
- });
54
- const jsx_runtime_namespaceObject = require("react/jsx-runtime");
55
- const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
56
- const react_context_namespaceObject = require("@radix-ui/react-context");
57
- const react_slot_namespaceObject = require("@radix-ui/react-slot");
58
- const external_lucide_react_namespaceObject = require("lucide-react");
59
- const external_react_namespaceObject = require("react");
60
- const external_button_cjs_namespaceObject = require("./button.cjs");
61
- const external_input_cjs_namespaceObject = require("./input.cjs");
62
- const external_separator_cjs_namespaceObject = require("./separator.cjs");
63
- const external_sheet_cjs_namespaceObject = require("./sheet.cjs");
64
- const external_skeleton_cjs_namespaceObject = require("./skeleton.cjs");
65
- const external_tooltip_cjs_namespaceObject = require("./tooltip.cjs");
66
- const use_is_mobile_cjs_namespaceObject = require("../hooks/use-is-mobile.cjs");
67
- const sidebarMenuButtonVariants = (0, tailwind_variants_namespaceObject.tv)({
68
- base: "peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-3 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
69
- defaultVariants: {
70
- size: "md",
71
- variant: "default"
72
- },
73
- variants: {
74
- size: {
75
- sm: "h-7 text-xs",
76
- md: "h-8 text-sm",
77
- lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
78
- },
79
- variant: {
80
- default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
81
- outline: "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
82
- }
83
- }
84
- });
85
- const SIDEBAR_COOKIE_NAME = "sidebar_state";
86
- const SIDEBAR_COOKIE_MAX_AGE = 604800;
87
- const SIDEBAR_WIDTH = "16rem";
88
- const SIDEBAR_WIDTH_MOBILE = "18rem";
89
- const SIDEBAR_WIDTH_ICON = "3.0625rem";
90
- const SIDEBAR_KEYBOARD_SHORTCUT = "b";
91
- const SIDEBAR_PROVIDER_NAME = "SidebarProvider";
92
- const [SidebarContextProvider, useSidebar] = (0, react_context_namespaceObject.createContext)(SIDEBAR_PROVIDER_NAME);
93
- function SidebarProvider({ children, className, defaultOpen = true, onOpenChange: setOpenProperty, open: openProperty, style, ...props }) {
94
- const isMobile = (0, use_is_mobile_cjs_namespaceObject.useIsMobile)();
95
- const [openMobile, setOpenMobile] = (0, external_react_namespaceObject.useState)(false);
96
- const [isOpen, setIsOpen] = (0, external_react_namespaceObject.useState)(defaultOpen);
97
- const open = openProperty ?? isOpen;
98
- const setOpen = (0, external_react_namespaceObject.useCallback)((value)=>{
99
- const openState = "function" == typeof value ? value(open) : value;
100
- if (setOpenProperty) setOpenProperty(openState);
101
- else setIsOpen(openState);
102
- document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState.toString()}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE.toString()}`;
103
- }, [
104
- setOpenProperty,
105
- open
106
- ]);
107
- const toggleSidebar = (0, external_react_namespaceObject.useCallback)(()=>{
108
- if (isMobile) setOpenMobile((currentValue)=>!currentValue);
109
- else setOpen((currentValue)=>!currentValue);
110
- }, [
111
- isMobile,
112
- setOpen
113
- ]);
114
- (0, external_react_namespaceObject.useEffect)(()=>{
115
- const handleKeyDown = (event)=>{
116
- if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
117
- event.preventDefault();
118
- toggleSidebar();
119
- }
120
- };
121
- window.addEventListener("keydown", handleKeyDown);
122
- return ()=>{
123
- window.removeEventListener("keydown", handleKeyDown);
124
- };
125
- }, [
126
- toggleSidebar
127
- ]);
128
- const state = open ? "expanded" : "collapsed";
129
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SidebarContextProvider, {
130
- isMobile: isMobile,
131
- open: open,
132
- openMobile: openMobile,
133
- setOpen: setOpen,
134
- setOpenMobile: setOpenMobile,
135
- state: state,
136
- toggleSidebar: toggleSidebar,
137
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipProvider, {
138
- delayDuration: 0,
139
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
140
- className: (0, tailwind_variants_namespaceObject.cn)("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar", className),
141
- "data-slot": "sidebar-wrapper",
142
- style: {
143
- "--sidebar-width": SIDEBAR_WIDTH,
144
- "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
145
- ...style
146
- },
147
- ...props,
148
- children: children
149
- })
150
- })
151
- });
152
- }
153
- const SIDEBAR_NAME = "Sidebar";
154
- function Sidebar({ children, className, collapsible = "offcanvas", side = "left", variant = "sidebar", ...props }) {
155
- const { isMobile, openMobile, setOpenMobile, state } = useSidebar(SIDEBAR_NAME);
156
- if ("none" === collapsible) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
157
- className: (0, tailwind_variants_namespaceObject.cn)("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground", className),
158
- "data-slot": "sidebar",
159
- ...props,
160
- children: children
161
- });
162
- if (isMobile) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_sheet_cjs_namespaceObject.Sheet, {
163
- open: openMobile,
164
- onOpenChange: setOpenMobile,
165
- ...props,
166
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_sheet_cjs_namespaceObject.SheetContent, {
167
- className: "w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
168
- "data-mobile": "true",
169
- "data-sidebar": "sidebar",
170
- "data-slot": "sidebar",
171
- side: side,
172
- style: {
173
- "--sidebar-width": SIDEBAR_WIDTH_MOBILE
174
- },
175
- children: [
176
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_sheet_cjs_namespaceObject.SheetHeader, {
177
- className: "sr-only",
178
- children: [
179
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_sheet_cjs_namespaceObject.SheetTitle, {
180
- children: "Sidebar"
181
- }),
182
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_sheet_cjs_namespaceObject.SheetDescription, {
183
- children: "Displays the mobile sidebar."
184
- })
185
- ]
186
- }),
187
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
188
- className: "flex h-full w-full flex-col",
189
- children: children
190
- })
191
- ]
192
- })
193
- });
194
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
195
- className: (0, tailwind_variants_namespaceObject.cn)("group peer hidden text-sidebar-foreground md:block", className),
196
- "data-collapsible": "collapsed" === state ? collapsible : "",
197
- "data-side": side,
198
- "data-slot": "sidebar",
199
- "data-state": state,
200
- "data-variant": variant,
201
- children: [
202
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
203
- className: (0, tailwind_variants_namespaceObject.cn)("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear group-data-[collapsible=offcanvas]:w-0 group-data-[side=right]:rotate-180", "floating" === variant || "inset" === variant ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"),
204
- "data-slot": "sidebar-gap"
205
- }),
206
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
207
- className: (0, tailwind_variants_namespaceObject.cn)("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex", "left" === side ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]", "floating" === variant || "inset" === variant ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l", className),
208
- "data-slot": "sidebar-container",
209
- ...props,
210
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
211
- className: "flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm",
212
- "data-sidebar": "sidebar",
213
- "data-slot": "sidebar-inner",
214
- children: children
215
- })
216
- })
217
- ]
218
- });
219
- }
220
- const SIDEBAR_TRIGGER_NAME = "SidebarTrigger";
221
- function SidebarTrigger({ className, onClick, ...props }) {
222
- const { toggleSidebar } = useSidebar(SIDEBAR_TRIGGER_NAME);
223
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_button_cjs_namespaceObject.Button, {
224
- className: (0, tailwind_variants_namespaceObject.cn)("size-7", className),
225
- "data-sidebar": "trigger",
226
- "data-slot": "sidebar-trigger",
227
- size: "icon",
228
- variant: "ghost",
229
- onClick: (event)=>{
230
- onClick?.(event);
231
- toggleSidebar();
232
- },
233
- ...props,
234
- children: [
235
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.PanelLeftIcon, {}),
236
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
237
- className: "sr-only",
238
- children: "Toggle Sidebar"
239
- })
240
- ]
241
- });
242
- }
243
- const SIDEBAR_RAIL_NAME = "SidebarRail";
244
- function SidebarRail({ className, ...props }) {
245
- const { toggleSidebar } = useSidebar(SIDEBAR_RAIL_NAME);
246
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
247
- className: (0, tailwind_variants_namespaceObject.cn)("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[collapsible=offcanvas]:translate-x-0 group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-0.5 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar hover:after:bg-sidebar-border in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize sm:flex [[data-side=left][data-collapsible=offcanvas]_&]:-right-2 [[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-collapsible=offcanvas]_&]:-left-2 [[data-side=right][data-state=collapsed]_&]:cursor-w-resize", className),
248
- "data-sidebar": "rail",
249
- "data-slot": "sidebar-rail",
250
- title: "Toggle Sidebar",
251
- type: "button",
252
- onClick: toggleSidebar,
253
- ...props
254
- });
255
- }
256
- function SidebarInset({ className, ...props }) {
257
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("main", {
258
- className: (0, tailwind_variants_namespaceObject.cn)("relative flex w-full min-w-0 flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2", className),
259
- "data-slot": "sidebar-inset",
260
- ...props
261
- });
262
- }
263
- function SidebarInput({ className, ...props }) {
264
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_cjs_namespaceObject.Input, {
265
- className: (0, tailwind_variants_namespaceObject.cn)("h-8 w-full bg-background shadow-none", className),
266
- "data-sidebar": "input",
267
- "data-slot": "sidebar-input",
268
- ...props
269
- });
270
- }
271
- function SidebarHeader({ className, ...props }) {
272
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
273
- className: (0, tailwind_variants_namespaceObject.cn)("flex flex-col gap-2 p-2", className),
274
- "data-sidebar": "header",
275
- "data-slot": "sidebar-header",
276
- ...props
277
- });
278
- }
279
- function SidebarFooter({ className, ...props }) {
280
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
281
- className: (0, tailwind_variants_namespaceObject.cn)("flex flex-col gap-2 p-2", className),
282
- "data-sidebar": "footer",
283
- "data-slot": "sidebar-footer",
284
- ...props
285
- });
286
- }
287
- function SidebarSeparator({ className, ...props }) {
288
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_separator_cjs_namespaceObject.Separator, {
289
- className: (0, tailwind_variants_namespaceObject.cn)("mx-2 w-auto bg-sidebar-border", className),
290
- "data-sidebar": "separator",
291
- "data-slot": "sidebar-separator",
292
- ...props
293
- });
294
- }
295
- function SidebarContent({ className, ...props }) {
296
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
297
- className: (0, tailwind_variants_namespaceObject.cn)("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden", className),
298
- "data-sidebar": "content",
299
- "data-slot": "sidebar-content",
300
- ...props
301
- });
302
- }
303
- function SidebarGroup({ className, ...props }) {
304
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
305
- className: (0, tailwind_variants_namespaceObject.cn)("relative flex w-full min-w-0 flex-col p-2", className),
306
- "data-sidebar": "group",
307
- "data-slot": "sidebar-group",
308
- ...props
309
- });
310
- }
311
- function SidebarGroupLabel({ asChild = false, className, ...props }) {
312
- const Component = asChild ? react_slot_namespaceObject.Slot : "div";
313
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Component, {
314
- className: (0, tailwind_variants_namespaceObject.cn)("flex h-8 shrink-0 items-center truncate rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-3 [&>svg]:size-4 [&>svg]:shrink-0", className),
315
- "data-sidebar": "group-label",
316
- "data-slot": "sidebar-group-label",
317
- ...props
318
- });
319
- }
320
- function SidebarGroupAction({ asChild = false, className, ...props }) {
321
- const Component = asChild ? react_slot_namespaceObject.Slot : "button";
322
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Component, {
323
- className: (0, tailwind_variants_namespaceObject.cn)("absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-3 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0", className),
324
- "data-sidebar": "group-action",
325
- "data-slot": "sidebar-group-action",
326
- ...props
327
- });
328
- }
329
- function SidebarGroupContent({ className, ...props }) {
330
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
331
- className: (0, tailwind_variants_namespaceObject.cn)("w-full text-sm", className),
332
- "data-sidebar": "group-content",
333
- "data-slot": "sidebar-group-content",
334
- ...props
335
- });
336
- }
337
- function SidebarMenu({ className, ...props }) {
338
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("ul", {
339
- className: (0, tailwind_variants_namespaceObject.cn)("flex w-full min-w-0 flex-col gap-1", className),
340
- "data-sidebar": "menu",
341
- "data-slot": "sidebar-menu",
342
- ...props
343
- });
344
- }
345
- function SidebarMenuItem({ className, ...props }) {
346
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("li", {
347
- className: (0, tailwind_variants_namespaceObject.cn)("group/menu-item relative", className),
348
- "data-sidebar": "menu-item",
349
- "data-slot": "sidebar-menu-item",
350
- ...props
351
- });
352
- }
353
- const SIDEBAR_MENU_BUTTON_NAME = "SidebarMenuButton";
354
- function SidebarMenuButton({ asChild = false, className, isActive = false, size = "md", tooltip, variant = "default", ...props }) {
355
- const Component = asChild ? react_slot_namespaceObject.Slot : "button";
356
- const { isMobile, state } = useSidebar(SIDEBAR_MENU_BUTTON_NAME);
357
- const button = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Component, {
358
- className: (0, tailwind_variants_namespaceObject.cn)(sidebarMenuButtonVariants({
359
- size,
360
- variant
361
- }), className),
362
- "data-active": isActive,
363
- "data-sidebar": "menu-button",
364
- "data-size": size,
365
- "data-slot": "sidebar-menu-button",
366
- ...props
367
- });
368
- if (!tooltip) return button;
369
- if ("string" == typeof tooltip) tooltip = {
370
- children: tooltip
371
- };
372
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_tooltip_cjs_namespaceObject.Tooltip, {
373
- children: [
374
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipTrigger, {
375
- asChild: true,
376
- children: button
377
- }),
378
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipContent, {
379
- align: "center",
380
- hidden: "collapsed" !== state || isMobile,
381
- side: "right",
382
- ...tooltip
383
- })
384
- ]
385
- });
386
- }
387
- function SidebarMenuAction({ asChild = false, className, showOnHover = false, ...props }) {
388
- const Component = asChild ? react_slot_namespaceObject.Slot : "button";
389
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Component, {
390
- className: (0, tailwind_variants_namespaceObject.cn)("absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-3 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0", showOnHover && "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground data-[state=open]:opacity-100 md:opacity-0", className),
391
- "data-sidebar": "menu-action",
392
- "data-slot": "sidebar-menu-action",
393
- ...props
394
- });
395
- }
396
- function SidebarMenuBadge({ className, ...props }) {
397
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
398
- className: (0, tailwind_variants_namespaceObject.cn)("pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1", className),
399
- "data-sidebar": "menu-badge",
400
- "data-slot": "sidebar-menu-badge",
401
- ...props
402
- });
403
- }
404
- function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
405
- const [width] = (0, external_react_namespaceObject.useState)(()=>`${String(Math.floor(40 * Math.random()) + 50)}%`);
406
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
407
- className: (0, tailwind_variants_namespaceObject.cn)("flex h-8 items-center gap-2 rounded-md px-2", className),
408
- "data-sidebar": "menu-skeleton",
409
- "data-slot": "sidebar-menu-skeleton",
410
- ...props,
411
- children: [
412
- showIcon ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_skeleton_cjs_namespaceObject.Skeleton, {
413
- className: "size-4 rounded-md",
414
- "data-sidebar": "menu-skeleton-icon"
415
- }) : null,
416
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_skeleton_cjs_namespaceObject.Skeleton, {
417
- className: "h-4 max-w-(--skeleton-width) flex-1",
418
- "data-sidebar": "menu-skeleton-text",
419
- style: {
420
- "--skeleton-width": width
421
- }
422
- })
423
- ]
424
- });
425
- }
426
- function SidebarMenuSub({ className, ...props }) {
427
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("ul", {
428
- className: (0, tailwind_variants_namespaceObject.cn)("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden", className),
429
- "data-sidebar": "menu-sub",
430
- "data-slot": "sidebar-menu-sub",
431
- ...props
432
- });
433
- }
434
- function SidebarMenuSubItem({ className, ...props }) {
435
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("li", {
436
- className: (0, tailwind_variants_namespaceObject.cn)("group/menu-sub-item relative", className),
437
- "data-sidebar": "menu-sub-item",
438
- "data-slot": "sidebar-menu-sub-item",
439
- ...props
440
- });
441
- }
442
- function SidebarMenuSubButton({ asChild = false, className, isActive = false, size = "md", ...props }) {
443
- const Component = asChild ? react_slot_namespaceObject.Slot : "a";
444
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Component, {
445
- className: (0, tailwind_variants_namespaceObject.cn)("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-3 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground", "sm" === size && "text-xs", "md" === size && "text-sm", "group-data-[collapsible=icon]:hidden", className),
446
- "data-active": isActive,
447
- "data-sidebar": "menu-sub-button",
448
- "data-size": size,
449
- "data-slot": "sidebar-menu-sub-button",
450
- ...props
451
- });
452
- }
453
- exports.Sidebar = __webpack_exports__.Sidebar;
454
- exports.SidebarContent = __webpack_exports__.SidebarContent;
455
- exports.SidebarFooter = __webpack_exports__.SidebarFooter;
456
- exports.SidebarGroup = __webpack_exports__.SidebarGroup;
457
- exports.SidebarGroupAction = __webpack_exports__.SidebarGroupAction;
458
- exports.SidebarGroupContent = __webpack_exports__.SidebarGroupContent;
459
- exports.SidebarGroupLabel = __webpack_exports__.SidebarGroupLabel;
460
- exports.SidebarHeader = __webpack_exports__.SidebarHeader;
461
- exports.SidebarInput = __webpack_exports__.SidebarInput;
462
- exports.SidebarInset = __webpack_exports__.SidebarInset;
463
- exports.SidebarMenu = __webpack_exports__.SidebarMenu;
464
- exports.SidebarMenuAction = __webpack_exports__.SidebarMenuAction;
465
- exports.SidebarMenuBadge = __webpack_exports__.SidebarMenuBadge;
466
- exports.SidebarMenuButton = __webpack_exports__.SidebarMenuButton;
467
- exports.SidebarMenuItem = __webpack_exports__.SidebarMenuItem;
468
- exports.SidebarMenuSkeleton = __webpack_exports__.SidebarMenuSkeleton;
469
- exports.SidebarMenuSub = __webpack_exports__.SidebarMenuSub;
470
- exports.SidebarMenuSubButton = __webpack_exports__.SidebarMenuSubButton;
471
- exports.SidebarMenuSubItem = __webpack_exports__.SidebarMenuSubItem;
472
- exports.SidebarProvider = __webpack_exports__.SidebarProvider;
473
- exports.SidebarRail = __webpack_exports__.SidebarRail;
474
- exports.SidebarSeparator = __webpack_exports__.SidebarSeparator;
475
- exports.SidebarTrigger = __webpack_exports__.SidebarTrigger;
476
- exports.sidebarMenuButtonVariants = __webpack_exports__.sidebarMenuButtonVariants;
477
- exports.useSidebar = __webpack_exports__.useSidebar;
478
- for(var __rspack_i in __webpack_exports__)if (-1 === [
479
- "Sidebar",
480
- "SidebarContent",
481
- "SidebarFooter",
482
- "SidebarGroup",
483
- "SidebarGroupAction",
484
- "SidebarGroupContent",
485
- "SidebarGroupLabel",
486
- "SidebarHeader",
487
- "SidebarInput",
488
- "SidebarInset",
489
- "SidebarMenu",
490
- "SidebarMenuAction",
491
- "SidebarMenuBadge",
492
- "SidebarMenuButton",
493
- "SidebarMenuItem",
494
- "SidebarMenuSkeleton",
495
- "SidebarMenuSub",
496
- "SidebarMenuSubButton",
497
- "SidebarMenuSubItem",
498
- "SidebarProvider",
499
- "SidebarRail",
500
- "SidebarSeparator",
501
- "SidebarTrigger",
502
- "sidebarMenuButtonVariants",
503
- "useSidebar"
504
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
505
- Object.defineProperty(exports, '__esModule', {
506
- value: true
507
- });
@@ -1,44 +0,0 @@
1
- "use strict";
2
- var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.d = (exports1, definition)=>{
5
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
- enumerable: true,
7
- get: definition[key]
8
- });
9
- };
10
- })();
11
- (()=>{
12
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
- })();
14
- (()=>{
15
- __webpack_require__.r = (exports1)=>{
16
- if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
- value: 'Module'
18
- });
19
- Object.defineProperty(exports1, '__esModule', {
20
- value: true
21
- });
22
- };
23
- })();
24
- var __webpack_exports__ = {};
25
- __webpack_require__.r(__webpack_exports__);
26
- __webpack_require__.d(__webpack_exports__, {
27
- Skeleton: ()=>Skeleton
28
- });
29
- const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
- const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
31
- function Skeleton({ className, ...props }) {
32
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
33
- className: (0, tailwind_variants_namespaceObject.cn)("animate-pulse rounded-lg bg-muted", className),
34
- "data-slot": "skeleton",
35
- ...props
36
- });
37
- }
38
- exports.Skeleton = __webpack_exports__.Skeleton;
39
- for(var __rspack_i in __webpack_exports__)if (-1 === [
40
- "Skeleton"
41
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
42
- Object.defineProperty(exports, '__esModule', {
43
- value: true
44
- });
@@ -1,80 +0,0 @@
1
- "use strict";
2
- "use client";
3
- var __webpack_require__ = {};
4
- (()=>{
5
- __webpack_require__.d = (exports1, definition)=>{
6
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
7
- enumerable: true,
8
- get: definition[key]
9
- });
10
- };
11
- })();
12
- (()=>{
13
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
14
- })();
15
- (()=>{
16
- __webpack_require__.r = (exports1)=>{
17
- if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
18
- value: 'Module'
19
- });
20
- Object.defineProperty(exports1, '__esModule', {
21
- value: true
22
- });
23
- };
24
- })();
25
- var __webpack_exports__ = {};
26
- __webpack_require__.r(__webpack_exports__);
27
- __webpack_require__.d(__webpack_exports__, {
28
- Slider: ()=>Slider
29
- });
30
- const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
- const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
32
- const react_slider_namespaceObject = require("@radix-ui/react-slider");
33
- const external_react_namespaceObject = require("react");
34
- function Slider({ className, defaultValue, max = 100, min = 0, value, ...props }) {
35
- const _values = (0, external_react_namespaceObject.useMemo)(()=>{
36
- if (Array.isArray(value)) return value;
37
- return Array.isArray(defaultValue) ? defaultValue : [
38
- min,
39
- max
40
- ];
41
- }, [
42
- value,
43
- defaultValue,
44
- min,
45
- max
46
- ]);
47
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_slider_namespaceObject.Root, {
48
- className: (0, tailwind_variants_namespaceObject.cn)("relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col", className),
49
- "data-slot": "slider",
50
- defaultValue: defaultValue,
51
- max: max,
52
- min: min,
53
- value: value,
54
- ...props,
55
- children: [
56
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_slider_namespaceObject.Track, {
57
- className: "relative w-full grow overflow-hidden rounded-full bg-input data-[orientation=horizontal]:h-1 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1",
58
- "data-slot": "slider-track",
59
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_slider_namespaceObject.Range, {
60
- className: "absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full",
61
- "data-slot": "slider-range"
62
- })
63
- }),
64
- Array.from({
65
- length: _values.length
66
- }, (_, index)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_slider_namespaceObject.Thumb, {
67
- "aria-label": "Volume",
68
- className: (0, tailwind_variants_namespaceObject.cn)("flex size-4 items-center justify-center rounded-full border-2 border-primary bg-primary shadow-sm outline-hidden after:size-full after:rounded-full after:bg-background after:transition-[width,height] focus-visible:ring-4 focus-visible:ring-primary/20 active:not-data-disabled:after:size-1 dark:focus-visible:ring-primary/40"),
69
- "data-slot": "slider-thumb"
70
- }, index))
71
- ]
72
- });
73
- }
74
- exports.Slider = __webpack_exports__.Slider;
75
- for(var __rspack_i in __webpack_exports__)if (-1 === [
76
- "Slider"
77
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
78
- Object.defineProperty(exports, '__esModule', {
79
- value: true
80
- });