@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,338 +1,101 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { ChevronLeft as ChevronLeftIcon, ChevronRight as ChevronRightIcon, OverflowMenuHorizontal as MoreHorizontalIcon } from "@carbon/icons-react";
3
2
  import { cn } from "cn";
4
3
  import * as React from "react";
5
4
  import { buttonVariants } from "../action/button.js";
6
5
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
- function Pagination(t0) {
8
- const $ = _c(8);
9
- let className;
10
- let props;
11
- if ($[0] !== t0) {
12
- ({
13
- className,
14
- ...props
15
- } = t0);
16
- $[0] = t0;
17
- $[1] = className;
18
- $[2] = props;
19
- } else {
20
- className = $[1];
21
- props = $[2];
22
- }
23
- let t1;
24
- if ($[3] !== className) {
25
- t1 = cn("mx-auto flex w-full justify-center", className);
26
- $[3] = className;
27
- $[4] = t1;
28
- } else {
29
- t1 = $[4];
30
- }
31
- let t2;
32
- if ($[5] !== props || $[6] !== t1) {
33
- t2 = /*#__PURE__*/_jsx("nav", {
34
- role: "navigation",
35
- "aria-label": "pagination",
36
- "data-slot": "pagination",
37
- className: t1,
38
- ...props
39
- });
40
- $[5] = props;
41
- $[6] = t1;
42
- $[7] = t2;
43
- } else {
44
- t2 = $[7];
45
- }
46
- return t2;
6
+ function Pagination({
7
+ className,
8
+ ...props
9
+ }) {
10
+ return /*#__PURE__*/_jsx("nav", {
11
+ role: "navigation",
12
+ "aria-label": "pagination",
13
+ "data-slot": "pagination",
14
+ className: cn("mx-auto flex w-full justify-center", className),
15
+ ...props
16
+ });
47
17
  }
48
- function PaginationContent(t0) {
49
- const $ = _c(8);
50
- let className;
51
- let props;
52
- if ($[0] !== t0) {
53
- ({
54
- className,
55
- ...props
56
- } = t0);
57
- $[0] = t0;
58
- $[1] = className;
59
- $[2] = props;
60
- } else {
61
- className = $[1];
62
- props = $[2];
63
- }
64
- let t1;
65
- if ($[3] !== className) {
66
- t1 = cn("flex flex-row items-center gap-1", className);
67
- $[3] = className;
68
- $[4] = t1;
69
- } else {
70
- t1 = $[4];
71
- }
72
- let t2;
73
- if ($[5] !== props || $[6] !== t1) {
74
- t2 = /*#__PURE__*/_jsx("ul", {
75
- "data-slot": "pagination-content",
76
- className: t1,
77
- ...props
78
- });
79
- $[5] = props;
80
- $[6] = t1;
81
- $[7] = t2;
82
- } else {
83
- t2 = $[7];
84
- }
85
- return t2;
18
+ function PaginationContent({
19
+ className,
20
+ ...props
21
+ }) {
22
+ return /*#__PURE__*/_jsx("ul", {
23
+ "data-slot": "pagination-content",
24
+ className: cn("flex flex-row items-center gap-1", className),
25
+ ...props
26
+ });
86
27
  }
87
- function PaginationItem(t0) {
88
- const $ = _c(4);
89
- let props;
90
- if ($[0] !== t0) {
91
- ({
92
- ...props
93
- } = t0);
94
- $[0] = t0;
95
- $[1] = props;
96
- } else {
97
- props = $[1];
98
- }
99
- let t1;
100
- if ($[2] !== props) {
101
- t1 = /*#__PURE__*/_jsx("li", {
102
- "data-slot": "pagination-item",
103
- ...props
104
- });
105
- $[2] = props;
106
- $[3] = t1;
107
- } else {
108
- t1 = $[3];
109
- }
110
- return t1;
28
+ function PaginationItem({
29
+ ...props
30
+ }) {
31
+ return /*#__PURE__*/_jsx("li", {
32
+ "data-slot": "pagination-item",
33
+ ...props
34
+ });
111
35
  }
112
36
  const activePageEmphasis = "border-input bg-muted font-semibold text-foreground dark:bg-muted";
113
- function PaginationLink(t0) {
114
- const $ = _c(14);
115
- let className;
116
- let isActive;
117
- let props;
118
- let t1;
119
- if ($[0] !== t0) {
120
- ({
121
- className,
122
- isActive,
123
- size: t1,
124
- ...props
125
- } = t0);
126
- $[0] = t0;
127
- $[1] = className;
128
- $[2] = isActive;
129
- $[3] = props;
130
- $[4] = t1;
131
- } else {
132
- className = $[1];
133
- isActive = $[2];
134
- props = $[3];
135
- t1 = $[4];
136
- }
137
- const size = t1 === undefined ? "icon" : t1;
138
- const t2 = isActive ? "page" : undefined;
139
- let t3;
140
- if ($[5] !== className || $[6] !== isActive || $[7] !== size) {
141
- t3 = cn(buttonVariants({
37
+ function PaginationLink({
38
+ className,
39
+ isActive,
40
+ size = "icon",
41
+ ...props
42
+ }) {
43
+ return /*#__PURE__*/_jsx("a", {
44
+ "aria-current": isActive ? "page" : undefined,
45
+ "data-slot": "pagination-link",
46
+ "data-active": isActive,
47
+ className: cn(buttonVariants({
142
48
  variant: isActive ? "outline" : "ghost",
143
49
  size
144
- }), isActive ? activePageEmphasis : "text-muted-foreground hover:text-foreground", className);
145
- $[5] = className;
146
- $[6] = isActive;
147
- $[7] = size;
148
- $[8] = t3;
149
- } else {
150
- t3 = $[8];
151
- }
152
- let t4;
153
- if ($[9] !== isActive || $[10] !== props || $[11] !== t2 || $[12] !== t3) {
154
- t4 = /*#__PURE__*/_jsx("a", {
155
- "aria-current": t2,
156
- "data-slot": "pagination-link",
157
- "data-active": isActive,
158
- className: t3,
159
- ...props
160
- });
161
- $[9] = isActive;
162
- $[10] = props;
163
- $[11] = t2;
164
- $[12] = t3;
165
- $[13] = t4;
166
- } else {
167
- t4 = $[13];
168
- }
169
- return t4;
50
+ }), isActive ? activePageEmphasis : "text-muted-foreground hover:text-foreground", className),
51
+ ...props
52
+ });
170
53
  }
171
- function PaginationPrevious(t0) {
172
- const $ = _c(10);
173
- let className;
174
- let props;
175
- if ($[0] !== t0) {
176
- ({
177
- className,
178
- ...props
179
- } = t0);
180
- $[0] = t0;
181
- $[1] = className;
182
- $[2] = props;
183
- } else {
184
- className = $[1];
185
- props = $[2];
186
- }
187
- let t1;
188
- if ($[3] !== className) {
189
- t1 = cn("gap-1 px-2.5 text-foreground sm:pl-2.5", className);
190
- $[3] = className;
191
- $[4] = t1;
192
- } else {
193
- t1 = $[4];
194
- }
195
- let t2;
196
- let t3;
197
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
198
- t2 = /*#__PURE__*/_jsx(ChevronLeftIcon, {});
199
- t3 = /*#__PURE__*/_jsx("span", {
54
+ function PaginationPrevious({
55
+ className,
56
+ ...props
57
+ }) {
58
+ return /*#__PURE__*/_jsxs(PaginationLink, {
59
+ "aria-label": "Go to previous page",
60
+ size: "default",
61
+ className: cn("gap-1 px-2.5 text-foreground sm:pl-2.5", className),
62
+ ...props,
63
+ children: [/*#__PURE__*/_jsx(ChevronLeftIcon, {}), /*#__PURE__*/_jsx("span", {
200
64
  className: "hidden sm:block",
201
65
  children: "Previous"
202
- });
203
- $[5] = t2;
204
- $[6] = t3;
205
- } else {
206
- t2 = $[5];
207
- t3 = $[6];
208
- }
209
- let t4;
210
- if ($[7] !== props || $[8] !== t1) {
211
- t4 = /*#__PURE__*/_jsxs(PaginationLink, {
212
- "aria-label": "Go to previous page",
213
- size: "default",
214
- className: t1,
215
- ...props,
216
- children: [t2, t3]
217
- });
218
- $[7] = props;
219
- $[8] = t1;
220
- $[9] = t4;
221
- } else {
222
- t4 = $[9];
223
- }
224
- return t4;
66
+ })]
67
+ });
225
68
  }
226
- function PaginationNext(t0) {
227
- const $ = _c(10);
228
- let className;
229
- let props;
230
- if ($[0] !== t0) {
231
- ({
232
- className,
233
- ...props
234
- } = t0);
235
- $[0] = t0;
236
- $[1] = className;
237
- $[2] = props;
238
- } else {
239
- className = $[1];
240
- props = $[2];
241
- }
242
- let t1;
243
- if ($[3] !== className) {
244
- t1 = cn("gap-1 px-2.5 text-foreground sm:pr-2.5", className);
245
- $[3] = className;
246
- $[4] = t1;
247
- } else {
248
- t1 = $[4];
249
- }
250
- let t2;
251
- let t3;
252
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
253
- t2 = /*#__PURE__*/_jsx("span", {
69
+ function PaginationNext({
70
+ className,
71
+ ...props
72
+ }) {
73
+ return /*#__PURE__*/_jsxs(PaginationLink, {
74
+ "aria-label": "Go to next page",
75
+ size: "default",
76
+ className: cn("gap-1 px-2.5 text-foreground sm:pr-2.5", className),
77
+ ...props,
78
+ children: [/*#__PURE__*/_jsx("span", {
254
79
  className: "hidden sm:block",
255
80
  children: "Next"
256
- });
257
- t3 = /*#__PURE__*/_jsx(ChevronRightIcon, {});
258
- $[5] = t2;
259
- $[6] = t3;
260
- } else {
261
- t2 = $[5];
262
- t3 = $[6];
263
- }
264
- let t4;
265
- if ($[7] !== props || $[8] !== t1) {
266
- t4 = /*#__PURE__*/_jsxs(PaginationLink, {
267
- "aria-label": "Go to next page",
268
- size: "default",
269
- className: t1,
270
- ...props,
271
- children: [t2, t3]
272
- });
273
- $[7] = props;
274
- $[8] = t1;
275
- $[9] = t4;
276
- } else {
277
- t4 = $[9];
278
- }
279
- return t4;
81
+ }), /*#__PURE__*/_jsx(ChevronRightIcon, {})]
82
+ });
280
83
  }
281
- function PaginationEllipsis(t0) {
282
- const $ = _c(10);
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("flex size-9 items-center justify-center", className);
300
- $[3] = className;
301
- $[4] = t1;
302
- } else {
303
- t1 = $[4];
304
- }
305
- let t2;
306
- let t3;
307
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
308
- t2 = /*#__PURE__*/_jsx(MoreHorizontalIcon, {
84
+ function PaginationEllipsis({
85
+ className,
86
+ ...props
87
+ }) {
88
+ return /*#__PURE__*/_jsxs("span", {
89
+ "aria-hidden": true,
90
+ "data-slot": "pagination-ellipsis",
91
+ className: cn("flex size-9 items-center justify-center", className),
92
+ ...props,
93
+ children: [/*#__PURE__*/_jsx(MoreHorizontalIcon, {
309
94
  className: "size-4"
310
- });
311
- t3 = /*#__PURE__*/_jsx("span", {
95
+ }), /*#__PURE__*/_jsx("span", {
312
96
  className: "sr-only",
313
97
  children: "More pages"
314
- });
315
- $[5] = t2;
316
- $[6] = t3;
317
- } else {
318
- t2 = $[5];
319
- t3 = $[6];
320
- }
321
- let t4;
322
- if ($[7] !== props || $[8] !== t1) {
323
- t4 = /*#__PURE__*/_jsxs("span", {
324
- "aria-hidden": true,
325
- "data-slot": "pagination-ellipsis",
326
- className: t1,
327
- ...props,
328
- children: [t2, t3]
329
- });
330
- $[7] = props;
331
- $[8] = t1;
332
- $[9] = t4;
333
- } else {
334
- t4 = $[9];
335
- }
336
- return t4;
98
+ })]
99
+ });
337
100
  }
338
101
  export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious };
@@ -1,86 +1,34 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { Separator } from "../display/separator.js";
3
2
  import { SidebarTrigger } from "../layout/sidebar/sidebar.js";
4
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
- function AppHeader(t0) {
6
- const $ = _c(7);
7
- const {
8
- breadcrumbs,
9
- children
10
- } = t0;
11
- let t1;
12
- let t2;
13
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
14
- t1 = /*#__PURE__*/_jsx(SidebarTrigger, {
4
+ function AppHeader({
5
+ breadcrumbs,
6
+ children
7
+ }) {
8
+ return /*#__PURE__*/_jsxs("header", {
9
+ "data-slot": "app-header",
10
+ className: "flex h-14 shrink-0 items-center gap-3 border-b border-line bg-background px-4",
11
+ children: [/*#__PURE__*/_jsx(SidebarTrigger, {
15
12
  className: "-ml-1"
16
- });
17
- t2 = /*#__PURE__*/_jsx(Separator, {
13
+ }), /*#__PURE__*/_jsx(Separator, {
18
14
  orientation: "vertical",
19
15
  className: "h-4"
20
- });
21
- $[0] = t1;
22
- $[1] = t2;
23
- } else {
24
- t1 = $[0];
25
- t2 = $[1];
26
- }
27
- let t3;
28
- if ($[2] !== children) {
29
- t3 = /*#__PURE__*/_jsx("div", {
16
+ }), breadcrumbs, /*#__PURE__*/_jsx("div", {
30
17
  className: "ml-auto flex shrink-0 items-center gap-2",
31
18
  children: children
32
- });
33
- $[2] = children;
34
- $[3] = t3;
35
- } else {
36
- t3 = $[3];
37
- }
38
- let t4;
39
- if ($[4] !== breadcrumbs || $[5] !== t3) {
40
- t4 = /*#__PURE__*/_jsxs("header", {
41
- "data-slot": "app-header",
42
- className: "flex h-14 shrink-0 items-center gap-3 border-b border-line bg-background px-4",
43
- children: [t1, t2, breadcrumbs, t3]
44
- });
45
- $[4] = breadcrumbs;
46
- $[5] = t3;
47
- $[6] = t4;
48
- } else {
49
- t4 = $[6];
50
- }
51
- return t4;
19
+ })]
20
+ });
52
21
  }
53
- function CommandHint(t0) {
54
- const $ = _c(5);
55
- const {
56
- shortcut: t1,
57
- label: t2
58
- } = t0;
59
- const shortcut = t1 === undefined ? "\u2318K" : t1;
60
- const label = t2 === undefined ? "commands" : t2;
61
- let t3;
62
- if ($[0] !== shortcut) {
63
- t3 = /*#__PURE__*/_jsx("kbd", {
22
+ function CommandHint({
23
+ shortcut = "⌘K",
24
+ label = "commands"
25
+ }) {
26
+ return /*#__PURE__*/_jsxs("span", {
27
+ className: "hidden items-center gap-1.5 text-xs text-faint 2xl:flex",
28
+ children: [/*#__PURE__*/_jsx("kbd", {
64
29
  className: "rounded border border-line bg-ghost px-1.5 py-0.5 font-mono text-[11px]",
65
30
  children: shortcut
66
- });
67
- $[0] = shortcut;
68
- $[1] = t3;
69
- } else {
70
- t3 = $[1];
71
- }
72
- let t4;
73
- if ($[2] !== label || $[3] !== t3) {
74
- t4 = /*#__PURE__*/_jsxs("span", {
75
- className: "hidden items-center gap-1.5 text-xs text-faint 2xl:flex",
76
- children: [t3, label]
77
- });
78
- $[2] = label;
79
- $[3] = t3;
80
- $[4] = t4;
81
- } else {
82
- t4 = $[4];
83
- }
84
- return t4;
31
+ }), label]
32
+ });
85
33
  }
86
34
  export { AppHeader, CommandHint };
@@ -1,63 +1,24 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { cn } from "cn";
3
2
  import { SidebarInset } from "../layout/sidebar/sidebar.js";
4
3
  import { SidebarProvider } from "../layout/sidebar/sidebar-context.js";
5
4
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
- function AppShell(t0) {
7
- const $ = _c(12);
8
- const {
9
- sidebar,
10
- header,
11
- children,
12
- defaultOpen,
13
- bodyClassName
14
- } = t0;
15
- let t1;
16
- if ($[0] !== bodyClassName) {
17
- t1 = cn("no-scrollbar flex w-full flex-1 flex-col overflow-y-auto px-6 pt-7 pb-8 lg:px-8", bodyClassName);
18
- $[0] = bodyClassName;
19
- $[1] = t1;
20
- } else {
21
- t1 = $[1];
22
- }
23
- let t2;
24
- if ($[2] !== children || $[3] !== t1) {
25
- t2 = /*#__PURE__*/_jsx("div", {
26
- "data-slot": "app-shell-body",
27
- className: t1,
28
- children: children
29
- });
30
- $[2] = children;
31
- $[3] = t1;
32
- $[4] = t2;
33
- } else {
34
- t2 = $[4];
35
- }
36
- let t3;
37
- if ($[5] !== header || $[6] !== t2) {
38
- t3 = /*#__PURE__*/_jsxs(SidebarInset, {
5
+ function AppShell({
6
+ sidebar,
7
+ header,
8
+ children,
9
+ defaultOpen,
10
+ bodyClassName
11
+ }) {
12
+ return /*#__PURE__*/_jsxs(SidebarProvider, {
13
+ defaultOpen: defaultOpen,
14
+ children: [sidebar, /*#__PURE__*/_jsxs(SidebarInset, {
39
15
  className: "h-svh overflow-hidden",
40
- children: [header, t2]
41
- });
42
- $[5] = header;
43
- $[6] = t2;
44
- $[7] = t3;
45
- } else {
46
- t3 = $[7];
47
- }
48
- let t4;
49
- if ($[8] !== defaultOpen || $[9] !== sidebar || $[10] !== t3) {
50
- t4 = /*#__PURE__*/_jsxs(SidebarProvider, {
51
- defaultOpen: defaultOpen,
52
- children: [sidebar, t3]
53
- });
54
- $[8] = defaultOpen;
55
- $[9] = sidebar;
56
- $[10] = t3;
57
- $[11] = t4;
58
- } else {
59
- t4 = $[11];
60
- }
61
- return t4;
16
+ children: [header, /*#__PURE__*/_jsx("div", {
17
+ "data-slot": "app-shell-body",
18
+ className: cn("no-scrollbar flex w-full flex-1 flex-col overflow-y-auto px-6 pt-7 pb-8 lg:px-8", bodyClassName),
19
+ children: children
20
+ })]
21
+ })]
22
+ });
62
23
  }
63
24
  export { AppShell };