@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,4 +1,3 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { cva } from "class-variance-authority";
3
2
  import { cn } from "cn";
4
3
  import { SkeletonBar, SkeletonLoadingLabel, skeletonRootProps } from "../skeleton-parts.js";
@@ -15,88 +14,25 @@ const skeletonAvatarVariants = cva("rounded-full", {
15
14
  size: "md"
16
15
  }
17
16
  });
18
- function SkeletonAvatar(t0) {
19
- const $ = _c(19);
20
- let className;
21
- let label;
22
- let props;
23
- let t1;
24
- if ($[0] !== t0) {
25
- ({
26
- size: t1,
27
- label,
28
- className,
29
- ...props
30
- } = t0);
31
- $[0] = t0;
32
- $[1] = className;
33
- $[2] = label;
34
- $[3] = props;
35
- $[4] = t1;
36
- } else {
37
- className = $[1];
38
- label = $[2];
39
- props = $[3];
40
- t1 = $[4];
41
- }
42
- const size = t1 === undefined ? "md" : t1;
43
- let t2;
44
- if ($[5] !== className) {
45
- t2 = cn("inline-flex shrink-0", className);
46
- $[5] = className;
47
- $[6] = t2;
48
- } else {
49
- t2 = $[6];
50
- }
51
- let t3;
52
- if ($[7] !== size) {
53
- t3 = skeletonAvatarVariants({
54
- size
55
- });
56
- $[7] = size;
57
- $[8] = t3;
58
- } else {
59
- t3 = $[8];
60
- }
61
- let t4;
62
- if ($[9] !== t3) {
63
- t4 = /*#__PURE__*/_jsx(SkeletonBar, {
64
- className: t3
65
- });
66
- $[9] = t3;
67
- $[10] = t4;
68
- } else {
69
- t4 = $[10];
70
- }
71
- let t5;
72
- if ($[11] !== label) {
73
- t5 = /*#__PURE__*/_jsx(SkeletonLoadingLabel, {
17
+ function SkeletonAvatar({
18
+ size = "md",
19
+ label,
20
+ className,
21
+ ...props
22
+ }) {
23
+ return /*#__PURE__*/_jsxs("div", {
24
+ "data-slot": "skeleton-avatar",
25
+ "data-size": size,
26
+ ...skeletonRootProps,
27
+ className: cn("inline-flex shrink-0", className),
28
+ ...props,
29
+ children: [/*#__PURE__*/_jsx(SkeletonBar, {
30
+ className: skeletonAvatarVariants({
31
+ size
32
+ })
33
+ }), /*#__PURE__*/_jsx(SkeletonLoadingLabel, {
74
34
  children: label
75
- });
76
- $[11] = label;
77
- $[12] = t5;
78
- } else {
79
- t5 = $[12];
80
- }
81
- let t6;
82
- if ($[13] !== props || $[14] !== size || $[15] !== t2 || $[16] !== t4 || $[17] !== t5) {
83
- t6 = /*#__PURE__*/_jsxs("div", {
84
- "data-slot": "skeleton-avatar",
85
- "data-size": size,
86
- ...skeletonRootProps,
87
- className: t2,
88
- ...props,
89
- children: [t4, t5]
90
- });
91
- $[13] = props;
92
- $[14] = size;
93
- $[15] = t2;
94
- $[16] = t4;
95
- $[17] = t5;
96
- $[18] = t6;
97
- } else {
98
- t6 = $[18];
99
- }
100
- return t6;
35
+ })]
36
+ });
101
37
  }
102
38
  export { SkeletonAvatar, skeletonAvatarVariants };
@@ -1,4 +1,3 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { cva } from "class-variance-authority";
3
2
  import { cn } from "cn";
4
3
  import { SkeletonBar, SkeletonLoadingLabel, skeletonRootProps } from "../skeleton-parts.js";
@@ -15,88 +14,25 @@ const skeletonButtonVariants = cva("rounded-full", {
15
14
  size: "default"
16
15
  }
17
16
  });
18
- function SkeletonButton(t0) {
19
- const $ = _c(19);
20
- let className;
21
- let label;
22
- let props;
23
- let t1;
24
- if ($[0] !== t0) {
25
- ({
26
- size: t1,
27
- label,
28
- className,
29
- ...props
30
- } = t0);
31
- $[0] = t0;
32
- $[1] = className;
33
- $[2] = label;
34
- $[3] = props;
35
- $[4] = t1;
36
- } else {
37
- className = $[1];
38
- label = $[2];
39
- props = $[3];
40
- t1 = $[4];
41
- }
42
- const size = t1 === undefined ? "default" : t1;
43
- let t2;
44
- if ($[5] !== className) {
45
- t2 = cn("inline-flex shrink-0", className);
46
- $[5] = className;
47
- $[6] = t2;
48
- } else {
49
- t2 = $[6];
50
- }
51
- let t3;
52
- if ($[7] !== size) {
53
- t3 = skeletonButtonVariants({
54
- size
55
- });
56
- $[7] = size;
57
- $[8] = t3;
58
- } else {
59
- t3 = $[8];
60
- }
61
- let t4;
62
- if ($[9] !== t3) {
63
- t4 = /*#__PURE__*/_jsx(SkeletonBar, {
64
- className: t3
65
- });
66
- $[9] = t3;
67
- $[10] = t4;
68
- } else {
69
- t4 = $[10];
70
- }
71
- let t5;
72
- if ($[11] !== label) {
73
- t5 = /*#__PURE__*/_jsx(SkeletonLoadingLabel, {
17
+ function SkeletonButton({
18
+ size = "default",
19
+ label,
20
+ className,
21
+ ...props
22
+ }) {
23
+ return /*#__PURE__*/_jsxs("div", {
24
+ "data-slot": "skeleton-button",
25
+ "data-size": size,
26
+ ...skeletonRootProps,
27
+ className: cn("inline-flex shrink-0", className),
28
+ ...props,
29
+ children: [/*#__PURE__*/_jsx(SkeletonBar, {
30
+ className: skeletonButtonVariants({
31
+ size
32
+ })
33
+ }), /*#__PURE__*/_jsx(SkeletonLoadingLabel, {
74
34
  children: label
75
- });
76
- $[11] = label;
77
- $[12] = t5;
78
- } else {
79
- t5 = $[12];
80
- }
81
- let t6;
82
- if ($[13] !== props || $[14] !== size || $[15] !== t2 || $[16] !== t4 || $[17] !== t5) {
83
- t6 = /*#__PURE__*/_jsxs("div", {
84
- "data-slot": "skeleton-button",
85
- "data-size": size,
86
- ...skeletonRootProps,
87
- className: t2,
88
- ...props,
89
- children: [t4, t5]
90
- });
91
- $[13] = props;
92
- $[14] = size;
93
- $[15] = t2;
94
- $[16] = t4;
95
- $[17] = t5;
96
- $[18] = t6;
97
- } else {
98
- t6 = $[18];
99
- }
100
- return t6;
35
+ })]
36
+ });
101
37
  }
102
38
  export { SkeletonButton, skeletonButtonVariants };
@@ -1,84 +1,31 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { cn } from "cn";
3
2
  import { SkeletonBar, SkeletonLoadingLabel, skeletonRootProps } from "../skeleton-parts.js";
4
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
4
  function lineWidth(index, lines) {
6
5
  return lines > 1 && index === lines - 1 ? "w-3/5" : "w-full";
7
6
  }
8
- function SkeletonText(t0) {
9
- const $ = _c(16);
10
- let className;
11
- let label;
12
- let props;
13
- let t1;
14
- if ($[0] !== t0) {
15
- ({
16
- lines: t1,
17
- label,
18
- className,
19
- ...props
20
- } = t0);
21
- $[0] = t0;
22
- $[1] = className;
23
- $[2] = label;
24
- $[3] = props;
25
- $[4] = t1;
26
- } else {
27
- className = $[1];
28
- label = $[2];
29
- props = $[3];
30
- t1 = $[4];
31
- }
32
- const lines = t1 === undefined ? 3 : t1;
7
+ function SkeletonText({
8
+ lines = 3,
9
+ label,
10
+ className,
11
+ ...props
12
+ }) {
33
13
  const count = Math.max(1, Math.floor(lines));
34
- let t2;
35
- if ($[5] !== className) {
36
- t2 = cn("flex w-full flex-col gap-2", className);
37
- $[5] = className;
38
- $[6] = t2;
39
- } else {
40
- t2 = $[6];
41
- }
42
- let t3;
43
- if ($[7] !== count) {
44
- t3 = Array.from({
14
+ return /*#__PURE__*/_jsxs("div", {
15
+ "data-slot": "skeleton-text",
16
+ ...skeletonRootProps,
17
+ className: cn("flex w-full flex-col gap-2", className),
18
+ ...props,
19
+ children: [Array.from({
45
20
  length: count
46
- }, (_, index) => /*#__PURE__*/_jsx(SkeletonBar, {
21
+ }, (_, index) => /*#__PURE__*/_jsx(SkeletonBar
22
+ // biome-ignore lint/suspicious/noArrayIndexKey: placeholder lines have no identity
23
+ , {
47
24
  "data-slot": "skeleton-text-line",
48
25
  className: cn("h-4", lineWidth(index, count))
49
- }, index));
50
- $[7] = count;
51
- $[8] = t3;
52
- } else {
53
- t3 = $[8];
54
- }
55
- let t4;
56
- if ($[9] !== label) {
57
- t4 = /*#__PURE__*/_jsx(SkeletonLoadingLabel, {
26
+ }, index)), /*#__PURE__*/_jsx(SkeletonLoadingLabel, {
58
27
  children: label
59
- });
60
- $[9] = label;
61
- $[10] = t4;
62
- } else {
63
- t4 = $[10];
64
- }
65
- let t5;
66
- if ($[11] !== props || $[12] !== t2 || $[13] !== t3 || $[14] !== t4) {
67
- t5 = /*#__PURE__*/_jsxs("div", {
68
- "data-slot": "skeleton-text",
69
- ...skeletonRootProps,
70
- className: t2,
71
- ...props,
72
- children: [t3, t4]
73
- });
74
- $[11] = props;
75
- $[12] = t2;
76
- $[13] = t3;
77
- $[14] = t4;
78
- $[15] = t5;
79
- } else {
80
- t5 = $[15];
81
- }
82
- return t5;
28
+ })]
29
+ });
83
30
  }
84
31
  export { SkeletonText };
@@ -1,65 +1,24 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { cn } from "cn";
3
2
  import { Skeleton } from "../status/skeleton.js";
4
3
  import { jsx as _jsx } from "react/jsx-runtime";
5
- function SkeletonBar(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("rounded-none bg-skeleton motion-reduce:animate-none", 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(Skeleton, {
32
- "aria-hidden": "true",
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 SkeletonBar({
5
+ className,
6
+ ...props
7
+ }) {
8
+ return /*#__PURE__*/_jsx(Skeleton, {
9
+ "aria-hidden": "true",
10
+ className: cn("rounded-none bg-skeleton motion-reduce:animate-none", className),
11
+ ...props
12
+ });
43
13
  }
44
- function SkeletonLoadingLabel(t0) {
45
- const $ = _c(2);
46
- const {
47
- children: t1
48
- } = t0;
49
- const children = t1 === undefined ? "Loading\u2026" : t1;
50
- let t2;
51
- if ($[0] !== children) {
52
- t2 = /*#__PURE__*/_jsx("span", {
53
- "data-slot": "skeleton-loading-label",
54
- className: "sr-only",
55
- children: children
56
- });
57
- $[0] = children;
58
- $[1] = t2;
59
- } else {
60
- t2 = $[1];
61
- }
62
- return t2;
14
+ function SkeletonLoadingLabel({
15
+ children = "Loading…"
16
+ }) {
17
+ return /*#__PURE__*/_jsx("span", {
18
+ "data-slot": "skeleton-loading-label",
19
+ className: "sr-only",
20
+ children: children
21
+ });
63
22
  }
64
23
  const skeletonRootProps = {
65
24
  role: "status",
@@ -1,4 +1,3 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { cva } from "class-variance-authority";
3
2
  import { cn } from "cn";
4
3
  import * as React from "react";
@@ -16,129 +15,38 @@ const alertVariants = cva("relative grid w-full grid-cols-[0_1fr] items-start ga
16
15
  variant: "default"
17
16
  }
18
17
  });
19
- function Alert(t0) {
20
- const $ = _c(10);
21
- let className;
22
- let props;
23
- let variant;
24
- if ($[0] !== t0) {
25
- ({
26
- className,
27
- variant,
28
- ...props
29
- } = t0);
30
- $[0] = t0;
31
- $[1] = className;
32
- $[2] = props;
33
- $[3] = variant;
34
- } else {
35
- className = $[1];
36
- props = $[2];
37
- variant = $[3];
38
- }
39
- let t1;
40
- if ($[4] !== className || $[5] !== variant) {
41
- t1 = cn(alertVariants({
18
+ function Alert({
19
+ className,
20
+ variant,
21
+ ...props
22
+ }) {
23
+ return /*#__PURE__*/_jsx("div", {
24
+ "data-slot": "alert",
25
+ role: "alert",
26
+ className: cn(alertVariants({
42
27
  variant
43
- }), className);
44
- $[4] = className;
45
- $[5] = variant;
46
- $[6] = t1;
47
- } else {
48
- t1 = $[6];
49
- }
50
- let t2;
51
- if ($[7] !== props || $[8] !== t1) {
52
- t2 = /*#__PURE__*/_jsx("div", {
53
- "data-slot": "alert",
54
- role: "alert",
55
- className: t1,
56
- ...props
57
- });
58
- $[7] = props;
59
- $[8] = t1;
60
- $[9] = t2;
61
- } else {
62
- t2 = $[9];
63
- }
64
- return t2;
28
+ }), className),
29
+ ...props
30
+ });
65
31
  }
66
- function AlertTitle(t0) {
67
- const $ = _c(8);
68
- let className;
69
- let props;
70
- if ($[0] !== t0) {
71
- ({
72
- className,
73
- ...props
74
- } = t0);
75
- $[0] = t0;
76
- $[1] = className;
77
- $[2] = props;
78
- } else {
79
- className = $[1];
80
- props = $[2];
81
- }
82
- let t1;
83
- if ($[3] !== className) {
84
- t1 = cn("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight", className);
85
- $[3] = className;
86
- $[4] = t1;
87
- } else {
88
- t1 = $[4];
89
- }
90
- let t2;
91
- if ($[5] !== props || $[6] !== t1) {
92
- t2 = /*#__PURE__*/_jsx("div", {
93
- "data-slot": "alert-title",
94
- className: t1,
95
- ...props
96
- });
97
- $[5] = props;
98
- $[6] = t1;
99
- $[7] = t2;
100
- } else {
101
- t2 = $[7];
102
- }
103
- return t2;
32
+ function AlertTitle({
33
+ className,
34
+ ...props
35
+ }) {
36
+ return /*#__PURE__*/_jsx("div", {
37
+ "data-slot": "alert-title",
38
+ className: cn("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight", className),
39
+ ...props
40
+ });
104
41
  }
105
- function AlertDescription(t0) {
106
- const $ = _c(8);
107
- let className;
108
- let props;
109
- if ($[0] !== t0) {
110
- ({
111
- className,
112
- ...props
113
- } = t0);
114
- $[0] = t0;
115
- $[1] = className;
116
- $[2] = props;
117
- } else {
118
- className = $[1];
119
- props = $[2];
120
- }
121
- let t1;
122
- if ($[3] !== className) {
123
- t1 = cn("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed", className);
124
- $[3] = className;
125
- $[4] = t1;
126
- } else {
127
- t1 = $[4];
128
- }
129
- let t2;
130
- if ($[5] !== props || $[6] !== t1) {
131
- t2 = /*#__PURE__*/_jsx("div", {
132
- "data-slot": "alert-description",
133
- className: t1,
134
- ...props
135
- });
136
- $[5] = props;
137
- $[6] = t1;
138
- $[7] = t2;
139
- } else {
140
- t2 = $[7];
141
- }
142
- return t2;
42
+ function AlertDescription({
43
+ className,
44
+ ...props
45
+ }) {
46
+ return /*#__PURE__*/_jsx("div", {
47
+ "data-slot": "alert-description",
48
+ className: cn("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed", className),
49
+ ...props
50
+ });
143
51
  }
144
52
  export { Alert, AlertDescription, AlertTitle };