@aviala-design/spiral 2.0.0 → 2.1.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.cjs +690 -425
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +115 -4
- package/dist/index.d.ts +115 -4
- package/dist/index.js +625 -358
- package/dist/index.js.map +1 -1
- package/dist/props.json +7 -1
- package/dist/styles.css +8 -1
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -77,6 +77,7 @@ __export(index_exports, {
|
|
|
77
77
|
Feedback: () => Feedback,
|
|
78
78
|
Fieldset: () => Fieldset,
|
|
79
79
|
FormField: () => FormField,
|
|
80
|
+
HoverPopover: () => HoverPopover,
|
|
80
81
|
Input: () => Input,
|
|
81
82
|
InputGroup: () => InputGroup,
|
|
82
83
|
InputGroupAddon: () => InputGroupAddon,
|
|
@@ -127,6 +128,7 @@ __export(index_exports, {
|
|
|
127
128
|
RadioGroup: () => RadioGroup,
|
|
128
129
|
RadioGroupItem: () => RadioGroupItem,
|
|
129
130
|
RadioInput: () => RadioInput,
|
|
131
|
+
ResponsiveTooltip: () => ResponsiveTooltip,
|
|
130
132
|
Scroll: () => Scroll,
|
|
131
133
|
ScrollPicker: () => ScrollPicker,
|
|
132
134
|
ScrollPickerColumn: () => ScrollPickerColumn,
|
|
@@ -643,6 +645,10 @@ var buttonVariants = (0, import_class_variance_authority3.cva)(
|
|
|
643
645
|
allRound: {
|
|
644
646
|
true: "min-w-[var(--button-min-width-allround,48px)] !rounded-[var(--border-radius-allround,99px)]",
|
|
645
647
|
false: "min-w-[var(--button-min-width,46px)]"
|
|
648
|
+
},
|
|
649
|
+
compact: {
|
|
650
|
+
true: "min-w-0",
|
|
651
|
+
false: ""
|
|
646
652
|
}
|
|
647
653
|
},
|
|
648
654
|
defaultVariants: {
|
|
@@ -727,6 +733,7 @@ var Button = (0, import_react6.forwardRef)(
|
|
|
727
733
|
variant,
|
|
728
734
|
size: sizeProp,
|
|
729
735
|
allRound = false,
|
|
736
|
+
compact,
|
|
730
737
|
iconOnly: iconOnlyProp,
|
|
731
738
|
asChild = false,
|
|
732
739
|
loading = false,
|
|
@@ -781,7 +788,7 @@ var Button = (0, import_react6.forwardRef)(
|
|
|
781
788
|
!iconOnly && renderIcon(rightIcon, iconLevel, void 0, "button.icon-right")
|
|
782
789
|
] });
|
|
783
790
|
const classes = cn(
|
|
784
|
-
buttonVariants({ mode, ...iconOnly ? {} : { allRound } }),
|
|
791
|
+
buttonVariants({ mode, ...iconOnly ? {} : { allRound }, compact }),
|
|
785
792
|
iconOnly && "min-w-0",
|
|
786
793
|
iconOnly && allRound && "!rounded-[var(--border-radius-allround,99px)]",
|
|
787
794
|
className
|
|
@@ -3240,10 +3247,13 @@ function useSegmentatorState(value, defaultValue, onValueChange) {
|
|
|
3240
3247
|
const [internal, setInternal] = (0, import_react23.useState)(defaultValue ?? "");
|
|
3241
3248
|
const isControlled = value !== void 0;
|
|
3242
3249
|
const current = isControlled ? value : internal;
|
|
3243
|
-
const setValue = (
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3250
|
+
const setValue = (0, import_react23.useCallback)(
|
|
3251
|
+
(next) => {
|
|
3252
|
+
if (!isControlled) setInternal(next);
|
|
3253
|
+
onValueChange?.(next);
|
|
3254
|
+
},
|
|
3255
|
+
[isControlled, onValueChange]
|
|
3256
|
+
);
|
|
3247
3257
|
return [current, setValue];
|
|
3248
3258
|
}
|
|
3249
3259
|
var SEGMENTATOR_DRAG_THRESHOLD_PX = 4;
|
|
@@ -3288,6 +3298,16 @@ function getEnabledSegmentatorItems(group) {
|
|
|
3288
3298
|
group.querySelectorAll(".aviala-segmentator-item:not(:disabled)")
|
|
3289
3299
|
);
|
|
3290
3300
|
}
|
|
3301
|
+
function applyDragPreview(group, activeItem) {
|
|
3302
|
+
const items = getEnabledSegmentatorItems(group);
|
|
3303
|
+
for (const item of items) {
|
|
3304
|
+
if (item === activeItem) {
|
|
3305
|
+
item.setAttribute("data-drag-preview", "true");
|
|
3306
|
+
} else {
|
|
3307
|
+
item.removeAttribute("data-drag-preview");
|
|
3308
|
+
}
|
|
3309
|
+
}
|
|
3310
|
+
}
|
|
3291
3311
|
function measureItemThumbMetrics(item, group) {
|
|
3292
3312
|
const groupRect = group.getBoundingClientRect();
|
|
3293
3313
|
const itemRect = item.getBoundingClientRect();
|
|
@@ -3509,7 +3529,6 @@ var SegmentatorGroup = (0, import_react23.forwardRef)(
|
|
|
3509
3529
|
const layoutKey = useThemeLayoutKey();
|
|
3510
3530
|
const consumeClickRef = (0, import_react23.useRef)(false);
|
|
3511
3531
|
const pointerDragRef = (0, import_react23.useRef)(null);
|
|
3512
|
-
const [dragPreviewValue, setDragPreviewValue] = (0, import_react23.useState)(null);
|
|
3513
3532
|
const [dragState, setDragState] = (0, import_react23.useState)({
|
|
3514
3533
|
pressing: false,
|
|
3515
3534
|
active: false
|
|
@@ -3518,9 +3537,12 @@ var SegmentatorGroup = (0, import_react23.forwardRef)(
|
|
|
3518
3537
|
const resetPointerInteraction = (0, import_react23.useCallback)(() => {
|
|
3519
3538
|
pointerDragRef.current?.cleanupWindowListeners?.();
|
|
3520
3539
|
pointerDragRef.current = null;
|
|
3521
|
-
setDragPreviewValue(null);
|
|
3522
3540
|
setDragState({ pressing: false, active: false });
|
|
3523
|
-
const
|
|
3541
|
+
const group = groupRef.current;
|
|
3542
|
+
if (group) {
|
|
3543
|
+
applyDragPreview(group, null);
|
|
3544
|
+
}
|
|
3545
|
+
const thumbEl = group?.querySelector(
|
|
3524
3546
|
".aviala-segmentator-thumb"
|
|
3525
3547
|
);
|
|
3526
3548
|
if (thumbEl) {
|
|
@@ -3577,8 +3599,8 @@ var SegmentatorGroup = (0, import_react23.forwardRef)(
|
|
|
3577
3599
|
if (itemChanged) {
|
|
3578
3600
|
triggerSegmentatorHaptic("select");
|
|
3579
3601
|
drag.snapUntil = performance.now() + 540;
|
|
3580
|
-
if (
|
|
3581
|
-
|
|
3602
|
+
if (item) {
|
|
3603
|
+
applyDragPreview(group, item);
|
|
3582
3604
|
}
|
|
3583
3605
|
}
|
|
3584
3606
|
drag.previewValue = nextPreviewValue;
|
|
@@ -3654,7 +3676,7 @@ var SegmentatorGroup = (0, import_react23.forwardRef)(
|
|
|
3654
3676
|
event.pointerId
|
|
3655
3677
|
);
|
|
3656
3678
|
writeThumbMetrics(metrics, false);
|
|
3657
|
-
|
|
3679
|
+
applyDragPreview(group, pressedItem);
|
|
3658
3680
|
setDragState({ pressing: true, active: false });
|
|
3659
3681
|
group.setPointerCapture(event.pointerId);
|
|
3660
3682
|
};
|
|
@@ -3662,16 +3684,17 @@ var SegmentatorGroup = (0, import_react23.forwardRef)(
|
|
|
3662
3684
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3663
3685
|
SegmentatorContext.Provider,
|
|
3664
3686
|
{
|
|
3665
|
-
value:
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3687
|
+
value: (0, import_react23.useMemo)(
|
|
3688
|
+
() => ({
|
|
3689
|
+
value: currentValue,
|
|
3690
|
+
onValueChange: setValue,
|
|
3691
|
+
mode,
|
|
3692
|
+
allRound,
|
|
3693
|
+
disabled,
|
|
3694
|
+
consumeClickRef
|
|
3695
|
+
}),
|
|
3696
|
+
[currentValue, setValue, mode, allRound, disabled]
|
|
3697
|
+
),
|
|
3675
3698
|
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
3676
3699
|
"div",
|
|
3677
3700
|
{
|
|
@@ -3742,7 +3765,6 @@ var SegmentatorItem = (0, import_react23.forwardRef)(
|
|
|
3742
3765
|
"data-selected": selected ? "true" : "false",
|
|
3743
3766
|
"data-value": value,
|
|
3744
3767
|
"data-mode": ctx.mode,
|
|
3745
|
-
"data-drag-preview": ctx.isPressing && ctx.dragPreviewValue === value ? "true" : void 0,
|
|
3746
3768
|
"data-all-round": ctx.allRound ? "true" : "false",
|
|
3747
3769
|
disabled: isDisabled,
|
|
3748
3770
|
className: cn("aviala-segmentator-item aviala-focus-ring", iconOnly && "min-w-0", className),
|
|
@@ -7505,37 +7527,9 @@ function Popover({
|
|
|
7505
7527
|
const [internalOpen, setInternalOpen] = (0, import_react42.useState)(defaultOpen);
|
|
7506
7528
|
const isControlled = openProp !== void 0;
|
|
7507
7529
|
const open = isControlled ? openProp : internalOpen;
|
|
7508
|
-
const windowBlurCloseRef = (0, import_react42.useRef)(false);
|
|
7509
|
-
const pointerDownCloseRef = (0, import_react42.useRef)(false);
|
|
7510
|
-
(0, import_react42.useEffect)(() => {
|
|
7511
|
-
const markWindowBlur = () => {
|
|
7512
|
-
windowBlurCloseRef.current = true;
|
|
7513
|
-
};
|
|
7514
|
-
window.addEventListener("blur", markWindowBlur, true);
|
|
7515
|
-
return () => window.removeEventListener("blur", markWindowBlur, true);
|
|
7516
|
-
}, []);
|
|
7517
|
-
(0, import_react42.useEffect)(() => {
|
|
7518
|
-
if (!open) {
|
|
7519
|
-
pointerDownCloseRef.current = false;
|
|
7520
|
-
return;
|
|
7521
|
-
}
|
|
7522
|
-
const markPointerDown = () => {
|
|
7523
|
-
pointerDownCloseRef.current = true;
|
|
7524
|
-
};
|
|
7525
|
-
document.addEventListener("pointerdown", markPointerDown, true);
|
|
7526
|
-
return () => document.removeEventListener("pointerdown", markPointerDown, true);
|
|
7527
|
-
}, [open]);
|
|
7528
7530
|
const handleOpenChange = (0, import_react42.useCallback)(
|
|
7529
7531
|
(nextOpen) => {
|
|
7530
|
-
if (!nextOpen
|
|
7531
|
-
windowBlurCloseRef.current = false;
|
|
7532
|
-
return;
|
|
7533
|
-
}
|
|
7534
|
-
windowBlurCloseRef.current = false;
|
|
7535
|
-
pointerDownCloseRef.current = false;
|
|
7536
|
-
if (!isControlled) {
|
|
7537
|
-
setInternalOpen(nextOpen);
|
|
7538
|
-
}
|
|
7532
|
+
if (!isControlled) setInternalOpen(nextOpen);
|
|
7539
7533
|
onOpenChange?.(nextOpen);
|
|
7540
7534
|
},
|
|
7541
7535
|
[isControlled, onOpenChange]
|
|
@@ -7561,6 +7555,7 @@ var PopoverContent = (0, import_react42.forwardRef)(
|
|
|
7561
7555
|
collisionPadding = 8,
|
|
7562
7556
|
portalled = true,
|
|
7563
7557
|
showArrow = false,
|
|
7558
|
+
flush = false,
|
|
7564
7559
|
...props
|
|
7565
7560
|
}, ref) => {
|
|
7566
7561
|
const content = /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
@@ -7573,7 +7568,14 @@ var PopoverContent = (0, import_react42.forwardRef)(
|
|
|
7573
7568
|
className: cn("aviala-popover-content", className),
|
|
7574
7569
|
...props,
|
|
7575
7570
|
children: [
|
|
7576
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7571
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7572
|
+
"div",
|
|
7573
|
+
{
|
|
7574
|
+
className: cn("aviala-popover-content__surface", typographyVariants({ level: "text" })),
|
|
7575
|
+
"data-flush": flush ? "true" : void 0,
|
|
7576
|
+
children
|
|
7577
|
+
}
|
|
7578
|
+
),
|
|
7577
7579
|
showArrow ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7578
7580
|
PopoverPrimitive6.Arrow,
|
|
7579
7581
|
{
|
|
@@ -7601,12 +7603,136 @@ var PopoverContent = (0, import_react42.forwardRef)(
|
|
|
7601
7603
|
);
|
|
7602
7604
|
PopoverContent.displayName = PopoverPrimitive6.Content.displayName;
|
|
7603
7605
|
|
|
7606
|
+
// src/components/hover-popover.tsx
|
|
7607
|
+
var import_react44 = require("react");
|
|
7608
|
+
|
|
7609
|
+
// src/components/use-coarse-pointer.ts
|
|
7610
|
+
var import_react43 = require("react");
|
|
7611
|
+
function useCoarsePointer() {
|
|
7612
|
+
const [coarse, setCoarse] = (0, import_react43.useState)(false);
|
|
7613
|
+
(0, import_react43.useEffect)(() => {
|
|
7614
|
+
if (typeof window === "undefined" || !window.matchMedia) return;
|
|
7615
|
+
const mq = window.matchMedia("(pointer: coarse)");
|
|
7616
|
+
const update = () => setCoarse(mq.matches);
|
|
7617
|
+
update();
|
|
7618
|
+
mq.addEventListener("change", update);
|
|
7619
|
+
return () => mq.removeEventListener("change", update);
|
|
7620
|
+
}, []);
|
|
7621
|
+
return coarse;
|
|
7622
|
+
}
|
|
7623
|
+
|
|
7624
|
+
// src/components/hover-popover.tsx
|
|
7625
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
7626
|
+
function HoverPopover({
|
|
7627
|
+
content,
|
|
7628
|
+
children,
|
|
7629
|
+
side = "top",
|
|
7630
|
+
align = "center",
|
|
7631
|
+
sideOffset = 8,
|
|
7632
|
+
collisionPadding = 8,
|
|
7633
|
+
showArrow = true,
|
|
7634
|
+
openDelay = 150,
|
|
7635
|
+
closeDelay = 150,
|
|
7636
|
+
open: openProp,
|
|
7637
|
+
defaultOpen = false,
|
|
7638
|
+
onOpenChange,
|
|
7639
|
+
contentClassName
|
|
7640
|
+
}) {
|
|
7641
|
+
const coarse = useCoarsePointer();
|
|
7642
|
+
const isControlled = openProp !== void 0;
|
|
7643
|
+
const [internalOpen, setInternalOpen] = (0, import_react44.useState)(defaultOpen);
|
|
7644
|
+
const open = isControlled ? openProp : internalOpen;
|
|
7645
|
+
const openTimer = (0, import_react44.useRef)(void 0);
|
|
7646
|
+
const closeTimer = (0, import_react44.useRef)(void 0);
|
|
7647
|
+
const clearTimers = (0, import_react44.useCallback)(() => {
|
|
7648
|
+
if (openTimer.current) clearTimeout(openTimer.current);
|
|
7649
|
+
if (closeTimer.current) clearTimeout(closeTimer.current);
|
|
7650
|
+
}, []);
|
|
7651
|
+
const setOpen = (0, import_react44.useCallback)(
|
|
7652
|
+
(next) => {
|
|
7653
|
+
if (!isControlled) setInternalOpen(next);
|
|
7654
|
+
onOpenChange?.(next);
|
|
7655
|
+
},
|
|
7656
|
+
[isControlled, onOpenChange]
|
|
7657
|
+
);
|
|
7658
|
+
(0, import_react44.useEffect)(() => () => clearTimers(), [clearTimers]);
|
|
7659
|
+
const keyboardOpenRef = (0, import_react44.useRef)(false);
|
|
7660
|
+
const contentRef = (0, import_react44.useRef)(null);
|
|
7661
|
+
const openNow = (0, import_react44.useCallback)(() => {
|
|
7662
|
+
keyboardOpenRef.current = false;
|
|
7663
|
+
clearTimers();
|
|
7664
|
+
openTimer.current = setTimeout(() => setOpen(true), openDelay);
|
|
7665
|
+
}, [clearTimers, openDelay, setOpen]);
|
|
7666
|
+
const closeSoon = (0, import_react44.useCallback)(() => {
|
|
7667
|
+
clearTimers();
|
|
7668
|
+
closeTimer.current = setTimeout(() => setOpen(false), closeDelay);
|
|
7669
|
+
}, [clearTimers, closeDelay, setOpen]);
|
|
7670
|
+
if (coarse) {
|
|
7671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
|
|
7672
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PopoverTrigger, { asChild: true, children }),
|
|
7673
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7674
|
+
PopoverContent,
|
|
7675
|
+
{
|
|
7676
|
+
side,
|
|
7677
|
+
align,
|
|
7678
|
+
sideOffset,
|
|
7679
|
+
collisionPadding,
|
|
7680
|
+
showArrow,
|
|
7681
|
+
className: contentClassName,
|
|
7682
|
+
children: content
|
|
7683
|
+
}
|
|
7684
|
+
)
|
|
7685
|
+
] });
|
|
7686
|
+
}
|
|
7687
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
|
|
7688
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7689
|
+
PopoverTrigger,
|
|
7690
|
+
{
|
|
7691
|
+
asChild: true,
|
|
7692
|
+
onMouseEnter: openNow,
|
|
7693
|
+
onMouseLeave: closeSoon,
|
|
7694
|
+
onKeyDown: (e) => {
|
|
7695
|
+
if (e.key === "Enter" || e.key === " ") keyboardOpenRef.current = true;
|
|
7696
|
+
},
|
|
7697
|
+
children
|
|
7698
|
+
}
|
|
7699
|
+
),
|
|
7700
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7701
|
+
PopoverContent,
|
|
7702
|
+
{
|
|
7703
|
+
ref: contentRef,
|
|
7704
|
+
side,
|
|
7705
|
+
align,
|
|
7706
|
+
sideOffset,
|
|
7707
|
+
collisionPadding,
|
|
7708
|
+
showArrow,
|
|
7709
|
+
className: contentClassName,
|
|
7710
|
+
onOpenAutoFocus: (e) => {
|
|
7711
|
+
if (!keyboardOpenRef.current) e.preventDefault();
|
|
7712
|
+
},
|
|
7713
|
+
onEscapeKeyDown: (e) => {
|
|
7714
|
+
e.preventDefault();
|
|
7715
|
+
setOpen(false);
|
|
7716
|
+
},
|
|
7717
|
+
onMouseEnter: clearTimers,
|
|
7718
|
+
onMouseLeave: closeSoon,
|
|
7719
|
+
onBlur: (e) => {
|
|
7720
|
+
const next = e.relatedTarget;
|
|
7721
|
+
if (next && contentRef.current?.contains(next)) return;
|
|
7722
|
+
closeSoon();
|
|
7723
|
+
},
|
|
7724
|
+
children: content
|
|
7725
|
+
}
|
|
7726
|
+
)
|
|
7727
|
+
] });
|
|
7728
|
+
}
|
|
7729
|
+
|
|
7604
7730
|
// src/components/modal.tsx
|
|
7605
7731
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
7606
7732
|
var import_icons15 = require("@aviala-design/icons");
|
|
7607
7733
|
var import_class_variance_authority10 = require("class-variance-authority");
|
|
7608
|
-
var
|
|
7609
|
-
var
|
|
7734
|
+
var import_react45 = require("react");
|
|
7735
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
7610
7736
|
var MODAL_ICON_SIZE = 16;
|
|
7611
7737
|
var modalContentVariants = (0, import_class_variance_authority10.cva)("aviala-modal-content", {
|
|
7612
7738
|
variants: {
|
|
@@ -7621,7 +7747,7 @@ var modalContentVariants = (0, import_class_variance_authority10.cva)("aviala-mo
|
|
|
7621
7747
|
});
|
|
7622
7748
|
function renderModalIcon(node) {
|
|
7623
7749
|
if (!node) return null;
|
|
7624
|
-
const content = (0,
|
|
7750
|
+
const content = (0, import_react45.isValidElement)(node) && typeof node.type !== "string" ? (0, import_react45.cloneElement)(node, {
|
|
7625
7751
|
width: MODAL_ICON_SIZE,
|
|
7626
7752
|
height: MODAL_ICON_SIZE,
|
|
7627
7753
|
className: cn(
|
|
@@ -7629,13 +7755,13 @@ function renderModalIcon(node) {
|
|
|
7629
7755
|
"shrink-0"
|
|
7630
7756
|
)
|
|
7631
7757
|
}) : node;
|
|
7632
|
-
return /* @__PURE__ */ (0,
|
|
7758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "aviala-modal__icon", "aria-hidden": true, children: content });
|
|
7633
7759
|
}
|
|
7634
7760
|
var Modal = DialogPrimitive.Root;
|
|
7635
7761
|
var ModalTrigger = DialogPrimitive.Trigger;
|
|
7636
7762
|
var ModalPortal = DialogPrimitive.Portal;
|
|
7637
7763
|
var ModalClose = DialogPrimitive.Close;
|
|
7638
|
-
var ModalOverlay = (0,
|
|
7764
|
+
var ModalOverlay = (0, import_react45.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7639
7765
|
DialogPrimitive.Overlay,
|
|
7640
7766
|
{
|
|
7641
7767
|
ref,
|
|
@@ -7644,7 +7770,7 @@ var ModalOverlay = (0, import_react43.forwardRef)(({ className, ...props }, ref)
|
|
|
7644
7770
|
}
|
|
7645
7771
|
));
|
|
7646
7772
|
ModalOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
7647
|
-
var ModalContent = (0,
|
|
7773
|
+
var ModalContent = (0, import_react45.forwardRef)(
|
|
7648
7774
|
({
|
|
7649
7775
|
className,
|
|
7650
7776
|
children,
|
|
@@ -7654,31 +7780,31 @@ var ModalContent = (0, import_react43.forwardRef)(
|
|
|
7654
7780
|
onOpenAutoFocus,
|
|
7655
7781
|
...props
|
|
7656
7782
|
}, ref) => {
|
|
7657
|
-
const overlay = showOverlay ? /* @__PURE__ */ (0,
|
|
7658
|
-
const panel = /* @__PURE__ */ (0,
|
|
7783
|
+
const overlay = showOverlay ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ModalOverlay, {}) : null;
|
|
7784
|
+
const panel = /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7659
7785
|
DialogPrimitive.Content,
|
|
7660
7786
|
{
|
|
7661
7787
|
ref,
|
|
7662
7788
|
className: cn(modalContentVariants({ size }), className),
|
|
7663
7789
|
onOpenAutoFocus,
|
|
7664
7790
|
...props,
|
|
7665
|
-
children: /* @__PURE__ */ (0,
|
|
7791
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "aviala-modal-content__surface", children })
|
|
7666
7792
|
}
|
|
7667
7793
|
);
|
|
7668
7794
|
if (!portalled) {
|
|
7669
|
-
return /* @__PURE__ */ (0,
|
|
7795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
|
|
7670
7796
|
overlay,
|
|
7671
7797
|
panel
|
|
7672
7798
|
] });
|
|
7673
7799
|
}
|
|
7674
|
-
return /* @__PURE__ */ (0,
|
|
7800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(DialogPrimitive.Portal, { children: [
|
|
7675
7801
|
overlay,
|
|
7676
7802
|
panel
|
|
7677
7803
|
] });
|
|
7678
7804
|
}
|
|
7679
7805
|
);
|
|
7680
7806
|
ModalContent.displayName = DialogPrimitive.Content.displayName;
|
|
7681
|
-
var ModalHeader = (0,
|
|
7807
|
+
var ModalHeader = (0, import_react45.forwardRef)(
|
|
7682
7808
|
({
|
|
7683
7809
|
className,
|
|
7684
7810
|
children,
|
|
@@ -7687,10 +7813,10 @@ var ModalHeader = (0, import_react43.forwardRef)(
|
|
|
7687
7813
|
showClose = true,
|
|
7688
7814
|
closeLabel = "Close dialog",
|
|
7689
7815
|
...props
|
|
7690
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
7816
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { ref, className: cn("aviala-modal__header", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "aviala-modal__header-row", children: [
|
|
7691
7817
|
showIcon ? renderModalIcon(icon) : null,
|
|
7692
|
-
/* @__PURE__ */ (0,
|
|
7693
|
-
showClose ? /* @__PURE__ */ (0,
|
|
7818
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "aviala-modal__header-main", children }),
|
|
7819
|
+
showClose ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(DialogPrimitive.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7694
7820
|
Button,
|
|
7695
7821
|
{
|
|
7696
7822
|
type: "button",
|
|
@@ -7698,28 +7824,28 @@ var ModalHeader = (0, import_react43.forwardRef)(
|
|
|
7698
7824
|
iconOnly: true,
|
|
7699
7825
|
"aria-label": closeLabel,
|
|
7700
7826
|
className: "aviala-modal__close",
|
|
7701
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
7827
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_icons15.SymbolWrong, { "aria-hidden": true })
|
|
7702
7828
|
}
|
|
7703
7829
|
) }) : null
|
|
7704
7830
|
] }) })
|
|
7705
7831
|
);
|
|
7706
7832
|
ModalHeader.displayName = "ModalHeader";
|
|
7707
|
-
var ModalTitle = (0,
|
|
7833
|
+
var ModalTitle = (0, import_react45.forwardRef)(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(DialogPrimitive.Title, { ref, asChild: true, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Typography, { level: "text", className: cn("aviala-modal__title", className), children }) }));
|
|
7708
7834
|
ModalTitle.displayName = DialogPrimitive.Title.displayName;
|
|
7709
|
-
var ModalDescription = (0,
|
|
7835
|
+
var ModalDescription = (0, import_react45.forwardRef)(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(DialogPrimitive.Description, { ref, asChild: true, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Typography, { level: "caption", className: cn("aviala-modal__description", className), children }) }));
|
|
7710
7836
|
ModalDescription.displayName = DialogPrimitive.Description.displayName;
|
|
7711
7837
|
function ModalHeaderText({
|
|
7712
7838
|
title,
|
|
7713
7839
|
description,
|
|
7714
7840
|
...props
|
|
7715
7841
|
}) {
|
|
7716
|
-
return /* @__PURE__ */ (0,
|
|
7717
|
-
/* @__PURE__ */ (0,
|
|
7718
|
-
description ? /* @__PURE__ */ (0,
|
|
7842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ModalHeader, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "aviala-modal__header-typeface", children: [
|
|
7843
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ModalTitle, { children: title }),
|
|
7844
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ModalDescription, { children: description }) : null
|
|
7719
7845
|
] }) });
|
|
7720
7846
|
}
|
|
7721
|
-
var ModalBody = (0,
|
|
7722
|
-
({ className, children, layout = "default", title, description, ...props }, ref) => /* @__PURE__ */ (0,
|
|
7847
|
+
var ModalBody = (0, import_react45.forwardRef)(
|
|
7848
|
+
({ className, children, layout = "default", title, description, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { ref, className: cn("aviala-modal__body", className), ...props, children: layout === "text" ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7723
7849
|
Typeface,
|
|
7724
7850
|
{
|
|
7725
7851
|
className: "aviala-modal__body-typeface",
|
|
@@ -7730,22 +7856,22 @@ var ModalBody = (0, import_react43.forwardRef)(
|
|
|
7730
7856
|
) : children })
|
|
7731
7857
|
);
|
|
7732
7858
|
ModalBody.displayName = "ModalBody";
|
|
7733
|
-
var ModalFooter = (0,
|
|
7734
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
7859
|
+
var ModalFooter = (0, import_react45.forwardRef)(
|
|
7860
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { ref, className: cn("aviala-modal__footer", className), ...props })
|
|
7735
7861
|
);
|
|
7736
7862
|
ModalFooter.displayName = "ModalFooter";
|
|
7737
7863
|
|
|
7738
7864
|
// src/components/tooltip.tsx
|
|
7739
7865
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
7740
|
-
var
|
|
7741
|
-
var
|
|
7866
|
+
var import_react46 = require("react");
|
|
7867
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
7742
7868
|
var TOOLTIP_DELAY_DURATION = 300;
|
|
7743
7869
|
function TooltipProvider({
|
|
7744
7870
|
delayDuration = TOOLTIP_DELAY_DURATION,
|
|
7745
7871
|
skipDelayDuration = 0,
|
|
7746
7872
|
...props
|
|
7747
7873
|
}) {
|
|
7748
|
-
return /* @__PURE__ */ (0,
|
|
7874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7749
7875
|
TooltipPrimitive.Provider,
|
|
7750
7876
|
{
|
|
7751
7877
|
delayDuration,
|
|
@@ -7756,7 +7882,7 @@ function TooltipProvider({
|
|
|
7756
7882
|
}
|
|
7757
7883
|
var Tooltip = TooltipPrimitive.Root;
|
|
7758
7884
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
7759
|
-
var TooltipContent = (0,
|
|
7885
|
+
var TooltipContent = (0, import_react46.forwardRef)(
|
|
7760
7886
|
({
|
|
7761
7887
|
className,
|
|
7762
7888
|
children,
|
|
@@ -7764,7 +7890,7 @@ var TooltipContent = (0, import_react44.forwardRef)(
|
|
|
7764
7890
|
collisionPadding = 8,
|
|
7765
7891
|
showArrow = true,
|
|
7766
7892
|
...props
|
|
7767
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
7893
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
7768
7894
|
TooltipPrimitive.Content,
|
|
7769
7895
|
{
|
|
7770
7896
|
ref,
|
|
@@ -7773,14 +7899,14 @@ var TooltipContent = (0, import_react44.forwardRef)(
|
|
|
7773
7899
|
className: cn("aviala-tooltip-content", className),
|
|
7774
7900
|
...props,
|
|
7775
7901
|
children: [
|
|
7776
|
-
/* @__PURE__ */ (0,
|
|
7777
|
-
showArrow ? /* @__PURE__ */ (0,
|
|
7902
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: cn("aviala-tooltip-content__surface", typographyVariants({ level: "caption" })), children }),
|
|
7903
|
+
showArrow ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7778
7904
|
TooltipPrimitive.Arrow,
|
|
7779
7905
|
{
|
|
7780
7906
|
asChild: true,
|
|
7781
7907
|
width: TOOLTIP_POINTER.width,
|
|
7782
7908
|
height: TOOLTIP_POINTER.height,
|
|
7783
|
-
children: /* @__PURE__ */ (0,
|
|
7909
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7784
7910
|
OverlayPointerSvg,
|
|
7785
7911
|
{
|
|
7786
7912
|
className: "aviala-tooltip-content__arrow",
|
|
@@ -7797,11 +7923,71 @@ var TooltipContent = (0, import_react44.forwardRef)(
|
|
|
7797
7923
|
);
|
|
7798
7924
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
7799
7925
|
|
|
7926
|
+
// src/components/responsive-tooltip.tsx
|
|
7927
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
7928
|
+
function ResponsiveTooltip({
|
|
7929
|
+
content,
|
|
7930
|
+
children,
|
|
7931
|
+
side = "top",
|
|
7932
|
+
align = "center",
|
|
7933
|
+
sideOffset = 4,
|
|
7934
|
+
collisionPadding = 8,
|
|
7935
|
+
showArrow = true,
|
|
7936
|
+
delayDuration = TOOLTIP_DELAY_DURATION,
|
|
7937
|
+
open,
|
|
7938
|
+
defaultOpen,
|
|
7939
|
+
onOpenChange,
|
|
7940
|
+
contentClassName
|
|
7941
|
+
}) {
|
|
7942
|
+
const coarse = useCoarsePointer();
|
|
7943
|
+
if (coarse) {
|
|
7944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Popover, { open, defaultOpen, onOpenChange, children: [
|
|
7945
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(PopoverTrigger, { asChild: true, children }),
|
|
7946
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
7947
|
+
PopoverContent,
|
|
7948
|
+
{
|
|
7949
|
+
side,
|
|
7950
|
+
align,
|
|
7951
|
+
sideOffset,
|
|
7952
|
+
collisionPadding,
|
|
7953
|
+
showArrow,
|
|
7954
|
+
className: contentClassName,
|
|
7955
|
+
children: content
|
|
7956
|
+
}
|
|
7957
|
+
)
|
|
7958
|
+
] });
|
|
7959
|
+
}
|
|
7960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
7961
|
+
Tooltip,
|
|
7962
|
+
{
|
|
7963
|
+
delayDuration,
|
|
7964
|
+
open,
|
|
7965
|
+
defaultOpen,
|
|
7966
|
+
onOpenChange,
|
|
7967
|
+
children: [
|
|
7968
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(TooltipTrigger, { asChild: true, children }),
|
|
7969
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
7970
|
+
TooltipContent,
|
|
7971
|
+
{
|
|
7972
|
+
side,
|
|
7973
|
+
align,
|
|
7974
|
+
sideOffset,
|
|
7975
|
+
collisionPadding,
|
|
7976
|
+
showArrow,
|
|
7977
|
+
className: contentClassName,
|
|
7978
|
+
children: content
|
|
7979
|
+
}
|
|
7980
|
+
)
|
|
7981
|
+
]
|
|
7982
|
+
}
|
|
7983
|
+
);
|
|
7984
|
+
}
|
|
7985
|
+
|
|
7800
7986
|
// src/components/feedback.tsx
|
|
7801
7987
|
var import_class_variance_authority11 = require("class-variance-authority");
|
|
7802
7988
|
var import_icons16 = require("@aviala-design/icons");
|
|
7803
|
-
var
|
|
7804
|
-
var
|
|
7989
|
+
var import_react47 = require("react");
|
|
7990
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
7805
7991
|
var FEEDBACK_ICON_SIZE = 22;
|
|
7806
7992
|
var feedbackVariants = (0, import_class_variance_authority11.cva)("aviala-feedback", {
|
|
7807
7993
|
variants: {
|
|
@@ -7829,7 +8015,7 @@ var feedbackVariants = (0, import_class_variance_authority11.cva)("aviala-feedba
|
|
|
7829
8015
|
});
|
|
7830
8016
|
function renderFeedbackIcon(node) {
|
|
7831
8017
|
if (!node) return null;
|
|
7832
|
-
const content = (0,
|
|
8018
|
+
const content = (0, import_react47.isValidElement)(node) && typeof node.type !== "string" ? (0, import_react47.cloneElement)(node, {
|
|
7833
8019
|
width: FEEDBACK_ICON_SIZE,
|
|
7834
8020
|
height: FEEDBACK_ICON_SIZE,
|
|
7835
8021
|
className: cn(
|
|
@@ -7837,25 +8023,25 @@ function renderFeedbackIcon(node) {
|
|
|
7837
8023
|
"shrink-0"
|
|
7838
8024
|
)
|
|
7839
8025
|
}) : node;
|
|
7840
|
-
return /* @__PURE__ */ (0,
|
|
8026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "aviala-feedback__icon", "aria-hidden": true, children: content });
|
|
7841
8027
|
}
|
|
7842
8028
|
function defaultStatusIcon(type, mode) {
|
|
7843
8029
|
const iconMode = mode === "primary" ? "fill" : "fill";
|
|
7844
8030
|
const thickness = "Regular";
|
|
7845
8031
|
switch (type) {
|
|
7846
8032
|
case "information":
|
|
7847
|
-
return /* @__PURE__ */ (0,
|
|
8033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_icons16.SymbolInformationCircle, { thickness, mode: iconMode, "aria-hidden": true });
|
|
7848
8034
|
case "warning":
|
|
7849
|
-
return /* @__PURE__ */ (0,
|
|
8035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_icons16.SymbolWarningCircle, { thickness, mode: iconMode, "aria-hidden": true });
|
|
7850
8036
|
case "wrong":
|
|
7851
|
-
return /* @__PURE__ */ (0,
|
|
8037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_icons16.SymbolWrongCircle, { thickness, mode: iconMode, "aria-hidden": true });
|
|
7852
8038
|
case "success":
|
|
7853
|
-
return /* @__PURE__ */ (0,
|
|
8039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_icons16.SymbolRightCircle, { thickness, mode: iconMode, "aria-hidden": true });
|
|
7854
8040
|
case "normal":
|
|
7855
|
-
return /* @__PURE__ */ (0,
|
|
8041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_icons16.GeneralNotification, { thickness, mode: "default", "aria-hidden": true });
|
|
7856
8042
|
}
|
|
7857
8043
|
}
|
|
7858
|
-
var Feedback = (0,
|
|
8044
|
+
var Feedback = (0, import_react47.forwardRef)(
|
|
7859
8045
|
({
|
|
7860
8046
|
className,
|
|
7861
8047
|
type = "information",
|
|
@@ -7877,7 +8063,7 @@ var Feedback = (0, import_react45.forwardRef)(
|
|
|
7877
8063
|
const tone = mode === "primary" ? "white" : "default";
|
|
7878
8064
|
const isSmall = resolvedSize === "small";
|
|
7879
8065
|
const resolvedRole = resolvedType === "wrong" ? "alert" : "status";
|
|
7880
|
-
return /* @__PURE__ */ (0,
|
|
8066
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
7881
8067
|
"div",
|
|
7882
8068
|
{
|
|
7883
8069
|
ref,
|
|
@@ -7891,9 +8077,9 @@ var Feedback = (0, import_react45.forwardRef)(
|
|
|
7891
8077
|
"data-size": resolvedSize,
|
|
7892
8078
|
"data-mode": mode,
|
|
7893
8079
|
...props,
|
|
7894
|
-
children: /* @__PURE__ */ (0,
|
|
8080
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "aviala-feedback__body", children: [
|
|
7895
8081
|
renderFeedbackIcon(icon ?? defaultStatusIcon(resolvedType, mode)),
|
|
7896
|
-
isSmall ? /* @__PURE__ */ (0,
|
|
8082
|
+
isSmall ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Typography, { level: "text", tone, className: "aviala-feedback__title", children: title }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
7897
8083
|
Typeface,
|
|
7898
8084
|
{
|
|
7899
8085
|
className: "aviala-feedback__typeface",
|
|
@@ -7903,7 +8089,7 @@ var Feedback = (0, import_react45.forwardRef)(
|
|
|
7903
8089
|
tone
|
|
7904
8090
|
}
|
|
7905
8091
|
),
|
|
7906
|
-
action ? /* @__PURE__ */ (0,
|
|
8092
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
7907
8093
|
Link,
|
|
7908
8094
|
{
|
|
7909
8095
|
level: "text",
|
|
@@ -7919,7 +8105,7 @@ var Feedback = (0, import_react45.forwardRef)(
|
|
|
7919
8105
|
children: action
|
|
7920
8106
|
}
|
|
7921
8107
|
) : null,
|
|
7922
|
-
showClose ? /* @__PURE__ */ (0,
|
|
8108
|
+
showClose ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
7923
8109
|
Link,
|
|
7924
8110
|
{
|
|
7925
8111
|
level: "text",
|
|
@@ -7928,7 +8114,7 @@ var Feedback = (0, import_react45.forwardRef)(
|
|
|
7928
8114
|
href: onClose ? "#" : void 0,
|
|
7929
8115
|
"aria-label": closeLabel,
|
|
7930
8116
|
className: "aviala-feedback__close",
|
|
7931
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
8117
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_icons16.SymbolWrong, { "aria-hidden": true }),
|
|
7932
8118
|
onClick: (event) => {
|
|
7933
8119
|
if (onClose) {
|
|
7934
8120
|
event.preventDefault();
|
|
@@ -7947,8 +8133,8 @@ Feedback.displayName = "Feedback";
|
|
|
7947
8133
|
// src/components/alert.tsx
|
|
7948
8134
|
var import_icons17 = require("@aviala-design/icons");
|
|
7949
8135
|
var import_class_variance_authority12 = require("class-variance-authority");
|
|
7950
|
-
var
|
|
7951
|
-
var
|
|
8136
|
+
var import_react48 = require("react");
|
|
8137
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
7952
8138
|
var ALERT_ICON_SIZE = 16;
|
|
7953
8139
|
var alertVariants = (0, import_class_variance_authority12.cva)("aviala-alert", {
|
|
7954
8140
|
variants: {
|
|
@@ -7976,7 +8162,7 @@ var alertVariants = (0, import_class_variance_authority12.cva)("aviala-alert", {
|
|
|
7976
8162
|
});
|
|
7977
8163
|
function renderAlertIcon(node) {
|
|
7978
8164
|
if (!node) return null;
|
|
7979
|
-
const content = (0,
|
|
8165
|
+
const content = (0, import_react48.isValidElement)(node) && typeof node.type !== "string" ? (0, import_react48.cloneElement)(node, {
|
|
7980
8166
|
width: ALERT_ICON_SIZE,
|
|
7981
8167
|
height: ALERT_ICON_SIZE,
|
|
7982
8168
|
className: cn(
|
|
@@ -7984,23 +8170,23 @@ function renderAlertIcon(node) {
|
|
|
7984
8170
|
"shrink-0"
|
|
7985
8171
|
)
|
|
7986
8172
|
}) : node;
|
|
7987
|
-
return /* @__PURE__ */ (0,
|
|
8173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "aviala-alert__icon", "aria-hidden": true, children: content });
|
|
7988
8174
|
}
|
|
7989
8175
|
function defaultStatusIcon2(type) {
|
|
7990
8176
|
const iconProps = { thickness: "Regular", mode: "fill", "aria-hidden": true };
|
|
7991
8177
|
switch (type) {
|
|
7992
8178
|
case "info":
|
|
7993
8179
|
case "neutral":
|
|
7994
|
-
return /* @__PURE__ */ (0,
|
|
8180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_icons17.SymbolInformationCircle, { ...iconProps });
|
|
7995
8181
|
case "warning":
|
|
7996
|
-
return /* @__PURE__ */ (0,
|
|
8182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_icons17.SymbolWarningCircle, { ...iconProps });
|
|
7997
8183
|
case "error":
|
|
7998
|
-
return /* @__PURE__ */ (0,
|
|
8184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_icons17.SymbolWrongCircle, { ...iconProps });
|
|
7999
8185
|
case "success":
|
|
8000
|
-
return /* @__PURE__ */ (0,
|
|
8186
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_icons17.SymbolRightCircle, { ...iconProps });
|
|
8001
8187
|
}
|
|
8002
8188
|
}
|
|
8003
|
-
var Alert = (0,
|
|
8189
|
+
var Alert = (0, import_react48.forwardRef)(
|
|
8004
8190
|
({
|
|
8005
8191
|
className,
|
|
8006
8192
|
type = "info",
|
|
@@ -8026,7 +8212,7 @@ var Alert = (0, import_react46.forwardRef)(
|
|
|
8026
8212
|
const resolvedType = type ?? "info";
|
|
8027
8213
|
const resolvedRole = resolvedType === "error" ? "alert" : "status";
|
|
8028
8214
|
const hasActions = showActions && (action || secondaryAction);
|
|
8029
|
-
return /* @__PURE__ */ (0,
|
|
8215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
8030
8216
|
"div",
|
|
8031
8217
|
{
|
|
8032
8218
|
ref,
|
|
@@ -8038,9 +8224,9 @@ var Alert = (0, import_react46.forwardRef)(
|
|
|
8038
8224
|
"data-appearance": appearance,
|
|
8039
8225
|
...props,
|
|
8040
8226
|
children: [
|
|
8041
|
-
/* @__PURE__ */ (0,
|
|
8227
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "aviala-alert__body", children: [
|
|
8042
8228
|
showIcon ? renderAlertIcon(icon ?? defaultStatusIcon2(resolvedType)) : null,
|
|
8043
|
-
isSmall ? /* @__PURE__ */ (0,
|
|
8229
|
+
isSmall ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Typography, { level: "text", className: "aviala-alert__title", children: title }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
8044
8230
|
Typeface,
|
|
8045
8231
|
{
|
|
8046
8232
|
className: "aviala-alert__typeface",
|
|
@@ -8049,7 +8235,7 @@ var Alert = (0, import_react46.forwardRef)(
|
|
|
8049
8235
|
secondary: description
|
|
8050
8236
|
}
|
|
8051
8237
|
),
|
|
8052
|
-
quickAction ? /* @__PURE__ */ (0,
|
|
8238
|
+
quickAction ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
8053
8239
|
Link,
|
|
8054
8240
|
{
|
|
8055
8241
|
level: "text",
|
|
@@ -8065,7 +8251,7 @@ var Alert = (0, import_react46.forwardRef)(
|
|
|
8065
8251
|
children: quickAction
|
|
8066
8252
|
}
|
|
8067
8253
|
) : null,
|
|
8068
|
-
dismissible ? /* @__PURE__ */ (0,
|
|
8254
|
+
dismissible ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
8069
8255
|
Link,
|
|
8070
8256
|
{
|
|
8071
8257
|
level: "text",
|
|
@@ -8074,7 +8260,7 @@ var Alert = (0, import_react46.forwardRef)(
|
|
|
8074
8260
|
href: onDismiss ? "#" : void 0,
|
|
8075
8261
|
"aria-label": closeLabel,
|
|
8076
8262
|
className: "aviala-alert__close",
|
|
8077
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
8263
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_icons17.SymbolWrong, { "aria-hidden": true }),
|
|
8078
8264
|
onClick: (event) => {
|
|
8079
8265
|
if (onDismiss) {
|
|
8080
8266
|
event.preventDefault();
|
|
@@ -8084,8 +8270,8 @@ var Alert = (0, import_react46.forwardRef)(
|
|
|
8084
8270
|
}
|
|
8085
8271
|
) : null
|
|
8086
8272
|
] }),
|
|
8087
|
-
hasActions ? /* @__PURE__ */ (0,
|
|
8088
|
-
action ? /* @__PURE__ */ (0,
|
|
8273
|
+
hasActions ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "aviala-alert__actions", children: [
|
|
8274
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
8089
8275
|
Link,
|
|
8090
8276
|
{
|
|
8091
8277
|
level: "caption",
|
|
@@ -8101,7 +8287,7 @@ var Alert = (0, import_react46.forwardRef)(
|
|
|
8101
8287
|
children: action
|
|
8102
8288
|
}
|
|
8103
8289
|
) : null,
|
|
8104
|
-
secondaryAction ? /* @__PURE__ */ (0,
|
|
8290
|
+
secondaryAction ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
8105
8291
|
Link,
|
|
8106
8292
|
{
|
|
8107
8293
|
level: "caption",
|
|
@@ -8127,31 +8313,31 @@ Alert.displayName = "Alert";
|
|
|
8127
8313
|
|
|
8128
8314
|
// src/components/list.tsx
|
|
8129
8315
|
var import_icons18 = require("@aviala-design/icons");
|
|
8130
|
-
var
|
|
8131
|
-
var
|
|
8132
|
-
var List = (0,
|
|
8133
|
-
({ className, title, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
8134
|
-
title != null ? /* @__PURE__ */ (0,
|
|
8135
|
-
/* @__PURE__ */ (0,
|
|
8316
|
+
var import_react49 = require("react");
|
|
8317
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
8318
|
+
var List = (0, import_react49.forwardRef)(
|
|
8319
|
+
({ className, title, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { ref, className: cn("aviala-list", className), ...props, children: [
|
|
8320
|
+
title != null ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ListTitle, { children: title }) : null,
|
|
8321
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ListGroup, { children })
|
|
8136
8322
|
] })
|
|
8137
8323
|
);
|
|
8138
8324
|
List.displayName = "List";
|
|
8139
|
-
var ListTitle = (0,
|
|
8140
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
8325
|
+
var ListTitle = (0, import_react49.forwardRef)(
|
|
8326
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { ref, className: cn("aviala-list-title", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: cn(typographyVariants({ level: "text" })), children }) })
|
|
8141
8327
|
);
|
|
8142
8328
|
ListTitle.displayName = "ListTitle";
|
|
8143
|
-
var ListGroup = (0,
|
|
8144
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
8329
|
+
var ListGroup = (0, import_react49.forwardRef)(
|
|
8330
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { ref, className: cn("aviala-list-group", className), role: "list", ...props, children })
|
|
8145
8331
|
);
|
|
8146
8332
|
ListGroup.displayName = "ListGroup";
|
|
8147
8333
|
function ListItemGroup({ label, children, className }) {
|
|
8148
|
-
return /* @__PURE__ */ (0,
|
|
8149
|
-
label != null ? /* @__PURE__ */ (0,
|
|
8150
|
-
/* @__PURE__ */ (0,
|
|
8334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: cn("aviala-list", className), children: [
|
|
8335
|
+
label != null ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ListTitle, { children: label }) : null,
|
|
8336
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ListGroup, { children })
|
|
8151
8337
|
] });
|
|
8152
8338
|
}
|
|
8153
|
-
var ListDivider = (0,
|
|
8154
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
8339
|
+
var ListDivider = (0, import_react49.forwardRef)(
|
|
8340
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8155
8341
|
"span",
|
|
8156
8342
|
{
|
|
8157
8343
|
ref,
|
|
@@ -8162,15 +8348,15 @@ var ListDivider = (0, import_react47.forwardRef)(
|
|
|
8162
8348
|
)
|
|
8163
8349
|
);
|
|
8164
8350
|
ListDivider.displayName = "ListDivider";
|
|
8165
|
-
var ListSeparator = (0,
|
|
8166
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
8351
|
+
var ListSeparator = (0, import_react49.forwardRef)(
|
|
8352
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("hr", { ref, className: cn("aviala-list-separator", className), ...props })
|
|
8167
8353
|
);
|
|
8168
8354
|
ListSeparator.displayName = "ListSeparator";
|
|
8169
8355
|
function renderLeadingIcon(node, leading) {
|
|
8170
8356
|
if (leading === "none") return null;
|
|
8171
8357
|
const iconSize = leading === "shaped" ? 20 : 22;
|
|
8172
|
-
const content = node ?? (leading === "shaped" ? /* @__PURE__ */ (0,
|
|
8173
|
-
const rendered = (0,
|
|
8358
|
+
const content = node ?? (leading === "shaped" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_icons18.GeneralSetting, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_icons18.GeneralSetting, { "aria-hidden": true }));
|
|
8359
|
+
const rendered = (0, import_react49.isValidElement)(content) && typeof content.type !== "string" ? (0, import_react49.cloneElement)(content, {
|
|
8174
8360
|
width: iconSize,
|
|
8175
8361
|
height: iconSize,
|
|
8176
8362
|
className: cn(
|
|
@@ -8178,7 +8364,7 @@ function renderLeadingIcon(node, leading) {
|
|
|
8178
8364
|
"shrink-0"
|
|
8179
8365
|
)
|
|
8180
8366
|
}) : content;
|
|
8181
|
-
return /* @__PURE__ */ (0,
|
|
8367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "aviala-list-item__icon", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8182
8368
|
"span",
|
|
8183
8369
|
{
|
|
8184
8370
|
className: cn(
|
|
@@ -8188,7 +8374,7 @@ function renderLeadingIcon(node, leading) {
|
|
|
8188
8374
|
}
|
|
8189
8375
|
) });
|
|
8190
8376
|
}
|
|
8191
|
-
var ListItem = (0,
|
|
8377
|
+
var ListItem = (0, import_react49.forwardRef)(
|
|
8192
8378
|
({
|
|
8193
8379
|
className,
|
|
8194
8380
|
itemType = "select",
|
|
@@ -8209,44 +8395,44 @@ var ListItem = (0, import_react47.forwardRef)(
|
|
|
8209
8395
|
...props
|
|
8210
8396
|
}, ref) => {
|
|
8211
8397
|
const isInteractive = interactive ?? onClick != null;
|
|
8212
|
-
const primaryAction = action ?? /* @__PURE__ */ (0,
|
|
8398
|
+
const primaryAction = action ?? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Button, { mode: "primary", size: "regular", leftIcon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_icons18.GeneralSetting, { "aria-hidden": true }), children: actionLabel });
|
|
8213
8399
|
const renderTrailing = () => {
|
|
8214
8400
|
if (trailing !== void 0) return trailing;
|
|
8215
8401
|
switch (itemType) {
|
|
8216
8402
|
case "action":
|
|
8217
|
-
return /* @__PURE__ */ (0,
|
|
8218
|
-
/* @__PURE__ */ (0,
|
|
8403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "aviala-list-item__more", children: [
|
|
8404
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "aviala-list-item__trailing", children: [
|
|
8219
8405
|
primaryAction,
|
|
8220
|
-
secondaryAction ?? /* @__PURE__ */ (0,
|
|
8406
|
+
secondaryAction ?? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8221
8407
|
Button,
|
|
8222
8408
|
{
|
|
8223
8409
|
mode: "default",
|
|
8224
8410
|
size: "regular",
|
|
8225
8411
|
iconOnly: true,
|
|
8226
8412
|
"aria-label": "More",
|
|
8227
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
8413
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_icons18.GeneralSetting, { "aria-hidden": true })
|
|
8228
8414
|
}
|
|
8229
8415
|
)
|
|
8230
8416
|
] }),
|
|
8231
|
-
/* @__PURE__ */ (0,
|
|
8232
|
-
/* @__PURE__ */ (0,
|
|
8417
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ListDivider, {}),
|
|
8418
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "aviala-list-item__chevron", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_icons18.DirectionArrowRightLight, { width: 18, height: 18 }) })
|
|
8233
8419
|
] });
|
|
8234
8420
|
case "switch":
|
|
8235
|
-
return /* @__PURE__ */ (0,
|
|
8421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "aviala-list-item__trailing", children: [
|
|
8236
8422
|
primaryAction,
|
|
8237
|
-
/* @__PURE__ */ (0,
|
|
8238
|
-
/* @__PURE__ */ (0,
|
|
8423
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ListDivider, {}),
|
|
8424
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Switch, { ...switchProps })
|
|
8239
8425
|
] });
|
|
8240
8426
|
case "select":
|
|
8241
8427
|
default:
|
|
8242
|
-
return /* @__PURE__ */ (0,
|
|
8428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "aviala-list-item__trailing", children: [
|
|
8243
8429
|
primaryAction,
|
|
8244
|
-
/* @__PURE__ */ (0,
|
|
8245
|
-
/* @__PURE__ */ (0,
|
|
8430
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ListDivider, {}),
|
|
8431
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "aviala-list-item__select", children: select })
|
|
8246
8432
|
] });
|
|
8247
8433
|
}
|
|
8248
8434
|
};
|
|
8249
|
-
return /* @__PURE__ */ (0,
|
|
8435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
8250
8436
|
"div",
|
|
8251
8437
|
{
|
|
8252
8438
|
ref,
|
|
@@ -8261,8 +8447,8 @@ var ListItem = (0, import_react47.forwardRef)(
|
|
|
8261
8447
|
...props,
|
|
8262
8448
|
children: [
|
|
8263
8449
|
renderLeadingIcon(icon, leading),
|
|
8264
|
-
/* @__PURE__ */ (0,
|
|
8265
|
-
/* @__PURE__ */ (0,
|
|
8450
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "aviala-list-item__body", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "aviala-list-item__content", children: [
|
|
8451
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "aviala-list-item__head", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Typeface, { content: "textCaption", primary: title, secondary: subtitle }) }),
|
|
8266
8452
|
renderTrailing()
|
|
8267
8453
|
] }) })
|
|
8268
8454
|
]
|
|
@@ -8275,14 +8461,14 @@ ListItem.displayName = "ListItem";
|
|
|
8275
8461
|
// src/components/navigation.tsx
|
|
8276
8462
|
var PopoverPrimitive7 = __toESM(require("@radix-ui/react-popover"), 1);
|
|
8277
8463
|
var import_react_slot5 = require("@radix-ui/react-slot");
|
|
8278
|
-
var
|
|
8279
|
-
var
|
|
8464
|
+
var import_react50 = require("react");
|
|
8465
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
8280
8466
|
function navigationItemButtonMode(active) {
|
|
8281
8467
|
return active ? "second" : "noBackgroundCustom";
|
|
8282
8468
|
}
|
|
8283
|
-
var NavigationDirectionContext = (0,
|
|
8469
|
+
var NavigationDirectionContext = (0, import_react50.createContext)("vertical");
|
|
8284
8470
|
function useNavigationDirection() {
|
|
8285
|
-
return (0,
|
|
8471
|
+
return (0, import_react50.useContext)(NavigationDirectionContext);
|
|
8286
8472
|
}
|
|
8287
8473
|
var NAVIGATION_ANIMATION_MS_FALLBACK = 300;
|
|
8288
8474
|
var NAVIGATION_ANIMATION_EASING_FALLBACK = "cubic-bezier(0.33, 1, 0.68, 1)";
|
|
@@ -8341,11 +8527,17 @@ function measureNavigationIndicator(group, direction) {
|
|
|
8341
8527
|
50
|
|
8342
8528
|
);
|
|
8343
8529
|
if (direction === "vertical") {
|
|
8530
|
+
let inset = railInset;
|
|
8531
|
+
if (item.matches(":active")) {
|
|
8532
|
+
inset = readIndicatorToken(group, "--navigation-rail-inset-press", 9);
|
|
8533
|
+
} else if (item.matches(":hover")) {
|
|
8534
|
+
inset = readIndicatorToken(group, "--navigation-rail-inset-hover", 3);
|
|
8535
|
+
}
|
|
8344
8536
|
return {
|
|
8345
8537
|
x: railLeft,
|
|
8346
|
-
y: itemRect.top - groupRect.top +
|
|
8538
|
+
y: itemRect.top - groupRect.top + inset,
|
|
8347
8539
|
width: railWidth,
|
|
8348
|
-
height: Math.max(0, itemRect.height -
|
|
8540
|
+
height: Math.max(0, itemRect.height - inset * 2),
|
|
8349
8541
|
visible: true
|
|
8350
8542
|
};
|
|
8351
8543
|
}
|
|
@@ -8436,21 +8628,21 @@ function runIndicatorAnimation(el, group, start, next, durationMs, easing, gener
|
|
|
8436
8628
|
};
|
|
8437
8629
|
}
|
|
8438
8630
|
function useNavigationIndicator(groupRef, direction, layoutKey) {
|
|
8439
|
-
const indicatorRef = (0,
|
|
8440
|
-
const metricsRef = (0,
|
|
8441
|
-
const animationRef = (0,
|
|
8442
|
-
const animationGenerationRef = (0,
|
|
8443
|
-
const isAnimatingRef = (0,
|
|
8444
|
-
const layoutTrackingFrameRef = (0,
|
|
8445
|
-
const isLayoutTrackingRef = (0,
|
|
8446
|
-
const isInitialMount = (0,
|
|
8447
|
-
const [activeRevision, setActiveRevision] = (0,
|
|
8448
|
-
const measureIndicator = (0,
|
|
8631
|
+
const indicatorRef = (0, import_react50.useRef)(null);
|
|
8632
|
+
const metricsRef = (0, import_react50.useRef)(null);
|
|
8633
|
+
const animationRef = (0, import_react50.useRef)(null);
|
|
8634
|
+
const animationGenerationRef = (0, import_react50.useRef)(0);
|
|
8635
|
+
const isAnimatingRef = (0, import_react50.useRef)(false);
|
|
8636
|
+
const layoutTrackingFrameRef = (0, import_react50.useRef)(null);
|
|
8637
|
+
const isLayoutTrackingRef = (0, import_react50.useRef)(false);
|
|
8638
|
+
const isInitialMount = (0, import_react50.useRef)(true);
|
|
8639
|
+
const [activeRevision, setActiveRevision] = (0, import_react50.useState)(0);
|
|
8640
|
+
const measureIndicator = (0, import_react50.useCallback)(() => {
|
|
8449
8641
|
const group = groupRef.current;
|
|
8450
8642
|
if (!group) return null;
|
|
8451
8643
|
return measureNavigationIndicator(group, direction);
|
|
8452
8644
|
}, [direction, groupRef]);
|
|
8453
|
-
const syncIndicator = (0,
|
|
8645
|
+
const syncIndicator = (0, import_react50.useCallback)(
|
|
8454
8646
|
(metrics, instant = false) => {
|
|
8455
8647
|
metricsRef.current = metrics;
|
|
8456
8648
|
const el = indicatorRef.current;
|
|
@@ -8458,14 +8650,14 @@ function useNavigationIndicator(groupRef, direction, layoutKey) {
|
|
|
8458
8650
|
},
|
|
8459
8651
|
[]
|
|
8460
8652
|
);
|
|
8461
|
-
const cancelLayoutTracking = (0,
|
|
8653
|
+
const cancelLayoutTracking = (0, import_react50.useCallback)(() => {
|
|
8462
8654
|
if (layoutTrackingFrameRef.current != null) {
|
|
8463
8655
|
cancelAnimationFrame(layoutTrackingFrameRef.current);
|
|
8464
8656
|
layoutTrackingFrameRef.current = null;
|
|
8465
8657
|
}
|
|
8466
8658
|
isLayoutTrackingRef.current = false;
|
|
8467
8659
|
}, []);
|
|
8468
|
-
const remeasureIndicator = (0,
|
|
8660
|
+
const remeasureIndicator = (0, import_react50.useCallback)(() => {
|
|
8469
8661
|
if (isLayoutTrackingRef.current) return;
|
|
8470
8662
|
const metrics = measureIndicator();
|
|
8471
8663
|
if (!metrics) return;
|
|
@@ -8474,7 +8666,7 @@ function useNavigationIndicator(groupRef, direction, layoutKey) {
|
|
|
8474
8666
|
isAnimatingRef.current = false;
|
|
8475
8667
|
syncIndicator(metrics, true);
|
|
8476
8668
|
}, [measureIndicator, syncIndicator]);
|
|
8477
|
-
const startExpandCollapseTracking = (0,
|
|
8669
|
+
const startExpandCollapseTracking = (0, import_react50.useCallback)(() => {
|
|
8478
8670
|
const group = groupRef.current;
|
|
8479
8671
|
const el = indicatorRef.current;
|
|
8480
8672
|
if (!group || !el) return;
|
|
@@ -8531,14 +8723,14 @@ function useNavigationIndicator(groupRef, direction, layoutKey) {
|
|
|
8531
8723
|
};
|
|
8532
8724
|
layoutTrackingFrameRef.current = requestAnimationFrame(tick);
|
|
8533
8725
|
}, [cancelLayoutTracking, groupRef, measureIndicator, syncIndicator]);
|
|
8534
|
-
const onIndicatorRef = (0,
|
|
8726
|
+
const onIndicatorRef = (0, import_react50.useCallback)((node) => {
|
|
8535
8727
|
indicatorRef.current = node;
|
|
8536
8728
|
if (node && metricsRef.current && isInitialMount.current) {
|
|
8537
8729
|
applyIndicatorMetrics(node, metricsRef.current, true);
|
|
8538
8730
|
isInitialMount.current = false;
|
|
8539
8731
|
}
|
|
8540
8732
|
}, []);
|
|
8541
|
-
(0,
|
|
8733
|
+
(0, import_react50.useLayoutEffect)(() => {
|
|
8542
8734
|
const group = groupRef.current;
|
|
8543
8735
|
const next = measureIndicator();
|
|
8544
8736
|
if (!next) return;
|
|
@@ -8586,7 +8778,7 @@ function useNavigationIndicator(groupRef, direction, layoutKey) {
|
|
|
8586
8778
|
syncIndicator,
|
|
8587
8779
|
groupRef
|
|
8588
8780
|
]);
|
|
8589
|
-
(0,
|
|
8781
|
+
(0, import_react50.useLayoutEffect)(() => {
|
|
8590
8782
|
const group = groupRef.current;
|
|
8591
8783
|
if (!group) return;
|
|
8592
8784
|
const observer = new MutationObserver((mutations) => {
|
|
@@ -8643,9 +8835,35 @@ function useNavigationIndicator(groupRef, direction, layoutKey) {
|
|
|
8643
8835
|
startExpandCollapseTracking,
|
|
8644
8836
|
syncIndicator
|
|
8645
8837
|
]);
|
|
8838
|
+
(0, import_react50.useEffect)(() => {
|
|
8839
|
+
if (direction !== "vertical") return;
|
|
8840
|
+
const group = groupRef.current;
|
|
8841
|
+
if (!group) return;
|
|
8842
|
+
const refreshInteractionMetrics = () => {
|
|
8843
|
+
if (isLayoutTrackingRef.current || isAnimatingRef.current) return;
|
|
8844
|
+
const metrics = measureIndicator();
|
|
8845
|
+
if (!metrics) return;
|
|
8846
|
+
if (metricsRef.current && metricsApproxEqual2(metrics, metricsRef.current)) {
|
|
8847
|
+
return;
|
|
8848
|
+
}
|
|
8849
|
+
syncIndicator(metrics, false);
|
|
8850
|
+
};
|
|
8851
|
+
group.addEventListener("pointerover", refreshInteractionMetrics);
|
|
8852
|
+
group.addEventListener("pointerout", refreshInteractionMetrics);
|
|
8853
|
+
group.addEventListener("pointerdown", refreshInteractionMetrics);
|
|
8854
|
+
group.addEventListener("pointerup", refreshInteractionMetrics);
|
|
8855
|
+
group.addEventListener("pointercancel", refreshInteractionMetrics);
|
|
8856
|
+
return () => {
|
|
8857
|
+
group.removeEventListener("pointerover", refreshInteractionMetrics);
|
|
8858
|
+
group.removeEventListener("pointerout", refreshInteractionMetrics);
|
|
8859
|
+
group.removeEventListener("pointerdown", refreshInteractionMetrics);
|
|
8860
|
+
group.removeEventListener("pointerup", refreshInteractionMetrics);
|
|
8861
|
+
group.removeEventListener("pointercancel", refreshInteractionMetrics);
|
|
8862
|
+
};
|
|
8863
|
+
}, [direction, groupRef, measureIndicator, syncIndicator]);
|
|
8646
8864
|
return onIndicatorRef;
|
|
8647
8865
|
}
|
|
8648
|
-
var Navigation = (0,
|
|
8866
|
+
var Navigation = (0, import_react50.forwardRef)(
|
|
8649
8867
|
({
|
|
8650
8868
|
className,
|
|
8651
8869
|
as: Tag2 = "nav",
|
|
@@ -8653,7 +8871,7 @@ var Navigation = (0, import_react48.forwardRef)(
|
|
|
8653
8871
|
direction = "vertical",
|
|
8654
8872
|
dividingLine = false,
|
|
8655
8873
|
...props
|
|
8656
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
8874
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(NavigationDirectionContext.Provider, { value: direction, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8657
8875
|
Tag2,
|
|
8658
8876
|
{
|
|
8659
8877
|
ref,
|
|
@@ -8666,8 +8884,8 @@ var Navigation = (0, import_react48.forwardRef)(
|
|
|
8666
8884
|
) })
|
|
8667
8885
|
);
|
|
8668
8886
|
Navigation.displayName = "Navigation";
|
|
8669
|
-
var NavigationBrand = (0,
|
|
8670
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
8887
|
+
var NavigationBrand = (0, import_react50.forwardRef)(
|
|
8888
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8671
8889
|
"div",
|
|
8672
8890
|
{
|
|
8673
8891
|
ref,
|
|
@@ -8677,40 +8895,40 @@ var NavigationBrand = (0, import_react48.forwardRef)(
|
|
|
8677
8895
|
)
|
|
8678
8896
|
);
|
|
8679
8897
|
NavigationBrand.displayName = "NavigationBrand";
|
|
8680
|
-
var NavigationBrandTitle = (0,
|
|
8898
|
+
var NavigationBrandTitle = (0, import_react50.forwardRef)(({ className, asChild = false, children, ...props }, ref) => {
|
|
8681
8899
|
const Comp = asChild ? import_react_slot5.Slot : "a";
|
|
8682
|
-
return /* @__PURE__ */ (0,
|
|
8900
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8683
8901
|
Comp,
|
|
8684
8902
|
{
|
|
8685
8903
|
ref,
|
|
8686
8904
|
className: cn("aviala-navigation-brand__title aviala-focus-ring", className),
|
|
8687
8905
|
...props,
|
|
8688
|
-
children: asChild ? children : /* @__PURE__ */ (0,
|
|
8906
|
+
children: asChild ? children : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Typography, { level: "text", as: "span", children })
|
|
8689
8907
|
}
|
|
8690
8908
|
);
|
|
8691
8909
|
});
|
|
8692
8910
|
NavigationBrandTitle.displayName = "NavigationBrandTitle";
|
|
8693
|
-
var NavigationSection = (0,
|
|
8911
|
+
var NavigationSection = (0, import_react50.forwardRef)(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8694
8912
|
"div",
|
|
8695
8913
|
{
|
|
8696
8914
|
ref,
|
|
8697
8915
|
className: cn("aviala-navigation-section", className),
|
|
8698
8916
|
...props,
|
|
8699
|
-
children: /* @__PURE__ */ (0,
|
|
8917
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Typography, { level: "caption", as: "p", children })
|
|
8700
8918
|
}
|
|
8701
8919
|
));
|
|
8702
8920
|
NavigationSection.displayName = "NavigationSection";
|
|
8703
|
-
var NavigationGroup = (0,
|
|
8921
|
+
var NavigationGroup = (0, import_react50.forwardRef)(
|
|
8704
8922
|
({ className, children, ...props }, ref) => {
|
|
8705
8923
|
const direction = useNavigationDirection();
|
|
8706
8924
|
const layoutKey = useThemeLayoutKey();
|
|
8707
|
-
const groupRef = (0,
|
|
8925
|
+
const groupRef = (0, import_react50.useRef)(null);
|
|
8708
8926
|
const onIndicatorRef = useNavigationIndicator(
|
|
8709
8927
|
groupRef,
|
|
8710
8928
|
direction,
|
|
8711
8929
|
layoutKey
|
|
8712
8930
|
);
|
|
8713
|
-
const setRefs = (0,
|
|
8931
|
+
const setRefs = (0, import_react50.useCallback)(
|
|
8714
8932
|
(node) => {
|
|
8715
8933
|
groupRef.current = node;
|
|
8716
8934
|
if (typeof ref === "function") {
|
|
@@ -8721,14 +8939,14 @@ var NavigationGroup = (0, import_react48.forwardRef)(
|
|
|
8721
8939
|
},
|
|
8722
8940
|
[ref]
|
|
8723
8941
|
);
|
|
8724
|
-
return /* @__PURE__ */ (0,
|
|
8942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
8725
8943
|
"div",
|
|
8726
8944
|
{
|
|
8727
8945
|
ref: setRefs,
|
|
8728
8946
|
className: cn("aviala-navigation-group", className),
|
|
8729
8947
|
...props,
|
|
8730
8948
|
children: [
|
|
8731
|
-
/* @__PURE__ */ (0,
|
|
8949
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8732
8950
|
"span",
|
|
8733
8951
|
{
|
|
8734
8952
|
ref: onIndicatorRef,
|
|
@@ -8744,17 +8962,17 @@ var NavigationGroup = (0, import_react48.forwardRef)(
|
|
|
8744
8962
|
}
|
|
8745
8963
|
);
|
|
8746
8964
|
NavigationGroup.displayName = "NavigationGroup";
|
|
8747
|
-
var NavigationItemGroup = (0,
|
|
8965
|
+
var NavigationItemGroup = (0, import_react50.forwardRef)(({ className, expanded, children, ...props }, ref) => {
|
|
8748
8966
|
const isCollapsible = expanded !== void 0;
|
|
8749
8967
|
const isCollapsed = isCollapsible && !expanded;
|
|
8750
|
-
const innerRef = (0,
|
|
8751
|
-
(0,
|
|
8968
|
+
const innerRef = (0, import_react50.useRef)(null);
|
|
8969
|
+
(0, import_react50.useLayoutEffect)(() => {
|
|
8752
8970
|
const inner = innerRef.current;
|
|
8753
8971
|
if (!inner) return;
|
|
8754
8972
|
if (isCollapsed) inner.setAttribute("inert", "");
|
|
8755
8973
|
else inner.removeAttribute("inert");
|
|
8756
8974
|
}, [isCollapsed]);
|
|
8757
|
-
return /* @__PURE__ */ (0,
|
|
8975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8758
8976
|
"div",
|
|
8759
8977
|
{
|
|
8760
8978
|
ref,
|
|
@@ -8762,7 +8980,7 @@ var NavigationItemGroup = (0, import_react48.forwardRef)(({ className, expanded,
|
|
|
8762
8980
|
"data-expanded": isCollapsible ? expanded ? "true" : "false" : void 0,
|
|
8763
8981
|
"aria-hidden": isCollapsed ? true : void 0,
|
|
8764
8982
|
...props,
|
|
8765
|
-
children: isCollapsible ? /* @__PURE__ */ (0,
|
|
8983
|
+
children: isCollapsible ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { ref: innerRef, className: "aviala-navigation-item-group__inner", children }) : children
|
|
8766
8984
|
}
|
|
8767
8985
|
);
|
|
8768
8986
|
});
|
|
@@ -8773,9 +8991,9 @@ function renderItemIcon3(node) {
|
|
|
8773
8991
|
level: "text",
|
|
8774
8992
|
biggerSize: true
|
|
8775
8993
|
});
|
|
8776
|
-
return /* @__PURE__ */ (0,
|
|
8994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "aviala-navigation-item__icon", children: content });
|
|
8777
8995
|
}
|
|
8778
|
-
var NavigationItem = (0,
|
|
8996
|
+
var NavigationItem = (0, import_react50.forwardRef)(
|
|
8779
8997
|
({
|
|
8780
8998
|
className,
|
|
8781
8999
|
active,
|
|
@@ -8790,9 +9008,9 @@ var NavigationItem = (0, import_react48.forwardRef)(
|
|
|
8790
9008
|
const Comp = asChild ? import_react_slot5.Slot : "a";
|
|
8791
9009
|
const isActive = active ?? ariaCurrent === "page";
|
|
8792
9010
|
const mode = navigationItemButtonMode(isActive);
|
|
8793
|
-
const controlContent = /* @__PURE__ */ (0,
|
|
9011
|
+
const controlContent = /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
8794
9012
|
renderItemIcon3(leftIcon),
|
|
8795
|
-
/* @__PURE__ */ (0,
|
|
9013
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8796
9014
|
Typography,
|
|
8797
9015
|
{
|
|
8798
9016
|
level: "text",
|
|
@@ -8801,15 +9019,15 @@ var NavigationItem = (0, import_react48.forwardRef)(
|
|
|
8801
9019
|
children
|
|
8802
9020
|
}
|
|
8803
9021
|
),
|
|
8804
|
-
rightIcon ? /* @__PURE__ */ (0,
|
|
9022
|
+
rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "aviala-navigation-item__chevron", children: renderItemIcon3(rightIcon) }) : null
|
|
8805
9023
|
] });
|
|
8806
|
-
return /* @__PURE__ */ (0,
|
|
9024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8807
9025
|
"span",
|
|
8808
9026
|
{
|
|
8809
9027
|
className: cn("aviala-navigation-item", className),
|
|
8810
9028
|
"data-item-type": itemType,
|
|
8811
9029
|
"data-active": isActive ? "true" : "false",
|
|
8812
|
-
children: /* @__PURE__ */ (0,
|
|
9030
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8813
9031
|
Comp,
|
|
8814
9032
|
{
|
|
8815
9033
|
ref,
|
|
@@ -8828,7 +9046,7 @@ var NavigationItem = (0, import_react48.forwardRef)(
|
|
|
8828
9046
|
}
|
|
8829
9047
|
);
|
|
8830
9048
|
NavigationItem.displayName = "NavigationItem";
|
|
8831
|
-
var NavigationActions = (0,
|
|
9049
|
+
var NavigationActions = (0, import_react50.forwardRef)(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8832
9050
|
"div",
|
|
8833
9051
|
{
|
|
8834
9052
|
ref,
|
|
@@ -8838,7 +9056,7 @@ var NavigationActions = (0, import_react48.forwardRef)(({ className, children, .
|
|
|
8838
9056
|
}
|
|
8839
9057
|
));
|
|
8840
9058
|
NavigationActions.displayName = "NavigationActions";
|
|
8841
|
-
var NavigationActionsSlot = (0,
|
|
9059
|
+
var NavigationActionsSlot = (0, import_react50.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8842
9060
|
"div",
|
|
8843
9061
|
{
|
|
8844
9062
|
ref,
|
|
@@ -8848,9 +9066,9 @@ var NavigationActionsSlot = (0, import_react48.forwardRef)(({ className, ...prop
|
|
|
8848
9066
|
));
|
|
8849
9067
|
NavigationActionsSlot.displayName = "NavigationActionsSlot";
|
|
8850
9068
|
var NAVIGATION_MENU_CLOSE_DELAY_MS = 150;
|
|
8851
|
-
var NavigationItemMenuContext = (0,
|
|
9069
|
+
var NavigationItemMenuContext = (0, import_react50.createContext)(null);
|
|
8852
9070
|
function useNavigationItemMenuContext(component) {
|
|
8853
|
-
const context = (0,
|
|
9071
|
+
const context = (0, import_react50.useContext)(NavigationItemMenuContext);
|
|
8854
9072
|
if (!context) {
|
|
8855
9073
|
throw new Error(`${component} must be used within <NavigationItemMenu>`);
|
|
8856
9074
|
}
|
|
@@ -8864,28 +9082,28 @@ function NavigationItemMenu({
|
|
|
8864
9082
|
onOpenChange,
|
|
8865
9083
|
children
|
|
8866
9084
|
}) {
|
|
8867
|
-
const [internalValue, setInternalValue] = (0,
|
|
9085
|
+
const [internalValue, setInternalValue] = (0, import_react50.useState)(defaultValue);
|
|
8868
9086
|
const isValueControlled = valueProp !== void 0;
|
|
8869
9087
|
const value = isValueControlled ? valueProp : internalValue;
|
|
8870
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
9088
|
+
const [internalOpen, setInternalOpen] = (0, import_react50.useState)(false);
|
|
8871
9089
|
const isOpenControlled = openProp !== void 0;
|
|
8872
9090
|
const open = isOpenControlled ? openProp : internalOpen;
|
|
8873
|
-
const closeTimerRef = (0,
|
|
8874
|
-
const openedByHoverRef = (0,
|
|
8875
|
-
const setOpen = (0,
|
|
9091
|
+
const closeTimerRef = (0, import_react50.useRef)(null);
|
|
9092
|
+
const openedByHoverRef = (0, import_react50.useRef)(false);
|
|
9093
|
+
const setOpen = (0, import_react50.useCallback)(
|
|
8876
9094
|
(nextOpen) => {
|
|
8877
9095
|
if (!isOpenControlled) setInternalOpen(nextOpen);
|
|
8878
9096
|
onOpenChange?.(nextOpen);
|
|
8879
9097
|
},
|
|
8880
9098
|
[isOpenControlled, onOpenChange]
|
|
8881
9099
|
);
|
|
8882
|
-
const cancelClose = (0,
|
|
9100
|
+
const cancelClose = (0, import_react50.useCallback)(() => {
|
|
8883
9101
|
if (closeTimerRef.current != null) {
|
|
8884
9102
|
window.clearTimeout(closeTimerRef.current);
|
|
8885
9103
|
closeTimerRef.current = null;
|
|
8886
9104
|
}
|
|
8887
9105
|
}, []);
|
|
8888
|
-
const openMenu = (0,
|
|
9106
|
+
const openMenu = (0, import_react50.useCallback)(
|
|
8889
9107
|
(viaHover) => {
|
|
8890
9108
|
cancelClose();
|
|
8891
9109
|
openedByHoverRef.current = viaHover;
|
|
@@ -8893,14 +9111,14 @@ function NavigationItemMenu({
|
|
|
8893
9111
|
},
|
|
8894
9112
|
[cancelClose, setOpen]
|
|
8895
9113
|
);
|
|
8896
|
-
const scheduleClose = (0,
|
|
9114
|
+
const scheduleClose = (0, import_react50.useCallback)(() => {
|
|
8897
9115
|
cancelClose();
|
|
8898
9116
|
closeTimerRef.current = window.setTimeout(() => {
|
|
8899
9117
|
closeTimerRef.current = null;
|
|
8900
9118
|
setOpen(false);
|
|
8901
9119
|
}, NAVIGATION_MENU_CLOSE_DELAY_MS);
|
|
8902
9120
|
}, [cancelClose, setOpen]);
|
|
8903
|
-
const select = (0,
|
|
9121
|
+
const select = (0, import_react50.useCallback)(
|
|
8904
9122
|
(nextValue) => {
|
|
8905
9123
|
if (!isValueControlled) setInternalValue(nextValue);
|
|
8906
9124
|
onValueChange?.(nextValue);
|
|
@@ -8909,8 +9127,8 @@ function NavigationItemMenu({
|
|
|
8909
9127
|
},
|
|
8910
9128
|
[cancelClose, isValueControlled, onValueChange, setOpen]
|
|
8911
9129
|
);
|
|
8912
|
-
(0,
|
|
8913
|
-
const contextValue = (0,
|
|
9130
|
+
(0, import_react50.useEffect)(() => cancelClose, [cancelClose]);
|
|
9131
|
+
const contextValue = (0, import_react50.useMemo)(
|
|
8914
9132
|
() => ({
|
|
8915
9133
|
value,
|
|
8916
9134
|
hasSelection: value != null && value !== "",
|
|
@@ -8922,7 +9140,7 @@ function NavigationItemMenu({
|
|
|
8922
9140
|
}),
|
|
8923
9141
|
[cancelClose, openMenu, scheduleClose, select, value]
|
|
8924
9142
|
);
|
|
8925
|
-
const handleOpenChange = (0,
|
|
9143
|
+
const handleOpenChange = (0, import_react50.useCallback)(
|
|
8926
9144
|
(nextOpen) => {
|
|
8927
9145
|
if (nextOpen) openedByHoverRef.current = false;
|
|
8928
9146
|
cancelClose();
|
|
@@ -8930,9 +9148,9 @@ function NavigationItemMenu({
|
|
|
8930
9148
|
},
|
|
8931
9149
|
[cancelClose, setOpen]
|
|
8932
9150
|
);
|
|
8933
|
-
return /* @__PURE__ */ (0,
|
|
9151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(NavigationItemMenuContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Popover, { open, onOpenChange: handleOpenChange, children }) });
|
|
8934
9152
|
}
|
|
8935
|
-
var NavigationItemMenuTrigger = (0,
|
|
9153
|
+
var NavigationItemMenuTrigger = (0, import_react50.forwardRef)(
|
|
8936
9154
|
({
|
|
8937
9155
|
className,
|
|
8938
9156
|
active,
|
|
@@ -8944,7 +9162,7 @@ var NavigationItemMenuTrigger = (0, import_react48.forwardRef)(
|
|
|
8944
9162
|
const menu = useNavigationItemMenuContext("NavigationItemMenuTrigger");
|
|
8945
9163
|
const isActive = active ?? menu.hasSelection;
|
|
8946
9164
|
const mode = navigationItemButtonMode(isActive);
|
|
8947
|
-
return /* @__PURE__ */ (0,
|
|
9165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8948
9166
|
"span",
|
|
8949
9167
|
{
|
|
8950
9168
|
className: cn("aviala-navigation-item", className),
|
|
@@ -8952,7 +9170,7 @@ var NavigationItemMenuTrigger = (0, import_react48.forwardRef)(
|
|
|
8952
9170
|
"data-active": isActive ? "true" : "false",
|
|
8953
9171
|
onMouseEnter: () => menu.openMenu(true),
|
|
8954
9172
|
onMouseLeave: menu.scheduleClose,
|
|
8955
|
-
children: /* @__PURE__ */ (0,
|
|
9173
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PopoverPrimitive7.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
8956
9174
|
"button",
|
|
8957
9175
|
{
|
|
8958
9176
|
ref,
|
|
@@ -8965,7 +9183,7 @@ var NavigationItemMenuTrigger = (0, import_react48.forwardRef)(
|
|
|
8965
9183
|
...props,
|
|
8966
9184
|
children: [
|
|
8967
9185
|
renderItemIcon3(leftIcon),
|
|
8968
|
-
/* @__PURE__ */ (0,
|
|
9186
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8969
9187
|
Typography,
|
|
8970
9188
|
{
|
|
8971
9189
|
level: "text",
|
|
@@ -8974,7 +9192,7 @@ var NavigationItemMenuTrigger = (0, import_react48.forwardRef)(
|
|
|
8974
9192
|
children
|
|
8975
9193
|
}
|
|
8976
9194
|
),
|
|
8977
|
-
rightIcon ? /* @__PURE__ */ (0,
|
|
9195
|
+
rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "aviala-navigation-item__chevron", children: renderItemIcon3(rightIcon) }) : null
|
|
8978
9196
|
]
|
|
8979
9197
|
}
|
|
8980
9198
|
) })
|
|
@@ -8983,7 +9201,7 @@ var NavigationItemMenuTrigger = (0, import_react48.forwardRef)(
|
|
|
8983
9201
|
}
|
|
8984
9202
|
);
|
|
8985
9203
|
NavigationItemMenuTrigger.displayName = "NavigationItemMenuTrigger";
|
|
8986
|
-
var NavigationItemMenuContent = (0,
|
|
9204
|
+
var NavigationItemMenuContent = (0, import_react50.forwardRef)(
|
|
8987
9205
|
({
|
|
8988
9206
|
className,
|
|
8989
9207
|
side,
|
|
@@ -8995,7 +9213,7 @@ var NavigationItemMenuContent = (0, import_react48.forwardRef)(
|
|
|
8995
9213
|
}, ref) => {
|
|
8996
9214
|
const direction = useNavigationDirection();
|
|
8997
9215
|
const menu = useNavigationItemMenuContext("NavigationItemMenuContent");
|
|
8998
|
-
return /* @__PURE__ */ (0,
|
|
9216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PopoverPrimitive7.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8999
9217
|
PopoverPrimitive7.Content,
|
|
9000
9218
|
{
|
|
9001
9219
|
ref,
|
|
@@ -9016,7 +9234,7 @@ var NavigationItemMenuContent = (0, import_react48.forwardRef)(
|
|
|
9016
9234
|
}
|
|
9017
9235
|
);
|
|
9018
9236
|
NavigationItemMenuContent.displayName = "NavigationItemMenuContent";
|
|
9019
|
-
var NavigationItemMenuItem = (0,
|
|
9237
|
+
var NavigationItemMenuItem = (0, import_react50.forwardRef)(
|
|
9020
9238
|
({
|
|
9021
9239
|
className,
|
|
9022
9240
|
value,
|
|
@@ -9030,7 +9248,7 @@ var NavigationItemMenuItem = (0, import_react48.forwardRef)(
|
|
|
9030
9248
|
}, ref) => {
|
|
9031
9249
|
const menu = useNavigationItemMenuContext("NavigationItemMenuItem");
|
|
9032
9250
|
const isSelected = selected ?? menu.value === value;
|
|
9033
|
-
return /* @__PURE__ */ (0,
|
|
9251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
9034
9252
|
"button",
|
|
9035
9253
|
{
|
|
9036
9254
|
ref,
|
|
@@ -9050,7 +9268,7 @@ var NavigationItemMenuItem = (0, import_react48.forwardRef)(
|
|
|
9050
9268
|
...props,
|
|
9051
9269
|
children: [
|
|
9052
9270
|
renderItemIcon3(leftIcon),
|
|
9053
|
-
/* @__PURE__ */ (0,
|
|
9271
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9054
9272
|
Typography,
|
|
9055
9273
|
{
|
|
9056
9274
|
level: "text",
|
|
@@ -9059,7 +9277,7 @@ var NavigationItemMenuItem = (0, import_react48.forwardRef)(
|
|
|
9059
9277
|
children
|
|
9060
9278
|
}
|
|
9061
9279
|
),
|
|
9062
|
-
rightIcon ? /* @__PURE__ */ (0,
|
|
9280
|
+
rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "aviala-navigation-menu-item__trailing", children: renderItemIcon3(rightIcon) }) : null
|
|
9063
9281
|
]
|
|
9064
9282
|
}
|
|
9065
9283
|
);
|
|
@@ -9070,8 +9288,8 @@ NavigationItemMenuItem.displayName = "NavigationItemMenuItem";
|
|
|
9070
9288
|
// src/components/slider.tsx
|
|
9071
9289
|
var SliderPrimitive = __toESM(require("@radix-ui/react-slider"), 1);
|
|
9072
9290
|
var import_class_variance_authority13 = require("class-variance-authority");
|
|
9073
|
-
var
|
|
9074
|
-
var
|
|
9291
|
+
var import_react51 = require("react");
|
|
9292
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
9075
9293
|
var sliderVariants = (0, import_class_variance_authority13.cva)("aviala-slider", {
|
|
9076
9294
|
variants: {
|
|
9077
9295
|
size: {
|
|
@@ -9088,7 +9306,7 @@ var sliderVariants = (0, import_class_variance_authority13.cva)("aviala-slider",
|
|
|
9088
9306
|
type: "default"
|
|
9089
9307
|
}
|
|
9090
9308
|
});
|
|
9091
|
-
var Slider = (0,
|
|
9309
|
+
var Slider = (0, import_react51.forwardRef)(
|
|
9092
9310
|
({
|
|
9093
9311
|
className,
|
|
9094
9312
|
size = "default",
|
|
@@ -9105,7 +9323,7 @@ var Slider = (0, import_react49.forwardRef)(
|
|
|
9105
9323
|
const isRange = resolvedType === "range";
|
|
9106
9324
|
const resolvedDefaultValue = defaultValue ?? (isRange ? [25, 75] : [50]);
|
|
9107
9325
|
const thumbCount = isRange ? Math.max(2, value?.length ?? defaultValue?.length ?? 2) : 1;
|
|
9108
|
-
return /* @__PURE__ */ (0,
|
|
9326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
9109
9327
|
SliderPrimitive.Root,
|
|
9110
9328
|
{
|
|
9111
9329
|
ref,
|
|
@@ -9123,8 +9341,8 @@ var Slider = (0, import_react49.forwardRef)(
|
|
|
9123
9341
|
"data-disabled": disabled ? "true" : void 0,
|
|
9124
9342
|
...props,
|
|
9125
9343
|
children: [
|
|
9126
|
-
/* @__PURE__ */ (0,
|
|
9127
|
-
Array.from({ length: thumbCount }, (_, index) => /* @__PURE__ */ (0,
|
|
9344
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SliderPrimitive.Track, { className: "aviala-slider__track", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SliderPrimitive.Range, { className: "aviala-slider__range" }) }),
|
|
9345
|
+
Array.from({ length: thumbCount }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SliderPrimitive.Thumb, { className: "aviala-slider__thumb aviala-focus-ring" }, index))
|
|
9128
9346
|
]
|
|
9129
9347
|
}
|
|
9130
9348
|
);
|
|
@@ -9135,8 +9353,8 @@ Slider.displayName = "Slider";
|
|
|
9135
9353
|
// src/components/upload.tsx
|
|
9136
9354
|
var import_icons19 = require("@aviala-design/icons");
|
|
9137
9355
|
var import_class_variance_authority14 = require("class-variance-authority");
|
|
9138
|
-
var
|
|
9139
|
-
var
|
|
9356
|
+
var import_react52 = require("react");
|
|
9357
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
9140
9358
|
var uploadVariants = (0, import_class_variance_authority14.cva)("aviala-upload aviala-focus-ring", {
|
|
9141
9359
|
variants: {
|
|
9142
9360
|
style: {
|
|
@@ -9148,7 +9366,7 @@ var uploadVariants = (0, import_class_variance_authority14.cva)("aviala-upload a
|
|
|
9148
9366
|
style: "default"
|
|
9149
9367
|
}
|
|
9150
9368
|
});
|
|
9151
|
-
var Upload = (0,
|
|
9369
|
+
var Upload = (0, import_react52.forwardRef)(
|
|
9152
9370
|
({
|
|
9153
9371
|
className,
|
|
9154
9372
|
style = "default",
|
|
@@ -9166,8 +9384,8 @@ var Upload = (0, import_react50.forwardRef)(
|
|
|
9166
9384
|
onDrop,
|
|
9167
9385
|
...props
|
|
9168
9386
|
}, ref) => {
|
|
9169
|
-
const inputRef = (0,
|
|
9170
|
-
const [dragging, setDragging] = (0,
|
|
9387
|
+
const inputRef = (0, import_react52.useRef)(null);
|
|
9388
|
+
const [dragging, setDragging] = (0, import_react52.useState)(false);
|
|
9171
9389
|
const resolvedStyle = style ?? "default";
|
|
9172
9390
|
const allowDrag = dragAndDrop ?? resolvedStyle === "large";
|
|
9173
9391
|
const openPicker = () => {
|
|
@@ -9186,7 +9404,7 @@ var Upload = (0, import_react50.forwardRef)(
|
|
|
9186
9404
|
onChange?.(event.dataTransfer.files);
|
|
9187
9405
|
}
|
|
9188
9406
|
};
|
|
9189
|
-
return /* @__PURE__ */ (0,
|
|
9407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
9190
9408
|
"div",
|
|
9191
9409
|
{
|
|
9192
9410
|
ref,
|
|
@@ -9217,7 +9435,7 @@ var Upload = (0, import_react50.forwardRef)(
|
|
|
9217
9435
|
onDrop: handleDrop,
|
|
9218
9436
|
...props,
|
|
9219
9437
|
children: [
|
|
9220
|
-
/* @__PURE__ */ (0,
|
|
9438
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9221
9439
|
"input",
|
|
9222
9440
|
{
|
|
9223
9441
|
ref: inputRef,
|
|
@@ -9232,8 +9450,8 @@ var Upload = (0, import_react50.forwardRef)(
|
|
|
9232
9450
|
...inputProps
|
|
9233
9451
|
}
|
|
9234
9452
|
),
|
|
9235
|
-
/* @__PURE__ */ (0,
|
|
9236
|
-
resolvedStyle === "large" ? /* @__PURE__ */ (0,
|
|
9453
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "aviala-upload__icon", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_icons19.GeneralUpload, { width: 16, height: 16 }) }),
|
|
9454
|
+
resolvedStyle === "large" ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9237
9455
|
Typeface,
|
|
9238
9456
|
{
|
|
9239
9457
|
className: "aviala-upload__typeface",
|
|
@@ -9241,7 +9459,7 @@ var Upload = (0, import_react50.forwardRef)(
|
|
|
9241
9459
|
primary: title,
|
|
9242
9460
|
secondary: description
|
|
9243
9461
|
}
|
|
9244
|
-
) : /* @__PURE__ */ (0,
|
|
9462
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Typography, { level: "text", as: "span", className: "aviala-upload__label", children: label })
|
|
9245
9463
|
]
|
|
9246
9464
|
}
|
|
9247
9465
|
);
|
|
@@ -9250,8 +9468,8 @@ var Upload = (0, import_react50.forwardRef)(
|
|
|
9250
9468
|
Upload.displayName = "Upload";
|
|
9251
9469
|
|
|
9252
9470
|
// src/components/scroll-picker.tsx
|
|
9253
|
-
var
|
|
9254
|
-
var
|
|
9471
|
+
var import_react53 = require("react");
|
|
9472
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
9255
9473
|
var LOOP_SECTIONS2 = 3;
|
|
9256
9474
|
var MIDDLE_SECTION2 = 1;
|
|
9257
9475
|
function normalizeIndex2(index, length) {
|
|
@@ -9279,7 +9497,7 @@ function fractionalIndexAtScrollTop(metrics, scrollTop) {
|
|
|
9279
9497
|
return (scrollTop - metrics.originTop) / metrics.pitch;
|
|
9280
9498
|
}
|
|
9281
9499
|
function ScrollPicker({ className, children, ...props }) {
|
|
9282
|
-
return /* @__PURE__ */ (0,
|
|
9500
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: cn("aviala-scroll-picker", className), ...props, children });
|
|
9283
9501
|
}
|
|
9284
9502
|
function ScrollPickerColumn({
|
|
9285
9503
|
className,
|
|
@@ -9291,27 +9509,27 @@ function ScrollPickerColumn({
|
|
|
9291
9509
|
formatValue,
|
|
9292
9510
|
getValueKey
|
|
9293
9511
|
}) {
|
|
9294
|
-
const scrollRef = (0,
|
|
9295
|
-
const isUserScrollingRef = (0,
|
|
9296
|
-
const isProgrammaticScrollRef = (0,
|
|
9297
|
-
const smoothTargetValueRef = (0,
|
|
9298
|
-
const scrollEndTimerRef = (0,
|
|
9299
|
-
const wheelAccumRef = (0,
|
|
9300
|
-
const selectedValueRef = (0,
|
|
9301
|
-
const reactId = (0,
|
|
9512
|
+
const scrollRef = (0, import_react53.useRef)(null);
|
|
9513
|
+
const isUserScrollingRef = (0, import_react53.useRef)(false);
|
|
9514
|
+
const isProgrammaticScrollRef = (0, import_react53.useRef)(false);
|
|
9515
|
+
const smoothTargetValueRef = (0, import_react53.useRef)(null);
|
|
9516
|
+
const scrollEndTimerRef = (0, import_react53.useRef)(void 0);
|
|
9517
|
+
const wheelAccumRef = (0, import_react53.useRef)(0);
|
|
9518
|
+
const selectedValueRef = (0, import_react53.useRef)(value);
|
|
9519
|
+
const reactId = (0, import_react53.useId)();
|
|
9302
9520
|
selectedValueRef.current = value;
|
|
9303
|
-
const getIndex = (0,
|
|
9521
|
+
const getIndex = (0, import_react53.useCallback)(
|
|
9304
9522
|
(candidate) => {
|
|
9305
9523
|
const index = values.findIndex((item) => Object.is(item, candidate));
|
|
9306
9524
|
return index >= 0 ? index : 0;
|
|
9307
9525
|
},
|
|
9308
9526
|
[values]
|
|
9309
9527
|
);
|
|
9310
|
-
const repeatedValues = (0,
|
|
9528
|
+
const repeatedValues = (0, import_react53.useMemo)(() => {
|
|
9311
9529
|
if (!loop) return [...values];
|
|
9312
9530
|
return Array.from({ length: LOOP_SECTIONS2 }, () => values).flat();
|
|
9313
9531
|
}, [loop, values]);
|
|
9314
|
-
const scrollToIndex = (0,
|
|
9532
|
+
const scrollToIndex = (0, import_react53.useCallback)((index, behavior = "auto") => {
|
|
9315
9533
|
const container = scrollRef.current;
|
|
9316
9534
|
if (!container) return;
|
|
9317
9535
|
const metrics = readMetrics(container);
|
|
@@ -9319,7 +9537,7 @@ function ScrollPickerColumn({
|
|
|
9319
9537
|
isProgrammaticScrollRef.current = true;
|
|
9320
9538
|
container.scrollTo({ top: scrollTopForIndex(container, metrics, index), behavior });
|
|
9321
9539
|
}, []);
|
|
9322
|
-
const scrollToValue = (0,
|
|
9540
|
+
const scrollToValue = (0, import_react53.useCallback)(
|
|
9323
9541
|
(nextValue, behavior = "smooth") => {
|
|
9324
9542
|
if (behavior === "smooth") {
|
|
9325
9543
|
smoothTargetValueRef.current = nextValue;
|
|
@@ -9332,7 +9550,7 @@ function ScrollPickerColumn({
|
|
|
9332
9550
|
},
|
|
9333
9551
|
[getIndex, loop, scrollToIndex, values.length]
|
|
9334
9552
|
);
|
|
9335
|
-
const settleScroll = (0,
|
|
9553
|
+
const settleScroll = (0, import_react53.useCallback)(() => {
|
|
9336
9554
|
const container = scrollRef.current;
|
|
9337
9555
|
if (!container || isProgrammaticScrollRef.current) {
|
|
9338
9556
|
isProgrammaticScrollRef.current = false;
|
|
@@ -9378,7 +9596,7 @@ function ScrollPickerColumn({
|
|
|
9378
9596
|
isUserScrollingRef.current = false;
|
|
9379
9597
|
wheelAccumRef.current = 0;
|
|
9380
9598
|
}, [loop, onChange, values]);
|
|
9381
|
-
const handleScroll = (0,
|
|
9599
|
+
const handleScroll = (0, import_react53.useCallback)(() => {
|
|
9382
9600
|
if (isProgrammaticScrollRef.current) return;
|
|
9383
9601
|
isUserScrollingRef.current = true;
|
|
9384
9602
|
if (scrollEndTimerRef.current) {
|
|
@@ -9386,7 +9604,7 @@ function ScrollPickerColumn({
|
|
|
9386
9604
|
}
|
|
9387
9605
|
scrollEndTimerRef.current = setTimeout(settleScroll, WHEEL_SCROLL_END_MS);
|
|
9388
9606
|
}, [settleScroll]);
|
|
9389
|
-
(0,
|
|
9607
|
+
(0, import_react53.useLayoutEffect)(() => {
|
|
9390
9608
|
if (isUserScrollingRef.current) return;
|
|
9391
9609
|
if (smoothTargetValueRef.current != null && Object.is(smoothTargetValueRef.current, value)) {
|
|
9392
9610
|
return;
|
|
@@ -9401,7 +9619,7 @@ function ScrollPickerColumn({
|
|
|
9401
9619
|
if (Math.abs(container.scrollTop - targetTop) <= 1) return;
|
|
9402
9620
|
scrollToIndex(targetIndex, "auto");
|
|
9403
9621
|
}, [getIndex, loop, scrollToIndex, value, values.length]);
|
|
9404
|
-
(0,
|
|
9622
|
+
(0, import_react53.useEffect)(() => {
|
|
9405
9623
|
const container = scrollRef.current;
|
|
9406
9624
|
if (!container) return;
|
|
9407
9625
|
const onScrollEnd = () => {
|
|
@@ -9418,7 +9636,7 @@ function ScrollPickerColumn({
|
|
|
9418
9636
|
}
|
|
9419
9637
|
};
|
|
9420
9638
|
}, [settleScroll]);
|
|
9421
|
-
(0,
|
|
9639
|
+
(0, import_react53.useEffect)(() => {
|
|
9422
9640
|
const container = scrollRef.current;
|
|
9423
9641
|
if (!container) return;
|
|
9424
9642
|
const onWheel = (event) => {
|
|
@@ -9476,9 +9694,9 @@ function ScrollPickerColumn({
|
|
|
9476
9694
|
}
|
|
9477
9695
|
};
|
|
9478
9696
|
const selectedOptionId = `${reactId}-${getIndex(value)}`;
|
|
9479
|
-
return /* @__PURE__ */ (0,
|
|
9480
|
-
/* @__PURE__ */ (0,
|
|
9481
|
-
/* @__PURE__ */ (0,
|
|
9697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: cn("aviala-scroll-picker-column", className), children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "aviala-scroll-picker-column__viewport", children: [
|
|
9698
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "aviala-scroll-picker-column__highlight", "aria-hidden": true }),
|
|
9699
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
9482
9700
|
"div",
|
|
9483
9701
|
{
|
|
9484
9702
|
ref: scrollRef,
|
|
@@ -9489,12 +9707,12 @@ function ScrollPickerColumn({
|
|
|
9489
9707
|
"aria-activedescendant": selectedOptionId,
|
|
9490
9708
|
tabIndex: 0,
|
|
9491
9709
|
onKeyDown: handleKeyDown,
|
|
9492
|
-
children: /* @__PURE__ */ (0,
|
|
9710
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("ul", { className: "aviala-scroll-picker-column__list", children: repeatedValues.map((itemValue, index) => {
|
|
9493
9711
|
const isSelected = Object.is(itemValue, value);
|
|
9494
9712
|
const valueIndex = loop ? normalizeIndex2(index, values.length) : index;
|
|
9495
9713
|
const optionId = `${reactId}-${loop ? index : valueIndex}`;
|
|
9496
9714
|
const key = getValueKey?.(itemValue, index) ?? `${String(itemValue)}-${index}`;
|
|
9497
|
-
return /* @__PURE__ */ (0,
|
|
9715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("li", { className: "contents", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
9498
9716
|
ScrollPickerItem,
|
|
9499
9717
|
{
|
|
9500
9718
|
id: isSelected ? selectedOptionId : optionId,
|
|
@@ -9520,7 +9738,7 @@ function ScrollPickerItem({
|
|
|
9520
9738
|
className,
|
|
9521
9739
|
onSelect
|
|
9522
9740
|
}) {
|
|
9523
|
-
return /* @__PURE__ */ (0,
|
|
9741
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
9524
9742
|
"button",
|
|
9525
9743
|
{
|
|
9526
9744
|
type: "button",
|
|
@@ -9543,9 +9761,9 @@ function ScrollPickerItem({
|
|
|
9543
9761
|
// src/components/breadcrumb.tsx
|
|
9544
9762
|
var import_icons20 = require("@aviala-design/icons");
|
|
9545
9763
|
var import_class_variance_authority15 = require("class-variance-authority");
|
|
9546
|
-
var
|
|
9547
|
-
var
|
|
9548
|
-
var BreadcrumbSizeContext = (0,
|
|
9764
|
+
var import_react54 = require("react");
|
|
9765
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
9766
|
+
var BreadcrumbSizeContext = (0, import_react54.createContext)("default");
|
|
9549
9767
|
function breadcrumbTypeLevel(size) {
|
|
9550
9768
|
return size === "small" ? "caption" : "text";
|
|
9551
9769
|
}
|
|
@@ -9560,10 +9778,10 @@ var breadcrumbVariants = (0, import_class_variance_authority15.cva)("aviala-brea
|
|
|
9560
9778
|
size: "default"
|
|
9561
9779
|
}
|
|
9562
9780
|
});
|
|
9563
|
-
var Breadcrumb = (0,
|
|
9781
|
+
var Breadcrumb = (0, import_react54.forwardRef)(
|
|
9564
9782
|
({ className, size = "default", children, ...props }, ref) => {
|
|
9565
9783
|
const resolvedSize = size ?? "default";
|
|
9566
|
-
return /* @__PURE__ */ (0,
|
|
9784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(BreadcrumbSizeContext.Provider, { value: resolvedSize, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9567
9785
|
"nav",
|
|
9568
9786
|
{
|
|
9569
9787
|
ref,
|
|
@@ -9571,18 +9789,18 @@ var Breadcrumb = (0, import_react52.forwardRef)(
|
|
|
9571
9789
|
className: cn(breadcrumbVariants({ size: resolvedSize }), className),
|
|
9572
9790
|
"data-size": resolvedSize,
|
|
9573
9791
|
...props,
|
|
9574
|
-
children: /* @__PURE__ */ (0,
|
|
9792
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("ol", { className: "aviala-breadcrumb__list", children })
|
|
9575
9793
|
}
|
|
9576
9794
|
) });
|
|
9577
9795
|
}
|
|
9578
9796
|
);
|
|
9579
9797
|
Breadcrumb.displayName = "Breadcrumb";
|
|
9580
|
-
var BreadcrumbItem = (0,
|
|
9798
|
+
var BreadcrumbItem = (0, import_react54.forwardRef)(
|
|
9581
9799
|
({ className, href, current = false, icon, onClick, children, ...props }, ref) => {
|
|
9582
|
-
const size = (0,
|
|
9583
|
-
const label = /* @__PURE__ */ (0,
|
|
9584
|
-
icon ? /* @__PURE__ */ (0,
|
|
9585
|
-
children != null ? /* @__PURE__ */ (0,
|
|
9800
|
+
const size = (0, import_react54.useContext)(BreadcrumbSizeContext);
|
|
9801
|
+
const label = /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
|
|
9802
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "aviala-breadcrumb-item__icon", children: icon }) : null,
|
|
9803
|
+
children != null ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9586
9804
|
Typography,
|
|
9587
9805
|
{
|
|
9588
9806
|
level: breadcrumbTypeLevel(size),
|
|
@@ -9592,13 +9810,13 @@ var BreadcrumbItem = (0, import_react52.forwardRef)(
|
|
|
9592
9810
|
}
|
|
9593
9811
|
) : null
|
|
9594
9812
|
] });
|
|
9595
|
-
return /* @__PURE__ */ (0,
|
|
9813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9596
9814
|
"li",
|
|
9597
9815
|
{
|
|
9598
9816
|
ref,
|
|
9599
9817
|
className: cn("aviala-breadcrumb-item-wrap", className),
|
|
9600
9818
|
...props,
|
|
9601
|
-
children: href != null ? /* @__PURE__ */ (0,
|
|
9819
|
+
children: href != null ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9602
9820
|
"a",
|
|
9603
9821
|
{
|
|
9604
9822
|
href,
|
|
@@ -9607,7 +9825,7 @@ var BreadcrumbItem = (0, import_react52.forwardRef)(
|
|
|
9607
9825
|
"aria-current": current ? "page" : void 0,
|
|
9608
9826
|
children: label
|
|
9609
9827
|
}
|
|
9610
|
-
) : onClick != null ? /* @__PURE__ */ (0,
|
|
9828
|
+
) : onClick != null ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9611
9829
|
"button",
|
|
9612
9830
|
{
|
|
9613
9831
|
type: "button",
|
|
@@ -9617,7 +9835,7 @@ var BreadcrumbItem = (0, import_react52.forwardRef)(
|
|
|
9617
9835
|
onClick,
|
|
9618
9836
|
children: label
|
|
9619
9837
|
}
|
|
9620
|
-
) : /* @__PURE__ */ (0,
|
|
9838
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9621
9839
|
"span",
|
|
9622
9840
|
{
|
|
9623
9841
|
className: "aviala-breadcrumb-item",
|
|
@@ -9631,10 +9849,10 @@ var BreadcrumbItem = (0, import_react52.forwardRef)(
|
|
|
9631
9849
|
}
|
|
9632
9850
|
);
|
|
9633
9851
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
9634
|
-
var BreadcrumbSeparator = (0,
|
|
9852
|
+
var BreadcrumbSeparator = (0, import_react54.forwardRef)(
|
|
9635
9853
|
({ className, children = "/", ...props }, ref) => {
|
|
9636
|
-
const size = (0,
|
|
9637
|
-
return /* @__PURE__ */ (0,
|
|
9854
|
+
const size = (0, import_react54.useContext)(BreadcrumbSizeContext);
|
|
9855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9638
9856
|
"li",
|
|
9639
9857
|
{
|
|
9640
9858
|
ref,
|
|
@@ -9642,13 +9860,13 @@ var BreadcrumbSeparator = (0, import_react52.forwardRef)(
|
|
|
9642
9860
|
"aria-hidden": true,
|
|
9643
9861
|
className: cn("aviala-breadcrumb-separator", className),
|
|
9644
9862
|
...props,
|
|
9645
|
-
children: /* @__PURE__ */ (0,
|
|
9863
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Typography, { level: breadcrumbTypeLevel(size), as: "span", children })
|
|
9646
9864
|
}
|
|
9647
9865
|
);
|
|
9648
9866
|
}
|
|
9649
9867
|
);
|
|
9650
9868
|
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
9651
|
-
var BreadcrumbEllipsisItem = (0,
|
|
9869
|
+
var BreadcrumbEllipsisItem = (0, import_react54.forwardRef)(
|
|
9652
9870
|
({
|
|
9653
9871
|
className,
|
|
9654
9872
|
href,
|
|
@@ -9657,12 +9875,12 @@ var BreadcrumbEllipsisItem = (0, import_react52.forwardRef)(
|
|
|
9657
9875
|
children,
|
|
9658
9876
|
...props
|
|
9659
9877
|
}, ref) => {
|
|
9660
|
-
const content = /* @__PURE__ */ (0,
|
|
9661
|
-
/* @__PURE__ */ (0,
|
|
9662
|
-
showChevron ? /* @__PURE__ */ (0,
|
|
9878
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
|
|
9879
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Typography, { level: "text", as: "span", className: "aviala-breadcrumb-ellipsis-item__label", children }),
|
|
9880
|
+
showChevron ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "aviala-breadcrumb-ellipsis-item__chevron", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_icons20.DirectionArrowRightLight, { width: 14, height: 14, thickness: "Light" }) }) : null
|
|
9663
9881
|
] });
|
|
9664
9882
|
if (href != null) {
|
|
9665
|
-
return /* @__PURE__ */ (0,
|
|
9883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9666
9884
|
"a",
|
|
9667
9885
|
{
|
|
9668
9886
|
ref,
|
|
@@ -9674,7 +9892,7 @@ var BreadcrumbEllipsisItem = (0, import_react52.forwardRef)(
|
|
|
9674
9892
|
}
|
|
9675
9893
|
);
|
|
9676
9894
|
}
|
|
9677
|
-
return /* @__PURE__ */ (0,
|
|
9895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9678
9896
|
"button",
|
|
9679
9897
|
{
|
|
9680
9898
|
ref,
|
|
@@ -9688,7 +9906,7 @@ var BreadcrumbEllipsisItem = (0, import_react52.forwardRef)(
|
|
|
9688
9906
|
}
|
|
9689
9907
|
);
|
|
9690
9908
|
BreadcrumbEllipsisItem.displayName = "BreadcrumbEllipsisItem";
|
|
9691
|
-
var BreadcrumbEllipsis = (0,
|
|
9909
|
+
var BreadcrumbEllipsis = (0, import_react54.forwardRef)(
|
|
9692
9910
|
({
|
|
9693
9911
|
className,
|
|
9694
9912
|
children,
|
|
@@ -9700,11 +9918,11 @@ var BreadcrumbEllipsis = (0, import_react52.forwardRef)(
|
|
|
9700
9918
|
"aria-label": ariaLabel,
|
|
9701
9919
|
...props
|
|
9702
9920
|
}, ref) => {
|
|
9703
|
-
const size = (0,
|
|
9704
|
-
const [uncontrolledActivated, setUncontrolledActivated] = (0,
|
|
9921
|
+
const size = (0, import_react54.useContext)(BreadcrumbSizeContext);
|
|
9922
|
+
const [uncontrolledActivated, setUncontrolledActivated] = (0, import_react54.useState)(defaultActivated);
|
|
9705
9923
|
const isControlled = activatedProp !== void 0;
|
|
9706
9924
|
const activated = isControlled ? Boolean(activatedProp) : uncontrolledActivated;
|
|
9707
|
-
const setActivated = (0,
|
|
9925
|
+
const setActivated = (0, import_react54.useCallback)(
|
|
9708
9926
|
(next) => {
|
|
9709
9927
|
if (!isControlled) setUncontrolledActivated(next);
|
|
9710
9928
|
onActivatedChange?.(next);
|
|
@@ -9712,8 +9930,8 @@ var BreadcrumbEllipsis = (0, import_react52.forwardRef)(
|
|
|
9712
9930
|
[isControlled, onActivatedChange]
|
|
9713
9931
|
);
|
|
9714
9932
|
const iconSize = 14;
|
|
9715
|
-
const icon = children ?? /* @__PURE__ */ (0,
|
|
9716
|
-
const trigger = /* @__PURE__ */ (0,
|
|
9933
|
+
const icon = children ?? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_icons20.SymbolMore, { width: iconSize, height: iconSize, thickness: "Light", "aria-hidden": true });
|
|
9934
|
+
const trigger = /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9717
9935
|
"button",
|
|
9718
9936
|
{
|
|
9719
9937
|
type: "button",
|
|
@@ -9732,9 +9950,9 @@ var BreadcrumbEllipsis = (0, import_react52.forwardRef)(
|
|
|
9732
9950
|
children: icon
|
|
9733
9951
|
}
|
|
9734
9952
|
);
|
|
9735
|
-
return /* @__PURE__ */ (0,
|
|
9736
|
-
/* @__PURE__ */ (0,
|
|
9737
|
-
/* @__PURE__ */ (0,
|
|
9953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("li", { ref, className: cn("aviala-breadcrumb-ellipsis-wrap", className), children: menu != null ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Popover, { open: activated, onOpenChange: setActivated, children: [
|
|
9954
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(PopoverTrigger, { asChild: true, children: trigger }),
|
|
9955
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9738
9956
|
PopoverContent,
|
|
9739
9957
|
{
|
|
9740
9958
|
className: "aviala-breadcrumb-ellipsis-menu",
|
|
@@ -9743,7 +9961,7 @@ var BreadcrumbEllipsis = (0, import_react52.forwardRef)(
|
|
|
9743
9961
|
sideOffset: 7,
|
|
9744
9962
|
showArrow: false,
|
|
9745
9963
|
role: "menu",
|
|
9746
|
-
children: /* @__PURE__ */ (0,
|
|
9964
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "aviala-breadcrumb-ellipsis-menu__items", children: menu })
|
|
9747
9965
|
}
|
|
9748
9966
|
)
|
|
9749
9967
|
] }) : trigger });
|
|
@@ -9752,9 +9970,9 @@ var BreadcrumbEllipsis = (0, import_react52.forwardRef)(
|
|
|
9752
9970
|
BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis";
|
|
9753
9971
|
|
|
9754
9972
|
// src/components/pagehead.tsx
|
|
9755
|
-
var
|
|
9756
|
-
var
|
|
9757
|
-
var Pagehead = (0,
|
|
9973
|
+
var import_react55 = require("react");
|
|
9974
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
9975
|
+
var Pagehead = (0, import_react55.forwardRef)(
|
|
9758
9976
|
({
|
|
9759
9977
|
className,
|
|
9760
9978
|
back,
|
|
@@ -9764,16 +9982,16 @@ var Pagehead = (0, import_react53.forwardRef)(
|
|
|
9764
9982
|
actions,
|
|
9765
9983
|
children,
|
|
9766
9984
|
...props
|
|
9767
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
9768
|
-
/* @__PURE__ */ (0,
|
|
9769
|
-
back != null ? /* @__PURE__ */ (0,
|
|
9770
|
-
/* @__PURE__ */ (0,
|
|
9771
|
-
breadcrumb != null ? /* @__PURE__ */ (0,
|
|
9772
|
-
title != null || description != null ? /* @__PURE__ */ (0,
|
|
9985
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("header", { ref, className: cn("aviala-pagehead", className), ...props, children: [
|
|
9986
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "aviala-pagehead__main", children: [
|
|
9987
|
+
back != null ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "aviala-pagehead__back", children: back }) : null,
|
|
9988
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "aviala-pagehead__title-block", children: [
|
|
9989
|
+
breadcrumb != null ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "aviala-pagehead__breadcrumb", children: breadcrumb }) : null,
|
|
9990
|
+
title != null || description != null ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "aviala-pagehead__title", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Typeface, { content: "textCaption", primary: title, secondary: description }) }) : null,
|
|
9773
9991
|
children
|
|
9774
9992
|
] })
|
|
9775
9993
|
] }),
|
|
9776
|
-
actions != null ? /* @__PURE__ */ (0,
|
|
9994
|
+
actions != null ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "aviala-pagehead__actions", children: actions }) : null
|
|
9777
9995
|
] })
|
|
9778
9996
|
);
|
|
9779
9997
|
Pagehead.displayName = "Pagehead";
|
|
@@ -9781,8 +9999,8 @@ Pagehead.displayName = "Pagehead";
|
|
|
9781
9999
|
// src/components/steps.tsx
|
|
9782
10000
|
var import_icons21 = require("@aviala-design/icons");
|
|
9783
10001
|
var import_class_variance_authority16 = require("class-variance-authority");
|
|
9784
|
-
var
|
|
9785
|
-
var
|
|
10002
|
+
var import_react56 = require("react");
|
|
10003
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
9786
10004
|
var stepsVariants = (0, import_class_variance_authority16.cva)("aviala-steps", {
|
|
9787
10005
|
variants: {
|
|
9788
10006
|
direction: {
|
|
@@ -9794,8 +10012,8 @@ var stepsVariants = (0, import_class_variance_authority16.cva)("aviala-steps", {
|
|
|
9794
10012
|
direction: "horizontal"
|
|
9795
10013
|
}
|
|
9796
10014
|
});
|
|
9797
|
-
var Steps = (0,
|
|
9798
|
-
({ className, direction = "horizontal", children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
10015
|
+
var Steps = (0, import_react56.forwardRef)(
|
|
10016
|
+
({ className, direction = "horizontal", children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
9799
10017
|
"div",
|
|
9800
10018
|
{
|
|
9801
10019
|
ref,
|
|
@@ -9810,20 +10028,20 @@ Steps.displayName = "Steps";
|
|
|
9810
10028
|
function defaultStepsIconContent(state, index) {
|
|
9811
10029
|
switch (state) {
|
|
9812
10030
|
case "done":
|
|
9813
|
-
return /* @__PURE__ */ (0,
|
|
10031
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_icons21.SymbolRight, { width: 12, height: 12, thickness: "Bold", "aria-hidden": true });
|
|
9814
10032
|
case "fail":
|
|
9815
|
-
return /* @__PURE__ */ (0,
|
|
10033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_icons21.SymbolWrong, { width: 12, height: 12, thickness: "Bold", "aria-hidden": true });
|
|
9816
10034
|
case "warning":
|
|
9817
|
-
return /* @__PURE__ */ (0,
|
|
10035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_icons21.SymbolWarning, { width: 12, height: 12, thickness: "Bold", "aria-hidden": true });
|
|
9818
10036
|
case "waiting":
|
|
9819
10037
|
case "inProgress":
|
|
9820
10038
|
case "default":
|
|
9821
10039
|
default:
|
|
9822
|
-
return index != null ? /* @__PURE__ */ (0,
|
|
10040
|
+
return index != null ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Typography, { level: "caption", as: "span", className: "aviala-steps-icon__index", children: index }) : null;
|
|
9823
10041
|
}
|
|
9824
10042
|
}
|
|
9825
|
-
var StepsIcon = (0,
|
|
9826
|
-
({ className, state = "default", index, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
10043
|
+
var StepsIcon = (0, import_react56.forwardRef)(
|
|
10044
|
+
({ className, state = "default", index, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
9827
10045
|
"span",
|
|
9828
10046
|
{
|
|
9829
10047
|
ref,
|
|
@@ -9835,7 +10053,7 @@ var StepsIcon = (0, import_react54.forwardRef)(
|
|
|
9835
10053
|
)
|
|
9836
10054
|
);
|
|
9837
10055
|
StepsIcon.displayName = "StepsIcon";
|
|
9838
|
-
var StepsItem = (0,
|
|
10056
|
+
var StepsItem = (0, import_react56.forwardRef)(
|
|
9839
10057
|
({
|
|
9840
10058
|
className,
|
|
9841
10059
|
state = "default",
|
|
@@ -9845,7 +10063,7 @@ var StepsItem = (0, import_react54.forwardRef)(
|
|
|
9845
10063
|
icon,
|
|
9846
10064
|
children,
|
|
9847
10065
|
...props
|
|
9848
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
10066
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
9849
10067
|
"div",
|
|
9850
10068
|
{
|
|
9851
10069
|
ref,
|
|
@@ -9853,9 +10071,9 @@ var StepsItem = (0, import_react54.forwardRef)(
|
|
|
9853
10071
|
"data-state": state,
|
|
9854
10072
|
...props,
|
|
9855
10073
|
children: [
|
|
9856
|
-
icon ?? /* @__PURE__ */ (0,
|
|
9857
|
-
/* @__PURE__ */ (0,
|
|
9858
|
-
title != null ? /* @__PURE__ */ (0,
|
|
10074
|
+
icon ?? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(StepsIcon, { state, index }),
|
|
10075
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "aviala-steps-item__body", children: [
|
|
10076
|
+
title != null ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
9859
10077
|
Typography,
|
|
9860
10078
|
{
|
|
9861
10079
|
level: "subtitle",
|
|
@@ -9864,7 +10082,7 @@ var StepsItem = (0, import_react54.forwardRef)(
|
|
|
9864
10082
|
children: title
|
|
9865
10083
|
}
|
|
9866
10084
|
) : null,
|
|
9867
|
-
description != null ? /* @__PURE__ */ (0,
|
|
10085
|
+
description != null ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
9868
10086
|
Typography,
|
|
9869
10087
|
{
|
|
9870
10088
|
level: "text",
|
|
@@ -9883,8 +10101,8 @@ StepsItem.displayName = "StepsItem";
|
|
|
9883
10101
|
|
|
9884
10102
|
// src/components/pagination.tsx
|
|
9885
10103
|
var import_icons22 = require("@aviala-design/icons");
|
|
9886
|
-
var
|
|
9887
|
-
var
|
|
10104
|
+
var import_react57 = require("react");
|
|
10105
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
9888
10106
|
function buildPageList(page, pageCount) {
|
|
9889
10107
|
if (pageCount <= 7) {
|
|
9890
10108
|
return Array.from({ length: pageCount }, (_, index) => index + 1);
|
|
@@ -9907,7 +10125,17 @@ function buildPageList(page, pageCount) {
|
|
|
9907
10125
|
}
|
|
9908
10126
|
return result;
|
|
9909
10127
|
}
|
|
9910
|
-
|
|
10128
|
+
function ellipsisRange(pages, index) {
|
|
10129
|
+
const prev = pages[index - 1];
|
|
10130
|
+
const next = pages[index + 1];
|
|
10131
|
+
if (typeof prev !== "number" || typeof next !== "number") return [];
|
|
10132
|
+
const start = prev + 1;
|
|
10133
|
+
const end = next - 1;
|
|
10134
|
+
const range = [];
|
|
10135
|
+
for (let p = start; p <= end; p += 1) range.push(p);
|
|
10136
|
+
return range;
|
|
10137
|
+
}
|
|
10138
|
+
var Pagination = (0, import_react57.forwardRef)(
|
|
9911
10139
|
({
|
|
9912
10140
|
className,
|
|
9913
10141
|
page: pageProp,
|
|
@@ -9925,9 +10153,10 @@ var Pagination = (0, import_react55.forwardRef)(
|
|
|
9925
10153
|
sizeOptionLabel = (size) => `${size} \u9879`,
|
|
9926
10154
|
...props
|
|
9927
10155
|
}, ref) => {
|
|
9928
|
-
const [uncontrolledPage, setUncontrolledPage] = (0,
|
|
9929
|
-
const [uncontrolledPageSize, setUncontrolledPageSize] = (0,
|
|
9930
|
-
const [jumpValue, setJumpValue] = (0,
|
|
10156
|
+
const [uncontrolledPage, setUncontrolledPage] = (0, import_react57.useState)(defaultPage);
|
|
10157
|
+
const [uncontrolledPageSize, setUncontrolledPageSize] = (0, import_react57.useState)(defaultPageSize);
|
|
10158
|
+
const [jumpValue, setJumpValue] = (0, import_react57.useState)("");
|
|
10159
|
+
const [openEllipsis, setOpenEllipsis] = (0, import_react57.useState)(null);
|
|
9931
10160
|
const page = pageProp ?? uncontrolledPage;
|
|
9932
10161
|
const pageSize = pageSizeProp ?? uncontrolledPageSize;
|
|
9933
10162
|
const safePageCount = Math.max(1, pageCount);
|
|
@@ -9948,7 +10177,7 @@ var Pagination = (0, import_react55.forwardRef)(
|
|
|
9948
10177
|
setPage(parsed);
|
|
9949
10178
|
setJumpValue("");
|
|
9950
10179
|
};
|
|
9951
|
-
return /* @__PURE__ */ (0,
|
|
10180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
9952
10181
|
"div",
|
|
9953
10182
|
{
|
|
9954
10183
|
ref,
|
|
@@ -9957,8 +10186,8 @@ var Pagination = (0, import_react55.forwardRef)(
|
|
|
9957
10186
|
"aria-label": props["aria-label"] ?? "Pagination",
|
|
9958
10187
|
...props,
|
|
9959
10188
|
children: [
|
|
9960
|
-
/* @__PURE__ */ (0,
|
|
9961
|
-
/* @__PURE__ */ (0,
|
|
10189
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "aviala-pagination__controls", children: [
|
|
10190
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
9962
10191
|
Button,
|
|
9963
10192
|
{
|
|
9964
10193
|
mode: "noBackgroundCustom",
|
|
@@ -9966,35 +10195,69 @@ var Pagination = (0, import_react55.forwardRef)(
|
|
|
9966
10195
|
iconOnly: true,
|
|
9967
10196
|
"aria-label": "Previous page",
|
|
9968
10197
|
disabled: currentPage <= 1,
|
|
9969
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
10198
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons22.DirectionArrowLeftLight, { "aria-hidden": true }),
|
|
9970
10199
|
onClick: () => setPage(currentPage - 1)
|
|
9971
10200
|
}
|
|
9972
10201
|
),
|
|
9973
|
-
/* @__PURE__ */ (0,
|
|
9974
|
-
(item, index) => item === "ellipsis" ? /* @__PURE__ */ (0,
|
|
9975
|
-
|
|
10202
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "aviala-pagination__pages", children: pages.map(
|
|
10203
|
+
(item, index) => item === "ellipsis" ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
10204
|
+
Popover,
|
|
9976
10205
|
{
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
9980
|
-
|
|
9981
|
-
|
|
10206
|
+
open: openEllipsis === index,
|
|
10207
|
+
onOpenChange: (open) => setOpenEllipsis(open ? index : null),
|
|
10208
|
+
children: [
|
|
10209
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
10210
|
+
"button",
|
|
10211
|
+
{
|
|
10212
|
+
type: "button",
|
|
10213
|
+
"data-size": "regular",
|
|
10214
|
+
className: cn(
|
|
10215
|
+
buttonVariants({ mode: "noBackgroundCustom", compact: true }),
|
|
10216
|
+
"aviala-pagination__page--ellipsis"
|
|
10217
|
+
),
|
|
10218
|
+
"aria-label": "\u66F4\u591A\u9875\u7801",
|
|
10219
|
+
"aria-haspopup": "menu",
|
|
10220
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Typography, { level: "text", as: "span", children: "\u2026" })
|
|
10221
|
+
}
|
|
10222
|
+
) }),
|
|
10223
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PopoverContent, { className: "aviala-pagination__ellipsis-content", showArrow: true, flush: true, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "aviala-pagination__ellipsis-menu", children: ellipsisRange(pages, index).map((p) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
10224
|
+
"button",
|
|
10225
|
+
{
|
|
10226
|
+
type: "button",
|
|
10227
|
+
"data-size": "regular",
|
|
10228
|
+
className: cn(
|
|
10229
|
+
buttonVariants({ mode: "noBackgroundCustom", compact: true }),
|
|
10230
|
+
"aviala-pagination__ellipsis-page"
|
|
10231
|
+
),
|
|
10232
|
+
onClick: () => {
|
|
10233
|
+
setPage(p);
|
|
10234
|
+
setOpenEllipsis(null);
|
|
10235
|
+
},
|
|
10236
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Typography, { level: "text", as: "span", children: p })
|
|
10237
|
+
},
|
|
10238
|
+
p
|
|
10239
|
+
)) }) })
|
|
10240
|
+
]
|
|
9982
10241
|
},
|
|
9983
10242
|
`ellipsis-${index}`
|
|
9984
|
-
) : /* @__PURE__ */ (0,
|
|
10243
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
9985
10244
|
"button",
|
|
9986
10245
|
{
|
|
9987
10246
|
type: "button",
|
|
9988
|
-
|
|
10247
|
+
"data-size": "regular",
|
|
10248
|
+
className: cn(
|
|
10249
|
+
buttonVariants({ mode: "noBackgroundCustom", compact: true }),
|
|
10250
|
+
"aviala-pagination__page"
|
|
10251
|
+
),
|
|
9989
10252
|
"data-active": item === currentPage ? "true" : void 0,
|
|
9990
10253
|
"aria-current": item === currentPage ? "page" : void 0,
|
|
9991
10254
|
onClick: () => setPage(item),
|
|
9992
|
-
children: /* @__PURE__ */ (0,
|
|
10255
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Typography, { level: "text", as: "span", children: item })
|
|
9993
10256
|
},
|
|
9994
10257
|
item
|
|
9995
10258
|
)
|
|
9996
10259
|
) }),
|
|
9997
|
-
/* @__PURE__ */ (0,
|
|
10260
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
9998
10261
|
Button,
|
|
9999
10262
|
{
|
|
10000
10263
|
mode: "noBackgroundCustom",
|
|
@@ -10002,14 +10265,14 @@ var Pagination = (0, import_react55.forwardRef)(
|
|
|
10002
10265
|
iconOnly: true,
|
|
10003
10266
|
"aria-label": "Next page",
|
|
10004
10267
|
disabled: currentPage >= safePageCount,
|
|
10005
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
10268
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_icons22.DirectionArrowRightLight, { "aria-hidden": true }),
|
|
10006
10269
|
onClick: () => setPage(currentPage + 1)
|
|
10007
10270
|
}
|
|
10008
10271
|
)
|
|
10009
10272
|
] }),
|
|
10010
|
-
showJump ? /* @__PURE__ */ (0,
|
|
10011
|
-
/* @__PURE__ */ (0,
|
|
10012
|
-
/* @__PURE__ */ (0,
|
|
10273
|
+
showJump ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "aviala-pagination__jump", children: [
|
|
10274
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Typography, { level: "text", as: "span", children: jumpLabel }),
|
|
10275
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
10013
10276
|
Input,
|
|
10014
10277
|
{
|
|
10015
10278
|
className: "aviala-pagination__jump-input",
|
|
@@ -10029,15 +10292,15 @@ var Pagination = (0, import_react55.forwardRef)(
|
|
|
10029
10292
|
}
|
|
10030
10293
|
)
|
|
10031
10294
|
] }) : null,
|
|
10032
|
-
showSizeChanger ? /* @__PURE__ */ (0,
|
|
10033
|
-
/* @__PURE__ */ (0,
|
|
10034
|
-
/* @__PURE__ */ (0,
|
|
10295
|
+
showSizeChanger ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "aviala-pagination__size", children: [
|
|
10296
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Typography, { level: "text", as: "span", children: sizeLabel }),
|
|
10297
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
10035
10298
|
Select,
|
|
10036
10299
|
{
|
|
10037
10300
|
value: String(pageSize),
|
|
10038
10301
|
onValueChange: (value) => setPageSize(Number(value)),
|
|
10039
10302
|
children: [
|
|
10040
|
-
/* @__PURE__ */ (0,
|
|
10303
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
10041
10304
|
SelectTrigger,
|
|
10042
10305
|
{
|
|
10043
10306
|
size: "regular",
|
|
@@ -10045,7 +10308,7 @@ var Pagination = (0, import_react55.forwardRef)(
|
|
|
10045
10308
|
"aria-label": "Page size"
|
|
10046
10309
|
}
|
|
10047
10310
|
),
|
|
10048
|
-
/* @__PURE__ */ (0,
|
|
10311
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectContent, { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItemGroup, { children: pageSizeOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
10049
10312
|
SelectItem,
|
|
10050
10313
|
{
|
|
10051
10314
|
value: String(option),
|
|
@@ -10067,15 +10330,15 @@ Pagination.displayName = "Pagination";
|
|
|
10067
10330
|
|
|
10068
10331
|
// src/components/card.tsx
|
|
10069
10332
|
var import_icons23 = require("@aviala-design/icons");
|
|
10070
|
-
var
|
|
10071
|
-
var
|
|
10072
|
-
var Card = (0,
|
|
10073
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
10333
|
+
var import_react58 = require("react");
|
|
10334
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
10335
|
+
var Card = (0, import_react58.forwardRef)(
|
|
10336
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { ref, className: cn("aviala-card", className), ...props, children })
|
|
10074
10337
|
);
|
|
10075
10338
|
Card.displayName = "Card";
|
|
10076
10339
|
function renderCardIcon(node) {
|
|
10077
10340
|
if (!node) return null;
|
|
10078
|
-
const content = (0,
|
|
10341
|
+
const content = (0, import_react58.isValidElement)(node) && typeof node.type !== "string" ? (0, import_react58.cloneElement)(node, {
|
|
10079
10342
|
width: 14,
|
|
10080
10343
|
height: 14,
|
|
10081
10344
|
className: cn(
|
|
@@ -10083,9 +10346,9 @@ function renderCardIcon(node) {
|
|
|
10083
10346
|
"shrink-0"
|
|
10084
10347
|
)
|
|
10085
10348
|
}) : node;
|
|
10086
|
-
return /* @__PURE__ */ (0,
|
|
10349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "aviala-card-head__icon", children: content });
|
|
10087
10350
|
}
|
|
10088
|
-
var CardHead = (0,
|
|
10351
|
+
var CardHead = (0, import_react58.forwardRef)(
|
|
10089
10352
|
({
|
|
10090
10353
|
className,
|
|
10091
10354
|
slotType = "select",
|
|
@@ -10101,38 +10364,38 @@ var CardHead = (0, import_react56.forwardRef)(
|
|
|
10101
10364
|
children,
|
|
10102
10365
|
...props
|
|
10103
10366
|
}, ref) => {
|
|
10104
|
-
const primaryAction = action ?? /* @__PURE__ */ (0,
|
|
10367
|
+
const primaryAction = action ?? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Button, { mode: "primary", size: "regular", leftIcon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons23.GeneralSetting, { "aria-hidden": true }), children: actionLabel });
|
|
10105
10368
|
const renderTrailing = () => {
|
|
10106
10369
|
if (trailing !== void 0) return trailing;
|
|
10107
10370
|
switch (slotType) {
|
|
10108
10371
|
case "action":
|
|
10109
|
-
return /* @__PURE__ */ (0,
|
|
10372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "aviala-card-head__trailing", children: [
|
|
10110
10373
|
primaryAction,
|
|
10111
|
-
secondaryAction ?? /* @__PURE__ */ (0,
|
|
10374
|
+
secondaryAction ?? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
10112
10375
|
Button,
|
|
10113
10376
|
{
|
|
10114
10377
|
mode: "default",
|
|
10115
10378
|
size: "regular",
|
|
10116
10379
|
iconOnly: true,
|
|
10117
10380
|
"aria-label": "More",
|
|
10118
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
10381
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons23.GeneralSetting, { "aria-hidden": true })
|
|
10119
10382
|
}
|
|
10120
10383
|
),
|
|
10121
|
-
/* @__PURE__ */ (0,
|
|
10122
|
-
/* @__PURE__ */ (0,
|
|
10384
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "aviala-card__divider", "aria-hidden": true }),
|
|
10385
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons23.DirectionArrowRightLight, { width: 14, height: 14, "aria-hidden": true })
|
|
10123
10386
|
] });
|
|
10124
10387
|
case "switch":
|
|
10125
|
-
return /* @__PURE__ */ (0,
|
|
10388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "aviala-card-head__trailing", children: [
|
|
10126
10389
|
primaryAction,
|
|
10127
|
-
/* @__PURE__ */ (0,
|
|
10128
|
-
/* @__PURE__ */ (0,
|
|
10390
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "aviala-card__divider", "aria-hidden": true }),
|
|
10391
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Switch, { ...switchProps })
|
|
10129
10392
|
] });
|
|
10130
10393
|
case "select":
|
|
10131
10394
|
default:
|
|
10132
|
-
return select != null ? /* @__PURE__ */ (0,
|
|
10395
|
+
return select != null ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "aviala-card-head__trailing", children: select }) : null;
|
|
10133
10396
|
}
|
|
10134
10397
|
};
|
|
10135
|
-
return /* @__PURE__ */ (0,
|
|
10398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
10136
10399
|
"div",
|
|
10137
10400
|
{
|
|
10138
10401
|
ref,
|
|
@@ -10140,9 +10403,9 @@ var CardHead = (0, import_react56.forwardRef)(
|
|
|
10140
10403
|
"data-type": slotType,
|
|
10141
10404
|
...props,
|
|
10142
10405
|
children: [
|
|
10143
|
-
/* @__PURE__ */ (0,
|
|
10144
|
-
renderCardIcon(icon ?? /* @__PURE__ */ (0,
|
|
10145
|
-
/* @__PURE__ */ (0,
|
|
10406
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "aviala-card-head__main", children: [
|
|
10407
|
+
renderCardIcon(icon ?? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons23.GeneralSetting, { "aria-hidden": true })),
|
|
10408
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "aviala-card-head__title", children: title != null || description != null ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Typeface, { content: "textCaption", primary: title, secondary: description }) : children })
|
|
10146
10409
|
] }),
|
|
10147
10410
|
renderTrailing()
|
|
10148
10411
|
]
|
|
@@ -10151,11 +10414,11 @@ var CardHead = (0, import_react56.forwardRef)(
|
|
|
10151
10414
|
}
|
|
10152
10415
|
);
|
|
10153
10416
|
CardHead.displayName = "CardHead";
|
|
10154
|
-
var CardBody = (0,
|
|
10155
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
10417
|
+
var CardBody = (0, import_react58.forwardRef)(
|
|
10418
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { ref, className: cn("aviala-card-body", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "aviala-card-body__content", children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Typography, { level: "text", as: "span", children }) : children }) })
|
|
10156
10419
|
);
|
|
10157
10420
|
CardBody.displayName = "CardBody";
|
|
10158
|
-
var CardBottom = (0,
|
|
10421
|
+
var CardBottom = (0, import_react58.forwardRef)(
|
|
10159
10422
|
({
|
|
10160
10423
|
className,
|
|
10161
10424
|
slotType = "action",
|
|
@@ -10168,46 +10431,46 @@ var CardBottom = (0, import_react56.forwardRef)(
|
|
|
10168
10431
|
children,
|
|
10169
10432
|
...props
|
|
10170
10433
|
}, ref) => {
|
|
10171
|
-
const primaryAction = action ?? /* @__PURE__ */ (0,
|
|
10434
|
+
const primaryAction = action ?? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Button, { mode: "primary", size: "regular", leftIcon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons23.GeneralSetting, { "aria-hidden": true }), children: actionLabel });
|
|
10172
10435
|
const renderTrailing = () => {
|
|
10173
10436
|
if (trailing !== void 0) return trailing;
|
|
10174
10437
|
if (children != null) return children;
|
|
10175
10438
|
switch (slotType) {
|
|
10176
10439
|
case "switch":
|
|
10177
|
-
return /* @__PURE__ */ (0,
|
|
10440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
10178
10441
|
primaryAction,
|
|
10179
|
-
/* @__PURE__ */ (0,
|
|
10180
|
-
/* @__PURE__ */ (0,
|
|
10442
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "aviala-card__divider", "aria-hidden": true }),
|
|
10443
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Switch, { ...switchProps })
|
|
10181
10444
|
] });
|
|
10182
10445
|
case "select":
|
|
10183
10446
|
return select;
|
|
10184
10447
|
case "action":
|
|
10185
10448
|
default:
|
|
10186
|
-
return /* @__PURE__ */ (0,
|
|
10449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
10187
10450
|
primaryAction,
|
|
10188
|
-
secondaryAction ?? /* @__PURE__ */ (0,
|
|
10451
|
+
secondaryAction ?? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
10189
10452
|
Button,
|
|
10190
10453
|
{
|
|
10191
10454
|
mode: "default",
|
|
10192
10455
|
size: "regular",
|
|
10193
10456
|
iconOnly: true,
|
|
10194
10457
|
"aria-label": "More",
|
|
10195
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
10458
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons23.GeneralSetting, { "aria-hidden": true })
|
|
10196
10459
|
}
|
|
10197
10460
|
),
|
|
10198
|
-
/* @__PURE__ */ (0,
|
|
10199
|
-
/* @__PURE__ */ (0,
|
|
10461
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "aviala-card__divider", "aria-hidden": true }),
|
|
10462
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons23.DirectionArrowRightLight, { width: 14, height: 14, "aria-hidden": true })
|
|
10200
10463
|
] });
|
|
10201
10464
|
}
|
|
10202
10465
|
};
|
|
10203
|
-
return /* @__PURE__ */ (0,
|
|
10466
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
10204
10467
|
"div",
|
|
10205
10468
|
{
|
|
10206
10469
|
ref,
|
|
10207
10470
|
className: cn("aviala-card-bottom", className),
|
|
10208
10471
|
"data-type": slotType,
|
|
10209
10472
|
...props,
|
|
10210
|
-
children: /* @__PURE__ */ (0,
|
|
10473
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "aviala-card-bottom__trailing", children: renderTrailing() })
|
|
10211
10474
|
}
|
|
10212
10475
|
);
|
|
10213
10476
|
}
|
|
@@ -10215,10 +10478,10 @@ var CardBottom = (0, import_react56.forwardRef)(
|
|
|
10215
10478
|
CardBottom.displayName = "CardBottom";
|
|
10216
10479
|
|
|
10217
10480
|
// src/components/table.tsx
|
|
10218
|
-
var
|
|
10219
|
-
var
|
|
10220
|
-
var Table = (0,
|
|
10221
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
10481
|
+
var import_react59 = require("react");
|
|
10482
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
10483
|
+
var Table = (0, import_react59.forwardRef)(
|
|
10484
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
10222
10485
|
"div",
|
|
10223
10486
|
{
|
|
10224
10487
|
ref,
|
|
@@ -10230,8 +10493,8 @@ var Table = (0, import_react57.forwardRef)(
|
|
|
10230
10493
|
)
|
|
10231
10494
|
);
|
|
10232
10495
|
Table.displayName = "Table";
|
|
10233
|
-
var TableRow = (0,
|
|
10234
|
-
({ className, header = false, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
10496
|
+
var TableRow = (0, import_react59.forwardRef)(
|
|
10497
|
+
({ className, header = false, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
10235
10498
|
"div",
|
|
10236
10499
|
{
|
|
10237
10500
|
ref,
|
|
@@ -10244,8 +10507,8 @@ var TableRow = (0, import_react57.forwardRef)(
|
|
|
10244
10507
|
)
|
|
10245
10508
|
);
|
|
10246
10509
|
TableRow.displayName = "TableRow";
|
|
10247
|
-
var TableHead = (0,
|
|
10248
|
-
({ className, content = "text", children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
10510
|
+
var TableHead = (0, import_react59.forwardRef)(
|
|
10511
|
+
({ className, content = "text", children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
10249
10512
|
"div",
|
|
10250
10513
|
{
|
|
10251
10514
|
ref,
|
|
@@ -10253,14 +10516,14 @@ var TableHead = (0, import_react57.forwardRef)(
|
|
|
10253
10516
|
className: cn("aviala-table-head", className),
|
|
10254
10517
|
"data-content": content,
|
|
10255
10518
|
...props,
|
|
10256
|
-
children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ (0,
|
|
10519
|
+
children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Typography, { level: "caption", as: "span", children }) : children
|
|
10257
10520
|
}
|
|
10258
10521
|
)
|
|
10259
10522
|
);
|
|
10260
10523
|
TableHead.displayName = "TableHead";
|
|
10261
10524
|
function renderCellIcon(node) {
|
|
10262
10525
|
if (!node) return null;
|
|
10263
|
-
const content = (0,
|
|
10526
|
+
const content = (0, import_react59.isValidElement)(node) && typeof node.type !== "string" ? (0, import_react59.cloneElement)(node, {
|
|
10264
10527
|
width: 16,
|
|
10265
10528
|
height: 16,
|
|
10266
10529
|
className: cn(
|
|
@@ -10268,9 +10531,9 @@ function renderCellIcon(node) {
|
|
|
10268
10531
|
"shrink-0"
|
|
10269
10532
|
)
|
|
10270
10533
|
}) : node;
|
|
10271
|
-
return /* @__PURE__ */ (0,
|
|
10534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "aviala-table-cell__icon", children: content });
|
|
10272
10535
|
}
|
|
10273
|
-
var TableCell = (0,
|
|
10536
|
+
var TableCell = (0, import_react59.forwardRef)(
|
|
10274
10537
|
({
|
|
10275
10538
|
className,
|
|
10276
10539
|
content = "text",
|
|
@@ -10289,29 +10552,29 @@ var TableCell = (0, import_react57.forwardRef)(
|
|
|
10289
10552
|
if (children != null) return children;
|
|
10290
10553
|
switch (content) {
|
|
10291
10554
|
case "checkbox":
|
|
10292
|
-
return /* @__PURE__ */ (0,
|
|
10555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Checkbox, { ...checkboxProps });
|
|
10293
10556
|
case "icon+text":
|
|
10294
|
-
return /* @__PURE__ */ (0,
|
|
10557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
|
|
10295
10558
|
renderCellIcon(icon),
|
|
10296
|
-
/* @__PURE__ */ (0,
|
|
10559
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "aviala-table-cell__text", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Typography, { level: "text", as: "span", children: text }) })
|
|
10297
10560
|
] });
|
|
10298
10561
|
case "people":
|
|
10299
|
-
return /* @__PURE__ */ (0,
|
|
10300
|
-
people ?? /* @__PURE__ */ (0,
|
|
10301
|
-
/* @__PURE__ */ (0,
|
|
10562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
|
|
10563
|
+
people ?? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Avatar, { content: "text", level: "text", children: "A" }),
|
|
10564
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "aviala-table-cell__text", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Typography, { level: "text", as: "span", children: text }) })
|
|
10302
10565
|
] });
|
|
10303
10566
|
case "badge":
|
|
10304
|
-
return badge ?? /* @__PURE__ */ (0,
|
|
10567
|
+
return badge ?? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Badge, { style: "theme", level: "caption", children: badgeLabel ?? "Text" });
|
|
10305
10568
|
case "switch":
|
|
10306
|
-
return /* @__PURE__ */ (0,
|
|
10569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Switch, { ...switchProps });
|
|
10307
10570
|
case "action":
|
|
10308
|
-
return /* @__PURE__ */ (0,
|
|
10571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "aviala-table-cell__actions", children: actions });
|
|
10309
10572
|
case "text":
|
|
10310
10573
|
default:
|
|
10311
|
-
return /* @__PURE__ */ (0,
|
|
10574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "aviala-table-cell__text", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Typography, { level: "text", as: "span", children: text }) });
|
|
10312
10575
|
}
|
|
10313
10576
|
};
|
|
10314
|
-
return /* @__PURE__ */ (0,
|
|
10577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
10315
10578
|
"div",
|
|
10316
10579
|
{
|
|
10317
10580
|
ref,
|
|
@@ -10373,6 +10636,7 @@ TableCell.displayName = "TableCell";
|
|
|
10373
10636
|
Feedback,
|
|
10374
10637
|
Fieldset,
|
|
10375
10638
|
FormField,
|
|
10639
|
+
HoverPopover,
|
|
10376
10640
|
Input,
|
|
10377
10641
|
InputGroup,
|
|
10378
10642
|
InputGroupAddon,
|
|
@@ -10423,6 +10687,7 @@ TableCell.displayName = "TableCell";
|
|
|
10423
10687
|
RadioGroup,
|
|
10424
10688
|
RadioGroupItem,
|
|
10425
10689
|
RadioInput,
|
|
10690
|
+
ResponsiveTooltip,
|
|
10426
10691
|
Scroll,
|
|
10427
10692
|
ScrollPicker,
|
|
10428
10693
|
ScrollPickerColumn,
|