@aviala-design/spiral 2.4.0 → 2.5.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/component-changelogs.json +80 -6
- package/dist/index.cjs +789 -576
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +75 -9
- package/dist/index.d.ts +75 -9
- package/dist/index.js +780 -562
- package/dist/index.js.map +1 -1
- package/dist/props.json +190 -2
- package/dist/styles.css +42 -14
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2738,11 +2738,12 @@ Scroll.displayName = "Scroll";
|
|
|
2738
2738
|
|
|
2739
2739
|
// src/components/checkbox.tsx
|
|
2740
2740
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
2741
|
-
import { SymbolRight as SymbolRight2 } from "@aviala-design/icons";
|
|
2742
2741
|
import {
|
|
2743
2742
|
cloneElement as cloneElement5,
|
|
2744
2743
|
forwardRef as forwardRef16,
|
|
2745
|
-
isValidElement as isValidElement10
|
|
2744
|
+
isValidElement as isValidElement10,
|
|
2745
|
+
useEffect as useEffect3,
|
|
2746
|
+
useState as useState6
|
|
2746
2747
|
} from "react";
|
|
2747
2748
|
|
|
2748
2749
|
// src/components/typeface.tsx
|
|
@@ -2826,42 +2827,71 @@ var TypefacePair = forwardRef15(
|
|
|
2826
2827
|
);
|
|
2827
2828
|
TypefacePair.displayName = "TypefacePair";
|
|
2828
2829
|
|
|
2830
|
+
// src/components/checkbox-check-icon.tsx
|
|
2831
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
2832
|
+
function CheckboxCheckIcon({ className, ...props }) {
|
|
2833
|
+
return /* @__PURE__ */ jsx18(
|
|
2834
|
+
"svg",
|
|
2835
|
+
{
|
|
2836
|
+
className: cn("aviala-checkbox__check-icon", className),
|
|
2837
|
+
viewBox: "0 0 12 12",
|
|
2838
|
+
fill: "none",
|
|
2839
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2840
|
+
"aria-hidden": true,
|
|
2841
|
+
overflow: "visible",
|
|
2842
|
+
...props,
|
|
2843
|
+
children: /* @__PURE__ */ jsx18(
|
|
2844
|
+
"path",
|
|
2845
|
+
{
|
|
2846
|
+
className: "aviala-checkbox__check-path",
|
|
2847
|
+
transform: "translate(1 1.6)",
|
|
2848
|
+
d: "M0 3.9L3.4974 8.35503C3.83947 8.79075 4.51016 8.75534 4.80444 8.28602L10 0",
|
|
2849
|
+
pathLength: 1,
|
|
2850
|
+
stroke: "currentColor",
|
|
2851
|
+
strokeLinecap: "round",
|
|
2852
|
+
vectorEffect: "non-scaling-stroke"
|
|
2853
|
+
}
|
|
2854
|
+
)
|
|
2855
|
+
}
|
|
2856
|
+
);
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2829
2859
|
// src/components/checkbox.tsx
|
|
2830
|
-
import { jsx as
|
|
2831
|
-
var Checkbox = forwardRef16(({ className, round = false, ...props }, ref) =>
|
|
2832
|
-
|
|
2833
|
-
{
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
}
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
)
|
|
2858
|
-
]
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
)
|
|
2860
|
+
import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2861
|
+
var Checkbox = forwardRef16(({ className, round = false, size = "default", ...props }, ref) => {
|
|
2862
|
+
const [motionReady, setMotionReady] = useState6(false);
|
|
2863
|
+
useEffect3(() => {
|
|
2864
|
+
const id = requestAnimationFrame(() => setMotionReady(true));
|
|
2865
|
+
return () => cancelAnimationFrame(id);
|
|
2866
|
+
}, []);
|
|
2867
|
+
return /* @__PURE__ */ jsxs11(
|
|
2868
|
+
CheckboxPrimitive.Root,
|
|
2869
|
+
{
|
|
2870
|
+
ref,
|
|
2871
|
+
className: cn("aviala-checkbox aviala-focus-ring", className),
|
|
2872
|
+
"data-round": round ? "true" : void 0,
|
|
2873
|
+
"data-size": size,
|
|
2874
|
+
"data-motion": motionReady ? "ready" : "boot",
|
|
2875
|
+
...props,
|
|
2876
|
+
children: [
|
|
2877
|
+
/* @__PURE__ */ jsx19("span", { "aria-hidden": true, className: "aviala-checkbox__surface" }),
|
|
2878
|
+
/* @__PURE__ */ jsxs11(CheckboxPrimitive.Indicator, { forceMount: true, className: "aviala-checkbox__indicator", children: [
|
|
2879
|
+
/* @__PURE__ */ jsx19(CheckboxCheckIcon, { className: "aviala-checkbox__indicator-icon aviala-checkbox__indicator-icon--check" }),
|
|
2880
|
+
/* @__PURE__ */ jsx19(
|
|
2881
|
+
"span",
|
|
2882
|
+
{
|
|
2883
|
+
"aria-hidden": true,
|
|
2884
|
+
className: "aviala-checkbox__indeterminate-mark aviala-checkbox__indicator-icon--indeterminate"
|
|
2885
|
+
}
|
|
2886
|
+
)
|
|
2887
|
+
] })
|
|
2888
|
+
]
|
|
2889
|
+
}
|
|
2890
|
+
);
|
|
2891
|
+
});
|
|
2862
2892
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
2863
2893
|
var CheckboxGroup = forwardRef16(
|
|
2864
|
-
({ className, direction = "vertical", ...props }, ref) => /* @__PURE__ */
|
|
2894
|
+
({ className, direction = "vertical", ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
2865
2895
|
"div",
|
|
2866
2896
|
{
|
|
2867
2897
|
ref,
|
|
@@ -2883,7 +2913,7 @@ function renderIcon3(node) {
|
|
|
2883
2913
|
"shrink-0"
|
|
2884
2914
|
)
|
|
2885
2915
|
}) : node;
|
|
2886
|
-
return /* @__PURE__ */
|
|
2916
|
+
return /* @__PURE__ */ jsx19("span", { className: "aviala-checkbox-input__icon", children: content });
|
|
2887
2917
|
}
|
|
2888
2918
|
var CheckboxInput = forwardRef16(
|
|
2889
2919
|
({
|
|
@@ -2901,9 +2931,9 @@ var CheckboxInput = forwardRef16(
|
|
|
2901
2931
|
className: cn("aviala-checkbox-input", className),
|
|
2902
2932
|
"data-disabled": disabled ? "true" : void 0,
|
|
2903
2933
|
children: [
|
|
2904
|
-
/* @__PURE__ */
|
|
2934
|
+
/* @__PURE__ */ jsx19(Checkbox, { ref, id, disabled, ...props }),
|
|
2905
2935
|
renderIcon3(icon),
|
|
2906
|
-
/* @__PURE__ */
|
|
2936
|
+
/* @__PURE__ */ jsx19(
|
|
2907
2937
|
TypefacePair,
|
|
2908
2938
|
{
|
|
2909
2939
|
className: "aviala-checkbox-input__content min-w-0 flex-1",
|
|
@@ -2924,8 +2954,8 @@ import {
|
|
|
2924
2954
|
forwardRef as forwardRef17,
|
|
2925
2955
|
isValidElement as isValidElement11
|
|
2926
2956
|
} from "react";
|
|
2927
|
-
import { jsx as
|
|
2928
|
-
var RadioGroup = forwardRef17(({ className, direction = "vertical", ...props }, ref) => /* @__PURE__ */
|
|
2957
|
+
import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2958
|
+
var RadioGroup = forwardRef17(({ className, direction = "vertical", ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
2929
2959
|
RadioGroupPrimitive.Root,
|
|
2930
2960
|
{
|
|
2931
2961
|
className: cn("aviala-radio-group", className),
|
|
@@ -2942,8 +2972,8 @@ var RadioGroupItem = forwardRef17(({ className, ...props }, ref) => /* @__PURE__
|
|
|
2942
2972
|
className: cn("aviala-radio aviala-focus-ring", className),
|
|
2943
2973
|
...props,
|
|
2944
2974
|
children: [
|
|
2945
|
-
/* @__PURE__ */
|
|
2946
|
-
/* @__PURE__ */
|
|
2975
|
+
/* @__PURE__ */ jsx20("span", { "aria-hidden": true, className: "aviala-radio__surface" }),
|
|
2976
|
+
/* @__PURE__ */ jsx20("span", { "aria-hidden": true, className: "aviala-radio__indicator" })
|
|
2947
2977
|
]
|
|
2948
2978
|
}
|
|
2949
2979
|
));
|
|
@@ -2959,7 +2989,7 @@ function renderIcon4(node) {
|
|
|
2959
2989
|
"shrink-0"
|
|
2960
2990
|
)
|
|
2961
2991
|
}) : node;
|
|
2962
|
-
return /* @__PURE__ */
|
|
2992
|
+
return /* @__PURE__ */ jsx20("span", { className: "aviala-radio-input__icon", children: content });
|
|
2963
2993
|
}
|
|
2964
2994
|
var RadioInput = forwardRef17(
|
|
2965
2995
|
({
|
|
@@ -2979,9 +3009,9 @@ var RadioInput = forwardRef17(
|
|
|
2979
3009
|
"data-style": variant,
|
|
2980
3010
|
"data-disabled": disabled ? "true" : void 0,
|
|
2981
3011
|
children: [
|
|
2982
|
-
/* @__PURE__ */
|
|
3012
|
+
/* @__PURE__ */ jsx20(RadioGroupItem, { ref, id, disabled, ...props }),
|
|
2983
3013
|
renderIcon4(icon),
|
|
2984
|
-
/* @__PURE__ */
|
|
3014
|
+
/* @__PURE__ */ jsx20(
|
|
2985
3015
|
TypefacePair,
|
|
2986
3016
|
{
|
|
2987
3017
|
className: "aviala-radio-input__content min-w-0 flex-1",
|
|
@@ -2998,7 +3028,7 @@ RadioInput.displayName = "RadioInput";
|
|
|
2998
3028
|
// src/components/switch.tsx
|
|
2999
3029
|
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
3000
3030
|
import { forwardRef as forwardRef18 } from "react";
|
|
3001
|
-
import { jsx as
|
|
3031
|
+
import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3002
3032
|
var Switch = forwardRef18(({ className, size = "regular", ...props }, ref) => /* @__PURE__ */ jsxs13(
|
|
3003
3033
|
SwitchPrimitive.Root,
|
|
3004
3034
|
{
|
|
@@ -3010,8 +3040,8 @@ var Switch = forwardRef18(({ className, size = "regular", ...props }, ref) => /*
|
|
|
3010
3040
|
ref,
|
|
3011
3041
|
...props,
|
|
3012
3042
|
children: [
|
|
3013
|
-
/* @__PURE__ */
|
|
3014
|
-
/* @__PURE__ */
|
|
3043
|
+
/* @__PURE__ */ jsx21("span", { "aria-hidden": true, className: "aviala-switch__surface" }),
|
|
3044
|
+
/* @__PURE__ */ jsx21(SwitchPrimitive.Thumb, { className: "aviala-switch__thumb" })
|
|
3015
3045
|
]
|
|
3016
3046
|
}
|
|
3017
3047
|
));
|
|
@@ -3022,9 +3052,9 @@ import { Slot as Slot4 } from "@radix-ui/react-slot";
|
|
|
3022
3052
|
import {
|
|
3023
3053
|
forwardRef as forwardRef19
|
|
3024
3054
|
} from "react";
|
|
3025
|
-
import { jsx as
|
|
3055
|
+
import { jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3026
3056
|
var Anchor2 = forwardRef19(
|
|
3027
|
-
({ className, as: Tag2 = "nav", ...props }, ref) => /* @__PURE__ */
|
|
3057
|
+
({ className, as: Tag2 = "nav", ...props }, ref) => /* @__PURE__ */ jsx22(Tag2, { ref, className: cn("aviala-anchor", className), ...props })
|
|
3028
3058
|
);
|
|
3029
3059
|
Anchor2.displayName = "Anchor";
|
|
3030
3060
|
var AnchorItem = forwardRef19(
|
|
@@ -3046,8 +3076,8 @@ var AnchorItem = forwardRef19(
|
|
|
3046
3076
|
"data-indent": String(indentLevel),
|
|
3047
3077
|
...props,
|
|
3048
3078
|
children: [
|
|
3049
|
-
/* @__PURE__ */
|
|
3050
|
-
/* @__PURE__ */
|
|
3079
|
+
/* @__PURE__ */ jsx22("span", { className: "aviala-anchor-item__rail", "aria-hidden": true }),
|
|
3080
|
+
/* @__PURE__ */ jsx22("span", { className: "aviala-anchor-item__content", children: /* @__PURE__ */ jsx22(Typography, { level: "text", as: "span", className: "aviala-anchor-item__label", children }) })
|
|
3051
3081
|
]
|
|
3052
3082
|
}
|
|
3053
3083
|
);
|
|
@@ -3061,13 +3091,13 @@ import {
|
|
|
3061
3091
|
forwardRef as forwardRef20,
|
|
3062
3092
|
useCallback as useCallback4,
|
|
3063
3093
|
useContext as useContext3,
|
|
3064
|
-
useEffect as
|
|
3094
|
+
useEffect as useEffect4,
|
|
3065
3095
|
useLayoutEffect as useLayoutEffect2,
|
|
3066
3096
|
useMemo as useMemo3,
|
|
3067
3097
|
useRef as useRef4,
|
|
3068
|
-
useState as
|
|
3098
|
+
useState as useState7
|
|
3069
3099
|
} from "react";
|
|
3070
|
-
import { jsx as
|
|
3100
|
+
import { jsx as jsx23, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3071
3101
|
var SegmentatorContext = createContext3(null);
|
|
3072
3102
|
function useSegmentatorContext() {
|
|
3073
3103
|
const ctx = useContext3(SegmentatorContext);
|
|
@@ -3082,7 +3112,7 @@ function renderIcon5(node, dimmed) {
|
|
|
3082
3112
|
level: "text",
|
|
3083
3113
|
biggerSize: true
|
|
3084
3114
|
});
|
|
3085
|
-
return /* @__PURE__ */
|
|
3115
|
+
return /* @__PURE__ */ jsx23(
|
|
3086
3116
|
"span",
|
|
3087
3117
|
{
|
|
3088
3118
|
className: cn(
|
|
@@ -3094,7 +3124,7 @@ function renderIcon5(node, dimmed) {
|
|
|
3094
3124
|
);
|
|
3095
3125
|
}
|
|
3096
3126
|
function useSegmentatorState(value, defaultValue, onValueChange) {
|
|
3097
|
-
const [internal, setInternal] =
|
|
3127
|
+
const [internal, setInternal] = useState7(defaultValue ?? "");
|
|
3098
3128
|
const isControlled = value !== void 0;
|
|
3099
3129
|
const current = isControlled ? value : internal;
|
|
3100
3130
|
const setValue = useCallback4(
|
|
@@ -3162,12 +3192,24 @@ function measureItemThumbMetrics(item, group) {
|
|
|
3162
3192
|
const groupRect = group.getBoundingClientRect();
|
|
3163
3193
|
const itemRect = item.getBoundingClientRect();
|
|
3164
3194
|
return {
|
|
3165
|
-
x: itemRect.left - groupRect.left,
|
|
3166
|
-
y: itemRect.top - groupRect.top,
|
|
3195
|
+
x: itemRect.left - groupRect.left + group.scrollLeft,
|
|
3196
|
+
y: itemRect.top - groupRect.top + group.scrollTop,
|
|
3167
3197
|
width: itemRect.width,
|
|
3168
3198
|
height: itemRect.height
|
|
3169
3199
|
};
|
|
3170
3200
|
}
|
|
3201
|
+
function syncSegmentatorOverflowing(group) {
|
|
3202
|
+
const overflowing = group.scrollWidth > group.clientWidth + 1;
|
|
3203
|
+
if (overflowing) {
|
|
3204
|
+
group.setAttribute("data-overflowing", "true");
|
|
3205
|
+
} else {
|
|
3206
|
+
group.removeAttribute("data-overflowing");
|
|
3207
|
+
}
|
|
3208
|
+
return overflowing;
|
|
3209
|
+
}
|
|
3210
|
+
function isSegmentatorOverflowing(group) {
|
|
3211
|
+
return group?.getAttribute("data-overflowing") === "true";
|
|
3212
|
+
}
|
|
3171
3213
|
function findItemAtClientX(items, clientX) {
|
|
3172
3214
|
for (const item of items) {
|
|
3173
3215
|
const rect = item.getBoundingClientRect();
|
|
@@ -3246,7 +3288,7 @@ function useSegmentatorThumb(groupRef, selectedValue, layoutKey, dragState) {
|
|
|
3246
3288
|
const thumbElRef = useRef4(null);
|
|
3247
3289
|
const metricsRef = useRef4(null);
|
|
3248
3290
|
const dragStateRef = useRef4(dragState);
|
|
3249
|
-
const [thumb, setThumb] =
|
|
3291
|
+
const [thumb, setThumb] = useState7(null);
|
|
3250
3292
|
const isInitialMount = useRef4(true);
|
|
3251
3293
|
dragStateRef.current = dragState;
|
|
3252
3294
|
const measureThumb = useCallback4(() => {
|
|
@@ -3256,14 +3298,7 @@ function useSegmentatorThumb(groupRef, selectedValue, layoutKey, dragState) {
|
|
|
3256
3298
|
'.aviala-segmentator-item[data-selected="true"]'
|
|
3257
3299
|
);
|
|
3258
3300
|
if (!selected) return null;
|
|
3259
|
-
|
|
3260
|
-
const itemRect = selected.getBoundingClientRect();
|
|
3261
|
-
return {
|
|
3262
|
-
x: itemRect.left - groupRect.left,
|
|
3263
|
-
y: itemRect.top - groupRect.top,
|
|
3264
|
-
width: itemRect.width,
|
|
3265
|
-
height: itemRect.height
|
|
3266
|
-
};
|
|
3301
|
+
return measureItemThumbMetrics(selected, group);
|
|
3267
3302
|
}, [groupRef]);
|
|
3268
3303
|
const syncThumb = useCallback4(
|
|
3269
3304
|
(metrics, instant = false) => {
|
|
@@ -3302,6 +3337,19 @@ function useSegmentatorThumb(groupRef, selectedValue, layoutKey, dragState) {
|
|
|
3302
3337
|
}, []);
|
|
3303
3338
|
useLayoutEffect2(() => {
|
|
3304
3339
|
if (dragState.pressing || dragState.active) return;
|
|
3340
|
+
const group = groupRef.current;
|
|
3341
|
+
if (group) {
|
|
3342
|
+
const selected = group.querySelector(
|
|
3343
|
+
'.aviala-segmentator-item[data-selected="true"]'
|
|
3344
|
+
);
|
|
3345
|
+
if (selected && !isInitialMount.current) {
|
|
3346
|
+
selected.scrollIntoView({
|
|
3347
|
+
inline: "nearest",
|
|
3348
|
+
block: "nearest",
|
|
3349
|
+
behavior: "smooth"
|
|
3350
|
+
});
|
|
3351
|
+
}
|
|
3352
|
+
}
|
|
3305
3353
|
const next = measureThumb();
|
|
3306
3354
|
if (!next) return;
|
|
3307
3355
|
const el = thumbElRef.current;
|
|
@@ -3330,18 +3378,28 @@ function useSegmentatorThumb(groupRef, selectedValue, layoutKey, dragState) {
|
|
|
3330
3378
|
return;
|
|
3331
3379
|
}
|
|
3332
3380
|
syncThumb(next, false);
|
|
3333
|
-
}, [selectedValue, measureThumb, syncThumb, dragState.active, dragState.pressing]);
|
|
3381
|
+
}, [selectedValue, measureThumb, syncThumb, dragState.active, dragState.pressing, groupRef]);
|
|
3334
3382
|
useLayoutEffect2(() => {
|
|
3335
3383
|
const group = groupRef.current;
|
|
3336
3384
|
if (!group) return;
|
|
3337
|
-
const
|
|
3385
|
+
const updateOverflowAndThumb = () => {
|
|
3386
|
+
syncSegmentatorOverflowing(group);
|
|
3338
3387
|
remeasureThumb();
|
|
3388
|
+
};
|
|
3389
|
+
updateOverflowAndThumb();
|
|
3390
|
+
const observer = new ResizeObserver(() => {
|
|
3391
|
+
updateOverflowAndThumb();
|
|
3339
3392
|
});
|
|
3340
3393
|
observer.observe(group);
|
|
3341
3394
|
const items = group.querySelectorAll(".aviala-segmentator-item");
|
|
3342
3395
|
items.forEach((item) => observer.observe(item));
|
|
3396
|
+
const onScroll = () => {
|
|
3397
|
+
syncSegmentatorOverflowing(group);
|
|
3398
|
+
remeasureThumb();
|
|
3399
|
+
};
|
|
3400
|
+
group.addEventListener("scroll", onScroll, { passive: true });
|
|
3343
3401
|
const layoutObserver = new MutationObserver(() => {
|
|
3344
|
-
requestAnimationFrame(
|
|
3402
|
+
requestAnimationFrame(updateOverflowAndThumb);
|
|
3345
3403
|
});
|
|
3346
3404
|
layoutObserver.observe(document.documentElement, {
|
|
3347
3405
|
attributes: true,
|
|
@@ -3350,9 +3408,10 @@ function useSegmentatorThumb(groupRef, selectedValue, layoutKey, dragState) {
|
|
|
3350
3408
|
return () => {
|
|
3351
3409
|
observer.disconnect();
|
|
3352
3410
|
layoutObserver.disconnect();
|
|
3411
|
+
group.removeEventListener("scroll", onScroll);
|
|
3353
3412
|
};
|
|
3354
3413
|
}, [groupRef, remeasureThumb]);
|
|
3355
|
-
|
|
3414
|
+
useEffect4(() => {
|
|
3356
3415
|
if (!layoutKey) return;
|
|
3357
3416
|
const frame = requestAnimationFrame(() => {
|
|
3358
3417
|
remeasureThumb();
|
|
@@ -3379,7 +3438,7 @@ var SegmentatorGroup = forwardRef20(
|
|
|
3379
3438
|
const layoutKey = useThemeLayoutKey();
|
|
3380
3439
|
const consumeClickRef = useRef4(false);
|
|
3381
3440
|
const pointerDragRef = useRef4(null);
|
|
3382
|
-
const [dragState, setDragState] =
|
|
3441
|
+
const [dragState, setDragState] = useState7({
|
|
3383
3442
|
pressing: false,
|
|
3384
3443
|
active: false
|
|
3385
3444
|
});
|
|
@@ -3506,6 +3565,7 @@ var SegmentatorGroup = forwardRef20(
|
|
|
3506
3565
|
);
|
|
3507
3566
|
const handlePointerDown = (event) => {
|
|
3508
3567
|
if (disabled || !isSegmentatorDragPointer(event.pointerType)) return;
|
|
3568
|
+
if (isSegmentatorOverflowing(groupRef.current)) return;
|
|
3509
3569
|
const pressedItem = getPressedItemFromTarget(event.target);
|
|
3510
3570
|
if (!pressedItem) return;
|
|
3511
3571
|
const group = groupRef.current;
|
|
@@ -3531,7 +3591,7 @@ var SegmentatorGroup = forwardRef20(
|
|
|
3531
3591
|
group.setPointerCapture(event.pointerId);
|
|
3532
3592
|
};
|
|
3533
3593
|
const thumbStyle = thumb ? buildThumbStyle() : void 0;
|
|
3534
|
-
return /* @__PURE__ */
|
|
3594
|
+
return /* @__PURE__ */ jsx23(
|
|
3535
3595
|
SegmentatorContext.Provider,
|
|
3536
3596
|
{
|
|
3537
3597
|
value: useMemo3(
|
|
@@ -3567,7 +3627,7 @@ var SegmentatorGroup = forwardRef20(
|
|
|
3567
3627
|
onLostPointerCapture: finishPointerDrag,
|
|
3568
3628
|
children: [
|
|
3569
3629
|
children,
|
|
3570
|
-
thumb && /* @__PURE__ */
|
|
3630
|
+
thumb && /* @__PURE__ */ jsx23(
|
|
3571
3631
|
"span",
|
|
3572
3632
|
{
|
|
3573
3633
|
ref: onThumbRef,
|
|
@@ -3605,7 +3665,7 @@ var SegmentatorItem = forwardRef20(
|
|
|
3605
3665
|
const isDisabled = disabled || ctx.disabled;
|
|
3606
3666
|
const dimmed = isDisabled;
|
|
3607
3667
|
const icon = iconOnly ? leftIcon ?? rightIcon : leftIcon;
|
|
3608
|
-
return /* @__PURE__ */
|
|
3668
|
+
return /* @__PURE__ */ jsx23(
|
|
3609
3669
|
"button",
|
|
3610
3670
|
{
|
|
3611
3671
|
ref,
|
|
@@ -3629,7 +3689,7 @@ var SegmentatorItem = forwardRef20(
|
|
|
3629
3689
|
...props,
|
|
3630
3690
|
children: /* @__PURE__ */ jsxs15("span", { className: "aviala-segmentator-item__content", children: [
|
|
3631
3691
|
renderIcon5(icon, dimmed && !!icon),
|
|
3632
|
-
!iconOnly && /* @__PURE__ */
|
|
3692
|
+
!iconOnly && /* @__PURE__ */ jsx23(
|
|
3633
3693
|
"span",
|
|
3634
3694
|
{
|
|
3635
3695
|
className: cn(
|
|
@@ -3651,7 +3711,7 @@ SegmentatorItem.displayName = "SegmentatorItem";
|
|
|
3651
3711
|
// src/components/form-field.tsx
|
|
3652
3712
|
import { SymbolInformationCircle, SymbolWrongCircle } from "@aviala-design/icons";
|
|
3653
3713
|
import { forwardRef as forwardRef21, useId as useId2 } from "react";
|
|
3654
|
-
import { Fragment as Fragment3, jsx as
|
|
3714
|
+
import { Fragment as Fragment3, jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3655
3715
|
var FormField = forwardRef21(
|
|
3656
3716
|
({
|
|
3657
3717
|
className,
|
|
@@ -3669,18 +3729,18 @@ var FormField = forwardRef21(
|
|
|
3669
3729
|
const reactId = useId2();
|
|
3670
3730
|
const labelId = `${reactId}-label`;
|
|
3671
3731
|
const hasLabel = label != null && label !== "";
|
|
3672
|
-
const labelNode = hasLabel || description ? htmlFor ? /* @__PURE__ */
|
|
3732
|
+
const labelNode = hasLabel || description ? htmlFor ? /* @__PURE__ */ jsx24("label", { htmlFor, className: "aviala-form__label aviala-form__label--control", children: /* @__PURE__ */ jsx24(
|
|
3673
3733
|
Typeface,
|
|
3674
3734
|
{
|
|
3675
3735
|
id: labelId,
|
|
3676
3736
|
content: "textCaption",
|
|
3677
3737
|
primary: hasLabel ? /* @__PURE__ */ jsxs16(Fragment3, { children: [
|
|
3678
3738
|
label,
|
|
3679
|
-
required ? /* @__PURE__ */
|
|
3739
|
+
required ? /* @__PURE__ */ jsx24("span", { className: "aviala-form__required", "aria-hidden": true, children: "*" }) : null
|
|
3680
3740
|
] }) : void 0,
|
|
3681
3741
|
secondary: description
|
|
3682
3742
|
}
|
|
3683
|
-
) }) : /* @__PURE__ */
|
|
3743
|
+
) }) : /* @__PURE__ */ jsx24(
|
|
3684
3744
|
Typeface,
|
|
3685
3745
|
{
|
|
3686
3746
|
id: labelId,
|
|
@@ -3688,7 +3748,7 @@ var FormField = forwardRef21(
|
|
|
3688
3748
|
content: "textCaption",
|
|
3689
3749
|
primary: hasLabel ? /* @__PURE__ */ jsxs16(Fragment3, { children: [
|
|
3690
3750
|
label,
|
|
3691
|
-
required ? /* @__PURE__ */
|
|
3751
|
+
required ? /* @__PURE__ */ jsx24("span", { className: "aviala-form__required", "aria-hidden": true, children: "*" }) : null
|
|
3692
3752
|
] }) : void 0,
|
|
3693
3753
|
secondary: description
|
|
3694
3754
|
}
|
|
@@ -3706,7 +3766,7 @@ var FormField = forwardRef21(
|
|
|
3706
3766
|
/* @__PURE__ */ jsxs16("div", { className: "aviala-form__content", children: [
|
|
3707
3767
|
children,
|
|
3708
3768
|
error ? /* @__PURE__ */ jsxs16("div", { className: "aviala-form__message aviala-form__message--error", role: "alert", children: [
|
|
3709
|
-
/* @__PURE__ */
|
|
3769
|
+
/* @__PURE__ */ jsx24(
|
|
3710
3770
|
SymbolWrongCircle,
|
|
3711
3771
|
{
|
|
3712
3772
|
className: "aviala-form__message-icon",
|
|
@@ -3715,10 +3775,10 @@ var FormField = forwardRef21(
|
|
|
3715
3775
|
"aria-hidden": true
|
|
3716
3776
|
}
|
|
3717
3777
|
),
|
|
3718
|
-
/* @__PURE__ */
|
|
3778
|
+
/* @__PURE__ */ jsx24(Typography, { level: "caption", as: "p", className: "aviala-form__message-text", children: error })
|
|
3719
3779
|
] }) : null,
|
|
3720
3780
|
info ? /* @__PURE__ */ jsxs16("div", { className: "aviala-form__message aviala-form__message--info", children: [
|
|
3721
|
-
/* @__PURE__ */
|
|
3781
|
+
/* @__PURE__ */ jsx24(
|
|
3722
3782
|
SymbolInformationCircle,
|
|
3723
3783
|
{
|
|
3724
3784
|
className: "aviala-form__message-icon",
|
|
@@ -3727,9 +3787,9 @@ var FormField = forwardRef21(
|
|
|
3727
3787
|
"aria-hidden": true
|
|
3728
3788
|
}
|
|
3729
3789
|
),
|
|
3730
|
-
/* @__PURE__ */
|
|
3790
|
+
/* @__PURE__ */ jsx24(Typography, { level: "caption", as: "p", className: "aviala-form__message-text", children: info })
|
|
3731
3791
|
] }) : null,
|
|
3732
|
-
alert ? /* @__PURE__ */
|
|
3792
|
+
alert ? /* @__PURE__ */ jsx24("div", { className: "aviala-form__alert", children: alert }) : null
|
|
3733
3793
|
] })
|
|
3734
3794
|
]
|
|
3735
3795
|
}
|
|
@@ -3740,9 +3800,9 @@ FormField.displayName = "FormField";
|
|
|
3740
3800
|
|
|
3741
3801
|
// src/components/input-group.tsx
|
|
3742
3802
|
import { forwardRef as forwardRef22 } from "react";
|
|
3743
|
-
import { jsx as
|
|
3803
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
3744
3804
|
var InputGroup = forwardRef22(
|
|
3745
|
-
({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */
|
|
3805
|
+
({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ jsx25(
|
|
3746
3806
|
"div",
|
|
3747
3807
|
{
|
|
3748
3808
|
ref,
|
|
@@ -3756,7 +3816,7 @@ var InputGroup = forwardRef22(
|
|
|
3756
3816
|
)
|
|
3757
3817
|
);
|
|
3758
3818
|
InputGroup.displayName = "InputGroup";
|
|
3759
|
-
var InputGroupAddon = forwardRef22(({ className, ...props }, ref) => /* @__PURE__ */
|
|
3819
|
+
var InputGroupAddon = forwardRef22(({ className, ...props }, ref) => /* @__PURE__ */ jsx25(
|
|
3760
3820
|
"div",
|
|
3761
3821
|
{
|
|
3762
3822
|
ref,
|
|
@@ -3772,7 +3832,7 @@ InputGroupAddon.displayName = "InputGroupAddon";
|
|
|
3772
3832
|
|
|
3773
3833
|
// src/components/stack.tsx
|
|
3774
3834
|
import { forwardRef as forwardRef23, useId as useId3 } from "react";
|
|
3775
|
-
import { jsx as
|
|
3835
|
+
import { jsx as jsx26, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3776
3836
|
var gapMap = {
|
|
3777
3837
|
inside: "var(--gap-inside, 4px)",
|
|
3778
3838
|
component: "var(--gap-component, 8px)",
|
|
@@ -3781,7 +3841,7 @@ var gapMap = {
|
|
|
3781
3841
|
page: "var(--gap-page-space, 24px)"
|
|
3782
3842
|
};
|
|
3783
3843
|
var Stack = forwardRef23(
|
|
3784
|
-
({ className, gap = "component", direction = "column", style, ...props }, ref) => /* @__PURE__ */
|
|
3844
|
+
({ className, gap = "component", direction = "column", style, ...props }, ref) => /* @__PURE__ */ jsx26(
|
|
3785
3845
|
"div",
|
|
3786
3846
|
{
|
|
3787
3847
|
ref,
|
|
@@ -3817,7 +3877,7 @@ var Fieldset = forwardRef23(
|
|
|
3817
3877
|
"aria-labelledby": hasHeading ? headingId : void 0,
|
|
3818
3878
|
...props,
|
|
3819
3879
|
children: [
|
|
3820
|
-
hasHeading || description ? /* @__PURE__ */
|
|
3880
|
+
hasHeading || description ? /* @__PURE__ */ jsx26(
|
|
3821
3881
|
Typeface,
|
|
3822
3882
|
{
|
|
3823
3883
|
id: headingId,
|
|
@@ -3827,11 +3887,11 @@ var Fieldset = forwardRef23(
|
|
|
3827
3887
|
secondary: description
|
|
3828
3888
|
}
|
|
3829
3889
|
) : null,
|
|
3830
|
-
/* @__PURE__ */
|
|
3890
|
+
/* @__PURE__ */ jsx26("div", { className: "aviala-form-group__slot", children }),
|
|
3831
3891
|
hasAction ? /* @__PURE__ */ jsxs17("div", { className: "aviala-form-group__action", children: [
|
|
3832
|
-
info ? /* @__PURE__ */
|
|
3833
|
-
feedback ? /* @__PURE__ */
|
|
3834
|
-
actions ? /* @__PURE__ */
|
|
3892
|
+
info ? /* @__PURE__ */ jsx26("div", { className: "aviala-form-group__info", children: info }) : null,
|
|
3893
|
+
feedback ? /* @__PURE__ */ jsx26("div", { className: "aviala-form-group__feedback", children: feedback }) : null,
|
|
3894
|
+
actions ? /* @__PURE__ */ jsx26("div", { className: "aviala-form-group__actions", children: actions }) : null
|
|
3835
3895
|
] }) : null
|
|
3836
3896
|
]
|
|
3837
3897
|
}
|
|
@@ -3844,7 +3904,7 @@ Fieldset.displayName = "Fieldset";
|
|
|
3844
3904
|
import * as PopoverPrimitive2 from "@radix-ui/react-popover";
|
|
3845
3905
|
import {
|
|
3846
3906
|
forwardRef as forwardRef25,
|
|
3847
|
-
useState as
|
|
3907
|
+
useState as useState10
|
|
3848
3908
|
} from "react";
|
|
3849
3909
|
|
|
3850
3910
|
// src/components/color-picker/color-picker-area.tsx
|
|
@@ -3963,7 +4023,7 @@ function usePointerDrag(ref, onMove, enabled = true) {
|
|
|
3963
4023
|
}
|
|
3964
4024
|
|
|
3965
4025
|
// src/components/color-picker/use-color-picker-state.ts
|
|
3966
|
-
import { useCallback as useCallback6, useMemo as useMemo4, useState as
|
|
4026
|
+
import { useCallback as useCallback6, useMemo as useMemo4, useState as useState8 } from "react";
|
|
3967
4027
|
function useColorPickerState({
|
|
3968
4028
|
value: controlledValue,
|
|
3969
4029
|
defaultValue = DEFAULT_COLOR,
|
|
@@ -3972,8 +4032,8 @@ function useColorPickerState({
|
|
|
3972
4032
|
defaultFormat = "hex",
|
|
3973
4033
|
onFormatChange
|
|
3974
4034
|
}) {
|
|
3975
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
3976
|
-
const [uncontrolledFormat, setUncontrolledFormat] =
|
|
4035
|
+
const [uncontrolledValue, setUncontrolledValue] = useState8(defaultValue);
|
|
4036
|
+
const [uncontrolledFormat, setUncontrolledFormat] = useState8(defaultFormat);
|
|
3977
4037
|
const value = controlledValue ?? uncontrolledValue;
|
|
3978
4038
|
const format = controlledFormat ?? uncontrolledFormat;
|
|
3979
4039
|
const setValue = useCallback6(
|
|
@@ -4006,7 +4066,7 @@ function useColorPickerState({
|
|
|
4006
4066
|
}
|
|
4007
4067
|
|
|
4008
4068
|
// src/components/color-picker/color-picker-area.tsx
|
|
4009
|
-
import { jsx as
|
|
4069
|
+
import { jsx as jsx27, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4010
4070
|
function ColorPickerArea({
|
|
4011
4071
|
className,
|
|
4012
4072
|
disabled,
|
|
@@ -4038,7 +4098,7 @@ function ColorPickerArea({
|
|
|
4038
4098
|
);
|
|
4039
4099
|
const { handlePointerDown, handlePointerMove } = usePointerDrag(ref, handleMove, !isDisabled);
|
|
4040
4100
|
const hueColor = pureHueHex(hsva.h);
|
|
4041
|
-
return /* @__PURE__ */
|
|
4101
|
+
return /* @__PURE__ */ jsx27("div", { className: cn("aviala-color-picker-area", className), ...spiralDebugId("color-picker.content.area"), children: /* @__PURE__ */ jsxs18(
|
|
4042
4102
|
"div",
|
|
4043
4103
|
{
|
|
4044
4104
|
ref,
|
|
@@ -4053,9 +4113,9 @@ function ColorPickerArea({
|
|
|
4053
4113
|
"aria-valuenow": Math.round(hsva.s),
|
|
4054
4114
|
tabIndex: isDisabled ? -1 : 0,
|
|
4055
4115
|
children: [
|
|
4056
|
-
/* @__PURE__ */
|
|
4057
|
-
/* @__PURE__ */
|
|
4058
|
-
/* @__PURE__ */
|
|
4116
|
+
/* @__PURE__ */ jsx27("div", { className: "aviala-color-picker-area__white", "aria-hidden": true }),
|
|
4117
|
+
/* @__PURE__ */ jsx27("div", { className: "aviala-color-picker-area__black", "aria-hidden": true }),
|
|
4118
|
+
/* @__PURE__ */ jsx27(
|
|
4059
4119
|
"div",
|
|
4060
4120
|
{
|
|
4061
4121
|
className: "aviala-color-picker-area__thumb",
|
|
@@ -4073,8 +4133,8 @@ function ColorPickerArea({
|
|
|
4073
4133
|
|
|
4074
4134
|
// src/components/color-picker/color-picker-inputs.tsx
|
|
4075
4135
|
import { EditColorPicker } from "@aviala-design/icons";
|
|
4076
|
-
import { useCallback as useCallback8, useEffect as
|
|
4077
|
-
import { jsx as
|
|
4136
|
+
import { useCallback as useCallback8, useEffect as useEffect5, useState as useState9 } from "react";
|
|
4137
|
+
import { jsx as jsx28, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4078
4138
|
function ColorPickerInputs({
|
|
4079
4139
|
className,
|
|
4080
4140
|
disabled,
|
|
@@ -4096,10 +4156,10 @@ function ColorPickerInputs({
|
|
|
4096
4156
|
const { value, setValue, format, setFormat, hsva } = ctx ?? local;
|
|
4097
4157
|
const isDisabled = disabled ?? ctx?.disabled;
|
|
4098
4158
|
const eyeDropperSupported = typeof window !== "undefined" && "EyeDropper" in window;
|
|
4099
|
-
const [hexDraft, setHexDraft] =
|
|
4100
|
-
const [alphaDraft, setAlphaDraft] =
|
|
4101
|
-
const [componentDraft, setComponentDraft] =
|
|
4102
|
-
|
|
4159
|
+
const [hexDraft, setHexDraft] = useState9(() => toHexInput(value));
|
|
4160
|
+
const [alphaDraft, setAlphaDraft] = useState9(() => String(alphaPercent(value)));
|
|
4161
|
+
const [componentDraft, setComponentDraft] = useState9(() => buildComponentDraft(value, format));
|
|
4162
|
+
useEffect5(() => {
|
|
4103
4163
|
setHexDraft(toHexInput(value));
|
|
4104
4164
|
setAlphaDraft(String(alphaPercent(value)));
|
|
4105
4165
|
setComponentDraft(buildComponentDraft(value, format));
|
|
@@ -4135,7 +4195,7 @@ function ColorPickerInputs({
|
|
|
4135
4195
|
}
|
|
4136
4196
|
}, [eyeDropperSupported, isDisabled, setValue]);
|
|
4137
4197
|
return /* @__PURE__ */ jsxs19("div", { className: cn("aviala-color-picker-inputs", className), ...spiralDebugId("color-picker.content.inputs"), children: [
|
|
4138
|
-
showEyedropper ? /* @__PURE__ */
|
|
4198
|
+
showEyedropper ? /* @__PURE__ */ jsx28(
|
|
4139
4199
|
Button,
|
|
4140
4200
|
{
|
|
4141
4201
|
type: "button",
|
|
@@ -4147,12 +4207,12 @@ function ColorPickerInputs({
|
|
|
4147
4207
|
...spiralDebugId("color-picker.content.inputs.eyedropper"),
|
|
4148
4208
|
title: eyeDropperSupported ? "Pick color from screen" : "EyeDropper not supported in this browser",
|
|
4149
4209
|
onClick: handleEyedropper,
|
|
4150
|
-
children: /* @__PURE__ */
|
|
4210
|
+
children: /* @__PURE__ */ jsx28(EditColorPicker, { "aria-hidden": true })
|
|
4151
4211
|
}
|
|
4152
4212
|
) : null,
|
|
4153
4213
|
format === "hex" ? /* @__PURE__ */ jsxs19("div", { className: "aviala-color-picker-field", children: [
|
|
4154
|
-
/* @__PURE__ */
|
|
4155
|
-
/* @__PURE__ */
|
|
4214
|
+
/* @__PURE__ */ jsx28("span", { className: "aviala-color-picker-field__badge-area", children: /* @__PURE__ */ jsx28(Badge, { style: "normal", children: "#" }) }),
|
|
4215
|
+
/* @__PURE__ */ jsx28(
|
|
4156
4216
|
"input",
|
|
4157
4217
|
{
|
|
4158
4218
|
className: cn("aviala-color-picker-field__input", typographyVariants({ level: "text" })),
|
|
@@ -4164,7 +4224,7 @@ function ColorPickerInputs({
|
|
|
4164
4224
|
onKeyDown: (e) => e.key === "Enter" && commitHex()
|
|
4165
4225
|
}
|
|
4166
4226
|
)
|
|
4167
|
-
] }) : /* @__PURE__ */
|
|
4227
|
+
] }) : /* @__PURE__ */ jsx28("div", { className: "aviala-color-picker-field", children: /* @__PURE__ */ jsx28(
|
|
4168
4228
|
"input",
|
|
4169
4229
|
{
|
|
4170
4230
|
className: cn("aviala-color-picker-field__input", typographyVariants({ level: "text" })),
|
|
@@ -4177,7 +4237,7 @@ function ColorPickerInputs({
|
|
|
4177
4237
|
}
|
|
4178
4238
|
) }),
|
|
4179
4239
|
/* @__PURE__ */ jsxs19("div", { className: "aviala-color-picker-field aviala-color-picker-field--alpha", children: [
|
|
4180
|
-
/* @__PURE__ */
|
|
4240
|
+
/* @__PURE__ */ jsx28(
|
|
4181
4241
|
"input",
|
|
4182
4242
|
{
|
|
4183
4243
|
className: cn("aviala-color-picker-field__input", typographyVariants({ level: "text" })),
|
|
@@ -4190,7 +4250,7 @@ function ColorPickerInputs({
|
|
|
4190
4250
|
onKeyDown: (e) => e.key === "Enter" && commitAlpha()
|
|
4191
4251
|
}
|
|
4192
4252
|
),
|
|
4193
|
-
/* @__PURE__ */
|
|
4253
|
+
/* @__PURE__ */ jsx28("span", { className: "aviala-color-picker-field__badge-area", children: /* @__PURE__ */ jsx28(Badge, { style: "normal", children: "%" }) })
|
|
4194
4254
|
] }),
|
|
4195
4255
|
/* @__PURE__ */ jsxs19(
|
|
4196
4256
|
Select,
|
|
@@ -4199,11 +4259,11 @@ function ColorPickerInputs({
|
|
|
4199
4259
|
onValueChange: (next) => setFormat(next),
|
|
4200
4260
|
disabled: isDisabled,
|
|
4201
4261
|
children: [
|
|
4202
|
-
/* @__PURE__ */
|
|
4203
|
-
/* @__PURE__ */
|
|
4204
|
-
/* @__PURE__ */
|
|
4205
|
-
/* @__PURE__ */
|
|
4206
|
-
/* @__PURE__ */
|
|
4262
|
+
/* @__PURE__ */ jsx28(SelectTrigger, { className: "aviala-color-picker-format-select w-[76px] shrink-0", size: "regular", children: /* @__PURE__ */ jsx28(SelectValue, {}) }),
|
|
4263
|
+
/* @__PURE__ */ jsx28(SelectContent, { onCloseAutoFocus: (event) => event.preventDefault(), children: /* @__PURE__ */ jsxs19(SelectItemGroup, { children: [
|
|
4264
|
+
/* @__PURE__ */ jsx28(SelectItem, { value: "hex", itemFunction: "radio", children: "HEX" }),
|
|
4265
|
+
/* @__PURE__ */ jsx28(SelectItem, { value: "rgb", itemFunction: "radio", children: "RGB" }),
|
|
4266
|
+
/* @__PURE__ */ jsx28(SelectItem, { value: "hsl", itemFunction: "radio", children: "HSL" })
|
|
4207
4267
|
] }) })
|
|
4208
4268
|
]
|
|
4209
4269
|
}
|
|
@@ -4227,11 +4287,11 @@ import { SymbolAdd } from "@aviala-design/icons";
|
|
|
4227
4287
|
|
|
4228
4288
|
// src/components/color-picker/color-pick-button.tsx
|
|
4229
4289
|
import { forwardRef as forwardRef24 } from "react";
|
|
4230
|
-
import { jsx as
|
|
4290
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
4231
4291
|
var ColorPickButton = forwardRef24(
|
|
4232
4292
|
({ className, color, selected = false, style, ...props }, ref) => {
|
|
4233
4293
|
const swatch = parseColor(color).toHex();
|
|
4234
|
-
return /* @__PURE__ */
|
|
4294
|
+
return /* @__PURE__ */ jsx29(
|
|
4235
4295
|
"button",
|
|
4236
4296
|
{
|
|
4237
4297
|
ref,
|
|
@@ -4240,7 +4300,7 @@ var ColorPickButton = forwardRef24(
|
|
|
4240
4300
|
"data-selected": selected ? "true" : void 0,
|
|
4241
4301
|
style,
|
|
4242
4302
|
...props,
|
|
4243
|
-
children: /* @__PURE__ */
|
|
4303
|
+
children: /* @__PURE__ */ jsx29(
|
|
4244
4304
|
"span",
|
|
4245
4305
|
{
|
|
4246
4306
|
className: "aviala-color-pick-button__swatch",
|
|
@@ -4255,7 +4315,7 @@ var ColorPickButton = forwardRef24(
|
|
|
4255
4315
|
ColorPickButton.displayName = "ColorPickButton";
|
|
4256
4316
|
|
|
4257
4317
|
// src/components/color-picker/color-picker-presets.tsx
|
|
4258
|
-
import { jsx as
|
|
4318
|
+
import { jsx as jsx30, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4259
4319
|
function ColorPickerPresets({
|
|
4260
4320
|
className,
|
|
4261
4321
|
presets: presetsProp,
|
|
@@ -4278,7 +4338,7 @@ function ColorPickerPresets({
|
|
|
4278
4338
|
onPresetsChange(next);
|
|
4279
4339
|
};
|
|
4280
4340
|
return /* @__PURE__ */ jsxs20("div", { className: cn("aviala-color-picker-presets", className), ...spiralDebugId("color-picker.content.presets"), children: [
|
|
4281
|
-
/* @__PURE__ */
|
|
4341
|
+
/* @__PURE__ */ jsx30(
|
|
4282
4342
|
Button,
|
|
4283
4343
|
{
|
|
4284
4344
|
type: "button",
|
|
@@ -4288,10 +4348,10 @@ function ColorPickerPresets({
|
|
|
4288
4348
|
disabled: isDisabled || !onPresetsChange || presets.length >= maxPresets,
|
|
4289
4349
|
"aria-label": "Add current color to presets",
|
|
4290
4350
|
onClick: handleAdd,
|
|
4291
|
-
children: /* @__PURE__ */
|
|
4351
|
+
children: /* @__PURE__ */ jsx30(SymbolAdd, { "aria-hidden": true })
|
|
4292
4352
|
}
|
|
4293
4353
|
),
|
|
4294
|
-
presets.map((color) => /* @__PURE__ */
|
|
4354
|
+
presets.map((color) => /* @__PURE__ */ jsx30(
|
|
4295
4355
|
ColorPickButton,
|
|
4296
4356
|
{
|
|
4297
4357
|
color,
|
|
@@ -4306,7 +4366,7 @@ function ColorPickerPresets({
|
|
|
4306
4366
|
|
|
4307
4367
|
// src/components/color-picker/color-picker-slider.tsx
|
|
4308
4368
|
import { useCallback as useCallback9, useRef as useRef6 } from "react";
|
|
4309
|
-
import { jsx as
|
|
4369
|
+
import { jsx as jsx31, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4310
4370
|
function ColorPickerSlider({
|
|
4311
4371
|
kind,
|
|
4312
4372
|
className,
|
|
@@ -4354,7 +4414,7 @@ function ColorPickerSlider({
|
|
|
4354
4414
|
backgroundImage: `linear-gradient(90deg, transparent, ${solidHex(value)})`,
|
|
4355
4415
|
backgroundColor: "var(--color-picker-checkerboard)"
|
|
4356
4416
|
};
|
|
4357
|
-
return /* @__PURE__ */
|
|
4417
|
+
return /* @__PURE__ */ jsx31(
|
|
4358
4418
|
"div",
|
|
4359
4419
|
{
|
|
4360
4420
|
className: cn("aviala-color-picker-slider-row", className),
|
|
@@ -4373,8 +4433,8 @@ function ColorPickerSlider({
|
|
|
4373
4433
|
"aria-valuenow": ariaValueNow,
|
|
4374
4434
|
tabIndex: isDisabled ? -1 : 0,
|
|
4375
4435
|
children: [
|
|
4376
|
-
/* @__PURE__ */
|
|
4377
|
-
/* @__PURE__ */
|
|
4436
|
+
/* @__PURE__ */ jsx31("div", { className: "aviala-color-picker-slider__track", style: trackStyle }),
|
|
4437
|
+
/* @__PURE__ */ jsx31(
|
|
4378
4438
|
"div",
|
|
4379
4439
|
{
|
|
4380
4440
|
className: "aviala-color-picker-slider__thumb",
|
|
@@ -4390,7 +4450,7 @@ function ColorPickerSlider({
|
|
|
4390
4450
|
}
|
|
4391
4451
|
|
|
4392
4452
|
// src/components/color-picker/color-picker.tsx
|
|
4393
|
-
import { jsx as
|
|
4453
|
+
import { jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4394
4454
|
function ColorPicker({
|
|
4395
4455
|
children,
|
|
4396
4456
|
className,
|
|
@@ -4408,7 +4468,7 @@ function ColorPicker({
|
|
|
4408
4468
|
defaultOpen = false,
|
|
4409
4469
|
onOpenChange
|
|
4410
4470
|
}) {
|
|
4411
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
4471
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState10(defaultOpen);
|
|
4412
4472
|
const open = controlledOpen ?? uncontrolledOpen;
|
|
4413
4473
|
const handleOpenChange = (next) => {
|
|
4414
4474
|
if (disabled && next) return;
|
|
@@ -4433,17 +4493,17 @@ function ColorPicker({
|
|
|
4433
4493
|
onPresetsChange,
|
|
4434
4494
|
maxPresets
|
|
4435
4495
|
};
|
|
4436
|
-
return /* @__PURE__ */
|
|
4496
|
+
return /* @__PURE__ */ jsx32(ColorPickerContextProvider, { value: contextValue, children: /* @__PURE__ */ jsx32(PopoverPrimitive2.Root, { open, onOpenChange: handleOpenChange, modal: false, children: /* @__PURE__ */ jsx32("div", { className: cn("inline-flex", className), ...spiralDebugId("color-picker"), children }) }) });
|
|
4437
4497
|
}
|
|
4438
4498
|
function ColorPickerContextProvider({
|
|
4439
4499
|
value,
|
|
4440
4500
|
children
|
|
4441
4501
|
}) {
|
|
4442
|
-
return /* @__PURE__ */
|
|
4502
|
+
return /* @__PURE__ */ jsx32(ColorPickerContext.Provider, { value, children });
|
|
4443
4503
|
}
|
|
4444
4504
|
var ColorPickerTrigger = forwardRef25(({ className, size = "regular", allRound = false, placeholder = "Select color", ...props }, ref) => {
|
|
4445
4505
|
const { value, open, disabled } = useColorPickerContext();
|
|
4446
|
-
return /* @__PURE__ */
|
|
4506
|
+
return /* @__PURE__ */ jsx32(PopoverPrimitive2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs22(
|
|
4447
4507
|
"button",
|
|
4448
4508
|
{
|
|
4449
4509
|
ref,
|
|
@@ -4457,7 +4517,7 @@ var ColorPickerTrigger = forwardRef25(({ className, size = "regular", allRound =
|
|
|
4457
4517
|
disabled,
|
|
4458
4518
|
...props,
|
|
4459
4519
|
children: [
|
|
4460
|
-
/* @__PURE__ */
|
|
4520
|
+
/* @__PURE__ */ jsx32("span", { className: "aviala-color-picker-trigger__swatch", ...spiralDebugId("color-picker.trigger.swatch"), children: /* @__PURE__ */ jsx32(
|
|
4461
4521
|
"span",
|
|
4462
4522
|
{
|
|
4463
4523
|
className: "aviala-color-picker-trigger__swatch-inner",
|
|
@@ -4465,7 +4525,7 @@ var ColorPickerTrigger = forwardRef25(({ className, size = "regular", allRound =
|
|
|
4465
4525
|
"aria-hidden": true
|
|
4466
4526
|
}
|
|
4467
4527
|
) }),
|
|
4468
|
-
/* @__PURE__ */
|
|
4528
|
+
/* @__PURE__ */ jsx32("span", { className: "aviala-color-picker-trigger__value", ...spiralDebugId("color-picker.trigger.value"), children: value ? value.replace(/^#/, "").slice(0, 6).toUpperCase() : /* @__PURE__ */ jsx32("span", { className: "aviala-color-picker-trigger__placeholder", children: placeholder }) })
|
|
4469
4529
|
]
|
|
4470
4530
|
}
|
|
4471
4531
|
) });
|
|
@@ -4484,7 +4544,7 @@ var ColorPickerContent = forwardRef25(
|
|
|
4484
4544
|
...props
|
|
4485
4545
|
}, ref) => {
|
|
4486
4546
|
const { presets, onPresetsChange, maxPresets, disabled } = useColorPickerContext();
|
|
4487
|
-
return /* @__PURE__ */
|
|
4547
|
+
return /* @__PURE__ */ jsx32(PopoverPrimitive2.Portal, { children: /* @__PURE__ */ jsx32(
|
|
4488
4548
|
PopoverPrimitive2.Content,
|
|
4489
4549
|
{
|
|
4490
4550
|
ref,
|
|
@@ -4501,11 +4561,11 @@ var ColorPickerContent = forwardRef25(
|
|
|
4501
4561
|
onFocusOutside: (event) => event.preventDefault(),
|
|
4502
4562
|
...props,
|
|
4503
4563
|
children: /* @__PURE__ */ jsxs22("div", { className: "aviala-color-picker-panel", children: [
|
|
4504
|
-
/* @__PURE__ */
|
|
4505
|
-
/* @__PURE__ */
|
|
4506
|
-
/* @__PURE__ */
|
|
4507
|
-
/* @__PURE__ */
|
|
4508
|
-
showPresets ? /* @__PURE__ */
|
|
4564
|
+
/* @__PURE__ */ jsx32(ColorPickerArea, { disabled }),
|
|
4565
|
+
/* @__PURE__ */ jsx32(ColorPickerSlider, { kind: "hue", disabled }),
|
|
4566
|
+
/* @__PURE__ */ jsx32(ColorPickerSlider, { kind: "alpha", disabled }),
|
|
4567
|
+
/* @__PURE__ */ jsx32(ColorPickerInputs, { disabled, showEyedropper }),
|
|
4568
|
+
showPresets ? /* @__PURE__ */ jsx32(
|
|
4509
4569
|
ColorPickerPresets,
|
|
4510
4570
|
{
|
|
4511
4571
|
disabled,
|
|
@@ -4522,7 +4582,7 @@ var ColorPickerContent = forwardRef25(
|
|
|
4522
4582
|
ColorPickerContent.displayName = "ColorPickerContent";
|
|
4523
4583
|
|
|
4524
4584
|
// src/components/color-picker/color-picker-panel.tsx
|
|
4525
|
-
import { jsx as
|
|
4585
|
+
import { jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4526
4586
|
function ColorPickerPanel({
|
|
4527
4587
|
className,
|
|
4528
4588
|
disabled,
|
|
@@ -4554,12 +4614,12 @@ function ColorPickerPanel({
|
|
|
4554
4614
|
onPresetsChange,
|
|
4555
4615
|
maxPresets
|
|
4556
4616
|
};
|
|
4557
|
-
return /* @__PURE__ */
|
|
4558
|
-
/* @__PURE__ */
|
|
4559
|
-
/* @__PURE__ */
|
|
4560
|
-
/* @__PURE__ */
|
|
4561
|
-
/* @__PURE__ */
|
|
4562
|
-
showPresets ? /* @__PURE__ */
|
|
4617
|
+
return /* @__PURE__ */ jsx33(ColorPickerContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs23("div", { className: cn("aviala-color-picker-panel", className), children: [
|
|
4618
|
+
/* @__PURE__ */ jsx33(ColorPickerArea, { disabled }),
|
|
4619
|
+
/* @__PURE__ */ jsx33(ColorPickerSlider, { kind: "hue", disabled }),
|
|
4620
|
+
/* @__PURE__ */ jsx33(ColorPickerSlider, { kind: "alpha", disabled }),
|
|
4621
|
+
/* @__PURE__ */ jsx33(ColorPickerInputs, { disabled, showEyedropper }),
|
|
4622
|
+
showPresets ? /* @__PURE__ */ jsx33(
|
|
4563
4623
|
ColorPickerPresets,
|
|
4564
4624
|
{
|
|
4565
4625
|
disabled,
|
|
@@ -4576,7 +4636,7 @@ import * as PopoverPrimitive3 from "@radix-ui/react-popover";
|
|
|
4576
4636
|
import {
|
|
4577
4637
|
DirectionArrowDownLight as DirectionArrowDownLight3,
|
|
4578
4638
|
DirectionArrowRightLight,
|
|
4579
|
-
SymbolRight as
|
|
4639
|
+
SymbolRight as SymbolRight2
|
|
4580
4640
|
} from "@aviala-design/icons";
|
|
4581
4641
|
import {
|
|
4582
4642
|
createContext as createContext5,
|
|
@@ -4584,13 +4644,13 @@ import {
|
|
|
4584
4644
|
isValidElement as isValidElement12,
|
|
4585
4645
|
useCallback as useCallback10,
|
|
4586
4646
|
useContext as useContext5,
|
|
4587
|
-
useEffect as
|
|
4647
|
+
useEffect as useEffect6,
|
|
4588
4648
|
useLayoutEffect as useLayoutEffect3,
|
|
4589
4649
|
useMemo as useMemo5,
|
|
4590
4650
|
useRef as useRef7,
|
|
4591
|
-
useState as
|
|
4651
|
+
useState as useState11
|
|
4592
4652
|
} from "react";
|
|
4593
|
-
import { jsx as
|
|
4653
|
+
import { jsx as jsx34, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4594
4654
|
var CascaderContext = createContext5(null);
|
|
4595
4655
|
function useCascaderContext() {
|
|
4596
4656
|
const context = useContext5(CascaderContext);
|
|
@@ -4605,7 +4665,7 @@ function renderItemIcon2(node, iconLevel = "text", debugId) {
|
|
|
4605
4665
|
level: iconLevel,
|
|
4606
4666
|
biggerSize: true
|
|
4607
4667
|
});
|
|
4608
|
-
return /* @__PURE__ */
|
|
4668
|
+
return /* @__PURE__ */ jsx34(
|
|
4609
4669
|
"span",
|
|
4610
4670
|
{
|
|
4611
4671
|
className: cn(
|
|
@@ -4620,17 +4680,17 @@ function renderItemIcon2(node, iconLevel = "text", debugId) {
|
|
|
4620
4680
|
}
|
|
4621
4681
|
function renderBadgeSlot2(node) {
|
|
4622
4682
|
if (node == null || node === false) return null;
|
|
4623
|
-
return /* @__PURE__ */
|
|
4683
|
+
return /* @__PURE__ */ jsx34("span", { className: "aviala-cascader-item__badge", children: isValidElement12(node) && node.type === Badge ? node : /* @__PURE__ */ jsx34(Badge, { children: node }) });
|
|
4624
4684
|
}
|
|
4625
4685
|
function CascaderItemFormRadio() {
|
|
4626
4686
|
return /* @__PURE__ */ jsxs24("span", { className: "aviala-cascader-item__form-radio", "aria-hidden": true, children: [
|
|
4627
|
-
/* @__PURE__ */
|
|
4628
|
-
/* @__PURE__ */
|
|
4687
|
+
/* @__PURE__ */ jsx34("span", { className: "aviala-cascader-item__form-radio-surface" }),
|
|
4688
|
+
/* @__PURE__ */ jsx34("span", { className: "aviala-cascader-item__form-radio-indicator" })
|
|
4629
4689
|
] });
|
|
4630
4690
|
}
|
|
4631
4691
|
function CascaderItemFormCheckbox() {
|
|
4632
|
-
return /* @__PURE__ */
|
|
4633
|
-
|
|
4692
|
+
return /* @__PURE__ */ jsx34("span", { className: "aviala-cascader-item__form-checkbox", "aria-hidden": true, children: /* @__PURE__ */ jsx34(
|
|
4693
|
+
SymbolRight2,
|
|
4634
4694
|
{
|
|
4635
4695
|
className: "aviala-cascader-item__form-checkbox-icon",
|
|
4636
4696
|
thickness: "Bold",
|
|
@@ -4642,27 +4702,27 @@ function CascaderItemFormCheckbox() {
|
|
|
4642
4702
|
}
|
|
4643
4703
|
function CascaderItemTrailingRadio({ selected }) {
|
|
4644
4704
|
if (!selected) return null;
|
|
4645
|
-
return /* @__PURE__ */
|
|
4705
|
+
return /* @__PURE__ */ jsx34("span", { className: "aviala-cascader-item__trailing-radio", "aria-hidden": true, children: /* @__PURE__ */ jsx34(SymbolRight2, { level: "text", biggerSize: true, "aria-hidden": true }) });
|
|
4646
4706
|
}
|
|
4647
4707
|
function CascaderItemTrailingCheckbox({ selected }) {
|
|
4648
4708
|
if (!selected) return null;
|
|
4649
|
-
return /* @__PURE__ */
|
|
4709
|
+
return /* @__PURE__ */ jsx34("span", { className: "aviala-cascader-item__trailing-checkbox", "aria-hidden": true, children: /* @__PURE__ */ jsx34(SymbolRight2, { level: "text", biggerSize: true, "aria-hidden": true }) });
|
|
4650
4710
|
}
|
|
4651
4711
|
function renderFunctionSlot2(itemFunction, layout, showFunctionIcon, hasChildren, selected, icon) {
|
|
4652
4712
|
if (!showFunctionIcon || layout === "title") return null;
|
|
4653
4713
|
if (icon !== void 0) {
|
|
4654
|
-
return /* @__PURE__ */
|
|
4714
|
+
return /* @__PURE__ */ jsx34("span", { className: "aviala-cascader-item__function", children: icon });
|
|
4655
4715
|
}
|
|
4656
4716
|
switch (itemFunction) {
|
|
4657
4717
|
case "radio":
|
|
4658
|
-
return /* @__PURE__ */
|
|
4718
|
+
return /* @__PURE__ */ jsx34("span", { className: "aviala-cascader-item__function", children: /* @__PURE__ */ jsx34(CascaderItemTrailingRadio, { selected }) });
|
|
4659
4719
|
case "checkbox":
|
|
4660
|
-
return /* @__PURE__ */
|
|
4720
|
+
return /* @__PURE__ */ jsx34("span", { className: "aviala-cascader-item__function", children: /* @__PURE__ */ jsx34(CascaderItemTrailingCheckbox, { selected }) });
|
|
4661
4721
|
case "simple":
|
|
4662
4722
|
default:
|
|
4663
4723
|
return /* @__PURE__ */ jsxs24("span", { className: "aviala-cascader-item__function", children: [
|
|
4664
|
-
selected ? /* @__PURE__ */
|
|
4665
|
-
hasChildren ? /* @__PURE__ */
|
|
4724
|
+
selected ? /* @__PURE__ */ jsx34(SymbolRight2, { level: "text", biggerSize: true, "aria-hidden": true }) : null,
|
|
4725
|
+
hasChildren ? /* @__PURE__ */ jsx34(DirectionArrowRightLight, { level: "text", biggerSize: true, "aria-hidden": true }) : null
|
|
4666
4726
|
] });
|
|
4667
4727
|
}
|
|
4668
4728
|
}
|
|
@@ -4699,10 +4759,10 @@ function Cascader({
|
|
|
4699
4759
|
changeOnSelect = true,
|
|
4700
4760
|
className
|
|
4701
4761
|
}) {
|
|
4702
|
-
const [internalOpen, setInternalOpen] =
|
|
4703
|
-
const [internalValue, setInternalValue] =
|
|
4704
|
-
const [activePath, setActivePath] =
|
|
4705
|
-
const [highlightedValue, setHighlightedValue] =
|
|
4762
|
+
const [internalOpen, setInternalOpen] = useState11(defaultOpen);
|
|
4763
|
+
const [internalValue, setInternalValue] = useState11(defaultValue ?? []);
|
|
4764
|
+
const [activePath, setActivePath] = useState11(defaultValue ?? []);
|
|
4765
|
+
const [highlightedValue, setHighlightedValue] = useState11(null);
|
|
4706
4766
|
const windowBlurCloseRef = useRef7(false);
|
|
4707
4767
|
const pointerDownCloseRef = useRef7(false);
|
|
4708
4768
|
const isOpenControlled = openProp !== void 0;
|
|
@@ -4710,14 +4770,14 @@ function Cascader({
|
|
|
4710
4770
|
const open = isOpenControlled ? openProp : internalOpen;
|
|
4711
4771
|
const selectedPath = isValueControlled ? valueProp ?? [] : internalValue;
|
|
4712
4772
|
const wasOpenRef = useRef7(open);
|
|
4713
|
-
|
|
4773
|
+
useEffect6(() => {
|
|
4714
4774
|
const markWindowBlur = () => {
|
|
4715
4775
|
windowBlurCloseRef.current = true;
|
|
4716
4776
|
};
|
|
4717
4777
|
window.addEventListener("blur", markWindowBlur, true);
|
|
4718
4778
|
return () => window.removeEventListener("blur", markWindowBlur, true);
|
|
4719
4779
|
}, []);
|
|
4720
|
-
|
|
4780
|
+
useEffect6(() => {
|
|
4721
4781
|
const justOpened = open && !wasOpenRef.current;
|
|
4722
4782
|
wasOpenRef.current = open;
|
|
4723
4783
|
if (!justOpened) return;
|
|
@@ -4732,7 +4792,7 @@ function Cascader({
|
|
|
4732
4792
|
}
|
|
4733
4793
|
setActivePath(selectedPath.slice(0, -1));
|
|
4734
4794
|
}, [open, options, selectedPath]);
|
|
4735
|
-
|
|
4795
|
+
useEffect6(() => {
|
|
4736
4796
|
if (!open) {
|
|
4737
4797
|
pointerDownCloseRef.current = false;
|
|
4738
4798
|
return;
|
|
@@ -4822,7 +4882,7 @@ function Cascader({
|
|
|
4822
4882
|
size
|
|
4823
4883
|
]
|
|
4824
4884
|
);
|
|
4825
|
-
return /* @__PURE__ */
|
|
4885
|
+
return /* @__PURE__ */ jsx34(CascaderContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx34(PopoverPrimitive3.Root, { open, onOpenChange: handleOpenChange, modal: false, children: /* @__PURE__ */ jsx34("div", { className: cn("inline-flex", className), ...spiralDebugId("cascader"), children }) }) });
|
|
4826
4886
|
}
|
|
4827
4887
|
var CascaderTrigger = forwardRef26(
|
|
4828
4888
|
({
|
|
@@ -4848,7 +4908,7 @@ var CascaderTrigger = forwardRef26(
|
|
|
4848
4908
|
label
|
|
4849
4909
|
] }, `${selectedPath[index]}-${index}`)) : null);
|
|
4850
4910
|
const hasValue = resolvedDisplay != null && resolvedDisplay !== false;
|
|
4851
|
-
return /* @__PURE__ */
|
|
4911
|
+
return /* @__PURE__ */ jsx34(PopoverPrimitive3.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs24(
|
|
4852
4912
|
"button",
|
|
4853
4913
|
{
|
|
4854
4914
|
ref,
|
|
@@ -4865,7 +4925,7 @@ var CascaderTrigger = forwardRef26(
|
|
|
4865
4925
|
...props,
|
|
4866
4926
|
children: [
|
|
4867
4927
|
renderSlotIcon(leftIcon, "aviala-cascader-trigger__slot", "cascader.trigger.icon-left"),
|
|
4868
|
-
/* @__PURE__ */
|
|
4928
|
+
/* @__PURE__ */ jsx34("span", { className: "aviala-cascader-trigger__field", ...spiralDebugId("cascader.trigger.value"), children: /* @__PURE__ */ jsx34(
|
|
4869
4929
|
"span",
|
|
4870
4930
|
{
|
|
4871
4931
|
className: cn("aviala-cascader-trigger__value", typographyVariants({ level: "text" })),
|
|
@@ -4874,14 +4934,14 @@ var CascaderTrigger = forwardRef26(
|
|
|
4874
4934
|
}
|
|
4875
4935
|
) }),
|
|
4876
4936
|
renderSlotIcon(rightIcon, "aviala-cascader-trigger__slot", "cascader.trigger.icon-right"),
|
|
4877
|
-
/* @__PURE__ */
|
|
4937
|
+
/* @__PURE__ */ jsx34(
|
|
4878
4938
|
"span",
|
|
4879
4939
|
{
|
|
4880
4940
|
className: "aviala-cascader-trigger__expand",
|
|
4881
4941
|
"aria-hidden": true,
|
|
4882
4942
|
style: expandIcon ? iconSlotCssVarStyle(expandIcon, "--input-slot-icon-size", "text", true) : iconLevelCssVarStyle("text", true, "--input-slot-icon-size"),
|
|
4883
4943
|
...spiralDebugId("cascader.trigger.expand"),
|
|
4884
|
-
children: expandIcon ?? /* @__PURE__ */
|
|
4944
|
+
children: expandIcon ?? /* @__PURE__ */ jsx34(DirectionArrowDownLight3, { level: "text", biggerSize: true, "aria-hidden": true })
|
|
4885
4945
|
}
|
|
4886
4946
|
)
|
|
4887
4947
|
]
|
|
@@ -4899,7 +4959,7 @@ var CascaderContent = forwardRef26(
|
|
|
4899
4959
|
portalled = true,
|
|
4900
4960
|
...props
|
|
4901
4961
|
}, ref) => {
|
|
4902
|
-
const content = /* @__PURE__ */
|
|
4962
|
+
const content = /* @__PURE__ */ jsx34(
|
|
4903
4963
|
PopoverPrimitive3.Content,
|
|
4904
4964
|
{
|
|
4905
4965
|
ref,
|
|
@@ -4912,12 +4972,12 @@ var CascaderContent = forwardRef26(
|
|
|
4912
4972
|
}
|
|
4913
4973
|
);
|
|
4914
4974
|
if (!portalled) return content;
|
|
4915
|
-
return /* @__PURE__ */
|
|
4975
|
+
return /* @__PURE__ */ jsx34(PopoverPrimitive3.Portal, { children: content });
|
|
4916
4976
|
}
|
|
4917
4977
|
);
|
|
4918
4978
|
CascaderContent.displayName = "CascaderContent";
|
|
4919
4979
|
var CascaderMenu = forwardRef26(
|
|
4920
|
-
({ children, className }, ref) => /* @__PURE__ */
|
|
4980
|
+
({ children, className }, ref) => /* @__PURE__ */ jsx34("div", { ref, className: cn("aviala-cascader-menu", className), children })
|
|
4921
4981
|
);
|
|
4922
4982
|
CascaderMenu.displayName = "CascaderMenu";
|
|
4923
4983
|
var CascaderColumn = forwardRef26(
|
|
@@ -4931,14 +4991,14 @@ var CascaderColumn = forwardRef26(
|
|
|
4931
4991
|
width: exitLayout.width,
|
|
4932
4992
|
zIndex: 0
|
|
4933
4993
|
} : void 0;
|
|
4934
|
-
return /* @__PURE__ */
|
|
4994
|
+
return /* @__PURE__ */ jsx34(
|
|
4935
4995
|
"div",
|
|
4936
4996
|
{
|
|
4937
4997
|
ref,
|
|
4938
4998
|
className: cn("aviala-cascader-column", className),
|
|
4939
4999
|
"data-animate": animate,
|
|
4940
5000
|
style: exitStyle,
|
|
4941
|
-
children: /* @__PURE__ */
|
|
5001
|
+
children: /* @__PURE__ */ jsx34("div", { className: "aviala-cascader-column__surface", "data-animate": animate, children })
|
|
4942
5002
|
}
|
|
4943
5003
|
);
|
|
4944
5004
|
}
|
|
@@ -4951,9 +5011,9 @@ function CascaderItemGroup({
|
|
|
4951
5011
|
className
|
|
4952
5012
|
}) {
|
|
4953
5013
|
return /* @__PURE__ */ jsxs24("div", { className: cn("aviala-cascader-group", className), children: [
|
|
4954
|
-
label ? /* @__PURE__ */
|
|
4955
|
-
/* @__PURE__ */
|
|
4956
|
-
showDivider ? /* @__PURE__ */
|
|
5014
|
+
label ? /* @__PURE__ */ jsx34("div", { className: cn("aviala-cascader-label", typographyVariants({ level: "caption" })), children: label }) : null,
|
|
5015
|
+
/* @__PURE__ */ jsx34("div", { className: "aviala-cascader-group__slot", children }),
|
|
5016
|
+
showDivider ? /* @__PURE__ */ jsx34("div", { className: "aviala-cascader-separator", role: "separator" }) : null
|
|
4957
5017
|
] });
|
|
4958
5018
|
}
|
|
4959
5019
|
var CascaderItem = forwardRef26(
|
|
@@ -5046,10 +5106,10 @@ var CascaderItem = forwardRef26(
|
|
|
5046
5106
|
if (!isTitle) setHighlightedValue(value);
|
|
5047
5107
|
},
|
|
5048
5108
|
children: [
|
|
5049
|
-
isFormLeading && itemFunction === "form-radio" ? /* @__PURE__ */
|
|
5050
|
-
isFormLeading && itemFunction === "form-checkbox" ? /* @__PURE__ */
|
|
5109
|
+
isFormLeading && itemFunction === "form-radio" ? /* @__PURE__ */ jsx34(CascaderItemFormRadio, {}) : null,
|
|
5110
|
+
isFormLeading && itemFunction === "form-checkbox" ? /* @__PURE__ */ jsx34(CascaderItemFormCheckbox, {}) : null,
|
|
5051
5111
|
showLeftIcon && leftIcon ? renderItemIcon2(leftIcon, leftIconLevel, "cascader.content.item.icon-left") : null,
|
|
5052
|
-
/* @__PURE__ */
|
|
5112
|
+
/* @__PURE__ */ jsx34("span", { className: cn("aviala-cascader-item__text", typographyVariants({ level: isTitle ? "caption" : "text" })), children: children ?? option?.label }),
|
|
5053
5113
|
showBadge ? renderBadgeSlot2(badge ?? "Text") : null,
|
|
5054
5114
|
showRightIcon && rightIcon ? renderItemIcon2(rightIcon, leftIconLevel) : null,
|
|
5055
5115
|
renderFunctionSlot2(
|
|
@@ -5080,7 +5140,7 @@ function CascaderOptionsMenu({ className }) {
|
|
|
5080
5140
|
const lastPathChangeAtRef = useRef7(0);
|
|
5081
5141
|
const menuRef = useRef7(null);
|
|
5082
5142
|
const columnElRefs = useRef7(/* @__PURE__ */ new Map());
|
|
5083
|
-
const [columns, setColumns] =
|
|
5143
|
+
const [columns, setColumns] = useState11([]);
|
|
5084
5144
|
const columnPaths = useMemo5(() => {
|
|
5085
5145
|
const paths = [[]];
|
|
5086
5146
|
const expansion = activePath.length > 0 ? activePath : selectedPath.slice(0, -1);
|
|
@@ -5165,7 +5225,7 @@ function CascaderOptionsMenu({ className }) {
|
|
|
5165
5225
|
prevColumnCountRef.current = columnPaths.length;
|
|
5166
5226
|
prevColumnPathsRef.current = columnPaths;
|
|
5167
5227
|
}, [columnPaths, open]);
|
|
5168
|
-
|
|
5228
|
+
useEffect6(() => {
|
|
5169
5229
|
if (!open || !columns.some((column) => column.animateExit)) {
|
|
5170
5230
|
return void 0;
|
|
5171
5231
|
}
|
|
@@ -5174,7 +5234,7 @@ function CascaderOptionsMenu({ className }) {
|
|
|
5174
5234
|
}, COLUMN_ANIMATION_MS);
|
|
5175
5235
|
return () => window.clearTimeout(timeout);
|
|
5176
5236
|
}, [columns, open]);
|
|
5177
|
-
return /* @__PURE__ */
|
|
5237
|
+
return /* @__PURE__ */ jsx34(CascaderMenu, { ref: menuRef, className, children: columns.map(({ pathPrefix, key, animateEnter, animateExit, exitLayout }) => /* @__PURE__ */ jsx34(
|
|
5178
5238
|
CascaderColumn,
|
|
5179
5239
|
{
|
|
5180
5240
|
ref: (element) => {
|
|
@@ -5187,7 +5247,7 @@ function CascaderOptionsMenu({ className }) {
|
|
|
5187
5247
|
animateEnter,
|
|
5188
5248
|
animateExit,
|
|
5189
5249
|
exitLayout,
|
|
5190
|
-
children: /* @__PURE__ */
|
|
5250
|
+
children: /* @__PURE__ */ jsx34(CascaderItemGroup, { label: "Title", showDivider: true, children: getOptionsAtPath2(pathPrefix).map((option) => /* @__PURE__ */ jsx34(
|
|
5191
5251
|
CascaderItem,
|
|
5192
5252
|
{
|
|
5193
5253
|
value: option.value,
|
|
@@ -5240,7 +5300,7 @@ function CascaderField({
|
|
|
5240
5300
|
changeOnSelect,
|
|
5241
5301
|
className,
|
|
5242
5302
|
children: [
|
|
5243
|
-
/* @__PURE__ */
|
|
5303
|
+
/* @__PURE__ */ jsx34(
|
|
5244
5304
|
CascaderTrigger,
|
|
5245
5305
|
{
|
|
5246
5306
|
size,
|
|
@@ -5254,7 +5314,7 @@ function CascaderField({
|
|
|
5254
5314
|
...triggerProps
|
|
5255
5315
|
}
|
|
5256
5316
|
),
|
|
5257
|
-
/* @__PURE__ */
|
|
5317
|
+
/* @__PURE__ */ jsx34(CascaderContent, { className: contentClassName, children: /* @__PURE__ */ jsx34(CascaderOptionsMenu, { className: menuClassName }) })
|
|
5258
5318
|
]
|
|
5259
5319
|
}
|
|
5260
5320
|
);
|
|
@@ -5271,23 +5331,23 @@ import {
|
|
|
5271
5331
|
import {
|
|
5272
5332
|
forwardRef as forwardRef27,
|
|
5273
5333
|
useCallback as useCallback12,
|
|
5274
|
-
useEffect as
|
|
5334
|
+
useEffect as useEffect8,
|
|
5275
5335
|
useId as useId4,
|
|
5276
5336
|
useLayoutEffect as useLayoutEffect5,
|
|
5277
5337
|
useMemo as useMemo8,
|
|
5278
5338
|
useRef as useRef9,
|
|
5279
|
-
useState as
|
|
5339
|
+
useState as useState12
|
|
5280
5340
|
} from "react";
|
|
5281
5341
|
|
|
5282
5342
|
// src/components/date-picker/date-picker-context.tsx
|
|
5283
5343
|
import { createContext as createContext6, useContext as useContext6 } from "react";
|
|
5284
|
-
import { jsx as
|
|
5344
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
5285
5345
|
var DatePickerContext = createContext6(null);
|
|
5286
5346
|
function DatePickerProvider({
|
|
5287
5347
|
value,
|
|
5288
5348
|
children
|
|
5289
5349
|
}) {
|
|
5290
|
-
return /* @__PURE__ */
|
|
5350
|
+
return /* @__PURE__ */ jsx35(DatePickerContext.Provider, { value, children });
|
|
5291
5351
|
}
|
|
5292
5352
|
function useDatePickerContext() {
|
|
5293
5353
|
const context = useContext6(DatePickerContext);
|
|
@@ -5487,7 +5547,7 @@ import { useMemo as useMemo7 } from "react";
|
|
|
5487
5547
|
// src/components/date-picker/date-picker-time-wheel.tsx
|
|
5488
5548
|
import {
|
|
5489
5549
|
useCallback as useCallback11,
|
|
5490
|
-
useEffect as
|
|
5550
|
+
useEffect as useEffect7,
|
|
5491
5551
|
useLayoutEffect as useLayoutEffect4,
|
|
5492
5552
|
useMemo as useMemo6,
|
|
5493
5553
|
useRef as useRef8
|
|
@@ -5514,7 +5574,7 @@ function stickyRoundIndex(fractionalIndex, stickiness = WHEEL_STICKY_AMOUNT) {
|
|
|
5514
5574
|
}
|
|
5515
5575
|
|
|
5516
5576
|
// src/components/date-picker/date-picker-time-wheel.tsx
|
|
5517
|
-
import { jsx as
|
|
5577
|
+
import { jsx as jsx36, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
5518
5578
|
var LOOP_SECTIONS = 3;
|
|
5519
5579
|
var MIDDLE_SECTION = 1;
|
|
5520
5580
|
function formatWheelValue(value) {
|
|
@@ -5674,7 +5734,7 @@ function DatePickerTimeWheelColumn({
|
|
|
5674
5734
|
});
|
|
5675
5735
|
return () => cancelAnimationFrame(raf);
|
|
5676
5736
|
}, [layoutKey, syncScrollToValue, value]);
|
|
5677
|
-
|
|
5737
|
+
useEffect7(() => {
|
|
5678
5738
|
const container = scrollRef.current;
|
|
5679
5739
|
if (!container) return;
|
|
5680
5740
|
const onScrollEnd = () => {
|
|
@@ -5696,7 +5756,7 @@ function DatePickerTimeWheelColumn({
|
|
|
5696
5756
|
}
|
|
5697
5757
|
};
|
|
5698
5758
|
}, [settleScroll, syncScrollToValue]);
|
|
5699
|
-
|
|
5759
|
+
useEffect7(() => {
|
|
5700
5760
|
const container = scrollRef.current;
|
|
5701
5761
|
if (!container) return;
|
|
5702
5762
|
const onWheel = (event) => {
|
|
@@ -5755,22 +5815,22 @@ function DatePickerTimeWheelColumn({
|
|
|
5755
5815
|
};
|
|
5756
5816
|
const selectedOptionId = loop ? `${ariaLabel}-${value}-${values.length * MIDDLE_SECTION + getValueIndex(values, value)}` : `${ariaLabel}-${value}`;
|
|
5757
5817
|
return /* @__PURE__ */ jsxs25("div", { className: cn("aviala-datepicker-time__wheel", className), children: [
|
|
5758
|
-
/* @__PURE__ */
|
|
5759
|
-
/* @__PURE__ */
|
|
5818
|
+
/* @__PURE__ */ jsx36("div", { className: "aviala-datepicker-time__wheel-highlight", "aria-hidden": true }),
|
|
5819
|
+
/* @__PURE__ */ jsx36(
|
|
5760
5820
|
"div",
|
|
5761
5821
|
{
|
|
5762
5822
|
className: "aviala-datepicker-time__wheel-fade aviala-datepicker-time__wheel-fade--top",
|
|
5763
5823
|
"aria-hidden": true
|
|
5764
5824
|
}
|
|
5765
5825
|
),
|
|
5766
|
-
/* @__PURE__ */
|
|
5826
|
+
/* @__PURE__ */ jsx36(
|
|
5767
5827
|
"div",
|
|
5768
5828
|
{
|
|
5769
5829
|
className: "aviala-datepicker-time__wheel-fade aviala-datepicker-time__wheel-fade--bottom",
|
|
5770
5830
|
"aria-hidden": true
|
|
5771
5831
|
}
|
|
5772
5832
|
),
|
|
5773
|
-
/* @__PURE__ */
|
|
5833
|
+
/* @__PURE__ */ jsx36(
|
|
5774
5834
|
"div",
|
|
5775
5835
|
{
|
|
5776
5836
|
ref: scrollRef,
|
|
@@ -5781,17 +5841,17 @@ function DatePickerTimeWheelColumn({
|
|
|
5781
5841
|
"aria-activedescendant": selectedOptionId,
|
|
5782
5842
|
tabIndex: 0,
|
|
5783
5843
|
onKeyDown: handleKeyDown,
|
|
5784
|
-
children: /* @__PURE__ */
|
|
5844
|
+
children: /* @__PURE__ */ jsx36("ul", { className: "aviala-datepicker-time__wheel-list", children: repeatedValues.map((itemValue, index) => {
|
|
5785
5845
|
const isSelected = itemValue === value;
|
|
5786
5846
|
const optionId = loop ? `${ariaLabel}-${itemValue}-${index}` : `${ariaLabel}-${itemValue}`;
|
|
5787
|
-
return /* @__PURE__ */
|
|
5847
|
+
return /* @__PURE__ */ jsx36(
|
|
5788
5848
|
"li",
|
|
5789
5849
|
{
|
|
5790
5850
|
id: optionId,
|
|
5791
5851
|
className: "aviala-datepicker-time__wheel-item",
|
|
5792
5852
|
role: "option",
|
|
5793
5853
|
"aria-selected": isSelected,
|
|
5794
|
-
children: /* @__PURE__ */
|
|
5854
|
+
children: /* @__PURE__ */ jsx36(
|
|
5795
5855
|
"button",
|
|
5796
5856
|
{
|
|
5797
5857
|
type: "button",
|
|
@@ -5820,7 +5880,7 @@ function DatePickerTimeWheelColumn({
|
|
|
5820
5880
|
}
|
|
5821
5881
|
|
|
5822
5882
|
// src/components/date-picker/date-picker-month-wheels.tsx
|
|
5823
|
-
import { jsx as
|
|
5883
|
+
import { jsx as jsx37, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
5824
5884
|
var MONTH_VALUES = Array.from({ length: 12 }, (_, index) => index + 1);
|
|
5825
5885
|
function formatYearValue(value) {
|
|
5826
5886
|
return String(value);
|
|
@@ -5845,14 +5905,14 @@ function DatePickerMonthYearWheels({
|
|
|
5845
5905
|
const setYearMonth = (nextYear, nextMonth) => {
|
|
5846
5906
|
setViewMonth(new Date(nextYear, nextMonth - 1, 1));
|
|
5847
5907
|
};
|
|
5848
|
-
return /* @__PURE__ */
|
|
5908
|
+
return /* @__PURE__ */ jsx37(
|
|
5849
5909
|
"div",
|
|
5850
5910
|
{
|
|
5851
5911
|
className: cn("aviala-datepicker-month", className),
|
|
5852
5912
|
role: "group",
|
|
5853
5913
|
"aria-label": "\u9009\u62E9\u5E74\u6708",
|
|
5854
5914
|
children: /* @__PURE__ */ jsxs26("div", { className: "aviala-datepicker-month__columns", children: [
|
|
5855
|
-
/* @__PURE__ */
|
|
5915
|
+
/* @__PURE__ */ jsx37(
|
|
5856
5916
|
DatePickerTimeWheelColumn,
|
|
5857
5917
|
{
|
|
5858
5918
|
"aria-label": "\u5E74",
|
|
@@ -5864,7 +5924,7 @@ function DatePickerMonthYearWheels({
|
|
|
5864
5924
|
onChange: (nextYear) => setYearMonth(nextYear, month)
|
|
5865
5925
|
}
|
|
5866
5926
|
),
|
|
5867
|
-
/* @__PURE__ */
|
|
5927
|
+
/* @__PURE__ */ jsx37(
|
|
5868
5928
|
DatePickerTimeWheelColumn,
|
|
5869
5929
|
{
|
|
5870
5930
|
"aria-label": "\u6708",
|
|
@@ -5882,12 +5942,12 @@ function DatePickerMonthYearWheels({
|
|
|
5882
5942
|
}
|
|
5883
5943
|
|
|
5884
5944
|
// src/components/time-picker/time-picker-wheels.tsx
|
|
5885
|
-
import { jsx as
|
|
5945
|
+
import { jsx as jsx38, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
5886
5946
|
var TIME_PICKER_HOUR_VALUES = Array.from({ length: 24 }, (_, index) => index);
|
|
5887
5947
|
var TIME_PICKER_MINUTE_VALUES = Array.from({ length: 12 }, (_, index) => index * 5);
|
|
5888
5948
|
function TimePickerWheels({ value, onChange, className }) {
|
|
5889
|
-
return /* @__PURE__ */
|
|
5890
|
-
/* @__PURE__ */
|
|
5949
|
+
return /* @__PURE__ */ jsx38("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: [
|
|
5950
|
+
/* @__PURE__ */ jsx38(
|
|
5891
5951
|
DatePickerTimeWheelColumn,
|
|
5892
5952
|
{
|
|
5893
5953
|
"aria-label": "\u5C0F\u65F6",
|
|
@@ -5896,7 +5956,7 @@ function TimePickerWheels({ value, onChange, className }) {
|
|
|
5896
5956
|
onChange: (hours) => onChange({ ...value, hours })
|
|
5897
5957
|
}
|
|
5898
5958
|
),
|
|
5899
|
-
/* @__PURE__ */
|
|
5959
|
+
/* @__PURE__ */ jsx38(
|
|
5900
5960
|
DatePickerTimeWheelColumn,
|
|
5901
5961
|
{
|
|
5902
5962
|
"aria-label": "\u5206\u949F",
|
|
@@ -5909,7 +5969,7 @@ function TimePickerWheels({ value, onChange, className }) {
|
|
|
5909
5969
|
}
|
|
5910
5970
|
|
|
5911
5971
|
// src/components/date-picker/date-picker.tsx
|
|
5912
|
-
import { Fragment as Fragment4, jsx as
|
|
5972
|
+
import { Fragment as Fragment4, jsx as jsx39, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
5913
5973
|
function getInitialViewMonth(mode, singleValue, rangeValue) {
|
|
5914
5974
|
if (mode === "single" && singleValue) return startOfDay(singleValue);
|
|
5915
5975
|
if (mode === "range") {
|
|
@@ -5935,16 +5995,16 @@ function DatePicker(props) {
|
|
|
5935
5995
|
defaultTimeValue = { hours: 17, minutes: 0 },
|
|
5936
5996
|
onTimeChange
|
|
5937
5997
|
} = props;
|
|
5938
|
-
const [internalOpen, setInternalOpen] =
|
|
5939
|
-
const [internalSingle, setInternalSingle] =
|
|
5998
|
+
const [internalOpen, setInternalOpen] = useState12(defaultOpen);
|
|
5999
|
+
const [internalSingle, setInternalSingle] = useState12(
|
|
5940
6000
|
() => mode === "single" ? props.defaultValue : void 0
|
|
5941
6001
|
);
|
|
5942
|
-
const [internalRange, setInternalRange] =
|
|
6002
|
+
const [internalRange, setInternalRange] = useState12(
|
|
5943
6003
|
() => mode === "range" ? props.defaultValue ?? {} : {}
|
|
5944
6004
|
);
|
|
5945
|
-
const [rangeDraftFrom, setRangeDraftFrom] =
|
|
5946
|
-
const [activePanel, setActivePanel] =
|
|
5947
|
-
const [internalTime, setInternalTime] =
|
|
6005
|
+
const [rangeDraftFrom, setRangeDraftFrom] = useState12(void 0);
|
|
6006
|
+
const [activePanel, setActivePanel] = useState12("date");
|
|
6007
|
+
const [internalTime, setInternalTime] = useState12(defaultTimeValue);
|
|
5948
6008
|
const isOpenControlled = openProp !== void 0;
|
|
5949
6009
|
const open = isOpenControlled ? openProp : internalOpen;
|
|
5950
6010
|
const timeValue = timeValueProp !== void 0 ? timeValueProp : internalTime;
|
|
@@ -5990,20 +6050,20 @@ function DatePicker(props) {
|
|
|
5990
6050
|
);
|
|
5991
6051
|
const singleValue = mode === "single" ? props.value !== void 0 ? props.value : internalSingle : void 0;
|
|
5992
6052
|
const rangeValue = mode === "range" ? props.value !== void 0 ? props.value ?? {} : internalRange : { from: rangeDraftFrom };
|
|
5993
|
-
const [viewMonth, setViewMonth] =
|
|
6053
|
+
const [viewMonth, setViewMonth] = useState12(
|
|
5994
6054
|
() => getInitialViewMonth(mode, singleValue, mode === "range" ? rangeValue : void 0)
|
|
5995
6055
|
);
|
|
5996
|
-
const [focusedDay, setFocusedDay] =
|
|
6056
|
+
const [focusedDay, setFocusedDay] = useState12(null);
|
|
5997
6057
|
const windowBlurCloseRef = useRef9(false);
|
|
5998
6058
|
const pointerDownCloseRef = useRef9(false);
|
|
5999
|
-
|
|
6059
|
+
useEffect8(() => {
|
|
6000
6060
|
const markWindowBlur = () => {
|
|
6001
6061
|
windowBlurCloseRef.current = true;
|
|
6002
6062
|
};
|
|
6003
6063
|
window.addEventListener("blur", markWindowBlur, true);
|
|
6004
6064
|
return () => window.removeEventListener("blur", markWindowBlur, true);
|
|
6005
6065
|
}, []);
|
|
6006
|
-
|
|
6066
|
+
useEffect8(() => {
|
|
6007
6067
|
if (!open) {
|
|
6008
6068
|
pointerDownCloseRef.current = false;
|
|
6009
6069
|
setRangeDraftFrom(void 0);
|
|
@@ -6233,7 +6293,7 @@ function DatePicker(props) {
|
|
|
6233
6293
|
viewMonth
|
|
6234
6294
|
]
|
|
6235
6295
|
);
|
|
6236
|
-
return /* @__PURE__ */
|
|
6296
|
+
return /* @__PURE__ */ jsx39(DatePickerProvider, { value: contextValue, children: /* @__PURE__ */ jsx39(PopoverPrimitive4.Root, { open, onOpenChange: handleOpenChange, modal: false, children: /* @__PURE__ */ jsx39("div", { className: cn("inline-flex", className), children }) }) });
|
|
6237
6297
|
}
|
|
6238
6298
|
function formatTriggerValue(mode, singleValue, rangeValue, enableTime, timeValue, rangeSeparator) {
|
|
6239
6299
|
if (mode === "single") {
|
|
@@ -6305,8 +6365,8 @@ var DatePickerTrigger = forwardRef27(
|
|
|
6305
6365
|
const defaultPlaceholder = enableTime ? "YYYY-MM-DD HH:mm" : placeholder;
|
|
6306
6366
|
const emptyPlaceholder = mode === "range" ? rangePlaceholder : defaultPlaceholder;
|
|
6307
6367
|
const formattedText = typeof formatted === "string" ? formatted : null;
|
|
6308
|
-
const [draft, setDraft] =
|
|
6309
|
-
|
|
6368
|
+
const [draft, setDraft] = useState12(formattedText ?? "");
|
|
6369
|
+
useEffect8(() => {
|
|
6310
6370
|
if (editingRef.current) return;
|
|
6311
6371
|
setDraft(formattedText ?? "");
|
|
6312
6372
|
}, [formattedText]);
|
|
@@ -6325,7 +6385,7 @@ var DatePickerTrigger = forwardRef27(
|
|
|
6325
6385
|
const showEditableInput = editable && displayValue == null;
|
|
6326
6386
|
if (!showEditableInput) {
|
|
6327
6387
|
const hasValue = formatted != null && formatted !== false;
|
|
6328
|
-
return /* @__PURE__ */
|
|
6388
|
+
return /* @__PURE__ */ jsx39(PopoverPrimitive4.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs28(
|
|
6329
6389
|
"button",
|
|
6330
6390
|
{
|
|
6331
6391
|
type: "button",
|
|
@@ -6339,10 +6399,10 @@ var DatePickerTrigger = forwardRef27(
|
|
|
6339
6399
|
"aria-haspopup": "dialog",
|
|
6340
6400
|
children: [
|
|
6341
6401
|
renderSlotIcon(
|
|
6342
|
-
leftIcon ?? /* @__PURE__ */
|
|
6402
|
+
leftIcon ?? /* @__PURE__ */ jsx39(TimeAndDateDate, { level: "text", biggerSize: true, "aria-hidden": true }),
|
|
6343
6403
|
"aviala-datepicker-trigger__slot"
|
|
6344
6404
|
),
|
|
6345
|
-
/* @__PURE__ */
|
|
6405
|
+
/* @__PURE__ */ jsx39("span", { className: "aviala-datepicker-trigger__field", children: /* @__PURE__ */ jsx39(
|
|
6346
6406
|
"span",
|
|
6347
6407
|
{
|
|
6348
6408
|
className: cn(
|
|
@@ -6358,7 +6418,7 @@ var DatePickerTrigger = forwardRef27(
|
|
|
6358
6418
|
}
|
|
6359
6419
|
) });
|
|
6360
6420
|
}
|
|
6361
|
-
return /* @__PURE__ */
|
|
6421
|
+
return /* @__PURE__ */ jsx39(PopoverPrimitive4.Anchor, { asChild: true, children: /* @__PURE__ */ jsxs28(
|
|
6362
6422
|
"div",
|
|
6363
6423
|
{
|
|
6364
6424
|
className: cn("aviala-datepicker-trigger aviala-focus-ring", className),
|
|
@@ -6376,10 +6436,10 @@ var DatePickerTrigger = forwardRef27(
|
|
|
6376
6436
|
},
|
|
6377
6437
|
children: [
|
|
6378
6438
|
renderSlotIcon(
|
|
6379
|
-
leftIcon ?? /* @__PURE__ */
|
|
6439
|
+
leftIcon ?? /* @__PURE__ */ jsx39(TimeAndDateDate, { level: "text", biggerSize: true, "aria-hidden": true }),
|
|
6380
6440
|
"aviala-datepicker-trigger__slot"
|
|
6381
6441
|
),
|
|
6382
|
-
/* @__PURE__ */
|
|
6442
|
+
/* @__PURE__ */ jsx39("span", { className: "aviala-datepicker-trigger__field", children: /* @__PURE__ */ jsx39(
|
|
6383
6443
|
"input",
|
|
6384
6444
|
{
|
|
6385
6445
|
ref: setInputRefs,
|
|
@@ -6448,7 +6508,7 @@ var DatePickerContent = forwardRef27(
|
|
|
6448
6508
|
align = "start",
|
|
6449
6509
|
...props
|
|
6450
6510
|
}, ref) => {
|
|
6451
|
-
const content = /* @__PURE__ */
|
|
6511
|
+
const content = /* @__PURE__ */ jsx39(
|
|
6452
6512
|
PopoverPrimitive4.Content,
|
|
6453
6513
|
{
|
|
6454
6514
|
ref,
|
|
@@ -6456,11 +6516,11 @@ var DatePickerContent = forwardRef27(
|
|
|
6456
6516
|
sideOffset,
|
|
6457
6517
|
align,
|
|
6458
6518
|
...props,
|
|
6459
|
-
children: children ?? /* @__PURE__ */
|
|
6519
|
+
children: children ?? /* @__PURE__ */ jsx39(DatePickerCalendar, {})
|
|
6460
6520
|
}
|
|
6461
6521
|
);
|
|
6462
6522
|
if (!portalled) return content;
|
|
6463
|
-
return /* @__PURE__ */
|
|
6523
|
+
return /* @__PURE__ */ jsx39(PopoverPrimitive4.Portal, { children: content });
|
|
6464
6524
|
}
|
|
6465
6525
|
);
|
|
6466
6526
|
DatePickerContent.displayName = "DatePickerContent";
|
|
@@ -6478,7 +6538,7 @@ function getFooterDateLabel(mode, singleValue, rangeValue) {
|
|
|
6478
6538
|
}
|
|
6479
6539
|
function DatePickerTimePanel() {
|
|
6480
6540
|
const { timeValue, setTimeValue } = useDatePickerContext();
|
|
6481
|
-
return /* @__PURE__ */
|
|
6541
|
+
return /* @__PURE__ */ jsx39(TimePickerWheels, { value: timeValue, onChange: setTimeValue });
|
|
6482
6542
|
}
|
|
6483
6543
|
function DatePickerPanelFooter() {
|
|
6484
6544
|
const {
|
|
@@ -6493,7 +6553,7 @@ function DatePickerPanelFooter() {
|
|
|
6493
6553
|
if (!enableTime) return null;
|
|
6494
6554
|
const panelValue = activePanel === "time" ? "time" : "date";
|
|
6495
6555
|
const isRangeMode = mode === "range";
|
|
6496
|
-
return /* @__PURE__ */
|
|
6556
|
+
return /* @__PURE__ */ jsx39("div", { className: "aviala-datepicker-footer-wrap", children: /* @__PURE__ */ jsxs28(
|
|
6497
6557
|
SegmentatorGroup,
|
|
6498
6558
|
{
|
|
6499
6559
|
value: panelValue,
|
|
@@ -6504,20 +6564,20 @@ function DatePickerPanelFooter() {
|
|
|
6504
6564
|
"data-active-panel": activePanel,
|
|
6505
6565
|
"aria-label": "\u65E5\u671F\u4E0E\u65F6\u95F4\u5207\u6362",
|
|
6506
6566
|
children: [
|
|
6507
|
-
/* @__PURE__ */
|
|
6567
|
+
/* @__PURE__ */ jsx39(
|
|
6508
6568
|
SegmentatorItem,
|
|
6509
6569
|
{
|
|
6510
6570
|
value: "date",
|
|
6511
|
-
leftIcon: /* @__PURE__ */
|
|
6571
|
+
leftIcon: /* @__PURE__ */ jsx39(TimeAndDateDate, { level: "text", biggerSize: true, "aria-hidden": true }),
|
|
6512
6572
|
iconOnly: isRangeMode && panelValue === "time",
|
|
6513
6573
|
children: getFooterDateLabel(mode, singleValue, rangeValue)
|
|
6514
6574
|
}
|
|
6515
6575
|
),
|
|
6516
|
-
/* @__PURE__ */
|
|
6576
|
+
/* @__PURE__ */ jsx39(
|
|
6517
6577
|
SegmentatorItem,
|
|
6518
6578
|
{
|
|
6519
6579
|
value: "time",
|
|
6520
|
-
leftIcon: /* @__PURE__ */
|
|
6580
|
+
leftIcon: /* @__PURE__ */ jsx39(TimeAndDateClock, { level: "text", biggerSize: true, "aria-hidden": true }),
|
|
6521
6581
|
iconOnly: isRangeMode && panelValue === "date",
|
|
6522
6582
|
children: formatTimeValue(timeValue.hours, timeValue.minutes)
|
|
6523
6583
|
}
|
|
@@ -6554,18 +6614,18 @@ function DatePickerCalendar({ className }) {
|
|
|
6554
6614
|
const prevViewMonthRef = useRef9(viewMonth);
|
|
6555
6615
|
const dayGridRef = useRef9(null);
|
|
6556
6616
|
const pendingDayFocusRef = useRef9(false);
|
|
6557
|
-
const [monthSlide, setMonthSlide] =
|
|
6617
|
+
const [monthSlide, setMonthSlide] = useState12(null);
|
|
6558
6618
|
const isMonthPanel = activePanel === "month";
|
|
6559
6619
|
const isTimePanel = activePanel === "time" && enableTime;
|
|
6560
6620
|
const targetContentView = isMonthPanel ? "month" : "date";
|
|
6561
|
-
const [contentView, setContentView] =
|
|
6562
|
-
const [viewCrossfade, setViewCrossfade] =
|
|
6563
|
-
const [monthWheelLayoutKey, setMonthWheelLayoutKey] =
|
|
6621
|
+
const [contentView, setContentView] = useState12(targetContentView);
|
|
6622
|
+
const [viewCrossfade, setViewCrossfade] = useState12(null);
|
|
6623
|
+
const [monthWheelLayoutKey, setMonthWheelLayoutKey] = useState12(0);
|
|
6564
6624
|
const contentViewRef = useRef9(contentView);
|
|
6565
6625
|
contentViewRef.current = contentView;
|
|
6566
6626
|
const targetPanel = isTimePanel ? "time" : "date";
|
|
6567
|
-
const [panel, setPanel] =
|
|
6568
|
-
const [panelSlide, setPanelSlide] =
|
|
6627
|
+
const [panel, setPanel] = useState12(targetPanel);
|
|
6628
|
+
const [panelSlide, setPanelSlide] = useState12(null);
|
|
6569
6629
|
const panelRef = useRef9(panel);
|
|
6570
6630
|
panelRef.current = panel;
|
|
6571
6631
|
useLayoutEffect5(() => {
|
|
@@ -6686,7 +6746,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6686
6746
|
};
|
|
6687
6747
|
const stepMonth = isMonthPanel ? 12 : 1;
|
|
6688
6748
|
const renderDateContent = () => /* @__PURE__ */ jsxs28(Fragment4, { children: [
|
|
6689
|
-
/* @__PURE__ */
|
|
6749
|
+
/* @__PURE__ */ jsx39("div", { className: "aviala-datepicker-calendar__weekdays", "aria-hidden": true, children: WEEKDAY_LABELS.map((label) => /* @__PURE__ */ jsx39(
|
|
6690
6750
|
"span",
|
|
6691
6751
|
{
|
|
6692
6752
|
className: cn(
|
|
@@ -6698,7 +6758,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6698
6758
|
label
|
|
6699
6759
|
)) }),
|
|
6700
6760
|
/* @__PURE__ */ jsxs28("div", { className: "aviala-datepicker-calendar__grid-viewport", children: [
|
|
6701
|
-
monthSlide && outgoingDays ? /* @__PURE__ */
|
|
6761
|
+
monthSlide && outgoingDays ? /* @__PURE__ */ jsx39(
|
|
6702
6762
|
"div",
|
|
6703
6763
|
{
|
|
6704
6764
|
className: "aviala-datepicker-calendar__grid",
|
|
@@ -6707,12 +6767,12 @@ function DatePickerCalendar({ className }) {
|
|
|
6707
6767
|
"aria-hidden": true,
|
|
6708
6768
|
children: outgoingDays.map((day) => {
|
|
6709
6769
|
const outside = !isSameMonth(day, monthSlide.outgoingMonth);
|
|
6710
|
-
return /* @__PURE__ */
|
|
6770
|
+
return /* @__PURE__ */ jsx39(
|
|
6711
6771
|
"span",
|
|
6712
6772
|
{
|
|
6713
6773
|
className: "aviala-datepicker-day",
|
|
6714
6774
|
"data-outside": outside ? "true" : void 0,
|
|
6715
|
-
children: /* @__PURE__ */
|
|
6775
|
+
children: /* @__PURE__ */ jsx39(
|
|
6716
6776
|
"span",
|
|
6717
6777
|
{
|
|
6718
6778
|
className: cn(
|
|
@@ -6729,7 +6789,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6729
6789
|
},
|
|
6730
6790
|
`out-${monthSlide.outgoingMonth.getFullYear()}-${monthSlide.outgoingMonth.getMonth()}`
|
|
6731
6791
|
) : null,
|
|
6732
|
-
/* @__PURE__ */
|
|
6792
|
+
/* @__PURE__ */ jsx39(
|
|
6733
6793
|
"div",
|
|
6734
6794
|
{
|
|
6735
6795
|
ref: dayGridRef,
|
|
@@ -6775,7 +6835,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6775
6835
|
onFocus: () => setFocusedDay(day),
|
|
6776
6836
|
onKeyDown: (event) => handleDayKeyDown(event, day),
|
|
6777
6837
|
children: [
|
|
6778
|
-
/* @__PURE__ */
|
|
6838
|
+
/* @__PURE__ */ jsx39(
|
|
6779
6839
|
"span",
|
|
6780
6840
|
{
|
|
6781
6841
|
className: cn(
|
|
@@ -6785,7 +6845,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6785
6845
|
children: day.getDate()
|
|
6786
6846
|
}
|
|
6787
6847
|
),
|
|
6788
|
-
isToday ? /* @__PURE__ */
|
|
6848
|
+
isToday ? /* @__PURE__ */ jsx39("span", { className: "aviala-datepicker-day__today-dot", "aria-hidden": true }) : null
|
|
6789
6849
|
]
|
|
6790
6850
|
},
|
|
6791
6851
|
dayKey
|
|
@@ -6796,20 +6856,20 @@ function DatePickerCalendar({ className }) {
|
|
|
6796
6856
|
)
|
|
6797
6857
|
] })
|
|
6798
6858
|
] });
|
|
6799
|
-
const renderContentView = (view) => view === "month" ? /* @__PURE__ */
|
|
6859
|
+
const renderContentView = (view) => view === "month" ? /* @__PURE__ */ jsx39(DatePickerMonthYearWheels, { layoutKey: monthWheelLayoutKey }) : renderDateContent();
|
|
6800
6860
|
const renderDatePanel = () => /* @__PURE__ */ jsxs28(Fragment4, { children: [
|
|
6801
6861
|
/* @__PURE__ */ jsxs28("div", { className: "aviala-datepicker-calendar__header", children: [
|
|
6802
|
-
/* @__PURE__ */
|
|
6862
|
+
/* @__PURE__ */ jsx39(
|
|
6803
6863
|
"button",
|
|
6804
6864
|
{
|
|
6805
6865
|
type: "button",
|
|
6806
6866
|
className: "aviala-datepicker-calendar__nav aviala-focus-ring",
|
|
6807
6867
|
"aria-label": isMonthPanel ? "Previous year" : "Previous month",
|
|
6808
6868
|
onClick: () => setViewMonth(addMonths(viewMonth, -stepMonth)),
|
|
6809
|
-
children: /* @__PURE__ */
|
|
6869
|
+
children: /* @__PURE__ */ jsx39(DirectionArrowLeft, { level: "text", biggerSize: true, "aria-hidden": true })
|
|
6810
6870
|
}
|
|
6811
6871
|
),
|
|
6812
|
-
/* @__PURE__ */
|
|
6872
|
+
/* @__PURE__ */ jsx39(
|
|
6813
6873
|
"button",
|
|
6814
6874
|
{
|
|
6815
6875
|
type: "button",
|
|
@@ -6822,7 +6882,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6822
6882
|
"aria-expanded": isMonthPanel,
|
|
6823
6883
|
"aria-label": isMonthPanel ? "\u5173\u95ED\u5E74\u6708\u9009\u62E9" : "\u9009\u62E9\u5E74\u6708",
|
|
6824
6884
|
onClick: () => setActivePanel(isMonthPanel ? "date" : "month"),
|
|
6825
|
-
children: /* @__PURE__ */
|
|
6885
|
+
children: /* @__PURE__ */ jsx39(
|
|
6826
6886
|
"span",
|
|
6827
6887
|
{
|
|
6828
6888
|
className: "aviala-datepicker-calendar__title-text",
|
|
@@ -6833,19 +6893,19 @@ function DatePickerCalendar({ className }) {
|
|
|
6833
6893
|
)
|
|
6834
6894
|
}
|
|
6835
6895
|
),
|
|
6836
|
-
/* @__PURE__ */
|
|
6896
|
+
/* @__PURE__ */ jsx39(
|
|
6837
6897
|
"button",
|
|
6838
6898
|
{
|
|
6839
6899
|
type: "button",
|
|
6840
6900
|
className: "aviala-datepicker-calendar__nav aviala-focus-ring",
|
|
6841
6901
|
"aria-label": isMonthPanel ? "Next year" : "Next month",
|
|
6842
6902
|
onClick: () => setViewMonth(addMonths(viewMonth, stepMonth)),
|
|
6843
|
-
children: /* @__PURE__ */
|
|
6903
|
+
children: /* @__PURE__ */ jsx39(DirectionArrowRight2, { level: "text", biggerSize: true, "aria-hidden": true })
|
|
6844
6904
|
}
|
|
6845
6905
|
)
|
|
6846
6906
|
] }),
|
|
6847
6907
|
/* @__PURE__ */ jsxs28("div", { className: "aviala-datepicker-calendar__view-viewport", children: [
|
|
6848
|
-
viewCrossfade ? /* @__PURE__ */
|
|
6908
|
+
viewCrossfade ? /* @__PURE__ */ jsx39(
|
|
6849
6909
|
"div",
|
|
6850
6910
|
{
|
|
6851
6911
|
className: "aviala-datepicker-calendar__view",
|
|
@@ -6856,7 +6916,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6856
6916
|
},
|
|
6857
6917
|
`exit-${viewCrossfade.outgoing}`
|
|
6858
6918
|
) : null,
|
|
6859
|
-
/* @__PURE__ */
|
|
6919
|
+
/* @__PURE__ */ jsx39(
|
|
6860
6920
|
"div",
|
|
6861
6921
|
{
|
|
6862
6922
|
className: "aviala-datepicker-calendar__view",
|
|
@@ -6877,7 +6937,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6877
6937
|
)
|
|
6878
6938
|
] })
|
|
6879
6939
|
] });
|
|
6880
|
-
const renderPanel = (kind) => kind === "time" ? /* @__PURE__ */
|
|
6940
|
+
const renderPanel = (kind) => kind === "time" ? /* @__PURE__ */ jsx39(DatePickerTimePanel, {}) : renderDatePanel();
|
|
6881
6941
|
return /* @__PURE__ */ jsxs28(
|
|
6882
6942
|
"div",
|
|
6883
6943
|
{
|
|
@@ -6886,7 +6946,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6886
6946
|
"aria-label": "Calendar",
|
|
6887
6947
|
children: [
|
|
6888
6948
|
/* @__PURE__ */ jsxs28("div", { className: "aviala-datepicker-calendar__panel-viewport", children: [
|
|
6889
|
-
panelSlide ? /* @__PURE__ */
|
|
6949
|
+
panelSlide ? /* @__PURE__ */ jsx39(
|
|
6890
6950
|
"div",
|
|
6891
6951
|
{
|
|
6892
6952
|
className: "aviala-datepicker-calendar__panel aviala-datepicker-calendar__body",
|
|
@@ -6898,7 +6958,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6898
6958
|
},
|
|
6899
6959
|
`panel-exit-${panelSlide.outgoing}`
|
|
6900
6960
|
) : null,
|
|
6901
|
-
/* @__PURE__ */
|
|
6961
|
+
/* @__PURE__ */ jsx39(
|
|
6902
6962
|
"div",
|
|
6903
6963
|
{
|
|
6904
6964
|
className: "aviala-datepicker-calendar__panel aviala-datepicker-calendar__body",
|
|
@@ -6916,7 +6976,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6916
6976
|
`panel-enter-${panel}`
|
|
6917
6977
|
)
|
|
6918
6978
|
] }),
|
|
6919
|
-
/* @__PURE__ */
|
|
6979
|
+
/* @__PURE__ */ jsx39(DatePickerPanelFooter, {})
|
|
6920
6980
|
]
|
|
6921
6981
|
}
|
|
6922
6982
|
);
|
|
@@ -6981,7 +7041,7 @@ function DatePickerField({
|
|
|
6981
7041
|
onTimeChange
|
|
6982
7042
|
};
|
|
6983
7043
|
return /* @__PURE__ */ jsxs28(DatePicker, { ...pickerProps, size, className, children: [
|
|
6984
|
-
/* @__PURE__ */
|
|
7044
|
+
/* @__PURE__ */ jsx39(
|
|
6985
7045
|
DatePickerTrigger,
|
|
6986
7046
|
{
|
|
6987
7047
|
size,
|
|
@@ -6995,7 +7055,7 @@ function DatePickerField({
|
|
|
6995
7055
|
editable
|
|
6996
7056
|
}
|
|
6997
7057
|
),
|
|
6998
|
-
/* @__PURE__ */
|
|
7058
|
+
/* @__PURE__ */ jsx39(DatePickerContent, { className: contentClassName, children: /* @__PURE__ */ jsx39(DatePickerCalendar, { className: calendarClassName }) })
|
|
6999
7059
|
] });
|
|
7000
7060
|
}
|
|
7001
7061
|
|
|
@@ -7005,21 +7065,21 @@ import { TimeAndDateClock as TimeAndDateClock2 } from "@aviala-design/icons";
|
|
|
7005
7065
|
import {
|
|
7006
7066
|
forwardRef as forwardRef28,
|
|
7007
7067
|
useCallback as useCallback13,
|
|
7008
|
-
useEffect as
|
|
7068
|
+
useEffect as useEffect9,
|
|
7009
7069
|
useMemo as useMemo9,
|
|
7010
7070
|
useRef as useRef10,
|
|
7011
|
-
useState as
|
|
7071
|
+
useState as useState13
|
|
7012
7072
|
} from "react";
|
|
7013
7073
|
|
|
7014
7074
|
// src/components/time-picker/time-picker-context.tsx
|
|
7015
7075
|
import { createContext as createContext7, useContext as useContext7 } from "react";
|
|
7016
|
-
import { jsx as
|
|
7076
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
7017
7077
|
var TimePickerContext = createContext7(null);
|
|
7018
7078
|
function TimePickerProvider({
|
|
7019
7079
|
value,
|
|
7020
7080
|
children
|
|
7021
7081
|
}) {
|
|
7022
|
-
return /* @__PURE__ */
|
|
7082
|
+
return /* @__PURE__ */ jsx40(TimePickerContext.Provider, { value, children });
|
|
7023
7083
|
}
|
|
7024
7084
|
function useTimePickerContext() {
|
|
7025
7085
|
const context = useContext7(TimePickerContext);
|
|
@@ -7030,7 +7090,7 @@ function useTimePickerContext() {
|
|
|
7030
7090
|
}
|
|
7031
7091
|
|
|
7032
7092
|
// src/components/time-picker/time-picker.tsx
|
|
7033
|
-
import { jsx as
|
|
7093
|
+
import { jsx as jsx41, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
7034
7094
|
function TimePicker({
|
|
7035
7095
|
children,
|
|
7036
7096
|
value: valueProp,
|
|
@@ -7043,8 +7103,8 @@ function TimePicker({
|
|
|
7043
7103
|
size = "regular",
|
|
7044
7104
|
className
|
|
7045
7105
|
}) {
|
|
7046
|
-
const [internalOpen, setInternalOpen] =
|
|
7047
|
-
const [internalValue, setInternalValue] =
|
|
7106
|
+
const [internalOpen, setInternalOpen] = useState13(defaultOpen);
|
|
7107
|
+
const [internalValue, setInternalValue] = useState13(defaultValue);
|
|
7048
7108
|
const windowBlurCloseRef = useRef10(false);
|
|
7049
7109
|
const pointerDownCloseRef = useRef10(false);
|
|
7050
7110
|
const isOpenControlled = openProp !== void 0;
|
|
@@ -7059,14 +7119,14 @@ function TimePicker({
|
|
|
7059
7119
|
},
|
|
7060
7120
|
[onValueChange, valueProp]
|
|
7061
7121
|
);
|
|
7062
|
-
|
|
7122
|
+
useEffect9(() => {
|
|
7063
7123
|
const markWindowBlur = () => {
|
|
7064
7124
|
windowBlurCloseRef.current = true;
|
|
7065
7125
|
};
|
|
7066
7126
|
window.addEventListener("blur", markWindowBlur, true);
|
|
7067
7127
|
return () => window.removeEventListener("blur", markWindowBlur, true);
|
|
7068
7128
|
}, []);
|
|
7069
|
-
|
|
7129
|
+
useEffect9(() => {
|
|
7070
7130
|
if (!open) {
|
|
7071
7131
|
pointerDownCloseRef.current = false;
|
|
7072
7132
|
return;
|
|
@@ -7103,7 +7163,7 @@ function TimePicker({
|
|
|
7103
7163
|
}),
|
|
7104
7164
|
[disabled, open, size, value, setValue]
|
|
7105
7165
|
);
|
|
7106
|
-
return /* @__PURE__ */
|
|
7166
|
+
return /* @__PURE__ */ jsx41(TimePickerProvider, { value: contextValue, children: /* @__PURE__ */ jsx41(PopoverPrimitive5.Root, { open, onOpenChange: handleOpenChange, modal: false, children: /* @__PURE__ */ jsx41("div", { className: cn("inline-flex", className), children }) }) });
|
|
7107
7167
|
}
|
|
7108
7168
|
var TimePickerTrigger = forwardRef28(
|
|
7109
7169
|
({
|
|
@@ -7123,7 +7183,7 @@ var TimePickerTrigger = forwardRef28(
|
|
|
7123
7183
|
const disabled = disabledProp ?? disabledContext;
|
|
7124
7184
|
const formatted = displayValue !== void 0 ? displayValue : formatTimeValue(value.hours, value.minutes);
|
|
7125
7185
|
const hasValue = formatted != null && formatted !== "";
|
|
7126
|
-
return /* @__PURE__ */
|
|
7186
|
+
return /* @__PURE__ */ jsx41(PopoverPrimitive5.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs29(
|
|
7127
7187
|
"button",
|
|
7128
7188
|
{
|
|
7129
7189
|
ref,
|
|
@@ -7139,10 +7199,10 @@ var TimePickerTrigger = forwardRef28(
|
|
|
7139
7199
|
...props,
|
|
7140
7200
|
children: [
|
|
7141
7201
|
renderSlotIcon(
|
|
7142
|
-
leftIcon ?? /* @__PURE__ */
|
|
7202
|
+
leftIcon ?? /* @__PURE__ */ jsx41(TimeAndDateClock2, { level: "text", biggerSize: true, "aria-hidden": true }),
|
|
7143
7203
|
"aviala-timepicker-trigger__slot"
|
|
7144
7204
|
),
|
|
7145
|
-
/* @__PURE__ */
|
|
7205
|
+
/* @__PURE__ */ jsx41("span", { className: "aviala-timepicker-trigger__field", children: /* @__PURE__ */ jsx41(
|
|
7146
7206
|
"span",
|
|
7147
7207
|
{
|
|
7148
7208
|
className: cn(
|
|
@@ -7169,7 +7229,7 @@ var TimePickerContent = forwardRef28(
|
|
|
7169
7229
|
align = "start",
|
|
7170
7230
|
...props
|
|
7171
7231
|
}, ref) => {
|
|
7172
|
-
const content = /* @__PURE__ */
|
|
7232
|
+
const content = /* @__PURE__ */ jsx41(
|
|
7173
7233
|
PopoverPrimitive5.Content,
|
|
7174
7234
|
{
|
|
7175
7235
|
ref,
|
|
@@ -7177,17 +7237,17 @@ var TimePickerContent = forwardRef28(
|
|
|
7177
7237
|
sideOffset,
|
|
7178
7238
|
align,
|
|
7179
7239
|
...props,
|
|
7180
|
-
children: children ?? /* @__PURE__ */
|
|
7240
|
+
children: children ?? /* @__PURE__ */ jsx41(TimePickerPanel, {})
|
|
7181
7241
|
}
|
|
7182
7242
|
);
|
|
7183
7243
|
if (!portalled) return content;
|
|
7184
|
-
return /* @__PURE__ */
|
|
7244
|
+
return /* @__PURE__ */ jsx41(PopoverPrimitive5.Portal, { children: content });
|
|
7185
7245
|
}
|
|
7186
7246
|
);
|
|
7187
7247
|
TimePickerContent.displayName = "TimePickerContent";
|
|
7188
7248
|
function TimePickerPanel({ className }) {
|
|
7189
7249
|
const { value, setValue } = useTimePickerContext();
|
|
7190
|
-
return /* @__PURE__ */
|
|
7250
|
+
return /* @__PURE__ */ jsx41("div", { className: cn("aviala-timepicker-panel", className), role: "application", "aria-label": "Time picker", children: /* @__PURE__ */ jsx41(TimePickerWheels, { value, onChange: setValue }) });
|
|
7191
7251
|
}
|
|
7192
7252
|
function TimePickerField({
|
|
7193
7253
|
contentClassName,
|
|
@@ -7220,7 +7280,7 @@ function TimePickerField({
|
|
|
7220
7280
|
size,
|
|
7221
7281
|
className,
|
|
7222
7282
|
children: [
|
|
7223
|
-
/* @__PURE__ */
|
|
7283
|
+
/* @__PURE__ */ jsx41(
|
|
7224
7284
|
TimePickerTrigger,
|
|
7225
7285
|
{
|
|
7226
7286
|
size,
|
|
@@ -7231,7 +7291,7 @@ function TimePickerField({
|
|
|
7231
7291
|
error
|
|
7232
7292
|
}
|
|
7233
7293
|
),
|
|
7234
|
-
/* @__PURE__ */
|
|
7294
|
+
/* @__PURE__ */ jsx41(TimePickerContent, { className: contentClassName, children: /* @__PURE__ */ jsx41(TimePickerPanel, { className: panelClassName }) })
|
|
7235
7295
|
]
|
|
7236
7296
|
}
|
|
7237
7297
|
);
|
|
@@ -7242,11 +7302,11 @@ import * as PopoverPrimitive6 from "@radix-ui/react-popover";
|
|
|
7242
7302
|
import {
|
|
7243
7303
|
forwardRef as forwardRef29,
|
|
7244
7304
|
useCallback as useCallback14,
|
|
7245
|
-
useState as
|
|
7305
|
+
useState as useState14
|
|
7246
7306
|
} from "react";
|
|
7247
7307
|
|
|
7248
7308
|
// src/components/overlay-pointer.tsx
|
|
7249
|
-
import { Fragment as Fragment5, jsx as
|
|
7309
|
+
import { Fragment as Fragment5, jsx as jsx42, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
7250
7310
|
var TOOLTIP_POINTER = {
|
|
7251
7311
|
width: 14,
|
|
7252
7312
|
height: 5,
|
|
@@ -7267,7 +7327,7 @@ function OverlayPointerSvg({
|
|
|
7267
7327
|
...props
|
|
7268
7328
|
}) {
|
|
7269
7329
|
const isPopover = variant === "popover";
|
|
7270
|
-
return /* @__PURE__ */
|
|
7330
|
+
return /* @__PURE__ */ jsx42(
|
|
7271
7331
|
"svg",
|
|
7272
7332
|
{
|
|
7273
7333
|
...props,
|
|
@@ -7281,15 +7341,15 @@ function OverlayPointerSvg({
|
|
|
7281
7341
|
className,
|
|
7282
7342
|
style: { ...style, width, height },
|
|
7283
7343
|
children: isPopover ? /* @__PURE__ */ jsxs30(Fragment5, { children: [
|
|
7284
|
-
/* @__PURE__ */
|
|
7285
|
-
/* @__PURE__ */
|
|
7286
|
-
] }) : /* @__PURE__ */
|
|
7344
|
+
/* @__PURE__ */ jsx42("path", { d: path, className: "aviala-popover-content__arrow-outline" }),
|
|
7345
|
+
/* @__PURE__ */ jsx42("path", { d: path, className: "aviala-popover-content__arrow-fill" })
|
|
7346
|
+
] }) : /* @__PURE__ */ jsx42("path", { d: path })
|
|
7287
7347
|
}
|
|
7288
7348
|
);
|
|
7289
7349
|
}
|
|
7290
7350
|
|
|
7291
7351
|
// src/components/popover.tsx
|
|
7292
|
-
import { jsx as
|
|
7352
|
+
import { jsx as jsx43, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
7293
7353
|
function Popover({
|
|
7294
7354
|
open: openProp,
|
|
7295
7355
|
defaultOpen = false,
|
|
@@ -7297,7 +7357,7 @@ function Popover({
|
|
|
7297
7357
|
modal = false,
|
|
7298
7358
|
...props
|
|
7299
7359
|
}) {
|
|
7300
|
-
const [internalOpen, setInternalOpen] =
|
|
7360
|
+
const [internalOpen, setInternalOpen] = useState14(defaultOpen);
|
|
7301
7361
|
const isControlled = openProp !== void 0;
|
|
7302
7362
|
const open = isControlled ? openProp : internalOpen;
|
|
7303
7363
|
const handleOpenChange = useCallback14(
|
|
@@ -7307,7 +7367,7 @@ function Popover({
|
|
|
7307
7367
|
},
|
|
7308
7368
|
[isControlled, onOpenChange]
|
|
7309
7369
|
);
|
|
7310
|
-
return /* @__PURE__ */
|
|
7370
|
+
return /* @__PURE__ */ jsx43(
|
|
7311
7371
|
PopoverPrimitive6.Root,
|
|
7312
7372
|
{
|
|
7313
7373
|
open,
|
|
@@ -7330,10 +7390,11 @@ var PopoverContent = forwardRef29(
|
|
|
7330
7390
|
showArrow = false,
|
|
7331
7391
|
flush = false,
|
|
7332
7392
|
appearance = "default",
|
|
7393
|
+
level,
|
|
7333
7394
|
...props
|
|
7334
7395
|
}, ref) => {
|
|
7335
7396
|
const isDefaultAppearance = appearance === "default";
|
|
7336
|
-
const surfaceLevel = appearance === "tooltip" ? "caption" : "text";
|
|
7397
|
+
const surfaceLevel = level ?? (appearance === "tooltip" ? "caption" : "text");
|
|
7337
7398
|
const pointer = isDefaultAppearance ? POPOVER_POINTER : TOOLTIP_POINTER;
|
|
7338
7399
|
const content = /* @__PURE__ */ jsxs31(
|
|
7339
7400
|
PopoverPrimitive6.Content,
|
|
@@ -7346,7 +7407,7 @@ var PopoverContent = forwardRef29(
|
|
|
7346
7407
|
className: cn("aviala-popover-content", className),
|
|
7347
7408
|
...props,
|
|
7348
7409
|
children: [
|
|
7349
|
-
/* @__PURE__ */
|
|
7410
|
+
/* @__PURE__ */ jsx43(
|
|
7350
7411
|
"div",
|
|
7351
7412
|
{
|
|
7352
7413
|
className: cn(
|
|
@@ -7357,13 +7418,13 @@ var PopoverContent = forwardRef29(
|
|
|
7357
7418
|
children
|
|
7358
7419
|
}
|
|
7359
7420
|
),
|
|
7360
|
-
showArrow ? /* @__PURE__ */
|
|
7421
|
+
showArrow ? /* @__PURE__ */ jsx43(
|
|
7361
7422
|
PopoverPrimitive6.Arrow,
|
|
7362
7423
|
{
|
|
7363
7424
|
asChild: true,
|
|
7364
7425
|
width: pointer.width,
|
|
7365
7426
|
height: pointer.height,
|
|
7366
|
-
children: /* @__PURE__ */
|
|
7427
|
+
children: /* @__PURE__ */ jsx43(
|
|
7367
7428
|
OverlayPointerSvg,
|
|
7368
7429
|
{
|
|
7369
7430
|
variant: isDefaultAppearance ? "popover" : "default",
|
|
@@ -7379,7 +7440,7 @@ var PopoverContent = forwardRef29(
|
|
|
7379
7440
|
}
|
|
7380
7441
|
);
|
|
7381
7442
|
if (!portalled) return content;
|
|
7382
|
-
return /* @__PURE__ */
|
|
7443
|
+
return /* @__PURE__ */ jsx43(PopoverPrimitive6.Portal, { children: content });
|
|
7383
7444
|
}
|
|
7384
7445
|
);
|
|
7385
7446
|
PopoverContent.displayName = PopoverPrimitive6.Content.displayName;
|
|
@@ -7387,16 +7448,16 @@ PopoverContent.displayName = PopoverPrimitive6.Content.displayName;
|
|
|
7387
7448
|
// src/components/hover-popover.tsx
|
|
7388
7449
|
import {
|
|
7389
7450
|
useCallback as useCallback15,
|
|
7390
|
-
useEffect as
|
|
7451
|
+
useEffect as useEffect11,
|
|
7391
7452
|
useRef as useRef11,
|
|
7392
|
-
useState as
|
|
7453
|
+
useState as useState16
|
|
7393
7454
|
} from "react";
|
|
7394
7455
|
|
|
7395
7456
|
// src/components/use-coarse-pointer.ts
|
|
7396
|
-
import { useEffect as
|
|
7457
|
+
import { useEffect as useEffect10, useState as useState15 } from "react";
|
|
7397
7458
|
function useCoarsePointer() {
|
|
7398
|
-
const [coarse, setCoarse] =
|
|
7399
|
-
|
|
7459
|
+
const [coarse, setCoarse] = useState15(false);
|
|
7460
|
+
useEffect10(() => {
|
|
7400
7461
|
if (typeof window === "undefined" || !window.matchMedia) return;
|
|
7401
7462
|
const mq = window.matchMedia("(pointer: coarse)");
|
|
7402
7463
|
const update = () => setCoarse(mq.matches);
|
|
@@ -7408,7 +7469,7 @@ function useCoarsePointer() {
|
|
|
7408
7469
|
}
|
|
7409
7470
|
|
|
7410
7471
|
// src/components/hover-popover.tsx
|
|
7411
|
-
import { jsx as
|
|
7472
|
+
import { jsx as jsx44, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
7412
7473
|
function HoverPopover({
|
|
7413
7474
|
content,
|
|
7414
7475
|
children,
|
|
@@ -7426,7 +7487,7 @@ function HoverPopover({
|
|
|
7426
7487
|
}) {
|
|
7427
7488
|
const coarse = useCoarsePointer();
|
|
7428
7489
|
const isControlled = openProp !== void 0;
|
|
7429
|
-
const [internalOpen, setInternalOpen] =
|
|
7490
|
+
const [internalOpen, setInternalOpen] = useState16(defaultOpen);
|
|
7430
7491
|
const open = isControlled ? openProp : internalOpen;
|
|
7431
7492
|
const openTimer = useRef11(void 0);
|
|
7432
7493
|
const closeTimer = useRef11(void 0);
|
|
@@ -7441,7 +7502,7 @@ function HoverPopover({
|
|
|
7441
7502
|
},
|
|
7442
7503
|
[isControlled, onOpenChange]
|
|
7443
7504
|
);
|
|
7444
|
-
|
|
7505
|
+
useEffect11(() => () => clearTimers(), [clearTimers]);
|
|
7445
7506
|
const keyboardOpenRef = useRef11(false);
|
|
7446
7507
|
const contentRef = useRef11(null);
|
|
7447
7508
|
const openNow = useCallback15(() => {
|
|
@@ -7455,8 +7516,8 @@ function HoverPopover({
|
|
|
7455
7516
|
}, [clearTimers, closeDelay, setOpen]);
|
|
7456
7517
|
if (coarse) {
|
|
7457
7518
|
return /* @__PURE__ */ jsxs32(Popover, { open, onOpenChange: setOpen, children: [
|
|
7458
|
-
/* @__PURE__ */
|
|
7459
|
-
/* @__PURE__ */
|
|
7519
|
+
/* @__PURE__ */ jsx44(PopoverTrigger, { asChild: true, children }),
|
|
7520
|
+
/* @__PURE__ */ jsx44(
|
|
7460
7521
|
PopoverContent,
|
|
7461
7522
|
{
|
|
7462
7523
|
side,
|
|
@@ -7471,7 +7532,7 @@ function HoverPopover({
|
|
|
7471
7532
|
] });
|
|
7472
7533
|
}
|
|
7473
7534
|
return /* @__PURE__ */ jsxs32(Popover, { open, onOpenChange: setOpen, children: [
|
|
7474
|
-
/* @__PURE__ */
|
|
7535
|
+
/* @__PURE__ */ jsx44(
|
|
7475
7536
|
PopoverTrigger,
|
|
7476
7537
|
{
|
|
7477
7538
|
asChild: true,
|
|
@@ -7483,7 +7544,7 @@ function HoverPopover({
|
|
|
7483
7544
|
children
|
|
7484
7545
|
}
|
|
7485
7546
|
),
|
|
7486
|
-
/* @__PURE__ */
|
|
7547
|
+
/* @__PURE__ */ jsx44(
|
|
7487
7548
|
PopoverContent,
|
|
7488
7549
|
{
|
|
7489
7550
|
ref: contentRef,
|
|
@@ -7522,7 +7583,7 @@ import {
|
|
|
7522
7583
|
forwardRef as forwardRef30,
|
|
7523
7584
|
isValidElement as isValidElement13
|
|
7524
7585
|
} from "react";
|
|
7525
|
-
import { Fragment as Fragment6, jsx as
|
|
7586
|
+
import { Fragment as Fragment6, jsx as jsx45, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
7526
7587
|
var MODAL_ICON_SIZE = 16;
|
|
7527
7588
|
var modalContentVariants = cva10("aviala-modal-content", {
|
|
7528
7589
|
variants: {
|
|
@@ -7545,13 +7606,13 @@ function renderModalIcon(node) {
|
|
|
7545
7606
|
"shrink-0"
|
|
7546
7607
|
)
|
|
7547
7608
|
}) : node;
|
|
7548
|
-
return /* @__PURE__ */
|
|
7609
|
+
return /* @__PURE__ */ jsx45("span", { className: "aviala-modal__icon", "aria-hidden": true, children: content });
|
|
7549
7610
|
}
|
|
7550
7611
|
var Modal = DialogPrimitive.Root;
|
|
7551
7612
|
var ModalTrigger = DialogPrimitive.Trigger;
|
|
7552
7613
|
var ModalPortal = DialogPrimitive.Portal;
|
|
7553
7614
|
var ModalClose = DialogPrimitive.Close;
|
|
7554
|
-
var ModalOverlay = forwardRef30(({ className, ...props }, ref) => /* @__PURE__ */
|
|
7615
|
+
var ModalOverlay = forwardRef30(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(
|
|
7555
7616
|
DialogPrimitive.Overlay,
|
|
7556
7617
|
{
|
|
7557
7618
|
ref,
|
|
@@ -7570,15 +7631,15 @@ var ModalContent = forwardRef30(
|
|
|
7570
7631
|
onOpenAutoFocus,
|
|
7571
7632
|
...props
|
|
7572
7633
|
}, ref) => {
|
|
7573
|
-
const overlay = showOverlay ? /* @__PURE__ */
|
|
7574
|
-
const panel = /* @__PURE__ */
|
|
7634
|
+
const overlay = showOverlay ? /* @__PURE__ */ jsx45(ModalOverlay, {}) : null;
|
|
7635
|
+
const panel = /* @__PURE__ */ jsx45(
|
|
7575
7636
|
DialogPrimitive.Content,
|
|
7576
7637
|
{
|
|
7577
7638
|
ref,
|
|
7578
7639
|
className: cn(modalContentVariants({ size }), className),
|
|
7579
7640
|
onOpenAutoFocus,
|
|
7580
7641
|
...props,
|
|
7581
|
-
children: /* @__PURE__ */
|
|
7642
|
+
children: /* @__PURE__ */ jsx45("div", { className: "aviala-modal-content__surface", children })
|
|
7582
7643
|
}
|
|
7583
7644
|
);
|
|
7584
7645
|
if (!portalled) {
|
|
@@ -7603,10 +7664,10 @@ var ModalHeader = forwardRef30(
|
|
|
7603
7664
|
showClose = true,
|
|
7604
7665
|
closeLabel = "Close dialog",
|
|
7605
7666
|
...props
|
|
7606
|
-
}, ref) => /* @__PURE__ */
|
|
7667
|
+
}, ref) => /* @__PURE__ */ jsx45("div", { ref, className: cn("aviala-modal__header", className), ...props, children: /* @__PURE__ */ jsxs33("div", { className: "aviala-modal__header-row", children: [
|
|
7607
7668
|
showIcon ? renderModalIcon(icon) : null,
|
|
7608
|
-
/* @__PURE__ */
|
|
7609
|
-
showClose ? /* @__PURE__ */
|
|
7669
|
+
/* @__PURE__ */ jsx45("div", { className: "aviala-modal__header-main", children }),
|
|
7670
|
+
showClose ? /* @__PURE__ */ jsx45(DialogPrimitive.Close, { asChild: true, children: /* @__PURE__ */ jsx45(
|
|
7610
7671
|
Button,
|
|
7611
7672
|
{
|
|
7612
7673
|
type: "button",
|
|
@@ -7614,28 +7675,28 @@ var ModalHeader = forwardRef30(
|
|
|
7614
7675
|
iconOnly: true,
|
|
7615
7676
|
"aria-label": closeLabel,
|
|
7616
7677
|
className: "aviala-modal__close",
|
|
7617
|
-
leftIcon: /* @__PURE__ */
|
|
7678
|
+
leftIcon: /* @__PURE__ */ jsx45(SymbolWrong2, { "aria-hidden": true })
|
|
7618
7679
|
}
|
|
7619
7680
|
) }) : null
|
|
7620
7681
|
] }) })
|
|
7621
7682
|
);
|
|
7622
7683
|
ModalHeader.displayName = "ModalHeader";
|
|
7623
|
-
var ModalTitle = forwardRef30(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
7684
|
+
var ModalTitle = forwardRef30(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx45(DialogPrimitive.Title, { ref, asChild: true, ...props, children: /* @__PURE__ */ jsx45(Typography, { level: "text", className: cn("aviala-modal__title", className), children }) }));
|
|
7624
7685
|
ModalTitle.displayName = DialogPrimitive.Title.displayName;
|
|
7625
|
-
var ModalDescription = forwardRef30(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
7686
|
+
var ModalDescription = forwardRef30(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx45(DialogPrimitive.Description, { ref, asChild: true, ...props, children: /* @__PURE__ */ jsx45(Typography, { level: "caption", className: cn("aviala-modal__description", className), children }) }));
|
|
7626
7687
|
ModalDescription.displayName = DialogPrimitive.Description.displayName;
|
|
7627
7688
|
function ModalHeaderText({
|
|
7628
7689
|
title,
|
|
7629
7690
|
description,
|
|
7630
7691
|
...props
|
|
7631
7692
|
}) {
|
|
7632
|
-
return /* @__PURE__ */
|
|
7633
|
-
/* @__PURE__ */
|
|
7634
|
-
description ? /* @__PURE__ */
|
|
7693
|
+
return /* @__PURE__ */ jsx45(ModalHeader, { ...props, children: /* @__PURE__ */ jsxs33("div", { className: "aviala-modal__header-typeface", children: [
|
|
7694
|
+
/* @__PURE__ */ jsx45(ModalTitle, { children: title }),
|
|
7695
|
+
description ? /* @__PURE__ */ jsx45(ModalDescription, { children: description }) : null
|
|
7635
7696
|
] }) });
|
|
7636
7697
|
}
|
|
7637
7698
|
var ModalBody = forwardRef30(
|
|
7638
|
-
({ className, children, layout = "default", title, description, ...props }, ref) => /* @__PURE__ */
|
|
7699
|
+
({ className, children, layout = "default", title, description, ...props }, ref) => /* @__PURE__ */ jsx45("div", { ref, className: cn("aviala-modal__body", className), ...props, children: layout === "text" ? /* @__PURE__ */ jsx45(
|
|
7639
7700
|
Typeface,
|
|
7640
7701
|
{
|
|
7641
7702
|
className: "aviala-modal__body-typeface",
|
|
@@ -7647,26 +7708,28 @@ var ModalBody = forwardRef30(
|
|
|
7647
7708
|
);
|
|
7648
7709
|
ModalBody.displayName = "ModalBody";
|
|
7649
7710
|
var ModalFooter = forwardRef30(
|
|
7650
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
7711
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx45("div", { ref, className: cn("aviala-modal__footer", className), ...props })
|
|
7651
7712
|
);
|
|
7652
7713
|
ModalFooter.displayName = "ModalFooter";
|
|
7653
7714
|
|
|
7654
7715
|
// src/components/tooltip.tsx
|
|
7655
7716
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
7656
7717
|
import { forwardRef as forwardRef31 } from "react";
|
|
7657
|
-
import { jsx as
|
|
7718
|
+
import { jsx as jsx46, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
7658
7719
|
var TOOLTIP_DELAY_DURATION = 300;
|
|
7659
7720
|
function TooltipProvider({
|
|
7721
|
+
children,
|
|
7660
7722
|
delayDuration = TOOLTIP_DELAY_DURATION,
|
|
7661
7723
|
skipDelayDuration = 0,
|
|
7662
7724
|
...props
|
|
7663
7725
|
}) {
|
|
7664
|
-
return /* @__PURE__ */
|
|
7726
|
+
return /* @__PURE__ */ jsx46(
|
|
7665
7727
|
TooltipPrimitive.Provider,
|
|
7666
7728
|
{
|
|
7667
7729
|
delayDuration,
|
|
7668
7730
|
skipDelayDuration,
|
|
7669
|
-
...props
|
|
7731
|
+
...props,
|
|
7732
|
+
children
|
|
7670
7733
|
}
|
|
7671
7734
|
);
|
|
7672
7735
|
}
|
|
@@ -7679,8 +7742,9 @@ var TooltipContent = forwardRef31(
|
|
|
7679
7742
|
sideOffset = 4,
|
|
7680
7743
|
collisionPadding = 8,
|
|
7681
7744
|
showArrow = true,
|
|
7745
|
+
level = "caption",
|
|
7682
7746
|
...props
|
|
7683
|
-
}, ref) => /* @__PURE__ */
|
|
7747
|
+
}, ref) => /* @__PURE__ */ jsx46(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs34(
|
|
7684
7748
|
TooltipPrimitive.Content,
|
|
7685
7749
|
{
|
|
7686
7750
|
ref,
|
|
@@ -7689,14 +7753,23 @@ var TooltipContent = forwardRef31(
|
|
|
7689
7753
|
className: cn("aviala-tooltip-content", className),
|
|
7690
7754
|
...props,
|
|
7691
7755
|
children: [
|
|
7692
|
-
/* @__PURE__ */
|
|
7693
|
-
|
|
7756
|
+
/* @__PURE__ */ jsx46(
|
|
7757
|
+
"div",
|
|
7758
|
+
{
|
|
7759
|
+
className: cn(
|
|
7760
|
+
"aviala-tooltip-content__surface",
|
|
7761
|
+
typographyVariants({ level })
|
|
7762
|
+
),
|
|
7763
|
+
children
|
|
7764
|
+
}
|
|
7765
|
+
),
|
|
7766
|
+
showArrow ? /* @__PURE__ */ jsx46(
|
|
7694
7767
|
TooltipPrimitive.Arrow,
|
|
7695
7768
|
{
|
|
7696
7769
|
asChild: true,
|
|
7697
7770
|
width: TOOLTIP_POINTER.width,
|
|
7698
7771
|
height: TOOLTIP_POINTER.height,
|
|
7699
|
-
children: /* @__PURE__ */
|
|
7772
|
+
children: /* @__PURE__ */ jsx46(
|
|
7700
7773
|
OverlayPointerSvg,
|
|
7701
7774
|
{
|
|
7702
7775
|
className: "aviala-tooltip-content__arrow",
|
|
@@ -7714,7 +7787,7 @@ var TooltipContent = forwardRef31(
|
|
|
7714
7787
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
7715
7788
|
|
|
7716
7789
|
// src/components/responsive-tooltip.tsx
|
|
7717
|
-
import { jsx as
|
|
7790
|
+
import { jsx as jsx47, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
7718
7791
|
function ResponsiveTooltip({
|
|
7719
7792
|
content,
|
|
7720
7793
|
children,
|
|
@@ -7723,6 +7796,7 @@ function ResponsiveTooltip({
|
|
|
7723
7796
|
sideOffset = 4,
|
|
7724
7797
|
collisionPadding = 8,
|
|
7725
7798
|
showArrow = true,
|
|
7799
|
+
level = "caption",
|
|
7726
7800
|
delayDuration = TOOLTIP_DELAY_DURATION,
|
|
7727
7801
|
open,
|
|
7728
7802
|
defaultOpen,
|
|
@@ -7732,11 +7806,12 @@ function ResponsiveTooltip({
|
|
|
7732
7806
|
const coarse = useCoarsePointer();
|
|
7733
7807
|
if (coarse) {
|
|
7734
7808
|
return /* @__PURE__ */ jsxs35(Popover, { open, defaultOpen, onOpenChange, children: [
|
|
7735
|
-
/* @__PURE__ */
|
|
7736
|
-
/* @__PURE__ */
|
|
7809
|
+
/* @__PURE__ */ jsx47(PopoverTrigger, { asChild: true, children }),
|
|
7810
|
+
/* @__PURE__ */ jsx47(
|
|
7737
7811
|
PopoverContent,
|
|
7738
7812
|
{
|
|
7739
7813
|
appearance: "tooltip",
|
|
7814
|
+
level,
|
|
7740
7815
|
side,
|
|
7741
7816
|
align,
|
|
7742
7817
|
sideOffset,
|
|
@@ -7756,8 +7831,8 @@ function ResponsiveTooltip({
|
|
|
7756
7831
|
defaultOpen,
|
|
7757
7832
|
onOpenChange,
|
|
7758
7833
|
children: [
|
|
7759
|
-
/* @__PURE__ */
|
|
7760
|
-
/* @__PURE__ */
|
|
7834
|
+
/* @__PURE__ */ jsx47(TooltipTrigger, { asChild: true, children }),
|
|
7835
|
+
/* @__PURE__ */ jsx47(
|
|
7761
7836
|
TooltipContent,
|
|
7762
7837
|
{
|
|
7763
7838
|
side,
|
|
@@ -7765,6 +7840,7 @@ function ResponsiveTooltip({
|
|
|
7765
7840
|
sideOffset,
|
|
7766
7841
|
collisionPadding,
|
|
7767
7842
|
showArrow,
|
|
7843
|
+
level,
|
|
7768
7844
|
className: contentClassName,
|
|
7769
7845
|
children: content
|
|
7770
7846
|
}
|
|
@@ -7789,7 +7865,7 @@ import {
|
|
|
7789
7865
|
forwardRef as forwardRef32,
|
|
7790
7866
|
isValidElement as isValidElement14
|
|
7791
7867
|
} from "react";
|
|
7792
|
-
import { jsx as
|
|
7868
|
+
import { jsx as jsx48, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
7793
7869
|
var FEEDBACK_ICON_SIZE = 22;
|
|
7794
7870
|
var feedbackVariants = cva11("aviala-feedback", {
|
|
7795
7871
|
variants: {
|
|
@@ -7825,22 +7901,22 @@ function renderFeedbackIcon(node) {
|
|
|
7825
7901
|
"shrink-0"
|
|
7826
7902
|
)
|
|
7827
7903
|
}) : node;
|
|
7828
|
-
return /* @__PURE__ */
|
|
7904
|
+
return /* @__PURE__ */ jsx48("span", { className: "aviala-feedback__icon", "aria-hidden": true, children: content });
|
|
7829
7905
|
}
|
|
7830
7906
|
function defaultStatusIcon(type, mode) {
|
|
7831
7907
|
const iconMode = mode === "primary" ? "fill" : "default";
|
|
7832
7908
|
const thickness = "Regular";
|
|
7833
7909
|
switch (type) {
|
|
7834
7910
|
case "information":
|
|
7835
|
-
return /* @__PURE__ */
|
|
7911
|
+
return /* @__PURE__ */ jsx48(SymbolInformationCircle2, { thickness, mode: iconMode, "aria-hidden": true });
|
|
7836
7912
|
case "warning":
|
|
7837
|
-
return /* @__PURE__ */
|
|
7913
|
+
return /* @__PURE__ */ jsx48(SymbolWarningCircle, { thickness, mode: iconMode, "aria-hidden": true });
|
|
7838
7914
|
case "wrong":
|
|
7839
|
-
return /* @__PURE__ */
|
|
7915
|
+
return /* @__PURE__ */ jsx48(SymbolWrongCircle2, { thickness, mode: iconMode, "aria-hidden": true });
|
|
7840
7916
|
case "success":
|
|
7841
|
-
return /* @__PURE__ */
|
|
7917
|
+
return /* @__PURE__ */ jsx48(SymbolRightCircle, { thickness, mode: iconMode, "aria-hidden": true });
|
|
7842
7918
|
case "normal":
|
|
7843
|
-
return /* @__PURE__ */
|
|
7919
|
+
return /* @__PURE__ */ jsx48(GeneralNotification, { thickness, mode: "default", "aria-hidden": true });
|
|
7844
7920
|
}
|
|
7845
7921
|
}
|
|
7846
7922
|
var Feedback = forwardRef32(
|
|
@@ -7865,7 +7941,7 @@ var Feedback = forwardRef32(
|
|
|
7865
7941
|
const tone = mode === "primary" ? "white" : "default";
|
|
7866
7942
|
const isSmall = resolvedSize === "small";
|
|
7867
7943
|
const resolvedRole = resolvedType === "wrong" ? "alert" : "status";
|
|
7868
|
-
return /* @__PURE__ */
|
|
7944
|
+
return /* @__PURE__ */ jsx48(
|
|
7869
7945
|
"div",
|
|
7870
7946
|
{
|
|
7871
7947
|
ref,
|
|
@@ -7881,7 +7957,7 @@ var Feedback = forwardRef32(
|
|
|
7881
7957
|
...props,
|
|
7882
7958
|
children: /* @__PURE__ */ jsxs36("div", { className: "aviala-feedback__body", children: [
|
|
7883
7959
|
renderFeedbackIcon(icon ?? defaultStatusIcon(resolvedType, mode)),
|
|
7884
|
-
isSmall ? /* @__PURE__ */
|
|
7960
|
+
isSmall ? /* @__PURE__ */ jsx48(Typography, { level: "text", tone, className: "aviala-feedback__title", children: title }) : /* @__PURE__ */ jsx48(
|
|
7885
7961
|
Typeface,
|
|
7886
7962
|
{
|
|
7887
7963
|
className: "aviala-feedback__typeface",
|
|
@@ -7891,7 +7967,7 @@ var Feedback = forwardRef32(
|
|
|
7891
7967
|
tone
|
|
7892
7968
|
}
|
|
7893
7969
|
),
|
|
7894
|
-
action ? /* @__PURE__ */
|
|
7970
|
+
action ? /* @__PURE__ */ jsx48(
|
|
7895
7971
|
Link,
|
|
7896
7972
|
{
|
|
7897
7973
|
level: "text",
|
|
@@ -7907,7 +7983,7 @@ var Feedback = forwardRef32(
|
|
|
7907
7983
|
children: action
|
|
7908
7984
|
}
|
|
7909
7985
|
) : null,
|
|
7910
|
-
showClose ? /* @__PURE__ */
|
|
7986
|
+
showClose ? /* @__PURE__ */ jsx48(
|
|
7911
7987
|
Link,
|
|
7912
7988
|
{
|
|
7913
7989
|
level: "text",
|
|
@@ -7916,7 +7992,7 @@ var Feedback = forwardRef32(
|
|
|
7916
7992
|
href: onClose ? "#" : void 0,
|
|
7917
7993
|
"aria-label": closeLabel,
|
|
7918
7994
|
className: "aviala-feedback__close",
|
|
7919
|
-
leftIcon: /* @__PURE__ */
|
|
7995
|
+
leftIcon: /* @__PURE__ */ jsx48(SymbolWrong3, { "aria-hidden": true }),
|
|
7920
7996
|
onClick: (event) => {
|
|
7921
7997
|
if (onClose) {
|
|
7922
7998
|
event.preventDefault();
|
|
@@ -7946,7 +8022,7 @@ import {
|
|
|
7946
8022
|
forwardRef as forwardRef33,
|
|
7947
8023
|
isValidElement as isValidElement15
|
|
7948
8024
|
} from "react";
|
|
7949
|
-
import { jsx as
|
|
8025
|
+
import { jsx as jsx49, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
7950
8026
|
var ALERT_ICON_SIZE = 16;
|
|
7951
8027
|
var alertVariants = cva12("aviala-alert", {
|
|
7952
8028
|
variants: {
|
|
@@ -7982,20 +8058,20 @@ function renderAlertIcon(node) {
|
|
|
7982
8058
|
"shrink-0"
|
|
7983
8059
|
)
|
|
7984
8060
|
}) : node;
|
|
7985
|
-
return /* @__PURE__ */
|
|
8061
|
+
return /* @__PURE__ */ jsx49("span", { className: "aviala-alert__icon", "aria-hidden": true, children: content });
|
|
7986
8062
|
}
|
|
7987
8063
|
function defaultStatusIcon2(type) {
|
|
7988
8064
|
const iconProps = { thickness: "Regular", mode: "fill", "aria-hidden": true };
|
|
7989
8065
|
switch (type) {
|
|
7990
8066
|
case "info":
|
|
7991
8067
|
case "neutral":
|
|
7992
|
-
return /* @__PURE__ */
|
|
8068
|
+
return /* @__PURE__ */ jsx49(SymbolInformationCircle3, { ...iconProps });
|
|
7993
8069
|
case "warning":
|
|
7994
|
-
return /* @__PURE__ */
|
|
8070
|
+
return /* @__PURE__ */ jsx49(SymbolWarningCircle2, { ...iconProps });
|
|
7995
8071
|
case "error":
|
|
7996
|
-
return /* @__PURE__ */
|
|
8072
|
+
return /* @__PURE__ */ jsx49(SymbolWrongCircle3, { ...iconProps });
|
|
7997
8073
|
case "success":
|
|
7998
|
-
return /* @__PURE__ */
|
|
8074
|
+
return /* @__PURE__ */ jsx49(SymbolRightCircle2, { ...iconProps });
|
|
7999
8075
|
}
|
|
8000
8076
|
}
|
|
8001
8077
|
var Alert = forwardRef33(
|
|
@@ -8038,7 +8114,7 @@ var Alert = forwardRef33(
|
|
|
8038
8114
|
children: [
|
|
8039
8115
|
/* @__PURE__ */ jsxs37("div", { className: "aviala-alert__body", children: [
|
|
8040
8116
|
showIcon ? renderAlertIcon(icon ?? defaultStatusIcon2(resolvedType)) : null,
|
|
8041
|
-
isSmall ? /* @__PURE__ */
|
|
8117
|
+
isSmall ? /* @__PURE__ */ jsx49(Typography, { level: "text", className: "aviala-alert__title", children: title }) : /* @__PURE__ */ jsx49(
|
|
8042
8118
|
Typeface,
|
|
8043
8119
|
{
|
|
8044
8120
|
className: "aviala-alert__typeface",
|
|
@@ -8047,7 +8123,7 @@ var Alert = forwardRef33(
|
|
|
8047
8123
|
secondary: description
|
|
8048
8124
|
}
|
|
8049
8125
|
),
|
|
8050
|
-
quickAction ? /* @__PURE__ */
|
|
8126
|
+
quickAction ? /* @__PURE__ */ jsx49(
|
|
8051
8127
|
Link,
|
|
8052
8128
|
{
|
|
8053
8129
|
level: "text",
|
|
@@ -8063,7 +8139,7 @@ var Alert = forwardRef33(
|
|
|
8063
8139
|
children: quickAction
|
|
8064
8140
|
}
|
|
8065
8141
|
) : null,
|
|
8066
|
-
dismissible ? /* @__PURE__ */
|
|
8142
|
+
dismissible ? /* @__PURE__ */ jsx49(
|
|
8067
8143
|
Link,
|
|
8068
8144
|
{
|
|
8069
8145
|
level: "text",
|
|
@@ -8072,7 +8148,7 @@ var Alert = forwardRef33(
|
|
|
8072
8148
|
href: onDismiss ? "#" : void 0,
|
|
8073
8149
|
"aria-label": closeLabel,
|
|
8074
8150
|
className: "aviala-alert__close",
|
|
8075
|
-
leftIcon: /* @__PURE__ */
|
|
8151
|
+
leftIcon: /* @__PURE__ */ jsx49(SymbolWrong4, { "aria-hidden": true }),
|
|
8076
8152
|
onClick: (event) => {
|
|
8077
8153
|
if (onDismiss) {
|
|
8078
8154
|
event.preventDefault();
|
|
@@ -8083,7 +8159,7 @@ var Alert = forwardRef33(
|
|
|
8083
8159
|
) : null
|
|
8084
8160
|
] }),
|
|
8085
8161
|
hasActions ? /* @__PURE__ */ jsxs37("div", { className: "aviala-alert__actions", children: [
|
|
8086
|
-
action ? /* @__PURE__ */
|
|
8162
|
+
action ? /* @__PURE__ */ jsx49(
|
|
8087
8163
|
Link,
|
|
8088
8164
|
{
|
|
8089
8165
|
level: "caption",
|
|
@@ -8099,7 +8175,7 @@ var Alert = forwardRef33(
|
|
|
8099
8175
|
children: action
|
|
8100
8176
|
}
|
|
8101
8177
|
) : null,
|
|
8102
|
-
secondaryAction ? /* @__PURE__ */
|
|
8178
|
+
secondaryAction ? /* @__PURE__ */ jsx49(
|
|
8103
8179
|
Link,
|
|
8104
8180
|
{
|
|
8105
8181
|
level: "caption",
|
|
@@ -8133,30 +8209,30 @@ import {
|
|
|
8133
8209
|
forwardRef as forwardRef34,
|
|
8134
8210
|
isValidElement as isValidElement16
|
|
8135
8211
|
} from "react";
|
|
8136
|
-
import { Fragment as Fragment7, jsx as
|
|
8212
|
+
import { Fragment as Fragment7, jsx as jsx50, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
8137
8213
|
var List = forwardRef34(
|
|
8138
8214
|
({ className, title, children, ...props }, ref) => /* @__PURE__ */ jsxs38("div", { ref, className: cn("aviala-list", className), ...props, children: [
|
|
8139
|
-
title != null ? /* @__PURE__ */
|
|
8140
|
-
/* @__PURE__ */
|
|
8215
|
+
title != null ? /* @__PURE__ */ jsx50(ListTitle, { children: title }) : null,
|
|
8216
|
+
/* @__PURE__ */ jsx50(ListGroup, { children })
|
|
8141
8217
|
] })
|
|
8142
8218
|
);
|
|
8143
8219
|
List.displayName = "List";
|
|
8144
8220
|
var ListTitle = forwardRef34(
|
|
8145
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
8221
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx50("div", { ref, className: cn("aviala-list-title", className), ...props, children: /* @__PURE__ */ jsx50("span", { className: cn(typographyVariants({ level: "text" })), children }) })
|
|
8146
8222
|
);
|
|
8147
8223
|
ListTitle.displayName = "ListTitle";
|
|
8148
8224
|
var ListGroup = forwardRef34(
|
|
8149
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
8225
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx50("div", { ref, className: cn("aviala-list-group", className), role: "list", ...props, children })
|
|
8150
8226
|
);
|
|
8151
8227
|
ListGroup.displayName = "ListGroup";
|
|
8152
8228
|
function ListItemGroup({ label, children, className }) {
|
|
8153
8229
|
return /* @__PURE__ */ jsxs38("div", { className: cn("aviala-list", className), children: [
|
|
8154
|
-
label != null ? /* @__PURE__ */
|
|
8155
|
-
/* @__PURE__ */
|
|
8230
|
+
label != null ? /* @__PURE__ */ jsx50(ListTitle, { children: label }) : null,
|
|
8231
|
+
/* @__PURE__ */ jsx50(ListGroup, { children })
|
|
8156
8232
|
] });
|
|
8157
8233
|
}
|
|
8158
8234
|
var ListDivider = forwardRef34(
|
|
8159
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
8235
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx50(
|
|
8160
8236
|
"span",
|
|
8161
8237
|
{
|
|
8162
8238
|
ref,
|
|
@@ -8168,13 +8244,13 @@ var ListDivider = forwardRef34(
|
|
|
8168
8244
|
);
|
|
8169
8245
|
ListDivider.displayName = "ListDivider";
|
|
8170
8246
|
var ListSeparator = forwardRef34(
|
|
8171
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
8247
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx50("hr", { ref, className: cn("aviala-list-separator", className), ...props })
|
|
8172
8248
|
);
|
|
8173
8249
|
ListSeparator.displayName = "ListSeparator";
|
|
8174
8250
|
function renderLeadingIcon(node, leading) {
|
|
8175
8251
|
if (leading === "none") return null;
|
|
8176
8252
|
const iconSize = leading === "shaped" ? 20 : 22;
|
|
8177
|
-
const content = node ?? (leading === "shaped" ? /* @__PURE__ */
|
|
8253
|
+
const content = node ?? (leading === "shaped" ? /* @__PURE__ */ jsx50(GeneralSetting, { "aria-hidden": true }) : /* @__PURE__ */ jsx50(GeneralSetting, { "aria-hidden": true }));
|
|
8178
8254
|
const rendered = isValidElement16(content) && typeof content.type !== "string" ? cloneElement11(content, {
|
|
8179
8255
|
width: iconSize,
|
|
8180
8256
|
height: iconSize,
|
|
@@ -8183,7 +8259,7 @@ function renderLeadingIcon(node, leading) {
|
|
|
8183
8259
|
"shrink-0"
|
|
8184
8260
|
)
|
|
8185
8261
|
}) : content;
|
|
8186
|
-
return /* @__PURE__ */
|
|
8262
|
+
return /* @__PURE__ */ jsx50("span", { className: "aviala-list-item__icon", children: /* @__PURE__ */ jsx50(
|
|
8187
8263
|
"span",
|
|
8188
8264
|
{
|
|
8189
8265
|
className: cn(
|
|
@@ -8221,12 +8297,12 @@ var ListItem = forwardRef34(
|
|
|
8221
8297
|
}, ref) => {
|
|
8222
8298
|
const isInteractive = interactive ?? (onClick != null || href != null);
|
|
8223
8299
|
const chevronVisible = showChevron ?? itemType === "action";
|
|
8224
|
-
const primaryAction = action ?? /* @__PURE__ */
|
|
8225
|
-
const chevron = chevronVisible ? /* @__PURE__ */
|
|
8300
|
+
const primaryAction = action ?? /* @__PURE__ */ jsx50(Button, { mode: "primary", size: "regular", leftIcon: /* @__PURE__ */ jsx50(GeneralSetting, { "aria-hidden": true }), children: actionLabel });
|
|
8301
|
+
const chevron = chevronVisible ? /* @__PURE__ */ jsx50("span", { className: "aviala-list-item__chevron", "aria-hidden": true, children: /* @__PURE__ */ jsx50(DirectionArrowRightLight2, { width: 18, height: 18 }) }) : null;
|
|
8226
8302
|
const renderTrailing = () => {
|
|
8227
8303
|
const hideActions = !showTrailing || trailing === null;
|
|
8228
8304
|
if (hideActions) {
|
|
8229
|
-
return chevron && itemType === "action" ? /* @__PURE__ */
|
|
8305
|
+
return chevron && itemType === "action" ? /* @__PURE__ */ jsx50("div", { className: "aviala-list-item__more", children: chevron }) : null;
|
|
8230
8306
|
}
|
|
8231
8307
|
if (trailing !== void 0) return trailing;
|
|
8232
8308
|
switch (itemType) {
|
|
@@ -8234,32 +8310,32 @@ var ListItem = forwardRef34(
|
|
|
8234
8310
|
return /* @__PURE__ */ jsxs38("div", { className: "aviala-list-item__more", children: [
|
|
8235
8311
|
/* @__PURE__ */ jsxs38("div", { className: "aviala-list-item__trailing", children: [
|
|
8236
8312
|
primaryAction,
|
|
8237
|
-
secondaryAction ?? /* @__PURE__ */
|
|
8313
|
+
secondaryAction ?? /* @__PURE__ */ jsx50(
|
|
8238
8314
|
Button,
|
|
8239
8315
|
{
|
|
8240
8316
|
mode: "default",
|
|
8241
8317
|
size: "regular",
|
|
8242
8318
|
iconOnly: true,
|
|
8243
8319
|
"aria-label": "More",
|
|
8244
|
-
leftIcon: /* @__PURE__ */
|
|
8320
|
+
leftIcon: /* @__PURE__ */ jsx50(GeneralSetting, { "aria-hidden": true })
|
|
8245
8321
|
}
|
|
8246
8322
|
)
|
|
8247
8323
|
] }),
|
|
8248
|
-
/* @__PURE__ */
|
|
8324
|
+
/* @__PURE__ */ jsx50(ListDivider, {}),
|
|
8249
8325
|
chevron
|
|
8250
8326
|
] });
|
|
8251
8327
|
case "switch":
|
|
8252
8328
|
return /* @__PURE__ */ jsxs38("div", { className: "aviala-list-item__trailing", children: [
|
|
8253
8329
|
primaryAction,
|
|
8254
|
-
/* @__PURE__ */
|
|
8255
|
-
/* @__PURE__ */
|
|
8330
|
+
/* @__PURE__ */ jsx50(ListDivider, {}),
|
|
8331
|
+
/* @__PURE__ */ jsx50(Switch, { ...switchProps })
|
|
8256
8332
|
] });
|
|
8257
8333
|
case "select":
|
|
8258
8334
|
default:
|
|
8259
8335
|
return /* @__PURE__ */ jsxs38("div", { className: "aviala-list-item__trailing", children: [
|
|
8260
8336
|
primaryAction,
|
|
8261
|
-
/* @__PURE__ */
|
|
8262
|
-
/* @__PURE__ */
|
|
8337
|
+
/* @__PURE__ */ jsx50(ListDivider, {}),
|
|
8338
|
+
/* @__PURE__ */ jsx50("span", { className: "aviala-list-item__select", children: select })
|
|
8263
8339
|
] });
|
|
8264
8340
|
}
|
|
8265
8341
|
};
|
|
@@ -8275,13 +8351,13 @@ var ListItem = forwardRef34(
|
|
|
8275
8351
|
const trailingNode = renderTrailing();
|
|
8276
8352
|
const body = /* @__PURE__ */ jsxs38(Fragment7, { children: [
|
|
8277
8353
|
renderLeadingIcon(icon, leading),
|
|
8278
|
-
/* @__PURE__ */
|
|
8279
|
-
/* @__PURE__ */
|
|
8354
|
+
/* @__PURE__ */ jsx50("div", { className: "aviala-list-item__body", children: /* @__PURE__ */ jsxs38("div", { className: "aviala-list-item__content", children: [
|
|
8355
|
+
/* @__PURE__ */ jsx50("div", { className: "aviala-list-item__head", children: /* @__PURE__ */ jsx50(Typeface, { content: "textCaption", primary: title, secondary: subtitle }) }),
|
|
8280
8356
|
trailingNode
|
|
8281
8357
|
] }) })
|
|
8282
8358
|
] });
|
|
8283
8359
|
if (href && !disabled) {
|
|
8284
|
-
return /* @__PURE__ */
|
|
8360
|
+
return /* @__PURE__ */ jsx50(
|
|
8285
8361
|
"a",
|
|
8286
8362
|
{
|
|
8287
8363
|
ref,
|
|
@@ -8297,7 +8373,7 @@ var ListItem = forwardRef34(
|
|
|
8297
8373
|
}
|
|
8298
8374
|
);
|
|
8299
8375
|
}
|
|
8300
|
-
return /* @__PURE__ */
|
|
8376
|
+
return /* @__PURE__ */ jsx50(
|
|
8301
8377
|
"div",
|
|
8302
8378
|
{
|
|
8303
8379
|
ref,
|
|
@@ -8321,13 +8397,13 @@ import {
|
|
|
8321
8397
|
forwardRef as forwardRef35,
|
|
8322
8398
|
useCallback as useCallback16,
|
|
8323
8399
|
useContext as useContext8,
|
|
8324
|
-
useEffect as
|
|
8400
|
+
useEffect as useEffect12,
|
|
8325
8401
|
useLayoutEffect as useLayoutEffect6,
|
|
8326
8402
|
useMemo as useMemo10,
|
|
8327
8403
|
useRef as useRef12,
|
|
8328
|
-
useState as
|
|
8404
|
+
useState as useState17
|
|
8329
8405
|
} from "react";
|
|
8330
|
-
import { Fragment as Fragment8, jsx as
|
|
8406
|
+
import { Fragment as Fragment8, jsx as jsx51, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
8331
8407
|
function navigationItemButtonMode(active) {
|
|
8332
8408
|
return active ? "second" : "noBackgroundCustom";
|
|
8333
8409
|
}
|
|
@@ -8336,7 +8412,7 @@ function useNavigationDirection() {
|
|
|
8336
8412
|
return useContext8(NavigationDirectionContext);
|
|
8337
8413
|
}
|
|
8338
8414
|
var NAVIGATION_ANIMATION_MS_FALLBACK = 300;
|
|
8339
|
-
var NAVIGATION_ANIMATION_EASING_FALLBACK = "cubic-bezier(0.
|
|
8415
|
+
var NAVIGATION_ANIMATION_EASING_FALLBACK = "cubic-bezier(0.16, 1, 0.3, 1)";
|
|
8340
8416
|
function parseDurationMs(value) {
|
|
8341
8417
|
const trimmed = value.trim();
|
|
8342
8418
|
if (!trimmed) return NAVIGATION_ANIMATION_MS_FALLBACK;
|
|
@@ -8443,8 +8519,8 @@ function measureIndicatorFromElement(indicatorEl, groupEl) {
|
|
|
8443
8519
|
visible: indicatorEl.dataset.visible === "true"
|
|
8444
8520
|
};
|
|
8445
8521
|
}
|
|
8446
|
-
function
|
|
8447
|
-
return 1 - Math.pow(1 - t,
|
|
8522
|
+
function easeOutQuint(t) {
|
|
8523
|
+
return 1 - Math.pow(1 - t, 5);
|
|
8448
8524
|
}
|
|
8449
8525
|
function metricsApproxEqual2(a, b, epsilon = 0.5) {
|
|
8450
8526
|
return Math.abs(a.x - b.x) < epsilon && Math.abs(a.y - b.y) < epsilon && Math.abs(a.width - b.width) < epsilon && Math.abs(a.height - b.height) < epsilon && a.visible === b.visible;
|
|
@@ -8501,7 +8577,7 @@ function useNavigationIndicator(groupRef, direction, layoutKey) {
|
|
|
8501
8577
|
const layoutTrackingFrameRef = useRef12(null);
|
|
8502
8578
|
const isLayoutTrackingRef = useRef12(false);
|
|
8503
8579
|
const isInitialMount = useRef12(true);
|
|
8504
|
-
const [activeRevision, setActiveRevision] =
|
|
8580
|
+
const [activeRevision, setActiveRevision] = useState17(0);
|
|
8505
8581
|
const measureIndicator = useCallback16(() => {
|
|
8506
8582
|
const group = groupRef.current;
|
|
8507
8583
|
if (!group) return null;
|
|
@@ -8568,7 +8644,7 @@ function useNavigationIndicator(groupRef, direction, layoutKey) {
|
|
|
8568
8644
|
if (!startVisible || !target.visible) {
|
|
8569
8645
|
syncIndicator(target, true);
|
|
8570
8646
|
} else {
|
|
8571
|
-
const eased =
|
|
8647
|
+
const eased = easeOutQuint(progress);
|
|
8572
8648
|
const groupRect = group.getBoundingClientRect();
|
|
8573
8649
|
const targetAbsX = groupRect.left + target.x;
|
|
8574
8650
|
const targetAbsY = groupRect.top + target.y;
|
|
@@ -8700,7 +8776,7 @@ function useNavigationIndicator(groupRef, direction, layoutKey) {
|
|
|
8700
8776
|
startExpandCollapseTracking,
|
|
8701
8777
|
syncIndicator
|
|
8702
8778
|
]);
|
|
8703
|
-
|
|
8779
|
+
useEffect12(() => {
|
|
8704
8780
|
if (direction !== "vertical") return;
|
|
8705
8781
|
const group = groupRef.current;
|
|
8706
8782
|
if (!group) return;
|
|
@@ -8736,7 +8812,7 @@ var Navigation = forwardRef35(
|
|
|
8736
8812
|
direction = "vertical",
|
|
8737
8813
|
dividingLine = false,
|
|
8738
8814
|
...props
|
|
8739
|
-
}, ref) => /* @__PURE__ */
|
|
8815
|
+
}, ref) => /* @__PURE__ */ jsx51(NavigationDirectionContext.Provider, { value: direction, children: /* @__PURE__ */ jsx51(
|
|
8740
8816
|
Tag2,
|
|
8741
8817
|
{
|
|
8742
8818
|
ref,
|
|
@@ -8750,7 +8826,7 @@ var Navigation = forwardRef35(
|
|
|
8750
8826
|
);
|
|
8751
8827
|
Navigation.displayName = "Navigation";
|
|
8752
8828
|
var NavigationBrand = forwardRef35(
|
|
8753
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
8829
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx51(
|
|
8754
8830
|
"div",
|
|
8755
8831
|
{
|
|
8756
8832
|
ref,
|
|
@@ -8762,24 +8838,24 @@ var NavigationBrand = forwardRef35(
|
|
|
8762
8838
|
NavigationBrand.displayName = "NavigationBrand";
|
|
8763
8839
|
var NavigationBrandTitle = forwardRef35(({ className, asChild = false, children, ...props }, ref) => {
|
|
8764
8840
|
const Comp = asChild ? Slot5 : "a";
|
|
8765
|
-
return /* @__PURE__ */
|
|
8841
|
+
return /* @__PURE__ */ jsx51(
|
|
8766
8842
|
Comp,
|
|
8767
8843
|
{
|
|
8768
8844
|
ref,
|
|
8769
8845
|
className: cn("aviala-navigation-brand__title aviala-focus-ring", className),
|
|
8770
8846
|
...props,
|
|
8771
|
-
children: asChild ? children : /* @__PURE__ */
|
|
8847
|
+
children: asChild ? children : /* @__PURE__ */ jsx51(Typography, { level: "text", as: "span", children })
|
|
8772
8848
|
}
|
|
8773
8849
|
);
|
|
8774
8850
|
});
|
|
8775
8851
|
NavigationBrandTitle.displayName = "NavigationBrandTitle";
|
|
8776
|
-
var NavigationSection = forwardRef35(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
8852
|
+
var NavigationSection = forwardRef35(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx51(
|
|
8777
8853
|
"div",
|
|
8778
8854
|
{
|
|
8779
8855
|
ref,
|
|
8780
8856
|
className: cn("aviala-navigation-section", className),
|
|
8781
8857
|
...props,
|
|
8782
|
-
children: /* @__PURE__ */
|
|
8858
|
+
children: /* @__PURE__ */ jsx51(Typography, { level: "caption", as: "p", children })
|
|
8783
8859
|
}
|
|
8784
8860
|
));
|
|
8785
8861
|
NavigationSection.displayName = "NavigationSection";
|
|
@@ -8811,7 +8887,7 @@ var NavigationGroup = forwardRef35(
|
|
|
8811
8887
|
className: cn("aviala-navigation-group", className),
|
|
8812
8888
|
...props,
|
|
8813
8889
|
children: [
|
|
8814
|
-
/* @__PURE__ */
|
|
8890
|
+
/* @__PURE__ */ jsx51(
|
|
8815
8891
|
"span",
|
|
8816
8892
|
{
|
|
8817
8893
|
ref: onIndicatorRef,
|
|
@@ -8837,7 +8913,7 @@ var NavigationItemGroup = forwardRef35(({ className, expanded, children, ...prop
|
|
|
8837
8913
|
if (isCollapsed) inner.setAttribute("inert", "");
|
|
8838
8914
|
else inner.removeAttribute("inert");
|
|
8839
8915
|
}, [isCollapsed]);
|
|
8840
|
-
return /* @__PURE__ */
|
|
8916
|
+
return /* @__PURE__ */ jsx51(
|
|
8841
8917
|
"div",
|
|
8842
8918
|
{
|
|
8843
8919
|
ref,
|
|
@@ -8845,7 +8921,7 @@ var NavigationItemGroup = forwardRef35(({ className, expanded, children, ...prop
|
|
|
8845
8921
|
"data-expanded": isCollapsible ? expanded ? "true" : "false" : void 0,
|
|
8846
8922
|
"aria-hidden": isCollapsed ? true : void 0,
|
|
8847
8923
|
...props,
|
|
8848
|
-
children: isCollapsible ? /* @__PURE__ */
|
|
8924
|
+
children: isCollapsible ? /* @__PURE__ */ jsx51("div", { ref: innerRef, className: "aviala-navigation-item-group__inner", children }) : children
|
|
8849
8925
|
}
|
|
8850
8926
|
);
|
|
8851
8927
|
});
|
|
@@ -8856,7 +8932,7 @@ function renderItemIcon3(node) {
|
|
|
8856
8932
|
level: "text",
|
|
8857
8933
|
biggerSize: true
|
|
8858
8934
|
});
|
|
8859
|
-
return /* @__PURE__ */
|
|
8935
|
+
return /* @__PURE__ */ jsx51("span", { className: "aviala-navigation-item__icon", children: content });
|
|
8860
8936
|
}
|
|
8861
8937
|
var NavigationItem = forwardRef35(
|
|
8862
8938
|
({
|
|
@@ -8875,7 +8951,7 @@ var NavigationItem = forwardRef35(
|
|
|
8875
8951
|
const mode = navigationItemButtonMode(isActive);
|
|
8876
8952
|
const controlContent = /* @__PURE__ */ jsxs39(Fragment8, { children: [
|
|
8877
8953
|
renderItemIcon3(leftIcon),
|
|
8878
|
-
/* @__PURE__ */
|
|
8954
|
+
/* @__PURE__ */ jsx51(
|
|
8879
8955
|
Typography,
|
|
8880
8956
|
{
|
|
8881
8957
|
level: "text",
|
|
@@ -8884,15 +8960,15 @@ var NavigationItem = forwardRef35(
|
|
|
8884
8960
|
children
|
|
8885
8961
|
}
|
|
8886
8962
|
),
|
|
8887
|
-
rightIcon ? /* @__PURE__ */
|
|
8963
|
+
rightIcon ? /* @__PURE__ */ jsx51("span", { className: "aviala-navigation-item__chevron", children: renderItemIcon3(rightIcon) }) : null
|
|
8888
8964
|
] });
|
|
8889
|
-
return /* @__PURE__ */
|
|
8965
|
+
return /* @__PURE__ */ jsx51(
|
|
8890
8966
|
"span",
|
|
8891
8967
|
{
|
|
8892
8968
|
className: cn("aviala-navigation-item", className),
|
|
8893
8969
|
"data-item-type": itemType,
|
|
8894
8970
|
"data-active": isActive ? "true" : "false",
|
|
8895
|
-
children: /* @__PURE__ */
|
|
8971
|
+
children: /* @__PURE__ */ jsx51(
|
|
8896
8972
|
Comp,
|
|
8897
8973
|
{
|
|
8898
8974
|
ref,
|
|
@@ -8911,7 +8987,7 @@ var NavigationItem = forwardRef35(
|
|
|
8911
8987
|
}
|
|
8912
8988
|
);
|
|
8913
8989
|
NavigationItem.displayName = "NavigationItem";
|
|
8914
|
-
var NavigationActions = forwardRef35(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
8990
|
+
var NavigationActions = forwardRef35(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx51(
|
|
8915
8991
|
"div",
|
|
8916
8992
|
{
|
|
8917
8993
|
ref,
|
|
@@ -8921,7 +8997,7 @@ var NavigationActions = forwardRef35(({ className, children, ...props }, ref) =>
|
|
|
8921
8997
|
}
|
|
8922
8998
|
));
|
|
8923
8999
|
NavigationActions.displayName = "NavigationActions";
|
|
8924
|
-
var NavigationActionsSlot = forwardRef35(({ className, ...props }, ref) => /* @__PURE__ */
|
|
9000
|
+
var NavigationActionsSlot = forwardRef35(({ className, ...props }, ref) => /* @__PURE__ */ jsx51(
|
|
8925
9001
|
"div",
|
|
8926
9002
|
{
|
|
8927
9003
|
ref,
|
|
@@ -8947,10 +9023,10 @@ function NavigationItemMenu({
|
|
|
8947
9023
|
onOpenChange,
|
|
8948
9024
|
children
|
|
8949
9025
|
}) {
|
|
8950
|
-
const [internalValue, setInternalValue] =
|
|
9026
|
+
const [internalValue, setInternalValue] = useState17(defaultValue);
|
|
8951
9027
|
const isValueControlled = valueProp !== void 0;
|
|
8952
9028
|
const value = isValueControlled ? valueProp : internalValue;
|
|
8953
|
-
const [internalOpen, setInternalOpen] =
|
|
9029
|
+
const [internalOpen, setInternalOpen] = useState17(false);
|
|
8954
9030
|
const isOpenControlled = openProp !== void 0;
|
|
8955
9031
|
const open = isOpenControlled ? openProp : internalOpen;
|
|
8956
9032
|
const closeTimerRef = useRef12(null);
|
|
@@ -8992,7 +9068,7 @@ function NavigationItemMenu({
|
|
|
8992
9068
|
},
|
|
8993
9069
|
[cancelClose, isValueControlled, onValueChange, setOpen]
|
|
8994
9070
|
);
|
|
8995
|
-
|
|
9071
|
+
useEffect12(() => cancelClose, [cancelClose]);
|
|
8996
9072
|
const contextValue = useMemo10(
|
|
8997
9073
|
() => ({
|
|
8998
9074
|
value,
|
|
@@ -9013,7 +9089,7 @@ function NavigationItemMenu({
|
|
|
9013
9089
|
},
|
|
9014
9090
|
[cancelClose, setOpen]
|
|
9015
9091
|
);
|
|
9016
|
-
return /* @__PURE__ */
|
|
9092
|
+
return /* @__PURE__ */ jsx51(NavigationItemMenuContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx51(Popover, { open, onOpenChange: handleOpenChange, children }) });
|
|
9017
9093
|
}
|
|
9018
9094
|
var NavigationItemMenuTrigger = forwardRef35(
|
|
9019
9095
|
({
|
|
@@ -9027,7 +9103,7 @@ var NavigationItemMenuTrigger = forwardRef35(
|
|
|
9027
9103
|
const menu = useNavigationItemMenuContext("NavigationItemMenuTrigger");
|
|
9028
9104
|
const isActive = active ?? menu.hasSelection;
|
|
9029
9105
|
const mode = navigationItemButtonMode(isActive);
|
|
9030
|
-
return /* @__PURE__ */
|
|
9106
|
+
return /* @__PURE__ */ jsx51(
|
|
9031
9107
|
"span",
|
|
9032
9108
|
{
|
|
9033
9109
|
className: cn("aviala-navigation-item", className),
|
|
@@ -9035,7 +9111,7 @@ var NavigationItemMenuTrigger = forwardRef35(
|
|
|
9035
9111
|
"data-active": isActive ? "true" : "false",
|
|
9036
9112
|
onMouseEnter: () => menu.openMenu(true),
|
|
9037
9113
|
onMouseLeave: menu.scheduleClose,
|
|
9038
|
-
children: /* @__PURE__ */
|
|
9114
|
+
children: /* @__PURE__ */ jsx51(PopoverPrimitive7.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs39(
|
|
9039
9115
|
"button",
|
|
9040
9116
|
{
|
|
9041
9117
|
ref,
|
|
@@ -9048,7 +9124,7 @@ var NavigationItemMenuTrigger = forwardRef35(
|
|
|
9048
9124
|
...props,
|
|
9049
9125
|
children: [
|
|
9050
9126
|
renderItemIcon3(leftIcon),
|
|
9051
|
-
/* @__PURE__ */
|
|
9127
|
+
/* @__PURE__ */ jsx51(
|
|
9052
9128
|
Typography,
|
|
9053
9129
|
{
|
|
9054
9130
|
level: "text",
|
|
@@ -9057,7 +9133,7 @@ var NavigationItemMenuTrigger = forwardRef35(
|
|
|
9057
9133
|
children
|
|
9058
9134
|
}
|
|
9059
9135
|
),
|
|
9060
|
-
rightIcon ? /* @__PURE__ */
|
|
9136
|
+
rightIcon ? /* @__PURE__ */ jsx51("span", { className: "aviala-navigation-item__chevron", children: renderItemIcon3(rightIcon) }) : null
|
|
9061
9137
|
]
|
|
9062
9138
|
}
|
|
9063
9139
|
) })
|
|
@@ -9078,7 +9154,7 @@ var NavigationItemMenuContent = forwardRef35(
|
|
|
9078
9154
|
}, ref) => {
|
|
9079
9155
|
const direction = useNavigationDirection();
|
|
9080
9156
|
const menu = useNavigationItemMenuContext("NavigationItemMenuContent");
|
|
9081
|
-
return /* @__PURE__ */
|
|
9157
|
+
return /* @__PURE__ */ jsx51(PopoverPrimitive7.Portal, { children: /* @__PURE__ */ jsx51(
|
|
9082
9158
|
PopoverPrimitive7.Content,
|
|
9083
9159
|
{
|
|
9084
9160
|
ref,
|
|
@@ -9133,7 +9209,7 @@ var NavigationItemMenuItem = forwardRef35(
|
|
|
9133
9209
|
...props,
|
|
9134
9210
|
children: [
|
|
9135
9211
|
renderItemIcon3(leftIcon),
|
|
9136
|
-
/* @__PURE__ */
|
|
9212
|
+
/* @__PURE__ */ jsx51(
|
|
9137
9213
|
Typography,
|
|
9138
9214
|
{
|
|
9139
9215
|
level: "text",
|
|
@@ -9142,7 +9218,7 @@ var NavigationItemMenuItem = forwardRef35(
|
|
|
9142
9218
|
children
|
|
9143
9219
|
}
|
|
9144
9220
|
),
|
|
9145
|
-
rightIcon ? /* @__PURE__ */
|
|
9221
|
+
rightIcon ? /* @__PURE__ */ jsx51("span", { className: "aviala-navigation-menu-item__trailing", children: renderItemIcon3(rightIcon) }) : null
|
|
9146
9222
|
]
|
|
9147
9223
|
}
|
|
9148
9224
|
);
|
|
@@ -9153,8 +9229,11 @@ NavigationItemMenuItem.displayName = "NavigationItemMenuItem";
|
|
|
9153
9229
|
// src/components/slider.tsx
|
|
9154
9230
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
9155
9231
|
import { cva as cva13 } from "class-variance-authority";
|
|
9156
|
-
import {
|
|
9157
|
-
|
|
9232
|
+
import {
|
|
9233
|
+
forwardRef as forwardRef36,
|
|
9234
|
+
useState as useState18
|
|
9235
|
+
} from "react";
|
|
9236
|
+
import { jsx as jsx52, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
9158
9237
|
var sliderVariants = cva13("aviala-slider", {
|
|
9159
9238
|
variants: {
|
|
9160
9239
|
size: {
|
|
@@ -9171,6 +9250,70 @@ var sliderVariants = cva13("aviala-slider", {
|
|
|
9171
9250
|
type: "default"
|
|
9172
9251
|
}
|
|
9173
9252
|
});
|
|
9253
|
+
function SliderValueTooltip({
|
|
9254
|
+
open,
|
|
9255
|
+
children
|
|
9256
|
+
}) {
|
|
9257
|
+
return /* @__PURE__ */ jsxs40(
|
|
9258
|
+
"span",
|
|
9259
|
+
{
|
|
9260
|
+
className: "aviala-slider__value-tooltip",
|
|
9261
|
+
"data-state": open ? "instant-open" : "closed",
|
|
9262
|
+
"aria-hidden": !open,
|
|
9263
|
+
children: [
|
|
9264
|
+
/* @__PURE__ */ jsx52(
|
|
9265
|
+
"span",
|
|
9266
|
+
{
|
|
9267
|
+
className: cn(
|
|
9268
|
+
"aviala-slider__value-tooltip__surface",
|
|
9269
|
+
typographyVariants({ level: "caption" })
|
|
9270
|
+
),
|
|
9271
|
+
children
|
|
9272
|
+
}
|
|
9273
|
+
),
|
|
9274
|
+
/* @__PURE__ */ jsx52("span", { className: "aviala-slider__value-tooltip__arrow", "aria-hidden": true, children: /* @__PURE__ */ jsx52(
|
|
9275
|
+
OverlayPointerSvg,
|
|
9276
|
+
{
|
|
9277
|
+
className: "aviala-tooltip-content__arrow",
|
|
9278
|
+
width: TOOLTIP_POINTER.width,
|
|
9279
|
+
height: TOOLTIP_POINTER.height,
|
|
9280
|
+
path: TOOLTIP_POINTER.path
|
|
9281
|
+
}
|
|
9282
|
+
) })
|
|
9283
|
+
]
|
|
9284
|
+
}
|
|
9285
|
+
);
|
|
9286
|
+
}
|
|
9287
|
+
function SliderThumb({
|
|
9288
|
+
index,
|
|
9289
|
+
value,
|
|
9290
|
+
showValueTooltip,
|
|
9291
|
+
formatValueTooltip,
|
|
9292
|
+
forceTooltipOpen,
|
|
9293
|
+
onThumbPointerDown
|
|
9294
|
+
}) {
|
|
9295
|
+
const [hoverOpen, setHoverOpen] = useState18(false);
|
|
9296
|
+
const tooltipOpen = Boolean(
|
|
9297
|
+
showValueTooltip && (forceTooltipOpen || hoverOpen)
|
|
9298
|
+
);
|
|
9299
|
+
const label = formatValueTooltip ? formatValueTooltip(value, index) : String(value);
|
|
9300
|
+
return /* @__PURE__ */ jsxs40(SliderPrimitive.unstable_ThumbProvider, { children: [
|
|
9301
|
+
/* @__PURE__ */ jsxs40(
|
|
9302
|
+
SliderPrimitive.unstable_ThumbTrigger,
|
|
9303
|
+
{
|
|
9304
|
+
className: "aviala-slider__thumb aviala-focus-ring",
|
|
9305
|
+
onPointerDown: onThumbPointerDown,
|
|
9306
|
+
onPointerEnter: showValueTooltip ? () => setHoverOpen(true) : void 0,
|
|
9307
|
+
onPointerLeave: showValueTooltip ? () => setHoverOpen(false) : void 0,
|
|
9308
|
+
children: [
|
|
9309
|
+
/* @__PURE__ */ jsx52("span", { className: "aviala-slider__thumb-face", "aria-hidden": true }),
|
|
9310
|
+
showValueTooltip ? /* @__PURE__ */ jsx52(SliderValueTooltip, { open: tooltipOpen, children: label }) : null
|
|
9311
|
+
]
|
|
9312
|
+
}
|
|
9313
|
+
),
|
|
9314
|
+
/* @__PURE__ */ jsx52(SliderPrimitive.unstable_BubbleInput, {})
|
|
9315
|
+
] });
|
|
9316
|
+
}
|
|
9174
9317
|
var Slider = forwardRef36(
|
|
9175
9318
|
({
|
|
9176
9319
|
className,
|
|
@@ -9181,6 +9324,14 @@ var Slider = forwardRef36(
|
|
|
9181
9324
|
defaultValue,
|
|
9182
9325
|
min = 0,
|
|
9183
9326
|
max = 100,
|
|
9327
|
+
onValueChange,
|
|
9328
|
+
onPointerDown,
|
|
9329
|
+
onPointerMove,
|
|
9330
|
+
onPointerUp,
|
|
9331
|
+
onPointerCancel,
|
|
9332
|
+
onLostPointerCapture,
|
|
9333
|
+
showValueTooltip = false,
|
|
9334
|
+
formatValueTooltip,
|
|
9184
9335
|
...props
|
|
9185
9336
|
}, ref) => {
|
|
9186
9337
|
const resolvedType = type ?? "default";
|
|
@@ -9188,6 +9339,49 @@ var Slider = forwardRef36(
|
|
|
9188
9339
|
const isRange = resolvedType === "range";
|
|
9189
9340
|
const resolvedDefaultValue = defaultValue ?? (isRange ? [25, 75] : [50]);
|
|
9190
9341
|
const thumbCount = isRange ? Math.max(2, value?.length ?? defaultValue?.length ?? 2) : 1;
|
|
9342
|
+
const [isDragging, setIsDragging] = useState18(false);
|
|
9343
|
+
const [pointerDown, setPointerDown] = useState18(false);
|
|
9344
|
+
const [activeThumbIndex, setActiveThumbIndex] = useState18(
|
|
9345
|
+
null
|
|
9346
|
+
);
|
|
9347
|
+
const [uncontrolledValue, setUncontrolledValue] = useState18(
|
|
9348
|
+
resolvedDefaultValue
|
|
9349
|
+
);
|
|
9350
|
+
const currentValues = value ?? uncontrolledValue;
|
|
9351
|
+
const handleValueChange = (next) => {
|
|
9352
|
+
if (value == null) setUncontrolledValue(next);
|
|
9353
|
+
if (showValueTooltip) {
|
|
9354
|
+
const prev = currentValues;
|
|
9355
|
+
const changed = next.findIndex((v, i) => v !== prev[i]);
|
|
9356
|
+
if (changed >= 0) setActiveThumbIndex(changed);
|
|
9357
|
+
}
|
|
9358
|
+
onValueChange?.(next);
|
|
9359
|
+
};
|
|
9360
|
+
const handlePointerDown = (event) => {
|
|
9361
|
+
if (showValueTooltip && !disabled) setPointerDown(true);
|
|
9362
|
+
onPointerDown?.(event);
|
|
9363
|
+
};
|
|
9364
|
+
const handlePointerMove = (event) => {
|
|
9365
|
+
if (event.buttons !== 0) setIsDragging(true);
|
|
9366
|
+
onPointerMove?.(event);
|
|
9367
|
+
};
|
|
9368
|
+
const endPointer = () => {
|
|
9369
|
+
setIsDragging(false);
|
|
9370
|
+
setPointerDown(false);
|
|
9371
|
+
setActiveThumbIndex(null);
|
|
9372
|
+
};
|
|
9373
|
+
const handlePointerUp = (event) => {
|
|
9374
|
+
endPointer();
|
|
9375
|
+
onPointerUp?.(event);
|
|
9376
|
+
};
|
|
9377
|
+
const handlePointerCancel = (event) => {
|
|
9378
|
+
endPointer();
|
|
9379
|
+
onPointerCancel?.(event);
|
|
9380
|
+
};
|
|
9381
|
+
const handleLostPointerCapture = (event) => {
|
|
9382
|
+
endPointer();
|
|
9383
|
+
onLostPointerCapture?.(event);
|
|
9384
|
+
};
|
|
9191
9385
|
return /* @__PURE__ */ jsxs40(
|
|
9192
9386
|
SliderPrimitive.Root,
|
|
9193
9387
|
{
|
|
@@ -9204,12 +9398,36 @@ var Slider = forwardRef36(
|
|
|
9204
9398
|
"data-size": resolvedSize,
|
|
9205
9399
|
"data-type": resolvedType,
|
|
9206
9400
|
"data-disabled": disabled ? "true" : void 0,
|
|
9401
|
+
"data-dragging": isDragging ? "true" : void 0,
|
|
9402
|
+
"data-value-tooltip": showValueTooltip ? "true" : void 0,
|
|
9403
|
+
onValueChange: handleValueChange,
|
|
9404
|
+
onPointerDown: handlePointerDown,
|
|
9405
|
+
onPointerMove: handlePointerMove,
|
|
9406
|
+
onPointerUp: handlePointerUp,
|
|
9407
|
+
onPointerCancel: handlePointerCancel,
|
|
9408
|
+
onLostPointerCapture: handleLostPointerCapture,
|
|
9207
9409
|
...props,
|
|
9208
9410
|
children: [
|
|
9209
|
-
/* @__PURE__ */
|
|
9210
|
-
Array.from({ length: thumbCount }, (_, index) =>
|
|
9411
|
+
/* @__PURE__ */ jsx52(SliderPrimitive.Track, { className: "aviala-slider__track", children: /* @__PURE__ */ jsx52(SliderPrimitive.Range, { className: "aviala-slider__range" }) }),
|
|
9412
|
+
Array.from({ length: thumbCount }, (_, index) => {
|
|
9413
|
+
const thumbValue = currentValues[index] ?? resolvedDefaultValue[index] ?? (isRange ? index === 0 ? min : max : min + (max - min) / 2);
|
|
9414
|
+
const forceTooltipOpen = pointerDown && (activeThumbIndex === index || activeThumbIndex == null && thumbCount === 1 && index === 0);
|
|
9415
|
+
return /* @__PURE__ */ jsx52(
|
|
9416
|
+
SliderThumb,
|
|
9417
|
+
{
|
|
9418
|
+
index,
|
|
9419
|
+
value: thumbValue,
|
|
9420
|
+
showValueTooltip: Boolean(showValueTooltip && !disabled),
|
|
9421
|
+
formatValueTooltip,
|
|
9422
|
+
forceTooltipOpen,
|
|
9423
|
+
onThumbPointerDown: () => setActiveThumbIndex(index)
|
|
9424
|
+
},
|
|
9425
|
+
index
|
|
9426
|
+
);
|
|
9427
|
+
})
|
|
9211
9428
|
]
|
|
9212
|
-
}
|
|
9429
|
+
},
|
|
9430
|
+
resolvedType
|
|
9213
9431
|
);
|
|
9214
9432
|
}
|
|
9215
9433
|
);
|
|
@@ -9221,9 +9439,9 @@ import { cva as cva14 } from "class-variance-authority";
|
|
|
9221
9439
|
import {
|
|
9222
9440
|
forwardRef as forwardRef37,
|
|
9223
9441
|
useRef as useRef13,
|
|
9224
|
-
useState as
|
|
9442
|
+
useState as useState19
|
|
9225
9443
|
} from "react";
|
|
9226
|
-
import { jsx as
|
|
9444
|
+
import { jsx as jsx53, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
9227
9445
|
var uploadVariants = cva14("aviala-upload aviala-focus-ring", {
|
|
9228
9446
|
variants: {
|
|
9229
9447
|
style: {
|
|
@@ -9254,7 +9472,7 @@ var Upload = forwardRef37(
|
|
|
9254
9472
|
...props
|
|
9255
9473
|
}, ref) => {
|
|
9256
9474
|
const inputRef = useRef13(null);
|
|
9257
|
-
const [dragging, setDragging] =
|
|
9475
|
+
const [dragging, setDragging] = useState19(false);
|
|
9258
9476
|
const resolvedStyle = style ?? "default";
|
|
9259
9477
|
const allowDrag = dragAndDrop ?? resolvedStyle === "large";
|
|
9260
9478
|
const openPicker = () => {
|
|
@@ -9304,7 +9522,7 @@ var Upload = forwardRef37(
|
|
|
9304
9522
|
onDrop: handleDrop,
|
|
9305
9523
|
...props,
|
|
9306
9524
|
children: [
|
|
9307
|
-
/* @__PURE__ */
|
|
9525
|
+
/* @__PURE__ */ jsx53(
|
|
9308
9526
|
"input",
|
|
9309
9527
|
{
|
|
9310
9528
|
ref: inputRef,
|
|
@@ -9319,8 +9537,8 @@ var Upload = forwardRef37(
|
|
|
9319
9537
|
...inputProps
|
|
9320
9538
|
}
|
|
9321
9539
|
),
|
|
9322
|
-
/* @__PURE__ */
|
|
9323
|
-
resolvedStyle === "large" ? /* @__PURE__ */
|
|
9540
|
+
/* @__PURE__ */ jsx53("span", { className: "aviala-upload__icon", "aria-hidden": true, children: /* @__PURE__ */ jsx53(GeneralUpload, { width: 16, height: 16 }) }),
|
|
9541
|
+
resolvedStyle === "large" ? /* @__PURE__ */ jsx53(
|
|
9324
9542
|
Typeface,
|
|
9325
9543
|
{
|
|
9326
9544
|
className: "aviala-upload__typeface",
|
|
@@ -9328,7 +9546,7 @@ var Upload = forwardRef37(
|
|
|
9328
9546
|
primary: title,
|
|
9329
9547
|
secondary: description
|
|
9330
9548
|
}
|
|
9331
|
-
) : /* @__PURE__ */
|
|
9549
|
+
) : /* @__PURE__ */ jsx53(Typography, { level: "text", as: "span", className: "aviala-upload__label", children: label })
|
|
9332
9550
|
]
|
|
9333
9551
|
}
|
|
9334
9552
|
);
|
|
@@ -9339,13 +9557,13 @@ Upload.displayName = "Upload";
|
|
|
9339
9557
|
// src/components/scroll-picker.tsx
|
|
9340
9558
|
import {
|
|
9341
9559
|
useCallback as useCallback17,
|
|
9342
|
-
useEffect as
|
|
9560
|
+
useEffect as useEffect13,
|
|
9343
9561
|
useId as useId5,
|
|
9344
9562
|
useLayoutEffect as useLayoutEffect7,
|
|
9345
9563
|
useMemo as useMemo11,
|
|
9346
9564
|
useRef as useRef14
|
|
9347
9565
|
} from "react";
|
|
9348
|
-
import { jsx as
|
|
9566
|
+
import { jsx as jsx54, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
9349
9567
|
var LOOP_SECTIONS2 = 3;
|
|
9350
9568
|
var MIDDLE_SECTION2 = 1;
|
|
9351
9569
|
function normalizeIndex2(index, length) {
|
|
@@ -9373,7 +9591,7 @@ function fractionalIndexAtScrollTop(metrics, scrollTop) {
|
|
|
9373
9591
|
return (scrollTop - metrics.originTop) / metrics.pitch;
|
|
9374
9592
|
}
|
|
9375
9593
|
function ScrollPicker({ className, children, ...props }) {
|
|
9376
|
-
return /* @__PURE__ */
|
|
9594
|
+
return /* @__PURE__ */ jsx54("div", { className: cn("aviala-scroll-picker", className), ...props, children });
|
|
9377
9595
|
}
|
|
9378
9596
|
function ScrollPickerColumn({
|
|
9379
9597
|
className,
|
|
@@ -9495,7 +9713,7 @@ function ScrollPickerColumn({
|
|
|
9495
9713
|
if (Math.abs(container.scrollTop - targetTop) <= 1) return;
|
|
9496
9714
|
scrollToIndex(targetIndex, "auto");
|
|
9497
9715
|
}, [getIndex, loop, scrollToIndex, value, values.length]);
|
|
9498
|
-
|
|
9716
|
+
useEffect13(() => {
|
|
9499
9717
|
const container = scrollRef.current;
|
|
9500
9718
|
if (!container) return;
|
|
9501
9719
|
const onScrollEnd = () => {
|
|
@@ -9512,7 +9730,7 @@ function ScrollPickerColumn({
|
|
|
9512
9730
|
}
|
|
9513
9731
|
};
|
|
9514
9732
|
}, [settleScroll]);
|
|
9515
|
-
|
|
9733
|
+
useEffect13(() => {
|
|
9516
9734
|
const container = scrollRef.current;
|
|
9517
9735
|
if (!container) return;
|
|
9518
9736
|
const onWheel = (event) => {
|
|
@@ -9570,9 +9788,9 @@ function ScrollPickerColumn({
|
|
|
9570
9788
|
}
|
|
9571
9789
|
};
|
|
9572
9790
|
const selectedOptionId = `${reactId}-${getIndex(value)}`;
|
|
9573
|
-
return /* @__PURE__ */
|
|
9574
|
-
/* @__PURE__ */
|
|
9575
|
-
/* @__PURE__ */
|
|
9791
|
+
return /* @__PURE__ */ jsx54("div", { className: cn("aviala-scroll-picker-column", className), children: /* @__PURE__ */ jsxs42("div", { className: "aviala-scroll-picker-column__viewport", children: [
|
|
9792
|
+
/* @__PURE__ */ jsx54("div", { className: "aviala-scroll-picker-column__highlight", "aria-hidden": true }),
|
|
9793
|
+
/* @__PURE__ */ jsx54(
|
|
9576
9794
|
"div",
|
|
9577
9795
|
{
|
|
9578
9796
|
ref: scrollRef,
|
|
@@ -9583,12 +9801,12 @@ function ScrollPickerColumn({
|
|
|
9583
9801
|
"aria-activedescendant": selectedOptionId,
|
|
9584
9802
|
tabIndex: 0,
|
|
9585
9803
|
onKeyDown: handleKeyDown,
|
|
9586
|
-
children: /* @__PURE__ */
|
|
9804
|
+
children: /* @__PURE__ */ jsx54("ul", { className: "aviala-scroll-picker-column__list", children: repeatedValues.map((itemValue, index) => {
|
|
9587
9805
|
const isSelected = Object.is(itemValue, value);
|
|
9588
9806
|
const valueIndex = loop ? normalizeIndex2(index, values.length) : index;
|
|
9589
9807
|
const optionId = `${reactId}-${loop ? index : valueIndex}`;
|
|
9590
9808
|
const key = getValueKey?.(itemValue, index) ?? `${String(itemValue)}-${index}`;
|
|
9591
|
-
return /* @__PURE__ */
|
|
9809
|
+
return /* @__PURE__ */ jsx54("li", { className: "contents", children: /* @__PURE__ */ jsx54(
|
|
9592
9810
|
ScrollPickerItem,
|
|
9593
9811
|
{
|
|
9594
9812
|
id: isSelected ? selectedOptionId : optionId,
|
|
@@ -9614,7 +9832,7 @@ function ScrollPickerItem({
|
|
|
9614
9832
|
className,
|
|
9615
9833
|
onSelect
|
|
9616
9834
|
}) {
|
|
9617
|
-
return /* @__PURE__ */
|
|
9835
|
+
return /* @__PURE__ */ jsx54(
|
|
9618
9836
|
"button",
|
|
9619
9837
|
{
|
|
9620
9838
|
type: "button",
|
|
@@ -9642,9 +9860,9 @@ import {
|
|
|
9642
9860
|
forwardRef as forwardRef38,
|
|
9643
9861
|
useCallback as useCallback18,
|
|
9644
9862
|
useContext as useContext9,
|
|
9645
|
-
useState as
|
|
9863
|
+
useState as useState20
|
|
9646
9864
|
} from "react";
|
|
9647
|
-
import { Fragment as Fragment9, jsx as
|
|
9865
|
+
import { Fragment as Fragment9, jsx as jsx55, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
9648
9866
|
var BreadcrumbSizeContext = createContext9("default");
|
|
9649
9867
|
function breadcrumbTypeLevel(size) {
|
|
9650
9868
|
return size === "small" ? "caption" : "text";
|
|
@@ -9663,7 +9881,7 @@ var breadcrumbVariants = cva15("aviala-breadcrumb", {
|
|
|
9663
9881
|
var Breadcrumb = forwardRef38(
|
|
9664
9882
|
({ className, size = "default", children, ...props }, ref) => {
|
|
9665
9883
|
const resolvedSize = size ?? "default";
|
|
9666
|
-
return /* @__PURE__ */
|
|
9884
|
+
return /* @__PURE__ */ jsx55(BreadcrumbSizeContext.Provider, { value: resolvedSize, children: /* @__PURE__ */ jsx55(
|
|
9667
9885
|
"nav",
|
|
9668
9886
|
{
|
|
9669
9887
|
ref,
|
|
@@ -9671,7 +9889,7 @@ var Breadcrumb = forwardRef38(
|
|
|
9671
9889
|
className: cn(breadcrumbVariants({ size: resolvedSize }), className),
|
|
9672
9890
|
"data-size": resolvedSize,
|
|
9673
9891
|
...props,
|
|
9674
|
-
children: /* @__PURE__ */
|
|
9892
|
+
children: /* @__PURE__ */ jsx55("ol", { className: "aviala-breadcrumb__list", children })
|
|
9675
9893
|
}
|
|
9676
9894
|
) });
|
|
9677
9895
|
}
|
|
@@ -9681,8 +9899,8 @@ var BreadcrumbItem = forwardRef38(
|
|
|
9681
9899
|
({ className, href, current = false, icon, onClick, children, ...props }, ref) => {
|
|
9682
9900
|
const size = useContext9(BreadcrumbSizeContext);
|
|
9683
9901
|
const label = /* @__PURE__ */ jsxs43(Fragment9, { children: [
|
|
9684
|
-
icon ? /* @__PURE__ */
|
|
9685
|
-
children != null ? /* @__PURE__ */
|
|
9902
|
+
icon ? /* @__PURE__ */ jsx55("span", { className: "aviala-breadcrumb-item__icon", children: icon }) : null,
|
|
9903
|
+
children != null ? /* @__PURE__ */ jsx55(
|
|
9686
9904
|
Typography,
|
|
9687
9905
|
{
|
|
9688
9906
|
level: breadcrumbTypeLevel(size),
|
|
@@ -9692,13 +9910,13 @@ var BreadcrumbItem = forwardRef38(
|
|
|
9692
9910
|
}
|
|
9693
9911
|
) : null
|
|
9694
9912
|
] });
|
|
9695
|
-
return /* @__PURE__ */
|
|
9913
|
+
return /* @__PURE__ */ jsx55(
|
|
9696
9914
|
"li",
|
|
9697
9915
|
{
|
|
9698
9916
|
ref,
|
|
9699
9917
|
className: cn("aviala-breadcrumb-item-wrap", className),
|
|
9700
9918
|
...props,
|
|
9701
|
-
children: href != null ? /* @__PURE__ */
|
|
9919
|
+
children: href != null ? /* @__PURE__ */ jsx55(
|
|
9702
9920
|
"a",
|
|
9703
9921
|
{
|
|
9704
9922
|
href,
|
|
@@ -9707,7 +9925,7 @@ var BreadcrumbItem = forwardRef38(
|
|
|
9707
9925
|
"aria-current": current ? "page" : void 0,
|
|
9708
9926
|
children: label
|
|
9709
9927
|
}
|
|
9710
|
-
) : onClick != null ? /* @__PURE__ */
|
|
9928
|
+
) : onClick != null ? /* @__PURE__ */ jsx55(
|
|
9711
9929
|
"button",
|
|
9712
9930
|
{
|
|
9713
9931
|
type: "button",
|
|
@@ -9717,7 +9935,7 @@ var BreadcrumbItem = forwardRef38(
|
|
|
9717
9935
|
onClick,
|
|
9718
9936
|
children: label
|
|
9719
9937
|
}
|
|
9720
|
-
) : /* @__PURE__ */
|
|
9938
|
+
) : /* @__PURE__ */ jsx55(
|
|
9721
9939
|
"span",
|
|
9722
9940
|
{
|
|
9723
9941
|
className: "aviala-breadcrumb-item",
|
|
@@ -9734,7 +9952,7 @@ BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
|
9734
9952
|
var BreadcrumbSeparator = forwardRef38(
|
|
9735
9953
|
({ className, children = "/", ...props }, ref) => {
|
|
9736
9954
|
const size = useContext9(BreadcrumbSizeContext);
|
|
9737
|
-
return /* @__PURE__ */
|
|
9955
|
+
return /* @__PURE__ */ jsx55(
|
|
9738
9956
|
"li",
|
|
9739
9957
|
{
|
|
9740
9958
|
ref,
|
|
@@ -9742,7 +9960,7 @@ var BreadcrumbSeparator = forwardRef38(
|
|
|
9742
9960
|
"aria-hidden": true,
|
|
9743
9961
|
className: cn("aviala-breadcrumb-separator", className),
|
|
9744
9962
|
...props,
|
|
9745
|
-
children: /* @__PURE__ */
|
|
9963
|
+
children: /* @__PURE__ */ jsx55(Typography, { level: breadcrumbTypeLevel(size), as: "span", children })
|
|
9746
9964
|
}
|
|
9747
9965
|
);
|
|
9748
9966
|
}
|
|
@@ -9758,11 +9976,11 @@ var BreadcrumbEllipsisItem = forwardRef38(
|
|
|
9758
9976
|
...props
|
|
9759
9977
|
}, ref) => {
|
|
9760
9978
|
const content = /* @__PURE__ */ jsxs43(Fragment9, { children: [
|
|
9761
|
-
/* @__PURE__ */
|
|
9762
|
-
showChevron ? /* @__PURE__ */
|
|
9979
|
+
/* @__PURE__ */ jsx55(Typography, { level: "text", as: "span", className: "aviala-breadcrumb-ellipsis-item__label", children }),
|
|
9980
|
+
showChevron ? /* @__PURE__ */ jsx55("span", { className: "aviala-breadcrumb-ellipsis-item__chevron", "aria-hidden": true, children: /* @__PURE__ */ jsx55(DirectionArrowRightLight3, { width: 14, height: 14, thickness: "Light" }) }) : null
|
|
9763
9981
|
] });
|
|
9764
9982
|
if (href != null) {
|
|
9765
|
-
return /* @__PURE__ */
|
|
9983
|
+
return /* @__PURE__ */ jsx55(
|
|
9766
9984
|
"a",
|
|
9767
9985
|
{
|
|
9768
9986
|
ref,
|
|
@@ -9774,7 +9992,7 @@ var BreadcrumbEllipsisItem = forwardRef38(
|
|
|
9774
9992
|
}
|
|
9775
9993
|
);
|
|
9776
9994
|
}
|
|
9777
|
-
return /* @__PURE__ */
|
|
9995
|
+
return /* @__PURE__ */ jsx55(
|
|
9778
9996
|
"button",
|
|
9779
9997
|
{
|
|
9780
9998
|
ref,
|
|
@@ -9801,7 +10019,7 @@ var BreadcrumbEllipsis = forwardRef38(
|
|
|
9801
10019
|
...props
|
|
9802
10020
|
}, ref) => {
|
|
9803
10021
|
const size = useContext9(BreadcrumbSizeContext);
|
|
9804
|
-
const [uncontrolledActivated, setUncontrolledActivated] =
|
|
10022
|
+
const [uncontrolledActivated, setUncontrolledActivated] = useState20(defaultActivated);
|
|
9805
10023
|
const isControlled = activatedProp !== void 0;
|
|
9806
10024
|
const activated = isControlled ? Boolean(activatedProp) : uncontrolledActivated;
|
|
9807
10025
|
const setActivated = useCallback18(
|
|
@@ -9812,8 +10030,8 @@ var BreadcrumbEllipsis = forwardRef38(
|
|
|
9812
10030
|
[isControlled, onActivatedChange]
|
|
9813
10031
|
);
|
|
9814
10032
|
const iconSize = 14;
|
|
9815
|
-
const icon = children ?? /* @__PURE__ */
|
|
9816
|
-
const trigger = /* @__PURE__ */
|
|
10033
|
+
const icon = children ?? /* @__PURE__ */ jsx55(SymbolMore, { width: iconSize, height: iconSize, thickness: "Light", "aria-hidden": true });
|
|
10034
|
+
const trigger = /* @__PURE__ */ jsx55(
|
|
9817
10035
|
"button",
|
|
9818
10036
|
{
|
|
9819
10037
|
type: "button",
|
|
@@ -9832,9 +10050,9 @@ var BreadcrumbEllipsis = forwardRef38(
|
|
|
9832
10050
|
children: icon
|
|
9833
10051
|
}
|
|
9834
10052
|
);
|
|
9835
|
-
return /* @__PURE__ */
|
|
9836
|
-
/* @__PURE__ */
|
|
9837
|
-
/* @__PURE__ */
|
|
10053
|
+
return /* @__PURE__ */ jsx55("li", { ref, className: cn("aviala-breadcrumb-ellipsis-wrap", className), children: menu != null ? /* @__PURE__ */ jsxs43(Popover, { open: activated, onOpenChange: setActivated, children: [
|
|
10054
|
+
/* @__PURE__ */ jsx55(PopoverTrigger, { asChild: true, children: trigger }),
|
|
10055
|
+
/* @__PURE__ */ jsx55(
|
|
9838
10056
|
PopoverContent,
|
|
9839
10057
|
{
|
|
9840
10058
|
className: "aviala-breadcrumb-ellipsis-menu",
|
|
@@ -9843,7 +10061,7 @@ var BreadcrumbEllipsis = forwardRef38(
|
|
|
9843
10061
|
sideOffset: 7,
|
|
9844
10062
|
showArrow: false,
|
|
9845
10063
|
role: "menu",
|
|
9846
|
-
children: /* @__PURE__ */
|
|
10064
|
+
children: /* @__PURE__ */ jsx55("div", { className: "aviala-breadcrumb-ellipsis-menu__items", children: menu })
|
|
9847
10065
|
}
|
|
9848
10066
|
)
|
|
9849
10067
|
] }) : trigger });
|
|
@@ -9855,7 +10073,7 @@ BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis";
|
|
|
9855
10073
|
import {
|
|
9856
10074
|
forwardRef as forwardRef39
|
|
9857
10075
|
} from "react";
|
|
9858
|
-
import { jsx as
|
|
10076
|
+
import { jsx as jsx56, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
9859
10077
|
var Pagehead = forwardRef39(
|
|
9860
10078
|
({
|
|
9861
10079
|
className,
|
|
@@ -9868,21 +10086,21 @@ var Pagehead = forwardRef39(
|
|
|
9868
10086
|
...props
|
|
9869
10087
|
}, ref) => /* @__PURE__ */ jsxs44("header", { ref, className: cn("aviala-pagehead", className), ...props, children: [
|
|
9870
10088
|
/* @__PURE__ */ jsxs44("div", { className: "aviala-pagehead__main", children: [
|
|
9871
|
-
back != null ? /* @__PURE__ */
|
|
10089
|
+
back != null ? /* @__PURE__ */ jsx56("div", { className: "aviala-pagehead__back", children: back }) : null,
|
|
9872
10090
|
/* @__PURE__ */ jsxs44("div", { className: "aviala-pagehead__title-block", children: [
|
|
9873
|
-
breadcrumb != null ? /* @__PURE__ */
|
|
9874
|
-
title != null || description != null ? /* @__PURE__ */
|
|
10091
|
+
breadcrumb != null ? /* @__PURE__ */ jsx56("div", { className: "aviala-pagehead__breadcrumb", children: breadcrumb }) : null,
|
|
10092
|
+
title != null || description != null ? /* @__PURE__ */ jsx56("div", { className: "aviala-pagehead__title", children: /* @__PURE__ */ jsx56(Typeface, { content: "textCaption", primary: title, secondary: description }) }) : null,
|
|
9875
10093
|
children
|
|
9876
10094
|
] })
|
|
9877
10095
|
] }),
|
|
9878
|
-
actions != null ? /* @__PURE__ */
|
|
10096
|
+
actions != null ? /* @__PURE__ */ jsx56("div", { className: "aviala-pagehead__actions", children: actions }) : null
|
|
9879
10097
|
] })
|
|
9880
10098
|
);
|
|
9881
10099
|
Pagehead.displayName = "Pagehead";
|
|
9882
10100
|
|
|
9883
10101
|
// src/components/steps.tsx
|
|
9884
10102
|
import {
|
|
9885
|
-
SymbolRight as
|
|
10103
|
+
SymbolRight as SymbolRight3,
|
|
9886
10104
|
SymbolWarning,
|
|
9887
10105
|
SymbolWrong as SymbolWrong5
|
|
9888
10106
|
} from "@aviala-design/icons";
|
|
@@ -9890,7 +10108,7 @@ import { cva as cva16 } from "class-variance-authority";
|
|
|
9890
10108
|
import {
|
|
9891
10109
|
forwardRef as forwardRef40
|
|
9892
10110
|
} from "react";
|
|
9893
|
-
import { jsx as
|
|
10111
|
+
import { jsx as jsx57, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
9894
10112
|
var stepsVariants = cva16("aviala-steps", {
|
|
9895
10113
|
variants: {
|
|
9896
10114
|
direction: {
|
|
@@ -9903,7 +10121,7 @@ var stepsVariants = cva16("aviala-steps", {
|
|
|
9903
10121
|
}
|
|
9904
10122
|
});
|
|
9905
10123
|
var Steps = forwardRef40(
|
|
9906
|
-
({ className, direction = "horizontal", children, ...props }, ref) => /* @__PURE__ */
|
|
10124
|
+
({ className, direction = "horizontal", children, ...props }, ref) => /* @__PURE__ */ jsx57(
|
|
9907
10125
|
"div",
|
|
9908
10126
|
{
|
|
9909
10127
|
ref,
|
|
@@ -9918,20 +10136,20 @@ Steps.displayName = "Steps";
|
|
|
9918
10136
|
function defaultStepsIconContent(state, index) {
|
|
9919
10137
|
switch (state) {
|
|
9920
10138
|
case "done":
|
|
9921
|
-
return /* @__PURE__ */
|
|
10139
|
+
return /* @__PURE__ */ jsx57(SymbolRight3, { width: 12, height: 12, thickness: "Bold", "aria-hidden": true });
|
|
9922
10140
|
case "fail":
|
|
9923
|
-
return /* @__PURE__ */
|
|
10141
|
+
return /* @__PURE__ */ jsx57(SymbolWrong5, { width: 12, height: 12, thickness: "Bold", "aria-hidden": true });
|
|
9924
10142
|
case "warning":
|
|
9925
|
-
return /* @__PURE__ */
|
|
10143
|
+
return /* @__PURE__ */ jsx57(SymbolWarning, { width: 12, height: 12, thickness: "Bold", "aria-hidden": true });
|
|
9926
10144
|
case "waiting":
|
|
9927
10145
|
case "inProgress":
|
|
9928
10146
|
case "default":
|
|
9929
10147
|
default:
|
|
9930
|
-
return index != null ? /* @__PURE__ */
|
|
10148
|
+
return index != null ? /* @__PURE__ */ jsx57(Typography, { level: "caption", as: "span", className: "aviala-steps-icon__index", children: index }) : null;
|
|
9931
10149
|
}
|
|
9932
10150
|
}
|
|
9933
10151
|
var StepsIcon = forwardRef40(
|
|
9934
|
-
({ className, state = "default", index, children, ...props }, ref) => /* @__PURE__ */
|
|
10152
|
+
({ className, state = "default", index, children, ...props }, ref) => /* @__PURE__ */ jsx57(
|
|
9935
10153
|
"span",
|
|
9936
10154
|
{
|
|
9937
10155
|
ref,
|
|
@@ -9961,9 +10179,9 @@ var StepsItem = forwardRef40(
|
|
|
9961
10179
|
"data-state": state,
|
|
9962
10180
|
...props,
|
|
9963
10181
|
children: [
|
|
9964
|
-
icon ?? /* @__PURE__ */
|
|
10182
|
+
icon ?? /* @__PURE__ */ jsx57(StepsIcon, { state, index }),
|
|
9965
10183
|
/* @__PURE__ */ jsxs45("div", { className: "aviala-steps-item__body", children: [
|
|
9966
|
-
title != null ? /* @__PURE__ */
|
|
10184
|
+
title != null ? /* @__PURE__ */ jsx57(
|
|
9967
10185
|
Typography,
|
|
9968
10186
|
{
|
|
9969
10187
|
level: "subtitle",
|
|
@@ -9972,7 +10190,7 @@ var StepsItem = forwardRef40(
|
|
|
9972
10190
|
children: title
|
|
9973
10191
|
}
|
|
9974
10192
|
) : null,
|
|
9975
|
-
description != null ? /* @__PURE__ */
|
|
10193
|
+
description != null ? /* @__PURE__ */ jsx57(
|
|
9976
10194
|
Typography,
|
|
9977
10195
|
{
|
|
9978
10196
|
level: "text",
|
|
@@ -9996,9 +10214,9 @@ import {
|
|
|
9996
10214
|
} from "@aviala-design/icons";
|
|
9997
10215
|
import {
|
|
9998
10216
|
forwardRef as forwardRef41,
|
|
9999
|
-
useState as
|
|
10217
|
+
useState as useState21
|
|
10000
10218
|
} from "react";
|
|
10001
|
-
import { jsx as
|
|
10219
|
+
import { jsx as jsx58, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
10002
10220
|
function buildPageList(page, pageCount) {
|
|
10003
10221
|
if (pageCount <= 7) {
|
|
10004
10222
|
return Array.from({ length: pageCount }, (_, index) => index + 1);
|
|
@@ -10049,10 +10267,10 @@ var Pagination = forwardRef41(
|
|
|
10049
10267
|
sizeOptionLabel = (size) => `${size} \u9879`,
|
|
10050
10268
|
...props
|
|
10051
10269
|
}, ref) => {
|
|
10052
|
-
const [uncontrolledPage, setUncontrolledPage] =
|
|
10053
|
-
const [uncontrolledPageSize, setUncontrolledPageSize] =
|
|
10054
|
-
const [jumpValue, setJumpValue] =
|
|
10055
|
-
const [openEllipsis, setOpenEllipsis] =
|
|
10270
|
+
const [uncontrolledPage, setUncontrolledPage] = useState21(defaultPage);
|
|
10271
|
+
const [uncontrolledPageSize, setUncontrolledPageSize] = useState21(defaultPageSize);
|
|
10272
|
+
const [jumpValue, setJumpValue] = useState21("");
|
|
10273
|
+
const [openEllipsis, setOpenEllipsis] = useState21(null);
|
|
10056
10274
|
const page = pageProp ?? uncontrolledPage;
|
|
10057
10275
|
const pageSize = pageSizeProp ?? uncontrolledPageSize;
|
|
10058
10276
|
const safePageCount = Math.max(1, pageCount);
|
|
@@ -10083,7 +10301,7 @@ var Pagination = forwardRef41(
|
|
|
10083
10301
|
...props,
|
|
10084
10302
|
children: [
|
|
10085
10303
|
/* @__PURE__ */ jsxs46("div", { className: "aviala-pagination__controls", children: [
|
|
10086
|
-
/* @__PURE__ */
|
|
10304
|
+
/* @__PURE__ */ jsx58(
|
|
10087
10305
|
Button,
|
|
10088
10306
|
{
|
|
10089
10307
|
mode: "noBackgroundCustom",
|
|
@@ -10091,18 +10309,18 @@ var Pagination = forwardRef41(
|
|
|
10091
10309
|
iconOnly: true,
|
|
10092
10310
|
"aria-label": "Previous page",
|
|
10093
10311
|
disabled: currentPage <= 1,
|
|
10094
|
-
leftIcon: /* @__PURE__ */
|
|
10312
|
+
leftIcon: /* @__PURE__ */ jsx58(DirectionArrowLeftLight, { "aria-hidden": true }),
|
|
10095
10313
|
onClick: () => setPage(currentPage - 1)
|
|
10096
10314
|
}
|
|
10097
10315
|
),
|
|
10098
|
-
/* @__PURE__ */
|
|
10316
|
+
/* @__PURE__ */ jsx58("div", { className: "aviala-pagination__pages", children: pages.map(
|
|
10099
10317
|
(item, index) => item === "ellipsis" ? /* @__PURE__ */ jsxs46(
|
|
10100
10318
|
Popover,
|
|
10101
10319
|
{
|
|
10102
10320
|
open: openEllipsis === index,
|
|
10103
10321
|
onOpenChange: (open) => setOpenEllipsis(open ? index : null),
|
|
10104
10322
|
children: [
|
|
10105
|
-
/* @__PURE__ */
|
|
10323
|
+
/* @__PURE__ */ jsx58(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx58(
|
|
10106
10324
|
"button",
|
|
10107
10325
|
{
|
|
10108
10326
|
type: "button",
|
|
@@ -10113,10 +10331,10 @@ var Pagination = forwardRef41(
|
|
|
10113
10331
|
),
|
|
10114
10332
|
"aria-label": "\u66F4\u591A\u9875\u7801",
|
|
10115
10333
|
"aria-haspopup": "menu",
|
|
10116
|
-
children: /* @__PURE__ */
|
|
10334
|
+
children: /* @__PURE__ */ jsx58(Typography, { level: "text", as: "span", children: "\u2026" })
|
|
10117
10335
|
}
|
|
10118
10336
|
) }),
|
|
10119
|
-
/* @__PURE__ */
|
|
10337
|
+
/* @__PURE__ */ jsx58(PopoverContent, { className: "aviala-pagination__ellipsis-content", showArrow: true, flush: true, children: /* @__PURE__ */ jsx58("div", { className: "aviala-pagination__ellipsis-menu", children: ellipsisRange(pages, index).map((p) => /* @__PURE__ */ jsx58(
|
|
10120
10338
|
"button",
|
|
10121
10339
|
{
|
|
10122
10340
|
type: "button",
|
|
@@ -10129,14 +10347,14 @@ var Pagination = forwardRef41(
|
|
|
10129
10347
|
setPage(p);
|
|
10130
10348
|
setOpenEllipsis(null);
|
|
10131
10349
|
},
|
|
10132
|
-
children: /* @__PURE__ */
|
|
10350
|
+
children: /* @__PURE__ */ jsx58(Typography, { level: "text", as: "span", children: p })
|
|
10133
10351
|
},
|
|
10134
10352
|
p
|
|
10135
10353
|
)) }) })
|
|
10136
10354
|
]
|
|
10137
10355
|
},
|
|
10138
10356
|
`ellipsis-${index}`
|
|
10139
|
-
) : /* @__PURE__ */
|
|
10357
|
+
) : /* @__PURE__ */ jsx58(
|
|
10140
10358
|
"button",
|
|
10141
10359
|
{
|
|
10142
10360
|
type: "button",
|
|
@@ -10148,12 +10366,12 @@ var Pagination = forwardRef41(
|
|
|
10148
10366
|
"data-active": item === currentPage ? "true" : void 0,
|
|
10149
10367
|
"aria-current": item === currentPage ? "page" : void 0,
|
|
10150
10368
|
onClick: () => setPage(item),
|
|
10151
|
-
children: /* @__PURE__ */
|
|
10369
|
+
children: /* @__PURE__ */ jsx58(Typography, { level: "text", as: "span", children: item })
|
|
10152
10370
|
},
|
|
10153
10371
|
item
|
|
10154
10372
|
)
|
|
10155
10373
|
) }),
|
|
10156
|
-
/* @__PURE__ */
|
|
10374
|
+
/* @__PURE__ */ jsx58(
|
|
10157
10375
|
Button,
|
|
10158
10376
|
{
|
|
10159
10377
|
mode: "noBackgroundCustom",
|
|
@@ -10161,14 +10379,14 @@ var Pagination = forwardRef41(
|
|
|
10161
10379
|
iconOnly: true,
|
|
10162
10380
|
"aria-label": "Next page",
|
|
10163
10381
|
disabled: currentPage >= safePageCount,
|
|
10164
|
-
leftIcon: /* @__PURE__ */
|
|
10382
|
+
leftIcon: /* @__PURE__ */ jsx58(DirectionArrowRightLight4, { "aria-hidden": true }),
|
|
10165
10383
|
onClick: () => setPage(currentPage + 1)
|
|
10166
10384
|
}
|
|
10167
10385
|
)
|
|
10168
10386
|
] }),
|
|
10169
10387
|
showJump ? /* @__PURE__ */ jsxs46("div", { className: "aviala-pagination__jump", children: [
|
|
10170
|
-
/* @__PURE__ */
|
|
10171
|
-
/* @__PURE__ */
|
|
10388
|
+
/* @__PURE__ */ jsx58(Typography, { level: "text", as: "span", children: jumpLabel }),
|
|
10389
|
+
/* @__PURE__ */ jsx58(
|
|
10172
10390
|
Input,
|
|
10173
10391
|
{
|
|
10174
10392
|
className: "aviala-pagination__jump-input",
|
|
@@ -10189,14 +10407,14 @@ var Pagination = forwardRef41(
|
|
|
10189
10407
|
)
|
|
10190
10408
|
] }) : null,
|
|
10191
10409
|
showSizeChanger ? /* @__PURE__ */ jsxs46("div", { className: "aviala-pagination__size", children: [
|
|
10192
|
-
/* @__PURE__ */
|
|
10410
|
+
/* @__PURE__ */ jsx58(Typography, { level: "text", as: "span", children: sizeLabel }),
|
|
10193
10411
|
/* @__PURE__ */ jsxs46(
|
|
10194
10412
|
Select,
|
|
10195
10413
|
{
|
|
10196
10414
|
value: String(pageSize),
|
|
10197
10415
|
onValueChange: (value) => setPageSize(Number(value)),
|
|
10198
10416
|
children: [
|
|
10199
|
-
/* @__PURE__ */
|
|
10417
|
+
/* @__PURE__ */ jsx58(
|
|
10200
10418
|
SelectTrigger,
|
|
10201
10419
|
{
|
|
10202
10420
|
size: "regular",
|
|
@@ -10204,7 +10422,7 @@ var Pagination = forwardRef41(
|
|
|
10204
10422
|
"aria-label": "Page size"
|
|
10205
10423
|
}
|
|
10206
10424
|
),
|
|
10207
|
-
/* @__PURE__ */
|
|
10425
|
+
/* @__PURE__ */ jsx58(SelectContent, { children: /* @__PURE__ */ jsx58(SelectItemGroup, { children: pageSizeOptions.map((option) => /* @__PURE__ */ jsx58(
|
|
10208
10426
|
SelectItem,
|
|
10209
10427
|
{
|
|
10210
10428
|
value: String(option),
|
|
@@ -10234,9 +10452,9 @@ import {
|
|
|
10234
10452
|
forwardRef as forwardRef42,
|
|
10235
10453
|
isValidElement as isValidElement17
|
|
10236
10454
|
} from "react";
|
|
10237
|
-
import { Fragment as Fragment10, jsx as
|
|
10455
|
+
import { Fragment as Fragment10, jsx as jsx59, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
10238
10456
|
var Card = forwardRef42(
|
|
10239
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
10457
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx59("div", { ref, className: cn("aviala-card", className), ...props, children })
|
|
10240
10458
|
);
|
|
10241
10459
|
Card.displayName = "Card";
|
|
10242
10460
|
function renderCardIcon(node) {
|
|
@@ -10249,7 +10467,7 @@ function renderCardIcon(node) {
|
|
|
10249
10467
|
"shrink-0"
|
|
10250
10468
|
)
|
|
10251
10469
|
}) : node;
|
|
10252
|
-
return /* @__PURE__ */
|
|
10470
|
+
return /* @__PURE__ */ jsx59("span", { className: "aviala-card-head__icon", children: content });
|
|
10253
10471
|
}
|
|
10254
10472
|
var CardHead = forwardRef42(
|
|
10255
10473
|
({
|
|
@@ -10267,35 +10485,35 @@ var CardHead = forwardRef42(
|
|
|
10267
10485
|
children,
|
|
10268
10486
|
...props
|
|
10269
10487
|
}, ref) => {
|
|
10270
|
-
const primaryAction = action ?? /* @__PURE__ */
|
|
10488
|
+
const primaryAction = action ?? /* @__PURE__ */ jsx59(Button, { mode: "primary", size: "regular", leftIcon: /* @__PURE__ */ jsx59(GeneralSetting2, { "aria-hidden": true }), children: actionLabel });
|
|
10271
10489
|
const renderTrailing = () => {
|
|
10272
10490
|
if (trailing !== void 0) return trailing;
|
|
10273
10491
|
switch (slotType) {
|
|
10274
10492
|
case "action":
|
|
10275
10493
|
return /* @__PURE__ */ jsxs47("div", { className: "aviala-card-head__trailing", children: [
|
|
10276
10494
|
primaryAction,
|
|
10277
|
-
secondaryAction ?? /* @__PURE__ */
|
|
10495
|
+
secondaryAction ?? /* @__PURE__ */ jsx59(
|
|
10278
10496
|
Button,
|
|
10279
10497
|
{
|
|
10280
10498
|
mode: "default",
|
|
10281
10499
|
size: "regular",
|
|
10282
10500
|
iconOnly: true,
|
|
10283
10501
|
"aria-label": "More",
|
|
10284
|
-
leftIcon: /* @__PURE__ */
|
|
10502
|
+
leftIcon: /* @__PURE__ */ jsx59(GeneralSetting2, { "aria-hidden": true })
|
|
10285
10503
|
}
|
|
10286
10504
|
),
|
|
10287
|
-
/* @__PURE__ */
|
|
10288
|
-
/* @__PURE__ */
|
|
10505
|
+
/* @__PURE__ */ jsx59("span", { className: "aviala-card__divider", "aria-hidden": true }),
|
|
10506
|
+
/* @__PURE__ */ jsx59(DirectionArrowRightLight5, { width: 14, height: 14, "aria-hidden": true })
|
|
10289
10507
|
] });
|
|
10290
10508
|
case "switch":
|
|
10291
10509
|
return /* @__PURE__ */ jsxs47("div", { className: "aviala-card-head__trailing", children: [
|
|
10292
10510
|
primaryAction,
|
|
10293
|
-
/* @__PURE__ */
|
|
10294
|
-
/* @__PURE__ */
|
|
10511
|
+
/* @__PURE__ */ jsx59("span", { className: "aviala-card__divider", "aria-hidden": true }),
|
|
10512
|
+
/* @__PURE__ */ jsx59(Switch, { ...switchProps })
|
|
10295
10513
|
] });
|
|
10296
10514
|
case "select":
|
|
10297
10515
|
default:
|
|
10298
|
-
return select != null ? /* @__PURE__ */
|
|
10516
|
+
return select != null ? /* @__PURE__ */ jsx59("div", { className: "aviala-card-head__trailing", children: select }) : null;
|
|
10299
10517
|
}
|
|
10300
10518
|
};
|
|
10301
10519
|
return /* @__PURE__ */ jsxs47(
|
|
@@ -10307,8 +10525,8 @@ var CardHead = forwardRef42(
|
|
|
10307
10525
|
...props,
|
|
10308
10526
|
children: [
|
|
10309
10527
|
/* @__PURE__ */ jsxs47("div", { className: "aviala-card-head__main", children: [
|
|
10310
|
-
renderCardIcon(icon ?? /* @__PURE__ */
|
|
10311
|
-
/* @__PURE__ */
|
|
10528
|
+
renderCardIcon(icon ?? /* @__PURE__ */ jsx59(GeneralSetting2, { "aria-hidden": true })),
|
|
10529
|
+
/* @__PURE__ */ jsx59("div", { className: "aviala-card-head__title", children: title != null || description != null ? /* @__PURE__ */ jsx59(Typeface, { content: "textCaption", primary: title, secondary: description }) : children })
|
|
10312
10530
|
] }),
|
|
10313
10531
|
renderTrailing()
|
|
10314
10532
|
]
|
|
@@ -10318,7 +10536,7 @@ var CardHead = forwardRef42(
|
|
|
10318
10536
|
);
|
|
10319
10537
|
CardHead.displayName = "CardHead";
|
|
10320
10538
|
var CardBody = forwardRef42(
|
|
10321
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
10539
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx59("div", { ref, className: cn("aviala-card-body", className), ...props, children: /* @__PURE__ */ jsx59("div", { className: "aviala-card-body__content", children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsx59(Typography, { level: "text", as: "span", children }) : children }) })
|
|
10322
10540
|
);
|
|
10323
10541
|
CardBody.displayName = "CardBody";
|
|
10324
10542
|
var CardBottom = forwardRef42(
|
|
@@ -10334,7 +10552,7 @@ var CardBottom = forwardRef42(
|
|
|
10334
10552
|
children,
|
|
10335
10553
|
...props
|
|
10336
10554
|
}, ref) => {
|
|
10337
|
-
const primaryAction = action ?? /* @__PURE__ */
|
|
10555
|
+
const primaryAction = action ?? /* @__PURE__ */ jsx59(Button, { mode: "primary", size: "regular", leftIcon: /* @__PURE__ */ jsx59(GeneralSetting2, { "aria-hidden": true }), children: actionLabel });
|
|
10338
10556
|
const renderTrailing = () => {
|
|
10339
10557
|
if (trailing !== void 0) return trailing;
|
|
10340
10558
|
if (children != null) return children;
|
|
@@ -10342,8 +10560,8 @@ var CardBottom = forwardRef42(
|
|
|
10342
10560
|
case "switch":
|
|
10343
10561
|
return /* @__PURE__ */ jsxs47(Fragment10, { children: [
|
|
10344
10562
|
primaryAction,
|
|
10345
|
-
/* @__PURE__ */
|
|
10346
|
-
/* @__PURE__ */
|
|
10563
|
+
/* @__PURE__ */ jsx59("span", { className: "aviala-card__divider", "aria-hidden": true }),
|
|
10564
|
+
/* @__PURE__ */ jsx59(Switch, { ...switchProps })
|
|
10347
10565
|
] });
|
|
10348
10566
|
case "select":
|
|
10349
10567
|
return select;
|
|
@@ -10351,29 +10569,29 @@ var CardBottom = forwardRef42(
|
|
|
10351
10569
|
default:
|
|
10352
10570
|
return /* @__PURE__ */ jsxs47(Fragment10, { children: [
|
|
10353
10571
|
primaryAction,
|
|
10354
|
-
secondaryAction ?? /* @__PURE__ */
|
|
10572
|
+
secondaryAction ?? /* @__PURE__ */ jsx59(
|
|
10355
10573
|
Button,
|
|
10356
10574
|
{
|
|
10357
10575
|
mode: "default",
|
|
10358
10576
|
size: "regular",
|
|
10359
10577
|
iconOnly: true,
|
|
10360
10578
|
"aria-label": "More",
|
|
10361
|
-
leftIcon: /* @__PURE__ */
|
|
10579
|
+
leftIcon: /* @__PURE__ */ jsx59(GeneralSetting2, { "aria-hidden": true })
|
|
10362
10580
|
}
|
|
10363
10581
|
),
|
|
10364
|
-
/* @__PURE__ */
|
|
10365
|
-
/* @__PURE__ */
|
|
10582
|
+
/* @__PURE__ */ jsx59("span", { className: "aviala-card__divider", "aria-hidden": true }),
|
|
10583
|
+
/* @__PURE__ */ jsx59(DirectionArrowRightLight5, { width: 14, height: 14, "aria-hidden": true })
|
|
10366
10584
|
] });
|
|
10367
10585
|
}
|
|
10368
10586
|
};
|
|
10369
|
-
return /* @__PURE__ */
|
|
10587
|
+
return /* @__PURE__ */ jsx59(
|
|
10370
10588
|
"div",
|
|
10371
10589
|
{
|
|
10372
10590
|
ref,
|
|
10373
10591
|
className: cn("aviala-card-bottom", className),
|
|
10374
10592
|
"data-type": slotType,
|
|
10375
10593
|
...props,
|
|
10376
|
-
children: /* @__PURE__ */
|
|
10594
|
+
children: /* @__PURE__ */ jsx59("div", { className: "aviala-card-bottom__trailing", children: renderTrailing() })
|
|
10377
10595
|
}
|
|
10378
10596
|
);
|
|
10379
10597
|
}
|
|
@@ -10386,9 +10604,9 @@ import {
|
|
|
10386
10604
|
forwardRef as forwardRef43,
|
|
10387
10605
|
isValidElement as isValidElement18
|
|
10388
10606
|
} from "react";
|
|
10389
|
-
import { Fragment as Fragment11, jsx as
|
|
10607
|
+
import { Fragment as Fragment11, jsx as jsx60, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
10390
10608
|
var Table = forwardRef43(
|
|
10391
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
10609
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx60(
|
|
10392
10610
|
"div",
|
|
10393
10611
|
{
|
|
10394
10612
|
ref,
|
|
@@ -10401,7 +10619,7 @@ var Table = forwardRef43(
|
|
|
10401
10619
|
);
|
|
10402
10620
|
Table.displayName = "Table";
|
|
10403
10621
|
var TableRow = forwardRef43(
|
|
10404
|
-
({ className, header = false, children, ...props }, ref) => /* @__PURE__ */
|
|
10622
|
+
({ className, header = false, children, ...props }, ref) => /* @__PURE__ */ jsx60(
|
|
10405
10623
|
"div",
|
|
10406
10624
|
{
|
|
10407
10625
|
ref,
|
|
@@ -10415,7 +10633,7 @@ var TableRow = forwardRef43(
|
|
|
10415
10633
|
);
|
|
10416
10634
|
TableRow.displayName = "TableRow";
|
|
10417
10635
|
var TableHead = forwardRef43(
|
|
10418
|
-
({ className, content = "text", children, ...props }, ref) => /* @__PURE__ */
|
|
10636
|
+
({ className, content = "text", children, ...props }, ref) => /* @__PURE__ */ jsx60(
|
|
10419
10637
|
"div",
|
|
10420
10638
|
{
|
|
10421
10639
|
ref,
|
|
@@ -10423,7 +10641,7 @@ var TableHead = forwardRef43(
|
|
|
10423
10641
|
className: cn("aviala-table-head", className),
|
|
10424
10642
|
"data-content": content,
|
|
10425
10643
|
...props,
|
|
10426
|
-
children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */
|
|
10644
|
+
children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsx60(Typography, { level: "caption", as: "span", children }) : children
|
|
10427
10645
|
}
|
|
10428
10646
|
)
|
|
10429
10647
|
);
|
|
@@ -10438,7 +10656,7 @@ function renderCellIcon(node) {
|
|
|
10438
10656
|
"shrink-0"
|
|
10439
10657
|
)
|
|
10440
10658
|
}) : node;
|
|
10441
|
-
return /* @__PURE__ */
|
|
10659
|
+
return /* @__PURE__ */ jsx60("span", { className: "aviala-table-cell__icon", children: content });
|
|
10442
10660
|
}
|
|
10443
10661
|
var TableCell = forwardRef43(
|
|
10444
10662
|
({
|
|
@@ -10459,29 +10677,29 @@ var TableCell = forwardRef43(
|
|
|
10459
10677
|
if (children != null) return children;
|
|
10460
10678
|
switch (content) {
|
|
10461
10679
|
case "checkbox":
|
|
10462
|
-
return /* @__PURE__ */
|
|
10680
|
+
return /* @__PURE__ */ jsx60(Checkbox, { ...checkboxProps });
|
|
10463
10681
|
case "icon+text":
|
|
10464
10682
|
return /* @__PURE__ */ jsxs48(Fragment11, { children: [
|
|
10465
10683
|
renderCellIcon(icon),
|
|
10466
|
-
/* @__PURE__ */
|
|
10684
|
+
/* @__PURE__ */ jsx60("span", { className: "aviala-table-cell__text", children: /* @__PURE__ */ jsx60(Typography, { level: "text", as: "span", children: text }) })
|
|
10467
10685
|
] });
|
|
10468
10686
|
case "people":
|
|
10469
10687
|
return /* @__PURE__ */ jsxs48(Fragment11, { children: [
|
|
10470
|
-
people ?? /* @__PURE__ */
|
|
10471
|
-
/* @__PURE__ */
|
|
10688
|
+
people ?? /* @__PURE__ */ jsx60(Avatar, { content: "text", level: "text", children: "A" }),
|
|
10689
|
+
/* @__PURE__ */ jsx60("span", { className: "aviala-table-cell__text", children: /* @__PURE__ */ jsx60(Typography, { level: "text", as: "span", children: text }) })
|
|
10472
10690
|
] });
|
|
10473
10691
|
case "badge":
|
|
10474
|
-
return badge ?? /* @__PURE__ */
|
|
10692
|
+
return badge ?? /* @__PURE__ */ jsx60(Badge, { style: "theme", level: "caption", children: badgeLabel ?? "Text" });
|
|
10475
10693
|
case "switch":
|
|
10476
|
-
return /* @__PURE__ */
|
|
10694
|
+
return /* @__PURE__ */ jsx60(Switch, { ...switchProps });
|
|
10477
10695
|
case "action":
|
|
10478
|
-
return /* @__PURE__ */
|
|
10696
|
+
return /* @__PURE__ */ jsx60("div", { className: "aviala-table-cell__actions", children: actions });
|
|
10479
10697
|
case "text":
|
|
10480
10698
|
default:
|
|
10481
|
-
return /* @__PURE__ */
|
|
10699
|
+
return /* @__PURE__ */ jsx60("span", { className: "aviala-table-cell__text", children: /* @__PURE__ */ jsx60(Typography, { level: "text", as: "span", children: text }) });
|
|
10482
10700
|
}
|
|
10483
10701
|
};
|
|
10484
|
-
return /* @__PURE__ */
|
|
10702
|
+
return /* @__PURE__ */ jsx60(
|
|
10485
10703
|
"div",
|
|
10486
10704
|
{
|
|
10487
10705
|
ref,
|