@cytario/design 5.1.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 +39 -18
- package/dist/index.js +565 -279
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -214,48 +214,335 @@ function Button({
|
|
|
214
214
|
|
|
215
215
|
// src/components/Tooltip/Tooltip.tsx
|
|
216
216
|
import {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
217
|
+
useEffect,
|
|
218
|
+
useLayoutEffect,
|
|
219
|
+
useRef,
|
|
220
|
+
useState
|
|
221
|
+
} from "react";
|
|
222
|
+
import { createPortal } from "react-dom";
|
|
220
223
|
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
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
|
-
|
|
250
|
-
|
|
251
|
-
|
|
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
|
+
);
|
|
341
|
+
}
|
|
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 };
|
|
252
370
|
}
|
|
253
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
|
+
|
|
254
541
|
// src/components/IconButton/IconButton.tsx
|
|
255
542
|
import {
|
|
256
543
|
Button as AriaButton2
|
|
257
544
|
} from "react-aria-components";
|
|
258
|
-
import { jsx as
|
|
545
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
259
546
|
var squareSizeStyles = {
|
|
260
547
|
xs: "h-7 w-7",
|
|
261
548
|
sm: "h-8 w-8",
|
|
@@ -292,7 +579,6 @@ function IconButton({
|
|
|
292
579
|
variant = "ghost",
|
|
293
580
|
size = "md",
|
|
294
581
|
showTooltip = true,
|
|
295
|
-
tooltipPlacement = "top",
|
|
296
582
|
isLoading = false,
|
|
297
583
|
isDisabled,
|
|
298
584
|
className,
|
|
@@ -303,7 +589,7 @@ function IconButton({
|
|
|
303
589
|
const radiusClass = inGroup ? groupRadiusClass2(position) : "rounded-md";
|
|
304
590
|
const marginClass = inGroup && position !== "start" && position !== "standalone" ? "-ml-px" : "";
|
|
305
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";
|
|
306
|
-
const button = /* @__PURE__ */
|
|
592
|
+
const button = /* @__PURE__ */ jsx6(
|
|
307
593
|
AriaButton2,
|
|
308
594
|
{
|
|
309
595
|
...props,
|
|
@@ -321,11 +607,11 @@ function IconButton({
|
|
|
321
607
|
marginClass,
|
|
322
608
|
className
|
|
323
609
|
].filter(Boolean).join(" "),
|
|
324
|
-
children: isLoading ? /* @__PURE__ */
|
|
610
|
+
children: isLoading ? /* @__PURE__ */ jsx6(Spinner, { size: iconSizeMap2[size] }) : /* @__PURE__ */ jsx6(Icon, { icon, size: iconSizeMap2[size] })
|
|
325
611
|
}
|
|
326
612
|
);
|
|
327
613
|
if (showTooltip) {
|
|
328
|
-
return /* @__PURE__ */
|
|
614
|
+
return /* @__PURE__ */ jsx6(Tooltip, { content: ariaLabel, children: button });
|
|
329
615
|
}
|
|
330
616
|
return button;
|
|
331
617
|
}
|
|
@@ -342,9 +628,9 @@ import { twMerge as twMerge2 } from "tailwind-merge";
|
|
|
342
628
|
import {
|
|
343
629
|
Label as AriaLabel
|
|
344
630
|
} from "react-aria-components";
|
|
345
|
-
import { jsx as
|
|
631
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
346
632
|
function Label({ isRequired, children, className, ...props }) {
|
|
347
|
-
return /* @__PURE__ */
|
|
633
|
+
return /* @__PURE__ */ jsxs5(
|
|
348
634
|
AriaLabel,
|
|
349
635
|
{
|
|
350
636
|
...props,
|
|
@@ -356,7 +642,7 @@ function Label({ isRequired, children, className, ...props }) {
|
|
|
356
642
|
].filter(Boolean).join(" "),
|
|
357
643
|
children: [
|
|
358
644
|
children,
|
|
359
|
-
isRequired && /* @__PURE__ */
|
|
645
|
+
isRequired && /* @__PURE__ */ jsx7(
|
|
360
646
|
"span",
|
|
361
647
|
{
|
|
362
648
|
"aria-hidden": "true",
|
|
@@ -370,7 +656,7 @@ function Label({ isRequired, children, className, ...props }) {
|
|
|
370
656
|
}
|
|
371
657
|
|
|
372
658
|
// src/components/Form/Input/Input.tsx
|
|
373
|
-
import { jsx as
|
|
659
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
374
660
|
var alignClasses = {
|
|
375
661
|
left: "text-left",
|
|
376
662
|
center: "text-center",
|
|
@@ -409,7 +695,7 @@ function Input({
|
|
|
409
695
|
const borderColor = isInvalid ? "border-(--color-border-danger)" : "border-(--color-border-default) hover:border-(--color-border-strong)";
|
|
410
696
|
const radiusClass = inGroup ? groupRadiusClasses(position) : "rounded-md";
|
|
411
697
|
const marginClass = inGroup && position !== "start" && position !== "standalone" ? "-ml-px" : "";
|
|
412
|
-
return /* @__PURE__ */
|
|
698
|
+
return /* @__PURE__ */ jsxs6(
|
|
413
699
|
Field,
|
|
414
700
|
{
|
|
415
701
|
...props,
|
|
@@ -424,8 +710,8 @@ function Input({
|
|
|
424
710
|
className
|
|
425
711
|
),
|
|
426
712
|
children: [
|
|
427
|
-
label && /* @__PURE__ */
|
|
428
|
-
prefix ? /* @__PURE__ */
|
|
713
|
+
label && /* @__PURE__ */ jsx8(Label, { isRequired, children: label }),
|
|
714
|
+
prefix ? /* @__PURE__ */ jsxs6(
|
|
429
715
|
"div",
|
|
430
716
|
{
|
|
431
717
|
className: twMerge2(
|
|
@@ -440,7 +726,7 @@ function Input({
|
|
|
440
726
|
isDisabled && "opacity-50 pointer-events-none"
|
|
441
727
|
),
|
|
442
728
|
children: [
|
|
443
|
-
/* @__PURE__ */
|
|
729
|
+
/* @__PURE__ */ jsx8(
|
|
444
730
|
"span",
|
|
445
731
|
{
|
|
446
732
|
className: twMerge2(
|
|
@@ -453,7 +739,7 @@ function Input({
|
|
|
453
739
|
children: prefix
|
|
454
740
|
}
|
|
455
741
|
),
|
|
456
|
-
/* @__PURE__ */
|
|
742
|
+
/* @__PURE__ */ jsx8(
|
|
457
743
|
AriaInput,
|
|
458
744
|
{
|
|
459
745
|
placeholder,
|
|
@@ -469,7 +755,7 @@ function Input({
|
|
|
469
755
|
)
|
|
470
756
|
]
|
|
471
757
|
}
|
|
472
|
-
) : /* @__PURE__ */
|
|
758
|
+
) : /* @__PURE__ */ jsx8(
|
|
473
759
|
AriaInput,
|
|
474
760
|
{
|
|
475
761
|
placeholder,
|
|
@@ -490,7 +776,7 @@ function Input({
|
|
|
490
776
|
)
|
|
491
777
|
}
|
|
492
778
|
),
|
|
493
|
-
description && /* @__PURE__ */
|
|
779
|
+
description && /* @__PURE__ */ jsx8(
|
|
494
780
|
Text,
|
|
495
781
|
{
|
|
496
782
|
slot: "description",
|
|
@@ -498,7 +784,7 @@ function Input({
|
|
|
498
784
|
children: description
|
|
499
785
|
}
|
|
500
786
|
),
|
|
501
|
-
isInvalid && /* @__PURE__ */
|
|
787
|
+
isInvalid && /* @__PURE__ */ jsx8(
|
|
502
788
|
Text,
|
|
503
789
|
{
|
|
504
790
|
slot: "errorMessage",
|
|
@@ -524,7 +810,7 @@ import {
|
|
|
524
810
|
Text as Text2
|
|
525
811
|
} from "react-aria-components";
|
|
526
812
|
import { twMerge as twMerge3 } from "tailwind-merge";
|
|
527
|
-
import { Fragment, jsx as
|
|
813
|
+
import { Fragment, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
528
814
|
function Select({
|
|
529
815
|
label,
|
|
530
816
|
items,
|
|
@@ -539,7 +825,7 @@ function Select({
|
|
|
539
825
|
...props
|
|
540
826
|
}) {
|
|
541
827
|
const hasError = Boolean(errorMessage);
|
|
542
|
-
return /* @__PURE__ */
|
|
828
|
+
return /* @__PURE__ */ jsxs7(
|
|
543
829
|
AriaSelect,
|
|
544
830
|
{
|
|
545
831
|
...props,
|
|
@@ -548,8 +834,8 @@ function Select({
|
|
|
548
834
|
isInvalid: hasError,
|
|
549
835
|
className: twMerge3("flex flex-col gap-1", className),
|
|
550
836
|
children: [
|
|
551
|
-
label && /* @__PURE__ */
|
|
552
|
-
/* @__PURE__ */
|
|
837
|
+
label && /* @__PURE__ */ jsx9(Label, { isRequired, children: label }),
|
|
838
|
+
/* @__PURE__ */ jsxs7(
|
|
553
839
|
Button2,
|
|
554
840
|
{
|
|
555
841
|
"aria-required": isRequired || void 0,
|
|
@@ -567,7 +853,7 @@ function Select({
|
|
|
567
853
|
hasError ? "border-(--color-border-danger)" : "border-(--color-border-default)"
|
|
568
854
|
),
|
|
569
855
|
children: [
|
|
570
|
-
/* @__PURE__ */
|
|
856
|
+
/* @__PURE__ */ jsx9(
|
|
571
857
|
SelectValue,
|
|
572
858
|
{
|
|
573
859
|
className: twMerge3(
|
|
@@ -581,7 +867,7 @@ function Select({
|
|
|
581
867
|
}
|
|
582
868
|
}
|
|
583
869
|
),
|
|
584
|
-
/* @__PURE__ */
|
|
870
|
+
/* @__PURE__ */ jsx9(
|
|
585
871
|
ChevronDown,
|
|
586
872
|
{
|
|
587
873
|
"aria-hidden": true,
|
|
@@ -594,8 +880,8 @@ function Select({
|
|
|
594
880
|
]
|
|
595
881
|
}
|
|
596
882
|
),
|
|
597
|
-
description && /* @__PURE__ */
|
|
598
|
-
hasError && /* @__PURE__ */
|
|
883
|
+
description && /* @__PURE__ */ jsx9(Text2, { slot: "description", className: "text-sm text-(--color-text-secondary)", children: description }),
|
|
884
|
+
hasError && /* @__PURE__ */ jsx9(
|
|
599
885
|
Text2,
|
|
600
886
|
{
|
|
601
887
|
slot: "errorMessage",
|
|
@@ -604,7 +890,7 @@ function Select({
|
|
|
604
890
|
children: errorMessage
|
|
605
891
|
}
|
|
606
892
|
),
|
|
607
|
-
/* @__PURE__ */
|
|
893
|
+
/* @__PURE__ */ jsx9(
|
|
608
894
|
Popover,
|
|
609
895
|
{
|
|
610
896
|
className: twMerge3(
|
|
@@ -617,7 +903,7 @@ function Select({
|
|
|
617
903
|
"entering:animate-in entering:fade-in",
|
|
618
904
|
"exiting:animate-out exiting:fade-out"
|
|
619
905
|
),
|
|
620
|
-
children: /* @__PURE__ */
|
|
906
|
+
children: /* @__PURE__ */ jsx9(ListBox, { className: "p-1 outline-none", items, children: (item) => /* @__PURE__ */ jsx9(
|
|
621
907
|
ListBoxItem,
|
|
622
908
|
{
|
|
623
909
|
id: item.id,
|
|
@@ -634,9 +920,9 @@ function Select({
|
|
|
634
920
|
`,
|
|
635
921
|
sizeStyles[size]
|
|
636
922
|
),
|
|
637
|
-
children: ({ isSelected }) => /* @__PURE__ */
|
|
638
|
-
/* @__PURE__ */
|
|
639
|
-
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)" })
|
|
640
926
|
] })
|
|
641
927
|
}
|
|
642
928
|
) })
|
|
@@ -656,13 +942,13 @@ import {
|
|
|
656
942
|
TableBody as AriaTableBody,
|
|
657
943
|
TableHeader as AriaTableHeader
|
|
658
944
|
} from "react-aria-components";
|
|
659
|
-
import { jsx as
|
|
945
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
660
946
|
var tableSizeClass = {
|
|
661
947
|
compact: "[--table-row-py:theme(spacing.1)]",
|
|
662
948
|
comfortable: "[--table-row-py:theme(spacing.3)]"
|
|
663
949
|
};
|
|
664
950
|
function Table({ size = "comfortable", className, ...props }) {
|
|
665
|
-
return /* @__PURE__ */
|
|
951
|
+
return /* @__PURE__ */ jsx10(
|
|
666
952
|
AriaTable,
|
|
667
953
|
{
|
|
668
954
|
...props,
|
|
@@ -675,10 +961,10 @@ function Table({ size = "comfortable", className, ...props }) {
|
|
|
675
961
|
);
|
|
676
962
|
}
|
|
677
963
|
function TableHeader(props) {
|
|
678
|
-
return /* @__PURE__ */
|
|
964
|
+
return /* @__PURE__ */ jsx10(AriaTableHeader, { ...props });
|
|
679
965
|
}
|
|
680
966
|
function Column(props) {
|
|
681
|
-
return /* @__PURE__ */
|
|
967
|
+
return /* @__PURE__ */ jsx10(
|
|
682
968
|
AriaColumn,
|
|
683
969
|
{
|
|
684
970
|
...props,
|
|
@@ -688,18 +974,18 @@ function Column(props) {
|
|
|
688
974
|
"cursor-default select-none outline-none",
|
|
689
975
|
"focus-visible:outline-2 focus-visible:outline-(--color-border-focus) focus-visible:outline-offset-[-2px]"
|
|
690
976
|
].join(" "),
|
|
691
|
-
children: ({ allowsSorting, sortDirection }) => /* @__PURE__ */
|
|
977
|
+
children: ({ allowsSorting, sortDirection }) => /* @__PURE__ */ jsxs8("span", { className: "inline-flex items-center gap-1", children: [
|
|
692
978
|
props.children,
|
|
693
|
-
allowsSorting && /* @__PURE__ */
|
|
979
|
+
allowsSorting && /* @__PURE__ */ jsx10("span", { "aria-hidden": "true", className: "text-(--color-text-tertiary)", children: sortDirection === "ascending" ? "\u25B2" : sortDirection === "descending" ? "\u25BC" : "\u25B4" })
|
|
694
980
|
] })
|
|
695
981
|
}
|
|
696
982
|
);
|
|
697
983
|
}
|
|
698
984
|
function TableBody(props) {
|
|
699
|
-
return /* @__PURE__ */
|
|
985
|
+
return /* @__PURE__ */ jsx10(AriaTableBody, { ...props });
|
|
700
986
|
}
|
|
701
987
|
function Row(props) {
|
|
702
|
-
return /* @__PURE__ */
|
|
988
|
+
return /* @__PURE__ */ jsx10(
|
|
703
989
|
AriaRow,
|
|
704
990
|
{
|
|
705
991
|
...props,
|
|
@@ -715,7 +1001,7 @@ function Row(props) {
|
|
|
715
1001
|
);
|
|
716
1002
|
}
|
|
717
1003
|
function Cell(props) {
|
|
718
|
-
return /* @__PURE__ */
|
|
1004
|
+
return /* @__PURE__ */ jsx10(
|
|
719
1005
|
AriaCell,
|
|
720
1006
|
{
|
|
721
1007
|
...props,
|
|
@@ -737,7 +1023,7 @@ import {
|
|
|
737
1023
|
Heading
|
|
738
1024
|
} from "react-aria-components";
|
|
739
1025
|
import { X } from "lucide-react";
|
|
740
|
-
import { Fragment as Fragment2, jsx as
|
|
1026
|
+
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
741
1027
|
var sizeStyles2 = {
|
|
742
1028
|
sm: "max-w-md",
|
|
743
1029
|
md: "max-w-lg",
|
|
@@ -753,7 +1039,7 @@ function Dialog({
|
|
|
753
1039
|
children,
|
|
754
1040
|
className
|
|
755
1041
|
}) {
|
|
756
|
-
return /* @__PURE__ */
|
|
1042
|
+
return /* @__PURE__ */ jsx11(
|
|
757
1043
|
ModalOverlay,
|
|
758
1044
|
{
|
|
759
1045
|
isOpen,
|
|
@@ -765,7 +1051,7 @@ function Dialog({
|
|
|
765
1051
|
"data-[entering]:animate-in data-[entering]:fade-in",
|
|
766
1052
|
"data-[exiting]:animate-out data-[exiting]:fade-out"
|
|
767
1053
|
].join(" "),
|
|
768
|
-
children: /* @__PURE__ */
|
|
1054
|
+
children: /* @__PURE__ */ jsx11(
|
|
769
1055
|
Modal,
|
|
770
1056
|
{
|
|
771
1057
|
className: [
|
|
@@ -776,9 +1062,9 @@ function Dialog({
|
|
|
776
1062
|
"data-[exiting]:animate-out data-[exiting]:zoom-out-95 data-[exiting]:fade-out",
|
|
777
1063
|
className
|
|
778
1064
|
].filter(Boolean).join(" "),
|
|
779
|
-
children: /* @__PURE__ */
|
|
780
|
-
/* @__PURE__ */
|
|
781
|
-
/* @__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(
|
|
782
1068
|
Heading,
|
|
783
1069
|
{
|
|
784
1070
|
slot: "title",
|
|
@@ -786,7 +1072,7 @@ function Dialog({
|
|
|
786
1072
|
children: title
|
|
787
1073
|
}
|
|
788
1074
|
),
|
|
789
|
-
/* @__PURE__ */
|
|
1075
|
+
/* @__PURE__ */ jsx11(
|
|
790
1076
|
"button",
|
|
791
1077
|
{
|
|
792
1078
|
type: "button",
|
|
@@ -798,11 +1084,11 @@ function Dialog({
|
|
|
798
1084
|
"transition-colors"
|
|
799
1085
|
].join(" "),
|
|
800
1086
|
"aria-label": "Close",
|
|
801
|
-
children: /* @__PURE__ */
|
|
1087
|
+
children: /* @__PURE__ */ jsx11(X, { size: 20, "aria-hidden": "true" })
|
|
802
1088
|
}
|
|
803
1089
|
)
|
|
804
1090
|
] }),
|
|
805
|
-
/* @__PURE__ */
|
|
1091
|
+
/* @__PURE__ */ jsx11("div", { className: "px-6 py-4 overflow-y-auto", children })
|
|
806
1092
|
] }) })
|
|
807
1093
|
}
|
|
808
1094
|
)
|
|
@@ -811,20 +1097,20 @@ function Dialog({
|
|
|
811
1097
|
}
|
|
812
1098
|
|
|
813
1099
|
// src/components/Dialog/DialogFooter.tsx
|
|
814
|
-
import { jsx as
|
|
1100
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
815
1101
|
|
|
816
1102
|
// src/components/Toast/Toast.tsx
|
|
817
1103
|
import {
|
|
818
1104
|
createContext as createContext2,
|
|
819
|
-
useCallback,
|
|
1105
|
+
useCallback as useCallback2,
|
|
820
1106
|
useContext as useContext2,
|
|
821
|
-
useEffect,
|
|
822
|
-
useRef,
|
|
823
|
-
useState
|
|
1107
|
+
useEffect as useEffect2,
|
|
1108
|
+
useRef as useRef4,
|
|
1109
|
+
useState as useState5
|
|
824
1110
|
} from "react";
|
|
825
|
-
import { createPortal } from "react-dom";
|
|
1111
|
+
import { createPortal as createPortal2 } from "react-dom";
|
|
826
1112
|
import { CheckCircle, XCircle, Info, X as X2 } from "lucide-react";
|
|
827
|
-
import { jsx as
|
|
1113
|
+
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
828
1114
|
var ToastContext = createContext2(null);
|
|
829
1115
|
var toastCounter = 0;
|
|
830
1116
|
var defaultDuration = {
|
|
@@ -866,23 +1152,23 @@ function ToastItem({
|
|
|
866
1152
|
toast,
|
|
867
1153
|
onRemove
|
|
868
1154
|
}) {
|
|
869
|
-
const [isExiting, setIsExiting] =
|
|
870
|
-
const timerRef =
|
|
1155
|
+
const [isExiting, setIsExiting] = useState5(false);
|
|
1156
|
+
const timerRef = useRef4(null);
|
|
871
1157
|
const placement = useContext2(PlacementContext);
|
|
872
1158
|
const config = variantConfig[toast.variant];
|
|
873
1159
|
const IconComponent = config.icon;
|
|
874
|
-
const dismiss =
|
|
1160
|
+
const dismiss = useCallback2(() => {
|
|
875
1161
|
setIsExiting(true);
|
|
876
1162
|
setTimeout(() => onRemove(toast.id), 200);
|
|
877
1163
|
}, [onRemove, toast.id]);
|
|
878
|
-
|
|
1164
|
+
useEffect2(() => {
|
|
879
1165
|
const duration = toast.duration ?? defaultDuration[toast.variant];
|
|
880
1166
|
timerRef.current = setTimeout(dismiss, duration);
|
|
881
1167
|
return () => {
|
|
882
1168
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
883
1169
|
};
|
|
884
1170
|
}, [toast.duration, toast.variant, dismiss]);
|
|
885
|
-
return /* @__PURE__ */
|
|
1171
|
+
return /* @__PURE__ */ jsxs10(
|
|
886
1172
|
"div",
|
|
887
1173
|
{
|
|
888
1174
|
role: "status",
|
|
@@ -895,16 +1181,16 @@ function ToastItem({
|
|
|
895
1181
|
config.containerClass
|
|
896
1182
|
].join(" "),
|
|
897
1183
|
children: [
|
|
898
|
-
/* @__PURE__ */
|
|
899
|
-
/* @__PURE__ */
|
|
900
|
-
/* @__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(
|
|
901
1187
|
"button",
|
|
902
1188
|
{
|
|
903
1189
|
type: "button",
|
|
904
1190
|
onClick: dismiss,
|
|
905
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",
|
|
906
1192
|
"aria-label": "Dismiss",
|
|
907
|
-
children: /* @__PURE__ */
|
|
1193
|
+
children: /* @__PURE__ */ jsx13(X2, { size: 16, "aria-hidden": "true" })
|
|
908
1194
|
}
|
|
909
1195
|
)
|
|
910
1196
|
]
|
|
@@ -923,8 +1209,8 @@ function ToastContainer({
|
|
|
923
1209
|
placement = "bottom-right"
|
|
924
1210
|
}) {
|
|
925
1211
|
if (toasts.length === 0) return null;
|
|
926
|
-
return
|
|
927
|
-
/* @__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)) }) }),
|
|
928
1214
|
document.body
|
|
929
1215
|
);
|
|
930
1216
|
}
|
|
@@ -943,21 +1229,21 @@ function createToastBridge() {
|
|
|
943
1229
|
};
|
|
944
1230
|
}
|
|
945
1231
|
function ToastProvider({ children, bridge, placement = "bottom-right" }) {
|
|
946
|
-
const [toasts, setToasts] =
|
|
947
|
-
const addToast =
|
|
1232
|
+
const [toasts, setToasts] = useState5([]);
|
|
1233
|
+
const addToast = useCallback2((toast) => {
|
|
948
1234
|
const id = `toast-${++toastCounter}`;
|
|
949
1235
|
setToasts((prev) => [...prev, { ...toast, id }]);
|
|
950
1236
|
}, []);
|
|
951
|
-
const removeToast =
|
|
1237
|
+
const removeToast = useCallback2((id) => {
|
|
952
1238
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
953
1239
|
}, []);
|
|
954
|
-
|
|
1240
|
+
useEffect2(() => {
|
|
955
1241
|
if (!bridge) return;
|
|
956
1242
|
return bridge.subscribe(addToast);
|
|
957
1243
|
}, [bridge, addToast]);
|
|
958
|
-
return /* @__PURE__ */
|
|
1244
|
+
return /* @__PURE__ */ jsxs10(ToastContext.Provider, { value: { toasts, addToast, removeToast }, children: [
|
|
959
1245
|
children,
|
|
960
|
-
/* @__PURE__ */
|
|
1246
|
+
/* @__PURE__ */ jsx13(ToastContainer, { toasts, removeToast, placement })
|
|
961
1247
|
] });
|
|
962
1248
|
}
|
|
963
1249
|
function useToast() {
|
|
@@ -973,7 +1259,7 @@ function useToast() {
|
|
|
973
1259
|
}
|
|
974
1260
|
|
|
975
1261
|
// src/components/EmptyState/EmptyState.tsx
|
|
976
|
-
import { jsx as
|
|
1262
|
+
import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
977
1263
|
function EmptyState({
|
|
978
1264
|
icon,
|
|
979
1265
|
title,
|
|
@@ -981,7 +1267,7 @@ function EmptyState({
|
|
|
981
1267
|
action,
|
|
982
1268
|
className
|
|
983
1269
|
}) {
|
|
984
|
-
return /* @__PURE__ */
|
|
1270
|
+
return /* @__PURE__ */ jsxs11(
|
|
985
1271
|
"div",
|
|
986
1272
|
{
|
|
987
1273
|
className: [
|
|
@@ -989,10 +1275,10 @@ function EmptyState({
|
|
|
989
1275
|
className
|
|
990
1276
|
].filter(Boolean).join(" "),
|
|
991
1277
|
children: [
|
|
992
|
-
icon && /* @__PURE__ */
|
|
993
|
-
/* @__PURE__ */
|
|
994
|
-
description && /* @__PURE__ */
|
|
995
|
-
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 })
|
|
996
1282
|
]
|
|
997
1283
|
}
|
|
998
1284
|
);
|
|
@@ -1003,9 +1289,9 @@ import {
|
|
|
1003
1289
|
Checkbox as AriaCheckbox
|
|
1004
1290
|
} from "react-aria-components";
|
|
1005
1291
|
import { Check as Check2 } from "lucide-react";
|
|
1006
|
-
import { Fragment as Fragment3, jsx as
|
|
1292
|
+
import { Fragment as Fragment3, jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1007
1293
|
function Checkbox({ children, className, ...props }) {
|
|
1008
|
-
return /* @__PURE__ */
|
|
1294
|
+
return /* @__PURE__ */ jsx15(
|
|
1009
1295
|
AriaCheckbox,
|
|
1010
1296
|
{
|
|
1011
1297
|
...props,
|
|
@@ -1014,8 +1300,8 @@ function Checkbox({ children, className, ...props }) {
|
|
|
1014
1300
|
"disabled:opacity-50 disabled:cursor-default",
|
|
1015
1301
|
className
|
|
1016
1302
|
].filter(Boolean).join(" "),
|
|
1017
|
-
children: ({ isSelected, isIndeterminate }) => /* @__PURE__ */
|
|
1018
|
-
/* @__PURE__ */
|
|
1303
|
+
children: ({ isSelected, isIndeterminate }) => /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
1304
|
+
/* @__PURE__ */ jsxs12(
|
|
1019
1305
|
"div",
|
|
1020
1306
|
{
|
|
1021
1307
|
className: [
|
|
@@ -1025,12 +1311,12 @@ function Checkbox({ children, className, ...props }) {
|
|
|
1025
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)"
|
|
1026
1312
|
].join(" "),
|
|
1027
1313
|
children: [
|
|
1028
|
-
isSelected && /* @__PURE__ */
|
|
1029
|
-
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" })
|
|
1030
1316
|
]
|
|
1031
1317
|
}
|
|
1032
1318
|
),
|
|
1033
|
-
children && /* @__PURE__ */
|
|
1319
|
+
children && /* @__PURE__ */ jsx15("span", { children })
|
|
1034
1320
|
] })
|
|
1035
1321
|
}
|
|
1036
1322
|
);
|
|
@@ -1040,7 +1326,7 @@ function Checkbox({ children, className, ...props }) {
|
|
|
1040
1326
|
import {
|
|
1041
1327
|
Switch as AriaSwitch
|
|
1042
1328
|
} from "react-aria-components";
|
|
1043
|
-
import { Fragment as Fragment4, jsx as
|
|
1329
|
+
import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1044
1330
|
var trackColorMap = {
|
|
1045
1331
|
primary: "bg-(--color-action-primary)",
|
|
1046
1332
|
success: "bg-(--color-action-success)",
|
|
@@ -1057,7 +1343,7 @@ function Switch({
|
|
|
1057
1343
|
...props
|
|
1058
1344
|
}) {
|
|
1059
1345
|
const isPreset = isPresetColor(color);
|
|
1060
|
-
return /* @__PURE__ */
|
|
1346
|
+
return /* @__PURE__ */ jsx16(
|
|
1061
1347
|
AriaSwitch,
|
|
1062
1348
|
{
|
|
1063
1349
|
...props,
|
|
@@ -1066,8 +1352,8 @@ function Switch({
|
|
|
1066
1352
|
"disabled:opacity-50 disabled:cursor-default",
|
|
1067
1353
|
className
|
|
1068
1354
|
].filter(Boolean).join(" "),
|
|
1069
|
-
children: ({ isSelected }) => /* @__PURE__ */
|
|
1070
|
-
/* @__PURE__ */
|
|
1355
|
+
children: ({ isSelected }) => /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
1356
|
+
/* @__PURE__ */ jsx16(
|
|
1071
1357
|
"div",
|
|
1072
1358
|
{
|
|
1073
1359
|
className: [
|
|
@@ -1076,7 +1362,7 @@ function Switch({
|
|
|
1076
1362
|
isSelected && isPreset ? trackColorMap[color] : !isSelected ? "bg-(--color-border-strong)" : ""
|
|
1077
1363
|
].join(" "),
|
|
1078
1364
|
style: isSelected && !isPreset ? { backgroundColor: color } : void 0,
|
|
1079
|
-
children: /* @__PURE__ */
|
|
1365
|
+
children: /* @__PURE__ */ jsx16(
|
|
1080
1366
|
"div",
|
|
1081
1367
|
{
|
|
1082
1368
|
className: [
|
|
@@ -1087,7 +1373,7 @@ function Switch({
|
|
|
1087
1373
|
)
|
|
1088
1374
|
}
|
|
1089
1375
|
),
|
|
1090
|
-
children && /* @__PURE__ */
|
|
1376
|
+
children && /* @__PURE__ */ jsx16("span", { children })
|
|
1091
1377
|
] })
|
|
1092
1378
|
}
|
|
1093
1379
|
);
|
|
@@ -1098,9 +1384,9 @@ import {
|
|
|
1098
1384
|
RadioGroup as AriaRadioGroup,
|
|
1099
1385
|
Radio as AriaRadio
|
|
1100
1386
|
} from "react-aria-components";
|
|
1101
|
-
import { Fragment as Fragment5, jsx as
|
|
1387
|
+
import { Fragment as Fragment5, jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1102
1388
|
function RadioGroup({ children, className, ...props }) {
|
|
1103
|
-
return /* @__PURE__ */
|
|
1389
|
+
return /* @__PURE__ */ jsx17(
|
|
1104
1390
|
AriaRadioGroup,
|
|
1105
1391
|
{
|
|
1106
1392
|
...props,
|
|
@@ -1114,7 +1400,7 @@ function RadioGroup({ children, className, ...props }) {
|
|
|
1114
1400
|
);
|
|
1115
1401
|
}
|
|
1116
1402
|
function Radio({ children, className, ...props }) {
|
|
1117
|
-
return /* @__PURE__ */
|
|
1403
|
+
return /* @__PURE__ */ jsx17(
|
|
1118
1404
|
AriaRadio,
|
|
1119
1405
|
{
|
|
1120
1406
|
...props,
|
|
@@ -1123,8 +1409,8 @@ function Radio({ children, className, ...props }) {
|
|
|
1123
1409
|
"disabled:opacity-50 disabled:cursor-default",
|
|
1124
1410
|
className
|
|
1125
1411
|
].filter(Boolean).join(" "),
|
|
1126
|
-
children: ({ isSelected }) => /* @__PURE__ */
|
|
1127
|
-
/* @__PURE__ */
|
|
1412
|
+
children: ({ isSelected }) => /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
1413
|
+
/* @__PURE__ */ jsx17(
|
|
1128
1414
|
"div",
|
|
1129
1415
|
{
|
|
1130
1416
|
className: [
|
|
@@ -1133,16 +1419,16 @@ function Radio({ children, className, ...props }) {
|
|
|
1133
1419
|
"group-focus-visible:ring-2 group-focus-visible:ring-(--color-border-focus) group-focus-visible:ring-offset-2",
|
|
1134
1420
|
isSelected ? "border-(--color-action-primary)" : "border-(--color-border-default) group-hover:border-(--color-border-strong)"
|
|
1135
1421
|
].join(" "),
|
|
1136
|
-
children: isSelected && /* @__PURE__ */
|
|
1422
|
+
children: isSelected && /* @__PURE__ */ jsx17("div", { className: "w-2.5 h-2.5 rounded-full bg-(--color-action-primary)" })
|
|
1137
1423
|
}
|
|
1138
1424
|
),
|
|
1139
|
-
children && /* @__PURE__ */
|
|
1425
|
+
children && /* @__PURE__ */ jsx17("span", { children })
|
|
1140
1426
|
] })
|
|
1141
1427
|
}
|
|
1142
1428
|
);
|
|
1143
1429
|
}
|
|
1144
1430
|
function RadioButton({ children, className, ...props }) {
|
|
1145
|
-
return /* @__PURE__ */
|
|
1431
|
+
return /* @__PURE__ */ jsx17(
|
|
1146
1432
|
AriaRadio,
|
|
1147
1433
|
{
|
|
1148
1434
|
...props,
|
|
@@ -1151,7 +1437,7 @@ function RadioButton({ children, className, ...props }) {
|
|
|
1151
1437
|
"disabled:opacity-50 disabled:cursor-default",
|
|
1152
1438
|
className
|
|
1153
1439
|
].filter(Boolean).join(" "),
|
|
1154
|
-
children: ({ isSelected }) => /* @__PURE__ */
|
|
1440
|
+
children: ({ isSelected }) => /* @__PURE__ */ jsx17(
|
|
1155
1441
|
"div",
|
|
1156
1442
|
{
|
|
1157
1443
|
className: [
|
|
@@ -1168,9 +1454,9 @@ function RadioButton({ children, className, ...props }) {
|
|
|
1168
1454
|
}
|
|
1169
1455
|
|
|
1170
1456
|
// src/components/Form/Fieldset/Fieldset.tsx
|
|
1171
|
-
import { jsx as
|
|
1457
|
+
import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1172
1458
|
function Fieldset({ legend, children, className }) {
|
|
1173
|
-
return /* @__PURE__ */
|
|
1459
|
+
return /* @__PURE__ */ jsxs15(
|
|
1174
1460
|
"fieldset",
|
|
1175
1461
|
{
|
|
1176
1462
|
className: [
|
|
@@ -1179,7 +1465,7 @@ function Fieldset({ legend, children, className }) {
|
|
|
1179
1465
|
className
|
|
1180
1466
|
].filter(Boolean).join(" "),
|
|
1181
1467
|
children: [
|
|
1182
|
-
legend && /* @__PURE__ */
|
|
1468
|
+
legend && /* @__PURE__ */ jsx18(
|
|
1183
1469
|
"legend",
|
|
1184
1470
|
{
|
|
1185
1471
|
className: [
|
|
@@ -1199,18 +1485,18 @@ function Fieldset({ legend, children, className }) {
|
|
|
1199
1485
|
|
|
1200
1486
|
// src/components/Form/InputGroup/InputGroup.tsx
|
|
1201
1487
|
import React from "react";
|
|
1202
|
-
import { jsx as
|
|
1488
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1203
1489
|
function InputGroup({ children, className }) {
|
|
1204
1490
|
const childArray = React.Children.toArray(children).filter(
|
|
1205
1491
|
React.isValidElement
|
|
1206
1492
|
);
|
|
1207
|
-
return /* @__PURE__ */
|
|
1493
|
+
return /* @__PURE__ */ jsx19(
|
|
1208
1494
|
"div",
|
|
1209
1495
|
{
|
|
1210
1496
|
className: ["flex items-stretch", className].filter(Boolean).join(" "),
|
|
1211
1497
|
children: childArray.map((child, index) => {
|
|
1212
1498
|
const position = childArray.length === 1 ? "standalone" : index === 0 ? "start" : index === childArray.length - 1 ? "end" : "middle";
|
|
1213
|
-
return /* @__PURE__ */
|
|
1499
|
+
return /* @__PURE__ */ jsx19(
|
|
1214
1500
|
InputGroupContext.Provider,
|
|
1215
1501
|
{
|
|
1216
1502
|
value: { inGroup: true, position },
|
|
@@ -1224,7 +1510,7 @@ function InputGroup({ children, className }) {
|
|
|
1224
1510
|
}
|
|
1225
1511
|
|
|
1226
1512
|
// src/components/Form/InputAddon/InputAddon.tsx
|
|
1227
|
-
import { jsx as
|
|
1513
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1228
1514
|
function groupRadiusClass3(position) {
|
|
1229
1515
|
switch (position) {
|
|
1230
1516
|
case "start":
|
|
@@ -1241,7 +1527,7 @@ function InputAddon({ children, className }) {
|
|
|
1241
1527
|
const { inGroup, position } = useInputGroup();
|
|
1242
1528
|
const radiusClass = inGroup ? groupRadiusClass3(position) : "rounded-md";
|
|
1243
1529
|
const marginClass = inGroup && position !== "start" && position !== "standalone" ? "-ml-px" : "";
|
|
1244
|
-
return /* @__PURE__ */
|
|
1530
|
+
return /* @__PURE__ */ jsx20(
|
|
1245
1531
|
"div",
|
|
1246
1532
|
{
|
|
1247
1533
|
className: [
|
|
@@ -1261,7 +1547,7 @@ function InputAddon({ children, className }) {
|
|
|
1261
1547
|
|
|
1262
1548
|
// src/components/Heading/Heading.tsx
|
|
1263
1549
|
import { twMerge as twMerge4 } from "tailwind-merge";
|
|
1264
|
-
import { jsx as
|
|
1550
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1265
1551
|
var defaultSizeMap = {
|
|
1266
1552
|
h1: "2xl",
|
|
1267
1553
|
h2: "xl",
|
|
@@ -1291,7 +1577,7 @@ function Heading2({
|
|
|
1291
1577
|
children
|
|
1292
1578
|
}) {
|
|
1293
1579
|
const resolvedSize = size ?? defaultSizeMap[Tag];
|
|
1294
|
-
return /* @__PURE__ */
|
|
1580
|
+
return /* @__PURE__ */ jsx21(
|
|
1295
1581
|
Tag,
|
|
1296
1582
|
{
|
|
1297
1583
|
className: twMerge4(
|
|
@@ -1305,7 +1591,7 @@ function Heading2({
|
|
|
1305
1591
|
);
|
|
1306
1592
|
}
|
|
1307
1593
|
function H1(props) {
|
|
1308
|
-
return /* @__PURE__ */
|
|
1594
|
+
return /* @__PURE__ */ jsx21(
|
|
1309
1595
|
Heading2,
|
|
1310
1596
|
{
|
|
1311
1597
|
...props,
|
|
@@ -1316,17 +1602,17 @@ function H1(props) {
|
|
|
1316
1602
|
);
|
|
1317
1603
|
}
|
|
1318
1604
|
function H2(props) {
|
|
1319
|
-
return /* @__PURE__ */
|
|
1605
|
+
return /* @__PURE__ */ jsx21(Heading2, { ...props, as: "h2", size: props.size ?? "xl" });
|
|
1320
1606
|
}
|
|
1321
1607
|
function H3(props) {
|
|
1322
|
-
return /* @__PURE__ */
|
|
1608
|
+
return /* @__PURE__ */ jsx21(Heading2, { ...props, as: "h3", size: props.size ?? "lg" });
|
|
1323
1609
|
}
|
|
1324
1610
|
|
|
1325
1611
|
// src/components/Link/Link.tsx
|
|
1326
1612
|
import {
|
|
1327
1613
|
Link as AriaLink
|
|
1328
1614
|
} from "react-aria-components";
|
|
1329
|
-
import { jsx as
|
|
1615
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1330
1616
|
var variantStyles2 = {
|
|
1331
1617
|
default: [
|
|
1332
1618
|
"text-teal-700 underline",
|
|
@@ -1342,7 +1628,7 @@ function Link({
|
|
|
1342
1628
|
className,
|
|
1343
1629
|
...props
|
|
1344
1630
|
}) {
|
|
1345
|
-
return /* @__PURE__ */
|
|
1631
|
+
return /* @__PURE__ */ jsx22(
|
|
1346
1632
|
AriaLink,
|
|
1347
1633
|
{
|
|
1348
1634
|
...props,
|
|
@@ -1363,20 +1649,20 @@ import {
|
|
|
1363
1649
|
Link as Link2
|
|
1364
1650
|
} from "react-aria-components";
|
|
1365
1651
|
import { ChevronRight } from "lucide-react";
|
|
1366
|
-
import { Fragment as Fragment6, jsx as
|
|
1652
|
+
import { Fragment as Fragment6, jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1367
1653
|
function Breadcrumbs({ items, className }) {
|
|
1368
|
-
return /* @__PURE__ */
|
|
1654
|
+
return /* @__PURE__ */ jsx23(
|
|
1369
1655
|
"nav",
|
|
1370
1656
|
{
|
|
1371
1657
|
"aria-label": "Breadcrumb",
|
|
1372
1658
|
className,
|
|
1373
|
-
children: /* @__PURE__ */
|
|
1659
|
+
children: /* @__PURE__ */ jsx23(
|
|
1374
1660
|
AriaBreadcrumbs,
|
|
1375
1661
|
{
|
|
1376
1662
|
className: "flex items-center gap-1 text-sm min-w-0",
|
|
1377
1663
|
children: items.map((item, index) => {
|
|
1378
1664
|
const isLast = index === items.length - 1;
|
|
1379
|
-
return /* @__PURE__ */
|
|
1665
|
+
return /* @__PURE__ */ jsx23(
|
|
1380
1666
|
AriaBreadcrumb,
|
|
1381
1667
|
{
|
|
1382
1668
|
id: item.id,
|
|
@@ -1384,8 +1670,8 @@ function Breadcrumbs({ items, className }) {
|
|
|
1384
1670
|
"flex items-center gap-1",
|
|
1385
1671
|
isLast ? "min-w-0" : "shrink-0"
|
|
1386
1672
|
].join(" "),
|
|
1387
|
-
children: isLast ? /* @__PURE__ */
|
|
1388
|
-
/* @__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(
|
|
1389
1675
|
Link2,
|
|
1390
1676
|
{
|
|
1391
1677
|
href: item.href,
|
|
@@ -1393,7 +1679,7 @@ function Breadcrumbs({ items, className }) {
|
|
|
1393
1679
|
children: item.label
|
|
1394
1680
|
}
|
|
1395
1681
|
),
|
|
1396
|
-
/* @__PURE__ */
|
|
1682
|
+
/* @__PURE__ */ jsx23(
|
|
1397
1683
|
ChevronRight,
|
|
1398
1684
|
{
|
|
1399
1685
|
className: "shrink-0 text-neutral-400",
|
|
@@ -1417,7 +1703,7 @@ import {
|
|
|
1417
1703
|
Link as AriaLink2
|
|
1418
1704
|
} from "react-aria-components";
|
|
1419
1705
|
import { twMerge as twMerge5 } from "tailwind-merge";
|
|
1420
|
-
import { jsx as
|
|
1706
|
+
import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1421
1707
|
var iconSizeMap3 = {
|
|
1422
1708
|
xs: "sm",
|
|
1423
1709
|
sm: "sm",
|
|
@@ -1433,7 +1719,7 @@ function ButtonLink({
|
|
|
1433
1719
|
children,
|
|
1434
1720
|
...props
|
|
1435
1721
|
}) {
|
|
1436
|
-
return /* @__PURE__ */
|
|
1722
|
+
return /* @__PURE__ */ jsxs17(
|
|
1437
1723
|
AriaLink2,
|
|
1438
1724
|
{
|
|
1439
1725
|
...props,
|
|
@@ -1449,9 +1735,9 @@ function ButtonLink({
|
|
|
1449
1735
|
className
|
|
1450
1736
|
),
|
|
1451
1737
|
children: [
|
|
1452
|
-
iconLeft && /* @__PURE__ */
|
|
1738
|
+
iconLeft && /* @__PURE__ */ jsx24(Icon, { icon: iconLeft, size: iconSizeMap3[size] }),
|
|
1453
1739
|
children,
|
|
1454
|
-
iconRight && /* @__PURE__ */
|
|
1740
|
+
iconRight && /* @__PURE__ */ jsx24(Icon, { icon: iconRight, size: iconSizeMap3[size] })
|
|
1455
1741
|
]
|
|
1456
1742
|
}
|
|
1457
1743
|
);
|
|
@@ -1467,11 +1753,10 @@ function IconButtonLink({
|
|
|
1467
1753
|
variant = "ghost",
|
|
1468
1754
|
size = "md",
|
|
1469
1755
|
showTooltip = true,
|
|
1470
|
-
tooltipPlacement = "top",
|
|
1471
1756
|
className,
|
|
1472
1757
|
...props
|
|
1473
1758
|
}) {
|
|
1474
|
-
const link = /* @__PURE__ */
|
|
1759
|
+
const link = /* @__PURE__ */ jsx24(
|
|
1475
1760
|
AriaLink2,
|
|
1476
1761
|
{
|
|
1477
1762
|
...props,
|
|
@@ -1485,11 +1770,11 @@ function IconButtonLink({
|
|
|
1485
1770
|
squareSizeStyles2[size],
|
|
1486
1771
|
className
|
|
1487
1772
|
),
|
|
1488
|
-
children: /* @__PURE__ */
|
|
1773
|
+
children: /* @__PURE__ */ jsx24(Icon, { icon, size: iconSizeMap3[size] })
|
|
1489
1774
|
}
|
|
1490
1775
|
);
|
|
1491
1776
|
if (showTooltip) {
|
|
1492
|
-
return /* @__PURE__ */
|
|
1777
|
+
return /* @__PURE__ */ jsx24(Tooltip, { content: ariaLabel, children: link });
|
|
1493
1778
|
}
|
|
1494
1779
|
return link;
|
|
1495
1780
|
}
|
|
@@ -1499,7 +1784,7 @@ import {
|
|
|
1499
1784
|
ToggleButton as AriaToggleButton
|
|
1500
1785
|
} from "react-aria-components";
|
|
1501
1786
|
import { twMerge as twMerge6 } from "tailwind-merge";
|
|
1502
|
-
import { jsx as
|
|
1787
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1503
1788
|
var squareSizeStyles3 = {
|
|
1504
1789
|
xs: "h-6 w-6 text-xs",
|
|
1505
1790
|
sm: "h-7 w-7 text-sm",
|
|
@@ -1544,7 +1829,7 @@ function ToggleButton({
|
|
|
1544
1829
|
...props
|
|
1545
1830
|
}) {
|
|
1546
1831
|
const styles = variantStyles3[variant];
|
|
1547
|
-
return /* @__PURE__ */
|
|
1832
|
+
return /* @__PURE__ */ jsx25(
|
|
1548
1833
|
AriaToggleButton,
|
|
1549
1834
|
{
|
|
1550
1835
|
...props,
|
|
@@ -1571,7 +1856,7 @@ import {
|
|
|
1571
1856
|
RadioGroup as AriaRadioGroup2,
|
|
1572
1857
|
Radio as AriaRadio2
|
|
1573
1858
|
} from "react-aria-components";
|
|
1574
|
-
import { jsx as
|
|
1859
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1575
1860
|
var ToggleButtonGroupContext = createContext3({
|
|
1576
1861
|
size: "md"
|
|
1577
1862
|
});
|
|
@@ -1591,7 +1876,7 @@ function ToggleButtonGroup({
|
|
|
1591
1876
|
children,
|
|
1592
1877
|
...props
|
|
1593
1878
|
}) {
|
|
1594
|
-
return /* @__PURE__ */
|
|
1879
|
+
return /* @__PURE__ */ jsx26(ToggleButtonGroupContext.Provider, { value: { size }, children: /* @__PURE__ */ jsx26(
|
|
1595
1880
|
AriaRadioGroup2,
|
|
1596
1881
|
{
|
|
1597
1882
|
...props,
|
|
@@ -1611,7 +1896,7 @@ function ToggleButtonGroupItem({
|
|
|
1611
1896
|
...props
|
|
1612
1897
|
}) {
|
|
1613
1898
|
const { size } = useContext3(ToggleButtonGroupContext);
|
|
1614
|
-
return /* @__PURE__ */
|
|
1899
|
+
return /* @__PURE__ */ jsx26(
|
|
1615
1900
|
AriaRadio2,
|
|
1616
1901
|
{
|
|
1617
1902
|
...props,
|
|
@@ -1643,7 +1928,7 @@ import {
|
|
|
1643
1928
|
MenuItem as AriaMenuItem,
|
|
1644
1929
|
Popover as Popover2
|
|
1645
1930
|
} from "react-aria-components";
|
|
1646
|
-
import { jsx as
|
|
1931
|
+
import { jsx as jsx27, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1647
1932
|
var popoverStyles = [
|
|
1648
1933
|
"bg-(--color-surface-default) rounded-md",
|
|
1649
1934
|
"shadow-lg border border-(--color-border-default)",
|
|
@@ -1663,13 +1948,13 @@ function Menu({
|
|
|
1663
1948
|
className
|
|
1664
1949
|
}) {
|
|
1665
1950
|
const selectionProps = selectionMode && selectionMode !== "none" ? { selectionMode, selectedKeys, defaultSelectedKeys, onSelectionChange } : {};
|
|
1666
|
-
return /* @__PURE__ */
|
|
1951
|
+
return /* @__PURE__ */ jsxs18(MenuTrigger, { children: [
|
|
1667
1952
|
children,
|
|
1668
|
-
/* @__PURE__ */
|
|
1953
|
+
/* @__PURE__ */ jsx27(
|
|
1669
1954
|
Popover2,
|
|
1670
1955
|
{
|
|
1671
1956
|
className: [popoverStyles, className].filter(Boolean).join(" "),
|
|
1672
|
-
children: items ? /* @__PURE__ */
|
|
1957
|
+
children: items ? /* @__PURE__ */ jsx27(
|
|
1673
1958
|
AriaMenu,
|
|
1674
1959
|
{
|
|
1675
1960
|
items,
|
|
@@ -1680,7 +1965,7 @@ function Menu({
|
|
|
1680
1965
|
},
|
|
1681
1966
|
...selectionProps,
|
|
1682
1967
|
className: "outline-none",
|
|
1683
|
-
children: (item) => /* @__PURE__ */
|
|
1968
|
+
children: (item) => /* @__PURE__ */ jsxs18(
|
|
1684
1969
|
AriaMenuItem,
|
|
1685
1970
|
{
|
|
1686
1971
|
id: item.id,
|
|
@@ -1696,14 +1981,14 @@ function Menu({
|
|
|
1696
1981
|
item.isDanger ? "text-(--color-text-danger)" : "text-(--color-text-primary)"
|
|
1697
1982
|
].filter(Boolean).join(" "),
|
|
1698
1983
|
children: [
|
|
1699
|
-
item.icon && /* @__PURE__ */
|
|
1700
|
-
/* @__PURE__ */
|
|
1701
|
-
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 })
|
|
1702
1987
|
]
|
|
1703
1988
|
}
|
|
1704
1989
|
)
|
|
1705
1990
|
}
|
|
1706
|
-
) : /* @__PURE__ */
|
|
1991
|
+
) : /* @__PURE__ */ jsx27(
|
|
1707
1992
|
AriaMenu,
|
|
1708
1993
|
{
|
|
1709
1994
|
onAction: (key) => onAction?.(key),
|
|
@@ -1719,7 +2004,7 @@ function Menu({
|
|
|
1719
2004
|
|
|
1720
2005
|
// src/components/Menu/MenuItem.tsx
|
|
1721
2006
|
import { MenuItem as AriaMenuItem2 } from "react-aria-components";
|
|
1722
|
-
import { jsx as
|
|
2007
|
+
import { jsx as jsx28, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1723
2008
|
function MenuItem({
|
|
1724
2009
|
id,
|
|
1725
2010
|
children,
|
|
@@ -1733,7 +2018,7 @@ function MenuItem({
|
|
|
1733
2018
|
textValue,
|
|
1734
2019
|
className
|
|
1735
2020
|
}) {
|
|
1736
|
-
return /* @__PURE__ */
|
|
2021
|
+
return /* @__PURE__ */ jsxs19(
|
|
1737
2022
|
AriaMenuItem2,
|
|
1738
2023
|
{
|
|
1739
2024
|
id,
|
|
@@ -1752,9 +2037,9 @@ function MenuItem({
|
|
|
1752
2037
|
className
|
|
1753
2038
|
].filter(Boolean).join(" "),
|
|
1754
2039
|
children: [
|
|
1755
|
-
icon && /* @__PURE__ */
|
|
1756
|
-
/* @__PURE__ */
|
|
1757
|
-
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 })
|
|
1758
2043
|
]
|
|
1759
2044
|
}
|
|
1760
2045
|
);
|
|
@@ -1763,7 +2048,7 @@ function MenuItem({
|
|
|
1763
2048
|
// src/components/Menu/MenuCheckboxItem.tsx
|
|
1764
2049
|
import { MenuItem as AriaMenuItem3 } from "react-aria-components";
|
|
1765
2050
|
import { Check as Check3 } from "lucide-react";
|
|
1766
|
-
import { Fragment as Fragment7, jsx as
|
|
2051
|
+
import { Fragment as Fragment7, jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1767
2052
|
function MenuCheckboxItem({
|
|
1768
2053
|
id,
|
|
1769
2054
|
children,
|
|
@@ -1771,7 +2056,7 @@ function MenuCheckboxItem({
|
|
|
1771
2056
|
isDisabled,
|
|
1772
2057
|
className
|
|
1773
2058
|
}) {
|
|
1774
|
-
return /* @__PURE__ */
|
|
2059
|
+
return /* @__PURE__ */ jsx29(
|
|
1775
2060
|
AriaMenuItem3,
|
|
1776
2061
|
{
|
|
1777
2062
|
id,
|
|
@@ -1787,9 +2072,9 @@ function MenuCheckboxItem({
|
|
|
1787
2072
|
isSelected ? "font-medium" : "",
|
|
1788
2073
|
className
|
|
1789
2074
|
].filter(Boolean).join(" "),
|
|
1790
|
-
children: ({ isSelected }) => /* @__PURE__ */
|
|
1791
|
-
/* @__PURE__ */
|
|
1792
|
-
/* @__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 })
|
|
1793
2078
|
] })
|
|
1794
2079
|
}
|
|
1795
2080
|
);
|
|
@@ -1800,15 +2085,15 @@ import {
|
|
|
1800
2085
|
MenuSection as AriaMenuSection,
|
|
1801
2086
|
Header
|
|
1802
2087
|
} from "react-aria-components";
|
|
1803
|
-
import { jsx as
|
|
2088
|
+
import { jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1804
2089
|
function MenuSection({
|
|
1805
2090
|
header,
|
|
1806
2091
|
children,
|
|
1807
2092
|
"aria-label": ariaLabel,
|
|
1808
2093
|
className
|
|
1809
2094
|
}) {
|
|
1810
|
-
return /* @__PURE__ */
|
|
1811
|
-
header && /* @__PURE__ */
|
|
2095
|
+
return /* @__PURE__ */ jsxs21(AriaMenuSection, { className, "aria-label": ariaLabel, children: [
|
|
2096
|
+
header && /* @__PURE__ */ jsx30(
|
|
1812
2097
|
Header,
|
|
1813
2098
|
{
|
|
1814
2099
|
className: [
|
|
@@ -1827,16 +2112,16 @@ function MenuSection({
|
|
|
1827
2112
|
|
|
1828
2113
|
// src/components/Menu/MenuHeader.tsx
|
|
1829
2114
|
import { Header as Header2 } from "react-aria-components";
|
|
1830
|
-
import { jsx as
|
|
2115
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1831
2116
|
function MenuHeader({ children, className }) {
|
|
1832
|
-
return /* @__PURE__ */
|
|
2117
|
+
return /* @__PURE__ */ jsx31(Header2, { className, children });
|
|
1833
2118
|
}
|
|
1834
2119
|
|
|
1835
2120
|
// src/components/Menu/MenuSeparator.tsx
|
|
1836
2121
|
import { Separator } from "react-aria-components";
|
|
1837
|
-
import { jsx as
|
|
2122
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1838
2123
|
function MenuSeparator({ className }) {
|
|
1839
|
-
return /* @__PURE__ */
|
|
2124
|
+
return /* @__PURE__ */ jsx32(
|
|
1840
2125
|
Separator,
|
|
1841
2126
|
{
|
|
1842
2127
|
className: [
|
|
@@ -1854,16 +2139,16 @@ import {
|
|
|
1854
2139
|
Button as AriaButton3
|
|
1855
2140
|
} from "react-aria-components";
|
|
1856
2141
|
import { twMerge as twMerge8 } from "tailwind-merge";
|
|
1857
|
-
import { jsx as
|
|
2142
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1858
2143
|
function Popover3({ children, isOpen, onOpenChange }) {
|
|
1859
|
-
return /* @__PURE__ */
|
|
2144
|
+
return /* @__PURE__ */ jsx33(DialogTrigger, { isOpen, onOpenChange, children });
|
|
1860
2145
|
}
|
|
1861
2146
|
function PopoverTrigger({ children, className }) {
|
|
1862
2147
|
const cx = `
|
|
1863
2148
|
inline-flex items-center bg-transparent border-none p-0 outline-none cursor-pointer
|
|
1864
2149
|
focus-visible:ring-2 focus-visible:ring-(--color-border-focus) focus-visible:rounded-sm
|
|
1865
2150
|
`;
|
|
1866
|
-
return /* @__PURE__ */
|
|
2151
|
+
return /* @__PURE__ */ jsx33(AriaButton3, { className: twMerge8(cx, className), children });
|
|
1867
2152
|
}
|
|
1868
2153
|
function PopoverContent({
|
|
1869
2154
|
placement = "bottom",
|
|
@@ -1884,7 +2169,7 @@ function PopoverContent({
|
|
|
1884
2169
|
entering:placement-left:slide-in-from-right-1
|
|
1885
2170
|
entering:placement-right:slide-in-from-left-1
|
|
1886
2171
|
`;
|
|
1887
|
-
return /* @__PURE__ */
|
|
2172
|
+
return /* @__PURE__ */ jsx33(
|
|
1888
2173
|
AriaPopover,
|
|
1889
2174
|
{
|
|
1890
2175
|
...rest,
|
|
@@ -1905,7 +2190,7 @@ import {
|
|
|
1905
2190
|
Tab as AriaTab,
|
|
1906
2191
|
TabPanel as AriaTabPanel
|
|
1907
2192
|
} from "react-aria-components";
|
|
1908
|
-
import { jsx as
|
|
2193
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
1909
2194
|
var TabsContext = createContext4({
|
|
1910
2195
|
variant: "underline",
|
|
1911
2196
|
size: "md"
|
|
@@ -1923,7 +2208,7 @@ function Tabs({
|
|
|
1923
2208
|
children,
|
|
1924
2209
|
...props
|
|
1925
2210
|
}) {
|
|
1926
|
-
return /* @__PURE__ */
|
|
2211
|
+
return /* @__PURE__ */ jsx34(TabsContext.Provider, { value: { variant, size }, children: /* @__PURE__ */ jsx34(
|
|
1927
2212
|
AriaTabs,
|
|
1928
2213
|
{
|
|
1929
2214
|
...props,
|
|
@@ -1943,7 +2228,7 @@ function TabList({
|
|
|
1943
2228
|
const { variant } = useContext4(TabsContext);
|
|
1944
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";
|
|
1945
2230
|
const verticalStyles = variant === "unstyled" ? "flex-col" : variant === "underline" ? "flex-col border-b-0 border-r border-(--color-border-default)" : "flex-col";
|
|
1946
|
-
return /* @__PURE__ */
|
|
2231
|
+
return /* @__PURE__ */ jsx34(
|
|
1947
2232
|
AriaTabList,
|
|
1948
2233
|
{
|
|
1949
2234
|
...props,
|
|
@@ -1957,7 +2242,7 @@ function TabList({
|
|
|
1957
2242
|
}
|
|
1958
2243
|
function Tab({ className, ...props }) {
|
|
1959
2244
|
const { variant, size } = useContext4(TabsContext);
|
|
1960
|
-
return /* @__PURE__ */
|
|
2245
|
+
return /* @__PURE__ */ jsx34(
|
|
1961
2246
|
AriaTab,
|
|
1962
2247
|
{
|
|
1963
2248
|
...props,
|
|
@@ -2014,7 +2299,7 @@ function getTabVariantStyles(variant, state) {
|
|
|
2014
2299
|
}
|
|
2015
2300
|
function TabPanel({ className, ...props }) {
|
|
2016
2301
|
const { variant } = useContext4(TabsContext);
|
|
2017
|
-
return /* @__PURE__ */
|
|
2302
|
+
return /* @__PURE__ */ jsx34(
|
|
2018
2303
|
AriaTabPanel,
|
|
2019
2304
|
{
|
|
2020
2305
|
...props,
|
|
@@ -2041,7 +2326,7 @@ import {
|
|
|
2041
2326
|
ToggleButtonGroup as AriaToggleButtonGroup,
|
|
2042
2327
|
ToggleButton as AriaToggleButton2
|
|
2043
2328
|
} from "react-aria-components";
|
|
2044
|
-
import { jsx as
|
|
2329
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
2045
2330
|
var SegmentedControlContext = createContext5({
|
|
2046
2331
|
size: "md"
|
|
2047
2332
|
});
|
|
@@ -2061,7 +2346,7 @@ function SegmentedControl({
|
|
|
2061
2346
|
...props
|
|
2062
2347
|
}) {
|
|
2063
2348
|
const isNoneMode = selectionMode === "none";
|
|
2064
|
-
return /* @__PURE__ */
|
|
2349
|
+
return /* @__PURE__ */ jsx35(SegmentedControlContext.Provider, { value: { size }, children: /* @__PURE__ */ jsx35(
|
|
2065
2350
|
AriaToggleButtonGroup,
|
|
2066
2351
|
{
|
|
2067
2352
|
...props,
|
|
@@ -2082,7 +2367,7 @@ function SegmentedControlItem({
|
|
|
2082
2367
|
...props
|
|
2083
2368
|
}) {
|
|
2084
2369
|
const { size } = useContext5(SegmentedControlContext);
|
|
2085
|
-
return /* @__PURE__ */
|
|
2370
|
+
return /* @__PURE__ */ jsx35(
|
|
2086
2371
|
AriaToggleButton2,
|
|
2087
2372
|
{
|
|
2088
2373
|
...props,
|
|
@@ -2108,7 +2393,7 @@ function SegmentedControlItem({
|
|
|
2108
2393
|
|
|
2109
2394
|
// src/components/Badge/Badge.tsx
|
|
2110
2395
|
import { twMerge as twMerge11 } from "tailwind-merge";
|
|
2111
|
-
import { jsx as
|
|
2396
|
+
import { jsx as jsx36, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2112
2397
|
var variantStyles4 = {
|
|
2113
2398
|
neutral: "bg-(--color-badge-neutral-bg) text-(--color-badge-neutral-text)",
|
|
2114
2399
|
purple: "bg-(--color-badge-purple-bg) text-(--color-badge-purple-text)",
|
|
@@ -2133,7 +2418,7 @@ function Badge({
|
|
|
2133
2418
|
icon: IconComponent,
|
|
2134
2419
|
className
|
|
2135
2420
|
}) {
|
|
2136
|
-
return /* @__PURE__ */
|
|
2421
|
+
return /* @__PURE__ */ jsxs22(
|
|
2137
2422
|
"span",
|
|
2138
2423
|
{
|
|
2139
2424
|
className: twMerge11(
|
|
@@ -2144,7 +2429,7 @@ function Badge({
|
|
|
2144
2429
|
className
|
|
2145
2430
|
),
|
|
2146
2431
|
children: [
|
|
2147
|
-
IconComponent && /* @__PURE__ */
|
|
2432
|
+
IconComponent && /* @__PURE__ */ jsx36(IconComponent, { size: iconSizeMap4[size], "aria-hidden": "true" }),
|
|
2148
2433
|
children
|
|
2149
2434
|
]
|
|
2150
2435
|
}
|
|
@@ -2152,9 +2437,9 @@ function Badge({
|
|
|
2152
2437
|
}
|
|
2153
2438
|
|
|
2154
2439
|
// src/components/Card/Card.tsx
|
|
2155
|
-
import { useCallback as
|
|
2440
|
+
import { useCallback as useCallback3 } from "react";
|
|
2156
2441
|
import { twMerge as twMerge12 } from "tailwind-merge";
|
|
2157
|
-
import { Fragment as Fragment8, jsx as
|
|
2442
|
+
import { Fragment as Fragment8, jsx as jsx37, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2158
2443
|
var paddingStyles = {
|
|
2159
2444
|
none: "p-0",
|
|
2160
2445
|
sm: "p-3",
|
|
@@ -2178,7 +2463,7 @@ function Card({
|
|
|
2178
2463
|
(href || onPress) && "block focus-visible:ring-2 focus-visible:ring-(--color-border-focus) focus-visible:ring-offset-2 outline-none",
|
|
2179
2464
|
className
|
|
2180
2465
|
);
|
|
2181
|
-
const handleKeyDown =
|
|
2466
|
+
const handleKeyDown = useCallback3(
|
|
2182
2467
|
(e) => {
|
|
2183
2468
|
if (onPress && (e.key === "Enter" || e.key === " ")) {
|
|
2184
2469
|
e.preventDefault();
|
|
@@ -2187,8 +2472,8 @@ function Card({
|
|
|
2187
2472
|
},
|
|
2188
2473
|
[onPress]
|
|
2189
2474
|
);
|
|
2190
|
-
const content = /* @__PURE__ */
|
|
2191
|
-
header && /* @__PURE__ */
|
|
2475
|
+
const content = /* @__PURE__ */ jsxs23(Fragment8, { children: [
|
|
2476
|
+
header && /* @__PURE__ */ jsx37(
|
|
2192
2477
|
"div",
|
|
2193
2478
|
{
|
|
2194
2479
|
className: twMerge12(
|
|
@@ -2198,8 +2483,8 @@ function Card({
|
|
|
2198
2483
|
children: header
|
|
2199
2484
|
}
|
|
2200
2485
|
),
|
|
2201
|
-
/* @__PURE__ */
|
|
2202
|
-
footer && /* @__PURE__ */
|
|
2486
|
+
/* @__PURE__ */ jsx37("div", { className: paddingStyles[padding], children }),
|
|
2487
|
+
footer && /* @__PURE__ */ jsx37(
|
|
2203
2488
|
"div",
|
|
2204
2489
|
{
|
|
2205
2490
|
className: twMerge12(
|
|
@@ -2211,10 +2496,10 @@ function Card({
|
|
|
2211
2496
|
)
|
|
2212
2497
|
] });
|
|
2213
2498
|
if (href) {
|
|
2214
|
-
return /* @__PURE__ */
|
|
2499
|
+
return /* @__PURE__ */ jsx37("a", { href, className: containerClass, children: content });
|
|
2215
2500
|
}
|
|
2216
2501
|
if (onPress) {
|
|
2217
|
-
return /* @__PURE__ */
|
|
2502
|
+
return /* @__PURE__ */ jsx37(
|
|
2218
2503
|
"div",
|
|
2219
2504
|
{
|
|
2220
2505
|
role: "button",
|
|
@@ -2226,13 +2511,13 @@ function Card({
|
|
|
2226
2511
|
}
|
|
2227
2512
|
);
|
|
2228
2513
|
}
|
|
2229
|
-
return /* @__PURE__ */
|
|
2514
|
+
return /* @__PURE__ */ jsx37("div", { className: containerClass, children: content });
|
|
2230
2515
|
}
|
|
2231
2516
|
|
|
2232
2517
|
// src/components/DeltaIndicator/DeltaIndicator.tsx
|
|
2233
2518
|
import { ArrowUp, ArrowDown, Minus } from "lucide-react";
|
|
2234
2519
|
import { twMerge as twMerge13 } from "tailwind-merge";
|
|
2235
|
-
import { jsx as
|
|
2520
|
+
import { jsx as jsx38, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2236
2521
|
function getDirection(current, previous) {
|
|
2237
2522
|
const diff = current - previous;
|
|
2238
2523
|
if (diff > 0) return "increase";
|
|
@@ -2285,7 +2570,7 @@ function DeltaIndicator({
|
|
|
2285
2570
|
className
|
|
2286
2571
|
}) {
|
|
2287
2572
|
if (unavailable) {
|
|
2288
|
-
return /* @__PURE__ */
|
|
2573
|
+
return /* @__PURE__ */ jsxs24(
|
|
2289
2574
|
"span",
|
|
2290
2575
|
{
|
|
2291
2576
|
className: twMerge13(
|
|
@@ -2294,7 +2579,7 @@ function DeltaIndicator({
|
|
|
2294
2579
|
className
|
|
2295
2580
|
),
|
|
2296
2581
|
children: [
|
|
2297
|
-
label && /* @__PURE__ */
|
|
2582
|
+
label && /* @__PURE__ */ jsx38("span", { className: "text-sm text-(--color-text-secondary) mr-1", children: label }),
|
|
2298
2583
|
unavailableText
|
|
2299
2584
|
]
|
|
2300
2585
|
}
|
|
@@ -2324,7 +2609,7 @@ function DeltaIndicator({
|
|
|
2324
2609
|
}
|
|
2325
2610
|
}
|
|
2326
2611
|
const isPill = mode === "pill";
|
|
2327
|
-
return /* @__PURE__ */
|
|
2612
|
+
return /* @__PURE__ */ jsxs24(
|
|
2328
2613
|
"span",
|
|
2329
2614
|
{
|
|
2330
2615
|
className: twMerge13(
|
|
@@ -2338,8 +2623,8 @@ function DeltaIndicator({
|
|
|
2338
2623
|
className
|
|
2339
2624
|
),
|
|
2340
2625
|
children: [
|
|
2341
|
-
label && /* @__PURE__ */
|
|
2342
|
-
/* @__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 }),
|
|
2343
2628
|
valueText
|
|
2344
2629
|
]
|
|
2345
2630
|
}
|
|
@@ -2348,7 +2633,7 @@ function DeltaIndicator({
|
|
|
2348
2633
|
|
|
2349
2634
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
2350
2635
|
import { twMerge as twMerge14 } from "tailwind-merge";
|
|
2351
|
-
import { jsx as
|
|
2636
|
+
import { jsx as jsx39, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2352
2637
|
var fillStyles = {
|
|
2353
2638
|
brand: "bg-(--color-progress-fill)",
|
|
2354
2639
|
success: "bg-(--color-progress-fill-success)",
|
|
@@ -2371,12 +2656,12 @@ function ProgressBar({
|
|
|
2371
2656
|
className
|
|
2372
2657
|
}) {
|
|
2373
2658
|
const clampedValue = Math.min(100, Math.max(0, value));
|
|
2374
|
-
return /* @__PURE__ */
|
|
2375
|
-
(label || description || showValue) && /* @__PURE__ */
|
|
2376
|
-
/* @__PURE__ */
|
|
2377
|
-
/* @__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) })
|
|
2378
2663
|
] }),
|
|
2379
|
-
/* @__PURE__ */
|
|
2664
|
+
/* @__PURE__ */ jsx39(
|
|
2380
2665
|
"div",
|
|
2381
2666
|
{
|
|
2382
2667
|
role: "progressbar",
|
|
@@ -2388,7 +2673,7 @@ function ProgressBar({
|
|
|
2388
2673
|
"w-full rounded-full bg-(--color-progress-track)",
|
|
2389
2674
|
sizeStyles8[size]
|
|
2390
2675
|
),
|
|
2391
|
-
children: /* @__PURE__ */
|
|
2676
|
+
children: /* @__PURE__ */ jsx39(
|
|
2392
2677
|
"div",
|
|
2393
2678
|
{
|
|
2394
2679
|
className: twMerge14(
|
|
@@ -2404,7 +2689,7 @@ function ProgressBar({
|
|
|
2404
2689
|
}
|
|
2405
2690
|
|
|
2406
2691
|
// src/components/Banner/Banner.tsx
|
|
2407
|
-
import { useState as
|
|
2692
|
+
import { useState as useState6 } from "react";
|
|
2408
2693
|
import {
|
|
2409
2694
|
Info as Info2,
|
|
2410
2695
|
AlertTriangle,
|
|
@@ -2413,7 +2698,7 @@ import {
|
|
|
2413
2698
|
X as X3
|
|
2414
2699
|
} from "lucide-react";
|
|
2415
2700
|
import { twMerge as twMerge15 } from "tailwind-merge";
|
|
2416
|
-
import { jsx as
|
|
2701
|
+
import { jsx as jsx40, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2417
2702
|
var variantConfig2 = {
|
|
2418
2703
|
info: {
|
|
2419
2704
|
icon: Info2,
|
|
@@ -2449,7 +2734,7 @@ function Banner({
|
|
|
2449
2734
|
onDismiss,
|
|
2450
2735
|
className
|
|
2451
2736
|
}) {
|
|
2452
|
-
const [dismissed, setDismissed] =
|
|
2737
|
+
const [dismissed, setDismissed] = useState6(false);
|
|
2453
2738
|
if (dismissed) return null;
|
|
2454
2739
|
const config = variantConfig2[variant];
|
|
2455
2740
|
const IconComponent = icon ?? config.icon;
|
|
@@ -2457,7 +2742,7 @@ function Banner({
|
|
|
2457
2742
|
setDismissed(true);
|
|
2458
2743
|
onDismiss?.();
|
|
2459
2744
|
};
|
|
2460
|
-
return /* @__PURE__ */
|
|
2745
|
+
return /* @__PURE__ */ jsxs26(
|
|
2461
2746
|
"div",
|
|
2462
2747
|
{
|
|
2463
2748
|
role: config.role,
|
|
@@ -2468,7 +2753,7 @@ function Banner({
|
|
|
2468
2753
|
className
|
|
2469
2754
|
),
|
|
2470
2755
|
children: [
|
|
2471
|
-
/* @__PURE__ */
|
|
2756
|
+
/* @__PURE__ */ jsx40(
|
|
2472
2757
|
IconComponent,
|
|
2473
2758
|
{
|
|
2474
2759
|
size: 20,
|
|
@@ -2476,21 +2761,21 @@ function Banner({
|
|
|
2476
2761
|
"aria-hidden": "true"
|
|
2477
2762
|
}
|
|
2478
2763
|
),
|
|
2479
|
-
/* @__PURE__ */
|
|
2480
|
-
title && /* @__PURE__ */
|
|
2764
|
+
/* @__PURE__ */ jsxs26("div", { className: "flex-1", children: [
|
|
2765
|
+
title && /* @__PURE__ */ jsxs26("span", { className: "font-medium", children: [
|
|
2481
2766
|
title,
|
|
2482
2767
|
" \u2014 "
|
|
2483
2768
|
] }),
|
|
2484
2769
|
children
|
|
2485
2770
|
] }),
|
|
2486
|
-
dismissible && /* @__PURE__ */
|
|
2771
|
+
dismissible && /* @__PURE__ */ jsx40(
|
|
2487
2772
|
"button",
|
|
2488
2773
|
{
|
|
2489
2774
|
type: "button",
|
|
2490
2775
|
onClick: handleDismiss,
|
|
2491
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",
|
|
2492
2777
|
"aria-label": "Dismiss",
|
|
2493
|
-
children: /* @__PURE__ */
|
|
2778
|
+
children: /* @__PURE__ */ jsx40(X3, { size: 16, "aria-hidden": "true" })
|
|
2494
2779
|
}
|
|
2495
2780
|
)
|
|
2496
2781
|
]
|
|
@@ -2500,7 +2785,7 @@ function Banner({
|
|
|
2500
2785
|
|
|
2501
2786
|
// src/components/MetricCard/MetricCard.tsx
|
|
2502
2787
|
import { twMerge as twMerge16 } from "tailwind-merge";
|
|
2503
|
-
import { Fragment as Fragment9, jsx as
|
|
2788
|
+
import { Fragment as Fragment9, jsx as jsx41, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2504
2789
|
var sizeConfig = {
|
|
2505
2790
|
sm: {
|
|
2506
2791
|
padding: "p-3",
|
|
@@ -2528,9 +2813,9 @@ function MetricCard({
|
|
|
2528
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",
|
|
2529
2814
|
className
|
|
2530
2815
|
);
|
|
2531
|
-
const content = /* @__PURE__ */
|
|
2532
|
-
/* @__PURE__ */
|
|
2533
|
-
/* @__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(
|
|
2534
2819
|
"div",
|
|
2535
2820
|
{
|
|
2536
2821
|
className: twMerge16(
|
|
@@ -2540,23 +2825,23 @@ function MetricCard({
|
|
|
2540
2825
|
children: value
|
|
2541
2826
|
}
|
|
2542
2827
|
),
|
|
2543
|
-
secondary && /* @__PURE__ */
|
|
2828
|
+
secondary && /* @__PURE__ */ jsx41("div", { className: "mt-1 text-sm", children: secondary })
|
|
2544
2829
|
] });
|
|
2545
2830
|
if (href) {
|
|
2546
|
-
return /* @__PURE__ */
|
|
2831
|
+
return /* @__PURE__ */ jsx41("a", { href, className: containerClass, children: content });
|
|
2547
2832
|
}
|
|
2548
|
-
return /* @__PURE__ */
|
|
2833
|
+
return /* @__PURE__ */ jsx41("div", { className: containerClass, children: content });
|
|
2549
2834
|
}
|
|
2550
2835
|
|
|
2551
2836
|
// src/components/SectionHeader/SectionHeader.tsx
|
|
2552
2837
|
import { twMerge as twMerge17 } from "tailwind-merge";
|
|
2553
|
-
import { jsx as
|
|
2838
|
+
import { jsx as jsx42, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2554
2839
|
function SectionHeader({
|
|
2555
2840
|
title,
|
|
2556
2841
|
children,
|
|
2557
2842
|
className
|
|
2558
2843
|
}) {
|
|
2559
|
-
return /* @__PURE__ */
|
|
2844
|
+
return /* @__PURE__ */ jsxs28(
|
|
2560
2845
|
"div",
|
|
2561
2846
|
{
|
|
2562
2847
|
className: twMerge17(
|
|
@@ -2564,8 +2849,8 @@ function SectionHeader({
|
|
|
2564
2849
|
className
|
|
2565
2850
|
),
|
|
2566
2851
|
children: [
|
|
2567
|
-
/* @__PURE__ */
|
|
2568
|
-
children && /* @__PURE__ */
|
|
2852
|
+
/* @__PURE__ */ jsx42(H2, { children: title }),
|
|
2853
|
+
children && /* @__PURE__ */ jsx42("div", { className: "ml-auto flex flex-wrap items-center gap-2", children })
|
|
2569
2854
|
]
|
|
2570
2855
|
}
|
|
2571
2856
|
);
|
|
@@ -2573,7 +2858,7 @@ function SectionHeader({
|
|
|
2573
2858
|
|
|
2574
2859
|
// src/components/Pill/Pill.tsx
|
|
2575
2860
|
import { twMerge as twMerge18 } from "tailwind-merge";
|
|
2576
|
-
import { jsx as
|
|
2861
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
2577
2862
|
var hashColors = {
|
|
2578
2863
|
purple: "bg-(--color-badge-purple-bg) text-(--color-badge-purple-text) border-(--color-badge-purple-text)/20",
|
|
2579
2864
|
teal: "bg-(--color-badge-teal-bg) text-(--color-badge-teal-text) border-(--color-badge-teal-text)/20",
|
|
@@ -2611,12 +2896,12 @@ function Pill({
|
|
|
2611
2896
|
colorStyles[color],
|
|
2612
2897
|
className
|
|
2613
2898
|
);
|
|
2614
|
-
return /* @__PURE__ */
|
|
2899
|
+
return /* @__PURE__ */ jsx43("span", { className: cx, ...rest, children });
|
|
2615
2900
|
}
|
|
2616
2901
|
|
|
2617
2902
|
// src/components/Pill/PathPill.tsx
|
|
2618
2903
|
import { twMerge as twMerge19 } from "tailwind-merge";
|
|
2619
|
-
import { jsx as
|
|
2904
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
2620
2905
|
function PathPill({
|
|
2621
2906
|
children,
|
|
2622
2907
|
visibleCount,
|
|
@@ -2628,7 +2913,7 @@ function PathPill({
|
|
|
2628
2913
|
const effectiveVisible = visibleCount ?? segments.length;
|
|
2629
2914
|
const dotCount = Math.max(0, segments.length - effectiveVisible);
|
|
2630
2915
|
const fullPath = segments.join(" / ");
|
|
2631
|
-
return /* @__PURE__ */
|
|
2916
|
+
return /* @__PURE__ */ jsx44(
|
|
2632
2917
|
"div",
|
|
2633
2918
|
{
|
|
2634
2919
|
className: twMerge19("relative flex", className),
|
|
@@ -2638,7 +2923,7 @@ function PathPill({
|
|
|
2638
2923
|
const isLast = i === segments.length - 1;
|
|
2639
2924
|
const cx = twMerge19(!isLast && "pr-5 -mr-4", isCollapsed && "pr-3");
|
|
2640
2925
|
const color = colorFn ? colorFn(segment, i) : pillColorFromName(segment);
|
|
2641
|
-
return /* @__PURE__ */
|
|
2926
|
+
return /* @__PURE__ */ jsx44(
|
|
2642
2927
|
Pill,
|
|
2643
2928
|
{
|
|
2644
2929
|
className: cx,
|
|
@@ -2654,8 +2939,8 @@ function PathPill({
|
|
|
2654
2939
|
}
|
|
2655
2940
|
|
|
2656
2941
|
// src/components/FormWizard/FormWizard.tsx
|
|
2657
|
-
import { createContext as createContext6, useContext as useContext6, useCallback as
|
|
2658
|
-
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";
|
|
2659
2944
|
var FormWizardContext = createContext6({
|
|
2660
2945
|
currentStep: 0,
|
|
2661
2946
|
totalSteps: 1,
|
|
@@ -2675,7 +2960,7 @@ function FormWizard({
|
|
|
2675
2960
|
}) {
|
|
2676
2961
|
const canGoBack = currentStep > 0;
|
|
2677
2962
|
const isLastStep = currentStep >= totalSteps - 1;
|
|
2678
|
-
const goBack =
|
|
2963
|
+
const goBack = useCallback4(() => {
|
|
2679
2964
|
if (currentStep > 0) {
|
|
2680
2965
|
onStepChange(currentStep - 1);
|
|
2681
2966
|
}
|
|
@@ -2690,13 +2975,13 @@ function FormWizard({
|
|
|
2690
2975
|
}),
|
|
2691
2976
|
[currentStep, totalSteps, canGoBack, goBack, isLastStep]
|
|
2692
2977
|
);
|
|
2693
|
-
return /* @__PURE__ */
|
|
2978
|
+
return /* @__PURE__ */ jsx45(FormWizardContext.Provider, { value, children });
|
|
2694
2979
|
}
|
|
2695
2980
|
|
|
2696
2981
|
// src/components/FormWizard/FormWizardProgress.tsx
|
|
2697
|
-
import { jsx as
|
|
2982
|
+
import { jsx as jsx46, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2698
2983
|
function CheckIcon() {
|
|
2699
|
-
return /* @__PURE__ */
|
|
2984
|
+
return /* @__PURE__ */ jsx46(
|
|
2700
2985
|
"svg",
|
|
2701
2986
|
{
|
|
2702
2987
|
"aria-hidden": "true",
|
|
@@ -2707,24 +2992,24 @@ function CheckIcon() {
|
|
|
2707
2992
|
strokeWidth: "2",
|
|
2708
2993
|
strokeLinecap: "round",
|
|
2709
2994
|
strokeLinejoin: "round",
|
|
2710
|
-
children: /* @__PURE__ */
|
|
2995
|
+
children: /* @__PURE__ */ jsx46("path", { d: "M3 8.5l3.5 3.5 6.5-7" })
|
|
2711
2996
|
}
|
|
2712
2997
|
);
|
|
2713
2998
|
}
|
|
2714
2999
|
function FormWizardProgress({ labels }) {
|
|
2715
3000
|
const { currentStep, totalSteps } = useFormWizard();
|
|
2716
|
-
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) => {
|
|
2717
3002
|
const isCompleted = index < currentStep;
|
|
2718
3003
|
const isCurrent = index === currentStep;
|
|
2719
3004
|
const isFuture = index > currentStep;
|
|
2720
|
-
return /* @__PURE__ */
|
|
3005
|
+
return /* @__PURE__ */ jsxs29(
|
|
2721
3006
|
"li",
|
|
2722
3007
|
{
|
|
2723
3008
|
className: "flex flex-1 flex-col items-center",
|
|
2724
3009
|
"aria-current": isCurrent ? "step" : void 0,
|
|
2725
3010
|
children: [
|
|
2726
|
-
/* @__PURE__ */
|
|
2727
|
-
index > 0 ? /* @__PURE__ */
|
|
3011
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex w-full items-center", children: [
|
|
3012
|
+
index > 0 ? /* @__PURE__ */ jsx46(
|
|
2728
3013
|
"div",
|
|
2729
3014
|
{
|
|
2730
3015
|
"aria-hidden": "true",
|
|
@@ -2733,8 +3018,8 @@ function FormWizardProgress({ labels }) {
|
|
|
2733
3018
|
index <= currentStep ? "bg-(--color-brand-primary)" : "bg-(--color-border-default)"
|
|
2734
3019
|
].join(" ")
|
|
2735
3020
|
}
|
|
2736
|
-
) : /* @__PURE__ */
|
|
2737
|
-
/* @__PURE__ */
|
|
3021
|
+
) : /* @__PURE__ */ jsx46("div", { className: "flex-1", "aria-hidden": "true" }),
|
|
3022
|
+
/* @__PURE__ */ jsx46(
|
|
2738
3023
|
"div",
|
|
2739
3024
|
{
|
|
2740
3025
|
className: [
|
|
@@ -2746,10 +3031,10 @@ function FormWizardProgress({ labels }) {
|
|
|
2746
3031
|
isFuture ? "border-2 border-(--color-border-default) bg-(--color-surface-default) text-(--color-text-tertiary)" : ""
|
|
2747
3032
|
].join(" "),
|
|
2748
3033
|
"aria-hidden": "true",
|
|
2749
|
-
children: isCompleted ? /* @__PURE__ */
|
|
3034
|
+
children: isCompleted ? /* @__PURE__ */ jsx46(CheckIcon, {}) : index + 1
|
|
2750
3035
|
}
|
|
2751
3036
|
),
|
|
2752
|
-
index < totalSteps - 1 ? /* @__PURE__ */
|
|
3037
|
+
index < totalSteps - 1 ? /* @__PURE__ */ jsx46(
|
|
2753
3038
|
"div",
|
|
2754
3039
|
{
|
|
2755
3040
|
"aria-hidden": "true",
|
|
@@ -2758,9 +3043,9 @@ function FormWizardProgress({ labels }) {
|
|
|
2758
3043
|
index < currentStep ? "bg-(--color-brand-primary)" : "bg-(--color-border-default)"
|
|
2759
3044
|
].join(" ")
|
|
2760
3045
|
}
|
|
2761
|
-
) : /* @__PURE__ */
|
|
3046
|
+
) : /* @__PURE__ */ jsx46("div", { className: "flex-1", "aria-hidden": "true" })
|
|
2762
3047
|
] }),
|
|
2763
|
-
/* @__PURE__ */
|
|
3048
|
+
/* @__PURE__ */ jsx46(
|
|
2764
3049
|
"span",
|
|
2765
3050
|
{
|
|
2766
3051
|
className: [
|
|
@@ -2778,15 +3063,15 @@ function FormWizardProgress({ labels }) {
|
|
|
2778
3063
|
}
|
|
2779
3064
|
|
|
2780
3065
|
// src/components/FormWizard/FormWizardNav.tsx
|
|
2781
|
-
import { jsx as
|
|
3066
|
+
import { jsx as jsx47, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2782
3067
|
function FormWizardNav({
|
|
2783
3068
|
onNext,
|
|
2784
3069
|
isSubmitting = false,
|
|
2785
3070
|
submitLabel = "Submit"
|
|
2786
3071
|
}) {
|
|
2787
3072
|
const { canGoBack, goBack, isLastStep } = useFormWizard();
|
|
2788
|
-
return /* @__PURE__ */
|
|
2789
|
-
canGoBack && /* @__PURE__ */
|
|
3073
|
+
return /* @__PURE__ */ jsxs30("div", { className: "flex items-center justify-end gap-3", children: [
|
|
3074
|
+
canGoBack && /* @__PURE__ */ jsx47(
|
|
2790
3075
|
Button,
|
|
2791
3076
|
{
|
|
2792
3077
|
variant: "secondary",
|
|
@@ -2796,7 +3081,7 @@ function FormWizardNav({
|
|
|
2796
3081
|
children: "Back"
|
|
2797
3082
|
}
|
|
2798
3083
|
),
|
|
2799
|
-
/* @__PURE__ */
|
|
3084
|
+
/* @__PURE__ */ jsx47(
|
|
2800
3085
|
Button,
|
|
2801
3086
|
{
|
|
2802
3087
|
variant: "primary",
|
|
@@ -3280,6 +3565,7 @@ export {
|
|
|
3280
3565
|
ToggleButtonGroup,
|
|
3281
3566
|
ToggleButtonGroupItem,
|
|
3282
3567
|
Tooltip,
|
|
3568
|
+
TruncatedText,
|
|
3283
3569
|
Tab2 as UnstyledTab,
|
|
3284
3570
|
TabList2 as UnstyledTabList,
|
|
3285
3571
|
TabPanel2 as UnstyledTabPanel,
|