@aviala-design/spiral 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1113 -1010
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +132 -4
- package/dist/index.d.ts +132 -4
- package/dist/index.js +985 -880
- 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.js
CHANGED
|
@@ -471,6 +471,10 @@ var buttonVariants = cva3(
|
|
|
471
471
|
allRound: {
|
|
472
472
|
true: "min-w-[var(--button-min-width-allround,48px)] !rounded-[var(--border-radius-allround,99px)]",
|
|
473
473
|
false: "min-w-[var(--button-min-width,46px)]"
|
|
474
|
+
},
|
|
475
|
+
compact: {
|
|
476
|
+
true: "min-w-0",
|
|
477
|
+
false: ""
|
|
474
478
|
}
|
|
475
479
|
},
|
|
476
480
|
defaultVariants: {
|
|
@@ -555,6 +559,7 @@ var Button = forwardRef3(
|
|
|
555
559
|
variant,
|
|
556
560
|
size: sizeProp,
|
|
557
561
|
allRound = false,
|
|
562
|
+
compact,
|
|
558
563
|
iconOnly: iconOnlyProp,
|
|
559
564
|
asChild = false,
|
|
560
565
|
loading = false,
|
|
@@ -609,7 +614,7 @@ var Button = forwardRef3(
|
|
|
609
614
|
!iconOnly && renderIcon(rightIcon, iconLevel, void 0, "button.icon-right")
|
|
610
615
|
] });
|
|
611
616
|
const classes = cn(
|
|
612
|
-
buttonVariants({ mode, ...iconOnly ? {} : { allRound } }),
|
|
617
|
+
buttonVariants({ mode, ...iconOnly ? {} : { allRound }, compact }),
|
|
613
618
|
iconOnly && "min-w-0",
|
|
614
619
|
iconOnly && allRound && "!rounded-[var(--border-radius-allround,99px)]",
|
|
615
620
|
className
|
|
@@ -652,6 +657,25 @@ import {
|
|
|
652
657
|
useState as useState2
|
|
653
658
|
} from "react";
|
|
654
659
|
|
|
660
|
+
// src/lib/render-slot-icon.tsx
|
|
661
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
662
|
+
function renderSlotIcon(node, className, debugId) {
|
|
663
|
+
if (!node) return null;
|
|
664
|
+
const content = cloneAvialaIconElement(node, {
|
|
665
|
+
level: "text",
|
|
666
|
+
biggerSize: true
|
|
667
|
+
});
|
|
668
|
+
return /* @__PURE__ */ jsx5(
|
|
669
|
+
"span",
|
|
670
|
+
{
|
|
671
|
+
className,
|
|
672
|
+
style: iconSlotCssVarStyle(node, "--input-slot-icon-size", "text", true),
|
|
673
|
+
...debugId ? spiralDebugId(debugId) : void 0,
|
|
674
|
+
children: content
|
|
675
|
+
}
|
|
676
|
+
);
|
|
677
|
+
}
|
|
678
|
+
|
|
655
679
|
// src/components/badge.tsx
|
|
656
680
|
import { cva as cva4 } from "class-variance-authority";
|
|
657
681
|
import {
|
|
@@ -660,7 +684,7 @@ import {
|
|
|
660
684
|
isValidElement as isValidElement4
|
|
661
685
|
} from "react";
|
|
662
686
|
import { resolveIconSizeToken as resolveIconSizeToken3 } from "@aviala-design/icons";
|
|
663
|
-
import { jsx as
|
|
687
|
+
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
664
688
|
var badgeVariants = cva4("aviala-badge", {
|
|
665
689
|
variants: {
|
|
666
690
|
style: {
|
|
@@ -717,7 +741,7 @@ function renderBadgeIcon(node, level) {
|
|
|
717
741
|
)
|
|
718
742
|
}
|
|
719
743
|
) : node;
|
|
720
|
-
return /* @__PURE__ */
|
|
744
|
+
return /* @__PURE__ */ jsx6("span", { className: "aviala-badge__icon", "aria-hidden": true, children: content });
|
|
721
745
|
}
|
|
722
746
|
var Badge = forwardRef4(
|
|
723
747
|
({
|
|
@@ -756,7 +780,7 @@ var Badge = forwardRef4(
|
|
|
756
780
|
...props,
|
|
757
781
|
children: [
|
|
758
782
|
renderBadgeIcon(leftIcon, resolvedLevel),
|
|
759
|
-
/* @__PURE__ */
|
|
783
|
+
/* @__PURE__ */ jsx6(
|
|
760
784
|
Typography,
|
|
761
785
|
{
|
|
762
786
|
level: typographyLevel,
|
|
@@ -775,7 +799,7 @@ var Badge = forwardRef4(
|
|
|
775
799
|
Badge.displayName = "Badge";
|
|
776
800
|
|
|
777
801
|
// src/components/input.tsx
|
|
778
|
-
import { jsx as
|
|
802
|
+
import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
779
803
|
function resolveInputState(value, defaultValue, focused) {
|
|
780
804
|
const current = value ?? defaultValue ?? "";
|
|
781
805
|
if (String(current).length === 0) return "empty";
|
|
@@ -792,25 +816,9 @@ var inputRootVariants = cva5("aviala-input relative min-w-0 font-sans", {
|
|
|
792
816
|
fullWidth: true
|
|
793
817
|
}
|
|
794
818
|
});
|
|
795
|
-
function renderSlotIcon(node, debugId) {
|
|
796
|
-
if (!node) return null;
|
|
797
|
-
const content = cloneAvialaIconElement(node, {
|
|
798
|
-
level: "text",
|
|
799
|
-
biggerSize: true
|
|
800
|
-
});
|
|
801
|
-
return /* @__PURE__ */ jsx6(
|
|
802
|
-
"span",
|
|
803
|
-
{
|
|
804
|
-
className: "aviala-input__slot",
|
|
805
|
-
style: iconSlotCssVarStyle(node, "--input-slot-icon-size", "text", true),
|
|
806
|
-
...debugId ? spiralDebugId(debugId) : void 0,
|
|
807
|
-
children: content
|
|
808
|
-
}
|
|
809
|
-
);
|
|
810
|
-
}
|
|
811
819
|
function renderBadgeArea(node) {
|
|
812
820
|
if (node == null || node === false) return null;
|
|
813
|
-
return /* @__PURE__ */
|
|
821
|
+
return /* @__PURE__ */ jsx7("span", { className: "aviala-input__badge-area", children: isValidElement5(node) && node.type === Badge ? node : /* @__PURE__ */ jsx7(Badge, { children: node }) });
|
|
814
822
|
}
|
|
815
823
|
var Input = forwardRef5(
|
|
816
824
|
({
|
|
@@ -847,14 +855,14 @@ var Input = forwardRef5(
|
|
|
847
855
|
"data-disabled": disabled ? "true" : void 0,
|
|
848
856
|
...spiralDebugId("input"),
|
|
849
857
|
children: [
|
|
850
|
-
renderSlotIcon(leftIcon, "input.left-icon"),
|
|
858
|
+
renderSlotIcon(leftIcon, "aviala-input__slot", "input.left-icon"),
|
|
851
859
|
renderBadgeArea(leftBadge),
|
|
852
|
-
/* @__PURE__ */
|
|
860
|
+
/* @__PURE__ */ jsx7(
|
|
853
861
|
"div",
|
|
854
862
|
{
|
|
855
863
|
className: "aviala-input__field relative z-[1] flex min-w-0 flex-1 flex-col justify-center",
|
|
856
864
|
...spiralDebugId("input.field"),
|
|
857
|
-
children: /* @__PURE__ */
|
|
865
|
+
children: /* @__PURE__ */ jsx7(
|
|
858
866
|
"input",
|
|
859
867
|
{
|
|
860
868
|
ref,
|
|
@@ -888,7 +896,7 @@ var Input = forwardRef5(
|
|
|
888
896
|
}
|
|
889
897
|
),
|
|
890
898
|
renderBadgeArea(rightBadge),
|
|
891
|
-
renderSlotIcon(rightIcon, "input.right-icon")
|
|
899
|
+
renderSlotIcon(rightIcon, "aviala-input__slot", "input.right-icon")
|
|
892
900
|
]
|
|
893
901
|
}
|
|
894
902
|
);
|
|
@@ -907,7 +915,7 @@ import {
|
|
|
907
915
|
useRef,
|
|
908
916
|
useState as useState3
|
|
909
917
|
} from "react";
|
|
910
|
-
import { jsx as
|
|
918
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
911
919
|
function assignRef(ref, value) {
|
|
912
920
|
if (!ref) return;
|
|
913
921
|
if (typeof ref === "function") {
|
|
@@ -949,25 +957,9 @@ function decimalPlaces(n) {
|
|
|
949
957
|
const i = text.indexOf(".");
|
|
950
958
|
return i === -1 ? 0 : text.length - i - 1;
|
|
951
959
|
}
|
|
952
|
-
function renderSlotIcon2(node, debugId) {
|
|
953
|
-
if (!node) return null;
|
|
954
|
-
const content = cloneAvialaIconElement(node, {
|
|
955
|
-
level: "text",
|
|
956
|
-
biggerSize: true
|
|
957
|
-
});
|
|
958
|
-
return /* @__PURE__ */ jsx7(
|
|
959
|
-
"span",
|
|
960
|
-
{
|
|
961
|
-
className: "aviala-input__slot",
|
|
962
|
-
style: iconSlotCssVarStyle(node, "--input-slot-icon-size", "text", true),
|
|
963
|
-
...debugId ? spiralDebugId(debugId) : void 0,
|
|
964
|
-
children: content
|
|
965
|
-
}
|
|
966
|
-
);
|
|
967
|
-
}
|
|
968
960
|
function renderBadgeArea2(node) {
|
|
969
961
|
if (node == null || node === false) return null;
|
|
970
|
-
return /* @__PURE__ */
|
|
962
|
+
return /* @__PURE__ */ jsx8("span", { className: "aviala-input__badge-area", children: isValidElement6(node) && node.type === Badge ? node : /* @__PURE__ */ jsx8(Badge, { children: node }) });
|
|
971
963
|
}
|
|
972
964
|
var numberInputRootVariants = inputRootVariants;
|
|
973
965
|
var NumberInput = forwardRef6(
|
|
@@ -1036,14 +1028,14 @@ var NumberInput = forwardRef6(
|
|
|
1036
1028
|
"data-disabled": disabled ? "true" : void 0,
|
|
1037
1029
|
...spiralDebugId("number-input"),
|
|
1038
1030
|
children: [
|
|
1039
|
-
|
|
1031
|
+
renderSlotIcon(leftIcon, "aviala-input__slot", "number-input.left-icon"),
|
|
1040
1032
|
renderBadgeArea2(leftBadge),
|
|
1041
|
-
/* @__PURE__ */
|
|
1033
|
+
/* @__PURE__ */ jsx8(
|
|
1042
1034
|
"div",
|
|
1043
1035
|
{
|
|
1044
1036
|
className: "aviala-input__field relative z-[1] flex min-w-0 flex-1 flex-col justify-center",
|
|
1045
1037
|
...spiralDebugId("number-input.field"),
|
|
1046
|
-
children: /* @__PURE__ */
|
|
1038
|
+
children: /* @__PURE__ */ jsx8(
|
|
1047
1039
|
"input",
|
|
1048
1040
|
{
|
|
1049
1041
|
ref: (node) => {
|
|
@@ -1101,14 +1093,14 @@ var NumberInput = forwardRef6(
|
|
|
1101
1093
|
}
|
|
1102
1094
|
),
|
|
1103
1095
|
renderBadgeArea2(rightBadge),
|
|
1104
|
-
|
|
1096
|
+
renderSlotIcon(rightIcon, "aviala-input__slot", "number-input.right-icon"),
|
|
1105
1097
|
showControls ? /* @__PURE__ */ jsxs4(
|
|
1106
1098
|
"div",
|
|
1107
1099
|
{
|
|
1108
1100
|
className: "aviala-number-input__controls",
|
|
1109
1101
|
...spiralDebugId("number-input.controls"),
|
|
1110
1102
|
children: [
|
|
1111
|
-
/* @__PURE__ */
|
|
1103
|
+
/* @__PURE__ */ jsx8(
|
|
1112
1104
|
"button",
|
|
1113
1105
|
{
|
|
1114
1106
|
type: "button",
|
|
@@ -1119,10 +1111,10 @@ var NumberInput = forwardRef6(
|
|
|
1119
1111
|
onMouseDown: (event) => event.preventDefault(),
|
|
1120
1112
|
onClick: () => applyStep(1),
|
|
1121
1113
|
...spiralDebugId("number-input.step-up"),
|
|
1122
|
-
children: /* @__PURE__ */
|
|
1114
|
+
children: /* @__PURE__ */ jsx8(DirectionArrowUpLight, { level: "text", biggerSize: true, "aria-hidden": true })
|
|
1123
1115
|
}
|
|
1124
1116
|
),
|
|
1125
|
-
/* @__PURE__ */
|
|
1117
|
+
/* @__PURE__ */ jsx8(
|
|
1126
1118
|
"button",
|
|
1127
1119
|
{
|
|
1128
1120
|
type: "button",
|
|
@@ -1133,7 +1125,7 @@ var NumberInput = forwardRef6(
|
|
|
1133
1125
|
onMouseDown: (event) => event.preventDefault(),
|
|
1134
1126
|
onClick: () => applyStep(-1),
|
|
1135
1127
|
...spiralDebugId("number-input.step-down"),
|
|
1136
|
-
children: /* @__PURE__ */
|
|
1128
|
+
children: /* @__PURE__ */ jsx8(DirectionArrowDownLight, { level: "text", biggerSize: true, "aria-hidden": true })
|
|
1137
1129
|
}
|
|
1138
1130
|
)
|
|
1139
1131
|
]
|
|
@@ -1155,7 +1147,7 @@ import {
|
|
|
1155
1147
|
useRef as useRef2,
|
|
1156
1148
|
useState as useState4
|
|
1157
1149
|
} from "react";
|
|
1158
|
-
import { jsx as
|
|
1150
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1159
1151
|
function assignRef2(ref, value) {
|
|
1160
1152
|
if (!ref) return;
|
|
1161
1153
|
if (typeof ref === "function") {
|
|
@@ -1169,22 +1161,6 @@ function resolveTextareaState(value, defaultValue, focused) {
|
|
|
1169
1161
|
if (String(current).length === 0) return "empty";
|
|
1170
1162
|
return focused ? "typing" : "fill";
|
|
1171
1163
|
}
|
|
1172
|
-
function renderSlotIcon3(node, debugId) {
|
|
1173
|
-
if (!node) return null;
|
|
1174
|
-
const content = cloneAvialaIconElement(node, {
|
|
1175
|
-
level: "text",
|
|
1176
|
-
biggerSize: true
|
|
1177
|
-
});
|
|
1178
|
-
return /* @__PURE__ */ jsx8(
|
|
1179
|
-
"span",
|
|
1180
|
-
{
|
|
1181
|
-
className: "aviala-textarea__slot",
|
|
1182
|
-
style: iconSlotCssVarStyle(node, "--input-slot-icon-size", "text", true),
|
|
1183
|
-
...debugId ? spiralDebugId(debugId) : void 0,
|
|
1184
|
-
children: content
|
|
1185
|
-
}
|
|
1186
|
-
);
|
|
1187
|
-
}
|
|
1188
1164
|
var Textarea = forwardRef7(
|
|
1189
1165
|
({
|
|
1190
1166
|
className,
|
|
@@ -1296,8 +1272,8 @@ var Textarea = forwardRef7(
|
|
|
1296
1272
|
onMouseDown: handleShellMouseDown,
|
|
1297
1273
|
...spiralDebugId("textarea"),
|
|
1298
1274
|
children: [
|
|
1299
|
-
|
|
1300
|
-
/* @__PURE__ */
|
|
1275
|
+
renderSlotIcon(leftIcon, "aviala-textarea__slot", "textarea.left-icon"),
|
|
1276
|
+
/* @__PURE__ */ jsx9("div", { className: "aviala-textarea__field", ...spiralDebugId("textarea.field"), children: /* @__PURE__ */ jsx9(
|
|
1301
1277
|
"textarea",
|
|
1302
1278
|
{
|
|
1303
1279
|
ref: setTextareaRef,
|
|
@@ -1324,7 +1300,7 @@ var Textarea = forwardRef7(
|
|
|
1324
1300
|
...props
|
|
1325
1301
|
}
|
|
1326
1302
|
) }),
|
|
1327
|
-
|
|
1303
|
+
renderSlotIcon(rightIcon, "aviala-textarea__slot", "textarea.right-icon"),
|
|
1328
1304
|
showController ? /* @__PURE__ */ jsxs5("div", { className: "aviala-textarea__controller", ...spiralDebugId("textarea.controller"), children: [
|
|
1329
1305
|
/* @__PURE__ */ jsxs5(
|
|
1330
1306
|
"span",
|
|
@@ -1337,7 +1313,7 @@ var Textarea = forwardRef7(
|
|
|
1337
1313
|
]
|
|
1338
1314
|
}
|
|
1339
1315
|
),
|
|
1340
|
-
/* @__PURE__ */
|
|
1316
|
+
/* @__PURE__ */ jsx9(
|
|
1341
1317
|
"button",
|
|
1342
1318
|
{
|
|
1343
1319
|
type: "button",
|
|
@@ -1347,7 +1323,7 @@ var Textarea = forwardRef7(
|
|
|
1347
1323
|
tabIndex: disabled ? -1 : 0,
|
|
1348
1324
|
onPointerDown: handleResizePointerDown,
|
|
1349
1325
|
...spiralDebugId("textarea.resize"),
|
|
1350
|
-
children: /* @__PURE__ */
|
|
1326
|
+
children: /* @__PURE__ */ jsx9(SymbolResize, { thickness: "Regular", mode: "default", "aria-hidden": true })
|
|
1351
1327
|
}
|
|
1352
1328
|
)
|
|
1353
1329
|
] }) : null
|
|
@@ -1386,7 +1362,7 @@ import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
|
1386
1362
|
import {
|
|
1387
1363
|
forwardRef as forwardRef8
|
|
1388
1364
|
} from "react";
|
|
1389
|
-
import { jsx as
|
|
1365
|
+
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1390
1366
|
var levelStyles = {
|
|
1391
1367
|
caption: {
|
|
1392
1368
|
className: typographyVariants({ level: "caption" }),
|
|
@@ -1405,7 +1381,7 @@ function renderIcon2(node, level) {
|
|
|
1405
1381
|
level: iconLevel,
|
|
1406
1382
|
biggerSize: true
|
|
1407
1383
|
});
|
|
1408
|
-
return /* @__PURE__ */
|
|
1384
|
+
return /* @__PURE__ */ jsx10(
|
|
1409
1385
|
"span",
|
|
1410
1386
|
{
|
|
1411
1387
|
className: cn(
|
|
@@ -1446,7 +1422,7 @@ var Link = forwardRef8(
|
|
|
1446
1422
|
onClick?.(e);
|
|
1447
1423
|
};
|
|
1448
1424
|
if (asChild) {
|
|
1449
|
-
return /* @__PURE__ */
|
|
1425
|
+
return /* @__PURE__ */ jsx10(
|
|
1450
1426
|
Comp,
|
|
1451
1427
|
{
|
|
1452
1428
|
className: sharedClassName,
|
|
@@ -1476,7 +1452,7 @@ var Link = forwardRef8(
|
|
|
1476
1452
|
onClick: handleClick,
|
|
1477
1453
|
children: [
|
|
1478
1454
|
renderIcon2(leftIcon ?? (iconOnly ? rightIcon : void 0), resolvedLevel),
|
|
1479
|
-
!iconOnly && children !== void 0 && children !== null && /* @__PURE__ */
|
|
1455
|
+
!iconOnly && children !== void 0 && children !== null && /* @__PURE__ */ jsx10(
|
|
1480
1456
|
"span",
|
|
1481
1457
|
{
|
|
1482
1458
|
className: cn(
|
|
@@ -1495,7 +1471,7 @@ var Link = forwardRef8(
|
|
|
1495
1471
|
Link.displayName = "Link";
|
|
1496
1472
|
|
|
1497
1473
|
// src/components/select.tsx
|
|
1498
|
-
import { jsx as
|
|
1474
|
+
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1499
1475
|
var SELECT_SUB_MENU_CLOSE_DELAY_MS = 250;
|
|
1500
1476
|
var SELECT_SUB_MENU_EXIT_ANIM_MS = 150;
|
|
1501
1477
|
var SelectSubMenuContext = createContext2(null);
|
|
@@ -1729,29 +1705,13 @@ function parseSelectSubItemChildren(children) {
|
|
|
1729
1705
|
function isWithinSelectSubLayer(target) {
|
|
1730
1706
|
return target instanceof Element && target.closest(".aviala-select-sub-content") !== null;
|
|
1731
1707
|
}
|
|
1732
|
-
function renderSlotIcon4(node, debugId) {
|
|
1733
|
-
if (!node) return null;
|
|
1734
|
-
const content = cloneAvialaIconElement(node, {
|
|
1735
|
-
level: "text",
|
|
1736
|
-
biggerSize: true
|
|
1737
|
-
});
|
|
1738
|
-
return /* @__PURE__ */ jsx10(
|
|
1739
|
-
"span",
|
|
1740
|
-
{
|
|
1741
|
-
className: "aviala-select-trigger__slot",
|
|
1742
|
-
style: iconSlotCssVarStyle(node, "--input-slot-icon-size", "text", true),
|
|
1743
|
-
...debugId ? spiralDebugId(debugId) : void 0,
|
|
1744
|
-
children: content
|
|
1745
|
-
}
|
|
1746
|
-
);
|
|
1747
|
-
}
|
|
1748
1708
|
function renderItemIcon(node, iconLevel = "text", debugId) {
|
|
1749
1709
|
if (!node) return null;
|
|
1750
1710
|
const content = cloneAvialaIconElement(node, {
|
|
1751
1711
|
level: iconLevel,
|
|
1752
1712
|
biggerSize: true
|
|
1753
1713
|
});
|
|
1754
|
-
return /* @__PURE__ */
|
|
1714
|
+
return /* @__PURE__ */ jsx11(
|
|
1755
1715
|
"span",
|
|
1756
1716
|
{
|
|
1757
1717
|
className: cn(
|
|
@@ -1766,16 +1726,16 @@ function renderItemIcon(node, iconLevel = "text", debugId) {
|
|
|
1766
1726
|
}
|
|
1767
1727
|
function renderBadgeSlot(node) {
|
|
1768
1728
|
if (node == null || node === false) return null;
|
|
1769
|
-
return /* @__PURE__ */
|
|
1729
|
+
return /* @__PURE__ */ jsx11("span", { className: "aviala-select-item__badge", children: isValidElement7(node) && node.type === Badge ? node : /* @__PURE__ */ jsx11(Badge, { children: node }) });
|
|
1770
1730
|
}
|
|
1771
1731
|
function SelectItemFormRadio() {
|
|
1772
1732
|
return /* @__PURE__ */ jsxs7("span", { className: "aviala-select-item__form-radio", "aria-hidden": true, children: [
|
|
1773
|
-
/* @__PURE__ */
|
|
1774
|
-
/* @__PURE__ */
|
|
1733
|
+
/* @__PURE__ */ jsx11("span", { className: "aviala-select-item__form-radio-surface" }),
|
|
1734
|
+
/* @__PURE__ */ jsx11("span", { className: "aviala-select-item__form-radio-indicator" })
|
|
1775
1735
|
] });
|
|
1776
1736
|
}
|
|
1777
1737
|
function SelectItemFormCheckbox() {
|
|
1778
|
-
return /* @__PURE__ */
|
|
1738
|
+
return /* @__PURE__ */ jsx11("span", { className: "aviala-select-item__form-checkbox", "aria-hidden": true, children: /* @__PURE__ */ jsx11(
|
|
1779
1739
|
SymbolRight,
|
|
1780
1740
|
{
|
|
1781
1741
|
className: "aviala-select-item__form-checkbox-icon",
|
|
@@ -1786,20 +1746,20 @@ function SelectItemFormCheckbox() {
|
|
|
1786
1746
|
) });
|
|
1787
1747
|
}
|
|
1788
1748
|
function SelectItemTrailingRadio() {
|
|
1789
|
-
return /* @__PURE__ */
|
|
1749
|
+
return /* @__PURE__ */ jsx11(SelectPrimitive.ItemIndicator, { className: "aviala-select-item__trailing-radio", "aria-hidden": true, children: /* @__PURE__ */ jsx11(SymbolRight, { level: "text", biggerSize: true, "aria-hidden": true }) });
|
|
1790
1750
|
}
|
|
1791
1751
|
function SelectItemTrailingCheckbox() {
|
|
1792
|
-
return /* @__PURE__ */
|
|
1752
|
+
return /* @__PURE__ */ jsx11(SelectPrimitive.ItemIndicator, { className: "aviala-select-item__trailing-checkbox", "aria-hidden": true, children: /* @__PURE__ */ jsx11(SymbolRight, { level: "text", biggerSize: true, "aria-hidden": true }) });
|
|
1793
1753
|
}
|
|
1794
1754
|
function SelectItemDefaultAvatar() {
|
|
1795
|
-
return /* @__PURE__ */
|
|
1755
|
+
return /* @__PURE__ */ jsx11("span", { className: "aviala-select-item__avatar", "aria-hidden": true, children: /* @__PURE__ */ jsx11(UsersUserCircle, { level: "text", biggerSize: true, "aria-hidden": true }) });
|
|
1796
1756
|
}
|
|
1797
1757
|
function renderFunctionSlot(itemFunction, layout, showFunctionIcon, icon) {
|
|
1798
1758
|
if (!showFunctionIcon) return null;
|
|
1799
1759
|
if (layout === "checked") return null;
|
|
1800
1760
|
const functionStyle = icon ? iconSlotCssVarStyle(icon, "--select-item-function-icon-size", "text", true) : void 0;
|
|
1801
1761
|
if (icon !== void 0) {
|
|
1802
|
-
return /* @__PURE__ */
|
|
1762
|
+
return /* @__PURE__ */ jsx11(
|
|
1803
1763
|
"span",
|
|
1804
1764
|
{
|
|
1805
1765
|
className: "aviala-select-item__function",
|
|
@@ -1811,19 +1771,19 @@ function renderFunctionSlot(itemFunction, layout, showFunctionIcon, icon) {
|
|
|
1811
1771
|
}
|
|
1812
1772
|
switch (itemFunction) {
|
|
1813
1773
|
case "radio":
|
|
1814
|
-
return /* @__PURE__ */
|
|
1774
|
+
return /* @__PURE__ */ jsx11("span", { className: "aviala-select-item__function", ...spiralDebugId("select.content.item.function"), children: /* @__PURE__ */ jsx11(SelectItemTrailingRadio, {}) });
|
|
1815
1775
|
case "checkbox":
|
|
1816
|
-
return /* @__PURE__ */
|
|
1776
|
+
return /* @__PURE__ */ jsx11("span", { className: "aviala-select-item__function", ...spiralDebugId("select.content.item.function"), children: /* @__PURE__ */ jsx11(SelectItemTrailingCheckbox, {}) });
|
|
1817
1777
|
case "simple":
|
|
1818
1778
|
case "action":
|
|
1819
1779
|
default:
|
|
1820
|
-
return /* @__PURE__ */
|
|
1780
|
+
return /* @__PURE__ */ jsx11(
|
|
1821
1781
|
"span",
|
|
1822
1782
|
{
|
|
1823
1783
|
className: "aviala-select-item__function",
|
|
1824
1784
|
style: iconLevelCssVarStyle("text", true, "--select-item-function-icon-size"),
|
|
1825
1785
|
...spiralDebugId("select.content.item.function"),
|
|
1826
|
-
children: /* @__PURE__ */
|
|
1786
|
+
children: /* @__PURE__ */ jsx11(DirectionArrowRight, { level: "text", biggerSize: true, "aria-hidden": true })
|
|
1827
1787
|
}
|
|
1828
1788
|
);
|
|
1829
1789
|
}
|
|
@@ -1876,7 +1836,7 @@ function Select({
|
|
|
1876
1836
|
},
|
|
1877
1837
|
[isControlled, onOpenChange]
|
|
1878
1838
|
);
|
|
1879
|
-
return /* @__PURE__ */
|
|
1839
|
+
return /* @__PURE__ */ jsx11(SelectDismissContext.Provider, { value: dismissContextValue, children: /* @__PURE__ */ jsx11(SelectPrimitive.Root, { open, onOpenChange: handleOpenChange, ...props }) });
|
|
1880
1840
|
}
|
|
1881
1841
|
var SelectValue = SelectPrimitive.Value;
|
|
1882
1842
|
var SelectGroup = SelectPrimitive.Group;
|
|
@@ -1911,7 +1871,7 @@ function wrapUngroupedSelectItems(children) {
|
|
|
1911
1871
|
const flushBareItems = () => {
|
|
1912
1872
|
if (bareItems.length === 0) return;
|
|
1913
1873
|
wrapped.push(
|
|
1914
|
-
/* @__PURE__ */
|
|
1874
|
+
/* @__PURE__ */ jsx11(SelectGroup, { className: "aviala-select-group", children: /* @__PURE__ */ jsx11("div", { className: "aviala-select-group__slot", children: bareItems }) }, `__select-auto-group-${autoGroupIndex++}`)
|
|
1915
1875
|
);
|
|
1916
1876
|
bareItems = [];
|
|
1917
1877
|
};
|
|
@@ -1962,8 +1922,8 @@ var SelectTrigger = forwardRef9(
|
|
|
1962
1922
|
...spiralDebugId("select.trigger"),
|
|
1963
1923
|
...props,
|
|
1964
1924
|
children: [
|
|
1965
|
-
|
|
1966
|
-
/* @__PURE__ */
|
|
1925
|
+
renderSlotIcon(leftIcon, "aviala-select-trigger__slot", "select.trigger.icon-left"),
|
|
1926
|
+
/* @__PURE__ */ jsx11("span", { className: "aviala-select-trigger__field", children: /* @__PURE__ */ jsx11(
|
|
1967
1927
|
SelectPrimitive.Value,
|
|
1968
1928
|
{
|
|
1969
1929
|
placeholder,
|
|
@@ -1971,15 +1931,15 @@ var SelectTrigger = forwardRef9(
|
|
|
1971
1931
|
...spiralDebugId("select.trigger.value")
|
|
1972
1932
|
}
|
|
1973
1933
|
) }),
|
|
1974
|
-
|
|
1975
|
-
/* @__PURE__ */
|
|
1934
|
+
renderSlotIcon(rightIcon, "aviala-select-trigger__slot", "select.trigger.icon-right"),
|
|
1935
|
+
/* @__PURE__ */ jsx11(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx11(
|
|
1976
1936
|
"span",
|
|
1977
1937
|
{
|
|
1978
1938
|
className: "aviala-select-trigger__expand",
|
|
1979
1939
|
"aria-hidden": true,
|
|
1980
1940
|
style: expandIcon ? iconSlotCssVarStyle(expandIcon, "--input-slot-icon-size", "text", true) : iconLevelCssVarStyle("text", true, "--input-slot-icon-size"),
|
|
1981
1941
|
...spiralDebugId("select.trigger.expand"),
|
|
1982
|
-
children: expandIcon ?? /* @__PURE__ */
|
|
1942
|
+
children: expandIcon ?? /* @__PURE__ */ jsx11(
|
|
1983
1943
|
DirectionArrowDownLight2,
|
|
1984
1944
|
{
|
|
1985
1945
|
className: "aviala-select-trigger__expand-icon",
|
|
@@ -2022,7 +1982,7 @@ var SelectContent = forwardRef9(
|
|
|
2022
1982
|
dismissContext.pointerDownCloseRef.current = false;
|
|
2023
1983
|
}
|
|
2024
1984
|
};
|
|
2025
|
-
const content = /* @__PURE__ */
|
|
1985
|
+
const content = /* @__PURE__ */ jsx11(SelectSubMenuContext.Provider, { value: subMenuLayer, children: /* @__PURE__ */ jsx11(
|
|
2026
1986
|
SelectPrimitive.Content,
|
|
2027
1987
|
{
|
|
2028
1988
|
ref,
|
|
@@ -2032,7 +1992,7 @@ var SelectContent = forwardRef9(
|
|
|
2032
1992
|
onCloseAutoFocus: handleCloseAutoFocus,
|
|
2033
1993
|
...spiralDebugId("select.content"),
|
|
2034
1994
|
...props,
|
|
2035
|
-
children: /* @__PURE__ */
|
|
1995
|
+
children: /* @__PURE__ */ jsx11(
|
|
2036
1996
|
SelectPrimitive.Viewport,
|
|
2037
1997
|
{
|
|
2038
1998
|
className: "aviala-select-viewport",
|
|
@@ -2043,11 +2003,11 @@ var SelectContent = forwardRef9(
|
|
|
2043
2003
|
}
|
|
2044
2004
|
) });
|
|
2045
2005
|
if (!portalled) return content;
|
|
2046
|
-
return /* @__PURE__ */
|
|
2006
|
+
return /* @__PURE__ */ jsx11(SelectPrimitive.Portal, { children: content });
|
|
2047
2007
|
}
|
|
2048
2008
|
);
|
|
2049
2009
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
2050
|
-
var SelectLabel = forwardRef9(({ className, ...props }, ref) => /* @__PURE__ */
|
|
2010
|
+
var SelectLabel = forwardRef9(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
2051
2011
|
SelectPrimitive.Label,
|
|
2052
2012
|
{
|
|
2053
2013
|
ref,
|
|
@@ -2083,15 +2043,15 @@ var SelectItem = forwardRef9(
|
|
|
2083
2043
|
const showTrailingFunction = showFunctionIcon && layout !== "checked" && itemFunction !== "form-radio" && itemFunction !== "form-checkbox";
|
|
2084
2044
|
const textLevel = isTitle ? "caption" : "text";
|
|
2085
2045
|
const textContent = isPeople ? /* @__PURE__ */ jsxs7("span", { className: "aviala-select-item__content", children: [
|
|
2086
|
-
/* @__PURE__ */
|
|
2046
|
+
/* @__PURE__ */ jsx11(
|
|
2087
2047
|
SelectPrimitive.ItemText,
|
|
2088
2048
|
{
|
|
2089
2049
|
className: cn("aviala-select-item__text", typographyVariants({ level: textLevel })),
|
|
2090
2050
|
children
|
|
2091
2051
|
}
|
|
2092
2052
|
),
|
|
2093
|
-
subtitle != null && subtitle !== false ? /* @__PURE__ */
|
|
2094
|
-
] }) : /* @__PURE__ */
|
|
2053
|
+
subtitle != null && subtitle !== false ? /* @__PURE__ */ jsx11("span", { className: cn("aviala-select-item__subtitle", typographyVariants({ level: "caption" })), children: subtitle }) : null
|
|
2054
|
+
] }) : /* @__PURE__ */ jsx11(
|
|
2095
2055
|
SelectPrimitive.ItemText,
|
|
2096
2056
|
{
|
|
2097
2057
|
className: cn("aviala-select-item__text", typographyVariants({ level: textLevel })),
|
|
@@ -2108,14 +2068,14 @@ var SelectItem = forwardRef9(
|
|
|
2108
2068
|
...spiralDebugId("select.content.item"),
|
|
2109
2069
|
...props,
|
|
2110
2070
|
children: [
|
|
2111
|
-
isFormLeading && itemFunction === "form-radio" ? /* @__PURE__ */
|
|
2112
|
-
isFormLeading && itemFunction === "form-checkbox" ? /* @__PURE__ */
|
|
2071
|
+
isFormLeading && itemFunction === "form-radio" ? /* @__PURE__ */ jsx11(SelectItemFormRadio, {}) : null,
|
|
2072
|
+
isFormLeading && itemFunction === "form-checkbox" ? /* @__PURE__ */ jsx11(SelectItemFormCheckbox, {}) : null,
|
|
2113
2073
|
showLeftIcon && leftIcon ? renderItemIcon(leftIcon, leftIconLevel, "select.content.item.icon-left") : null,
|
|
2114
|
-
isPeople ? avatar ?? /* @__PURE__ */
|
|
2074
|
+
isPeople ? avatar ?? /* @__PURE__ */ jsx11(SelectItemDefaultAvatar, {}) : null,
|
|
2115
2075
|
textContent,
|
|
2116
2076
|
showBadge ? renderBadgeSlot(badge ?? "Text") : null,
|
|
2117
2077
|
showRightIcon && rightIcon ? renderItemIcon(rightIcon, leftIconLevel, "select.content.item.icon-right") : null,
|
|
2118
|
-
showMoreFunction ? /* @__PURE__ */
|
|
2078
|
+
showMoreFunction ? /* @__PURE__ */ jsx11("span", { className: "aviala-select-item__more", children: moreAction ?? /* @__PURE__ */ jsx11(Link, { level: "text", href: "#", onClick: (event) => event.preventDefault(), children: "Text" }) }) : null,
|
|
2119
2079
|
renderFunctionSlot(itemFunction, layout, showTrailingFunction, icon)
|
|
2120
2080
|
]
|
|
2121
2081
|
}
|
|
@@ -2192,9 +2152,9 @@ var SelectSubItem = forwardRef9(
|
|
|
2192
2152
|
const showTrailingFunction = showFunctionIcon && layout !== "checked" && itemFunction !== "form-radio" && itemFunction !== "form-checkbox";
|
|
2193
2153
|
const textLevel = isTitle ? "caption" : "text";
|
|
2194
2154
|
const textContent = isPeople ? /* @__PURE__ */ jsxs7("span", { className: "aviala-select-item__content", children: [
|
|
2195
|
-
/* @__PURE__ */
|
|
2196
|
-
subtitle != null && subtitle !== false ? /* @__PURE__ */
|
|
2197
|
-
] }) : /* @__PURE__ */
|
|
2155
|
+
/* @__PURE__ */ jsx11("span", { className: cn("aviala-select-item__text", typographyVariants({ level: textLevel })), children: itemChildren }),
|
|
2156
|
+
subtitle != null && subtitle !== false ? /* @__PURE__ */ jsx11("span", { className: cn("aviala-select-item__subtitle", typographyVariants({ level: "caption" })), children: subtitle }) : null
|
|
2157
|
+
] }) : /* @__PURE__ */ jsx11("span", { className: cn("aviala-select-item__text", typographyVariants({ level: textLevel })), children: itemChildren });
|
|
2198
2158
|
const handleTriggerBlur = (event) => {
|
|
2199
2159
|
scheduleCloseSubItem(subItemId, event.relatedTarget);
|
|
2200
2160
|
};
|
|
@@ -2230,19 +2190,19 @@ var SelectSubItem = forwardRef9(
|
|
|
2230
2190
|
onBlur: handleTriggerBlur,
|
|
2231
2191
|
onKeyDown: handleKeyDown,
|
|
2232
2192
|
children: [
|
|
2233
|
-
isFormLeading && itemFunction === "form-radio" ? /* @__PURE__ */
|
|
2234
|
-
isFormLeading && itemFunction === "form-checkbox" ? /* @__PURE__ */
|
|
2193
|
+
isFormLeading && itemFunction === "form-radio" ? /* @__PURE__ */ jsx11(SelectItemFormRadio, {}) : null,
|
|
2194
|
+
isFormLeading && itemFunction === "form-checkbox" ? /* @__PURE__ */ jsx11(SelectItemFormCheckbox, {}) : null,
|
|
2235
2195
|
showLeftIcon && leftIcon ? renderItemIcon(leftIcon, leftIconLevel) : null,
|
|
2236
|
-
isPeople ? avatar ?? /* @__PURE__ */
|
|
2196
|
+
isPeople ? avatar ?? /* @__PURE__ */ jsx11(SelectItemDefaultAvatar, {}) : null,
|
|
2237
2197
|
textContent,
|
|
2238
2198
|
showBadge ? renderBadgeSlot(badge ?? "Text") : null,
|
|
2239
2199
|
showRightIcon && rightIcon ? renderItemIcon(rightIcon, leftIconLevel) : null,
|
|
2240
|
-
showMoreFunction ? /* @__PURE__ */
|
|
2200
|
+
showMoreFunction ? /* @__PURE__ */ jsx11("span", { className: "aviala-select-item__more", children: moreAction ?? /* @__PURE__ */ jsx11(Link, { level: "text", href: "#", onClick: (event) => event.preventDefault(), children: "Text" }) }) : null,
|
|
2241
2201
|
renderFunctionSlot(itemFunction, layout, showTrailingFunction, icon)
|
|
2242
2202
|
]
|
|
2243
2203
|
}
|
|
2244
2204
|
);
|
|
2245
|
-
const flyout = /* @__PURE__ */
|
|
2205
|
+
const flyout = /* @__PURE__ */ jsx11(
|
|
2246
2206
|
PopoverPrimitive.Content,
|
|
2247
2207
|
{
|
|
2248
2208
|
ref: contentRef,
|
|
@@ -2260,10 +2220,10 @@ var SelectSubItem = forwardRef9(
|
|
|
2260
2220
|
onPointerEnter: handleOpen,
|
|
2261
2221
|
onPointerLeave: handlePointerLeave,
|
|
2262
2222
|
onPointerDownOutside: (event) => event.preventDefault(),
|
|
2263
|
-
children: /* @__PURE__ */
|
|
2223
|
+
children: /* @__PURE__ */ jsx11("div", { className: "aviala-select-viewport aviala-select-sub-content__viewport", children: wrapUngroupedSelectItems(subMenu.children) })
|
|
2264
2224
|
}
|
|
2265
2225
|
);
|
|
2266
|
-
return /* @__PURE__ */
|
|
2226
|
+
return /* @__PURE__ */ jsx11(PopoverPrimitive.Root, { open, modal: false, children: /* @__PURE__ */ jsxs7(
|
|
2267
2227
|
"div",
|
|
2268
2228
|
{
|
|
2269
2229
|
ref: (node) => {
|
|
@@ -2278,8 +2238,8 @@ var SelectSubItem = forwardRef9(
|
|
|
2278
2238
|
onPointerEnter: handleOpen,
|
|
2279
2239
|
onPointerLeave: handlePointerLeave,
|
|
2280
2240
|
children: [
|
|
2281
|
-
/* @__PURE__ */
|
|
2282
|
-
portalled ? /* @__PURE__ */
|
|
2241
|
+
/* @__PURE__ */ jsx11(PopoverPrimitive.Anchor, { asChild: true, children: itemRow }),
|
|
2242
|
+
portalled ? /* @__PURE__ */ jsx11(PopoverPrimitive.Portal, { children: flyout }) : flyout
|
|
2283
2243
|
]
|
|
2284
2244
|
}
|
|
2285
2245
|
) });
|
|
@@ -2287,12 +2247,12 @@ var SelectSubItem = forwardRef9(
|
|
|
2287
2247
|
);
|
|
2288
2248
|
SelectSubItem.displayName = "SelectSubItem";
|
|
2289
2249
|
var SelectSubItemPeople = forwardRef9(
|
|
2290
|
-
(props, ref) => /* @__PURE__ */
|
|
2250
|
+
(props, ref) => /* @__PURE__ */ jsx11(SelectSubItem, { ref, layout: "people", ...props })
|
|
2291
2251
|
);
|
|
2292
2252
|
SelectSubItemPeople.displayName = "SelectSubItemPeople";
|
|
2293
|
-
var SelectItemPeople = forwardRef9((props, ref) => /* @__PURE__ */
|
|
2253
|
+
var SelectItemPeople = forwardRef9((props, ref) => /* @__PURE__ */ jsx11(SelectItem, { ref, layout: "people", ...props }));
|
|
2294
2254
|
SelectItemPeople.displayName = "SelectItemPeople";
|
|
2295
|
-
var SelectSeparator = forwardRef9(({ className, ...props }, ref) => /* @__PURE__ */
|
|
2255
|
+
var SelectSeparator = forwardRef9(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
2296
2256
|
SelectPrimitive.Separator,
|
|
2297
2257
|
{
|
|
2298
2258
|
ref,
|
|
@@ -2308,17 +2268,17 @@ function SelectItemGroup({
|
|
|
2308
2268
|
className
|
|
2309
2269
|
}) {
|
|
2310
2270
|
return /* @__PURE__ */ jsxs7(SelectGroup, { className: cn("aviala-select-group", className), children: [
|
|
2311
|
-
label ? /* @__PURE__ */
|
|
2312
|
-
/* @__PURE__ */
|
|
2313
|
-
showDivider ? /* @__PURE__ */
|
|
2271
|
+
label ? /* @__PURE__ */ jsx11(SelectLabel, { children: label }) : null,
|
|
2272
|
+
/* @__PURE__ */ jsx11("div", { className: "aviala-select-group__slot", children }),
|
|
2273
|
+
showDivider ? /* @__PURE__ */ jsx11(SelectSeparator, {}) : null
|
|
2314
2274
|
] });
|
|
2315
2275
|
}
|
|
2316
2276
|
|
|
2317
2277
|
// src/components/label.tsx
|
|
2318
2278
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
2319
2279
|
import { forwardRef as forwardRef10 } from "react";
|
|
2320
|
-
import { jsx as
|
|
2321
|
-
var Label2 = forwardRef10(({ className, ...props }, ref) => /* @__PURE__ */
|
|
2280
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
2281
|
+
var Label2 = forwardRef10(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
2322
2282
|
LabelPrimitive.Root,
|
|
2323
2283
|
{
|
|
2324
2284
|
ref,
|
|
@@ -2339,7 +2299,7 @@ import {
|
|
|
2339
2299
|
forwardRef as forwardRef11,
|
|
2340
2300
|
isValidElement as isValidElement8
|
|
2341
2301
|
} from "react";
|
|
2342
|
-
import { jsx as
|
|
2302
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2343
2303
|
var avatarVariants = cva6("aviala-avatar", {
|
|
2344
2304
|
variants: {
|
|
2345
2305
|
level: {
|
|
@@ -2412,7 +2372,7 @@ var Avatar = forwardRef11(
|
|
|
2412
2372
|
}, ref) => {
|
|
2413
2373
|
const resolvedLevel = level ?? "text";
|
|
2414
2374
|
const resolvedContent = content ?? "text";
|
|
2415
|
-
return /* @__PURE__ */
|
|
2375
|
+
return /* @__PURE__ */ jsx13(
|
|
2416
2376
|
"span",
|
|
2417
2377
|
{
|
|
2418
2378
|
ref,
|
|
@@ -2429,7 +2389,7 @@ var Avatar = forwardRef11(
|
|
|
2429
2389
|
"data-line-height-fix": lineHeightFix ? "true" : "false",
|
|
2430
2390
|
...props,
|
|
2431
2391
|
children: /* @__PURE__ */ jsxs8("span", { className: "aviala-avatar__surface", children: [
|
|
2432
|
-
resolvedContent === "picture" && src ? /* @__PURE__ */
|
|
2392
|
+
resolvedContent === "picture" && src ? /* @__PURE__ */ jsx13(
|
|
2433
2393
|
"img",
|
|
2434
2394
|
{
|
|
2435
2395
|
className: "aviala-avatar__image",
|
|
@@ -2438,8 +2398,8 @@ var Avatar = forwardRef11(
|
|
|
2438
2398
|
...imgProps
|
|
2439
2399
|
}
|
|
2440
2400
|
) : null,
|
|
2441
|
-
resolvedContent === "icon" ? /* @__PURE__ */
|
|
2442
|
-
resolvedContent === "text" ? /* @__PURE__ */
|
|
2401
|
+
resolvedContent === "icon" ? /* @__PURE__ */ jsx13("span", { className: "aviala-avatar__icon", "aria-hidden": true, children: renderAvatarIcon(icon, resolvedLevel) }) : null,
|
|
2402
|
+
resolvedContent === "text" ? /* @__PURE__ */ jsx13(
|
|
2443
2403
|
Typography,
|
|
2444
2404
|
{
|
|
2445
2405
|
level: AVATAR_TEXT_LEVEL[resolvedLevel],
|
|
@@ -2463,7 +2423,7 @@ import {
|
|
|
2463
2423
|
forwardRef as forwardRef12,
|
|
2464
2424
|
isValidElement as isValidElement9
|
|
2465
2425
|
} from "react";
|
|
2466
|
-
import { jsx as
|
|
2426
|
+
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2467
2427
|
var tagVariants = cva7("aviala-tag", {
|
|
2468
2428
|
variants: {
|
|
2469
2429
|
level: {
|
|
@@ -2511,17 +2471,17 @@ function renderTagIcon(node, level) {
|
|
|
2511
2471
|
)
|
|
2512
2472
|
}
|
|
2513
2473
|
) : node;
|
|
2514
|
-
return /* @__PURE__ */
|
|
2474
|
+
return /* @__PURE__ */ jsx14("span", { className: "aviala-tag__icon", "aria-hidden": true, children: content });
|
|
2515
2475
|
}
|
|
2516
2476
|
var TagClose = forwardRef12(
|
|
2517
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
2477
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
2518
2478
|
"button",
|
|
2519
2479
|
{
|
|
2520
2480
|
ref,
|
|
2521
2481
|
type: "button",
|
|
2522
2482
|
className: cn("aviala-tag__close aviala-focus-ring", className),
|
|
2523
2483
|
...props,
|
|
2524
|
-
children: children ?? /* @__PURE__ */
|
|
2484
|
+
children: children ?? /* @__PURE__ */ jsx14(SymbolWrong, { "aria-hidden": true, width: 14, height: 14 })
|
|
2525
2485
|
}
|
|
2526
2486
|
)
|
|
2527
2487
|
);
|
|
@@ -2548,7 +2508,7 @@ var Tag = forwardRef12(
|
|
|
2548
2508
|
const resolvedContent = content ?? "text";
|
|
2549
2509
|
const resolvedLhf = resolveLineHeightFix2(resolvedLevel, lineHeightFix);
|
|
2550
2510
|
const typographyLevel = resolvedLevel;
|
|
2551
|
-
const peopleAvatar = avatar ?? (avatarSrc ? /* @__PURE__ */
|
|
2511
|
+
const peopleAvatar = avatar ?? (avatarSrc ? /* @__PURE__ */ jsx14(Avatar, { level: "text", content: "picture", src: avatarSrc, lineHeightFix: false }) : /* @__PURE__ */ jsx14(Avatar, { level: "text", content: "text", lineHeightFix: false, children: avatarText ?? (typeof children === "string" ? children.charAt(0) : "?") }));
|
|
2552
2512
|
return /* @__PURE__ */ jsxs9(
|
|
2553
2513
|
"span",
|
|
2554
2514
|
{
|
|
@@ -2568,8 +2528,8 @@ var Tag = forwardRef12(
|
|
|
2568
2528
|
"aria-disabled": disabled || void 0,
|
|
2569
2529
|
...props,
|
|
2570
2530
|
children: [
|
|
2571
|
-
resolvedContent === "people" ? /* @__PURE__ */
|
|
2572
|
-
/* @__PURE__ */
|
|
2531
|
+
resolvedContent === "people" ? /* @__PURE__ */ jsx14("span", { className: "aviala-tag__avatar", children: peopleAvatar }) : renderTagIcon(leftIcon, resolvedLevel),
|
|
2532
|
+
/* @__PURE__ */ jsx14(
|
|
2573
2533
|
Typography,
|
|
2574
2534
|
{
|
|
2575
2535
|
level: typographyLevel,
|
|
@@ -2579,7 +2539,7 @@ var Tag = forwardRef12(
|
|
|
2579
2539
|
}
|
|
2580
2540
|
),
|
|
2581
2541
|
resolvedContent === "text" ? renderTagIcon(rightIcon, resolvedLevel) : null,
|
|
2582
|
-
closable ? /* @__PURE__ */
|
|
2542
|
+
closable ? /* @__PURE__ */ jsx14(
|
|
2583
2543
|
TagClose,
|
|
2584
2544
|
{
|
|
2585
2545
|
"aria-label": closeLabel,
|
|
@@ -2600,7 +2560,7 @@ Tag.displayName = "Tag";
|
|
|
2600
2560
|
// src/components/progress.tsx
|
|
2601
2561
|
import { cva as cva8 } from "class-variance-authority";
|
|
2602
2562
|
import { forwardRef as forwardRef13 } from "react";
|
|
2603
|
-
import { Fragment as Fragment2, jsx as
|
|
2563
|
+
import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2604
2564
|
var progressVariants = cva8("aviala-progress", {
|
|
2605
2565
|
variants: {
|
|
2606
2566
|
type: {
|
|
@@ -2649,7 +2609,7 @@ var Progress = forwardRef13(
|
|
|
2649
2609
|
const normalizedRadius = radius - stroke;
|
|
2650
2610
|
const circumference = normalizedRadius * 2 * Math.PI;
|
|
2651
2611
|
const strokeDashoffset = circumference - percent / 100 * circumference;
|
|
2652
|
-
return /* @__PURE__ */
|
|
2612
|
+
return /* @__PURE__ */ jsx15(
|
|
2653
2613
|
"div",
|
|
2654
2614
|
{
|
|
2655
2615
|
ref,
|
|
@@ -2671,14 +2631,14 @@ var Progress = forwardRef13(
|
|
|
2671
2631
|
"data-shape": resolvedShape,
|
|
2672
2632
|
...props,
|
|
2673
2633
|
children: resolvedShape === "bar" ? /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
2674
|
-
/* @__PURE__ */
|
|
2634
|
+
/* @__PURE__ */ jsx15("div", { className: "aviala-progress__track", children: /* @__PURE__ */ jsx15(
|
|
2675
2635
|
"div",
|
|
2676
2636
|
{
|
|
2677
2637
|
className: "aviala-progress__fill",
|
|
2678
2638
|
style: { width: `${percent}%` }
|
|
2679
2639
|
}
|
|
2680
2640
|
) }),
|
|
2681
|
-
showLabel ? /* @__PURE__ */
|
|
2641
|
+
showLabel ? /* @__PURE__ */ jsx15(
|
|
2682
2642
|
Typography,
|
|
2683
2643
|
{
|
|
2684
2644
|
level: "caption",
|
|
@@ -2697,7 +2657,7 @@ var Progress = forwardRef13(
|
|
|
2697
2657
|
viewBox: `0 0 ${radius * 2} ${radius * 2}`,
|
|
2698
2658
|
"aria-hidden": true,
|
|
2699
2659
|
children: [
|
|
2700
|
-
/* @__PURE__ */
|
|
2660
|
+
/* @__PURE__ */ jsx15(
|
|
2701
2661
|
"circle",
|
|
2702
2662
|
{
|
|
2703
2663
|
className: "aviala-progress__ring-track",
|
|
@@ -2708,7 +2668,7 @@ var Progress = forwardRef13(
|
|
|
2708
2668
|
strokeWidth: stroke
|
|
2709
2669
|
}
|
|
2710
2670
|
),
|
|
2711
|
-
/* @__PURE__ */
|
|
2671
|
+
/* @__PURE__ */ jsx15(
|
|
2712
2672
|
"circle",
|
|
2713
2673
|
{
|
|
2714
2674
|
className: "aviala-progress__ring-fill",
|
|
@@ -2735,7 +2695,7 @@ Progress.displayName = "Progress";
|
|
|
2735
2695
|
// src/components/scroll.tsx
|
|
2736
2696
|
import { cva as cva9 } from "class-variance-authority";
|
|
2737
2697
|
import { forwardRef as forwardRef14 } from "react";
|
|
2738
|
-
import { jsx as
|
|
2698
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
2739
2699
|
var scrollVariants = cva9("aviala-scroll", {
|
|
2740
2700
|
variants: {
|
|
2741
2701
|
size: {
|
|
@@ -2759,7 +2719,7 @@ var Scroll = forwardRef14(
|
|
|
2759
2719
|
orientation = "vertical",
|
|
2760
2720
|
children,
|
|
2761
2721
|
...props
|
|
2762
|
-
}, ref) => /* @__PURE__ */
|
|
2722
|
+
}, ref) => /* @__PURE__ */ jsx16(
|
|
2763
2723
|
"div",
|
|
2764
2724
|
{
|
|
2765
2725
|
ref,
|
|
@@ -2787,7 +2747,7 @@ import {
|
|
|
2787
2747
|
|
|
2788
2748
|
// src/components/typeface.tsx
|
|
2789
2749
|
import { forwardRef as forwardRef15 } from "react";
|
|
2790
|
-
import { jsx as
|
|
2750
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
2791
2751
|
var typefaceLayouts = {
|
|
2792
2752
|
allCustom: [
|
|
2793
2753
|
{ level: "text", children: null },
|
|
@@ -2831,11 +2791,11 @@ var Typeface = forwardRef15(
|
|
|
2831
2791
|
}, ref) => {
|
|
2832
2792
|
const layout = typefaceLayouts[content];
|
|
2833
2793
|
const values = resolveTypefaceValues(content, primary, secondary, tertiary, children);
|
|
2834
|
-
return /* @__PURE__ */
|
|
2794
|
+
return /* @__PURE__ */ jsx17("div", { ref, className: cn("aviala-typeface", className), "data-content": content, ...props, children: layout.map((line, index) => {
|
|
2835
2795
|
const value = values[index];
|
|
2836
2796
|
if (value === void 0 || value === null || value === false) return null;
|
|
2837
2797
|
const lineContent = index === 0 ? primaryContent : index === 1 ? secondaryContent : tertiaryContent;
|
|
2838
|
-
return /* @__PURE__ */
|
|
2798
|
+
return /* @__PURE__ */ jsx17("span", { className: "aviala-typeface__line", children: /* @__PURE__ */ jsx17(Typography, { level: line.level, content: lineContent, tone, children: value }) }, `${line.level}-${index}`);
|
|
2839
2799
|
}) });
|
|
2840
2800
|
}
|
|
2841
2801
|
);
|
|
@@ -2853,7 +2813,7 @@ function resolveTypefaceValues(content, primary, secondary, tertiary, children)
|
|
|
2853
2813
|
return [children];
|
|
2854
2814
|
}
|
|
2855
2815
|
var TypefacePair = forwardRef15(
|
|
2856
|
-
({ title, description, ...props }, ref) => /* @__PURE__ */
|
|
2816
|
+
({ title, description, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
2857
2817
|
Typeface,
|
|
2858
2818
|
{
|
|
2859
2819
|
ref,
|
|
@@ -2867,7 +2827,7 @@ var TypefacePair = forwardRef15(
|
|
|
2867
2827
|
TypefacePair.displayName = "TypefacePair";
|
|
2868
2828
|
|
|
2869
2829
|
// src/components/checkbox.tsx
|
|
2870
|
-
import { jsx as
|
|
2830
|
+
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2871
2831
|
var Checkbox = forwardRef16(({ className, round = false, ...props }, ref) => /* @__PURE__ */ jsxs11(
|
|
2872
2832
|
CheckboxPrimitive.Root,
|
|
2873
2833
|
{
|
|
@@ -2876,9 +2836,9 @@ var Checkbox = forwardRef16(({ className, round = false, ...props }, ref) => /*
|
|
|
2876
2836
|
"data-round": round ? "true" : void 0,
|
|
2877
2837
|
...props,
|
|
2878
2838
|
children: [
|
|
2879
|
-
/* @__PURE__ */
|
|
2839
|
+
/* @__PURE__ */ jsx18("span", { "aria-hidden": true, className: "aviala-checkbox__surface" }),
|
|
2880
2840
|
/* @__PURE__ */ jsxs11(CheckboxPrimitive.Indicator, { className: "aviala-checkbox__indicator", children: [
|
|
2881
|
-
/* @__PURE__ */
|
|
2841
|
+
/* @__PURE__ */ jsx18(
|
|
2882
2842
|
SymbolRight2,
|
|
2883
2843
|
{
|
|
2884
2844
|
className: "aviala-checkbox__indicator-icon aviala-checkbox__indicator-icon--check",
|
|
@@ -2888,7 +2848,7 @@ var Checkbox = forwardRef16(({ className, round = false, ...props }, ref) => /*
|
|
|
2888
2848
|
"aria-hidden": true
|
|
2889
2849
|
}
|
|
2890
2850
|
),
|
|
2891
|
-
/* @__PURE__ */
|
|
2851
|
+
/* @__PURE__ */ jsx18(
|
|
2892
2852
|
"span",
|
|
2893
2853
|
{
|
|
2894
2854
|
"aria-hidden": true,
|
|
@@ -2901,7 +2861,7 @@ var Checkbox = forwardRef16(({ className, round = false, ...props }, ref) => /*
|
|
|
2901
2861
|
));
|
|
2902
2862
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
2903
2863
|
var CheckboxGroup = forwardRef16(
|
|
2904
|
-
({ className, direction = "vertical", ...props }, ref) => /* @__PURE__ */
|
|
2864
|
+
({ className, direction = "vertical", ...props }, ref) => /* @__PURE__ */ jsx18(
|
|
2905
2865
|
"div",
|
|
2906
2866
|
{
|
|
2907
2867
|
ref,
|
|
@@ -2923,7 +2883,7 @@ function renderIcon3(node) {
|
|
|
2923
2883
|
"shrink-0"
|
|
2924
2884
|
)
|
|
2925
2885
|
}) : node;
|
|
2926
|
-
return /* @__PURE__ */
|
|
2886
|
+
return /* @__PURE__ */ jsx18("span", { className: "aviala-checkbox-input__icon", children: content });
|
|
2927
2887
|
}
|
|
2928
2888
|
var CheckboxInput = forwardRef16(
|
|
2929
2889
|
({
|
|
@@ -2941,9 +2901,9 @@ var CheckboxInput = forwardRef16(
|
|
|
2941
2901
|
className: cn("aviala-checkbox-input", className),
|
|
2942
2902
|
"data-disabled": disabled ? "true" : void 0,
|
|
2943
2903
|
children: [
|
|
2944
|
-
/* @__PURE__ */
|
|
2904
|
+
/* @__PURE__ */ jsx18(Checkbox, { ref, id, disabled, ...props }),
|
|
2945
2905
|
renderIcon3(icon),
|
|
2946
|
-
/* @__PURE__ */
|
|
2906
|
+
/* @__PURE__ */ jsx18(
|
|
2947
2907
|
TypefacePair,
|
|
2948
2908
|
{
|
|
2949
2909
|
className: "aviala-checkbox-input__content min-w-0 flex-1",
|
|
@@ -2964,8 +2924,8 @@ import {
|
|
|
2964
2924
|
forwardRef as forwardRef17,
|
|
2965
2925
|
isValidElement as isValidElement11
|
|
2966
2926
|
} from "react";
|
|
2967
|
-
import { jsx as
|
|
2968
|
-
var RadioGroup = forwardRef17(({ className, direction = "vertical", ...props }, ref) => /* @__PURE__ */
|
|
2927
|
+
import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2928
|
+
var RadioGroup = forwardRef17(({ className, direction = "vertical", ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
2969
2929
|
RadioGroupPrimitive.Root,
|
|
2970
2930
|
{
|
|
2971
2931
|
className: cn("aviala-radio-group", className),
|
|
@@ -2982,8 +2942,8 @@ var RadioGroupItem = forwardRef17(({ className, ...props }, ref) => /* @__PURE__
|
|
|
2982
2942
|
className: cn("aviala-radio aviala-focus-ring", className),
|
|
2983
2943
|
...props,
|
|
2984
2944
|
children: [
|
|
2985
|
-
/* @__PURE__ */
|
|
2986
|
-
/* @__PURE__ */
|
|
2945
|
+
/* @__PURE__ */ jsx19("span", { "aria-hidden": true, className: "aviala-radio__surface" }),
|
|
2946
|
+
/* @__PURE__ */ jsx19("span", { "aria-hidden": true, className: "aviala-radio__indicator" })
|
|
2987
2947
|
]
|
|
2988
2948
|
}
|
|
2989
2949
|
));
|
|
@@ -2999,7 +2959,7 @@ function renderIcon4(node) {
|
|
|
2999
2959
|
"shrink-0"
|
|
3000
2960
|
)
|
|
3001
2961
|
}) : node;
|
|
3002
|
-
return /* @__PURE__ */
|
|
2962
|
+
return /* @__PURE__ */ jsx19("span", { className: "aviala-radio-input__icon", children: content });
|
|
3003
2963
|
}
|
|
3004
2964
|
var RadioInput = forwardRef17(
|
|
3005
2965
|
({
|
|
@@ -3019,9 +2979,9 @@ var RadioInput = forwardRef17(
|
|
|
3019
2979
|
"data-style": variant,
|
|
3020
2980
|
"data-disabled": disabled ? "true" : void 0,
|
|
3021
2981
|
children: [
|
|
3022
|
-
/* @__PURE__ */
|
|
2982
|
+
/* @__PURE__ */ jsx19(RadioGroupItem, { ref, id, disabled, ...props }),
|
|
3023
2983
|
renderIcon4(icon),
|
|
3024
|
-
/* @__PURE__ */
|
|
2984
|
+
/* @__PURE__ */ jsx19(
|
|
3025
2985
|
TypefacePair,
|
|
3026
2986
|
{
|
|
3027
2987
|
className: "aviala-radio-input__content min-w-0 flex-1",
|
|
@@ -3038,7 +2998,7 @@ RadioInput.displayName = "RadioInput";
|
|
|
3038
2998
|
// src/components/switch.tsx
|
|
3039
2999
|
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
3040
3000
|
import { forwardRef as forwardRef18 } from "react";
|
|
3041
|
-
import { jsx as
|
|
3001
|
+
import { jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3042
3002
|
var Switch = forwardRef18(({ className, size = "regular", ...props }, ref) => /* @__PURE__ */ jsxs13(
|
|
3043
3003
|
SwitchPrimitive.Root,
|
|
3044
3004
|
{
|
|
@@ -3050,8 +3010,8 @@ var Switch = forwardRef18(({ className, size = "regular", ...props }, ref) => /*
|
|
|
3050
3010
|
ref,
|
|
3051
3011
|
...props,
|
|
3052
3012
|
children: [
|
|
3053
|
-
/* @__PURE__ */
|
|
3054
|
-
/* @__PURE__ */
|
|
3013
|
+
/* @__PURE__ */ jsx20("span", { "aria-hidden": true, className: "aviala-switch__surface" }),
|
|
3014
|
+
/* @__PURE__ */ jsx20(SwitchPrimitive.Thumb, { className: "aviala-switch__thumb" })
|
|
3055
3015
|
]
|
|
3056
3016
|
}
|
|
3057
3017
|
));
|
|
@@ -3062,9 +3022,9 @@ import { Slot as Slot4 } from "@radix-ui/react-slot";
|
|
|
3062
3022
|
import {
|
|
3063
3023
|
forwardRef as forwardRef19
|
|
3064
3024
|
} from "react";
|
|
3065
|
-
import { jsx as
|
|
3025
|
+
import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3066
3026
|
var Anchor2 = forwardRef19(
|
|
3067
|
-
({ className, as: Tag2 = "nav", ...props }, ref) => /* @__PURE__ */
|
|
3027
|
+
({ className, as: Tag2 = "nav", ...props }, ref) => /* @__PURE__ */ jsx21(Tag2, { ref, className: cn("aviala-anchor", className), ...props })
|
|
3068
3028
|
);
|
|
3069
3029
|
Anchor2.displayName = "Anchor";
|
|
3070
3030
|
var AnchorItem = forwardRef19(
|
|
@@ -3086,8 +3046,8 @@ var AnchorItem = forwardRef19(
|
|
|
3086
3046
|
"data-indent": String(indentLevel),
|
|
3087
3047
|
...props,
|
|
3088
3048
|
children: [
|
|
3089
|
-
/* @__PURE__ */
|
|
3090
|
-
/* @__PURE__ */
|
|
3049
|
+
/* @__PURE__ */ jsx21("span", { className: "aviala-anchor-item__rail", "aria-hidden": true }),
|
|
3050
|
+
/* @__PURE__ */ jsx21("span", { className: "aviala-anchor-item__content", children: /* @__PURE__ */ jsx21(Typography, { level: "text", as: "span", className: "aviala-anchor-item__label", children }) })
|
|
3091
3051
|
]
|
|
3092
3052
|
}
|
|
3093
3053
|
);
|
|
@@ -3103,10 +3063,11 @@ import {
|
|
|
3103
3063
|
useContext as useContext3,
|
|
3104
3064
|
useEffect as useEffect3,
|
|
3105
3065
|
useLayoutEffect as useLayoutEffect2,
|
|
3066
|
+
useMemo as useMemo3,
|
|
3106
3067
|
useRef as useRef4,
|
|
3107
3068
|
useState as useState6
|
|
3108
3069
|
} from "react";
|
|
3109
|
-
import { jsx as
|
|
3070
|
+
import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3110
3071
|
var SegmentatorContext = createContext3(null);
|
|
3111
3072
|
function useSegmentatorContext() {
|
|
3112
3073
|
const ctx = useContext3(SegmentatorContext);
|
|
@@ -3121,7 +3082,7 @@ function renderIcon5(node, dimmed) {
|
|
|
3121
3082
|
level: "text",
|
|
3122
3083
|
biggerSize: true
|
|
3123
3084
|
});
|
|
3124
|
-
return /* @__PURE__ */
|
|
3085
|
+
return /* @__PURE__ */ jsx22(
|
|
3125
3086
|
"span",
|
|
3126
3087
|
{
|
|
3127
3088
|
className: cn(
|
|
@@ -3136,10 +3097,13 @@ function useSegmentatorState(value, defaultValue, onValueChange) {
|
|
|
3136
3097
|
const [internal, setInternal] = useState6(defaultValue ?? "");
|
|
3137
3098
|
const isControlled = value !== void 0;
|
|
3138
3099
|
const current = isControlled ? value : internal;
|
|
3139
|
-
const setValue = (
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3100
|
+
const setValue = useCallback4(
|
|
3101
|
+
(next) => {
|
|
3102
|
+
if (!isControlled) setInternal(next);
|
|
3103
|
+
onValueChange?.(next);
|
|
3104
|
+
},
|
|
3105
|
+
[isControlled, onValueChange]
|
|
3106
|
+
);
|
|
3143
3107
|
return [current, setValue];
|
|
3144
3108
|
}
|
|
3145
3109
|
var SEGMENTATOR_DRAG_THRESHOLD_PX = 4;
|
|
@@ -3184,6 +3148,16 @@ function getEnabledSegmentatorItems(group) {
|
|
|
3184
3148
|
group.querySelectorAll(".aviala-segmentator-item:not(:disabled)")
|
|
3185
3149
|
);
|
|
3186
3150
|
}
|
|
3151
|
+
function applyDragPreview(group, activeItem) {
|
|
3152
|
+
const items = getEnabledSegmentatorItems(group);
|
|
3153
|
+
for (const item of items) {
|
|
3154
|
+
if (item === activeItem) {
|
|
3155
|
+
item.setAttribute("data-drag-preview", "true");
|
|
3156
|
+
} else {
|
|
3157
|
+
item.removeAttribute("data-drag-preview");
|
|
3158
|
+
}
|
|
3159
|
+
}
|
|
3160
|
+
}
|
|
3187
3161
|
function measureItemThumbMetrics(item, group) {
|
|
3188
3162
|
const groupRect = group.getBoundingClientRect();
|
|
3189
3163
|
const itemRect = item.getBoundingClientRect();
|
|
@@ -3405,7 +3379,6 @@ var SegmentatorGroup = forwardRef20(
|
|
|
3405
3379
|
const layoutKey = useThemeLayoutKey();
|
|
3406
3380
|
const consumeClickRef = useRef4(false);
|
|
3407
3381
|
const pointerDragRef = useRef4(null);
|
|
3408
|
-
const [dragPreviewValue, setDragPreviewValue] = useState6(null);
|
|
3409
3382
|
const [dragState, setDragState] = useState6({
|
|
3410
3383
|
pressing: false,
|
|
3411
3384
|
active: false
|
|
@@ -3414,9 +3387,12 @@ var SegmentatorGroup = forwardRef20(
|
|
|
3414
3387
|
const resetPointerInteraction = useCallback4(() => {
|
|
3415
3388
|
pointerDragRef.current?.cleanupWindowListeners?.();
|
|
3416
3389
|
pointerDragRef.current = null;
|
|
3417
|
-
setDragPreviewValue(null);
|
|
3418
3390
|
setDragState({ pressing: false, active: false });
|
|
3419
|
-
const
|
|
3391
|
+
const group = groupRef.current;
|
|
3392
|
+
if (group) {
|
|
3393
|
+
applyDragPreview(group, null);
|
|
3394
|
+
}
|
|
3395
|
+
const thumbEl = group?.querySelector(
|
|
3420
3396
|
".aviala-segmentator-thumb"
|
|
3421
3397
|
);
|
|
3422
3398
|
if (thumbEl) {
|
|
@@ -3473,8 +3449,8 @@ var SegmentatorGroup = forwardRef20(
|
|
|
3473
3449
|
if (itemChanged) {
|
|
3474
3450
|
triggerSegmentatorHaptic("select");
|
|
3475
3451
|
drag.snapUntil = performance.now() + 540;
|
|
3476
|
-
if (
|
|
3477
|
-
|
|
3452
|
+
if (item) {
|
|
3453
|
+
applyDragPreview(group, item);
|
|
3478
3454
|
}
|
|
3479
3455
|
}
|
|
3480
3456
|
drag.previewValue = nextPreviewValue;
|
|
@@ -3550,24 +3526,25 @@ var SegmentatorGroup = forwardRef20(
|
|
|
3550
3526
|
event.pointerId
|
|
3551
3527
|
);
|
|
3552
3528
|
writeThumbMetrics(metrics, false);
|
|
3553
|
-
|
|
3529
|
+
applyDragPreview(group, pressedItem);
|
|
3554
3530
|
setDragState({ pressing: true, active: false });
|
|
3555
3531
|
group.setPointerCapture(event.pointerId);
|
|
3556
3532
|
};
|
|
3557
3533
|
const thumbStyle = thumb ? buildThumbStyle() : void 0;
|
|
3558
|
-
return /* @__PURE__ */
|
|
3534
|
+
return /* @__PURE__ */ jsx22(
|
|
3559
3535
|
SegmentatorContext.Provider,
|
|
3560
3536
|
{
|
|
3561
|
-
value:
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3537
|
+
value: useMemo3(
|
|
3538
|
+
() => ({
|
|
3539
|
+
value: currentValue,
|
|
3540
|
+
onValueChange: setValue,
|
|
3541
|
+
mode,
|
|
3542
|
+
allRound,
|
|
3543
|
+
disabled,
|
|
3544
|
+
consumeClickRef
|
|
3545
|
+
}),
|
|
3546
|
+
[currentValue, setValue, mode, allRound, disabled]
|
|
3547
|
+
),
|
|
3571
3548
|
children: /* @__PURE__ */ jsxs15(
|
|
3572
3549
|
"div",
|
|
3573
3550
|
{
|
|
@@ -3590,7 +3567,7 @@ var SegmentatorGroup = forwardRef20(
|
|
|
3590
3567
|
onLostPointerCapture: finishPointerDrag,
|
|
3591
3568
|
children: [
|
|
3592
3569
|
children,
|
|
3593
|
-
thumb && /* @__PURE__ */
|
|
3570
|
+
thumb && /* @__PURE__ */ jsx22(
|
|
3594
3571
|
"span",
|
|
3595
3572
|
{
|
|
3596
3573
|
ref: onThumbRef,
|
|
@@ -3628,7 +3605,7 @@ var SegmentatorItem = forwardRef20(
|
|
|
3628
3605
|
const isDisabled = disabled || ctx.disabled;
|
|
3629
3606
|
const dimmed = isDisabled;
|
|
3630
3607
|
const icon = iconOnly ? leftIcon ?? rightIcon : leftIcon;
|
|
3631
|
-
return /* @__PURE__ */
|
|
3608
|
+
return /* @__PURE__ */ jsx22(
|
|
3632
3609
|
"button",
|
|
3633
3610
|
{
|
|
3634
3611
|
ref,
|
|
@@ -3638,7 +3615,6 @@ var SegmentatorItem = forwardRef20(
|
|
|
3638
3615
|
"data-selected": selected ? "true" : "false",
|
|
3639
3616
|
"data-value": value,
|
|
3640
3617
|
"data-mode": ctx.mode,
|
|
3641
|
-
"data-drag-preview": ctx.isPressing && ctx.dragPreviewValue === value ? "true" : void 0,
|
|
3642
3618
|
"data-all-round": ctx.allRound ? "true" : "false",
|
|
3643
3619
|
disabled: isDisabled,
|
|
3644
3620
|
className: cn("aviala-segmentator-item aviala-focus-ring", iconOnly && "min-w-0", className),
|
|
@@ -3653,7 +3629,7 @@ var SegmentatorItem = forwardRef20(
|
|
|
3653
3629
|
...props,
|
|
3654
3630
|
children: /* @__PURE__ */ jsxs15("span", { className: "aviala-segmentator-item__content", children: [
|
|
3655
3631
|
renderIcon5(icon, dimmed && !!icon),
|
|
3656
|
-
!iconOnly && /* @__PURE__ */
|
|
3632
|
+
!iconOnly && /* @__PURE__ */ jsx22(
|
|
3657
3633
|
"span",
|
|
3658
3634
|
{
|
|
3659
3635
|
className: cn(
|
|
@@ -3675,7 +3651,7 @@ SegmentatorItem.displayName = "SegmentatorItem";
|
|
|
3675
3651
|
// src/components/form-field.tsx
|
|
3676
3652
|
import { SymbolInformationCircle, SymbolWrongCircle } from "@aviala-design/icons";
|
|
3677
3653
|
import { forwardRef as forwardRef21, useId as useId2 } from "react";
|
|
3678
|
-
import { Fragment as Fragment3, jsx as
|
|
3654
|
+
import { Fragment as Fragment3, jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3679
3655
|
var FormField = forwardRef21(
|
|
3680
3656
|
({
|
|
3681
3657
|
className,
|
|
@@ -3693,18 +3669,18 @@ var FormField = forwardRef21(
|
|
|
3693
3669
|
const reactId = useId2();
|
|
3694
3670
|
const labelId = `${reactId}-label`;
|
|
3695
3671
|
const hasLabel = label != null && label !== "";
|
|
3696
|
-
const labelNode = hasLabel || description ? htmlFor ? /* @__PURE__ */
|
|
3672
|
+
const labelNode = hasLabel || description ? htmlFor ? /* @__PURE__ */ jsx23("label", { htmlFor, className: "aviala-form__label aviala-form__label--control", children: /* @__PURE__ */ jsx23(
|
|
3697
3673
|
Typeface,
|
|
3698
3674
|
{
|
|
3699
3675
|
id: labelId,
|
|
3700
3676
|
content: "textCaption",
|
|
3701
3677
|
primary: hasLabel ? /* @__PURE__ */ jsxs16(Fragment3, { children: [
|
|
3702
3678
|
label,
|
|
3703
|
-
required ? /* @__PURE__ */
|
|
3679
|
+
required ? /* @__PURE__ */ jsx23("span", { className: "aviala-form__required", "aria-hidden": true, children: "*" }) : null
|
|
3704
3680
|
] }) : void 0,
|
|
3705
3681
|
secondary: description
|
|
3706
3682
|
}
|
|
3707
|
-
) }) : /* @__PURE__ */
|
|
3683
|
+
) }) : /* @__PURE__ */ jsx23(
|
|
3708
3684
|
Typeface,
|
|
3709
3685
|
{
|
|
3710
3686
|
id: labelId,
|
|
@@ -3712,7 +3688,7 @@ var FormField = forwardRef21(
|
|
|
3712
3688
|
content: "textCaption",
|
|
3713
3689
|
primary: hasLabel ? /* @__PURE__ */ jsxs16(Fragment3, { children: [
|
|
3714
3690
|
label,
|
|
3715
|
-
required ? /* @__PURE__ */
|
|
3691
|
+
required ? /* @__PURE__ */ jsx23("span", { className: "aviala-form__required", "aria-hidden": true, children: "*" }) : null
|
|
3716
3692
|
] }) : void 0,
|
|
3717
3693
|
secondary: description
|
|
3718
3694
|
}
|
|
@@ -3730,7 +3706,7 @@ var FormField = forwardRef21(
|
|
|
3730
3706
|
/* @__PURE__ */ jsxs16("div", { className: "aviala-form__content", children: [
|
|
3731
3707
|
children,
|
|
3732
3708
|
error ? /* @__PURE__ */ jsxs16("div", { className: "aviala-form__message aviala-form__message--error", role: "alert", children: [
|
|
3733
|
-
/* @__PURE__ */
|
|
3709
|
+
/* @__PURE__ */ jsx23(
|
|
3734
3710
|
SymbolWrongCircle,
|
|
3735
3711
|
{
|
|
3736
3712
|
className: "aviala-form__message-icon",
|
|
@@ -3739,10 +3715,10 @@ var FormField = forwardRef21(
|
|
|
3739
3715
|
"aria-hidden": true
|
|
3740
3716
|
}
|
|
3741
3717
|
),
|
|
3742
|
-
/* @__PURE__ */
|
|
3718
|
+
/* @__PURE__ */ jsx23(Typography, { level: "caption", as: "p", className: "aviala-form__message-text", children: error })
|
|
3743
3719
|
] }) : null,
|
|
3744
3720
|
info ? /* @__PURE__ */ jsxs16("div", { className: "aviala-form__message aviala-form__message--info", children: [
|
|
3745
|
-
/* @__PURE__ */
|
|
3721
|
+
/* @__PURE__ */ jsx23(
|
|
3746
3722
|
SymbolInformationCircle,
|
|
3747
3723
|
{
|
|
3748
3724
|
className: "aviala-form__message-icon",
|
|
@@ -3751,9 +3727,9 @@ var FormField = forwardRef21(
|
|
|
3751
3727
|
"aria-hidden": true
|
|
3752
3728
|
}
|
|
3753
3729
|
),
|
|
3754
|
-
/* @__PURE__ */
|
|
3730
|
+
/* @__PURE__ */ jsx23(Typography, { level: "caption", as: "p", className: "aviala-form__message-text", children: info })
|
|
3755
3731
|
] }) : null,
|
|
3756
|
-
alert ? /* @__PURE__ */
|
|
3732
|
+
alert ? /* @__PURE__ */ jsx23("div", { className: "aviala-form__alert", children: alert }) : null
|
|
3757
3733
|
] })
|
|
3758
3734
|
]
|
|
3759
3735
|
}
|
|
@@ -3764,9 +3740,9 @@ FormField.displayName = "FormField";
|
|
|
3764
3740
|
|
|
3765
3741
|
// src/components/input-group.tsx
|
|
3766
3742
|
import { forwardRef as forwardRef22 } from "react";
|
|
3767
|
-
import { jsx as
|
|
3743
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
3768
3744
|
var InputGroup = forwardRef22(
|
|
3769
|
-
({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */
|
|
3745
|
+
({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
3770
3746
|
"div",
|
|
3771
3747
|
{
|
|
3772
3748
|
ref,
|
|
@@ -3780,7 +3756,7 @@ var InputGroup = forwardRef22(
|
|
|
3780
3756
|
)
|
|
3781
3757
|
);
|
|
3782
3758
|
InputGroup.displayName = "InputGroup";
|
|
3783
|
-
var InputGroupAddon = forwardRef22(({ className, ...props }, ref) => /* @__PURE__ */
|
|
3759
|
+
var InputGroupAddon = forwardRef22(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
3784
3760
|
"div",
|
|
3785
3761
|
{
|
|
3786
3762
|
ref,
|
|
@@ -3796,7 +3772,7 @@ InputGroupAddon.displayName = "InputGroupAddon";
|
|
|
3796
3772
|
|
|
3797
3773
|
// src/components/stack.tsx
|
|
3798
3774
|
import { forwardRef as forwardRef23, useId as useId3 } from "react";
|
|
3799
|
-
import { jsx as
|
|
3775
|
+
import { jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3800
3776
|
var gapMap = {
|
|
3801
3777
|
inside: "var(--gap-inside, 4px)",
|
|
3802
3778
|
component: "var(--gap-component, 8px)",
|
|
@@ -3805,7 +3781,7 @@ var gapMap = {
|
|
|
3805
3781
|
page: "var(--gap-page-space, 24px)"
|
|
3806
3782
|
};
|
|
3807
3783
|
var Stack = forwardRef23(
|
|
3808
|
-
({ className, gap = "component", direction = "column", style, ...props }, ref) => /* @__PURE__ */
|
|
3784
|
+
({ className, gap = "component", direction = "column", style, ...props }, ref) => /* @__PURE__ */ jsx25(
|
|
3809
3785
|
"div",
|
|
3810
3786
|
{
|
|
3811
3787
|
ref,
|
|
@@ -3841,7 +3817,7 @@ var Fieldset = forwardRef23(
|
|
|
3841
3817
|
"aria-labelledby": hasHeading ? headingId : void 0,
|
|
3842
3818
|
...props,
|
|
3843
3819
|
children: [
|
|
3844
|
-
hasHeading || description ? /* @__PURE__ */
|
|
3820
|
+
hasHeading || description ? /* @__PURE__ */ jsx25(
|
|
3845
3821
|
Typeface,
|
|
3846
3822
|
{
|
|
3847
3823
|
id: headingId,
|
|
@@ -3851,11 +3827,11 @@ var Fieldset = forwardRef23(
|
|
|
3851
3827
|
secondary: description
|
|
3852
3828
|
}
|
|
3853
3829
|
) : null,
|
|
3854
|
-
/* @__PURE__ */
|
|
3830
|
+
/* @__PURE__ */ jsx25("div", { className: "aviala-form-group__slot", children }),
|
|
3855
3831
|
hasAction ? /* @__PURE__ */ jsxs17("div", { className: "aviala-form-group__action", children: [
|
|
3856
|
-
info ? /* @__PURE__ */
|
|
3857
|
-
feedback ? /* @__PURE__ */
|
|
3858
|
-
actions ? /* @__PURE__ */
|
|
3832
|
+
info ? /* @__PURE__ */ jsx25("div", { className: "aviala-form-group__info", children: info }) : null,
|
|
3833
|
+
feedback ? /* @__PURE__ */ jsx25("div", { className: "aviala-form-group__feedback", children: feedback }) : null,
|
|
3834
|
+
actions ? /* @__PURE__ */ jsx25("div", { className: "aviala-form-group__actions", children: actions }) : null
|
|
3859
3835
|
] }) : null
|
|
3860
3836
|
]
|
|
3861
3837
|
}
|
|
@@ -3987,7 +3963,7 @@ function usePointerDrag(ref, onMove, enabled = true) {
|
|
|
3987
3963
|
}
|
|
3988
3964
|
|
|
3989
3965
|
// src/components/color-picker/use-color-picker-state.ts
|
|
3990
|
-
import { useCallback as useCallback6, useMemo as
|
|
3966
|
+
import { useCallback as useCallback6, useMemo as useMemo4, useState as useState7 } from "react";
|
|
3991
3967
|
function useColorPickerState({
|
|
3992
3968
|
value: controlledValue,
|
|
3993
3969
|
defaultValue = DEFAULT_COLOR,
|
|
@@ -4010,7 +3986,7 @@ function useColorPickerState({
|
|
|
4010
3986
|
},
|
|
4011
3987
|
[controlledValue, onChange]
|
|
4012
3988
|
);
|
|
4013
|
-
const hsva =
|
|
3989
|
+
const hsva = useMemo4(() => toHsva(value), [value]);
|
|
4014
3990
|
const setHsva = useCallback6(
|
|
4015
3991
|
(partial, meta) => {
|
|
4016
3992
|
setValue(fromHsva({ ...hsva, ...partial }), meta);
|
|
@@ -4030,7 +4006,7 @@ function useColorPickerState({
|
|
|
4030
4006
|
}
|
|
4031
4007
|
|
|
4032
4008
|
// src/components/color-picker/color-picker-area.tsx
|
|
4033
|
-
import { jsx as
|
|
4009
|
+
import { jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4034
4010
|
function ColorPickerArea({
|
|
4035
4011
|
className,
|
|
4036
4012
|
disabled,
|
|
@@ -4062,7 +4038,7 @@ function ColorPickerArea({
|
|
|
4062
4038
|
);
|
|
4063
4039
|
const { handlePointerDown, handlePointerMove } = usePointerDrag(ref, handleMove, !isDisabled);
|
|
4064
4040
|
const hueColor = pureHueHex(hsva.h);
|
|
4065
|
-
return /* @__PURE__ */
|
|
4041
|
+
return /* @__PURE__ */ jsx26("div", { className: cn("aviala-color-picker-area", className), ...spiralDebugId("color-picker.content.area"), children: /* @__PURE__ */ jsxs18(
|
|
4066
4042
|
"div",
|
|
4067
4043
|
{
|
|
4068
4044
|
ref,
|
|
@@ -4077,9 +4053,9 @@ function ColorPickerArea({
|
|
|
4077
4053
|
"aria-valuenow": Math.round(hsva.s),
|
|
4078
4054
|
tabIndex: isDisabled ? -1 : 0,
|
|
4079
4055
|
children: [
|
|
4080
|
-
/* @__PURE__ */
|
|
4081
|
-
/* @__PURE__ */
|
|
4082
|
-
/* @__PURE__ */
|
|
4056
|
+
/* @__PURE__ */ jsx26("div", { className: "aviala-color-picker-area__white", "aria-hidden": true }),
|
|
4057
|
+
/* @__PURE__ */ jsx26("div", { className: "aviala-color-picker-area__black", "aria-hidden": true }),
|
|
4058
|
+
/* @__PURE__ */ jsx26(
|
|
4083
4059
|
"div",
|
|
4084
4060
|
{
|
|
4085
4061
|
className: "aviala-color-picker-area__thumb",
|
|
@@ -4098,7 +4074,7 @@ function ColorPickerArea({
|
|
|
4098
4074
|
// src/components/color-picker/color-picker-inputs.tsx
|
|
4099
4075
|
import { EditColorPicker } from "@aviala-design/icons";
|
|
4100
4076
|
import { useCallback as useCallback8, useEffect as useEffect4, useState as useState8 } from "react";
|
|
4101
|
-
import { jsx as
|
|
4077
|
+
import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4102
4078
|
function ColorPickerInputs({
|
|
4103
4079
|
className,
|
|
4104
4080
|
disabled,
|
|
@@ -4159,7 +4135,7 @@ function ColorPickerInputs({
|
|
|
4159
4135
|
}
|
|
4160
4136
|
}, [eyeDropperSupported, isDisabled, setValue]);
|
|
4161
4137
|
return /* @__PURE__ */ jsxs19("div", { className: cn("aviala-color-picker-inputs", className), ...spiralDebugId("color-picker.content.inputs"), children: [
|
|
4162
|
-
showEyedropper ? /* @__PURE__ */
|
|
4138
|
+
showEyedropper ? /* @__PURE__ */ jsx27(
|
|
4163
4139
|
Button,
|
|
4164
4140
|
{
|
|
4165
4141
|
type: "button",
|
|
@@ -4171,12 +4147,12 @@ function ColorPickerInputs({
|
|
|
4171
4147
|
...spiralDebugId("color-picker.content.inputs.eyedropper"),
|
|
4172
4148
|
title: eyeDropperSupported ? "Pick color from screen" : "EyeDropper not supported in this browser",
|
|
4173
4149
|
onClick: handleEyedropper,
|
|
4174
|
-
children: /* @__PURE__ */
|
|
4150
|
+
children: /* @__PURE__ */ jsx27(EditColorPicker, { "aria-hidden": true })
|
|
4175
4151
|
}
|
|
4176
4152
|
) : null,
|
|
4177
4153
|
format === "hex" ? /* @__PURE__ */ jsxs19("div", { className: "aviala-color-picker-field", children: [
|
|
4178
|
-
/* @__PURE__ */
|
|
4179
|
-
/* @__PURE__ */
|
|
4154
|
+
/* @__PURE__ */ jsx27("span", { className: "aviala-color-picker-field__badge-area", children: /* @__PURE__ */ jsx27(Badge, { style: "normal", children: "#" }) }),
|
|
4155
|
+
/* @__PURE__ */ jsx27(
|
|
4180
4156
|
"input",
|
|
4181
4157
|
{
|
|
4182
4158
|
className: cn("aviala-color-picker-field__input", typographyVariants({ level: "text" })),
|
|
@@ -4188,7 +4164,7 @@ function ColorPickerInputs({
|
|
|
4188
4164
|
onKeyDown: (e) => e.key === "Enter" && commitHex()
|
|
4189
4165
|
}
|
|
4190
4166
|
)
|
|
4191
|
-
] }) : /* @__PURE__ */
|
|
4167
|
+
] }) : /* @__PURE__ */ jsx27("div", { className: "aviala-color-picker-field", children: /* @__PURE__ */ jsx27(
|
|
4192
4168
|
"input",
|
|
4193
4169
|
{
|
|
4194
4170
|
className: cn("aviala-color-picker-field__input", typographyVariants({ level: "text" })),
|
|
@@ -4201,7 +4177,7 @@ function ColorPickerInputs({
|
|
|
4201
4177
|
}
|
|
4202
4178
|
) }),
|
|
4203
4179
|
/* @__PURE__ */ jsxs19("div", { className: "aviala-color-picker-field aviala-color-picker-field--alpha", children: [
|
|
4204
|
-
/* @__PURE__ */
|
|
4180
|
+
/* @__PURE__ */ jsx27(
|
|
4205
4181
|
"input",
|
|
4206
4182
|
{
|
|
4207
4183
|
className: cn("aviala-color-picker-field__input", typographyVariants({ level: "text" })),
|
|
@@ -4214,7 +4190,7 @@ function ColorPickerInputs({
|
|
|
4214
4190
|
onKeyDown: (e) => e.key === "Enter" && commitAlpha()
|
|
4215
4191
|
}
|
|
4216
4192
|
),
|
|
4217
|
-
/* @__PURE__ */
|
|
4193
|
+
/* @__PURE__ */ jsx27("span", { className: "aviala-color-picker-field__badge-area", children: /* @__PURE__ */ jsx27(Badge, { style: "normal", children: "%" }) })
|
|
4218
4194
|
] }),
|
|
4219
4195
|
/* @__PURE__ */ jsxs19(
|
|
4220
4196
|
Select,
|
|
@@ -4223,11 +4199,11 @@ function ColorPickerInputs({
|
|
|
4223
4199
|
onValueChange: (next) => setFormat(next),
|
|
4224
4200
|
disabled: isDisabled,
|
|
4225
4201
|
children: [
|
|
4226
|
-
/* @__PURE__ */
|
|
4227
|
-
/* @__PURE__ */
|
|
4228
|
-
/* @__PURE__ */
|
|
4229
|
-
/* @__PURE__ */
|
|
4230
|
-
/* @__PURE__ */
|
|
4202
|
+
/* @__PURE__ */ jsx27(SelectTrigger, { className: "aviala-color-picker-format-select w-[76px] shrink-0", size: "regular", children: /* @__PURE__ */ jsx27(SelectValue, {}) }),
|
|
4203
|
+
/* @__PURE__ */ jsx27(SelectContent, { onCloseAutoFocus: (event) => event.preventDefault(), children: /* @__PURE__ */ jsxs19(SelectItemGroup, { children: [
|
|
4204
|
+
/* @__PURE__ */ jsx27(SelectItem, { value: "hex", itemFunction: "radio", children: "HEX" }),
|
|
4205
|
+
/* @__PURE__ */ jsx27(SelectItem, { value: "rgb", itemFunction: "radio", children: "RGB" }),
|
|
4206
|
+
/* @__PURE__ */ jsx27(SelectItem, { value: "hsl", itemFunction: "radio", children: "HSL" })
|
|
4231
4207
|
] }) })
|
|
4232
4208
|
]
|
|
4233
4209
|
}
|
|
@@ -4251,11 +4227,11 @@ import { SymbolAdd } from "@aviala-design/icons";
|
|
|
4251
4227
|
|
|
4252
4228
|
// src/components/color-picker/color-pick-button.tsx
|
|
4253
4229
|
import { forwardRef as forwardRef24 } from "react";
|
|
4254
|
-
import { jsx as
|
|
4230
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
4255
4231
|
var ColorPickButton = forwardRef24(
|
|
4256
4232
|
({ className, color, selected = false, style, ...props }, ref) => {
|
|
4257
4233
|
const swatch = parseColor(color).toHex();
|
|
4258
|
-
return /* @__PURE__ */
|
|
4234
|
+
return /* @__PURE__ */ jsx28(
|
|
4259
4235
|
"button",
|
|
4260
4236
|
{
|
|
4261
4237
|
ref,
|
|
@@ -4264,7 +4240,7 @@ var ColorPickButton = forwardRef24(
|
|
|
4264
4240
|
"data-selected": selected ? "true" : void 0,
|
|
4265
4241
|
style,
|
|
4266
4242
|
...props,
|
|
4267
|
-
children: /* @__PURE__ */
|
|
4243
|
+
children: /* @__PURE__ */ jsx28(
|
|
4268
4244
|
"span",
|
|
4269
4245
|
{
|
|
4270
4246
|
className: "aviala-color-pick-button__swatch",
|
|
@@ -4279,7 +4255,7 @@ var ColorPickButton = forwardRef24(
|
|
|
4279
4255
|
ColorPickButton.displayName = "ColorPickButton";
|
|
4280
4256
|
|
|
4281
4257
|
// src/components/color-picker/color-picker-presets.tsx
|
|
4282
|
-
import { jsx as
|
|
4258
|
+
import { jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4283
4259
|
function ColorPickerPresets({
|
|
4284
4260
|
className,
|
|
4285
4261
|
presets: presetsProp,
|
|
@@ -4302,7 +4278,7 @@ function ColorPickerPresets({
|
|
|
4302
4278
|
onPresetsChange(next);
|
|
4303
4279
|
};
|
|
4304
4280
|
return /* @__PURE__ */ jsxs20("div", { className: cn("aviala-color-picker-presets", className), ...spiralDebugId("color-picker.content.presets"), children: [
|
|
4305
|
-
/* @__PURE__ */
|
|
4281
|
+
/* @__PURE__ */ jsx29(
|
|
4306
4282
|
Button,
|
|
4307
4283
|
{
|
|
4308
4284
|
type: "button",
|
|
@@ -4312,10 +4288,10 @@ function ColorPickerPresets({
|
|
|
4312
4288
|
disabled: isDisabled || !onPresetsChange || presets.length >= maxPresets,
|
|
4313
4289
|
"aria-label": "Add current color to presets",
|
|
4314
4290
|
onClick: handleAdd,
|
|
4315
|
-
children: /* @__PURE__ */
|
|
4291
|
+
children: /* @__PURE__ */ jsx29(SymbolAdd, { "aria-hidden": true })
|
|
4316
4292
|
}
|
|
4317
4293
|
),
|
|
4318
|
-
presets.map((color) => /* @__PURE__ */
|
|
4294
|
+
presets.map((color) => /* @__PURE__ */ jsx29(
|
|
4319
4295
|
ColorPickButton,
|
|
4320
4296
|
{
|
|
4321
4297
|
color,
|
|
@@ -4330,7 +4306,7 @@ function ColorPickerPresets({
|
|
|
4330
4306
|
|
|
4331
4307
|
// src/components/color-picker/color-picker-slider.tsx
|
|
4332
4308
|
import { useCallback as useCallback9, useRef as useRef6 } from "react";
|
|
4333
|
-
import { jsx as
|
|
4309
|
+
import { jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4334
4310
|
function ColorPickerSlider({
|
|
4335
4311
|
kind,
|
|
4336
4312
|
className,
|
|
@@ -4378,7 +4354,7 @@ function ColorPickerSlider({
|
|
|
4378
4354
|
backgroundImage: `linear-gradient(90deg, transparent, ${solidHex(value)})`,
|
|
4379
4355
|
backgroundColor: "var(--color-picker-checkerboard)"
|
|
4380
4356
|
};
|
|
4381
|
-
return /* @__PURE__ */
|
|
4357
|
+
return /* @__PURE__ */ jsx30(
|
|
4382
4358
|
"div",
|
|
4383
4359
|
{
|
|
4384
4360
|
className: cn("aviala-color-picker-slider-row", className),
|
|
@@ -4397,8 +4373,8 @@ function ColorPickerSlider({
|
|
|
4397
4373
|
"aria-valuenow": ariaValueNow,
|
|
4398
4374
|
tabIndex: isDisabled ? -1 : 0,
|
|
4399
4375
|
children: [
|
|
4400
|
-
/* @__PURE__ */
|
|
4401
|
-
/* @__PURE__ */
|
|
4376
|
+
/* @__PURE__ */ jsx30("div", { className: "aviala-color-picker-slider__track", style: trackStyle }),
|
|
4377
|
+
/* @__PURE__ */ jsx30(
|
|
4402
4378
|
"div",
|
|
4403
4379
|
{
|
|
4404
4380
|
className: "aviala-color-picker-slider__thumb",
|
|
@@ -4414,7 +4390,7 @@ function ColorPickerSlider({
|
|
|
4414
4390
|
}
|
|
4415
4391
|
|
|
4416
4392
|
// src/components/color-picker/color-picker.tsx
|
|
4417
|
-
import { jsx as
|
|
4393
|
+
import { jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4418
4394
|
function ColorPicker({
|
|
4419
4395
|
children,
|
|
4420
4396
|
className,
|
|
@@ -4457,17 +4433,17 @@ function ColorPicker({
|
|
|
4457
4433
|
onPresetsChange,
|
|
4458
4434
|
maxPresets
|
|
4459
4435
|
};
|
|
4460
|
-
return /* @__PURE__ */
|
|
4436
|
+
return /* @__PURE__ */ jsx31(ColorPickerContextProvider, { value: contextValue, children: /* @__PURE__ */ jsx31(PopoverPrimitive2.Root, { open, onOpenChange: handleOpenChange, modal: false, children: /* @__PURE__ */ jsx31("div", { className: cn("inline-flex", className), ...spiralDebugId("color-picker"), children }) }) });
|
|
4461
4437
|
}
|
|
4462
4438
|
function ColorPickerContextProvider({
|
|
4463
4439
|
value,
|
|
4464
4440
|
children
|
|
4465
4441
|
}) {
|
|
4466
|
-
return /* @__PURE__ */
|
|
4442
|
+
return /* @__PURE__ */ jsx31(ColorPickerContext.Provider, { value, children });
|
|
4467
4443
|
}
|
|
4468
4444
|
var ColorPickerTrigger = forwardRef25(({ className, size = "regular", allRound = false, placeholder = "Select color", ...props }, ref) => {
|
|
4469
4445
|
const { value, open, disabled } = useColorPickerContext();
|
|
4470
|
-
return /* @__PURE__ */
|
|
4446
|
+
return /* @__PURE__ */ jsx31(PopoverPrimitive2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs22(
|
|
4471
4447
|
"button",
|
|
4472
4448
|
{
|
|
4473
4449
|
ref,
|
|
@@ -4481,7 +4457,7 @@ var ColorPickerTrigger = forwardRef25(({ className, size = "regular", allRound =
|
|
|
4481
4457
|
disabled,
|
|
4482
4458
|
...props,
|
|
4483
4459
|
children: [
|
|
4484
|
-
/* @__PURE__ */
|
|
4460
|
+
/* @__PURE__ */ jsx31("span", { className: "aviala-color-picker-trigger__swatch", ...spiralDebugId("color-picker.trigger.swatch"), children: /* @__PURE__ */ jsx31(
|
|
4485
4461
|
"span",
|
|
4486
4462
|
{
|
|
4487
4463
|
className: "aviala-color-picker-trigger__swatch-inner",
|
|
@@ -4489,7 +4465,7 @@ var ColorPickerTrigger = forwardRef25(({ className, size = "regular", allRound =
|
|
|
4489
4465
|
"aria-hidden": true
|
|
4490
4466
|
}
|
|
4491
4467
|
) }),
|
|
4492
|
-
/* @__PURE__ */
|
|
4468
|
+
/* @__PURE__ */ jsx31("span", { className: "aviala-color-picker-trigger__value", ...spiralDebugId("color-picker.trigger.value"), children: value ? value.replace(/^#/, "").slice(0, 6).toUpperCase() : /* @__PURE__ */ jsx31("span", { className: "aviala-color-picker-trigger__placeholder", children: placeholder }) })
|
|
4493
4469
|
]
|
|
4494
4470
|
}
|
|
4495
4471
|
) });
|
|
@@ -4508,7 +4484,7 @@ var ColorPickerContent = forwardRef25(
|
|
|
4508
4484
|
...props
|
|
4509
4485
|
}, ref) => {
|
|
4510
4486
|
const { presets, onPresetsChange, maxPresets, disabled } = useColorPickerContext();
|
|
4511
|
-
return /* @__PURE__ */
|
|
4487
|
+
return /* @__PURE__ */ jsx31(PopoverPrimitive2.Portal, { children: /* @__PURE__ */ jsx31(
|
|
4512
4488
|
PopoverPrimitive2.Content,
|
|
4513
4489
|
{
|
|
4514
4490
|
ref,
|
|
@@ -4525,11 +4501,11 @@ var ColorPickerContent = forwardRef25(
|
|
|
4525
4501
|
onFocusOutside: (event) => event.preventDefault(),
|
|
4526
4502
|
...props,
|
|
4527
4503
|
children: /* @__PURE__ */ jsxs22("div", { className: "aviala-color-picker-panel", children: [
|
|
4528
|
-
/* @__PURE__ */
|
|
4529
|
-
/* @__PURE__ */
|
|
4530
|
-
/* @__PURE__ */
|
|
4531
|
-
/* @__PURE__ */
|
|
4532
|
-
showPresets ? /* @__PURE__ */
|
|
4504
|
+
/* @__PURE__ */ jsx31(ColorPickerArea, { disabled }),
|
|
4505
|
+
/* @__PURE__ */ jsx31(ColorPickerSlider, { kind: "hue", disabled }),
|
|
4506
|
+
/* @__PURE__ */ jsx31(ColorPickerSlider, { kind: "alpha", disabled }),
|
|
4507
|
+
/* @__PURE__ */ jsx31(ColorPickerInputs, { disabled, showEyedropper }),
|
|
4508
|
+
showPresets ? /* @__PURE__ */ jsx31(
|
|
4533
4509
|
ColorPickerPresets,
|
|
4534
4510
|
{
|
|
4535
4511
|
disabled,
|
|
@@ -4546,7 +4522,7 @@ var ColorPickerContent = forwardRef25(
|
|
|
4546
4522
|
ColorPickerContent.displayName = "ColorPickerContent";
|
|
4547
4523
|
|
|
4548
4524
|
// src/components/color-picker/color-picker-panel.tsx
|
|
4549
|
-
import { jsx as
|
|
4525
|
+
import { jsx as jsx32, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4550
4526
|
function ColorPickerPanel({
|
|
4551
4527
|
className,
|
|
4552
4528
|
disabled,
|
|
@@ -4578,12 +4554,12 @@ function ColorPickerPanel({
|
|
|
4578
4554
|
onPresetsChange,
|
|
4579
4555
|
maxPresets
|
|
4580
4556
|
};
|
|
4581
|
-
return /* @__PURE__ */
|
|
4582
|
-
/* @__PURE__ */
|
|
4583
|
-
/* @__PURE__ */
|
|
4584
|
-
/* @__PURE__ */
|
|
4585
|
-
/* @__PURE__ */
|
|
4586
|
-
showPresets ? /* @__PURE__ */
|
|
4557
|
+
return /* @__PURE__ */ jsx32(ColorPickerContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs23("div", { className: cn("aviala-color-picker-panel", className), children: [
|
|
4558
|
+
/* @__PURE__ */ jsx32(ColorPickerArea, { disabled }),
|
|
4559
|
+
/* @__PURE__ */ jsx32(ColorPickerSlider, { kind: "hue", disabled }),
|
|
4560
|
+
/* @__PURE__ */ jsx32(ColorPickerSlider, { kind: "alpha", disabled }),
|
|
4561
|
+
/* @__PURE__ */ jsx32(ColorPickerInputs, { disabled, showEyedropper }),
|
|
4562
|
+
showPresets ? /* @__PURE__ */ jsx32(
|
|
4587
4563
|
ColorPickerPresets,
|
|
4588
4564
|
{
|
|
4589
4565
|
disabled,
|
|
@@ -4610,11 +4586,11 @@ import {
|
|
|
4610
4586
|
useContext as useContext5,
|
|
4611
4587
|
useEffect as useEffect5,
|
|
4612
4588
|
useLayoutEffect as useLayoutEffect3,
|
|
4613
|
-
useMemo as
|
|
4589
|
+
useMemo as useMemo5,
|
|
4614
4590
|
useRef as useRef7,
|
|
4615
4591
|
useState as useState10
|
|
4616
4592
|
} from "react";
|
|
4617
|
-
import { jsx as
|
|
4593
|
+
import { jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4618
4594
|
var CascaderContext = createContext5(null);
|
|
4619
4595
|
function useCascaderContext() {
|
|
4620
4596
|
const context = useContext5(CascaderContext);
|
|
@@ -4623,29 +4599,13 @@ function useCascaderContext() {
|
|
|
4623
4599
|
}
|
|
4624
4600
|
return context;
|
|
4625
4601
|
}
|
|
4626
|
-
function renderSlotIcon5(node, debugId) {
|
|
4627
|
-
if (!node) return null;
|
|
4628
|
-
const content = cloneAvialaIconElement(node, {
|
|
4629
|
-
level: "text",
|
|
4630
|
-
biggerSize: true
|
|
4631
|
-
});
|
|
4632
|
-
return /* @__PURE__ */ jsx32(
|
|
4633
|
-
"span",
|
|
4634
|
-
{
|
|
4635
|
-
className: "aviala-cascader-trigger__slot",
|
|
4636
|
-
style: iconSlotCssVarStyle(node, "--input-slot-icon-size", "text", true),
|
|
4637
|
-
...debugId ? spiralDebugId(debugId) : void 0,
|
|
4638
|
-
children: content
|
|
4639
|
-
}
|
|
4640
|
-
);
|
|
4641
|
-
}
|
|
4642
4602
|
function renderItemIcon2(node, iconLevel = "text", debugId) {
|
|
4643
4603
|
if (!node) return null;
|
|
4644
4604
|
const content = cloneAvialaIconElement(node, {
|
|
4645
4605
|
level: iconLevel,
|
|
4646
4606
|
biggerSize: true
|
|
4647
4607
|
});
|
|
4648
|
-
return /* @__PURE__ */
|
|
4608
|
+
return /* @__PURE__ */ jsx33(
|
|
4649
4609
|
"span",
|
|
4650
4610
|
{
|
|
4651
4611
|
className: cn(
|
|
@@ -4660,16 +4620,16 @@ function renderItemIcon2(node, iconLevel = "text", debugId) {
|
|
|
4660
4620
|
}
|
|
4661
4621
|
function renderBadgeSlot2(node) {
|
|
4662
4622
|
if (node == null || node === false) return null;
|
|
4663
|
-
return /* @__PURE__ */
|
|
4623
|
+
return /* @__PURE__ */ jsx33("span", { className: "aviala-cascader-item__badge", children: isValidElement12(node) && node.type === Badge ? node : /* @__PURE__ */ jsx33(Badge, { children: node }) });
|
|
4664
4624
|
}
|
|
4665
4625
|
function CascaderItemFormRadio() {
|
|
4666
4626
|
return /* @__PURE__ */ jsxs24("span", { className: "aviala-cascader-item__form-radio", "aria-hidden": true, children: [
|
|
4667
|
-
/* @__PURE__ */
|
|
4668
|
-
/* @__PURE__ */
|
|
4627
|
+
/* @__PURE__ */ jsx33("span", { className: "aviala-cascader-item__form-radio-surface" }),
|
|
4628
|
+
/* @__PURE__ */ jsx33("span", { className: "aviala-cascader-item__form-radio-indicator" })
|
|
4669
4629
|
] });
|
|
4670
4630
|
}
|
|
4671
4631
|
function CascaderItemFormCheckbox() {
|
|
4672
|
-
return /* @__PURE__ */
|
|
4632
|
+
return /* @__PURE__ */ jsx33("span", { className: "aviala-cascader-item__form-checkbox", "aria-hidden": true, children: /* @__PURE__ */ jsx33(
|
|
4673
4633
|
SymbolRight3,
|
|
4674
4634
|
{
|
|
4675
4635
|
className: "aviala-cascader-item__form-checkbox-icon",
|
|
@@ -4682,27 +4642,27 @@ function CascaderItemFormCheckbox() {
|
|
|
4682
4642
|
}
|
|
4683
4643
|
function CascaderItemTrailingRadio({ selected }) {
|
|
4684
4644
|
if (!selected) return null;
|
|
4685
|
-
return /* @__PURE__ */
|
|
4645
|
+
return /* @__PURE__ */ jsx33("span", { className: "aviala-cascader-item__trailing-radio", "aria-hidden": true, children: /* @__PURE__ */ jsx33(SymbolRight3, { level: "text", biggerSize: true, "aria-hidden": true }) });
|
|
4686
4646
|
}
|
|
4687
4647
|
function CascaderItemTrailingCheckbox({ selected }) {
|
|
4688
4648
|
if (!selected) return null;
|
|
4689
|
-
return /* @__PURE__ */
|
|
4649
|
+
return /* @__PURE__ */ jsx33("span", { className: "aviala-cascader-item__trailing-checkbox", "aria-hidden": true, children: /* @__PURE__ */ jsx33(SymbolRight3, { level: "text", biggerSize: true, "aria-hidden": true }) });
|
|
4690
4650
|
}
|
|
4691
4651
|
function renderFunctionSlot2(itemFunction, layout, showFunctionIcon, hasChildren, selected, icon) {
|
|
4692
4652
|
if (!showFunctionIcon || layout === "title") return null;
|
|
4693
4653
|
if (icon !== void 0) {
|
|
4694
|
-
return /* @__PURE__ */
|
|
4654
|
+
return /* @__PURE__ */ jsx33("span", { className: "aviala-cascader-item__function", children: icon });
|
|
4695
4655
|
}
|
|
4696
4656
|
switch (itemFunction) {
|
|
4697
4657
|
case "radio":
|
|
4698
|
-
return /* @__PURE__ */
|
|
4658
|
+
return /* @__PURE__ */ jsx33("span", { className: "aviala-cascader-item__function", children: /* @__PURE__ */ jsx33(CascaderItemTrailingRadio, { selected }) });
|
|
4699
4659
|
case "checkbox":
|
|
4700
|
-
return /* @__PURE__ */
|
|
4660
|
+
return /* @__PURE__ */ jsx33("span", { className: "aviala-cascader-item__function", children: /* @__PURE__ */ jsx33(CascaderItemTrailingCheckbox, { selected }) });
|
|
4701
4661
|
case "simple":
|
|
4702
4662
|
default:
|
|
4703
4663
|
return /* @__PURE__ */ jsxs24("span", { className: "aviala-cascader-item__function", children: [
|
|
4704
|
-
selected ? /* @__PURE__ */
|
|
4705
|
-
hasChildren ? /* @__PURE__ */
|
|
4664
|
+
selected ? /* @__PURE__ */ jsx33(SymbolRight3, { level: "text", biggerSize: true, "aria-hidden": true }) : null,
|
|
4665
|
+
hasChildren ? /* @__PURE__ */ jsx33(DirectionArrowRightLight, { level: "text", biggerSize: true, "aria-hidden": true }) : null
|
|
4706
4666
|
] });
|
|
4707
4667
|
}
|
|
4708
4668
|
}
|
|
@@ -4831,7 +4791,7 @@ function Cascader({
|
|
|
4831
4791
|
},
|
|
4832
4792
|
[changeOnSelect, commitValue, expandTo, handleOpenChange, options]
|
|
4833
4793
|
);
|
|
4834
|
-
const contextValue =
|
|
4794
|
+
const contextValue = useMemo5(
|
|
4835
4795
|
() => ({
|
|
4836
4796
|
open,
|
|
4837
4797
|
disabled,
|
|
@@ -4862,7 +4822,7 @@ function Cascader({
|
|
|
4862
4822
|
size
|
|
4863
4823
|
]
|
|
4864
4824
|
);
|
|
4865
|
-
return /* @__PURE__ */
|
|
4825
|
+
return /* @__PURE__ */ jsx33(CascaderContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx33(PopoverPrimitive3.Root, { open, onOpenChange: handleOpenChange, modal: false, children: /* @__PURE__ */ jsx33("div", { className: cn("inline-flex", className), ...spiralDebugId("cascader"), children }) }) });
|
|
4866
4826
|
}
|
|
4867
4827
|
var CascaderTrigger = forwardRef26(
|
|
4868
4828
|
({
|
|
@@ -4888,7 +4848,7 @@ var CascaderTrigger = forwardRef26(
|
|
|
4888
4848
|
label
|
|
4889
4849
|
] }, `${selectedPath[index]}-${index}`)) : null);
|
|
4890
4850
|
const hasValue = resolvedDisplay != null && resolvedDisplay !== false;
|
|
4891
|
-
return /* @__PURE__ */
|
|
4851
|
+
return /* @__PURE__ */ jsx33(PopoverPrimitive3.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs24(
|
|
4892
4852
|
"button",
|
|
4893
4853
|
{
|
|
4894
4854
|
ref,
|
|
@@ -4904,8 +4864,8 @@ var CascaderTrigger = forwardRef26(
|
|
|
4904
4864
|
...spiralDebugId("cascader.trigger"),
|
|
4905
4865
|
...props,
|
|
4906
4866
|
children: [
|
|
4907
|
-
|
|
4908
|
-
/* @__PURE__ */
|
|
4867
|
+
renderSlotIcon(leftIcon, "aviala-cascader-trigger__slot", "cascader.trigger.icon-left"),
|
|
4868
|
+
/* @__PURE__ */ jsx33("span", { className: "aviala-cascader-trigger__field", ...spiralDebugId("cascader.trigger.value"), children: /* @__PURE__ */ jsx33(
|
|
4909
4869
|
"span",
|
|
4910
4870
|
{
|
|
4911
4871
|
className: cn("aviala-cascader-trigger__value", typographyVariants({ level: "text" })),
|
|
@@ -4913,15 +4873,15 @@ var CascaderTrigger = forwardRef26(
|
|
|
4913
4873
|
children: hasValue ? resolvedDisplay : placeholder
|
|
4914
4874
|
}
|
|
4915
4875
|
) }),
|
|
4916
|
-
|
|
4917
|
-
/* @__PURE__ */
|
|
4876
|
+
renderSlotIcon(rightIcon, "aviala-cascader-trigger__slot", "cascader.trigger.icon-right"),
|
|
4877
|
+
/* @__PURE__ */ jsx33(
|
|
4918
4878
|
"span",
|
|
4919
4879
|
{
|
|
4920
4880
|
className: "aviala-cascader-trigger__expand",
|
|
4921
4881
|
"aria-hidden": true,
|
|
4922
4882
|
style: expandIcon ? iconSlotCssVarStyle(expandIcon, "--input-slot-icon-size", "text", true) : iconLevelCssVarStyle("text", true, "--input-slot-icon-size"),
|
|
4923
4883
|
...spiralDebugId("cascader.trigger.expand"),
|
|
4924
|
-
children: expandIcon ?? /* @__PURE__ */
|
|
4884
|
+
children: expandIcon ?? /* @__PURE__ */ jsx33(DirectionArrowDownLight3, { level: "text", biggerSize: true, "aria-hidden": true })
|
|
4925
4885
|
}
|
|
4926
4886
|
)
|
|
4927
4887
|
]
|
|
@@ -4939,7 +4899,7 @@ var CascaderContent = forwardRef26(
|
|
|
4939
4899
|
portalled = true,
|
|
4940
4900
|
...props
|
|
4941
4901
|
}, ref) => {
|
|
4942
|
-
const content = /* @__PURE__ */
|
|
4902
|
+
const content = /* @__PURE__ */ jsx33(
|
|
4943
4903
|
PopoverPrimitive3.Content,
|
|
4944
4904
|
{
|
|
4945
4905
|
ref,
|
|
@@ -4952,12 +4912,12 @@ var CascaderContent = forwardRef26(
|
|
|
4952
4912
|
}
|
|
4953
4913
|
);
|
|
4954
4914
|
if (!portalled) return content;
|
|
4955
|
-
return /* @__PURE__ */
|
|
4915
|
+
return /* @__PURE__ */ jsx33(PopoverPrimitive3.Portal, { children: content });
|
|
4956
4916
|
}
|
|
4957
4917
|
);
|
|
4958
4918
|
CascaderContent.displayName = "CascaderContent";
|
|
4959
4919
|
var CascaderMenu = forwardRef26(
|
|
4960
|
-
({ children, className }, ref) => /* @__PURE__ */
|
|
4920
|
+
({ children, className }, ref) => /* @__PURE__ */ jsx33("div", { ref, className: cn("aviala-cascader-menu", className), children })
|
|
4961
4921
|
);
|
|
4962
4922
|
CascaderMenu.displayName = "CascaderMenu";
|
|
4963
4923
|
var CascaderColumn = forwardRef26(
|
|
@@ -4971,14 +4931,14 @@ var CascaderColumn = forwardRef26(
|
|
|
4971
4931
|
width: exitLayout.width,
|
|
4972
4932
|
zIndex: 0
|
|
4973
4933
|
} : void 0;
|
|
4974
|
-
return /* @__PURE__ */
|
|
4934
|
+
return /* @__PURE__ */ jsx33(
|
|
4975
4935
|
"div",
|
|
4976
4936
|
{
|
|
4977
4937
|
ref,
|
|
4978
4938
|
className: cn("aviala-cascader-column", className),
|
|
4979
4939
|
"data-animate": animate,
|
|
4980
4940
|
style: exitStyle,
|
|
4981
|
-
children: /* @__PURE__ */
|
|
4941
|
+
children: /* @__PURE__ */ jsx33("div", { className: "aviala-cascader-column__surface", "data-animate": animate, children })
|
|
4982
4942
|
}
|
|
4983
4943
|
);
|
|
4984
4944
|
}
|
|
@@ -4991,9 +4951,9 @@ function CascaderItemGroup({
|
|
|
4991
4951
|
className
|
|
4992
4952
|
}) {
|
|
4993
4953
|
return /* @__PURE__ */ jsxs24("div", { className: cn("aviala-cascader-group", className), children: [
|
|
4994
|
-
label ? /* @__PURE__ */
|
|
4995
|
-
/* @__PURE__ */
|
|
4996
|
-
showDivider ? /* @__PURE__ */
|
|
4954
|
+
label ? /* @__PURE__ */ jsx33("div", { className: cn("aviala-cascader-label", typographyVariants({ level: "caption" })), children: label }) : null,
|
|
4955
|
+
/* @__PURE__ */ jsx33("div", { className: "aviala-cascader-group__slot", children }),
|
|
4956
|
+
showDivider ? /* @__PURE__ */ jsx33("div", { className: "aviala-cascader-separator", role: "separator" }) : null
|
|
4997
4957
|
] });
|
|
4998
4958
|
}
|
|
4999
4959
|
var CascaderItem = forwardRef26(
|
|
@@ -5086,10 +5046,10 @@ var CascaderItem = forwardRef26(
|
|
|
5086
5046
|
if (!isTitle) setHighlightedValue(value);
|
|
5087
5047
|
},
|
|
5088
5048
|
children: [
|
|
5089
|
-
isFormLeading && itemFunction === "form-radio" ? /* @__PURE__ */
|
|
5090
|
-
isFormLeading && itemFunction === "form-checkbox" ? /* @__PURE__ */
|
|
5049
|
+
isFormLeading && itemFunction === "form-radio" ? /* @__PURE__ */ jsx33(CascaderItemFormRadio, {}) : null,
|
|
5050
|
+
isFormLeading && itemFunction === "form-checkbox" ? /* @__PURE__ */ jsx33(CascaderItemFormCheckbox, {}) : null,
|
|
5091
5051
|
showLeftIcon && leftIcon ? renderItemIcon2(leftIcon, leftIconLevel, "cascader.content.item.icon-left") : null,
|
|
5092
|
-
/* @__PURE__ */
|
|
5052
|
+
/* @__PURE__ */ jsx33("span", { className: cn("aviala-cascader-item__text", typographyVariants({ level: isTitle ? "caption" : "text" })), children: children ?? option?.label }),
|
|
5093
5053
|
showBadge ? renderBadgeSlot2(badge ?? "Text") : null,
|
|
5094
5054
|
showRightIcon && rightIcon ? renderItemIcon2(rightIcon, leftIconLevel) : null,
|
|
5095
5055
|
renderFunctionSlot2(
|
|
@@ -5121,7 +5081,7 @@ function CascaderOptionsMenu({ className }) {
|
|
|
5121
5081
|
const menuRef = useRef7(null);
|
|
5122
5082
|
const columnElRefs = useRef7(/* @__PURE__ */ new Map());
|
|
5123
5083
|
const [columns, setColumns] = useState10([]);
|
|
5124
|
-
const columnPaths =
|
|
5084
|
+
const columnPaths = useMemo5(() => {
|
|
5125
5085
|
const paths = [[]];
|
|
5126
5086
|
const expansion = activePath.length > 0 ? activePath : selectedPath.slice(0, -1);
|
|
5127
5087
|
for (let index = 0; index < expansion.length; index += 1) {
|
|
@@ -5214,7 +5174,7 @@ function CascaderOptionsMenu({ className }) {
|
|
|
5214
5174
|
}, COLUMN_ANIMATION_MS);
|
|
5215
5175
|
return () => window.clearTimeout(timeout);
|
|
5216
5176
|
}, [columns, open]);
|
|
5217
|
-
return /* @__PURE__ */
|
|
5177
|
+
return /* @__PURE__ */ jsx33(CascaderMenu, { ref: menuRef, className, children: columns.map(({ pathPrefix, key, animateEnter, animateExit, exitLayout }) => /* @__PURE__ */ jsx33(
|
|
5218
5178
|
CascaderColumn,
|
|
5219
5179
|
{
|
|
5220
5180
|
ref: (element) => {
|
|
@@ -5227,7 +5187,7 @@ function CascaderOptionsMenu({ className }) {
|
|
|
5227
5187
|
animateEnter,
|
|
5228
5188
|
animateExit,
|
|
5229
5189
|
exitLayout,
|
|
5230
|
-
children: /* @__PURE__ */
|
|
5190
|
+
children: /* @__PURE__ */ jsx33(CascaderItemGroup, { label: "Title", showDivider: true, children: getOptionsAtPath2(pathPrefix).map((option) => /* @__PURE__ */ jsx33(
|
|
5231
5191
|
CascaderItem,
|
|
5232
5192
|
{
|
|
5233
5193
|
value: option.value,
|
|
@@ -5280,7 +5240,7 @@ function CascaderField({
|
|
|
5280
5240
|
changeOnSelect,
|
|
5281
5241
|
className,
|
|
5282
5242
|
children: [
|
|
5283
|
-
/* @__PURE__ */
|
|
5243
|
+
/* @__PURE__ */ jsx33(
|
|
5284
5244
|
CascaderTrigger,
|
|
5285
5245
|
{
|
|
5286
5246
|
size,
|
|
@@ -5294,7 +5254,7 @@ function CascaderField({
|
|
|
5294
5254
|
...triggerProps
|
|
5295
5255
|
}
|
|
5296
5256
|
),
|
|
5297
|
-
/* @__PURE__ */
|
|
5257
|
+
/* @__PURE__ */ jsx33(CascaderContent, { className: contentClassName, children: /* @__PURE__ */ jsx33(CascaderOptionsMenu, { className: menuClassName }) })
|
|
5298
5258
|
]
|
|
5299
5259
|
}
|
|
5300
5260
|
);
|
|
@@ -5314,20 +5274,20 @@ import {
|
|
|
5314
5274
|
useEffect as useEffect7,
|
|
5315
5275
|
useId as useId4,
|
|
5316
5276
|
useLayoutEffect as useLayoutEffect5,
|
|
5317
|
-
useMemo as
|
|
5277
|
+
useMemo as useMemo8,
|
|
5318
5278
|
useRef as useRef9,
|
|
5319
5279
|
useState as useState11
|
|
5320
5280
|
} from "react";
|
|
5321
5281
|
|
|
5322
5282
|
// src/components/date-picker/date-picker-context.tsx
|
|
5323
5283
|
import { createContext as createContext6, useContext as useContext6 } from "react";
|
|
5324
|
-
import { jsx as
|
|
5284
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
5325
5285
|
var DatePickerContext = createContext6(null);
|
|
5326
5286
|
function DatePickerProvider({
|
|
5327
5287
|
value,
|
|
5328
5288
|
children
|
|
5329
5289
|
}) {
|
|
5330
|
-
return /* @__PURE__ */
|
|
5290
|
+
return /* @__PURE__ */ jsx34(DatePickerContext.Provider, { value, children });
|
|
5331
5291
|
}
|
|
5332
5292
|
function useDatePickerContext() {
|
|
5333
5293
|
const context = useContext6(DatePickerContext);
|
|
@@ -5522,14 +5482,14 @@ function parseDateRangeInput(text) {
|
|
|
5522
5482
|
}
|
|
5523
5483
|
|
|
5524
5484
|
// src/components/date-picker/date-picker-month-wheels.tsx
|
|
5525
|
-
import { useMemo as
|
|
5485
|
+
import { useMemo as useMemo7 } from "react";
|
|
5526
5486
|
|
|
5527
5487
|
// src/components/date-picker/date-picker-time-wheel.tsx
|
|
5528
5488
|
import {
|
|
5529
5489
|
useCallback as useCallback11,
|
|
5530
5490
|
useEffect as useEffect6,
|
|
5531
5491
|
useLayoutEffect as useLayoutEffect4,
|
|
5532
|
-
useMemo as
|
|
5492
|
+
useMemo as useMemo6,
|
|
5533
5493
|
useRef as useRef8
|
|
5534
5494
|
} from "react";
|
|
5535
5495
|
|
|
@@ -5554,7 +5514,7 @@ function stickyRoundIndex(fractionalIndex, stickiness = WHEEL_STICKY_AMOUNT) {
|
|
|
5554
5514
|
}
|
|
5555
5515
|
|
|
5556
5516
|
// src/components/date-picker/date-picker-time-wheel.tsx
|
|
5557
|
-
import { jsx as
|
|
5517
|
+
import { jsx as jsx35, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
5558
5518
|
var LOOP_SECTIONS = 3;
|
|
5559
5519
|
var MIDDLE_SECTION = 1;
|
|
5560
5520
|
function formatWheelValue(value) {
|
|
@@ -5607,7 +5567,7 @@ function DatePickerTimeWheelColumn({
|
|
|
5607
5567
|
const wheelAccumRef = useRef8(0);
|
|
5608
5568
|
const selectedValueRef = useRef8(value);
|
|
5609
5569
|
selectedValueRef.current = value;
|
|
5610
|
-
const repeatedValues =
|
|
5570
|
+
const repeatedValues = useMemo6(() => {
|
|
5611
5571
|
if (!loop) return [...values];
|
|
5612
5572
|
return Array.from({ length: LOOP_SECTIONS }, () => values).flat();
|
|
5613
5573
|
}, [loop, values]);
|
|
@@ -5795,22 +5755,22 @@ function DatePickerTimeWheelColumn({
|
|
|
5795
5755
|
};
|
|
5796
5756
|
const selectedOptionId = loop ? `${ariaLabel}-${value}-${values.length * MIDDLE_SECTION + getValueIndex(values, value)}` : `${ariaLabel}-${value}`;
|
|
5797
5757
|
return /* @__PURE__ */ jsxs25("div", { className: cn("aviala-datepicker-time__wheel", className), children: [
|
|
5798
|
-
/* @__PURE__ */
|
|
5799
|
-
/* @__PURE__ */
|
|
5758
|
+
/* @__PURE__ */ jsx35("div", { className: "aviala-datepicker-time__wheel-highlight", "aria-hidden": true }),
|
|
5759
|
+
/* @__PURE__ */ jsx35(
|
|
5800
5760
|
"div",
|
|
5801
5761
|
{
|
|
5802
5762
|
className: "aviala-datepicker-time__wheel-fade aviala-datepicker-time__wheel-fade--top",
|
|
5803
5763
|
"aria-hidden": true
|
|
5804
5764
|
}
|
|
5805
5765
|
),
|
|
5806
|
-
/* @__PURE__ */
|
|
5766
|
+
/* @__PURE__ */ jsx35(
|
|
5807
5767
|
"div",
|
|
5808
5768
|
{
|
|
5809
5769
|
className: "aviala-datepicker-time__wheel-fade aviala-datepicker-time__wheel-fade--bottom",
|
|
5810
5770
|
"aria-hidden": true
|
|
5811
5771
|
}
|
|
5812
5772
|
),
|
|
5813
|
-
/* @__PURE__ */
|
|
5773
|
+
/* @__PURE__ */ jsx35(
|
|
5814
5774
|
"div",
|
|
5815
5775
|
{
|
|
5816
5776
|
ref: scrollRef,
|
|
@@ -5821,17 +5781,17 @@ function DatePickerTimeWheelColumn({
|
|
|
5821
5781
|
"aria-activedescendant": selectedOptionId,
|
|
5822
5782
|
tabIndex: 0,
|
|
5823
5783
|
onKeyDown: handleKeyDown,
|
|
5824
|
-
children: /* @__PURE__ */
|
|
5784
|
+
children: /* @__PURE__ */ jsx35("ul", { className: "aviala-datepicker-time__wheel-list", children: repeatedValues.map((itemValue, index) => {
|
|
5825
5785
|
const isSelected = itemValue === value;
|
|
5826
5786
|
const optionId = loop ? `${ariaLabel}-${itemValue}-${index}` : `${ariaLabel}-${itemValue}`;
|
|
5827
|
-
return /* @__PURE__ */
|
|
5787
|
+
return /* @__PURE__ */ jsx35(
|
|
5828
5788
|
"li",
|
|
5829
5789
|
{
|
|
5830
5790
|
id: optionId,
|
|
5831
5791
|
className: "aviala-datepicker-time__wheel-item",
|
|
5832
5792
|
role: "option",
|
|
5833
5793
|
"aria-selected": isSelected,
|
|
5834
|
-
children: /* @__PURE__ */
|
|
5794
|
+
children: /* @__PURE__ */ jsx35(
|
|
5835
5795
|
"button",
|
|
5836
5796
|
{
|
|
5837
5797
|
type: "button",
|
|
@@ -5860,7 +5820,7 @@ function DatePickerTimeWheelColumn({
|
|
|
5860
5820
|
}
|
|
5861
5821
|
|
|
5862
5822
|
// src/components/date-picker/date-picker-month-wheels.tsx
|
|
5863
|
-
import { jsx as
|
|
5823
|
+
import { jsx as jsx36, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
5864
5824
|
var MONTH_VALUES = Array.from({ length: 12 }, (_, index) => index + 1);
|
|
5865
5825
|
function formatYearValue(value) {
|
|
5866
5826
|
return String(value);
|
|
@@ -5875,7 +5835,7 @@ function DatePickerMonthYearWheels({
|
|
|
5875
5835
|
const { viewMonth, setViewMonth, minDate, maxDate } = useDatePickerContext();
|
|
5876
5836
|
const year = viewMonth.getFullYear();
|
|
5877
5837
|
const month = viewMonth.getMonth() + 1;
|
|
5878
|
-
const yearValues =
|
|
5838
|
+
const yearValues = useMemo7(() => {
|
|
5879
5839
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
5880
5840
|
const start = minDate?.getFullYear() ?? currentYear - 100;
|
|
5881
5841
|
const end = maxDate?.getFullYear() ?? currentYear + 100;
|
|
@@ -5885,14 +5845,14 @@ function DatePickerMonthYearWheels({
|
|
|
5885
5845
|
const setYearMonth = (nextYear, nextMonth) => {
|
|
5886
5846
|
setViewMonth(new Date(nextYear, nextMonth - 1, 1));
|
|
5887
5847
|
};
|
|
5888
|
-
return /* @__PURE__ */
|
|
5848
|
+
return /* @__PURE__ */ jsx36(
|
|
5889
5849
|
"div",
|
|
5890
5850
|
{
|
|
5891
5851
|
className: cn("aviala-datepicker-month", className),
|
|
5892
5852
|
role: "group",
|
|
5893
5853
|
"aria-label": "\u9009\u62E9\u5E74\u6708",
|
|
5894
5854
|
children: /* @__PURE__ */ jsxs26("div", { className: "aviala-datepicker-month__columns", children: [
|
|
5895
|
-
/* @__PURE__ */
|
|
5855
|
+
/* @__PURE__ */ jsx36(
|
|
5896
5856
|
DatePickerTimeWheelColumn,
|
|
5897
5857
|
{
|
|
5898
5858
|
"aria-label": "\u5E74",
|
|
@@ -5904,7 +5864,7 @@ function DatePickerMonthYearWheels({
|
|
|
5904
5864
|
onChange: (nextYear) => setYearMonth(nextYear, month)
|
|
5905
5865
|
}
|
|
5906
5866
|
),
|
|
5907
|
-
/* @__PURE__ */
|
|
5867
|
+
/* @__PURE__ */ jsx36(
|
|
5908
5868
|
DatePickerTimeWheelColumn,
|
|
5909
5869
|
{
|
|
5910
5870
|
"aria-label": "\u6708",
|
|
@@ -5922,12 +5882,12 @@ function DatePickerMonthYearWheels({
|
|
|
5922
5882
|
}
|
|
5923
5883
|
|
|
5924
5884
|
// src/components/time-picker/time-picker-wheels.tsx
|
|
5925
|
-
import { jsx as
|
|
5885
|
+
import { jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
5926
5886
|
var TIME_PICKER_HOUR_VALUES = Array.from({ length: 24 }, (_, index) => index);
|
|
5927
5887
|
var TIME_PICKER_MINUTE_VALUES = Array.from({ length: 12 }, (_, index) => index * 5);
|
|
5928
5888
|
function TimePickerWheels({ value, onChange, className }) {
|
|
5929
|
-
return /* @__PURE__ */
|
|
5930
|
-
/* @__PURE__ */
|
|
5889
|
+
return /* @__PURE__ */ jsx37("div", { className: cn("aviala-datepicker-time", className), role: "group", "aria-label": "\u9009\u62E9\u65F6\u95F4", children: /* @__PURE__ */ jsxs27("div", { className: "aviala-datepicker-time__columns", children: [
|
|
5890
|
+
/* @__PURE__ */ jsx37(
|
|
5931
5891
|
DatePickerTimeWheelColumn,
|
|
5932
5892
|
{
|
|
5933
5893
|
"aria-label": "\u5C0F\u65F6",
|
|
@@ -5936,7 +5896,7 @@ function TimePickerWheels({ value, onChange, className }) {
|
|
|
5936
5896
|
onChange: (hours) => onChange({ ...value, hours })
|
|
5937
5897
|
}
|
|
5938
5898
|
),
|
|
5939
|
-
/* @__PURE__ */
|
|
5899
|
+
/* @__PURE__ */ jsx37(
|
|
5940
5900
|
DatePickerTimeWheelColumn,
|
|
5941
5901
|
{
|
|
5942
5902
|
"aria-label": "\u5206\u949F",
|
|
@@ -5949,22 +5909,7 @@ function TimePickerWheels({ value, onChange, className }) {
|
|
|
5949
5909
|
}
|
|
5950
5910
|
|
|
5951
5911
|
// src/components/date-picker/date-picker.tsx
|
|
5952
|
-
import { Fragment as Fragment4, jsx as
|
|
5953
|
-
function renderSlotIcon6(node) {
|
|
5954
|
-
if (!node) return null;
|
|
5955
|
-
const content = cloneAvialaIconElement(node, {
|
|
5956
|
-
level: "text",
|
|
5957
|
-
biggerSize: true
|
|
5958
|
-
});
|
|
5959
|
-
return /* @__PURE__ */ jsx37(
|
|
5960
|
-
"span",
|
|
5961
|
-
{
|
|
5962
|
-
className: "aviala-datepicker-trigger__slot",
|
|
5963
|
-
style: iconSlotCssVarStyle(node, "--input-slot-icon-size", "text", true),
|
|
5964
|
-
children: content
|
|
5965
|
-
}
|
|
5966
|
-
);
|
|
5967
|
-
}
|
|
5912
|
+
import { Fragment as Fragment4, jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
5968
5913
|
function getInitialViewMonth(mode, singleValue, rangeValue) {
|
|
5969
5914
|
if (mode === "single" && singleValue) return startOfDay(singleValue);
|
|
5970
5915
|
if (mode === "range") {
|
|
@@ -6244,7 +6189,7 @@ function DatePicker(props) {
|
|
|
6244
6189
|
viewMonth
|
|
6245
6190
|
]
|
|
6246
6191
|
);
|
|
6247
|
-
const contextValue =
|
|
6192
|
+
const contextValue = useMemo8(
|
|
6248
6193
|
() => ({
|
|
6249
6194
|
open,
|
|
6250
6195
|
setOpen: handleOpenChange,
|
|
@@ -6288,7 +6233,7 @@ function DatePicker(props) {
|
|
|
6288
6233
|
viewMonth
|
|
6289
6234
|
]
|
|
6290
6235
|
);
|
|
6291
|
-
return /* @__PURE__ */
|
|
6236
|
+
return /* @__PURE__ */ jsx38(DatePickerProvider, { value: contextValue, children: /* @__PURE__ */ jsx38(PopoverPrimitive4.Root, { open, onOpenChange: handleOpenChange, modal: false, children: /* @__PURE__ */ jsx38("div", { className: cn("inline-flex", className), children }) }) });
|
|
6292
6237
|
}
|
|
6293
6238
|
function formatTriggerValue(mode, singleValue, rangeValue, enableTime, timeValue, rangeSeparator) {
|
|
6294
6239
|
if (mode === "single") {
|
|
@@ -6380,7 +6325,7 @@ var DatePickerTrigger = forwardRef27(
|
|
|
6380
6325
|
const showEditableInput = editable && displayValue == null;
|
|
6381
6326
|
if (!showEditableInput) {
|
|
6382
6327
|
const hasValue = formatted != null && formatted !== false;
|
|
6383
|
-
return /* @__PURE__ */
|
|
6328
|
+
return /* @__PURE__ */ jsx38(PopoverPrimitive4.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs28(
|
|
6384
6329
|
"button",
|
|
6385
6330
|
{
|
|
6386
6331
|
type: "button",
|
|
@@ -6393,10 +6338,11 @@ var DatePickerTrigger = forwardRef27(
|
|
|
6393
6338
|
"aria-expanded": open,
|
|
6394
6339
|
"aria-haspopup": "dialog",
|
|
6395
6340
|
children: [
|
|
6396
|
-
|
|
6397
|
-
leftIcon ?? /* @__PURE__ */
|
|
6341
|
+
renderSlotIcon(
|
|
6342
|
+
leftIcon ?? /* @__PURE__ */ jsx38(TimeAndDateDate, { level: "text", biggerSize: true, "aria-hidden": true }),
|
|
6343
|
+
"aviala-datepicker-trigger__slot"
|
|
6398
6344
|
),
|
|
6399
|
-
/* @__PURE__ */
|
|
6345
|
+
/* @__PURE__ */ jsx38("span", { className: "aviala-datepicker-trigger__field", children: /* @__PURE__ */ jsx38(
|
|
6400
6346
|
"span",
|
|
6401
6347
|
{
|
|
6402
6348
|
className: cn(
|
|
@@ -6407,12 +6353,12 @@ var DatePickerTrigger = forwardRef27(
|
|
|
6407
6353
|
children: hasValue ? formatted : emptyPlaceholder
|
|
6408
6354
|
}
|
|
6409
6355
|
) }),
|
|
6410
|
-
|
|
6356
|
+
renderSlotIcon(rightIcon, "aviala-datepicker-trigger__slot")
|
|
6411
6357
|
]
|
|
6412
6358
|
}
|
|
6413
6359
|
) });
|
|
6414
6360
|
}
|
|
6415
|
-
return /* @__PURE__ */
|
|
6361
|
+
return /* @__PURE__ */ jsx38(PopoverPrimitive4.Anchor, { asChild: true, children: /* @__PURE__ */ jsxs28(
|
|
6416
6362
|
"div",
|
|
6417
6363
|
{
|
|
6418
6364
|
className: cn("aviala-datepicker-trigger aviala-focus-ring", className),
|
|
@@ -6429,10 +6375,11 @@ var DatePickerTrigger = forwardRef27(
|
|
|
6429
6375
|
openPicker();
|
|
6430
6376
|
},
|
|
6431
6377
|
children: [
|
|
6432
|
-
|
|
6433
|
-
leftIcon ?? /* @__PURE__ */
|
|
6378
|
+
renderSlotIcon(
|
|
6379
|
+
leftIcon ?? /* @__PURE__ */ jsx38(TimeAndDateDate, { level: "text", biggerSize: true, "aria-hidden": true }),
|
|
6380
|
+
"aviala-datepicker-trigger__slot"
|
|
6434
6381
|
),
|
|
6435
|
-
/* @__PURE__ */
|
|
6382
|
+
/* @__PURE__ */ jsx38("span", { className: "aviala-datepicker-trigger__field", children: /* @__PURE__ */ jsx38(
|
|
6436
6383
|
"input",
|
|
6437
6384
|
{
|
|
6438
6385
|
ref: setInputRefs,
|
|
@@ -6452,93 +6399,10 @@ var DatePickerTrigger = forwardRef27(
|
|
|
6452
6399
|
onFocus: (event) => {
|
|
6453
6400
|
editingRef.current = true;
|
|
6454
6401
|
openPicker();
|
|
6455
|
-
{
|
|
6456
|
-
const inputEl = event.currentTarget;
|
|
6457
|
-
const logTriggerStyles = (phase) => {
|
|
6458
|
-
const trigger = inputEl.closest(
|
|
6459
|
-
".aviala-datepicker-trigger"
|
|
6460
|
-
);
|
|
6461
|
-
const cs = trigger ? getComputedStyle(trigger) : null;
|
|
6462
|
-
fetch(
|
|
6463
|
-
"http://127.0.0.1:7374/ingest/ad1201c6-cfe5-466e-96ed-49d0c8840eda",
|
|
6464
|
-
{
|
|
6465
|
-
method: "POST",
|
|
6466
|
-
headers: {
|
|
6467
|
-
"Content-Type": "application/json",
|
|
6468
|
-
"X-Debug-Session-Id": "0f383b"
|
|
6469
|
-
},
|
|
6470
|
-
body: JSON.stringify({
|
|
6471
|
-
sessionId: "0f383b",
|
|
6472
|
-
runId: "pre-fix",
|
|
6473
|
-
hypothesisId: "A-E",
|
|
6474
|
-
location: "date-picker.tsx:DatePickerTrigger.onFocus",
|
|
6475
|
-
message: `trigger styles on input focus (${phase})`,
|
|
6476
|
-
data: {
|
|
6477
|
-
phase,
|
|
6478
|
-
openProp: open,
|
|
6479
|
-
dataState: trigger?.getAttribute("data-state"),
|
|
6480
|
-
matchesFocusWithin: trigger?.matches(":focus-within") ?? null,
|
|
6481
|
-
matchesFocusVisible: trigger?.matches(":focus-visible") ?? null,
|
|
6482
|
-
hasFocusRingClass: trigger?.classList.contains("aviala-focus-ring") ?? null,
|
|
6483
|
-
kbdAttr: document.documentElement.hasAttribute(
|
|
6484
|
-
"data-aviala-kbd"
|
|
6485
|
-
),
|
|
6486
|
-
bg: cs?.backgroundColor ?? null,
|
|
6487
|
-
boxShadow: cs?.boxShadow ?? null,
|
|
6488
|
-
borderColor: cs?.borderColor ?? null,
|
|
6489
|
-
borderWidth: cs?.borderWidth ?? null,
|
|
6490
|
-
activeTag: document.activeElement?.tagName ?? null,
|
|
6491
|
-
activeClass: document.activeElement?.className ?? null
|
|
6492
|
-
},
|
|
6493
|
-
timestamp: Date.now()
|
|
6494
|
-
})
|
|
6495
|
-
}
|
|
6496
|
-
).catch(() => {
|
|
6497
|
-
});
|
|
6498
|
-
};
|
|
6499
|
-
logTriggerStyles("sync");
|
|
6500
|
-
requestAnimationFrame(() => logTriggerStyles("raf"));
|
|
6501
|
-
}
|
|
6502
6402
|
onFocus?.(event);
|
|
6503
6403
|
},
|
|
6504
6404
|
onBlur: (event) => {
|
|
6505
6405
|
editingRef.current = false;
|
|
6506
|
-
{
|
|
6507
|
-
const trigger = event.currentTarget.closest(
|
|
6508
|
-
".aviala-datepicker-trigger"
|
|
6509
|
-
);
|
|
6510
|
-
const cs = trigger ? getComputedStyle(trigger) : null;
|
|
6511
|
-
fetch(
|
|
6512
|
-
"http://127.0.0.1:7374/ingest/ad1201c6-cfe5-466e-96ed-49d0c8840eda",
|
|
6513
|
-
{
|
|
6514
|
-
method: "POST",
|
|
6515
|
-
headers: {
|
|
6516
|
-
"Content-Type": "application/json",
|
|
6517
|
-
"X-Debug-Session-Id": "0f383b"
|
|
6518
|
-
},
|
|
6519
|
-
body: JSON.stringify({
|
|
6520
|
-
sessionId: "0f383b",
|
|
6521
|
-
runId: "pre-fix",
|
|
6522
|
-
hypothesisId: "A-E",
|
|
6523
|
-
location: "date-picker.tsx:DatePickerTrigger.onBlur",
|
|
6524
|
-
message: "trigger styles on input blur",
|
|
6525
|
-
data: {
|
|
6526
|
-
openProp: open,
|
|
6527
|
-
dataState: trigger?.getAttribute("data-state"),
|
|
6528
|
-
matchesFocusWithin: trigger?.matches(":focus-within") ?? null,
|
|
6529
|
-
kbdAttr: document.documentElement.hasAttribute(
|
|
6530
|
-
"data-aviala-kbd"
|
|
6531
|
-
),
|
|
6532
|
-
bg: cs?.backgroundColor ?? null,
|
|
6533
|
-
boxShadow: cs?.boxShadow ?? null,
|
|
6534
|
-
relatedTargetTag: event.relatedTarget?.tagName ?? null
|
|
6535
|
-
},
|
|
6536
|
-
timestamp: Date.now()
|
|
6537
|
-
})
|
|
6538
|
-
}
|
|
6539
|
-
).catch(() => {
|
|
6540
|
-
});
|
|
6541
|
-
}
|
|
6542
6406
|
window.setTimeout(() => {
|
|
6543
6407
|
const active = document.activeElement;
|
|
6544
6408
|
if (active?.closest(
|
|
@@ -6568,7 +6432,7 @@ var DatePickerTrigger = forwardRef27(
|
|
|
6568
6432
|
...props
|
|
6569
6433
|
}
|
|
6570
6434
|
) }),
|
|
6571
|
-
|
|
6435
|
+
renderSlotIcon(rightIcon, "aviala-datepicker-trigger__slot")
|
|
6572
6436
|
]
|
|
6573
6437
|
}
|
|
6574
6438
|
) });
|
|
@@ -6584,7 +6448,7 @@ var DatePickerContent = forwardRef27(
|
|
|
6584
6448
|
align = "start",
|
|
6585
6449
|
...props
|
|
6586
6450
|
}, ref) => {
|
|
6587
|
-
const content = /* @__PURE__ */
|
|
6451
|
+
const content = /* @__PURE__ */ jsx38(
|
|
6588
6452
|
PopoverPrimitive4.Content,
|
|
6589
6453
|
{
|
|
6590
6454
|
ref,
|
|
@@ -6592,11 +6456,11 @@ var DatePickerContent = forwardRef27(
|
|
|
6592
6456
|
sideOffset,
|
|
6593
6457
|
align,
|
|
6594
6458
|
...props,
|
|
6595
|
-
children: children ?? /* @__PURE__ */
|
|
6459
|
+
children: children ?? /* @__PURE__ */ jsx38(DatePickerCalendar, {})
|
|
6596
6460
|
}
|
|
6597
6461
|
);
|
|
6598
6462
|
if (!portalled) return content;
|
|
6599
|
-
return /* @__PURE__ */
|
|
6463
|
+
return /* @__PURE__ */ jsx38(PopoverPrimitive4.Portal, { children: content });
|
|
6600
6464
|
}
|
|
6601
6465
|
);
|
|
6602
6466
|
DatePickerContent.displayName = "DatePickerContent";
|
|
@@ -6614,7 +6478,7 @@ function getFooterDateLabel(mode, singleValue, rangeValue) {
|
|
|
6614
6478
|
}
|
|
6615
6479
|
function DatePickerTimePanel() {
|
|
6616
6480
|
const { timeValue, setTimeValue } = useDatePickerContext();
|
|
6617
|
-
return /* @__PURE__ */
|
|
6481
|
+
return /* @__PURE__ */ jsx38(TimePickerWheels, { value: timeValue, onChange: setTimeValue });
|
|
6618
6482
|
}
|
|
6619
6483
|
function DatePickerPanelFooter() {
|
|
6620
6484
|
const {
|
|
@@ -6629,7 +6493,7 @@ function DatePickerPanelFooter() {
|
|
|
6629
6493
|
if (!enableTime) return null;
|
|
6630
6494
|
const panelValue = activePanel === "time" ? "time" : "date";
|
|
6631
6495
|
const isRangeMode = mode === "range";
|
|
6632
|
-
return /* @__PURE__ */
|
|
6496
|
+
return /* @__PURE__ */ jsx38("div", { className: "aviala-datepicker-footer-wrap", children: /* @__PURE__ */ jsxs28(
|
|
6633
6497
|
SegmentatorGroup,
|
|
6634
6498
|
{
|
|
6635
6499
|
value: panelValue,
|
|
@@ -6640,20 +6504,20 @@ function DatePickerPanelFooter() {
|
|
|
6640
6504
|
"data-active-panel": activePanel,
|
|
6641
6505
|
"aria-label": "\u65E5\u671F\u4E0E\u65F6\u95F4\u5207\u6362",
|
|
6642
6506
|
children: [
|
|
6643
|
-
/* @__PURE__ */
|
|
6507
|
+
/* @__PURE__ */ jsx38(
|
|
6644
6508
|
SegmentatorItem,
|
|
6645
6509
|
{
|
|
6646
6510
|
value: "date",
|
|
6647
|
-
leftIcon: /* @__PURE__ */
|
|
6511
|
+
leftIcon: /* @__PURE__ */ jsx38(TimeAndDateDate, { level: "text", biggerSize: true, "aria-hidden": true }),
|
|
6648
6512
|
iconOnly: isRangeMode && panelValue === "time",
|
|
6649
6513
|
children: getFooterDateLabel(mode, singleValue, rangeValue)
|
|
6650
6514
|
}
|
|
6651
6515
|
),
|
|
6652
|
-
/* @__PURE__ */
|
|
6516
|
+
/* @__PURE__ */ jsx38(
|
|
6653
6517
|
SegmentatorItem,
|
|
6654
6518
|
{
|
|
6655
6519
|
value: "time",
|
|
6656
|
-
leftIcon: /* @__PURE__ */
|
|
6520
|
+
leftIcon: /* @__PURE__ */ jsx38(TimeAndDateClock, { level: "text", biggerSize: true, "aria-hidden": true }),
|
|
6657
6521
|
iconOnly: isRangeMode && panelValue === "date",
|
|
6658
6522
|
children: formatTimeValue(timeValue.hours, timeValue.minutes)
|
|
6659
6523
|
}
|
|
@@ -6685,8 +6549,8 @@ function DatePickerCalendar({ className }) {
|
|
|
6685
6549
|
setActivePanel,
|
|
6686
6550
|
enableTime
|
|
6687
6551
|
} = useDatePickerContext();
|
|
6688
|
-
const today =
|
|
6689
|
-
const days =
|
|
6552
|
+
const today = useMemo8(() => startOfDay(/* @__PURE__ */ new Date()), []);
|
|
6553
|
+
const days = useMemo8(() => getCalendarDays(viewMonth), [viewMonth]);
|
|
6690
6554
|
const prevViewMonthRef = useRef9(viewMonth);
|
|
6691
6555
|
const dayGridRef = useRef9(null);
|
|
6692
6556
|
const pendingDayFocusRef = useRef9(false);
|
|
@@ -6757,7 +6621,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6757
6621
|
pendingDayFocusRef.current = false;
|
|
6758
6622
|
target.focus();
|
|
6759
6623
|
}, [focusedDay, days, monthSlide]);
|
|
6760
|
-
const outgoingDays =
|
|
6624
|
+
const outgoingDays = useMemo8(
|
|
6761
6625
|
() => monthSlide ? getCalendarDays(monthSlide.outgoingMonth) : null,
|
|
6762
6626
|
[monthSlide]
|
|
6763
6627
|
);
|
|
@@ -6822,7 +6686,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6822
6686
|
};
|
|
6823
6687
|
const stepMonth = isMonthPanel ? 12 : 1;
|
|
6824
6688
|
const renderDateContent = () => /* @__PURE__ */ jsxs28(Fragment4, { children: [
|
|
6825
|
-
/* @__PURE__ */
|
|
6689
|
+
/* @__PURE__ */ jsx38("div", { className: "aviala-datepicker-calendar__weekdays", "aria-hidden": true, children: WEEKDAY_LABELS.map((label) => /* @__PURE__ */ jsx38(
|
|
6826
6690
|
"span",
|
|
6827
6691
|
{
|
|
6828
6692
|
className: cn(
|
|
@@ -6834,7 +6698,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6834
6698
|
label
|
|
6835
6699
|
)) }),
|
|
6836
6700
|
/* @__PURE__ */ jsxs28("div", { className: "aviala-datepicker-calendar__grid-viewport", children: [
|
|
6837
|
-
monthSlide && outgoingDays ? /* @__PURE__ */
|
|
6701
|
+
monthSlide && outgoingDays ? /* @__PURE__ */ jsx38(
|
|
6838
6702
|
"div",
|
|
6839
6703
|
{
|
|
6840
6704
|
className: "aviala-datepicker-calendar__grid",
|
|
@@ -6843,12 +6707,12 @@ function DatePickerCalendar({ className }) {
|
|
|
6843
6707
|
"aria-hidden": true,
|
|
6844
6708
|
children: outgoingDays.map((day) => {
|
|
6845
6709
|
const outside = !isSameMonth(day, monthSlide.outgoingMonth);
|
|
6846
|
-
return /* @__PURE__ */
|
|
6710
|
+
return /* @__PURE__ */ jsx38(
|
|
6847
6711
|
"span",
|
|
6848
6712
|
{
|
|
6849
6713
|
className: "aviala-datepicker-day",
|
|
6850
6714
|
"data-outside": outside ? "true" : void 0,
|
|
6851
|
-
children: /* @__PURE__ */
|
|
6715
|
+
children: /* @__PURE__ */ jsx38(
|
|
6852
6716
|
"span",
|
|
6853
6717
|
{
|
|
6854
6718
|
className: cn(
|
|
@@ -6865,7 +6729,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6865
6729
|
},
|
|
6866
6730
|
`out-${monthSlide.outgoingMonth.getFullYear()}-${monthSlide.outgoingMonth.getMonth()}`
|
|
6867
6731
|
) : null,
|
|
6868
|
-
/* @__PURE__ */
|
|
6732
|
+
/* @__PURE__ */ jsx38(
|
|
6869
6733
|
"div",
|
|
6870
6734
|
{
|
|
6871
6735
|
ref: dayGridRef,
|
|
@@ -6911,7 +6775,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6911
6775
|
onFocus: () => setFocusedDay(day),
|
|
6912
6776
|
onKeyDown: (event) => handleDayKeyDown(event, day),
|
|
6913
6777
|
children: [
|
|
6914
|
-
/* @__PURE__ */
|
|
6778
|
+
/* @__PURE__ */ jsx38(
|
|
6915
6779
|
"span",
|
|
6916
6780
|
{
|
|
6917
6781
|
className: cn(
|
|
@@ -6921,7 +6785,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6921
6785
|
children: day.getDate()
|
|
6922
6786
|
}
|
|
6923
6787
|
),
|
|
6924
|
-
isToday ? /* @__PURE__ */
|
|
6788
|
+
isToday ? /* @__PURE__ */ jsx38("span", { className: "aviala-datepicker-day__today-dot", "aria-hidden": true }) : null
|
|
6925
6789
|
]
|
|
6926
6790
|
},
|
|
6927
6791
|
dayKey
|
|
@@ -6932,20 +6796,20 @@ function DatePickerCalendar({ className }) {
|
|
|
6932
6796
|
)
|
|
6933
6797
|
] })
|
|
6934
6798
|
] });
|
|
6935
|
-
const renderContentView = (view) => view === "month" ? /* @__PURE__ */
|
|
6799
|
+
const renderContentView = (view) => view === "month" ? /* @__PURE__ */ jsx38(DatePickerMonthYearWheels, { layoutKey: monthWheelLayoutKey }) : renderDateContent();
|
|
6936
6800
|
const renderDatePanel = () => /* @__PURE__ */ jsxs28(Fragment4, { children: [
|
|
6937
6801
|
/* @__PURE__ */ jsxs28("div", { className: "aviala-datepicker-calendar__header", children: [
|
|
6938
|
-
/* @__PURE__ */
|
|
6802
|
+
/* @__PURE__ */ jsx38(
|
|
6939
6803
|
"button",
|
|
6940
6804
|
{
|
|
6941
6805
|
type: "button",
|
|
6942
6806
|
className: "aviala-datepicker-calendar__nav aviala-focus-ring",
|
|
6943
6807
|
"aria-label": isMonthPanel ? "Previous year" : "Previous month",
|
|
6944
6808
|
onClick: () => setViewMonth(addMonths(viewMonth, -stepMonth)),
|
|
6945
|
-
children: /* @__PURE__ */
|
|
6809
|
+
children: /* @__PURE__ */ jsx38(DirectionArrowLeft, { level: "text", biggerSize: true, "aria-hidden": true })
|
|
6946
6810
|
}
|
|
6947
6811
|
),
|
|
6948
|
-
/* @__PURE__ */
|
|
6812
|
+
/* @__PURE__ */ jsx38(
|
|
6949
6813
|
"button",
|
|
6950
6814
|
{
|
|
6951
6815
|
type: "button",
|
|
@@ -6958,7 +6822,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6958
6822
|
"aria-expanded": isMonthPanel,
|
|
6959
6823
|
"aria-label": isMonthPanel ? "\u5173\u95ED\u5E74\u6708\u9009\u62E9" : "\u9009\u62E9\u5E74\u6708",
|
|
6960
6824
|
onClick: () => setActivePanel(isMonthPanel ? "date" : "month"),
|
|
6961
|
-
children: /* @__PURE__ */
|
|
6825
|
+
children: /* @__PURE__ */ jsx38(
|
|
6962
6826
|
"span",
|
|
6963
6827
|
{
|
|
6964
6828
|
className: "aviala-datepicker-calendar__title-text",
|
|
@@ -6969,19 +6833,19 @@ function DatePickerCalendar({ className }) {
|
|
|
6969
6833
|
)
|
|
6970
6834
|
}
|
|
6971
6835
|
),
|
|
6972
|
-
/* @__PURE__ */
|
|
6836
|
+
/* @__PURE__ */ jsx38(
|
|
6973
6837
|
"button",
|
|
6974
6838
|
{
|
|
6975
6839
|
type: "button",
|
|
6976
6840
|
className: "aviala-datepicker-calendar__nav aviala-focus-ring",
|
|
6977
6841
|
"aria-label": isMonthPanel ? "Next year" : "Next month",
|
|
6978
6842
|
onClick: () => setViewMonth(addMonths(viewMonth, stepMonth)),
|
|
6979
|
-
children: /* @__PURE__ */
|
|
6843
|
+
children: /* @__PURE__ */ jsx38(DirectionArrowRight2, { level: "text", biggerSize: true, "aria-hidden": true })
|
|
6980
6844
|
}
|
|
6981
6845
|
)
|
|
6982
6846
|
] }),
|
|
6983
6847
|
/* @__PURE__ */ jsxs28("div", { className: "aviala-datepicker-calendar__view-viewport", children: [
|
|
6984
|
-
viewCrossfade ? /* @__PURE__ */
|
|
6848
|
+
viewCrossfade ? /* @__PURE__ */ jsx38(
|
|
6985
6849
|
"div",
|
|
6986
6850
|
{
|
|
6987
6851
|
className: "aviala-datepicker-calendar__view",
|
|
@@ -6992,7 +6856,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6992
6856
|
},
|
|
6993
6857
|
`exit-${viewCrossfade.outgoing}`
|
|
6994
6858
|
) : null,
|
|
6995
|
-
/* @__PURE__ */
|
|
6859
|
+
/* @__PURE__ */ jsx38(
|
|
6996
6860
|
"div",
|
|
6997
6861
|
{
|
|
6998
6862
|
className: "aviala-datepicker-calendar__view",
|
|
@@ -7013,7 +6877,7 @@ function DatePickerCalendar({ className }) {
|
|
|
7013
6877
|
)
|
|
7014
6878
|
] })
|
|
7015
6879
|
] });
|
|
7016
|
-
const renderPanel = (kind) => kind === "time" ? /* @__PURE__ */
|
|
6880
|
+
const renderPanel = (kind) => kind === "time" ? /* @__PURE__ */ jsx38(DatePickerTimePanel, {}) : renderDatePanel();
|
|
7017
6881
|
return /* @__PURE__ */ jsxs28(
|
|
7018
6882
|
"div",
|
|
7019
6883
|
{
|
|
@@ -7022,7 +6886,7 @@ function DatePickerCalendar({ className }) {
|
|
|
7022
6886
|
"aria-label": "Calendar",
|
|
7023
6887
|
children: [
|
|
7024
6888
|
/* @__PURE__ */ jsxs28("div", { className: "aviala-datepicker-calendar__panel-viewport", children: [
|
|
7025
|
-
panelSlide ? /* @__PURE__ */
|
|
6889
|
+
panelSlide ? /* @__PURE__ */ jsx38(
|
|
7026
6890
|
"div",
|
|
7027
6891
|
{
|
|
7028
6892
|
className: "aviala-datepicker-calendar__panel aviala-datepicker-calendar__body",
|
|
@@ -7034,7 +6898,7 @@ function DatePickerCalendar({ className }) {
|
|
|
7034
6898
|
},
|
|
7035
6899
|
`panel-exit-${panelSlide.outgoing}`
|
|
7036
6900
|
) : null,
|
|
7037
|
-
/* @__PURE__ */
|
|
6901
|
+
/* @__PURE__ */ jsx38(
|
|
7038
6902
|
"div",
|
|
7039
6903
|
{
|
|
7040
6904
|
className: "aviala-datepicker-calendar__panel aviala-datepicker-calendar__body",
|
|
@@ -7052,7 +6916,7 @@ function DatePickerCalendar({ className }) {
|
|
|
7052
6916
|
`panel-enter-${panel}`
|
|
7053
6917
|
)
|
|
7054
6918
|
] }),
|
|
7055
|
-
/* @__PURE__ */
|
|
6919
|
+
/* @__PURE__ */ jsx38(DatePickerPanelFooter, {})
|
|
7056
6920
|
]
|
|
7057
6921
|
}
|
|
7058
6922
|
);
|
|
@@ -7117,7 +6981,7 @@ function DatePickerField({
|
|
|
7117
6981
|
onTimeChange
|
|
7118
6982
|
};
|
|
7119
6983
|
return /* @__PURE__ */ jsxs28(DatePicker, { ...pickerProps, size, className, children: [
|
|
7120
|
-
/* @__PURE__ */
|
|
6984
|
+
/* @__PURE__ */ jsx38(
|
|
7121
6985
|
DatePickerTrigger,
|
|
7122
6986
|
{
|
|
7123
6987
|
size,
|
|
@@ -7131,7 +6995,7 @@ function DatePickerField({
|
|
|
7131
6995
|
editable
|
|
7132
6996
|
}
|
|
7133
6997
|
),
|
|
7134
|
-
/* @__PURE__ */
|
|
6998
|
+
/* @__PURE__ */ jsx38(DatePickerContent, { className: contentClassName, children: /* @__PURE__ */ jsx38(DatePickerCalendar, { className: calendarClassName }) })
|
|
7135
6999
|
] });
|
|
7136
7000
|
}
|
|
7137
7001
|
|
|
@@ -7142,20 +7006,20 @@ import {
|
|
|
7142
7006
|
forwardRef as forwardRef28,
|
|
7143
7007
|
useCallback as useCallback13,
|
|
7144
7008
|
useEffect as useEffect8,
|
|
7145
|
-
useMemo as
|
|
7009
|
+
useMemo as useMemo9,
|
|
7146
7010
|
useRef as useRef10,
|
|
7147
7011
|
useState as useState12
|
|
7148
7012
|
} from "react";
|
|
7149
7013
|
|
|
7150
7014
|
// src/components/time-picker/time-picker-context.tsx
|
|
7151
7015
|
import { createContext as createContext7, useContext as useContext7 } from "react";
|
|
7152
|
-
import { jsx as
|
|
7016
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
7153
7017
|
var TimePickerContext = createContext7(null);
|
|
7154
7018
|
function TimePickerProvider({
|
|
7155
7019
|
value,
|
|
7156
7020
|
children
|
|
7157
7021
|
}) {
|
|
7158
|
-
return /* @__PURE__ */
|
|
7022
|
+
return /* @__PURE__ */ jsx39(TimePickerContext.Provider, { value, children });
|
|
7159
7023
|
}
|
|
7160
7024
|
function useTimePickerContext() {
|
|
7161
7025
|
const context = useContext7(TimePickerContext);
|
|
@@ -7166,22 +7030,7 @@ function useTimePickerContext() {
|
|
|
7166
7030
|
}
|
|
7167
7031
|
|
|
7168
7032
|
// src/components/time-picker/time-picker.tsx
|
|
7169
|
-
import { jsx as
|
|
7170
|
-
function renderSlotIcon7(node) {
|
|
7171
|
-
if (!node) return null;
|
|
7172
|
-
const content = cloneAvialaIconElement(node, {
|
|
7173
|
-
level: "text",
|
|
7174
|
-
biggerSize: true
|
|
7175
|
-
});
|
|
7176
|
-
return /* @__PURE__ */ jsx39(
|
|
7177
|
-
"span",
|
|
7178
|
-
{
|
|
7179
|
-
className: "aviala-timepicker-trigger__slot",
|
|
7180
|
-
style: iconSlotCssVarStyle(node, "--input-slot-icon-size", "text", true),
|
|
7181
|
-
children: content
|
|
7182
|
-
}
|
|
7183
|
-
);
|
|
7184
|
-
}
|
|
7033
|
+
import { jsx as jsx40, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
7185
7034
|
function TimePicker({
|
|
7186
7035
|
children,
|
|
7187
7036
|
value: valueProp,
|
|
@@ -7244,7 +7093,7 @@ function TimePicker({
|
|
|
7244
7093
|
},
|
|
7245
7094
|
[disabled, isOpenControlled, onOpenChange]
|
|
7246
7095
|
);
|
|
7247
|
-
const contextValue =
|
|
7096
|
+
const contextValue = useMemo9(
|
|
7248
7097
|
() => ({
|
|
7249
7098
|
open,
|
|
7250
7099
|
disabled,
|
|
@@ -7254,7 +7103,7 @@ function TimePicker({
|
|
|
7254
7103
|
}),
|
|
7255
7104
|
[disabled, open, size, value, setValue]
|
|
7256
7105
|
);
|
|
7257
|
-
return /* @__PURE__ */
|
|
7106
|
+
return /* @__PURE__ */ jsx40(TimePickerProvider, { value: contextValue, children: /* @__PURE__ */ jsx40(PopoverPrimitive5.Root, { open, onOpenChange: handleOpenChange, modal: false, children: /* @__PURE__ */ jsx40("div", { className: cn("inline-flex", className), children }) }) });
|
|
7258
7107
|
}
|
|
7259
7108
|
var TimePickerTrigger = forwardRef28(
|
|
7260
7109
|
({
|
|
@@ -7274,7 +7123,7 @@ var TimePickerTrigger = forwardRef28(
|
|
|
7274
7123
|
const disabled = disabledProp ?? disabledContext;
|
|
7275
7124
|
const formatted = displayValue !== void 0 ? displayValue : formatTimeValue(value.hours, value.minutes);
|
|
7276
7125
|
const hasValue = formatted != null && formatted !== "";
|
|
7277
|
-
return /* @__PURE__ */
|
|
7126
|
+
return /* @__PURE__ */ jsx40(PopoverPrimitive5.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs29(
|
|
7278
7127
|
"button",
|
|
7279
7128
|
{
|
|
7280
7129
|
ref,
|
|
@@ -7289,10 +7138,11 @@ var TimePickerTrigger = forwardRef28(
|
|
|
7289
7138
|
"aria-haspopup": "dialog",
|
|
7290
7139
|
...props,
|
|
7291
7140
|
children: [
|
|
7292
|
-
|
|
7293
|
-
leftIcon ?? /* @__PURE__ */
|
|
7141
|
+
renderSlotIcon(
|
|
7142
|
+
leftIcon ?? /* @__PURE__ */ jsx40(TimeAndDateClock2, { level: "text", biggerSize: true, "aria-hidden": true }),
|
|
7143
|
+
"aviala-timepicker-trigger__slot"
|
|
7294
7144
|
),
|
|
7295
|
-
/* @__PURE__ */
|
|
7145
|
+
/* @__PURE__ */ jsx40("span", { className: "aviala-timepicker-trigger__field", children: /* @__PURE__ */ jsx40(
|
|
7296
7146
|
"span",
|
|
7297
7147
|
{
|
|
7298
7148
|
className: cn(
|
|
@@ -7303,7 +7153,7 @@ var TimePickerTrigger = forwardRef28(
|
|
|
7303
7153
|
children: hasValue ? formatted : placeholder
|
|
7304
7154
|
}
|
|
7305
7155
|
) }),
|
|
7306
|
-
|
|
7156
|
+
renderSlotIcon(rightIcon, "aviala-timepicker-trigger__slot")
|
|
7307
7157
|
]
|
|
7308
7158
|
}
|
|
7309
7159
|
) });
|
|
@@ -7319,7 +7169,7 @@ var TimePickerContent = forwardRef28(
|
|
|
7319
7169
|
align = "start",
|
|
7320
7170
|
...props
|
|
7321
7171
|
}, ref) => {
|
|
7322
|
-
const content = /* @__PURE__ */
|
|
7172
|
+
const content = /* @__PURE__ */ jsx40(
|
|
7323
7173
|
PopoverPrimitive5.Content,
|
|
7324
7174
|
{
|
|
7325
7175
|
ref,
|
|
@@ -7327,17 +7177,17 @@ var TimePickerContent = forwardRef28(
|
|
|
7327
7177
|
sideOffset,
|
|
7328
7178
|
align,
|
|
7329
7179
|
...props,
|
|
7330
|
-
children: children ?? /* @__PURE__ */
|
|
7180
|
+
children: children ?? /* @__PURE__ */ jsx40(TimePickerPanel, {})
|
|
7331
7181
|
}
|
|
7332
7182
|
);
|
|
7333
7183
|
if (!portalled) return content;
|
|
7334
|
-
return /* @__PURE__ */
|
|
7184
|
+
return /* @__PURE__ */ jsx40(PopoverPrimitive5.Portal, { children: content });
|
|
7335
7185
|
}
|
|
7336
7186
|
);
|
|
7337
7187
|
TimePickerContent.displayName = "TimePickerContent";
|
|
7338
7188
|
function TimePickerPanel({ className }) {
|
|
7339
7189
|
const { value, setValue } = useTimePickerContext();
|
|
7340
|
-
return /* @__PURE__ */
|
|
7190
|
+
return /* @__PURE__ */ jsx40("div", { className: cn("aviala-timepicker-panel", className), role: "application", "aria-label": "Time picker", children: /* @__PURE__ */ jsx40(TimePickerWheels, { value, onChange: setValue }) });
|
|
7341
7191
|
}
|
|
7342
7192
|
function TimePickerField({
|
|
7343
7193
|
contentClassName,
|
|
@@ -7370,7 +7220,7 @@ function TimePickerField({
|
|
|
7370
7220
|
size,
|
|
7371
7221
|
className,
|
|
7372
7222
|
children: [
|
|
7373
|
-
/* @__PURE__ */
|
|
7223
|
+
/* @__PURE__ */ jsx40(
|
|
7374
7224
|
TimePickerTrigger,
|
|
7375
7225
|
{
|
|
7376
7226
|
size,
|
|
@@ -7381,7 +7231,7 @@ function TimePickerField({
|
|
|
7381
7231
|
error
|
|
7382
7232
|
}
|
|
7383
7233
|
),
|
|
7384
|
-
/* @__PURE__ */
|
|
7234
|
+
/* @__PURE__ */ jsx40(TimePickerContent, { className: contentClassName, children: /* @__PURE__ */ jsx40(TimePickerPanel, { className: panelClassName }) })
|
|
7385
7235
|
]
|
|
7386
7236
|
}
|
|
7387
7237
|
);
|
|
@@ -7392,13 +7242,11 @@ import * as PopoverPrimitive6 from "@radix-ui/react-popover";
|
|
|
7392
7242
|
import {
|
|
7393
7243
|
forwardRef as forwardRef29,
|
|
7394
7244
|
useCallback as useCallback14,
|
|
7395
|
-
useEffect as useEffect9,
|
|
7396
|
-
useRef as useRef11,
|
|
7397
7245
|
useState as useState13
|
|
7398
7246
|
} from "react";
|
|
7399
7247
|
|
|
7400
7248
|
// src/components/overlay-pointer.tsx
|
|
7401
|
-
import { Fragment as Fragment5, jsx as
|
|
7249
|
+
import { Fragment as Fragment5, jsx as jsx41, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
7402
7250
|
var TOOLTIP_POINTER = {
|
|
7403
7251
|
width: 14,
|
|
7404
7252
|
height: 5,
|
|
@@ -7419,7 +7267,7 @@ function OverlayPointerSvg({
|
|
|
7419
7267
|
...props
|
|
7420
7268
|
}) {
|
|
7421
7269
|
const isPopover = variant === "popover";
|
|
7422
|
-
return /* @__PURE__ */
|
|
7270
|
+
return /* @__PURE__ */ jsx41(
|
|
7423
7271
|
"svg",
|
|
7424
7272
|
{
|
|
7425
7273
|
...props,
|
|
@@ -7433,15 +7281,15 @@ function OverlayPointerSvg({
|
|
|
7433
7281
|
className,
|
|
7434
7282
|
style: { ...style, width, height },
|
|
7435
7283
|
children: isPopover ? /* @__PURE__ */ jsxs30(Fragment5, { children: [
|
|
7436
|
-
/* @__PURE__ */
|
|
7437
|
-
/* @__PURE__ */
|
|
7438
|
-
] }) : /* @__PURE__ */
|
|
7284
|
+
/* @__PURE__ */ jsx41("path", { d: path, className: "aviala-popover-content__arrow-outline" }),
|
|
7285
|
+
/* @__PURE__ */ jsx41("path", { d: path, className: "aviala-popover-content__arrow-fill" })
|
|
7286
|
+
] }) : /* @__PURE__ */ jsx41("path", { d: path })
|
|
7439
7287
|
}
|
|
7440
7288
|
);
|
|
7441
7289
|
}
|
|
7442
7290
|
|
|
7443
7291
|
// src/components/popover.tsx
|
|
7444
|
-
import { jsx as
|
|
7292
|
+
import { jsx as jsx42, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
7445
7293
|
function Popover({
|
|
7446
7294
|
open: openProp,
|
|
7447
7295
|
defaultOpen = false,
|
|
@@ -7452,42 +7300,14 @@ function Popover({
|
|
|
7452
7300
|
const [internalOpen, setInternalOpen] = useState13(defaultOpen);
|
|
7453
7301
|
const isControlled = openProp !== void 0;
|
|
7454
7302
|
const open = isControlled ? openProp : internalOpen;
|
|
7455
|
-
const windowBlurCloseRef = useRef11(false);
|
|
7456
|
-
const pointerDownCloseRef = useRef11(false);
|
|
7457
|
-
useEffect9(() => {
|
|
7458
|
-
const markWindowBlur = () => {
|
|
7459
|
-
windowBlurCloseRef.current = true;
|
|
7460
|
-
};
|
|
7461
|
-
window.addEventListener("blur", markWindowBlur, true);
|
|
7462
|
-
return () => window.removeEventListener("blur", markWindowBlur, true);
|
|
7463
|
-
}, []);
|
|
7464
|
-
useEffect9(() => {
|
|
7465
|
-
if (!open) {
|
|
7466
|
-
pointerDownCloseRef.current = false;
|
|
7467
|
-
return;
|
|
7468
|
-
}
|
|
7469
|
-
const markPointerDown = () => {
|
|
7470
|
-
pointerDownCloseRef.current = true;
|
|
7471
|
-
};
|
|
7472
|
-
document.addEventListener("pointerdown", markPointerDown, true);
|
|
7473
|
-
return () => document.removeEventListener("pointerdown", markPointerDown, true);
|
|
7474
|
-
}, [open]);
|
|
7475
7303
|
const handleOpenChange = useCallback14(
|
|
7476
7304
|
(nextOpen) => {
|
|
7477
|
-
if (!nextOpen
|
|
7478
|
-
windowBlurCloseRef.current = false;
|
|
7479
|
-
return;
|
|
7480
|
-
}
|
|
7481
|
-
windowBlurCloseRef.current = false;
|
|
7482
|
-
pointerDownCloseRef.current = false;
|
|
7483
|
-
if (!isControlled) {
|
|
7484
|
-
setInternalOpen(nextOpen);
|
|
7485
|
-
}
|
|
7305
|
+
if (!isControlled) setInternalOpen(nextOpen);
|
|
7486
7306
|
onOpenChange?.(nextOpen);
|
|
7487
7307
|
},
|
|
7488
7308
|
[isControlled, onOpenChange]
|
|
7489
7309
|
);
|
|
7490
|
-
return /* @__PURE__ */
|
|
7310
|
+
return /* @__PURE__ */ jsx42(
|
|
7491
7311
|
PopoverPrimitive6.Root,
|
|
7492
7312
|
{
|
|
7493
7313
|
open,
|
|
@@ -7508,8 +7328,13 @@ var PopoverContent = forwardRef29(
|
|
|
7508
7328
|
collisionPadding = 8,
|
|
7509
7329
|
portalled = true,
|
|
7510
7330
|
showArrow = false,
|
|
7331
|
+
flush = false,
|
|
7332
|
+
appearance = "default",
|
|
7511
7333
|
...props
|
|
7512
7334
|
}, ref) => {
|
|
7335
|
+
const isDefaultAppearance = appearance === "default";
|
|
7336
|
+
const surfaceLevel = appearance === "tooltip" ? "caption" : "text";
|
|
7337
|
+
const pointer = isDefaultAppearance ? POPOVER_POINTER : TOOLTIP_POINTER;
|
|
7513
7338
|
const content = /* @__PURE__ */ jsxs31(
|
|
7514
7339
|
PopoverPrimitive6.Content,
|
|
7515
7340
|
{
|
|
@@ -7517,24 +7342,35 @@ var PopoverContent = forwardRef29(
|
|
|
7517
7342
|
align,
|
|
7518
7343
|
sideOffset,
|
|
7519
7344
|
collisionPadding,
|
|
7345
|
+
"data-appearance": appearance,
|
|
7520
7346
|
className: cn("aviala-popover-content", className),
|
|
7521
7347
|
...props,
|
|
7522
7348
|
children: [
|
|
7523
|
-
/* @__PURE__ */
|
|
7524
|
-
|
|
7349
|
+
/* @__PURE__ */ jsx42(
|
|
7350
|
+
"div",
|
|
7351
|
+
{
|
|
7352
|
+
className: cn(
|
|
7353
|
+
"aviala-popover-content__surface",
|
|
7354
|
+
typographyVariants({ level: surfaceLevel })
|
|
7355
|
+
),
|
|
7356
|
+
"data-flush": flush ? "true" : void 0,
|
|
7357
|
+
children
|
|
7358
|
+
}
|
|
7359
|
+
),
|
|
7360
|
+
showArrow ? /* @__PURE__ */ jsx42(
|
|
7525
7361
|
PopoverPrimitive6.Arrow,
|
|
7526
7362
|
{
|
|
7527
7363
|
asChild: true,
|
|
7528
|
-
width:
|
|
7529
|
-
height:
|
|
7530
|
-
children: /* @__PURE__ */
|
|
7364
|
+
width: pointer.width,
|
|
7365
|
+
height: pointer.height,
|
|
7366
|
+
children: /* @__PURE__ */ jsx42(
|
|
7531
7367
|
OverlayPointerSvg,
|
|
7532
7368
|
{
|
|
7533
|
-
variant: "popover",
|
|
7369
|
+
variant: isDefaultAppearance ? "popover" : "default",
|
|
7534
7370
|
className: "aviala-popover-content__arrow",
|
|
7535
|
-
width:
|
|
7536
|
-
height:
|
|
7537
|
-
path:
|
|
7371
|
+
width: pointer.width,
|
|
7372
|
+
height: pointer.height,
|
|
7373
|
+
path: pointer.path
|
|
7538
7374
|
}
|
|
7539
7375
|
)
|
|
7540
7376
|
}
|
|
@@ -7543,11 +7379,140 @@ var PopoverContent = forwardRef29(
|
|
|
7543
7379
|
}
|
|
7544
7380
|
);
|
|
7545
7381
|
if (!portalled) return content;
|
|
7546
|
-
return /* @__PURE__ */
|
|
7382
|
+
return /* @__PURE__ */ jsx42(PopoverPrimitive6.Portal, { children: content });
|
|
7547
7383
|
}
|
|
7548
7384
|
);
|
|
7549
7385
|
PopoverContent.displayName = PopoverPrimitive6.Content.displayName;
|
|
7550
7386
|
|
|
7387
|
+
// src/components/hover-popover.tsx
|
|
7388
|
+
import {
|
|
7389
|
+
useCallback as useCallback15,
|
|
7390
|
+
useEffect as useEffect10,
|
|
7391
|
+
useRef as useRef11,
|
|
7392
|
+
useState as useState15
|
|
7393
|
+
} from "react";
|
|
7394
|
+
|
|
7395
|
+
// src/components/use-coarse-pointer.ts
|
|
7396
|
+
import { useEffect as useEffect9, useState as useState14 } from "react";
|
|
7397
|
+
function useCoarsePointer() {
|
|
7398
|
+
const [coarse, setCoarse] = useState14(false);
|
|
7399
|
+
useEffect9(() => {
|
|
7400
|
+
if (typeof window === "undefined" || !window.matchMedia) return;
|
|
7401
|
+
const mq = window.matchMedia("(pointer: coarse)");
|
|
7402
|
+
const update = () => setCoarse(mq.matches);
|
|
7403
|
+
update();
|
|
7404
|
+
mq.addEventListener("change", update);
|
|
7405
|
+
return () => mq.removeEventListener("change", update);
|
|
7406
|
+
}, []);
|
|
7407
|
+
return coarse;
|
|
7408
|
+
}
|
|
7409
|
+
|
|
7410
|
+
// src/components/hover-popover.tsx
|
|
7411
|
+
import { jsx as jsx43, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
7412
|
+
function HoverPopover({
|
|
7413
|
+
content,
|
|
7414
|
+
children,
|
|
7415
|
+
side = "top",
|
|
7416
|
+
align = "center",
|
|
7417
|
+
sideOffset = 8,
|
|
7418
|
+
collisionPadding = 8,
|
|
7419
|
+
showArrow = true,
|
|
7420
|
+
openDelay = 150,
|
|
7421
|
+
closeDelay = 150,
|
|
7422
|
+
open: openProp,
|
|
7423
|
+
defaultOpen = false,
|
|
7424
|
+
onOpenChange,
|
|
7425
|
+
contentClassName
|
|
7426
|
+
}) {
|
|
7427
|
+
const coarse = useCoarsePointer();
|
|
7428
|
+
const isControlled = openProp !== void 0;
|
|
7429
|
+
const [internalOpen, setInternalOpen] = useState15(defaultOpen);
|
|
7430
|
+
const open = isControlled ? openProp : internalOpen;
|
|
7431
|
+
const openTimer = useRef11(void 0);
|
|
7432
|
+
const closeTimer = useRef11(void 0);
|
|
7433
|
+
const clearTimers = useCallback15(() => {
|
|
7434
|
+
if (openTimer.current) clearTimeout(openTimer.current);
|
|
7435
|
+
if (closeTimer.current) clearTimeout(closeTimer.current);
|
|
7436
|
+
}, []);
|
|
7437
|
+
const setOpen = useCallback15(
|
|
7438
|
+
(next) => {
|
|
7439
|
+
if (!isControlled) setInternalOpen(next);
|
|
7440
|
+
onOpenChange?.(next);
|
|
7441
|
+
},
|
|
7442
|
+
[isControlled, onOpenChange]
|
|
7443
|
+
);
|
|
7444
|
+
useEffect10(() => () => clearTimers(), [clearTimers]);
|
|
7445
|
+
const keyboardOpenRef = useRef11(false);
|
|
7446
|
+
const contentRef = useRef11(null);
|
|
7447
|
+
const openNow = useCallback15(() => {
|
|
7448
|
+
keyboardOpenRef.current = false;
|
|
7449
|
+
clearTimers();
|
|
7450
|
+
openTimer.current = setTimeout(() => setOpen(true), openDelay);
|
|
7451
|
+
}, [clearTimers, openDelay, setOpen]);
|
|
7452
|
+
const closeSoon = useCallback15(() => {
|
|
7453
|
+
clearTimers();
|
|
7454
|
+
closeTimer.current = setTimeout(() => setOpen(false), closeDelay);
|
|
7455
|
+
}, [clearTimers, closeDelay, setOpen]);
|
|
7456
|
+
if (coarse) {
|
|
7457
|
+
return /* @__PURE__ */ jsxs32(Popover, { open, onOpenChange: setOpen, children: [
|
|
7458
|
+
/* @__PURE__ */ jsx43(PopoverTrigger, { asChild: true, children }),
|
|
7459
|
+
/* @__PURE__ */ jsx43(
|
|
7460
|
+
PopoverContent,
|
|
7461
|
+
{
|
|
7462
|
+
side,
|
|
7463
|
+
align,
|
|
7464
|
+
sideOffset,
|
|
7465
|
+
collisionPadding,
|
|
7466
|
+
showArrow,
|
|
7467
|
+
className: contentClassName,
|
|
7468
|
+
children: content
|
|
7469
|
+
}
|
|
7470
|
+
)
|
|
7471
|
+
] });
|
|
7472
|
+
}
|
|
7473
|
+
return /* @__PURE__ */ jsxs32(Popover, { open, onOpenChange: setOpen, children: [
|
|
7474
|
+
/* @__PURE__ */ jsx43(
|
|
7475
|
+
PopoverTrigger,
|
|
7476
|
+
{
|
|
7477
|
+
asChild: true,
|
|
7478
|
+
onMouseEnter: openNow,
|
|
7479
|
+
onMouseLeave: closeSoon,
|
|
7480
|
+
onKeyDown: (e) => {
|
|
7481
|
+
if (e.key === "Enter" || e.key === " ") keyboardOpenRef.current = true;
|
|
7482
|
+
},
|
|
7483
|
+
children
|
|
7484
|
+
}
|
|
7485
|
+
),
|
|
7486
|
+
/* @__PURE__ */ jsx43(
|
|
7487
|
+
PopoverContent,
|
|
7488
|
+
{
|
|
7489
|
+
ref: contentRef,
|
|
7490
|
+
side,
|
|
7491
|
+
align,
|
|
7492
|
+
sideOffset,
|
|
7493
|
+
collisionPadding,
|
|
7494
|
+
showArrow,
|
|
7495
|
+
className: contentClassName,
|
|
7496
|
+
onOpenAutoFocus: (e) => {
|
|
7497
|
+
if (!keyboardOpenRef.current) e.preventDefault();
|
|
7498
|
+
},
|
|
7499
|
+
onEscapeKeyDown: (e) => {
|
|
7500
|
+
e.preventDefault();
|
|
7501
|
+
setOpen(false);
|
|
7502
|
+
},
|
|
7503
|
+
onMouseEnter: clearTimers,
|
|
7504
|
+
onMouseLeave: closeSoon,
|
|
7505
|
+
onBlur: (e) => {
|
|
7506
|
+
const next = e.relatedTarget;
|
|
7507
|
+
if (next && contentRef.current?.contains(next)) return;
|
|
7508
|
+
closeSoon();
|
|
7509
|
+
},
|
|
7510
|
+
children: content
|
|
7511
|
+
}
|
|
7512
|
+
)
|
|
7513
|
+
] });
|
|
7514
|
+
}
|
|
7515
|
+
|
|
7551
7516
|
// src/components/modal.tsx
|
|
7552
7517
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
7553
7518
|
import { SymbolWrong as SymbolWrong2 } from "@aviala-design/icons";
|
|
@@ -7557,7 +7522,7 @@ import {
|
|
|
7557
7522
|
forwardRef as forwardRef30,
|
|
7558
7523
|
isValidElement as isValidElement13
|
|
7559
7524
|
} from "react";
|
|
7560
|
-
import { Fragment as Fragment6, jsx as
|
|
7525
|
+
import { Fragment as Fragment6, jsx as jsx44, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
7561
7526
|
var MODAL_ICON_SIZE = 16;
|
|
7562
7527
|
var modalContentVariants = cva10("aviala-modal-content", {
|
|
7563
7528
|
variants: {
|
|
@@ -7580,13 +7545,13 @@ function renderModalIcon(node) {
|
|
|
7580
7545
|
"shrink-0"
|
|
7581
7546
|
)
|
|
7582
7547
|
}) : node;
|
|
7583
|
-
return /* @__PURE__ */
|
|
7548
|
+
return /* @__PURE__ */ jsx44("span", { className: "aviala-modal__icon", "aria-hidden": true, children: content });
|
|
7584
7549
|
}
|
|
7585
7550
|
var Modal = DialogPrimitive.Root;
|
|
7586
7551
|
var ModalTrigger = DialogPrimitive.Trigger;
|
|
7587
7552
|
var ModalPortal = DialogPrimitive.Portal;
|
|
7588
7553
|
var ModalClose = DialogPrimitive.Close;
|
|
7589
|
-
var ModalOverlay = forwardRef30(({ className, ...props }, ref) => /* @__PURE__ */
|
|
7554
|
+
var ModalOverlay = forwardRef30(({ className, ...props }, ref) => /* @__PURE__ */ jsx44(
|
|
7590
7555
|
DialogPrimitive.Overlay,
|
|
7591
7556
|
{
|
|
7592
7557
|
ref,
|
|
@@ -7605,24 +7570,24 @@ var ModalContent = forwardRef30(
|
|
|
7605
7570
|
onOpenAutoFocus,
|
|
7606
7571
|
...props
|
|
7607
7572
|
}, ref) => {
|
|
7608
|
-
const overlay = showOverlay ? /* @__PURE__ */
|
|
7609
|
-
const panel = /* @__PURE__ */
|
|
7573
|
+
const overlay = showOverlay ? /* @__PURE__ */ jsx44(ModalOverlay, {}) : null;
|
|
7574
|
+
const panel = /* @__PURE__ */ jsx44(
|
|
7610
7575
|
DialogPrimitive.Content,
|
|
7611
7576
|
{
|
|
7612
7577
|
ref,
|
|
7613
7578
|
className: cn(modalContentVariants({ size }), className),
|
|
7614
7579
|
onOpenAutoFocus,
|
|
7615
7580
|
...props,
|
|
7616
|
-
children: /* @__PURE__ */
|
|
7581
|
+
children: /* @__PURE__ */ jsx44("div", { className: "aviala-modal-content__surface", children })
|
|
7617
7582
|
}
|
|
7618
7583
|
);
|
|
7619
7584
|
if (!portalled) {
|
|
7620
|
-
return /* @__PURE__ */
|
|
7585
|
+
return /* @__PURE__ */ jsxs33(Fragment6, { children: [
|
|
7621
7586
|
overlay,
|
|
7622
7587
|
panel
|
|
7623
7588
|
] });
|
|
7624
7589
|
}
|
|
7625
|
-
return /* @__PURE__ */
|
|
7590
|
+
return /* @__PURE__ */ jsxs33(DialogPrimitive.Portal, { children: [
|
|
7626
7591
|
overlay,
|
|
7627
7592
|
panel
|
|
7628
7593
|
] });
|
|
@@ -7638,10 +7603,10 @@ var ModalHeader = forwardRef30(
|
|
|
7638
7603
|
showClose = true,
|
|
7639
7604
|
closeLabel = "Close dialog",
|
|
7640
7605
|
...props
|
|
7641
|
-
}, ref) => /* @__PURE__ */
|
|
7606
|
+
}, ref) => /* @__PURE__ */ jsx44("div", { ref, className: cn("aviala-modal__header", className), ...props, children: /* @__PURE__ */ jsxs33("div", { className: "aviala-modal__header-row", children: [
|
|
7642
7607
|
showIcon ? renderModalIcon(icon) : null,
|
|
7643
|
-
/* @__PURE__ */
|
|
7644
|
-
showClose ? /* @__PURE__ */
|
|
7608
|
+
/* @__PURE__ */ jsx44("div", { className: "aviala-modal__header-main", children }),
|
|
7609
|
+
showClose ? /* @__PURE__ */ jsx44(DialogPrimitive.Close, { asChild: true, children: /* @__PURE__ */ jsx44(
|
|
7645
7610
|
Button,
|
|
7646
7611
|
{
|
|
7647
7612
|
type: "button",
|
|
@@ -7649,28 +7614,28 @@ var ModalHeader = forwardRef30(
|
|
|
7649
7614
|
iconOnly: true,
|
|
7650
7615
|
"aria-label": closeLabel,
|
|
7651
7616
|
className: "aviala-modal__close",
|
|
7652
|
-
leftIcon: /* @__PURE__ */
|
|
7617
|
+
leftIcon: /* @__PURE__ */ jsx44(SymbolWrong2, { "aria-hidden": true })
|
|
7653
7618
|
}
|
|
7654
7619
|
) }) : null
|
|
7655
7620
|
] }) })
|
|
7656
7621
|
);
|
|
7657
7622
|
ModalHeader.displayName = "ModalHeader";
|
|
7658
|
-
var ModalTitle = forwardRef30(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
7623
|
+
var ModalTitle = forwardRef30(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx44(DialogPrimitive.Title, { ref, asChild: true, ...props, children: /* @__PURE__ */ jsx44(Typography, { level: "text", className: cn("aviala-modal__title", className), children }) }));
|
|
7659
7624
|
ModalTitle.displayName = DialogPrimitive.Title.displayName;
|
|
7660
|
-
var ModalDescription = forwardRef30(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
7625
|
+
var ModalDescription = forwardRef30(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx44(DialogPrimitive.Description, { ref, asChild: true, ...props, children: /* @__PURE__ */ jsx44(Typography, { level: "caption", className: cn("aviala-modal__description", className), children }) }));
|
|
7661
7626
|
ModalDescription.displayName = DialogPrimitive.Description.displayName;
|
|
7662
7627
|
function ModalHeaderText({
|
|
7663
7628
|
title,
|
|
7664
7629
|
description,
|
|
7665
7630
|
...props
|
|
7666
7631
|
}) {
|
|
7667
|
-
return /* @__PURE__ */
|
|
7668
|
-
/* @__PURE__ */
|
|
7669
|
-
description ? /* @__PURE__ */
|
|
7632
|
+
return /* @__PURE__ */ jsx44(ModalHeader, { ...props, children: /* @__PURE__ */ jsxs33("div", { className: "aviala-modal__header-typeface", children: [
|
|
7633
|
+
/* @__PURE__ */ jsx44(ModalTitle, { children: title }),
|
|
7634
|
+
description ? /* @__PURE__ */ jsx44(ModalDescription, { children: description }) : null
|
|
7670
7635
|
] }) });
|
|
7671
7636
|
}
|
|
7672
7637
|
var ModalBody = forwardRef30(
|
|
7673
|
-
({ className, children, layout = "default", title, description, ...props }, ref) => /* @__PURE__ */
|
|
7638
|
+
({ className, children, layout = "default", title, description, ...props }, ref) => /* @__PURE__ */ jsx44("div", { ref, className: cn("aviala-modal__body", className), ...props, children: layout === "text" ? /* @__PURE__ */ jsx44(
|
|
7674
7639
|
Typeface,
|
|
7675
7640
|
{
|
|
7676
7641
|
className: "aviala-modal__body-typeface",
|
|
@@ -7682,21 +7647,21 @@ var ModalBody = forwardRef30(
|
|
|
7682
7647
|
);
|
|
7683
7648
|
ModalBody.displayName = "ModalBody";
|
|
7684
7649
|
var ModalFooter = forwardRef30(
|
|
7685
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
7650
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx44("div", { ref, className: cn("aviala-modal__footer", className), ...props })
|
|
7686
7651
|
);
|
|
7687
7652
|
ModalFooter.displayName = "ModalFooter";
|
|
7688
7653
|
|
|
7689
7654
|
// src/components/tooltip.tsx
|
|
7690
7655
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
7691
7656
|
import { forwardRef as forwardRef31 } from "react";
|
|
7692
|
-
import { jsx as
|
|
7657
|
+
import { jsx as jsx45, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
7693
7658
|
var TOOLTIP_DELAY_DURATION = 300;
|
|
7694
7659
|
function TooltipProvider({
|
|
7695
7660
|
delayDuration = TOOLTIP_DELAY_DURATION,
|
|
7696
7661
|
skipDelayDuration = 0,
|
|
7697
7662
|
...props
|
|
7698
7663
|
}) {
|
|
7699
|
-
return /* @__PURE__ */
|
|
7664
|
+
return /* @__PURE__ */ jsx45(
|
|
7700
7665
|
TooltipPrimitive.Provider,
|
|
7701
7666
|
{
|
|
7702
7667
|
delayDuration,
|
|
@@ -7715,7 +7680,7 @@ var TooltipContent = forwardRef31(
|
|
|
7715
7680
|
collisionPadding = 8,
|
|
7716
7681
|
showArrow = true,
|
|
7717
7682
|
...props
|
|
7718
|
-
}, ref) => /* @__PURE__ */
|
|
7683
|
+
}, ref) => /* @__PURE__ */ jsx45(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs34(
|
|
7719
7684
|
TooltipPrimitive.Content,
|
|
7720
7685
|
{
|
|
7721
7686
|
ref,
|
|
@@ -7724,14 +7689,14 @@ var TooltipContent = forwardRef31(
|
|
|
7724
7689
|
className: cn("aviala-tooltip-content", className),
|
|
7725
7690
|
...props,
|
|
7726
7691
|
children: [
|
|
7727
|
-
/* @__PURE__ */
|
|
7728
|
-
showArrow ? /* @__PURE__ */
|
|
7692
|
+
/* @__PURE__ */ jsx45("div", { className: cn("aviala-tooltip-content__surface", typographyVariants({ level: "caption" })), children }),
|
|
7693
|
+
showArrow ? /* @__PURE__ */ jsx45(
|
|
7729
7694
|
TooltipPrimitive.Arrow,
|
|
7730
7695
|
{
|
|
7731
7696
|
asChild: true,
|
|
7732
7697
|
width: TOOLTIP_POINTER.width,
|
|
7733
7698
|
height: TOOLTIP_POINTER.height,
|
|
7734
|
-
children: /* @__PURE__ */
|
|
7699
|
+
children: /* @__PURE__ */ jsx45(
|
|
7735
7700
|
OverlayPointerSvg,
|
|
7736
7701
|
{
|
|
7737
7702
|
className: "aviala-tooltip-content__arrow",
|
|
@@ -7748,6 +7713,67 @@ var TooltipContent = forwardRef31(
|
|
|
7748
7713
|
);
|
|
7749
7714
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
7750
7715
|
|
|
7716
|
+
// src/components/responsive-tooltip.tsx
|
|
7717
|
+
import { jsx as jsx46, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
7718
|
+
function ResponsiveTooltip({
|
|
7719
|
+
content,
|
|
7720
|
+
children,
|
|
7721
|
+
side = "top",
|
|
7722
|
+
align = "center",
|
|
7723
|
+
sideOffset = 4,
|
|
7724
|
+
collisionPadding = 8,
|
|
7725
|
+
showArrow = true,
|
|
7726
|
+
delayDuration = TOOLTIP_DELAY_DURATION,
|
|
7727
|
+
open,
|
|
7728
|
+
defaultOpen,
|
|
7729
|
+
onOpenChange,
|
|
7730
|
+
contentClassName
|
|
7731
|
+
}) {
|
|
7732
|
+
const coarse = useCoarsePointer();
|
|
7733
|
+
if (coarse) {
|
|
7734
|
+
return /* @__PURE__ */ jsxs35(Popover, { open, defaultOpen, onOpenChange, children: [
|
|
7735
|
+
/* @__PURE__ */ jsx46(PopoverTrigger, { asChild: true, children }),
|
|
7736
|
+
/* @__PURE__ */ jsx46(
|
|
7737
|
+
PopoverContent,
|
|
7738
|
+
{
|
|
7739
|
+
appearance: "tooltip",
|
|
7740
|
+
side,
|
|
7741
|
+
align,
|
|
7742
|
+
sideOffset,
|
|
7743
|
+
collisionPadding,
|
|
7744
|
+
showArrow,
|
|
7745
|
+
className: contentClassName,
|
|
7746
|
+
children: content
|
|
7747
|
+
}
|
|
7748
|
+
)
|
|
7749
|
+
] });
|
|
7750
|
+
}
|
|
7751
|
+
return /* @__PURE__ */ jsxs35(
|
|
7752
|
+
Tooltip,
|
|
7753
|
+
{
|
|
7754
|
+
delayDuration,
|
|
7755
|
+
open,
|
|
7756
|
+
defaultOpen,
|
|
7757
|
+
onOpenChange,
|
|
7758
|
+
children: [
|
|
7759
|
+
/* @__PURE__ */ jsx46(TooltipTrigger, { asChild: true, children }),
|
|
7760
|
+
/* @__PURE__ */ jsx46(
|
|
7761
|
+
TooltipContent,
|
|
7762
|
+
{
|
|
7763
|
+
side,
|
|
7764
|
+
align,
|
|
7765
|
+
sideOffset,
|
|
7766
|
+
collisionPadding,
|
|
7767
|
+
showArrow,
|
|
7768
|
+
className: contentClassName,
|
|
7769
|
+
children: content
|
|
7770
|
+
}
|
|
7771
|
+
)
|
|
7772
|
+
]
|
|
7773
|
+
}
|
|
7774
|
+
);
|
|
7775
|
+
}
|
|
7776
|
+
|
|
7751
7777
|
// src/components/feedback.tsx
|
|
7752
7778
|
import { cva as cva11 } from "class-variance-authority";
|
|
7753
7779
|
import {
|
|
@@ -7763,7 +7789,7 @@ import {
|
|
|
7763
7789
|
forwardRef as forwardRef32,
|
|
7764
7790
|
isValidElement as isValidElement14
|
|
7765
7791
|
} from "react";
|
|
7766
|
-
import { jsx as
|
|
7792
|
+
import { jsx as jsx47, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
7767
7793
|
var FEEDBACK_ICON_SIZE = 22;
|
|
7768
7794
|
var feedbackVariants = cva11("aviala-feedback", {
|
|
7769
7795
|
variants: {
|
|
@@ -7799,22 +7825,22 @@ function renderFeedbackIcon(node) {
|
|
|
7799
7825
|
"shrink-0"
|
|
7800
7826
|
)
|
|
7801
7827
|
}) : node;
|
|
7802
|
-
return /* @__PURE__ */
|
|
7828
|
+
return /* @__PURE__ */ jsx47("span", { className: "aviala-feedback__icon", "aria-hidden": true, children: content });
|
|
7803
7829
|
}
|
|
7804
7830
|
function defaultStatusIcon(type, mode) {
|
|
7805
7831
|
const iconMode = mode === "primary" ? "fill" : "fill";
|
|
7806
7832
|
const thickness = "Regular";
|
|
7807
7833
|
switch (type) {
|
|
7808
7834
|
case "information":
|
|
7809
|
-
return /* @__PURE__ */
|
|
7835
|
+
return /* @__PURE__ */ jsx47(SymbolInformationCircle2, { thickness, mode: iconMode, "aria-hidden": true });
|
|
7810
7836
|
case "warning":
|
|
7811
|
-
return /* @__PURE__ */
|
|
7837
|
+
return /* @__PURE__ */ jsx47(SymbolWarningCircle, { thickness, mode: iconMode, "aria-hidden": true });
|
|
7812
7838
|
case "wrong":
|
|
7813
|
-
return /* @__PURE__ */
|
|
7839
|
+
return /* @__PURE__ */ jsx47(SymbolWrongCircle2, { thickness, mode: iconMode, "aria-hidden": true });
|
|
7814
7840
|
case "success":
|
|
7815
|
-
return /* @__PURE__ */
|
|
7841
|
+
return /* @__PURE__ */ jsx47(SymbolRightCircle, { thickness, mode: iconMode, "aria-hidden": true });
|
|
7816
7842
|
case "normal":
|
|
7817
|
-
return /* @__PURE__ */
|
|
7843
|
+
return /* @__PURE__ */ jsx47(GeneralNotification, { thickness, mode: "default", "aria-hidden": true });
|
|
7818
7844
|
}
|
|
7819
7845
|
}
|
|
7820
7846
|
var Feedback = forwardRef32(
|
|
@@ -7839,7 +7865,7 @@ var Feedback = forwardRef32(
|
|
|
7839
7865
|
const tone = mode === "primary" ? "white" : "default";
|
|
7840
7866
|
const isSmall = resolvedSize === "small";
|
|
7841
7867
|
const resolvedRole = resolvedType === "wrong" ? "alert" : "status";
|
|
7842
|
-
return /* @__PURE__ */
|
|
7868
|
+
return /* @__PURE__ */ jsx47(
|
|
7843
7869
|
"div",
|
|
7844
7870
|
{
|
|
7845
7871
|
ref,
|
|
@@ -7853,9 +7879,9 @@ var Feedback = forwardRef32(
|
|
|
7853
7879
|
"data-size": resolvedSize,
|
|
7854
7880
|
"data-mode": mode,
|
|
7855
7881
|
...props,
|
|
7856
|
-
children: /* @__PURE__ */
|
|
7882
|
+
children: /* @__PURE__ */ jsxs36("div", { className: "aviala-feedback__body", children: [
|
|
7857
7883
|
renderFeedbackIcon(icon ?? defaultStatusIcon(resolvedType, mode)),
|
|
7858
|
-
isSmall ? /* @__PURE__ */
|
|
7884
|
+
isSmall ? /* @__PURE__ */ jsx47(Typography, { level: "text", tone, className: "aviala-feedback__title", children: title }) : /* @__PURE__ */ jsx47(
|
|
7859
7885
|
Typeface,
|
|
7860
7886
|
{
|
|
7861
7887
|
className: "aviala-feedback__typeface",
|
|
@@ -7865,7 +7891,7 @@ var Feedback = forwardRef32(
|
|
|
7865
7891
|
tone
|
|
7866
7892
|
}
|
|
7867
7893
|
),
|
|
7868
|
-
action ? /* @__PURE__ */
|
|
7894
|
+
action ? /* @__PURE__ */ jsx47(
|
|
7869
7895
|
Link,
|
|
7870
7896
|
{
|
|
7871
7897
|
level: "text",
|
|
@@ -7881,7 +7907,7 @@ var Feedback = forwardRef32(
|
|
|
7881
7907
|
children: action
|
|
7882
7908
|
}
|
|
7883
7909
|
) : null,
|
|
7884
|
-
showClose ? /* @__PURE__ */
|
|
7910
|
+
showClose ? /* @__PURE__ */ jsx47(
|
|
7885
7911
|
Link,
|
|
7886
7912
|
{
|
|
7887
7913
|
level: "text",
|
|
@@ -7890,7 +7916,7 @@ var Feedback = forwardRef32(
|
|
|
7890
7916
|
href: onClose ? "#" : void 0,
|
|
7891
7917
|
"aria-label": closeLabel,
|
|
7892
7918
|
className: "aviala-feedback__close",
|
|
7893
|
-
leftIcon: /* @__PURE__ */
|
|
7919
|
+
leftIcon: /* @__PURE__ */ jsx47(SymbolWrong3, { "aria-hidden": true }),
|
|
7894
7920
|
onClick: (event) => {
|
|
7895
7921
|
if (onClose) {
|
|
7896
7922
|
event.preventDefault();
|
|
@@ -7920,7 +7946,7 @@ import {
|
|
|
7920
7946
|
forwardRef as forwardRef33,
|
|
7921
7947
|
isValidElement as isValidElement15
|
|
7922
7948
|
} from "react";
|
|
7923
|
-
import { jsx as
|
|
7949
|
+
import { jsx as jsx48, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
7924
7950
|
var ALERT_ICON_SIZE = 16;
|
|
7925
7951
|
var alertVariants = cva12("aviala-alert", {
|
|
7926
7952
|
variants: {
|
|
@@ -7956,20 +7982,20 @@ function renderAlertIcon(node) {
|
|
|
7956
7982
|
"shrink-0"
|
|
7957
7983
|
)
|
|
7958
7984
|
}) : node;
|
|
7959
|
-
return /* @__PURE__ */
|
|
7985
|
+
return /* @__PURE__ */ jsx48("span", { className: "aviala-alert__icon", "aria-hidden": true, children: content });
|
|
7960
7986
|
}
|
|
7961
7987
|
function defaultStatusIcon2(type) {
|
|
7962
7988
|
const iconProps = { thickness: "Regular", mode: "fill", "aria-hidden": true };
|
|
7963
7989
|
switch (type) {
|
|
7964
7990
|
case "info":
|
|
7965
7991
|
case "neutral":
|
|
7966
|
-
return /* @__PURE__ */
|
|
7992
|
+
return /* @__PURE__ */ jsx48(SymbolInformationCircle3, { ...iconProps });
|
|
7967
7993
|
case "warning":
|
|
7968
|
-
return /* @__PURE__ */
|
|
7994
|
+
return /* @__PURE__ */ jsx48(SymbolWarningCircle2, { ...iconProps });
|
|
7969
7995
|
case "error":
|
|
7970
|
-
return /* @__PURE__ */
|
|
7996
|
+
return /* @__PURE__ */ jsx48(SymbolWrongCircle3, { ...iconProps });
|
|
7971
7997
|
case "success":
|
|
7972
|
-
return /* @__PURE__ */
|
|
7998
|
+
return /* @__PURE__ */ jsx48(SymbolRightCircle2, { ...iconProps });
|
|
7973
7999
|
}
|
|
7974
8000
|
}
|
|
7975
8001
|
var Alert = forwardRef33(
|
|
@@ -7998,7 +8024,7 @@ var Alert = forwardRef33(
|
|
|
7998
8024
|
const resolvedType = type ?? "info";
|
|
7999
8025
|
const resolvedRole = resolvedType === "error" ? "alert" : "status";
|
|
8000
8026
|
const hasActions = showActions && (action || secondaryAction);
|
|
8001
|
-
return /* @__PURE__ */
|
|
8027
|
+
return /* @__PURE__ */ jsxs37(
|
|
8002
8028
|
"div",
|
|
8003
8029
|
{
|
|
8004
8030
|
ref,
|
|
@@ -8010,9 +8036,9 @@ var Alert = forwardRef33(
|
|
|
8010
8036
|
"data-appearance": appearance,
|
|
8011
8037
|
...props,
|
|
8012
8038
|
children: [
|
|
8013
|
-
/* @__PURE__ */
|
|
8039
|
+
/* @__PURE__ */ jsxs37("div", { className: "aviala-alert__body", children: [
|
|
8014
8040
|
showIcon ? renderAlertIcon(icon ?? defaultStatusIcon2(resolvedType)) : null,
|
|
8015
|
-
isSmall ? /* @__PURE__ */
|
|
8041
|
+
isSmall ? /* @__PURE__ */ jsx48(Typography, { level: "text", className: "aviala-alert__title", children: title }) : /* @__PURE__ */ jsx48(
|
|
8016
8042
|
Typeface,
|
|
8017
8043
|
{
|
|
8018
8044
|
className: "aviala-alert__typeface",
|
|
@@ -8021,7 +8047,7 @@ var Alert = forwardRef33(
|
|
|
8021
8047
|
secondary: description
|
|
8022
8048
|
}
|
|
8023
8049
|
),
|
|
8024
|
-
quickAction ? /* @__PURE__ */
|
|
8050
|
+
quickAction ? /* @__PURE__ */ jsx48(
|
|
8025
8051
|
Link,
|
|
8026
8052
|
{
|
|
8027
8053
|
level: "text",
|
|
@@ -8037,7 +8063,7 @@ var Alert = forwardRef33(
|
|
|
8037
8063
|
children: quickAction
|
|
8038
8064
|
}
|
|
8039
8065
|
) : null,
|
|
8040
|
-
dismissible ? /* @__PURE__ */
|
|
8066
|
+
dismissible ? /* @__PURE__ */ jsx48(
|
|
8041
8067
|
Link,
|
|
8042
8068
|
{
|
|
8043
8069
|
level: "text",
|
|
@@ -8046,7 +8072,7 @@ var Alert = forwardRef33(
|
|
|
8046
8072
|
href: onDismiss ? "#" : void 0,
|
|
8047
8073
|
"aria-label": closeLabel,
|
|
8048
8074
|
className: "aviala-alert__close",
|
|
8049
|
-
leftIcon: /* @__PURE__ */
|
|
8075
|
+
leftIcon: /* @__PURE__ */ jsx48(SymbolWrong4, { "aria-hidden": true }),
|
|
8050
8076
|
onClick: (event) => {
|
|
8051
8077
|
if (onDismiss) {
|
|
8052
8078
|
event.preventDefault();
|
|
@@ -8056,8 +8082,8 @@ var Alert = forwardRef33(
|
|
|
8056
8082
|
}
|
|
8057
8083
|
) : null
|
|
8058
8084
|
] }),
|
|
8059
|
-
hasActions ? /* @__PURE__ */
|
|
8060
|
-
action ? /* @__PURE__ */
|
|
8085
|
+
hasActions ? /* @__PURE__ */ jsxs37("div", { className: "aviala-alert__actions", children: [
|
|
8086
|
+
action ? /* @__PURE__ */ jsx48(
|
|
8061
8087
|
Link,
|
|
8062
8088
|
{
|
|
8063
8089
|
level: "caption",
|
|
@@ -8073,7 +8099,7 @@ var Alert = forwardRef33(
|
|
|
8073
8099
|
children: action
|
|
8074
8100
|
}
|
|
8075
8101
|
) : null,
|
|
8076
|
-
secondaryAction ? /* @__PURE__ */
|
|
8102
|
+
secondaryAction ? /* @__PURE__ */ jsx48(
|
|
8077
8103
|
Link,
|
|
8078
8104
|
{
|
|
8079
8105
|
level: "caption",
|
|
@@ -8107,30 +8133,30 @@ import {
|
|
|
8107
8133
|
forwardRef as forwardRef34,
|
|
8108
8134
|
isValidElement as isValidElement16
|
|
8109
8135
|
} from "react";
|
|
8110
|
-
import { jsx as
|
|
8136
|
+
import { jsx as jsx49, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
8111
8137
|
var List = forwardRef34(
|
|
8112
|
-
({ className, title, children, ...props }, ref) => /* @__PURE__ */
|
|
8113
|
-
title != null ? /* @__PURE__ */
|
|
8114
|
-
/* @__PURE__ */
|
|
8138
|
+
({ className, title, children, ...props }, ref) => /* @__PURE__ */ jsxs38("div", { ref, className: cn("aviala-list", className), ...props, children: [
|
|
8139
|
+
title != null ? /* @__PURE__ */ jsx49(ListTitle, { children: title }) : null,
|
|
8140
|
+
/* @__PURE__ */ jsx49(ListGroup, { children })
|
|
8115
8141
|
] })
|
|
8116
8142
|
);
|
|
8117
8143
|
List.displayName = "List";
|
|
8118
8144
|
var ListTitle = forwardRef34(
|
|
8119
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
8145
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx49("div", { ref, className: cn("aviala-list-title", className), ...props, children: /* @__PURE__ */ jsx49("span", { className: cn(typographyVariants({ level: "text" })), children }) })
|
|
8120
8146
|
);
|
|
8121
8147
|
ListTitle.displayName = "ListTitle";
|
|
8122
8148
|
var ListGroup = forwardRef34(
|
|
8123
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
8149
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx49("div", { ref, className: cn("aviala-list-group", className), role: "list", ...props, children })
|
|
8124
8150
|
);
|
|
8125
8151
|
ListGroup.displayName = "ListGroup";
|
|
8126
8152
|
function ListItemGroup({ label, children, className }) {
|
|
8127
|
-
return /* @__PURE__ */
|
|
8128
|
-
label != null ? /* @__PURE__ */
|
|
8129
|
-
/* @__PURE__ */
|
|
8153
|
+
return /* @__PURE__ */ jsxs38("div", { className: cn("aviala-list", className), children: [
|
|
8154
|
+
label != null ? /* @__PURE__ */ jsx49(ListTitle, { children: label }) : null,
|
|
8155
|
+
/* @__PURE__ */ jsx49(ListGroup, { children })
|
|
8130
8156
|
] });
|
|
8131
8157
|
}
|
|
8132
8158
|
var ListDivider = forwardRef34(
|
|
8133
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
8159
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx49(
|
|
8134
8160
|
"span",
|
|
8135
8161
|
{
|
|
8136
8162
|
ref,
|
|
@@ -8142,13 +8168,13 @@ var ListDivider = forwardRef34(
|
|
|
8142
8168
|
);
|
|
8143
8169
|
ListDivider.displayName = "ListDivider";
|
|
8144
8170
|
var ListSeparator = forwardRef34(
|
|
8145
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
8171
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx49("hr", { ref, className: cn("aviala-list-separator", className), ...props })
|
|
8146
8172
|
);
|
|
8147
8173
|
ListSeparator.displayName = "ListSeparator";
|
|
8148
8174
|
function renderLeadingIcon(node, leading) {
|
|
8149
8175
|
if (leading === "none") return null;
|
|
8150
8176
|
const iconSize = leading === "shaped" ? 20 : 22;
|
|
8151
|
-
const content = node ?? (leading === "shaped" ? /* @__PURE__ */
|
|
8177
|
+
const content = node ?? (leading === "shaped" ? /* @__PURE__ */ jsx49(GeneralSetting, { "aria-hidden": true }) : /* @__PURE__ */ jsx49(GeneralSetting, { "aria-hidden": true }));
|
|
8152
8178
|
const rendered = isValidElement16(content) && typeof content.type !== "string" ? cloneElement11(content, {
|
|
8153
8179
|
width: iconSize,
|
|
8154
8180
|
height: iconSize,
|
|
@@ -8157,7 +8183,7 @@ function renderLeadingIcon(node, leading) {
|
|
|
8157
8183
|
"shrink-0"
|
|
8158
8184
|
)
|
|
8159
8185
|
}) : content;
|
|
8160
|
-
return /* @__PURE__ */
|
|
8186
|
+
return /* @__PURE__ */ jsx49("span", { className: "aviala-list-item__icon", children: /* @__PURE__ */ jsx49(
|
|
8161
8187
|
"span",
|
|
8162
8188
|
{
|
|
8163
8189
|
className: cn(
|
|
@@ -8188,44 +8214,44 @@ var ListItem = forwardRef34(
|
|
|
8188
8214
|
...props
|
|
8189
8215
|
}, ref) => {
|
|
8190
8216
|
const isInteractive = interactive ?? onClick != null;
|
|
8191
|
-
const primaryAction = action ?? /* @__PURE__ */
|
|
8217
|
+
const primaryAction = action ?? /* @__PURE__ */ jsx49(Button, { mode: "primary", size: "regular", leftIcon: /* @__PURE__ */ jsx49(GeneralSetting, { "aria-hidden": true }), children: actionLabel });
|
|
8192
8218
|
const renderTrailing = () => {
|
|
8193
8219
|
if (trailing !== void 0) return trailing;
|
|
8194
8220
|
switch (itemType) {
|
|
8195
8221
|
case "action":
|
|
8196
|
-
return /* @__PURE__ */
|
|
8197
|
-
/* @__PURE__ */
|
|
8222
|
+
return /* @__PURE__ */ jsxs38("div", { className: "aviala-list-item__more", children: [
|
|
8223
|
+
/* @__PURE__ */ jsxs38("div", { className: "aviala-list-item__trailing", children: [
|
|
8198
8224
|
primaryAction,
|
|
8199
|
-
secondaryAction ?? /* @__PURE__ */
|
|
8225
|
+
secondaryAction ?? /* @__PURE__ */ jsx49(
|
|
8200
8226
|
Button,
|
|
8201
8227
|
{
|
|
8202
8228
|
mode: "default",
|
|
8203
8229
|
size: "regular",
|
|
8204
8230
|
iconOnly: true,
|
|
8205
8231
|
"aria-label": "More",
|
|
8206
|
-
leftIcon: /* @__PURE__ */
|
|
8232
|
+
leftIcon: /* @__PURE__ */ jsx49(GeneralSetting, { "aria-hidden": true })
|
|
8207
8233
|
}
|
|
8208
8234
|
)
|
|
8209
8235
|
] }),
|
|
8210
|
-
/* @__PURE__ */
|
|
8211
|
-
/* @__PURE__ */
|
|
8236
|
+
/* @__PURE__ */ jsx49(ListDivider, {}),
|
|
8237
|
+
/* @__PURE__ */ jsx49("span", { className: "aviala-list-item__chevron", "aria-hidden": true, children: /* @__PURE__ */ jsx49(DirectionArrowRightLight2, { width: 18, height: 18 }) })
|
|
8212
8238
|
] });
|
|
8213
8239
|
case "switch":
|
|
8214
|
-
return /* @__PURE__ */
|
|
8240
|
+
return /* @__PURE__ */ jsxs38("div", { className: "aviala-list-item__trailing", children: [
|
|
8215
8241
|
primaryAction,
|
|
8216
|
-
/* @__PURE__ */
|
|
8217
|
-
/* @__PURE__ */
|
|
8242
|
+
/* @__PURE__ */ jsx49(ListDivider, {}),
|
|
8243
|
+
/* @__PURE__ */ jsx49(Switch, { ...switchProps })
|
|
8218
8244
|
] });
|
|
8219
8245
|
case "select":
|
|
8220
8246
|
default:
|
|
8221
|
-
return /* @__PURE__ */
|
|
8247
|
+
return /* @__PURE__ */ jsxs38("div", { className: "aviala-list-item__trailing", children: [
|
|
8222
8248
|
primaryAction,
|
|
8223
|
-
/* @__PURE__ */
|
|
8224
|
-
/* @__PURE__ */
|
|
8249
|
+
/* @__PURE__ */ jsx49(ListDivider, {}),
|
|
8250
|
+
/* @__PURE__ */ jsx49("span", { className: "aviala-list-item__select", children: select })
|
|
8225
8251
|
] });
|
|
8226
8252
|
}
|
|
8227
8253
|
};
|
|
8228
|
-
return /* @__PURE__ */
|
|
8254
|
+
return /* @__PURE__ */ jsxs38(
|
|
8229
8255
|
"div",
|
|
8230
8256
|
{
|
|
8231
8257
|
ref,
|
|
@@ -8240,8 +8266,8 @@ var ListItem = forwardRef34(
|
|
|
8240
8266
|
...props,
|
|
8241
8267
|
children: [
|
|
8242
8268
|
renderLeadingIcon(icon, leading),
|
|
8243
|
-
/* @__PURE__ */
|
|
8244
|
-
/* @__PURE__ */
|
|
8269
|
+
/* @__PURE__ */ jsx49("div", { className: "aviala-list-item__body", children: /* @__PURE__ */ jsxs38("div", { className: "aviala-list-item__content", children: [
|
|
8270
|
+
/* @__PURE__ */ jsx49("div", { className: "aviala-list-item__head", children: /* @__PURE__ */ jsx49(Typeface, { content: "textCaption", primary: title, secondary: subtitle }) }),
|
|
8245
8271
|
renderTrailing()
|
|
8246
8272
|
] }) })
|
|
8247
8273
|
]
|
|
@@ -8257,15 +8283,15 @@ import { Slot as Slot5 } from "@radix-ui/react-slot";
|
|
|
8257
8283
|
import {
|
|
8258
8284
|
createContext as createContext8,
|
|
8259
8285
|
forwardRef as forwardRef35,
|
|
8260
|
-
useCallback as
|
|
8286
|
+
useCallback as useCallback16,
|
|
8261
8287
|
useContext as useContext8,
|
|
8262
|
-
useEffect as
|
|
8288
|
+
useEffect as useEffect11,
|
|
8263
8289
|
useLayoutEffect as useLayoutEffect6,
|
|
8264
|
-
useMemo as
|
|
8290
|
+
useMemo as useMemo10,
|
|
8265
8291
|
useRef as useRef12,
|
|
8266
|
-
useState as
|
|
8292
|
+
useState as useState16
|
|
8267
8293
|
} from "react";
|
|
8268
|
-
import { Fragment as Fragment7, jsx as
|
|
8294
|
+
import { Fragment as Fragment7, jsx as jsx50, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
8269
8295
|
function navigationItemButtonMode(active) {
|
|
8270
8296
|
return active ? "second" : "noBackgroundCustom";
|
|
8271
8297
|
}
|
|
@@ -8330,11 +8356,17 @@ function measureNavigationIndicator(group, direction) {
|
|
|
8330
8356
|
50
|
|
8331
8357
|
);
|
|
8332
8358
|
if (direction === "vertical") {
|
|
8359
|
+
let inset = railInset;
|
|
8360
|
+
if (item.matches(":active")) {
|
|
8361
|
+
inset = readIndicatorToken(group, "--navigation-rail-inset-press", 9);
|
|
8362
|
+
} else if (item.matches(":hover")) {
|
|
8363
|
+
inset = readIndicatorToken(group, "--navigation-rail-inset-hover", 3);
|
|
8364
|
+
}
|
|
8333
8365
|
return {
|
|
8334
8366
|
x: railLeft,
|
|
8335
|
-
y: itemRect.top - groupRect.top +
|
|
8367
|
+
y: itemRect.top - groupRect.top + inset,
|
|
8336
8368
|
width: railWidth,
|
|
8337
|
-
height: Math.max(0, itemRect.height -
|
|
8369
|
+
height: Math.max(0, itemRect.height - inset * 2),
|
|
8338
8370
|
visible: true
|
|
8339
8371
|
};
|
|
8340
8372
|
}
|
|
@@ -8433,13 +8465,13 @@ function useNavigationIndicator(groupRef, direction, layoutKey) {
|
|
|
8433
8465
|
const layoutTrackingFrameRef = useRef12(null);
|
|
8434
8466
|
const isLayoutTrackingRef = useRef12(false);
|
|
8435
8467
|
const isInitialMount = useRef12(true);
|
|
8436
|
-
const [activeRevision, setActiveRevision] =
|
|
8437
|
-
const measureIndicator =
|
|
8468
|
+
const [activeRevision, setActiveRevision] = useState16(0);
|
|
8469
|
+
const measureIndicator = useCallback16(() => {
|
|
8438
8470
|
const group = groupRef.current;
|
|
8439
8471
|
if (!group) return null;
|
|
8440
8472
|
return measureNavigationIndicator(group, direction);
|
|
8441
8473
|
}, [direction, groupRef]);
|
|
8442
|
-
const syncIndicator =
|
|
8474
|
+
const syncIndicator = useCallback16(
|
|
8443
8475
|
(metrics, instant = false) => {
|
|
8444
8476
|
metricsRef.current = metrics;
|
|
8445
8477
|
const el = indicatorRef.current;
|
|
@@ -8447,14 +8479,14 @@ function useNavigationIndicator(groupRef, direction, layoutKey) {
|
|
|
8447
8479
|
},
|
|
8448
8480
|
[]
|
|
8449
8481
|
);
|
|
8450
|
-
const cancelLayoutTracking =
|
|
8482
|
+
const cancelLayoutTracking = useCallback16(() => {
|
|
8451
8483
|
if (layoutTrackingFrameRef.current != null) {
|
|
8452
8484
|
cancelAnimationFrame(layoutTrackingFrameRef.current);
|
|
8453
8485
|
layoutTrackingFrameRef.current = null;
|
|
8454
8486
|
}
|
|
8455
8487
|
isLayoutTrackingRef.current = false;
|
|
8456
8488
|
}, []);
|
|
8457
|
-
const remeasureIndicator =
|
|
8489
|
+
const remeasureIndicator = useCallback16(() => {
|
|
8458
8490
|
if (isLayoutTrackingRef.current) return;
|
|
8459
8491
|
const metrics = measureIndicator();
|
|
8460
8492
|
if (!metrics) return;
|
|
@@ -8463,7 +8495,7 @@ function useNavigationIndicator(groupRef, direction, layoutKey) {
|
|
|
8463
8495
|
isAnimatingRef.current = false;
|
|
8464
8496
|
syncIndicator(metrics, true);
|
|
8465
8497
|
}, [measureIndicator, syncIndicator]);
|
|
8466
|
-
const startExpandCollapseTracking =
|
|
8498
|
+
const startExpandCollapseTracking = useCallback16(() => {
|
|
8467
8499
|
const group = groupRef.current;
|
|
8468
8500
|
const el = indicatorRef.current;
|
|
8469
8501
|
if (!group || !el) return;
|
|
@@ -8520,7 +8552,7 @@ function useNavigationIndicator(groupRef, direction, layoutKey) {
|
|
|
8520
8552
|
};
|
|
8521
8553
|
layoutTrackingFrameRef.current = requestAnimationFrame(tick);
|
|
8522
8554
|
}, [cancelLayoutTracking, groupRef, measureIndicator, syncIndicator]);
|
|
8523
|
-
const onIndicatorRef =
|
|
8555
|
+
const onIndicatorRef = useCallback16((node) => {
|
|
8524
8556
|
indicatorRef.current = node;
|
|
8525
8557
|
if (node && metricsRef.current && isInitialMount.current) {
|
|
8526
8558
|
applyIndicatorMetrics(node, metricsRef.current, true);
|
|
@@ -8632,6 +8664,32 @@ function useNavigationIndicator(groupRef, direction, layoutKey) {
|
|
|
8632
8664
|
startExpandCollapseTracking,
|
|
8633
8665
|
syncIndicator
|
|
8634
8666
|
]);
|
|
8667
|
+
useEffect11(() => {
|
|
8668
|
+
if (direction !== "vertical") return;
|
|
8669
|
+
const group = groupRef.current;
|
|
8670
|
+
if (!group) return;
|
|
8671
|
+
const refreshInteractionMetrics = () => {
|
|
8672
|
+
if (isLayoutTrackingRef.current || isAnimatingRef.current) return;
|
|
8673
|
+
const metrics = measureIndicator();
|
|
8674
|
+
if (!metrics) return;
|
|
8675
|
+
if (metricsRef.current && metricsApproxEqual2(metrics, metricsRef.current)) {
|
|
8676
|
+
return;
|
|
8677
|
+
}
|
|
8678
|
+
syncIndicator(metrics, false);
|
|
8679
|
+
};
|
|
8680
|
+
group.addEventListener("pointerover", refreshInteractionMetrics);
|
|
8681
|
+
group.addEventListener("pointerout", refreshInteractionMetrics);
|
|
8682
|
+
group.addEventListener("pointerdown", refreshInteractionMetrics);
|
|
8683
|
+
group.addEventListener("pointerup", refreshInteractionMetrics);
|
|
8684
|
+
group.addEventListener("pointercancel", refreshInteractionMetrics);
|
|
8685
|
+
return () => {
|
|
8686
|
+
group.removeEventListener("pointerover", refreshInteractionMetrics);
|
|
8687
|
+
group.removeEventListener("pointerout", refreshInteractionMetrics);
|
|
8688
|
+
group.removeEventListener("pointerdown", refreshInteractionMetrics);
|
|
8689
|
+
group.removeEventListener("pointerup", refreshInteractionMetrics);
|
|
8690
|
+
group.removeEventListener("pointercancel", refreshInteractionMetrics);
|
|
8691
|
+
};
|
|
8692
|
+
}, [direction, groupRef, measureIndicator, syncIndicator]);
|
|
8635
8693
|
return onIndicatorRef;
|
|
8636
8694
|
}
|
|
8637
8695
|
var Navigation = forwardRef35(
|
|
@@ -8642,7 +8700,7 @@ var Navigation = forwardRef35(
|
|
|
8642
8700
|
direction = "vertical",
|
|
8643
8701
|
dividingLine = false,
|
|
8644
8702
|
...props
|
|
8645
|
-
}, ref) => /* @__PURE__ */
|
|
8703
|
+
}, ref) => /* @__PURE__ */ jsx50(NavigationDirectionContext.Provider, { value: direction, children: /* @__PURE__ */ jsx50(
|
|
8646
8704
|
Tag2,
|
|
8647
8705
|
{
|
|
8648
8706
|
ref,
|
|
@@ -8656,7 +8714,7 @@ var Navigation = forwardRef35(
|
|
|
8656
8714
|
);
|
|
8657
8715
|
Navigation.displayName = "Navigation";
|
|
8658
8716
|
var NavigationBrand = forwardRef35(
|
|
8659
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
8717
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx50(
|
|
8660
8718
|
"div",
|
|
8661
8719
|
{
|
|
8662
8720
|
ref,
|
|
@@ -8668,24 +8726,24 @@ var NavigationBrand = forwardRef35(
|
|
|
8668
8726
|
NavigationBrand.displayName = "NavigationBrand";
|
|
8669
8727
|
var NavigationBrandTitle = forwardRef35(({ className, asChild = false, children, ...props }, ref) => {
|
|
8670
8728
|
const Comp = asChild ? Slot5 : "a";
|
|
8671
|
-
return /* @__PURE__ */
|
|
8729
|
+
return /* @__PURE__ */ jsx50(
|
|
8672
8730
|
Comp,
|
|
8673
8731
|
{
|
|
8674
8732
|
ref,
|
|
8675
8733
|
className: cn("aviala-navigation-brand__title aviala-focus-ring", className),
|
|
8676
8734
|
...props,
|
|
8677
|
-
children: asChild ? children : /* @__PURE__ */
|
|
8735
|
+
children: asChild ? children : /* @__PURE__ */ jsx50(Typography, { level: "text", as: "span", children })
|
|
8678
8736
|
}
|
|
8679
8737
|
);
|
|
8680
8738
|
});
|
|
8681
8739
|
NavigationBrandTitle.displayName = "NavigationBrandTitle";
|
|
8682
|
-
var NavigationSection = forwardRef35(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
8740
|
+
var NavigationSection = forwardRef35(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx50(
|
|
8683
8741
|
"div",
|
|
8684
8742
|
{
|
|
8685
8743
|
ref,
|
|
8686
8744
|
className: cn("aviala-navigation-section", className),
|
|
8687
8745
|
...props,
|
|
8688
|
-
children: /* @__PURE__ */
|
|
8746
|
+
children: /* @__PURE__ */ jsx50(Typography, { level: "caption", as: "p", children })
|
|
8689
8747
|
}
|
|
8690
8748
|
));
|
|
8691
8749
|
NavigationSection.displayName = "NavigationSection";
|
|
@@ -8699,7 +8757,7 @@ var NavigationGroup = forwardRef35(
|
|
|
8699
8757
|
direction,
|
|
8700
8758
|
layoutKey
|
|
8701
8759
|
);
|
|
8702
|
-
const setRefs =
|
|
8760
|
+
const setRefs = useCallback16(
|
|
8703
8761
|
(node) => {
|
|
8704
8762
|
groupRef.current = node;
|
|
8705
8763
|
if (typeof ref === "function") {
|
|
@@ -8710,14 +8768,14 @@ var NavigationGroup = forwardRef35(
|
|
|
8710
8768
|
},
|
|
8711
8769
|
[ref]
|
|
8712
8770
|
);
|
|
8713
|
-
return /* @__PURE__ */
|
|
8771
|
+
return /* @__PURE__ */ jsxs39(
|
|
8714
8772
|
"div",
|
|
8715
8773
|
{
|
|
8716
8774
|
ref: setRefs,
|
|
8717
8775
|
className: cn("aviala-navigation-group", className),
|
|
8718
8776
|
...props,
|
|
8719
8777
|
children: [
|
|
8720
|
-
/* @__PURE__ */
|
|
8778
|
+
/* @__PURE__ */ jsx50(
|
|
8721
8779
|
"span",
|
|
8722
8780
|
{
|
|
8723
8781
|
ref: onIndicatorRef,
|
|
@@ -8743,7 +8801,7 @@ var NavigationItemGroup = forwardRef35(({ className, expanded, children, ...prop
|
|
|
8743
8801
|
if (isCollapsed) inner.setAttribute("inert", "");
|
|
8744
8802
|
else inner.removeAttribute("inert");
|
|
8745
8803
|
}, [isCollapsed]);
|
|
8746
|
-
return /* @__PURE__ */
|
|
8804
|
+
return /* @__PURE__ */ jsx50(
|
|
8747
8805
|
"div",
|
|
8748
8806
|
{
|
|
8749
8807
|
ref,
|
|
@@ -8751,7 +8809,7 @@ var NavigationItemGroup = forwardRef35(({ className, expanded, children, ...prop
|
|
|
8751
8809
|
"data-expanded": isCollapsible ? expanded ? "true" : "false" : void 0,
|
|
8752
8810
|
"aria-hidden": isCollapsed ? true : void 0,
|
|
8753
8811
|
...props,
|
|
8754
|
-
children: isCollapsible ? /* @__PURE__ */
|
|
8812
|
+
children: isCollapsible ? /* @__PURE__ */ jsx50("div", { ref: innerRef, className: "aviala-navigation-item-group__inner", children }) : children
|
|
8755
8813
|
}
|
|
8756
8814
|
);
|
|
8757
8815
|
});
|
|
@@ -8762,7 +8820,7 @@ function renderItemIcon3(node) {
|
|
|
8762
8820
|
level: "text",
|
|
8763
8821
|
biggerSize: true
|
|
8764
8822
|
});
|
|
8765
|
-
return /* @__PURE__ */
|
|
8823
|
+
return /* @__PURE__ */ jsx50("span", { className: "aviala-navigation-item__icon", children: content });
|
|
8766
8824
|
}
|
|
8767
8825
|
var NavigationItem = forwardRef35(
|
|
8768
8826
|
({
|
|
@@ -8779,9 +8837,9 @@ var NavigationItem = forwardRef35(
|
|
|
8779
8837
|
const Comp = asChild ? Slot5 : "a";
|
|
8780
8838
|
const isActive = active ?? ariaCurrent === "page";
|
|
8781
8839
|
const mode = navigationItemButtonMode(isActive);
|
|
8782
|
-
const controlContent = /* @__PURE__ */
|
|
8840
|
+
const controlContent = /* @__PURE__ */ jsxs39(Fragment7, { children: [
|
|
8783
8841
|
renderItemIcon3(leftIcon),
|
|
8784
|
-
/* @__PURE__ */
|
|
8842
|
+
/* @__PURE__ */ jsx50(
|
|
8785
8843
|
Typography,
|
|
8786
8844
|
{
|
|
8787
8845
|
level: "text",
|
|
@@ -8790,15 +8848,15 @@ var NavigationItem = forwardRef35(
|
|
|
8790
8848
|
children
|
|
8791
8849
|
}
|
|
8792
8850
|
),
|
|
8793
|
-
rightIcon ? /* @__PURE__ */
|
|
8851
|
+
rightIcon ? /* @__PURE__ */ jsx50("span", { className: "aviala-navigation-item__chevron", children: renderItemIcon3(rightIcon) }) : null
|
|
8794
8852
|
] });
|
|
8795
|
-
return /* @__PURE__ */
|
|
8853
|
+
return /* @__PURE__ */ jsx50(
|
|
8796
8854
|
"span",
|
|
8797
8855
|
{
|
|
8798
8856
|
className: cn("aviala-navigation-item", className),
|
|
8799
8857
|
"data-item-type": itemType,
|
|
8800
8858
|
"data-active": isActive ? "true" : "false",
|
|
8801
|
-
children: /* @__PURE__ */
|
|
8859
|
+
children: /* @__PURE__ */ jsx50(
|
|
8802
8860
|
Comp,
|
|
8803
8861
|
{
|
|
8804
8862
|
ref,
|
|
@@ -8817,7 +8875,7 @@ var NavigationItem = forwardRef35(
|
|
|
8817
8875
|
}
|
|
8818
8876
|
);
|
|
8819
8877
|
NavigationItem.displayName = "NavigationItem";
|
|
8820
|
-
var NavigationActions = forwardRef35(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
8878
|
+
var NavigationActions = forwardRef35(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx50(
|
|
8821
8879
|
"div",
|
|
8822
8880
|
{
|
|
8823
8881
|
ref,
|
|
@@ -8827,7 +8885,7 @@ var NavigationActions = forwardRef35(({ className, children, ...props }, ref) =>
|
|
|
8827
8885
|
}
|
|
8828
8886
|
));
|
|
8829
8887
|
NavigationActions.displayName = "NavigationActions";
|
|
8830
|
-
var NavigationActionsSlot = forwardRef35(({ className, ...props }, ref) => /* @__PURE__ */
|
|
8888
|
+
var NavigationActionsSlot = forwardRef35(({ className, ...props }, ref) => /* @__PURE__ */ jsx50(
|
|
8831
8889
|
"div",
|
|
8832
8890
|
{
|
|
8833
8891
|
ref,
|
|
@@ -8853,28 +8911,28 @@ function NavigationItemMenu({
|
|
|
8853
8911
|
onOpenChange,
|
|
8854
8912
|
children
|
|
8855
8913
|
}) {
|
|
8856
|
-
const [internalValue, setInternalValue] =
|
|
8914
|
+
const [internalValue, setInternalValue] = useState16(defaultValue);
|
|
8857
8915
|
const isValueControlled = valueProp !== void 0;
|
|
8858
8916
|
const value = isValueControlled ? valueProp : internalValue;
|
|
8859
|
-
const [internalOpen, setInternalOpen] =
|
|
8917
|
+
const [internalOpen, setInternalOpen] = useState16(false);
|
|
8860
8918
|
const isOpenControlled = openProp !== void 0;
|
|
8861
8919
|
const open = isOpenControlled ? openProp : internalOpen;
|
|
8862
8920
|
const closeTimerRef = useRef12(null);
|
|
8863
8921
|
const openedByHoverRef = useRef12(false);
|
|
8864
|
-
const setOpen =
|
|
8922
|
+
const setOpen = useCallback16(
|
|
8865
8923
|
(nextOpen) => {
|
|
8866
8924
|
if (!isOpenControlled) setInternalOpen(nextOpen);
|
|
8867
8925
|
onOpenChange?.(nextOpen);
|
|
8868
8926
|
},
|
|
8869
8927
|
[isOpenControlled, onOpenChange]
|
|
8870
8928
|
);
|
|
8871
|
-
const cancelClose =
|
|
8929
|
+
const cancelClose = useCallback16(() => {
|
|
8872
8930
|
if (closeTimerRef.current != null) {
|
|
8873
8931
|
window.clearTimeout(closeTimerRef.current);
|
|
8874
8932
|
closeTimerRef.current = null;
|
|
8875
8933
|
}
|
|
8876
8934
|
}, []);
|
|
8877
|
-
const openMenu =
|
|
8935
|
+
const openMenu = useCallback16(
|
|
8878
8936
|
(viaHover) => {
|
|
8879
8937
|
cancelClose();
|
|
8880
8938
|
openedByHoverRef.current = viaHover;
|
|
@@ -8882,14 +8940,14 @@ function NavigationItemMenu({
|
|
|
8882
8940
|
},
|
|
8883
8941
|
[cancelClose, setOpen]
|
|
8884
8942
|
);
|
|
8885
|
-
const scheduleClose =
|
|
8943
|
+
const scheduleClose = useCallback16(() => {
|
|
8886
8944
|
cancelClose();
|
|
8887
8945
|
closeTimerRef.current = window.setTimeout(() => {
|
|
8888
8946
|
closeTimerRef.current = null;
|
|
8889
8947
|
setOpen(false);
|
|
8890
8948
|
}, NAVIGATION_MENU_CLOSE_DELAY_MS);
|
|
8891
8949
|
}, [cancelClose, setOpen]);
|
|
8892
|
-
const select =
|
|
8950
|
+
const select = useCallback16(
|
|
8893
8951
|
(nextValue) => {
|
|
8894
8952
|
if (!isValueControlled) setInternalValue(nextValue);
|
|
8895
8953
|
onValueChange?.(nextValue);
|
|
@@ -8898,8 +8956,8 @@ function NavigationItemMenu({
|
|
|
8898
8956
|
},
|
|
8899
8957
|
[cancelClose, isValueControlled, onValueChange, setOpen]
|
|
8900
8958
|
);
|
|
8901
|
-
|
|
8902
|
-
const contextValue =
|
|
8959
|
+
useEffect11(() => cancelClose, [cancelClose]);
|
|
8960
|
+
const contextValue = useMemo10(
|
|
8903
8961
|
() => ({
|
|
8904
8962
|
value,
|
|
8905
8963
|
hasSelection: value != null && value !== "",
|
|
@@ -8911,7 +8969,7 @@ function NavigationItemMenu({
|
|
|
8911
8969
|
}),
|
|
8912
8970
|
[cancelClose, openMenu, scheduleClose, select, value]
|
|
8913
8971
|
);
|
|
8914
|
-
const handleOpenChange =
|
|
8972
|
+
const handleOpenChange = useCallback16(
|
|
8915
8973
|
(nextOpen) => {
|
|
8916
8974
|
if (nextOpen) openedByHoverRef.current = false;
|
|
8917
8975
|
cancelClose();
|
|
@@ -8919,7 +8977,7 @@ function NavigationItemMenu({
|
|
|
8919
8977
|
},
|
|
8920
8978
|
[cancelClose, setOpen]
|
|
8921
8979
|
);
|
|
8922
|
-
return /* @__PURE__ */
|
|
8980
|
+
return /* @__PURE__ */ jsx50(NavigationItemMenuContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx50(Popover, { open, onOpenChange: handleOpenChange, children }) });
|
|
8923
8981
|
}
|
|
8924
8982
|
var NavigationItemMenuTrigger = forwardRef35(
|
|
8925
8983
|
({
|
|
@@ -8933,7 +8991,7 @@ var NavigationItemMenuTrigger = forwardRef35(
|
|
|
8933
8991
|
const menu = useNavigationItemMenuContext("NavigationItemMenuTrigger");
|
|
8934
8992
|
const isActive = active ?? menu.hasSelection;
|
|
8935
8993
|
const mode = navigationItemButtonMode(isActive);
|
|
8936
|
-
return /* @__PURE__ */
|
|
8994
|
+
return /* @__PURE__ */ jsx50(
|
|
8937
8995
|
"span",
|
|
8938
8996
|
{
|
|
8939
8997
|
className: cn("aviala-navigation-item", className),
|
|
@@ -8941,7 +8999,7 @@ var NavigationItemMenuTrigger = forwardRef35(
|
|
|
8941
8999
|
"data-active": isActive ? "true" : "false",
|
|
8942
9000
|
onMouseEnter: () => menu.openMenu(true),
|
|
8943
9001
|
onMouseLeave: menu.scheduleClose,
|
|
8944
|
-
children: /* @__PURE__ */
|
|
9002
|
+
children: /* @__PURE__ */ jsx50(PopoverPrimitive7.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs39(
|
|
8945
9003
|
"button",
|
|
8946
9004
|
{
|
|
8947
9005
|
ref,
|
|
@@ -8954,7 +9012,7 @@ var NavigationItemMenuTrigger = forwardRef35(
|
|
|
8954
9012
|
...props,
|
|
8955
9013
|
children: [
|
|
8956
9014
|
renderItemIcon3(leftIcon),
|
|
8957
|
-
/* @__PURE__ */
|
|
9015
|
+
/* @__PURE__ */ jsx50(
|
|
8958
9016
|
Typography,
|
|
8959
9017
|
{
|
|
8960
9018
|
level: "text",
|
|
@@ -8963,7 +9021,7 @@ var NavigationItemMenuTrigger = forwardRef35(
|
|
|
8963
9021
|
children
|
|
8964
9022
|
}
|
|
8965
9023
|
),
|
|
8966
|
-
rightIcon ? /* @__PURE__ */
|
|
9024
|
+
rightIcon ? /* @__PURE__ */ jsx50("span", { className: "aviala-navigation-item__chevron", children: renderItemIcon3(rightIcon) }) : null
|
|
8967
9025
|
]
|
|
8968
9026
|
}
|
|
8969
9027
|
) })
|
|
@@ -8984,7 +9042,7 @@ var NavigationItemMenuContent = forwardRef35(
|
|
|
8984
9042
|
}, ref) => {
|
|
8985
9043
|
const direction = useNavigationDirection();
|
|
8986
9044
|
const menu = useNavigationItemMenuContext("NavigationItemMenuContent");
|
|
8987
|
-
return /* @__PURE__ */
|
|
9045
|
+
return /* @__PURE__ */ jsx50(PopoverPrimitive7.Portal, { children: /* @__PURE__ */ jsx50(
|
|
8988
9046
|
PopoverPrimitive7.Content,
|
|
8989
9047
|
{
|
|
8990
9048
|
ref,
|
|
@@ -9019,7 +9077,7 @@ var NavigationItemMenuItem = forwardRef35(
|
|
|
9019
9077
|
}, ref) => {
|
|
9020
9078
|
const menu = useNavigationItemMenuContext("NavigationItemMenuItem");
|
|
9021
9079
|
const isSelected = selected ?? menu.value === value;
|
|
9022
|
-
return /* @__PURE__ */
|
|
9080
|
+
return /* @__PURE__ */ jsxs39(
|
|
9023
9081
|
"button",
|
|
9024
9082
|
{
|
|
9025
9083
|
ref,
|
|
@@ -9039,7 +9097,7 @@ var NavigationItemMenuItem = forwardRef35(
|
|
|
9039
9097
|
...props,
|
|
9040
9098
|
children: [
|
|
9041
9099
|
renderItemIcon3(leftIcon),
|
|
9042
|
-
/* @__PURE__ */
|
|
9100
|
+
/* @__PURE__ */ jsx50(
|
|
9043
9101
|
Typography,
|
|
9044
9102
|
{
|
|
9045
9103
|
level: "text",
|
|
@@ -9048,7 +9106,7 @@ var NavigationItemMenuItem = forwardRef35(
|
|
|
9048
9106
|
children
|
|
9049
9107
|
}
|
|
9050
9108
|
),
|
|
9051
|
-
rightIcon ? /* @__PURE__ */
|
|
9109
|
+
rightIcon ? /* @__PURE__ */ jsx50("span", { className: "aviala-navigation-menu-item__trailing", children: renderItemIcon3(rightIcon) }) : null
|
|
9052
9110
|
]
|
|
9053
9111
|
}
|
|
9054
9112
|
);
|
|
@@ -9060,7 +9118,7 @@ NavigationItemMenuItem.displayName = "NavigationItemMenuItem";
|
|
|
9060
9118
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
9061
9119
|
import { cva as cva13 } from "class-variance-authority";
|
|
9062
9120
|
import { forwardRef as forwardRef36 } from "react";
|
|
9063
|
-
import { jsx as
|
|
9121
|
+
import { jsx as jsx51, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
9064
9122
|
var sliderVariants = cva13("aviala-slider", {
|
|
9065
9123
|
variants: {
|
|
9066
9124
|
size: {
|
|
@@ -9094,7 +9152,7 @@ var Slider = forwardRef36(
|
|
|
9094
9152
|
const isRange = resolvedType === "range";
|
|
9095
9153
|
const resolvedDefaultValue = defaultValue ?? (isRange ? [25, 75] : [50]);
|
|
9096
9154
|
const thumbCount = isRange ? Math.max(2, value?.length ?? defaultValue?.length ?? 2) : 1;
|
|
9097
|
-
return /* @__PURE__ */
|
|
9155
|
+
return /* @__PURE__ */ jsxs40(
|
|
9098
9156
|
SliderPrimitive.Root,
|
|
9099
9157
|
{
|
|
9100
9158
|
ref,
|
|
@@ -9112,8 +9170,8 @@ var Slider = forwardRef36(
|
|
|
9112
9170
|
"data-disabled": disabled ? "true" : void 0,
|
|
9113
9171
|
...props,
|
|
9114
9172
|
children: [
|
|
9115
|
-
/* @__PURE__ */
|
|
9116
|
-
Array.from({ length: thumbCount }, (_, index) => /* @__PURE__ */
|
|
9173
|
+
/* @__PURE__ */ jsx51(SliderPrimitive.Track, { className: "aviala-slider__track", children: /* @__PURE__ */ jsx51(SliderPrimitive.Range, { className: "aviala-slider__range" }) }),
|
|
9174
|
+
Array.from({ length: thumbCount }, (_, index) => /* @__PURE__ */ jsx51(SliderPrimitive.Thumb, { className: "aviala-slider__thumb aviala-focus-ring" }, index))
|
|
9117
9175
|
]
|
|
9118
9176
|
}
|
|
9119
9177
|
);
|
|
@@ -9127,9 +9185,9 @@ import { cva as cva14 } from "class-variance-authority";
|
|
|
9127
9185
|
import {
|
|
9128
9186
|
forwardRef as forwardRef37,
|
|
9129
9187
|
useRef as useRef13,
|
|
9130
|
-
useState as
|
|
9188
|
+
useState as useState17
|
|
9131
9189
|
} from "react";
|
|
9132
|
-
import { jsx as
|
|
9190
|
+
import { jsx as jsx52, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
9133
9191
|
var uploadVariants = cva14("aviala-upload aviala-focus-ring", {
|
|
9134
9192
|
variants: {
|
|
9135
9193
|
style: {
|
|
@@ -9160,7 +9218,7 @@ var Upload = forwardRef37(
|
|
|
9160
9218
|
...props
|
|
9161
9219
|
}, ref) => {
|
|
9162
9220
|
const inputRef = useRef13(null);
|
|
9163
|
-
const [dragging, setDragging] =
|
|
9221
|
+
const [dragging, setDragging] = useState17(false);
|
|
9164
9222
|
const resolvedStyle = style ?? "default";
|
|
9165
9223
|
const allowDrag = dragAndDrop ?? resolvedStyle === "large";
|
|
9166
9224
|
const openPicker = () => {
|
|
@@ -9179,7 +9237,7 @@ var Upload = forwardRef37(
|
|
|
9179
9237
|
onChange?.(event.dataTransfer.files);
|
|
9180
9238
|
}
|
|
9181
9239
|
};
|
|
9182
|
-
return /* @__PURE__ */
|
|
9240
|
+
return /* @__PURE__ */ jsxs41(
|
|
9183
9241
|
"div",
|
|
9184
9242
|
{
|
|
9185
9243
|
ref,
|
|
@@ -9210,7 +9268,7 @@ var Upload = forwardRef37(
|
|
|
9210
9268
|
onDrop: handleDrop,
|
|
9211
9269
|
...props,
|
|
9212
9270
|
children: [
|
|
9213
|
-
/* @__PURE__ */
|
|
9271
|
+
/* @__PURE__ */ jsx52(
|
|
9214
9272
|
"input",
|
|
9215
9273
|
{
|
|
9216
9274
|
ref: inputRef,
|
|
@@ -9225,8 +9283,8 @@ var Upload = forwardRef37(
|
|
|
9225
9283
|
...inputProps
|
|
9226
9284
|
}
|
|
9227
9285
|
),
|
|
9228
|
-
/* @__PURE__ */
|
|
9229
|
-
resolvedStyle === "large" ? /* @__PURE__ */
|
|
9286
|
+
/* @__PURE__ */ jsx52("span", { className: "aviala-upload__icon", "aria-hidden": true, children: /* @__PURE__ */ jsx52(GeneralUpload, { width: 16, height: 16 }) }),
|
|
9287
|
+
resolvedStyle === "large" ? /* @__PURE__ */ jsx52(
|
|
9230
9288
|
Typeface,
|
|
9231
9289
|
{
|
|
9232
9290
|
className: "aviala-upload__typeface",
|
|
@@ -9234,7 +9292,7 @@ var Upload = forwardRef37(
|
|
|
9234
9292
|
primary: title,
|
|
9235
9293
|
secondary: description
|
|
9236
9294
|
}
|
|
9237
|
-
) : /* @__PURE__ */
|
|
9295
|
+
) : /* @__PURE__ */ jsx52(Typography, { level: "text", as: "span", className: "aviala-upload__label", children: label })
|
|
9238
9296
|
]
|
|
9239
9297
|
}
|
|
9240
9298
|
);
|
|
@@ -9244,14 +9302,14 @@ Upload.displayName = "Upload";
|
|
|
9244
9302
|
|
|
9245
9303
|
// src/components/scroll-picker.tsx
|
|
9246
9304
|
import {
|
|
9247
|
-
useCallback as
|
|
9248
|
-
useEffect as
|
|
9305
|
+
useCallback as useCallback17,
|
|
9306
|
+
useEffect as useEffect12,
|
|
9249
9307
|
useId as useId5,
|
|
9250
9308
|
useLayoutEffect as useLayoutEffect7,
|
|
9251
|
-
useMemo as
|
|
9309
|
+
useMemo as useMemo11,
|
|
9252
9310
|
useRef as useRef14
|
|
9253
9311
|
} from "react";
|
|
9254
|
-
import { jsx as
|
|
9312
|
+
import { jsx as jsx53, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
9255
9313
|
var LOOP_SECTIONS2 = 3;
|
|
9256
9314
|
var MIDDLE_SECTION2 = 1;
|
|
9257
9315
|
function normalizeIndex2(index, length) {
|
|
@@ -9279,7 +9337,7 @@ function fractionalIndexAtScrollTop(metrics, scrollTop) {
|
|
|
9279
9337
|
return (scrollTop - metrics.originTop) / metrics.pitch;
|
|
9280
9338
|
}
|
|
9281
9339
|
function ScrollPicker({ className, children, ...props }) {
|
|
9282
|
-
return /* @__PURE__ */
|
|
9340
|
+
return /* @__PURE__ */ jsx53("div", { className: cn("aviala-scroll-picker", className), ...props, children });
|
|
9283
9341
|
}
|
|
9284
9342
|
function ScrollPickerColumn({
|
|
9285
9343
|
className,
|
|
@@ -9300,18 +9358,18 @@ function ScrollPickerColumn({
|
|
|
9300
9358
|
const selectedValueRef = useRef14(value);
|
|
9301
9359
|
const reactId = useId5();
|
|
9302
9360
|
selectedValueRef.current = value;
|
|
9303
|
-
const getIndex =
|
|
9361
|
+
const getIndex = useCallback17(
|
|
9304
9362
|
(candidate) => {
|
|
9305
9363
|
const index = values.findIndex((item) => Object.is(item, candidate));
|
|
9306
9364
|
return index >= 0 ? index : 0;
|
|
9307
9365
|
},
|
|
9308
9366
|
[values]
|
|
9309
9367
|
);
|
|
9310
|
-
const repeatedValues =
|
|
9368
|
+
const repeatedValues = useMemo11(() => {
|
|
9311
9369
|
if (!loop) return [...values];
|
|
9312
9370
|
return Array.from({ length: LOOP_SECTIONS2 }, () => values).flat();
|
|
9313
9371
|
}, [loop, values]);
|
|
9314
|
-
const scrollToIndex =
|
|
9372
|
+
const scrollToIndex = useCallback17((index, behavior = "auto") => {
|
|
9315
9373
|
const container = scrollRef.current;
|
|
9316
9374
|
if (!container) return;
|
|
9317
9375
|
const metrics = readMetrics(container);
|
|
@@ -9319,7 +9377,7 @@ function ScrollPickerColumn({
|
|
|
9319
9377
|
isProgrammaticScrollRef.current = true;
|
|
9320
9378
|
container.scrollTo({ top: scrollTopForIndex(container, metrics, index), behavior });
|
|
9321
9379
|
}, []);
|
|
9322
|
-
const scrollToValue =
|
|
9380
|
+
const scrollToValue = useCallback17(
|
|
9323
9381
|
(nextValue, behavior = "smooth") => {
|
|
9324
9382
|
if (behavior === "smooth") {
|
|
9325
9383
|
smoothTargetValueRef.current = nextValue;
|
|
@@ -9332,7 +9390,7 @@ function ScrollPickerColumn({
|
|
|
9332
9390
|
},
|
|
9333
9391
|
[getIndex, loop, scrollToIndex, values.length]
|
|
9334
9392
|
);
|
|
9335
|
-
const settleScroll =
|
|
9393
|
+
const settleScroll = useCallback17(() => {
|
|
9336
9394
|
const container = scrollRef.current;
|
|
9337
9395
|
if (!container || isProgrammaticScrollRef.current) {
|
|
9338
9396
|
isProgrammaticScrollRef.current = false;
|
|
@@ -9378,7 +9436,7 @@ function ScrollPickerColumn({
|
|
|
9378
9436
|
isUserScrollingRef.current = false;
|
|
9379
9437
|
wheelAccumRef.current = 0;
|
|
9380
9438
|
}, [loop, onChange, values]);
|
|
9381
|
-
const handleScroll =
|
|
9439
|
+
const handleScroll = useCallback17(() => {
|
|
9382
9440
|
if (isProgrammaticScrollRef.current) return;
|
|
9383
9441
|
isUserScrollingRef.current = true;
|
|
9384
9442
|
if (scrollEndTimerRef.current) {
|
|
@@ -9401,7 +9459,7 @@ function ScrollPickerColumn({
|
|
|
9401
9459
|
if (Math.abs(container.scrollTop - targetTop) <= 1) return;
|
|
9402
9460
|
scrollToIndex(targetIndex, "auto");
|
|
9403
9461
|
}, [getIndex, loop, scrollToIndex, value, values.length]);
|
|
9404
|
-
|
|
9462
|
+
useEffect12(() => {
|
|
9405
9463
|
const container = scrollRef.current;
|
|
9406
9464
|
if (!container) return;
|
|
9407
9465
|
const onScrollEnd = () => {
|
|
@@ -9418,7 +9476,7 @@ function ScrollPickerColumn({
|
|
|
9418
9476
|
}
|
|
9419
9477
|
};
|
|
9420
9478
|
}, [settleScroll]);
|
|
9421
|
-
|
|
9479
|
+
useEffect12(() => {
|
|
9422
9480
|
const container = scrollRef.current;
|
|
9423
9481
|
if (!container) return;
|
|
9424
9482
|
const onWheel = (event) => {
|
|
@@ -9476,9 +9534,9 @@ function ScrollPickerColumn({
|
|
|
9476
9534
|
}
|
|
9477
9535
|
};
|
|
9478
9536
|
const selectedOptionId = `${reactId}-${getIndex(value)}`;
|
|
9479
|
-
return /* @__PURE__ */
|
|
9480
|
-
/* @__PURE__ */
|
|
9481
|
-
/* @__PURE__ */
|
|
9537
|
+
return /* @__PURE__ */ jsx53("div", { className: cn("aviala-scroll-picker-column", className), children: /* @__PURE__ */ jsxs42("div", { className: "aviala-scroll-picker-column__viewport", children: [
|
|
9538
|
+
/* @__PURE__ */ jsx53("div", { className: "aviala-scroll-picker-column__highlight", "aria-hidden": true }),
|
|
9539
|
+
/* @__PURE__ */ jsx53(
|
|
9482
9540
|
"div",
|
|
9483
9541
|
{
|
|
9484
9542
|
ref: scrollRef,
|
|
@@ -9489,12 +9547,12 @@ function ScrollPickerColumn({
|
|
|
9489
9547
|
"aria-activedescendant": selectedOptionId,
|
|
9490
9548
|
tabIndex: 0,
|
|
9491
9549
|
onKeyDown: handleKeyDown,
|
|
9492
|
-
children: /* @__PURE__ */
|
|
9550
|
+
children: /* @__PURE__ */ jsx53("ul", { className: "aviala-scroll-picker-column__list", children: repeatedValues.map((itemValue, index) => {
|
|
9493
9551
|
const isSelected = Object.is(itemValue, value);
|
|
9494
9552
|
const valueIndex = loop ? normalizeIndex2(index, values.length) : index;
|
|
9495
9553
|
const optionId = `${reactId}-${loop ? index : valueIndex}`;
|
|
9496
9554
|
const key = getValueKey?.(itemValue, index) ?? `${String(itemValue)}-${index}`;
|
|
9497
|
-
return /* @__PURE__ */
|
|
9555
|
+
return /* @__PURE__ */ jsx53("li", { className: "contents", children: /* @__PURE__ */ jsx53(
|
|
9498
9556
|
ScrollPickerItem,
|
|
9499
9557
|
{
|
|
9500
9558
|
id: isSelected ? selectedOptionId : optionId,
|
|
@@ -9520,7 +9578,7 @@ function ScrollPickerItem({
|
|
|
9520
9578
|
className,
|
|
9521
9579
|
onSelect
|
|
9522
9580
|
}) {
|
|
9523
|
-
return /* @__PURE__ */
|
|
9581
|
+
return /* @__PURE__ */ jsx53(
|
|
9524
9582
|
"button",
|
|
9525
9583
|
{
|
|
9526
9584
|
type: "button",
|
|
@@ -9546,11 +9604,11 @@ import { cva as cva15 } from "class-variance-authority";
|
|
|
9546
9604
|
import {
|
|
9547
9605
|
createContext as createContext9,
|
|
9548
9606
|
forwardRef as forwardRef38,
|
|
9549
|
-
useCallback as
|
|
9607
|
+
useCallback as useCallback18,
|
|
9550
9608
|
useContext as useContext9,
|
|
9551
|
-
useState as
|
|
9609
|
+
useState as useState18
|
|
9552
9610
|
} from "react";
|
|
9553
|
-
import { Fragment as Fragment8, jsx as
|
|
9611
|
+
import { Fragment as Fragment8, jsx as jsx54, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
9554
9612
|
var BreadcrumbSizeContext = createContext9("default");
|
|
9555
9613
|
function breadcrumbTypeLevel(size) {
|
|
9556
9614
|
return size === "small" ? "caption" : "text";
|
|
@@ -9569,7 +9627,7 @@ var breadcrumbVariants = cva15("aviala-breadcrumb", {
|
|
|
9569
9627
|
var Breadcrumb = forwardRef38(
|
|
9570
9628
|
({ className, size = "default", children, ...props }, ref) => {
|
|
9571
9629
|
const resolvedSize = size ?? "default";
|
|
9572
|
-
return /* @__PURE__ */
|
|
9630
|
+
return /* @__PURE__ */ jsx54(BreadcrumbSizeContext.Provider, { value: resolvedSize, children: /* @__PURE__ */ jsx54(
|
|
9573
9631
|
"nav",
|
|
9574
9632
|
{
|
|
9575
9633
|
ref,
|
|
@@ -9577,7 +9635,7 @@ var Breadcrumb = forwardRef38(
|
|
|
9577
9635
|
className: cn(breadcrumbVariants({ size: resolvedSize }), className),
|
|
9578
9636
|
"data-size": resolvedSize,
|
|
9579
9637
|
...props,
|
|
9580
|
-
children: /* @__PURE__ */
|
|
9638
|
+
children: /* @__PURE__ */ jsx54("ol", { className: "aviala-breadcrumb__list", children })
|
|
9581
9639
|
}
|
|
9582
9640
|
) });
|
|
9583
9641
|
}
|
|
@@ -9586,9 +9644,9 @@ Breadcrumb.displayName = "Breadcrumb";
|
|
|
9586
9644
|
var BreadcrumbItem = forwardRef38(
|
|
9587
9645
|
({ className, href, current = false, icon, onClick, children, ...props }, ref) => {
|
|
9588
9646
|
const size = useContext9(BreadcrumbSizeContext);
|
|
9589
|
-
const label = /* @__PURE__ */
|
|
9590
|
-
icon ? /* @__PURE__ */
|
|
9591
|
-
children != null ? /* @__PURE__ */
|
|
9647
|
+
const label = /* @__PURE__ */ jsxs43(Fragment8, { children: [
|
|
9648
|
+
icon ? /* @__PURE__ */ jsx54("span", { className: "aviala-breadcrumb-item__icon", children: icon }) : null,
|
|
9649
|
+
children != null ? /* @__PURE__ */ jsx54(
|
|
9592
9650
|
Typography,
|
|
9593
9651
|
{
|
|
9594
9652
|
level: breadcrumbTypeLevel(size),
|
|
@@ -9598,13 +9656,13 @@ var BreadcrumbItem = forwardRef38(
|
|
|
9598
9656
|
}
|
|
9599
9657
|
) : null
|
|
9600
9658
|
] });
|
|
9601
|
-
return /* @__PURE__ */
|
|
9659
|
+
return /* @__PURE__ */ jsx54(
|
|
9602
9660
|
"li",
|
|
9603
9661
|
{
|
|
9604
9662
|
ref,
|
|
9605
9663
|
className: cn("aviala-breadcrumb-item-wrap", className),
|
|
9606
9664
|
...props,
|
|
9607
|
-
children: href != null ? /* @__PURE__ */
|
|
9665
|
+
children: href != null ? /* @__PURE__ */ jsx54(
|
|
9608
9666
|
"a",
|
|
9609
9667
|
{
|
|
9610
9668
|
href,
|
|
@@ -9613,7 +9671,7 @@ var BreadcrumbItem = forwardRef38(
|
|
|
9613
9671
|
"aria-current": current ? "page" : void 0,
|
|
9614
9672
|
children: label
|
|
9615
9673
|
}
|
|
9616
|
-
) : onClick != null ? /* @__PURE__ */
|
|
9674
|
+
) : onClick != null ? /* @__PURE__ */ jsx54(
|
|
9617
9675
|
"button",
|
|
9618
9676
|
{
|
|
9619
9677
|
type: "button",
|
|
@@ -9623,7 +9681,7 @@ var BreadcrumbItem = forwardRef38(
|
|
|
9623
9681
|
onClick,
|
|
9624
9682
|
children: label
|
|
9625
9683
|
}
|
|
9626
|
-
) : /* @__PURE__ */
|
|
9684
|
+
) : /* @__PURE__ */ jsx54(
|
|
9627
9685
|
"span",
|
|
9628
9686
|
{
|
|
9629
9687
|
className: "aviala-breadcrumb-item",
|
|
@@ -9640,7 +9698,7 @@ BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
|
9640
9698
|
var BreadcrumbSeparator = forwardRef38(
|
|
9641
9699
|
({ className, children = "/", ...props }, ref) => {
|
|
9642
9700
|
const size = useContext9(BreadcrumbSizeContext);
|
|
9643
|
-
return /* @__PURE__ */
|
|
9701
|
+
return /* @__PURE__ */ jsx54(
|
|
9644
9702
|
"li",
|
|
9645
9703
|
{
|
|
9646
9704
|
ref,
|
|
@@ -9648,7 +9706,7 @@ var BreadcrumbSeparator = forwardRef38(
|
|
|
9648
9706
|
"aria-hidden": true,
|
|
9649
9707
|
className: cn("aviala-breadcrumb-separator", className),
|
|
9650
9708
|
...props,
|
|
9651
|
-
children: /* @__PURE__ */
|
|
9709
|
+
children: /* @__PURE__ */ jsx54(Typography, { level: breadcrumbTypeLevel(size), as: "span", children })
|
|
9652
9710
|
}
|
|
9653
9711
|
);
|
|
9654
9712
|
}
|
|
@@ -9663,12 +9721,12 @@ var BreadcrumbEllipsisItem = forwardRef38(
|
|
|
9663
9721
|
children,
|
|
9664
9722
|
...props
|
|
9665
9723
|
}, ref) => {
|
|
9666
|
-
const content = /* @__PURE__ */
|
|
9667
|
-
/* @__PURE__ */
|
|
9668
|
-
showChevron ? /* @__PURE__ */
|
|
9724
|
+
const content = /* @__PURE__ */ jsxs43(Fragment8, { children: [
|
|
9725
|
+
/* @__PURE__ */ jsx54(Typography, { level: "text", as: "span", className: "aviala-breadcrumb-ellipsis-item__label", children }),
|
|
9726
|
+
showChevron ? /* @__PURE__ */ jsx54("span", { className: "aviala-breadcrumb-ellipsis-item__chevron", "aria-hidden": true, children: /* @__PURE__ */ jsx54(DirectionArrowRightLight3, { width: 14, height: 14, thickness: "Light" }) }) : null
|
|
9669
9727
|
] });
|
|
9670
9728
|
if (href != null) {
|
|
9671
|
-
return /* @__PURE__ */
|
|
9729
|
+
return /* @__PURE__ */ jsx54(
|
|
9672
9730
|
"a",
|
|
9673
9731
|
{
|
|
9674
9732
|
ref,
|
|
@@ -9680,7 +9738,7 @@ var BreadcrumbEllipsisItem = forwardRef38(
|
|
|
9680
9738
|
}
|
|
9681
9739
|
);
|
|
9682
9740
|
}
|
|
9683
|
-
return /* @__PURE__ */
|
|
9741
|
+
return /* @__PURE__ */ jsx54(
|
|
9684
9742
|
"button",
|
|
9685
9743
|
{
|
|
9686
9744
|
ref,
|
|
@@ -9707,10 +9765,10 @@ var BreadcrumbEllipsis = forwardRef38(
|
|
|
9707
9765
|
...props
|
|
9708
9766
|
}, ref) => {
|
|
9709
9767
|
const size = useContext9(BreadcrumbSizeContext);
|
|
9710
|
-
const [uncontrolledActivated, setUncontrolledActivated] =
|
|
9768
|
+
const [uncontrolledActivated, setUncontrolledActivated] = useState18(defaultActivated);
|
|
9711
9769
|
const isControlled = activatedProp !== void 0;
|
|
9712
9770
|
const activated = isControlled ? Boolean(activatedProp) : uncontrolledActivated;
|
|
9713
|
-
const setActivated =
|
|
9771
|
+
const setActivated = useCallback18(
|
|
9714
9772
|
(next) => {
|
|
9715
9773
|
if (!isControlled) setUncontrolledActivated(next);
|
|
9716
9774
|
onActivatedChange?.(next);
|
|
@@ -9718,8 +9776,8 @@ var BreadcrumbEllipsis = forwardRef38(
|
|
|
9718
9776
|
[isControlled, onActivatedChange]
|
|
9719
9777
|
);
|
|
9720
9778
|
const iconSize = 14;
|
|
9721
|
-
const icon = children ?? /* @__PURE__ */
|
|
9722
|
-
const trigger = /* @__PURE__ */
|
|
9779
|
+
const icon = children ?? /* @__PURE__ */ jsx54(SymbolMore, { width: iconSize, height: iconSize, thickness: "Light", "aria-hidden": true });
|
|
9780
|
+
const trigger = /* @__PURE__ */ jsx54(
|
|
9723
9781
|
"button",
|
|
9724
9782
|
{
|
|
9725
9783
|
type: "button",
|
|
@@ -9738,9 +9796,9 @@ var BreadcrumbEllipsis = forwardRef38(
|
|
|
9738
9796
|
children: icon
|
|
9739
9797
|
}
|
|
9740
9798
|
);
|
|
9741
|
-
return /* @__PURE__ */
|
|
9742
|
-
/* @__PURE__ */
|
|
9743
|
-
/* @__PURE__ */
|
|
9799
|
+
return /* @__PURE__ */ jsx54("li", { ref, className: cn("aviala-breadcrumb-ellipsis-wrap", className), children: menu != null ? /* @__PURE__ */ jsxs43(Popover, { open: activated, onOpenChange: setActivated, children: [
|
|
9800
|
+
/* @__PURE__ */ jsx54(PopoverTrigger, { asChild: true, children: trigger }),
|
|
9801
|
+
/* @__PURE__ */ jsx54(
|
|
9744
9802
|
PopoverContent,
|
|
9745
9803
|
{
|
|
9746
9804
|
className: "aviala-breadcrumb-ellipsis-menu",
|
|
@@ -9749,7 +9807,7 @@ var BreadcrumbEllipsis = forwardRef38(
|
|
|
9749
9807
|
sideOffset: 7,
|
|
9750
9808
|
showArrow: false,
|
|
9751
9809
|
role: "menu",
|
|
9752
|
-
children: /* @__PURE__ */
|
|
9810
|
+
children: /* @__PURE__ */ jsx54("div", { className: "aviala-breadcrumb-ellipsis-menu__items", children: menu })
|
|
9753
9811
|
}
|
|
9754
9812
|
)
|
|
9755
9813
|
] }) : trigger });
|
|
@@ -9761,7 +9819,7 @@ BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis";
|
|
|
9761
9819
|
import {
|
|
9762
9820
|
forwardRef as forwardRef39
|
|
9763
9821
|
} from "react";
|
|
9764
|
-
import { jsx as
|
|
9822
|
+
import { jsx as jsx55, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
9765
9823
|
var Pagehead = forwardRef39(
|
|
9766
9824
|
({
|
|
9767
9825
|
className,
|
|
@@ -9772,16 +9830,16 @@ var Pagehead = forwardRef39(
|
|
|
9772
9830
|
actions,
|
|
9773
9831
|
children,
|
|
9774
9832
|
...props
|
|
9775
|
-
}, ref) => /* @__PURE__ */
|
|
9776
|
-
/* @__PURE__ */
|
|
9777
|
-
back != null ? /* @__PURE__ */
|
|
9778
|
-
/* @__PURE__ */
|
|
9779
|
-
breadcrumb != null ? /* @__PURE__ */
|
|
9780
|
-
title != null || description != null ? /* @__PURE__ */
|
|
9833
|
+
}, ref) => /* @__PURE__ */ jsxs44("header", { ref, className: cn("aviala-pagehead", className), ...props, children: [
|
|
9834
|
+
/* @__PURE__ */ jsxs44("div", { className: "aviala-pagehead__main", children: [
|
|
9835
|
+
back != null ? /* @__PURE__ */ jsx55("div", { className: "aviala-pagehead__back", children: back }) : null,
|
|
9836
|
+
/* @__PURE__ */ jsxs44("div", { className: "aviala-pagehead__title-block", children: [
|
|
9837
|
+
breadcrumb != null ? /* @__PURE__ */ jsx55("div", { className: "aviala-pagehead__breadcrumb", children: breadcrumb }) : null,
|
|
9838
|
+
title != null || description != null ? /* @__PURE__ */ jsx55("div", { className: "aviala-pagehead__title", children: /* @__PURE__ */ jsx55(Typeface, { content: "textCaption", primary: title, secondary: description }) }) : null,
|
|
9781
9839
|
children
|
|
9782
9840
|
] })
|
|
9783
9841
|
] }),
|
|
9784
|
-
actions != null ? /* @__PURE__ */
|
|
9842
|
+
actions != null ? /* @__PURE__ */ jsx55("div", { className: "aviala-pagehead__actions", children: actions }) : null
|
|
9785
9843
|
] })
|
|
9786
9844
|
);
|
|
9787
9845
|
Pagehead.displayName = "Pagehead";
|
|
@@ -9796,7 +9854,7 @@ import { cva as cva16 } from "class-variance-authority";
|
|
|
9796
9854
|
import {
|
|
9797
9855
|
forwardRef as forwardRef40
|
|
9798
9856
|
} from "react";
|
|
9799
|
-
import { jsx as
|
|
9857
|
+
import { jsx as jsx56, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
9800
9858
|
var stepsVariants = cva16("aviala-steps", {
|
|
9801
9859
|
variants: {
|
|
9802
9860
|
direction: {
|
|
@@ -9809,7 +9867,7 @@ var stepsVariants = cva16("aviala-steps", {
|
|
|
9809
9867
|
}
|
|
9810
9868
|
});
|
|
9811
9869
|
var Steps = forwardRef40(
|
|
9812
|
-
({ className, direction = "horizontal", children, ...props }, ref) => /* @__PURE__ */
|
|
9870
|
+
({ className, direction = "horizontal", children, ...props }, ref) => /* @__PURE__ */ jsx56(
|
|
9813
9871
|
"div",
|
|
9814
9872
|
{
|
|
9815
9873
|
ref,
|
|
@@ -9824,20 +9882,20 @@ Steps.displayName = "Steps";
|
|
|
9824
9882
|
function defaultStepsIconContent(state, index) {
|
|
9825
9883
|
switch (state) {
|
|
9826
9884
|
case "done":
|
|
9827
|
-
return /* @__PURE__ */
|
|
9885
|
+
return /* @__PURE__ */ jsx56(SymbolRight4, { width: 12, height: 12, thickness: "Bold", "aria-hidden": true });
|
|
9828
9886
|
case "fail":
|
|
9829
|
-
return /* @__PURE__ */
|
|
9887
|
+
return /* @__PURE__ */ jsx56(SymbolWrong5, { width: 12, height: 12, thickness: "Bold", "aria-hidden": true });
|
|
9830
9888
|
case "warning":
|
|
9831
|
-
return /* @__PURE__ */
|
|
9889
|
+
return /* @__PURE__ */ jsx56(SymbolWarning, { width: 12, height: 12, thickness: "Bold", "aria-hidden": true });
|
|
9832
9890
|
case "waiting":
|
|
9833
9891
|
case "inProgress":
|
|
9834
9892
|
case "default":
|
|
9835
9893
|
default:
|
|
9836
|
-
return index != null ? /* @__PURE__ */
|
|
9894
|
+
return index != null ? /* @__PURE__ */ jsx56(Typography, { level: "caption", as: "span", className: "aviala-steps-icon__index", children: index }) : null;
|
|
9837
9895
|
}
|
|
9838
9896
|
}
|
|
9839
9897
|
var StepsIcon = forwardRef40(
|
|
9840
|
-
({ className, state = "default", index, children, ...props }, ref) => /* @__PURE__ */
|
|
9898
|
+
({ className, state = "default", index, children, ...props }, ref) => /* @__PURE__ */ jsx56(
|
|
9841
9899
|
"span",
|
|
9842
9900
|
{
|
|
9843
9901
|
ref,
|
|
@@ -9859,7 +9917,7 @@ var StepsItem = forwardRef40(
|
|
|
9859
9917
|
icon,
|
|
9860
9918
|
children,
|
|
9861
9919
|
...props
|
|
9862
|
-
}, ref) => /* @__PURE__ */
|
|
9920
|
+
}, ref) => /* @__PURE__ */ jsxs45(
|
|
9863
9921
|
"div",
|
|
9864
9922
|
{
|
|
9865
9923
|
ref,
|
|
@@ -9867,9 +9925,9 @@ var StepsItem = forwardRef40(
|
|
|
9867
9925
|
"data-state": state,
|
|
9868
9926
|
...props,
|
|
9869
9927
|
children: [
|
|
9870
|
-
icon ?? /* @__PURE__ */
|
|
9871
|
-
/* @__PURE__ */
|
|
9872
|
-
title != null ? /* @__PURE__ */
|
|
9928
|
+
icon ?? /* @__PURE__ */ jsx56(StepsIcon, { state, index }),
|
|
9929
|
+
/* @__PURE__ */ jsxs45("div", { className: "aviala-steps-item__body", children: [
|
|
9930
|
+
title != null ? /* @__PURE__ */ jsx56(
|
|
9873
9931
|
Typography,
|
|
9874
9932
|
{
|
|
9875
9933
|
level: "subtitle",
|
|
@@ -9878,7 +9936,7 @@ var StepsItem = forwardRef40(
|
|
|
9878
9936
|
children: title
|
|
9879
9937
|
}
|
|
9880
9938
|
) : null,
|
|
9881
|
-
description != null ? /* @__PURE__ */
|
|
9939
|
+
description != null ? /* @__PURE__ */ jsx56(
|
|
9882
9940
|
Typography,
|
|
9883
9941
|
{
|
|
9884
9942
|
level: "text",
|
|
@@ -9902,9 +9960,9 @@ import {
|
|
|
9902
9960
|
} from "@aviala-design/icons";
|
|
9903
9961
|
import {
|
|
9904
9962
|
forwardRef as forwardRef41,
|
|
9905
|
-
useState as
|
|
9963
|
+
useState as useState19
|
|
9906
9964
|
} from "react";
|
|
9907
|
-
import { jsx as
|
|
9965
|
+
import { jsx as jsx57, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
9908
9966
|
function buildPageList(page, pageCount) {
|
|
9909
9967
|
if (pageCount <= 7) {
|
|
9910
9968
|
return Array.from({ length: pageCount }, (_, index) => index + 1);
|
|
@@ -9927,6 +9985,16 @@ function buildPageList(page, pageCount) {
|
|
|
9927
9985
|
}
|
|
9928
9986
|
return result;
|
|
9929
9987
|
}
|
|
9988
|
+
function ellipsisRange(pages, index) {
|
|
9989
|
+
const prev = pages[index - 1];
|
|
9990
|
+
const next = pages[index + 1];
|
|
9991
|
+
if (typeof prev !== "number" || typeof next !== "number") return [];
|
|
9992
|
+
const start = prev + 1;
|
|
9993
|
+
const end = next - 1;
|
|
9994
|
+
const range = [];
|
|
9995
|
+
for (let p = start; p <= end; p += 1) range.push(p);
|
|
9996
|
+
return range;
|
|
9997
|
+
}
|
|
9930
9998
|
var Pagination = forwardRef41(
|
|
9931
9999
|
({
|
|
9932
10000
|
className,
|
|
@@ -9945,9 +10013,10 @@ var Pagination = forwardRef41(
|
|
|
9945
10013
|
sizeOptionLabel = (size) => `${size} \u9879`,
|
|
9946
10014
|
...props
|
|
9947
10015
|
}, ref) => {
|
|
9948
|
-
const [uncontrolledPage, setUncontrolledPage] =
|
|
9949
|
-
const [uncontrolledPageSize, setUncontrolledPageSize] =
|
|
9950
|
-
const [jumpValue, setJumpValue] =
|
|
10016
|
+
const [uncontrolledPage, setUncontrolledPage] = useState19(defaultPage);
|
|
10017
|
+
const [uncontrolledPageSize, setUncontrolledPageSize] = useState19(defaultPageSize);
|
|
10018
|
+
const [jumpValue, setJumpValue] = useState19("");
|
|
10019
|
+
const [openEllipsis, setOpenEllipsis] = useState19(null);
|
|
9951
10020
|
const page = pageProp ?? uncontrolledPage;
|
|
9952
10021
|
const pageSize = pageSizeProp ?? uncontrolledPageSize;
|
|
9953
10022
|
const safePageCount = Math.max(1, pageCount);
|
|
@@ -9968,7 +10037,7 @@ var Pagination = forwardRef41(
|
|
|
9968
10037
|
setPage(parsed);
|
|
9969
10038
|
setJumpValue("");
|
|
9970
10039
|
};
|
|
9971
|
-
return /* @__PURE__ */
|
|
10040
|
+
return /* @__PURE__ */ jsxs46(
|
|
9972
10041
|
"div",
|
|
9973
10042
|
{
|
|
9974
10043
|
ref,
|
|
@@ -9977,8 +10046,8 @@ var Pagination = forwardRef41(
|
|
|
9977
10046
|
"aria-label": props["aria-label"] ?? "Pagination",
|
|
9978
10047
|
...props,
|
|
9979
10048
|
children: [
|
|
9980
|
-
/* @__PURE__ */
|
|
9981
|
-
/* @__PURE__ */
|
|
10049
|
+
/* @__PURE__ */ jsxs46("div", { className: "aviala-pagination__controls", children: [
|
|
10050
|
+
/* @__PURE__ */ jsx57(
|
|
9982
10051
|
Button,
|
|
9983
10052
|
{
|
|
9984
10053
|
mode: "noBackgroundCustom",
|
|
@@ -9986,35 +10055,69 @@ var Pagination = forwardRef41(
|
|
|
9986
10055
|
iconOnly: true,
|
|
9987
10056
|
"aria-label": "Previous page",
|
|
9988
10057
|
disabled: currentPage <= 1,
|
|
9989
|
-
leftIcon: /* @__PURE__ */
|
|
10058
|
+
leftIcon: /* @__PURE__ */ jsx57(DirectionArrowLeftLight, { "aria-hidden": true }),
|
|
9990
10059
|
onClick: () => setPage(currentPage - 1)
|
|
9991
10060
|
}
|
|
9992
10061
|
),
|
|
9993
|
-
/* @__PURE__ */
|
|
9994
|
-
(item, index) => item === "ellipsis" ? /* @__PURE__ */
|
|
9995
|
-
|
|
10062
|
+
/* @__PURE__ */ jsx57("div", { className: "aviala-pagination__pages", children: pages.map(
|
|
10063
|
+
(item, index) => item === "ellipsis" ? /* @__PURE__ */ jsxs46(
|
|
10064
|
+
Popover,
|
|
9996
10065
|
{
|
|
9997
|
-
|
|
9998
|
-
|
|
9999
|
-
|
|
10000
|
-
|
|
10001
|
-
|
|
10066
|
+
open: openEllipsis === index,
|
|
10067
|
+
onOpenChange: (open) => setOpenEllipsis(open ? index : null),
|
|
10068
|
+
children: [
|
|
10069
|
+
/* @__PURE__ */ jsx57(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx57(
|
|
10070
|
+
"button",
|
|
10071
|
+
{
|
|
10072
|
+
type: "button",
|
|
10073
|
+
"data-size": "regular",
|
|
10074
|
+
className: cn(
|
|
10075
|
+
buttonVariants({ mode: "noBackgroundCustom", compact: true }),
|
|
10076
|
+
"aviala-pagination__page--ellipsis"
|
|
10077
|
+
),
|
|
10078
|
+
"aria-label": "\u66F4\u591A\u9875\u7801",
|
|
10079
|
+
"aria-haspopup": "menu",
|
|
10080
|
+
children: /* @__PURE__ */ jsx57(Typography, { level: "text", as: "span", children: "\u2026" })
|
|
10081
|
+
}
|
|
10082
|
+
) }),
|
|
10083
|
+
/* @__PURE__ */ jsx57(PopoverContent, { className: "aviala-pagination__ellipsis-content", showArrow: true, flush: true, children: /* @__PURE__ */ jsx57("div", { className: "aviala-pagination__ellipsis-menu", children: ellipsisRange(pages, index).map((p) => /* @__PURE__ */ jsx57(
|
|
10084
|
+
"button",
|
|
10085
|
+
{
|
|
10086
|
+
type: "button",
|
|
10087
|
+
"data-size": "regular",
|
|
10088
|
+
className: cn(
|
|
10089
|
+
buttonVariants({ mode: "noBackgroundCustom", compact: true }),
|
|
10090
|
+
"aviala-pagination__ellipsis-page"
|
|
10091
|
+
),
|
|
10092
|
+
onClick: () => {
|
|
10093
|
+
setPage(p);
|
|
10094
|
+
setOpenEllipsis(null);
|
|
10095
|
+
},
|
|
10096
|
+
children: /* @__PURE__ */ jsx57(Typography, { level: "text", as: "span", children: p })
|
|
10097
|
+
},
|
|
10098
|
+
p
|
|
10099
|
+
)) }) })
|
|
10100
|
+
]
|
|
10002
10101
|
},
|
|
10003
10102
|
`ellipsis-${index}`
|
|
10004
|
-
) : /* @__PURE__ */
|
|
10103
|
+
) : /* @__PURE__ */ jsx57(
|
|
10005
10104
|
"button",
|
|
10006
10105
|
{
|
|
10007
10106
|
type: "button",
|
|
10008
|
-
|
|
10107
|
+
"data-size": "regular",
|
|
10108
|
+
className: cn(
|
|
10109
|
+
buttonVariants({ mode: "noBackgroundCustom", compact: true }),
|
|
10110
|
+
"aviala-pagination__page"
|
|
10111
|
+
),
|
|
10009
10112
|
"data-active": item === currentPage ? "true" : void 0,
|
|
10010
10113
|
"aria-current": item === currentPage ? "page" : void 0,
|
|
10011
10114
|
onClick: () => setPage(item),
|
|
10012
|
-
children: /* @__PURE__ */
|
|
10115
|
+
children: /* @__PURE__ */ jsx57(Typography, { level: "text", as: "span", children: item })
|
|
10013
10116
|
},
|
|
10014
10117
|
item
|
|
10015
10118
|
)
|
|
10016
10119
|
) }),
|
|
10017
|
-
/* @__PURE__ */
|
|
10120
|
+
/* @__PURE__ */ jsx57(
|
|
10018
10121
|
Button,
|
|
10019
10122
|
{
|
|
10020
10123
|
mode: "noBackgroundCustom",
|
|
@@ -10022,14 +10125,14 @@ var Pagination = forwardRef41(
|
|
|
10022
10125
|
iconOnly: true,
|
|
10023
10126
|
"aria-label": "Next page",
|
|
10024
10127
|
disabled: currentPage >= safePageCount,
|
|
10025
|
-
leftIcon: /* @__PURE__ */
|
|
10128
|
+
leftIcon: /* @__PURE__ */ jsx57(DirectionArrowRightLight4, { "aria-hidden": true }),
|
|
10026
10129
|
onClick: () => setPage(currentPage + 1)
|
|
10027
10130
|
}
|
|
10028
10131
|
)
|
|
10029
10132
|
] }),
|
|
10030
|
-
showJump ? /* @__PURE__ */
|
|
10031
|
-
/* @__PURE__ */
|
|
10032
|
-
/* @__PURE__ */
|
|
10133
|
+
showJump ? /* @__PURE__ */ jsxs46("div", { className: "aviala-pagination__jump", children: [
|
|
10134
|
+
/* @__PURE__ */ jsx57(Typography, { level: "text", as: "span", children: jumpLabel }),
|
|
10135
|
+
/* @__PURE__ */ jsx57(
|
|
10033
10136
|
Input,
|
|
10034
10137
|
{
|
|
10035
10138
|
className: "aviala-pagination__jump-input",
|
|
@@ -10049,15 +10152,15 @@ var Pagination = forwardRef41(
|
|
|
10049
10152
|
}
|
|
10050
10153
|
)
|
|
10051
10154
|
] }) : null,
|
|
10052
|
-
showSizeChanger ? /* @__PURE__ */
|
|
10053
|
-
/* @__PURE__ */
|
|
10054
|
-
/* @__PURE__ */
|
|
10155
|
+
showSizeChanger ? /* @__PURE__ */ jsxs46("div", { className: "aviala-pagination__size", children: [
|
|
10156
|
+
/* @__PURE__ */ jsx57(Typography, { level: "text", as: "span", children: sizeLabel }),
|
|
10157
|
+
/* @__PURE__ */ jsxs46(
|
|
10055
10158
|
Select,
|
|
10056
10159
|
{
|
|
10057
10160
|
value: String(pageSize),
|
|
10058
10161
|
onValueChange: (value) => setPageSize(Number(value)),
|
|
10059
10162
|
children: [
|
|
10060
|
-
/* @__PURE__ */
|
|
10163
|
+
/* @__PURE__ */ jsx57(
|
|
10061
10164
|
SelectTrigger,
|
|
10062
10165
|
{
|
|
10063
10166
|
size: "regular",
|
|
@@ -10065,7 +10168,7 @@ var Pagination = forwardRef41(
|
|
|
10065
10168
|
"aria-label": "Page size"
|
|
10066
10169
|
}
|
|
10067
10170
|
),
|
|
10068
|
-
/* @__PURE__ */
|
|
10171
|
+
/* @__PURE__ */ jsx57(SelectContent, { children: /* @__PURE__ */ jsx57(SelectItemGroup, { children: pageSizeOptions.map((option) => /* @__PURE__ */ jsx57(
|
|
10069
10172
|
SelectItem,
|
|
10070
10173
|
{
|
|
10071
10174
|
value: String(option),
|
|
@@ -10095,9 +10198,9 @@ import {
|
|
|
10095
10198
|
forwardRef as forwardRef42,
|
|
10096
10199
|
isValidElement as isValidElement17
|
|
10097
10200
|
} from "react";
|
|
10098
|
-
import { Fragment as Fragment9, jsx as
|
|
10201
|
+
import { Fragment as Fragment9, jsx as jsx58, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
10099
10202
|
var Card = forwardRef42(
|
|
10100
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
10203
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx58("div", { ref, className: cn("aviala-card", className), ...props, children })
|
|
10101
10204
|
);
|
|
10102
10205
|
Card.displayName = "Card";
|
|
10103
10206
|
function renderCardIcon(node) {
|
|
@@ -10110,7 +10213,7 @@ function renderCardIcon(node) {
|
|
|
10110
10213
|
"shrink-0"
|
|
10111
10214
|
)
|
|
10112
10215
|
}) : node;
|
|
10113
|
-
return /* @__PURE__ */
|
|
10216
|
+
return /* @__PURE__ */ jsx58("span", { className: "aviala-card-head__icon", children: content });
|
|
10114
10217
|
}
|
|
10115
10218
|
var CardHead = forwardRef42(
|
|
10116
10219
|
({
|
|
@@ -10128,38 +10231,38 @@ var CardHead = forwardRef42(
|
|
|
10128
10231
|
children,
|
|
10129
10232
|
...props
|
|
10130
10233
|
}, ref) => {
|
|
10131
|
-
const primaryAction = action ?? /* @__PURE__ */
|
|
10234
|
+
const primaryAction = action ?? /* @__PURE__ */ jsx58(Button, { mode: "primary", size: "regular", leftIcon: /* @__PURE__ */ jsx58(GeneralSetting2, { "aria-hidden": true }), children: actionLabel });
|
|
10132
10235
|
const renderTrailing = () => {
|
|
10133
10236
|
if (trailing !== void 0) return trailing;
|
|
10134
10237
|
switch (slotType) {
|
|
10135
10238
|
case "action":
|
|
10136
|
-
return /* @__PURE__ */
|
|
10239
|
+
return /* @__PURE__ */ jsxs47("div", { className: "aviala-card-head__trailing", children: [
|
|
10137
10240
|
primaryAction,
|
|
10138
|
-
secondaryAction ?? /* @__PURE__ */
|
|
10241
|
+
secondaryAction ?? /* @__PURE__ */ jsx58(
|
|
10139
10242
|
Button,
|
|
10140
10243
|
{
|
|
10141
10244
|
mode: "default",
|
|
10142
10245
|
size: "regular",
|
|
10143
10246
|
iconOnly: true,
|
|
10144
10247
|
"aria-label": "More",
|
|
10145
|
-
leftIcon: /* @__PURE__ */
|
|
10248
|
+
leftIcon: /* @__PURE__ */ jsx58(GeneralSetting2, { "aria-hidden": true })
|
|
10146
10249
|
}
|
|
10147
10250
|
),
|
|
10148
|
-
/* @__PURE__ */
|
|
10149
|
-
/* @__PURE__ */
|
|
10251
|
+
/* @__PURE__ */ jsx58("span", { className: "aviala-card__divider", "aria-hidden": true }),
|
|
10252
|
+
/* @__PURE__ */ jsx58(DirectionArrowRightLight5, { width: 14, height: 14, "aria-hidden": true })
|
|
10150
10253
|
] });
|
|
10151
10254
|
case "switch":
|
|
10152
|
-
return /* @__PURE__ */
|
|
10255
|
+
return /* @__PURE__ */ jsxs47("div", { className: "aviala-card-head__trailing", children: [
|
|
10153
10256
|
primaryAction,
|
|
10154
|
-
/* @__PURE__ */
|
|
10155
|
-
/* @__PURE__ */
|
|
10257
|
+
/* @__PURE__ */ jsx58("span", { className: "aviala-card__divider", "aria-hidden": true }),
|
|
10258
|
+
/* @__PURE__ */ jsx58(Switch, { ...switchProps })
|
|
10156
10259
|
] });
|
|
10157
10260
|
case "select":
|
|
10158
10261
|
default:
|
|
10159
|
-
return select != null ? /* @__PURE__ */
|
|
10262
|
+
return select != null ? /* @__PURE__ */ jsx58("div", { className: "aviala-card-head__trailing", children: select }) : null;
|
|
10160
10263
|
}
|
|
10161
10264
|
};
|
|
10162
|
-
return /* @__PURE__ */
|
|
10265
|
+
return /* @__PURE__ */ jsxs47(
|
|
10163
10266
|
"div",
|
|
10164
10267
|
{
|
|
10165
10268
|
ref,
|
|
@@ -10167,9 +10270,9 @@ var CardHead = forwardRef42(
|
|
|
10167
10270
|
"data-type": slotType,
|
|
10168
10271
|
...props,
|
|
10169
10272
|
children: [
|
|
10170
|
-
/* @__PURE__ */
|
|
10171
|
-
renderCardIcon(icon ?? /* @__PURE__ */
|
|
10172
|
-
/* @__PURE__ */
|
|
10273
|
+
/* @__PURE__ */ jsxs47("div", { className: "aviala-card-head__main", children: [
|
|
10274
|
+
renderCardIcon(icon ?? /* @__PURE__ */ jsx58(GeneralSetting2, { "aria-hidden": true })),
|
|
10275
|
+
/* @__PURE__ */ jsx58("div", { className: "aviala-card-head__title", children: title != null || description != null ? /* @__PURE__ */ jsx58(Typeface, { content: "textCaption", primary: title, secondary: description }) : children })
|
|
10173
10276
|
] }),
|
|
10174
10277
|
renderTrailing()
|
|
10175
10278
|
]
|
|
@@ -10179,7 +10282,7 @@ var CardHead = forwardRef42(
|
|
|
10179
10282
|
);
|
|
10180
10283
|
CardHead.displayName = "CardHead";
|
|
10181
10284
|
var CardBody = forwardRef42(
|
|
10182
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
10285
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx58("div", { ref, className: cn("aviala-card-body", className), ...props, children: /* @__PURE__ */ jsx58("div", { className: "aviala-card-body__content", children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsx58(Typography, { level: "text", as: "span", children }) : children }) })
|
|
10183
10286
|
);
|
|
10184
10287
|
CardBody.displayName = "CardBody";
|
|
10185
10288
|
var CardBottom = forwardRef42(
|
|
@@ -10195,46 +10298,46 @@ var CardBottom = forwardRef42(
|
|
|
10195
10298
|
children,
|
|
10196
10299
|
...props
|
|
10197
10300
|
}, ref) => {
|
|
10198
|
-
const primaryAction = action ?? /* @__PURE__ */
|
|
10301
|
+
const primaryAction = action ?? /* @__PURE__ */ jsx58(Button, { mode: "primary", size: "regular", leftIcon: /* @__PURE__ */ jsx58(GeneralSetting2, { "aria-hidden": true }), children: actionLabel });
|
|
10199
10302
|
const renderTrailing = () => {
|
|
10200
10303
|
if (trailing !== void 0) return trailing;
|
|
10201
10304
|
if (children != null) return children;
|
|
10202
10305
|
switch (slotType) {
|
|
10203
10306
|
case "switch":
|
|
10204
|
-
return /* @__PURE__ */
|
|
10307
|
+
return /* @__PURE__ */ jsxs47(Fragment9, { children: [
|
|
10205
10308
|
primaryAction,
|
|
10206
|
-
/* @__PURE__ */
|
|
10207
|
-
/* @__PURE__ */
|
|
10309
|
+
/* @__PURE__ */ jsx58("span", { className: "aviala-card__divider", "aria-hidden": true }),
|
|
10310
|
+
/* @__PURE__ */ jsx58(Switch, { ...switchProps })
|
|
10208
10311
|
] });
|
|
10209
10312
|
case "select":
|
|
10210
10313
|
return select;
|
|
10211
10314
|
case "action":
|
|
10212
10315
|
default:
|
|
10213
|
-
return /* @__PURE__ */
|
|
10316
|
+
return /* @__PURE__ */ jsxs47(Fragment9, { children: [
|
|
10214
10317
|
primaryAction,
|
|
10215
|
-
secondaryAction ?? /* @__PURE__ */
|
|
10318
|
+
secondaryAction ?? /* @__PURE__ */ jsx58(
|
|
10216
10319
|
Button,
|
|
10217
10320
|
{
|
|
10218
10321
|
mode: "default",
|
|
10219
10322
|
size: "regular",
|
|
10220
10323
|
iconOnly: true,
|
|
10221
10324
|
"aria-label": "More",
|
|
10222
|
-
leftIcon: /* @__PURE__ */
|
|
10325
|
+
leftIcon: /* @__PURE__ */ jsx58(GeneralSetting2, { "aria-hidden": true })
|
|
10223
10326
|
}
|
|
10224
10327
|
),
|
|
10225
|
-
/* @__PURE__ */
|
|
10226
|
-
/* @__PURE__ */
|
|
10328
|
+
/* @__PURE__ */ jsx58("span", { className: "aviala-card__divider", "aria-hidden": true }),
|
|
10329
|
+
/* @__PURE__ */ jsx58(DirectionArrowRightLight5, { width: 14, height: 14, "aria-hidden": true })
|
|
10227
10330
|
] });
|
|
10228
10331
|
}
|
|
10229
10332
|
};
|
|
10230
|
-
return /* @__PURE__ */
|
|
10333
|
+
return /* @__PURE__ */ jsx58(
|
|
10231
10334
|
"div",
|
|
10232
10335
|
{
|
|
10233
10336
|
ref,
|
|
10234
10337
|
className: cn("aviala-card-bottom", className),
|
|
10235
10338
|
"data-type": slotType,
|
|
10236
10339
|
...props,
|
|
10237
|
-
children: /* @__PURE__ */
|
|
10340
|
+
children: /* @__PURE__ */ jsx58("div", { className: "aviala-card-bottom__trailing", children: renderTrailing() })
|
|
10238
10341
|
}
|
|
10239
10342
|
);
|
|
10240
10343
|
}
|
|
@@ -10247,9 +10350,9 @@ import {
|
|
|
10247
10350
|
forwardRef as forwardRef43,
|
|
10248
10351
|
isValidElement as isValidElement18
|
|
10249
10352
|
} from "react";
|
|
10250
|
-
import { Fragment as Fragment10, jsx as
|
|
10353
|
+
import { Fragment as Fragment10, jsx as jsx59, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
10251
10354
|
var Table = forwardRef43(
|
|
10252
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
10355
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx59(
|
|
10253
10356
|
"div",
|
|
10254
10357
|
{
|
|
10255
10358
|
ref,
|
|
@@ -10262,7 +10365,7 @@ var Table = forwardRef43(
|
|
|
10262
10365
|
);
|
|
10263
10366
|
Table.displayName = "Table";
|
|
10264
10367
|
var TableRow = forwardRef43(
|
|
10265
|
-
({ className, header = false, children, ...props }, ref) => /* @__PURE__ */
|
|
10368
|
+
({ className, header = false, children, ...props }, ref) => /* @__PURE__ */ jsx59(
|
|
10266
10369
|
"div",
|
|
10267
10370
|
{
|
|
10268
10371
|
ref,
|
|
@@ -10276,7 +10379,7 @@ var TableRow = forwardRef43(
|
|
|
10276
10379
|
);
|
|
10277
10380
|
TableRow.displayName = "TableRow";
|
|
10278
10381
|
var TableHead = forwardRef43(
|
|
10279
|
-
({ className, content = "text", children, ...props }, ref) => /* @__PURE__ */
|
|
10382
|
+
({ className, content = "text", children, ...props }, ref) => /* @__PURE__ */ jsx59(
|
|
10280
10383
|
"div",
|
|
10281
10384
|
{
|
|
10282
10385
|
ref,
|
|
@@ -10284,7 +10387,7 @@ var TableHead = forwardRef43(
|
|
|
10284
10387
|
className: cn("aviala-table-head", className),
|
|
10285
10388
|
"data-content": content,
|
|
10286
10389
|
...props,
|
|
10287
|
-
children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */
|
|
10390
|
+
children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsx59(Typography, { level: "caption", as: "span", children }) : children
|
|
10288
10391
|
}
|
|
10289
10392
|
)
|
|
10290
10393
|
);
|
|
@@ -10299,7 +10402,7 @@ function renderCellIcon(node) {
|
|
|
10299
10402
|
"shrink-0"
|
|
10300
10403
|
)
|
|
10301
10404
|
}) : node;
|
|
10302
|
-
return /* @__PURE__ */
|
|
10405
|
+
return /* @__PURE__ */ jsx59("span", { className: "aviala-table-cell__icon", children: content });
|
|
10303
10406
|
}
|
|
10304
10407
|
var TableCell = forwardRef43(
|
|
10305
10408
|
({
|
|
@@ -10320,29 +10423,29 @@ var TableCell = forwardRef43(
|
|
|
10320
10423
|
if (children != null) return children;
|
|
10321
10424
|
switch (content) {
|
|
10322
10425
|
case "checkbox":
|
|
10323
|
-
return /* @__PURE__ */
|
|
10426
|
+
return /* @__PURE__ */ jsx59(Checkbox, { ...checkboxProps });
|
|
10324
10427
|
case "icon+text":
|
|
10325
|
-
return /* @__PURE__ */
|
|
10428
|
+
return /* @__PURE__ */ jsxs48(Fragment10, { children: [
|
|
10326
10429
|
renderCellIcon(icon),
|
|
10327
|
-
/* @__PURE__ */
|
|
10430
|
+
/* @__PURE__ */ jsx59("span", { className: "aviala-table-cell__text", children: /* @__PURE__ */ jsx59(Typography, { level: "text", as: "span", children: text }) })
|
|
10328
10431
|
] });
|
|
10329
10432
|
case "people":
|
|
10330
|
-
return /* @__PURE__ */
|
|
10331
|
-
people ?? /* @__PURE__ */
|
|
10332
|
-
/* @__PURE__ */
|
|
10433
|
+
return /* @__PURE__ */ jsxs48(Fragment10, { children: [
|
|
10434
|
+
people ?? /* @__PURE__ */ jsx59(Avatar, { content: "text", level: "text", children: "A" }),
|
|
10435
|
+
/* @__PURE__ */ jsx59("span", { className: "aviala-table-cell__text", children: /* @__PURE__ */ jsx59(Typography, { level: "text", as: "span", children: text }) })
|
|
10333
10436
|
] });
|
|
10334
10437
|
case "badge":
|
|
10335
|
-
return badge ?? /* @__PURE__ */
|
|
10438
|
+
return badge ?? /* @__PURE__ */ jsx59(Badge, { style: "theme", level: "caption", children: badgeLabel ?? "Text" });
|
|
10336
10439
|
case "switch":
|
|
10337
|
-
return /* @__PURE__ */
|
|
10440
|
+
return /* @__PURE__ */ jsx59(Switch, { ...switchProps });
|
|
10338
10441
|
case "action":
|
|
10339
|
-
return /* @__PURE__ */
|
|
10442
|
+
return /* @__PURE__ */ jsx59("div", { className: "aviala-table-cell__actions", children: actions });
|
|
10340
10443
|
case "text":
|
|
10341
10444
|
default:
|
|
10342
|
-
return /* @__PURE__ */
|
|
10445
|
+
return /* @__PURE__ */ jsx59("span", { className: "aviala-table-cell__text", children: /* @__PURE__ */ jsx59(Typography, { level: "text", as: "span", children: text }) });
|
|
10343
10446
|
}
|
|
10344
10447
|
};
|
|
10345
|
-
return /* @__PURE__ */
|
|
10448
|
+
return /* @__PURE__ */ jsx59(
|
|
10346
10449
|
"div",
|
|
10347
10450
|
{
|
|
10348
10451
|
ref,
|
|
@@ -10403,6 +10506,7 @@ export {
|
|
|
10403
10506
|
Feedback,
|
|
10404
10507
|
Fieldset,
|
|
10405
10508
|
FormField,
|
|
10509
|
+
HoverPopover,
|
|
10406
10510
|
Input,
|
|
10407
10511
|
InputGroup,
|
|
10408
10512
|
InputGroupAddon,
|
|
@@ -10453,6 +10557,7 @@ export {
|
|
|
10453
10557
|
RadioGroup,
|
|
10454
10558
|
RadioGroupItem,
|
|
10455
10559
|
RadioInput,
|
|
10560
|
+
ResponsiveTooltip,
|
|
10456
10561
|
Scroll,
|
|
10457
10562
|
ScrollPicker,
|
|
10458
10563
|
ScrollPickerColumn,
|