@cytario/design 5.0.0 → 5.2.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/index.css +1 -1
- package/dist/index.d.ts +42 -21
- package/dist/index.js +592 -304
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import { twMerge } from "tailwind-merge";
|
|
|
11
11
|
|
|
12
12
|
// src/components/_shared/styles.ts
|
|
13
13
|
var sizeStyles = {
|
|
14
|
+
xs: "px-2 py-1 text-xs",
|
|
14
15
|
sm: "px-3 py-1.5 text-sm",
|
|
15
16
|
md: "px-4 py-2 text-base",
|
|
16
17
|
lg: "px-6 py-3 text-lg"
|
|
@@ -149,6 +150,7 @@ function useInputGroup() {
|
|
|
149
150
|
// src/components/Button/Button.tsx
|
|
150
151
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
151
152
|
var iconSizeMap = {
|
|
153
|
+
xs: "sm",
|
|
152
154
|
sm: "sm",
|
|
153
155
|
md: "sm",
|
|
154
156
|
lg: "md"
|
|
@@ -156,11 +158,11 @@ var iconSizeMap = {
|
|
|
156
158
|
function groupRadiusClass(position) {
|
|
157
159
|
switch (position) {
|
|
158
160
|
case "start":
|
|
159
|
-
return "rounded-l-
|
|
161
|
+
return "rounded-l-md rounded-r-none";
|
|
160
162
|
case "middle":
|
|
161
163
|
return "rounded-none";
|
|
162
164
|
case "end":
|
|
163
|
-
return "rounded-r-
|
|
165
|
+
return "rounded-r-md rounded-l-none";
|
|
164
166
|
default:
|
|
165
167
|
return "rounded-md";
|
|
166
168
|
}
|
|
@@ -187,7 +189,7 @@ function Button({
|
|
|
187
189
|
...props,
|
|
188
190
|
isDisabled: isDisabled || isLoading,
|
|
189
191
|
className: twMerge(
|
|
190
|
-
"inline-flex items-center justify-center gap-2 shrink-0",
|
|
192
|
+
"inline-flex items-center justify-center gap-2 shrink-0 cursor-pointer",
|
|
191
193
|
radiusClass,
|
|
192
194
|
"font-medium",
|
|
193
195
|
"leading-tight",
|
|
@@ -212,59 +214,349 @@ function Button({
|
|
|
212
214
|
|
|
213
215
|
// src/components/Tooltip/Tooltip.tsx
|
|
214
216
|
import {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
217
|
+
useEffect,
|
|
218
|
+
useLayoutEffect,
|
|
219
|
+
useRef,
|
|
220
|
+
useState
|
|
221
|
+
} from "react";
|
|
222
|
+
import { createPortal } from "react-dom";
|
|
218
223
|
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
224
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
225
|
+
var offsetThreshold = 5;
|
|
226
|
+
var tooltipDelay = 500;
|
|
227
|
+
var tooltipOffset = 12;
|
|
228
|
+
var viewportMargin = 4;
|
|
229
|
+
var tooltipCx = [
|
|
230
|
+
"fixed z-50 px-2 py-1 rounded shadow-lg",
|
|
231
|
+
// Natural content width (capped at max-w-xs): being positioned near the
|
|
232
|
+
// right viewport edge must shift the tooltip left, not squeeze its layout.
|
|
233
|
+
"w-max max-w-xs",
|
|
234
|
+
"bg-(--color-surface-overlay) backdrop-blur-sm",
|
|
235
|
+
"text-(--color-text-inverse) text-sm",
|
|
236
|
+
"pointer-events-none"
|
|
237
|
+
].join(" ");
|
|
238
|
+
function Tooltip({ content, children }) {
|
|
239
|
+
const [visible, setVisible] = useState(false);
|
|
240
|
+
const [coords, setCoords] = useState({ x: 0, y: 0 });
|
|
241
|
+
const [adjustedCoords, setAdjustedCoords] = useState({ x: 0, y: 0 });
|
|
242
|
+
const timerRef = useRef(null);
|
|
243
|
+
const restAnchorRef = useRef(null);
|
|
244
|
+
const tooltipRef = useRef(null);
|
|
245
|
+
const isVisible = visible && content != null;
|
|
246
|
+
const calculateAdjustedPosition = (anchorX, anchorY) => {
|
|
247
|
+
if (!tooltipRef.current) {
|
|
248
|
+
return { x: anchorX + tooltipOffset, y: anchorY + tooltipOffset };
|
|
249
|
+
}
|
|
250
|
+
const { width, height } = tooltipRef.current.getBoundingClientRect();
|
|
251
|
+
const viewportWidth = window.innerWidth;
|
|
252
|
+
const viewportHeight = window.innerHeight;
|
|
253
|
+
let x = anchorX + tooltipOffset;
|
|
254
|
+
let y = anchorY + tooltipOffset;
|
|
255
|
+
if (anchorX + width > viewportWidth) {
|
|
256
|
+
x = anchorX - width - tooltipOffset;
|
|
257
|
+
}
|
|
258
|
+
if (anchorY + height > viewportHeight) {
|
|
259
|
+
y = anchorY - height - tooltipOffset;
|
|
260
|
+
}
|
|
261
|
+
x = Math.max(
|
|
262
|
+
viewportMargin,
|
|
263
|
+
Math.min(x, viewportWidth - width - viewportMargin)
|
|
264
|
+
);
|
|
265
|
+
y = Math.max(
|
|
266
|
+
viewportMargin,
|
|
267
|
+
Math.min(y, viewportHeight - height - viewportMargin)
|
|
268
|
+
);
|
|
269
|
+
return { x, y };
|
|
270
|
+
};
|
|
271
|
+
useIsomorphicLayoutEffect(() => {
|
|
272
|
+
if (!isVisible || !tooltipRef.current) return;
|
|
273
|
+
setAdjustedCoords(calculateAdjustedPosition(coords.x, coords.y));
|
|
274
|
+
}, [isVisible, coords, content]);
|
|
275
|
+
const hideTooltip = () => {
|
|
276
|
+
if (timerRef.current) {
|
|
277
|
+
clearTimeout(timerRef.current);
|
|
278
|
+
timerRef.current = null;
|
|
279
|
+
}
|
|
280
|
+
restAnchorRef.current = null;
|
|
281
|
+
setVisible(false);
|
|
282
|
+
};
|
|
283
|
+
const handleMouseMove = ({ clientX, clientY }) => {
|
|
284
|
+
setCoords({ x: clientX, y: clientY });
|
|
285
|
+
const anchor = restAnchorRef.current;
|
|
286
|
+
const moved = anchor == null || Math.abs(clientX - anchor.x) > offsetThreshold || Math.abs(clientY - anchor.y) > offsetThreshold;
|
|
287
|
+
if (!moved) return;
|
|
288
|
+
hideTooltip();
|
|
289
|
+
restAnchorRef.current = { x: clientX, y: clientY };
|
|
290
|
+
timerRef.current = window.setTimeout(() => {
|
|
291
|
+
setVisible(true);
|
|
292
|
+
}, tooltipDelay);
|
|
293
|
+
};
|
|
294
|
+
const handleFocus = (e) => {
|
|
295
|
+
const target = e.target;
|
|
296
|
+
let focusVisible = true;
|
|
297
|
+
try {
|
|
298
|
+
focusVisible = target.matches(":focus-visible");
|
|
299
|
+
} catch {
|
|
300
|
+
}
|
|
301
|
+
if (!focusVisible) return;
|
|
302
|
+
const rect = target.getBoundingClientRect();
|
|
303
|
+
const center = { x: rect.left + rect.width / 2, y: rect.top + rect.height / 2 };
|
|
304
|
+
restAnchorRef.current = center;
|
|
305
|
+
setCoords(center);
|
|
306
|
+
setVisible(true);
|
|
307
|
+
};
|
|
308
|
+
const handleKeyDown = (e) => {
|
|
309
|
+
if (e.key === "Escape") hideTooltip();
|
|
310
|
+
};
|
|
311
|
+
useEffect(() => {
|
|
312
|
+
return () => {
|
|
313
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
314
|
+
};
|
|
315
|
+
}, []);
|
|
316
|
+
const tooltipContent = isVisible && content != null ? /* @__PURE__ */ jsx4(
|
|
317
|
+
"div",
|
|
318
|
+
{
|
|
319
|
+
ref: tooltipRef,
|
|
320
|
+
role: "tooltip",
|
|
321
|
+
className: tooltipCx,
|
|
322
|
+
style: { left: adjustedCoords.x, top: adjustedCoords.y },
|
|
323
|
+
children: content
|
|
324
|
+
}
|
|
325
|
+
) : null;
|
|
326
|
+
return /* @__PURE__ */ jsxs3(
|
|
327
|
+
"span",
|
|
328
|
+
{
|
|
329
|
+
style: { display: "contents" },
|
|
330
|
+
onMouseMove: handleMouseMove,
|
|
331
|
+
onMouseLeave: hideTooltip,
|
|
332
|
+
onFocus: handleFocus,
|
|
333
|
+
onBlur: hideTooltip,
|
|
334
|
+
onKeyDown: handleKeyDown,
|
|
335
|
+
children: [
|
|
336
|
+
children,
|
|
337
|
+
typeof window !== "undefined" && createPortal(tooltipContent, document.body)
|
|
338
|
+
]
|
|
339
|
+
}
|
|
340
|
+
);
|
|
250
341
|
}
|
|
251
342
|
|
|
343
|
+
// src/components/TruncatedText/TruncatedText.tsx
|
|
344
|
+
import {
|
|
345
|
+
useRef as useRef3
|
|
346
|
+
} from "react";
|
|
347
|
+
|
|
348
|
+
// src/components/TruncatedText/useCopyToClipboard.ts
|
|
349
|
+
import { useCallback, useRef as useRef2, useState as useState2 } from "react";
|
|
350
|
+
var FLASH_DURATION = 1500;
|
|
351
|
+
function useCopyToClipboard(copyValue) {
|
|
352
|
+
const [isCopied, setIsCopied] = useState2(false);
|
|
353
|
+
const timerRef = useRef2(null);
|
|
354
|
+
const handleClick = useCallback(() => {
|
|
355
|
+
if (copyValue == null) return;
|
|
356
|
+
const selection = window.getSelection()?.toString();
|
|
357
|
+
if (selection && selection.length > 0) return;
|
|
358
|
+
if (!navigator.clipboard) return;
|
|
359
|
+
navigator.clipboard.writeText(copyValue).then(() => {
|
|
360
|
+
if (timerRef.current != null) clearTimeout(timerRef.current);
|
|
361
|
+
setIsCopied(true);
|
|
362
|
+
timerRef.current = window.setTimeout(() => {
|
|
363
|
+
setIsCopied(false);
|
|
364
|
+
timerRef.current = null;
|
|
365
|
+
}, FLASH_DURATION);
|
|
366
|
+
}).catch(() => {
|
|
367
|
+
});
|
|
368
|
+
}, [copyValue]);
|
|
369
|
+
return { handleClick, isCopied };
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
// src/components/TruncatedText/useMiddleEllipsis.ts
|
|
373
|
+
import { useLayoutEffect as useLayoutEffect2, useState as useState3 } from "react";
|
|
374
|
+
var ELLIPSIS = "\u2026";
|
|
375
|
+
function computeTruncated(el, text) {
|
|
376
|
+
el.textContent = text;
|
|
377
|
+
if (el.scrollWidth <= el.clientWidth) return text;
|
|
378
|
+
let lo = 0;
|
|
379
|
+
let hi = text.length;
|
|
380
|
+
while (lo < hi) {
|
|
381
|
+
const mid = Math.ceil((lo + hi) / 2);
|
|
382
|
+
const startLen2 = Math.ceil(mid / 2);
|
|
383
|
+
const endLen2 = Math.floor(mid / 2);
|
|
384
|
+
el.textContent = text.slice(0, startLen2) + ELLIPSIS + (endLen2 > 0 ? text.slice(text.length - endLen2) : "");
|
|
385
|
+
if (el.scrollWidth <= el.clientWidth) {
|
|
386
|
+
lo = mid;
|
|
387
|
+
} else {
|
|
388
|
+
hi = mid - 1;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
if (lo === 0) return ELLIPSIS;
|
|
392
|
+
const startLen = Math.ceil(lo / 2);
|
|
393
|
+
const endLen = Math.floor(lo / 2);
|
|
394
|
+
const result = endLen === 0 ? text.slice(0, startLen) + ELLIPSIS : text.slice(0, startLen) + ELLIPSIS + text.slice(text.length - endLen);
|
|
395
|
+
el.textContent = result;
|
|
396
|
+
return result;
|
|
397
|
+
}
|
|
398
|
+
function useMiddleEllipsis(ref, text) {
|
|
399
|
+
const [displayed, setDisplayed] = useState3(text);
|
|
400
|
+
useLayoutEffect2(() => {
|
|
401
|
+
const el = ref.current;
|
|
402
|
+
if (!el) return;
|
|
403
|
+
const update = () => setDisplayed(computeTruncated(el, text));
|
|
404
|
+
update();
|
|
405
|
+
const observer = new ResizeObserver(() => update());
|
|
406
|
+
observer.observe(el);
|
|
407
|
+
return () => observer.disconnect();
|
|
408
|
+
}, [ref, text]);
|
|
409
|
+
return displayed;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
// src/components/TruncatedText/useOverflowDetection.ts
|
|
413
|
+
import { useLayoutEffect as useLayoutEffect3, useState as useState4 } from "react";
|
|
414
|
+
function useOverflowDetection(ref) {
|
|
415
|
+
const [isTruncated, setIsTruncated] = useState4(false);
|
|
416
|
+
useLayoutEffect3(() => {
|
|
417
|
+
const el = ref.current;
|
|
418
|
+
if (!el) return;
|
|
419
|
+
const check = () => setIsTruncated(el.scrollWidth > el.offsetWidth);
|
|
420
|
+
check();
|
|
421
|
+
let raf = 0;
|
|
422
|
+
const observer = new ResizeObserver(() => {
|
|
423
|
+
cancelAnimationFrame(raf);
|
|
424
|
+
raf = requestAnimationFrame(check);
|
|
425
|
+
});
|
|
426
|
+
observer.observe(el);
|
|
427
|
+
return () => {
|
|
428
|
+
cancelAnimationFrame(raf);
|
|
429
|
+
observer.disconnect();
|
|
430
|
+
};
|
|
431
|
+
}, [ref]);
|
|
432
|
+
return isTruncated;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
// src/components/TruncatedText/TruncatedText.tsx
|
|
436
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
437
|
+
var spanCx = "truncate overflow-hidden whitespace-nowrap block min-w-0 w-full";
|
|
438
|
+
var copyCx = "hover:bg-(--color-surface-hover) transition-colors rounded cursor-pointer";
|
|
439
|
+
var leftStyle = { direction: "rtl", textAlign: "left" };
|
|
440
|
+
var pinScroll = (e) => {
|
|
441
|
+
if (e.currentTarget.scrollLeft !== 0) e.currentTarget.scrollLeft = 0;
|
|
442
|
+
};
|
|
443
|
+
var handleCopyKeyDown = (handleClick) => (e) => {
|
|
444
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
445
|
+
e.preventDefault();
|
|
446
|
+
handleClick();
|
|
447
|
+
}
|
|
448
|
+
};
|
|
449
|
+
var CopiedOverlay = () => /* @__PURE__ */ jsx5(
|
|
450
|
+
"span",
|
|
451
|
+
{
|
|
452
|
+
role: "status",
|
|
453
|
+
"aria-live": "polite",
|
|
454
|
+
className: "absolute inset-0 flex items-center text-(--color-text-secondary) pointer-events-none",
|
|
455
|
+
children: "Copied"
|
|
456
|
+
}
|
|
457
|
+
);
|
|
458
|
+
var RightEllipsis = ({ children, copyValue }) => {
|
|
459
|
+
const ref = useRef3(null);
|
|
460
|
+
const isTruncated = useOverflowDetection(ref);
|
|
461
|
+
const { handleClick, isCopied } = useCopyToClipboard(copyValue);
|
|
462
|
+
const isCopyable = copyValue != null;
|
|
463
|
+
const baseCx = isCopyable ? `${spanCx} ${copyCx} relative` : spanCx;
|
|
464
|
+
const cx = isCopied ? `${baseCx} text-transparent` : baseCx;
|
|
465
|
+
return /* @__PURE__ */ jsx5(Tooltip, { content: isTruncated ? children : null, children: /* @__PURE__ */ jsxs4(
|
|
466
|
+
"span",
|
|
467
|
+
{
|
|
468
|
+
ref,
|
|
469
|
+
className: cx,
|
|
470
|
+
onScroll: pinScroll,
|
|
471
|
+
onClick: isCopyable ? handleClick : void 0,
|
|
472
|
+
onKeyDown: isCopyable ? handleCopyKeyDown(handleClick) : void 0,
|
|
473
|
+
role: isCopyable ? "button" : void 0,
|
|
474
|
+
tabIndex: isCopyable ? 0 : void 0,
|
|
475
|
+
children: [
|
|
476
|
+
children,
|
|
477
|
+
isCopied && /* @__PURE__ */ jsx5(CopiedOverlay, {})
|
|
478
|
+
]
|
|
479
|
+
}
|
|
480
|
+
) });
|
|
481
|
+
};
|
|
482
|
+
var LeftEllipsis = ({ children, copyValue }) => {
|
|
483
|
+
const ref = useRef3(null);
|
|
484
|
+
const isTruncated = useOverflowDetection(ref);
|
|
485
|
+
const { handleClick, isCopied } = useCopyToClipboard(copyValue);
|
|
486
|
+
const isCopyable = copyValue != null;
|
|
487
|
+
const baseCx = isCopyable ? `${spanCx} ${copyCx} relative` : spanCx;
|
|
488
|
+
const cx = isCopied ? `${baseCx} text-transparent` : baseCx;
|
|
489
|
+
return /* @__PURE__ */ jsx5(Tooltip, { content: isTruncated ? children : null, children: /* @__PURE__ */ jsxs4(
|
|
490
|
+
"span",
|
|
491
|
+
{
|
|
492
|
+
ref,
|
|
493
|
+
className: cx,
|
|
494
|
+
style: leftStyle,
|
|
495
|
+
onScroll: pinScroll,
|
|
496
|
+
onClick: isCopyable ? handleClick : void 0,
|
|
497
|
+
onKeyDown: isCopyable ? handleCopyKeyDown(handleClick) : void 0,
|
|
498
|
+
role: isCopyable ? "button" : void 0,
|
|
499
|
+
tabIndex: isCopyable ? 0 : void 0,
|
|
500
|
+
children: [
|
|
501
|
+
/* @__PURE__ */ jsx5("bdi", { children }),
|
|
502
|
+
isCopied && /* @__PURE__ */ jsx5(CopiedOverlay, {})
|
|
503
|
+
]
|
|
504
|
+
}
|
|
505
|
+
) });
|
|
506
|
+
};
|
|
507
|
+
var middleCx = "overflow-hidden whitespace-nowrap block min-w-0 w-full";
|
|
508
|
+
var MiddleEllipsisString = ({ text, copyValue }) => {
|
|
509
|
+
const ref = useRef3(null);
|
|
510
|
+
const displayed = useMiddleEllipsis(ref, text);
|
|
511
|
+
const isTruncated = displayed !== text;
|
|
512
|
+
const { handleClick, isCopied } = useCopyToClipboard(copyValue);
|
|
513
|
+
const isCopyable = copyValue != null;
|
|
514
|
+
const baseCx = isCopyable ? `${middleCx} ${copyCx} relative` : middleCx;
|
|
515
|
+
const cx = isCopied ? `${baseCx} text-transparent` : baseCx;
|
|
516
|
+
return /* @__PURE__ */ jsx5(Tooltip, { content: isTruncated ? text : null, children: /* @__PURE__ */ jsxs4(
|
|
517
|
+
"span",
|
|
518
|
+
{
|
|
519
|
+
ref,
|
|
520
|
+
className: cx,
|
|
521
|
+
"aria-label": isTruncated ? text : void 0,
|
|
522
|
+
onScroll: pinScroll,
|
|
523
|
+
onClick: isCopyable ? handleClick : void 0,
|
|
524
|
+
onKeyDown: isCopyable ? handleCopyKeyDown(handleClick) : void 0,
|
|
525
|
+
role: isCopyable ? "button" : void 0,
|
|
526
|
+
tabIndex: isCopyable ? 0 : void 0,
|
|
527
|
+
children: [
|
|
528
|
+
displayed,
|
|
529
|
+
isCopied && /* @__PURE__ */ jsx5(CopiedOverlay, {})
|
|
530
|
+
]
|
|
531
|
+
}
|
|
532
|
+
) });
|
|
533
|
+
};
|
|
534
|
+
var TruncatedText = ({ children, ellipsis = "right", copyValue }) => {
|
|
535
|
+
if (ellipsis === "left") return /* @__PURE__ */ jsx5(LeftEllipsis, { copyValue, children });
|
|
536
|
+
if (ellipsis === "middle" && typeof children === "string")
|
|
537
|
+
return /* @__PURE__ */ jsx5(MiddleEllipsisString, { text: children, copyValue });
|
|
538
|
+
return /* @__PURE__ */ jsx5(RightEllipsis, { copyValue, children });
|
|
539
|
+
};
|
|
540
|
+
|
|
252
541
|
// src/components/IconButton/IconButton.tsx
|
|
253
542
|
import {
|
|
254
543
|
Button as AriaButton2
|
|
255
544
|
} from "react-aria-components";
|
|
256
|
-
import { jsx as
|
|
545
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
257
546
|
var squareSizeStyles = {
|
|
547
|
+
xs: "h-7 w-7",
|
|
258
548
|
sm: "h-8 w-8",
|
|
259
549
|
md: "h-10 w-10",
|
|
260
550
|
lg: "h-12 w-12"
|
|
261
551
|
};
|
|
262
552
|
var squareWidthOnly = {
|
|
553
|
+
xs: "w-7",
|
|
263
554
|
sm: "w-8",
|
|
264
555
|
md: "w-10",
|
|
265
556
|
lg: "w-12"
|
|
266
557
|
};
|
|
267
558
|
var iconSizeMap2 = {
|
|
559
|
+
xs: "sm",
|
|
268
560
|
sm: "sm",
|
|
269
561
|
md: "sm",
|
|
270
562
|
lg: "md"
|
|
@@ -272,11 +564,11 @@ var iconSizeMap2 = {
|
|
|
272
564
|
function groupRadiusClass2(position) {
|
|
273
565
|
switch (position) {
|
|
274
566
|
case "start":
|
|
275
|
-
return "rounded-l-
|
|
567
|
+
return "rounded-l-md rounded-r-none";
|
|
276
568
|
case "middle":
|
|
277
569
|
return "rounded-none";
|
|
278
570
|
case "end":
|
|
279
|
-
return "rounded-r-
|
|
571
|
+
return "rounded-r-md rounded-l-none";
|
|
280
572
|
default:
|
|
281
573
|
return "rounded-md";
|
|
282
574
|
}
|
|
@@ -287,7 +579,6 @@ function IconButton({
|
|
|
287
579
|
variant = "ghost",
|
|
288
580
|
size = "md",
|
|
289
581
|
showTooltip = true,
|
|
290
|
-
tooltipPlacement = "top",
|
|
291
582
|
isLoading = false,
|
|
292
583
|
isDisabled,
|
|
293
584
|
className,
|
|
@@ -298,14 +589,14 @@ function IconButton({
|
|
|
298
589
|
const radiusClass = inGroup ? groupRadiusClass2(position) : "rounded-md";
|
|
299
590
|
const marginClass = inGroup && position !== "start" && position !== "standalone" ? "-ml-px" : "";
|
|
300
591
|
const focusRing = inGroup ? "focus-visible:ring-2 focus-visible:ring-(--color-border-focus) focus-visible:ring-offset-0 focus-visible:z-10" : "focus-visible:ring-2 focus-visible:ring-(--color-border-focus) focus-visible:ring-offset-2";
|
|
301
|
-
const button = /* @__PURE__ */
|
|
592
|
+
const button = /* @__PURE__ */ jsx6(
|
|
302
593
|
AriaButton2,
|
|
303
594
|
{
|
|
304
595
|
...props,
|
|
305
596
|
"aria-label": ariaLabel,
|
|
306
597
|
isDisabled: isDisabled || isLoading,
|
|
307
598
|
className: [
|
|
308
|
-
"inline-flex items-center justify-center shrink-0",
|
|
599
|
+
"inline-flex items-center justify-center shrink-0 cursor-pointer",
|
|
309
600
|
radiusClass,
|
|
310
601
|
"outline-none transition-colors",
|
|
311
602
|
focusRing,
|
|
@@ -316,11 +607,11 @@ function IconButton({
|
|
|
316
607
|
marginClass,
|
|
317
608
|
className
|
|
318
609
|
].filter(Boolean).join(" "),
|
|
319
|
-
children: isLoading ? /* @__PURE__ */
|
|
610
|
+
children: isLoading ? /* @__PURE__ */ jsx6(Spinner, { size: iconSizeMap2[size] }) : /* @__PURE__ */ jsx6(Icon, { icon, size: iconSizeMap2[size] })
|
|
320
611
|
}
|
|
321
612
|
);
|
|
322
613
|
if (showTooltip) {
|
|
323
|
-
return /* @__PURE__ */
|
|
614
|
+
return /* @__PURE__ */ jsx6(Tooltip, { content: ariaLabel, children: button });
|
|
324
615
|
}
|
|
325
616
|
return button;
|
|
326
617
|
}
|
|
@@ -337,9 +628,9 @@ import { twMerge as twMerge2 } from "tailwind-merge";
|
|
|
337
628
|
import {
|
|
338
629
|
Label as AriaLabel
|
|
339
630
|
} from "react-aria-components";
|
|
340
|
-
import { jsx as
|
|
631
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
341
632
|
function Label({ isRequired, children, className, ...props }) {
|
|
342
|
-
return /* @__PURE__ */
|
|
633
|
+
return /* @__PURE__ */ jsxs5(
|
|
343
634
|
AriaLabel,
|
|
344
635
|
{
|
|
345
636
|
...props,
|
|
@@ -351,7 +642,7 @@ function Label({ isRequired, children, className, ...props }) {
|
|
|
351
642
|
].filter(Boolean).join(" "),
|
|
352
643
|
children: [
|
|
353
644
|
children,
|
|
354
|
-
isRequired && /* @__PURE__ */
|
|
645
|
+
isRequired && /* @__PURE__ */ jsx7(
|
|
355
646
|
"span",
|
|
356
647
|
{
|
|
357
648
|
"aria-hidden": "true",
|
|
@@ -365,7 +656,7 @@ function Label({ isRequired, children, className, ...props }) {
|
|
|
365
656
|
}
|
|
366
657
|
|
|
367
658
|
// src/components/Form/Input/Input.tsx
|
|
368
|
-
import { jsx as
|
|
659
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
369
660
|
var alignClasses = {
|
|
370
661
|
left: "text-left",
|
|
371
662
|
center: "text-center",
|
|
@@ -404,7 +695,7 @@ function Input({
|
|
|
404
695
|
const borderColor = isInvalid ? "border-(--color-border-danger)" : "border-(--color-border-default) hover:border-(--color-border-strong)";
|
|
405
696
|
const radiusClass = inGroup ? groupRadiusClasses(position) : "rounded-md";
|
|
406
697
|
const marginClass = inGroup && position !== "start" && position !== "standalone" ? "-ml-px" : "";
|
|
407
|
-
return /* @__PURE__ */
|
|
698
|
+
return /* @__PURE__ */ jsxs6(
|
|
408
699
|
Field,
|
|
409
700
|
{
|
|
410
701
|
...props,
|
|
@@ -419,8 +710,8 @@ function Input({
|
|
|
419
710
|
className
|
|
420
711
|
),
|
|
421
712
|
children: [
|
|
422
|
-
label && /* @__PURE__ */
|
|
423
|
-
prefix ? /* @__PURE__ */
|
|
713
|
+
label && /* @__PURE__ */ jsx8(Label, { isRequired, children: label }),
|
|
714
|
+
prefix ? /* @__PURE__ */ jsxs6(
|
|
424
715
|
"div",
|
|
425
716
|
{
|
|
426
717
|
className: twMerge2(
|
|
@@ -435,7 +726,7 @@ function Input({
|
|
|
435
726
|
isDisabled && "opacity-50 pointer-events-none"
|
|
436
727
|
),
|
|
437
728
|
children: [
|
|
438
|
-
/* @__PURE__ */
|
|
729
|
+
/* @__PURE__ */ jsx8(
|
|
439
730
|
"span",
|
|
440
731
|
{
|
|
441
732
|
className: twMerge2(
|
|
@@ -448,7 +739,7 @@ function Input({
|
|
|
448
739
|
children: prefix
|
|
449
740
|
}
|
|
450
741
|
),
|
|
451
|
-
/* @__PURE__ */
|
|
742
|
+
/* @__PURE__ */ jsx8(
|
|
452
743
|
AriaInput,
|
|
453
744
|
{
|
|
454
745
|
placeholder,
|
|
@@ -464,7 +755,7 @@ function Input({
|
|
|
464
755
|
)
|
|
465
756
|
]
|
|
466
757
|
}
|
|
467
|
-
) : /* @__PURE__ */
|
|
758
|
+
) : /* @__PURE__ */ jsx8(
|
|
468
759
|
AriaInput,
|
|
469
760
|
{
|
|
470
761
|
placeholder,
|
|
@@ -485,7 +776,7 @@ function Input({
|
|
|
485
776
|
)
|
|
486
777
|
}
|
|
487
778
|
),
|
|
488
|
-
description && /* @__PURE__ */
|
|
779
|
+
description && /* @__PURE__ */ jsx8(
|
|
489
780
|
Text,
|
|
490
781
|
{
|
|
491
782
|
slot: "description",
|
|
@@ -493,7 +784,7 @@ function Input({
|
|
|
493
784
|
children: description
|
|
494
785
|
}
|
|
495
786
|
),
|
|
496
|
-
isInvalid && /* @__PURE__ */
|
|
787
|
+
isInvalid && /* @__PURE__ */ jsx8(
|
|
497
788
|
Text,
|
|
498
789
|
{
|
|
499
790
|
slot: "errorMessage",
|
|
@@ -519,7 +810,7 @@ import {
|
|
|
519
810
|
Text as Text2
|
|
520
811
|
} from "react-aria-components";
|
|
521
812
|
import { twMerge as twMerge3 } from "tailwind-merge";
|
|
522
|
-
import { Fragment, jsx as
|
|
813
|
+
import { Fragment, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
523
814
|
function Select({
|
|
524
815
|
label,
|
|
525
816
|
items,
|
|
@@ -534,7 +825,7 @@ function Select({
|
|
|
534
825
|
...props
|
|
535
826
|
}) {
|
|
536
827
|
const hasError = Boolean(errorMessage);
|
|
537
|
-
return /* @__PURE__ */
|
|
828
|
+
return /* @__PURE__ */ jsxs7(
|
|
538
829
|
AriaSelect,
|
|
539
830
|
{
|
|
540
831
|
...props,
|
|
@@ -543,8 +834,8 @@ function Select({
|
|
|
543
834
|
isInvalid: hasError,
|
|
544
835
|
className: twMerge3("flex flex-col gap-1", className),
|
|
545
836
|
children: [
|
|
546
|
-
label && /* @__PURE__ */
|
|
547
|
-
/* @__PURE__ */
|
|
837
|
+
label && /* @__PURE__ */ jsx9(Label, { isRequired, children: label }),
|
|
838
|
+
/* @__PURE__ */ jsxs7(
|
|
548
839
|
Button2,
|
|
549
840
|
{
|
|
550
841
|
"aria-required": isRequired || void 0,
|
|
@@ -562,7 +853,7 @@ function Select({
|
|
|
562
853
|
hasError ? "border-(--color-border-danger)" : "border-(--color-border-default)"
|
|
563
854
|
),
|
|
564
855
|
children: [
|
|
565
|
-
/* @__PURE__ */
|
|
856
|
+
/* @__PURE__ */ jsx9(
|
|
566
857
|
SelectValue,
|
|
567
858
|
{
|
|
568
859
|
className: twMerge3(
|
|
@@ -576,7 +867,7 @@ function Select({
|
|
|
576
867
|
}
|
|
577
868
|
}
|
|
578
869
|
),
|
|
579
|
-
/* @__PURE__ */
|
|
870
|
+
/* @__PURE__ */ jsx9(
|
|
580
871
|
ChevronDown,
|
|
581
872
|
{
|
|
582
873
|
"aria-hidden": true,
|
|
@@ -589,8 +880,8 @@ function Select({
|
|
|
589
880
|
]
|
|
590
881
|
}
|
|
591
882
|
),
|
|
592
|
-
description && /* @__PURE__ */
|
|
593
|
-
hasError && /* @__PURE__ */
|
|
883
|
+
description && /* @__PURE__ */ jsx9(Text2, { slot: "description", className: "text-sm text-(--color-text-secondary)", children: description }),
|
|
884
|
+
hasError && /* @__PURE__ */ jsx9(
|
|
594
885
|
Text2,
|
|
595
886
|
{
|
|
596
887
|
slot: "errorMessage",
|
|
@@ -599,7 +890,7 @@ function Select({
|
|
|
599
890
|
children: errorMessage
|
|
600
891
|
}
|
|
601
892
|
),
|
|
602
|
-
/* @__PURE__ */
|
|
893
|
+
/* @__PURE__ */ jsx9(
|
|
603
894
|
Popover,
|
|
604
895
|
{
|
|
605
896
|
className: twMerge3(
|
|
@@ -612,7 +903,7 @@ function Select({
|
|
|
612
903
|
"entering:animate-in entering:fade-in",
|
|
613
904
|
"exiting:animate-out exiting:fade-out"
|
|
614
905
|
),
|
|
615
|
-
children: /* @__PURE__ */
|
|
906
|
+
children: /* @__PURE__ */ jsx9(ListBox, { className: "p-1 outline-none", items, children: (item) => /* @__PURE__ */ jsx9(
|
|
616
907
|
ListBoxItem,
|
|
617
908
|
{
|
|
618
909
|
id: item.id,
|
|
@@ -629,9 +920,9 @@ function Select({
|
|
|
629
920
|
`,
|
|
630
921
|
sizeStyles[size]
|
|
631
922
|
),
|
|
632
|
-
children: ({ isSelected }) => /* @__PURE__ */
|
|
633
|
-
/* @__PURE__ */
|
|
634
|
-
isSelected && /* @__PURE__ */
|
|
923
|
+
children: ({ isSelected }) => /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
924
|
+
/* @__PURE__ */ jsx9("span", { className: renderItem ? "min-w-0 flex-1" : "truncate", children: renderItem ? renderItem(item) : item.name }),
|
|
925
|
+
isSelected && /* @__PURE__ */ jsx9(Check, { className: "h-4 w-4 shrink-0 text-(--color-action-primary)" })
|
|
635
926
|
] })
|
|
636
927
|
}
|
|
637
928
|
) })
|
|
@@ -651,13 +942,13 @@ import {
|
|
|
651
942
|
TableBody as AriaTableBody,
|
|
652
943
|
TableHeader as AriaTableHeader
|
|
653
944
|
} from "react-aria-components";
|
|
654
|
-
import { jsx as
|
|
945
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
655
946
|
var tableSizeClass = {
|
|
656
947
|
compact: "[--table-row-py:theme(spacing.1)]",
|
|
657
948
|
comfortable: "[--table-row-py:theme(spacing.3)]"
|
|
658
949
|
};
|
|
659
950
|
function Table({ size = "comfortable", className, ...props }) {
|
|
660
|
-
return /* @__PURE__ */
|
|
951
|
+
return /* @__PURE__ */ jsx10(
|
|
661
952
|
AriaTable,
|
|
662
953
|
{
|
|
663
954
|
...props,
|
|
@@ -670,10 +961,10 @@ function Table({ size = "comfortable", className, ...props }) {
|
|
|
670
961
|
);
|
|
671
962
|
}
|
|
672
963
|
function TableHeader(props) {
|
|
673
|
-
return /* @__PURE__ */
|
|
964
|
+
return /* @__PURE__ */ jsx10(AriaTableHeader, { ...props });
|
|
674
965
|
}
|
|
675
966
|
function Column(props) {
|
|
676
|
-
return /* @__PURE__ */
|
|
967
|
+
return /* @__PURE__ */ jsx10(
|
|
677
968
|
AriaColumn,
|
|
678
969
|
{
|
|
679
970
|
...props,
|
|
@@ -683,18 +974,18 @@ function Column(props) {
|
|
|
683
974
|
"cursor-default select-none outline-none",
|
|
684
975
|
"focus-visible:outline-2 focus-visible:outline-(--color-border-focus) focus-visible:outline-offset-[-2px]"
|
|
685
976
|
].join(" "),
|
|
686
|
-
children: ({ allowsSorting, sortDirection }) => /* @__PURE__ */
|
|
977
|
+
children: ({ allowsSorting, sortDirection }) => /* @__PURE__ */ jsxs8("span", { className: "inline-flex items-center gap-1", children: [
|
|
687
978
|
props.children,
|
|
688
|
-
allowsSorting && /* @__PURE__ */
|
|
979
|
+
allowsSorting && /* @__PURE__ */ jsx10("span", { "aria-hidden": "true", className: "text-(--color-text-tertiary)", children: sortDirection === "ascending" ? "\u25B2" : sortDirection === "descending" ? "\u25BC" : "\u25B4" })
|
|
689
980
|
] })
|
|
690
981
|
}
|
|
691
982
|
);
|
|
692
983
|
}
|
|
693
984
|
function TableBody(props) {
|
|
694
|
-
return /* @__PURE__ */
|
|
985
|
+
return /* @__PURE__ */ jsx10(AriaTableBody, { ...props });
|
|
695
986
|
}
|
|
696
987
|
function Row(props) {
|
|
697
|
-
return /* @__PURE__ */
|
|
988
|
+
return /* @__PURE__ */ jsx10(
|
|
698
989
|
AriaRow,
|
|
699
990
|
{
|
|
700
991
|
...props,
|
|
@@ -710,7 +1001,7 @@ function Row(props) {
|
|
|
710
1001
|
);
|
|
711
1002
|
}
|
|
712
1003
|
function Cell(props) {
|
|
713
|
-
return /* @__PURE__ */
|
|
1004
|
+
return /* @__PURE__ */ jsx10(
|
|
714
1005
|
AriaCell,
|
|
715
1006
|
{
|
|
716
1007
|
...props,
|
|
@@ -732,7 +1023,7 @@ import {
|
|
|
732
1023
|
Heading
|
|
733
1024
|
} from "react-aria-components";
|
|
734
1025
|
import { X } from "lucide-react";
|
|
735
|
-
import { Fragment as Fragment2, jsx as
|
|
1026
|
+
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
736
1027
|
var sizeStyles2 = {
|
|
737
1028
|
sm: "max-w-md",
|
|
738
1029
|
md: "max-w-lg",
|
|
@@ -748,7 +1039,7 @@ function Dialog({
|
|
|
748
1039
|
children,
|
|
749
1040
|
className
|
|
750
1041
|
}) {
|
|
751
|
-
return /* @__PURE__ */
|
|
1042
|
+
return /* @__PURE__ */ jsx11(
|
|
752
1043
|
ModalOverlay,
|
|
753
1044
|
{
|
|
754
1045
|
isOpen,
|
|
@@ -760,7 +1051,7 @@ function Dialog({
|
|
|
760
1051
|
"data-[entering]:animate-in data-[entering]:fade-in",
|
|
761
1052
|
"data-[exiting]:animate-out data-[exiting]:fade-out"
|
|
762
1053
|
].join(" "),
|
|
763
|
-
children: /* @__PURE__ */
|
|
1054
|
+
children: /* @__PURE__ */ jsx11(
|
|
764
1055
|
Modal,
|
|
765
1056
|
{
|
|
766
1057
|
className: [
|
|
@@ -771,9 +1062,9 @@ function Dialog({
|
|
|
771
1062
|
"data-[exiting]:animate-out data-[exiting]:zoom-out-95 data-[exiting]:fade-out",
|
|
772
1063
|
className
|
|
773
1064
|
].filter(Boolean).join(" "),
|
|
774
|
-
children: /* @__PURE__ */
|
|
775
|
-
/* @__PURE__ */
|
|
776
|
-
/* @__PURE__ */
|
|
1065
|
+
children: /* @__PURE__ */ jsx11(AriaDialog, { className: "outline-none flex flex-col max-h-[85vh]", children: ({ close }) => /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1066
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center justify-between px-6 py-4 border-b border-(--color-border-default)", children: [
|
|
1067
|
+
/* @__PURE__ */ jsx11(
|
|
777
1068
|
Heading,
|
|
778
1069
|
{
|
|
779
1070
|
slot: "title",
|
|
@@ -781,7 +1072,7 @@ function Dialog({
|
|
|
781
1072
|
children: title
|
|
782
1073
|
}
|
|
783
1074
|
),
|
|
784
|
-
/* @__PURE__ */
|
|
1075
|
+
/* @__PURE__ */ jsx11(
|
|
785
1076
|
"button",
|
|
786
1077
|
{
|
|
787
1078
|
type: "button",
|
|
@@ -793,11 +1084,11 @@ function Dialog({
|
|
|
793
1084
|
"transition-colors"
|
|
794
1085
|
].join(" "),
|
|
795
1086
|
"aria-label": "Close",
|
|
796
|
-
children: /* @__PURE__ */
|
|
1087
|
+
children: /* @__PURE__ */ jsx11(X, { size: 20, "aria-hidden": "true" })
|
|
797
1088
|
}
|
|
798
1089
|
)
|
|
799
1090
|
] }),
|
|
800
|
-
/* @__PURE__ */
|
|
1091
|
+
/* @__PURE__ */ jsx11("div", { className: "px-6 py-4 overflow-y-auto", children })
|
|
801
1092
|
] }) })
|
|
802
1093
|
}
|
|
803
1094
|
)
|
|
@@ -806,20 +1097,20 @@ function Dialog({
|
|
|
806
1097
|
}
|
|
807
1098
|
|
|
808
1099
|
// src/components/Dialog/DialogFooter.tsx
|
|
809
|
-
import { jsx as
|
|
1100
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
810
1101
|
|
|
811
1102
|
// src/components/Toast/Toast.tsx
|
|
812
1103
|
import {
|
|
813
1104
|
createContext as createContext2,
|
|
814
|
-
useCallback,
|
|
1105
|
+
useCallback as useCallback2,
|
|
815
1106
|
useContext as useContext2,
|
|
816
|
-
useEffect,
|
|
817
|
-
useRef,
|
|
818
|
-
useState
|
|
1107
|
+
useEffect as useEffect2,
|
|
1108
|
+
useRef as useRef4,
|
|
1109
|
+
useState as useState5
|
|
819
1110
|
} from "react";
|
|
820
|
-
import { createPortal } from "react-dom";
|
|
1111
|
+
import { createPortal as createPortal2 } from "react-dom";
|
|
821
1112
|
import { CheckCircle, XCircle, Info, X as X2 } from "lucide-react";
|
|
822
|
-
import { jsx as
|
|
1113
|
+
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
823
1114
|
var ToastContext = createContext2(null);
|
|
824
1115
|
var toastCounter = 0;
|
|
825
1116
|
var defaultDuration = {
|
|
@@ -861,23 +1152,23 @@ function ToastItem({
|
|
|
861
1152
|
toast,
|
|
862
1153
|
onRemove
|
|
863
1154
|
}) {
|
|
864
|
-
const [isExiting, setIsExiting] =
|
|
865
|
-
const timerRef =
|
|
1155
|
+
const [isExiting, setIsExiting] = useState5(false);
|
|
1156
|
+
const timerRef = useRef4(null);
|
|
866
1157
|
const placement = useContext2(PlacementContext);
|
|
867
1158
|
const config = variantConfig[toast.variant];
|
|
868
1159
|
const IconComponent = config.icon;
|
|
869
|
-
const dismiss =
|
|
1160
|
+
const dismiss = useCallback2(() => {
|
|
870
1161
|
setIsExiting(true);
|
|
871
1162
|
setTimeout(() => onRemove(toast.id), 200);
|
|
872
1163
|
}, [onRemove, toast.id]);
|
|
873
|
-
|
|
1164
|
+
useEffect2(() => {
|
|
874
1165
|
const duration = toast.duration ?? defaultDuration[toast.variant];
|
|
875
1166
|
timerRef.current = setTimeout(dismiss, duration);
|
|
876
1167
|
return () => {
|
|
877
1168
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
878
1169
|
};
|
|
879
1170
|
}, [toast.duration, toast.variant, dismiss]);
|
|
880
|
-
return /* @__PURE__ */
|
|
1171
|
+
return /* @__PURE__ */ jsxs10(
|
|
881
1172
|
"div",
|
|
882
1173
|
{
|
|
883
1174
|
role: "status",
|
|
@@ -890,16 +1181,16 @@ function ToastItem({
|
|
|
890
1181
|
config.containerClass
|
|
891
1182
|
].join(" "),
|
|
892
1183
|
children: [
|
|
893
|
-
/* @__PURE__ */
|
|
894
|
-
/* @__PURE__ */
|
|
895
|
-
/* @__PURE__ */
|
|
1184
|
+
/* @__PURE__ */ jsx13(IconComponent, { size: 20, className: ["shrink-0 mt-0.5", config.iconClass].join(" "), "aria-hidden": "true" }),
|
|
1185
|
+
/* @__PURE__ */ jsx13("p", { className: "flex-1 text-sm font-medium", children: toast.message }),
|
|
1186
|
+
/* @__PURE__ */ jsx13(
|
|
896
1187
|
"button",
|
|
897
1188
|
{
|
|
898
1189
|
type: "button",
|
|
899
1190
|
onClick: dismiss,
|
|
900
1191
|
className: "shrink-0 rounded-sm p-0.5 opacity-70 hover:opacity-100 transition-opacity outline-none focus-visible:ring-2 focus-visible:ring-current",
|
|
901
1192
|
"aria-label": "Dismiss",
|
|
902
|
-
children: /* @__PURE__ */
|
|
1193
|
+
children: /* @__PURE__ */ jsx13(X2, { size: 16, "aria-hidden": "true" })
|
|
903
1194
|
}
|
|
904
1195
|
)
|
|
905
1196
|
]
|
|
@@ -918,8 +1209,8 @@ function ToastContainer({
|
|
|
918
1209
|
placement = "bottom-right"
|
|
919
1210
|
}) {
|
|
920
1211
|
if (toasts.length === 0) return null;
|
|
921
|
-
return
|
|
922
|
-
/* @__PURE__ */
|
|
1212
|
+
return createPortal2(
|
|
1213
|
+
/* @__PURE__ */ jsx13(PlacementContext.Provider, { value: placement, children: /* @__PURE__ */ jsx13("div", { className: containerPositionStyles[placement], children: toasts.map((toast) => /* @__PURE__ */ jsx13(ToastItem, { toast, onRemove: removeToast }, toast.id)) }) }),
|
|
923
1214
|
document.body
|
|
924
1215
|
);
|
|
925
1216
|
}
|
|
@@ -938,21 +1229,21 @@ function createToastBridge() {
|
|
|
938
1229
|
};
|
|
939
1230
|
}
|
|
940
1231
|
function ToastProvider({ children, bridge, placement = "bottom-right" }) {
|
|
941
|
-
const [toasts, setToasts] =
|
|
942
|
-
const addToast =
|
|
1232
|
+
const [toasts, setToasts] = useState5([]);
|
|
1233
|
+
const addToast = useCallback2((toast) => {
|
|
943
1234
|
const id = `toast-${++toastCounter}`;
|
|
944
1235
|
setToasts((prev) => [...prev, { ...toast, id }]);
|
|
945
1236
|
}, []);
|
|
946
|
-
const removeToast =
|
|
1237
|
+
const removeToast = useCallback2((id) => {
|
|
947
1238
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
948
1239
|
}, []);
|
|
949
|
-
|
|
1240
|
+
useEffect2(() => {
|
|
950
1241
|
if (!bridge) return;
|
|
951
1242
|
return bridge.subscribe(addToast);
|
|
952
1243
|
}, [bridge, addToast]);
|
|
953
|
-
return /* @__PURE__ */
|
|
1244
|
+
return /* @__PURE__ */ jsxs10(ToastContext.Provider, { value: { toasts, addToast, removeToast }, children: [
|
|
954
1245
|
children,
|
|
955
|
-
/* @__PURE__ */
|
|
1246
|
+
/* @__PURE__ */ jsx13(ToastContainer, { toasts, removeToast, placement })
|
|
956
1247
|
] });
|
|
957
1248
|
}
|
|
958
1249
|
function useToast() {
|
|
@@ -968,7 +1259,7 @@ function useToast() {
|
|
|
968
1259
|
}
|
|
969
1260
|
|
|
970
1261
|
// src/components/EmptyState/EmptyState.tsx
|
|
971
|
-
import { jsx as
|
|
1262
|
+
import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
972
1263
|
function EmptyState({
|
|
973
1264
|
icon,
|
|
974
1265
|
title,
|
|
@@ -976,7 +1267,7 @@ function EmptyState({
|
|
|
976
1267
|
action,
|
|
977
1268
|
className
|
|
978
1269
|
}) {
|
|
979
|
-
return /* @__PURE__ */
|
|
1270
|
+
return /* @__PURE__ */ jsxs11(
|
|
980
1271
|
"div",
|
|
981
1272
|
{
|
|
982
1273
|
className: [
|
|
@@ -984,10 +1275,10 @@ function EmptyState({
|
|
|
984
1275
|
className
|
|
985
1276
|
].filter(Boolean).join(" "),
|
|
986
1277
|
children: [
|
|
987
|
-
icon && /* @__PURE__ */
|
|
988
|
-
/* @__PURE__ */
|
|
989
|
-
description && /* @__PURE__ */
|
|
990
|
-
action && /* @__PURE__ */
|
|
1278
|
+
icon && /* @__PURE__ */ jsx14(Icon, { icon, size: "xl", className: "text-(--color-text-tertiary)" }),
|
|
1279
|
+
/* @__PURE__ */ jsx14("h3", { className: "text-lg font-semibold text-(--color-text-primary) mt-4", children: title }),
|
|
1280
|
+
description && /* @__PURE__ */ jsx14("p", { className: "text-sm text-(--color-text-secondary) mt-2 max-w-sm", children: description }),
|
|
1281
|
+
action && /* @__PURE__ */ jsx14("div", { className: "mt-6", children: action })
|
|
991
1282
|
]
|
|
992
1283
|
}
|
|
993
1284
|
);
|
|
@@ -998,9 +1289,9 @@ import {
|
|
|
998
1289
|
Checkbox as AriaCheckbox
|
|
999
1290
|
} from "react-aria-components";
|
|
1000
1291
|
import { Check as Check2 } from "lucide-react";
|
|
1001
|
-
import { Fragment as Fragment3, jsx as
|
|
1292
|
+
import { Fragment as Fragment3, jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1002
1293
|
function Checkbox({ children, className, ...props }) {
|
|
1003
|
-
return /* @__PURE__ */
|
|
1294
|
+
return /* @__PURE__ */ jsx15(
|
|
1004
1295
|
AriaCheckbox,
|
|
1005
1296
|
{
|
|
1006
1297
|
...props,
|
|
@@ -1009,8 +1300,8 @@ function Checkbox({ children, className, ...props }) {
|
|
|
1009
1300
|
"disabled:opacity-50 disabled:cursor-default",
|
|
1010
1301
|
className
|
|
1011
1302
|
].filter(Boolean).join(" "),
|
|
1012
|
-
children: ({ isSelected, isIndeterminate }) => /* @__PURE__ */
|
|
1013
|
-
/* @__PURE__ */
|
|
1303
|
+
children: ({ isSelected, isIndeterminate }) => /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
1304
|
+
/* @__PURE__ */ jsxs12(
|
|
1014
1305
|
"div",
|
|
1015
1306
|
{
|
|
1016
1307
|
className: [
|
|
@@ -1020,12 +1311,12 @@ function Checkbox({ children, className, ...props }) {
|
|
|
1020
1311
|
isSelected || isIndeterminate ? "bg-(--color-action-primary) border-(--color-action-primary)" : "bg-(--color-surface-default) border-(--color-border-default) group-hover:border-(--color-border-strong)"
|
|
1021
1312
|
].join(" "),
|
|
1022
1313
|
children: [
|
|
1023
|
-
isSelected && /* @__PURE__ */
|
|
1024
|
-
isIndeterminate && /* @__PURE__ */
|
|
1314
|
+
isSelected && /* @__PURE__ */ jsx15(Check2, { className: "w-4 h-4 text-(--color-text-inverse)", strokeWidth: 3 }),
|
|
1315
|
+
isIndeterminate && /* @__PURE__ */ jsx15("div", { className: "w-3 h-0.5 bg-(--color-text-inverse) rounded-full" })
|
|
1025
1316
|
]
|
|
1026
1317
|
}
|
|
1027
1318
|
),
|
|
1028
|
-
children && /* @__PURE__ */
|
|
1319
|
+
children && /* @__PURE__ */ jsx15("span", { children })
|
|
1029
1320
|
] })
|
|
1030
1321
|
}
|
|
1031
1322
|
);
|
|
@@ -1035,7 +1326,7 @@ function Checkbox({ children, className, ...props }) {
|
|
|
1035
1326
|
import {
|
|
1036
1327
|
Switch as AriaSwitch
|
|
1037
1328
|
} from "react-aria-components";
|
|
1038
|
-
import { Fragment as Fragment4, jsx as
|
|
1329
|
+
import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1039
1330
|
var trackColorMap = {
|
|
1040
1331
|
primary: "bg-(--color-action-primary)",
|
|
1041
1332
|
success: "bg-(--color-action-success)",
|
|
@@ -1052,7 +1343,7 @@ function Switch({
|
|
|
1052
1343
|
...props
|
|
1053
1344
|
}) {
|
|
1054
1345
|
const isPreset = isPresetColor(color);
|
|
1055
|
-
return /* @__PURE__ */
|
|
1346
|
+
return /* @__PURE__ */ jsx16(
|
|
1056
1347
|
AriaSwitch,
|
|
1057
1348
|
{
|
|
1058
1349
|
...props,
|
|
@@ -1061,8 +1352,8 @@ function Switch({
|
|
|
1061
1352
|
"disabled:opacity-50 disabled:cursor-default",
|
|
1062
1353
|
className
|
|
1063
1354
|
].filter(Boolean).join(" "),
|
|
1064
|
-
children: ({ isSelected }) => /* @__PURE__ */
|
|
1065
|
-
/* @__PURE__ */
|
|
1355
|
+
children: ({ isSelected }) => /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
1356
|
+
/* @__PURE__ */ jsx16(
|
|
1066
1357
|
"div",
|
|
1067
1358
|
{
|
|
1068
1359
|
className: [
|
|
@@ -1071,7 +1362,7 @@ function Switch({
|
|
|
1071
1362
|
isSelected && isPreset ? trackColorMap[color] : !isSelected ? "bg-(--color-border-strong)" : ""
|
|
1072
1363
|
].join(" "),
|
|
1073
1364
|
style: isSelected && !isPreset ? { backgroundColor: color } : void 0,
|
|
1074
|
-
children: /* @__PURE__ */
|
|
1365
|
+
children: /* @__PURE__ */ jsx16(
|
|
1075
1366
|
"div",
|
|
1076
1367
|
{
|
|
1077
1368
|
className: [
|
|
@@ -1082,7 +1373,7 @@ function Switch({
|
|
|
1082
1373
|
)
|
|
1083
1374
|
}
|
|
1084
1375
|
),
|
|
1085
|
-
children && /* @__PURE__ */
|
|
1376
|
+
children && /* @__PURE__ */ jsx16("span", { children })
|
|
1086
1377
|
] })
|
|
1087
1378
|
}
|
|
1088
1379
|
);
|
|
@@ -1093,9 +1384,9 @@ import {
|
|
|
1093
1384
|
RadioGroup as AriaRadioGroup,
|
|
1094
1385
|
Radio as AriaRadio
|
|
1095
1386
|
} from "react-aria-components";
|
|
1096
|
-
import { Fragment as Fragment5, jsx as
|
|
1387
|
+
import { Fragment as Fragment5, jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1097
1388
|
function RadioGroup({ children, className, ...props }) {
|
|
1098
|
-
return /* @__PURE__ */
|
|
1389
|
+
return /* @__PURE__ */ jsx17(
|
|
1099
1390
|
AriaRadioGroup,
|
|
1100
1391
|
{
|
|
1101
1392
|
...props,
|
|
@@ -1109,7 +1400,7 @@ function RadioGroup({ children, className, ...props }) {
|
|
|
1109
1400
|
);
|
|
1110
1401
|
}
|
|
1111
1402
|
function Radio({ children, className, ...props }) {
|
|
1112
|
-
return /* @__PURE__ */
|
|
1403
|
+
return /* @__PURE__ */ jsx17(
|
|
1113
1404
|
AriaRadio,
|
|
1114
1405
|
{
|
|
1115
1406
|
...props,
|
|
@@ -1118,8 +1409,8 @@ function Radio({ children, className, ...props }) {
|
|
|
1118
1409
|
"disabled:opacity-50 disabled:cursor-default",
|
|
1119
1410
|
className
|
|
1120
1411
|
].filter(Boolean).join(" "),
|
|
1121
|
-
children: ({ isSelected }) => /* @__PURE__ */
|
|
1122
|
-
/* @__PURE__ */
|
|
1412
|
+
children: ({ isSelected }) => /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
1413
|
+
/* @__PURE__ */ jsx17(
|
|
1123
1414
|
"div",
|
|
1124
1415
|
{
|
|
1125
1416
|
className: [
|
|
@@ -1128,16 +1419,16 @@ function Radio({ children, className, ...props }) {
|
|
|
1128
1419
|
"group-focus-visible:ring-2 group-focus-visible:ring-(--color-border-focus) group-focus-visible:ring-offset-2",
|
|
1129
1420
|
isSelected ? "border-(--color-action-primary)" : "border-(--color-border-default) group-hover:border-(--color-border-strong)"
|
|
1130
1421
|
].join(" "),
|
|
1131
|
-
children: isSelected && /* @__PURE__ */
|
|
1422
|
+
children: isSelected && /* @__PURE__ */ jsx17("div", { className: "w-2.5 h-2.5 rounded-full bg-(--color-action-primary)" })
|
|
1132
1423
|
}
|
|
1133
1424
|
),
|
|
1134
|
-
children && /* @__PURE__ */
|
|
1425
|
+
children && /* @__PURE__ */ jsx17("span", { children })
|
|
1135
1426
|
] })
|
|
1136
1427
|
}
|
|
1137
1428
|
);
|
|
1138
1429
|
}
|
|
1139
1430
|
function RadioButton({ children, className, ...props }) {
|
|
1140
|
-
return /* @__PURE__ */
|
|
1431
|
+
return /* @__PURE__ */ jsx17(
|
|
1141
1432
|
AriaRadio,
|
|
1142
1433
|
{
|
|
1143
1434
|
...props,
|
|
@@ -1146,7 +1437,7 @@ function RadioButton({ children, className, ...props }) {
|
|
|
1146
1437
|
"disabled:opacity-50 disabled:cursor-default",
|
|
1147
1438
|
className
|
|
1148
1439
|
].filter(Boolean).join(" "),
|
|
1149
|
-
children: ({ isSelected }) => /* @__PURE__ */
|
|
1440
|
+
children: ({ isSelected }) => /* @__PURE__ */ jsx17(
|
|
1150
1441
|
"div",
|
|
1151
1442
|
{
|
|
1152
1443
|
className: [
|
|
@@ -1163,9 +1454,9 @@ function RadioButton({ children, className, ...props }) {
|
|
|
1163
1454
|
}
|
|
1164
1455
|
|
|
1165
1456
|
// src/components/Form/Fieldset/Fieldset.tsx
|
|
1166
|
-
import { jsx as
|
|
1457
|
+
import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1167
1458
|
function Fieldset({ legend, children, className }) {
|
|
1168
|
-
return /* @__PURE__ */
|
|
1459
|
+
return /* @__PURE__ */ jsxs15(
|
|
1169
1460
|
"fieldset",
|
|
1170
1461
|
{
|
|
1171
1462
|
className: [
|
|
@@ -1174,7 +1465,7 @@ function Fieldset({ legend, children, className }) {
|
|
|
1174
1465
|
className
|
|
1175
1466
|
].filter(Boolean).join(" "),
|
|
1176
1467
|
children: [
|
|
1177
|
-
legend && /* @__PURE__ */
|
|
1468
|
+
legend && /* @__PURE__ */ jsx18(
|
|
1178
1469
|
"legend",
|
|
1179
1470
|
{
|
|
1180
1471
|
className: [
|
|
@@ -1194,18 +1485,18 @@ function Fieldset({ legend, children, className }) {
|
|
|
1194
1485
|
|
|
1195
1486
|
// src/components/Form/InputGroup/InputGroup.tsx
|
|
1196
1487
|
import React from "react";
|
|
1197
|
-
import { jsx as
|
|
1488
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1198
1489
|
function InputGroup({ children, className }) {
|
|
1199
1490
|
const childArray = React.Children.toArray(children).filter(
|
|
1200
1491
|
React.isValidElement
|
|
1201
1492
|
);
|
|
1202
|
-
return /* @__PURE__ */
|
|
1493
|
+
return /* @__PURE__ */ jsx19(
|
|
1203
1494
|
"div",
|
|
1204
1495
|
{
|
|
1205
1496
|
className: ["flex items-stretch", className].filter(Boolean).join(" "),
|
|
1206
1497
|
children: childArray.map((child, index) => {
|
|
1207
1498
|
const position = childArray.length === 1 ? "standalone" : index === 0 ? "start" : index === childArray.length - 1 ? "end" : "middle";
|
|
1208
|
-
return /* @__PURE__ */
|
|
1499
|
+
return /* @__PURE__ */ jsx19(
|
|
1209
1500
|
InputGroupContext.Provider,
|
|
1210
1501
|
{
|
|
1211
1502
|
value: { inGroup: true, position },
|
|
@@ -1219,7 +1510,7 @@ function InputGroup({ children, className }) {
|
|
|
1219
1510
|
}
|
|
1220
1511
|
|
|
1221
1512
|
// src/components/Form/InputAddon/InputAddon.tsx
|
|
1222
|
-
import { jsx as
|
|
1513
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1223
1514
|
function groupRadiusClass3(position) {
|
|
1224
1515
|
switch (position) {
|
|
1225
1516
|
case "start":
|
|
@@ -1236,7 +1527,7 @@ function InputAddon({ children, className }) {
|
|
|
1236
1527
|
const { inGroup, position } = useInputGroup();
|
|
1237
1528
|
const radiusClass = inGroup ? groupRadiusClass3(position) : "rounded-md";
|
|
1238
1529
|
const marginClass = inGroup && position !== "start" && position !== "standalone" ? "-ml-px" : "";
|
|
1239
|
-
return /* @__PURE__ */
|
|
1530
|
+
return /* @__PURE__ */ jsx20(
|
|
1240
1531
|
"div",
|
|
1241
1532
|
{
|
|
1242
1533
|
className: [
|
|
@@ -1256,7 +1547,7 @@ function InputAddon({ children, className }) {
|
|
|
1256
1547
|
|
|
1257
1548
|
// src/components/Heading/Heading.tsx
|
|
1258
1549
|
import { twMerge as twMerge4 } from "tailwind-merge";
|
|
1259
|
-
import { jsx as
|
|
1550
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1260
1551
|
var defaultSizeMap = {
|
|
1261
1552
|
h1: "2xl",
|
|
1262
1553
|
h2: "xl",
|
|
@@ -1286,7 +1577,7 @@ function Heading2({
|
|
|
1286
1577
|
children
|
|
1287
1578
|
}) {
|
|
1288
1579
|
const resolvedSize = size ?? defaultSizeMap[Tag];
|
|
1289
|
-
return /* @__PURE__ */
|
|
1580
|
+
return /* @__PURE__ */ jsx21(
|
|
1290
1581
|
Tag,
|
|
1291
1582
|
{
|
|
1292
1583
|
className: twMerge4(
|
|
@@ -1300,7 +1591,7 @@ function Heading2({
|
|
|
1300
1591
|
);
|
|
1301
1592
|
}
|
|
1302
1593
|
function H1(props) {
|
|
1303
|
-
return /* @__PURE__ */
|
|
1594
|
+
return /* @__PURE__ */ jsx21(
|
|
1304
1595
|
Heading2,
|
|
1305
1596
|
{
|
|
1306
1597
|
...props,
|
|
@@ -1311,17 +1602,17 @@ function H1(props) {
|
|
|
1311
1602
|
);
|
|
1312
1603
|
}
|
|
1313
1604
|
function H2(props) {
|
|
1314
|
-
return /* @__PURE__ */
|
|
1605
|
+
return /* @__PURE__ */ jsx21(Heading2, { ...props, as: "h2", size: props.size ?? "xl" });
|
|
1315
1606
|
}
|
|
1316
1607
|
function H3(props) {
|
|
1317
|
-
return /* @__PURE__ */
|
|
1608
|
+
return /* @__PURE__ */ jsx21(Heading2, { ...props, as: "h3", size: props.size ?? "lg" });
|
|
1318
1609
|
}
|
|
1319
1610
|
|
|
1320
1611
|
// src/components/Link/Link.tsx
|
|
1321
1612
|
import {
|
|
1322
1613
|
Link as AriaLink
|
|
1323
1614
|
} from "react-aria-components";
|
|
1324
|
-
import { jsx as
|
|
1615
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1325
1616
|
var variantStyles2 = {
|
|
1326
1617
|
default: [
|
|
1327
1618
|
"text-teal-700 underline",
|
|
@@ -1337,7 +1628,7 @@ function Link({
|
|
|
1337
1628
|
className,
|
|
1338
1629
|
...props
|
|
1339
1630
|
}) {
|
|
1340
|
-
return /* @__PURE__ */
|
|
1631
|
+
return /* @__PURE__ */ jsx22(
|
|
1341
1632
|
AriaLink,
|
|
1342
1633
|
{
|
|
1343
1634
|
...props,
|
|
@@ -1358,20 +1649,20 @@ import {
|
|
|
1358
1649
|
Link as Link2
|
|
1359
1650
|
} from "react-aria-components";
|
|
1360
1651
|
import { ChevronRight } from "lucide-react";
|
|
1361
|
-
import { Fragment as Fragment6, jsx as
|
|
1652
|
+
import { Fragment as Fragment6, jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1362
1653
|
function Breadcrumbs({ items, className }) {
|
|
1363
|
-
return /* @__PURE__ */
|
|
1654
|
+
return /* @__PURE__ */ jsx23(
|
|
1364
1655
|
"nav",
|
|
1365
1656
|
{
|
|
1366
1657
|
"aria-label": "Breadcrumb",
|
|
1367
1658
|
className,
|
|
1368
|
-
children: /* @__PURE__ */
|
|
1659
|
+
children: /* @__PURE__ */ jsx23(
|
|
1369
1660
|
AriaBreadcrumbs,
|
|
1370
1661
|
{
|
|
1371
1662
|
className: "flex items-center gap-1 text-sm min-w-0",
|
|
1372
1663
|
children: items.map((item, index) => {
|
|
1373
1664
|
const isLast = index === items.length - 1;
|
|
1374
|
-
return /* @__PURE__ */
|
|
1665
|
+
return /* @__PURE__ */ jsx23(
|
|
1375
1666
|
AriaBreadcrumb,
|
|
1376
1667
|
{
|
|
1377
1668
|
id: item.id,
|
|
@@ -1379,8 +1670,8 @@ function Breadcrumbs({ items, className }) {
|
|
|
1379
1670
|
"flex items-center gap-1",
|
|
1380
1671
|
isLast ? "min-w-0" : "shrink-0"
|
|
1381
1672
|
].join(" "),
|
|
1382
|
-
children: isLast ? /* @__PURE__ */
|
|
1383
|
-
/* @__PURE__ */
|
|
1673
|
+
children: isLast ? /* @__PURE__ */ jsx23("span", { className: "font-medium text-(--color-text-primary) truncate", children: item.label }) : /* @__PURE__ */ jsxs16(Fragment6, { children: [
|
|
1674
|
+
/* @__PURE__ */ jsx23(
|
|
1384
1675
|
Link2,
|
|
1385
1676
|
{
|
|
1386
1677
|
href: item.href,
|
|
@@ -1388,7 +1679,7 @@ function Breadcrumbs({ items, className }) {
|
|
|
1388
1679
|
children: item.label
|
|
1389
1680
|
}
|
|
1390
1681
|
),
|
|
1391
|
-
/* @__PURE__ */
|
|
1682
|
+
/* @__PURE__ */ jsx23(
|
|
1392
1683
|
ChevronRight,
|
|
1393
1684
|
{
|
|
1394
1685
|
className: "shrink-0 text-neutral-400",
|
|
@@ -1412,8 +1703,9 @@ import {
|
|
|
1412
1703
|
Link as AriaLink2
|
|
1413
1704
|
} from "react-aria-components";
|
|
1414
1705
|
import { twMerge as twMerge5 } from "tailwind-merge";
|
|
1415
|
-
import { jsx as
|
|
1706
|
+
import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1416
1707
|
var iconSizeMap3 = {
|
|
1708
|
+
xs: "sm",
|
|
1417
1709
|
sm: "sm",
|
|
1418
1710
|
md: "sm",
|
|
1419
1711
|
lg: "md"
|
|
@@ -1427,12 +1719,12 @@ function ButtonLink({
|
|
|
1427
1719
|
children,
|
|
1428
1720
|
...props
|
|
1429
1721
|
}) {
|
|
1430
|
-
return /* @__PURE__ */
|
|
1722
|
+
return /* @__PURE__ */ jsxs17(
|
|
1431
1723
|
AriaLink2,
|
|
1432
1724
|
{
|
|
1433
1725
|
...props,
|
|
1434
1726
|
className: twMerge5(
|
|
1435
|
-
"inline-flex items-center justify-center gap-2",
|
|
1727
|
+
"inline-flex items-center justify-center gap-2 cursor-pointer",
|
|
1436
1728
|
"rounded-md",
|
|
1437
1729
|
"font-medium",
|
|
1438
1730
|
"leading-tight",
|
|
@@ -1443,9 +1735,9 @@ function ButtonLink({
|
|
|
1443
1735
|
className
|
|
1444
1736
|
),
|
|
1445
1737
|
children: [
|
|
1446
|
-
iconLeft && /* @__PURE__ */
|
|
1738
|
+
iconLeft && /* @__PURE__ */ jsx24(Icon, { icon: iconLeft, size: iconSizeMap3[size] }),
|
|
1447
1739
|
children,
|
|
1448
|
-
iconRight && /* @__PURE__ */
|
|
1740
|
+
iconRight && /* @__PURE__ */ jsx24(Icon, { icon: iconRight, size: iconSizeMap3[size] })
|
|
1449
1741
|
]
|
|
1450
1742
|
}
|
|
1451
1743
|
);
|
|
@@ -1461,17 +1753,16 @@ function IconButtonLink({
|
|
|
1461
1753
|
variant = "ghost",
|
|
1462
1754
|
size = "md",
|
|
1463
1755
|
showTooltip = true,
|
|
1464
|
-
tooltipPlacement = "top",
|
|
1465
1756
|
className,
|
|
1466
1757
|
...props
|
|
1467
1758
|
}) {
|
|
1468
|
-
const link = /* @__PURE__ */
|
|
1759
|
+
const link = /* @__PURE__ */ jsx24(
|
|
1469
1760
|
AriaLink2,
|
|
1470
1761
|
{
|
|
1471
1762
|
...props,
|
|
1472
1763
|
"aria-label": ariaLabel,
|
|
1473
1764
|
className: twMerge5(
|
|
1474
|
-
"inline-flex items-center justify-center",
|
|
1765
|
+
"inline-flex items-center justify-center cursor-pointer",
|
|
1475
1766
|
"rounded-md",
|
|
1476
1767
|
"outline-none transition-colors no-underline",
|
|
1477
1768
|
"focus-visible:ring-2 focus-visible:ring-(--color-border-focus) focus-visible:ring-offset-2",
|
|
@@ -1479,11 +1770,11 @@ function IconButtonLink({
|
|
|
1479
1770
|
squareSizeStyles2[size],
|
|
1480
1771
|
className
|
|
1481
1772
|
),
|
|
1482
|
-
children: /* @__PURE__ */
|
|
1773
|
+
children: /* @__PURE__ */ jsx24(Icon, { icon, size: iconSizeMap3[size] })
|
|
1483
1774
|
}
|
|
1484
1775
|
);
|
|
1485
1776
|
if (showTooltip) {
|
|
1486
|
-
return /* @__PURE__ */
|
|
1777
|
+
return /* @__PURE__ */ jsx24(Tooltip, { content: ariaLabel, children: link });
|
|
1487
1778
|
}
|
|
1488
1779
|
return link;
|
|
1489
1780
|
}
|
|
@@ -1493,13 +1784,9 @@ import {
|
|
|
1493
1784
|
ToggleButton as AriaToggleButton
|
|
1494
1785
|
} from "react-aria-components";
|
|
1495
1786
|
import { twMerge as twMerge6 } from "tailwind-merge";
|
|
1496
|
-
import { jsx as
|
|
1497
|
-
var sizeStyles4 = {
|
|
1498
|
-
sm: "px-3 py-1.5 text-sm",
|
|
1499
|
-
md: "px-4 py-2 text-base",
|
|
1500
|
-
lg: "px-6 py-3 text-lg"
|
|
1501
|
-
};
|
|
1787
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1502
1788
|
var squareSizeStyles3 = {
|
|
1789
|
+
xs: "h-6 w-6 text-xs",
|
|
1503
1790
|
sm: "h-7 w-7 text-sm",
|
|
1504
1791
|
md: "h-8 w-8 text-base",
|
|
1505
1792
|
lg: "h-10 w-10 text-lg"
|
|
@@ -1542,19 +1829,19 @@ function ToggleButton({
|
|
|
1542
1829
|
...props
|
|
1543
1830
|
}) {
|
|
1544
1831
|
const styles = variantStyles3[variant];
|
|
1545
|
-
return /* @__PURE__ */
|
|
1832
|
+
return /* @__PURE__ */ jsx25(
|
|
1546
1833
|
AriaToggleButton,
|
|
1547
1834
|
{
|
|
1548
1835
|
...props,
|
|
1549
1836
|
className: ({ isSelected }) => twMerge6(
|
|
1550
|
-
"inline-flex items-center justify-center gap-2",
|
|
1837
|
+
"inline-flex items-center justify-center gap-2 cursor-pointer",
|
|
1551
1838
|
isSquare ? "rounded-none" : "rounded-md",
|
|
1552
1839
|
"font-medium",
|
|
1553
1840
|
"leading-tight",
|
|
1554
1841
|
"outline-none transition-colors",
|
|
1555
1842
|
"focus-visible:ring-2 focus-visible:ring-(--color-border-focus) focus-visible:ring-offset-2",
|
|
1556
1843
|
"disabled:opacity-50 disabled:pointer-events-none",
|
|
1557
|
-
isSquare ? squareSizeStyles3[size] :
|
|
1844
|
+
isSquare ? squareSizeStyles3[size] : sizeStyles[size],
|
|
1558
1845
|
isSelected ? styles.selected : styles.base,
|
|
1559
1846
|
className
|
|
1560
1847
|
)
|
|
@@ -1569,11 +1856,11 @@ import {
|
|
|
1569
1856
|
RadioGroup as AriaRadioGroup2,
|
|
1570
1857
|
Radio as AriaRadio2
|
|
1571
1858
|
} from "react-aria-components";
|
|
1572
|
-
import { jsx as
|
|
1859
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1573
1860
|
var ToggleButtonGroupContext = createContext3({
|
|
1574
1861
|
size: "md"
|
|
1575
1862
|
});
|
|
1576
|
-
var
|
|
1863
|
+
var sizeStyles4 = {
|
|
1577
1864
|
sm: "px-2.5 py-1 text-xs gap-1",
|
|
1578
1865
|
md: "px-3 py-1.5 text-sm gap-1.5",
|
|
1579
1866
|
lg: "px-4 py-2 text-base gap-2"
|
|
@@ -1589,7 +1876,7 @@ function ToggleButtonGroup({
|
|
|
1589
1876
|
children,
|
|
1590
1877
|
...props
|
|
1591
1878
|
}) {
|
|
1592
|
-
return /* @__PURE__ */
|
|
1879
|
+
return /* @__PURE__ */ jsx26(ToggleButtonGroupContext.Provider, { value: { size }, children: /* @__PURE__ */ jsx26(
|
|
1593
1880
|
AriaRadioGroup2,
|
|
1594
1881
|
{
|
|
1595
1882
|
...props,
|
|
@@ -1609,7 +1896,7 @@ function ToggleButtonGroupItem({
|
|
|
1609
1896
|
...props
|
|
1610
1897
|
}) {
|
|
1611
1898
|
const { size } = useContext3(ToggleButtonGroupContext);
|
|
1612
|
-
return /* @__PURE__ */
|
|
1899
|
+
return /* @__PURE__ */ jsx26(
|
|
1613
1900
|
AriaRadio2,
|
|
1614
1901
|
{
|
|
1615
1902
|
...props,
|
|
@@ -1624,7 +1911,7 @@ function ToggleButtonGroupItem({
|
|
|
1624
1911
|
// Disabled
|
|
1625
1912
|
isDisabled && "opacity-50 pointer-events-none",
|
|
1626
1913
|
// Size
|
|
1627
|
-
isIconOnly ? iconOnlySizeStyles[size] :
|
|
1914
|
+
isIconOnly ? iconOnlySizeStyles[size] : sizeStyles4[size],
|
|
1628
1915
|
// Selected state
|
|
1629
1916
|
isSelected ? "bg-(--color-surface-default) text-(--color-text-primary) shadow-sm font-semibold" : isPressed ? "bg-(--color-surface-subtle) text-(--color-text-primary)" : isHovered ? "bg-(--color-surface-subtle) text-(--color-text-primary)" : "bg-transparent text-(--color-text-secondary)",
|
|
1630
1917
|
className
|
|
@@ -1641,7 +1928,7 @@ import {
|
|
|
1641
1928
|
MenuItem as AriaMenuItem,
|
|
1642
1929
|
Popover as Popover2
|
|
1643
1930
|
} from "react-aria-components";
|
|
1644
|
-
import { jsx as
|
|
1931
|
+
import { jsx as jsx27, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1645
1932
|
var popoverStyles = [
|
|
1646
1933
|
"bg-(--color-surface-default) rounded-md",
|
|
1647
1934
|
"shadow-lg border border-(--color-border-default)",
|
|
@@ -1661,13 +1948,13 @@ function Menu({
|
|
|
1661
1948
|
className
|
|
1662
1949
|
}) {
|
|
1663
1950
|
const selectionProps = selectionMode && selectionMode !== "none" ? { selectionMode, selectedKeys, defaultSelectedKeys, onSelectionChange } : {};
|
|
1664
|
-
return /* @__PURE__ */
|
|
1951
|
+
return /* @__PURE__ */ jsxs18(MenuTrigger, { children: [
|
|
1665
1952
|
children,
|
|
1666
|
-
/* @__PURE__ */
|
|
1953
|
+
/* @__PURE__ */ jsx27(
|
|
1667
1954
|
Popover2,
|
|
1668
1955
|
{
|
|
1669
1956
|
className: [popoverStyles, className].filter(Boolean).join(" "),
|
|
1670
|
-
children: items ? /* @__PURE__ */
|
|
1957
|
+
children: items ? /* @__PURE__ */ jsx27(
|
|
1671
1958
|
AriaMenu,
|
|
1672
1959
|
{
|
|
1673
1960
|
items,
|
|
@@ -1678,7 +1965,7 @@ function Menu({
|
|
|
1678
1965
|
},
|
|
1679
1966
|
...selectionProps,
|
|
1680
1967
|
className: "outline-none",
|
|
1681
|
-
children: (item) => /* @__PURE__ */
|
|
1968
|
+
children: (item) => /* @__PURE__ */ jsxs18(
|
|
1682
1969
|
AriaMenuItem,
|
|
1683
1970
|
{
|
|
1684
1971
|
id: item.id,
|
|
@@ -1694,14 +1981,14 @@ function Menu({
|
|
|
1694
1981
|
item.isDanger ? "text-(--color-text-danger)" : "text-(--color-text-primary)"
|
|
1695
1982
|
].filter(Boolean).join(" "),
|
|
1696
1983
|
children: [
|
|
1697
|
-
item.icon && /* @__PURE__ */
|
|
1698
|
-
/* @__PURE__ */
|
|
1699
|
-
item.endContent && /* @__PURE__ */
|
|
1984
|
+
item.icon && /* @__PURE__ */ jsx27(Icon, { icon: item.icon, size: "sm" }),
|
|
1985
|
+
/* @__PURE__ */ jsx27("span", { className: "flex-1", children: item.label }),
|
|
1986
|
+
item.endContent && /* @__PURE__ */ jsx27("span", { className: "ml-auto flex items-center", children: item.endContent })
|
|
1700
1987
|
]
|
|
1701
1988
|
}
|
|
1702
1989
|
)
|
|
1703
1990
|
}
|
|
1704
|
-
) : /* @__PURE__ */
|
|
1991
|
+
) : /* @__PURE__ */ jsx27(
|
|
1705
1992
|
AriaMenu,
|
|
1706
1993
|
{
|
|
1707
1994
|
onAction: (key) => onAction?.(key),
|
|
@@ -1717,7 +2004,7 @@ function Menu({
|
|
|
1717
2004
|
|
|
1718
2005
|
// src/components/Menu/MenuItem.tsx
|
|
1719
2006
|
import { MenuItem as AriaMenuItem2 } from "react-aria-components";
|
|
1720
|
-
import { jsx as
|
|
2007
|
+
import { jsx as jsx28, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1721
2008
|
function MenuItem({
|
|
1722
2009
|
id,
|
|
1723
2010
|
children,
|
|
@@ -1731,7 +2018,7 @@ function MenuItem({
|
|
|
1731
2018
|
textValue,
|
|
1732
2019
|
className
|
|
1733
2020
|
}) {
|
|
1734
|
-
return /* @__PURE__ */
|
|
2021
|
+
return /* @__PURE__ */ jsxs19(
|
|
1735
2022
|
AriaMenuItem2,
|
|
1736
2023
|
{
|
|
1737
2024
|
id,
|
|
@@ -1750,9 +2037,9 @@ function MenuItem({
|
|
|
1750
2037
|
className
|
|
1751
2038
|
].filter(Boolean).join(" "),
|
|
1752
2039
|
children: [
|
|
1753
|
-
icon && /* @__PURE__ */
|
|
1754
|
-
/* @__PURE__ */
|
|
1755
|
-
endContent && /* @__PURE__ */
|
|
2040
|
+
icon && /* @__PURE__ */ jsx28(Icon, { icon, size: "sm" }),
|
|
2041
|
+
/* @__PURE__ */ jsx28("span", { className: "flex-1", children }),
|
|
2042
|
+
endContent && /* @__PURE__ */ jsx28("span", { className: "ml-auto flex items-center", children: endContent })
|
|
1756
2043
|
]
|
|
1757
2044
|
}
|
|
1758
2045
|
);
|
|
@@ -1761,7 +2048,7 @@ function MenuItem({
|
|
|
1761
2048
|
// src/components/Menu/MenuCheckboxItem.tsx
|
|
1762
2049
|
import { MenuItem as AriaMenuItem3 } from "react-aria-components";
|
|
1763
2050
|
import { Check as Check3 } from "lucide-react";
|
|
1764
|
-
import { Fragment as Fragment7, jsx as
|
|
2051
|
+
import { Fragment as Fragment7, jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1765
2052
|
function MenuCheckboxItem({
|
|
1766
2053
|
id,
|
|
1767
2054
|
children,
|
|
@@ -1769,7 +2056,7 @@ function MenuCheckboxItem({
|
|
|
1769
2056
|
isDisabled,
|
|
1770
2057
|
className
|
|
1771
2058
|
}) {
|
|
1772
|
-
return /* @__PURE__ */
|
|
2059
|
+
return /* @__PURE__ */ jsx29(
|
|
1773
2060
|
AriaMenuItem3,
|
|
1774
2061
|
{
|
|
1775
2062
|
id,
|
|
@@ -1785,9 +2072,9 @@ function MenuCheckboxItem({
|
|
|
1785
2072
|
isSelected ? "font-medium" : "",
|
|
1786
2073
|
className
|
|
1787
2074
|
].filter(Boolean).join(" "),
|
|
1788
|
-
children: ({ isSelected }) => /* @__PURE__ */
|
|
1789
|
-
/* @__PURE__ */
|
|
1790
|
-
/* @__PURE__ */
|
|
2075
|
+
children: ({ isSelected }) => /* @__PURE__ */ jsxs20(Fragment7, { children: [
|
|
2076
|
+
/* @__PURE__ */ jsx29("span", { className: "flex items-center justify-center w-4 h-4 shrink-0", children: isSelected && /* @__PURE__ */ jsx29(Check3, { size: 14, className: "text-(--color-action-primary)", "aria-hidden": "true" }) }),
|
|
2077
|
+
/* @__PURE__ */ jsx29("span", { className: "flex-1", children })
|
|
1791
2078
|
] })
|
|
1792
2079
|
}
|
|
1793
2080
|
);
|
|
@@ -1798,15 +2085,15 @@ import {
|
|
|
1798
2085
|
MenuSection as AriaMenuSection,
|
|
1799
2086
|
Header
|
|
1800
2087
|
} from "react-aria-components";
|
|
1801
|
-
import { jsx as
|
|
2088
|
+
import { jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1802
2089
|
function MenuSection({
|
|
1803
2090
|
header,
|
|
1804
2091
|
children,
|
|
1805
2092
|
"aria-label": ariaLabel,
|
|
1806
2093
|
className
|
|
1807
2094
|
}) {
|
|
1808
|
-
return /* @__PURE__ */
|
|
1809
|
-
header && /* @__PURE__ */
|
|
2095
|
+
return /* @__PURE__ */ jsxs21(AriaMenuSection, { className, "aria-label": ariaLabel, children: [
|
|
2096
|
+
header && /* @__PURE__ */ jsx30(
|
|
1810
2097
|
Header,
|
|
1811
2098
|
{
|
|
1812
2099
|
className: [
|
|
@@ -1825,16 +2112,16 @@ function MenuSection({
|
|
|
1825
2112
|
|
|
1826
2113
|
// src/components/Menu/MenuHeader.tsx
|
|
1827
2114
|
import { Header as Header2 } from "react-aria-components";
|
|
1828
|
-
import { jsx as
|
|
2115
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1829
2116
|
function MenuHeader({ children, className }) {
|
|
1830
|
-
return /* @__PURE__ */
|
|
2117
|
+
return /* @__PURE__ */ jsx31(Header2, { className, children });
|
|
1831
2118
|
}
|
|
1832
2119
|
|
|
1833
2120
|
// src/components/Menu/MenuSeparator.tsx
|
|
1834
2121
|
import { Separator } from "react-aria-components";
|
|
1835
|
-
import { jsx as
|
|
2122
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1836
2123
|
function MenuSeparator({ className }) {
|
|
1837
|
-
return /* @__PURE__ */
|
|
2124
|
+
return /* @__PURE__ */ jsx32(
|
|
1838
2125
|
Separator,
|
|
1839
2126
|
{
|
|
1840
2127
|
className: [
|
|
@@ -1852,16 +2139,16 @@ import {
|
|
|
1852
2139
|
Button as AriaButton3
|
|
1853
2140
|
} from "react-aria-components";
|
|
1854
2141
|
import { twMerge as twMerge8 } from "tailwind-merge";
|
|
1855
|
-
import { jsx as
|
|
2142
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1856
2143
|
function Popover3({ children, isOpen, onOpenChange }) {
|
|
1857
|
-
return /* @__PURE__ */
|
|
2144
|
+
return /* @__PURE__ */ jsx33(DialogTrigger, { isOpen, onOpenChange, children });
|
|
1858
2145
|
}
|
|
1859
2146
|
function PopoverTrigger({ children, className }) {
|
|
1860
2147
|
const cx = `
|
|
1861
2148
|
inline-flex items-center bg-transparent border-none p-0 outline-none cursor-pointer
|
|
1862
2149
|
focus-visible:ring-2 focus-visible:ring-(--color-border-focus) focus-visible:rounded-sm
|
|
1863
2150
|
`;
|
|
1864
|
-
return /* @__PURE__ */
|
|
2151
|
+
return /* @__PURE__ */ jsx33(AriaButton3, { className: twMerge8(cx, className), children });
|
|
1865
2152
|
}
|
|
1866
2153
|
function PopoverContent({
|
|
1867
2154
|
placement = "bottom",
|
|
@@ -1882,7 +2169,7 @@ function PopoverContent({
|
|
|
1882
2169
|
entering:placement-left:slide-in-from-right-1
|
|
1883
2170
|
entering:placement-right:slide-in-from-left-1
|
|
1884
2171
|
`;
|
|
1885
|
-
return /* @__PURE__ */
|
|
2172
|
+
return /* @__PURE__ */ jsx33(
|
|
1886
2173
|
AriaPopover,
|
|
1887
2174
|
{
|
|
1888
2175
|
...rest,
|
|
@@ -1903,12 +2190,12 @@ import {
|
|
|
1903
2190
|
Tab as AriaTab,
|
|
1904
2191
|
TabPanel as AriaTabPanel
|
|
1905
2192
|
} from "react-aria-components";
|
|
1906
|
-
import { jsx as
|
|
2193
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
1907
2194
|
var TabsContext = createContext4({
|
|
1908
2195
|
variant: "underline",
|
|
1909
2196
|
size: "md"
|
|
1910
2197
|
});
|
|
1911
|
-
var
|
|
2198
|
+
var sizeStyles5 = {
|
|
1912
2199
|
sm: "px-3 py-1.5 text-sm",
|
|
1913
2200
|
md: "px-4 py-2 text-base",
|
|
1914
2201
|
lg: "px-6 py-3 text-lg"
|
|
@@ -1921,7 +2208,7 @@ function Tabs({
|
|
|
1921
2208
|
children,
|
|
1922
2209
|
...props
|
|
1923
2210
|
}) {
|
|
1924
|
-
return /* @__PURE__ */
|
|
2211
|
+
return /* @__PURE__ */ jsx34(TabsContext.Provider, { value: { variant, size }, children: /* @__PURE__ */ jsx34(
|
|
1925
2212
|
AriaTabs,
|
|
1926
2213
|
{
|
|
1927
2214
|
...props,
|
|
@@ -1941,7 +2228,7 @@ function TabList({
|
|
|
1941
2228
|
const { variant } = useContext4(TabsContext);
|
|
1942
2229
|
const baseStyles = variant === "unstyled" ? "flex items-center" : variant === "underline" ? "flex items-center border-b border-(--color-border-default)" : "inline-flex items-center bg-(--color-surface-muted) rounded-lg p-1 gap-1";
|
|
1943
2230
|
const verticalStyles = variant === "unstyled" ? "flex-col" : variant === "underline" ? "flex-col border-b-0 border-r border-(--color-border-default)" : "flex-col";
|
|
1944
|
-
return /* @__PURE__ */
|
|
2231
|
+
return /* @__PURE__ */ jsx34(
|
|
1945
2232
|
AriaTabList,
|
|
1946
2233
|
{
|
|
1947
2234
|
...props,
|
|
@@ -1955,7 +2242,7 @@ function TabList({
|
|
|
1955
2242
|
}
|
|
1956
2243
|
function Tab({ className, ...props }) {
|
|
1957
2244
|
const { variant, size } = useContext4(TabsContext);
|
|
1958
|
-
return /* @__PURE__ */
|
|
2245
|
+
return /* @__PURE__ */ jsx34(
|
|
1959
2246
|
AriaTab,
|
|
1960
2247
|
{
|
|
1961
2248
|
...props,
|
|
@@ -1977,7 +2264,7 @@ function Tab({ className, ...props }) {
|
|
|
1977
2264
|
// Disabled
|
|
1978
2265
|
isDisabled ? "opacity-50 pointer-events-none" : "",
|
|
1979
2266
|
// Size
|
|
1980
|
-
|
|
2267
|
+
sizeStyles5[size],
|
|
1981
2268
|
...getTabVariantStyles(variant, {
|
|
1982
2269
|
isSelected,
|
|
1983
2270
|
isHovered,
|
|
@@ -2012,7 +2299,7 @@ function getTabVariantStyles(variant, state) {
|
|
|
2012
2299
|
}
|
|
2013
2300
|
function TabPanel({ className, ...props }) {
|
|
2014
2301
|
const { variant } = useContext4(TabsContext);
|
|
2015
|
-
return /* @__PURE__ */
|
|
2302
|
+
return /* @__PURE__ */ jsx34(
|
|
2016
2303
|
AriaTabPanel,
|
|
2017
2304
|
{
|
|
2018
2305
|
...props,
|
|
@@ -2039,11 +2326,11 @@ import {
|
|
|
2039
2326
|
ToggleButtonGroup as AriaToggleButtonGroup,
|
|
2040
2327
|
ToggleButton as AriaToggleButton2
|
|
2041
2328
|
} from "react-aria-components";
|
|
2042
|
-
import { jsx as
|
|
2329
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
2043
2330
|
var SegmentedControlContext = createContext5({
|
|
2044
2331
|
size: "md"
|
|
2045
2332
|
});
|
|
2046
|
-
var
|
|
2333
|
+
var sizeStyles6 = {
|
|
2047
2334
|
sm: "px-2.5 py-1 text-xs",
|
|
2048
2335
|
md: "px-3 py-1.5 text-sm",
|
|
2049
2336
|
lg: "px-4 py-2 text-base"
|
|
@@ -2059,7 +2346,7 @@ function SegmentedControl({
|
|
|
2059
2346
|
...props
|
|
2060
2347
|
}) {
|
|
2061
2348
|
const isNoneMode = selectionMode === "none";
|
|
2062
|
-
return /* @__PURE__ */
|
|
2349
|
+
return /* @__PURE__ */ jsx35(SegmentedControlContext.Provider, { value: { size }, children: /* @__PURE__ */ jsx35(
|
|
2063
2350
|
AriaToggleButtonGroup,
|
|
2064
2351
|
{
|
|
2065
2352
|
...props,
|
|
@@ -2080,7 +2367,7 @@ function SegmentedControlItem({
|
|
|
2080
2367
|
...props
|
|
2081
2368
|
}) {
|
|
2082
2369
|
const { size } = useContext5(SegmentedControlContext);
|
|
2083
|
-
return /* @__PURE__ */
|
|
2370
|
+
return /* @__PURE__ */ jsx35(
|
|
2084
2371
|
AriaToggleButton2,
|
|
2085
2372
|
{
|
|
2086
2373
|
...props,
|
|
@@ -2095,7 +2382,7 @@ function SegmentedControlItem({
|
|
|
2095
2382
|
// Disabled
|
|
2096
2383
|
isDisabled && "opacity-50 pointer-events-none",
|
|
2097
2384
|
// Size
|
|
2098
|
-
|
|
2385
|
+
sizeStyles6[size],
|
|
2099
2386
|
// Selected state
|
|
2100
2387
|
isSelected ? "bg-(--color-surface-default) text-(--color-text-primary) shadow-sm font-semibold" : isPressed ? "bg-(--color-surface-subtle) text-(--color-text-primary)" : isHovered ? "bg-(--color-surface-subtle) text-(--color-text-primary)" : "bg-transparent text-(--color-text-secondary)",
|
|
2101
2388
|
className
|
|
@@ -2106,7 +2393,7 @@ function SegmentedControlItem({
|
|
|
2106
2393
|
|
|
2107
2394
|
// src/components/Badge/Badge.tsx
|
|
2108
2395
|
import { twMerge as twMerge11 } from "tailwind-merge";
|
|
2109
|
-
import { jsx as
|
|
2396
|
+
import { jsx as jsx36, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2110
2397
|
var variantStyles4 = {
|
|
2111
2398
|
neutral: "bg-(--color-badge-neutral-bg) text-(--color-badge-neutral-text)",
|
|
2112
2399
|
purple: "bg-(--color-badge-purple-bg) text-(--color-badge-purple-text)",
|
|
@@ -2116,7 +2403,7 @@ var variantStyles4 = {
|
|
|
2116
2403
|
green: "bg-(--color-badge-green-bg) text-(--color-badge-green-text)",
|
|
2117
2404
|
amber: "bg-(--color-badge-amber-bg) text-(--color-badge-amber-text)"
|
|
2118
2405
|
};
|
|
2119
|
-
var
|
|
2406
|
+
var sizeStyles7 = {
|
|
2120
2407
|
sm: "px-1.5 py-0.5",
|
|
2121
2408
|
md: "px-2 py-0.5"
|
|
2122
2409
|
};
|
|
@@ -2131,18 +2418,18 @@ function Badge({
|
|
|
2131
2418
|
icon: IconComponent,
|
|
2132
2419
|
className
|
|
2133
2420
|
}) {
|
|
2134
|
-
return /* @__PURE__ */
|
|
2421
|
+
return /* @__PURE__ */ jsxs22(
|
|
2135
2422
|
"span",
|
|
2136
2423
|
{
|
|
2137
2424
|
className: twMerge11(
|
|
2138
2425
|
"inline-flex items-center gap-1 rounded-full",
|
|
2139
2426
|
"text-xs font-medium leading-tight",
|
|
2140
2427
|
variantStyles4[variant],
|
|
2141
|
-
|
|
2428
|
+
sizeStyles7[size],
|
|
2142
2429
|
className
|
|
2143
2430
|
),
|
|
2144
2431
|
children: [
|
|
2145
|
-
IconComponent && /* @__PURE__ */
|
|
2432
|
+
IconComponent && /* @__PURE__ */ jsx36(IconComponent, { size: iconSizeMap4[size], "aria-hidden": "true" }),
|
|
2146
2433
|
children
|
|
2147
2434
|
]
|
|
2148
2435
|
}
|
|
@@ -2150,9 +2437,9 @@ function Badge({
|
|
|
2150
2437
|
}
|
|
2151
2438
|
|
|
2152
2439
|
// src/components/Card/Card.tsx
|
|
2153
|
-
import { useCallback as
|
|
2440
|
+
import { useCallback as useCallback3 } from "react";
|
|
2154
2441
|
import { twMerge as twMerge12 } from "tailwind-merge";
|
|
2155
|
-
import { Fragment as Fragment8, jsx as
|
|
2442
|
+
import { Fragment as Fragment8, jsx as jsx37, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2156
2443
|
var paddingStyles = {
|
|
2157
2444
|
none: "p-0",
|
|
2158
2445
|
sm: "p-3",
|
|
@@ -2176,7 +2463,7 @@ function Card({
|
|
|
2176
2463
|
(href || onPress) && "block focus-visible:ring-2 focus-visible:ring-(--color-border-focus) focus-visible:ring-offset-2 outline-none",
|
|
2177
2464
|
className
|
|
2178
2465
|
);
|
|
2179
|
-
const handleKeyDown =
|
|
2466
|
+
const handleKeyDown = useCallback3(
|
|
2180
2467
|
(e) => {
|
|
2181
2468
|
if (onPress && (e.key === "Enter" || e.key === " ")) {
|
|
2182
2469
|
e.preventDefault();
|
|
@@ -2185,8 +2472,8 @@ function Card({
|
|
|
2185
2472
|
},
|
|
2186
2473
|
[onPress]
|
|
2187
2474
|
);
|
|
2188
|
-
const content = /* @__PURE__ */
|
|
2189
|
-
header && /* @__PURE__ */
|
|
2475
|
+
const content = /* @__PURE__ */ jsxs23(Fragment8, { children: [
|
|
2476
|
+
header && /* @__PURE__ */ jsx37(
|
|
2190
2477
|
"div",
|
|
2191
2478
|
{
|
|
2192
2479
|
className: twMerge12(
|
|
@@ -2196,8 +2483,8 @@ function Card({
|
|
|
2196
2483
|
children: header
|
|
2197
2484
|
}
|
|
2198
2485
|
),
|
|
2199
|
-
/* @__PURE__ */
|
|
2200
|
-
footer && /* @__PURE__ */
|
|
2486
|
+
/* @__PURE__ */ jsx37("div", { className: paddingStyles[padding], children }),
|
|
2487
|
+
footer && /* @__PURE__ */ jsx37(
|
|
2201
2488
|
"div",
|
|
2202
2489
|
{
|
|
2203
2490
|
className: twMerge12(
|
|
@@ -2209,10 +2496,10 @@ function Card({
|
|
|
2209
2496
|
)
|
|
2210
2497
|
] });
|
|
2211
2498
|
if (href) {
|
|
2212
|
-
return /* @__PURE__ */
|
|
2499
|
+
return /* @__PURE__ */ jsx37("a", { href, className: containerClass, children: content });
|
|
2213
2500
|
}
|
|
2214
2501
|
if (onPress) {
|
|
2215
|
-
return /* @__PURE__ */
|
|
2502
|
+
return /* @__PURE__ */ jsx37(
|
|
2216
2503
|
"div",
|
|
2217
2504
|
{
|
|
2218
2505
|
role: "button",
|
|
@@ -2224,13 +2511,13 @@ function Card({
|
|
|
2224
2511
|
}
|
|
2225
2512
|
);
|
|
2226
2513
|
}
|
|
2227
|
-
return /* @__PURE__ */
|
|
2514
|
+
return /* @__PURE__ */ jsx37("div", { className: containerClass, children: content });
|
|
2228
2515
|
}
|
|
2229
2516
|
|
|
2230
2517
|
// src/components/DeltaIndicator/DeltaIndicator.tsx
|
|
2231
2518
|
import { ArrowUp, ArrowDown, Minus } from "lucide-react";
|
|
2232
2519
|
import { twMerge as twMerge13 } from "tailwind-merge";
|
|
2233
|
-
import { jsx as
|
|
2520
|
+
import { jsx as jsx38, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2234
2521
|
function getDirection(current, previous) {
|
|
2235
2522
|
const diff = current - previous;
|
|
2236
2523
|
if (diff > 0) return "increase";
|
|
@@ -2283,7 +2570,7 @@ function DeltaIndicator({
|
|
|
2283
2570
|
className
|
|
2284
2571
|
}) {
|
|
2285
2572
|
if (unavailable) {
|
|
2286
|
-
return /* @__PURE__ */
|
|
2573
|
+
return /* @__PURE__ */ jsxs24(
|
|
2287
2574
|
"span",
|
|
2288
2575
|
{
|
|
2289
2576
|
className: twMerge13(
|
|
@@ -2292,7 +2579,7 @@ function DeltaIndicator({
|
|
|
2292
2579
|
className
|
|
2293
2580
|
),
|
|
2294
2581
|
children: [
|
|
2295
|
-
label && /* @__PURE__ */
|
|
2582
|
+
label && /* @__PURE__ */ jsx38("span", { className: "text-sm text-(--color-text-secondary) mr-1", children: label }),
|
|
2296
2583
|
unavailableText
|
|
2297
2584
|
]
|
|
2298
2585
|
}
|
|
@@ -2322,7 +2609,7 @@ function DeltaIndicator({
|
|
|
2322
2609
|
}
|
|
2323
2610
|
}
|
|
2324
2611
|
const isPill = mode === "pill";
|
|
2325
|
-
return /* @__PURE__ */
|
|
2612
|
+
return /* @__PURE__ */ jsxs24(
|
|
2326
2613
|
"span",
|
|
2327
2614
|
{
|
|
2328
2615
|
className: twMerge13(
|
|
@@ -2336,8 +2623,8 @@ function DeltaIndicator({
|
|
|
2336
2623
|
className
|
|
2337
2624
|
),
|
|
2338
2625
|
children: [
|
|
2339
|
-
label && /* @__PURE__ */
|
|
2340
|
-
/* @__PURE__ */
|
|
2626
|
+
label && /* @__PURE__ */ jsx38("span", { className: "text-sm text-(--color-text-secondary) mr-1", children: label }),
|
|
2627
|
+
/* @__PURE__ */ jsx38(IconComponent, { size: 14, "aria-hidden": true }),
|
|
2341
2628
|
valueText
|
|
2342
2629
|
]
|
|
2343
2630
|
}
|
|
@@ -2346,7 +2633,7 @@ function DeltaIndicator({
|
|
|
2346
2633
|
|
|
2347
2634
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
2348
2635
|
import { twMerge as twMerge14 } from "tailwind-merge";
|
|
2349
|
-
import { jsx as
|
|
2636
|
+
import { jsx as jsx39, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2350
2637
|
var fillStyles = {
|
|
2351
2638
|
brand: "bg-(--color-progress-fill)",
|
|
2352
2639
|
success: "bg-(--color-progress-fill-success)",
|
|
@@ -2354,7 +2641,7 @@ var fillStyles = {
|
|
|
2354
2641
|
danger: "bg-(--color-progress-fill-danger)",
|
|
2355
2642
|
neutral: "bg-(--color-text-secondary)"
|
|
2356
2643
|
};
|
|
2357
|
-
var
|
|
2644
|
+
var sizeStyles8 = {
|
|
2358
2645
|
sm: "h-1.5",
|
|
2359
2646
|
md: "h-3",
|
|
2360
2647
|
lg: "h-4"
|
|
@@ -2369,12 +2656,12 @@ function ProgressBar({
|
|
|
2369
2656
|
className
|
|
2370
2657
|
}) {
|
|
2371
2658
|
const clampedValue = Math.min(100, Math.max(0, value));
|
|
2372
|
-
return /* @__PURE__ */
|
|
2373
|
-
(label || description || showValue) && /* @__PURE__ */
|
|
2374
|
-
/* @__PURE__ */
|
|
2375
|
-
/* @__PURE__ */
|
|
2659
|
+
return /* @__PURE__ */ jsxs25("div", { className: twMerge14("w-full", className), children: [
|
|
2660
|
+
(label || description || showValue) && /* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between mb-2", children: [
|
|
2661
|
+
/* @__PURE__ */ jsx39("span", { className: "text-sm font-medium text-(--color-text-primary)", children: label }),
|
|
2662
|
+
/* @__PURE__ */ jsx39("span", { className: "text-sm text-(--color-text-secondary)", children: description ?? (showValue ? `${clampedValue}%` : null) })
|
|
2376
2663
|
] }),
|
|
2377
|
-
/* @__PURE__ */
|
|
2664
|
+
/* @__PURE__ */ jsx39(
|
|
2378
2665
|
"div",
|
|
2379
2666
|
{
|
|
2380
2667
|
role: "progressbar",
|
|
@@ -2384,9 +2671,9 @@ function ProgressBar({
|
|
|
2384
2671
|
"aria-label": label ?? "Progress",
|
|
2385
2672
|
className: twMerge14(
|
|
2386
2673
|
"w-full rounded-full bg-(--color-progress-track)",
|
|
2387
|
-
|
|
2674
|
+
sizeStyles8[size]
|
|
2388
2675
|
),
|
|
2389
|
-
children: /* @__PURE__ */
|
|
2676
|
+
children: /* @__PURE__ */ jsx39(
|
|
2390
2677
|
"div",
|
|
2391
2678
|
{
|
|
2392
2679
|
className: twMerge14(
|
|
@@ -2402,7 +2689,7 @@ function ProgressBar({
|
|
|
2402
2689
|
}
|
|
2403
2690
|
|
|
2404
2691
|
// src/components/Banner/Banner.tsx
|
|
2405
|
-
import { useState as
|
|
2692
|
+
import { useState as useState6 } from "react";
|
|
2406
2693
|
import {
|
|
2407
2694
|
Info as Info2,
|
|
2408
2695
|
AlertTriangle,
|
|
@@ -2411,7 +2698,7 @@ import {
|
|
|
2411
2698
|
X as X3
|
|
2412
2699
|
} from "lucide-react";
|
|
2413
2700
|
import { twMerge as twMerge15 } from "tailwind-merge";
|
|
2414
|
-
import { jsx as
|
|
2701
|
+
import { jsx as jsx40, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2415
2702
|
var variantConfig2 = {
|
|
2416
2703
|
info: {
|
|
2417
2704
|
icon: Info2,
|
|
@@ -2447,7 +2734,7 @@ function Banner({
|
|
|
2447
2734
|
onDismiss,
|
|
2448
2735
|
className
|
|
2449
2736
|
}) {
|
|
2450
|
-
const [dismissed, setDismissed] =
|
|
2737
|
+
const [dismissed, setDismissed] = useState6(false);
|
|
2451
2738
|
if (dismissed) return null;
|
|
2452
2739
|
const config = variantConfig2[variant];
|
|
2453
2740
|
const IconComponent = icon ?? config.icon;
|
|
@@ -2455,7 +2742,7 @@ function Banner({
|
|
|
2455
2742
|
setDismissed(true);
|
|
2456
2743
|
onDismiss?.();
|
|
2457
2744
|
};
|
|
2458
|
-
return /* @__PURE__ */
|
|
2745
|
+
return /* @__PURE__ */ jsxs26(
|
|
2459
2746
|
"div",
|
|
2460
2747
|
{
|
|
2461
2748
|
role: config.role,
|
|
@@ -2466,7 +2753,7 @@ function Banner({
|
|
|
2466
2753
|
className
|
|
2467
2754
|
),
|
|
2468
2755
|
children: [
|
|
2469
|
-
/* @__PURE__ */
|
|
2756
|
+
/* @__PURE__ */ jsx40(
|
|
2470
2757
|
IconComponent,
|
|
2471
2758
|
{
|
|
2472
2759
|
size: 20,
|
|
@@ -2474,21 +2761,21 @@ function Banner({
|
|
|
2474
2761
|
"aria-hidden": "true"
|
|
2475
2762
|
}
|
|
2476
2763
|
),
|
|
2477
|
-
/* @__PURE__ */
|
|
2478
|
-
title && /* @__PURE__ */
|
|
2764
|
+
/* @__PURE__ */ jsxs26("div", { className: "flex-1", children: [
|
|
2765
|
+
title && /* @__PURE__ */ jsxs26("span", { className: "font-medium", children: [
|
|
2479
2766
|
title,
|
|
2480
2767
|
" \u2014 "
|
|
2481
2768
|
] }),
|
|
2482
2769
|
children
|
|
2483
2770
|
] }),
|
|
2484
|
-
dismissible && /* @__PURE__ */
|
|
2771
|
+
dismissible && /* @__PURE__ */ jsx40(
|
|
2485
2772
|
"button",
|
|
2486
2773
|
{
|
|
2487
2774
|
type: "button",
|
|
2488
2775
|
onClick: handleDismiss,
|
|
2489
2776
|
className: "shrink-0 rounded-sm p-0.5 opacity-70 hover:opacity-100 transition-opacity outline-none focus-visible:ring-2 focus-visible:ring-current",
|
|
2490
2777
|
"aria-label": "Dismiss",
|
|
2491
|
-
children: /* @__PURE__ */
|
|
2778
|
+
children: /* @__PURE__ */ jsx40(X3, { size: 16, "aria-hidden": "true" })
|
|
2492
2779
|
}
|
|
2493
2780
|
)
|
|
2494
2781
|
]
|
|
@@ -2498,7 +2785,7 @@ function Banner({
|
|
|
2498
2785
|
|
|
2499
2786
|
// src/components/MetricCard/MetricCard.tsx
|
|
2500
2787
|
import { twMerge as twMerge16 } from "tailwind-merge";
|
|
2501
|
-
import { Fragment as Fragment9, jsx as
|
|
2788
|
+
import { Fragment as Fragment9, jsx as jsx41, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2502
2789
|
var sizeConfig = {
|
|
2503
2790
|
sm: {
|
|
2504
2791
|
padding: "p-3",
|
|
@@ -2526,9 +2813,9 @@ function MetricCard({
|
|
|
2526
2813
|
href && "block transition-shadow hover:shadow-md hover:border-(--color-border-focus) focus-visible:ring-2 focus-visible:ring-(--color-border-focus) focus-visible:ring-offset-2 outline-none",
|
|
2527
2814
|
className
|
|
2528
2815
|
);
|
|
2529
|
-
const content = /* @__PURE__ */
|
|
2530
|
-
/* @__PURE__ */
|
|
2531
|
-
/* @__PURE__ */
|
|
2816
|
+
const content = /* @__PURE__ */ jsxs27(Fragment9, { children: [
|
|
2817
|
+
/* @__PURE__ */ jsx41("div", { className: twMerge16(config.labelClass, "text-(--color-text-secondary)"), children: label }),
|
|
2818
|
+
/* @__PURE__ */ jsx41(
|
|
2532
2819
|
"div",
|
|
2533
2820
|
{
|
|
2534
2821
|
className: twMerge16(
|
|
@@ -2538,23 +2825,23 @@ function MetricCard({
|
|
|
2538
2825
|
children: value
|
|
2539
2826
|
}
|
|
2540
2827
|
),
|
|
2541
|
-
secondary && /* @__PURE__ */
|
|
2828
|
+
secondary && /* @__PURE__ */ jsx41("div", { className: "mt-1 text-sm", children: secondary })
|
|
2542
2829
|
] });
|
|
2543
2830
|
if (href) {
|
|
2544
|
-
return /* @__PURE__ */
|
|
2831
|
+
return /* @__PURE__ */ jsx41("a", { href, className: containerClass, children: content });
|
|
2545
2832
|
}
|
|
2546
|
-
return /* @__PURE__ */
|
|
2833
|
+
return /* @__PURE__ */ jsx41("div", { className: containerClass, children: content });
|
|
2547
2834
|
}
|
|
2548
2835
|
|
|
2549
2836
|
// src/components/SectionHeader/SectionHeader.tsx
|
|
2550
2837
|
import { twMerge as twMerge17 } from "tailwind-merge";
|
|
2551
|
-
import { jsx as
|
|
2838
|
+
import { jsx as jsx42, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2552
2839
|
function SectionHeader({
|
|
2553
2840
|
title,
|
|
2554
2841
|
children,
|
|
2555
2842
|
className
|
|
2556
2843
|
}) {
|
|
2557
|
-
return /* @__PURE__ */
|
|
2844
|
+
return /* @__PURE__ */ jsxs28(
|
|
2558
2845
|
"div",
|
|
2559
2846
|
{
|
|
2560
2847
|
className: twMerge17(
|
|
@@ -2562,8 +2849,8 @@ function SectionHeader({
|
|
|
2562
2849
|
className
|
|
2563
2850
|
),
|
|
2564
2851
|
children: [
|
|
2565
|
-
/* @__PURE__ */
|
|
2566
|
-
children && /* @__PURE__ */
|
|
2852
|
+
/* @__PURE__ */ jsx42(H2, { children: title }),
|
|
2853
|
+
children && /* @__PURE__ */ jsx42("div", { className: "ml-auto flex flex-wrap items-center gap-2", children })
|
|
2567
2854
|
]
|
|
2568
2855
|
}
|
|
2569
2856
|
);
|
|
@@ -2571,7 +2858,7 @@ function SectionHeader({
|
|
|
2571
2858
|
|
|
2572
2859
|
// src/components/Pill/Pill.tsx
|
|
2573
2860
|
import { twMerge as twMerge18 } from "tailwind-merge";
|
|
2574
|
-
import { jsx as
|
|
2861
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
2575
2862
|
var hashColors = {
|
|
2576
2863
|
purple: "bg-(--color-badge-purple-bg) text-(--color-badge-purple-text) border-(--color-badge-purple-text)/20",
|
|
2577
2864
|
teal: "bg-(--color-badge-teal-bg) text-(--color-badge-teal-text) border-(--color-badge-teal-text)/20",
|
|
@@ -2609,12 +2896,12 @@ function Pill({
|
|
|
2609
2896
|
colorStyles[color],
|
|
2610
2897
|
className
|
|
2611
2898
|
);
|
|
2612
|
-
return /* @__PURE__ */
|
|
2899
|
+
return /* @__PURE__ */ jsx43("span", { className: cx, ...rest, children });
|
|
2613
2900
|
}
|
|
2614
2901
|
|
|
2615
2902
|
// src/components/Pill/PathPill.tsx
|
|
2616
2903
|
import { twMerge as twMerge19 } from "tailwind-merge";
|
|
2617
|
-
import { jsx as
|
|
2904
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
2618
2905
|
function PathPill({
|
|
2619
2906
|
children,
|
|
2620
2907
|
visibleCount,
|
|
@@ -2626,7 +2913,7 @@ function PathPill({
|
|
|
2626
2913
|
const effectiveVisible = visibleCount ?? segments.length;
|
|
2627
2914
|
const dotCount = Math.max(0, segments.length - effectiveVisible);
|
|
2628
2915
|
const fullPath = segments.join(" / ");
|
|
2629
|
-
return /* @__PURE__ */
|
|
2916
|
+
return /* @__PURE__ */ jsx44(
|
|
2630
2917
|
"div",
|
|
2631
2918
|
{
|
|
2632
2919
|
className: twMerge19("relative flex", className),
|
|
@@ -2636,7 +2923,7 @@ function PathPill({
|
|
|
2636
2923
|
const isLast = i === segments.length - 1;
|
|
2637
2924
|
const cx = twMerge19(!isLast && "pr-5 -mr-4", isCollapsed && "pr-3");
|
|
2638
2925
|
const color = colorFn ? colorFn(segment, i) : pillColorFromName(segment);
|
|
2639
|
-
return /* @__PURE__ */
|
|
2926
|
+
return /* @__PURE__ */ jsx44(
|
|
2640
2927
|
Pill,
|
|
2641
2928
|
{
|
|
2642
2929
|
className: cx,
|
|
@@ -2652,8 +2939,8 @@ function PathPill({
|
|
|
2652
2939
|
}
|
|
2653
2940
|
|
|
2654
2941
|
// src/components/FormWizard/FormWizard.tsx
|
|
2655
|
-
import { createContext as createContext6, useContext as useContext6, useCallback as
|
|
2656
|
-
import { jsx as
|
|
2942
|
+
import { createContext as createContext6, useContext as useContext6, useCallback as useCallback4, useMemo } from "react";
|
|
2943
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
2657
2944
|
var FormWizardContext = createContext6({
|
|
2658
2945
|
currentStep: 0,
|
|
2659
2946
|
totalSteps: 1,
|
|
@@ -2673,7 +2960,7 @@ function FormWizard({
|
|
|
2673
2960
|
}) {
|
|
2674
2961
|
const canGoBack = currentStep > 0;
|
|
2675
2962
|
const isLastStep = currentStep >= totalSteps - 1;
|
|
2676
|
-
const goBack =
|
|
2963
|
+
const goBack = useCallback4(() => {
|
|
2677
2964
|
if (currentStep > 0) {
|
|
2678
2965
|
onStepChange(currentStep - 1);
|
|
2679
2966
|
}
|
|
@@ -2688,13 +2975,13 @@ function FormWizard({
|
|
|
2688
2975
|
}),
|
|
2689
2976
|
[currentStep, totalSteps, canGoBack, goBack, isLastStep]
|
|
2690
2977
|
);
|
|
2691
|
-
return /* @__PURE__ */
|
|
2978
|
+
return /* @__PURE__ */ jsx45(FormWizardContext.Provider, { value, children });
|
|
2692
2979
|
}
|
|
2693
2980
|
|
|
2694
2981
|
// src/components/FormWizard/FormWizardProgress.tsx
|
|
2695
|
-
import { jsx as
|
|
2982
|
+
import { jsx as jsx46, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2696
2983
|
function CheckIcon() {
|
|
2697
|
-
return /* @__PURE__ */
|
|
2984
|
+
return /* @__PURE__ */ jsx46(
|
|
2698
2985
|
"svg",
|
|
2699
2986
|
{
|
|
2700
2987
|
"aria-hidden": "true",
|
|
@@ -2705,24 +2992,24 @@ function CheckIcon() {
|
|
|
2705
2992
|
strokeWidth: "2",
|
|
2706
2993
|
strokeLinecap: "round",
|
|
2707
2994
|
strokeLinejoin: "round",
|
|
2708
|
-
children: /* @__PURE__ */
|
|
2995
|
+
children: /* @__PURE__ */ jsx46("path", { d: "M3 8.5l3.5 3.5 6.5-7" })
|
|
2709
2996
|
}
|
|
2710
2997
|
);
|
|
2711
2998
|
}
|
|
2712
2999
|
function FormWizardProgress({ labels }) {
|
|
2713
3000
|
const { currentStep, totalSteps } = useFormWizard();
|
|
2714
|
-
return /* @__PURE__ */
|
|
3001
|
+
return /* @__PURE__ */ jsx46("nav", { "aria-label": "Form progress", children: /* @__PURE__ */ jsx46("ol", { className: "flex items-start", role: "list", children: labels.map((label, index) => {
|
|
2715
3002
|
const isCompleted = index < currentStep;
|
|
2716
3003
|
const isCurrent = index === currentStep;
|
|
2717
3004
|
const isFuture = index > currentStep;
|
|
2718
|
-
return /* @__PURE__ */
|
|
3005
|
+
return /* @__PURE__ */ jsxs29(
|
|
2719
3006
|
"li",
|
|
2720
3007
|
{
|
|
2721
3008
|
className: "flex flex-1 flex-col items-center",
|
|
2722
3009
|
"aria-current": isCurrent ? "step" : void 0,
|
|
2723
3010
|
children: [
|
|
2724
|
-
/* @__PURE__ */
|
|
2725
|
-
index > 0 ? /* @__PURE__ */
|
|
3011
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex w-full items-center", children: [
|
|
3012
|
+
index > 0 ? /* @__PURE__ */ jsx46(
|
|
2726
3013
|
"div",
|
|
2727
3014
|
{
|
|
2728
3015
|
"aria-hidden": "true",
|
|
@@ -2731,8 +3018,8 @@ function FormWizardProgress({ labels }) {
|
|
|
2731
3018
|
index <= currentStep ? "bg-(--color-brand-primary)" : "bg-(--color-border-default)"
|
|
2732
3019
|
].join(" ")
|
|
2733
3020
|
}
|
|
2734
|
-
) : /* @__PURE__ */
|
|
2735
|
-
/* @__PURE__ */
|
|
3021
|
+
) : /* @__PURE__ */ jsx46("div", { className: "flex-1", "aria-hidden": "true" }),
|
|
3022
|
+
/* @__PURE__ */ jsx46(
|
|
2736
3023
|
"div",
|
|
2737
3024
|
{
|
|
2738
3025
|
className: [
|
|
@@ -2744,10 +3031,10 @@ function FormWizardProgress({ labels }) {
|
|
|
2744
3031
|
isFuture ? "border-2 border-(--color-border-default) bg-(--color-surface-default) text-(--color-text-tertiary)" : ""
|
|
2745
3032
|
].join(" "),
|
|
2746
3033
|
"aria-hidden": "true",
|
|
2747
|
-
children: isCompleted ? /* @__PURE__ */
|
|
3034
|
+
children: isCompleted ? /* @__PURE__ */ jsx46(CheckIcon, {}) : index + 1
|
|
2748
3035
|
}
|
|
2749
3036
|
),
|
|
2750
|
-
index < totalSteps - 1 ? /* @__PURE__ */
|
|
3037
|
+
index < totalSteps - 1 ? /* @__PURE__ */ jsx46(
|
|
2751
3038
|
"div",
|
|
2752
3039
|
{
|
|
2753
3040
|
"aria-hidden": "true",
|
|
@@ -2756,9 +3043,9 @@ function FormWizardProgress({ labels }) {
|
|
|
2756
3043
|
index < currentStep ? "bg-(--color-brand-primary)" : "bg-(--color-border-default)"
|
|
2757
3044
|
].join(" ")
|
|
2758
3045
|
}
|
|
2759
|
-
) : /* @__PURE__ */
|
|
3046
|
+
) : /* @__PURE__ */ jsx46("div", { className: "flex-1", "aria-hidden": "true" })
|
|
2760
3047
|
] }),
|
|
2761
|
-
/* @__PURE__ */
|
|
3048
|
+
/* @__PURE__ */ jsx46(
|
|
2762
3049
|
"span",
|
|
2763
3050
|
{
|
|
2764
3051
|
className: [
|
|
@@ -2776,15 +3063,15 @@ function FormWizardProgress({ labels }) {
|
|
|
2776
3063
|
}
|
|
2777
3064
|
|
|
2778
3065
|
// src/components/FormWizard/FormWizardNav.tsx
|
|
2779
|
-
import { jsx as
|
|
3066
|
+
import { jsx as jsx47, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2780
3067
|
function FormWizardNav({
|
|
2781
3068
|
onNext,
|
|
2782
3069
|
isSubmitting = false,
|
|
2783
3070
|
submitLabel = "Submit"
|
|
2784
3071
|
}) {
|
|
2785
3072
|
const { canGoBack, goBack, isLastStep } = useFormWizard();
|
|
2786
|
-
return /* @__PURE__ */
|
|
2787
|
-
canGoBack && /* @__PURE__ */
|
|
3073
|
+
return /* @__PURE__ */ jsxs30("div", { className: "flex items-center justify-end gap-3", children: [
|
|
3074
|
+
canGoBack && /* @__PURE__ */ jsx47(
|
|
2788
3075
|
Button,
|
|
2789
3076
|
{
|
|
2790
3077
|
variant: "secondary",
|
|
@@ -2794,7 +3081,7 @@ function FormWizardNav({
|
|
|
2794
3081
|
children: "Back"
|
|
2795
3082
|
}
|
|
2796
3083
|
),
|
|
2797
|
-
/* @__PURE__ */
|
|
3084
|
+
/* @__PURE__ */ jsx47(
|
|
2798
3085
|
Button,
|
|
2799
3086
|
{
|
|
2800
3087
|
variant: "primary",
|
|
@@ -3278,6 +3565,7 @@ export {
|
|
|
3278
3565
|
ToggleButtonGroup,
|
|
3279
3566
|
ToggleButtonGroupItem,
|
|
3280
3567
|
Tooltip,
|
|
3568
|
+
TruncatedText,
|
|
3281
3569
|
Tab2 as UnstyledTab,
|
|
3282
3570
|
TabList2 as UnstyledTabList,
|
|
3283
3571
|
TabPanel2 as UnstyledTabPanel,
|