@locusgraph/blocks 0.2.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.
Files changed (48) hide show
  1. package/README.md +11 -11
  2. package/dist/billing/plan-price.d.ts +4 -0
  3. package/dist/billing/plan-price.js +70 -0
  4. package/dist/billing/{plan-options.d.ts → plans.d.ts} +2 -2
  5. package/dist/billing/plans.js +74 -0
  6. package/dist/billing/top-up.d.ts +11 -0
  7. package/dist/billing/top-up.js +108 -0
  8. package/dist/billing/wallet.d.ts +8 -0
  9. package/dist/billing/wallet.js +217 -0
  10. package/dist/dates/local-date.js +51 -7
  11. package/dist/index.d.ts +13 -8
  12. package/dist/index.js +13 -8
  13. package/dist/keys/{no-keys.d.ts → keys-empty.d.ts} +2 -2
  14. package/dist/keys/keys-empty.js +73 -0
  15. package/dist/keys/{keys-table.d.ts → keys.d.ts} +2 -2
  16. package/dist/keys/keys.js +151 -0
  17. package/dist/skeletons/keys-skeleton.d.ts +6 -0
  18. package/dist/skeletons/keys-skeleton.js +170 -0
  19. package/dist/skeletons/plans-skeleton.d.ts +7 -0
  20. package/dist/skeletons/plans-skeleton.js +94 -0
  21. package/dist/skeletons/top-up-skeleton.d.ts +5 -0
  22. package/dist/skeletons/top-up-skeleton.js +73 -0
  23. package/dist/skeletons/usage-skeleton.d.ts +6 -0
  24. package/dist/skeletons/usage-skeleton.js +88 -0
  25. package/dist/skeletons/wallet-skeleton.d.ts +5 -0
  26. package/dist/skeletons/wallet-skeleton.js +84 -0
  27. package/dist/types.d.ts +5 -1
  28. package/dist/types.js +1 -1
  29. package/dist/usage/quota.d.ts +4 -0
  30. package/dist/usage/quota.js +203 -0
  31. package/dist/usage/usage-alert.d.ts +11 -0
  32. package/dist/usage/usage-alert.js +222 -0
  33. package/dist/usage/usage.d.ts +8 -0
  34. package/dist/usage/usage.js +57 -0
  35. package/package.json +6 -6
  36. package/dist/billing/credit-packs.d.ts +0 -9
  37. package/dist/billing/credit-packs.js +0 -6
  38. package/dist/billing/plan-options.js +0 -8
  39. package/dist/billing/wallet-panel.d.ts +0 -8
  40. package/dist/billing/wallet-panel.js +0 -16
  41. package/dist/keys/keys-table.js +0 -9
  42. package/dist/keys/no-keys.js +0 -8
  43. package/dist/usage/quota-meter.d.ts +0 -4
  44. package/dist/usage/quota-meter.js +0 -13
  45. package/dist/usage/usage-attention.d.ts +0 -11
  46. package/dist/usage/usage-attention.js +0 -20
  47. package/dist/usage/usage-summary.d.ts +0 -8
  48. package/dist/usage/usage-summary.js +0 -6
@@ -0,0 +1,73 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { Password as KeyRoundIcon, Add as PlusIcon } from "@carbon/icons-react";
3
+ import { Button, RuleGrid, RuleGridCell, RuleGridDescription, RuleGridTitle } from "@locusgraph/components";
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
+ export function KeysEmpty(t0) {
6
+ const $ = _c(10);
7
+ const {
8
+ newKeyHref,
9
+ description: t1,
10
+ linkComponent: t2
11
+ } = t0;
12
+ const description = t1 === undefined ? newKeyHref ? "Create a key to let a service call LocusGraph products for this organization." : "Ask an owner to create a key for this organization." : t1;
13
+ const Link = t2 === undefined ? "a" : t2;
14
+ let t3;
15
+ let t4;
16
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
17
+ t3 = /*#__PURE__*/_jsx(KeyRoundIcon, {
18
+ className: "mb-1 size-5 text-muted-foreground"
19
+ });
20
+ t4 = /*#__PURE__*/_jsx(RuleGridTitle, {
21
+ children: "No API keys yet"
22
+ });
23
+ $[0] = t3;
24
+ $[1] = t4;
25
+ } else {
26
+ t3 = $[0];
27
+ t4 = $[1];
28
+ }
29
+ let t5;
30
+ if ($[2] !== description) {
31
+ t5 = /*#__PURE__*/_jsx(RuleGridDescription, {
32
+ className: "max-w-sm",
33
+ children: description
34
+ });
35
+ $[2] = description;
36
+ $[3] = t5;
37
+ } else {
38
+ t5 = $[3];
39
+ }
40
+ let t6;
41
+ if ($[4] !== Link || $[5] !== newKeyHref) {
42
+ t6 = newKeyHref && /*#__PURE__*/_jsx(Button, {
43
+ asChild: true,
44
+ size: "sm",
45
+ className: "mt-2",
46
+ children: /*#__PURE__*/_jsxs(Link, {
47
+ href: newKeyHref,
48
+ children: [/*#__PURE__*/_jsx(PlusIcon, {}), "New key"]
49
+ })
50
+ });
51
+ $[4] = Link;
52
+ $[5] = newKeyHref;
53
+ $[6] = t6;
54
+ } else {
55
+ t6 = $[6];
56
+ }
57
+ let t7;
58
+ if ($[7] !== t5 || $[8] !== t6) {
59
+ t7 = /*#__PURE__*/_jsx(RuleGrid, {
60
+ columns: 1,
61
+ children: /*#__PURE__*/_jsxs(RuleGridCell, {
62
+ className: "items-center gap-2 py-12 text-center",
63
+ children: [t3, t4, t5, t6]
64
+ })
65
+ });
66
+ $[7] = t5;
67
+ $[8] = t6;
68
+ $[9] = t7;
69
+ } else {
70
+ t7 = $[9];
71
+ }
72
+ return t7;
73
+ }
@@ -1,9 +1,9 @@
1
1
  import type * as React from "react";
2
2
  import type { ApiKeyRow } from "../types.js";
3
- type KeysTableProps = {
3
+ type KeysProps = {
4
4
  keys: ApiKeyRow[];
5
5
  actions?: (key: ApiKeyRow) => React.ReactNode;
6
6
  highlightedId?: string;
7
7
  };
8
- export declare function KeysTable({ keys, actions, highlightedId }: KeysTableProps): React.JSX.Element;
8
+ export declare function Keys({ keys, actions, highlightedId }: KeysProps): React.JSX.Element;
9
9
  export {};
@@ -0,0 +1,151 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@locusgraph/components";
3
+ import { LocalDate } from "../dates/local-date.js";
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
+ function dateOr(value, empty) {
6
+ return value ? /*#__PURE__*/_jsx(LocalDate, {
7
+ value: value
8
+ }) : empty;
9
+ }
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;
151
+ }
@@ -0,0 +1,6 @@
1
+ type KeysSkeletonProps = {
2
+ rows?: number;
3
+ actions?: boolean;
4
+ };
5
+ export declare function KeysSkeleton({ rows, actions }: KeysSkeletonProps): import("react").JSX.Element;
6
+ export {};
@@ -0,0 +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";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
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
+ }];
25
+ function NameCellSkeleton() {
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;
45
+ }
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);
170
+ }
@@ -0,0 +1,7 @@
1
+ type PlansSkeletonProps = {
2
+ plans?: number;
3
+ points?: number;
4
+ currentIndex?: number;
5
+ };
6
+ export declare function PlansSkeleton({ plans, points, currentIndex }: PlansSkeletonProps): import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,94 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { RuleGrid, RuleGridCell, SkeletonBar, SkeletonLoadingLabel, skeletonRootProps } from "@locusgraph/components";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
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);
94
+ }
@@ -0,0 +1,5 @@
1
+ type TopUpSkeletonProps = {
2
+ packs?: number;
3
+ };
4
+ export declare function TopUpSkeleton({ packs }: TopUpSkeletonProps): import("react").JSX.Element;
5
+ export {};
@@ -0,0 +1,73 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { RuleGridCell, RuleGridLabel, SkeletonBar, SkeletonLoadingLabel, skeletonRootProps } from "@locusgraph/components";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
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);
73
+ }
@@ -0,0 +1,6 @@
1
+ type UsageSkeletonProps = {
2
+ quotas?: number;
3
+ label?: string;
4
+ };
5
+ export declare function UsageSkeleton({ quotas, label }: UsageSkeletonProps): import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1,88 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { RuleGrid, RuleGridCell, RuleGridLabel, SkeletonBar, SkeletonLoadingLabel, skeletonRootProps } from "@locusgraph/components";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
+ function QuotaSkeleton() {
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;
28
+ }
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);
88
+ }
@@ -0,0 +1,5 @@
1
+ type WalletSkeletonProps = {
2
+ grants?: number;
3
+ };
4
+ export declare function WalletSkeleton({ grants }: WalletSkeletonProps): import("react").JSX.Element;
5
+ export {};