@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.cjs
CHANGED
|
@@ -2863,7 +2863,6 @@ Scroll.displayName = "Scroll";
|
|
|
2863
2863
|
|
|
2864
2864
|
// src/components/checkbox.tsx
|
|
2865
2865
|
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"), 1);
|
|
2866
|
-
var import_icons8 = require("@aviala-design/icons");
|
|
2867
2866
|
var import_react19 = require("react");
|
|
2868
2867
|
|
|
2869
2868
|
// src/components/typeface.tsx
|
|
@@ -2947,42 +2946,71 @@ var TypefacePair = (0, import_react18.forwardRef)(
|
|
|
2947
2946
|
);
|
|
2948
2947
|
TypefacePair.displayName = "TypefacePair";
|
|
2949
2948
|
|
|
2950
|
-
// src/components/checkbox.tsx
|
|
2949
|
+
// src/components/checkbox-check-icon.tsx
|
|
2951
2950
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
));
|
|
2951
|
+
function CheckboxCheckIcon({ className, ...props }) {
|
|
2952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2953
|
+
"svg",
|
|
2954
|
+
{
|
|
2955
|
+
className: cn("aviala-checkbox__check-icon", className),
|
|
2956
|
+
viewBox: "0 0 12 12",
|
|
2957
|
+
fill: "none",
|
|
2958
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2959
|
+
"aria-hidden": true,
|
|
2960
|
+
overflow: "visible",
|
|
2961
|
+
...props,
|
|
2962
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2963
|
+
"path",
|
|
2964
|
+
{
|
|
2965
|
+
className: "aviala-checkbox__check-path",
|
|
2966
|
+
transform: "translate(1 1.6)",
|
|
2967
|
+
d: "M0 3.9L3.4974 8.35503C3.83947 8.79075 4.51016 8.75534 4.80444 8.28602L10 0",
|
|
2968
|
+
pathLength: 1,
|
|
2969
|
+
stroke: "currentColor",
|
|
2970
|
+
strokeLinecap: "round",
|
|
2971
|
+
vectorEffect: "non-scaling-stroke"
|
|
2972
|
+
}
|
|
2973
|
+
)
|
|
2974
|
+
}
|
|
2975
|
+
);
|
|
2976
|
+
}
|
|
2977
|
+
|
|
2978
|
+
// src/components/checkbox.tsx
|
|
2979
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2980
|
+
var Checkbox = (0, import_react19.forwardRef)(({ className, round = false, size = "default", ...props }, ref) => {
|
|
2981
|
+
const [motionReady, setMotionReady] = (0, import_react19.useState)(false);
|
|
2982
|
+
(0, import_react19.useEffect)(() => {
|
|
2983
|
+
const id = requestAnimationFrame(() => setMotionReady(true));
|
|
2984
|
+
return () => cancelAnimationFrame(id);
|
|
2985
|
+
}, []);
|
|
2986
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2987
|
+
CheckboxPrimitive.Root,
|
|
2988
|
+
{
|
|
2989
|
+
ref,
|
|
2990
|
+
className: cn("aviala-checkbox aviala-focus-ring", className),
|
|
2991
|
+
"data-round": round ? "true" : void 0,
|
|
2992
|
+
"data-size": size,
|
|
2993
|
+
"data-motion": motionReady ? "ready" : "boot",
|
|
2994
|
+
...props,
|
|
2995
|
+
children: [
|
|
2996
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { "aria-hidden": true, className: "aviala-checkbox__surface" }),
|
|
2997
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(CheckboxPrimitive.Indicator, { forceMount: true, className: "aviala-checkbox__indicator", children: [
|
|
2998
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CheckboxCheckIcon, { className: "aviala-checkbox__indicator-icon aviala-checkbox__indicator-icon--check" }),
|
|
2999
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3000
|
+
"span",
|
|
3001
|
+
{
|
|
3002
|
+
"aria-hidden": true,
|
|
3003
|
+
className: "aviala-checkbox__indeterminate-mark aviala-checkbox__indicator-icon--indeterminate"
|
|
3004
|
+
}
|
|
3005
|
+
)
|
|
3006
|
+
] })
|
|
3007
|
+
]
|
|
3008
|
+
}
|
|
3009
|
+
);
|
|
3010
|
+
});
|
|
2983
3011
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
2984
3012
|
var CheckboxGroup = (0, import_react19.forwardRef)(
|
|
2985
|
-
({ className, direction = "vertical", ...props }, ref) => /* @__PURE__ */ (0,
|
|
3013
|
+
({ className, direction = "vertical", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2986
3014
|
"div",
|
|
2987
3015
|
{
|
|
2988
3016
|
ref,
|
|
@@ -3004,7 +3032,7 @@ function renderIcon3(node) {
|
|
|
3004
3032
|
"shrink-0"
|
|
3005
3033
|
)
|
|
3006
3034
|
}) : node;
|
|
3007
|
-
return /* @__PURE__ */ (0,
|
|
3035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "aviala-checkbox-input__icon", children: content });
|
|
3008
3036
|
}
|
|
3009
3037
|
var CheckboxInput = (0, import_react19.forwardRef)(
|
|
3010
3038
|
({
|
|
@@ -3015,16 +3043,16 @@ var CheckboxInput = (0, import_react19.forwardRef)(
|
|
|
3015
3043
|
disabled,
|
|
3016
3044
|
id,
|
|
3017
3045
|
...props
|
|
3018
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
3046
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
3019
3047
|
"label",
|
|
3020
3048
|
{
|
|
3021
3049
|
htmlFor: id,
|
|
3022
3050
|
className: cn("aviala-checkbox-input", className),
|
|
3023
3051
|
"data-disabled": disabled ? "true" : void 0,
|
|
3024
3052
|
children: [
|
|
3025
|
-
/* @__PURE__ */ (0,
|
|
3053
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Checkbox, { ref, id, disabled, ...props }),
|
|
3026
3054
|
renderIcon3(icon),
|
|
3027
|
-
/* @__PURE__ */ (0,
|
|
3055
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3028
3056
|
TypefacePair,
|
|
3029
3057
|
{
|
|
3030
3058
|
className: "aviala-checkbox-input__content min-w-0 flex-1",
|
|
@@ -3041,8 +3069,8 @@ CheckboxInput.displayName = "CheckboxInput";
|
|
|
3041
3069
|
// src/components/radio-group.tsx
|
|
3042
3070
|
var RadioGroupPrimitive = __toESM(require("@radix-ui/react-radio-group"), 1);
|
|
3043
3071
|
var import_react20 = require("react");
|
|
3044
|
-
var
|
|
3045
|
-
var RadioGroup = (0, import_react20.forwardRef)(({ className, direction = "vertical", ...props }, ref) => /* @__PURE__ */ (0,
|
|
3072
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3073
|
+
var RadioGroup = (0, import_react20.forwardRef)(({ className, direction = "vertical", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3046
3074
|
RadioGroupPrimitive.Root,
|
|
3047
3075
|
{
|
|
3048
3076
|
className: cn("aviala-radio-group", className),
|
|
@@ -3052,15 +3080,15 @@ var RadioGroup = (0, import_react20.forwardRef)(({ className, direction = "verti
|
|
|
3052
3080
|
}
|
|
3053
3081
|
));
|
|
3054
3082
|
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
3055
|
-
var RadioGroupItem = (0, import_react20.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3083
|
+
var RadioGroupItem = (0, import_react20.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3056
3084
|
RadioGroupPrimitive.Item,
|
|
3057
3085
|
{
|
|
3058
3086
|
ref,
|
|
3059
3087
|
className: cn("aviala-radio aviala-focus-ring", className),
|
|
3060
3088
|
...props,
|
|
3061
3089
|
children: [
|
|
3062
|
-
/* @__PURE__ */ (0,
|
|
3063
|
-
/* @__PURE__ */ (0,
|
|
3090
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { "aria-hidden": true, className: "aviala-radio__surface" }),
|
|
3091
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { "aria-hidden": true, className: "aviala-radio__indicator" })
|
|
3064
3092
|
]
|
|
3065
3093
|
}
|
|
3066
3094
|
));
|
|
@@ -3076,7 +3104,7 @@ function renderIcon4(node) {
|
|
|
3076
3104
|
"shrink-0"
|
|
3077
3105
|
)
|
|
3078
3106
|
}) : node;
|
|
3079
|
-
return /* @__PURE__ */ (0,
|
|
3107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "aviala-radio-input__icon", children: content });
|
|
3080
3108
|
}
|
|
3081
3109
|
var RadioInput = (0, import_react20.forwardRef)(
|
|
3082
3110
|
({
|
|
@@ -3088,7 +3116,7 @@ var RadioInput = (0, import_react20.forwardRef)(
|
|
|
3088
3116
|
disabled,
|
|
3089
3117
|
id,
|
|
3090
3118
|
...props
|
|
3091
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
3119
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3092
3120
|
"label",
|
|
3093
3121
|
{
|
|
3094
3122
|
htmlFor: id,
|
|
@@ -3096,9 +3124,9 @@ var RadioInput = (0, import_react20.forwardRef)(
|
|
|
3096
3124
|
"data-style": variant,
|
|
3097
3125
|
"data-disabled": disabled ? "true" : void 0,
|
|
3098
3126
|
children: [
|
|
3099
|
-
/* @__PURE__ */ (0,
|
|
3127
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(RadioGroupItem, { ref, id, disabled, ...props }),
|
|
3100
3128
|
renderIcon4(icon),
|
|
3101
|
-
/* @__PURE__ */ (0,
|
|
3129
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3102
3130
|
TypefacePair,
|
|
3103
3131
|
{
|
|
3104
3132
|
className: "aviala-radio-input__content min-w-0 flex-1",
|
|
@@ -3115,8 +3143,8 @@ RadioInput.displayName = "RadioInput";
|
|
|
3115
3143
|
// src/components/switch.tsx
|
|
3116
3144
|
var SwitchPrimitive = __toESM(require("@radix-ui/react-switch"), 1);
|
|
3117
3145
|
var import_react21 = require("react");
|
|
3118
|
-
var
|
|
3119
|
-
var Switch = (0, import_react21.forwardRef)(({ className, size = "regular", ...props }, ref) => /* @__PURE__ */ (0,
|
|
3146
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3147
|
+
var Switch = (0, import_react21.forwardRef)(({ className, size = "regular", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
3120
3148
|
SwitchPrimitive.Root,
|
|
3121
3149
|
{
|
|
3122
3150
|
className: cn(
|
|
@@ -3127,8 +3155,8 @@ var Switch = (0, import_react21.forwardRef)(({ className, size = "regular", ...p
|
|
|
3127
3155
|
ref,
|
|
3128
3156
|
...props,
|
|
3129
3157
|
children: [
|
|
3130
|
-
/* @__PURE__ */ (0,
|
|
3131
|
-
/* @__PURE__ */ (0,
|
|
3158
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { "aria-hidden": true, className: "aviala-switch__surface" }),
|
|
3159
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SwitchPrimitive.Thumb, { className: "aviala-switch__thumb" })
|
|
3132
3160
|
]
|
|
3133
3161
|
}
|
|
3134
3162
|
));
|
|
@@ -3137,9 +3165,9 @@ Switch.displayName = SwitchPrimitive.Root.displayName;
|
|
|
3137
3165
|
// src/components/anchor.tsx
|
|
3138
3166
|
var import_react_slot4 = require("@radix-ui/react-slot");
|
|
3139
3167
|
var import_react22 = require("react");
|
|
3140
|
-
var
|
|
3168
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3141
3169
|
var Anchor2 = (0, import_react22.forwardRef)(
|
|
3142
|
-
({ className, as: Tag2 = "nav", ...props }, ref) => /* @__PURE__ */ (0,
|
|
3170
|
+
({ className, as: Tag2 = "nav", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Tag2, { ref, className: cn("aviala-anchor", className), ...props })
|
|
3143
3171
|
);
|
|
3144
3172
|
Anchor2.displayName = "Anchor";
|
|
3145
3173
|
var AnchorItem = (0, import_react22.forwardRef)(
|
|
@@ -3152,7 +3180,7 @@ var AnchorItem = (0, import_react22.forwardRef)(
|
|
|
3152
3180
|
...props
|
|
3153
3181
|
}, ref) => {
|
|
3154
3182
|
const Comp = asChild ? import_react_slot4.Slot : "a";
|
|
3155
|
-
return /* @__PURE__ */ (0,
|
|
3183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
3156
3184
|
Comp,
|
|
3157
3185
|
{
|
|
3158
3186
|
ref,
|
|
@@ -3161,8 +3189,8 @@ var AnchorItem = (0, import_react22.forwardRef)(
|
|
|
3161
3189
|
"data-indent": String(indentLevel),
|
|
3162
3190
|
...props,
|
|
3163
3191
|
children: [
|
|
3164
|
-
/* @__PURE__ */ (0,
|
|
3165
|
-
/* @__PURE__ */ (0,
|
|
3192
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "aviala-anchor-item__rail", "aria-hidden": true }),
|
|
3193
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "aviala-anchor-item__content", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Typography, { level: "text", as: "span", className: "aviala-anchor-item__label", children }) })
|
|
3166
3194
|
]
|
|
3167
3195
|
}
|
|
3168
3196
|
);
|
|
@@ -3172,7 +3200,7 @@ AnchorItem.displayName = "AnchorItem";
|
|
|
3172
3200
|
|
|
3173
3201
|
// src/components/segmentator.tsx
|
|
3174
3202
|
var import_react23 = require("react");
|
|
3175
|
-
var
|
|
3203
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3176
3204
|
var SegmentatorContext = (0, import_react23.createContext)(null);
|
|
3177
3205
|
function useSegmentatorContext() {
|
|
3178
3206
|
const ctx = (0, import_react23.useContext)(SegmentatorContext);
|
|
@@ -3187,7 +3215,7 @@ function renderIcon5(node, dimmed) {
|
|
|
3187
3215
|
level: "text",
|
|
3188
3216
|
biggerSize: true
|
|
3189
3217
|
});
|
|
3190
|
-
return /* @__PURE__ */ (0,
|
|
3218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3191
3219
|
"span",
|
|
3192
3220
|
{
|
|
3193
3221
|
className: cn(
|
|
@@ -3267,12 +3295,24 @@ function measureItemThumbMetrics(item, group) {
|
|
|
3267
3295
|
const groupRect = group.getBoundingClientRect();
|
|
3268
3296
|
const itemRect = item.getBoundingClientRect();
|
|
3269
3297
|
return {
|
|
3270
|
-
x: itemRect.left - groupRect.left,
|
|
3271
|
-
y: itemRect.top - groupRect.top,
|
|
3298
|
+
x: itemRect.left - groupRect.left + group.scrollLeft,
|
|
3299
|
+
y: itemRect.top - groupRect.top + group.scrollTop,
|
|
3272
3300
|
width: itemRect.width,
|
|
3273
3301
|
height: itemRect.height
|
|
3274
3302
|
};
|
|
3275
3303
|
}
|
|
3304
|
+
function syncSegmentatorOverflowing(group) {
|
|
3305
|
+
const overflowing = group.scrollWidth > group.clientWidth + 1;
|
|
3306
|
+
if (overflowing) {
|
|
3307
|
+
group.setAttribute("data-overflowing", "true");
|
|
3308
|
+
} else {
|
|
3309
|
+
group.removeAttribute("data-overflowing");
|
|
3310
|
+
}
|
|
3311
|
+
return overflowing;
|
|
3312
|
+
}
|
|
3313
|
+
function isSegmentatorOverflowing(group) {
|
|
3314
|
+
return group?.getAttribute("data-overflowing") === "true";
|
|
3315
|
+
}
|
|
3276
3316
|
function findItemAtClientX(items, clientX) {
|
|
3277
3317
|
for (const item of items) {
|
|
3278
3318
|
const rect = item.getBoundingClientRect();
|
|
@@ -3361,14 +3401,7 @@ function useSegmentatorThumb(groupRef, selectedValue, layoutKey, dragState) {
|
|
|
3361
3401
|
'.aviala-segmentator-item[data-selected="true"]'
|
|
3362
3402
|
);
|
|
3363
3403
|
if (!selected) return null;
|
|
3364
|
-
|
|
3365
|
-
const itemRect = selected.getBoundingClientRect();
|
|
3366
|
-
return {
|
|
3367
|
-
x: itemRect.left - groupRect.left,
|
|
3368
|
-
y: itemRect.top - groupRect.top,
|
|
3369
|
-
width: itemRect.width,
|
|
3370
|
-
height: itemRect.height
|
|
3371
|
-
};
|
|
3404
|
+
return measureItemThumbMetrics(selected, group);
|
|
3372
3405
|
}, [groupRef]);
|
|
3373
3406
|
const syncThumb = (0, import_react23.useCallback)(
|
|
3374
3407
|
(metrics, instant = false) => {
|
|
@@ -3407,6 +3440,19 @@ function useSegmentatorThumb(groupRef, selectedValue, layoutKey, dragState) {
|
|
|
3407
3440
|
}, []);
|
|
3408
3441
|
(0, import_react23.useLayoutEffect)(() => {
|
|
3409
3442
|
if (dragState.pressing || dragState.active) return;
|
|
3443
|
+
const group = groupRef.current;
|
|
3444
|
+
if (group) {
|
|
3445
|
+
const selected = group.querySelector(
|
|
3446
|
+
'.aviala-segmentator-item[data-selected="true"]'
|
|
3447
|
+
);
|
|
3448
|
+
if (selected && !isInitialMount.current) {
|
|
3449
|
+
selected.scrollIntoView({
|
|
3450
|
+
inline: "nearest",
|
|
3451
|
+
block: "nearest",
|
|
3452
|
+
behavior: "smooth"
|
|
3453
|
+
});
|
|
3454
|
+
}
|
|
3455
|
+
}
|
|
3410
3456
|
const next = measureThumb();
|
|
3411
3457
|
if (!next) return;
|
|
3412
3458
|
const el = thumbElRef.current;
|
|
@@ -3435,18 +3481,28 @@ function useSegmentatorThumb(groupRef, selectedValue, layoutKey, dragState) {
|
|
|
3435
3481
|
return;
|
|
3436
3482
|
}
|
|
3437
3483
|
syncThumb(next, false);
|
|
3438
|
-
}, [selectedValue, measureThumb, syncThumb, dragState.active, dragState.pressing]);
|
|
3484
|
+
}, [selectedValue, measureThumb, syncThumb, dragState.active, dragState.pressing, groupRef]);
|
|
3439
3485
|
(0, import_react23.useLayoutEffect)(() => {
|
|
3440
3486
|
const group = groupRef.current;
|
|
3441
3487
|
if (!group) return;
|
|
3442
|
-
const
|
|
3488
|
+
const updateOverflowAndThumb = () => {
|
|
3489
|
+
syncSegmentatorOverflowing(group);
|
|
3443
3490
|
remeasureThumb();
|
|
3491
|
+
};
|
|
3492
|
+
updateOverflowAndThumb();
|
|
3493
|
+
const observer = new ResizeObserver(() => {
|
|
3494
|
+
updateOverflowAndThumb();
|
|
3444
3495
|
});
|
|
3445
3496
|
observer.observe(group);
|
|
3446
3497
|
const items = group.querySelectorAll(".aviala-segmentator-item");
|
|
3447
3498
|
items.forEach((item) => observer.observe(item));
|
|
3499
|
+
const onScroll = () => {
|
|
3500
|
+
syncSegmentatorOverflowing(group);
|
|
3501
|
+
remeasureThumb();
|
|
3502
|
+
};
|
|
3503
|
+
group.addEventListener("scroll", onScroll, { passive: true });
|
|
3448
3504
|
const layoutObserver = new MutationObserver(() => {
|
|
3449
|
-
requestAnimationFrame(
|
|
3505
|
+
requestAnimationFrame(updateOverflowAndThumb);
|
|
3450
3506
|
});
|
|
3451
3507
|
layoutObserver.observe(document.documentElement, {
|
|
3452
3508
|
attributes: true,
|
|
@@ -3455,6 +3511,7 @@ function useSegmentatorThumb(groupRef, selectedValue, layoutKey, dragState) {
|
|
|
3455
3511
|
return () => {
|
|
3456
3512
|
observer.disconnect();
|
|
3457
3513
|
layoutObserver.disconnect();
|
|
3514
|
+
group.removeEventListener("scroll", onScroll);
|
|
3458
3515
|
};
|
|
3459
3516
|
}, [groupRef, remeasureThumb]);
|
|
3460
3517
|
(0, import_react23.useEffect)(() => {
|
|
@@ -3611,6 +3668,7 @@ var SegmentatorGroup = (0, import_react23.forwardRef)(
|
|
|
3611
3668
|
);
|
|
3612
3669
|
const handlePointerDown = (event) => {
|
|
3613
3670
|
if (disabled || !isSegmentatorDragPointer(event.pointerType)) return;
|
|
3671
|
+
if (isSegmentatorOverflowing(groupRef.current)) return;
|
|
3614
3672
|
const pressedItem = getPressedItemFromTarget(event.target);
|
|
3615
3673
|
if (!pressedItem) return;
|
|
3616
3674
|
const group = groupRef.current;
|
|
@@ -3636,7 +3694,7 @@ var SegmentatorGroup = (0, import_react23.forwardRef)(
|
|
|
3636
3694
|
group.setPointerCapture(event.pointerId);
|
|
3637
3695
|
};
|
|
3638
3696
|
const thumbStyle = thumb ? buildThumbStyle() : void 0;
|
|
3639
|
-
return /* @__PURE__ */ (0,
|
|
3697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3640
3698
|
SegmentatorContext.Provider,
|
|
3641
3699
|
{
|
|
3642
3700
|
value: (0, import_react23.useMemo)(
|
|
@@ -3650,7 +3708,7 @@ var SegmentatorGroup = (0, import_react23.forwardRef)(
|
|
|
3650
3708
|
}),
|
|
3651
3709
|
[currentValue, setValue, mode, allRound, disabled]
|
|
3652
3710
|
),
|
|
3653
|
-
children: /* @__PURE__ */ (0,
|
|
3711
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
3654
3712
|
"div",
|
|
3655
3713
|
{
|
|
3656
3714
|
ref: (node) => {
|
|
@@ -3672,7 +3730,7 @@ var SegmentatorGroup = (0, import_react23.forwardRef)(
|
|
|
3672
3730
|
onLostPointerCapture: finishPointerDrag,
|
|
3673
3731
|
children: [
|
|
3674
3732
|
children,
|
|
3675
|
-
thumb && /* @__PURE__ */ (0,
|
|
3733
|
+
thumb && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3676
3734
|
"span",
|
|
3677
3735
|
{
|
|
3678
3736
|
ref: onThumbRef,
|
|
@@ -3710,7 +3768,7 @@ var SegmentatorItem = (0, import_react23.forwardRef)(
|
|
|
3710
3768
|
const isDisabled = disabled || ctx.disabled;
|
|
3711
3769
|
const dimmed = isDisabled;
|
|
3712
3770
|
const icon = iconOnly ? leftIcon ?? rightIcon : leftIcon;
|
|
3713
|
-
return /* @__PURE__ */ (0,
|
|
3771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3714
3772
|
"button",
|
|
3715
3773
|
{
|
|
3716
3774
|
ref,
|
|
@@ -3732,9 +3790,9 @@ var SegmentatorItem = (0, import_react23.forwardRef)(
|
|
|
3732
3790
|
onClick?.(e);
|
|
3733
3791
|
},
|
|
3734
3792
|
...props,
|
|
3735
|
-
children: /* @__PURE__ */ (0,
|
|
3793
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "aviala-segmentator-item__content", children: [
|
|
3736
3794
|
renderIcon5(icon, dimmed && !!icon),
|
|
3737
|
-
!iconOnly && /* @__PURE__ */ (0,
|
|
3795
|
+
!iconOnly && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3738
3796
|
"span",
|
|
3739
3797
|
{
|
|
3740
3798
|
className: cn(
|
|
@@ -3754,9 +3812,9 @@ var SegmentatorItem = (0, import_react23.forwardRef)(
|
|
|
3754
3812
|
SegmentatorItem.displayName = "SegmentatorItem";
|
|
3755
3813
|
|
|
3756
3814
|
// src/components/form-field.tsx
|
|
3757
|
-
var
|
|
3815
|
+
var import_icons8 = require("@aviala-design/icons");
|
|
3758
3816
|
var import_react24 = require("react");
|
|
3759
|
-
var
|
|
3817
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
3760
3818
|
var FormField = (0, import_react24.forwardRef)(
|
|
3761
3819
|
({
|
|
3762
3820
|
className,
|
|
@@ -3774,31 +3832,31 @@ var FormField = (0, import_react24.forwardRef)(
|
|
|
3774
3832
|
const reactId = (0, import_react24.useId)();
|
|
3775
3833
|
const labelId = `${reactId}-label`;
|
|
3776
3834
|
const hasLabel = label != null && label !== "";
|
|
3777
|
-
const labelNode = hasLabel || description ? htmlFor ? /* @__PURE__ */ (0,
|
|
3835
|
+
const labelNode = hasLabel || description ? htmlFor ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { htmlFor, className: "aviala-form__label aviala-form__label--control", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3778
3836
|
Typeface,
|
|
3779
3837
|
{
|
|
3780
3838
|
id: labelId,
|
|
3781
3839
|
content: "textCaption",
|
|
3782
|
-
primary: hasLabel ? /* @__PURE__ */ (0,
|
|
3840
|
+
primary: hasLabel ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
3783
3841
|
label,
|
|
3784
|
-
required ? /* @__PURE__ */ (0,
|
|
3842
|
+
required ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "aviala-form__required", "aria-hidden": true, children: "*" }) : null
|
|
3785
3843
|
] }) : void 0,
|
|
3786
3844
|
secondary: description
|
|
3787
3845
|
}
|
|
3788
|
-
) }) : /* @__PURE__ */ (0,
|
|
3846
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3789
3847
|
Typeface,
|
|
3790
3848
|
{
|
|
3791
3849
|
id: labelId,
|
|
3792
3850
|
className: "aviala-form__label",
|
|
3793
3851
|
content: "textCaption",
|
|
3794
|
-
primary: hasLabel ? /* @__PURE__ */ (0,
|
|
3852
|
+
primary: hasLabel ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
3795
3853
|
label,
|
|
3796
|
-
required ? /* @__PURE__ */ (0,
|
|
3854
|
+
required ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "aviala-form__required", "aria-hidden": true, children: "*" }) : null
|
|
3797
3855
|
] }) : void 0,
|
|
3798
3856
|
secondary: description
|
|
3799
3857
|
}
|
|
3800
3858
|
) : null;
|
|
3801
|
-
return /* @__PURE__ */ (0,
|
|
3859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3802
3860
|
"div",
|
|
3803
3861
|
{
|
|
3804
3862
|
ref,
|
|
@@ -3808,11 +3866,11 @@ var FormField = (0, import_react24.forwardRef)(
|
|
|
3808
3866
|
...props,
|
|
3809
3867
|
children: [
|
|
3810
3868
|
labelNode,
|
|
3811
|
-
/* @__PURE__ */ (0,
|
|
3869
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "aviala-form__content", children: [
|
|
3812
3870
|
children,
|
|
3813
|
-
error ? /* @__PURE__ */ (0,
|
|
3814
|
-
/* @__PURE__ */ (0,
|
|
3815
|
-
|
|
3871
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "aviala-form__message aviala-form__message--error", role: "alert", children: [
|
|
3872
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3873
|
+
import_icons8.SymbolWrongCircle,
|
|
3816
3874
|
{
|
|
3817
3875
|
className: "aviala-form__message-icon",
|
|
3818
3876
|
width: 14,
|
|
@@ -3820,11 +3878,11 @@ var FormField = (0, import_react24.forwardRef)(
|
|
|
3820
3878
|
"aria-hidden": true
|
|
3821
3879
|
}
|
|
3822
3880
|
),
|
|
3823
|
-
/* @__PURE__ */ (0,
|
|
3881
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Typography, { level: "caption", as: "p", className: "aviala-form__message-text", children: error })
|
|
3824
3882
|
] }) : null,
|
|
3825
|
-
info ? /* @__PURE__ */ (0,
|
|
3826
|
-
/* @__PURE__ */ (0,
|
|
3827
|
-
|
|
3883
|
+
info ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "aviala-form__message aviala-form__message--info", children: [
|
|
3884
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3885
|
+
import_icons8.SymbolInformationCircle,
|
|
3828
3886
|
{
|
|
3829
3887
|
className: "aviala-form__message-icon",
|
|
3830
3888
|
width: 14,
|
|
@@ -3832,9 +3890,9 @@ var FormField = (0, import_react24.forwardRef)(
|
|
|
3832
3890
|
"aria-hidden": true
|
|
3833
3891
|
}
|
|
3834
3892
|
),
|
|
3835
|
-
/* @__PURE__ */ (0,
|
|
3893
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Typography, { level: "caption", as: "p", className: "aviala-form__message-text", children: info })
|
|
3836
3894
|
] }) : null,
|
|
3837
|
-
alert ? /* @__PURE__ */ (0,
|
|
3895
|
+
alert ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "aviala-form__alert", children: alert }) : null
|
|
3838
3896
|
] })
|
|
3839
3897
|
]
|
|
3840
3898
|
}
|
|
@@ -3845,9 +3903,9 @@ FormField.displayName = "FormField";
|
|
|
3845
3903
|
|
|
3846
3904
|
// src/components/input-group.tsx
|
|
3847
3905
|
var import_react25 = require("react");
|
|
3848
|
-
var
|
|
3906
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
3849
3907
|
var InputGroup = (0, import_react25.forwardRef)(
|
|
3850
|
-
({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ (0,
|
|
3908
|
+
({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3851
3909
|
"div",
|
|
3852
3910
|
{
|
|
3853
3911
|
ref,
|
|
@@ -3861,7 +3919,7 @@ var InputGroup = (0, import_react25.forwardRef)(
|
|
|
3861
3919
|
)
|
|
3862
3920
|
);
|
|
3863
3921
|
InputGroup.displayName = "InputGroup";
|
|
3864
|
-
var InputGroupAddon = (0, import_react25.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3922
|
+
var InputGroupAddon = (0, import_react25.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3865
3923
|
"div",
|
|
3866
3924
|
{
|
|
3867
3925
|
ref,
|
|
@@ -3877,7 +3935,7 @@ InputGroupAddon.displayName = "InputGroupAddon";
|
|
|
3877
3935
|
|
|
3878
3936
|
// src/components/stack.tsx
|
|
3879
3937
|
var import_react26 = require("react");
|
|
3880
|
-
var
|
|
3938
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3881
3939
|
var gapMap = {
|
|
3882
3940
|
inside: "var(--gap-inside, 4px)",
|
|
3883
3941
|
component: "var(--gap-component, 8px)",
|
|
@@ -3886,7 +3944,7 @@ var gapMap = {
|
|
|
3886
3944
|
page: "var(--gap-page-space, 24px)"
|
|
3887
3945
|
};
|
|
3888
3946
|
var Stack = (0, import_react26.forwardRef)(
|
|
3889
|
-
({ className, gap = "component", direction = "column", style, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3947
|
+
({ className, gap = "component", direction = "column", style, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3890
3948
|
"div",
|
|
3891
3949
|
{
|
|
3892
3950
|
ref,
|
|
@@ -3914,7 +3972,7 @@ var Fieldset = (0, import_react26.forwardRef)(
|
|
|
3914
3972
|
const heading = title ?? legend;
|
|
3915
3973
|
const hasHeading = heading != null && heading !== "";
|
|
3916
3974
|
const hasAction = info != null || feedback != null || actions != null;
|
|
3917
|
-
return /* @__PURE__ */ (0,
|
|
3975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
3918
3976
|
"fieldset",
|
|
3919
3977
|
{
|
|
3920
3978
|
ref,
|
|
@@ -3922,7 +3980,7 @@ var Fieldset = (0, import_react26.forwardRef)(
|
|
|
3922
3980
|
"aria-labelledby": hasHeading ? headingId : void 0,
|
|
3923
3981
|
...props,
|
|
3924
3982
|
children: [
|
|
3925
|
-
hasHeading || description ? /* @__PURE__ */ (0,
|
|
3983
|
+
hasHeading || description ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3926
3984
|
Typeface,
|
|
3927
3985
|
{
|
|
3928
3986
|
id: headingId,
|
|
@@ -3932,11 +3990,11 @@ var Fieldset = (0, import_react26.forwardRef)(
|
|
|
3932
3990
|
secondary: description
|
|
3933
3991
|
}
|
|
3934
3992
|
) : null,
|
|
3935
|
-
/* @__PURE__ */ (0,
|
|
3936
|
-
hasAction ? /* @__PURE__ */ (0,
|
|
3937
|
-
info ? /* @__PURE__ */ (0,
|
|
3938
|
-
feedback ? /* @__PURE__ */ (0,
|
|
3939
|
-
actions ? /* @__PURE__ */ (0,
|
|
3993
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "aviala-form-group__slot", children }),
|
|
3994
|
+
hasAction ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "aviala-form-group__action", children: [
|
|
3995
|
+
info ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "aviala-form-group__info", children: info }) : null,
|
|
3996
|
+
feedback ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "aviala-form-group__feedback", children: feedback }) : null,
|
|
3997
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "aviala-form-group__actions", children: actions }) : null
|
|
3940
3998
|
] }) : null
|
|
3941
3999
|
]
|
|
3942
4000
|
}
|
|
@@ -4108,7 +4166,7 @@ function useColorPickerState({
|
|
|
4108
4166
|
}
|
|
4109
4167
|
|
|
4110
4168
|
// src/components/color-picker/color-picker-area.tsx
|
|
4111
|
-
var
|
|
4169
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4112
4170
|
function ColorPickerArea({
|
|
4113
4171
|
className,
|
|
4114
4172
|
disabled,
|
|
@@ -4140,7 +4198,7 @@ function ColorPickerArea({
|
|
|
4140
4198
|
);
|
|
4141
4199
|
const { handlePointerDown, handlePointerMove } = usePointerDrag(ref, handleMove, !isDisabled);
|
|
4142
4200
|
const hueColor = pureHueHex(hsva.h);
|
|
4143
|
-
return /* @__PURE__ */ (0,
|
|
4201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: cn("aviala-color-picker-area", className), ...spiralDebugId("color-picker.content.area"), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4144
4202
|
"div",
|
|
4145
4203
|
{
|
|
4146
4204
|
ref,
|
|
@@ -4155,9 +4213,9 @@ function ColorPickerArea({
|
|
|
4155
4213
|
"aria-valuenow": Math.round(hsva.s),
|
|
4156
4214
|
tabIndex: isDisabled ? -1 : 0,
|
|
4157
4215
|
children: [
|
|
4158
|
-
/* @__PURE__ */ (0,
|
|
4159
|
-
/* @__PURE__ */ (0,
|
|
4160
|
-
/* @__PURE__ */ (0,
|
|
4216
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "aviala-color-picker-area__white", "aria-hidden": true }),
|
|
4217
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "aviala-color-picker-area__black", "aria-hidden": true }),
|
|
4218
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4161
4219
|
"div",
|
|
4162
4220
|
{
|
|
4163
4221
|
className: "aviala-color-picker-area__thumb",
|
|
@@ -4174,9 +4232,9 @@ function ColorPickerArea({
|
|
|
4174
4232
|
}
|
|
4175
4233
|
|
|
4176
4234
|
// src/components/color-picker/color-picker-inputs.tsx
|
|
4177
|
-
var
|
|
4235
|
+
var import_icons9 = require("@aviala-design/icons");
|
|
4178
4236
|
var import_react31 = require("react");
|
|
4179
|
-
var
|
|
4237
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
4180
4238
|
function ColorPickerInputs({
|
|
4181
4239
|
className,
|
|
4182
4240
|
disabled,
|
|
@@ -4236,8 +4294,8 @@ function ColorPickerInputs({
|
|
|
4236
4294
|
} catch {
|
|
4237
4295
|
}
|
|
4238
4296
|
}, [eyeDropperSupported, isDisabled, setValue]);
|
|
4239
|
-
return /* @__PURE__ */ (0,
|
|
4240
|
-
showEyedropper ? /* @__PURE__ */ (0,
|
|
4297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: cn("aviala-color-picker-inputs", className), ...spiralDebugId("color-picker.content.inputs"), children: [
|
|
4298
|
+
showEyedropper ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4241
4299
|
Button,
|
|
4242
4300
|
{
|
|
4243
4301
|
type: "button",
|
|
@@ -4249,12 +4307,12 @@ function ColorPickerInputs({
|
|
|
4249
4307
|
...spiralDebugId("color-picker.content.inputs.eyedropper"),
|
|
4250
4308
|
title: eyeDropperSupported ? "Pick color from screen" : "EyeDropper not supported in this browser",
|
|
4251
4309
|
onClick: handleEyedropper,
|
|
4252
|
-
children: /* @__PURE__ */ (0,
|
|
4310
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_icons9.EditColorPicker, { "aria-hidden": true })
|
|
4253
4311
|
}
|
|
4254
4312
|
) : null,
|
|
4255
|
-
format === "hex" ? /* @__PURE__ */ (0,
|
|
4256
|
-
/* @__PURE__ */ (0,
|
|
4257
|
-
/* @__PURE__ */ (0,
|
|
4313
|
+
format === "hex" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "aviala-color-picker-field", children: [
|
|
4314
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "aviala-color-picker-field__badge-area", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Badge, { style: "normal", children: "#" }) }),
|
|
4315
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4258
4316
|
"input",
|
|
4259
4317
|
{
|
|
4260
4318
|
className: cn("aviala-color-picker-field__input", typographyVariants({ level: "text" })),
|
|
@@ -4266,7 +4324,7 @@ function ColorPickerInputs({
|
|
|
4266
4324
|
onKeyDown: (e) => e.key === "Enter" && commitHex()
|
|
4267
4325
|
}
|
|
4268
4326
|
)
|
|
4269
|
-
] }) : /* @__PURE__ */ (0,
|
|
4327
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "aviala-color-picker-field", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4270
4328
|
"input",
|
|
4271
4329
|
{
|
|
4272
4330
|
className: cn("aviala-color-picker-field__input", typographyVariants({ level: "text" })),
|
|
@@ -4278,8 +4336,8 @@ function ColorPickerInputs({
|
|
|
4278
4336
|
onKeyDown: (e) => e.key === "Enter" && commitComponents()
|
|
4279
4337
|
}
|
|
4280
4338
|
) }),
|
|
4281
|
-
/* @__PURE__ */ (0,
|
|
4282
|
-
/* @__PURE__ */ (0,
|
|
4339
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "aviala-color-picker-field aviala-color-picker-field--alpha", children: [
|
|
4340
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4283
4341
|
"input",
|
|
4284
4342
|
{
|
|
4285
4343
|
className: cn("aviala-color-picker-field__input", typographyVariants({ level: "text" })),
|
|
@@ -4292,20 +4350,20 @@ function ColorPickerInputs({
|
|
|
4292
4350
|
onKeyDown: (e) => e.key === "Enter" && commitAlpha()
|
|
4293
4351
|
}
|
|
4294
4352
|
),
|
|
4295
|
-
/* @__PURE__ */ (0,
|
|
4353
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "aviala-color-picker-field__badge-area", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Badge, { style: "normal", children: "%" }) })
|
|
4296
4354
|
] }),
|
|
4297
|
-
/* @__PURE__ */ (0,
|
|
4355
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
4298
4356
|
Select,
|
|
4299
4357
|
{
|
|
4300
4358
|
value: format,
|
|
4301
4359
|
onValueChange: (next) => setFormat(next),
|
|
4302
4360
|
disabled: isDisabled,
|
|
4303
4361
|
children: [
|
|
4304
|
-
/* @__PURE__ */ (0,
|
|
4305
|
-
/* @__PURE__ */ (0,
|
|
4306
|
-
/* @__PURE__ */ (0,
|
|
4307
|
-
/* @__PURE__ */ (0,
|
|
4308
|
-
/* @__PURE__ */ (0,
|
|
4362
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectTrigger, { className: "aviala-color-picker-format-select w-[76px] shrink-0", size: "regular", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectValue, {}) }),
|
|
4363
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectContent, { onCloseAutoFocus: (event) => event.preventDefault(), children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(SelectItemGroup, { children: [
|
|
4364
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectItem, { value: "hex", itemFunction: "radio", children: "HEX" }),
|
|
4365
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectItem, { value: "rgb", itemFunction: "radio", children: "RGB" }),
|
|
4366
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectItem, { value: "hsl", itemFunction: "radio", children: "HSL" })
|
|
4309
4367
|
] }) })
|
|
4310
4368
|
]
|
|
4311
4369
|
}
|
|
@@ -4325,15 +4383,15 @@ function buildComponentDraft(value, format) {
|
|
|
4325
4383
|
}
|
|
4326
4384
|
|
|
4327
4385
|
// src/components/color-picker/color-picker-presets.tsx
|
|
4328
|
-
var
|
|
4386
|
+
var import_icons10 = require("@aviala-design/icons");
|
|
4329
4387
|
|
|
4330
4388
|
// src/components/color-picker/color-pick-button.tsx
|
|
4331
4389
|
var import_react32 = require("react");
|
|
4332
|
-
var
|
|
4390
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
4333
4391
|
var ColorPickButton = (0, import_react32.forwardRef)(
|
|
4334
4392
|
({ className, color, selected = false, style, ...props }, ref) => {
|
|
4335
4393
|
const swatch = parseColor(color).toHex();
|
|
4336
|
-
return /* @__PURE__ */ (0,
|
|
4394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4337
4395
|
"button",
|
|
4338
4396
|
{
|
|
4339
4397
|
ref,
|
|
@@ -4342,7 +4400,7 @@ var ColorPickButton = (0, import_react32.forwardRef)(
|
|
|
4342
4400
|
"data-selected": selected ? "true" : void 0,
|
|
4343
4401
|
style,
|
|
4344
4402
|
...props,
|
|
4345
|
-
children: /* @__PURE__ */ (0,
|
|
4403
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4346
4404
|
"span",
|
|
4347
4405
|
{
|
|
4348
4406
|
className: "aviala-color-pick-button__swatch",
|
|
@@ -4357,7 +4415,7 @@ var ColorPickButton = (0, import_react32.forwardRef)(
|
|
|
4357
4415
|
ColorPickButton.displayName = "ColorPickButton";
|
|
4358
4416
|
|
|
4359
4417
|
// src/components/color-picker/color-picker-presets.tsx
|
|
4360
|
-
var
|
|
4418
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
4361
4419
|
function ColorPickerPresets({
|
|
4362
4420
|
className,
|
|
4363
4421
|
presets: presetsProp,
|
|
@@ -4379,8 +4437,8 @@ function ColorPickerPresets({
|
|
|
4379
4437
|
const next = [...presets, normalized].slice(-maxPresets);
|
|
4380
4438
|
onPresetsChange(next);
|
|
4381
4439
|
};
|
|
4382
|
-
return /* @__PURE__ */ (0,
|
|
4383
|
-
/* @__PURE__ */ (0,
|
|
4440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: cn("aviala-color-picker-presets", className), ...spiralDebugId("color-picker.content.presets"), children: [
|
|
4441
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4384
4442
|
Button,
|
|
4385
4443
|
{
|
|
4386
4444
|
type: "button",
|
|
@@ -4390,10 +4448,10 @@ function ColorPickerPresets({
|
|
|
4390
4448
|
disabled: isDisabled || !onPresetsChange || presets.length >= maxPresets,
|
|
4391
4449
|
"aria-label": "Add current color to presets",
|
|
4392
4450
|
onClick: handleAdd,
|
|
4393
|
-
children: /* @__PURE__ */ (0,
|
|
4451
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_icons10.SymbolAdd, { "aria-hidden": true })
|
|
4394
4452
|
}
|
|
4395
4453
|
),
|
|
4396
|
-
presets.map((color) => /* @__PURE__ */ (0,
|
|
4454
|
+
presets.map((color) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4397
4455
|
ColorPickButton,
|
|
4398
4456
|
{
|
|
4399
4457
|
color,
|
|
@@ -4408,7 +4466,7 @@ function ColorPickerPresets({
|
|
|
4408
4466
|
|
|
4409
4467
|
// src/components/color-picker/color-picker-slider.tsx
|
|
4410
4468
|
var import_react33 = require("react");
|
|
4411
|
-
var
|
|
4469
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
4412
4470
|
function ColorPickerSlider({
|
|
4413
4471
|
kind,
|
|
4414
4472
|
className,
|
|
@@ -4456,12 +4514,12 @@ function ColorPickerSlider({
|
|
|
4456
4514
|
backgroundImage: `linear-gradient(90deg, transparent, ${solidHex(value)})`,
|
|
4457
4515
|
backgroundColor: "var(--color-picker-checkerboard)"
|
|
4458
4516
|
};
|
|
4459
|
-
return /* @__PURE__ */ (0,
|
|
4517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4460
4518
|
"div",
|
|
4461
4519
|
{
|
|
4462
4520
|
className: cn("aviala-color-picker-slider-row", className),
|
|
4463
4521
|
...spiralDebugId(`color-picker.content.${kind}-slider`),
|
|
4464
|
-
children: /* @__PURE__ */ (0,
|
|
4522
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
4465
4523
|
"div",
|
|
4466
4524
|
{
|
|
4467
4525
|
ref,
|
|
@@ -4475,8 +4533,8 @@ function ColorPickerSlider({
|
|
|
4475
4533
|
"aria-valuenow": ariaValueNow,
|
|
4476
4534
|
tabIndex: isDisabled ? -1 : 0,
|
|
4477
4535
|
children: [
|
|
4478
|
-
/* @__PURE__ */ (0,
|
|
4479
|
-
/* @__PURE__ */ (0,
|
|
4536
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "aviala-color-picker-slider__track", style: trackStyle }),
|
|
4537
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4480
4538
|
"div",
|
|
4481
4539
|
{
|
|
4482
4540
|
className: "aviala-color-picker-slider__thumb",
|
|
@@ -4492,7 +4550,7 @@ function ColorPickerSlider({
|
|
|
4492
4550
|
}
|
|
4493
4551
|
|
|
4494
4552
|
// src/components/color-picker/color-picker.tsx
|
|
4495
|
-
var
|
|
4553
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
4496
4554
|
function ColorPicker({
|
|
4497
4555
|
children,
|
|
4498
4556
|
className,
|
|
@@ -4535,17 +4593,17 @@ function ColorPicker({
|
|
|
4535
4593
|
onPresetsChange,
|
|
4536
4594
|
maxPresets
|
|
4537
4595
|
};
|
|
4538
|
-
return /* @__PURE__ */ (0,
|
|
4596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ColorPickerContextProvider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PopoverPrimitive2.Root, { open, onOpenChange: handleOpenChange, modal: false, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: cn("inline-flex", className), ...spiralDebugId("color-picker"), children }) }) });
|
|
4539
4597
|
}
|
|
4540
4598
|
function ColorPickerContextProvider({
|
|
4541
4599
|
value,
|
|
4542
4600
|
children
|
|
4543
4601
|
}) {
|
|
4544
|
-
return /* @__PURE__ */ (0,
|
|
4602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ColorPickerContext.Provider, { value, children });
|
|
4545
4603
|
}
|
|
4546
4604
|
var ColorPickerTrigger = (0, import_react34.forwardRef)(({ className, size = "regular", allRound = false, placeholder = "Select color", ...props }, ref) => {
|
|
4547
4605
|
const { value, open, disabled } = useColorPickerContext();
|
|
4548
|
-
return /* @__PURE__ */ (0,
|
|
4606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PopoverPrimitive2.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
4549
4607
|
"button",
|
|
4550
4608
|
{
|
|
4551
4609
|
ref,
|
|
@@ -4559,7 +4617,7 @@ var ColorPickerTrigger = (0, import_react34.forwardRef)(({ className, size = "re
|
|
|
4559
4617
|
disabled,
|
|
4560
4618
|
...props,
|
|
4561
4619
|
children: [
|
|
4562
|
-
/* @__PURE__ */ (0,
|
|
4620
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "aviala-color-picker-trigger__swatch", ...spiralDebugId("color-picker.trigger.swatch"), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4563
4621
|
"span",
|
|
4564
4622
|
{
|
|
4565
4623
|
className: "aviala-color-picker-trigger__swatch-inner",
|
|
@@ -4567,7 +4625,7 @@ var ColorPickerTrigger = (0, import_react34.forwardRef)(({ className, size = "re
|
|
|
4567
4625
|
"aria-hidden": true
|
|
4568
4626
|
}
|
|
4569
4627
|
) }),
|
|
4570
|
-
/* @__PURE__ */ (0,
|
|
4628
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "aviala-color-picker-trigger__value", ...spiralDebugId("color-picker.trigger.value"), children: value ? value.replace(/^#/, "").slice(0, 6).toUpperCase() : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "aviala-color-picker-trigger__placeholder", children: placeholder }) })
|
|
4571
4629
|
]
|
|
4572
4630
|
}
|
|
4573
4631
|
) });
|
|
@@ -4586,7 +4644,7 @@ var ColorPickerContent = (0, import_react34.forwardRef)(
|
|
|
4586
4644
|
...props
|
|
4587
4645
|
}, ref) => {
|
|
4588
4646
|
const { presets, onPresetsChange, maxPresets, disabled } = useColorPickerContext();
|
|
4589
|
-
return /* @__PURE__ */ (0,
|
|
4647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PopoverPrimitive2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4590
4648
|
PopoverPrimitive2.Content,
|
|
4591
4649
|
{
|
|
4592
4650
|
ref,
|
|
@@ -4602,12 +4660,12 @@ var ColorPickerContent = (0, import_react34.forwardRef)(
|
|
|
4602
4660
|
},
|
|
4603
4661
|
onFocusOutside: (event) => event.preventDefault(),
|
|
4604
4662
|
...props,
|
|
4605
|
-
children: /* @__PURE__ */ (0,
|
|
4606
|
-
/* @__PURE__ */ (0,
|
|
4607
|
-
/* @__PURE__ */ (0,
|
|
4608
|
-
/* @__PURE__ */ (0,
|
|
4609
|
-
/* @__PURE__ */ (0,
|
|
4610
|
-
showPresets ? /* @__PURE__ */ (0,
|
|
4663
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "aviala-color-picker-panel", children: [
|
|
4664
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ColorPickerArea, { disabled }),
|
|
4665
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ColorPickerSlider, { kind: "hue", disabled }),
|
|
4666
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ColorPickerSlider, { kind: "alpha", disabled }),
|
|
4667
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ColorPickerInputs, { disabled, showEyedropper }),
|
|
4668
|
+
showPresets ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4611
4669
|
ColorPickerPresets,
|
|
4612
4670
|
{
|
|
4613
4671
|
disabled,
|
|
@@ -4624,7 +4682,7 @@ var ColorPickerContent = (0, import_react34.forwardRef)(
|
|
|
4624
4682
|
ColorPickerContent.displayName = "ColorPickerContent";
|
|
4625
4683
|
|
|
4626
4684
|
// src/components/color-picker/color-picker-panel.tsx
|
|
4627
|
-
var
|
|
4685
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
4628
4686
|
function ColorPickerPanel({
|
|
4629
4687
|
className,
|
|
4630
4688
|
disabled,
|
|
@@ -4656,12 +4714,12 @@ function ColorPickerPanel({
|
|
|
4656
4714
|
onPresetsChange,
|
|
4657
4715
|
maxPresets
|
|
4658
4716
|
};
|
|
4659
|
-
return /* @__PURE__ */ (0,
|
|
4660
|
-
/* @__PURE__ */ (0,
|
|
4661
|
-
/* @__PURE__ */ (0,
|
|
4662
|
-
/* @__PURE__ */ (0,
|
|
4663
|
-
/* @__PURE__ */ (0,
|
|
4664
|
-
showPresets ? /* @__PURE__ */ (0,
|
|
4717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ColorPickerContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: cn("aviala-color-picker-panel", className), children: [
|
|
4718
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ColorPickerArea, { disabled }),
|
|
4719
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ColorPickerSlider, { kind: "hue", disabled }),
|
|
4720
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ColorPickerSlider, { kind: "alpha", disabled }),
|
|
4721
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ColorPickerInputs, { disabled, showEyedropper }),
|
|
4722
|
+
showPresets ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4665
4723
|
ColorPickerPresets,
|
|
4666
4724
|
{
|
|
4667
4725
|
disabled,
|
|
@@ -4675,9 +4733,9 @@ function ColorPickerPanel({
|
|
|
4675
4733
|
|
|
4676
4734
|
// src/components/cascader.tsx
|
|
4677
4735
|
var PopoverPrimitive3 = __toESM(require("@radix-ui/react-popover"), 1);
|
|
4678
|
-
var
|
|
4736
|
+
var import_icons11 = require("@aviala-design/icons");
|
|
4679
4737
|
var import_react35 = require("react");
|
|
4680
|
-
var
|
|
4738
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
4681
4739
|
var CascaderContext = (0, import_react35.createContext)(null);
|
|
4682
4740
|
function useCascaderContext() {
|
|
4683
4741
|
const context = (0, import_react35.useContext)(CascaderContext);
|
|
@@ -4692,7 +4750,7 @@ function renderItemIcon2(node, iconLevel = "text", debugId) {
|
|
|
4692
4750
|
level: iconLevel,
|
|
4693
4751
|
biggerSize: true
|
|
4694
4752
|
});
|
|
4695
|
-
return /* @__PURE__ */ (0,
|
|
4753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4696
4754
|
"span",
|
|
4697
4755
|
{
|
|
4698
4756
|
className: cn(
|
|
@@ -4707,17 +4765,17 @@ function renderItemIcon2(node, iconLevel = "text", debugId) {
|
|
|
4707
4765
|
}
|
|
4708
4766
|
function renderBadgeSlot2(node) {
|
|
4709
4767
|
if (node == null || node === false) return null;
|
|
4710
|
-
return /* @__PURE__ */ (0,
|
|
4768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "aviala-cascader-item__badge", children: (0, import_react35.isValidElement)(node) && node.type === Badge ? node : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Badge, { children: node }) });
|
|
4711
4769
|
}
|
|
4712
4770
|
function CascaderItemFormRadio() {
|
|
4713
|
-
return /* @__PURE__ */ (0,
|
|
4714
|
-
/* @__PURE__ */ (0,
|
|
4715
|
-
/* @__PURE__ */ (0,
|
|
4771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "aviala-cascader-item__form-radio", "aria-hidden": true, children: [
|
|
4772
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "aviala-cascader-item__form-radio-surface" }),
|
|
4773
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "aviala-cascader-item__form-radio-indicator" })
|
|
4716
4774
|
] });
|
|
4717
4775
|
}
|
|
4718
4776
|
function CascaderItemFormCheckbox() {
|
|
4719
|
-
return /* @__PURE__ */ (0,
|
|
4720
|
-
|
|
4777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "aviala-cascader-item__form-checkbox", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4778
|
+
import_icons11.SymbolRight,
|
|
4721
4779
|
{
|
|
4722
4780
|
className: "aviala-cascader-item__form-checkbox-icon",
|
|
4723
4781
|
thickness: "Bold",
|
|
@@ -4729,27 +4787,27 @@ function CascaderItemFormCheckbox() {
|
|
|
4729
4787
|
}
|
|
4730
4788
|
function CascaderItemTrailingRadio({ selected }) {
|
|
4731
4789
|
if (!selected) return null;
|
|
4732
|
-
return /* @__PURE__ */ (0,
|
|
4790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "aviala-cascader-item__trailing-radio", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_icons11.SymbolRight, { level: "text", biggerSize: true, "aria-hidden": true }) });
|
|
4733
4791
|
}
|
|
4734
4792
|
function CascaderItemTrailingCheckbox({ selected }) {
|
|
4735
4793
|
if (!selected) return null;
|
|
4736
|
-
return /* @__PURE__ */ (0,
|
|
4794
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "aviala-cascader-item__trailing-checkbox", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_icons11.SymbolRight, { level: "text", biggerSize: true, "aria-hidden": true }) });
|
|
4737
4795
|
}
|
|
4738
4796
|
function renderFunctionSlot2(itemFunction, layout, showFunctionIcon, hasChildren, selected, icon) {
|
|
4739
4797
|
if (!showFunctionIcon || layout === "title") return null;
|
|
4740
4798
|
if (icon !== void 0) {
|
|
4741
|
-
return /* @__PURE__ */ (0,
|
|
4799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "aviala-cascader-item__function", children: icon });
|
|
4742
4800
|
}
|
|
4743
4801
|
switch (itemFunction) {
|
|
4744
4802
|
case "radio":
|
|
4745
|
-
return /* @__PURE__ */ (0,
|
|
4803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "aviala-cascader-item__function", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CascaderItemTrailingRadio, { selected }) });
|
|
4746
4804
|
case "checkbox":
|
|
4747
|
-
return /* @__PURE__ */ (0,
|
|
4805
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "aviala-cascader-item__function", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CascaderItemTrailingCheckbox, { selected }) });
|
|
4748
4806
|
case "simple":
|
|
4749
4807
|
default:
|
|
4750
|
-
return /* @__PURE__ */ (0,
|
|
4751
|
-
selected ? /* @__PURE__ */ (0,
|
|
4752
|
-
hasChildren ? /* @__PURE__ */ (0,
|
|
4808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "aviala-cascader-item__function", children: [
|
|
4809
|
+
selected ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_icons11.SymbolRight, { level: "text", biggerSize: true, "aria-hidden": true }) : null,
|
|
4810
|
+
hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_icons11.DirectionArrowRightLight, { level: "text", biggerSize: true, "aria-hidden": true }) : null
|
|
4753
4811
|
] });
|
|
4754
4812
|
}
|
|
4755
4813
|
}
|
|
@@ -4909,7 +4967,7 @@ function Cascader({
|
|
|
4909
4967
|
size
|
|
4910
4968
|
]
|
|
4911
4969
|
);
|
|
4912
|
-
return /* @__PURE__ */ (0,
|
|
4970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CascaderContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PopoverPrimitive3.Root, { open, onOpenChange: handleOpenChange, modal: false, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: cn("inline-flex", className), ...spiralDebugId("cascader"), children }) }) });
|
|
4913
4971
|
}
|
|
4914
4972
|
var CascaderTrigger = (0, import_react35.forwardRef)(
|
|
4915
4973
|
({
|
|
@@ -4930,12 +4988,12 @@ var CascaderTrigger = (0, import_react35.forwardRef)(
|
|
|
4930
4988
|
const size = sizeProp ?? sizeContext;
|
|
4931
4989
|
const disabled = disabledProp ?? disabledContext;
|
|
4932
4990
|
const labels = selectedPath.map((_, index) => getOptionAtPath(selectedPath.slice(0, index + 1))?.label).filter((label) => label != null && label !== false);
|
|
4933
|
-
const resolvedDisplay = displayValue ?? (labels.length > 0 ? labels.map((label, index) => /* @__PURE__ */ (0,
|
|
4991
|
+
const resolvedDisplay = displayValue ?? (labels.length > 0 ? labels.map((label, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { children: [
|
|
4934
4992
|
index > 0 ? separator : null,
|
|
4935
4993
|
label
|
|
4936
4994
|
] }, `${selectedPath[index]}-${index}`)) : null);
|
|
4937
4995
|
const hasValue = resolvedDisplay != null && resolvedDisplay !== false;
|
|
4938
|
-
return /* @__PURE__ */ (0,
|
|
4996
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PopoverPrimitive3.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
4939
4997
|
"button",
|
|
4940
4998
|
{
|
|
4941
4999
|
ref,
|
|
@@ -4952,7 +5010,7 @@ var CascaderTrigger = (0, import_react35.forwardRef)(
|
|
|
4952
5010
|
...props,
|
|
4953
5011
|
children: [
|
|
4954
5012
|
renderSlotIcon(leftIcon, "aviala-cascader-trigger__slot", "cascader.trigger.icon-left"),
|
|
4955
|
-
/* @__PURE__ */ (0,
|
|
5013
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "aviala-cascader-trigger__field", ...spiralDebugId("cascader.trigger.value"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4956
5014
|
"span",
|
|
4957
5015
|
{
|
|
4958
5016
|
className: cn("aviala-cascader-trigger__value", typographyVariants({ level: "text" })),
|
|
@@ -4961,14 +5019,14 @@ var CascaderTrigger = (0, import_react35.forwardRef)(
|
|
|
4961
5019
|
}
|
|
4962
5020
|
) }),
|
|
4963
5021
|
renderSlotIcon(rightIcon, "aviala-cascader-trigger__slot", "cascader.trigger.icon-right"),
|
|
4964
|
-
/* @__PURE__ */ (0,
|
|
5022
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4965
5023
|
"span",
|
|
4966
5024
|
{
|
|
4967
5025
|
className: "aviala-cascader-trigger__expand",
|
|
4968
5026
|
"aria-hidden": true,
|
|
4969
5027
|
style: expandIcon ? iconSlotCssVarStyle(expandIcon, "--input-slot-icon-size", "text", true) : iconLevelCssVarStyle("text", true, "--input-slot-icon-size"),
|
|
4970
5028
|
...spiralDebugId("cascader.trigger.expand"),
|
|
4971
|
-
children: expandIcon ?? /* @__PURE__ */ (0,
|
|
5029
|
+
children: expandIcon ?? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_icons11.DirectionArrowDownLight, { level: "text", biggerSize: true, "aria-hidden": true })
|
|
4972
5030
|
}
|
|
4973
5031
|
)
|
|
4974
5032
|
]
|
|
@@ -4986,7 +5044,7 @@ var CascaderContent = (0, import_react35.forwardRef)(
|
|
|
4986
5044
|
portalled = true,
|
|
4987
5045
|
...props
|
|
4988
5046
|
}, ref) => {
|
|
4989
|
-
const content = /* @__PURE__ */ (0,
|
|
5047
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4990
5048
|
PopoverPrimitive3.Content,
|
|
4991
5049
|
{
|
|
4992
5050
|
ref,
|
|
@@ -4999,12 +5057,12 @@ var CascaderContent = (0, import_react35.forwardRef)(
|
|
|
4999
5057
|
}
|
|
5000
5058
|
);
|
|
5001
5059
|
if (!portalled) return content;
|
|
5002
|
-
return /* @__PURE__ */ (0,
|
|
5060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PopoverPrimitive3.Portal, { children: content });
|
|
5003
5061
|
}
|
|
5004
5062
|
);
|
|
5005
5063
|
CascaderContent.displayName = "CascaderContent";
|
|
5006
5064
|
var CascaderMenu = (0, import_react35.forwardRef)(
|
|
5007
|
-
({ children, className }, ref) => /* @__PURE__ */ (0,
|
|
5065
|
+
({ children, className }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { ref, className: cn("aviala-cascader-menu", className), children })
|
|
5008
5066
|
);
|
|
5009
5067
|
CascaderMenu.displayName = "CascaderMenu";
|
|
5010
5068
|
var CascaderColumn = (0, import_react35.forwardRef)(
|
|
@@ -5018,14 +5076,14 @@ var CascaderColumn = (0, import_react35.forwardRef)(
|
|
|
5018
5076
|
width: exitLayout.width,
|
|
5019
5077
|
zIndex: 0
|
|
5020
5078
|
} : void 0;
|
|
5021
|
-
return /* @__PURE__ */ (0,
|
|
5079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5022
5080
|
"div",
|
|
5023
5081
|
{
|
|
5024
5082
|
ref,
|
|
5025
5083
|
className: cn("aviala-cascader-column", className),
|
|
5026
5084
|
"data-animate": animate,
|
|
5027
5085
|
style: exitStyle,
|
|
5028
|
-
children: /* @__PURE__ */ (0,
|
|
5086
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "aviala-cascader-column__surface", "data-animate": animate, children })
|
|
5029
5087
|
}
|
|
5030
5088
|
);
|
|
5031
5089
|
}
|
|
@@ -5037,10 +5095,10 @@ function CascaderItemGroup({
|
|
|
5037
5095
|
children,
|
|
5038
5096
|
className
|
|
5039
5097
|
}) {
|
|
5040
|
-
return /* @__PURE__ */ (0,
|
|
5041
|
-
label ? /* @__PURE__ */ (0,
|
|
5042
|
-
/* @__PURE__ */ (0,
|
|
5043
|
-
showDivider ? /* @__PURE__ */ (0,
|
|
5098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: cn("aviala-cascader-group", className), children: [
|
|
5099
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: cn("aviala-cascader-label", typographyVariants({ level: "caption" })), children: label }) : null,
|
|
5100
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "aviala-cascader-group__slot", children }),
|
|
5101
|
+
showDivider ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "aviala-cascader-separator", role: "separator" }) : null
|
|
5044
5102
|
] });
|
|
5045
5103
|
}
|
|
5046
5104
|
var CascaderItem = (0, import_react35.forwardRef)(
|
|
@@ -5101,7 +5159,7 @@ var CascaderItem = (0, import_react35.forwardRef)(
|
|
|
5101
5159
|
expandTo(path);
|
|
5102
5160
|
}
|
|
5103
5161
|
};
|
|
5104
|
-
return /* @__PURE__ */ (0,
|
|
5162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
5105
5163
|
"button",
|
|
5106
5164
|
{
|
|
5107
5165
|
ref,
|
|
@@ -5133,10 +5191,10 @@ var CascaderItem = (0, import_react35.forwardRef)(
|
|
|
5133
5191
|
if (!isTitle) setHighlightedValue(value);
|
|
5134
5192
|
},
|
|
5135
5193
|
children: [
|
|
5136
|
-
isFormLeading && itemFunction === "form-radio" ? /* @__PURE__ */ (0,
|
|
5137
|
-
isFormLeading && itemFunction === "form-checkbox" ? /* @__PURE__ */ (0,
|
|
5194
|
+
isFormLeading && itemFunction === "form-radio" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CascaderItemFormRadio, {}) : null,
|
|
5195
|
+
isFormLeading && itemFunction === "form-checkbox" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CascaderItemFormCheckbox, {}) : null,
|
|
5138
5196
|
showLeftIcon && leftIcon ? renderItemIcon2(leftIcon, leftIconLevel, "cascader.content.item.icon-left") : null,
|
|
5139
|
-
/* @__PURE__ */ (0,
|
|
5197
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: cn("aviala-cascader-item__text", typographyVariants({ level: isTitle ? "caption" : "text" })), children: children ?? option?.label }),
|
|
5140
5198
|
showBadge ? renderBadgeSlot2(badge ?? "Text") : null,
|
|
5141
5199
|
showRightIcon && rightIcon ? renderItemIcon2(rightIcon, leftIconLevel) : null,
|
|
5142
5200
|
renderFunctionSlot2(
|
|
@@ -5261,7 +5319,7 @@ function CascaderOptionsMenu({ className }) {
|
|
|
5261
5319
|
}, COLUMN_ANIMATION_MS);
|
|
5262
5320
|
return () => window.clearTimeout(timeout);
|
|
5263
5321
|
}, [columns, open]);
|
|
5264
|
-
return /* @__PURE__ */ (0,
|
|
5322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CascaderMenu, { ref: menuRef, className, children: columns.map(({ pathPrefix, key, animateEnter, animateExit, exitLayout }) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5265
5323
|
CascaderColumn,
|
|
5266
5324
|
{
|
|
5267
5325
|
ref: (element) => {
|
|
@@ -5274,7 +5332,7 @@ function CascaderOptionsMenu({ className }) {
|
|
|
5274
5332
|
animateEnter,
|
|
5275
5333
|
animateExit,
|
|
5276
5334
|
exitLayout,
|
|
5277
|
-
children: /* @__PURE__ */ (0,
|
|
5335
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CascaderItemGroup, { label: "Title", showDivider: true, children: getOptionsAtPath2(pathPrefix).map((option) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5278
5336
|
CascaderItem,
|
|
5279
5337
|
{
|
|
5280
5338
|
value: option.value,
|
|
@@ -5312,7 +5370,7 @@ function CascaderField({
|
|
|
5312
5370
|
separator,
|
|
5313
5371
|
...triggerProps
|
|
5314
5372
|
}) {
|
|
5315
|
-
return /* @__PURE__ */ (0,
|
|
5373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
5316
5374
|
Cascader,
|
|
5317
5375
|
{
|
|
5318
5376
|
options,
|
|
@@ -5327,7 +5385,7 @@ function CascaderField({
|
|
|
5327
5385
|
changeOnSelect,
|
|
5328
5386
|
className,
|
|
5329
5387
|
children: [
|
|
5330
|
-
/* @__PURE__ */ (0,
|
|
5388
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5331
5389
|
CascaderTrigger,
|
|
5332
5390
|
{
|
|
5333
5391
|
size,
|
|
@@ -5341,7 +5399,7 @@ function CascaderField({
|
|
|
5341
5399
|
...triggerProps
|
|
5342
5400
|
}
|
|
5343
5401
|
),
|
|
5344
|
-
/* @__PURE__ */ (0,
|
|
5402
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CascaderContent, { className: contentClassName, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CascaderOptionsMenu, { className: menuClassName }) })
|
|
5345
5403
|
]
|
|
5346
5404
|
}
|
|
5347
5405
|
);
|
|
@@ -5349,18 +5407,18 @@ function CascaderField({
|
|
|
5349
5407
|
|
|
5350
5408
|
// src/components/date-picker/date-picker.tsx
|
|
5351
5409
|
var PopoverPrimitive4 = __toESM(require("@radix-ui/react-popover"), 1);
|
|
5352
|
-
var
|
|
5410
|
+
var import_icons12 = require("@aviala-design/icons");
|
|
5353
5411
|
var import_react39 = require("react");
|
|
5354
5412
|
|
|
5355
5413
|
// src/components/date-picker/date-picker-context.tsx
|
|
5356
5414
|
var import_react36 = require("react");
|
|
5357
|
-
var
|
|
5415
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
5358
5416
|
var DatePickerContext = (0, import_react36.createContext)(null);
|
|
5359
5417
|
function DatePickerProvider({
|
|
5360
5418
|
value,
|
|
5361
5419
|
children
|
|
5362
5420
|
}) {
|
|
5363
|
-
return /* @__PURE__ */ (0,
|
|
5421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DatePickerContext.Provider, { value, children });
|
|
5364
5422
|
}
|
|
5365
5423
|
function useDatePickerContext() {
|
|
5366
5424
|
const context = (0, import_react36.useContext)(DatePickerContext);
|
|
@@ -5581,7 +5639,7 @@ function stickyRoundIndex(fractionalIndex, stickiness = WHEEL_STICKY_AMOUNT) {
|
|
|
5581
5639
|
}
|
|
5582
5640
|
|
|
5583
5641
|
// src/components/date-picker/date-picker-time-wheel.tsx
|
|
5584
|
-
var
|
|
5642
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
5585
5643
|
var LOOP_SECTIONS = 3;
|
|
5586
5644
|
var MIDDLE_SECTION = 1;
|
|
5587
5645
|
function formatWheelValue(value) {
|
|
@@ -5821,23 +5879,23 @@ function DatePickerTimeWheelColumn({
|
|
|
5821
5879
|
}
|
|
5822
5880
|
};
|
|
5823
5881
|
const selectedOptionId = loop ? `${ariaLabel}-${value}-${values.length * MIDDLE_SECTION + getValueIndex(values, value)}` : `${ariaLabel}-${value}`;
|
|
5824
|
-
return /* @__PURE__ */ (0,
|
|
5825
|
-
/* @__PURE__ */ (0,
|
|
5826
|
-
/* @__PURE__ */ (0,
|
|
5882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: cn("aviala-datepicker-time__wheel", className), children: [
|
|
5883
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "aviala-datepicker-time__wheel-highlight", "aria-hidden": true }),
|
|
5884
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5827
5885
|
"div",
|
|
5828
5886
|
{
|
|
5829
5887
|
className: "aviala-datepicker-time__wheel-fade aviala-datepicker-time__wheel-fade--top",
|
|
5830
5888
|
"aria-hidden": true
|
|
5831
5889
|
}
|
|
5832
5890
|
),
|
|
5833
|
-
/* @__PURE__ */ (0,
|
|
5891
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5834
5892
|
"div",
|
|
5835
5893
|
{
|
|
5836
5894
|
className: "aviala-datepicker-time__wheel-fade aviala-datepicker-time__wheel-fade--bottom",
|
|
5837
5895
|
"aria-hidden": true
|
|
5838
5896
|
}
|
|
5839
5897
|
),
|
|
5840
|
-
/* @__PURE__ */ (0,
|
|
5898
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5841
5899
|
"div",
|
|
5842
5900
|
{
|
|
5843
5901
|
ref: scrollRef,
|
|
@@ -5848,17 +5906,17 @@ function DatePickerTimeWheelColumn({
|
|
|
5848
5906
|
"aria-activedescendant": selectedOptionId,
|
|
5849
5907
|
tabIndex: 0,
|
|
5850
5908
|
onKeyDown: handleKeyDown,
|
|
5851
|
-
children: /* @__PURE__ */ (0,
|
|
5909
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("ul", { className: "aviala-datepicker-time__wheel-list", children: repeatedValues.map((itemValue, index) => {
|
|
5852
5910
|
const isSelected = itemValue === value;
|
|
5853
5911
|
const optionId = loop ? `${ariaLabel}-${itemValue}-${index}` : `${ariaLabel}-${itemValue}`;
|
|
5854
|
-
return /* @__PURE__ */ (0,
|
|
5912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5855
5913
|
"li",
|
|
5856
5914
|
{
|
|
5857
5915
|
id: optionId,
|
|
5858
5916
|
className: "aviala-datepicker-time__wheel-item",
|
|
5859
5917
|
role: "option",
|
|
5860
5918
|
"aria-selected": isSelected,
|
|
5861
|
-
children: /* @__PURE__ */ (0,
|
|
5919
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5862
5920
|
"button",
|
|
5863
5921
|
{
|
|
5864
5922
|
type: "button",
|
|
@@ -5887,7 +5945,7 @@ function DatePickerTimeWheelColumn({
|
|
|
5887
5945
|
}
|
|
5888
5946
|
|
|
5889
5947
|
// src/components/date-picker/date-picker-month-wheels.tsx
|
|
5890
|
-
var
|
|
5948
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
5891
5949
|
var MONTH_VALUES = Array.from({ length: 12 }, (_, index) => index + 1);
|
|
5892
5950
|
function formatYearValue(value) {
|
|
5893
5951
|
return String(value);
|
|
@@ -5912,14 +5970,14 @@ function DatePickerMonthYearWheels({
|
|
|
5912
5970
|
const setYearMonth = (nextYear, nextMonth) => {
|
|
5913
5971
|
setViewMonth(new Date(nextYear, nextMonth - 1, 1));
|
|
5914
5972
|
};
|
|
5915
|
-
return /* @__PURE__ */ (0,
|
|
5973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5916
5974
|
"div",
|
|
5917
5975
|
{
|
|
5918
5976
|
className: cn("aviala-datepicker-month", className),
|
|
5919
5977
|
role: "group",
|
|
5920
5978
|
"aria-label": "\u9009\u62E9\u5E74\u6708",
|
|
5921
|
-
children: /* @__PURE__ */ (0,
|
|
5922
|
-
/* @__PURE__ */ (0,
|
|
5979
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "aviala-datepicker-month__columns", children: [
|
|
5980
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5923
5981
|
DatePickerTimeWheelColumn,
|
|
5924
5982
|
{
|
|
5925
5983
|
"aria-label": "\u5E74",
|
|
@@ -5931,7 +5989,7 @@ function DatePickerMonthYearWheels({
|
|
|
5931
5989
|
onChange: (nextYear) => setYearMonth(nextYear, month)
|
|
5932
5990
|
}
|
|
5933
5991
|
),
|
|
5934
|
-
/* @__PURE__ */ (0,
|
|
5992
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5935
5993
|
DatePickerTimeWheelColumn,
|
|
5936
5994
|
{
|
|
5937
5995
|
"aria-label": "\u6708",
|
|
@@ -5949,12 +6007,12 @@ function DatePickerMonthYearWheels({
|
|
|
5949
6007
|
}
|
|
5950
6008
|
|
|
5951
6009
|
// src/components/time-picker/time-picker-wheels.tsx
|
|
5952
|
-
var
|
|
6010
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
5953
6011
|
var TIME_PICKER_HOUR_VALUES = Array.from({ length: 24 }, (_, index) => index);
|
|
5954
6012
|
var TIME_PICKER_MINUTE_VALUES = Array.from({ length: 12 }, (_, index) => index * 5);
|
|
5955
6013
|
function TimePickerWheels({ value, onChange, className }) {
|
|
5956
|
-
return /* @__PURE__ */ (0,
|
|
5957
|
-
/* @__PURE__ */ (0,
|
|
6014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: cn("aviala-datepicker-time", className), role: "group", "aria-label": "\u9009\u62E9\u65F6\u95F4", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "aviala-datepicker-time__columns", children: [
|
|
6015
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5958
6016
|
DatePickerTimeWheelColumn,
|
|
5959
6017
|
{
|
|
5960
6018
|
"aria-label": "\u5C0F\u65F6",
|
|
@@ -5963,7 +6021,7 @@ function TimePickerWheels({ value, onChange, className }) {
|
|
|
5963
6021
|
onChange: (hours) => onChange({ ...value, hours })
|
|
5964
6022
|
}
|
|
5965
6023
|
),
|
|
5966
|
-
/* @__PURE__ */ (0,
|
|
6024
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5967
6025
|
DatePickerTimeWheelColumn,
|
|
5968
6026
|
{
|
|
5969
6027
|
"aria-label": "\u5206\u949F",
|
|
@@ -5976,7 +6034,7 @@ function TimePickerWheels({ value, onChange, className }) {
|
|
|
5976
6034
|
}
|
|
5977
6035
|
|
|
5978
6036
|
// src/components/date-picker/date-picker.tsx
|
|
5979
|
-
var
|
|
6037
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
5980
6038
|
function getInitialViewMonth(mode, singleValue, rangeValue) {
|
|
5981
6039
|
if (mode === "single" && singleValue) return startOfDay(singleValue);
|
|
5982
6040
|
if (mode === "range") {
|
|
@@ -6300,7 +6358,7 @@ function DatePicker(props) {
|
|
|
6300
6358
|
viewMonth
|
|
6301
6359
|
]
|
|
6302
6360
|
);
|
|
6303
|
-
return /* @__PURE__ */ (0,
|
|
6361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DatePickerProvider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PopoverPrimitive4.Root, { open, onOpenChange: handleOpenChange, modal: false, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: cn("inline-flex", className), children }) }) });
|
|
6304
6362
|
}
|
|
6305
6363
|
function formatTriggerValue(mode, singleValue, rangeValue, enableTime, timeValue, rangeSeparator) {
|
|
6306
6364
|
if (mode === "single") {
|
|
@@ -6392,7 +6450,7 @@ var DatePickerTrigger = (0, import_react39.forwardRef)(
|
|
|
6392
6450
|
const showEditableInput = editable && displayValue == null;
|
|
6393
6451
|
if (!showEditableInput) {
|
|
6394
6452
|
const hasValue = formatted != null && formatted !== false;
|
|
6395
|
-
return /* @__PURE__ */ (0,
|
|
6453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PopoverPrimitive4.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
6396
6454
|
"button",
|
|
6397
6455
|
{
|
|
6398
6456
|
type: "button",
|
|
@@ -6406,10 +6464,10 @@ var DatePickerTrigger = (0, import_react39.forwardRef)(
|
|
|
6406
6464
|
"aria-haspopup": "dialog",
|
|
6407
6465
|
children: [
|
|
6408
6466
|
renderSlotIcon(
|
|
6409
|
-
leftIcon ?? /* @__PURE__ */ (0,
|
|
6467
|
+
leftIcon ?? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_icons12.TimeAndDateDate, { level: "text", biggerSize: true, "aria-hidden": true }),
|
|
6410
6468
|
"aviala-datepicker-trigger__slot"
|
|
6411
6469
|
),
|
|
6412
|
-
/* @__PURE__ */ (0,
|
|
6470
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "aviala-datepicker-trigger__field", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6413
6471
|
"span",
|
|
6414
6472
|
{
|
|
6415
6473
|
className: cn(
|
|
@@ -6425,7 +6483,7 @@ var DatePickerTrigger = (0, import_react39.forwardRef)(
|
|
|
6425
6483
|
}
|
|
6426
6484
|
) });
|
|
6427
6485
|
}
|
|
6428
|
-
return /* @__PURE__ */ (0,
|
|
6486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PopoverPrimitive4.Anchor, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
6429
6487
|
"div",
|
|
6430
6488
|
{
|
|
6431
6489
|
className: cn("aviala-datepicker-trigger aviala-focus-ring", className),
|
|
@@ -6443,10 +6501,10 @@ var DatePickerTrigger = (0, import_react39.forwardRef)(
|
|
|
6443
6501
|
},
|
|
6444
6502
|
children: [
|
|
6445
6503
|
renderSlotIcon(
|
|
6446
|
-
leftIcon ?? /* @__PURE__ */ (0,
|
|
6504
|
+
leftIcon ?? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_icons12.TimeAndDateDate, { level: "text", biggerSize: true, "aria-hidden": true }),
|
|
6447
6505
|
"aviala-datepicker-trigger__slot"
|
|
6448
6506
|
),
|
|
6449
|
-
/* @__PURE__ */ (0,
|
|
6507
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "aviala-datepicker-trigger__field", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6450
6508
|
"input",
|
|
6451
6509
|
{
|
|
6452
6510
|
ref: setInputRefs,
|
|
@@ -6515,7 +6573,7 @@ var DatePickerContent = (0, import_react39.forwardRef)(
|
|
|
6515
6573
|
align = "start",
|
|
6516
6574
|
...props
|
|
6517
6575
|
}, ref) => {
|
|
6518
|
-
const content = /* @__PURE__ */ (0,
|
|
6576
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6519
6577
|
PopoverPrimitive4.Content,
|
|
6520
6578
|
{
|
|
6521
6579
|
ref,
|
|
@@ -6523,11 +6581,11 @@ var DatePickerContent = (0, import_react39.forwardRef)(
|
|
|
6523
6581
|
sideOffset,
|
|
6524
6582
|
align,
|
|
6525
6583
|
...props,
|
|
6526
|
-
children: children ?? /* @__PURE__ */ (0,
|
|
6584
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DatePickerCalendar, {})
|
|
6527
6585
|
}
|
|
6528
6586
|
);
|
|
6529
6587
|
if (!portalled) return content;
|
|
6530
|
-
return /* @__PURE__ */ (0,
|
|
6588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PopoverPrimitive4.Portal, { children: content });
|
|
6531
6589
|
}
|
|
6532
6590
|
);
|
|
6533
6591
|
DatePickerContent.displayName = "DatePickerContent";
|
|
@@ -6545,7 +6603,7 @@ function getFooterDateLabel(mode, singleValue, rangeValue) {
|
|
|
6545
6603
|
}
|
|
6546
6604
|
function DatePickerTimePanel() {
|
|
6547
6605
|
const { timeValue, setTimeValue } = useDatePickerContext();
|
|
6548
|
-
return /* @__PURE__ */ (0,
|
|
6606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TimePickerWheels, { value: timeValue, onChange: setTimeValue });
|
|
6549
6607
|
}
|
|
6550
6608
|
function DatePickerPanelFooter() {
|
|
6551
6609
|
const {
|
|
@@ -6560,7 +6618,7 @@ function DatePickerPanelFooter() {
|
|
|
6560
6618
|
if (!enableTime) return null;
|
|
6561
6619
|
const panelValue = activePanel === "time" ? "time" : "date";
|
|
6562
6620
|
const isRangeMode = mode === "range";
|
|
6563
|
-
return /* @__PURE__ */ (0,
|
|
6621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "aviala-datepicker-footer-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
6564
6622
|
SegmentatorGroup,
|
|
6565
6623
|
{
|
|
6566
6624
|
value: panelValue,
|
|
@@ -6571,20 +6629,20 @@ function DatePickerPanelFooter() {
|
|
|
6571
6629
|
"data-active-panel": activePanel,
|
|
6572
6630
|
"aria-label": "\u65E5\u671F\u4E0E\u65F6\u95F4\u5207\u6362",
|
|
6573
6631
|
children: [
|
|
6574
|
-
/* @__PURE__ */ (0,
|
|
6632
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6575
6633
|
SegmentatorItem,
|
|
6576
6634
|
{
|
|
6577
6635
|
value: "date",
|
|
6578
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
6636
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_icons12.TimeAndDateDate, { level: "text", biggerSize: true, "aria-hidden": true }),
|
|
6579
6637
|
iconOnly: isRangeMode && panelValue === "time",
|
|
6580
6638
|
children: getFooterDateLabel(mode, singleValue, rangeValue)
|
|
6581
6639
|
}
|
|
6582
6640
|
),
|
|
6583
|
-
/* @__PURE__ */ (0,
|
|
6641
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6584
6642
|
SegmentatorItem,
|
|
6585
6643
|
{
|
|
6586
6644
|
value: "time",
|
|
6587
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
6645
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_icons12.TimeAndDateClock, { level: "text", biggerSize: true, "aria-hidden": true }),
|
|
6588
6646
|
iconOnly: isRangeMode && panelValue === "date",
|
|
6589
6647
|
children: formatTimeValue(timeValue.hours, timeValue.minutes)
|
|
6590
6648
|
}
|
|
@@ -6752,8 +6810,8 @@ function DatePickerCalendar({ className }) {
|
|
|
6752
6810
|
}
|
|
6753
6811
|
};
|
|
6754
6812
|
const stepMonth = isMonthPanel ? 12 : 1;
|
|
6755
|
-
const renderDateContent = () => /* @__PURE__ */ (0,
|
|
6756
|
-
/* @__PURE__ */ (0,
|
|
6813
|
+
const renderDateContent = () => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
6814
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "aviala-datepicker-calendar__weekdays", "aria-hidden": true, children: WEEKDAY_LABELS.map((label) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6757
6815
|
"span",
|
|
6758
6816
|
{
|
|
6759
6817
|
className: cn(
|
|
@@ -6764,8 +6822,8 @@ function DatePickerCalendar({ className }) {
|
|
|
6764
6822
|
},
|
|
6765
6823
|
label
|
|
6766
6824
|
)) }),
|
|
6767
|
-
/* @__PURE__ */ (0,
|
|
6768
|
-
monthSlide && outgoingDays ? /* @__PURE__ */ (0,
|
|
6825
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "aviala-datepicker-calendar__grid-viewport", children: [
|
|
6826
|
+
monthSlide && outgoingDays ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6769
6827
|
"div",
|
|
6770
6828
|
{
|
|
6771
6829
|
className: "aviala-datepicker-calendar__grid",
|
|
@@ -6774,12 +6832,12 @@ function DatePickerCalendar({ className }) {
|
|
|
6774
6832
|
"aria-hidden": true,
|
|
6775
6833
|
children: outgoingDays.map((day) => {
|
|
6776
6834
|
const outside = !isSameMonth(day, monthSlide.outgoingMonth);
|
|
6777
|
-
return /* @__PURE__ */ (0,
|
|
6835
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6778
6836
|
"span",
|
|
6779
6837
|
{
|
|
6780
6838
|
className: "aviala-datepicker-day",
|
|
6781
6839
|
"data-outside": outside ? "true" : void 0,
|
|
6782
|
-
children: /* @__PURE__ */ (0,
|
|
6840
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6783
6841
|
"span",
|
|
6784
6842
|
{
|
|
6785
6843
|
className: cn(
|
|
@@ -6796,7 +6854,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6796
6854
|
},
|
|
6797
6855
|
`out-${monthSlide.outgoingMonth.getFullYear()}-${monthSlide.outgoingMonth.getMonth()}`
|
|
6798
6856
|
) : null,
|
|
6799
|
-
/* @__PURE__ */ (0,
|
|
6857
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6800
6858
|
"div",
|
|
6801
6859
|
{
|
|
6802
6860
|
ref: dayGridRef,
|
|
@@ -6820,7 +6878,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6820
6878
|
const dayDisabled = isDateDisabled(day, minDate, maxDate);
|
|
6821
6879
|
const focused = focusedDay ? isSameDay(day, focusedDay) : false;
|
|
6822
6880
|
const dayKey = formatIsoDate(day);
|
|
6823
|
-
return /* @__PURE__ */ (0,
|
|
6881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
6824
6882
|
"button",
|
|
6825
6883
|
{
|
|
6826
6884
|
type: "button",
|
|
@@ -6842,7 +6900,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6842
6900
|
onFocus: () => setFocusedDay(day),
|
|
6843
6901
|
onKeyDown: (event) => handleDayKeyDown(event, day),
|
|
6844
6902
|
children: [
|
|
6845
|
-
/* @__PURE__ */ (0,
|
|
6903
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6846
6904
|
"span",
|
|
6847
6905
|
{
|
|
6848
6906
|
className: cn(
|
|
@@ -6852,7 +6910,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6852
6910
|
children: day.getDate()
|
|
6853
6911
|
}
|
|
6854
6912
|
),
|
|
6855
|
-
isToday ? /* @__PURE__ */ (0,
|
|
6913
|
+
isToday ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "aviala-datepicker-day__today-dot", "aria-hidden": true }) : null
|
|
6856
6914
|
]
|
|
6857
6915
|
},
|
|
6858
6916
|
dayKey
|
|
@@ -6863,20 +6921,20 @@ function DatePickerCalendar({ className }) {
|
|
|
6863
6921
|
)
|
|
6864
6922
|
] })
|
|
6865
6923
|
] });
|
|
6866
|
-
const renderContentView = (view) => view === "month" ? /* @__PURE__ */ (0,
|
|
6867
|
-
const renderDatePanel = () => /* @__PURE__ */ (0,
|
|
6868
|
-
/* @__PURE__ */ (0,
|
|
6869
|
-
/* @__PURE__ */ (0,
|
|
6924
|
+
const renderContentView = (view) => view === "month" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DatePickerMonthYearWheels, { layoutKey: monthWheelLayoutKey }) : renderDateContent();
|
|
6925
|
+
const renderDatePanel = () => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
6926
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "aviala-datepicker-calendar__header", children: [
|
|
6927
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6870
6928
|
"button",
|
|
6871
6929
|
{
|
|
6872
6930
|
type: "button",
|
|
6873
6931
|
className: "aviala-datepicker-calendar__nav aviala-focus-ring",
|
|
6874
6932
|
"aria-label": isMonthPanel ? "Previous year" : "Previous month",
|
|
6875
6933
|
onClick: () => setViewMonth(addMonths(viewMonth, -stepMonth)),
|
|
6876
|
-
children: /* @__PURE__ */ (0,
|
|
6934
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_icons12.DirectionArrowLeft, { level: "text", biggerSize: true, "aria-hidden": true })
|
|
6877
6935
|
}
|
|
6878
6936
|
),
|
|
6879
|
-
/* @__PURE__ */ (0,
|
|
6937
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6880
6938
|
"button",
|
|
6881
6939
|
{
|
|
6882
6940
|
type: "button",
|
|
@@ -6889,7 +6947,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6889
6947
|
"aria-expanded": isMonthPanel,
|
|
6890
6948
|
"aria-label": isMonthPanel ? "\u5173\u95ED\u5E74\u6708\u9009\u62E9" : "\u9009\u62E9\u5E74\u6708",
|
|
6891
6949
|
onClick: () => setActivePanel(isMonthPanel ? "date" : "month"),
|
|
6892
|
-
children: /* @__PURE__ */ (0,
|
|
6950
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6893
6951
|
"span",
|
|
6894
6952
|
{
|
|
6895
6953
|
className: "aviala-datepicker-calendar__title-text",
|
|
@@ -6900,19 +6958,19 @@ function DatePickerCalendar({ className }) {
|
|
|
6900
6958
|
)
|
|
6901
6959
|
}
|
|
6902
6960
|
),
|
|
6903
|
-
/* @__PURE__ */ (0,
|
|
6961
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6904
6962
|
"button",
|
|
6905
6963
|
{
|
|
6906
6964
|
type: "button",
|
|
6907
6965
|
className: "aviala-datepicker-calendar__nav aviala-focus-ring",
|
|
6908
6966
|
"aria-label": isMonthPanel ? "Next year" : "Next month",
|
|
6909
6967
|
onClick: () => setViewMonth(addMonths(viewMonth, stepMonth)),
|
|
6910
|
-
children: /* @__PURE__ */ (0,
|
|
6968
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_icons12.DirectionArrowRight, { level: "text", biggerSize: true, "aria-hidden": true })
|
|
6911
6969
|
}
|
|
6912
6970
|
)
|
|
6913
6971
|
] }),
|
|
6914
|
-
/* @__PURE__ */ (0,
|
|
6915
|
-
viewCrossfade ? /* @__PURE__ */ (0,
|
|
6972
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "aviala-datepicker-calendar__view-viewport", children: [
|
|
6973
|
+
viewCrossfade ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6916
6974
|
"div",
|
|
6917
6975
|
{
|
|
6918
6976
|
className: "aviala-datepicker-calendar__view",
|
|
@@ -6923,7 +6981,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6923
6981
|
},
|
|
6924
6982
|
`exit-${viewCrossfade.outgoing}`
|
|
6925
6983
|
) : null,
|
|
6926
|
-
/* @__PURE__ */ (0,
|
|
6984
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6927
6985
|
"div",
|
|
6928
6986
|
{
|
|
6929
6987
|
className: "aviala-datepicker-calendar__view",
|
|
@@ -6944,16 +7002,16 @@ function DatePickerCalendar({ className }) {
|
|
|
6944
7002
|
)
|
|
6945
7003
|
] })
|
|
6946
7004
|
] });
|
|
6947
|
-
const renderPanel = (kind) => kind === "time" ? /* @__PURE__ */ (0,
|
|
6948
|
-
return /* @__PURE__ */ (0,
|
|
7005
|
+
const renderPanel = (kind) => kind === "time" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DatePickerTimePanel, {}) : renderDatePanel();
|
|
7006
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
6949
7007
|
"div",
|
|
6950
7008
|
{
|
|
6951
7009
|
className: cn("aviala-datepicker-calendar", className),
|
|
6952
7010
|
role: "application",
|
|
6953
7011
|
"aria-label": "Calendar",
|
|
6954
7012
|
children: [
|
|
6955
|
-
/* @__PURE__ */ (0,
|
|
6956
|
-
panelSlide ? /* @__PURE__ */ (0,
|
|
7013
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "aviala-datepicker-calendar__panel-viewport", children: [
|
|
7014
|
+
panelSlide ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6957
7015
|
"div",
|
|
6958
7016
|
{
|
|
6959
7017
|
className: "aviala-datepicker-calendar__panel aviala-datepicker-calendar__body",
|
|
@@ -6965,7 +7023,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6965
7023
|
},
|
|
6966
7024
|
`panel-exit-${panelSlide.outgoing}`
|
|
6967
7025
|
) : null,
|
|
6968
|
-
/* @__PURE__ */ (0,
|
|
7026
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6969
7027
|
"div",
|
|
6970
7028
|
{
|
|
6971
7029
|
className: "aviala-datepicker-calendar__panel aviala-datepicker-calendar__body",
|
|
@@ -6983,7 +7041,7 @@ function DatePickerCalendar({ className }) {
|
|
|
6983
7041
|
`panel-enter-${panel}`
|
|
6984
7042
|
)
|
|
6985
7043
|
] }),
|
|
6986
|
-
/* @__PURE__ */ (0,
|
|
7044
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DatePickerPanelFooter, {})
|
|
6987
7045
|
]
|
|
6988
7046
|
}
|
|
6989
7047
|
);
|
|
@@ -7047,8 +7105,8 @@ function DatePickerField({
|
|
|
7047
7105
|
defaultTimeValue,
|
|
7048
7106
|
onTimeChange
|
|
7049
7107
|
};
|
|
7050
|
-
return /* @__PURE__ */ (0,
|
|
7051
|
-
/* @__PURE__ */ (0,
|
|
7108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(DatePicker, { ...pickerProps, size, className, children: [
|
|
7109
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
7052
7110
|
DatePickerTrigger,
|
|
7053
7111
|
{
|
|
7054
7112
|
size,
|
|
@@ -7062,24 +7120,24 @@ function DatePickerField({
|
|
|
7062
7120
|
editable
|
|
7063
7121
|
}
|
|
7064
7122
|
),
|
|
7065
|
-
/* @__PURE__ */ (0,
|
|
7123
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DatePickerContent, { className: contentClassName, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DatePickerCalendar, { className: calendarClassName }) })
|
|
7066
7124
|
] });
|
|
7067
7125
|
}
|
|
7068
7126
|
|
|
7069
7127
|
// src/components/time-picker/time-picker.tsx
|
|
7070
7128
|
var PopoverPrimitive5 = __toESM(require("@radix-ui/react-popover"), 1);
|
|
7071
|
-
var
|
|
7129
|
+
var import_icons13 = require("@aviala-design/icons");
|
|
7072
7130
|
var import_react41 = require("react");
|
|
7073
7131
|
|
|
7074
7132
|
// src/components/time-picker/time-picker-context.tsx
|
|
7075
7133
|
var import_react40 = require("react");
|
|
7076
|
-
var
|
|
7134
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
7077
7135
|
var TimePickerContext = (0, import_react40.createContext)(null);
|
|
7078
7136
|
function TimePickerProvider({
|
|
7079
7137
|
value,
|
|
7080
7138
|
children
|
|
7081
7139
|
}) {
|
|
7082
|
-
return /* @__PURE__ */ (0,
|
|
7140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TimePickerContext.Provider, { value, children });
|
|
7083
7141
|
}
|
|
7084
7142
|
function useTimePickerContext() {
|
|
7085
7143
|
const context = (0, import_react40.useContext)(TimePickerContext);
|
|
@@ -7090,7 +7148,7 @@ function useTimePickerContext() {
|
|
|
7090
7148
|
}
|
|
7091
7149
|
|
|
7092
7150
|
// src/components/time-picker/time-picker.tsx
|
|
7093
|
-
var
|
|
7151
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
7094
7152
|
function TimePicker({
|
|
7095
7153
|
children,
|
|
7096
7154
|
value: valueProp,
|
|
@@ -7163,7 +7221,7 @@ function TimePicker({
|
|
|
7163
7221
|
}),
|
|
7164
7222
|
[disabled, open, size, value, setValue]
|
|
7165
7223
|
);
|
|
7166
|
-
return /* @__PURE__ */ (0,
|
|
7224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TimePickerProvider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(PopoverPrimitive5.Root, { open, onOpenChange: handleOpenChange, modal: false, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: cn("inline-flex", className), children }) }) });
|
|
7167
7225
|
}
|
|
7168
7226
|
var TimePickerTrigger = (0, import_react41.forwardRef)(
|
|
7169
7227
|
({
|
|
@@ -7183,7 +7241,7 @@ var TimePickerTrigger = (0, import_react41.forwardRef)(
|
|
|
7183
7241
|
const disabled = disabledProp ?? disabledContext;
|
|
7184
7242
|
const formatted = displayValue !== void 0 ? displayValue : formatTimeValue(value.hours, value.minutes);
|
|
7185
7243
|
const hasValue = formatted != null && formatted !== "";
|
|
7186
|
-
return /* @__PURE__ */ (0,
|
|
7244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(PopoverPrimitive5.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
7187
7245
|
"button",
|
|
7188
7246
|
{
|
|
7189
7247
|
ref,
|
|
@@ -7199,10 +7257,10 @@ var TimePickerTrigger = (0, import_react41.forwardRef)(
|
|
|
7199
7257
|
...props,
|
|
7200
7258
|
children: [
|
|
7201
7259
|
renderSlotIcon(
|
|
7202
|
-
leftIcon ?? /* @__PURE__ */ (0,
|
|
7260
|
+
leftIcon ?? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_icons13.TimeAndDateClock, { level: "text", biggerSize: true, "aria-hidden": true }),
|
|
7203
7261
|
"aviala-timepicker-trigger__slot"
|
|
7204
7262
|
),
|
|
7205
|
-
/* @__PURE__ */ (0,
|
|
7263
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "aviala-timepicker-trigger__field", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7206
7264
|
"span",
|
|
7207
7265
|
{
|
|
7208
7266
|
className: cn(
|
|
@@ -7229,7 +7287,7 @@ var TimePickerContent = (0, import_react41.forwardRef)(
|
|
|
7229
7287
|
align = "start",
|
|
7230
7288
|
...props
|
|
7231
7289
|
}, ref) => {
|
|
7232
|
-
const content = /* @__PURE__ */ (0,
|
|
7290
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7233
7291
|
PopoverPrimitive5.Content,
|
|
7234
7292
|
{
|
|
7235
7293
|
ref,
|
|
@@ -7237,17 +7295,17 @@ var TimePickerContent = (0, import_react41.forwardRef)(
|
|
|
7237
7295
|
sideOffset,
|
|
7238
7296
|
align,
|
|
7239
7297
|
...props,
|
|
7240
|
-
children: children ?? /* @__PURE__ */ (0,
|
|
7298
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TimePickerPanel, {})
|
|
7241
7299
|
}
|
|
7242
7300
|
);
|
|
7243
7301
|
if (!portalled) return content;
|
|
7244
|
-
return /* @__PURE__ */ (0,
|
|
7302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(PopoverPrimitive5.Portal, { children: content });
|
|
7245
7303
|
}
|
|
7246
7304
|
);
|
|
7247
7305
|
TimePickerContent.displayName = "TimePickerContent";
|
|
7248
7306
|
function TimePickerPanel({ className }) {
|
|
7249
7307
|
const { value, setValue } = useTimePickerContext();
|
|
7250
|
-
return /* @__PURE__ */ (0,
|
|
7308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: cn("aviala-timepicker-panel", className), role: "application", "aria-label": "Time picker", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TimePickerWheels, { value, onChange: setValue }) });
|
|
7251
7309
|
}
|
|
7252
7310
|
function TimePickerField({
|
|
7253
7311
|
contentClassName,
|
|
@@ -7267,7 +7325,7 @@ function TimePickerField({
|
|
|
7267
7325
|
onOpenChange,
|
|
7268
7326
|
disabled
|
|
7269
7327
|
}) {
|
|
7270
|
-
return /* @__PURE__ */ (0,
|
|
7328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
7271
7329
|
TimePicker,
|
|
7272
7330
|
{
|
|
7273
7331
|
value,
|
|
@@ -7280,7 +7338,7 @@ function TimePickerField({
|
|
|
7280
7338
|
size,
|
|
7281
7339
|
className,
|
|
7282
7340
|
children: [
|
|
7283
|
-
/* @__PURE__ */ (0,
|
|
7341
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7284
7342
|
TimePickerTrigger,
|
|
7285
7343
|
{
|
|
7286
7344
|
size,
|
|
@@ -7291,7 +7349,7 @@ function TimePickerField({
|
|
|
7291
7349
|
error
|
|
7292
7350
|
}
|
|
7293
7351
|
),
|
|
7294
|
-
/* @__PURE__ */ (0,
|
|
7352
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TimePickerContent, { className: contentClassName, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TimePickerPanel, { className: panelClassName }) })
|
|
7295
7353
|
]
|
|
7296
7354
|
}
|
|
7297
7355
|
);
|
|
@@ -7302,7 +7360,7 @@ var PopoverPrimitive6 = __toESM(require("@radix-ui/react-popover"), 1);
|
|
|
7302
7360
|
var import_react42 = require("react");
|
|
7303
7361
|
|
|
7304
7362
|
// src/components/overlay-pointer.tsx
|
|
7305
|
-
var
|
|
7363
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
7306
7364
|
var TOOLTIP_POINTER = {
|
|
7307
7365
|
width: 14,
|
|
7308
7366
|
height: 5,
|
|
@@ -7323,7 +7381,7 @@ function OverlayPointerSvg({
|
|
|
7323
7381
|
...props
|
|
7324
7382
|
}) {
|
|
7325
7383
|
const isPopover = variant === "popover";
|
|
7326
|
-
return /* @__PURE__ */ (0,
|
|
7384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7327
7385
|
"svg",
|
|
7328
7386
|
{
|
|
7329
7387
|
...props,
|
|
@@ -7336,16 +7394,16 @@ function OverlayPointerSvg({
|
|
|
7336
7394
|
"aria-hidden": true,
|
|
7337
7395
|
className,
|
|
7338
7396
|
style: { ...style, width, height },
|
|
7339
|
-
children: isPopover ? /* @__PURE__ */ (0,
|
|
7340
|
-
/* @__PURE__ */ (0,
|
|
7341
|
-
/* @__PURE__ */ (0,
|
|
7342
|
-
] }) : /* @__PURE__ */ (0,
|
|
7397
|
+
children: isPopover ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
7398
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("path", { d: path, className: "aviala-popover-content__arrow-outline" }),
|
|
7399
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("path", { d: path, className: "aviala-popover-content__arrow-fill" })
|
|
7400
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("path", { d: path })
|
|
7343
7401
|
}
|
|
7344
7402
|
);
|
|
7345
7403
|
}
|
|
7346
7404
|
|
|
7347
7405
|
// src/components/popover.tsx
|
|
7348
|
-
var
|
|
7406
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
7349
7407
|
function Popover({
|
|
7350
7408
|
open: openProp,
|
|
7351
7409
|
defaultOpen = false,
|
|
@@ -7363,7 +7421,7 @@ function Popover({
|
|
|
7363
7421
|
},
|
|
7364
7422
|
[isControlled, onOpenChange]
|
|
7365
7423
|
);
|
|
7366
|
-
return /* @__PURE__ */ (0,
|
|
7424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7367
7425
|
PopoverPrimitive6.Root,
|
|
7368
7426
|
{
|
|
7369
7427
|
open,
|
|
@@ -7386,12 +7444,13 @@ var PopoverContent = (0, import_react42.forwardRef)(
|
|
|
7386
7444
|
showArrow = false,
|
|
7387
7445
|
flush = false,
|
|
7388
7446
|
appearance = "default",
|
|
7447
|
+
level,
|
|
7389
7448
|
...props
|
|
7390
7449
|
}, ref) => {
|
|
7391
7450
|
const isDefaultAppearance = appearance === "default";
|
|
7392
|
-
const surfaceLevel = appearance === "tooltip" ? "caption" : "text";
|
|
7451
|
+
const surfaceLevel = level ?? (appearance === "tooltip" ? "caption" : "text");
|
|
7393
7452
|
const pointer = isDefaultAppearance ? POPOVER_POINTER : TOOLTIP_POINTER;
|
|
7394
|
-
const content = /* @__PURE__ */ (0,
|
|
7453
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
7395
7454
|
PopoverPrimitive6.Content,
|
|
7396
7455
|
{
|
|
7397
7456
|
ref,
|
|
@@ -7402,7 +7461,7 @@ var PopoverContent = (0, import_react42.forwardRef)(
|
|
|
7402
7461
|
className: cn("aviala-popover-content", className),
|
|
7403
7462
|
...props,
|
|
7404
7463
|
children: [
|
|
7405
|
-
/* @__PURE__ */ (0,
|
|
7464
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7406
7465
|
"div",
|
|
7407
7466
|
{
|
|
7408
7467
|
className: cn(
|
|
@@ -7413,13 +7472,13 @@ var PopoverContent = (0, import_react42.forwardRef)(
|
|
|
7413
7472
|
children
|
|
7414
7473
|
}
|
|
7415
7474
|
),
|
|
7416
|
-
showArrow ? /* @__PURE__ */ (0,
|
|
7475
|
+
showArrow ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7417
7476
|
PopoverPrimitive6.Arrow,
|
|
7418
7477
|
{
|
|
7419
7478
|
asChild: true,
|
|
7420
7479
|
width: pointer.width,
|
|
7421
7480
|
height: pointer.height,
|
|
7422
|
-
children: /* @__PURE__ */ (0,
|
|
7481
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7423
7482
|
OverlayPointerSvg,
|
|
7424
7483
|
{
|
|
7425
7484
|
variant: isDefaultAppearance ? "popover" : "default",
|
|
@@ -7435,7 +7494,7 @@ var PopoverContent = (0, import_react42.forwardRef)(
|
|
|
7435
7494
|
}
|
|
7436
7495
|
);
|
|
7437
7496
|
if (!portalled) return content;
|
|
7438
|
-
return /* @__PURE__ */ (0,
|
|
7497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(PopoverPrimitive6.Portal, { children: content });
|
|
7439
7498
|
}
|
|
7440
7499
|
);
|
|
7441
7500
|
PopoverContent.displayName = PopoverPrimitive6.Content.displayName;
|
|
@@ -7459,7 +7518,7 @@ function useCoarsePointer() {
|
|
|
7459
7518
|
}
|
|
7460
7519
|
|
|
7461
7520
|
// src/components/hover-popover.tsx
|
|
7462
|
-
var
|
|
7521
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
7463
7522
|
function HoverPopover({
|
|
7464
7523
|
content,
|
|
7465
7524
|
children,
|
|
@@ -7505,9 +7564,9 @@ function HoverPopover({
|
|
|
7505
7564
|
closeTimer.current = setTimeout(() => setOpen(false), closeDelay);
|
|
7506
7565
|
}, [clearTimers, closeDelay, setOpen]);
|
|
7507
7566
|
if (coarse) {
|
|
7508
|
-
return /* @__PURE__ */ (0,
|
|
7509
|
-
/* @__PURE__ */ (0,
|
|
7510
|
-
/* @__PURE__ */ (0,
|
|
7567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
|
|
7568
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(PopoverTrigger, { asChild: true, children }),
|
|
7569
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7511
7570
|
PopoverContent,
|
|
7512
7571
|
{
|
|
7513
7572
|
side,
|
|
@@ -7521,8 +7580,8 @@ function HoverPopover({
|
|
|
7521
7580
|
)
|
|
7522
7581
|
] });
|
|
7523
7582
|
}
|
|
7524
|
-
return /* @__PURE__ */ (0,
|
|
7525
|
-
/* @__PURE__ */ (0,
|
|
7583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
|
|
7584
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7526
7585
|
PopoverTrigger,
|
|
7527
7586
|
{
|
|
7528
7587
|
asChild: true,
|
|
@@ -7534,7 +7593,7 @@ function HoverPopover({
|
|
|
7534
7593
|
children
|
|
7535
7594
|
}
|
|
7536
7595
|
),
|
|
7537
|
-
/* @__PURE__ */ (0,
|
|
7596
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7538
7597
|
PopoverContent,
|
|
7539
7598
|
{
|
|
7540
7599
|
ref: contentRef,
|
|
@@ -7566,10 +7625,10 @@ function HoverPopover({
|
|
|
7566
7625
|
|
|
7567
7626
|
// src/components/modal.tsx
|
|
7568
7627
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
7569
|
-
var
|
|
7628
|
+
var import_icons14 = require("@aviala-design/icons");
|
|
7570
7629
|
var import_class_variance_authority10 = require("class-variance-authority");
|
|
7571
7630
|
var import_react45 = require("react");
|
|
7572
|
-
var
|
|
7631
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
7573
7632
|
var MODAL_ICON_SIZE = 16;
|
|
7574
7633
|
var modalContentVariants = (0, import_class_variance_authority10.cva)("aviala-modal-content", {
|
|
7575
7634
|
variants: {
|
|
@@ -7592,13 +7651,13 @@ function renderModalIcon(node) {
|
|
|
7592
7651
|
"shrink-0"
|
|
7593
7652
|
)
|
|
7594
7653
|
}) : node;
|
|
7595
|
-
return /* @__PURE__ */ (0,
|
|
7654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "aviala-modal__icon", "aria-hidden": true, children: content });
|
|
7596
7655
|
}
|
|
7597
7656
|
var Modal = DialogPrimitive.Root;
|
|
7598
7657
|
var ModalTrigger = DialogPrimitive.Trigger;
|
|
7599
7658
|
var ModalPortal = DialogPrimitive.Portal;
|
|
7600
7659
|
var ModalClose = DialogPrimitive.Close;
|
|
7601
|
-
var ModalOverlay = (0, import_react45.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
7660
|
+
var ModalOverlay = (0, import_react45.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
7602
7661
|
DialogPrimitive.Overlay,
|
|
7603
7662
|
{
|
|
7604
7663
|
ref,
|
|
@@ -7617,24 +7676,24 @@ var ModalContent = (0, import_react45.forwardRef)(
|
|
|
7617
7676
|
onOpenAutoFocus,
|
|
7618
7677
|
...props
|
|
7619
7678
|
}, ref) => {
|
|
7620
|
-
const overlay = showOverlay ? /* @__PURE__ */ (0,
|
|
7621
|
-
const panel = /* @__PURE__ */ (0,
|
|
7679
|
+
const overlay = showOverlay ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ModalOverlay, {}) : null;
|
|
7680
|
+
const panel = /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
7622
7681
|
DialogPrimitive.Content,
|
|
7623
7682
|
{
|
|
7624
7683
|
ref,
|
|
7625
7684
|
className: cn(modalContentVariants({ size }), className),
|
|
7626
7685
|
onOpenAutoFocus,
|
|
7627
7686
|
...props,
|
|
7628
|
-
children: /* @__PURE__ */ (0,
|
|
7687
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "aviala-modal-content__surface", children })
|
|
7629
7688
|
}
|
|
7630
7689
|
);
|
|
7631
7690
|
if (!portalled) {
|
|
7632
|
-
return /* @__PURE__ */ (0,
|
|
7691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
7633
7692
|
overlay,
|
|
7634
7693
|
panel
|
|
7635
7694
|
] });
|
|
7636
7695
|
}
|
|
7637
|
-
return /* @__PURE__ */ (0,
|
|
7696
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(DialogPrimitive.Portal, { children: [
|
|
7638
7697
|
overlay,
|
|
7639
7698
|
panel
|
|
7640
7699
|
] });
|
|
@@ -7650,10 +7709,10 @@ var ModalHeader = (0, import_react45.forwardRef)(
|
|
|
7650
7709
|
showClose = true,
|
|
7651
7710
|
closeLabel = "Close dialog",
|
|
7652
7711
|
...props
|
|
7653
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
7712
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { ref, className: cn("aviala-modal__header", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "aviala-modal__header-row", children: [
|
|
7654
7713
|
showIcon ? renderModalIcon(icon) : null,
|
|
7655
|
-
/* @__PURE__ */ (0,
|
|
7656
|
-
showClose ? /* @__PURE__ */ (0,
|
|
7714
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "aviala-modal__header-main", children }),
|
|
7715
|
+
showClose ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DialogPrimitive.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
7657
7716
|
Button,
|
|
7658
7717
|
{
|
|
7659
7718
|
type: "button",
|
|
@@ -7661,28 +7720,28 @@ var ModalHeader = (0, import_react45.forwardRef)(
|
|
|
7661
7720
|
iconOnly: true,
|
|
7662
7721
|
"aria-label": closeLabel,
|
|
7663
7722
|
className: "aviala-modal__close",
|
|
7664
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
7723
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_icons14.SymbolWrong, { "aria-hidden": true })
|
|
7665
7724
|
}
|
|
7666
7725
|
) }) : null
|
|
7667
7726
|
] }) })
|
|
7668
7727
|
);
|
|
7669
7728
|
ModalHeader.displayName = "ModalHeader";
|
|
7670
|
-
var ModalTitle = (0, import_react45.forwardRef)(({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
7729
|
+
var ModalTitle = (0, import_react45.forwardRef)(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DialogPrimitive.Title, { ref, asChild: true, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Typography, { level: "text", className: cn("aviala-modal__title", className), children }) }));
|
|
7671
7730
|
ModalTitle.displayName = DialogPrimitive.Title.displayName;
|
|
7672
|
-
var ModalDescription = (0, import_react45.forwardRef)(({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
7731
|
+
var ModalDescription = (0, import_react45.forwardRef)(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DialogPrimitive.Description, { ref, asChild: true, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Typography, { level: "caption", className: cn("aviala-modal__description", className), children }) }));
|
|
7673
7732
|
ModalDescription.displayName = DialogPrimitive.Description.displayName;
|
|
7674
7733
|
function ModalHeaderText({
|
|
7675
7734
|
title,
|
|
7676
7735
|
description,
|
|
7677
7736
|
...props
|
|
7678
7737
|
}) {
|
|
7679
|
-
return /* @__PURE__ */ (0,
|
|
7680
|
-
/* @__PURE__ */ (0,
|
|
7681
|
-
description ? /* @__PURE__ */ (0,
|
|
7738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ModalHeader, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "aviala-modal__header-typeface", children: [
|
|
7739
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ModalTitle, { children: title }),
|
|
7740
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ModalDescription, { children: description }) : null
|
|
7682
7741
|
] }) });
|
|
7683
7742
|
}
|
|
7684
7743
|
var ModalBody = (0, import_react45.forwardRef)(
|
|
7685
|
-
({ className, children, layout = "default", title, description, ...props }, ref) => /* @__PURE__ */ (0,
|
|
7744
|
+
({ className, children, layout = "default", title, description, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { ref, className: cn("aviala-modal__body", className), ...props, children: layout === "text" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
7686
7745
|
Typeface,
|
|
7687
7746
|
{
|
|
7688
7747
|
className: "aviala-modal__body-typeface",
|
|
@@ -7694,26 +7753,28 @@ var ModalBody = (0, import_react45.forwardRef)(
|
|
|
7694
7753
|
);
|
|
7695
7754
|
ModalBody.displayName = "ModalBody";
|
|
7696
7755
|
var ModalFooter = (0, import_react45.forwardRef)(
|
|
7697
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
7756
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { ref, className: cn("aviala-modal__footer", className), ...props })
|
|
7698
7757
|
);
|
|
7699
7758
|
ModalFooter.displayName = "ModalFooter";
|
|
7700
7759
|
|
|
7701
7760
|
// src/components/tooltip.tsx
|
|
7702
7761
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
7703
7762
|
var import_react46 = require("react");
|
|
7704
|
-
var
|
|
7763
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
7705
7764
|
var TOOLTIP_DELAY_DURATION = 300;
|
|
7706
7765
|
function TooltipProvider({
|
|
7766
|
+
children,
|
|
7707
7767
|
delayDuration = TOOLTIP_DELAY_DURATION,
|
|
7708
7768
|
skipDelayDuration = 0,
|
|
7709
7769
|
...props
|
|
7710
7770
|
}) {
|
|
7711
|
-
return /* @__PURE__ */ (0,
|
|
7771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
7712
7772
|
TooltipPrimitive.Provider,
|
|
7713
7773
|
{
|
|
7714
7774
|
delayDuration,
|
|
7715
7775
|
skipDelayDuration,
|
|
7716
|
-
...props
|
|
7776
|
+
...props,
|
|
7777
|
+
children
|
|
7717
7778
|
}
|
|
7718
7779
|
);
|
|
7719
7780
|
}
|
|
@@ -7726,8 +7787,9 @@ var TooltipContent = (0, import_react46.forwardRef)(
|
|
|
7726
7787
|
sideOffset = 4,
|
|
7727
7788
|
collisionPadding = 8,
|
|
7728
7789
|
showArrow = true,
|
|
7790
|
+
level = "caption",
|
|
7729
7791
|
...props
|
|
7730
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
7792
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
7731
7793
|
TooltipPrimitive.Content,
|
|
7732
7794
|
{
|
|
7733
7795
|
ref,
|
|
@@ -7736,14 +7798,23 @@ var TooltipContent = (0, import_react46.forwardRef)(
|
|
|
7736
7798
|
className: cn("aviala-tooltip-content", className),
|
|
7737
7799
|
...props,
|
|
7738
7800
|
children: [
|
|
7739
|
-
/* @__PURE__ */ (0,
|
|
7740
|
-
|
|
7801
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
7802
|
+
"div",
|
|
7803
|
+
{
|
|
7804
|
+
className: cn(
|
|
7805
|
+
"aviala-tooltip-content__surface",
|
|
7806
|
+
typographyVariants({ level })
|
|
7807
|
+
),
|
|
7808
|
+
children
|
|
7809
|
+
}
|
|
7810
|
+
),
|
|
7811
|
+
showArrow ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
7741
7812
|
TooltipPrimitive.Arrow,
|
|
7742
7813
|
{
|
|
7743
7814
|
asChild: true,
|
|
7744
7815
|
width: TOOLTIP_POINTER.width,
|
|
7745
7816
|
height: TOOLTIP_POINTER.height,
|
|
7746
|
-
children: /* @__PURE__ */ (0,
|
|
7817
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
7747
7818
|
OverlayPointerSvg,
|
|
7748
7819
|
{
|
|
7749
7820
|
className: "aviala-tooltip-content__arrow",
|
|
@@ -7761,7 +7832,7 @@ var TooltipContent = (0, import_react46.forwardRef)(
|
|
|
7761
7832
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
7762
7833
|
|
|
7763
7834
|
// src/components/responsive-tooltip.tsx
|
|
7764
|
-
var
|
|
7835
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
7765
7836
|
function ResponsiveTooltip({
|
|
7766
7837
|
content,
|
|
7767
7838
|
children,
|
|
@@ -7770,6 +7841,7 @@ function ResponsiveTooltip({
|
|
|
7770
7841
|
sideOffset = 4,
|
|
7771
7842
|
collisionPadding = 8,
|
|
7772
7843
|
showArrow = true,
|
|
7844
|
+
level = "caption",
|
|
7773
7845
|
delayDuration = TOOLTIP_DELAY_DURATION,
|
|
7774
7846
|
open,
|
|
7775
7847
|
defaultOpen,
|
|
@@ -7778,12 +7850,13 @@ function ResponsiveTooltip({
|
|
|
7778
7850
|
}) {
|
|
7779
7851
|
const coarse = useCoarsePointer();
|
|
7780
7852
|
if (coarse) {
|
|
7781
|
-
return /* @__PURE__ */ (0,
|
|
7782
|
-
/* @__PURE__ */ (0,
|
|
7783
|
-
/* @__PURE__ */ (0,
|
|
7853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Popover, { open, defaultOpen, onOpenChange, children: [
|
|
7854
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(PopoverTrigger, { asChild: true, children }),
|
|
7855
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7784
7856
|
PopoverContent,
|
|
7785
7857
|
{
|
|
7786
7858
|
appearance: "tooltip",
|
|
7859
|
+
level,
|
|
7787
7860
|
side,
|
|
7788
7861
|
align,
|
|
7789
7862
|
sideOffset,
|
|
@@ -7795,7 +7868,7 @@ function ResponsiveTooltip({
|
|
|
7795
7868
|
)
|
|
7796
7869
|
] });
|
|
7797
7870
|
}
|
|
7798
|
-
return /* @__PURE__ */ (0,
|
|
7871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
7799
7872
|
Tooltip,
|
|
7800
7873
|
{
|
|
7801
7874
|
delayDuration,
|
|
@@ -7803,8 +7876,8 @@ function ResponsiveTooltip({
|
|
|
7803
7876
|
defaultOpen,
|
|
7804
7877
|
onOpenChange,
|
|
7805
7878
|
children: [
|
|
7806
|
-
/* @__PURE__ */ (0,
|
|
7807
|
-
/* @__PURE__ */ (0,
|
|
7879
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TooltipTrigger, { asChild: true, children }),
|
|
7880
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7808
7881
|
TooltipContent,
|
|
7809
7882
|
{
|
|
7810
7883
|
side,
|
|
@@ -7812,6 +7885,7 @@ function ResponsiveTooltip({
|
|
|
7812
7885
|
sideOffset,
|
|
7813
7886
|
collisionPadding,
|
|
7814
7887
|
showArrow,
|
|
7888
|
+
level,
|
|
7815
7889
|
className: contentClassName,
|
|
7816
7890
|
children: content
|
|
7817
7891
|
}
|
|
@@ -7823,9 +7897,9 @@ function ResponsiveTooltip({
|
|
|
7823
7897
|
|
|
7824
7898
|
// src/components/feedback.tsx
|
|
7825
7899
|
var import_class_variance_authority11 = require("class-variance-authority");
|
|
7826
|
-
var
|
|
7900
|
+
var import_icons15 = require("@aviala-design/icons");
|
|
7827
7901
|
var import_react47 = require("react");
|
|
7828
|
-
var
|
|
7902
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
7829
7903
|
var FEEDBACK_ICON_SIZE = 22;
|
|
7830
7904
|
var feedbackVariants = (0, import_class_variance_authority11.cva)("aviala-feedback", {
|
|
7831
7905
|
variants: {
|
|
@@ -7861,22 +7935,22 @@ function renderFeedbackIcon(node) {
|
|
|
7861
7935
|
"shrink-0"
|
|
7862
7936
|
)
|
|
7863
7937
|
}) : node;
|
|
7864
|
-
return /* @__PURE__ */ (0,
|
|
7938
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "aviala-feedback__icon", "aria-hidden": true, children: content });
|
|
7865
7939
|
}
|
|
7866
7940
|
function defaultStatusIcon(type, mode) {
|
|
7867
7941
|
const iconMode = mode === "primary" ? "fill" : "default";
|
|
7868
7942
|
const thickness = "Regular";
|
|
7869
7943
|
switch (type) {
|
|
7870
7944
|
case "information":
|
|
7871
|
-
return /* @__PURE__ */ (0,
|
|
7945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_icons15.SymbolInformationCircle, { thickness, mode: iconMode, "aria-hidden": true });
|
|
7872
7946
|
case "warning":
|
|
7873
|
-
return /* @__PURE__ */ (0,
|
|
7947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_icons15.SymbolWarningCircle, { thickness, mode: iconMode, "aria-hidden": true });
|
|
7874
7948
|
case "wrong":
|
|
7875
|
-
return /* @__PURE__ */ (0,
|
|
7949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_icons15.SymbolWrongCircle, { thickness, mode: iconMode, "aria-hidden": true });
|
|
7876
7950
|
case "success":
|
|
7877
|
-
return /* @__PURE__ */ (0,
|
|
7951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_icons15.SymbolRightCircle, { thickness, mode: iconMode, "aria-hidden": true });
|
|
7878
7952
|
case "normal":
|
|
7879
|
-
return /* @__PURE__ */ (0,
|
|
7953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_icons15.GeneralNotification, { thickness, mode: "default", "aria-hidden": true });
|
|
7880
7954
|
}
|
|
7881
7955
|
}
|
|
7882
7956
|
var Feedback = (0, import_react47.forwardRef)(
|
|
@@ -7901,7 +7975,7 @@ var Feedback = (0, import_react47.forwardRef)(
|
|
|
7901
7975
|
const tone = mode === "primary" ? "white" : "default";
|
|
7902
7976
|
const isSmall = resolvedSize === "small";
|
|
7903
7977
|
const resolvedRole = resolvedType === "wrong" ? "alert" : "status";
|
|
7904
|
-
return /* @__PURE__ */ (0,
|
|
7978
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
7905
7979
|
"div",
|
|
7906
7980
|
{
|
|
7907
7981
|
ref,
|
|
@@ -7915,9 +7989,9 @@ var Feedback = (0, import_react47.forwardRef)(
|
|
|
7915
7989
|
"data-size": resolvedSize,
|
|
7916
7990
|
"data-mode": mode,
|
|
7917
7991
|
...props,
|
|
7918
|
-
children: /* @__PURE__ */ (0,
|
|
7992
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "aviala-feedback__body", children: [
|
|
7919
7993
|
renderFeedbackIcon(icon ?? defaultStatusIcon(resolvedType, mode)),
|
|
7920
|
-
isSmall ? /* @__PURE__ */ (0,
|
|
7994
|
+
isSmall ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Typography, { level: "text", tone, className: "aviala-feedback__title", children: title }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
7921
7995
|
Typeface,
|
|
7922
7996
|
{
|
|
7923
7997
|
className: "aviala-feedback__typeface",
|
|
@@ -7927,7 +8001,7 @@ var Feedback = (0, import_react47.forwardRef)(
|
|
|
7927
8001
|
tone
|
|
7928
8002
|
}
|
|
7929
8003
|
),
|
|
7930
|
-
action ? /* @__PURE__ */ (0,
|
|
8004
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
7931
8005
|
Link,
|
|
7932
8006
|
{
|
|
7933
8007
|
level: "text",
|
|
@@ -7943,7 +8017,7 @@ var Feedback = (0, import_react47.forwardRef)(
|
|
|
7943
8017
|
children: action
|
|
7944
8018
|
}
|
|
7945
8019
|
) : null,
|
|
7946
|
-
showClose ? /* @__PURE__ */ (0,
|
|
8020
|
+
showClose ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
7947
8021
|
Link,
|
|
7948
8022
|
{
|
|
7949
8023
|
level: "text",
|
|
@@ -7952,7 +8026,7 @@ var Feedback = (0, import_react47.forwardRef)(
|
|
|
7952
8026
|
href: onClose ? "#" : void 0,
|
|
7953
8027
|
"aria-label": closeLabel,
|
|
7954
8028
|
className: "aviala-feedback__close",
|
|
7955
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
8029
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_icons15.SymbolWrong, { "aria-hidden": true }),
|
|
7956
8030
|
onClick: (event) => {
|
|
7957
8031
|
if (onClose) {
|
|
7958
8032
|
event.preventDefault();
|
|
@@ -7969,10 +8043,10 @@ var Feedback = (0, import_react47.forwardRef)(
|
|
|
7969
8043
|
Feedback.displayName = "Feedback";
|
|
7970
8044
|
|
|
7971
8045
|
// src/components/alert.tsx
|
|
7972
|
-
var
|
|
8046
|
+
var import_icons16 = require("@aviala-design/icons");
|
|
7973
8047
|
var import_class_variance_authority12 = require("class-variance-authority");
|
|
7974
8048
|
var import_react48 = require("react");
|
|
7975
|
-
var
|
|
8049
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
7976
8050
|
var ALERT_ICON_SIZE = 16;
|
|
7977
8051
|
var alertVariants = (0, import_class_variance_authority12.cva)("aviala-alert", {
|
|
7978
8052
|
variants: {
|
|
@@ -8008,20 +8082,20 @@ function renderAlertIcon(node) {
|
|
|
8008
8082
|
"shrink-0"
|
|
8009
8083
|
)
|
|
8010
8084
|
}) : node;
|
|
8011
|
-
return /* @__PURE__ */ (0,
|
|
8085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "aviala-alert__icon", "aria-hidden": true, children: content });
|
|
8012
8086
|
}
|
|
8013
8087
|
function defaultStatusIcon2(type) {
|
|
8014
8088
|
const iconProps = { thickness: "Regular", mode: "fill", "aria-hidden": true };
|
|
8015
8089
|
switch (type) {
|
|
8016
8090
|
case "info":
|
|
8017
8091
|
case "neutral":
|
|
8018
|
-
return /* @__PURE__ */ (0,
|
|
8092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_icons16.SymbolInformationCircle, { ...iconProps });
|
|
8019
8093
|
case "warning":
|
|
8020
|
-
return /* @__PURE__ */ (0,
|
|
8094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_icons16.SymbolWarningCircle, { ...iconProps });
|
|
8021
8095
|
case "error":
|
|
8022
|
-
return /* @__PURE__ */ (0,
|
|
8096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_icons16.SymbolWrongCircle, { ...iconProps });
|
|
8023
8097
|
case "success":
|
|
8024
|
-
return /* @__PURE__ */ (0,
|
|
8098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_icons16.SymbolRightCircle, { ...iconProps });
|
|
8025
8099
|
}
|
|
8026
8100
|
}
|
|
8027
8101
|
var Alert = (0, import_react48.forwardRef)(
|
|
@@ -8050,7 +8124,7 @@ var Alert = (0, import_react48.forwardRef)(
|
|
|
8050
8124
|
const resolvedType = type ?? "info";
|
|
8051
8125
|
const resolvedRole = resolvedType === "error" ? "alert" : "status";
|
|
8052
8126
|
const hasActions = showActions && (action || secondaryAction);
|
|
8053
|
-
return /* @__PURE__ */ (0,
|
|
8127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
8054
8128
|
"div",
|
|
8055
8129
|
{
|
|
8056
8130
|
ref,
|
|
@@ -8062,9 +8136,9 @@ var Alert = (0, import_react48.forwardRef)(
|
|
|
8062
8136
|
"data-appearance": appearance,
|
|
8063
8137
|
...props,
|
|
8064
8138
|
children: [
|
|
8065
|
-
/* @__PURE__ */ (0,
|
|
8139
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "aviala-alert__body", children: [
|
|
8066
8140
|
showIcon ? renderAlertIcon(icon ?? defaultStatusIcon2(resolvedType)) : null,
|
|
8067
|
-
isSmall ? /* @__PURE__ */ (0,
|
|
8141
|
+
isSmall ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Typography, { level: "text", className: "aviala-alert__title", children: title }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8068
8142
|
Typeface,
|
|
8069
8143
|
{
|
|
8070
8144
|
className: "aviala-alert__typeface",
|
|
@@ -8073,7 +8147,7 @@ var Alert = (0, import_react48.forwardRef)(
|
|
|
8073
8147
|
secondary: description
|
|
8074
8148
|
}
|
|
8075
8149
|
),
|
|
8076
|
-
quickAction ? /* @__PURE__ */ (0,
|
|
8150
|
+
quickAction ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8077
8151
|
Link,
|
|
8078
8152
|
{
|
|
8079
8153
|
level: "text",
|
|
@@ -8089,7 +8163,7 @@ var Alert = (0, import_react48.forwardRef)(
|
|
|
8089
8163
|
children: quickAction
|
|
8090
8164
|
}
|
|
8091
8165
|
) : null,
|
|
8092
|
-
dismissible ? /* @__PURE__ */ (0,
|
|
8166
|
+
dismissible ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8093
8167
|
Link,
|
|
8094
8168
|
{
|
|
8095
8169
|
level: "text",
|
|
@@ -8098,7 +8172,7 @@ var Alert = (0, import_react48.forwardRef)(
|
|
|
8098
8172
|
href: onDismiss ? "#" : void 0,
|
|
8099
8173
|
"aria-label": closeLabel,
|
|
8100
8174
|
className: "aviala-alert__close",
|
|
8101
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
8175
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_icons16.SymbolWrong, { "aria-hidden": true }),
|
|
8102
8176
|
onClick: (event) => {
|
|
8103
8177
|
if (onDismiss) {
|
|
8104
8178
|
event.preventDefault();
|
|
@@ -8108,8 +8182,8 @@ var Alert = (0, import_react48.forwardRef)(
|
|
|
8108
8182
|
}
|
|
8109
8183
|
) : null
|
|
8110
8184
|
] }),
|
|
8111
|
-
hasActions ? /* @__PURE__ */ (0,
|
|
8112
|
-
action ? /* @__PURE__ */ (0,
|
|
8185
|
+
hasActions ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "aviala-alert__actions", children: [
|
|
8186
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8113
8187
|
Link,
|
|
8114
8188
|
{
|
|
8115
8189
|
level: "caption",
|
|
@@ -8125,7 +8199,7 @@ var Alert = (0, import_react48.forwardRef)(
|
|
|
8125
8199
|
children: action
|
|
8126
8200
|
}
|
|
8127
8201
|
) : null,
|
|
8128
|
-
secondaryAction ? /* @__PURE__ */ (0,
|
|
8202
|
+
secondaryAction ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8129
8203
|
Link,
|
|
8130
8204
|
{
|
|
8131
8205
|
level: "caption",
|
|
@@ -8150,32 +8224,32 @@ var Alert = (0, import_react48.forwardRef)(
|
|
|
8150
8224
|
Alert.displayName = "Alert";
|
|
8151
8225
|
|
|
8152
8226
|
// src/components/list.tsx
|
|
8153
|
-
var
|
|
8227
|
+
var import_icons17 = require("@aviala-design/icons");
|
|
8154
8228
|
var import_react49 = require("react");
|
|
8155
|
-
var
|
|
8229
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
8156
8230
|
var List = (0, import_react49.forwardRef)(
|
|
8157
|
-
({ className, title, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
8158
|
-
title != null ? /* @__PURE__ */ (0,
|
|
8159
|
-
/* @__PURE__ */ (0,
|
|
8231
|
+
({ className, title, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { ref, className: cn("aviala-list", className), ...props, children: [
|
|
8232
|
+
title != null ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ListTitle, { children: title }) : null,
|
|
8233
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ListGroup, { children })
|
|
8160
8234
|
] })
|
|
8161
8235
|
);
|
|
8162
8236
|
List.displayName = "List";
|
|
8163
8237
|
var ListTitle = (0, import_react49.forwardRef)(
|
|
8164
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
8238
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { ref, className: cn("aviala-list-title", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: cn(typographyVariants({ level: "text" })), children }) })
|
|
8165
8239
|
);
|
|
8166
8240
|
ListTitle.displayName = "ListTitle";
|
|
8167
8241
|
var ListGroup = (0, import_react49.forwardRef)(
|
|
8168
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
8242
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { ref, className: cn("aviala-list-group", className), role: "list", ...props, children })
|
|
8169
8243
|
);
|
|
8170
8244
|
ListGroup.displayName = "ListGroup";
|
|
8171
8245
|
function ListItemGroup({ label, children, className }) {
|
|
8172
|
-
return /* @__PURE__ */ (0,
|
|
8173
|
-
label != null ? /* @__PURE__ */ (0,
|
|
8174
|
-
/* @__PURE__ */ (0,
|
|
8246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: cn("aviala-list", className), children: [
|
|
8247
|
+
label != null ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ListTitle, { children: label }) : null,
|
|
8248
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ListGroup, { children })
|
|
8175
8249
|
] });
|
|
8176
8250
|
}
|
|
8177
8251
|
var ListDivider = (0, import_react49.forwardRef)(
|
|
8178
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
8252
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
8179
8253
|
"span",
|
|
8180
8254
|
{
|
|
8181
8255
|
ref,
|
|
@@ -8187,13 +8261,13 @@ var ListDivider = (0, import_react49.forwardRef)(
|
|
|
8187
8261
|
);
|
|
8188
8262
|
ListDivider.displayName = "ListDivider";
|
|
8189
8263
|
var ListSeparator = (0, import_react49.forwardRef)(
|
|
8190
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
8264
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("hr", { ref, className: cn("aviala-list-separator", className), ...props })
|
|
8191
8265
|
);
|
|
8192
8266
|
ListSeparator.displayName = "ListSeparator";
|
|
8193
8267
|
function renderLeadingIcon(node, leading) {
|
|
8194
8268
|
if (leading === "none") return null;
|
|
8195
8269
|
const iconSize = leading === "shaped" ? 20 : 22;
|
|
8196
|
-
const content = node ?? (leading === "shaped" ? /* @__PURE__ */ (0,
|
|
8270
|
+
const content = node ?? (leading === "shaped" ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_icons17.GeneralSetting, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_icons17.GeneralSetting, { "aria-hidden": true }));
|
|
8197
8271
|
const rendered = (0, import_react49.isValidElement)(content) && typeof content.type !== "string" ? (0, import_react49.cloneElement)(content, {
|
|
8198
8272
|
width: iconSize,
|
|
8199
8273
|
height: iconSize,
|
|
@@ -8202,7 +8276,7 @@ function renderLeadingIcon(node, leading) {
|
|
|
8202
8276
|
"shrink-0"
|
|
8203
8277
|
)
|
|
8204
8278
|
}) : content;
|
|
8205
|
-
return /* @__PURE__ */ (0,
|
|
8279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "aviala-list-item__icon", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
8206
8280
|
"span",
|
|
8207
8281
|
{
|
|
8208
8282
|
className: cn(
|
|
@@ -8240,45 +8314,45 @@ var ListItem = (0, import_react49.forwardRef)(
|
|
|
8240
8314
|
}, ref) => {
|
|
8241
8315
|
const isInteractive = interactive ?? (onClick != null || href != null);
|
|
8242
8316
|
const chevronVisible = showChevron ?? itemType === "action";
|
|
8243
|
-
const primaryAction = action ?? /* @__PURE__ */ (0,
|
|
8244
|
-
const chevron = chevronVisible ? /* @__PURE__ */ (0,
|
|
8317
|
+
const primaryAction = action ?? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Button, { mode: "primary", size: "regular", leftIcon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_icons17.GeneralSetting, { "aria-hidden": true }), children: actionLabel });
|
|
8318
|
+
const chevron = chevronVisible ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "aviala-list-item__chevron", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_icons17.DirectionArrowRightLight, { width: 18, height: 18 }) }) : null;
|
|
8245
8319
|
const renderTrailing = () => {
|
|
8246
8320
|
const hideActions = !showTrailing || trailing === null;
|
|
8247
8321
|
if (hideActions) {
|
|
8248
|
-
return chevron && itemType === "action" ? /* @__PURE__ */ (0,
|
|
8322
|
+
return chevron && itemType === "action" ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "aviala-list-item__more", children: chevron }) : null;
|
|
8249
8323
|
}
|
|
8250
8324
|
if (trailing !== void 0) return trailing;
|
|
8251
8325
|
switch (itemType) {
|
|
8252
8326
|
case "action":
|
|
8253
|
-
return /* @__PURE__ */ (0,
|
|
8254
|
-
/* @__PURE__ */ (0,
|
|
8327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "aviala-list-item__more", children: [
|
|
8328
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "aviala-list-item__trailing", children: [
|
|
8255
8329
|
primaryAction,
|
|
8256
|
-
secondaryAction ?? /* @__PURE__ */ (0,
|
|
8330
|
+
secondaryAction ?? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
8257
8331
|
Button,
|
|
8258
8332
|
{
|
|
8259
8333
|
mode: "default",
|
|
8260
8334
|
size: "regular",
|
|
8261
8335
|
iconOnly: true,
|
|
8262
8336
|
"aria-label": "More",
|
|
8263
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
8337
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_icons17.GeneralSetting, { "aria-hidden": true })
|
|
8264
8338
|
}
|
|
8265
8339
|
)
|
|
8266
8340
|
] }),
|
|
8267
|
-
/* @__PURE__ */ (0,
|
|
8341
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ListDivider, {}),
|
|
8268
8342
|
chevron
|
|
8269
8343
|
] });
|
|
8270
8344
|
case "switch":
|
|
8271
|
-
return /* @__PURE__ */ (0,
|
|
8345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "aviala-list-item__trailing", children: [
|
|
8272
8346
|
primaryAction,
|
|
8273
|
-
/* @__PURE__ */ (0,
|
|
8274
|
-
/* @__PURE__ */ (0,
|
|
8347
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ListDivider, {}),
|
|
8348
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Switch, { ...switchProps })
|
|
8275
8349
|
] });
|
|
8276
8350
|
case "select":
|
|
8277
8351
|
default:
|
|
8278
|
-
return /* @__PURE__ */ (0,
|
|
8352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "aviala-list-item__trailing", children: [
|
|
8279
8353
|
primaryAction,
|
|
8280
|
-
/* @__PURE__ */ (0,
|
|
8281
|
-
/* @__PURE__ */ (0,
|
|
8354
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ListDivider, {}),
|
|
8355
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "aviala-list-item__select", children: select })
|
|
8282
8356
|
] });
|
|
8283
8357
|
}
|
|
8284
8358
|
};
|
|
@@ -8292,15 +8366,15 @@ var ListItem = (0, import_react49.forwardRef)(
|
|
|
8292
8366
|
"data-top-divider": showTopDivider === void 0 ? void 0 : showTopDivider ? "true" : "false"
|
|
8293
8367
|
};
|
|
8294
8368
|
const trailingNode = renderTrailing();
|
|
8295
|
-
const body = /* @__PURE__ */ (0,
|
|
8369
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
8296
8370
|
renderLeadingIcon(icon, leading),
|
|
8297
|
-
/* @__PURE__ */ (0,
|
|
8298
|
-
/* @__PURE__ */ (0,
|
|
8371
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "aviala-list-item__body", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "aviala-list-item__content", children: [
|
|
8372
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "aviala-list-item__head", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Typeface, { content: "textCaption", primary: title, secondary: subtitle }) }),
|
|
8299
8373
|
trailingNode
|
|
8300
8374
|
] }) })
|
|
8301
8375
|
] });
|
|
8302
8376
|
if (href && !disabled) {
|
|
8303
|
-
return /* @__PURE__ */ (0,
|
|
8377
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
8304
8378
|
"a",
|
|
8305
8379
|
{
|
|
8306
8380
|
ref,
|
|
@@ -8316,7 +8390,7 @@ var ListItem = (0, import_react49.forwardRef)(
|
|
|
8316
8390
|
}
|
|
8317
8391
|
);
|
|
8318
8392
|
}
|
|
8319
|
-
return /* @__PURE__ */ (0,
|
|
8393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
8320
8394
|
"div",
|
|
8321
8395
|
{
|
|
8322
8396
|
ref,
|
|
@@ -8336,7 +8410,7 @@ ListItem.displayName = "ListItem";
|
|
|
8336
8410
|
var PopoverPrimitive7 = __toESM(require("@radix-ui/react-popover"), 1);
|
|
8337
8411
|
var import_react_slot5 = require("@radix-ui/react-slot");
|
|
8338
8412
|
var import_react50 = require("react");
|
|
8339
|
-
var
|
|
8413
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
8340
8414
|
function navigationItemButtonMode(active) {
|
|
8341
8415
|
return active ? "second" : "noBackgroundCustom";
|
|
8342
8416
|
}
|
|
@@ -8345,7 +8419,7 @@ function useNavigationDirection() {
|
|
|
8345
8419
|
return (0, import_react50.useContext)(NavigationDirectionContext);
|
|
8346
8420
|
}
|
|
8347
8421
|
var NAVIGATION_ANIMATION_MS_FALLBACK = 300;
|
|
8348
|
-
var NAVIGATION_ANIMATION_EASING_FALLBACK = "cubic-bezier(0.
|
|
8422
|
+
var NAVIGATION_ANIMATION_EASING_FALLBACK = "cubic-bezier(0.16, 1, 0.3, 1)";
|
|
8349
8423
|
function parseDurationMs(value) {
|
|
8350
8424
|
const trimmed = value.trim();
|
|
8351
8425
|
if (!trimmed) return NAVIGATION_ANIMATION_MS_FALLBACK;
|
|
@@ -8452,8 +8526,8 @@ function measureIndicatorFromElement(indicatorEl, groupEl) {
|
|
|
8452
8526
|
visible: indicatorEl.dataset.visible === "true"
|
|
8453
8527
|
};
|
|
8454
8528
|
}
|
|
8455
|
-
function
|
|
8456
|
-
return 1 - Math.pow(1 - t,
|
|
8529
|
+
function easeOutQuint(t) {
|
|
8530
|
+
return 1 - Math.pow(1 - t, 5);
|
|
8457
8531
|
}
|
|
8458
8532
|
function metricsApproxEqual2(a, b, epsilon = 0.5) {
|
|
8459
8533
|
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;
|
|
@@ -8577,7 +8651,7 @@ function useNavigationIndicator(groupRef, direction, layoutKey) {
|
|
|
8577
8651
|
if (!startVisible || !target.visible) {
|
|
8578
8652
|
syncIndicator(target, true);
|
|
8579
8653
|
} else {
|
|
8580
|
-
const eased =
|
|
8654
|
+
const eased = easeOutQuint(progress);
|
|
8581
8655
|
const groupRect = group.getBoundingClientRect();
|
|
8582
8656
|
const targetAbsX = groupRect.left + target.x;
|
|
8583
8657
|
const targetAbsY = groupRect.top + target.y;
|
|
@@ -8745,7 +8819,7 @@ var Navigation = (0, import_react50.forwardRef)(
|
|
|
8745
8819
|
direction = "vertical",
|
|
8746
8820
|
dividingLine = false,
|
|
8747
8821
|
...props
|
|
8748
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
8822
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(NavigationDirectionContext.Provider, { value: direction, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8749
8823
|
Tag2,
|
|
8750
8824
|
{
|
|
8751
8825
|
ref,
|
|
@@ -8759,7 +8833,7 @@ var Navigation = (0, import_react50.forwardRef)(
|
|
|
8759
8833
|
);
|
|
8760
8834
|
Navigation.displayName = "Navigation";
|
|
8761
8835
|
var NavigationBrand = (0, import_react50.forwardRef)(
|
|
8762
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
8836
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8763
8837
|
"div",
|
|
8764
8838
|
{
|
|
8765
8839
|
ref,
|
|
@@ -8771,24 +8845,24 @@ var NavigationBrand = (0, import_react50.forwardRef)(
|
|
|
8771
8845
|
NavigationBrand.displayName = "NavigationBrand";
|
|
8772
8846
|
var NavigationBrandTitle = (0, import_react50.forwardRef)(({ className, asChild = false, children, ...props }, ref) => {
|
|
8773
8847
|
const Comp = asChild ? import_react_slot5.Slot : "a";
|
|
8774
|
-
return /* @__PURE__ */ (0,
|
|
8848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8775
8849
|
Comp,
|
|
8776
8850
|
{
|
|
8777
8851
|
ref,
|
|
8778
8852
|
className: cn("aviala-navigation-brand__title aviala-focus-ring", className),
|
|
8779
8853
|
...props,
|
|
8780
|
-
children: asChild ? children : /* @__PURE__ */ (0,
|
|
8854
|
+
children: asChild ? children : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Typography, { level: "text", as: "span", children })
|
|
8781
8855
|
}
|
|
8782
8856
|
);
|
|
8783
8857
|
});
|
|
8784
8858
|
NavigationBrandTitle.displayName = "NavigationBrandTitle";
|
|
8785
|
-
var NavigationSection = (0, import_react50.forwardRef)(({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
8859
|
+
var NavigationSection = (0, import_react50.forwardRef)(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8786
8860
|
"div",
|
|
8787
8861
|
{
|
|
8788
8862
|
ref,
|
|
8789
8863
|
className: cn("aviala-navigation-section", className),
|
|
8790
8864
|
...props,
|
|
8791
|
-
children: /* @__PURE__ */ (0,
|
|
8865
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Typography, { level: "caption", as: "p", children })
|
|
8792
8866
|
}
|
|
8793
8867
|
));
|
|
8794
8868
|
NavigationSection.displayName = "NavigationSection";
|
|
@@ -8813,14 +8887,14 @@ var NavigationGroup = (0, import_react50.forwardRef)(
|
|
|
8813
8887
|
},
|
|
8814
8888
|
[ref]
|
|
8815
8889
|
);
|
|
8816
|
-
return /* @__PURE__ */ (0,
|
|
8890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
8817
8891
|
"div",
|
|
8818
8892
|
{
|
|
8819
8893
|
ref: setRefs,
|
|
8820
8894
|
className: cn("aviala-navigation-group", className),
|
|
8821
8895
|
...props,
|
|
8822
8896
|
children: [
|
|
8823
|
-
/* @__PURE__ */ (0,
|
|
8897
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8824
8898
|
"span",
|
|
8825
8899
|
{
|
|
8826
8900
|
ref: onIndicatorRef,
|
|
@@ -8846,7 +8920,7 @@ var NavigationItemGroup = (0, import_react50.forwardRef)(({ className, expanded,
|
|
|
8846
8920
|
if (isCollapsed) inner.setAttribute("inert", "");
|
|
8847
8921
|
else inner.removeAttribute("inert");
|
|
8848
8922
|
}, [isCollapsed]);
|
|
8849
|
-
return /* @__PURE__ */ (0,
|
|
8923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8850
8924
|
"div",
|
|
8851
8925
|
{
|
|
8852
8926
|
ref,
|
|
@@ -8854,7 +8928,7 @@ var NavigationItemGroup = (0, import_react50.forwardRef)(({ className, expanded,
|
|
|
8854
8928
|
"data-expanded": isCollapsible ? expanded ? "true" : "false" : void 0,
|
|
8855
8929
|
"aria-hidden": isCollapsed ? true : void 0,
|
|
8856
8930
|
...props,
|
|
8857
|
-
children: isCollapsible ? /* @__PURE__ */ (0,
|
|
8931
|
+
children: isCollapsible ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { ref: innerRef, className: "aviala-navigation-item-group__inner", children }) : children
|
|
8858
8932
|
}
|
|
8859
8933
|
);
|
|
8860
8934
|
});
|
|
@@ -8865,7 +8939,7 @@ function renderItemIcon3(node) {
|
|
|
8865
8939
|
level: "text",
|
|
8866
8940
|
biggerSize: true
|
|
8867
8941
|
});
|
|
8868
|
-
return /* @__PURE__ */ (0,
|
|
8942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "aviala-navigation-item__icon", children: content });
|
|
8869
8943
|
}
|
|
8870
8944
|
var NavigationItem = (0, import_react50.forwardRef)(
|
|
8871
8945
|
({
|
|
@@ -8882,9 +8956,9 @@ var NavigationItem = (0, import_react50.forwardRef)(
|
|
|
8882
8956
|
const Comp = asChild ? import_react_slot5.Slot : "a";
|
|
8883
8957
|
const isActive = active ?? ariaCurrent === "page";
|
|
8884
8958
|
const mode = navigationItemButtonMode(isActive);
|
|
8885
|
-
const controlContent = /* @__PURE__ */ (0,
|
|
8959
|
+
const controlContent = /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
8886
8960
|
renderItemIcon3(leftIcon),
|
|
8887
|
-
/* @__PURE__ */ (0,
|
|
8961
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8888
8962
|
Typography,
|
|
8889
8963
|
{
|
|
8890
8964
|
level: "text",
|
|
@@ -8893,15 +8967,15 @@ var NavigationItem = (0, import_react50.forwardRef)(
|
|
|
8893
8967
|
children
|
|
8894
8968
|
}
|
|
8895
8969
|
),
|
|
8896
|
-
rightIcon ? /* @__PURE__ */ (0,
|
|
8970
|
+
rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "aviala-navigation-item__chevron", children: renderItemIcon3(rightIcon) }) : null
|
|
8897
8971
|
] });
|
|
8898
|
-
return /* @__PURE__ */ (0,
|
|
8972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8899
8973
|
"span",
|
|
8900
8974
|
{
|
|
8901
8975
|
className: cn("aviala-navigation-item", className),
|
|
8902
8976
|
"data-item-type": itemType,
|
|
8903
8977
|
"data-active": isActive ? "true" : "false",
|
|
8904
|
-
children: /* @__PURE__ */ (0,
|
|
8978
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8905
8979
|
Comp,
|
|
8906
8980
|
{
|
|
8907
8981
|
ref,
|
|
@@ -8920,7 +8994,7 @@ var NavigationItem = (0, import_react50.forwardRef)(
|
|
|
8920
8994
|
}
|
|
8921
8995
|
);
|
|
8922
8996
|
NavigationItem.displayName = "NavigationItem";
|
|
8923
|
-
var NavigationActions = (0, import_react50.forwardRef)(({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
8997
|
+
var NavigationActions = (0, import_react50.forwardRef)(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8924
8998
|
"div",
|
|
8925
8999
|
{
|
|
8926
9000
|
ref,
|
|
@@ -8930,7 +9004,7 @@ var NavigationActions = (0, import_react50.forwardRef)(({ className, children, .
|
|
|
8930
9004
|
}
|
|
8931
9005
|
));
|
|
8932
9006
|
NavigationActions.displayName = "NavigationActions";
|
|
8933
|
-
var NavigationActionsSlot = (0, import_react50.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
9007
|
+
var NavigationActionsSlot = (0, import_react50.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8934
9008
|
"div",
|
|
8935
9009
|
{
|
|
8936
9010
|
ref,
|
|
@@ -9022,7 +9096,7 @@ function NavigationItemMenu({
|
|
|
9022
9096
|
},
|
|
9023
9097
|
[cancelClose, setOpen]
|
|
9024
9098
|
);
|
|
9025
|
-
return /* @__PURE__ */ (0,
|
|
9099
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(NavigationItemMenuContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Popover, { open, onOpenChange: handleOpenChange, children }) });
|
|
9026
9100
|
}
|
|
9027
9101
|
var NavigationItemMenuTrigger = (0, import_react50.forwardRef)(
|
|
9028
9102
|
({
|
|
@@ -9036,7 +9110,7 @@ var NavigationItemMenuTrigger = (0, import_react50.forwardRef)(
|
|
|
9036
9110
|
const menu = useNavigationItemMenuContext("NavigationItemMenuTrigger");
|
|
9037
9111
|
const isActive = active ?? menu.hasSelection;
|
|
9038
9112
|
const mode = navigationItemButtonMode(isActive);
|
|
9039
|
-
return /* @__PURE__ */ (0,
|
|
9113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9040
9114
|
"span",
|
|
9041
9115
|
{
|
|
9042
9116
|
className: cn("aviala-navigation-item", className),
|
|
@@ -9044,7 +9118,7 @@ var NavigationItemMenuTrigger = (0, import_react50.forwardRef)(
|
|
|
9044
9118
|
"data-active": isActive ? "true" : "false",
|
|
9045
9119
|
onMouseEnter: () => menu.openMenu(true),
|
|
9046
9120
|
onMouseLeave: menu.scheduleClose,
|
|
9047
|
-
children: /* @__PURE__ */ (0,
|
|
9121
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(PopoverPrimitive7.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
9048
9122
|
"button",
|
|
9049
9123
|
{
|
|
9050
9124
|
ref,
|
|
@@ -9057,7 +9131,7 @@ var NavigationItemMenuTrigger = (0, import_react50.forwardRef)(
|
|
|
9057
9131
|
...props,
|
|
9058
9132
|
children: [
|
|
9059
9133
|
renderItemIcon3(leftIcon),
|
|
9060
|
-
/* @__PURE__ */ (0,
|
|
9134
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9061
9135
|
Typography,
|
|
9062
9136
|
{
|
|
9063
9137
|
level: "text",
|
|
@@ -9066,7 +9140,7 @@ var NavigationItemMenuTrigger = (0, import_react50.forwardRef)(
|
|
|
9066
9140
|
children
|
|
9067
9141
|
}
|
|
9068
9142
|
),
|
|
9069
|
-
rightIcon ? /* @__PURE__ */ (0,
|
|
9143
|
+
rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "aviala-navigation-item__chevron", children: renderItemIcon3(rightIcon) }) : null
|
|
9070
9144
|
]
|
|
9071
9145
|
}
|
|
9072
9146
|
) })
|
|
@@ -9087,7 +9161,7 @@ var NavigationItemMenuContent = (0, import_react50.forwardRef)(
|
|
|
9087
9161
|
}, ref) => {
|
|
9088
9162
|
const direction = useNavigationDirection();
|
|
9089
9163
|
const menu = useNavigationItemMenuContext("NavigationItemMenuContent");
|
|
9090
|
-
return /* @__PURE__ */ (0,
|
|
9164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(PopoverPrimitive7.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9091
9165
|
PopoverPrimitive7.Content,
|
|
9092
9166
|
{
|
|
9093
9167
|
ref,
|
|
@@ -9122,7 +9196,7 @@ var NavigationItemMenuItem = (0, import_react50.forwardRef)(
|
|
|
9122
9196
|
}, ref) => {
|
|
9123
9197
|
const menu = useNavigationItemMenuContext("NavigationItemMenuItem");
|
|
9124
9198
|
const isSelected = selected ?? menu.value === value;
|
|
9125
|
-
return /* @__PURE__ */ (0,
|
|
9199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
9126
9200
|
"button",
|
|
9127
9201
|
{
|
|
9128
9202
|
ref,
|
|
@@ -9142,7 +9216,7 @@ var NavigationItemMenuItem = (0, import_react50.forwardRef)(
|
|
|
9142
9216
|
...props,
|
|
9143
9217
|
children: [
|
|
9144
9218
|
renderItemIcon3(leftIcon),
|
|
9145
|
-
/* @__PURE__ */ (0,
|
|
9219
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
9146
9220
|
Typography,
|
|
9147
9221
|
{
|
|
9148
9222
|
level: "text",
|
|
@@ -9151,7 +9225,7 @@ var NavigationItemMenuItem = (0, import_react50.forwardRef)(
|
|
|
9151
9225
|
children
|
|
9152
9226
|
}
|
|
9153
9227
|
),
|
|
9154
|
-
rightIcon ? /* @__PURE__ */ (0,
|
|
9228
|
+
rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "aviala-navigation-menu-item__trailing", children: renderItemIcon3(rightIcon) }) : null
|
|
9155
9229
|
]
|
|
9156
9230
|
}
|
|
9157
9231
|
);
|
|
@@ -9163,7 +9237,7 @@ NavigationItemMenuItem.displayName = "NavigationItemMenuItem";
|
|
|
9163
9237
|
var SliderPrimitive = __toESM(require("@radix-ui/react-slider"), 1);
|
|
9164
9238
|
var import_class_variance_authority13 = require("class-variance-authority");
|
|
9165
9239
|
var import_react51 = require("react");
|
|
9166
|
-
var
|
|
9240
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
9167
9241
|
var sliderVariants = (0, import_class_variance_authority13.cva)("aviala-slider", {
|
|
9168
9242
|
variants: {
|
|
9169
9243
|
size: {
|
|
@@ -9180,6 +9254,70 @@ var sliderVariants = (0, import_class_variance_authority13.cva)("aviala-slider",
|
|
|
9180
9254
|
type: "default"
|
|
9181
9255
|
}
|
|
9182
9256
|
});
|
|
9257
|
+
function SliderValueTooltip({
|
|
9258
|
+
open,
|
|
9259
|
+
children
|
|
9260
|
+
}) {
|
|
9261
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
9262
|
+
"span",
|
|
9263
|
+
{
|
|
9264
|
+
className: "aviala-slider__value-tooltip",
|
|
9265
|
+
"data-state": open ? "instant-open" : "closed",
|
|
9266
|
+
"aria-hidden": !open,
|
|
9267
|
+
children: [
|
|
9268
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
9269
|
+
"span",
|
|
9270
|
+
{
|
|
9271
|
+
className: cn(
|
|
9272
|
+
"aviala-slider__value-tooltip__surface",
|
|
9273
|
+
typographyVariants({ level: "caption" })
|
|
9274
|
+
),
|
|
9275
|
+
children
|
|
9276
|
+
}
|
|
9277
|
+
),
|
|
9278
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "aviala-slider__value-tooltip__arrow", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
9279
|
+
OverlayPointerSvg,
|
|
9280
|
+
{
|
|
9281
|
+
className: "aviala-tooltip-content__arrow",
|
|
9282
|
+
width: TOOLTIP_POINTER.width,
|
|
9283
|
+
height: TOOLTIP_POINTER.height,
|
|
9284
|
+
path: TOOLTIP_POINTER.path
|
|
9285
|
+
}
|
|
9286
|
+
) })
|
|
9287
|
+
]
|
|
9288
|
+
}
|
|
9289
|
+
);
|
|
9290
|
+
}
|
|
9291
|
+
function SliderThumb({
|
|
9292
|
+
index,
|
|
9293
|
+
value,
|
|
9294
|
+
showValueTooltip,
|
|
9295
|
+
formatValueTooltip,
|
|
9296
|
+
forceTooltipOpen,
|
|
9297
|
+
onThumbPointerDown
|
|
9298
|
+
}) {
|
|
9299
|
+
const [hoverOpen, setHoverOpen] = (0, import_react51.useState)(false);
|
|
9300
|
+
const tooltipOpen = Boolean(
|
|
9301
|
+
showValueTooltip && (forceTooltipOpen || hoverOpen)
|
|
9302
|
+
);
|
|
9303
|
+
const label = formatValueTooltip ? formatValueTooltip(value, index) : String(value);
|
|
9304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(SliderPrimitive.unstable_ThumbProvider, { children: [
|
|
9305
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
9306
|
+
SliderPrimitive.unstable_ThumbTrigger,
|
|
9307
|
+
{
|
|
9308
|
+
className: "aviala-slider__thumb aviala-focus-ring",
|
|
9309
|
+
onPointerDown: onThumbPointerDown,
|
|
9310
|
+
onPointerEnter: showValueTooltip ? () => setHoverOpen(true) : void 0,
|
|
9311
|
+
onPointerLeave: showValueTooltip ? () => setHoverOpen(false) : void 0,
|
|
9312
|
+
children: [
|
|
9313
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "aviala-slider__thumb-face", "aria-hidden": true }),
|
|
9314
|
+
showValueTooltip ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(SliderValueTooltip, { open: tooltipOpen, children: label }) : null
|
|
9315
|
+
]
|
|
9316
|
+
}
|
|
9317
|
+
),
|
|
9318
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(SliderPrimitive.unstable_BubbleInput, {})
|
|
9319
|
+
] });
|
|
9320
|
+
}
|
|
9183
9321
|
var Slider = (0, import_react51.forwardRef)(
|
|
9184
9322
|
({
|
|
9185
9323
|
className,
|
|
@@ -9190,6 +9328,14 @@ var Slider = (0, import_react51.forwardRef)(
|
|
|
9190
9328
|
defaultValue,
|
|
9191
9329
|
min = 0,
|
|
9192
9330
|
max = 100,
|
|
9331
|
+
onValueChange,
|
|
9332
|
+
onPointerDown,
|
|
9333
|
+
onPointerMove,
|
|
9334
|
+
onPointerUp,
|
|
9335
|
+
onPointerCancel,
|
|
9336
|
+
onLostPointerCapture,
|
|
9337
|
+
showValueTooltip = false,
|
|
9338
|
+
formatValueTooltip,
|
|
9193
9339
|
...props
|
|
9194
9340
|
}, ref) => {
|
|
9195
9341
|
const resolvedType = type ?? "default";
|
|
@@ -9197,7 +9343,50 @@ var Slider = (0, import_react51.forwardRef)(
|
|
|
9197
9343
|
const isRange = resolvedType === "range";
|
|
9198
9344
|
const resolvedDefaultValue = defaultValue ?? (isRange ? [25, 75] : [50]);
|
|
9199
9345
|
const thumbCount = isRange ? Math.max(2, value?.length ?? defaultValue?.length ?? 2) : 1;
|
|
9200
|
-
|
|
9346
|
+
const [isDragging, setIsDragging] = (0, import_react51.useState)(false);
|
|
9347
|
+
const [pointerDown, setPointerDown] = (0, import_react51.useState)(false);
|
|
9348
|
+
const [activeThumbIndex, setActiveThumbIndex] = (0, import_react51.useState)(
|
|
9349
|
+
null
|
|
9350
|
+
);
|
|
9351
|
+
const [uncontrolledValue, setUncontrolledValue] = (0, import_react51.useState)(
|
|
9352
|
+
resolvedDefaultValue
|
|
9353
|
+
);
|
|
9354
|
+
const currentValues = value ?? uncontrolledValue;
|
|
9355
|
+
const handleValueChange = (next) => {
|
|
9356
|
+
if (value == null) setUncontrolledValue(next);
|
|
9357
|
+
if (showValueTooltip) {
|
|
9358
|
+
const prev = currentValues;
|
|
9359
|
+
const changed = next.findIndex((v, i) => v !== prev[i]);
|
|
9360
|
+
if (changed >= 0) setActiveThumbIndex(changed);
|
|
9361
|
+
}
|
|
9362
|
+
onValueChange?.(next);
|
|
9363
|
+
};
|
|
9364
|
+
const handlePointerDown = (event) => {
|
|
9365
|
+
if (showValueTooltip && !disabled) setPointerDown(true);
|
|
9366
|
+
onPointerDown?.(event);
|
|
9367
|
+
};
|
|
9368
|
+
const handlePointerMove = (event) => {
|
|
9369
|
+
if (event.buttons !== 0) setIsDragging(true);
|
|
9370
|
+
onPointerMove?.(event);
|
|
9371
|
+
};
|
|
9372
|
+
const endPointer = () => {
|
|
9373
|
+
setIsDragging(false);
|
|
9374
|
+
setPointerDown(false);
|
|
9375
|
+
setActiveThumbIndex(null);
|
|
9376
|
+
};
|
|
9377
|
+
const handlePointerUp = (event) => {
|
|
9378
|
+
endPointer();
|
|
9379
|
+
onPointerUp?.(event);
|
|
9380
|
+
};
|
|
9381
|
+
const handlePointerCancel = (event) => {
|
|
9382
|
+
endPointer();
|
|
9383
|
+
onPointerCancel?.(event);
|
|
9384
|
+
};
|
|
9385
|
+
const handleLostPointerCapture = (event) => {
|
|
9386
|
+
endPointer();
|
|
9387
|
+
onLostPointerCapture?.(event);
|
|
9388
|
+
};
|
|
9389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
9201
9390
|
SliderPrimitive.Root,
|
|
9202
9391
|
{
|
|
9203
9392
|
ref,
|
|
@@ -9213,22 +9402,46 @@ var Slider = (0, import_react51.forwardRef)(
|
|
|
9213
9402
|
"data-size": resolvedSize,
|
|
9214
9403
|
"data-type": resolvedType,
|
|
9215
9404
|
"data-disabled": disabled ? "true" : void 0,
|
|
9405
|
+
"data-dragging": isDragging ? "true" : void 0,
|
|
9406
|
+
"data-value-tooltip": showValueTooltip ? "true" : void 0,
|
|
9407
|
+
onValueChange: handleValueChange,
|
|
9408
|
+
onPointerDown: handlePointerDown,
|
|
9409
|
+
onPointerMove: handlePointerMove,
|
|
9410
|
+
onPointerUp: handlePointerUp,
|
|
9411
|
+
onPointerCancel: handlePointerCancel,
|
|
9412
|
+
onLostPointerCapture: handleLostPointerCapture,
|
|
9216
9413
|
...props,
|
|
9217
9414
|
children: [
|
|
9218
|
-
/* @__PURE__ */ (0,
|
|
9219
|
-
Array.from({ length: thumbCount }, (_, index) =>
|
|
9415
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(SliderPrimitive.Track, { className: "aviala-slider__track", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(SliderPrimitive.Range, { className: "aviala-slider__range" }) }),
|
|
9416
|
+
Array.from({ length: thumbCount }, (_, index) => {
|
|
9417
|
+
const thumbValue = currentValues[index] ?? resolvedDefaultValue[index] ?? (isRange ? index === 0 ? min : max : min + (max - min) / 2);
|
|
9418
|
+
const forceTooltipOpen = pointerDown && (activeThumbIndex === index || activeThumbIndex == null && thumbCount === 1 && index === 0);
|
|
9419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
9420
|
+
SliderThumb,
|
|
9421
|
+
{
|
|
9422
|
+
index,
|
|
9423
|
+
value: thumbValue,
|
|
9424
|
+
showValueTooltip: Boolean(showValueTooltip && !disabled),
|
|
9425
|
+
formatValueTooltip,
|
|
9426
|
+
forceTooltipOpen,
|
|
9427
|
+
onThumbPointerDown: () => setActiveThumbIndex(index)
|
|
9428
|
+
},
|
|
9429
|
+
index
|
|
9430
|
+
);
|
|
9431
|
+
})
|
|
9220
9432
|
]
|
|
9221
|
-
}
|
|
9433
|
+
},
|
|
9434
|
+
resolvedType
|
|
9222
9435
|
);
|
|
9223
9436
|
}
|
|
9224
9437
|
);
|
|
9225
9438
|
Slider.displayName = "Slider";
|
|
9226
9439
|
|
|
9227
9440
|
// src/components/upload.tsx
|
|
9228
|
-
var
|
|
9441
|
+
var import_icons18 = require("@aviala-design/icons");
|
|
9229
9442
|
var import_class_variance_authority14 = require("class-variance-authority");
|
|
9230
9443
|
var import_react52 = require("react");
|
|
9231
|
-
var
|
|
9444
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
9232
9445
|
var uploadVariants = (0, import_class_variance_authority14.cva)("aviala-upload aviala-focus-ring", {
|
|
9233
9446
|
variants: {
|
|
9234
9447
|
style: {
|
|
@@ -9278,7 +9491,7 @@ var Upload = (0, import_react52.forwardRef)(
|
|
|
9278
9491
|
onChange?.(event.dataTransfer.files);
|
|
9279
9492
|
}
|
|
9280
9493
|
};
|
|
9281
|
-
return /* @__PURE__ */ (0,
|
|
9494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
9282
9495
|
"div",
|
|
9283
9496
|
{
|
|
9284
9497
|
ref,
|
|
@@ -9309,7 +9522,7 @@ var Upload = (0, import_react52.forwardRef)(
|
|
|
9309
9522
|
onDrop: handleDrop,
|
|
9310
9523
|
...props,
|
|
9311
9524
|
children: [
|
|
9312
|
-
/* @__PURE__ */ (0,
|
|
9525
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9313
9526
|
"input",
|
|
9314
9527
|
{
|
|
9315
9528
|
ref: inputRef,
|
|
@@ -9324,8 +9537,8 @@ var Upload = (0, import_react52.forwardRef)(
|
|
|
9324
9537
|
...inputProps
|
|
9325
9538
|
}
|
|
9326
9539
|
),
|
|
9327
|
-
/* @__PURE__ */ (0,
|
|
9328
|
-
resolvedStyle === "large" ? /* @__PURE__ */ (0,
|
|
9540
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "aviala-upload__icon", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_icons18.GeneralUpload, { width: 16, height: 16 }) }),
|
|
9541
|
+
resolvedStyle === "large" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
9329
9542
|
Typeface,
|
|
9330
9543
|
{
|
|
9331
9544
|
className: "aviala-upload__typeface",
|
|
@@ -9333,7 +9546,7 @@ var Upload = (0, import_react52.forwardRef)(
|
|
|
9333
9546
|
primary: title,
|
|
9334
9547
|
secondary: description
|
|
9335
9548
|
}
|
|
9336
|
-
) : /* @__PURE__ */ (0,
|
|
9549
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Typography, { level: "text", as: "span", className: "aviala-upload__label", children: label })
|
|
9337
9550
|
]
|
|
9338
9551
|
}
|
|
9339
9552
|
);
|
|
@@ -9343,7 +9556,7 @@ Upload.displayName = "Upload";
|
|
|
9343
9556
|
|
|
9344
9557
|
// src/components/scroll-picker.tsx
|
|
9345
9558
|
var import_react53 = require("react");
|
|
9346
|
-
var
|
|
9559
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
9347
9560
|
var LOOP_SECTIONS2 = 3;
|
|
9348
9561
|
var MIDDLE_SECTION2 = 1;
|
|
9349
9562
|
function normalizeIndex2(index, length) {
|
|
@@ -9371,7 +9584,7 @@ function fractionalIndexAtScrollTop(metrics, scrollTop) {
|
|
|
9371
9584
|
return (scrollTop - metrics.originTop) / metrics.pitch;
|
|
9372
9585
|
}
|
|
9373
9586
|
function ScrollPicker({ className, children, ...props }) {
|
|
9374
|
-
return /* @__PURE__ */ (0,
|
|
9587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: cn("aviala-scroll-picker", className), ...props, children });
|
|
9375
9588
|
}
|
|
9376
9589
|
function ScrollPickerColumn({
|
|
9377
9590
|
className,
|
|
@@ -9568,9 +9781,9 @@ function ScrollPickerColumn({
|
|
|
9568
9781
|
}
|
|
9569
9782
|
};
|
|
9570
9783
|
const selectedOptionId = `${reactId}-${getIndex(value)}`;
|
|
9571
|
-
return /* @__PURE__ */ (0,
|
|
9572
|
-
/* @__PURE__ */ (0,
|
|
9573
|
-
/* @__PURE__ */ (0,
|
|
9784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: cn("aviala-scroll-picker-column", className), children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "aviala-scroll-picker-column__viewport", children: [
|
|
9785
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "aviala-scroll-picker-column__highlight", "aria-hidden": true }),
|
|
9786
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
9574
9787
|
"div",
|
|
9575
9788
|
{
|
|
9576
9789
|
ref: scrollRef,
|
|
@@ -9581,12 +9794,12 @@ function ScrollPickerColumn({
|
|
|
9581
9794
|
"aria-activedescendant": selectedOptionId,
|
|
9582
9795
|
tabIndex: 0,
|
|
9583
9796
|
onKeyDown: handleKeyDown,
|
|
9584
|
-
children: /* @__PURE__ */ (0,
|
|
9797
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("ul", { className: "aviala-scroll-picker-column__list", children: repeatedValues.map((itemValue, index) => {
|
|
9585
9798
|
const isSelected = Object.is(itemValue, value);
|
|
9586
9799
|
const valueIndex = loop ? normalizeIndex2(index, values.length) : index;
|
|
9587
9800
|
const optionId = `${reactId}-${loop ? index : valueIndex}`;
|
|
9588
9801
|
const key = getValueKey?.(itemValue, index) ?? `${String(itemValue)}-${index}`;
|
|
9589
|
-
return /* @__PURE__ */ (0,
|
|
9802
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("li", { className: "contents", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
9590
9803
|
ScrollPickerItem,
|
|
9591
9804
|
{
|
|
9592
9805
|
id: isSelected ? selectedOptionId : optionId,
|
|
@@ -9612,7 +9825,7 @@ function ScrollPickerItem({
|
|
|
9612
9825
|
className,
|
|
9613
9826
|
onSelect
|
|
9614
9827
|
}) {
|
|
9615
|
-
return /* @__PURE__ */ (0,
|
|
9828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
9616
9829
|
"button",
|
|
9617
9830
|
{
|
|
9618
9831
|
type: "button",
|
|
@@ -9633,10 +9846,10 @@ function ScrollPickerItem({
|
|
|
9633
9846
|
}
|
|
9634
9847
|
|
|
9635
9848
|
// src/components/breadcrumb.tsx
|
|
9636
|
-
var
|
|
9849
|
+
var import_icons19 = require("@aviala-design/icons");
|
|
9637
9850
|
var import_class_variance_authority15 = require("class-variance-authority");
|
|
9638
9851
|
var import_react54 = require("react");
|
|
9639
|
-
var
|
|
9852
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
9640
9853
|
var BreadcrumbSizeContext = (0, import_react54.createContext)("default");
|
|
9641
9854
|
function breadcrumbTypeLevel(size) {
|
|
9642
9855
|
return size === "small" ? "caption" : "text";
|
|
@@ -9655,7 +9868,7 @@ var breadcrumbVariants = (0, import_class_variance_authority15.cva)("aviala-brea
|
|
|
9655
9868
|
var Breadcrumb = (0, import_react54.forwardRef)(
|
|
9656
9869
|
({ className, size = "default", children, ...props }, ref) => {
|
|
9657
9870
|
const resolvedSize = size ?? "default";
|
|
9658
|
-
return /* @__PURE__ */ (0,
|
|
9871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(BreadcrumbSizeContext.Provider, { value: resolvedSize, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
9659
9872
|
"nav",
|
|
9660
9873
|
{
|
|
9661
9874
|
ref,
|
|
@@ -9663,7 +9876,7 @@ var Breadcrumb = (0, import_react54.forwardRef)(
|
|
|
9663
9876
|
className: cn(breadcrumbVariants({ size: resolvedSize }), className),
|
|
9664
9877
|
"data-size": resolvedSize,
|
|
9665
9878
|
...props,
|
|
9666
|
-
children: /* @__PURE__ */ (0,
|
|
9879
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("ol", { className: "aviala-breadcrumb__list", children })
|
|
9667
9880
|
}
|
|
9668
9881
|
) });
|
|
9669
9882
|
}
|
|
@@ -9672,9 +9885,9 @@ Breadcrumb.displayName = "Breadcrumb";
|
|
|
9672
9885
|
var BreadcrumbItem = (0, import_react54.forwardRef)(
|
|
9673
9886
|
({ className, href, current = false, icon, onClick, children, ...props }, ref) => {
|
|
9674
9887
|
const size = (0, import_react54.useContext)(BreadcrumbSizeContext);
|
|
9675
|
-
const label = /* @__PURE__ */ (0,
|
|
9676
|
-
icon ? /* @__PURE__ */ (0,
|
|
9677
|
-
children != null ? /* @__PURE__ */ (0,
|
|
9888
|
+
const label = /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
|
|
9889
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "aviala-breadcrumb-item__icon", children: icon }) : null,
|
|
9890
|
+
children != null ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
9678
9891
|
Typography,
|
|
9679
9892
|
{
|
|
9680
9893
|
level: breadcrumbTypeLevel(size),
|
|
@@ -9684,13 +9897,13 @@ var BreadcrumbItem = (0, import_react54.forwardRef)(
|
|
|
9684
9897
|
}
|
|
9685
9898
|
) : null
|
|
9686
9899
|
] });
|
|
9687
|
-
return /* @__PURE__ */ (0,
|
|
9900
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
9688
9901
|
"li",
|
|
9689
9902
|
{
|
|
9690
9903
|
ref,
|
|
9691
9904
|
className: cn("aviala-breadcrumb-item-wrap", className),
|
|
9692
9905
|
...props,
|
|
9693
|
-
children: href != null ? /* @__PURE__ */ (0,
|
|
9906
|
+
children: href != null ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
9694
9907
|
"a",
|
|
9695
9908
|
{
|
|
9696
9909
|
href,
|
|
@@ -9699,7 +9912,7 @@ var BreadcrumbItem = (0, import_react54.forwardRef)(
|
|
|
9699
9912
|
"aria-current": current ? "page" : void 0,
|
|
9700
9913
|
children: label
|
|
9701
9914
|
}
|
|
9702
|
-
) : onClick != null ? /* @__PURE__ */ (0,
|
|
9915
|
+
) : onClick != null ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
9703
9916
|
"button",
|
|
9704
9917
|
{
|
|
9705
9918
|
type: "button",
|
|
@@ -9709,7 +9922,7 @@ var BreadcrumbItem = (0, import_react54.forwardRef)(
|
|
|
9709
9922
|
onClick,
|
|
9710
9923
|
children: label
|
|
9711
9924
|
}
|
|
9712
|
-
) : /* @__PURE__ */ (0,
|
|
9925
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
9713
9926
|
"span",
|
|
9714
9927
|
{
|
|
9715
9928
|
className: "aviala-breadcrumb-item",
|
|
@@ -9726,7 +9939,7 @@ BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
|
9726
9939
|
var BreadcrumbSeparator = (0, import_react54.forwardRef)(
|
|
9727
9940
|
({ className, children = "/", ...props }, ref) => {
|
|
9728
9941
|
const size = (0, import_react54.useContext)(BreadcrumbSizeContext);
|
|
9729
|
-
return /* @__PURE__ */ (0,
|
|
9942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
9730
9943
|
"li",
|
|
9731
9944
|
{
|
|
9732
9945
|
ref,
|
|
@@ -9734,7 +9947,7 @@ var BreadcrumbSeparator = (0, import_react54.forwardRef)(
|
|
|
9734
9947
|
"aria-hidden": true,
|
|
9735
9948
|
className: cn("aviala-breadcrumb-separator", className),
|
|
9736
9949
|
...props,
|
|
9737
|
-
children: /* @__PURE__ */ (0,
|
|
9950
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Typography, { level: breadcrumbTypeLevel(size), as: "span", children })
|
|
9738
9951
|
}
|
|
9739
9952
|
);
|
|
9740
9953
|
}
|
|
@@ -9749,12 +9962,12 @@ var BreadcrumbEllipsisItem = (0, import_react54.forwardRef)(
|
|
|
9749
9962
|
children,
|
|
9750
9963
|
...props
|
|
9751
9964
|
}, ref) => {
|
|
9752
|
-
const content = /* @__PURE__ */ (0,
|
|
9753
|
-
/* @__PURE__ */ (0,
|
|
9754
|
-
showChevron ? /* @__PURE__ */ (0,
|
|
9965
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
|
|
9966
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Typography, { level: "text", as: "span", className: "aviala-breadcrumb-ellipsis-item__label", children }),
|
|
9967
|
+
showChevron ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "aviala-breadcrumb-ellipsis-item__chevron", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_icons19.DirectionArrowRightLight, { width: 14, height: 14, thickness: "Light" }) }) : null
|
|
9755
9968
|
] });
|
|
9756
9969
|
if (href != null) {
|
|
9757
|
-
return /* @__PURE__ */ (0,
|
|
9970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
9758
9971
|
"a",
|
|
9759
9972
|
{
|
|
9760
9973
|
ref,
|
|
@@ -9766,7 +9979,7 @@ var BreadcrumbEllipsisItem = (0, import_react54.forwardRef)(
|
|
|
9766
9979
|
}
|
|
9767
9980
|
);
|
|
9768
9981
|
}
|
|
9769
|
-
return /* @__PURE__ */ (0,
|
|
9982
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
9770
9983
|
"button",
|
|
9771
9984
|
{
|
|
9772
9985
|
ref,
|
|
@@ -9804,8 +10017,8 @@ var BreadcrumbEllipsis = (0, import_react54.forwardRef)(
|
|
|
9804
10017
|
[isControlled, onActivatedChange]
|
|
9805
10018
|
);
|
|
9806
10019
|
const iconSize = 14;
|
|
9807
|
-
const icon = children ?? /* @__PURE__ */ (0,
|
|
9808
|
-
const trigger = /* @__PURE__ */ (0,
|
|
10020
|
+
const icon = children ?? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_icons19.SymbolMore, { width: iconSize, height: iconSize, thickness: "Light", "aria-hidden": true });
|
|
10021
|
+
const trigger = /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
9809
10022
|
"button",
|
|
9810
10023
|
{
|
|
9811
10024
|
type: "button",
|
|
@@ -9824,9 +10037,9 @@ var BreadcrumbEllipsis = (0, import_react54.forwardRef)(
|
|
|
9824
10037
|
children: icon
|
|
9825
10038
|
}
|
|
9826
10039
|
);
|
|
9827
|
-
return /* @__PURE__ */ (0,
|
|
9828
|
-
/* @__PURE__ */ (0,
|
|
9829
|
-
/* @__PURE__ */ (0,
|
|
10040
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("li", { ref, className: cn("aviala-breadcrumb-ellipsis-wrap", className), children: menu != null ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Popover, { open: activated, onOpenChange: setActivated, children: [
|
|
10041
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(PopoverTrigger, { asChild: true, children: trigger }),
|
|
10042
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
9830
10043
|
PopoverContent,
|
|
9831
10044
|
{
|
|
9832
10045
|
className: "aviala-breadcrumb-ellipsis-menu",
|
|
@@ -9835,7 +10048,7 @@ var BreadcrumbEllipsis = (0, import_react54.forwardRef)(
|
|
|
9835
10048
|
sideOffset: 7,
|
|
9836
10049
|
showArrow: false,
|
|
9837
10050
|
role: "menu",
|
|
9838
|
-
children: /* @__PURE__ */ (0,
|
|
10051
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "aviala-breadcrumb-ellipsis-menu__items", children: menu })
|
|
9839
10052
|
}
|
|
9840
10053
|
)
|
|
9841
10054
|
] }) : trigger });
|
|
@@ -9845,7 +10058,7 @@ BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis";
|
|
|
9845
10058
|
|
|
9846
10059
|
// src/components/pagehead.tsx
|
|
9847
10060
|
var import_react55 = require("react");
|
|
9848
|
-
var
|
|
10061
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
9849
10062
|
var Pagehead = (0, import_react55.forwardRef)(
|
|
9850
10063
|
({
|
|
9851
10064
|
className,
|
|
@@ -9856,25 +10069,25 @@ var Pagehead = (0, import_react55.forwardRef)(
|
|
|
9856
10069
|
actions,
|
|
9857
10070
|
children,
|
|
9858
10071
|
...props
|
|
9859
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
9860
|
-
/* @__PURE__ */ (0,
|
|
9861
|
-
back != null ? /* @__PURE__ */ (0,
|
|
9862
|
-
/* @__PURE__ */ (0,
|
|
9863
|
-
breadcrumb != null ? /* @__PURE__ */ (0,
|
|
9864
|
-
title != null || description != null ? /* @__PURE__ */ (0,
|
|
10072
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("header", { ref, className: cn("aviala-pagehead", className), ...props, children: [
|
|
10073
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "aviala-pagehead__main", children: [
|
|
10074
|
+
back != null ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "aviala-pagehead__back", children: back }) : null,
|
|
10075
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "aviala-pagehead__title-block", children: [
|
|
10076
|
+
breadcrumb != null ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "aviala-pagehead__breadcrumb", children: breadcrumb }) : null,
|
|
10077
|
+
title != null || description != null ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "aviala-pagehead__title", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Typeface, { content: "textCaption", primary: title, secondary: description }) }) : null,
|
|
9865
10078
|
children
|
|
9866
10079
|
] })
|
|
9867
10080
|
] }),
|
|
9868
|
-
actions != null ? /* @__PURE__ */ (0,
|
|
10081
|
+
actions != null ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "aviala-pagehead__actions", children: actions }) : null
|
|
9869
10082
|
] })
|
|
9870
10083
|
);
|
|
9871
10084
|
Pagehead.displayName = "Pagehead";
|
|
9872
10085
|
|
|
9873
10086
|
// src/components/steps.tsx
|
|
9874
|
-
var
|
|
10087
|
+
var import_icons20 = require("@aviala-design/icons");
|
|
9875
10088
|
var import_class_variance_authority16 = require("class-variance-authority");
|
|
9876
10089
|
var import_react56 = require("react");
|
|
9877
|
-
var
|
|
10090
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
9878
10091
|
var stepsVariants = (0, import_class_variance_authority16.cva)("aviala-steps", {
|
|
9879
10092
|
variants: {
|
|
9880
10093
|
direction: {
|
|
@@ -9887,7 +10100,7 @@ var stepsVariants = (0, import_class_variance_authority16.cva)("aviala-steps", {
|
|
|
9887
10100
|
}
|
|
9888
10101
|
});
|
|
9889
10102
|
var Steps = (0, import_react56.forwardRef)(
|
|
9890
|
-
({ className, direction = "horizontal", children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
10103
|
+
({ className, direction = "horizontal", children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
9891
10104
|
"div",
|
|
9892
10105
|
{
|
|
9893
10106
|
ref,
|
|
@@ -9902,20 +10115,20 @@ Steps.displayName = "Steps";
|
|
|
9902
10115
|
function defaultStepsIconContent(state, index) {
|
|
9903
10116
|
switch (state) {
|
|
9904
10117
|
case "done":
|
|
9905
|
-
return /* @__PURE__ */ (0,
|
|
10118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons20.SymbolRight, { width: 12, height: 12, thickness: "Bold", "aria-hidden": true });
|
|
9906
10119
|
case "fail":
|
|
9907
|
-
return /* @__PURE__ */ (0,
|
|
10120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons20.SymbolWrong, { width: 12, height: 12, thickness: "Bold", "aria-hidden": true });
|
|
9908
10121
|
case "warning":
|
|
9909
|
-
return /* @__PURE__ */ (0,
|
|
10122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons20.SymbolWarning, { width: 12, height: 12, thickness: "Bold", "aria-hidden": true });
|
|
9910
10123
|
case "waiting":
|
|
9911
10124
|
case "inProgress":
|
|
9912
10125
|
case "default":
|
|
9913
10126
|
default:
|
|
9914
|
-
return index != null ? /* @__PURE__ */ (0,
|
|
10127
|
+
return index != null ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Typography, { level: "caption", as: "span", className: "aviala-steps-icon__index", children: index }) : null;
|
|
9915
10128
|
}
|
|
9916
10129
|
}
|
|
9917
10130
|
var StepsIcon = (0, import_react56.forwardRef)(
|
|
9918
|
-
({ className, state = "default", index, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
10131
|
+
({ className, state = "default", index, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
9919
10132
|
"span",
|
|
9920
10133
|
{
|
|
9921
10134
|
ref,
|
|
@@ -9937,7 +10150,7 @@ var StepsItem = (0, import_react56.forwardRef)(
|
|
|
9937
10150
|
icon,
|
|
9938
10151
|
children,
|
|
9939
10152
|
...props
|
|
9940
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
10153
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
9941
10154
|
"div",
|
|
9942
10155
|
{
|
|
9943
10156
|
ref,
|
|
@@ -9945,9 +10158,9 @@ var StepsItem = (0, import_react56.forwardRef)(
|
|
|
9945
10158
|
"data-state": state,
|
|
9946
10159
|
...props,
|
|
9947
10160
|
children: [
|
|
9948
|
-
icon ?? /* @__PURE__ */ (0,
|
|
9949
|
-
/* @__PURE__ */ (0,
|
|
9950
|
-
title != null ? /* @__PURE__ */ (0,
|
|
10161
|
+
icon ?? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(StepsIcon, { state, index }),
|
|
10162
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "aviala-steps-item__body", children: [
|
|
10163
|
+
title != null ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
9951
10164
|
Typography,
|
|
9952
10165
|
{
|
|
9953
10166
|
level: "subtitle",
|
|
@@ -9956,7 +10169,7 @@ var StepsItem = (0, import_react56.forwardRef)(
|
|
|
9956
10169
|
children: title
|
|
9957
10170
|
}
|
|
9958
10171
|
) : null,
|
|
9959
|
-
description != null ? /* @__PURE__ */ (0,
|
|
10172
|
+
description != null ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
9960
10173
|
Typography,
|
|
9961
10174
|
{
|
|
9962
10175
|
level: "text",
|
|
@@ -9974,9 +10187,9 @@ var StepsItem = (0, import_react56.forwardRef)(
|
|
|
9974
10187
|
StepsItem.displayName = "StepsItem";
|
|
9975
10188
|
|
|
9976
10189
|
// src/components/pagination.tsx
|
|
9977
|
-
var
|
|
10190
|
+
var import_icons21 = require("@aviala-design/icons");
|
|
9978
10191
|
var import_react57 = require("react");
|
|
9979
|
-
var
|
|
10192
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
9980
10193
|
function buildPageList(page, pageCount) {
|
|
9981
10194
|
if (pageCount <= 7) {
|
|
9982
10195
|
return Array.from({ length: pageCount }, (_, index) => index + 1);
|
|
@@ -10051,7 +10264,7 @@ var Pagination = (0, import_react57.forwardRef)(
|
|
|
10051
10264
|
setPage(parsed);
|
|
10052
10265
|
setJumpValue("");
|
|
10053
10266
|
};
|
|
10054
|
-
return /* @__PURE__ */ (0,
|
|
10267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
10055
10268
|
"div",
|
|
10056
10269
|
{
|
|
10057
10270
|
ref,
|
|
@@ -10060,8 +10273,8 @@ var Pagination = (0, import_react57.forwardRef)(
|
|
|
10060
10273
|
"aria-label": props["aria-label"] ?? "Pagination",
|
|
10061
10274
|
...props,
|
|
10062
10275
|
children: [
|
|
10063
|
-
/* @__PURE__ */ (0,
|
|
10064
|
-
/* @__PURE__ */ (0,
|
|
10276
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "aviala-pagination__controls", children: [
|
|
10277
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
10065
10278
|
Button,
|
|
10066
10279
|
{
|
|
10067
10280
|
mode: "noBackgroundCustom",
|
|
@@ -10069,18 +10282,18 @@ var Pagination = (0, import_react57.forwardRef)(
|
|
|
10069
10282
|
iconOnly: true,
|
|
10070
10283
|
"aria-label": "Previous page",
|
|
10071
10284
|
disabled: currentPage <= 1,
|
|
10072
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
10285
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_icons21.DirectionArrowLeftLight, { "aria-hidden": true }),
|
|
10073
10286
|
onClick: () => setPage(currentPage - 1)
|
|
10074
10287
|
}
|
|
10075
10288
|
),
|
|
10076
|
-
/* @__PURE__ */ (0,
|
|
10077
|
-
(item, index) => item === "ellipsis" ? /* @__PURE__ */ (0,
|
|
10289
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "aviala-pagination__pages", children: pages.map(
|
|
10290
|
+
(item, index) => item === "ellipsis" ? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
10078
10291
|
Popover,
|
|
10079
10292
|
{
|
|
10080
10293
|
open: openEllipsis === index,
|
|
10081
10294
|
onOpenChange: (open) => setOpenEllipsis(open ? index : null),
|
|
10082
10295
|
children: [
|
|
10083
|
-
/* @__PURE__ */ (0,
|
|
10296
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
10084
10297
|
"button",
|
|
10085
10298
|
{
|
|
10086
10299
|
type: "button",
|
|
@@ -10091,10 +10304,10 @@ var Pagination = (0, import_react57.forwardRef)(
|
|
|
10091
10304
|
),
|
|
10092
10305
|
"aria-label": "\u66F4\u591A\u9875\u7801",
|
|
10093
10306
|
"aria-haspopup": "menu",
|
|
10094
|
-
children: /* @__PURE__ */ (0,
|
|
10307
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Typography, { level: "text", as: "span", children: "\u2026" })
|
|
10095
10308
|
}
|
|
10096
10309
|
) }),
|
|
10097
|
-
/* @__PURE__ */ (0,
|
|
10310
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(PopoverContent, { className: "aviala-pagination__ellipsis-content", showArrow: true, flush: true, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "aviala-pagination__ellipsis-menu", children: ellipsisRange(pages, index).map((p) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
10098
10311
|
"button",
|
|
10099
10312
|
{
|
|
10100
10313
|
type: "button",
|
|
@@ -10107,14 +10320,14 @@ var Pagination = (0, import_react57.forwardRef)(
|
|
|
10107
10320
|
setPage(p);
|
|
10108
10321
|
setOpenEllipsis(null);
|
|
10109
10322
|
},
|
|
10110
|
-
children: /* @__PURE__ */ (0,
|
|
10323
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Typography, { level: "text", as: "span", children: p })
|
|
10111
10324
|
},
|
|
10112
10325
|
p
|
|
10113
10326
|
)) }) })
|
|
10114
10327
|
]
|
|
10115
10328
|
},
|
|
10116
10329
|
`ellipsis-${index}`
|
|
10117
|
-
) : /* @__PURE__ */ (0,
|
|
10330
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
10118
10331
|
"button",
|
|
10119
10332
|
{
|
|
10120
10333
|
type: "button",
|
|
@@ -10126,12 +10339,12 @@ var Pagination = (0, import_react57.forwardRef)(
|
|
|
10126
10339
|
"data-active": item === currentPage ? "true" : void 0,
|
|
10127
10340
|
"aria-current": item === currentPage ? "page" : void 0,
|
|
10128
10341
|
onClick: () => setPage(item),
|
|
10129
|
-
children: /* @__PURE__ */ (0,
|
|
10342
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Typography, { level: "text", as: "span", children: item })
|
|
10130
10343
|
},
|
|
10131
10344
|
item
|
|
10132
10345
|
)
|
|
10133
10346
|
) }),
|
|
10134
|
-
/* @__PURE__ */ (0,
|
|
10347
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
10135
10348
|
Button,
|
|
10136
10349
|
{
|
|
10137
10350
|
mode: "noBackgroundCustom",
|
|
@@ -10139,14 +10352,14 @@ var Pagination = (0, import_react57.forwardRef)(
|
|
|
10139
10352
|
iconOnly: true,
|
|
10140
10353
|
"aria-label": "Next page",
|
|
10141
10354
|
disabled: currentPage >= safePageCount,
|
|
10142
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
10355
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_icons21.DirectionArrowRightLight, { "aria-hidden": true }),
|
|
10143
10356
|
onClick: () => setPage(currentPage + 1)
|
|
10144
10357
|
}
|
|
10145
10358
|
)
|
|
10146
10359
|
] }),
|
|
10147
|
-
showJump ? /* @__PURE__ */ (0,
|
|
10148
|
-
/* @__PURE__ */ (0,
|
|
10149
|
-
/* @__PURE__ */ (0,
|
|
10360
|
+
showJump ? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "aviala-pagination__jump", children: [
|
|
10361
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Typography, { level: "text", as: "span", children: jumpLabel }),
|
|
10362
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
10150
10363
|
Input,
|
|
10151
10364
|
{
|
|
10152
10365
|
className: "aviala-pagination__jump-input",
|
|
@@ -10166,15 +10379,15 @@ var Pagination = (0, import_react57.forwardRef)(
|
|
|
10166
10379
|
}
|
|
10167
10380
|
)
|
|
10168
10381
|
] }) : null,
|
|
10169
|
-
showSizeChanger ? /* @__PURE__ */ (0,
|
|
10170
|
-
/* @__PURE__ */ (0,
|
|
10171
|
-
/* @__PURE__ */ (0,
|
|
10382
|
+
showSizeChanger ? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "aviala-pagination__size", children: [
|
|
10383
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Typography, { level: "text", as: "span", children: sizeLabel }),
|
|
10384
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
10172
10385
|
Select,
|
|
10173
10386
|
{
|
|
10174
10387
|
value: String(pageSize),
|
|
10175
10388
|
onValueChange: (value) => setPageSize(Number(value)),
|
|
10176
10389
|
children: [
|
|
10177
|
-
/* @__PURE__ */ (0,
|
|
10390
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
10178
10391
|
SelectTrigger,
|
|
10179
10392
|
{
|
|
10180
10393
|
size: "regular",
|
|
@@ -10182,7 +10395,7 @@ var Pagination = (0, import_react57.forwardRef)(
|
|
|
10182
10395
|
"aria-label": "Page size"
|
|
10183
10396
|
}
|
|
10184
10397
|
),
|
|
10185
|
-
/* @__PURE__ */ (0,
|
|
10398
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(SelectContent, { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(SelectItemGroup, { children: pageSizeOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
10186
10399
|
SelectItem,
|
|
10187
10400
|
{
|
|
10188
10401
|
value: String(option),
|
|
@@ -10203,11 +10416,11 @@ var Pagination = (0, import_react57.forwardRef)(
|
|
|
10203
10416
|
Pagination.displayName = "Pagination";
|
|
10204
10417
|
|
|
10205
10418
|
// src/components/card.tsx
|
|
10206
|
-
var
|
|
10419
|
+
var import_icons22 = require("@aviala-design/icons");
|
|
10207
10420
|
var import_react58 = require("react");
|
|
10208
|
-
var
|
|
10421
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
10209
10422
|
var Card = (0, import_react58.forwardRef)(
|
|
10210
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
10423
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { ref, className: cn("aviala-card", className), ...props, children })
|
|
10211
10424
|
);
|
|
10212
10425
|
Card.displayName = "Card";
|
|
10213
10426
|
function renderCardIcon(node) {
|
|
@@ -10220,7 +10433,7 @@ function renderCardIcon(node) {
|
|
|
10220
10433
|
"shrink-0"
|
|
10221
10434
|
)
|
|
10222
10435
|
}) : node;
|
|
10223
|
-
return /* @__PURE__ */ (0,
|
|
10436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "aviala-card-head__icon", children: content });
|
|
10224
10437
|
}
|
|
10225
10438
|
var CardHead = (0, import_react58.forwardRef)(
|
|
10226
10439
|
({
|
|
@@ -10238,38 +10451,38 @@ var CardHead = (0, import_react58.forwardRef)(
|
|
|
10238
10451
|
children,
|
|
10239
10452
|
...props
|
|
10240
10453
|
}, ref) => {
|
|
10241
|
-
const primaryAction = action ?? /* @__PURE__ */ (0,
|
|
10454
|
+
const primaryAction = action ?? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Button, { mode: "primary", size: "regular", leftIcon: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons22.GeneralSetting, { "aria-hidden": true }), children: actionLabel });
|
|
10242
10455
|
const renderTrailing = () => {
|
|
10243
10456
|
if (trailing !== void 0) return trailing;
|
|
10244
10457
|
switch (slotType) {
|
|
10245
10458
|
case "action":
|
|
10246
|
-
return /* @__PURE__ */ (0,
|
|
10459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "aviala-card-head__trailing", children: [
|
|
10247
10460
|
primaryAction,
|
|
10248
|
-
secondaryAction ?? /* @__PURE__ */ (0,
|
|
10461
|
+
secondaryAction ?? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
10249
10462
|
Button,
|
|
10250
10463
|
{
|
|
10251
10464
|
mode: "default",
|
|
10252
10465
|
size: "regular",
|
|
10253
10466
|
iconOnly: true,
|
|
10254
10467
|
"aria-label": "More",
|
|
10255
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
10468
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons22.GeneralSetting, { "aria-hidden": true })
|
|
10256
10469
|
}
|
|
10257
10470
|
),
|
|
10258
|
-
/* @__PURE__ */ (0,
|
|
10259
|
-
/* @__PURE__ */ (0,
|
|
10471
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "aviala-card__divider", "aria-hidden": true }),
|
|
10472
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons22.DirectionArrowRightLight, { width: 14, height: 14, "aria-hidden": true })
|
|
10260
10473
|
] });
|
|
10261
10474
|
case "switch":
|
|
10262
|
-
return /* @__PURE__ */ (0,
|
|
10475
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "aviala-card-head__trailing", children: [
|
|
10263
10476
|
primaryAction,
|
|
10264
|
-
/* @__PURE__ */ (0,
|
|
10265
|
-
/* @__PURE__ */ (0,
|
|
10477
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "aviala-card__divider", "aria-hidden": true }),
|
|
10478
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Switch, { ...switchProps })
|
|
10266
10479
|
] });
|
|
10267
10480
|
case "select":
|
|
10268
10481
|
default:
|
|
10269
|
-
return select != null ? /* @__PURE__ */ (0,
|
|
10482
|
+
return select != null ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "aviala-card-head__trailing", children: select }) : null;
|
|
10270
10483
|
}
|
|
10271
10484
|
};
|
|
10272
|
-
return /* @__PURE__ */ (0,
|
|
10485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
10273
10486
|
"div",
|
|
10274
10487
|
{
|
|
10275
10488
|
ref,
|
|
@@ -10277,9 +10490,9 @@ var CardHead = (0, import_react58.forwardRef)(
|
|
|
10277
10490
|
"data-type": slotType,
|
|
10278
10491
|
...props,
|
|
10279
10492
|
children: [
|
|
10280
|
-
/* @__PURE__ */ (0,
|
|
10281
|
-
renderCardIcon(icon ?? /* @__PURE__ */ (0,
|
|
10282
|
-
/* @__PURE__ */ (0,
|
|
10493
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "aviala-card-head__main", children: [
|
|
10494
|
+
renderCardIcon(icon ?? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons22.GeneralSetting, { "aria-hidden": true })),
|
|
10495
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "aviala-card-head__title", children: title != null || description != null ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Typeface, { content: "textCaption", primary: title, secondary: description }) : children })
|
|
10283
10496
|
] }),
|
|
10284
10497
|
renderTrailing()
|
|
10285
10498
|
]
|
|
@@ -10289,7 +10502,7 @@ var CardHead = (0, import_react58.forwardRef)(
|
|
|
10289
10502
|
);
|
|
10290
10503
|
CardHead.displayName = "CardHead";
|
|
10291
10504
|
var CardBody = (0, import_react58.forwardRef)(
|
|
10292
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
10505
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { ref, className: cn("aviala-card-body", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "aviala-card-body__content", children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Typography, { level: "text", as: "span", children }) : children }) })
|
|
10293
10506
|
);
|
|
10294
10507
|
CardBody.displayName = "CardBody";
|
|
10295
10508
|
var CardBottom = (0, import_react58.forwardRef)(
|
|
@@ -10305,46 +10518,46 @@ var CardBottom = (0, import_react58.forwardRef)(
|
|
|
10305
10518
|
children,
|
|
10306
10519
|
...props
|
|
10307
10520
|
}, ref) => {
|
|
10308
|
-
const primaryAction = action ?? /* @__PURE__ */ (0,
|
|
10521
|
+
const primaryAction = action ?? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Button, { mode: "primary", size: "regular", leftIcon: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons22.GeneralSetting, { "aria-hidden": true }), children: actionLabel });
|
|
10309
10522
|
const renderTrailing = () => {
|
|
10310
10523
|
if (trailing !== void 0) return trailing;
|
|
10311
10524
|
if (children != null) return children;
|
|
10312
10525
|
switch (slotType) {
|
|
10313
10526
|
case "switch":
|
|
10314
|
-
return /* @__PURE__ */ (0,
|
|
10527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
|
|
10315
10528
|
primaryAction,
|
|
10316
|
-
/* @__PURE__ */ (0,
|
|
10317
|
-
/* @__PURE__ */ (0,
|
|
10529
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "aviala-card__divider", "aria-hidden": true }),
|
|
10530
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Switch, { ...switchProps })
|
|
10318
10531
|
] });
|
|
10319
10532
|
case "select":
|
|
10320
10533
|
return select;
|
|
10321
10534
|
case "action":
|
|
10322
10535
|
default:
|
|
10323
|
-
return /* @__PURE__ */ (0,
|
|
10536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
|
|
10324
10537
|
primaryAction,
|
|
10325
|
-
secondaryAction ?? /* @__PURE__ */ (0,
|
|
10538
|
+
secondaryAction ?? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
10326
10539
|
Button,
|
|
10327
10540
|
{
|
|
10328
10541
|
mode: "default",
|
|
10329
10542
|
size: "regular",
|
|
10330
10543
|
iconOnly: true,
|
|
10331
10544
|
"aria-label": "More",
|
|
10332
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
10545
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons22.GeneralSetting, { "aria-hidden": true })
|
|
10333
10546
|
}
|
|
10334
10547
|
),
|
|
10335
|
-
/* @__PURE__ */ (0,
|
|
10336
|
-
/* @__PURE__ */ (0,
|
|
10548
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "aviala-card__divider", "aria-hidden": true }),
|
|
10549
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_icons22.DirectionArrowRightLight, { width: 14, height: 14, "aria-hidden": true })
|
|
10337
10550
|
] });
|
|
10338
10551
|
}
|
|
10339
10552
|
};
|
|
10340
|
-
return /* @__PURE__ */ (0,
|
|
10553
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
10341
10554
|
"div",
|
|
10342
10555
|
{
|
|
10343
10556
|
ref,
|
|
10344
10557
|
className: cn("aviala-card-bottom", className),
|
|
10345
10558
|
"data-type": slotType,
|
|
10346
10559
|
...props,
|
|
10347
|
-
children: /* @__PURE__ */ (0,
|
|
10560
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "aviala-card-bottom__trailing", children: renderTrailing() })
|
|
10348
10561
|
}
|
|
10349
10562
|
);
|
|
10350
10563
|
}
|
|
@@ -10353,9 +10566,9 @@ CardBottom.displayName = "CardBottom";
|
|
|
10353
10566
|
|
|
10354
10567
|
// src/components/table.tsx
|
|
10355
10568
|
var import_react59 = require("react");
|
|
10356
|
-
var
|
|
10569
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
10357
10570
|
var Table = (0, import_react59.forwardRef)(
|
|
10358
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
10571
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
10359
10572
|
"div",
|
|
10360
10573
|
{
|
|
10361
10574
|
ref,
|
|
@@ -10368,7 +10581,7 @@ var Table = (0, import_react59.forwardRef)(
|
|
|
10368
10581
|
);
|
|
10369
10582
|
Table.displayName = "Table";
|
|
10370
10583
|
var TableRow = (0, import_react59.forwardRef)(
|
|
10371
|
-
({ className, header = false, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
10584
|
+
({ className, header = false, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
10372
10585
|
"div",
|
|
10373
10586
|
{
|
|
10374
10587
|
ref,
|
|
@@ -10382,7 +10595,7 @@ var TableRow = (0, import_react59.forwardRef)(
|
|
|
10382
10595
|
);
|
|
10383
10596
|
TableRow.displayName = "TableRow";
|
|
10384
10597
|
var TableHead = (0, import_react59.forwardRef)(
|
|
10385
|
-
({ className, content = "text", children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
10598
|
+
({ className, content = "text", children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
10386
10599
|
"div",
|
|
10387
10600
|
{
|
|
10388
10601
|
ref,
|
|
@@ -10390,7 +10603,7 @@ var TableHead = (0, import_react59.forwardRef)(
|
|
|
10390
10603
|
className: cn("aviala-table-head", className),
|
|
10391
10604
|
"data-content": content,
|
|
10392
10605
|
...props,
|
|
10393
|
-
children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ (0,
|
|
10606
|
+
children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Typography, { level: "caption", as: "span", children }) : children
|
|
10394
10607
|
}
|
|
10395
10608
|
)
|
|
10396
10609
|
);
|
|
@@ -10405,7 +10618,7 @@ function renderCellIcon(node) {
|
|
|
10405
10618
|
"shrink-0"
|
|
10406
10619
|
)
|
|
10407
10620
|
}) : node;
|
|
10408
|
-
return /* @__PURE__ */ (0,
|
|
10621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "aviala-table-cell__icon", children: content });
|
|
10409
10622
|
}
|
|
10410
10623
|
var TableCell = (0, import_react59.forwardRef)(
|
|
10411
10624
|
({
|
|
@@ -10426,29 +10639,29 @@ var TableCell = (0, import_react59.forwardRef)(
|
|
|
10426
10639
|
if (children != null) return children;
|
|
10427
10640
|
switch (content) {
|
|
10428
10641
|
case "checkbox":
|
|
10429
|
-
return /* @__PURE__ */ (0,
|
|
10642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Checkbox, { ...checkboxProps });
|
|
10430
10643
|
case "icon+text":
|
|
10431
|
-
return /* @__PURE__ */ (0,
|
|
10644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
|
|
10432
10645
|
renderCellIcon(icon),
|
|
10433
|
-
/* @__PURE__ */ (0,
|
|
10646
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "aviala-table-cell__text", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Typography, { level: "text", as: "span", children: text }) })
|
|
10434
10647
|
] });
|
|
10435
10648
|
case "people":
|
|
10436
|
-
return /* @__PURE__ */ (0,
|
|
10437
|
-
people ?? /* @__PURE__ */ (0,
|
|
10438
|
-
/* @__PURE__ */ (0,
|
|
10649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
|
|
10650
|
+
people ?? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Avatar, { content: "text", level: "text", children: "A" }),
|
|
10651
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "aviala-table-cell__text", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Typography, { level: "text", as: "span", children: text }) })
|
|
10439
10652
|
] });
|
|
10440
10653
|
case "badge":
|
|
10441
|
-
return badge ?? /* @__PURE__ */ (0,
|
|
10654
|
+
return badge ?? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Badge, { style: "theme", level: "caption", children: badgeLabel ?? "Text" });
|
|
10442
10655
|
case "switch":
|
|
10443
|
-
return /* @__PURE__ */ (0,
|
|
10656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Switch, { ...switchProps });
|
|
10444
10657
|
case "action":
|
|
10445
|
-
return /* @__PURE__ */ (0,
|
|
10658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "aviala-table-cell__actions", children: actions });
|
|
10446
10659
|
case "text":
|
|
10447
10660
|
default:
|
|
10448
|
-
return /* @__PURE__ */ (0,
|
|
10661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "aviala-table-cell__text", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Typography, { level: "text", as: "span", children: text }) });
|
|
10449
10662
|
}
|
|
10450
10663
|
};
|
|
10451
|
-
return /* @__PURE__ */ (0,
|
|
10664
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
10452
10665
|
"div",
|
|
10453
10666
|
{
|
|
10454
10667
|
ref,
|