@eightshift/ui-components 5.0.10 → 5.1.1
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/{Collection-uTAXq9Br.js → Collection-BRJOMbOa.js} +12 -7
- package/dist/{Dialog-CmAxaSUv.js → Dialog-D6EdDPeu.js} +8 -8
- package/dist/{useFormValidation-Dy0PXJg5.js → Form-Bnyyv3Im.js} +6 -4
- package/dist/{Group-DDPhPPTQ.js → Group-LBogWgyp.js} +2 -2
- package/dist/{Input-BmDS8Juy.js → Input-DfSBLhDx.js} +1 -1
- package/dist/List-BLeHBkfx.js +590 -0
- package/dist/{ListBox-_nDFq8-H.js → ListBox-BY3gwI8c.js} +3 -3
- package/dist/Select-BebwUgKB.js +764 -0
- package/dist/Separator-CTQWg_HO.js +1111 -0
- package/dist/TextField-o2U-uBWv.js +133 -0
- package/dist/assets/style-admin.css +264 -150
- package/dist/assets/style-editor.css +264 -150
- package/dist/assets/style.css +264 -150
- package/dist/assets/wp-font-enhancements.css +1 -1
- package/dist/assets/wp-ui-enhancements.css +1 -1
- package/dist/components/base-control/base-control.js +1 -1
- package/dist/components/breakpoint-preview/breakpoint-preview.js +3 -4
- package/dist/components/button/button.js +3 -3
- package/dist/components/checkbox/checkbox.js +1 -2
- package/dist/components/color-pickers/color-picker.js +7 -9
- package/dist/components/color-pickers/color-swatch.js +1 -1
- package/dist/components/color-pickers/gradient-editor.js +19 -25
- package/dist/components/color-pickers/solid-color-picker.js +27 -27
- package/dist/components/component-toggle/component-toggle.js +1 -1
- package/dist/components/draggable/draggable-handle.js +2 -2
- package/dist/components/draggable/draggable.js +5 -5
- package/dist/components/draggable-list/draggable-list-item.js +2 -2
- package/dist/components/draggable-list/draggable-list.js +5 -5
- package/dist/components/expandable/expandable.js +1 -1
- package/dist/components/index.js +5 -5
- package/dist/components/input-field/input-field.js +14 -129
- package/dist/components/item-collection/item-collection.js +1 -1
- package/dist/components/link-input/link-input.js +1463 -17
- package/dist/components/matrix-align/matrix-align.js +11 -14
- package/dist/components/menu/menu.js +4 -8
- package/dist/components/modal/modal.js +30 -31
- package/dist/components/number-picker/number-picker.js +9 -10
- package/dist/components/option-select/option-select.js +140 -156
- package/dist/components/placeholders/file-placeholder.js +1 -1
- package/dist/components/placeholders/image-placeholder.js +3 -3
- package/dist/components/placeholders/media-placeholder.js +2 -2
- package/dist/components/popover/popover.js +10 -5
- package/dist/components/radio/radio.js +4 -5
- package/dist/components/repeater/repeater-item.js +1 -1
- package/dist/components/repeater/repeater.js +6 -6
- package/dist/components/responsive/mini-responsive.js +45 -47
- package/dist/components/responsive/responsive-legacy.js +51 -55
- package/dist/components/responsive/responsive.js +47 -49
- package/dist/components/responsive-preview/responsive-preview.js +12 -15
- package/dist/components/select/async-multi-select.js +4 -4
- package/dist/components/select/async-single-select.js +1 -1
- package/dist/components/select/multi-select-components.js +1 -1
- package/dist/components/select/multi-select.js +4 -4
- package/dist/components/select/shared.js +2 -2
- package/dist/components/select/single-select.js +1 -1
- package/dist/components/select/styles.js +3 -3
- package/dist/components/select/v2/async-select.js +216 -158
- package/dist/components/select/v2/shared.js +29 -20
- package/dist/components/select/v2/single-select.js +203 -851
- package/dist/components/slider/column-config-slider.js +2 -2
- package/dist/components/slider/slider.js +2 -2
- package/dist/components/slider/utils.js +1 -1
- package/dist/components/tabs/tabs.js +7 -8
- package/dist/components/toggle/switch.js +4 -3
- package/dist/components/toggle-button/toggle-button.js +1 -1
- package/dist/{default-i18n-CT_oS1Fy.js → default-i18n-OFa3zAyB.js} +5 -9
- package/dist/icons/icons.js +141 -141
- package/dist/icons/jsx-svg.js +3 -4
- package/dist/index.js +4 -4
- package/dist/{multi-select-components-Sp-JEFEX.js → multi-select-components-BcKzA24f.js} +3 -3
- package/dist/{react-jsx-parser.min-DZCiis5V.js → react-jsx-parser.min-LF707GK8.js} +312 -332
- package/dist/useAsyncList-fLtZMvJO.js +420 -0
- package/dist/useFilter-BR5z1A4Q.js +50 -0
- package/dist/{useListState-9Hq_FiRF.js → useListState-BrZ2XvDS.js} +1 -1
- package/dist/{useNumberField-D0u2bh8g.js → useNumberField-y0dLc_6m.js} +2 -2
- package/dist/{useSingleSelectListState-DqhemUIh.js → useSingleSelectListState-Bh46cRXs.js} +1 -1
- package/dist/utilities/array-helpers.js +4 -7
- package/dist/utilities/es-dash.js +21 -3
- package/dist/utilities/index.js +2 -1
- package/dist/utilities/text-helpers.js +3 -3
- package/package.json +9 -9
- package/dist/ComboBox-BANSEKnb.js +0 -1915
- package/dist/Form-Cq3fu75_.js +0 -5
- package/dist/List-CZMUbkFU.js +0 -593
- package/dist/Separator-BN3mjL6q.js +0 -332
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { _ as __ } from "../../default-i18n-
|
|
2
|
+
import { _ as __ } from "../../default-i18n-OFa3zAyB.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";
|
|
@@ -111,19 +111,16 @@ const MatrixAlign = (props) => {
|
|
|
111
111
|
triggerProps: { "aria-label": ariaLabel },
|
|
112
112
|
tooltip,
|
|
113
113
|
keepOpen: true,
|
|
114
|
-
children: sizeOptions.map(({ value: itemValue, label: label2 }) =>
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
itemValue
|
|
125
|
-
);
|
|
126
|
-
})
|
|
114
|
+
children: sizeOptions.map(({ value: itemValue, label: label2 }) => /* @__PURE__ */ jsx(
|
|
115
|
+
MenuItem,
|
|
116
|
+
{
|
|
117
|
+
endIcon: icons?.[`position${size}${pascalCase(itemValue)}`],
|
|
118
|
+
selected: value === itemValue,
|
|
119
|
+
onClick: () => onChange(itemValue),
|
|
120
|
+
children: label2
|
|
121
|
+
},
|
|
122
|
+
itemValue
|
|
123
|
+
))
|
|
127
124
|
}
|
|
128
125
|
)
|
|
129
126
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { $ as $72a5793c14baf454$export$8b251419efc915eb, a as $431f98aba6844401$export$1ff3c3f08ae963c0 } from "../../Separator-
|
|
3
|
-
import {
|
|
2
|
+
import { $ as $72a5793c14baf454$export$8b251419efc915eb, a as $431f98aba6844401$export$1ff3c3f08ae963c0 } from "../../Separator-CTQWg_HO.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-D6EdDPeu.js";
|
|
4
4
|
import { icons } from "../../icons/icons.js";
|
|
5
5
|
import { Button } from "../button/button.js";
|
|
6
6
|
import { Popover } from "../popover/popover.js";
|
|
7
7
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
8
8
|
import { cloneElement } from "react";
|
|
9
|
-
import { _ as __ } from "../../default-i18n-
|
|
9
|
+
import { _ as __ } from "../../default-i18n-OFa3zAyB.js";
|
|
10
10
|
/**
|
|
11
11
|
* A simple menu component.
|
|
12
12
|
*
|
|
@@ -60,7 +60,6 @@ import { _ as __ } from "../../default-i18n-CT_oS1Fy.js";
|
|
|
60
60
|
* @preserve
|
|
61
61
|
*/
|
|
62
62
|
const Menu = (props) => {
|
|
63
|
-
var _a;
|
|
64
63
|
const {
|
|
65
64
|
children,
|
|
66
65
|
triggerLabel,
|
|
@@ -90,10 +89,7 @@ const Menu = (props) => {
|
|
|
90
89
|
if (openOnLongPress) {
|
|
91
90
|
additionalProps.trigger = "longPress";
|
|
92
91
|
}
|
|
93
|
-
const hasSubmenuItems = Array.isArray(children) ? children.some((child) =>
|
|
94
|
-
var _a2;
|
|
95
|
-
return ((_a2 = child == null ? void 0 : child.type) == null ? void 0 : _a2.displayName) === "SubMenuItem";
|
|
96
|
-
}) : ((_a = children == null ? void 0 : children.type) == null ? void 0 : _a.displayName) === "SubMenuItem";
|
|
92
|
+
const hasSubmenuItems = Array.isArray(children) ? children.some((child) => child?.type?.displayName === "SubMenuItem") : children?.type?.displayName === "SubMenuItem";
|
|
97
93
|
return /* @__PURE__ */ jsxs(
|
|
98
94
|
$3674c52c6b3c5bce$export$27d2ad3c5815583e,
|
|
99
95
|
{
|
|
@@ -1,15 +1,15 @@
|
|
|
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-D6EdDPeu.js";
|
|
3
3
|
import { $ as $5cb03073d3f54797$export$a8a3e93435678ff9 } from "../../Heading-ba38ScjJ.js";
|
|
4
4
|
import { n as $b5e257d569688ac6$export$535bd6ca7f90a273, d as $3ef42575df84b30b$export$9d1611c77c2fe928, a as $64fa3d84918910a7$export$29f1550f4b0d4415, l as $df56164dff5785e2$export$4338b53315abf666, m as $5dc95899b306f630$export$c9058316764c140e, b as $64fa3d84918910a7$export$4d86445c2cf5e3, i as $64fa3d84918910a7$export$2881499e37b75b9a } from "../../utils-CZt7LCbO.js";
|
|
5
5
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-EDDcM64A.js";
|
|
6
6
|
import React__default, { useState, useEffect, forwardRef, useContext, createContext, useRef, useMemo } from "react";
|
|
7
7
|
import { $ as $fc909762b330b746$export$61c6a8c84e605fb6, a as $d3f049242431219c$export$45fda7c47f93fd48, b as $d3f049242431219c$export$6d3443f2c48bfc20 } from "../../OverlayArrow-BUfV-5P3.js";
|
|
8
8
|
import { Button } from "../button/button.js";
|
|
9
|
-
import { _ as __ } from "../../default-i18n-
|
|
9
|
+
import { _ as __ } from "../../default-i18n-OFa3zAyB.js";
|
|
10
10
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
11
11
|
import { icons } from "../../icons/icons.js";
|
|
12
|
-
import "../../react-jsx-parser.min-
|
|
12
|
+
import "../../react-jsx-parser.min-LF707GK8.js";
|
|
13
13
|
import { HStack } from "../layout/hstack.js";
|
|
14
14
|
let $5df64b3807dc15ee$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
|
|
15
15
|
function $5df64b3807dc15ee$export$d699905dd57c73ca() {
|
|
@@ -192,6 +192,7 @@ function $f3f84453ead64de5$var$ModalContent(props) {
|
|
|
192
192
|
* @param {boolean} [props.open] - **Controlled mode ** - whether the modal is open.
|
|
193
193
|
* @param {boolean} [props.defaultOpen] - **Uncontrolled mode ** - whether the modal is initially open.
|
|
194
194
|
* @param {JSX.Element|JSX.Element[]} [props.actions] - Actions to display in the modal footer, typically buttons.
|
|
195
|
+
* @param {JSX.Element|JSX.Element[]} [props.headerActions] - Actions to display in the modal header, next to the close button (if enabled).
|
|
195
196
|
* @param {string|JSX.Element} [props.triggerLabel] - Label for the trigger button.
|
|
196
197
|
* @param {JSX.Element} [props.triggerIcon] - Trigger button icon.
|
|
197
198
|
* @param {Object} [props.triggerProps] - Props to pass to the trigger button.
|
|
@@ -244,6 +245,7 @@ const ModalInternal = (props) => {
|
|
|
244
245
|
onOpenChange,
|
|
245
246
|
title,
|
|
246
247
|
actions,
|
|
248
|
+
headerActions,
|
|
247
249
|
noCloseButton,
|
|
248
250
|
noClickToDismiss,
|
|
249
251
|
noKeyboardDismiss,
|
|
@@ -286,34 +288,31 @@ const ModalInternal = (props) => {
|
|
|
286
288
|
className: "es:relative es:text-sm es:outline-hidden",
|
|
287
289
|
"aria-label": ariaLabel,
|
|
288
290
|
children: ({ close }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
289
|
-
/* @__PURE__ */ jsxs(
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
title
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
]
|
|
315
|
-
}
|
|
316
|
-
),
|
|
291
|
+
/* @__PURE__ */ jsxs(HStack, { className: clsx(title && "es:px-5 es:py-3 es:justify-between es:bg-secondary-50 es:border-b es:border-secondary-200", headerClassName), children: [
|
|
292
|
+
title && /* @__PURE__ */ jsx(
|
|
293
|
+
$5cb03073d3f54797$export$a8a3e93435678ff9,
|
|
294
|
+
{
|
|
295
|
+
className: "es:text-balance es:text-base! es:my-0! es:font-medium!",
|
|
296
|
+
slot: "title",
|
|
297
|
+
children: title
|
|
298
|
+
}
|
|
299
|
+
),
|
|
300
|
+
(!noCloseButton || headerActions) && /* @__PURE__ */ jsxs(HStack, { className: !title && "es:absolute es:top-4 es:right-4 es:z-20", children: [
|
|
301
|
+
headerActions,
|
|
302
|
+
!noCloseButton && /* @__PURE__ */ jsx(
|
|
303
|
+
Button,
|
|
304
|
+
{
|
|
305
|
+
className: !title && "es:bg-white/60 es:backdrop-blur-lg",
|
|
306
|
+
onPress: close,
|
|
307
|
+
type: "ghost",
|
|
308
|
+
size: "small",
|
|
309
|
+
icon: icons.clear,
|
|
310
|
+
"aria-label": __("Close", "eightshift-frontend-libs"),
|
|
311
|
+
tooltip: true
|
|
312
|
+
}
|
|
313
|
+
)
|
|
314
|
+
] })
|
|
315
|
+
] }),
|
|
317
316
|
children && /* @__PURE__ */ jsx("div", { className: clsx("es:p-5 es:space-y-2.5", contentContainerClassName), children }),
|
|
318
317
|
actions && /* @__PURE__ */ jsx(HStack, { className: clsx("es:justify-end es:px-5 es:py-3 es:border-t es:border-secondary-100", actionsClassName), children: actions })
|
|
319
318
|
] })
|
|
@@ -1,17 +1,17 @@
|
|
|
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 {
|
|
5
|
-
import { a as $3985021b0ad6602f$export$37fb8590cf2c088c, $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-
|
|
3
|
+
import { _ as __ } from "../../default-i18n-OFa3zAyB.js";
|
|
4
|
+
import { $ as $a049562f99e7db0e$export$f9c6924e160136d1, a as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4 } from "../../Group-LBogWgyp.js";
|
|
5
|
+
import { a as $3985021b0ad6602f$export$37fb8590cf2c088c, $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-DfSBLhDx.js";
|
|
6
6
|
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-JS_ob-kh.js";
|
|
7
7
|
import { a as $d2b4bc8c273e7be6$export$24d547caef80ccd1 } from "../../Button-DH22t_SM.js";
|
|
8
8
|
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, g as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, h as $64fa3d84918910a7$export$ef03459518577ad4, b as $64fa3d84918910a7$export$4d86445c2cf5e3, i as $64fa3d84918910a7$export$2881499e37b75b9a } from "../../utils-CZt7LCbO.js";
|
|
9
9
|
import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-DHrSdE_Q.js";
|
|
10
|
-
import { $ as $d3e0e05bdfcf66bd$export$c24727297075ec6a } from "../../Form-
|
|
10
|
+
import { $ as $d3e0e05bdfcf66bd$export$c24727297075ec6a } from "../../Form-Bnyyv3Im.js";
|
|
11
11
|
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-BuJgePCv.js";
|
|
12
12
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-EDDcM64A.js";
|
|
13
13
|
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-BbYZoHvX.js";
|
|
14
|
-
import { $ as $de67e98908f0c6ee$export$7f629e9dc1ecf37c, a as $81397a9303501bda$export$23f548e970bdf099 } from "../../useNumberField-
|
|
14
|
+
import { $ as $de67e98908f0c6ee$export$7f629e9dc1ecf37c, a as $81397a9303501bda$export$23f548e970bdf099 } from "../../useNumberField-y0dLc_6m.js";
|
|
15
15
|
import { Button } from "../button/button.js";
|
|
16
16
|
import { icons } from "../../icons/icons.js";
|
|
17
17
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
@@ -170,7 +170,6 @@ const NumberPicker = ({
|
|
|
170
170
|
hidden,
|
|
171
171
|
...props
|
|
172
172
|
}) => {
|
|
173
|
-
var _a, _b, _c, _d, _e;
|
|
174
173
|
const [isInputFocused, setIsInputFocused] = useState(false);
|
|
175
174
|
if (hidden) {
|
|
176
175
|
return null;
|
|
@@ -221,8 +220,8 @@ const NumberPicker = ({
|
|
|
221
220
|
"es:group es:flex es:w-fit es:items-center es:rounded-10 es:border es:border-secondary-300 es:pl-1 es:pr-0.5 es:shadow-sm es:focus-within:shadow-md es:transition",
|
|
222
221
|
"es:inset-ring es:inset-ring-secondary-100",
|
|
223
222
|
isInputFocused && "es:outline-hidden es:focus-visible:border-accent-500 es:focus-visible:ring-2 es:focus-visible:ring-accent-500/50",
|
|
224
|
-
!prefix && (
|
|
225
|
-
|
|
223
|
+
!prefix && (sizes?.[size]?.noPrefixPadding ?? sizes.default.noPrefixPadding),
|
|
224
|
+
sizes?.[size]?.field ?? sizes.default.field,
|
|
226
225
|
"es:disabled:shadow-none es:disabled:border-secondary-200 es:disabled:bg-secondary-50 es:disabled:text-secondary-500 es:disabled:cursor-default es:readonly:bg-secondary-50"
|
|
227
226
|
),
|
|
228
227
|
children: [
|
|
@@ -242,7 +241,7 @@ const NumberPicker = ({
|
|
|
242
241
|
className: "es:col-start-2 es:row-span-2 es:border-none! es:bg-transparent es:px-0! es:py-1! es:text-sm es:tabular-nums es:shadow-none! es:outline-hidden! es:selection:bg-accent-500/20 es:selection:text-accent-950 es:focus:shadow-none! es:any-focus:outline-hidden",
|
|
243
242
|
placeholder,
|
|
244
243
|
style: {
|
|
245
|
-
width: fixedWidth ? `${fixedWidth}ch` : `calc(${min < 0 ? "0.75ch + " : ""}${(
|
|
244
|
+
width: fixedWidth ? `${fixedWidth}ch` : `calc(${min < 0 ? "0.75ch + " : ""}${(max ?? 1e3)?.toString()?.length} * 1ch)`
|
|
246
245
|
},
|
|
247
246
|
"aria-label": ariaLabel ?? __("Enter a number", "eightshift-ui-components")
|
|
248
247
|
}
|
|
@@ -276,7 +275,7 @@ const NumberPicker = ({
|
|
|
276
275
|
}
|
|
277
276
|
),
|
|
278
277
|
children && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
279
|
-
/* @__PURE__ */ jsx("div", { className: clsx("es:w-px es:bg-secondary-300",
|
|
278
|
+
/* @__PURE__ */ jsx("div", { className: clsx("es:w-px es:bg-secondary-300", sizes?.[size]?.extraContentSeparator ?? sizes.default.extraContentSeparator) }),
|
|
280
279
|
/* @__PURE__ */ jsx("div", { className: "es:p-0.5 es:pr-0", children: Array.isArray(children) ? children.map((child) => cloneElement(child, { slot: null })) : cloneElement(children, { slot: null }) })
|
|
281
280
|
] })
|
|
282
281
|
]
|
|
@@ -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-OFa3zAyB.js";
|
|
11
11
|
/**
|
|
12
12
|
* A component that allows the user to select an option from a list of options.
|
|
13
13
|
*
|
|
@@ -55,7 +55,6 @@ import { _ as __ } from "../../default-i18n-CT_oS1Fy.js";
|
|
|
55
55
|
* @preserve
|
|
56
56
|
*/
|
|
57
57
|
const OptionSelect = (props) => {
|
|
58
|
-
var _a, _b;
|
|
59
58
|
const {
|
|
60
59
|
icon,
|
|
61
60
|
label,
|
|
@@ -87,10 +86,10 @@ const OptionSelect = (props) => {
|
|
|
87
86
|
return null;
|
|
88
87
|
}
|
|
89
88
|
let tooltip = rawTooltip;
|
|
90
|
-
if (rawTooltip === true &&
|
|
89
|
+
if (rawTooltip === true && ariaLabel?.length > 0) {
|
|
91
90
|
tooltip = ariaLabel;
|
|
92
91
|
}
|
|
93
|
-
const currentItem = options
|
|
92
|
+
const currentItem = options?.find(({ value: optionValue }) => optionValue === value);
|
|
94
93
|
const notSetLabel = /* @__PURE__ */ jsx("span", { className: "es:leading-3 es:opacity-50", children: __("Not set", "eightshift-ui-components") });
|
|
95
94
|
let radioDesign = "default";
|
|
96
95
|
if (type === "radiosSegmented") {
|
|
@@ -104,12 +103,12 @@ const OptionSelect = (props) => {
|
|
|
104
103
|
MenuItem,
|
|
105
104
|
{
|
|
106
105
|
icon: !noTriggerIcon && (icon ?? // eslint-disable-next-line no-nested-ternary
|
|
107
|
-
(currentItem ? typeof
|
|
106
|
+
(currentItem ? typeof currentItem?.icon === "string" ? icons?.[currentItem?.icon] : currentItem?.icon : (noTriggerLabel || noTriggerIcon) && notSetLabel)),
|
|
108
107
|
children: /* @__PURE__ */ jsx(
|
|
109
108
|
RichLabel,
|
|
110
109
|
{
|
|
111
|
-
label: noTriggerLabel ? null : label ??
|
|
112
|
-
subtitle: subtitle === true ? currentItem
|
|
110
|
+
label: noTriggerLabel ? null : label ?? currentItem?.label ?? notSetLabel,
|
|
111
|
+
subtitle: subtitle === true ? currentItem?.label : subtitle,
|
|
113
112
|
noColor: true
|
|
114
113
|
}
|
|
115
114
|
)
|
|
@@ -129,39 +128,36 @@ const OptionSelect = (props) => {
|
|
|
129
128
|
sectionTitle: optionSectionTitle,
|
|
130
129
|
shortcut: optionShortcut,
|
|
131
130
|
disabled: optionDisabled
|
|
132
|
-
}) => {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
optionHasSeparator === "below" && /* @__PURE__ */ jsx(MenuSeparator, {})
|
|
163
|
-
] }, optionValue);
|
|
164
|
-
}
|
|
131
|
+
}) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
132
|
+
(optionHasSeparator === true || optionHasSeparator === "above") && /* @__PURE__ */ jsx(MenuSeparator, {}),
|
|
133
|
+
optionSectionTitle && /* @__PURE__ */ jsx(MenuItem, { disabled: true, children: optionSectionTitle }),
|
|
134
|
+
/* @__PURE__ */ jsxs(
|
|
135
|
+
MenuItem,
|
|
136
|
+
{
|
|
137
|
+
selected: value === optionValue,
|
|
138
|
+
disabled: optionDisabled || disabled,
|
|
139
|
+
className: itemClassName,
|
|
140
|
+
icon: !noItemIcon && (typeof optionIcon === "string" ? icons?.[optionIcon] : optionIcon),
|
|
141
|
+
endIcon: !noItemIcon && (typeof optionEndIcon === "string" ? icons?.[optionEndIcon] : optionEndIcon),
|
|
142
|
+
"aria-label": optionAriaLabel ?? optionLabel,
|
|
143
|
+
onClick: () => onChange(optionValue),
|
|
144
|
+
shortcut: optionShortcut,
|
|
145
|
+
...itemProps,
|
|
146
|
+
children: [
|
|
147
|
+
!noItemLabel && !optionSubtitle && optionLabel,
|
|
148
|
+
!noItemLabel && optionSubtitle && /* @__PURE__ */ jsx(
|
|
149
|
+
RichLabel,
|
|
150
|
+
{
|
|
151
|
+
label: optionLabel,
|
|
152
|
+
subtitle: optionSubtitle,
|
|
153
|
+
noColor: true
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
),
|
|
159
|
+
optionHasSeparator === "below" && /* @__PURE__ */ jsx(MenuSeparator, {})
|
|
160
|
+
] }, optionValue)
|
|
165
161
|
),
|
|
166
162
|
children
|
|
167
163
|
]
|
|
@@ -182,39 +178,36 @@ const OptionSelect = (props) => {
|
|
|
182
178
|
sectionTitle: optionSectionTitle,
|
|
183
179
|
shortcut: optionShortcut,
|
|
184
180
|
disabled: optionDisabled
|
|
185
|
-
}) => {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
optionHasSeparator === "below" && /* @__PURE__ */ jsx(MenuSeparator, {})
|
|
216
|
-
] }, optionValue);
|
|
217
|
-
}
|
|
181
|
+
}) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
182
|
+
(optionHasSeparator === true || optionHasSeparator === "above") && /* @__PURE__ */ jsx(MenuSeparator, {}),
|
|
183
|
+
optionSectionTitle && /* @__PURE__ */ jsx(MenuItem, { disabled: true, children: optionSectionTitle }),
|
|
184
|
+
/* @__PURE__ */ jsxs(
|
|
185
|
+
MenuItem,
|
|
186
|
+
{
|
|
187
|
+
selected: value === optionValue,
|
|
188
|
+
disabled: optionDisabled || disabled,
|
|
189
|
+
className: itemClassName,
|
|
190
|
+
icon: !noItemIcon && (typeof optionIcon === "string" ? icons?.[optionIcon] : optionIcon),
|
|
191
|
+
endIcon: !noItemIcon && (typeof optionEndIcon === "string" ? icons?.[optionEndIcon] : optionEndIcon),
|
|
192
|
+
"aria-label": optionAriaLabel ?? optionLabel,
|
|
193
|
+
onClick: () => onChange(optionValue),
|
|
194
|
+
shortcut: optionShortcut,
|
|
195
|
+
...itemProps,
|
|
196
|
+
children: [
|
|
197
|
+
!noItemLabel && !optionSubtitle && optionLabel,
|
|
198
|
+
!noItemLabel && optionSubtitle && /* @__PURE__ */ jsx(
|
|
199
|
+
RichLabel,
|
|
200
|
+
{
|
|
201
|
+
label: optionLabel,
|
|
202
|
+
subtitle: optionSubtitle,
|
|
203
|
+
noColor: true
|
|
204
|
+
}
|
|
205
|
+
)
|
|
206
|
+
]
|
|
207
|
+
}
|
|
208
|
+
),
|
|
209
|
+
optionHasSeparator === "below" && /* @__PURE__ */ jsx(MenuSeparator, {})
|
|
210
|
+
] }, optionValue)
|
|
218
211
|
),
|
|
219
212
|
children
|
|
220
213
|
] });
|
|
@@ -247,34 +240,31 @@ const OptionSelect = (props) => {
|
|
|
247
240
|
ariaLabel: optionAriaLabel,
|
|
248
241
|
subtitle: optionSubtitle,
|
|
249
242
|
disabled: optionDisabled
|
|
250
|
-
}) =>
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
optionValue
|
|
276
|
-
);
|
|
277
|
-
}
|
|
243
|
+
}) => /* @__PURE__ */ jsxs(
|
|
244
|
+
ToggleButton,
|
|
245
|
+
{
|
|
246
|
+
selected: optionValue === value,
|
|
247
|
+
onChange: () => onChange(optionValue),
|
|
248
|
+
disabled: optionDisabled || disabled,
|
|
249
|
+
className: itemClassName,
|
|
250
|
+
icon: !noItemIcon && (typeof optionIcon === "string" ? icons?.[optionIcon] : optionIcon),
|
|
251
|
+
tooltip: optionTooltip ?? optionAriaLabel ?? (noItemLabel && optionLabel),
|
|
252
|
+
"aria-label": optionAriaLabel ?? optionLabel ?? optionTooltip,
|
|
253
|
+
...itemProps,
|
|
254
|
+
children: [
|
|
255
|
+
!noItemLabel && !optionSubtitle && optionLabel,
|
|
256
|
+
!noItemLabel && optionSubtitle && /* @__PURE__ */ jsx(
|
|
257
|
+
RichLabel,
|
|
258
|
+
{
|
|
259
|
+
label: optionLabel,
|
|
260
|
+
subtitle: optionSubtitle,
|
|
261
|
+
noColor: true
|
|
262
|
+
}
|
|
263
|
+
)
|
|
264
|
+
]
|
|
265
|
+
},
|
|
266
|
+
optionValue
|
|
267
|
+
)
|
|
278
268
|
)
|
|
279
269
|
}
|
|
280
270
|
),
|
|
@@ -287,41 +277,38 @@ const OptionSelect = (props) => {
|
|
|
287
277
|
"aria-label": typeof label !== "undefined" ? null : ariaLabel,
|
|
288
278
|
value,
|
|
289
279
|
...wrapperProps,
|
|
290
|
-
children: options.map(({ label: optionLabel, value: optionValue, icon: optionIcon, ariaLabel: optionAriaLabel, subtitle: optionSubtitle, disabled: optionDisabled }) =>
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
optionValue
|
|
305
|
-
);
|
|
306
|
-
})
|
|
280
|
+
children: options.map(({ label: optionLabel, value: optionValue, icon: optionIcon, ariaLabel: optionAriaLabel, subtitle: optionSubtitle, disabled: optionDisabled }) => /* @__PURE__ */ jsx(
|
|
281
|
+
RadioButton,
|
|
282
|
+
{
|
|
283
|
+
value: optionValue,
|
|
284
|
+
disabled: optionDisabled || disabled,
|
|
285
|
+
className: itemClassName,
|
|
286
|
+
subtitle: !noItemLabel && optionSubtitle,
|
|
287
|
+
icon: !noItemIcon && (typeof optionIcon === "string" ? icons?.[optionIcon] : optionIcon),
|
|
288
|
+
"aria-label": optionAriaLabel ?? optionLabel,
|
|
289
|
+
label: !noItemLabel && optionLabel,
|
|
290
|
+
...itemProps
|
|
291
|
+
},
|
|
292
|
+
optionValue
|
|
293
|
+
))
|
|
307
294
|
}
|
|
308
295
|
),
|
|
309
296
|
type === "menu" && /* @__PURE__ */ jsxs(
|
|
310
297
|
Menu,
|
|
311
298
|
{
|
|
312
|
-
triggerLabel: noTriggerLabel ? null :
|
|
299
|
+
triggerLabel: noTriggerLabel ? null : currentItem?.label ?? notSetLabel,
|
|
313
300
|
triggerIcon: !noTriggerIcon && // eslint-disable-next-line no-nested-ternary
|
|
314
|
-
(currentItem ? typeof
|
|
301
|
+
(currentItem ? typeof currentItem?.icon === "string" ? icons?.[currentItem?.icon] : currentItem?.icon : (noTriggerLabel || noTriggerIcon) && notSetLabel),
|
|
315
302
|
tooltip: noTriggerLabel ? /* @__PURE__ */ jsx(
|
|
316
303
|
RichLabel,
|
|
317
304
|
{
|
|
318
|
-
label: tooltip ? tooltip :
|
|
319
|
-
subtitle: tooltip && (
|
|
305
|
+
label: tooltip ? tooltip : currentItem?.tooltip ?? currentItem?.label,
|
|
306
|
+
subtitle: tooltip && (currentItem?.tooltip ?? currentItem?.label),
|
|
320
307
|
noColor: true
|
|
321
308
|
}
|
|
322
309
|
) : tooltip,
|
|
323
310
|
triggerProps: {
|
|
324
|
-
...wrapperProps
|
|
311
|
+
...wrapperProps?.triggerProps,
|
|
325
312
|
"aria-label": typeof label !== "undefined" ? null : ariaLabel ?? label ?? tooltip
|
|
326
313
|
},
|
|
327
314
|
keepOpen: true,
|
|
@@ -340,39 +327,36 @@ const OptionSelect = (props) => {
|
|
|
340
327
|
sectionTitle: optionSectionTitle,
|
|
341
328
|
shortcut: optionShortcut,
|
|
342
329
|
disabled: optionDisabled
|
|
343
|
-
}) => {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
optionHasSeparator === "below" && /* @__PURE__ */ jsx(MenuSeparator, {})
|
|
374
|
-
] }, optionValue);
|
|
375
|
-
}
|
|
330
|
+
}) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
331
|
+
(optionHasSeparator === true || optionHasSeparator === "above") && /* @__PURE__ */ jsx(MenuSeparator, {}),
|
|
332
|
+
optionSectionTitle && /* @__PURE__ */ jsx(MenuItem, { disabled: true, children: optionSectionTitle }),
|
|
333
|
+
/* @__PURE__ */ jsxs(
|
|
334
|
+
MenuItem,
|
|
335
|
+
{
|
|
336
|
+
selected: value === optionValue,
|
|
337
|
+
disabled: optionDisabled || disabled,
|
|
338
|
+
className: itemClassName,
|
|
339
|
+
icon: !noItemIcon && (typeof optionIcon === "string" ? icons?.[optionIcon] : optionIcon),
|
|
340
|
+
endIcon: !noItemIcon && (typeof optionEndIcon === "string" ? icons?.[optionEndIcon] : optionEndIcon),
|
|
341
|
+
"aria-label": optionAriaLabel ?? optionLabel,
|
|
342
|
+
onClick: () => onChange(optionValue),
|
|
343
|
+
shortcut: optionShortcut,
|
|
344
|
+
...itemProps,
|
|
345
|
+
children: [
|
|
346
|
+
!noItemLabel && !optionSubtitle && optionLabel,
|
|
347
|
+
!noItemLabel && optionSubtitle && /* @__PURE__ */ jsx(
|
|
348
|
+
RichLabel,
|
|
349
|
+
{
|
|
350
|
+
label: optionLabel,
|
|
351
|
+
subtitle: optionSubtitle,
|
|
352
|
+
noColor: true
|
|
353
|
+
}
|
|
354
|
+
)
|
|
355
|
+
]
|
|
356
|
+
}
|
|
357
|
+
),
|
|
358
|
+
optionHasSeparator === "below" && /* @__PURE__ */ jsx(MenuSeparator, {})
|
|
359
|
+
] }, optionValue)
|
|
376
360
|
),
|
|
377
361
|
children
|
|
378
362
|
]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { _ as __ } from "../../default-i18n-
|
|
2
|
+
import { _ as __ } from "../../default-i18n-OFa3zAyB.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";
|