@locusgraph/blocks 0.3.0 → 0.3.1

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.
package/dist/keys/keys.js CHANGED
@@ -1,9 +1,151 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@locusgraph/components";
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@locusgraph/components";
3
3
  import { LocalDate } from "../dates/local-date.js";
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
5
  function dateOr(value, empty) {
5
- return value ? _jsx(LocalDate, { value: value }) : empty;
6
+ return value ? /*#__PURE__*/_jsx(LocalDate, {
7
+ value: value
8
+ }) : empty;
6
9
  }
7
- export function Keys({ keys, actions, highlightedId }) {
8
- return (_jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: "Name" }), _jsx(TableHead, { className: "hidden md:table-cell", children: "Key" }), _jsx(TableHead, { children: "Product" }), _jsx(TableHead, { className: "hidden md:table-cell", children: "Created by" }), _jsx(TableHead, { className: "hidden md:table-cell", children: "Created" }), _jsx(TableHead, { children: "Expires" }), actions && _jsx(TableHead, { className: "w-0" })] }) }), _jsx(TableBody, { children: keys.map((key) => (_jsxs(TableRow, { "data-new": key.id === highlightedId ? "" : undefined, className: "transition-colors duration-1000 data-new:bg-accent", children: [_jsxs(TableCell, { className: "max-w-40", children: [_jsx("span", { className: "block truncate font-medium", children: key.name ?? "Untitled" }), _jsx("span", { className: "block truncate font-mono text-xs text-muted-foreground md:hidden", children: key.maskedKey })] }), _jsx(TableCell, { className: "hidden font-mono text-muted-foreground md:table-cell", children: key.maskedKey }), _jsx(TableCell, { children: key.productLabel }), _jsx(TableCell, { className: "hidden md:table-cell", children: key.createdBy }), _jsx(TableCell, { className: "hidden md:table-cell", children: dateOr(key.createdAt, "—") }), _jsx(TableCell, { children: dateOr(key.expiresAt, "Never") }), actions && (_jsx(TableCell, { className: "w-0 pr-2 text-right whitespace-nowrap", children: actions(key) }))] }, key.id))) })] }));
10
+ export function Keys(t0) {
11
+ const $ = _c(22);
12
+ const {
13
+ keys,
14
+ actions,
15
+ highlightedId
16
+ } = t0;
17
+ let t1;
18
+ let t2;
19
+ let t3;
20
+ let t4;
21
+ let t5;
22
+ let t6;
23
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
24
+ t1 = /*#__PURE__*/_jsx(TableHead, {
25
+ children: "Name"
26
+ });
27
+ t2 = /*#__PURE__*/_jsx(TableHead, {
28
+ className: "hidden md:table-cell",
29
+ children: "Key"
30
+ });
31
+ t3 = /*#__PURE__*/_jsx(TableHead, {
32
+ children: "Product"
33
+ });
34
+ t4 = /*#__PURE__*/_jsx(TableHead, {
35
+ className: "hidden md:table-cell",
36
+ children: "Created by"
37
+ });
38
+ t5 = /*#__PURE__*/_jsx(TableHead, {
39
+ className: "hidden md:table-cell",
40
+ children: "Created"
41
+ });
42
+ t6 = /*#__PURE__*/_jsx(TableHead, {
43
+ children: "Expires"
44
+ });
45
+ $[0] = t1;
46
+ $[1] = t2;
47
+ $[2] = t3;
48
+ $[3] = t4;
49
+ $[4] = t5;
50
+ $[5] = t6;
51
+ } else {
52
+ t1 = $[0];
53
+ t2 = $[1];
54
+ t3 = $[2];
55
+ t4 = $[3];
56
+ t5 = $[4];
57
+ t6 = $[5];
58
+ }
59
+ let t7;
60
+ if ($[6] !== actions) {
61
+ t7 = actions && /*#__PURE__*/_jsx(TableHead, {
62
+ className: "w-0"
63
+ });
64
+ $[6] = actions;
65
+ $[7] = t7;
66
+ } else {
67
+ t7 = $[7];
68
+ }
69
+ let t8;
70
+ if ($[8] !== t7) {
71
+ t8 = /*#__PURE__*/_jsx(TableHeader, {
72
+ children: /*#__PURE__*/_jsxs(TableRow, {
73
+ children: [t1, t2, t3, t4, t5, t6, t7]
74
+ })
75
+ });
76
+ $[8] = t7;
77
+ $[9] = t8;
78
+ } else {
79
+ t8 = $[9];
80
+ }
81
+ let t9;
82
+ if ($[10] !== actions || $[11] !== highlightedId || $[12] !== keys) {
83
+ let t10;
84
+ if ($[14] !== actions || $[15] !== highlightedId) {
85
+ t10 = key => /*#__PURE__*/_jsxs(TableRow, {
86
+ "data-new": key.id === highlightedId ? "" : undefined,
87
+ className: "transition-colors duration-1000 data-new:bg-accent",
88
+ children: [/*#__PURE__*/_jsxs(TableCell, {
89
+ className: "max-w-40",
90
+ children: [/*#__PURE__*/_jsx("span", {
91
+ className: "block truncate font-medium",
92
+ children: key.name ?? "Untitled"
93
+ }), /*#__PURE__*/_jsx("span", {
94
+ className: "block truncate font-mono text-xs text-muted-foreground md:hidden",
95
+ children: key.maskedKey
96
+ })]
97
+ }), /*#__PURE__*/_jsx(TableCell, {
98
+ className: "hidden font-mono text-muted-foreground md:table-cell",
99
+ children: key.maskedKey
100
+ }), /*#__PURE__*/_jsx(TableCell, {
101
+ children: key.productLabel
102
+ }), /*#__PURE__*/_jsx(TableCell, {
103
+ className: "hidden md:table-cell",
104
+ children: key.createdBy
105
+ }), /*#__PURE__*/_jsx(TableCell, {
106
+ className: "hidden md:table-cell",
107
+ children: dateOr(key.createdAt, "\u2014")
108
+ }), /*#__PURE__*/_jsx(TableCell, {
109
+ children: dateOr(key.expiresAt, "Never")
110
+ }), actions && /*#__PURE__*/_jsx(TableCell, {
111
+ className: "w-0 pr-2 text-right whitespace-nowrap",
112
+ children: actions(key)
113
+ })]
114
+ }, key.id);
115
+ $[14] = actions;
116
+ $[15] = highlightedId;
117
+ $[16] = t10;
118
+ } else {
119
+ t10 = $[16];
120
+ }
121
+ t9 = keys.map(t10);
122
+ $[10] = actions;
123
+ $[11] = highlightedId;
124
+ $[12] = keys;
125
+ $[13] = t9;
126
+ } else {
127
+ t9 = $[13];
128
+ }
129
+ let t10;
130
+ if ($[17] !== t9) {
131
+ t10 = /*#__PURE__*/_jsx(TableBody, {
132
+ children: t9
133
+ });
134
+ $[17] = t9;
135
+ $[18] = t10;
136
+ } else {
137
+ t10 = $[18];
138
+ }
139
+ let t11;
140
+ if ($[19] !== t10 || $[20] !== t8) {
141
+ t11 = /*#__PURE__*/_jsxs(Table, {
142
+ children: [t8, t10]
143
+ });
144
+ $[19] = t10;
145
+ $[20] = t8;
146
+ $[21] = t11;
147
+ } else {
148
+ t11 = $[21];
149
+ }
150
+ return t11;
9
151
  }
@@ -1,18 +1,170 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { SkeletonBar, SkeletonLoadingLabel, skeletonRootProps, Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@locusgraph/components";
1
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { SkeletonBar, SkeletonLoadingLabel, skeletonRootProps, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@locusgraph/components";
3
- const columns = [
4
- { name: "Key", visibility: "hidden md:table-cell", bar: "w-36" },
5
- { name: "Product", visibility: "", bar: "w-20" },
6
- { name: "Created by", visibility: "hidden md:table-cell", bar: "w-32" },
7
- { name: "Created", visibility: "hidden md:table-cell", bar: "w-20" },
8
- { name: "Expires", visibility: "", bar: "w-20" },
9
- ];
4
+ const columns = [{
5
+ name: "Key",
6
+ visibility: "hidden md:table-cell",
7
+ bar: "w-36"
8
+ }, {
9
+ name: "Product",
10
+ visibility: "",
11
+ bar: "w-20"
12
+ }, {
13
+ name: "Created by",
14
+ visibility: "hidden md:table-cell",
15
+ bar: "w-32"
16
+ }, {
17
+ name: "Created",
18
+ visibility: "hidden md:table-cell",
19
+ bar: "w-20"
20
+ }, {
21
+ name: "Expires",
22
+ visibility: "",
23
+ bar: "w-20"
24
+ }];
10
25
  function NameCellSkeleton() {
11
- return (_jsx(TableCell, { className: "max-w-40", children: _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx(SkeletonBar, { className: "h-4 w-28" }), _jsx(SkeletonBar, { className: "h-3 w-20 md:hidden" })] }) }));
26
+ const $ = _c(1);
27
+ let t0;
28
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
29
+ t0 = /*#__PURE__*/_jsx(TableCell, {
30
+ className: "max-w-40",
31
+ children: /*#__PURE__*/_jsxs("div", {
32
+ className: "flex flex-col gap-1",
33
+ children: [/*#__PURE__*/_jsx(SkeletonBar, {
34
+ className: "h-4 w-28"
35
+ }), /*#__PURE__*/_jsx(SkeletonBar, {
36
+ className: "h-3 w-20 md:hidden"
37
+ })]
38
+ })
39
+ });
40
+ $[0] = t0;
41
+ } else {
42
+ t0 = $[0];
43
+ }
44
+ return t0;
12
45
  }
13
- export function KeysSkeleton({ rows = 3, actions = false }) {
14
- const count = Math.max(1, Math.floor(rows));
15
- return (_jsxs("div", { "data-slot": "keys-skeleton", ...skeletonRootProps, className: "w-full", children: [_jsxs(Table, { "aria-hidden": "true", children: [_jsx(TableHeader, { children: _jsxs(TableRow, { className: "hover:bg-transparent", children: [_jsx(TableHead, { children: "Name" }), columns.map((column) => (_jsx(TableHead, { className: column.visibility, children: column.name }, column.name))), actions && _jsx(TableHead, { className: "w-0" })] }) }), _jsx(TableBody, { children: Array.from({ length: count }, (_, row) => (_jsxs(TableRow
16
- // biome-ignore lint/suspicious/noArrayIndexKey: placeholder rows have no identity
17
- , { "data-slot": "keys-skeleton-row", className: "hover:bg-transparent", children: [_jsx(NameCellSkeleton, {}), columns.map((column) => (_jsx(TableCell, { className: column.visibility, children: _jsx(SkeletonBar, { className: `h-4 ${column.bar}` }) }, column.name))), actions && (_jsx(TableCell, { className: "w-0 pr-2 text-right", children: _jsx(SkeletonBar, { className: "ml-auto h-8 w-16 rounded-full" }) }))] }, row))) })] }), _jsx(SkeletonLoadingLabel, { children: "Loading API keys\u2026" })] }));
46
+ export function KeysSkeleton(t0) {
47
+ const $ = _c(17);
48
+ const {
49
+ rows: t1,
50
+ actions: t2
51
+ } = t0;
52
+ const rows = t1 === undefined ? 3 : t1;
53
+ const actions = t2 === undefined ? false : t2;
54
+ const count = Math.max(1, Math.floor(rows));
55
+ let t3;
56
+ let t4;
57
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
58
+ t3 = /*#__PURE__*/_jsx(TableHead, {
59
+ children: "Name"
60
+ });
61
+ t4 = columns.map(_temp);
62
+ $[0] = t3;
63
+ $[1] = t4;
64
+ } else {
65
+ t3 = $[0];
66
+ t4 = $[1];
67
+ }
68
+ let t5;
69
+ if ($[2] !== actions) {
70
+ t5 = actions && /*#__PURE__*/_jsx(TableHead, {
71
+ className: "w-0"
72
+ });
73
+ $[2] = actions;
74
+ $[3] = t5;
75
+ } else {
76
+ t5 = $[3];
77
+ }
78
+ let t6;
79
+ if ($[4] !== t5) {
80
+ t6 = /*#__PURE__*/_jsx(TableHeader, {
81
+ children: /*#__PURE__*/_jsxs(TableRow, {
82
+ className: "hover:bg-transparent",
83
+ children: [t3, t4, t5]
84
+ })
85
+ });
86
+ $[4] = t5;
87
+ $[5] = t6;
88
+ } else {
89
+ t6 = $[5];
90
+ }
91
+ let t7;
92
+ if ($[6] !== actions || $[7] !== count) {
93
+ let t8;
94
+ if ($[9] !== actions) {
95
+ t8 = (_, row) => /*#__PURE__*/_jsxs(TableRow, {
96
+ "data-slot": "keys-skeleton-row",
97
+ className: "hover:bg-transparent",
98
+ children: [/*#__PURE__*/_jsx(NameCellSkeleton, {}), columns.map(_temp2), actions && /*#__PURE__*/_jsx(TableCell, {
99
+ className: "w-0 pr-2 text-right",
100
+ children: /*#__PURE__*/_jsx(SkeletonBar, {
101
+ className: "ml-auto h-8 w-16 rounded-full"
102
+ })
103
+ })]
104
+ }, row);
105
+ $[9] = actions;
106
+ $[10] = t8;
107
+ } else {
108
+ t8 = $[10];
109
+ }
110
+ t7 = /*#__PURE__*/_jsx(TableBody, {
111
+ children: Array.from({
112
+ length: count
113
+ }, t8)
114
+ });
115
+ $[6] = actions;
116
+ $[7] = count;
117
+ $[8] = t7;
118
+ } else {
119
+ t7 = $[8];
120
+ }
121
+ let t8;
122
+ if ($[11] !== t6 || $[12] !== t7) {
123
+ t8 = /*#__PURE__*/_jsxs(Table, {
124
+ "aria-hidden": "true",
125
+ children: [t6, t7]
126
+ });
127
+ $[11] = t6;
128
+ $[12] = t7;
129
+ $[13] = t8;
130
+ } else {
131
+ t8 = $[13];
132
+ }
133
+ let t9;
134
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
135
+ t9 = /*#__PURE__*/_jsx(SkeletonLoadingLabel, {
136
+ children: "Loading API keys\u2026"
137
+ });
138
+ $[14] = t9;
139
+ } else {
140
+ t9 = $[14];
141
+ }
142
+ let t10;
143
+ if ($[15] !== t8) {
144
+ t10 = /*#__PURE__*/_jsxs("div", {
145
+ "data-slot": "keys-skeleton",
146
+ ...skeletonRootProps,
147
+ className: "w-full",
148
+ children: [t8, t9]
149
+ });
150
+ $[15] = t8;
151
+ $[16] = t10;
152
+ } else {
153
+ t10 = $[16];
154
+ }
155
+ return t10;
156
+ }
157
+ function _temp2(column_0) {
158
+ return /*#__PURE__*/_jsx(TableCell, {
159
+ className: column_0.visibility,
160
+ children: /*#__PURE__*/_jsx(SkeletonBar, {
161
+ className: `h-4 ${column_0.bar}`
162
+ })
163
+ }, column_0.name);
164
+ }
165
+ function _temp(column) {
166
+ return /*#__PURE__*/_jsx(TableHead, {
167
+ className: column.visibility,
168
+ children: column.name
169
+ }, column.name);
18
170
  }
@@ -1,9 +1,94 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { RuleGrid, RuleGridCell, SkeletonBar, SkeletonLoadingLabel, skeletonRootProps } from "@locusgraph/components";
1
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { RuleGrid, RuleGridCell, SkeletonBar, SkeletonLoadingLabel, skeletonRootProps, } from "@locusgraph/components";
3
- export function PlansSkeleton({ plans = 2, points = 2, currentIndex = 0 }) {
4
- const planCount = Math.max(1, Math.floor(plans));
5
- const pointCount = Math.max(0, Math.floor(points));
6
- return (_jsxs(RuleGrid, { columns: planCount >= 3 ? 3 : 2, "data-slot": "plans-skeleton", ...skeletonRootProps, children: [Array.from({ length: planCount }, (_, plan) => (_jsxs(RuleGridCell
7
- // biome-ignore lint/suspicious/noArrayIndexKey: placeholder plans have no identity
8
- , { "data-slot": "plan-skeleton", "aria-hidden": "true", className: "gap-4", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("div", { className: "flex min-h-6 items-center", children: _jsx(SkeletonBar, { className: "h-5 w-20" }) }), _jsx(SkeletonBar, { className: "h-8 w-28" })] }), _jsx("div", { className: "flex flex-col gap-1.5", children: Array.from({ length: pointCount }, (_, point) => (_jsx(SkeletonBar, { className: "h-4 w-40" }, point))) }), plan === currentIndex ? (_jsx("div", { className: "mt-auto flex min-h-8 items-center", children: _jsx(SkeletonBar, { className: "h-4 w-16" }) })) : (_jsx(SkeletonBar, { className: "mt-auto h-8 w-28 rounded-full" }))] }, plan))), _jsx(SkeletonLoadingLabel, { children: "Loading plans\u2026" })] }));
4
+ export function PlansSkeleton(t0) {
5
+ const $ = _c(11);
6
+ const {
7
+ plans: t1,
8
+ points: t2,
9
+ currentIndex: t3
10
+ } = t0;
11
+ const plans = t1 === undefined ? 2 : t1;
12
+ const points = t2 === undefined ? 2 : t2;
13
+ const currentIndex = t3 === undefined ? 0 : t3;
14
+ const planCount = Math.max(1, Math.floor(plans));
15
+ const pointCount = Math.max(0, Math.floor(points));
16
+ const t4 = planCount >= 3 ? 3 : 2;
17
+ let t5;
18
+ if ($[0] !== currentIndex || $[1] !== planCount || $[2] !== pointCount) {
19
+ let t6;
20
+ if ($[4] !== currentIndex || $[5] !== pointCount) {
21
+ t6 = (_, plan) => /*#__PURE__*/_jsxs(RuleGridCell, {
22
+ "data-slot": "plan-skeleton",
23
+ "aria-hidden": "true",
24
+ className: "gap-4",
25
+ children: [/*#__PURE__*/_jsxs("div", {
26
+ className: "flex flex-col gap-2",
27
+ children: [/*#__PURE__*/_jsx("div", {
28
+ className: "flex min-h-6 items-center",
29
+ children: /*#__PURE__*/_jsx(SkeletonBar, {
30
+ className: "h-5 w-20"
31
+ })
32
+ }), /*#__PURE__*/_jsx(SkeletonBar, {
33
+ className: "h-8 w-28"
34
+ })]
35
+ }), /*#__PURE__*/_jsx("div", {
36
+ className: "flex flex-col gap-1.5",
37
+ children: Array.from({
38
+ length: pointCount
39
+ }, _temp)
40
+ }), plan === currentIndex ? /*#__PURE__*/_jsx("div", {
41
+ className: "mt-auto flex min-h-8 items-center",
42
+ children: /*#__PURE__*/_jsx(SkeletonBar, {
43
+ className: "h-4 w-16"
44
+ })
45
+ }) : /*#__PURE__*/_jsx(SkeletonBar, {
46
+ className: "mt-auto h-8 w-28 rounded-full"
47
+ })]
48
+ }, plan);
49
+ $[4] = currentIndex;
50
+ $[5] = pointCount;
51
+ $[6] = t6;
52
+ } else {
53
+ t6 = $[6];
54
+ }
55
+ t5 = Array.from({
56
+ length: planCount
57
+ }, t6);
58
+ $[0] = currentIndex;
59
+ $[1] = planCount;
60
+ $[2] = pointCount;
61
+ $[3] = t5;
62
+ } else {
63
+ t5 = $[3];
64
+ }
65
+ let t6;
66
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
67
+ t6 = /*#__PURE__*/_jsx(SkeletonLoadingLabel, {
68
+ children: "Loading plans\u2026"
69
+ });
70
+ $[7] = t6;
71
+ } else {
72
+ t6 = $[7];
73
+ }
74
+ let t7;
75
+ if ($[8] !== t4 || $[9] !== t5) {
76
+ t7 = /*#__PURE__*/_jsxs(RuleGrid, {
77
+ columns: t4,
78
+ "data-slot": "plans-skeleton",
79
+ ...skeletonRootProps,
80
+ children: [t5, t6]
81
+ });
82
+ $[8] = t4;
83
+ $[9] = t5;
84
+ $[10] = t7;
85
+ } else {
86
+ t7 = $[10];
87
+ }
88
+ return t7;
89
+ }
90
+ function _temp(__0, point) {
91
+ return /*#__PURE__*/_jsx(SkeletonBar, {
92
+ className: "h-4 w-40"
93
+ }, point);
9
94
  }
@@ -1,8 +1,73 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { RuleGridCell, RuleGridLabel, SkeletonBar, SkeletonLoadingLabel, skeletonRootProps } from "@locusgraph/components";
1
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { RuleGridCell, RuleGridLabel, SkeletonBar, SkeletonLoadingLabel, skeletonRootProps, } from "@locusgraph/components";
3
- export function TopUpSkeleton({ packs = 3 }) {
4
- const count = Math.max(1, Math.floor(packs));
5
- return (_jsxs(RuleGridCell, { "data-slot": "top-up-skeleton", ...skeletonRootProps, className: "gap-4", children: [_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("span", { className: "flex min-h-6 items-center", children: _jsx(RuleGridLabel, { children: "Buy credits" }) }), _jsx(SkeletonBar, { className: "h-4 w-full max-w-72" }), _jsx(SkeletonBar, { className: "h-4 w-3/4 max-w-56" })] }), _jsx("div", { className: "flex flex-wrap gap-2", "aria-hidden": "true", children: Array.from({ length: count }, (_, index) => (_jsx(SkeletonBar
6
- // biome-ignore lint/suspicious/noArrayIndexKey: placeholder packs have no identity
7
- , { "data-slot": "credit-pack-skeleton", className: "h-9 w-24 rounded-full" }, index))) }), _jsx(SkeletonLoadingLabel, { children: "Loading credit packs\u2026" })] }));
4
+ export function TopUpSkeleton(t0) {
5
+ const $ = _c(6);
6
+ const {
7
+ packs: t1
8
+ } = t0;
9
+ const packs = t1 === undefined ? 3 : t1;
10
+ const count = Math.max(1, Math.floor(packs));
11
+ let t2;
12
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
13
+ t2 = /*#__PURE__*/_jsxs("div", {
14
+ className: "flex flex-col gap-1.5",
15
+ children: [/*#__PURE__*/_jsx("span", {
16
+ className: "flex min-h-6 items-center",
17
+ children: /*#__PURE__*/_jsx(RuleGridLabel, {
18
+ children: "Buy credits"
19
+ })
20
+ }), /*#__PURE__*/_jsx(SkeletonBar, {
21
+ className: "h-4 w-full max-w-72"
22
+ }), /*#__PURE__*/_jsx(SkeletonBar, {
23
+ className: "h-4 w-3/4 max-w-56"
24
+ })]
25
+ });
26
+ $[0] = t2;
27
+ } else {
28
+ t2 = $[0];
29
+ }
30
+ let t3;
31
+ if ($[1] !== count) {
32
+ t3 = /*#__PURE__*/_jsx("div", {
33
+ className: "flex flex-wrap gap-2",
34
+ "aria-hidden": "true",
35
+ children: Array.from({
36
+ length: count
37
+ }, _temp)
38
+ });
39
+ $[1] = count;
40
+ $[2] = t3;
41
+ } else {
42
+ t3 = $[2];
43
+ }
44
+ let t4;
45
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
46
+ t4 = /*#__PURE__*/_jsx(SkeletonLoadingLabel, {
47
+ children: "Loading credit packs\u2026"
48
+ });
49
+ $[3] = t4;
50
+ } else {
51
+ t4 = $[3];
52
+ }
53
+ let t5;
54
+ if ($[4] !== t3) {
55
+ t5 = /*#__PURE__*/_jsxs(RuleGridCell, {
56
+ "data-slot": "top-up-skeleton",
57
+ ...skeletonRootProps,
58
+ className: "gap-4",
59
+ children: [t2, t3, t4]
60
+ });
61
+ $[4] = t3;
62
+ $[5] = t5;
63
+ } else {
64
+ t5 = $[5];
65
+ }
66
+ return t5;
67
+ }
68
+ function _temp(_, index) {
69
+ return /*#__PURE__*/_jsx(SkeletonBar, {
70
+ "data-slot": "credit-pack-skeleton",
71
+ className: "h-9 w-24 rounded-full"
72
+ }, index);
8
73
  }
@@ -1,9 +1,88 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { RuleGrid, RuleGridCell, RuleGridLabel, SkeletonBar, SkeletonLoadingLabel, skeletonRootProps } from "@locusgraph/components";
1
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { RuleGrid, RuleGridCell, RuleGridLabel, SkeletonBar, SkeletonLoadingLabel, skeletonRootProps, } from "@locusgraph/components";
3
4
  function QuotaSkeleton() {
4
- return (_jsxs("div", { "data-slot": "quota-skeleton", "aria-hidden": "true", className: "flex flex-col gap-2", children: [_jsxs("div", { className: "flex items-baseline justify-between gap-4", children: [_jsx(SkeletonBar, { className: "h-4 w-28" }), _jsx(SkeletonBar, { className: "h-4 w-36" })] }), _jsx(SkeletonBar, { className: "h-2 w-full rounded-full" })] }));
5
+ const $ = _c(1);
6
+ let t0;
7
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
8
+ t0 = /*#__PURE__*/_jsxs("div", {
9
+ "data-slot": "quota-skeleton",
10
+ "aria-hidden": "true",
11
+ className: "flex flex-col gap-2",
12
+ children: [/*#__PURE__*/_jsxs("div", {
13
+ className: "flex items-baseline justify-between gap-4",
14
+ children: [/*#__PURE__*/_jsx(SkeletonBar, {
15
+ className: "h-4 w-28"
16
+ }), /*#__PURE__*/_jsx(SkeletonBar, {
17
+ className: "h-4 w-36"
18
+ })]
19
+ }), /*#__PURE__*/_jsx(SkeletonBar, {
20
+ className: "h-2 w-full rounded-full"
21
+ })]
22
+ });
23
+ $[0] = t0;
24
+ } else {
25
+ t0 = $[0];
26
+ }
27
+ return t0;
5
28
  }
6
- export function UsageSkeleton({ quotas = 2, label = "Usage" }) {
7
- const count = Math.max(1, Math.floor(quotas));
8
- return (_jsx(RuleGrid, { columns: 1, "data-slot": "usage-skeleton", ...skeletonRootProps, children: _jsxs(RuleGridCell, { className: "gap-5", children: [_jsx(RuleGridLabel, { children: label }), Array.from({ length: count }, (_, index) => (_jsx(QuotaSkeleton, {}, index))), _jsx(SkeletonLoadingLabel, { children: "Loading usage\u2026" })] }) }));
29
+ export function UsageSkeleton(t0) {
30
+ const $ = _c(8);
31
+ const {
32
+ quotas: t1,
33
+ label: t2
34
+ } = t0;
35
+ const quotas = t1 === undefined ? 2 : t1;
36
+ const label = t2 === undefined ? "Usage" : t2;
37
+ const count = Math.max(1, Math.floor(quotas));
38
+ let t3;
39
+ if ($[0] !== label) {
40
+ t3 = /*#__PURE__*/_jsx(RuleGridLabel, {
41
+ children: label
42
+ });
43
+ $[0] = label;
44
+ $[1] = t3;
45
+ } else {
46
+ t3 = $[1];
47
+ }
48
+ let t4;
49
+ if ($[2] !== count) {
50
+ t4 = Array.from({
51
+ length: count
52
+ }, _temp);
53
+ $[2] = count;
54
+ $[3] = t4;
55
+ } else {
56
+ t4 = $[3];
57
+ }
58
+ let t5;
59
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
60
+ t5 = /*#__PURE__*/_jsx(SkeletonLoadingLabel, {
61
+ children: "Loading usage\u2026"
62
+ });
63
+ $[4] = t5;
64
+ } else {
65
+ t5 = $[4];
66
+ }
67
+ let t6;
68
+ if ($[5] !== t3 || $[6] !== t4) {
69
+ t6 = /*#__PURE__*/_jsx(RuleGrid, {
70
+ columns: 1,
71
+ "data-slot": "usage-skeleton",
72
+ ...skeletonRootProps,
73
+ children: /*#__PURE__*/_jsxs(RuleGridCell, {
74
+ className: "gap-5",
75
+ children: [t3, t4, t5]
76
+ })
77
+ });
78
+ $[5] = t3;
79
+ $[6] = t4;
80
+ $[7] = t6;
81
+ } else {
82
+ t6 = $[7];
83
+ }
84
+ return t6;
85
+ }
86
+ function _temp(_, index) {
87
+ return /*#__PURE__*/_jsx(QuotaSkeleton, {}, index);
9
88
  }