@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,379 +1,103 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { ChevronDown as ChevronDownIcon } from "@carbon/icons-react";
3
2
  import { cva } from "class-variance-authority";
4
3
  import { cn } from "cn";
5
4
  import * as NavigationMenuPrimitive from "radix-ui/navigation-menu";
6
5
  import * as React from "react";
7
6
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
- function NavigationMenu(t0) {
9
- const $ = _c(15);
10
- let children;
11
- let className;
12
- let props;
13
- let t1;
14
- if ($[0] !== t0) {
15
- ({
16
- className,
17
- children,
18
- viewport: t1,
19
- ...props
20
- } = t0);
21
- $[0] = t0;
22
- $[1] = children;
23
- $[2] = className;
24
- $[3] = props;
25
- $[4] = t1;
26
- } else {
27
- children = $[1];
28
- className = $[2];
29
- props = $[3];
30
- t1 = $[4];
31
- }
32
- const viewport = t1 === undefined ? true : t1;
33
- let t2;
34
- if ($[5] !== className) {
35
- t2 = cn("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center", className);
36
- $[5] = className;
37
- $[6] = t2;
38
- } else {
39
- t2 = $[6];
40
- }
41
- let t3;
42
- if ($[7] !== viewport) {
43
- t3 = viewport && /*#__PURE__*/_jsx(NavigationMenuViewport, {});
44
- $[7] = viewport;
45
- $[8] = t3;
46
- } else {
47
- t3 = $[8];
48
- }
49
- let t4;
50
- if ($[9] !== children || $[10] !== props || $[11] !== t2 || $[12] !== t3 || $[13] !== viewport) {
51
- t4 = /*#__PURE__*/_jsxs(NavigationMenuPrimitive.Root, {
52
- "data-slot": "navigation-menu",
53
- "data-viewport": viewport,
54
- className: t2,
55
- ...props,
56
- children: [children, t3]
57
- });
58
- $[9] = children;
59
- $[10] = props;
60
- $[11] = t2;
61
- $[12] = t3;
62
- $[13] = viewport;
63
- $[14] = t4;
64
- } else {
65
- t4 = $[14];
66
- }
67
- return t4;
7
+ function NavigationMenu({
8
+ className,
9
+ children,
10
+ viewport = true,
11
+ ...props
12
+ }) {
13
+ return /*#__PURE__*/_jsxs(NavigationMenuPrimitive.Root, {
14
+ "data-slot": "navigation-menu",
15
+ "data-viewport": viewport,
16
+ className: cn("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center", className),
17
+ ...props,
18
+ children: [children, viewport && /*#__PURE__*/_jsx(NavigationMenuViewport, {})]
19
+ });
68
20
  }
69
- function NavigationMenuList(t0) {
70
- const $ = _c(8);
71
- let className;
72
- let props;
73
- if ($[0] !== t0) {
74
- ({
75
- className,
76
- ...props
77
- } = t0);
78
- $[0] = t0;
79
- $[1] = className;
80
- $[2] = props;
81
- } else {
82
- className = $[1];
83
- props = $[2];
84
- }
85
- let t1;
86
- if ($[3] !== className) {
87
- t1 = cn("group flex flex-1 list-none items-center justify-center gap-1", className);
88
- $[3] = className;
89
- $[4] = t1;
90
- } else {
91
- t1 = $[4];
92
- }
93
- let t2;
94
- if ($[5] !== props || $[6] !== t1) {
95
- t2 = /*#__PURE__*/_jsx(NavigationMenuPrimitive.List, {
96
- "data-slot": "navigation-menu-list",
97
- className: t1,
98
- ...props
99
- });
100
- $[5] = props;
101
- $[6] = t1;
102
- $[7] = t2;
103
- } else {
104
- t2 = $[7];
105
- }
106
- return t2;
21
+ function NavigationMenuList({
22
+ className,
23
+ ...props
24
+ }) {
25
+ return /*#__PURE__*/_jsx(NavigationMenuPrimitive.List, {
26
+ "data-slot": "navigation-menu-list",
27
+ className: cn("group flex flex-1 list-none items-center justify-center gap-1", className),
28
+ ...props
29
+ });
107
30
  }
108
- function NavigationMenuItem(t0) {
109
- const $ = _c(8);
110
- let className;
111
- let props;
112
- if ($[0] !== t0) {
113
- ({
114
- className,
115
- ...props
116
- } = t0);
117
- $[0] = t0;
118
- $[1] = className;
119
- $[2] = props;
120
- } else {
121
- className = $[1];
122
- props = $[2];
123
- }
124
- let t1;
125
- if ($[3] !== className) {
126
- t1 = cn("relative", className);
127
- $[3] = className;
128
- $[4] = t1;
129
- } else {
130
- t1 = $[4];
131
- }
132
- let t2;
133
- if ($[5] !== props || $[6] !== t1) {
134
- t2 = /*#__PURE__*/_jsx(NavigationMenuPrimitive.Item, {
135
- "data-slot": "navigation-menu-item",
136
- className: t1,
137
- ...props
138
- });
139
- $[5] = props;
140
- $[6] = t1;
141
- $[7] = t2;
142
- } else {
143
- t2 = $[7];
144
- }
145
- return t2;
31
+ function NavigationMenuItem({
32
+ className,
33
+ ...props
34
+ }) {
35
+ return /*#__PURE__*/_jsx(NavigationMenuPrimitive.Item, {
36
+ "data-slot": "navigation-menu-item",
37
+ className: cn("relative", className),
38
+ ...props
39
+ });
146
40
  }
147
41
  const navigationMenuTriggerStyle = cva("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-[color,box-shadow] outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-accent/50 data-[state=open]:text-accent-foreground data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent");
148
- function NavigationMenuTrigger(t0) {
149
- const $ = _c(11);
150
- let children;
151
- let className;
152
- let props;
153
- if ($[0] !== t0) {
154
- ({
155
- className,
156
- children,
157
- ...props
158
- } = t0);
159
- $[0] = t0;
160
- $[1] = children;
161
- $[2] = className;
162
- $[3] = props;
163
- } else {
164
- children = $[1];
165
- className = $[2];
166
- props = $[3];
167
- }
168
- let t1;
169
- if ($[4] !== className) {
170
- t1 = cn(navigationMenuTriggerStyle(), "group", className);
171
- $[4] = className;
172
- $[5] = t1;
173
- } else {
174
- t1 = $[5];
175
- }
176
- let t2;
177
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
178
- t2 = /*#__PURE__*/_jsx(ChevronDownIcon, {
42
+ function NavigationMenuTrigger({
43
+ className,
44
+ children,
45
+ ...props
46
+ }) {
47
+ return /*#__PURE__*/_jsxs(NavigationMenuPrimitive.Trigger, {
48
+ "data-slot": "navigation-menu-trigger",
49
+ className: cn(navigationMenuTriggerStyle(), "group", className),
50
+ ...props,
51
+ children: [children, " ", /*#__PURE__*/_jsx(ChevronDownIcon, {
179
52
  className: "relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180",
180
53
  "aria-hidden": "true"
181
- });
182
- $[6] = t2;
183
- } else {
184
- t2 = $[6];
185
- }
186
- let t3;
187
- if ($[7] !== children || $[8] !== props || $[9] !== t1) {
188
- t3 = /*#__PURE__*/_jsxs(NavigationMenuPrimitive.Trigger, {
189
- "data-slot": "navigation-menu-trigger",
190
- className: t1,
191
- ...props,
192
- children: [children, " ", t2]
193
- });
194
- $[7] = children;
195
- $[8] = props;
196
- $[9] = t1;
197
- $[10] = t3;
198
- } else {
199
- t3 = $[10];
200
- }
201
- return t3;
54
+ })]
55
+ });
202
56
  }
203
- function NavigationMenuContent(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("top-0 left-0 w-full p-2 pr-2.5 data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out md:absolute md:w-auto", "group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow-overlay group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95", 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(NavigationMenuPrimitive.Content, {
230
- "data-slot": "navigation-menu-content",
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 NavigationMenuContent({
58
+ className,
59
+ ...props
60
+ }) {
61
+ return /*#__PURE__*/_jsx(NavigationMenuPrimitive.Content, {
62
+ "data-slot": "navigation-menu-content",
63
+ className: cn("top-0 left-0 w-full p-2 pr-2.5 data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out md:absolute md:w-auto", "group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow-overlay group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95", className),
64
+ ...props
65
+ });
241
66
  }
242
- function NavigationMenuViewport(t0) {
243
- const $ = _c(9);
244
- let className;
245
- let props;
246
- if ($[0] !== t0) {
247
- ({
248
- className,
67
+ function NavigationMenuViewport({
68
+ className,
69
+ ...props
70
+ }) {
71
+ return /*#__PURE__*/_jsx("div", {
72
+ className: cn("absolute top-full left-0 isolate z-50 flex justify-center"),
73
+ children: /*#__PURE__*/_jsx(NavigationMenuPrimitive.Viewport, {
74
+ "data-slot": "navigation-menu-viewport",
75
+ className: cn("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-overlay data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]", className),
249
76
  ...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] === Symbol.for("react.memo_cache_sentinel")) {
260
- t1 = cn("absolute top-full left-0 isolate z-50 flex justify-center");
261
- $[3] = t1;
262
- } else {
263
- t1 = $[3];
264
- }
265
- let t2;
266
- if ($[4] !== className) {
267
- t2 = cn("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-overlay data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]", className);
268
- $[4] = className;
269
- $[5] = t2;
270
- } else {
271
- t2 = $[5];
272
- }
273
- let t3;
274
- if ($[6] !== props || $[7] !== t2) {
275
- t3 = /*#__PURE__*/_jsx("div", {
276
- className: t1,
277
- children: /*#__PURE__*/_jsx(NavigationMenuPrimitive.Viewport, {
278
- "data-slot": "navigation-menu-viewport",
279
- className: t2,
280
- ...props
281
- })
282
- });
283
- $[6] = props;
284
- $[7] = t2;
285
- $[8] = t3;
286
- } else {
287
- t3 = $[8];
288
- }
289
- return t3;
77
+ })
78
+ });
290
79
  }
291
- function NavigationMenuLink(t0) {
292
- const $ = _c(8);
293
- let className;
294
- let props;
295
- if ($[0] !== t0) {
296
- ({
297
- className,
298
- ...props
299
- } = t0);
300
- $[0] = t0;
301
- $[1] = className;
302
- $[2] = props;
303
- } else {
304
- className = $[1];
305
- props = $[2];
306
- }
307
- let t1;
308
- if ($[3] !== className) {
309
- t1 = cn("flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-1 data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground data-[active=true]:hover:bg-accent data-[active=true]:focus:bg-accent [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", className);
310
- $[3] = className;
311
- $[4] = t1;
312
- } else {
313
- t1 = $[4];
314
- }
315
- let t2;
316
- if ($[5] !== props || $[6] !== t1) {
317
- t2 = /*#__PURE__*/_jsx(NavigationMenuPrimitive.Link, {
318
- "data-slot": "navigation-menu-link",
319
- className: t1,
320
- ...props
321
- });
322
- $[5] = props;
323
- $[6] = t1;
324
- $[7] = t2;
325
- } else {
326
- t2 = $[7];
327
- }
328
- return t2;
80
+ function NavigationMenuLink({
81
+ className,
82
+ ...props
83
+ }) {
84
+ return /*#__PURE__*/_jsx(NavigationMenuPrimitive.Link, {
85
+ "data-slot": "navigation-menu-link",
86
+ className: cn("flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-1 data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground data-[active=true]:hover:bg-accent data-[active=true]:focus:bg-accent [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", className),
87
+ ...props
88
+ });
329
89
  }
330
- function NavigationMenuIndicator(t0) {
331
- const $ = _c(9);
332
- let className;
333
- let props;
334
- if ($[0] !== t0) {
335
- ({
336
- className,
337
- ...props
338
- } = t0);
339
- $[0] = t0;
340
- $[1] = className;
341
- $[2] = props;
342
- } else {
343
- className = $[1];
344
- props = $[2];
345
- }
346
- let t1;
347
- if ($[3] !== className) {
348
- t1 = cn("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:animate-in data-[state=visible]:fade-in", className);
349
- $[3] = className;
350
- $[4] = t1;
351
- } else {
352
- t1 = $[4];
353
- }
354
- let t2;
355
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
356
- t2 = /*#__PURE__*/_jsx("div", {
90
+ function NavigationMenuIndicator({
91
+ className,
92
+ ...props
93
+ }) {
94
+ return /*#__PURE__*/_jsx(NavigationMenuPrimitive.Indicator, {
95
+ "data-slot": "navigation-menu-indicator",
96
+ className: cn("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:animate-in data-[state=visible]:fade-in", className),
97
+ ...props,
98
+ children: /*#__PURE__*/_jsx("div", {
357
99
  className: "relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"
358
- });
359
- $[5] = t2;
360
- } else {
361
- t2 = $[5];
362
- }
363
- let t3;
364
- if ($[6] !== props || $[7] !== t1) {
365
- t3 = /*#__PURE__*/_jsx(NavigationMenuPrimitive.Indicator, {
366
- "data-slot": "navigation-menu-indicator",
367
- className: t1,
368
- ...props,
369
- children: t2
370
- });
371
- $[6] = props;
372
- $[7] = t1;
373
- $[8] = t3;
374
- } else {
375
- t3 = $[8];
376
- }
377
- return t3;
100
+ })
101
+ });
378
102
  }
379
103
  export { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, navigationMenuTriggerStyle };