@locusgraph/components 0.2.1 → 0.2.2

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 (43) hide show
  1. package/dist/action/button-group.js +33 -136
  2. package/dist/action/button.js +15 -62
  3. package/dist/display/badge.js +13 -54
  4. package/dist/display/chat/attachment/attachment-parts.js +52 -218
  5. package/dist/display/chat/attachment/attachment.js +46 -186
  6. package/dist/display/chat/bubble.js +47 -192
  7. package/dist/display/chat/marker.js +32 -131
  8. package/dist/display/chat/message.js +56 -236
  9. package/dist/display/content/item.js +101 -415
  10. package/dist/display/content/kbd.js +18 -77
  11. package/dist/display/rule-grid/rule-grid.js +69 -292
  12. package/dist/display/skeletons/layouts/skeleton-rule-grid.js +25 -74
  13. package/dist/display/skeletons/layouts/skeleton-table.js +38 -158
  14. package/dist/display/skeletons/shapes/skeleton-avatar.js +19 -83
  15. package/dist/display/skeletons/shapes/skeleton-button.js +19 -83
  16. package/dist/display/skeletons/shapes/skeleton-text.js +18 -71
  17. package/dist/display/skeletons/skeleton-parts.js +17 -58
  18. package/dist/display/status/alert.js +30 -122
  19. package/dist/display/status/empty.js +57 -238
  20. package/dist/display/status/skeleton.js +9 -39
  21. package/dist/display/status/spinner.js +10 -40
  22. package/dist/display/table.js +75 -308
  23. package/dist/form/field/field-error.js +24 -107
  24. package/dist/form/field/field-separator.js +14 -65
  25. package/dist/form/field/field-set.js +20 -84
  26. package/dist/form/field/field-text.js +27 -115
  27. package/dist/form/field/field.js +31 -125
  28. package/dist/form/input.js +11 -45
  29. package/dist/form/native-select.js +31 -139
  30. package/dist/form/textarea.js +9 -39
  31. package/dist/layout/use-mobile.js +7 -20
  32. package/dist/navigation/breadcrumb.js +75 -294
  33. package/dist/navigation/navigation-menu.js +83 -359
  34. package/dist/navigation/pagination.js +78 -315
  35. package/dist/shell/app-header.js +21 -73
  36. package/dist/shell/app-shell.js +17 -56
  37. package/dist/shell/breadcrumbs.js +39 -97
  38. package/dist/shell/docs/docs-shell.js +35 -99
  39. package/dist/shell/docs/docs-sidebar.js +39 -86
  40. package/dist/shell/docs/use-active-section.js +31 -75
  41. package/dist/shell/navigation/app-sidebar.js +52 -174
  42. package/dist/shell/navigation/nav-group.js +40 -149
  43. package/package.json +1 -1
@@ -1,320 +1,87 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { cn } from "cn";
3
2
  import { jsx as _jsx } from "react/jsx-runtime";
4
- function Table(t0) {
5
- const $ = _c(8);
6
- let className;
7
- let props;
8
- if ($[0] !== t0) {
9
- ({
10
- className,
3
+ function Table({
4
+ className,
5
+ ...props
6
+ }) {
7
+ return /*#__PURE__*/_jsx("div", {
8
+ "data-slot": "table-container",
9
+ className: "relative w-full overflow-x-auto scroll-fade-x",
10
+ children: /*#__PURE__*/_jsx("table", {
11
+ "data-slot": "table",
12
+ className: cn("w-full caption-bottom text-sm", className),
11
13
  ...props
12
- } = t0);
13
- $[0] = t0;
14
- $[1] = className;
15
- $[2] = props;
16
- } else {
17
- className = $[1];
18
- props = $[2];
19
- }
20
- let t1;
21
- if ($[3] !== className) {
22
- t1 = cn("w-full caption-bottom text-sm", className);
23
- $[3] = className;
24
- $[4] = t1;
25
- } else {
26
- t1 = $[4];
27
- }
28
- let t2;
29
- if ($[5] !== props || $[6] !== t1) {
30
- t2 = /*#__PURE__*/_jsx("div", {
31
- "data-slot": "table-container",
32
- className: "relative w-full overflow-x-auto scroll-fade-x",
33
- children: /*#__PURE__*/_jsx("table", {
34
- "data-slot": "table",
35
- className: t1,
36
- ...props
37
- })
38
- });
39
- $[5] = props;
40
- $[6] = t1;
41
- $[7] = t2;
42
- } else {
43
- t2 = $[7];
44
- }
45
- return t2;
14
+ })
15
+ });
46
16
  }
47
- function TableHeader(t0) {
48
- const $ = _c(8);
49
- let className;
50
- let props;
51
- if ($[0] !== t0) {
52
- ({
53
- className,
54
- ...props
55
- } = t0);
56
- $[0] = t0;
57
- $[1] = className;
58
- $[2] = props;
59
- } else {
60
- className = $[1];
61
- props = $[2];
62
- }
63
- let t1;
64
- if ($[3] !== className) {
65
- t1 = cn("[&_tr]:border-b", className);
66
- $[3] = className;
67
- $[4] = t1;
68
- } else {
69
- t1 = $[4];
70
- }
71
- let t2;
72
- if ($[5] !== props || $[6] !== t1) {
73
- t2 = /*#__PURE__*/_jsx("thead", {
74
- "data-slot": "table-header",
75
- className: t1,
76
- ...props
77
- });
78
- $[5] = props;
79
- $[6] = t1;
80
- $[7] = t2;
81
- } else {
82
- t2 = $[7];
83
- }
84
- return t2;
17
+ function TableHeader({
18
+ className,
19
+ ...props
20
+ }) {
21
+ return /*#__PURE__*/_jsx("thead", {
22
+ "data-slot": "table-header",
23
+ className: cn("[&_tr]:border-b", className),
24
+ ...props
25
+ });
85
26
  }
86
- function TableBody(t0) {
87
- const $ = _c(8);
88
- let className;
89
- let props;
90
- if ($[0] !== t0) {
91
- ({
92
- className,
93
- ...props
94
- } = t0);
95
- $[0] = t0;
96
- $[1] = className;
97
- $[2] = props;
98
- } else {
99
- className = $[1];
100
- props = $[2];
101
- }
102
- let t1;
103
- if ($[3] !== className) {
104
- t1 = cn("[&_tr:last-child]:border-0", className);
105
- $[3] = className;
106
- $[4] = t1;
107
- } else {
108
- t1 = $[4];
109
- }
110
- let t2;
111
- if ($[5] !== props || $[6] !== t1) {
112
- t2 = /*#__PURE__*/_jsx("tbody", {
113
- "data-slot": "table-body",
114
- className: t1,
115
- ...props
116
- });
117
- $[5] = props;
118
- $[6] = t1;
119
- $[7] = t2;
120
- } else {
121
- t2 = $[7];
122
- }
123
- return t2;
27
+ function TableBody({
28
+ className,
29
+ ...props
30
+ }) {
31
+ return /*#__PURE__*/_jsx("tbody", {
32
+ "data-slot": "table-body",
33
+ className: cn("[&_tr:last-child]:border-0", className),
34
+ ...props
35
+ });
124
36
  }
125
- function TableFooter(t0) {
126
- const $ = _c(8);
127
- let className;
128
- let props;
129
- if ($[0] !== t0) {
130
- ({
131
- className,
132
- ...props
133
- } = t0);
134
- $[0] = t0;
135
- $[1] = className;
136
- $[2] = props;
137
- } else {
138
- className = $[1];
139
- props = $[2];
140
- }
141
- let t1;
142
- if ($[3] !== className) {
143
- t1 = cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className);
144
- $[3] = className;
145
- $[4] = t1;
146
- } else {
147
- t1 = $[4];
148
- }
149
- let t2;
150
- if ($[5] !== props || $[6] !== t1) {
151
- t2 = /*#__PURE__*/_jsx("tfoot", {
152
- "data-slot": "table-footer",
153
- className: t1,
154
- ...props
155
- });
156
- $[5] = props;
157
- $[6] = t1;
158
- $[7] = t2;
159
- } else {
160
- t2 = $[7];
161
- }
162
- return t2;
37
+ function TableFooter({
38
+ className,
39
+ ...props
40
+ }) {
41
+ return /*#__PURE__*/_jsx("tfoot", {
42
+ "data-slot": "table-footer",
43
+ className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className),
44
+ ...props
45
+ });
163
46
  }
164
- function TableRow(t0) {
165
- const $ = _c(8);
166
- let className;
167
- let props;
168
- if ($[0] !== t0) {
169
- ({
170
- className,
171
- ...props
172
- } = t0);
173
- $[0] = t0;
174
- $[1] = className;
175
- $[2] = props;
176
- } else {
177
- className = $[1];
178
- props = $[2];
179
- }
180
- let t1;
181
- if ($[3] !== className) {
182
- t1 = cn("border-b transition-colors duration-150 ease-out hover:bg-muted/40 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted", className);
183
- $[3] = className;
184
- $[4] = t1;
185
- } else {
186
- t1 = $[4];
187
- }
188
- let t2;
189
- if ($[5] !== props || $[6] !== t1) {
190
- t2 = /*#__PURE__*/_jsx("tr", {
191
- "data-slot": "table-row",
192
- className: t1,
193
- ...props
194
- });
195
- $[5] = props;
196
- $[6] = t1;
197
- $[7] = t2;
198
- } else {
199
- t2 = $[7];
200
- }
201
- return t2;
47
+ function TableRow({
48
+ className,
49
+ ...props
50
+ }) {
51
+ return /*#__PURE__*/_jsx("tr", {
52
+ "data-slot": "table-row",
53
+ className: cn("border-b transition-colors duration-150 ease-out hover:bg-muted/40 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted", className),
54
+ ...props
55
+ });
202
56
  }
203
- function TableHead(t0) {
204
- const $ = _c(8);
205
- let className;
206
- let props;
207
- if ($[0] !== t0) {
208
- ({
209
- className,
210
- ...props
211
- } = t0);
212
- $[0] = t0;
213
- $[1] = className;
214
- $[2] = props;
215
- } else {
216
- className = $[1];
217
- props = $[2];
218
- }
219
- let t1;
220
- if ($[3] !== className) {
221
- t1 = cn("eyebrow h-9 px-3 text-left align-middle font-normal whitespace-nowrap sm:px-4 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className);
222
- $[3] = className;
223
- $[4] = t1;
224
- } else {
225
- t1 = $[4];
226
- }
227
- let t2;
228
- if ($[5] !== props || $[6] !== t1) {
229
- t2 = /*#__PURE__*/_jsx("th", {
230
- "data-slot": "table-head",
231
- className: t1,
232
- ...props
233
- });
234
- $[5] = props;
235
- $[6] = t1;
236
- $[7] = t2;
237
- } else {
238
- t2 = $[7];
239
- }
240
- return t2;
57
+ function TableHead({
58
+ className,
59
+ ...props
60
+ }) {
61
+ return /*#__PURE__*/_jsx("th", {
62
+ "data-slot": "table-head",
63
+ className: cn("eyebrow h-9 px-3 text-left align-middle font-normal whitespace-nowrap sm:px-4 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className),
64
+ ...props
65
+ });
241
66
  }
242
- function TableCell(t0) {
243
- const $ = _c(8);
244
- let className;
245
- let props;
246
- if ($[0] !== t0) {
247
- ({
248
- className,
249
- ...props
250
- } = t0);
251
- $[0] = t0;
252
- $[1] = className;
253
- $[2] = props;
254
- } else {
255
- className = $[1];
256
- props = $[2];
257
- }
258
- let t1;
259
- if ($[3] !== className) {
260
- t1 = cn("px-3 py-2.5 align-middle whitespace-nowrap tabular-nums sm:px-4 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className);
261
- $[3] = className;
262
- $[4] = t1;
263
- } else {
264
- t1 = $[4];
265
- }
266
- let t2;
267
- if ($[5] !== props || $[6] !== t1) {
268
- t2 = /*#__PURE__*/_jsx("td", {
269
- "data-slot": "table-cell",
270
- className: t1,
271
- ...props
272
- });
273
- $[5] = props;
274
- $[6] = t1;
275
- $[7] = t2;
276
- } else {
277
- t2 = $[7];
278
- }
279
- return t2;
67
+ function TableCell({
68
+ className,
69
+ ...props
70
+ }) {
71
+ return /*#__PURE__*/_jsx("td", {
72
+ "data-slot": "table-cell",
73
+ className: cn("px-3 py-2.5 align-middle whitespace-nowrap tabular-nums sm:px-4 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className),
74
+ ...props
75
+ });
280
76
  }
281
- function TableCaption(t0) {
282
- const $ = _c(8);
283
- let className;
284
- let props;
285
- if ($[0] !== t0) {
286
- ({
287
- className,
288
- ...props
289
- } = t0);
290
- $[0] = t0;
291
- $[1] = className;
292
- $[2] = props;
293
- } else {
294
- className = $[1];
295
- props = $[2];
296
- }
297
- let t1;
298
- if ($[3] !== className) {
299
- t1 = cn("mt-4 text-sm text-muted-foreground", className);
300
- $[3] = className;
301
- $[4] = t1;
302
- } else {
303
- t1 = $[4];
304
- }
305
- let t2;
306
- if ($[5] !== props || $[6] !== t1) {
307
- t2 = /*#__PURE__*/_jsx("caption", {
308
- "data-slot": "table-caption",
309
- className: t1,
310
- ...props
311
- });
312
- $[5] = props;
313
- $[6] = t1;
314
- $[7] = t2;
315
- } else {
316
- t2 = $[7];
317
- }
318
- return t2;
77
+ function TableCaption({
78
+ className,
79
+ ...props
80
+ }) {
81
+ return /*#__PURE__*/_jsx("caption", {
82
+ "data-slot": "table-caption",
83
+ className: cn("mt-4 text-sm text-muted-foreground", className),
84
+ ...props
85
+ });
319
86
  }
320
87
  export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
@@ -1,123 +1,40 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { cn } from "cn";
3
2
  import { jsx as _jsx } from "react/jsx-runtime";
4
3
  function uniqueMessages(errors) {
5
4
  const messages = errors.map(error => error?.message).filter(message => !!message);
6
5
  return [...new Set(messages)];
7
6
  }
8
- function FieldErrorContent(t0) {
9
- const $ = _c(4);
10
- const {
11
- messages
12
- } = t0;
7
+ function FieldErrorContent({
8
+ messages
9
+ }) {
13
10
  if (messages.length === 1) {
14
11
  return messages[0];
15
12
  }
16
- let t1;
17
- if ($[0] !== messages) {
18
- t1 = messages.map(_temp);
19
- $[0] = messages;
20
- $[1] = t1;
21
- } else {
22
- t1 = $[1];
23
- }
24
- let t2;
25
- if ($[2] !== t1) {
26
- t2 = /*#__PURE__*/_jsx("ul", {
27
- className: "ml-4 flex list-disc flex-col gap-1",
28
- children: t1
29
- });
30
- $[2] = t1;
31
- $[3] = t2;
32
- } else {
33
- t2 = $[3];
34
- }
35
- return t2;
36
- }
37
- function _temp(message) {
38
- return /*#__PURE__*/_jsx("li", {
39
- children: message
40
- }, message);
13
+ return /*#__PURE__*/_jsx("ul", {
14
+ className: "ml-4 flex list-disc flex-col gap-1",
15
+ children: messages.map(message => /*#__PURE__*/_jsx("li", {
16
+ children: message
17
+ }, message))
18
+ });
41
19
  }
42
- function FieldError(t0) {
43
- const $ = _c(18);
44
- let children;
45
- let className;
46
- let errors;
47
- let props;
48
- if ($[0] !== t0) {
49
- ({
50
- className,
51
- children,
52
- errors,
53
- ...props
54
- } = t0);
55
- $[0] = t0;
56
- $[1] = children;
57
- $[2] = className;
58
- $[3] = errors;
59
- $[4] = props;
60
- } else {
61
- children = $[1];
62
- className = $[2];
63
- errors = $[3];
64
- props = $[4];
65
- }
66
- let t1;
67
- if ($[5] !== errors) {
68
- t1 = errors ?? [];
69
- $[5] = errors;
70
- $[6] = t1;
71
- } else {
72
- t1 = $[6];
73
- }
74
- let t2;
75
- if ($[7] !== t1) {
76
- t2 = uniqueMessages(t1);
77
- $[7] = t1;
78
- $[8] = t2;
79
- } else {
80
- t2 = $[8];
81
- }
82
- const messages = t2;
20
+ function FieldError({
21
+ className,
22
+ children,
23
+ errors,
24
+ ...props
25
+ }) {
26
+ const messages = uniqueMessages(errors ?? []);
83
27
  if (!children && messages.length === 0) {
84
28
  return null;
85
29
  }
86
- let t3;
87
- if ($[9] !== className) {
88
- t3 = cn("text-sm font-normal text-destructive", className);
89
- $[9] = className;
90
- $[10] = t3;
91
- } else {
92
- t3 = $[10];
93
- }
94
- let t4;
95
- if ($[11] !== children || $[12] !== messages) {
96
- t4 = children ?? /*#__PURE__*/_jsx(FieldErrorContent, {
30
+ return /*#__PURE__*/_jsx("div", {
31
+ role: "alert",
32
+ "data-slot": "field-error",
33
+ className: cn("text-sm font-normal text-destructive", className),
34
+ ...props,
35
+ children: children ?? /*#__PURE__*/_jsx(FieldErrorContent, {
97
36
  messages: messages
98
- });
99
- $[11] = children;
100
- $[12] = messages;
101
- $[13] = t4;
102
- } else {
103
- t4 = $[13];
104
- }
105
- let t5;
106
- if ($[14] !== props || $[15] !== t3 || $[16] !== t4) {
107
- t5 = /*#__PURE__*/_jsx("div", {
108
- role: "alert",
109
- "data-slot": "field-error",
110
- className: t3,
111
- ...props,
112
- children: t4
113
- });
114
- $[14] = props;
115
- $[15] = t3;
116
- $[16] = t4;
117
- $[17] = t5;
118
- } else {
119
- t5 = $[17];
120
- }
121
- return t5;
37
+ })
38
+ });
122
39
  }
123
40
  export { FieldError };
@@ -1,74 +1,23 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { cn } from "cn";
3
2
  import { Separator } from "../../display/separator.js";
4
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
- function FieldSeparator(t0) {
6
- const $ = _c(14);
7
- let children;
8
- let className;
9
- let props;
10
- if ($[0] !== t0) {
11
- ({
12
- children,
13
- className,
14
- ...props
15
- } = t0);
16
- $[0] = t0;
17
- $[1] = children;
18
- $[2] = className;
19
- $[3] = props;
20
- } else {
21
- children = $[1];
22
- className = $[2];
23
- props = $[3];
24
- }
25
- const t1 = !!children;
26
- let t2;
27
- if ($[4] !== className) {
28
- t2 = cn("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className);
29
- $[4] = className;
30
- $[5] = t2;
31
- } else {
32
- t2 = $[5];
33
- }
34
- let t3;
35
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
36
- t3 = /*#__PURE__*/_jsx(Separator, {
4
+ function FieldSeparator({
5
+ children,
6
+ className,
7
+ ...props
8
+ }) {
9
+ return /*#__PURE__*/_jsxs("div", {
10
+ "data-slot": "field-separator",
11
+ "data-content": !!children,
12
+ className: cn("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className),
13
+ ...props,
14
+ children: [/*#__PURE__*/_jsx(Separator, {
37
15
  className: "absolute inset-0 top-1/2"
38
- });
39
- $[6] = t3;
40
- } else {
41
- t3 = $[6];
42
- }
43
- let t4;
44
- if ($[7] !== children) {
45
- t4 = children && /*#__PURE__*/_jsx("span", {
16
+ }), children && /*#__PURE__*/_jsx("span", {
46
17
  className: "relative mx-auto block w-fit bg-background px-2 text-muted-foreground",
47
18
  "data-slot": "field-separator-content",
48
19
  children: children
49
- });
50
- $[7] = children;
51
- $[8] = t4;
52
- } else {
53
- t4 = $[8];
54
- }
55
- let t5;
56
- if ($[9] !== props || $[10] !== t1 || $[11] !== t2 || $[12] !== t4) {
57
- t5 = /*#__PURE__*/_jsxs("div", {
58
- "data-slot": "field-separator",
59
- "data-content": t1,
60
- className: t2,
61
- ...props,
62
- children: [t3, t4]
63
- });
64
- $[9] = props;
65
- $[10] = t1;
66
- $[11] = t2;
67
- $[12] = t4;
68
- $[13] = t5;
69
- } else {
70
- t5 = $[13];
71
- }
72
- return t5;
20
+ })]
21
+ });
73
22
  }
74
23
  export { FieldSeparator };