@codefast/ui 0.3.14 → 0.3.16-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/components/accordion.d.mts +30 -0
- package/dist/components/accordion.mjs +15 -0
- package/dist/components/alert-dialog.d.mts +60 -0
- package/dist/components/alert-dialog.mjs +30 -0
- package/dist/components/alert.d.mts +21 -0
- package/dist/components/alert.mjs +12 -0
- package/dist/components/aspect-ratio.d.mts +6 -0
- package/dist/components/aspect-ratio.mjs +3 -0
- package/dist/components/avatar.d.mts +18 -0
- package/dist/components/avatar.mjs +9 -0
- package/dist/components/badge.d.mts +9 -0
- package/dist/components/badge.mjs +6 -0
- package/dist/components/breadcrumb.d.mts +42 -0
- package/dist/components/breadcrumb.mjs +21 -0
- package/dist/components/button-group.d.mts +21 -0
- package/dist/components/button-group.mjs +12 -0
- package/dist/components/button.d.mts +9 -0
- package/dist/components/button.mjs +6 -0
- package/dist/components/calendar.d.mts +12 -0
- package/dist/components/calendar.mjs +6 -0
- package/dist/components/card.d.mts +42 -0
- package/dist/components/card.mjs +21 -0
- package/dist/components/carousel.d.mts +33 -0
- package/dist/components/carousel.mjs +15 -0
- package/dist/components/chart.d.mts +39 -0
- package/dist/components/chart.mjs +18 -0
- package/dist/components/checkbox-cards.d.mts +12 -0
- package/dist/components/checkbox-cards.mjs +6 -0
- package/dist/components/checkbox-group.d.mts +12 -0
- package/dist/components/checkbox-group.mjs +6 -0
- package/dist/components/checkbox.d.mts +6 -0
- package/dist/components/checkbox.mjs +3 -0
- package/dist/components/collapsible.d.mts +18 -0
- package/dist/components/collapsible.mjs +9 -0
- package/dist/components/command.d.mts +60 -0
- package/dist/components/command.mjs +30 -0
- package/dist/components/context-menu.d.mts +90 -0
- package/dist/components/context-menu.mjs +45 -0
- package/dist/components/dialog.d.mts +54 -0
- package/dist/components/dialog.mjs +27 -0
- package/dist/components/drawer.d.mts +54 -0
- package/dist/components/drawer.mjs +27 -0
- package/dist/components/dropdown-menu.d.mts +90 -0
- package/dist/components/dropdown-menu.mjs +45 -0
- package/dist/components/empty.d.mts +39 -0
- package/dist/components/empty.mjs +21 -0
- package/dist/components/field.d.mts +63 -0
- package/dist/components/field.mjs +33 -0
- package/dist/components/form.d.mts +42 -0
- package/dist/components/form.mjs +21 -0
- package/dist/components/hover-card.d.mts +24 -0
- package/dist/components/hover-card.mjs +12 -0
- package/dist/components/input-group.d.mts +45 -0
- package/dist/components/input-group.mjs +27 -0
- package/dist/components/input-number.d.mts +6 -0
- package/dist/components/input-number.mjs +3 -0
- package/dist/components/input-otp.d.mts +24 -0
- package/dist/components/input-otp.mjs +12 -0
- package/dist/components/input-password.d.mts +6 -0
- package/dist/components/input-password.mjs +3 -0
- package/dist/components/input-search.d.mts +6 -0
- package/dist/components/input-search.mjs +3 -0
- package/dist/components/input.d.mts +6 -0
- package/dist/components/input.mjs +3 -0
- package/dist/components/item.d.mts +66 -0
- package/dist/components/item.mjs +36 -0
- package/dist/components/kbd.d.mts +12 -0
- package/dist/components/kbd.mjs +6 -0
- package/dist/components/label.d.mts +6 -0
- package/dist/components/label.mjs +3 -0
- package/dist/components/menubar.d.mts +96 -0
- package/dist/components/menubar.mjs +48 -0
- package/dist/components/native-select.d.mts +18 -0
- package/dist/components/native-select.mjs +9 -0
- package/dist/components/navigation-menu.d.mts +39 -0
- package/dist/components/navigation-menu.mjs +21 -0
- package/dist/components/pagination.d.mts +42 -0
- package/dist/components/pagination.mjs +21 -0
- package/dist/components/popover.d.mts +30 -0
- package/dist/components/popover.mjs +15 -0
- package/dist/components/progress-circle.d.mts +9 -0
- package/dist/components/progress-circle.mjs +6 -0
- package/dist/components/progress.d.mts +6 -0
- package/dist/components/progress.mjs +3 -0
- package/dist/components/radio-cards.d.mts +12 -0
- package/dist/components/radio-cards.mjs +6 -0
- package/dist/components/radio-group.d.mts +12 -0
- package/dist/components/radio-group.mjs +6 -0
- package/dist/components/radio.d.mts +6 -0
- package/dist/components/radio.mjs +3 -0
- package/dist/components/resizable.d.mts +18 -0
- package/dist/components/resizable.mjs +9 -0
- package/dist/components/scroll-area.d.mts +15 -0
- package/dist/components/scroll-area.mjs +9 -0
- package/dist/components/select.d.mts +60 -0
- package/dist/components/select.mjs +30 -0
- package/dist/components/separator.d.mts +15 -0
- package/dist/components/separator.mjs +9 -0
- package/dist/components/sheet.d.mts +57 -0
- package/dist/components/sheet.mjs +30 -0
- package/dist/components/sidebar.d.mts +141 -0
- package/dist/components/sidebar.mjs +72 -0
- package/dist/components/skeleton.d.mts +6 -0
- package/dist/components/skeleton.mjs +3 -0
- package/dist/components/slider.d.mts +6 -0
- package/dist/components/slider.mjs +3 -0
- package/dist/components/sonner.d.mts +6 -0
- package/dist/components/sonner.mjs +3 -0
- package/dist/components/spinner.d.mts +6 -0
- package/dist/components/spinner.mjs +3 -0
- package/dist/components/switch.d.mts +6 -0
- package/dist/components/switch.mjs +3 -0
- package/dist/components/table.d.mts +48 -0
- package/dist/components/table.mjs +24 -0
- package/dist/components/tabs.d.mts +24 -0
- package/dist/components/tabs.mjs +12 -0
- package/dist/components/textarea.d.mts +6 -0
- package/dist/components/textarea.mjs +3 -0
- package/dist/components/toggle-group.d.mts +12 -0
- package/dist/components/toggle-group.mjs +6 -0
- package/dist/components/toggle.d.mts +12 -0
- package/dist/components/toggle.mjs +6 -0
- package/dist/components/tooltip.d.mts +30 -0
- package/dist/components/tooltip.mjs +15 -0
- package/dist/hooks/use-animated-value.d.mts +2 -0
- package/dist/hooks/use-animated-value.mjs +5 -3
- package/dist/hooks/use-copy-to-clipboard.d.mts +2 -0
- package/dist/hooks/use-copy-to-clipboard.mjs +5 -3
- package/dist/hooks/use-is-mobile.d.mts +2 -0
- package/dist/hooks/use-is-mobile.mjs +5 -3
- package/dist/hooks/use-media-query.d.mts +2 -0
- package/dist/hooks/use-media-query.mjs +5 -3
- package/dist/hooks/use-mutation-observer.d.mts +2 -0
- package/dist/hooks/use-mutation-observer.mjs +5 -3
- package/dist/hooks/use-pagination.d.mts +7 -0
- package/dist/hooks/use-pagination.mjs +7 -3
- package/dist/primitives/checkbox-group.d.mts +12 -0
- package/dist/primitives/checkbox-group.mjs +6 -0
- package/dist/primitives/input-number.d.mts +22 -0
- package/dist/primitives/input-number.mjs +12 -0
- package/dist/primitives/input.d.mts +10 -0
- package/dist/primitives/input.mjs +6 -0
- package/dist/primitives/progress-circle.d.mts +30 -0
- package/dist/primitives/progress-circle.mjs +19 -7
- package/package.json +9 -9
|
@@ -7,6 +7,9 @@ import * as _$_codefast_tailwind_variants0 from "@codefast/tailwind-variants";
|
|
|
7
7
|
import { ComponentProps, Dispatch, JSX, SetStateAction } from "react";
|
|
8
8
|
|
|
9
9
|
//#region src/components/sidebar.d.ts
|
|
10
|
+
/**
|
|
11
|
+
* @since 0.3.16-canary.0
|
|
12
|
+
*/
|
|
10
13
|
declare const sidebarMenuButtonVariants: _$_codefast_tailwind_variants0.VariantFunctionType<{
|
|
11
14
|
size: {
|
|
12
15
|
sm: string[];
|
|
@@ -28,11 +31,17 @@ interface SidebarContextValue {
|
|
|
28
31
|
toggleSidebar: () => void;
|
|
29
32
|
}
|
|
30
33
|
declare const useSidebar: (consumerName: string) => SidebarContextValue;
|
|
34
|
+
/**
|
|
35
|
+
* @since 0.3.16-canary.0
|
|
36
|
+
*/
|
|
31
37
|
interface SidebarProviderProps extends ComponentProps<"div"> {
|
|
32
38
|
defaultOpen?: boolean;
|
|
33
39
|
onOpenChange?: (open: boolean) => void;
|
|
34
40
|
open?: boolean;
|
|
35
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* @since 0.3.16-canary.0
|
|
44
|
+
*/
|
|
36
45
|
declare function SidebarProvider({
|
|
37
46
|
children,
|
|
38
47
|
className,
|
|
@@ -42,11 +51,17 @@ declare function SidebarProvider({
|
|
|
42
51
|
style,
|
|
43
52
|
...props
|
|
44
53
|
}: SidebarProviderProps): JSX.Element;
|
|
54
|
+
/**
|
|
55
|
+
* @since 0.3.16-canary.0
|
|
56
|
+
*/
|
|
45
57
|
interface SidebarProps extends ComponentProps<"div"> {
|
|
46
58
|
collapsible?: "icon" | "none" | "offcanvas";
|
|
47
59
|
side?: "left" | "right";
|
|
48
60
|
variant?: "floating" | "inset" | "sidebar";
|
|
49
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* @since 0.3.16-canary.0
|
|
64
|
+
*/
|
|
50
65
|
declare function Sidebar({
|
|
51
66
|
children,
|
|
52
67
|
className,
|
|
@@ -55,88 +70,178 @@ declare function Sidebar({
|
|
|
55
70
|
variant,
|
|
56
71
|
...props
|
|
57
72
|
}: SidebarProps): JSX.Element;
|
|
73
|
+
/**
|
|
74
|
+
* @since 0.3.16-canary.0
|
|
75
|
+
*/
|
|
58
76
|
type SidebarTriggerProps = ComponentProps<typeof Button>;
|
|
77
|
+
/**
|
|
78
|
+
* @since 0.3.16-canary.0
|
|
79
|
+
*/
|
|
59
80
|
declare function SidebarTrigger({
|
|
60
81
|
className,
|
|
61
82
|
onClick,
|
|
62
83
|
...props
|
|
63
84
|
}: SidebarTriggerProps): JSX.Element;
|
|
85
|
+
/**
|
|
86
|
+
* @since 0.3.16-canary.0
|
|
87
|
+
*/
|
|
64
88
|
type SidebarRailProps = ComponentProps<"button">;
|
|
89
|
+
/**
|
|
90
|
+
* @since 0.3.16-canary.0
|
|
91
|
+
*/
|
|
65
92
|
declare function SidebarRail({
|
|
66
93
|
className,
|
|
67
94
|
...props
|
|
68
95
|
}: SidebarRailProps): JSX.Element;
|
|
96
|
+
/**
|
|
97
|
+
* @since 0.3.16-canary.0
|
|
98
|
+
*/
|
|
69
99
|
type SidebarInsetProps = ComponentProps<"main">;
|
|
100
|
+
/**
|
|
101
|
+
* @since 0.3.16-canary.0
|
|
102
|
+
*/
|
|
70
103
|
declare function SidebarInset({
|
|
71
104
|
className,
|
|
72
105
|
...props
|
|
73
106
|
}: SidebarInsetProps): JSX.Element;
|
|
107
|
+
/**
|
|
108
|
+
* @since 0.3.16-canary.0
|
|
109
|
+
*/
|
|
74
110
|
type SidebarInputProps = ComponentProps<typeof Input>;
|
|
111
|
+
/**
|
|
112
|
+
* @since 0.3.16-canary.0
|
|
113
|
+
*/
|
|
75
114
|
declare function SidebarInput({
|
|
76
115
|
className,
|
|
77
116
|
...props
|
|
78
117
|
}: SidebarInputProps): JSX.Element;
|
|
118
|
+
/**
|
|
119
|
+
* @since 0.3.16-canary.0
|
|
120
|
+
*/
|
|
79
121
|
type SidebarHeaderProps = ComponentProps<"div">;
|
|
122
|
+
/**
|
|
123
|
+
* @since 0.3.16-canary.0
|
|
124
|
+
*/
|
|
80
125
|
declare function SidebarHeader({
|
|
81
126
|
className,
|
|
82
127
|
...props
|
|
83
128
|
}: SidebarHeaderProps): JSX.Element;
|
|
129
|
+
/**
|
|
130
|
+
* @since 0.3.16-canary.0
|
|
131
|
+
*/
|
|
84
132
|
type SidebarFooterProps = ComponentProps<"div">;
|
|
133
|
+
/**
|
|
134
|
+
* @since 0.3.16-canary.0
|
|
135
|
+
*/
|
|
85
136
|
declare function SidebarFooter({
|
|
86
137
|
className,
|
|
87
138
|
...props
|
|
88
139
|
}: SidebarFooterProps): JSX.Element;
|
|
140
|
+
/**
|
|
141
|
+
* @since 0.3.16-canary.0
|
|
142
|
+
*/
|
|
89
143
|
type SidebarSeparatorProps = ComponentProps<typeof Separator>;
|
|
144
|
+
/**
|
|
145
|
+
* @since 0.3.16-canary.0
|
|
146
|
+
*/
|
|
90
147
|
declare function SidebarSeparator({
|
|
91
148
|
className,
|
|
92
149
|
...props
|
|
93
150
|
}: SidebarSeparatorProps): JSX.Element;
|
|
151
|
+
/**
|
|
152
|
+
* @since 0.3.16-canary.0
|
|
153
|
+
*/
|
|
94
154
|
type SidebarContentProps = ComponentProps<"div">;
|
|
155
|
+
/**
|
|
156
|
+
* @since 0.3.16-canary.0
|
|
157
|
+
*/
|
|
95
158
|
declare function SidebarContent({
|
|
96
159
|
className,
|
|
97
160
|
...props
|
|
98
161
|
}: SidebarContentProps): JSX.Element;
|
|
162
|
+
/**
|
|
163
|
+
* @since 0.3.16-canary.0
|
|
164
|
+
*/
|
|
99
165
|
type SidebarGroupProps = ComponentProps<"div">;
|
|
166
|
+
/**
|
|
167
|
+
* @since 0.3.16-canary.0
|
|
168
|
+
*/
|
|
100
169
|
declare function SidebarGroup({
|
|
101
170
|
className,
|
|
102
171
|
...props
|
|
103
172
|
}: SidebarGroupProps): JSX.Element;
|
|
173
|
+
/**
|
|
174
|
+
* @since 0.3.16-canary.0
|
|
175
|
+
*/
|
|
104
176
|
interface SidebarGroupLabelProps extends ComponentProps<"div"> {
|
|
105
177
|
asChild?: boolean;
|
|
106
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* @since 0.3.16-canary.0
|
|
181
|
+
*/
|
|
107
182
|
declare function SidebarGroupLabel({
|
|
108
183
|
asChild,
|
|
109
184
|
className,
|
|
110
185
|
...props
|
|
111
186
|
}: SidebarGroupLabelProps): JSX.Element;
|
|
187
|
+
/**
|
|
188
|
+
* @since 0.3.16-canary.0
|
|
189
|
+
*/
|
|
112
190
|
interface SidebarGroupActionProps extends ComponentProps<"button"> {
|
|
113
191
|
asChild?: boolean;
|
|
114
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* @since 0.3.16-canary.0
|
|
195
|
+
*/
|
|
115
196
|
declare function SidebarGroupAction({
|
|
116
197
|
asChild,
|
|
117
198
|
className,
|
|
118
199
|
...props
|
|
119
200
|
}: SidebarGroupActionProps): JSX.Element;
|
|
201
|
+
/**
|
|
202
|
+
* @since 0.3.16-canary.0
|
|
203
|
+
*/
|
|
120
204
|
type SidebarGroupContentProps = ComponentProps<"div">;
|
|
205
|
+
/**
|
|
206
|
+
* @since 0.3.16-canary.0
|
|
207
|
+
*/
|
|
121
208
|
declare function SidebarGroupContent({
|
|
122
209
|
className,
|
|
123
210
|
...props
|
|
124
211
|
}: SidebarGroupContentProps): JSX.Element;
|
|
212
|
+
/**
|
|
213
|
+
* @since 0.3.16-canary.0
|
|
214
|
+
*/
|
|
125
215
|
type SidebarMenuProps = ComponentProps<"ul">;
|
|
216
|
+
/**
|
|
217
|
+
* @since 0.3.16-canary.0
|
|
218
|
+
*/
|
|
126
219
|
declare function SidebarMenu({
|
|
127
220
|
className,
|
|
128
221
|
...props
|
|
129
222
|
}: SidebarMenuProps): JSX.Element;
|
|
223
|
+
/**
|
|
224
|
+
* @since 0.3.16-canary.0
|
|
225
|
+
*/
|
|
130
226
|
type SidebarMenuItemProps = ComponentProps<"li">;
|
|
227
|
+
/**
|
|
228
|
+
* @since 0.3.16-canary.0
|
|
229
|
+
*/
|
|
131
230
|
declare function SidebarMenuItem({
|
|
132
231
|
className,
|
|
133
232
|
...props
|
|
134
233
|
}: SidebarMenuItemProps): JSX.Element;
|
|
234
|
+
/**
|
|
235
|
+
* @since 0.3.16-canary.0
|
|
236
|
+
*/
|
|
135
237
|
interface SidebarMenuButtonProps extends ComponentProps<"button">, VariantProps<typeof sidebarMenuButtonVariants> {
|
|
136
238
|
asChild?: boolean;
|
|
137
239
|
isActive?: boolean;
|
|
138
240
|
tooltip?: ComponentProps<typeof TooltipContent> | string;
|
|
139
241
|
}
|
|
242
|
+
/**
|
|
243
|
+
* @since 0.3.16-canary.0
|
|
244
|
+
*/
|
|
140
245
|
declare function SidebarMenuButton({
|
|
141
246
|
asChild,
|
|
142
247
|
className,
|
|
@@ -146,44 +251,80 @@ declare function SidebarMenuButton({
|
|
|
146
251
|
variant,
|
|
147
252
|
...props
|
|
148
253
|
}: SidebarMenuButtonProps): JSX.Element;
|
|
254
|
+
/**
|
|
255
|
+
* @since 0.3.16-canary.0
|
|
256
|
+
*/
|
|
149
257
|
interface SidebarMenuActionProps extends ComponentProps<"button"> {
|
|
150
258
|
asChild?: boolean;
|
|
151
259
|
showOnHover?: boolean;
|
|
152
260
|
}
|
|
261
|
+
/**
|
|
262
|
+
* @since 0.3.16-canary.0
|
|
263
|
+
*/
|
|
153
264
|
declare function SidebarMenuAction({
|
|
154
265
|
asChild,
|
|
155
266
|
className,
|
|
156
267
|
showOnHover,
|
|
157
268
|
...props
|
|
158
269
|
}: SidebarMenuActionProps): JSX.Element;
|
|
270
|
+
/**
|
|
271
|
+
* @since 0.3.16-canary.0
|
|
272
|
+
*/
|
|
159
273
|
type SidebarMenuBadgeProps = ComponentProps<"div">;
|
|
274
|
+
/**
|
|
275
|
+
* @since 0.3.16-canary.0
|
|
276
|
+
*/
|
|
160
277
|
declare function SidebarMenuBadge({
|
|
161
278
|
className,
|
|
162
279
|
...props
|
|
163
280
|
}: SidebarMenuBadgeProps): JSX.Element;
|
|
281
|
+
/**
|
|
282
|
+
* @since 0.3.16-canary.0
|
|
283
|
+
*/
|
|
164
284
|
interface SidebarMenuSkeletonProps extends ComponentProps<"div"> {
|
|
165
285
|
showIcon?: boolean;
|
|
166
286
|
}
|
|
287
|
+
/**
|
|
288
|
+
* @since 0.3.16-canary.0
|
|
289
|
+
*/
|
|
167
290
|
declare function SidebarMenuSkeleton({
|
|
168
291
|
className,
|
|
169
292
|
showIcon,
|
|
170
293
|
...props
|
|
171
294
|
}: SidebarMenuSkeletonProps): JSX.Element;
|
|
295
|
+
/**
|
|
296
|
+
* @since 0.3.16-canary.0
|
|
297
|
+
*/
|
|
172
298
|
type SidebarMenuSubProps = ComponentProps<"ul">;
|
|
299
|
+
/**
|
|
300
|
+
* @since 0.3.16-canary.0
|
|
301
|
+
*/
|
|
173
302
|
declare function SidebarMenuSub({
|
|
174
303
|
className,
|
|
175
304
|
...props
|
|
176
305
|
}: SidebarMenuSubProps): JSX.Element;
|
|
306
|
+
/**
|
|
307
|
+
* @since 0.3.16-canary.0
|
|
308
|
+
*/
|
|
177
309
|
type SidebarMenuSubItemProps = ComponentProps<"li">;
|
|
310
|
+
/**
|
|
311
|
+
* @since 0.3.16-canary.0
|
|
312
|
+
*/
|
|
178
313
|
declare function SidebarMenuSubItem({
|
|
179
314
|
className,
|
|
180
315
|
...props
|
|
181
316
|
}: SidebarMenuSubItemProps): JSX.Element;
|
|
317
|
+
/**
|
|
318
|
+
* @since 0.3.16-canary.0
|
|
319
|
+
*/
|
|
182
320
|
interface SidebarMenuSubButtonProps extends ComponentProps<"a"> {
|
|
183
321
|
asChild?: boolean;
|
|
184
322
|
isActive?: boolean;
|
|
185
323
|
size?: "md" | "sm";
|
|
186
324
|
}
|
|
325
|
+
/**
|
|
326
|
+
* @since 0.3.16-canary.0
|
|
327
|
+
*/
|
|
187
328
|
declare function SidebarMenuSubButton({
|
|
188
329
|
asChild,
|
|
189
330
|
className,
|
|
@@ -13,6 +13,9 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
import { useCallback, useEffect, useState } from "react";
|
|
14
14
|
import { createContext } from "@radix-ui/react-context";
|
|
15
15
|
//#region src/components/sidebar.tsx
|
|
16
|
+
/**
|
|
17
|
+
* @since 0.3.16-canary.0
|
|
18
|
+
*/
|
|
16
19
|
const sidebarMenuButtonVariants = tv({
|
|
17
20
|
base: [
|
|
18
21
|
"peer/menu-button flex w-full items-center gap-2 overflow-hidden p-2",
|
|
@@ -54,6 +57,9 @@ const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
|
54
57
|
const SIDEBAR_WIDTH_ICON = "3.0625rem";
|
|
55
58
|
const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
56
59
|
const [SidebarContextProvider, useSidebar] = createContext("SidebarProvider");
|
|
60
|
+
/**
|
|
61
|
+
* @since 0.3.16-canary.0
|
|
62
|
+
*/
|
|
57
63
|
function SidebarProvider({ children, className, defaultOpen = true, onOpenChange: setOpenProperty, open: openProperty, style, ...props }) {
|
|
58
64
|
const isMobile = useIsMobile();
|
|
59
65
|
const [openMobile, setOpenMobile] = useState(false);
|
|
@@ -106,6 +112,9 @@ function SidebarProvider({ children, className, defaultOpen = true, onOpenChange
|
|
|
106
112
|
});
|
|
107
113
|
}
|
|
108
114
|
const SIDEBAR_NAME = "Sidebar";
|
|
115
|
+
/**
|
|
116
|
+
* @since 0.3.16-canary.0
|
|
117
|
+
*/
|
|
109
118
|
function Sidebar({ children, className, collapsible = "offcanvas", side = "left", variant = "sidebar", ...props }) {
|
|
110
119
|
const { isMobile, openMobile, setOpenMobile, state } = useSidebar(SIDEBAR_NAME);
|
|
111
120
|
if (collapsible === "none") return /* @__PURE__ */ jsx("div", {
|
|
@@ -158,6 +167,9 @@ function Sidebar({ children, className, collapsible = "offcanvas", side = "left"
|
|
|
158
167
|
});
|
|
159
168
|
}
|
|
160
169
|
const SIDEBAR_TRIGGER_NAME = "SidebarTrigger";
|
|
170
|
+
/**
|
|
171
|
+
* @since 0.3.16-canary.0
|
|
172
|
+
*/
|
|
161
173
|
function SidebarTrigger({ className, onClick, ...props }) {
|
|
162
174
|
const { toggleSidebar } = useSidebar(SIDEBAR_TRIGGER_NAME);
|
|
163
175
|
return /* @__PURE__ */ jsxs(Button, {
|
|
@@ -178,6 +190,9 @@ function SidebarTrigger({ className, onClick, ...props }) {
|
|
|
178
190
|
});
|
|
179
191
|
}
|
|
180
192
|
const SIDEBAR_RAIL_NAME = "SidebarRail";
|
|
193
|
+
/**
|
|
194
|
+
* @since 0.3.16-canary.0
|
|
195
|
+
*/
|
|
181
196
|
function SidebarRail({ className, ...props }) {
|
|
182
197
|
const { toggleSidebar } = useSidebar(SIDEBAR_RAIL_NAME);
|
|
183
198
|
return /* @__PURE__ */ jsx("button", {
|
|
@@ -190,6 +205,9 @@ function SidebarRail({ className, ...props }) {
|
|
|
190
205
|
...props
|
|
191
206
|
});
|
|
192
207
|
}
|
|
208
|
+
/**
|
|
209
|
+
* @since 0.3.16-canary.0
|
|
210
|
+
*/
|
|
193
211
|
function SidebarInset({ className, ...props }) {
|
|
194
212
|
return /* @__PURE__ */ jsx("main", {
|
|
195
213
|
className: 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),
|
|
@@ -197,6 +215,9 @@ function SidebarInset({ className, ...props }) {
|
|
|
197
215
|
...props
|
|
198
216
|
});
|
|
199
217
|
}
|
|
218
|
+
/**
|
|
219
|
+
* @since 0.3.16-canary.0
|
|
220
|
+
*/
|
|
200
221
|
function SidebarInput({ className, ...props }) {
|
|
201
222
|
return /* @__PURE__ */ jsx(Input, {
|
|
202
223
|
className: cn("h-8 w-full", "bg-background shadow-none", className),
|
|
@@ -205,6 +226,9 @@ function SidebarInput({ className, ...props }) {
|
|
|
205
226
|
...props
|
|
206
227
|
});
|
|
207
228
|
}
|
|
229
|
+
/**
|
|
230
|
+
* @since 0.3.16-canary.0
|
|
231
|
+
*/
|
|
208
232
|
function SidebarHeader({ className, ...props }) {
|
|
209
233
|
return /* @__PURE__ */ jsx("div", {
|
|
210
234
|
className: cn("flex flex-col gap-2", "p-2", className),
|
|
@@ -213,6 +237,9 @@ function SidebarHeader({ className, ...props }) {
|
|
|
213
237
|
...props
|
|
214
238
|
});
|
|
215
239
|
}
|
|
240
|
+
/**
|
|
241
|
+
* @since 0.3.16-canary.0
|
|
242
|
+
*/
|
|
216
243
|
function SidebarFooter({ className, ...props }) {
|
|
217
244
|
return /* @__PURE__ */ jsx("div", {
|
|
218
245
|
className: cn("flex flex-col gap-2", "p-2", className),
|
|
@@ -221,6 +248,9 @@ function SidebarFooter({ className, ...props }) {
|
|
|
221
248
|
...props
|
|
222
249
|
});
|
|
223
250
|
}
|
|
251
|
+
/**
|
|
252
|
+
* @since 0.3.16-canary.0
|
|
253
|
+
*/
|
|
224
254
|
function SidebarSeparator({ className, ...props }) {
|
|
225
255
|
return /* @__PURE__ */ jsx(Separator, {
|
|
226
256
|
className: cn("mx-2 w-auto", "bg-sidebar-border", className),
|
|
@@ -229,6 +259,9 @@ function SidebarSeparator({ className, ...props }) {
|
|
|
229
259
|
...props
|
|
230
260
|
});
|
|
231
261
|
}
|
|
262
|
+
/**
|
|
263
|
+
* @since 0.3.16-canary.0
|
|
264
|
+
*/
|
|
232
265
|
function SidebarContent({ className, ...props }) {
|
|
233
266
|
return /* @__PURE__ */ jsx("div", {
|
|
234
267
|
className: cn("flex min-h-0 flex-1 flex-col gap-2 overflow-auto", "group-data-[collapsible=icon]:overflow-hidden", className),
|
|
@@ -237,6 +270,9 @@ function SidebarContent({ className, ...props }) {
|
|
|
237
270
|
...props
|
|
238
271
|
});
|
|
239
272
|
}
|
|
273
|
+
/**
|
|
274
|
+
* @since 0.3.16-canary.0
|
|
275
|
+
*/
|
|
240
276
|
function SidebarGroup({ className, ...props }) {
|
|
241
277
|
return /* @__PURE__ */ jsx("div", {
|
|
242
278
|
className: cn("relative flex w-full min-w-0 flex-col", "p-2", className),
|
|
@@ -245,6 +281,9 @@ function SidebarGroup({ className, ...props }) {
|
|
|
245
281
|
...props
|
|
246
282
|
});
|
|
247
283
|
}
|
|
284
|
+
/**
|
|
285
|
+
* @since 0.3.16-canary.0
|
|
286
|
+
*/
|
|
248
287
|
function SidebarGroupLabel({ asChild = false, className, ...props }) {
|
|
249
288
|
return /* @__PURE__ */ jsx(asChild ? Slot : "div", {
|
|
250
289
|
className: cn("flex h-8 shrink-0 items-center px-2", "rounded-md ring-sidebar-ring outline-hidden", "truncate text-xs font-medium text-sidebar-foreground/70", "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),
|
|
@@ -253,6 +292,9 @@ function SidebarGroupLabel({ asChild = false, className, ...props }) {
|
|
|
253
292
|
...props
|
|
254
293
|
});
|
|
255
294
|
}
|
|
295
|
+
/**
|
|
296
|
+
* @since 0.3.16-canary.0
|
|
297
|
+
*/
|
|
256
298
|
function SidebarGroupAction({ asChild = false, className, ...props }) {
|
|
257
299
|
return /* @__PURE__ */ jsx(asChild ? Slot : "button", {
|
|
258
300
|
className: cn("absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center p-0", "rounded-md ring-sidebar-ring outline-hidden", "text-sidebar-foreground", "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),
|
|
@@ -261,6 +303,9 @@ function SidebarGroupAction({ asChild = false, className, ...props }) {
|
|
|
261
303
|
...props
|
|
262
304
|
});
|
|
263
305
|
}
|
|
306
|
+
/**
|
|
307
|
+
* @since 0.3.16-canary.0
|
|
308
|
+
*/
|
|
264
309
|
function SidebarGroupContent({ className, ...props }) {
|
|
265
310
|
return /* @__PURE__ */ jsx("div", {
|
|
266
311
|
className: cn("w-full", "text-sm", className),
|
|
@@ -269,6 +314,9 @@ function SidebarGroupContent({ className, ...props }) {
|
|
|
269
314
|
...props
|
|
270
315
|
});
|
|
271
316
|
}
|
|
317
|
+
/**
|
|
318
|
+
* @since 0.3.16-canary.0
|
|
319
|
+
*/
|
|
272
320
|
function SidebarMenu({ className, ...props }) {
|
|
273
321
|
return /* @__PURE__ */ jsx("ul", {
|
|
274
322
|
className: cn("flex w-full min-w-0 flex-col gap-1", className),
|
|
@@ -277,6 +325,9 @@ function SidebarMenu({ className, ...props }) {
|
|
|
277
325
|
...props
|
|
278
326
|
});
|
|
279
327
|
}
|
|
328
|
+
/**
|
|
329
|
+
* @since 0.3.16-canary.0
|
|
330
|
+
*/
|
|
280
331
|
function SidebarMenuItem({ className, ...props }) {
|
|
281
332
|
return /* @__PURE__ */ jsx("li", {
|
|
282
333
|
className: cn("group/menu-item relative", className),
|
|
@@ -286,6 +337,9 @@ function SidebarMenuItem({ className, ...props }) {
|
|
|
286
337
|
});
|
|
287
338
|
}
|
|
288
339
|
const SIDEBAR_MENU_BUTTON_NAME = "SidebarMenuButton";
|
|
340
|
+
/**
|
|
341
|
+
* @since 0.3.16-canary.0
|
|
342
|
+
*/
|
|
289
343
|
function SidebarMenuButton({ asChild = false, className, isActive = false, size = "md", tooltip, variant = "default", ...props }) {
|
|
290
344
|
const Component = asChild ? Slot : "button";
|
|
291
345
|
const { isMobile, state } = useSidebar(SIDEBAR_MENU_BUTTON_NAME);
|
|
@@ -312,6 +366,9 @@ function SidebarMenuButton({ asChild = false, className, isActive = false, size
|
|
|
312
366
|
...tooltip
|
|
313
367
|
})] });
|
|
314
368
|
}
|
|
369
|
+
/**
|
|
370
|
+
* @since 0.3.16-canary.0
|
|
371
|
+
*/
|
|
315
372
|
function SidebarMenuAction({ asChild = false, className, showOnHover = false, ...props }) {
|
|
316
373
|
return /* @__PURE__ */ jsx(asChild ? Slot : "button", {
|
|
317
374
|
className: cn("absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center p-0", "rounded-md ring-sidebar-ring outline-hidden", "text-sidebar-foreground", "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/menu-button:text-sidebar-accent-foreground md:opacity-0 data-open:opacity-100", className),
|
|
@@ -320,6 +377,9 @@ function SidebarMenuAction({ asChild = false, className, showOnHover = false, ..
|
|
|
320
377
|
...props
|
|
321
378
|
});
|
|
322
379
|
}
|
|
380
|
+
/**
|
|
381
|
+
* @since 0.3.16-canary.0
|
|
382
|
+
*/
|
|
323
383
|
function SidebarMenuBadge({ className, ...props }) {
|
|
324
384
|
return /* @__PURE__ */ jsx("div", {
|
|
325
385
|
className: cn("absolute right-1 flex h-5 min-w-5 items-center justify-center px-1", "rounded-md", "text-xs font-medium text-sidebar-foreground tabular-nums", "pointer-events-none select-none", "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", "peer-data-active/menu-button:text-sidebar-accent-foreground", className),
|
|
@@ -328,6 +388,9 @@ function SidebarMenuBadge({ className, ...props }) {
|
|
|
328
388
|
...props
|
|
329
389
|
});
|
|
330
390
|
}
|
|
391
|
+
/**
|
|
392
|
+
* @since 0.3.16-canary.0
|
|
393
|
+
*/
|
|
331
394
|
function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
|
|
332
395
|
const [width] = useState(() => `${String(Math.floor(Math.random() * 40) + 50)}%`);
|
|
333
396
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -345,6 +408,9 @@ function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
|
|
|
345
408
|
})]
|
|
346
409
|
});
|
|
347
410
|
}
|
|
411
|
+
/**
|
|
412
|
+
* @since 0.3.16-canary.0
|
|
413
|
+
*/
|
|
348
414
|
function SidebarMenuSub({ className, ...props }) {
|
|
349
415
|
return /* @__PURE__ */ jsx("ul", {
|
|
350
416
|
className: cn("mx-3.5 flex min-w-0 flex-col gap-1 px-2.5 py-0.5", "border-l border-sidebar-border", "translate-x-px", "group-data-[collapsible=icon]:hidden", className),
|
|
@@ -353,6 +419,9 @@ function SidebarMenuSub({ className, ...props }) {
|
|
|
353
419
|
...props
|
|
354
420
|
});
|
|
355
421
|
}
|
|
422
|
+
/**
|
|
423
|
+
* @since 0.3.16-canary.0
|
|
424
|
+
*/
|
|
356
425
|
function SidebarMenuSubItem({ className, ...props }) {
|
|
357
426
|
return /* @__PURE__ */ jsx("li", {
|
|
358
427
|
className: cn("group/menu-sub-item relative", className),
|
|
@@ -361,6 +430,9 @@ function SidebarMenuSubItem({ className, ...props }) {
|
|
|
361
430
|
...props
|
|
362
431
|
});
|
|
363
432
|
}
|
|
433
|
+
/**
|
|
434
|
+
* @since 0.3.16-canary.0
|
|
435
|
+
*/
|
|
364
436
|
function SidebarMenuSubButton({ asChild = false, className, isActive = false, size = "md", ...props }) {
|
|
365
437
|
return /* @__PURE__ */ jsx(asChild ? Slot : "a", {
|
|
366
438
|
className: cn("flex h-7 min-w-0 items-center gap-2 overflow-hidden px-2", "rounded-md ring-sidebar-ring outline-hidden", "text-sidebar-foreground", "-translate-x-px", "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:bg-sidebar-accent data-active:text-sidebar-accent-foreground", "group-data-[collapsible=icon]:hidden", "[&>span:last-child]:truncate", "[&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground", size === "sm" && "text-xs", size === "md" && "text-sm", className),
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { ComponentProps, JSX } from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/components/skeleton.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* @since 0.3.16-canary.0
|
|
6
|
+
*/
|
|
4
7
|
type SkeletonProps = ComponentProps<"div">;
|
|
8
|
+
/**
|
|
9
|
+
* @since 0.3.16-canary.0
|
|
10
|
+
*/
|
|
5
11
|
declare function Skeleton({
|
|
6
12
|
className,
|
|
7
13
|
...props
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.mjs";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/skeleton.tsx
|
|
4
|
+
/**
|
|
5
|
+
* @since 0.3.16-canary.0
|
|
6
|
+
*/
|
|
4
7
|
function Skeleton({ className, ...props }) {
|
|
5
8
|
return /* @__PURE__ */ jsx("div", {
|
|
6
9
|
className: cn("rounded-lg", "bg-muted", "animate-pulse", className),
|
|
@@ -2,7 +2,13 @@ import { ComponentProps, JSX } from "react";
|
|
|
2
2
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
3
3
|
|
|
4
4
|
//#region src/components/slider.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* @since 0.3.16-canary.0
|
|
7
|
+
*/
|
|
5
8
|
type SliderProps = ComponentProps<typeof SliderPrimitive.Root>;
|
|
9
|
+
/**
|
|
10
|
+
* @since 0.3.16-canary.0
|
|
11
|
+
*/
|
|
6
12
|
declare function Slider({
|
|
7
13
|
className,
|
|
8
14
|
defaultValue,
|
|
@@ -4,6 +4,9 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
import { useMemo } from "react";
|
|
5
5
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
6
6
|
//#region src/components/slider.tsx
|
|
7
|
+
/**
|
|
8
|
+
* @since 0.3.16-canary.0
|
|
9
|
+
*/
|
|
7
10
|
function Slider({ className, defaultValue, max = 100, min = 0, value, ...props }) {
|
|
8
11
|
const _values = useMemo(() => {
|
|
9
12
|
if (Array.isArray(value)) return value;
|
|
@@ -2,7 +2,13 @@ import { JSX } from "react";
|
|
|
2
2
|
import { ToasterProps as ToasterProps$1, toast, useSonner } from "sonner";
|
|
3
3
|
|
|
4
4
|
//#region src/components/sonner.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* @since 0.3.16-canary.0
|
|
7
|
+
*/
|
|
5
8
|
type ToasterProps = ToasterProps$1;
|
|
9
|
+
/**
|
|
10
|
+
* @since 0.3.16-canary.0
|
|
11
|
+
*/
|
|
6
12
|
declare function Toaster({
|
|
7
13
|
...props
|
|
8
14
|
}: ToasterProps): JSX.Element;
|
|
@@ -4,6 +4,9 @@ import { jsx } from "react/jsx-runtime";
|
|
|
4
4
|
import { useTheme } from "next-themes";
|
|
5
5
|
import { Toaster as Toaster$1, toast, useSonner } from "sonner";
|
|
6
6
|
//#region src/components/sonner.tsx
|
|
7
|
+
/**
|
|
8
|
+
* @since 0.3.16-canary.0
|
|
9
|
+
*/
|
|
7
10
|
function Toaster({ ...props }) {
|
|
8
11
|
const { theme = "system" } = useTheme();
|
|
9
12
|
return /* @__PURE__ */ jsx(Toaster$1, {
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { ComponentProps, ReactNode } from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/components/spinner.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* @since 0.3.16-canary.0
|
|
6
|
+
*/
|
|
4
7
|
interface SpinnerProps extends ComponentProps<"span"> {
|
|
5
8
|
loading?: boolean;
|
|
6
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* @since 0.3.16-canary.0
|
|
12
|
+
*/
|
|
7
13
|
declare function Spinner({
|
|
8
14
|
children,
|
|
9
15
|
className,
|
|
@@ -4,6 +4,9 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
|
|
5
5
|
//#region src/components/spinner.tsx
|
|
6
6
|
const SPINNER_COUNT = 8;
|
|
7
|
+
/**
|
|
8
|
+
* @since 0.3.16-canary.0
|
|
9
|
+
*/
|
|
7
10
|
function Spinner({ children, className, loading = true, ...props }) {
|
|
8
11
|
if (!loading) return children;
|
|
9
12
|
const spinner = /* @__PURE__ */ jsx("span", {
|
|
@@ -2,7 +2,13 @@ import { ComponentProps, JSX } from "react";
|
|
|
2
2
|
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
3
3
|
|
|
4
4
|
//#region src/components/switch.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* @since 0.3.16-canary.0
|
|
7
|
+
*/
|
|
5
8
|
type SwitchProps = ComponentProps<typeof SwitchPrimitives.Root>;
|
|
9
|
+
/**
|
|
10
|
+
* @since 0.3.16-canary.0
|
|
11
|
+
*/
|
|
6
12
|
declare function Switch({
|
|
7
13
|
className,
|
|
8
14
|
...props
|
|
@@ -3,6 +3,9 @@ import { cn } from "../lib/utils.mjs";
|
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
5
5
|
//#region src/components/switch.tsx
|
|
6
|
+
/**
|
|
7
|
+
* @since 0.3.16-canary.0
|
|
8
|
+
*/
|
|
6
9
|
function Switch({ className, ...props }) {
|
|
7
10
|
return /* @__PURE__ */ jsx(SwitchPrimitives.Root, {
|
|
8
11
|
className: cn("peer inline-flex h-5 w-9 shrink-0 items-center p-0.75", "rounded-full border border-transparent shadow-xs outline-hidden", "transition-all", "focus-visible:ring-3 focus-visible:ring-ring/50", "focus-visible:not-data-checked:border-ring/60", "disabled:opacity-50", "data-checked:bg-primary", "data-checked:focus-visible:ring-primary/20", "dark:data-checked:focus-visible:ring-primary/40", "data-unchecked:bg-input", "dark:data-unchecked:bg-input/80", className),
|