@arcadeai/design-system 3.36.0 → 3.37.0
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/assets/index.css +1 -1
- package/dist/assets/tokens.css +1 -1
- package/dist/assets/variables.css +1 -1
- package/dist/components/index.js +412 -396
- package/dist/components/ui/atoms/arcade-gradient.d.ts.map +1 -0
- package/dist/components/ui/atoms/{icons/arcade-gradient.js → arcade-gradient.js} +1 -1
- package/dist/components/ui/atoms/icons/index.d.ts +0 -1
- package/dist/components/ui/atoms/icons/index.d.ts.map +1 -1
- package/dist/components/ui/atoms/icons/index.js +294 -296
- package/dist/components/ui/atoms/index.d.ts +1 -0
- package/dist/components/ui/atoms/index.d.ts.map +1 -1
- package/dist/components/ui/atoms/index.js +112 -112
- package/dist/components/ui/atoms/loader.d.ts +1 -1
- package/dist/components/ui/atoms/loader.d.ts.map +1 -1
- package/dist/components/ui/atoms/loader.js +91 -61
- package/dist/components/ui/atoms/virtualized-grid.d.ts.map +1 -1
- package/dist/components/ui/atoms/virtualized-grid.js +16 -16
- package/dist/components/ui/index.js +412 -396
- package/dist/components/ui/molecules/chat-history-item.d.ts +21 -0
- package/dist/components/ui/molecules/chat-history-item.d.ts.map +1 -0
- package/dist/components/ui/molecules/chat-history-item.js +88 -0
- package/dist/components/ui/molecules/chat-message-list.d.ts +6 -0
- package/dist/components/ui/molecules/chat-message-list.d.ts.map +1 -1
- package/dist/components/ui/molecules/chat-message-list.js +117 -61
- package/dist/components/ui/molecules/confirm-popover.d.ts +20 -0
- package/dist/components/ui/molecules/confirm-popover.d.ts.map +1 -0
- package/dist/components/ui/molecules/confirm-popover.js +50 -0
- package/dist/components/ui/molecules/error-state.d.ts +17 -0
- package/dist/components/ui/molecules/error-state.d.ts.map +1 -0
- package/dist/components/ui/molecules/error-state.js +45 -0
- package/dist/components/ui/molecules/index.d.ts +10 -6
- package/dist/components/ui/molecules/index.d.ts.map +1 -1
- package/dist/components/ui/molecules/index.js +52 -51
- package/dist/components/ui/molecules/requirement-badges.js +4 -5
- package/dist/components/ui/molecules/steps-progress.d.ts +1 -0
- package/dist/components/ui/molecules/steps-progress.d.ts.map +1 -1
- package/dist/components/ui/molecules/steps-progress.js +75 -52
- package/dist/components/ui/molecules/suggestion-card.d.ts +2 -0
- package/dist/components/ui/molecules/suggestion-card.d.ts.map +1 -1
- package/dist/components/ui/molecules/suggestion-card.js +42 -16
- package/dist/components/ui/molecules/tool-call-accordion.d.ts +6 -1
- package/dist/components/ui/molecules/tool-call-accordion.d.ts.map +1 -1
- package/dist/components/ui/molecules/tool-call-accordion.js +153 -96
- package/dist/components/ui/molecules/toolkit-card.js +1 -1
- package/dist/components/ui/pages/chat-page-skeleton.d.ts +7 -0
- package/dist/components/ui/pages/chat-page-skeleton.d.ts.map +1 -0
- package/dist/components/ui/pages/chat-page-skeleton.js +18 -0
- package/dist/components/ui/pages/index.d.ts +2 -2
- package/dist/components/ui/pages/index.d.ts.map +1 -1
- package/dist/components/ui/pages/index.js +4 -4
- package/dist/components/ui/templates/chat-template-skeletons.d.ts +12 -0
- package/dist/components/ui/templates/chat-template-skeletons.d.ts.map +1 -0
- package/dist/components/ui/templates/chat-template-skeletons.js +119 -0
- package/dist/components/ui/templates/error-template.d.ts +20 -0
- package/dist/components/ui/templates/error-template.d.ts.map +1 -0
- package/dist/components/ui/templates/error-template.js +117 -0
- package/dist/components/ui/templates/index.d.ts +4 -0
- package/dist/components/ui/templates/index.d.ts.map +1 -1
- package/dist/components/ui/templates/index.js +37 -22
- package/dist/hooks/use-mobile.d.ts.map +1 -1
- package/dist/hooks/use-mobile.js +12 -11
- package/dist/main.js +381 -365
- package/dist/metadata/toolkit-icons.d.ts.map +1 -1
- package/dist/metadata/toolkit-icons.js +187 -186
- package/dist/metadata/toolkits.d.ts.map +1 -1
- package/dist/metadata/toolkits.js +13 -0
- package/dist/{toolkit-card-B97E7TBA.js → toolkit-card-CB1oiaei.js} +2 -3
- package/package.json +1 -1
- package/dist/components/ui/atoms/icons/arcade-gradient.d.ts.map +0 -1
- package/dist/components/ui/molecules/switcher.d.ts +0 -83
- package/dist/components/ui/molecules/switcher.d.ts.map +0 -1
- package/dist/components/ui/molecules/switcher.js +0 -164
- package/dist/components/ui/pages/chat-page.d.ts +0 -83
- package/dist/components/ui/pages/chat-page.d.ts.map +0 -1
- package/dist/components/ui/pages/chat-page.js +0 -385
- /package/dist/components/ui/atoms/{icons/arcade-gradient.d.ts → arcade-gradient.d.ts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
1
|
+
import { jsx as n, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import { cn as a } from "../../../lib/utils.js";
|
|
3
3
|
function m({
|
|
4
|
-
className:
|
|
4
|
+
className: i,
|
|
5
5
|
size: e = "md"
|
|
6
6
|
}) {
|
|
7
7
|
return /* @__PURE__ */ n(
|
|
@@ -10,7 +10,7 @@ function m({
|
|
|
10
10
|
className: a(
|
|
11
11
|
"animate-spin rounded-full border-2 border-primary border-t-transparent",
|
|
12
12
|
{ sm: "size-4", md: "size-5", lg: "size-6" }[e],
|
|
13
|
-
|
|
13
|
+
i
|
|
14
14
|
),
|
|
15
15
|
children: /* @__PURE__ */ n("span", { className: "sr-only", children: "Loading" })
|
|
16
16
|
}
|
|
@@ -30,16 +30,16 @@ const c = {
|
|
|
30
30
|
lg: "14px"
|
|
31
31
|
};
|
|
32
32
|
function g({
|
|
33
|
-
className:
|
|
33
|
+
className: i,
|
|
34
34
|
size: e = "md"
|
|
35
35
|
}) {
|
|
36
|
-
const
|
|
36
|
+
const t = { sm: "size-4", md: "size-5", lg: "size-6" }, s = {
|
|
37
37
|
sm: { height: "6px", width: "1.5px" },
|
|
38
38
|
md: { height: "8px", width: "2px" },
|
|
39
39
|
lg: { height: "10px", width: "2.5px" }
|
|
40
40
|
};
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */ n("div", { className: "absolute h-full w-full", children: Array.from({ length: 12 }, (
|
|
41
|
+
return /* @__PURE__ */ l("div", { className: a("relative", t[e], i), children: [
|
|
42
|
+
/* @__PURE__ */ n("div", { className: "absolute h-full w-full", children: Array.from({ length: 12 }, (d, r) => /* @__PURE__ */ n(
|
|
43
43
|
"div",
|
|
44
44
|
{
|
|
45
45
|
className: "absolute animate-[spinner-fade_1.2s_linear_infinite] rounded-full bg-primary",
|
|
@@ -61,16 +61,16 @@ function g({
|
|
|
61
61
|
] });
|
|
62
62
|
}
|
|
63
63
|
function p({
|
|
64
|
-
className:
|
|
64
|
+
className: i,
|
|
65
65
|
size: e = "md"
|
|
66
66
|
}) {
|
|
67
|
-
return /* @__PURE__ */
|
|
67
|
+
return /* @__PURE__ */ l("div", { className: a("relative", { sm: "size-4", md: "size-5", lg: "size-6" }[e], i), children: [
|
|
68
68
|
/* @__PURE__ */ n("div", { className: "absolute inset-0 animate-[thin-pulse_1.5s_ease-in-out_infinite] rounded-full border-2 border-primary" }),
|
|
69
69
|
/* @__PURE__ */ n("span", { className: "sr-only", children: "Loading" })
|
|
70
70
|
] });
|
|
71
71
|
}
|
|
72
72
|
function x({
|
|
73
|
-
className:
|
|
73
|
+
className: i,
|
|
74
74
|
size: e = "md"
|
|
75
75
|
}) {
|
|
76
76
|
return /* @__PURE__ */ n(
|
|
@@ -79,32 +79,32 @@ function x({
|
|
|
79
79
|
className: a(
|
|
80
80
|
"animate-[pulse-dot_1.2s_ease-in-out_infinite] rounded-full bg-primary",
|
|
81
81
|
{ sm: "size-1", md: "size-2", lg: "size-3" }[e],
|
|
82
|
-
|
|
82
|
+
i
|
|
83
83
|
),
|
|
84
84
|
children: /* @__PURE__ */ n("span", { className: "sr-only", children: "Loading" })
|
|
85
85
|
}
|
|
86
86
|
);
|
|
87
87
|
}
|
|
88
88
|
function f({
|
|
89
|
-
className:
|
|
89
|
+
className: i,
|
|
90
90
|
size: e = "md"
|
|
91
91
|
}) {
|
|
92
|
-
const
|
|
93
|
-
return /* @__PURE__ */
|
|
92
|
+
const t = { sm: "h-1.5 w-1.5", md: "h-2 w-2", lg: "h-2.5 w-2.5" };
|
|
93
|
+
return /* @__PURE__ */ l(
|
|
94
94
|
"div",
|
|
95
95
|
{
|
|
96
96
|
className: a(
|
|
97
97
|
"flex items-center space-x-1",
|
|
98
98
|
{ sm: "h-4", md: "h-5", lg: "h-6" }[e],
|
|
99
|
-
|
|
99
|
+
i
|
|
100
100
|
),
|
|
101
101
|
children: [
|
|
102
|
-
Array.from({ length: 3 }, (
|
|
102
|
+
Array.from({ length: 3 }, (d, r) => /* @__PURE__ */ n(
|
|
103
103
|
"div",
|
|
104
104
|
{
|
|
105
105
|
className: a(
|
|
106
106
|
"animate-[bounce-dots_1.4s_ease-in-out_infinite] rounded-full bg-primary",
|
|
107
|
-
|
|
107
|
+
t[e]
|
|
108
108
|
),
|
|
109
109
|
style: { animationDelay: `${r * 160}ms` }
|
|
110
110
|
},
|
|
@@ -116,25 +116,25 @@ function f({
|
|
|
116
116
|
);
|
|
117
117
|
}
|
|
118
118
|
function _({
|
|
119
|
-
className:
|
|
119
|
+
className: i,
|
|
120
120
|
size: e = "md"
|
|
121
121
|
}) {
|
|
122
|
-
const
|
|
123
|
-
return /* @__PURE__ */
|
|
122
|
+
const t = { sm: "h-1 w-1", md: "h-1.5 w-1.5", lg: "h-2 w-2" };
|
|
123
|
+
return /* @__PURE__ */ l(
|
|
124
124
|
"div",
|
|
125
125
|
{
|
|
126
126
|
className: a(
|
|
127
127
|
"flex items-center space-x-1",
|
|
128
128
|
{ sm: "h-4", md: "h-5", lg: "h-6" }[e],
|
|
129
|
-
|
|
129
|
+
i
|
|
130
130
|
),
|
|
131
131
|
children: [
|
|
132
|
-
Array.from({ length: 3 }, (
|
|
132
|
+
Array.from({ length: 3 }, (d, r) => /* @__PURE__ */ n(
|
|
133
133
|
"div",
|
|
134
134
|
{
|
|
135
135
|
className: a(
|
|
136
136
|
"animate-[typing_1s_infinite] rounded-full bg-primary",
|
|
137
|
-
|
|
137
|
+
t[e]
|
|
138
138
|
),
|
|
139
139
|
style: { animationDelay: `${r * 250}ms` }
|
|
140
140
|
},
|
|
@@ -146,21 +146,21 @@ function _({
|
|
|
146
146
|
);
|
|
147
147
|
}
|
|
148
148
|
function y({
|
|
149
|
-
className:
|
|
149
|
+
className: i,
|
|
150
150
|
size: e = "md"
|
|
151
151
|
}) {
|
|
152
|
-
const
|
|
152
|
+
const t = { sm: "w-0.5", md: "w-0.5", lg: "w-1" }, s = { sm: "h-4", md: "h-5", lg: "h-6" }, d = {
|
|
153
153
|
sm: ["6px", "9px", "12px", "9px", "6px"],
|
|
154
154
|
md: ["8px", "12px", "16px", "12px", "8px"],
|
|
155
155
|
lg: ["10px", "15px", "20px", "15px", "10px"]
|
|
156
156
|
};
|
|
157
|
-
return /* @__PURE__ */
|
|
157
|
+
return /* @__PURE__ */ l(
|
|
158
158
|
"div",
|
|
159
159
|
{
|
|
160
160
|
className: a(
|
|
161
161
|
"flex items-center gap-0.5",
|
|
162
162
|
s[e],
|
|
163
|
-
|
|
163
|
+
i
|
|
164
164
|
),
|
|
165
165
|
children: [
|
|
166
166
|
Array.from({ length: 5 }, (r, o) => /* @__PURE__ */ n(
|
|
@@ -168,11 +168,11 @@ function y({
|
|
|
168
168
|
{
|
|
169
169
|
className: a(
|
|
170
170
|
"animate-[wave_1s_ease-in-out_infinite] rounded-full bg-primary",
|
|
171
|
-
|
|
171
|
+
t[e]
|
|
172
172
|
),
|
|
173
173
|
style: {
|
|
174
174
|
animationDelay: `${o * 100}ms`,
|
|
175
|
-
height:
|
|
175
|
+
height: d[e][o]
|
|
176
176
|
}
|
|
177
177
|
},
|
|
178
178
|
o
|
|
@@ -183,21 +183,21 @@ function y({
|
|
|
183
183
|
);
|
|
184
184
|
}
|
|
185
185
|
function b({
|
|
186
|
-
className:
|
|
186
|
+
className: i,
|
|
187
187
|
size: e = "md"
|
|
188
188
|
}) {
|
|
189
|
-
const
|
|
190
|
-
return /* @__PURE__ */
|
|
189
|
+
const t = { sm: "w-1", md: "w-1.5", lg: "w-2" };
|
|
190
|
+
return /* @__PURE__ */ l("div", { className: a("flex", {
|
|
191
191
|
sm: "h-4 gap-1",
|
|
192
192
|
md: "h-5 gap-1.5",
|
|
193
193
|
lg: "h-6 gap-2"
|
|
194
|
-
}[e],
|
|
195
|
-
Array.from({ length: 3 }, (
|
|
194
|
+
}[e], i), children: [
|
|
195
|
+
Array.from({ length: 3 }, (d, r) => /* @__PURE__ */ n(
|
|
196
196
|
"div",
|
|
197
197
|
{
|
|
198
198
|
className: a(
|
|
199
199
|
"h-full animate-[wave-bars_1.2s_ease-in-out_infinite] bg-primary",
|
|
200
|
-
|
|
200
|
+
t[e]
|
|
201
201
|
),
|
|
202
202
|
style: { animationDelay: `${r * 0.2}s` }
|
|
203
203
|
},
|
|
@@ -207,17 +207,17 @@ function b({
|
|
|
207
207
|
] });
|
|
208
208
|
}
|
|
209
209
|
function v({
|
|
210
|
-
className:
|
|
210
|
+
className: i,
|
|
211
211
|
size: e = "md"
|
|
212
212
|
}) {
|
|
213
|
-
const
|
|
214
|
-
return /* @__PURE__ */
|
|
213
|
+
const t = { sm: "h-3 w-1.5", md: "h-4 w-2", lg: "h-5 w-2.5" }, s = { sm: "text-xs", md: "text-sm", lg: "text-base" };
|
|
214
|
+
return /* @__PURE__ */ l(
|
|
215
215
|
"div",
|
|
216
216
|
{
|
|
217
217
|
className: a(
|
|
218
218
|
"flex items-center space-x-1",
|
|
219
219
|
{ sm: "h-4", md: "h-5", lg: "h-6" }[e],
|
|
220
|
-
|
|
220
|
+
i
|
|
221
221
|
),
|
|
222
222
|
children: [
|
|
223
223
|
/* @__PURE__ */ n("span", { className: a("font-mono text-primary", s[e]), children: ">" }),
|
|
@@ -226,7 +226,7 @@ function v({
|
|
|
226
226
|
{
|
|
227
227
|
className: a(
|
|
228
228
|
"animate-[blink_1s_step-end_infinite] bg-primary",
|
|
229
|
-
|
|
229
|
+
t[e]
|
|
230
230
|
)
|
|
231
231
|
}
|
|
232
232
|
),
|
|
@@ -236,26 +236,26 @@ function v({
|
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
238
|
function L({
|
|
239
|
-
text:
|
|
239
|
+
text: i = "Thinking",
|
|
240
240
|
className: e,
|
|
241
|
-
size:
|
|
241
|
+
size: t = "md"
|
|
242
242
|
}) {
|
|
243
243
|
return /* @__PURE__ */ n(
|
|
244
244
|
"div",
|
|
245
245
|
{
|
|
246
246
|
className: a(
|
|
247
247
|
"animate-[text-blink_2s_ease-in-out_infinite] font-medium",
|
|
248
|
-
{ sm: "text-xs", md: "text-sm", lg: "text-base" }[
|
|
248
|
+
{ sm: "text-xs", md: "text-sm", lg: "text-base" }[t],
|
|
249
249
|
e
|
|
250
250
|
),
|
|
251
|
-
children:
|
|
251
|
+
children: i
|
|
252
252
|
}
|
|
253
253
|
);
|
|
254
254
|
}
|
|
255
255
|
function N({
|
|
256
|
-
text:
|
|
256
|
+
text: i = "Thinking",
|
|
257
257
|
className: e,
|
|
258
|
-
size:
|
|
258
|
+
size: t = "md"
|
|
259
259
|
}) {
|
|
260
260
|
return /* @__PURE__ */ n(
|
|
261
261
|
"div",
|
|
@@ -264,41 +264,69 @@ function N({
|
|
|
264
264
|
"bg-[linear-gradient(to_right,var(--muted-foreground)_40%,var(--foreground)_60%,var(--muted-foreground)_80%)]",
|
|
265
265
|
"bg-size-[200%_auto] bg-clip-text font-medium text-transparent",
|
|
266
266
|
"animate-[shimmer_4s_infinite_linear]",
|
|
267
|
-
{ sm: "text-xs", md: "text-sm", lg: "text-base" }[
|
|
267
|
+
{ sm: "text-xs", md: "text-sm", lg: "text-base" }[t],
|
|
268
268
|
e
|
|
269
269
|
),
|
|
270
|
-
children:
|
|
270
|
+
children: i
|
|
271
271
|
}
|
|
272
272
|
);
|
|
273
273
|
}
|
|
274
274
|
function S({
|
|
275
|
-
className:
|
|
275
|
+
className: i,
|
|
276
276
|
text: e = "Thinking",
|
|
277
|
-
size:
|
|
277
|
+
size: t = "md"
|
|
278
278
|
}) {
|
|
279
279
|
const s = { sm: "text-xs", md: "text-sm", lg: "text-base" };
|
|
280
|
-
return /* @__PURE__ */
|
|
280
|
+
return /* @__PURE__ */ l("div", { className: a("inline-flex items-center", i), children: [
|
|
281
281
|
/* @__PURE__ */ n(
|
|
282
282
|
"span",
|
|
283
283
|
{
|
|
284
|
-
className: a("font-medium text-muted-foreground", s[
|
|
284
|
+
className: a("font-medium text-muted-foreground", s[t]),
|
|
285
285
|
children: e
|
|
286
286
|
}
|
|
287
287
|
),
|
|
288
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ l("span", { className: "inline-flex", children: [
|
|
289
289
|
/* @__PURE__ */ n("span", { className: "animate-[loading-dots_1.4s_infinite_0.2s] text-muted-foreground", children: "." }),
|
|
290
290
|
/* @__PURE__ */ n("span", { className: "animate-[loading-dots_1.4s_infinite_0.4s] text-muted-foreground", children: "." }),
|
|
291
291
|
/* @__PURE__ */ n("span", { className: "animate-[loading-dots_1.4s_infinite_0.6s] text-muted-foreground", children: "." })
|
|
292
292
|
] })
|
|
293
293
|
] });
|
|
294
294
|
}
|
|
295
|
-
function
|
|
296
|
-
|
|
295
|
+
function w({
|
|
296
|
+
className: i,
|
|
297
297
|
size: e = "md",
|
|
298
|
-
text:
|
|
298
|
+
text: t
|
|
299
|
+
}) {
|
|
300
|
+
const s = { sm: "text-sm", md: "text-base", lg: "text-lg" }, d = { sm: "text-xs", md: "text-sm", lg: "text-base" };
|
|
301
|
+
return /* @__PURE__ */ l("div", { className: a("inline-flex items-center gap-1.5", i), children: [
|
|
302
|
+
/* @__PURE__ */ n(
|
|
303
|
+
"span",
|
|
304
|
+
{
|
|
305
|
+
"aria-hidden": "true",
|
|
306
|
+
className: a(
|
|
307
|
+
"before:animate-[braille-spin_0.8s_steps(10,end)_infinite] before:content-['⠋']",
|
|
308
|
+
"font-mono text-primary leading-none",
|
|
309
|
+
s[e]
|
|
310
|
+
)
|
|
311
|
+
}
|
|
312
|
+
),
|
|
313
|
+
t && /* @__PURE__ */ n(
|
|
314
|
+
"span",
|
|
315
|
+
{
|
|
316
|
+
className: a("text-muted-foreground leading-none", d[e]),
|
|
317
|
+
children: t
|
|
318
|
+
}
|
|
319
|
+
),
|
|
320
|
+
!t && /* @__PURE__ */ n("span", { className: "sr-only", children: "Loading" })
|
|
321
|
+
] });
|
|
322
|
+
}
|
|
323
|
+
function A({
|
|
324
|
+
variant: i = "circular",
|
|
325
|
+
size: e = "md",
|
|
326
|
+
text: t,
|
|
299
327
|
className: s
|
|
300
328
|
}) {
|
|
301
|
-
switch (
|
|
329
|
+
switch (i) {
|
|
302
330
|
case "circular":
|
|
303
331
|
return /* @__PURE__ */ n(m, { className: s, size: e });
|
|
304
332
|
case "classic":
|
|
@@ -318,15 +346,17 @@ function C({
|
|
|
318
346
|
case "terminal":
|
|
319
347
|
return /* @__PURE__ */ n(v, { className: s, size: e });
|
|
320
348
|
case "text-blink":
|
|
321
|
-
return /* @__PURE__ */ n(L, { className: s, size: e, text:
|
|
349
|
+
return /* @__PURE__ */ n(L, { className: s, size: e, text: t });
|
|
322
350
|
case "text-shimmer":
|
|
323
|
-
return /* @__PURE__ */ n(N, { className: s, size: e, text:
|
|
351
|
+
return /* @__PURE__ */ n(N, { className: s, size: e, text: t });
|
|
324
352
|
case "loading-dots":
|
|
325
|
-
return /* @__PURE__ */ n(S, { className: s, size: e, text:
|
|
353
|
+
return /* @__PURE__ */ n(S, { className: s, size: e, text: t });
|
|
354
|
+
case "braille":
|
|
355
|
+
return /* @__PURE__ */ n(w, { className: s, size: e, text: t });
|
|
326
356
|
default:
|
|
327
357
|
return /* @__PURE__ */ n(m, { className: s, size: e });
|
|
328
358
|
}
|
|
329
359
|
}
|
|
330
360
|
export {
|
|
331
|
-
|
|
361
|
+
A as Loader
|
|
332
362
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtualized-grid.d.ts","sourceRoot":"","sources":["../../../../lib/components/ui/atoms/virtualized-grid.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI;IACpC,0BAA0B;IAC1B,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,SAAS,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACzC,oCAAoC;IACpC,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IAClD,2CAA2C;IAC3C,eAAe,EAAE,MAAM,CAAC;IACxB,mCAAmC;IACnC,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAChC,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;
|
|
1
|
+
{"version":3,"file":"virtualized-grid.d.ts","sourceRoot":"","sources":["../../../../lib/components/ui/atoms/virtualized-grid.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI;IACpC,0BAA0B;IAC1B,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,SAAS,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACzC,oCAAoC;IACpC,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IAClD,2CAA2C;IAC3C,eAAe,EAAE,MAAM,CAAC;IACxB,mCAAmC;IACnC,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAChC,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAgBF,wBAAgB,eAAe,CAAC,CAAC,EAAE,EACjC,KAAK,EACL,OAAO,EACP,SAAS,EACT,UAAU,EACV,eAAe,EACf,UAAU,EACV,QAA2B,EAC3B,QAA6B,EAC7B,aAAwC,GACzC,EAAE,oBAAoB,CAAC,CAAC,CAAC,kDA0GzB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as x } from "react/jsx-runtime";
|
|
2
2
|
import * as w from "react";
|
|
3
|
-
import { useRef as F, useState as
|
|
3
|
+
import { useRef as F, useState as k, useEffect as T, useMemo as D } from "react";
|
|
4
4
|
import { flushSync as N } from "react-dom";
|
|
5
5
|
function y(r, l, e) {
|
|
6
6
|
let s = e.initialDeps ?? [], t, n = !0;
|
|
@@ -42,7 +42,7 @@ function O(r, l) {
|
|
|
42
42
|
throw new Error("Unexpected undefined");
|
|
43
43
|
return r;
|
|
44
44
|
}
|
|
45
|
-
const W = (r, l) => Math.abs(r - l) < 1.01,
|
|
45
|
+
const W = (r, l) => Math.abs(r - l) < 1.01, V = (r, l, e) => {
|
|
46
46
|
let s;
|
|
47
47
|
return function(...t) {
|
|
48
48
|
r.clearTimeout(s), s = r.setTimeout(() => l.apply(this, t), e);
|
|
@@ -50,7 +50,7 @@ const W = (r, l) => Math.abs(r - l) < 1.01, L = (r, l, e) => {
|
|
|
50
50
|
}, z = (r) => {
|
|
51
51
|
const { offsetWidth: l, offsetHeight: e } = r;
|
|
52
52
|
return { width: l, height: e };
|
|
53
|
-
},
|
|
53
|
+
}, L = (r) => r, j = (r) => {
|
|
54
54
|
const l = Math.max(r.startIndex - r.overscan, 0), e = Math.min(r.endIndex + r.overscan, r.count - 1), s = [];
|
|
55
55
|
for (let t = l; t <= e; t++)
|
|
56
56
|
s.push(t);
|
|
@@ -97,7 +97,7 @@ const W = (r, l) => Math.abs(r - l) < 1.01, L = (r, l, e) => {
|
|
|
97
97
|
return;
|
|
98
98
|
let t = 0;
|
|
99
99
|
const n = r.options.useScrollendEvent && I ? () => {
|
|
100
|
-
} :
|
|
100
|
+
} : V(
|
|
101
101
|
s,
|
|
102
102
|
() => {
|
|
103
103
|
l(t, !1);
|
|
@@ -132,7 +132,7 @@ const W = (r, l) => Math.abs(r - l) < 1.01, L = (r, l, e) => {
|
|
|
132
132
|
behavior: e
|
|
133
133
|
});
|
|
134
134
|
};
|
|
135
|
-
class
|
|
135
|
+
class q {
|
|
136
136
|
constructor(l) {
|
|
137
137
|
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.currentScrollToIndex = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
|
|
138
138
|
let e = null;
|
|
@@ -170,7 +170,7 @@ class U {
|
|
|
170
170
|
scrollPaddingStart: 0,
|
|
171
171
|
scrollPaddingEnd: 0,
|
|
172
172
|
horizontal: !1,
|
|
173
|
-
getItemKey:
|
|
173
|
+
getItemKey: L,
|
|
174
174
|
rangeExtractor: j,
|
|
175
175
|
onChange: () => {
|
|
176
176
|
},
|
|
@@ -323,7 +323,7 @@ class U {
|
|
|
323
323
|
this.getScrollOffset(),
|
|
324
324
|
this.options.lanes
|
|
325
325
|
],
|
|
326
|
-
(e, s, t, n) => this.range = e.length > 0 && s > 0 ?
|
|
326
|
+
(e, s, t, n) => this.range = e.length > 0 && s > 0 ? U({
|
|
327
327
|
measurements: e,
|
|
328
328
|
outerSize: s,
|
|
329
329
|
scrollOffset: t,
|
|
@@ -531,7 +531,7 @@ const _ = (r, l, e, s) => {
|
|
|
531
531
|
}
|
|
532
532
|
return r > 0 ? r - 1 : 0;
|
|
533
533
|
};
|
|
534
|
-
function
|
|
534
|
+
function U({
|
|
535
535
|
measurements: r,
|
|
536
536
|
outerSize: l,
|
|
537
537
|
scrollOffset: e,
|
|
@@ -579,7 +579,7 @@ function K({
|
|
|
579
579
|
r && o ? N(e) : e(), (i = l.onChange) == null || i.call(l, n, o);
|
|
580
580
|
}
|
|
581
581
|
}, [t] = w.useState(
|
|
582
|
-
() => new
|
|
582
|
+
() => new q(s)
|
|
583
583
|
);
|
|
584
584
|
return t.setOptions(s), A(() => t._didMount(), []), A(() => t._willUpdate()), t;
|
|
585
585
|
}
|
|
@@ -591,8 +591,8 @@ function G(r) {
|
|
|
591
591
|
...r
|
|
592
592
|
});
|
|
593
593
|
}
|
|
594
|
-
const X = 5, Y = 0
|
|
595
|
-
function
|
|
594
|
+
const X = 5, Y = 0;
|
|
595
|
+
function J(r, l) {
|
|
596
596
|
if (l <= 0)
|
|
597
597
|
throw new Error(`chunkArray: size must be positive, received ${l}`);
|
|
598
598
|
const e = [];
|
|
@@ -600,7 +600,7 @@ function Q(r, l) {
|
|
|
600
600
|
e.push(r.slice(s, s + l));
|
|
601
601
|
return e;
|
|
602
602
|
}
|
|
603
|
-
function
|
|
603
|
+
function te({
|
|
604
604
|
items: r,
|
|
605
605
|
columns: l,
|
|
606
606
|
parentRef: e,
|
|
@@ -609,13 +609,13 @@ function se({
|
|
|
609
609
|
getItemKey: n,
|
|
610
610
|
overscan: o = X,
|
|
611
611
|
rowGapPx: i = Y,
|
|
612
|
-
gridClassName: h =
|
|
612
|
+
gridClassName: h = "grid grid-cols-1 gap-4"
|
|
613
613
|
}) {
|
|
614
614
|
if (l <= 0)
|
|
615
615
|
throw new Error(
|
|
616
616
|
`VirtualizedGrid: columns must be positive, received ${l}`
|
|
617
617
|
);
|
|
618
|
-
const u = F(null), [c, v] =
|
|
618
|
+
const u = F(null), [c, v] = k(0);
|
|
619
619
|
T(() => {
|
|
620
620
|
const m = u.current, p = e.current;
|
|
621
621
|
if (!(m && p))
|
|
@@ -628,7 +628,7 @@ function se({
|
|
|
628
628
|
const E = new ResizeObserver(d);
|
|
629
629
|
return E.observe(m), E.observe(p), () => E.disconnect();
|
|
630
630
|
}, [e]);
|
|
631
|
-
const a =
|
|
631
|
+
const a = D(() => J(r, l).map(
|
|
632
632
|
(p, d) => p.map((E, S) => ({
|
|
633
633
|
item: E,
|
|
634
634
|
index: d * l + S
|
|
@@ -679,5 +679,5 @@ function se({
|
|
|
679
679
|
);
|
|
680
680
|
}
|
|
681
681
|
export {
|
|
682
|
-
|
|
682
|
+
te as VirtualizedGrid
|
|
683
683
|
};
|