@locusgraph/components 0.2.0 → 0.2.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 (102) hide show
  1. package/dist/action/button-group.js +148 -17
  2. package/dist/action/button.js +91 -27
  3. package/dist/action/toggle-group.js +176 -12
  4. package/dist/action/toggle.js +70 -17
  5. package/dist/display/avatar.js +118 -7
  6. package/dist/display/badge.js +74 -20
  7. package/dist/display/chart/chart-container.js +205 -45
  8. package/dist/display/chart/chart-legend.js +79 -14
  9. package/dist/display/chart/chart-tooltip.js +211 -40
  10. package/dist/display/chat/attachment/attachment-parts.js +222 -13
  11. package/dist/display/chat/attachment/attachment.js +210 -28
  12. package/dist/display/chat/bubble.js +225 -37
  13. package/dist/display/chat/marker.js +143 -15
  14. package/dist/display/chat/message-scroller.js +276 -14
  15. package/dist/display/chat/message.js +238 -13
  16. package/dist/display/content/item.js +448 -47
  17. package/dist/display/content/kbd.js +78 -5
  18. package/dist/display/media/aspect-ratio.js +27 -3
  19. package/dist/display/media/carousel-controls.js +162 -11
  20. package/dist/display/media/carousel.js +325 -65
  21. package/dist/display/rule-grid/rule-grid.js +309 -29
  22. package/dist/display/separator.js +56 -3
  23. package/dist/display/skeletons/layouts/skeleton-rule-grid.js +79 -6
  24. package/dist/display/skeletons/layouts/skeleton-table.js +163 -5
  25. package/dist/display/skeletons/shapes/skeleton-avatar.js +95 -13
  26. package/dist/display/skeletons/shapes/skeleton-button.js +95 -13
  27. package/dist/display/skeletons/shapes/skeleton-text.js +78 -7
  28. package/dist/display/skeletons/skeleton-parts.js +63 -6
  29. package/dist/display/status/alert.js +136 -18
  30. package/dist/display/status/empty.js +250 -22
  31. package/dist/display/status/progress.js +116 -16
  32. package/dist/display/status/skeleton.js +40 -3
  33. package/dist/display/status/spinner.js +41 -3
  34. package/dist/display/table.js +310 -17
  35. package/dist/feedback/toaster.js +98 -21
  36. package/dist/form/advanced/calendar-day-button.js +89 -12
  37. package/dist/form/advanced/calendar.js +349 -56
  38. package/dist/form/advanced/combobox/combobox-chips.js +151 -8
  39. package/dist/form/advanced/combobox/combobox-items.js +239 -14
  40. package/dist/form/advanced/combobox/combobox.js +386 -13
  41. package/dist/form/advanced/input-otp.js +201 -11
  42. package/dist/form/choice/checkbox.js +58 -3
  43. package/dist/form/choice/radio-group.js +94 -5
  44. package/dist/form/choice/select.js +479 -25
  45. package/dist/form/choice/slider.js +118 -4
  46. package/dist/form/choice/switch.js +53 -3
  47. package/dist/form/field/field-error.js +117 -14
  48. package/dist/form/field/field-separator.js +70 -3
  49. package/dist/form/field/field-set.js +85 -5
  50. package/dist/form/field/field-text.js +116 -7
  51. package/dist/form/field/field.js +137 -25
  52. package/dist/form/hook-form/form.js +338 -40
  53. package/dist/form/input-group.js +297 -47
  54. package/dist/form/input.js +47 -3
  55. package/dist/form/label.js +42 -3
  56. package/dist/form/native-select.js +147 -7
  57. package/dist/form/textarea.js +41 -3
  58. package/dist/layout/accordion.js +165 -8
  59. package/dist/layout/collapsible.js +75 -7
  60. package/dist/layout/resizable.js +122 -7
  61. package/dist/layout/scroll/direction.js +25 -3
  62. package/dist/layout/scroll/scroll-area.js +138 -5
  63. package/dist/layout/sidebar/sidebar-context.js +184 -51
  64. package/dist/layout/sidebar/sidebar-menu-sub.js +219 -14
  65. package/dist/layout/sidebar/sidebar-menu.js +319 -38
  66. package/dist/layout/sidebar/sidebar-sections.js +369 -22
  67. package/dist/layout/sidebar/sidebar.js +384 -28
  68. package/dist/layout/tabs.js +183 -18
  69. package/dist/layout/use-mobile.js +23 -10
  70. package/dist/navigation/breadcrumb.js +301 -17
  71. package/dist/navigation/menubar/menubar-items.js +322 -16
  72. package/dist/navigation/menubar/menubar-sub.js +125 -7
  73. package/dist/navigation/menubar/menubar.js +213 -13
  74. package/dist/navigation/navigation-menu.js +366 -18
  75. package/dist/navigation/pagination.js +328 -20
  76. package/dist/overlay/alert-dialog.js +485 -26
  77. package/dist/overlay/context-menu/context-menu-items.js +322 -16
  78. package/dist/overlay/context-menu/context-menu-sub.js +125 -7
  79. package/dist/overlay/context-menu/context-menu.js +140 -11
  80. package/dist/overlay/dialog.js +405 -24
  81. package/dist/overlay/floating/command.js +423 -20
  82. package/dist/overlay/floating/drawer.js +354 -22
  83. package/dist/overlay/floating/hover-card.js +107 -7
  84. package/dist/overlay/menu/dropdown-menu-choice.js +149 -7
  85. package/dist/overlay/menu/dropdown-menu-item.js +174 -9
  86. package/dist/overlay/menu/dropdown-menu-sub.js +124 -7
  87. package/dist/overlay/menu/dropdown-menu.js +147 -12
  88. package/dist/overlay/popover.js +106 -7
  89. package/dist/overlay/sheet.js +379 -26
  90. package/dist/overlay/tooltip.js +145 -9
  91. package/dist/shell/app-header.js +81 -5
  92. package/dist/shell/app-shell.js +58 -3
  93. package/dist/shell/breadcrumbs.js +102 -12
  94. package/dist/shell/docs/docs-header.js +210 -10
  95. package/dist/shell/docs/docs-shell.js +100 -3
  96. package/dist/shell/docs/docs-sidebar.js +88 -7
  97. package/dist/shell/docs/on-this-page.js +78 -7
  98. package/dist/shell/docs/use-active-section.js +88 -42
  99. package/dist/shell/navigation/app-sidebar.js +188 -6
  100. package/dist/shell/navigation/nav-group.js +161 -10
  101. package/dist/shell/theme-toggle.js +51 -4
  102. package/package.json +2 -2
@@ -1,40 +1,396 @@
1
1
  "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+
3
+ import { c as _c } from "react/compiler-runtime";
3
4
  import { SidePanelOpen as PanelLeftIcon } from "@carbon/icons-react";
4
5
  import { cn } from "cn";
5
6
  import { Button } from "../../action/button.js";
6
- import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, } from "../../overlay/sheet.js";
7
+ import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "../../overlay/sheet.js";
7
8
  import { SIDEBAR_WIDTH_MOBILE, useSidebar } from "./sidebar-context.js";
8
- function Sidebar({ side = "left", variant = "sidebar", collapsible = "offcanvas", className, children, ...props }) {
9
- const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
10
- if (collapsible === "none") {
11
- return (_jsx("div", { "data-slot": "sidebar", className: cn("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground", className), ...props, children: children }));
9
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
+ function Sidebar(t0) {
11
+ const $ = _c(46);
12
+ let children;
13
+ let className;
14
+ let props;
15
+ let t1;
16
+ let t2;
17
+ let t3;
18
+ if ($[0] !== t0) {
19
+ ({
20
+ side: t1,
21
+ variant: t2,
22
+ collapsible: t3,
23
+ className,
24
+ children,
25
+ ...props
26
+ } = t0);
27
+ $[0] = t0;
28
+ $[1] = children;
29
+ $[2] = className;
30
+ $[3] = props;
31
+ $[4] = t1;
32
+ $[5] = t2;
33
+ $[6] = t3;
34
+ } else {
35
+ children = $[1];
36
+ className = $[2];
37
+ props = $[3];
38
+ t1 = $[4];
39
+ t2 = $[5];
40
+ t3 = $[6];
41
+ }
42
+ const side = t1 === undefined ? "left" : t1;
43
+ const variant = t2 === undefined ? "sidebar" : t2;
44
+ const collapsible = t3 === undefined ? "offcanvas" : t3;
45
+ const {
46
+ isMobile,
47
+ state,
48
+ openMobile,
49
+ setOpenMobile
50
+ } = useSidebar();
51
+ if (collapsible === "none") {
52
+ let t4;
53
+ if ($[7] !== className) {
54
+ t4 = cn("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground", className);
55
+ $[7] = className;
56
+ $[8] = t4;
57
+ } else {
58
+ t4 = $[8];
59
+ }
60
+ let t5;
61
+ if ($[9] !== children || $[10] !== props || $[11] !== t4) {
62
+ t5 = /*#__PURE__*/_jsx("div", {
63
+ "data-slot": "sidebar",
64
+ className: t4,
65
+ ...props,
66
+ children: children
67
+ });
68
+ $[9] = children;
69
+ $[10] = props;
70
+ $[11] = t4;
71
+ $[12] = t5;
72
+ } else {
73
+ t5 = $[12];
74
+ }
75
+ return t5;
76
+ }
77
+ if (isMobile) {
78
+ let t4;
79
+ if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
80
+ t4 = {
81
+ "--sidebar-width": SIDEBAR_WIDTH_MOBILE
82
+ };
83
+ $[13] = t4;
84
+ } else {
85
+ t4 = $[13];
86
+ }
87
+ let t5;
88
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
89
+ t5 = /*#__PURE__*/_jsxs(SheetHeader, {
90
+ className: "sr-only",
91
+ children: [/*#__PURE__*/_jsx(SheetTitle, {
92
+ children: "Sidebar"
93
+ }), /*#__PURE__*/_jsx(SheetDescription, {
94
+ children: "Displays the mobile sidebar."
95
+ })]
96
+ });
97
+ $[14] = t5;
98
+ } else {
99
+ t5 = $[14];
100
+ }
101
+ let t6;
102
+ if ($[15] !== children) {
103
+ t6 = /*#__PURE__*/_jsx("div", {
104
+ className: "flex h-full w-full flex-col",
105
+ children: children
106
+ });
107
+ $[15] = children;
108
+ $[16] = t6;
109
+ } else {
110
+ t6 = $[16];
111
+ }
112
+ let t7;
113
+ if ($[17] !== side || $[18] !== t6) {
114
+ t7 = /*#__PURE__*/_jsxs(SheetContent, {
115
+ "data-sidebar": "sidebar",
116
+ "data-slot": "sidebar",
117
+ "data-mobile": "true",
118
+ className: "w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
119
+ style: t4,
120
+ side: side,
121
+ children: [t5, t6]
122
+ });
123
+ $[17] = side;
124
+ $[18] = t6;
125
+ $[19] = t7;
126
+ } else {
127
+ t7 = $[19];
12
128
  }
13
- if (isMobile) {
14
- return (_jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: _jsxs(SheetContent, { "data-sidebar": "sidebar", "data-slot": "sidebar", "data-mobile": "true", className: "w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden", style: {
15
- "--sidebar-width": SIDEBAR_WIDTH_MOBILE,
16
- }, side: side, children: [_jsxs(SheetHeader, { className: "sr-only", children: [_jsx(SheetTitle, { children: "Sidebar" }), _jsx(SheetDescription, { children: "Displays the mobile sidebar." })] }), _jsx("div", { className: "flex h-full w-full flex-col", children: children })] }) }));
129
+ let t8;
130
+ if ($[20] !== openMobile || $[21] !== props || $[22] !== setOpenMobile || $[23] !== t7) {
131
+ t8 = /*#__PURE__*/_jsx(Sheet, {
132
+ open: openMobile,
133
+ onOpenChange: setOpenMobile,
134
+ ...props,
135
+ children: t7
136
+ });
137
+ $[20] = openMobile;
138
+ $[21] = props;
139
+ $[22] = setOpenMobile;
140
+ $[23] = t7;
141
+ $[24] = t8;
142
+ } else {
143
+ t8 = $[24];
17
144
  }
18
- return (_jsxs("div", { className: "group peer hidden text-sidebar-foreground md:block", "data-state": state, "data-collapsible": state === "collapsed" ? collapsible : "", "data-variant": variant, "data-side": side, "data-slot": "sidebar", children: [_jsx("div", { "data-slot": "sidebar-gap", className: 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", variant === "floating" || variant === "inset"
19
- ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]"
20
- : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)") }), _jsx("div", { "data-slot": "sidebar-container", className: cn("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex", side === "left"
21
- ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]"
22
- : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]", variant === "floating" || variant === "inset"
23
- ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]"
24
- : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l", className), ...props, children: _jsx("div", { "data-sidebar": "sidebar", "data-slot": "sidebar-inner", 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", children: children }) })] }));
145
+ return t8;
146
+ }
147
+ const t4 = state === "collapsed" ? collapsible : "";
148
+ const t5 = variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)";
149
+ let t6;
150
+ if ($[25] !== t5) {
151
+ t6 = 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", t5);
152
+ $[25] = t5;
153
+ $[26] = t6;
154
+ } else {
155
+ t6 = $[26];
156
+ }
157
+ let t7;
158
+ if ($[27] !== t6) {
159
+ t7 = /*#__PURE__*/_jsx("div", {
160
+ "data-slot": "sidebar-gap",
161
+ className: t6
162
+ });
163
+ $[27] = t6;
164
+ $[28] = t7;
165
+ } else {
166
+ t7 = $[28];
167
+ }
168
+ const t8 = side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]";
169
+ const t9 = variant === "floating" || variant === "inset" ? "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";
170
+ let t10;
171
+ if ($[29] !== className || $[30] !== t8 || $[31] !== t9) {
172
+ t10 = cn("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex", t8, t9, className);
173
+ $[29] = className;
174
+ $[30] = t8;
175
+ $[31] = t9;
176
+ $[32] = t10;
177
+ } else {
178
+ t10 = $[32];
179
+ }
180
+ let t11;
181
+ if ($[33] !== children) {
182
+ t11 = /*#__PURE__*/_jsx("div", {
183
+ "data-sidebar": "sidebar",
184
+ "data-slot": "sidebar-inner",
185
+ 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",
186
+ children: children
187
+ });
188
+ $[33] = children;
189
+ $[34] = t11;
190
+ } else {
191
+ t11 = $[34];
192
+ }
193
+ let t12;
194
+ if ($[35] !== props || $[36] !== t10 || $[37] !== t11) {
195
+ t12 = /*#__PURE__*/_jsx("div", {
196
+ "data-slot": "sidebar-container",
197
+ className: t10,
198
+ ...props,
199
+ children: t11
200
+ });
201
+ $[35] = props;
202
+ $[36] = t10;
203
+ $[37] = t11;
204
+ $[38] = t12;
205
+ } else {
206
+ t12 = $[38];
207
+ }
208
+ let t13;
209
+ if ($[39] !== side || $[40] !== state || $[41] !== t12 || $[42] !== t4 || $[43] !== t7 || $[44] !== variant) {
210
+ t13 = /*#__PURE__*/_jsxs("div", {
211
+ className: "group peer hidden text-sidebar-foreground md:block",
212
+ "data-state": state,
213
+ "data-collapsible": t4,
214
+ "data-variant": variant,
215
+ "data-side": side,
216
+ "data-slot": "sidebar",
217
+ children: [t7, t12]
218
+ });
219
+ $[39] = side;
220
+ $[40] = state;
221
+ $[41] = t12;
222
+ $[42] = t4;
223
+ $[43] = t7;
224
+ $[44] = variant;
225
+ $[45] = t13;
226
+ } else {
227
+ t13 = $[45];
228
+ }
229
+ return t13;
25
230
  }
26
- function SidebarTrigger({ className, onClick, ...props }) {
27
- const { toggleSidebar } = useSidebar();
28
- return (_jsxs(Button, { "data-sidebar": "trigger", "data-slot": "sidebar-trigger", variant: "ghost", size: "icon", className: cn("size-7", className), onClick: (event) => {
29
- onClick?.(event);
30
- toggleSidebar();
31
- }, ...props, children: [_jsx(PanelLeftIcon, {}), _jsx("span", { className: "sr-only", children: "Toggle Sidebar" })] }));
231
+ function SidebarTrigger(t0) {
232
+ const $ = _c(15);
233
+ let className;
234
+ let onClick;
235
+ let props;
236
+ if ($[0] !== t0) {
237
+ ({
238
+ className,
239
+ onClick,
240
+ ...props
241
+ } = t0);
242
+ $[0] = t0;
243
+ $[1] = className;
244
+ $[2] = onClick;
245
+ $[3] = props;
246
+ } else {
247
+ className = $[1];
248
+ onClick = $[2];
249
+ props = $[3];
250
+ }
251
+ const {
252
+ toggleSidebar
253
+ } = useSidebar();
254
+ let t1;
255
+ if ($[4] !== className) {
256
+ t1 = cn("size-7", className);
257
+ $[4] = className;
258
+ $[5] = t1;
259
+ } else {
260
+ t1 = $[5];
261
+ }
262
+ let t2;
263
+ if ($[6] !== onClick || $[7] !== toggleSidebar) {
264
+ t2 = event => {
265
+ onClick?.(event);
266
+ toggleSidebar();
267
+ };
268
+ $[6] = onClick;
269
+ $[7] = toggleSidebar;
270
+ $[8] = t2;
271
+ } else {
272
+ t2 = $[8];
273
+ }
274
+ let t3;
275
+ let t4;
276
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
277
+ t3 = /*#__PURE__*/_jsx(PanelLeftIcon, {});
278
+ t4 = /*#__PURE__*/_jsx("span", {
279
+ className: "sr-only",
280
+ children: "Toggle Sidebar"
281
+ });
282
+ $[9] = t3;
283
+ $[10] = t4;
284
+ } else {
285
+ t3 = $[9];
286
+ t4 = $[10];
287
+ }
288
+ let t5;
289
+ if ($[11] !== props || $[12] !== t1 || $[13] !== t2) {
290
+ t5 = /*#__PURE__*/_jsxs(Button, {
291
+ "data-sidebar": "trigger",
292
+ "data-slot": "sidebar-trigger",
293
+ variant: "ghost",
294
+ size: "icon",
295
+ className: t1,
296
+ onClick: t2,
297
+ ...props,
298
+ children: [t3, t4]
299
+ });
300
+ $[11] = props;
301
+ $[12] = t1;
302
+ $[13] = t2;
303
+ $[14] = t5;
304
+ } else {
305
+ t5 = $[14];
306
+ }
307
+ return t5;
32
308
  }
33
- function SidebarRail({ className, ...props }) {
34
- const { toggleSidebar } = useSidebar();
35
- return (_jsx("button", { "data-sidebar": "rail", "data-slot": "sidebar-rail", "aria-label": "Toggle Sidebar", tabIndex: -1, onClick: toggleSidebar, title: "Toggle Sidebar", className: cn("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex", "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize", "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize", "group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar", "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2", "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2", className), ...props }));
309
+ function SidebarRail(t0) {
310
+ const $ = _c(9);
311
+ let className;
312
+ let props;
313
+ if ($[0] !== t0) {
314
+ ({
315
+ className,
316
+ ...props
317
+ } = t0);
318
+ $[0] = t0;
319
+ $[1] = className;
320
+ $[2] = props;
321
+ } else {
322
+ className = $[1];
323
+ props = $[2];
324
+ }
325
+ const {
326
+ toggleSidebar
327
+ } = useSidebar();
328
+ let t1;
329
+ if ($[3] !== className) {
330
+ t1 = cn("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex", "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize", "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize", "group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar", "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2", "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2", className);
331
+ $[3] = className;
332
+ $[4] = t1;
333
+ } else {
334
+ t1 = $[4];
335
+ }
336
+ let t2;
337
+ if ($[5] !== props || $[6] !== t1 || $[7] !== toggleSidebar) {
338
+ t2 = /*#__PURE__*/_jsx("button", {
339
+ "data-sidebar": "rail",
340
+ "data-slot": "sidebar-rail",
341
+ "aria-label": "Toggle Sidebar",
342
+ tabIndex: -1,
343
+ onClick: toggleSidebar,
344
+ title: "Toggle Sidebar",
345
+ className: t1,
346
+ ...props
347
+ });
348
+ $[5] = props;
349
+ $[6] = t1;
350
+ $[7] = toggleSidebar;
351
+ $[8] = t2;
352
+ } else {
353
+ t2 = $[8];
354
+ }
355
+ return t2;
36
356
  }
37
- function SidebarInset({ className, ...props }) {
38
- return (_jsx("main", { "data-slot": "sidebar-inset", className: cn("relative flex w-full 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), ...props }));
357
+ function SidebarInset(t0) {
358
+ const $ = _c(8);
359
+ let className;
360
+ let props;
361
+ if ($[0] !== t0) {
362
+ ({
363
+ className,
364
+ ...props
365
+ } = t0);
366
+ $[0] = t0;
367
+ $[1] = className;
368
+ $[2] = props;
369
+ } else {
370
+ className = $[1];
371
+ props = $[2];
372
+ }
373
+ let t1;
374
+ if ($[3] !== className) {
375
+ t1 = cn("relative flex w-full 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);
376
+ $[3] = className;
377
+ $[4] = t1;
378
+ } else {
379
+ t1 = $[4];
380
+ }
381
+ let t2;
382
+ if ($[5] !== props || $[6] !== t1) {
383
+ t2 = /*#__PURE__*/_jsx("main", {
384
+ "data-slot": "sidebar-inset",
385
+ className: t1,
386
+ ...props
387
+ });
388
+ $[5] = props;
389
+ $[6] = t1;
390
+ $[7] = t2;
391
+ } else {
392
+ t2 = $[7];
393
+ }
394
+ return t2;
39
395
  }
40
396
  export { Sidebar, SidebarInset, SidebarRail, SidebarTrigger };
@@ -1,30 +1,195 @@
1
1
  "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
2
+
3
+ import { c as _c } from "react/compiler-runtime";
3
4
  import { cva } from "class-variance-authority";
4
5
  import { cn } from "cn";
5
6
  import * as TabsPrimitive from "radix-ui/tabs";
6
- function Tabs({ className, orientation = "horizontal", ...props }) {
7
- return (_jsx(TabsPrimitive.Root, { "data-slot": "tabs", "data-orientation": orientation, orientation: orientation, className: cn("group/tabs flex gap-4 data-[orientation=horizontal]:flex-col data-[orientation=vertical]:gap-6", className), ...props }));
7
+ import * as React from "react";
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ function Tabs(t0) {
10
+ const $ = _c(10);
11
+ let className;
12
+ let props;
13
+ let t1;
14
+ if ($[0] !== t0) {
15
+ ({
16
+ className,
17
+ orientation: t1,
18
+ ...props
19
+ } = t0);
20
+ $[0] = t0;
21
+ $[1] = className;
22
+ $[2] = props;
23
+ $[3] = t1;
24
+ } else {
25
+ className = $[1];
26
+ props = $[2];
27
+ t1 = $[3];
28
+ }
29
+ const orientation = t1 === undefined ? "horizontal" : t1;
30
+ let t2;
31
+ if ($[4] !== className) {
32
+ t2 = cn("group/tabs flex gap-4 data-[orientation=horizontal]:flex-col data-[orientation=vertical]:gap-6", className);
33
+ $[4] = className;
34
+ $[5] = t2;
35
+ } else {
36
+ t2 = $[5];
37
+ }
38
+ let t3;
39
+ if ($[6] !== orientation || $[7] !== props || $[8] !== t2) {
40
+ t3 = /*#__PURE__*/_jsx(TabsPrimitive.Root, {
41
+ "data-slot": "tabs",
42
+ "data-orientation": orientation,
43
+ orientation: orientation,
44
+ className: t2,
45
+ ...props
46
+ });
47
+ $[6] = orientation;
48
+ $[7] = props;
49
+ $[8] = t2;
50
+ $[9] = t3;
51
+ } else {
52
+ t3 = $[9];
53
+ }
54
+ return t3;
8
55
  }
9
56
  const tabsListVariants = cva("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none", {
10
- variants: {
11
- variant: {
12
- default: "bg-muted",
13
- line: "gap-1 bg-transparent group-data-[orientation=horizontal]/tabs:border-b group-data-[orientation=horizontal]/tabs:border-line group-data-[orientation=vertical]/tabs:border-r group-data-[orientation=vertical]/tabs:border-line",
14
- },
15
- },
16
- defaultVariants: {
17
- variant: "default",
18
- },
57
+ variants: {
58
+ variant: {
59
+ default: "bg-muted",
60
+ line: "gap-1 bg-transparent group-data-[orientation=horizontal]/tabs:border-b group-data-[orientation=horizontal]/tabs:border-line group-data-[orientation=vertical]/tabs:border-r group-data-[orientation=vertical]/tabs:border-line"
61
+ }
62
+ },
63
+ defaultVariants: {
64
+ variant: "default"
65
+ }
19
66
  });
20
- function TabsList({ className, variant = "default", ...props }) {
21
- return (_jsx(TabsPrimitive.List, { "data-slot": "tabs-list", "data-variant": variant, className: cn(tabsListVariants({ variant }), className), ...props }));
67
+ function TabsList(t0) {
68
+ const $ = _c(11);
69
+ let className;
70
+ let props;
71
+ let t1;
72
+ if ($[0] !== t0) {
73
+ ({
74
+ className,
75
+ variant: t1,
76
+ ...props
77
+ } = t0);
78
+ $[0] = t0;
79
+ $[1] = className;
80
+ $[2] = props;
81
+ $[3] = t1;
82
+ } else {
83
+ className = $[1];
84
+ props = $[2];
85
+ t1 = $[3];
86
+ }
87
+ const variant = t1 === undefined ? "default" : t1;
88
+ let t2;
89
+ if ($[4] !== className || $[5] !== variant) {
90
+ t2 = cn(tabsListVariants({
91
+ variant
92
+ }), className);
93
+ $[4] = className;
94
+ $[5] = variant;
95
+ $[6] = t2;
96
+ } else {
97
+ t2 = $[6];
98
+ }
99
+ let t3;
100
+ if ($[7] !== props || $[8] !== t2 || $[9] !== variant) {
101
+ t3 = /*#__PURE__*/_jsx(TabsPrimitive.List, {
102
+ "data-slot": "tabs-list",
103
+ "data-variant": variant,
104
+ className: t2,
105
+ ...props
106
+ });
107
+ $[7] = props;
108
+ $[8] = t2;
109
+ $[9] = variant;
110
+ $[10] = t3;
111
+ } else {
112
+ t3 = $[10];
113
+ }
114
+ return t3;
22
115
  }
23
- function TabsTrigger({ className, ...props }) {
24
- return (_jsx(TabsPrimitive.Trigger, { "data-slot": "tabs-trigger", className: cn("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-[color,background-color,border-color,box-shadow] duration-150 ease-out group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent", "data-[state=active]:bg-background data-[state=active]:text-foreground group-data-[variant=default]/tabs-list:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground", "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-4px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100", className), ...props }));
116
+ function TabsTrigger(t0) {
117
+ const $ = _c(8);
118
+ let className;
119
+ let props;
120
+ if ($[0] !== t0) {
121
+ ({
122
+ className,
123
+ ...props
124
+ } = t0);
125
+ $[0] = t0;
126
+ $[1] = className;
127
+ $[2] = props;
128
+ } else {
129
+ className = $[1];
130
+ props = $[2];
131
+ }
132
+ let t1;
133
+ if ($[3] !== className) {
134
+ t1 = cn("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-[color,background-color,border-color,box-shadow] duration-150 ease-out group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent", "data-[state=active]:bg-background data-[state=active]:text-foreground group-data-[variant=default]/tabs-list:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground", "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-4px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100", className);
135
+ $[3] = className;
136
+ $[4] = t1;
137
+ } else {
138
+ t1 = $[4];
139
+ }
140
+ let t2;
141
+ if ($[5] !== props || $[6] !== t1) {
142
+ t2 = /*#__PURE__*/_jsx(TabsPrimitive.Trigger, {
143
+ "data-slot": "tabs-trigger",
144
+ className: t1,
145
+ ...props
146
+ });
147
+ $[5] = props;
148
+ $[6] = t1;
149
+ $[7] = t2;
150
+ } else {
151
+ t2 = $[7];
152
+ }
153
+ return t2;
25
154
  }
26
155
  const visibleKeyboardFocusOutline = "focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-solid focus-visible:outline-ring/70";
27
- function TabsContent({ className, ...props }) {
28
- return (_jsx(TabsPrimitive.Content, { "data-slot": "tabs-content", className: cn("flex-1 outline-none", visibleKeyboardFocusOutline, className), ...props }));
156
+ function TabsContent(t0) {
157
+ const $ = _c(8);
158
+ let className;
159
+ let props;
160
+ if ($[0] !== t0) {
161
+ ({
162
+ className,
163
+ ...props
164
+ } = t0);
165
+ $[0] = t0;
166
+ $[1] = className;
167
+ $[2] = props;
168
+ } else {
169
+ className = $[1];
170
+ props = $[2];
171
+ }
172
+ let t1;
173
+ if ($[3] !== className) {
174
+ t1 = cn("flex-1 outline-none", visibleKeyboardFocusOutline, className);
175
+ $[3] = className;
176
+ $[4] = t1;
177
+ } else {
178
+ t1 = $[4];
179
+ }
180
+ let t2;
181
+ if ($[5] !== props || $[6] !== t1) {
182
+ t2 = /*#__PURE__*/_jsx(TabsPrimitive.Content, {
183
+ "data-slot": "tabs-content",
184
+ className: t1,
185
+ ...props
186
+ });
187
+ $[5] = props;
188
+ $[6] = t1;
189
+ $[7] = t2;
190
+ } else {
191
+ t2 = $[7];
192
+ }
193
+ return t2;
29
194
  }
30
195
  export { Tabs, TabsContent, TabsList, TabsTrigger, tabsListVariants };
@@ -1,15 +1,28 @@
1
+ import { c as _c } from "react/compiler-runtime";
1
2
  import * as React from "react";
2
3
  const MOBILE_BREAKPOINT = 768;
3
4
  export function useIsMobile() {
4
- const [isMobile, setIsMobile] = React.useState(undefined);
5
- React.useEffect(() => {
6
- const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
7
- const onChange = () => {
8
- setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
9
- };
10
- mql.addEventListener("change", onChange);
5
+ const $ = _c(2);
6
+ const [isMobile, setIsMobile] = React.useState(undefined);
7
+ let t0;
8
+ let t1;
9
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
10
+ t0 = () => {
11
+ const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
12
+ const onChange = () => {
11
13
  setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
12
- return () => mql.removeEventListener("change", onChange);
13
- }, []);
14
- return !!isMobile;
14
+ };
15
+ mql.addEventListener("change", onChange);
16
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
17
+ return () => mql.removeEventListener("change", onChange);
18
+ };
19
+ t1 = [];
20
+ $[0] = t0;
21
+ $[1] = t1;
22
+ } else {
23
+ t0 = $[0];
24
+ t1 = $[1];
25
+ }
26
+ React.useEffect(t0, t1);
27
+ return !!isMobile;
15
28
  }