@eightshift/ui-components 5.6.1 → 6.0.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/{Button-CQ5ZZJ2w.js → Button-BXjXzdW_.js} +13 -13
- package/dist/{Dialog-BMgMUQuN.js → Dialog-D8bjn-nh.js} +404 -77
- package/dist/{FieldError-B8BgFmIQ.js → FieldError-DwBG6m1U.js} +2 -2
- package/dist/{FocusScope-B5vxRkHm.js → FocusScope-BMk5oZCk.js} +8 -8
- package/dist/{Heading-B5aEynOM.js → Heading-BmRX4BRL.js} +3 -3
- package/dist/{Hidden-rE6uR-lr.js → Hidden-Rfj-STx7.js} +4 -4
- package/dist/{Input-8yja_IHC.js → Input-CNNksOWg.js} +11 -11
- package/dist/{Label-DWVaNd2E.js → Label-D8a3eYb-.js} +4 -4
- package/dist/{List-BiAnh5G5.js → List-BGHOoFf0.js} +8 -8
- package/dist/{ListBox-DggfiuO_.js → ListBox-Dd37zMvs.js} +40 -41
- package/dist/{OverlayArrow-DraDOoRn.js → OverlayArrow-DokC40S3.js} +6 -6
- package/dist/{PortalProvider---wyKpMr.js → PortalProvider-CHPnqDSH.js} +2 -2
- package/dist/RadioGroup-BVFvITWO.js +371 -0
- package/dist/{SearchField-DWGdCvnn.js → SearchField-CHYnN-jt.js} +16 -16
- package/dist/{SelectionManager-B6-b5NM2.js → SelectionManager-N8X7T_4D.js} +44 -46
- package/dist/{SharedElementTransition-fML-zIv6.js → SharedElementTransition-BDT84GtD.js} +3 -3
- package/dist/{Slider-DfU6bRtH.js → Slider-CL5CM9S8.js} +23 -23
- package/dist/{Text-AxKZjtFm.js → Text-ztX6G1zR.js} +3 -3
- package/dist/{VisuallyHidden-CgnIuZJ2.js → VisuallyHidden-DTUuKFiI.js} +4 -4
- package/dist/assets/style-admin.css +12156 -2
- package/dist/assets/style-editor.css +12156 -2
- package/dist/assets/style.css +12162 -2
- package/dist/assets/wp-overrides/allow-full-width-blocks.css +6 -0
- package/dist/assets/wp-overrides/fix-label-text-case.css +29 -0
- package/dist/assets/wp-overrides/increase-sidebar-width.css +4 -0
- package/dist/assets/wp-overrides/make-block-messages-nicer.css +155 -0
- package/dist/assets/wp-overrides/replace-fonts.css +8 -0
- package/dist/assets/wp-overrides/restyle-tooltips.css +194 -0
- package/dist/assets/wp-overrides/round-corners.css +200 -0
- package/dist/assets/wp-overrides/unify-button-sizes.css +5 -0
- package/dist/clsx-DgYk2OaC.js +16 -0
- package/dist/{Color-WxFE7lQB.js → color-swatch-CFIuSPcO.js} +124 -6
- package/dist/components/animated-visibility/animated-visibility.js +25 -17
- package/dist/components/base-control/base-control.js +8 -5
- package/dist/components/base-control/container.js +204 -0
- package/dist/components/button/button.js +249 -155
- package/dist/components/checkbox/checkbox.js +96 -37
- package/dist/components/color-pickers/color-picker.js +16 -7
- package/dist/components/color-pickers/color-swatch.js +5 -57
- package/dist/components/color-pickers/gradient-editor.js +161 -138
- package/dist/components/color-pickers/solid-color-picker.js +308 -206
- package/dist/components/component-toggle/component-toggle.js +12 -8
- package/dist/components/container-panel/container-panel.js +54 -31
- package/dist/components/draggable/draggable-handle.js +8 -7
- package/dist/components/draggable/draggable.js +2 -2
- package/dist/components/draggable-list/draggable-list-item.js +21 -12
- package/dist/components/draggable-list/draggable-list.js +19 -21
- package/dist/components/expandable/expandable.js +56 -28
- package/dist/components/index.js +7 -21
- package/dist/components/input-field/input-field.js +112 -35
- package/dist/components/item-collection/item-collection.js +1 -1
- package/dist/components/link-input/link-input.js +181 -121
- package/dist/components/matrix-align/matrix-align.js +54 -20
- package/dist/components/menu/menu.js +26 -34
- package/dist/components/modal/modal.js +31 -28
- package/dist/components/notice/notice.js +45 -28
- package/dist/components/number-picker/number-picker.js +151 -101
- package/dist/components/option-select/option-select.js +40 -4
- package/dist/components/options-panel/options-panel.js +52 -25
- package/dist/components/placeholders/file-picker-shell.js +10 -9
- package/dist/components/placeholders/file-placeholder.js +14 -6
- package/dist/components/placeholders/image-placeholder.js +14 -4
- package/dist/components/placeholders/media-placeholder.js +11 -4
- package/dist/components/popover/popover.js +14 -11
- package/dist/components/portal-provider/portal-provider.js +1 -1
- package/dist/components/radio/radio.js +118 -429
- package/dist/components/repeater/repeater-item.js +7 -10
- package/dist/components/repeater/repeater.js +9 -15
- package/dist/components/responsive/mini-responsive.js +53 -61
- package/dist/components/responsive/responsive-legacy.js +1 -1
- package/dist/components/responsive/responsive.js +27 -27
- package/dist/components/responsive-preview/responsive-preview.js +1 -1
- package/dist/components/rich-label/rich-label.js +5 -5
- package/dist/components/select/async-multi-select.js +467 -100
- package/dist/components/select/{v2/async-select.js → async-select.js} +182 -105
- package/dist/components/select/multi-select.js +437 -83
- package/dist/components/select/shared.js +14 -42
- package/dist/components/select/single-select.js +349 -54
- package/dist/components/slider/column-config-slider.js +138 -45
- package/dist/components/slider/slider.js +265 -205
- package/dist/components/slider/utils.js +32 -1
- package/dist/components/smart-image/smart-image.js +25 -4
- package/dist/components/smart-image/worker-inline.js +1 -1
- package/dist/components/spacer/spacer.js +2 -2
- package/dist/components/tabs/tabs.js +370 -101
- package/dist/components/toggle/switch.js +174 -39
- package/dist/components/toggle/toggle.js +6 -3
- package/dist/components/toggle-button/toggle-button.js +140 -56
- package/dist/components/tooltip/tooltip.js +27 -26
- package/dist/{context-DMOmz986.js → context-BQvmiUqb.js} +3 -3
- package/dist/{default-i18n-DBm-GqWM.js → default-i18n-CnQeC5Pl.js} +10 -10
- package/dist/{general-Ck8IV7xJ.js → general-B6pOveVp.js} +11 -10
- package/dist/icons/icons.js +28 -9
- package/dist/icons/jsx-svg.js +1 -1
- package/dist/icons/spinner.js +3 -1
- package/dist/{index-Dq3gT5pW.js → index-BHpUy2Ix.js} +1 -1
- package/dist/{index-D8-Zjpbd.js → index-oFgxU4zs.js} +3 -3
- package/dist/index.js +6 -20
- package/dist/proxy-0B6wWuDe.js +7409 -0
- package/dist/{react-jsx-parser.min-VUl-CuCv.js → react-jsx-parser.min-B_hvYYa1.js} +5 -5
- package/dist/{Select-BvggcFOX.js → shared-DwjRce5e.js} +170 -36
- package/dist/{textSelection-DbCKqaw8.js → textSelection-CwHUtNVX.js} +1 -1
- package/dist/{useButton-v9ngEj50.js → useButton-DdZrS1Kz.js} +3 -3
- package/dist/{useEvent-BifIGnVS.js → useEvent-BD7Olibq.js} +1 -1
- package/dist/{useFilter-BlkUH1Ma.js → useFilter-bhxeEDg8.js} +1 -1
- package/dist/{useFocusRing-Cgm0R4Cf.js → useFocusRing-D3b7Kh4P.js} +1 -1
- package/dist/{useFormReset-yV9VVy9R.js → useFormReset-WUv2PdFO.js} +1 -1
- package/dist/{useFormValidation-CeNsUGWK.js → useFormValidation-DQeXkyLm.js} +2 -2
- package/dist/{useHover-BRDW3y7-.js → useHover-Bycb7BsD.js} +7 -7
- package/dist/{useLabel-C8umX0gk.js → useLabel-Bnv4-T24.js} +2 -2
- package/dist/{useLabels-Cdxi6JSa.js → useLabels-B49ptFDX.js} +1 -1
- package/dist/{useListState-RdLrYsMP.js → useListState-ZKhRO8ML.js} +1 -1
- package/dist/{useLocalizedStringFormatter-eaZiN2tE.js → useLocalizedStringFormatter-NETP-8H8.js} +1 -1
- package/dist/{useNumberField-D16dDfYF.js → useNumberField-D2fUHql3.js} +10 -10
- package/dist/{useNumberFormatter-BCmkV-7c.js → useNumberFormatter-DGvuRCn7.js} +1 -1
- package/dist/{usePress-DJskZBH9.js → usePress-B8OteQMu.js} +6 -6
- package/dist/{useSingleSelectListState-n0AVMr3Y.js → useSingleSelectListState-BBTu4shO.js} +2 -2
- package/dist/{useToggle-DSBDAfdw.js → useToggle-BZhaYwZl.js} +4 -4
- package/dist/{useToggleState-CzN79ary.js → useToggleState-VkXJjsru.js} +1 -1
- package/dist/utilities/general.js +1 -1
- package/dist/utilities/index.js +1 -1
- package/dist/{utils-cvK1vxO7.js → utils-DGpXyJOJ.js} +29 -42
- package/dist/workers/image-analysis.worker.js +3 -3
- package/package.json +26 -22
- package/dist/ColorSwatch-xVS3rMYS.js +0 -66
- package/dist/Select-ef7c0426.esm-CmTkSxDx.js +0 -2474
- package/dist/Separator-B-xeqOkC.js +0 -344
- package/dist/assets/wp-font-enhancements.css +0 -2
- package/dist/assets/wp-ui-enhancements.css +0 -2
- package/dist/components/select/async-single-select.js +0 -138
- package/dist/components/select/custom-select-default-components.js +0 -38
- package/dist/components/select/multi-select-components.js +0 -8
- package/dist/components/select/react-select-component-wrappers.js +0 -90
- package/dist/components/select/styles.js +0 -49
- package/dist/components/select/v2/async-multi-select.js +0 -432
- package/dist/components/select/v2/multi-select.js +0 -403
- package/dist/components/select/v2/shared.js +0 -69
- package/dist/components/select/v2/single-select.js +0 -358
- package/dist/index-641ee5b8.esm-DVp0njHa.js +0 -3139
- package/dist/modifiers.esm-BuJQPI1X.js +0 -31
- package/dist/multi-select-components-CT_W0Cy9.js +0 -3744
- package/dist/react-select-async.esm-Zl1LPaPb.js +0 -107
- package/dist/react-select.esm-Bu36HujU.js +0 -15
- package/dist/useDragAndDrop-C08ZXv4F.js +0 -3925
- package/dist/wp/wp-font-enhancements.js +0 -1
- package/dist/wp/wp-ui-enhancements.js +0 -1
|
@@ -1,358 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { _ as __ } from "../../../default-i18n-DBm-GqWM.js";
|
|
3
|
-
import { BaseControl } from "../../base-control/base-control.js";
|
|
4
|
-
import { $ as $d2f53cda644affe3$export$2f2b9559550c7bbc, a as $440f4836bcb56932$export$b94867ecbd698f21 } from "../../../SearchField-DWGdCvnn.js";
|
|
5
|
-
import { $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../../Button-CQ5ZZJ2w.js";
|
|
6
|
-
import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../../Input-8yja_IHC.js";
|
|
7
|
-
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../../Label-DWVaNd2E.js";
|
|
8
|
-
import { $ as $eed445e0843c11d0$export$41f133550aa26f48 } from "../../../ListBox-DggfiuO_.js";
|
|
9
|
-
import { e as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../../Dialog-BMgMUQuN.js";
|
|
10
|
-
import { $ as $82d7e5349645de74$export$ef9b1a59e592288f, a as $82d7e5349645de74$export$e288731fd71264f0, b as $82d7e5349645de74$export$ef445b55be0601bd } from "../../../Select-BvggcFOX.js";
|
|
11
|
-
import { useRef, cloneElement, useContext } from "react";
|
|
12
|
-
import { icons } from "../../../icons/icons.js";
|
|
13
|
-
import "../../../react-jsx-parser.min-VUl-CuCv.js";
|
|
14
|
-
import { OptionItemBase } from "./shared.js";
|
|
15
|
-
import { RichLabel } from "../../rich-label/rich-label.js";
|
|
16
|
-
import { c as clsx } from "../../../utils-cvK1vxO7.js";
|
|
17
|
-
import { $ as $bb77f239b46e8c72$export$3274cf84b703fff } from "../../../useFilter-BlkUH1Ma.js";
|
|
18
|
-
/**
|
|
19
|
-
* Select menu.
|
|
20
|
-
*
|
|
21
|
-
* @component
|
|
22
|
-
* @param {Object} props - Component props.
|
|
23
|
-
* @param {string} [props.icon] - Icon of the component.
|
|
24
|
-
* @param {string} [props.help] - Help text of the component.
|
|
25
|
-
* @param {string} [props.label] - Label of the component.
|
|
26
|
-
* @param {boolean} [props.inline] - Whether the Select menu is displayed inline with the label, to the right.
|
|
27
|
-
* @param {JSX.Element|JSX.Element[]} [props.actions] - Actions to show to the right of the label.
|
|
28
|
-
* @param {string} [props.subtitle] - Subtitle of the component.
|
|
29
|
-
* @param {{label: string, value: string, metadata: Object<string, any>?}[]} props.options - Options to display in the select. `[{ label: string, value: string }]`.
|
|
30
|
-
* @param {string|{label: string, value: string, metadata: Object<string, any>?}} props.value - Current value of the select.
|
|
31
|
-
* @param {Function} props.onChange - Function to call when the value changes.
|
|
32
|
-
* @param {boolean} [props.simpleValue=false] - If `true`, instead of using a `{label: '', value: ''}` value type, a string is used (just the value).
|
|
33
|
-
* @param {boolean} [props.clearable] - Whether the select is clearable.
|
|
34
|
-
* @param {boolean} [props.disabled] - Whether the select is disabled.
|
|
35
|
-
* @param {string} [props.placeholder] - Placeholder text to show when no value is selected.
|
|
36
|
-
* @param {JSX.Element} [props.customMenuOption] - If provided, replaces the default item in the dropdown menu (react-select's `components.Option`).
|
|
37
|
-
* @param {JSX.Element} [props.customValueDisplay] - If provided, replaces the default current value display of each selected item (react-select's `components.MultiValue`).
|
|
38
|
-
* @param {JSX.Element} [props.customDropdownArrow] - If provided, replaces the default dropdown arrow indicator.
|
|
39
|
-
* @param {string} [props.className] - Classes to pass to the select menu.
|
|
40
|
-
* @param {boolean} [props.noMinWidth=false] - If `true`, the select menu will not have a minimum width.
|
|
41
|
-
* @param {boolean} [props.searchable] - If `true`, the menu will allow searching through the options.
|
|
42
|
-
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
43
|
-
*
|
|
44
|
-
* @returns {JSX.Element} The SelectNext component.
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* const [value, setValue] = useState(null);
|
|
48
|
-
*
|
|
49
|
-
* const options = [
|
|
50
|
-
* { label: 'Option 1', value: 'option-1' },
|
|
51
|
-
* { label: 'Option 2', value: 'option-2' },
|
|
52
|
-
* { label: 'Option 3', value: 'option-3' },
|
|
53
|
-
* ];
|
|
54
|
-
*
|
|
55
|
-
* <SelectNext
|
|
56
|
-
* label='Select items'
|
|
57
|
-
* options={loadOptions}
|
|
58
|
-
* value={value}
|
|
59
|
-
* onChange={setValue}
|
|
60
|
-
* />
|
|
61
|
-
*
|
|
62
|
-
* @preserve
|
|
63
|
-
*/
|
|
64
|
-
const SelectNext = (props) => {
|
|
65
|
-
const {
|
|
66
|
-
icon,
|
|
67
|
-
help,
|
|
68
|
-
label,
|
|
69
|
-
inline,
|
|
70
|
-
actions,
|
|
71
|
-
subtitle,
|
|
72
|
-
value,
|
|
73
|
-
onChange,
|
|
74
|
-
options,
|
|
75
|
-
simpleValue = false,
|
|
76
|
-
disabled = false,
|
|
77
|
-
clearable = false,
|
|
78
|
-
placeholder = __("Select...", "eightshift-ui-components"),
|
|
79
|
-
customMenuOption,
|
|
80
|
-
customValueDisplay,
|
|
81
|
-
customDropdownArrow,
|
|
82
|
-
className,
|
|
83
|
-
noMinWidth = false,
|
|
84
|
-
searchable,
|
|
85
|
-
hidden,
|
|
86
|
-
...rest
|
|
87
|
-
} = props;
|
|
88
|
-
const ref = useRef();
|
|
89
|
-
const currentValue = simpleValue ? value ?? null : value?.value ?? null;
|
|
90
|
-
const { contains } = $bb77f239b46e8c72$export$3274cf84b703fff({ sensitivity: "base" });
|
|
91
|
-
if (hidden) {
|
|
92
|
-
return null;
|
|
93
|
-
}
|
|
94
|
-
return /* @__PURE__ */ jsx(
|
|
95
|
-
$82d7e5349645de74$export$ef9b1a59e592288f,
|
|
96
|
-
{
|
|
97
|
-
isDisabled: disabled,
|
|
98
|
-
selectedKey: currentValue,
|
|
99
|
-
onSelectionChange: (selected) => {
|
|
100
|
-
if (selected === null || selected === void 0) {
|
|
101
|
-
onChange(null);
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
if (simpleValue) {
|
|
105
|
-
onChange(selected);
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
const item = options.find((item2) => item2.value === selected);
|
|
109
|
-
if (!item) {
|
|
110
|
-
onChange(null);
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
if (item && "id" in item) {
|
|
114
|
-
delete item.id;
|
|
115
|
-
}
|
|
116
|
-
onChange(item);
|
|
117
|
-
},
|
|
118
|
-
placeholder,
|
|
119
|
-
...rest,
|
|
120
|
-
children: /* @__PURE__ */ jsxs(
|
|
121
|
-
BaseControl,
|
|
122
|
-
{
|
|
123
|
-
label,
|
|
124
|
-
icon,
|
|
125
|
-
subtitle,
|
|
126
|
-
actions,
|
|
127
|
-
help,
|
|
128
|
-
inline,
|
|
129
|
-
labelAs: $01b77f81d0f07f68$export$b04be29aa201d4f5,
|
|
130
|
-
children: [
|
|
131
|
-
/* @__PURE__ */ jsxs(
|
|
132
|
-
"div",
|
|
133
|
-
{
|
|
134
|
-
className: clsx(
|
|
135
|
-
"es:relative es:flex es:items-center es:gap-1 es:px-1.5 es:focus-visible:outline-hidden es:focus-visible:ring-2 es:focus-visible:ring-accent-500/50",
|
|
136
|
-
"es:h-9 es:rounded-10 es:border es:border-secondary-300 es:bg-white es:text-sm es:shadow-sm es:transition",
|
|
137
|
-
"es:inset-ring es:inset-ring-secondary-100",
|
|
138
|
-
"es:any-focus:outline-hidden",
|
|
139
|
-
!noMinWidth && "es:min-w-48",
|
|
140
|
-
!inline && "es:w-full",
|
|
141
|
-
disabled && "es:select-none es:shadow-none!",
|
|
142
|
-
"es:has-[[aria-haspopup=listbox][data-focus-visible=true],[aria-autocomplete=list][data-focus-visible=true]]:border-accent-500 es:has-[[aria-haspopup=listbox][data-focus-visible=true],[aria-autocomplete=list][data-focus-visible=true]]:ring-2 es:has-[[aria-haspopup=listbox][data-focus-visible=true],[aria-autocomplete=list][data-focus-visible=true]]:ring-accent-500/50",
|
|
143
|
-
className
|
|
144
|
-
),
|
|
145
|
-
ref,
|
|
146
|
-
children: [
|
|
147
|
-
/* @__PURE__ */ jsxs($d2b4bc8c273e7be6$export$353f5b6fc5456de1, { className: "es:any-focus:outline-hidden es:text-start es:size-full es:inline-block es:group es:overflow-x-clip", children: [
|
|
148
|
-
/* @__PURE__ */ jsx($82d7e5349645de74$export$e288731fd71264f0, { children: ({ isPlaceholder, selectedItem }) => {
|
|
149
|
-
if (!isPlaceholder && currentValue && customValueDisplay) {
|
|
150
|
-
return customValueDisplay(selectedItem);
|
|
151
|
-
}
|
|
152
|
-
if (!currentValue) {
|
|
153
|
-
return /* @__PURE__ */ jsx("span", { className: "es:pointer-events-none es:pr-6 es:text-sm es:text-secondary-500", children: placeholder });
|
|
154
|
-
}
|
|
155
|
-
let icon2 = selectedItem?.icon ?? null;
|
|
156
|
-
if (typeof selectedItem?.icon === "string") {
|
|
157
|
-
icon2 = icons?.[selectedItem.icon] ?? null;
|
|
158
|
-
}
|
|
159
|
-
return /* @__PURE__ */ jsx(
|
|
160
|
-
RichLabel,
|
|
161
|
-
{
|
|
162
|
-
icon: icon2,
|
|
163
|
-
label: selectedItem?.label,
|
|
164
|
-
subtitle: selectedItem?.subtitle,
|
|
165
|
-
className: clsx("es:pr-6 es:grow es:w-full", disabled && "es:grayscale es:pointer-events-none"),
|
|
166
|
-
iconClassName: "es:pointer-events-none es:select-none"
|
|
167
|
-
}
|
|
168
|
-
);
|
|
169
|
-
} }),
|
|
170
|
-
/* @__PURE__ */ jsxs(
|
|
171
|
-
"div",
|
|
172
|
-
{
|
|
173
|
-
className: clsx("es:absolute es:bottom-0 es:right-1 es:top-0 es:my-auto es:flex es:items-center", disabled ? "es:text-secondary-300" : "es:text-secondary-500"),
|
|
174
|
-
"aria-hidden": "true",
|
|
175
|
-
children: [
|
|
176
|
-
!customDropdownArrow && cloneElement(icons.dropdownCaretAlt, {
|
|
177
|
-
className: "es:w-4 es:group-aria-expanded:-scale-y-100 es:transition-transform es:duration-200"
|
|
178
|
-
}),
|
|
179
|
-
customDropdownArrow && /* @__PURE__ */ jsx(
|
|
180
|
-
"div",
|
|
181
|
-
{
|
|
182
|
-
"aria-hidden": "true",
|
|
183
|
-
className: "es:group-aria-expanded:-scale-y-100 es:transition-transform es:duration-200",
|
|
184
|
-
children: customDropdownArrow
|
|
185
|
-
}
|
|
186
|
-
)
|
|
187
|
-
]
|
|
188
|
-
}
|
|
189
|
-
)
|
|
190
|
-
] }),
|
|
191
|
-
clearable && /* @__PURE__ */ jsx(SelectClearButton, {})
|
|
192
|
-
]
|
|
193
|
-
}
|
|
194
|
-
),
|
|
195
|
-
/* @__PURE__ */ jsxs(
|
|
196
|
-
$07b14b47974efb58$export$5b6b19405a83ff9d,
|
|
197
|
-
{
|
|
198
|
-
className: ({ isEntering, isExiting }) => clsx(
|
|
199
|
-
"es:flex es:w-76 es:min-w-9 es:max-w-76 es:flex-col es:-hidden es:rounded-2xl es:border es:border-secondary-200 es:bg-white es:text-sm es:shadow-xl es:inset-ring es:inset-ring-secondary-100",
|
|
200
|
-
"es:any-focus:outline-hidden",
|
|
201
|
-
"es:motion-safe:motion-duration-200 es:motion-safe:motion-ease-spring-bouncy",
|
|
202
|
-
"es:placement-bottom:origin-top-left es:placement-top:origin-bottom-left",
|
|
203
|
-
"es:placement-left:origin-right es:placement-right:origin-left",
|
|
204
|
-
isEntering && "es:motion-safe:motion-scale-in-95 es:motion-opacity-in-0",
|
|
205
|
-
isEntering && "es:motion-safe:placement-top:motion-translate-y-in-[5%] es:motion-safe:placement-bottom:motion-translate-y-in-[-5%] es:motion-safe:placement-left:motion-translate-x-in-[5%] es:motion-safe:placement-right:motion-translate-x-in-[-5%]",
|
|
206
|
-
isExiting && "es:motion-safe:motion-scale-out-95 es:motion-opacity-out-0",
|
|
207
|
-
isExiting && "es:motion-safe:placement-top:motion-translate-y-out-[5%] es:motion-safe:placement-bottom:motion-translate-y-out-[-5%] es:motion-safe:placement-left:motion-translate-x-out-[5%] es:motion-safe:placement-right:motion-translate-x-out-[-5%]"
|
|
208
|
-
),
|
|
209
|
-
placement: "bottom left",
|
|
210
|
-
maxHeight: 300,
|
|
211
|
-
triggerRef: ref,
|
|
212
|
-
children: [
|
|
213
|
-
searchable && /* @__PURE__ */ jsxs($d2f53cda644affe3$export$2f2b9559550c7bbc, { filter: contains, children: [
|
|
214
|
-
/* @__PURE__ */ jsxs(
|
|
215
|
-
$440f4836bcb56932$export$b94867ecbd698f21,
|
|
216
|
-
{
|
|
217
|
-
"aria-label": __("Search", "eightshift-ui-components"),
|
|
218
|
-
className: "es:flex es:items-center es:bg-secondary-100 es:m-2 es:rounded-lg es:relative es:placeholder:text-secondary-500",
|
|
219
|
-
autoFocus: true,
|
|
220
|
-
children: [
|
|
221
|
-
/* @__PURE__ */ jsx(
|
|
222
|
-
$3985021b0ad6602f$export$f5b8910cec6cf069,
|
|
223
|
-
{
|
|
224
|
-
placeholder: __("Search...", "eightshift-ui-components"),
|
|
225
|
-
className: "es:peer es:size-full es:h-9 es:outline-hidden es:px-2.5 es:shadow-none es:text-sm es:py-0 es:[&::-webkit-search-cancel-button]:hidden"
|
|
226
|
-
}
|
|
227
|
-
),
|
|
228
|
-
/* @__PURE__ */ jsx(
|
|
229
|
-
$d2b4bc8c273e7be6$export$353f5b6fc5456de1,
|
|
230
|
-
{
|
|
231
|
-
"aria-label": __("Clear", "eightshift-ui-components"),
|
|
232
|
-
className: clsx(
|
|
233
|
-
"es:absolute es:right-2 es:top-0 es:bottom-0 es:my-auto",
|
|
234
|
-
"es:flex es:size-6 es:items-center es:justify-center es:rounded es:text-sm es:text-secondary-600 es:transition es:hover:bg-red-50 es:hover:text-red-900 es:any-focus:outline-hidden es:focus:ring-2 es:focus:ring-accent-500/50 es:disabled:text-secondary-300 es:cursor-pointer",
|
|
235
|
-
"es:peer-placeholder-shown:opacity-0"
|
|
236
|
-
),
|
|
237
|
-
children: icons.clearAlt
|
|
238
|
-
}
|
|
239
|
-
)
|
|
240
|
-
]
|
|
241
|
-
}
|
|
242
|
-
),
|
|
243
|
-
/* @__PURE__ */ jsx("div", { className: "es:w-full es:h-px es:bg-secondary-200 es:shrink-0" }),
|
|
244
|
-
/* @__PURE__ */ jsx(
|
|
245
|
-
$eed445e0843c11d0$export$41f133550aa26f48,
|
|
246
|
-
{
|
|
247
|
-
className: clsx("es:space-y-0.5 es:p-1 es:any-focus:outline-hidden es:min-h-16", options?.length > 0 && "es:overflow-y-auto"),
|
|
248
|
-
items: options,
|
|
249
|
-
renderEmptyState: () => /* @__PURE__ */ jsx(
|
|
250
|
-
RichLabel,
|
|
251
|
-
{
|
|
252
|
-
icon: icons.searchEmpty,
|
|
253
|
-
label: __("No results", "eightshift-ui-components"),
|
|
254
|
-
subtitle: __("Try a different search term", "eightshift-ui-components"),
|
|
255
|
-
className: "es:min-h-14 es:p-2 es:w-fit es:mx-auto es:motion-preset-slide-up es:motion-ease-spring-bouncy es:motion-duration-200 es:shrink-0",
|
|
256
|
-
iconClassName: "es:text-accent-700 es:icon:size-7!",
|
|
257
|
-
noColor: true
|
|
258
|
-
}
|
|
259
|
-
),
|
|
260
|
-
children: (item) => {
|
|
261
|
-
let icon2 = item?.icon ?? null;
|
|
262
|
-
if (typeof item?.icon === "string") {
|
|
263
|
-
icon2 = icons?.[item.icon] ?? null;
|
|
264
|
-
}
|
|
265
|
-
return /* @__PURE__ */ jsxs(
|
|
266
|
-
OptionItemBase,
|
|
267
|
-
{
|
|
268
|
-
id: item.value,
|
|
269
|
-
className: item?.className,
|
|
270
|
-
children: [
|
|
271
|
-
customMenuOption && customMenuOption(item),
|
|
272
|
-
!customMenuOption && /* @__PURE__ */ jsx(
|
|
273
|
-
RichLabel,
|
|
274
|
-
{
|
|
275
|
-
icon: icon2,
|
|
276
|
-
label: item?.label,
|
|
277
|
-
subtitle: item?.subtitle
|
|
278
|
-
}
|
|
279
|
-
)
|
|
280
|
-
]
|
|
281
|
-
}
|
|
282
|
-
);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
)
|
|
286
|
-
] }),
|
|
287
|
-
!searchable && /* @__PURE__ */ jsx(
|
|
288
|
-
$eed445e0843c11d0$export$41f133550aa26f48,
|
|
289
|
-
{
|
|
290
|
-
className: "es:space-y-0.5 es:p-1 es:any-focus:outline-hidden es:overflow-y-auto",
|
|
291
|
-
items: options,
|
|
292
|
-
renderEmptyState: () => /* @__PURE__ */ jsx(
|
|
293
|
-
RichLabel,
|
|
294
|
-
{
|
|
295
|
-
icon: icons.searchEmpty,
|
|
296
|
-
label: __("No results", "eightshift-ui-components"),
|
|
297
|
-
subtitle: __("Try a different search term", "eightshift-ui-components"),
|
|
298
|
-
className: "es:min-h-14 es:p-2 es:w-fit es:mx-auto es:motion-preset-slide-up es:motion-ease-spring-bouncy es:motion-duration-200",
|
|
299
|
-
iconClassName: "es:text-accent-700 es:icon:size-7!",
|
|
300
|
-
noColor: true
|
|
301
|
-
}
|
|
302
|
-
),
|
|
303
|
-
children: (item) => {
|
|
304
|
-
let icon2 = item?.icon ?? null;
|
|
305
|
-
if (typeof item?.icon === "string") {
|
|
306
|
-
icon2 = icons?.[item.icon] ?? null;
|
|
307
|
-
}
|
|
308
|
-
return /* @__PURE__ */ jsxs(
|
|
309
|
-
OptionItemBase,
|
|
310
|
-
{
|
|
311
|
-
id: item.value,
|
|
312
|
-
className: item?.className,
|
|
313
|
-
children: [
|
|
314
|
-
customMenuOption && customMenuOption(item),
|
|
315
|
-
!customMenuOption && /* @__PURE__ */ jsx(
|
|
316
|
-
RichLabel,
|
|
317
|
-
{
|
|
318
|
-
icon: icon2,
|
|
319
|
-
label: item?.label,
|
|
320
|
-
subtitle: item?.subtitle,
|
|
321
|
-
noColor: true
|
|
322
|
-
}
|
|
323
|
-
)
|
|
324
|
-
]
|
|
325
|
-
}
|
|
326
|
-
);
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
)
|
|
330
|
-
]
|
|
331
|
-
}
|
|
332
|
-
)
|
|
333
|
-
]
|
|
334
|
-
}
|
|
335
|
-
)
|
|
336
|
-
}
|
|
337
|
-
);
|
|
338
|
-
};
|
|
339
|
-
const SelectClearButton = () => {
|
|
340
|
-
const state = useContext($82d7e5349645de74$export$ef445b55be0601bd);
|
|
341
|
-
const isEmpty = state?.selectedKey === null;
|
|
342
|
-
return /* @__PURE__ */ jsx(
|
|
343
|
-
$d2b4bc8c273e7be6$export$353f5b6fc5456de1,
|
|
344
|
-
{
|
|
345
|
-
"aria-label": __("Clear value", "eightshift-ui-components"),
|
|
346
|
-
className: clsx(
|
|
347
|
-
"es:mr-6 es:flex es:h-6 es:w-8 es:items-center es:justify-center es:rounded es:text-sm es:text-secondary-600 es:transition es:hover:bg-red-50 es:hover:text-red-900 es:any-focus:outline-hidden es:focus:ring-2 es:focus:ring-accent-500/50 es:disabled:text-secondary-300 es:cursor-pointer",
|
|
348
|
-
isEmpty ? "es:hidden" : "es:flex"
|
|
349
|
-
),
|
|
350
|
-
onPress: () => state?.setSelectedKey(null),
|
|
351
|
-
slot: null,
|
|
352
|
-
children: icons.clearAlt
|
|
353
|
-
}
|
|
354
|
-
);
|
|
355
|
-
};
|
|
356
|
-
export {
|
|
357
|
-
SelectNext
|
|
358
|
-
};
|