@eightshift/ui-components 5.2.1 → 5.3.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/{Button-RTwMSBs-.js → Button-npzfSoYo.js} +3 -3
- package/dist/{Dialog-Xf6AsnV-.js → Dialog-CQ8H6Noi.js} +77 -50
- package/dist/{FocusScope-BnwM-e8R.js → FocusScope-DJApHXhY.js} +1 -1
- package/dist/Form-Cq3fu75_.js +5 -0
- package/dist/{Group-C4cXobNT.js → Input-ChJaTNa5.js} +39 -39
- package/dist/{List-CwJTORxj.js → List-BiAnh5G5.js} +5 -5
- package/dist/{ListBox-BeC97FZ4.js → ListBox-D0Stb4wr.js} +13 -23
- package/dist/{OverlayArrow-EZ0v_ljk.js → OverlayArrow-DivvkAVb.js} +46 -25
- package/dist/{Separator-Fl7qSeN-.js → SearchField-jVsbJe1O.js} +151 -475
- package/dist/{Select-DEQf8ZWI.js → Select-ciHB1pub.js} +12 -11
- package/dist/{Select-ef7c0426.esm-D6WOCaYm.js → Select-ef7c0426.esm-CmTkSxDx.js} +3 -3
- package/dist/{Collection-D_KhdLDC.js → SelectionManager-CabSdgMq.js} +1801 -1777
- package/dist/Separator-BPvqJny4.js +344 -0
- package/dist/{Slider-BQFSEhvk.js → Slider-ChP04COa.js} +4 -4
- package/dist/{VisuallyHidden-D9s7FTtC.js → VisuallyHidden-X6SggVVO.js} +1 -1
- package/dist/assets/style-admin.css +315 -79
- package/dist/assets/style-editor.css +315 -79
- package/dist/assets/style.css +315 -79
- package/dist/assets/wp-font-enhancements.css +1 -1
- package/dist/assets/wp-ui-enhancements.css +5 -14
- package/dist/components/animated-visibility/animated-visibility.js +16 -16
- package/dist/components/button/button.js +7 -23
- package/dist/components/checkbox/checkbox.js +11 -10
- package/dist/components/color-pickers/color-picker.js +5 -4
- package/dist/components/color-pickers/color-swatch.js +1 -1
- package/dist/components/color-pickers/gradient-editor.js +7 -7
- package/dist/components/color-pickers/solid-color-picker.js +8 -8
- package/dist/components/component-toggle/component-toggle.js +1 -1
- package/dist/components/draggable/draggable-handle.js +1 -1
- package/dist/components/draggable/draggable.js +34 -17
- package/dist/components/draggable-list/draggable-list-item.js +1 -1
- package/dist/components/draggable-list/draggable-list.js +6 -4
- package/dist/components/expandable/expandable.js +5 -5
- package/dist/components/index.js +2 -1
- package/dist/components/input-field/input-field.js +139 -3
- package/dist/components/item-collection/item-collection.js +1 -1
- package/dist/components/link-input/link-input.js +16 -15
- package/dist/components/matrix-align/matrix-align.js +1 -1
- package/dist/components/menu/menu.js +94 -24
- package/dist/components/modal/modal.js +4 -4
- package/dist/components/notice/notice.js +6 -5
- package/dist/components/number-picker/number-picker.js +5 -5
- package/dist/components/option-select/option-select.js +1 -1
- package/dist/components/placeholders/file-placeholder.js +1 -1
- package/dist/components/popover/popover.js +7 -21
- package/dist/components/radio/radio.js +7 -6
- package/dist/components/repeater/repeater-item.js +1 -1
- package/dist/components/repeater/repeater.js +2 -2
- package/dist/components/responsive/mini-responsive.js +1 -1
- package/dist/components/responsive/responsive-legacy.js +1 -1
- package/dist/components/responsive/responsive.js +21 -20
- package/dist/components/responsive-preview/responsive-preview.js +1 -1
- package/dist/components/rich-label/rich-label.js +28 -15
- package/dist/components/select/async-multi-select.js +3 -3
- package/dist/components/select/async-single-select.js +2 -2
- package/dist/components/select/custom-select-default-components.js +1 -1
- package/dist/components/select/multi-select-components.js +1 -1
- package/dist/components/select/multi-select.js +3 -3
- package/dist/components/select/react-select-component-wrappers.js +1 -1
- package/dist/components/select/single-select.js +2 -2
- package/dist/components/select/styles.js +1 -1
- package/dist/components/select/v2/async-multi-select.js +9 -9
- package/dist/components/select/v2/async-select.js +9 -9
- package/dist/components/select/v2/multi-select.js +8 -8
- package/dist/components/select/v2/shared.js +1 -1
- package/dist/components/select/v2/single-select.js +8 -8
- package/dist/components/slider/column-config-slider.js +2 -2
- package/dist/components/slider/slider.js +1 -1
- package/dist/components/slider/utils.js +1 -1
- package/dist/components/tabs/tabs.js +13 -9
- package/dist/components/toggle/switch.js +5 -5
- package/dist/components/toggle-button/toggle-button.js +7 -7
- package/dist/components/tooltip/tooltip.js +12 -35
- package/dist/context-DCAZLyDS.js +7 -0
- package/dist/{default-i18n-DY6EfUSA.js → default-i18n-CN_q3KUs.js} +15 -56
- package/dist/icons/icons.js +3347 -30273
- package/dist/{index-641ee5b8.esm-Bu-mgopl.js → index-641ee5b8.esm-DVp0njHa.js} +10 -8
- package/dist/{index-CBHA_HDD.js → index-D8-Zjpbd.js} +18 -18
- package/dist/index.js +2 -1
- package/dist/{multi-select-components-rCCyCaKO.js → multi-select-components-CT_W0Cy9.js} +1 -1
- package/dist/{react-select-async.esm-XYrsKYb2.js → react-select-async.esm-Zl1LPaPb.js} +3 -3
- package/dist/{react-select.esm-CCSPY6XR.js → react-select.esm-Bu36HujU.js} +3 -3
- package/dist/{textSelection-D5tWX1rJ.js → textSelection-k0u64dDA.js} +1 -1
- package/dist/{useAsyncList-ZqaIH2gh.js → useAsyncList-D52mQcrH.js} +30 -0
- package/dist/{useButton-BtJSiQi3.js → useButton-Bn4ZT295.js} +4 -3
- package/dist/{useDragAndDrop-CddFteYC.js → useDragAndDrop-DVLrIdEn.js} +18 -10
- package/dist/{useFilter-Cl2ggwwq.js → useFilter-C4wo8Iii.js} +1 -1
- package/dist/{useFocusRing-D5BfOWag.js → useFocusRing-CUxgjvAY.js} +1 -1
- package/dist/{Form-BeMxJA29.js → useFormValidation-CUtZcedF.js} +5 -7
- package/dist/{useHover-44IApaa2.js → useHover-LmGemtHE.js} +24 -24
- package/dist/{useListState-BSkHuB7-.js → useListState-Xsk-aOvN.js} +8 -5
- package/dist/{useNumberField-JhWPy1JY.js → useNumberField-BCjjZWaz.js} +100 -99
- package/dist/{usePress-BnrkvZ7e.js → usePress-CBQIDzpQ.js} +12 -12
- package/dist/{useSingleSelectListState-CzJFsSHr.js → useSingleSelectListState-DattSD7d.js} +2 -2
- package/dist/{useToggle-OaIBlwRu.js → useToggle-C8CedY6Z.js} +2 -2
- package/dist/{useToggleState-BF8hvidm.js → useToggleState-CiAradXs.js} +1 -1
- package/package.json +25 -25
- package/dist/TextField-x_eEa_qR.js +0 -143
|
@@ -1,9 +1,145 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../
|
|
3
|
-
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-DWVaNd2E.js";
|
|
4
|
-
import { $ as $
|
|
2
|
+
import { d as $2d73ec29415bd339$export$712718f7aec83d5, b as $3985021b0ad6602f$export$37fb8590cf2c088c, a as $a049562f99e7db0e$export$f9c6924e160136d1, $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-ChJaTNa5.js";
|
|
3
|
+
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-DWVaNd2E.js";
|
|
4
|
+
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415, h as $64fa3d84918910a7$export$4d86445c2cf5e3, b as $3ef42575df84b30b$export$9d1611c77c2fe928, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, f as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, g as $64fa3d84918910a7$export$ef03459518577ad4, i as $64fa3d84918910a7$export$2881499e37b75b9a } from "../../utils-cvK1vxO7.js";
|
|
5
|
+
import React__default, { forwardRef, createContext, useRef, useState, useCallback } from "react";
|
|
6
|
+
import { w as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../useHover-LmGemtHE.js";
|
|
7
|
+
import { a as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-CUxgjvAY.js";
|
|
8
|
+
import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-B8BgFmIQ.js";
|
|
9
|
+
import { $ as $8e6cc465cc68f603$export$698f465ec27e93df } from "../../context-DCAZLyDS.js";
|
|
10
|
+
import { $ as $d3e0e05bdfcf66bd$export$c24727297075ec6a } from "../../Form-Cq3fu75_.js";
|
|
11
|
+
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-AxKZjtFm.js";
|
|
12
|
+
import { $ as $f39a9eba43920ace$export$86427a43e3e48ebb } from "../../Hidden-rE6uR-lr.js";
|
|
13
|
+
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-D2C6R0DK.js";
|
|
5
14
|
import { BaseControl } from "../base-control/base-control.js";
|
|
6
15
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
16
|
+
const $216918bed6669f72$export$2dc6166a7e65358c = /* @__PURE__ */ createContext({});
|
|
17
|
+
let $216918bed6669f72$var$filterHoverProps = (props) => {
|
|
18
|
+
let { onHoverStart, onHoverChange, onHoverEnd, ...otherProps } = props;
|
|
19
|
+
return otherProps;
|
|
20
|
+
};
|
|
21
|
+
const $216918bed6669f72$export$f5c9f3c2c4054eec = /* @__PURE__ */ forwardRef(function TextArea(props, ref) {
|
|
22
|
+
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $216918bed6669f72$export$2dc6166a7e65358c);
|
|
23
|
+
let { hoverProps, isHovered } = $6179b936705e76d3$export$ae780daf29e6d456(props);
|
|
24
|
+
let { isFocused, isFocusVisible, focusProps } = $f7dceffc5ad7768b$export$4e328f61c538687f({
|
|
25
|
+
isTextInput: true,
|
|
26
|
+
autoFocus: props.autoFocus
|
|
27
|
+
});
|
|
28
|
+
let isInvalid = !!props["aria-invalid"] && props["aria-invalid"] !== "false";
|
|
29
|
+
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
30
|
+
...props,
|
|
31
|
+
values: {
|
|
32
|
+
isHovered,
|
|
33
|
+
isFocused,
|
|
34
|
+
isFocusVisible,
|
|
35
|
+
isDisabled: props.disabled || false,
|
|
36
|
+
isInvalid
|
|
37
|
+
},
|
|
38
|
+
defaultClassName: "react-aria-TextArea"
|
|
39
|
+
});
|
|
40
|
+
return /* @__PURE__ */ React__default.createElement("textarea", {
|
|
41
|
+
...$3ef42575df84b30b$export$9d1611c77c2fe928($216918bed6669f72$var$filterHoverProps(props), focusProps, hoverProps),
|
|
42
|
+
...renderProps,
|
|
43
|
+
ref,
|
|
44
|
+
"data-focused": isFocused || void 0,
|
|
45
|
+
"data-disabled": props.disabled || void 0,
|
|
46
|
+
"data-hovered": isHovered || void 0,
|
|
47
|
+
"data-focus-visible": isFocusVisible || void 0,
|
|
48
|
+
"data-invalid": isInvalid || void 0
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
const $bcdf0525bf22703d$export$2129e27b3ef0d483 = /* @__PURE__ */ createContext(null);
|
|
52
|
+
const $bcdf0525bf22703d$export$2c73285ae9390cec = /* @__PURE__ */ $f39a9eba43920ace$export$86427a43e3e48ebb(function TextField(props, ref) {
|
|
53
|
+
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $bcdf0525bf22703d$export$2129e27b3ef0d483);
|
|
54
|
+
let { validationBehavior: formValidationBehavior } = $64fa3d84918910a7$export$fabf2dc03a41866e($d3e0e05bdfcf66bd$export$c24727297075ec6a) || {};
|
|
55
|
+
var _props_validationBehavior, _ref;
|
|
56
|
+
let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : "native";
|
|
57
|
+
let inputRef = useRef(null);
|
|
58
|
+
[props, inputRef] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, inputRef, $8e6cc465cc68f603$export$698f465ec27e93df);
|
|
59
|
+
let [labelRef, label] = $64fa3d84918910a7$export$9d4c57ee4c6ffdd8(!props["aria-label"] && !props["aria-labelledby"]);
|
|
60
|
+
let [inputElementType, setInputElementType] = useState("input");
|
|
61
|
+
let { labelProps, inputProps, descriptionProps, errorMessageProps, ...validation } = $2d73ec29415bd339$export$712718f7aec83d5({
|
|
62
|
+
...$64fa3d84918910a7$export$ef03459518577ad4(props),
|
|
63
|
+
inputElementType,
|
|
64
|
+
label,
|
|
65
|
+
validationBehavior
|
|
66
|
+
}, inputRef);
|
|
67
|
+
let inputOrTextAreaRef = useCallback((el) => {
|
|
68
|
+
inputRef.current = el;
|
|
69
|
+
if (el) setInputElementType(el instanceof HTMLTextAreaElement ? "textarea" : "input");
|
|
70
|
+
}, [
|
|
71
|
+
inputRef
|
|
72
|
+
]);
|
|
73
|
+
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
74
|
+
...props,
|
|
75
|
+
values: {
|
|
76
|
+
isDisabled: props.isDisabled || false,
|
|
77
|
+
isInvalid: validation.isInvalid,
|
|
78
|
+
isReadOnly: props.isReadOnly || false,
|
|
79
|
+
isRequired: props.isRequired || false
|
|
80
|
+
},
|
|
81
|
+
defaultClassName: "react-aria-TextField"
|
|
82
|
+
});
|
|
83
|
+
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
84
|
+
global: true
|
|
85
|
+
});
|
|
86
|
+
delete DOMProps.id;
|
|
87
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
88
|
+
...DOMProps,
|
|
89
|
+
...renderProps,
|
|
90
|
+
ref,
|
|
91
|
+
slot: props.slot || void 0,
|
|
92
|
+
"data-disabled": props.isDisabled || void 0,
|
|
93
|
+
"data-invalid": validation.isInvalid || void 0,
|
|
94
|
+
"data-readonly": props.isReadOnly || void 0,
|
|
95
|
+
"data-required": props.isRequired || void 0
|
|
96
|
+
}, /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
|
|
97
|
+
values: [
|
|
98
|
+
[
|
|
99
|
+
$01b77f81d0f07f68$export$75b6ee27786ba447,
|
|
100
|
+
{
|
|
101
|
+
...labelProps,
|
|
102
|
+
ref: labelRef
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
[
|
|
106
|
+
$3985021b0ad6602f$export$37fb8590cf2c088c,
|
|
107
|
+
{
|
|
108
|
+
...inputProps,
|
|
109
|
+
ref: inputOrTextAreaRef
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
[
|
|
113
|
+
$216918bed6669f72$export$2dc6166a7e65358c,
|
|
114
|
+
{
|
|
115
|
+
...inputProps,
|
|
116
|
+
ref: inputOrTextAreaRef
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
[
|
|
120
|
+
$a049562f99e7db0e$export$f9c6924e160136d1,
|
|
121
|
+
{
|
|
122
|
+
role: "presentation",
|
|
123
|
+
isInvalid: validation.isInvalid,
|
|
124
|
+
isDisabled: props.isDisabled || false
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
[
|
|
128
|
+
$514c0188e459b4c0$export$9afb8bc826b033ea,
|
|
129
|
+
{
|
|
130
|
+
slots: {
|
|
131
|
+
description: descriptionProps,
|
|
132
|
+
errorMessage: errorMessageProps
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
[
|
|
137
|
+
$ee014567cb39d3f0$export$ff05c3ac10437e03,
|
|
138
|
+
validation
|
|
139
|
+
]
|
|
140
|
+
]
|
|
141
|
+
}, renderProps.children));
|
|
142
|
+
});
|
|
7
143
|
/**
|
|
8
144
|
* An input field.
|
|
9
145
|
*
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { c as $319e236875307eab$export$a9b970dcc4ae71a9, a as $d2b4bc8c273e7be6$export$24d547caef80ccd1, $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../Button-
|
|
2
|
+
import { c as $319e236875307eab$export$a9b970dcc4ae71a9, a as $d2b4bc8c273e7be6$export$24d547caef80ccd1, $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../Button-npzfSoYo.js";
|
|
3
3
|
import { p as $ff5963eb1fccf552$export$e08e3b67e392101e, b as $3ef42575df84b30b$export$9d1611c77c2fe928, a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, f as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, g as $64fa3d84918910a7$export$ef03459518577ad4, h as $64fa3d84918910a7$export$4d86445c2cf5e3, i as $64fa3d84918910a7$export$2881499e37b75b9a } from "../../utils-cvK1vxO7.js";
|
|
4
4
|
import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-B8BgFmIQ.js";
|
|
5
|
-
import {
|
|
6
|
-
import { d as $2d73ec29415bd339$export$712718f7aec83d5, b as $3985021b0ad6602f$export$37fb8590cf2c088c, a as $a049562f99e7db0e$export$f9c6924e160136d1, c as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4, $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../
|
|
5
|
+
import { $ as $d3e0e05bdfcf66bd$export$c24727297075ec6a } from "../../Form-Cq3fu75_.js";
|
|
6
|
+
import { d as $2d73ec29415bd339$export$712718f7aec83d5, b as $3985021b0ad6602f$export$37fb8590cf2c088c, a as $a049562f99e7db0e$export$f9c6924e160136d1, c as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4, $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-ChJaTNa5.js";
|
|
7
7
|
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-DWVaNd2E.js";
|
|
8
|
-
import { e as $b1f0cad8af73213b$export$3585ede4d035bf14, f as $b1f0cad8af73213b$export$9145995848b05025, c as $eed445e0843c11d0$export$7ff8f37d2d81a48d, d as $eed445e0843c11d0$export$7c5906fe4f1f2af2, $ as $eed445e0843c11d0$export$41f133550aa26f48, a as $eed445e0843c11d0$export$a11e76429ed99b4 } from "../../ListBox-
|
|
9
|
-
import { o as $168583247155ddda$export$dc9c12ed27dd1b49, k as $5e3802645cc19319$export$1c3ebcada18427bf, l as $de32f1b87079253c$export$d2f961adcb0afbe, p as $07b14b47974efb58$export$9b9a0cd73afb7ca4, e as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../Dialog-
|
|
8
|
+
import { e as $b1f0cad8af73213b$export$3585ede4d035bf14, f as $b1f0cad8af73213b$export$9145995848b05025, c as $eed445e0843c11d0$export$7ff8f37d2d81a48d, d as $eed445e0843c11d0$export$7c5906fe4f1f2af2, $ as $eed445e0843c11d0$export$41f133550aa26f48, a as $eed445e0843c11d0$export$a11e76429ed99b4 } from "../../ListBox-D0Stb4wr.js";
|
|
9
|
+
import { o as $168583247155ddda$export$dc9c12ed27dd1b49, k as $5e3802645cc19319$export$1c3ebcada18427bf, l as $de32f1b87079253c$export$d2f961adcb0afbe, p as $07b14b47974efb58$export$9b9a0cd73afb7ca4, e as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../Dialog-CQ8H6Noi.js";
|
|
10
10
|
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-AxKZjtFm.js";
|
|
11
|
-
import {
|
|
11
|
+
import { k as $ae20dd8cbca75726$export$d6daf82dcd84e87c, q as $c5a24bc478652b5f$export$1005530eda016c13, t as $55f9b1ae81f22853$export$2b35b76d2e30e129, e as $e1995378a142960e$export$bf788dd355e3a401 } from "../../SelectionManager-CabSdgMq.js";
|
|
12
12
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-D2C6R0DK.js";
|
|
13
|
-
import { $ as $fc909762b330b746$export$61c6a8c84e605fb6, f as $9daab02d461809db$export$683480f191c0e3ea } from "../../OverlayArrow-
|
|
13
|
+
import { $ as $fc909762b330b746$export$61c6a8c84e605fb6, f as $9daab02d461809db$export$683480f191c0e3ea } from "../../OverlayArrow-DivvkAVb.js";
|
|
14
14
|
import React__default, { useRef, useEffect, useMemo, useState, useCallback, forwardRef, createContext, cloneElement } from "react";
|
|
15
|
-
import { $ as $bb77f239b46e8c72$export$3274cf84b703fff } from "../../useFilter-
|
|
16
|
-
import { $ as $
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
15
|
+
import { $ as $bb77f239b46e8c72$export$3274cf84b703fff } from "../../useFilter-C4wo8Iii.js";
|
|
16
|
+
import { b as $e5be200c675c3b3a$export$a763b9476acd3eb, $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10 } from "../../useFormValidation-CUtZcedF.js";
|
|
17
|
+
import { $ as $a0d645289fe9b86b$export$e7f05e985daf4b5f } from "../../useSingleSelectListState-DattSD7d.js";
|
|
18
|
+
import { c as $a02d57049d202695$export$d085fb9e920b5ca7 } from "../../useListState-Xsk-aOvN.js";
|
|
19
|
+
import { J as $c87311424ea30a05$export$e1865c3bedcd822b, g as $d4ee10de306f2510$export$cd4e5573fbe2b576, c as $431fbd86ca7dc216$export$b204af158042fbac, a as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "../../useHover-LmGemtHE.js";
|
|
20
|
+
import { b as $ea8dcbcb9ea1b556$export$9a302a45f65d0572 } from "../../usePress-CBQIDzpQ.js";
|
|
20
21
|
import { $ as $313b98861ee5dd6c$export$d6875122194c7b44 } from "../../useLabels-Cdxi6JSa.js";
|
|
21
|
-
import {
|
|
22
|
+
import { f as $2a25aae57d74318e$export$a05409b8bb224a5a, e as $453cc9f0df89c0a5$export$77d5aafae4e095b2 } from "../../Separator-BPvqJny4.js";
|
|
22
23
|
import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "../../useLocalizedStringFormatter-eaZiN2tE.js";
|
|
23
|
-
import { _ as __ } from "../../default-i18n-
|
|
24
|
+
import { _ as __ } from "../../default-i18n-CN_q3KUs.js";
|
|
24
25
|
import { icons } from "../../icons/icons.js";
|
|
25
26
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
26
27
|
import { Spacer } from "../spacer/spacer.js";
|
|
@@ -28,7 +29,7 @@ import { Tooltip } from "../tooltip/tooltip.js";
|
|
|
28
29
|
import { AnimatedVisibility } from "../animated-visibility/animated-visibility.js";
|
|
29
30
|
import { BaseControl } from "../base-control/base-control.js";
|
|
30
31
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
31
|
-
import { $ as $f86e6c1ec7da6ebb$export$bc3384a35de93d66 } from "../../useAsyncList-
|
|
32
|
+
import { $ as $f86e6c1ec7da6ebb$export$bc3384a35de93d66 } from "../../useAsyncList-D52mQcrH.js";
|
|
32
33
|
function $4f58c5f72bcf79f7$export$496315a1608d9602(effect, dependencies) {
|
|
33
34
|
const isInitialMount = useRef(true);
|
|
34
35
|
const lastDeps = useRef(null);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { _ as __ } from "../../default-i18n-
|
|
2
|
+
import { _ as __ } from "../../default-i18n-CN_q3KUs.js";
|
|
3
3
|
import { icons } from "../../icons/icons.js";
|
|
4
4
|
import { pascalCase, upperFirst, camelCase } from "../../utilities/es-dash.js";
|
|
5
5
|
import { Menu, MenuItem } from "../menu/menu.js";
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { $ as $72a5793c14baf454$export$8b251419efc915eb, a as $431f98aba6844401$export$1ff3c3f08ae963c0 } from "../../Separator-
|
|
3
|
-
import { $ as $3674c52c6b3c5bce$export$27d2ad3c5815583e, a as $3674c52c6b3c5bce$export$d9b273488cd8ce6f, b as $3674c52c6b3c5bce$export$2ce376c2cc3355c8, c as $3674c52c6b3c5bce$export$4b1545b4f2016d26, d as $3674c52c6b3c5bce$export$ecabc99eeffab7ca } from "../../Dialog-
|
|
2
|
+
import { $ as $72a5793c14baf454$export$8b251419efc915eb, a as $431f98aba6844401$export$1ff3c3f08ae963c0 } from "../../Separator-BPvqJny4.js";
|
|
3
|
+
import { $ as $3674c52c6b3c5bce$export$27d2ad3c5815583e, a as $3674c52c6b3c5bce$export$d9b273488cd8ce6f, b as $3674c52c6b3c5bce$export$2ce376c2cc3355c8, c as $3674c52c6b3c5bce$export$4b1545b4f2016d26, d as $3674c52c6b3c5bce$export$ecabc99eeffab7ca } from "../../Dialog-CQ8H6Noi.js";
|
|
4
|
+
import { RichLabel } from "../rich-label/rich-label.js";
|
|
4
5
|
import { icons } from "../../icons/icons.js";
|
|
5
6
|
import { Button } from "../button/button.js";
|
|
6
7
|
import { Popover } from "../popover/popover.js";
|
|
7
8
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
8
9
|
import { cloneElement } from "react";
|
|
9
|
-
import { _ as __ } from "../../default-i18n-
|
|
10
|
+
import { _ as __ } from "../../default-i18n-CN_q3KUs.js";
|
|
10
11
|
/**
|
|
11
12
|
* A simple menu component.
|
|
12
13
|
*
|
|
@@ -14,12 +15,13 @@ import { _ as __ } from "../../default-i18n-DY6EfUSA.js";
|
|
|
14
15
|
* @param {Object} props - Component props.
|
|
15
16
|
* @param {string} [props.triggerLabel] - The label of the trigger button.
|
|
16
17
|
* @param {JSX.Element} [props.triggerIcon] - The icon of the trigger button.
|
|
17
|
-
* @param {
|
|
18
|
+
* @param {ButtonProps} [props.triggerProps] - Props to pass to the trigger button.
|
|
18
19
|
* @param {string} [props.tooltip] - Tooltip text to display on the trigger button.
|
|
19
20
|
* @param {boolean} [props.keepOpen=false] - If `true`, the menu will not close when an item is selected.
|
|
20
21
|
* @param {boolean} [props.openOnLongPress=false] - If `true`, the menu will open on long press instead of click. If enabled, a regular `onPress` event can also be passed to the trigger button to enable dual behavior.
|
|
21
|
-
* @param {
|
|
22
|
+
* @param {PopoverProps} [props.popoverProps] - Props to pass to the popover.
|
|
22
23
|
* @param {boolean} [props.disabled] - If `true`, the trigger button is disabled.
|
|
24
|
+
* @param {boolean} [props.manualWidth=false] - If `true`, the popover will not have a fixed width.
|
|
23
25
|
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
24
26
|
*
|
|
25
27
|
* @returns {JSX.Element} The Menu component.
|
|
@@ -72,6 +74,7 @@ const Menu = (props) => {
|
|
|
72
74
|
"aria-label": ariaLabel = triggerLabel ?? __("Menu", "eightshift-ui-components"),
|
|
73
75
|
openOnLongPress = false,
|
|
74
76
|
disabled,
|
|
77
|
+
manualWidth,
|
|
75
78
|
hidden
|
|
76
79
|
} = props;
|
|
77
80
|
if (hidden) {
|
|
@@ -111,10 +114,10 @@ const Menu = (props) => {
|
|
|
111
114
|
/* @__PURE__ */ jsx(
|
|
112
115
|
Popover,
|
|
113
116
|
{
|
|
114
|
-
className: "es:p-0! es:any-focus:outline-hidden",
|
|
115
117
|
"aria-label": ariaLabel,
|
|
116
|
-
wrapperClassName: clsx(!hasSubmenuItems && "es:overflow-y-auto"),
|
|
117
118
|
...popoverProps,
|
|
119
|
+
className: clsx("es:p-0! es:any-focus:outline-hidden", !manualWidth && "es:w-56", manualWidth && "es:max-w-80", popoverProps?.className),
|
|
120
|
+
wrapperClassName: clsx(!hasSubmenuItems && "es:overflow-y-auto", popoverProps?.wrapperClassName),
|
|
118
121
|
children: /* @__PURE__ */ jsx(
|
|
119
122
|
$3674c52c6b3c5bce$export$d9b273488cd8ce6f,
|
|
120
123
|
{
|
|
@@ -152,11 +155,11 @@ const MenuSection = (props) => {
|
|
|
152
155
|
{
|
|
153
156
|
className: clsx(
|
|
154
157
|
"es:space-y-1 es:border-b es:border-b-secondary-200 es:last:border-b-0",
|
|
155
|
-
label && "es:pt-2 es:first:pt-
|
|
158
|
+
label && "es:pt-2 es:first:pt-2.5 es:last:pb-0",
|
|
156
159
|
!label && "es:has-[>_:only-child]:pb-0"
|
|
157
160
|
),
|
|
158
161
|
children: [
|
|
159
|
-
label && /* @__PURE__ */ jsx($72a5793c14baf454$export$8b251419efc915eb, { className: "es:ml-
|
|
162
|
+
label && /* @__PURE__ */ jsx($72a5793c14baf454$export$8b251419efc915eb, { className: "es:ml-2.5 es:text-sm es:text-secondary-500", children: label }),
|
|
160
163
|
children
|
|
161
164
|
]
|
|
162
165
|
}
|
|
@@ -172,7 +175,7 @@ const MenuSection = (props) => {
|
|
|
172
175
|
* @preserve
|
|
173
176
|
*/
|
|
174
177
|
const MenuSeparator = () => {
|
|
175
|
-
return /* @__PURE__ */ jsx($431f98aba6844401$export$1ff3c3f08ae963c0, { className: "es:
|
|
178
|
+
return /* @__PURE__ */ jsx($431f98aba6844401$export$1ff3c3f08ae963c0, { className: "es:my-1 es:border-b es:border-secondary-300" });
|
|
176
179
|
};
|
|
177
180
|
/**
|
|
178
181
|
* A menu item.
|
|
@@ -185,7 +188,10 @@ const MenuSeparator = () => {
|
|
|
185
188
|
* @param {boolean} [props.selected] - If `true`, the item is marked as selected. This is visually represented by a circle.
|
|
186
189
|
* @param {boolean} [props.disabled] - If `true`, the item will be disabled.
|
|
187
190
|
* @param {JSX.Element} [props.endIcon] - The icon at the right side of the item.
|
|
191
|
+
* @param {string|JSX.Element} [props.subtitle] - The subtitle below the main label.
|
|
188
192
|
* @param {Function} [props.onClick] - Function to run when the item is clicked.
|
|
193
|
+
* @param {boolean} [props.danger] - If `true`, the item appearance is tweaked to indicate a dangerous action.
|
|
194
|
+
* @param {boolean} [props.primary] - If `true`, the item appearance is tweaked to indicate a primary action.
|
|
189
195
|
* @param {string} [props.className] - Classes to pass to the menu item.
|
|
190
196
|
*
|
|
191
197
|
* @returns {JSX.Element} The MenuItem component.
|
|
@@ -198,15 +204,26 @@ const MenuItem = (props) => {
|
|
|
198
204
|
const {
|
|
199
205
|
icon,
|
|
200
206
|
children,
|
|
207
|
+
subtitle,
|
|
201
208
|
checked,
|
|
202
209
|
selected,
|
|
203
210
|
disabled,
|
|
204
211
|
endIcon,
|
|
205
212
|
onClick,
|
|
206
213
|
shortcut,
|
|
214
|
+
danger,
|
|
215
|
+
primary,
|
|
207
216
|
className,
|
|
208
217
|
"aria-label": ariaLabel = typeof children === "string" ? children : __("Menu item", "eightshift-ui-components")
|
|
209
218
|
} = props;
|
|
219
|
+
let itemIcon = icon;
|
|
220
|
+
if (checked === true) {
|
|
221
|
+
itemIcon = icons.menuItemCheck;
|
|
222
|
+
} else if (selected === true) {
|
|
223
|
+
itemIcon = icons.menuItemCircle;
|
|
224
|
+
} else if (selected === false || checked === false) {
|
|
225
|
+
itemIcon = icons.dummySpacer;
|
|
226
|
+
}
|
|
210
227
|
return /* @__PURE__ */ jsxs(
|
|
211
228
|
$3674c52c6b3c5bce$export$2ce376c2cc3355c8,
|
|
212
229
|
{
|
|
@@ -214,23 +231,34 @@ const MenuItem = (props) => {
|
|
|
214
231
|
"aria-label": ariaLabel,
|
|
215
232
|
isDisabled: disabled,
|
|
216
233
|
className: clsx(
|
|
217
|
-
"es:mx-1 es:mb-
|
|
218
|
-
"es:first:mt-1
|
|
234
|
+
"es:mx-1 es:mb-0.5 es:flex es:min-w-44 es:min-h-9.5 es:items-center es:gap-1.5",
|
|
235
|
+
"es:first:mt-1",
|
|
236
|
+
"es:last:mb-1",
|
|
219
237
|
"es:select-none es:rounded-xl es:py-1.5 es:px-2.5 es:text-sm es:transition",
|
|
220
238
|
"es:any-focus:outline-hidden",
|
|
221
|
-
|
|
239
|
+
"es:icon:shrink-0",
|
|
240
|
+
!disabled && "es:focus-visible:inset-ring",
|
|
241
|
+
!disabled && !(danger || primary) && "es:hover:bg-secondary-950/5 es:focus-visible:inset-ring-secondary-950/10 es:focus-visible:bg-secondary-950/5 es:contrast-more:focus-visible:bg-accent-800",
|
|
242
|
+
!disabled && danger && "es:hover:bg-red-500/5 es:focus-visible:inset-ring-red-600/30 es:focus-visible:bg-red-600/5 es:hover:text-red-900 es:focus-visible:text-red-950 es:contrast-more:focus-visible:bg-red-800",
|
|
243
|
+
!disabled && primary && "es:hover:bg-accent-500/5 es:focus-visible:inset-ring-accent-600/30 es:focus-visible:bg-accent-600/5 es:hover:text-accent-900 es:focus-visible:text-accent-950 es:contrast-more:focus-visible:bg-accent-700",
|
|
244
|
+
!disabled && "es:contrast-more:focus-visible:text-white! es:contrast-more:focus-visible:icon:text-white!",
|
|
222
245
|
disabled ? "es:text-secondary-400" : "es:text-secondary-800",
|
|
223
246
|
className
|
|
224
247
|
),
|
|
225
248
|
onAction: onClick,
|
|
226
249
|
children: [
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
250
|
+
/* @__PURE__ */ jsx(
|
|
251
|
+
RichLabel,
|
|
252
|
+
{
|
|
253
|
+
icon: itemIcon,
|
|
254
|
+
label: children,
|
|
255
|
+
subtitle,
|
|
256
|
+
iconClassName: clsx(danger && "es:not-contrast-more:icon:text-red-700!", primary && "es:not-contrast-more:icon:text-accent-600!"),
|
|
257
|
+
noColor: true
|
|
258
|
+
}
|
|
259
|
+
),
|
|
260
|
+
shortcut && /* @__PURE__ */ jsx("div", { className: "es:ml-auto es:pl-2 es:text-[0.6875rem] es:tracking-tight es:text-secondary-400 es:contrast-more:text-current es:shrink-0", children: shortcut }),
|
|
261
|
+
endIcon && /* @__PURE__ */ jsx("div", { className: clsx("es:shrink-0 es:icon:shrink-0", !shortcut && "es:ml-auto es:pl-2"), children: endIcon })
|
|
234
262
|
]
|
|
235
263
|
}
|
|
236
264
|
);
|
|
@@ -242,7 +270,8 @@ const MenuItem = (props) => {
|
|
|
242
270
|
* @param {Object} props - Component props.
|
|
243
271
|
* @param {JSX.Element} props.trigger - The trigger button for the submenu. **This should be a `MenuItem`.**
|
|
244
272
|
* @param {boolean} [props.keepOpen=false] - If `true`, the submenu will not close when an item is selected.
|
|
245
|
-
* @param {
|
|
273
|
+
* @param {boolean} [props.manualWidth=false] - If `true`, the popover will not have a fixed width.
|
|
274
|
+
* @param {PopoverProps} [props.popoverProps] - Props to pass to the popover.
|
|
246
275
|
*
|
|
247
276
|
* @returns {JSX.Element} The SubMenuItem component.
|
|
248
277
|
*
|
|
@@ -251,7 +280,7 @@ const MenuItem = (props) => {
|
|
|
251
280
|
* @preserve
|
|
252
281
|
*/
|
|
253
282
|
const SubMenuItem = (props) => {
|
|
254
|
-
const { children, trigger, popoverProps, keepOpen } = props;
|
|
283
|
+
const { children, trigger, popoverProps, keepOpen, manualWidth } = props;
|
|
255
284
|
let additionalProps = {};
|
|
256
285
|
if (keepOpen) {
|
|
257
286
|
additionalProps = {
|
|
@@ -265,15 +294,15 @@ const SubMenuItem = (props) => {
|
|
|
265
294
|
}
|
|
266
295
|
return /* @__PURE__ */ jsxs($3674c52c6b3c5bce$export$ecabc99eeffab7ca, { children: [
|
|
267
296
|
cloneElement(trigger, {
|
|
268
|
-
endIcon: /* @__PURE__ */ jsx("span", { className: "es:text-secondary-400", children: icons.caretRightFill })
|
|
297
|
+
endIcon: /* @__PURE__ */ jsx("span", { className: "es:text-secondary-400 es:contrast-more:text-current", children: icons.caretRightFill })
|
|
269
298
|
}),
|
|
270
299
|
/* @__PURE__ */ jsx(
|
|
271
300
|
Popover,
|
|
272
301
|
{
|
|
273
302
|
"aria-label": props["aria-label"] ?? __("Submenu", "eightshift-ui-components"),
|
|
274
|
-
className: "es:p-0! es:any-focus:outline-hidden",
|
|
275
303
|
offset: -1,
|
|
276
304
|
...popoverProps,
|
|
305
|
+
className: clsx("es:p-0! es:any-focus:outline-hidden", !manualWidth && "es:w-56", manualWidth && "es:max-w-80", popoverProps?.className),
|
|
277
306
|
children: /* @__PURE__ */ jsx(
|
|
278
307
|
$3674c52c6b3c5bce$export$d9b273488cd8ce6f,
|
|
279
308
|
{
|
|
@@ -288,10 +317,51 @@ const SubMenuItem = (props) => {
|
|
|
288
317
|
] });
|
|
289
318
|
};
|
|
290
319
|
SubMenuItem.displayName = "SubMenuItem";
|
|
320
|
+
/**
|
|
321
|
+
* A decorative menu section header, used to label groups of menu items.
|
|
322
|
+
*
|
|
323
|
+
* @component
|
|
324
|
+
* @param {Object} props - Component props.
|
|
325
|
+
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
326
|
+
*
|
|
327
|
+
* @returns {JSX.Element} The MenuSectionHeader component.
|
|
328
|
+
*
|
|
329
|
+
* @example
|
|
330
|
+
* <MenuSectionHeader>Section</MenuSectionHeader>
|
|
331
|
+
*
|
|
332
|
+
* @preserve
|
|
333
|
+
*/
|
|
334
|
+
const MenuSectionHeader = (props) => {
|
|
335
|
+
const {
|
|
336
|
+
children,
|
|
337
|
+
className,
|
|
338
|
+
hidden
|
|
339
|
+
} = props;
|
|
340
|
+
if (hidden) {
|
|
341
|
+
return null;
|
|
342
|
+
}
|
|
343
|
+
return /* @__PURE__ */ jsx(
|
|
344
|
+
$3674c52c6b3c5bce$export$2ce376c2cc3355c8,
|
|
345
|
+
{
|
|
346
|
+
...props,
|
|
347
|
+
className: clsx(
|
|
348
|
+
"es:mx-1 es:p-2.5 es:pb-1 es:flex es:min-w-44 es:items-center es:gap-1.5",
|
|
349
|
+
"es:select-none es:text-sm",
|
|
350
|
+
"es:icon:shrink-0",
|
|
351
|
+
"es:text-secondary-500",
|
|
352
|
+
className
|
|
353
|
+
),
|
|
354
|
+
isDisabled: true,
|
|
355
|
+
children
|
|
356
|
+
}
|
|
357
|
+
);
|
|
358
|
+
};
|
|
359
|
+
MenuSectionHeader.displayName = "MenuSectionHeader";
|
|
291
360
|
export {
|
|
292
361
|
Menu,
|
|
293
362
|
MenuItem,
|
|
294
363
|
MenuSection,
|
|
364
|
+
MenuSectionHeader,
|
|
295
365
|
MenuSeparator,
|
|
296
366
|
SubMenuItem
|
|
297
367
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { h as $a11501f3d1d39e6c$export$ea8f71083e90600f, i as $49c51c25361d4cd2$export$ee0f7cc6afcd1c18, j as $337b884510726a0d$export$14c98a7594375490, k as $5e3802645cc19319$export$1c3ebcada18427bf, l as $de32f1b87079253c$export$d2f961adcb0afbe, m as $86ea4cb521eb2e37$export$2317d149ed6f78c4, n as $337b884510726a0d$export$c6fdb837b070b4ff, g as $de32f1b87079253c$export$2e1e1122cf0cba88, f as $de32f1b87079253c$export$3ddf2d174ce01153 } from "../../Dialog-
|
|
2
|
+
import { h as $a11501f3d1d39e6c$export$ea8f71083e90600f, i as $49c51c25361d4cd2$export$ee0f7cc6afcd1c18, j as $337b884510726a0d$export$14c98a7594375490, k as $5e3802645cc19319$export$1c3ebcada18427bf, l as $de32f1b87079253c$export$d2f961adcb0afbe, m as $86ea4cb521eb2e37$export$2317d149ed6f78c4, n as $337b884510726a0d$export$c6fdb837b070b4ff, g as $de32f1b87079253c$export$2e1e1122cf0cba88, f as $de32f1b87079253c$export$3ddf2d174ce01153 } from "../../Dialog-CQ8H6Noi.js";
|
|
3
3
|
import { $ as $5cb03073d3f54797$export$a8a3e93435678ff9 } from "../../Heading-bh1HU5HH.js";
|
|
4
4
|
import { n as $b5e257d569688ac6$export$535bd6ca7f90a273, b as $3ef42575df84b30b$export$9d1611c77c2fe928, a as $64fa3d84918910a7$export$29f1550f4b0d4415, l as $df56164dff5785e2$export$4338b53315abf666, m as $5dc95899b306f630$export$c9058316764c140e, h as $64fa3d84918910a7$export$4d86445c2cf5e3, i as $64fa3d84918910a7$export$2881499e37b75b9a } from "../../utils-cvK1vxO7.js";
|
|
5
5
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-D2C6R0DK.js";
|
|
6
6
|
import React__default, { useState, useEffect, forwardRef, useContext, createContext, useRef, useMemo } from "react";
|
|
7
|
-
import { $ as $fc909762b330b746$export$61c6a8c84e605fb6, a as $d3f049242431219c$export$45fda7c47f93fd48, b as $d3f049242431219c$export$6d3443f2c48bfc20 } from "../../OverlayArrow-
|
|
7
|
+
import { $ as $fc909762b330b746$export$61c6a8c84e605fb6, a as $d3f049242431219c$export$45fda7c47f93fd48, b as $d3f049242431219c$export$6d3443f2c48bfc20 } from "../../OverlayArrow-DivvkAVb.js";
|
|
8
8
|
import { Button } from "../button/button.js";
|
|
9
|
-
import { _ as __ } from "../../default-i18n-
|
|
9
|
+
import { _ as __ } from "../../default-i18n-CN_q3KUs.js";
|
|
10
10
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
11
11
|
import { icons } from "../../icons/icons.js";
|
|
12
12
|
import "../../react-jsx-parser.min-LF707GK8.js";
|
|
@@ -221,7 +221,7 @@ function $f3f84453ead64de5$var$ModalContent(props) {
|
|
|
221
221
|
* @param {JSX.Element|JSX.Element[]} [props.headerActions] - Actions to display in the modal header, next to the close button (if enabled).
|
|
222
222
|
* @param {string|JSX.Element} [props.triggerLabel] - Label for the trigger button.
|
|
223
223
|
* @param {JSX.Element} [props.triggerIcon] - Trigger button icon.
|
|
224
|
-
* @param {
|
|
224
|
+
* @param {ButtonProps} [props.triggerProps] - Props to pass to the trigger button.
|
|
225
225
|
* @param {ReactNode} [props.customTrigger] - If provided, replaces the default trigger button. The passed component should be something button-related that can open the modal.
|
|
226
226
|
* @param {string|JSX.Element} [props.title] - Title of the modal.
|
|
227
227
|
* @param {boolean} [props.noCloseButton] - If `true`, the close button will not be displayed.
|
|
@@ -77,7 +77,8 @@ const Notice = (props) => {
|
|
|
77
77
|
className: clsx(
|
|
78
78
|
"es:grid es:grid-cols-[auto_1fr] es:grid-rows-[auto_auto] es:rounded-xl es:border es:bg-linear-to-tr es:shadow-sm es:inset-ring-1",
|
|
79
79
|
styles[type].className,
|
|
80
|
-
|
|
80
|
+
"es:icon:shrink-0",
|
|
81
|
+
icon || styles[type].icon ? "es:gap-x-2 es:py-2 es:pl-2 es:pr-3" : "es:py-2.5 es:px-3",
|
|
81
82
|
className
|
|
82
83
|
),
|
|
83
84
|
children: [
|
|
@@ -85,8 +86,8 @@ const Notice = (props) => {
|
|
|
85
86
|
"div",
|
|
86
87
|
{
|
|
87
88
|
className: clsx(
|
|
88
|
-
"es:col-span-1 es:col-start-1 es:row-span-2 es:row-start-1 es:shrink-0 es:icon:size-
|
|
89
|
-
alignIconToTitle ? "es:self-baseline" : "es:self-center",
|
|
89
|
+
"es:col-span-1 es:col-start-1 es:row-span-2 es:row-start-1 es:shrink-0 es:icon:size-6",
|
|
90
|
+
alignIconToTitle ? "es:self-baseline" : "es:self-center-safe",
|
|
90
91
|
styles[type].iconColorClassName
|
|
91
92
|
),
|
|
92
93
|
children: icon ?? styles[type].icon
|
|
@@ -97,7 +98,7 @@ const Notice = (props) => {
|
|
|
97
98
|
{
|
|
98
99
|
className: clsx(
|
|
99
100
|
"es:col-span-2 es:col-start-2 es:text-balance es:text-sm es:leading-tight",
|
|
100
|
-
subtitle ? "es:self-end" : "es:row-span-2 es:self-center",
|
|
101
|
+
subtitle ? "es:self-end" : "es:row-span-2 es:self-center-safe",
|
|
101
102
|
styles[type].textColorClassName
|
|
102
103
|
),
|
|
103
104
|
children: label
|
|
@@ -109,7 +110,7 @@ const Notice = (props) => {
|
|
|
109
110
|
className: clsx(
|
|
110
111
|
"es:col-span-2 es:col-start-2 es:text-balance es:text-xs es:leading-tight es:pt-0.5",
|
|
111
112
|
styles[type].subtitleColorClassName,
|
|
112
|
-
label ? "es:self-start" : "es:row-span-2 es:self-center"
|
|
113
|
+
label ? "es:self-start" : "es:row-span-2 es:self-center-safe"
|
|
113
114
|
),
|
|
114
115
|
children: subtitle
|
|
115
116
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React__default, { forwardRef, createContext, useRef, useState, cloneElement } from "react";
|
|
3
|
-
import { _ as __ } from "../../default-i18n-
|
|
4
|
-
import { a as $a049562f99e7db0e$export$f9c6924e160136d1, b as $3985021b0ad6602f$export$37fb8590cf2c088c, c as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4, $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../
|
|
3
|
+
import { _ as __ } from "../../default-i18n-CN_q3KUs.js";
|
|
4
|
+
import { a as $a049562f99e7db0e$export$f9c6924e160136d1, b as $3985021b0ad6602f$export$37fb8590cf2c088c, c as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4, $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-ChJaTNa5.js";
|
|
5
5
|
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-DWVaNd2E.js";
|
|
6
|
-
import { a as $d2b4bc8c273e7be6$export$24d547caef80ccd1 } from "../../Button-
|
|
6
|
+
import { a as $d2b4bc8c273e7be6$export$24d547caef80ccd1 } from "../../Button-npzfSoYo.js";
|
|
7
7
|
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, f as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, g as $64fa3d84918910a7$export$ef03459518577ad4, h as $64fa3d84918910a7$export$4d86445c2cf5e3, i as $64fa3d84918910a7$export$2881499e37b75b9a } from "../../utils-cvK1vxO7.js";
|
|
8
8
|
import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-B8BgFmIQ.js";
|
|
9
|
-
import { $ as $d3e0e05bdfcf66bd$export$c24727297075ec6a } from "../../Form-
|
|
9
|
+
import { $ as $d3e0e05bdfcf66bd$export$c24727297075ec6a } from "../../Form-Cq3fu75_.js";
|
|
10
10
|
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-AxKZjtFm.js";
|
|
11
11
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-D2C6R0DK.js";
|
|
12
12
|
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-DMOmz986.js";
|
|
13
|
-
import { $ as $de67e98908f0c6ee$export$7f629e9dc1ecf37c, a as $81397a9303501bda$export$23f548e970bdf099 } from "../../useNumberField-
|
|
13
|
+
import { $ as $de67e98908f0c6ee$export$7f629e9dc1ecf37c, a as $81397a9303501bda$export$23f548e970bdf099 } from "../../useNumberField-BCjjZWaz.js";
|
|
14
14
|
import { Button } from "../button/button.js";
|
|
15
15
|
import { icons } from "../../icons/icons.js";
|
|
16
16
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
@@ -7,7 +7,7 @@ import { SubMenuItem, MenuSeparator, MenuItem, Menu } from "../menu/menu.js";
|
|
|
7
7
|
import { RadioButtonGroup, RadioButton } from "../radio/radio.js";
|
|
8
8
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
9
9
|
import { ToggleButton } from "../toggle-button/toggle-button.js";
|
|
10
|
-
import { _ as __ } from "../../default-i18n-
|
|
10
|
+
import { _ as __ } from "../../default-i18n-CN_q3KUs.js";
|
|
11
11
|
/**
|
|
12
12
|
* A component that allows the user to select an option from a list of options.
|
|
13
13
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { _ as __ } from "../../default-i18n-
|
|
2
|
+
import { _ as __ } from "../../default-i18n-CN_q3KUs.js";
|
|
3
3
|
import { icons } from "../../icons/icons.js";
|
|
4
4
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
5
5
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { e as $07b14b47974efb58$export$5b6b19405a83ff9d, f as $de32f1b87079253c$export$3ddf2d174ce01153, g as $de32f1b87079253c$export$2e1e1122cf0cba88 } from "../../Dialog-
|
|
2
|
+
import { e as $07b14b47974efb58$export$5b6b19405a83ff9d, f as $de32f1b87079253c$export$3ddf2d174ce01153, g as $de32f1b87079253c$export$2e1e1122cf0cba88 } from "../../Dialog-CQ8H6Noi.js";
|
|
3
3
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
4
|
-
import { _ as __ } from "../../default-i18n-
|
|
4
|
+
import { _ as __ } from "../../default-i18n-CN_q3KUs.js";
|
|
5
5
|
import { Button } from "../button/button.js";
|
|
6
6
|
/**
|
|
7
7
|
* A popover component.
|
|
@@ -11,26 +11,10 @@ import { Button } from "../button/button.js";
|
|
|
11
11
|
* - **uncontrolled mode**: pass `openByDefault` to set the initial popover state. The show/hide state will be managed internally, based on the interaction with the trigger button.
|
|
12
12
|
*
|
|
13
13
|
* @component
|
|
14
|
-
* @param {
|
|
15
|
-
* @param {React.Ref} props.triggerRef - Ref of the trigger button. In uncontrolled mode, this element will be used to open the popover. In controlled mode, the popover will be anchored to this element.
|
|
16
|
-
* @param {boolean} [props.openByDefault=false] - (**Controlled mode**) If `true`, the popover is open by default.
|
|
17
|
-
* @param {boolean} props.isOpen - (**Uncontrolled mode**) If `true`, the popover is open.
|
|
18
|
-
* @param {Function} props.onOpenChange - (**Uncontrolled mode**) Function to run when the popover is opened or closed. `(isOpen: boolean) => void`.
|
|
19
|
-
* @param {PopoverPlacement} props.placement - The placement of the popover.
|
|
20
|
-
* @param {string} [props.className] - Classes to pass to the popover contents.
|
|
21
|
-
* @param {string} [props.wrapperClassName] - Classes to pass to the popover wrapper.
|
|
22
|
-
* @param {Object} props.style - Styles to pass to the popover.
|
|
23
|
-
* @param {number} props.offset - Offset from the trigger element, on the same axis as the placement of the popover (e.g. if `placement` is `left`, this controls the horizontal spacing from the element).
|
|
24
|
-
* @param {number} props.crossOffset - Offset from the trigger element, on the opposite axis as the placement of the popover (e.g. if `placement` is `left`, this controls the vertical spacing from the element).
|
|
25
|
-
* @param {number} props.containerPadding - Space that should be left between the popover and the edge of the container (the default container is browser window).
|
|
26
|
-
* @param {boolean} props.shouldFlip - If `true`, the popover should flip when there is not enough space.
|
|
27
|
-
* @param {Function} [props.shouldCloseOnInteractOutside=() => true] - Allows ignoring close events for certain elements. `(element: HTMLElement) => boolean`.
|
|
28
|
-
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
14
|
+
* @param {PopoverProps} props - Component props.
|
|
29
15
|
*
|
|
30
16
|
* @returns {JSX.Element} The Popover component.
|
|
31
17
|
*
|
|
32
|
-
* @typedef {'bottom' | 'bottom left' | 'bottom right' | 'bottom start' | 'bottom end' | 'top' | 'top left' | 'top right' | 'top start' | 'top end' | 'left' | 'left top' | 'left bottom' | 'start' | 'start top' | 'start bottom' | 'right' | 'right top' | 'right bottom' | 'end' | 'end top' | 'end bottom'} PopoverPlacement
|
|
33
|
-
*
|
|
34
18
|
* @example
|
|
35
19
|
* // Uncontrolled mode.
|
|
36
20
|
* const ref = useRef(null);
|
|
@@ -102,7 +86,9 @@ const Popover = (props) => {
|
|
|
102
86
|
crossOffset,
|
|
103
87
|
containerPadding,
|
|
104
88
|
className: ({ isEntering, isExiting }) => clsx(
|
|
105
|
-
"es:rounded-2xl es:border es:border-secondary-300 es:bg-white es:inset-ring es:inset-ring-secondary-100 es:shadow-xl es:outline-hidden",
|
|
89
|
+
"es:rounded-2xl es:border es:border-secondary-300 es:bg-white/85 es:inset-ring es:inset-ring-secondary-100 es:shadow-xl es:outline-hidden",
|
|
90
|
+
"es:backdrop-blur-2xl es:backdrop-brightness-125 es:backdrop-saturate-150",
|
|
91
|
+
"es:inset-shadow-xs es:inset-shadow-secondary-100",
|
|
106
92
|
"es:motion-safe:motion-duration-200 es:motion-safe:motion-ease-spring-bouncy",
|
|
107
93
|
"es:placement-bottom:origin-top-left es:placement-top:origin-bottom-left",
|
|
108
94
|
"es:placement-left:origin-right es:placement-right:origin-left",
|
|
@@ -137,7 +123,7 @@ const Popover = (props) => {
|
|
|
137
123
|
* @param {JSX.Element} props.trigger - Allows using a custom trigger element.
|
|
138
124
|
* @param {JSX.Element} [props.triggerButtonIcon] - The icon for the built-in trigger button.
|
|
139
125
|
* @param {string} props.triggerButtonLabel - The label for the built-in trigger button.
|
|
140
|
-
* @param {
|
|
126
|
+
* @param {ButtonProps} props.triggerButtonProps - Props to pass to the built-in trigger button.
|
|
141
127
|
* @param {Function} props.onOpenChange - Function to run when the popover is opened or closed. `(isOpen: boolean) => void`.
|
|
142
128
|
* @param {boolean} props.openByDefault - If `true`, the popover is open by default.
|
|
143
129
|
* @param {PopoverPlacement} props.placement - The placement of the popover.
|