@locusgraph/components 0.1.1 → 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 (116) 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 +71 -18
  5. package/dist/display/avatar.js +118 -7
  6. package/dist/display/badge.d.ts +1 -1
  7. package/dist/display/badge.js +74 -17
  8. package/dist/display/chart/chart-container.js +205 -45
  9. package/dist/display/chart/chart-legend.js +79 -14
  10. package/dist/display/chart/chart-tooltip.js +211 -40
  11. package/dist/display/chat/attachment/attachment-parts.js +222 -13
  12. package/dist/display/chat/attachment/attachment.js +210 -28
  13. package/dist/display/chat/bubble.js +225 -37
  14. package/dist/display/chat/marker.js +143 -15
  15. package/dist/display/chat/message-scroller.js +277 -15
  16. package/dist/display/chat/message.js +238 -13
  17. package/dist/display/content/item.js +448 -47
  18. package/dist/display/content/kbd.js +78 -5
  19. package/dist/display/media/aspect-ratio.js +27 -3
  20. package/dist/display/media/carousel-controls.js +163 -12
  21. package/dist/display/media/carousel.js +325 -65
  22. package/dist/display/rule-grid/rule-grid.d.ts +3 -1
  23. package/dist/display/rule-grid/rule-grid.js +311 -25
  24. package/dist/display/separator.js +56 -3
  25. package/dist/display/skeletons/layouts/skeleton-rule-grid.d.ts +8 -0
  26. package/dist/display/skeletons/layouts/skeleton-rule-grid.js +83 -0
  27. package/dist/display/skeletons/layouts/skeleton-table.d.ts +8 -0
  28. package/dist/display/skeletons/layouts/skeleton-table.js +174 -0
  29. package/dist/display/skeletons/shapes/skeleton-avatar.d.ts +10 -0
  30. package/dist/display/skeletons/shapes/skeleton-avatar.js +102 -0
  31. package/dist/display/skeletons/shapes/skeleton-button.d.ts +10 -0
  32. package/dist/display/skeletons/shapes/skeleton-button.js +102 -0
  33. package/dist/display/skeletons/shapes/skeleton-text.d.ts +7 -0
  34. package/dist/display/skeletons/shapes/skeleton-text.js +84 -0
  35. package/dist/display/skeletons/skeleton-parts.d.ts +11 -0
  36. package/dist/display/skeletons/skeleton-parts.js +68 -0
  37. package/dist/display/status/alert.d.ts +1 -1
  38. package/dist/display/status/alert.js +137 -17
  39. package/dist/display/status/empty.js +250 -22
  40. package/dist/display/status/progress.d.ts +5 -1
  41. package/dist/display/status/progress.js +120 -3
  42. package/dist/display/status/skeleton.js +40 -3
  43. package/dist/display/status/spinner.js +42 -4
  44. package/dist/display/table.js +310 -17
  45. package/dist/feedback/toaster.d.ts +1 -1
  46. package/dist/feedback/toaster.js +100 -25
  47. package/dist/form/advanced/calendar-day-button.js +89 -12
  48. package/dist/form/advanced/calendar.js +349 -56
  49. package/dist/form/advanced/combobox/combobox-chips.js +152 -9
  50. package/dist/form/advanced/combobox/combobox-items.js +240 -15
  51. package/dist/form/advanced/combobox/combobox.js +387 -14
  52. package/dist/form/advanced/input-otp.js +202 -12
  53. package/dist/form/choice/checkbox.js +59 -4
  54. package/dist/form/choice/radio-group.js +95 -6
  55. package/dist/form/choice/select.js +479 -25
  56. package/dist/form/choice/slider.js +118 -4
  57. package/dist/form/choice/switch.js +53 -3
  58. package/dist/form/field/field-error.js +117 -14
  59. package/dist/form/field/field-separator.js +70 -3
  60. package/dist/form/field/field-set.js +85 -5
  61. package/dist/form/field/field-text.js +116 -7
  62. package/dist/form/field/field.js +138 -26
  63. package/dist/form/hook-form/form.js +338 -40
  64. package/dist/form/input-group.js +297 -47
  65. package/dist/form/input.js +47 -3
  66. package/dist/form/label.js +42 -3
  67. package/dist/form/native-select.js +148 -8
  68. package/dist/form/textarea.js +41 -3
  69. package/dist/index.d.ts +6 -0
  70. package/dist/index.js +6 -0
  71. package/dist/layout/accordion.js +166 -9
  72. package/dist/layout/collapsible.js +75 -7
  73. package/dist/layout/resizable.js +123 -8
  74. package/dist/layout/scroll/direction.js +25 -3
  75. package/dist/layout/scroll/scroll-area.d.ts +1 -1
  76. package/dist/layout/scroll/scroll-area.js +138 -5
  77. package/dist/layout/sidebar/sidebar-context.js +184 -51
  78. package/dist/layout/sidebar/sidebar-menu-sub.js +219 -14
  79. package/dist/layout/sidebar/sidebar-menu.js +319 -38
  80. package/dist/layout/sidebar/sidebar-sections.js +369 -22
  81. package/dist/layout/sidebar/sidebar.js +385 -29
  82. package/dist/layout/tabs.js +183 -18
  83. package/dist/layout/use-mobile.js +23 -10
  84. package/dist/navigation/breadcrumb.js +302 -18
  85. package/dist/navigation/menubar/menubar-items.js +323 -17
  86. package/dist/navigation/menubar/menubar-sub.js +126 -8
  87. package/dist/navigation/menubar/menubar.js +213 -13
  88. package/dist/navigation/navigation-menu.js +367 -19
  89. package/dist/navigation/pagination.js +329 -20
  90. package/dist/overlay/alert-dialog.js +485 -26
  91. package/dist/overlay/context-menu/context-menu-items.js +323 -17
  92. package/dist/overlay/context-menu/context-menu-sub.js +126 -8
  93. package/dist/overlay/context-menu/context-menu.js +140 -11
  94. package/dist/overlay/dialog.js +406 -25
  95. package/dist/overlay/floating/command.js +424 -21
  96. package/dist/overlay/floating/drawer.js +354 -22
  97. package/dist/overlay/floating/hover-card.js +107 -7
  98. package/dist/overlay/menu/dropdown-menu-choice.js +150 -8
  99. package/dist/overlay/menu/dropdown-menu-item.js +174 -9
  100. package/dist/overlay/menu/dropdown-menu-sub.js +125 -8
  101. package/dist/overlay/menu/dropdown-menu.js +147 -12
  102. package/dist/overlay/popover.js +106 -7
  103. package/dist/overlay/sheet.js +380 -27
  104. package/dist/overlay/tooltip.js +145 -9
  105. package/dist/shell/app-header.js +81 -5
  106. package/dist/shell/app-shell.js +58 -3
  107. package/dist/shell/breadcrumbs.js +102 -12
  108. package/dist/shell/docs/docs-header.js +211 -11
  109. package/dist/shell/docs/docs-shell.js +100 -3
  110. package/dist/shell/docs/docs-sidebar.js +88 -7
  111. package/dist/shell/docs/on-this-page.js +78 -7
  112. package/dist/shell/docs/use-active-section.js +88 -42
  113. package/dist/shell/navigation/app-sidebar.js +188 -6
  114. package/dist/shell/navigation/nav-group.js +161 -10
  115. package/dist/shell/theme-toggle.js +52 -5
  116. package/package.json +5 -5
@@ -1,35 +1,321 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import { cva } from "class-variance-authority";
3
3
  import { cn } from "cn";
4
4
  import * as Slot from "radix-ui/slot";
5
+ import * as React from "react";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
5
7
  const ruleGridVariants = cva("grid grid-cols-1 gap-px p-px", {
6
- variants: {
7
- columns: {
8
- 1: "",
9
- 2: "sm:grid-cols-2",
10
- 3: "sm:grid-cols-2 lg:grid-cols-3",
11
- 4: "sm:grid-cols-2 lg:grid-cols-4",
12
- },
13
- },
14
- defaultVariants: {
15
- columns: 3,
16
- },
8
+ variants: {
9
+ columns: {
10
+ 1: "",
11
+ 2: "sm:grid-cols-2",
12
+ 3: "sm:grid-cols-2 lg:grid-cols-3",
13
+ 4: "sm:grid-cols-2 lg:grid-cols-4"
14
+ }
15
+ },
16
+ defaultVariants: {
17
+ columns: 3
18
+ }
17
19
  });
18
- function RuleGrid({ className, columns = 3, ...props }) {
19
- return (_jsx("div", { "data-slot": "rule-grid", "data-columns": columns, className: cn(ruleGridVariants({ columns, className })), ...props }));
20
+ function RuleGrid(t0) {
21
+ const $ = _c(11);
22
+ let className;
23
+ let props;
24
+ let t1;
25
+ if ($[0] !== t0) {
26
+ ({
27
+ className,
28
+ columns: t1,
29
+ ...props
30
+ } = t0);
31
+ $[0] = t0;
32
+ $[1] = className;
33
+ $[2] = props;
34
+ $[3] = t1;
35
+ } else {
36
+ className = $[1];
37
+ props = $[2];
38
+ t1 = $[3];
39
+ }
40
+ const columns = t1 === undefined ? 3 : t1;
41
+ let t2;
42
+ if ($[4] !== className || $[5] !== columns) {
43
+ t2 = cn(ruleGridVariants({
44
+ columns,
45
+ className
46
+ }));
47
+ $[4] = className;
48
+ $[5] = columns;
49
+ $[6] = t2;
50
+ } else {
51
+ t2 = $[6];
52
+ }
53
+ let t3;
54
+ if ($[7] !== columns || $[8] !== props || $[9] !== t2) {
55
+ t3 = /*#__PURE__*/_jsx("div", {
56
+ "data-slot": "rule-grid",
57
+ "data-columns": columns,
58
+ className: t2,
59
+ ...props
60
+ });
61
+ $[7] = columns;
62
+ $[8] = props;
63
+ $[9] = t2;
64
+ $[10] = t3;
65
+ } else {
66
+ t3 = $[10];
67
+ }
68
+ return t3;
69
+ }
70
+ function RuleGridCell(t0) {
71
+ const $ = _c(13);
72
+ let className;
73
+ let props;
74
+ let t1;
75
+ let t2;
76
+ if ($[0] !== t0) {
77
+ ({
78
+ className,
79
+ asChild: t1,
80
+ interactive: t2,
81
+ ...props
82
+ } = t0);
83
+ $[0] = t0;
84
+ $[1] = className;
85
+ $[2] = props;
86
+ $[3] = t1;
87
+ $[4] = t2;
88
+ } else {
89
+ className = $[1];
90
+ props = $[2];
91
+ t1 = $[3];
92
+ t2 = $[4];
93
+ }
94
+ const asChild = t1 === undefined ? false : t1;
95
+ const interactive = t2 === undefined ? false : t2;
96
+ const Comp = asChild ? Slot.Root : "div";
97
+ const t3 = interactive || undefined;
98
+ const t4 = interactive && "transition-colors duration-150 ease-out outline-none hover:bg-accent/60 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring active:bg-accent";
99
+ let t5;
100
+ if ($[5] !== className || $[6] !== t4) {
101
+ t5 = cn("flex min-w-0 flex-col gap-2 bg-card p-6 text-card-foreground ring-1 ring-border", t4, className);
102
+ $[5] = className;
103
+ $[6] = t4;
104
+ $[7] = t5;
105
+ } else {
106
+ t5 = $[7];
107
+ }
108
+ let t6;
109
+ if ($[8] !== Comp || $[9] !== props || $[10] !== t3 || $[11] !== t5) {
110
+ t6 = /*#__PURE__*/_jsx(Comp, {
111
+ "data-slot": "rule-grid-cell",
112
+ "data-interactive": t3,
113
+ className: t5,
114
+ ...props
115
+ });
116
+ $[8] = Comp;
117
+ $[9] = props;
118
+ $[10] = t3;
119
+ $[11] = t5;
120
+ $[12] = t6;
121
+ } else {
122
+ t6 = $[12];
123
+ }
124
+ return t6;
125
+ }
126
+ function RuleGridHeader(t0) {
127
+ const $ = _c(8);
128
+ let className;
129
+ let props;
130
+ if ($[0] !== t0) {
131
+ ({
132
+ className,
133
+ ...props
134
+ } = t0);
135
+ $[0] = t0;
136
+ $[1] = className;
137
+ $[2] = props;
138
+ } else {
139
+ className = $[1];
140
+ props = $[2];
141
+ }
142
+ let t1;
143
+ if ($[3] !== className) {
144
+ t1 = cn("-mx-6 -mt-6 mb-2 flex min-h-11 items-center gap-2 border-b bg-muted/35 px-6 py-2.5", className);
145
+ $[3] = className;
146
+ $[4] = t1;
147
+ } else {
148
+ t1 = $[4];
149
+ }
150
+ let t2;
151
+ if ($[5] !== props || $[6] !== t1) {
152
+ t2 = /*#__PURE__*/_jsx("div", {
153
+ "data-slot": "rule-grid-header",
154
+ className: t1,
155
+ ...props
156
+ });
157
+ $[5] = props;
158
+ $[6] = t1;
159
+ $[7] = t2;
160
+ } else {
161
+ t2 = $[7];
162
+ }
163
+ return t2;
20
164
  }
21
- function RuleGridCell({ className, asChild = false, interactive = false, ...props }) {
22
- const Comp = asChild ? Slot.Root : "div";
23
- return (_jsx(Comp, { "data-slot": "rule-grid-cell", "data-interactive": interactive || undefined, className: cn("flex min-w-0 flex-col gap-2 bg-card p-6 text-card-foreground ring-1 ring-border", interactive &&
24
- "transition-colors duration-150 ease-out outline-none hover:bg-accent/60 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring active:bg-accent", className), ...props }));
165
+ function RuleGridFooter(t0) {
166
+ const $ = _c(8);
167
+ let className;
168
+ let props;
169
+ if ($[0] !== t0) {
170
+ ({
171
+ className,
172
+ ...props
173
+ } = t0);
174
+ $[0] = t0;
175
+ $[1] = className;
176
+ $[2] = props;
177
+ } else {
178
+ className = $[1];
179
+ props = $[2];
180
+ }
181
+ let t1;
182
+ if ($[3] !== className) {
183
+ t1 = cn("-mx-6 mt-auto -mb-6 flex min-h-12 flex-wrap items-center gap-2 border-t bg-muted/70 px-6 py-3", className);
184
+ $[3] = className;
185
+ $[4] = t1;
186
+ } else {
187
+ t1 = $[4];
188
+ }
189
+ let t2;
190
+ if ($[5] !== props || $[6] !== t1) {
191
+ t2 = /*#__PURE__*/_jsx("div", {
192
+ "data-slot": "rule-grid-footer",
193
+ className: t1,
194
+ ...props
195
+ });
196
+ $[5] = props;
197
+ $[6] = t1;
198
+ $[7] = t2;
199
+ } else {
200
+ t2 = $[7];
201
+ }
202
+ return t2;
25
203
  }
26
- function RuleGridLabel({ className, ...props }) {
27
- return (_jsx("span", { "data-slot": "rule-grid-label", className: cn("font-mono text-[11.5px] text-muted-foreground", className), ...props }));
204
+ function RuleGridLabel(t0) {
205
+ const $ = _c(8);
206
+ let className;
207
+ let props;
208
+ if ($[0] !== t0) {
209
+ ({
210
+ className,
211
+ ...props
212
+ } = t0);
213
+ $[0] = t0;
214
+ $[1] = className;
215
+ $[2] = props;
216
+ } else {
217
+ className = $[1];
218
+ props = $[2];
219
+ }
220
+ let t1;
221
+ if ($[3] !== className) {
222
+ t1 = cn("eyebrow", className);
223
+ $[3] = className;
224
+ $[4] = t1;
225
+ } else {
226
+ t1 = $[4];
227
+ }
228
+ let t2;
229
+ if ($[5] !== props || $[6] !== t1) {
230
+ t2 = /*#__PURE__*/_jsx("span", {
231
+ "data-slot": "rule-grid-label",
232
+ className: t1,
233
+ ...props
234
+ });
235
+ $[5] = props;
236
+ $[6] = t1;
237
+ $[7] = t2;
238
+ } else {
239
+ t2 = $[7];
240
+ }
241
+ return t2;
28
242
  }
29
- function RuleGridTitle({ className, ...props }) {
30
- return (_jsx("div", { "data-slot": "rule-grid-title", className: cn("text-[15px] font-medium tracking-[-0.01em]", className), ...props }));
243
+ function RuleGridTitle(t0) {
244
+ const $ = _c(8);
245
+ let className;
246
+ let props;
247
+ if ($[0] !== t0) {
248
+ ({
249
+ className,
250
+ ...props
251
+ } = t0);
252
+ $[0] = t0;
253
+ $[1] = className;
254
+ $[2] = props;
255
+ } else {
256
+ className = $[1];
257
+ props = $[2];
258
+ }
259
+ let t1;
260
+ if ($[3] !== className) {
261
+ t1 = cn("text-[15px] font-medium tracking-[-0.01em]", className);
262
+ $[3] = className;
263
+ $[4] = t1;
264
+ } else {
265
+ t1 = $[4];
266
+ }
267
+ let t2;
268
+ if ($[5] !== props || $[6] !== t1) {
269
+ t2 = /*#__PURE__*/_jsx("div", {
270
+ "data-slot": "rule-grid-title",
271
+ className: t1,
272
+ ...props
273
+ });
274
+ $[5] = props;
275
+ $[6] = t1;
276
+ $[7] = t2;
277
+ } else {
278
+ t2 = $[7];
279
+ }
280
+ return t2;
31
281
  }
32
- function RuleGridDescription({ className, ...props }) {
33
- return (_jsx("p", { "data-slot": "rule-grid-description", className: cn("text-sm text-muted-foreground", className), ...props }));
282
+ function RuleGridDescription(t0) {
283
+ const $ = _c(8);
284
+ let className;
285
+ let props;
286
+ if ($[0] !== t0) {
287
+ ({
288
+ className,
289
+ ...props
290
+ } = t0);
291
+ $[0] = t0;
292
+ $[1] = className;
293
+ $[2] = props;
294
+ } else {
295
+ className = $[1];
296
+ props = $[2];
297
+ }
298
+ let t1;
299
+ if ($[3] !== className) {
300
+ t1 = cn("text-sm text-muted-foreground", className);
301
+ $[3] = className;
302
+ $[4] = t1;
303
+ } else {
304
+ t1 = $[4];
305
+ }
306
+ let t2;
307
+ if ($[5] !== props || $[6] !== t1) {
308
+ t2 = /*#__PURE__*/_jsx("p", {
309
+ "data-slot": "rule-grid-description",
310
+ className: t1,
311
+ ...props
312
+ });
313
+ $[5] = props;
314
+ $[6] = t1;
315
+ $[7] = t2;
316
+ } else {
317
+ t2 = $[7];
318
+ }
319
+ return t2;
34
320
  }
35
- export { RuleGrid, RuleGridCell, RuleGridDescription, RuleGridLabel, RuleGridTitle, ruleGridVariants, };
321
+ export { RuleGrid, RuleGridCell, RuleGridDescription, RuleGridFooter, RuleGridHeader, RuleGridLabel, RuleGridTitle, ruleGridVariants };
@@ -1,8 +1,61 @@
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 { cn } from "cn";
4
5
  import * as SeparatorPrimitive from "radix-ui/separator";
5
- function Separator({ className, orientation = "horizontal", decorative = true, ...props }) {
6
- return (_jsx(SeparatorPrimitive.Root, { "data-slot": "separator", decorative: decorative, orientation: orientation, className: cn("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px", className), ...props }));
6
+ import * as React from "react";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ function Separator(t0) {
9
+ const $ = _c(12);
10
+ let className;
11
+ let props;
12
+ let t1;
13
+ let t2;
14
+ if ($[0] !== t0) {
15
+ ({
16
+ className,
17
+ orientation: t1,
18
+ decorative: t2,
19
+ ...props
20
+ } = t0);
21
+ $[0] = t0;
22
+ $[1] = className;
23
+ $[2] = props;
24
+ $[3] = t1;
25
+ $[4] = t2;
26
+ } else {
27
+ className = $[1];
28
+ props = $[2];
29
+ t1 = $[3];
30
+ t2 = $[4];
31
+ }
32
+ const orientation = t1 === undefined ? "horizontal" : t1;
33
+ const decorative = t2 === undefined ? true : t2;
34
+ let t3;
35
+ if ($[5] !== className) {
36
+ t3 = cn("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px", className);
37
+ $[5] = className;
38
+ $[6] = t3;
39
+ } else {
40
+ t3 = $[6];
41
+ }
42
+ let t4;
43
+ if ($[7] !== decorative || $[8] !== orientation || $[9] !== props || $[10] !== t3) {
44
+ t4 = /*#__PURE__*/_jsx(SeparatorPrimitive.Root, {
45
+ "data-slot": "separator",
46
+ decorative: decorative,
47
+ orientation: orientation,
48
+ className: t3,
49
+ ...props
50
+ });
51
+ $[7] = decorative;
52
+ $[8] = orientation;
53
+ $[9] = props;
54
+ $[10] = t3;
55
+ $[11] = t4;
56
+ } else {
57
+ t4 = $[11];
58
+ }
59
+ return t4;
7
60
  }
8
61
  export { Separator };
@@ -0,0 +1,8 @@
1
+ import type * as React from "react";
2
+ import { RuleGrid } from "../../rule-grid/rule-grid.js";
3
+ type SkeletonRuleGridProps = Omit<React.ComponentProps<typeof RuleGrid>, "children"> & {
4
+ cells?: number;
5
+ label?: string;
6
+ };
7
+ declare function SkeletonRuleGrid({ cells, columns, label, ...props }: SkeletonRuleGridProps): React.JSX.Element;
8
+ export { SkeletonRuleGrid };
@@ -0,0 +1,83 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { RuleGrid, RuleGridCell } from "../../rule-grid/rule-grid.js";
3
+ import { SkeletonBar, SkeletonLoadingLabel, skeletonRootProps } from "../skeleton-parts.js";
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
+ function SkeletonRuleGrid(t0) {
6
+ const $ = _c(14);
7
+ let label;
8
+ let props;
9
+ let t1;
10
+ let t2;
11
+ if ($[0] !== t0) {
12
+ ({
13
+ cells: t1,
14
+ columns: t2,
15
+ label,
16
+ ...props
17
+ } = t0);
18
+ $[0] = t0;
19
+ $[1] = label;
20
+ $[2] = props;
21
+ $[3] = t1;
22
+ $[4] = t2;
23
+ } else {
24
+ label = $[1];
25
+ props = $[2];
26
+ t1 = $[3];
27
+ t2 = $[4];
28
+ }
29
+ const cells = t1 === undefined ? 3 : t1;
30
+ const columns = t2 === undefined ? 3 : t2;
31
+ const count = Math.max(1, Math.floor(cells));
32
+ let t3;
33
+ if ($[5] !== count) {
34
+ t3 = Array.from({
35
+ length: count
36
+ }, _temp);
37
+ $[5] = count;
38
+ $[6] = t3;
39
+ } else {
40
+ t3 = $[6];
41
+ }
42
+ let t4;
43
+ if ($[7] !== label) {
44
+ t4 = /*#__PURE__*/_jsx(SkeletonLoadingLabel, {
45
+ children: label
46
+ });
47
+ $[7] = label;
48
+ $[8] = t4;
49
+ } else {
50
+ t4 = $[8];
51
+ }
52
+ let t5;
53
+ if ($[9] !== columns || $[10] !== props || $[11] !== t3 || $[12] !== t4) {
54
+ t5 = /*#__PURE__*/_jsxs(RuleGrid, {
55
+ "data-slot": "skeleton-rule-grid",
56
+ columns: columns,
57
+ ...skeletonRootProps,
58
+ ...props,
59
+ children: [t3, t4]
60
+ });
61
+ $[9] = columns;
62
+ $[10] = props;
63
+ $[11] = t3;
64
+ $[12] = t4;
65
+ $[13] = t5;
66
+ } else {
67
+ t5 = $[13];
68
+ }
69
+ return t5;
70
+ }
71
+ function _temp(_, index) {
72
+ return /*#__PURE__*/_jsxs(RuleGridCell, {
73
+ "data-slot": "skeleton-rule-grid-cell",
74
+ "aria-hidden": "true",
75
+ className: "gap-3",
76
+ children: [/*#__PURE__*/_jsx(SkeletonBar, {
77
+ className: "h-3 w-20"
78
+ }), /*#__PURE__*/_jsx(SkeletonBar, {
79
+ className: "h-7 w-28"
80
+ })]
81
+ }, index);
82
+ }
83
+ export { SkeletonRuleGrid };
@@ -0,0 +1,8 @@
1
+ import type * as React from "react";
2
+ type SkeletonTableProps = React.ComponentProps<"div"> & {
3
+ rows?: number;
4
+ columns?: number;
5
+ label?: string;
6
+ };
7
+ declare function SkeletonTable({ rows, columns, label, className, ...props }: SkeletonTableProps): React.JSX.Element;
8
+ export { SkeletonTable };
@@ -0,0 +1,174 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { cn } from "cn";
3
+ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../../table.js";
4
+ import { SkeletonBar, SkeletonLoadingLabel, skeletonRootProps } from "../skeleton-parts.js";
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
+ const cellWidths = ["w-24", "w-32", "w-20", "w-28", "w-16"];
7
+ function cellWidth(column) {
8
+ return cellWidths[column % cellWidths.length];
9
+ }
10
+ function indexes(count) {
11
+ return Array.from({
12
+ length: Math.max(1, Math.floor(count))
13
+ }, (_, index) => index);
14
+ }
15
+ function SkeletonTable(t0) {
16
+ const $ = _c(38);
17
+ let className;
18
+ let label;
19
+ let props;
20
+ let t1;
21
+ let t2;
22
+ if ($[0] !== t0) {
23
+ ({
24
+ rows: t1,
25
+ columns: t2,
26
+ label,
27
+ className,
28
+ ...props
29
+ } = t0);
30
+ $[0] = t0;
31
+ $[1] = className;
32
+ $[2] = label;
33
+ $[3] = props;
34
+ $[4] = t1;
35
+ $[5] = t2;
36
+ } else {
37
+ className = $[1];
38
+ label = $[2];
39
+ props = $[3];
40
+ t1 = $[4];
41
+ t2 = $[5];
42
+ }
43
+ const rows = t1 === undefined ? 5 : t1;
44
+ const columns = t2 === undefined ? 4 : t2;
45
+ let T0;
46
+ let T1;
47
+ let t3;
48
+ let t4;
49
+ let t5;
50
+ let t6;
51
+ let t7;
52
+ let t8;
53
+ let t9;
54
+ if ($[6] !== className || $[7] !== columns || $[8] !== props || $[9] !== rows) {
55
+ const columnIndexes = indexes(columns);
56
+ t6 = "skeleton-table";
57
+ t7 = skeletonRootProps;
58
+ if ($[19] !== className) {
59
+ t8 = cn("w-full", className);
60
+ $[19] = className;
61
+ $[20] = t8;
62
+ } else {
63
+ t8 = $[20];
64
+ }
65
+ t9 = props;
66
+ T1 = Table;
67
+ t4 = "true";
68
+ t5 = /*#__PURE__*/_jsx(TableHeader, {
69
+ children: /*#__PURE__*/_jsx(TableRow, {
70
+ className: "hover:bg-transparent",
71
+ children: columnIndexes.map(_temp)
72
+ })
73
+ });
74
+ T0 = TableBody;
75
+ t3 = indexes(rows).map(row => /*#__PURE__*/_jsx(TableRow, {
76
+ "data-slot": "skeleton-table-row",
77
+ className: "hover:bg-transparent",
78
+ children: columnIndexes.map(_temp2)
79
+ }, row));
80
+ $[6] = className;
81
+ $[7] = columns;
82
+ $[8] = props;
83
+ $[9] = rows;
84
+ $[10] = T0;
85
+ $[11] = T1;
86
+ $[12] = t3;
87
+ $[13] = t4;
88
+ $[14] = t5;
89
+ $[15] = t6;
90
+ $[16] = t7;
91
+ $[17] = t8;
92
+ $[18] = t9;
93
+ } else {
94
+ T0 = $[10];
95
+ T1 = $[11];
96
+ t3 = $[12];
97
+ t4 = $[13];
98
+ t5 = $[14];
99
+ t6 = $[15];
100
+ t7 = $[16];
101
+ t8 = $[17];
102
+ t9 = $[18];
103
+ }
104
+ let t10;
105
+ if ($[21] !== T0 || $[22] !== t3) {
106
+ t10 = /*#__PURE__*/_jsx(T0, {
107
+ children: t3
108
+ });
109
+ $[21] = T0;
110
+ $[22] = t3;
111
+ $[23] = t10;
112
+ } else {
113
+ t10 = $[23];
114
+ }
115
+ let t11;
116
+ if ($[24] !== T1 || $[25] !== t10 || $[26] !== t4 || $[27] !== t5) {
117
+ t11 = /*#__PURE__*/_jsxs(T1, {
118
+ "aria-hidden": t4,
119
+ children: [t5, t10]
120
+ });
121
+ $[24] = T1;
122
+ $[25] = t10;
123
+ $[26] = t4;
124
+ $[27] = t5;
125
+ $[28] = t11;
126
+ } else {
127
+ t11 = $[28];
128
+ }
129
+ let t12;
130
+ if ($[29] !== label) {
131
+ t12 = /*#__PURE__*/_jsx(SkeletonLoadingLabel, {
132
+ children: label
133
+ });
134
+ $[29] = label;
135
+ $[30] = t12;
136
+ } else {
137
+ t12 = $[30];
138
+ }
139
+ let t13;
140
+ if ($[31] !== t11 || $[32] !== t12 || $[33] !== t6 || $[34] !== t7 || $[35] !== t8 || $[36] !== t9) {
141
+ t13 = /*#__PURE__*/_jsxs("div", {
142
+ "data-slot": t6,
143
+ ...t7,
144
+ className: t8,
145
+ ...t9,
146
+ children: [t11, t12]
147
+ });
148
+ $[31] = t11;
149
+ $[32] = t12;
150
+ $[33] = t6;
151
+ $[34] = t7;
152
+ $[35] = t8;
153
+ $[36] = t9;
154
+ $[37] = t13;
155
+ } else {
156
+ t13 = $[37];
157
+ }
158
+ return t13;
159
+ }
160
+ function _temp2(column_0) {
161
+ return /*#__PURE__*/_jsx(TableCell, {
162
+ children: /*#__PURE__*/_jsx(SkeletonBar, {
163
+ className: cn("h-4", cellWidth(column_0))
164
+ })
165
+ }, column_0);
166
+ }
167
+ function _temp(column) {
168
+ return /*#__PURE__*/_jsx(TableHead, {
169
+ children: /*#__PURE__*/_jsx(SkeletonBar, {
170
+ className: "h-3 w-16"
171
+ })
172
+ }, column);
173
+ }
174
+ export { SkeletonTable };
@@ -0,0 +1,10 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import type * as React from "react";
3
+ declare const skeletonAvatarVariants: (props?: ({
4
+ size?: "lg" | "md" | "sm" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ type SkeletonAvatarProps = React.ComponentProps<"div"> & VariantProps<typeof skeletonAvatarVariants> & {
7
+ label?: string;
8
+ };
9
+ declare function SkeletonAvatar({ size, label, className, ...props }: SkeletonAvatarProps): React.JSX.Element;
10
+ export { SkeletonAvatar, skeletonAvatarVariants };