@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,44 +1,14 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { cn } from "cn";
3
2
  import * as React from "react";
4
3
  import { jsx as _jsx } from "react/jsx-runtime";
5
- function Textarea(t0) {
6
- const $ = _c(8);
7
- let className;
8
- let props;
9
- if ($[0] !== t0) {
10
- ({
11
- className,
12
- ...props
13
- } = t0);
14
- $[0] = t0;
15
- $[1] = className;
16
- $[2] = props;
17
- } else {
18
- className = $[1];
19
- props = $[2];
20
- }
21
- let t1;
22
- if ($[3] !== className) {
23
- t1 = cn("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40", className);
24
- $[3] = className;
25
- $[4] = t1;
26
- } else {
27
- t1 = $[4];
28
- }
29
- let t2;
30
- if ($[5] !== props || $[6] !== t1) {
31
- t2 = /*#__PURE__*/_jsx("textarea", {
32
- "data-slot": "textarea",
33
- className: t1,
34
- ...props
35
- });
36
- $[5] = props;
37
- $[6] = t1;
38
- $[7] = t2;
39
- } else {
40
- t2 = $[7];
41
- }
42
- return t2;
4
+ function Textarea({
5
+ className,
6
+ ...props
7
+ }) {
8
+ return /*#__PURE__*/_jsx("textarea", {
9
+ "data-slot": "textarea",
10
+ className: cn("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40", className),
11
+ ...props
12
+ });
43
13
  }
44
14
  export { Textarea };
@@ -1,28 +1,15 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import * as React from "react";
3
2
  const MOBILE_BREAKPOINT = 768;
4
3
  export function useIsMobile() {
5
- const $ = _c(2);
6
4
  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 = () => {
13
- setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
14
- };
15
- mql.addEventListener("change", onChange);
5
+ React.useEffect(() => {
6
+ const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
7
+ const onChange = () => {
16
8
  setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
17
- return () => mql.removeEventListener("change", onChange);
18
9
  };
19
- t1 = [];
20
- $[0] = t0;
21
- $[1] = t1;
22
- } else {
23
- t0 = $[0];
24
- t1 = $[1];
25
- }
26
- React.useEffect(t0, t1);
10
+ mql.addEventListener("change", onChange);
11
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
12
+ return () => mql.removeEventListener("change", onChange);
13
+ }, []);
27
14
  return !!isMobile;
28
15
  }
@@ -1,311 +1,92 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { ChevronRight, OverflowMenuHorizontal as MoreHorizontal } from "@carbon/icons-react";
3
2
  import { cn } from "cn";
4
3
  import * as Slot from "radix-ui/slot";
5
4
  import * as React from "react";
6
5
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
- function Breadcrumb(t0) {
8
- const $ = _c(4);
9
- let props;
10
- if ($[0] !== t0) {
11
- ({
12
- ...props
13
- } = t0);
14
- $[0] = t0;
15
- $[1] = props;
16
- } else {
17
- props = $[1];
18
- }
19
- let t1;
20
- if ($[2] !== props) {
21
- t1 = /*#__PURE__*/_jsx("nav", {
22
- "aria-label": "breadcrumb",
23
- "data-slot": "breadcrumb",
24
- ...props
25
- });
26
- $[2] = props;
27
- $[3] = t1;
28
- } else {
29
- t1 = $[3];
30
- }
31
- return t1;
6
+ function Breadcrumb({
7
+ ...props
8
+ }) {
9
+ return /*#__PURE__*/_jsx("nav", {
10
+ "aria-label": "breadcrumb",
11
+ "data-slot": "breadcrumb",
12
+ ...props
13
+ });
32
14
  }
33
- function BreadcrumbList(t0) {
34
- const $ = _c(8);
35
- let className;
36
- let props;
37
- if ($[0] !== t0) {
38
- ({
39
- className,
40
- ...props
41
- } = t0);
42
- $[0] = t0;
43
- $[1] = className;
44
- $[2] = props;
45
- } else {
46
- className = $[1];
47
- props = $[2];
48
- }
49
- let t1;
50
- if ($[3] !== className) {
51
- t1 = cn("flex flex-wrap items-center gap-1.5 text-sm break-words text-muted-foreground sm:gap-2.5", className);
52
- $[3] = className;
53
- $[4] = t1;
54
- } else {
55
- t1 = $[4];
56
- }
57
- let t2;
58
- if ($[5] !== props || $[6] !== t1) {
59
- t2 = /*#__PURE__*/_jsx("ol", {
60
- "data-slot": "breadcrumb-list",
61
- className: t1,
62
- ...props
63
- });
64
- $[5] = props;
65
- $[6] = t1;
66
- $[7] = t2;
67
- } else {
68
- t2 = $[7];
69
- }
70
- return t2;
15
+ function BreadcrumbList({
16
+ className,
17
+ ...props
18
+ }) {
19
+ return /*#__PURE__*/_jsx("ol", {
20
+ "data-slot": "breadcrumb-list",
21
+ className: cn("flex flex-wrap items-center gap-1.5 text-sm break-words text-muted-foreground sm:gap-2.5", className),
22
+ ...props
23
+ });
71
24
  }
72
- function BreadcrumbItem(t0) {
73
- const $ = _c(8);
74
- let className;
75
- let props;
76
- if ($[0] !== t0) {
77
- ({
78
- className,
79
- ...props
80
- } = t0);
81
- $[0] = t0;
82
- $[1] = className;
83
- $[2] = props;
84
- } else {
85
- className = $[1];
86
- props = $[2];
87
- }
88
- let t1;
89
- if ($[3] !== className) {
90
- t1 = cn("inline-flex items-center gap-1.5", className);
91
- $[3] = className;
92
- $[4] = t1;
93
- } else {
94
- t1 = $[4];
95
- }
96
- let t2;
97
- if ($[5] !== props || $[6] !== t1) {
98
- t2 = /*#__PURE__*/_jsx("li", {
99
- "data-slot": "breadcrumb-item",
100
- className: t1,
101
- ...props
102
- });
103
- $[5] = props;
104
- $[6] = t1;
105
- $[7] = t2;
106
- } else {
107
- t2 = $[7];
108
- }
109
- return t2;
25
+ function BreadcrumbItem({
26
+ className,
27
+ ...props
28
+ }) {
29
+ return /*#__PURE__*/_jsx("li", {
30
+ "data-slot": "breadcrumb-item",
31
+ className: cn("inline-flex items-center gap-1.5", className),
32
+ ...props
33
+ });
110
34
  }
111
- function BreadcrumbLink(t0) {
112
- const $ = _c(10);
113
- let asChild;
114
- let className;
115
- let props;
116
- if ($[0] !== t0) {
117
- ({
118
- asChild,
119
- className,
120
- ...props
121
- } = t0);
122
- $[0] = t0;
123
- $[1] = asChild;
124
- $[2] = className;
125
- $[3] = props;
126
- } else {
127
- asChild = $[1];
128
- className = $[2];
129
- props = $[3];
130
- }
35
+ function BreadcrumbLink({
36
+ asChild,
37
+ className,
38
+ ...props
39
+ }) {
131
40
  const Comp = asChild ? Slot.Root : "a";
132
- let t1;
133
- if ($[4] !== className) {
134
- t1 = cn("transition-colors hover:text-foreground", className);
135
- $[4] = className;
136
- $[5] = t1;
137
- } else {
138
- t1 = $[5];
139
- }
140
- let t2;
141
- if ($[6] !== Comp || $[7] !== props || $[8] !== t1) {
142
- t2 = /*#__PURE__*/_jsx(Comp, {
143
- "data-slot": "breadcrumb-link",
144
- className: t1,
145
- ...props
146
- });
147
- $[6] = Comp;
148
- $[7] = props;
149
- $[8] = t1;
150
- $[9] = t2;
151
- } else {
152
- t2 = $[9];
153
- }
154
- return t2;
41
+ return /*#__PURE__*/_jsx(Comp, {
42
+ "data-slot": "breadcrumb-link",
43
+ className: cn("transition-colors hover:text-foreground", className),
44
+ ...props
45
+ });
155
46
  }
156
- function BreadcrumbPage(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("font-normal text-foreground", 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("span", {
183
- "data-slot": "breadcrumb-page",
184
- role: "link",
185
- "aria-disabled": "true",
186
- "aria-current": "page",
187
- className: t1,
188
- ...props
189
- });
190
- $[5] = props;
191
- $[6] = t1;
192
- $[7] = t2;
193
- } else {
194
- t2 = $[7];
195
- }
196
- return t2;
47
+ function BreadcrumbPage({
48
+ className,
49
+ ...props
50
+ }) {
51
+ return /*#__PURE__*/_jsx("span", {
52
+ "data-slot": "breadcrumb-page",
53
+ role: "link",
54
+ "aria-disabled": "true",
55
+ "aria-current": "page",
56
+ className: cn("font-normal text-foreground", className),
57
+ ...props
58
+ });
197
59
  }
198
- function BreadcrumbSeparator(t0) {
199
- const $ = _c(12);
200
- let children;
201
- let className;
202
- let props;
203
- if ($[0] !== t0) {
204
- ({
205
- children,
206
- className,
207
- ...props
208
- } = t0);
209
- $[0] = t0;
210
- $[1] = children;
211
- $[2] = className;
212
- $[3] = props;
213
- } else {
214
- children = $[1];
215
- className = $[2];
216
- props = $[3];
217
- }
218
- let t1;
219
- if ($[4] !== className) {
220
- t1 = cn("[&>svg]:size-3.5", className);
221
- $[4] = className;
222
- $[5] = t1;
223
- } else {
224
- t1 = $[5];
225
- }
226
- let t2;
227
- if ($[6] !== children) {
228
- t2 = children ?? /*#__PURE__*/_jsx(ChevronRight, {});
229
- $[6] = children;
230
- $[7] = t2;
231
- } else {
232
- t2 = $[7];
233
- }
234
- let t3;
235
- if ($[8] !== props || $[9] !== t1 || $[10] !== t2) {
236
- t3 = /*#__PURE__*/_jsx("li", {
237
- "data-slot": "breadcrumb-separator",
238
- role: "presentation",
239
- "aria-hidden": "true",
240
- className: t1,
241
- ...props,
242
- children: t2
243
- });
244
- $[8] = props;
245
- $[9] = t1;
246
- $[10] = t2;
247
- $[11] = t3;
248
- } else {
249
- t3 = $[11];
250
- }
251
- return t3;
60
+ function BreadcrumbSeparator({
61
+ children,
62
+ className,
63
+ ...props
64
+ }) {
65
+ return /*#__PURE__*/_jsx("li", {
66
+ "data-slot": "breadcrumb-separator",
67
+ role: "presentation",
68
+ "aria-hidden": "true",
69
+ className: cn("[&>svg]:size-3.5", className),
70
+ ...props,
71
+ children: children ?? /*#__PURE__*/_jsx(ChevronRight, {})
72
+ });
252
73
  }
253
- function BreadcrumbEllipsis(t0) {
254
- const $ = _c(10);
255
- let className;
256
- let props;
257
- if ($[0] !== t0) {
258
- ({
259
- className,
260
- ...props
261
- } = t0);
262
- $[0] = t0;
263
- $[1] = className;
264
- $[2] = props;
265
- } else {
266
- className = $[1];
267
- props = $[2];
268
- }
269
- let t1;
270
- if ($[3] !== className) {
271
- t1 = cn("flex size-9 items-center justify-center", className);
272
- $[3] = className;
273
- $[4] = t1;
274
- } else {
275
- t1 = $[4];
276
- }
277
- let t2;
278
- let t3;
279
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
280
- t2 = /*#__PURE__*/_jsx(MoreHorizontal, {
74
+ function BreadcrumbEllipsis({
75
+ className,
76
+ ...props
77
+ }) {
78
+ return /*#__PURE__*/_jsxs("span", {
79
+ "data-slot": "breadcrumb-ellipsis",
80
+ role: "presentation",
81
+ "aria-hidden": "true",
82
+ className: cn("flex size-9 items-center justify-center", className),
83
+ ...props,
84
+ children: [/*#__PURE__*/_jsx(MoreHorizontal, {
281
85
  className: "size-4"
282
- });
283
- t3 = /*#__PURE__*/_jsx("span", {
86
+ }), /*#__PURE__*/_jsx("span", {
284
87
  className: "sr-only",
285
88
  children: "More"
286
- });
287
- $[5] = t2;
288
- $[6] = t3;
289
- } else {
290
- t2 = $[5];
291
- t3 = $[6];
292
- }
293
- let t4;
294
- if ($[7] !== props || $[8] !== t1) {
295
- t4 = /*#__PURE__*/_jsxs("span", {
296
- "data-slot": "breadcrumb-ellipsis",
297
- role: "presentation",
298
- "aria-hidden": "true",
299
- className: t1,
300
- ...props,
301
- children: [t2, t3]
302
- });
303
- $[7] = props;
304
- $[8] = t1;
305
- $[9] = t4;
306
- } else {
307
- t4 = $[9];
308
- }
309
- return t4;
89
+ })]
90
+ });
310
91
  }
311
92
  export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator };