@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,35 +1,35 @@
|
|
|
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-
|
|
3
|
-
import {
|
|
4
|
-
import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-
|
|
2
|
+
import { c as $319e236875307eab$export$a9b970dcc4ae71a9, a as $d2b4bc8c273e7be6$export$24d547caef80ccd1, $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../Button-BXjXzdW_.js";
|
|
3
|
+
import { o as $ff5963eb1fccf552$export$e08e3b67e392101e, a as $3ef42575df84b30b$export$9d1611c77c2fe928, $ as $64fa3d84918910a7$export$29f1550f4b0d4415, d as $64fa3d84918910a7$export$fabf2dc03a41866e, e as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, f as $64fa3d84918910a7$export$ef03459518577ad4, g as $64fa3d84918910a7$export$4d86445c2cf5e3, h as $64fa3d84918910a7$export$2881499e37b75b9a } from "../../utils-DGpXyJOJ.js";
|
|
4
|
+
import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-DwBG6m1U.js";
|
|
5
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-
|
|
7
|
-
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-
|
|
11
|
-
import { m as $ae20dd8cbca75726$export$d6daf82dcd84e87c,
|
|
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-CNNksOWg.js";
|
|
7
|
+
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-D8a3eYb-.js";
|
|
8
|
+
import { a as $b1f0cad8af73213b$export$3585ede4d035bf14, b as $b1f0cad8af73213b$export$9145995848b05025, c as $eed445e0843c11d0$export$7ff8f37d2d81a48d, d as $eed445e0843c11d0$export$7c5906fe4f1f2af2, $ as $eed445e0843c11d0$export$41f133550aa26f48, e as $eed445e0843c11d0$export$a11e76429ed99b4 } from "../../ListBox-Dd37zMvs.js";
|
|
9
|
+
import { w as $168583247155ddda$export$dc9c12ed27dd1b49, t as $2a25aae57d74318e$export$a05409b8bb224a5a, s as $453cc9f0df89c0a5$export$77d5aafae4e095b2, m as $5e3802645cc19319$export$1c3ebcada18427bf, n as $de32f1b87079253c$export$d2f961adcb0afbe, x as $07b14b47974efb58$export$9b9a0cd73afb7ca4, $ as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../Dialog-D8bjn-nh.js";
|
|
10
|
+
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-ztX6G1zR.js";
|
|
11
|
+
import { m as $ae20dd8cbca75726$export$d6daf82dcd84e87c, q as $c5a24bc478652b5f$export$1005530eda016c13, r as $55f9b1ae81f22853$export$2b35b76d2e30e129, g as $e1995378a142960e$export$bf788dd355e3a401 } from "../../SelectionManager-N8X7T_4D.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-
|
|
14
|
-
import
|
|
15
|
-
import { $ as $bb77f239b46e8c72$export$3274cf84b703fff } from "../../useFilter-
|
|
16
|
-
import { b as $e5be200c675c3b3a$export$a763b9476acd3eb, $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10 } from "../../useFormValidation-
|
|
17
|
-
import { $ as $a0d645289fe9b86b$export$e7f05e985daf4b5f } from "../../useSingleSelectListState-
|
|
18
|
-
import { c as $a02d57049d202695$export$d085fb9e920b5ca7 } from "../../useListState-
|
|
19
|
-
import { J as $c87311424ea30a05$export$e1865c3bedcd822b, g as $d4ee10de306f2510$export$cd4e5573fbe2b576, c as $431fbd86ca7dc216$export$b204af158042fbac, a as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "../../useHover-
|
|
20
|
-
import { b as $ea8dcbcb9ea1b556$export$9a302a45f65d0572 } from "../../usePress-
|
|
21
|
-
import { $ as $313b98861ee5dd6c$export$d6875122194c7b44 } from "../../useLabels-
|
|
22
|
-
import { $ as $e9faafb641e167db$export$90fc3a17d93f704c } from "../../useEvent-
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { _ as __ } from "../../default-i18n-DBm-GqWM.js";
|
|
13
|
+
import { $ as $fc909762b330b746$export$61c6a8c84e605fb6, f as $9daab02d461809db$export$683480f191c0e3ea } from "../../OverlayArrow-DokC40S3.js";
|
|
14
|
+
import $dbSRa$react__default, { useRef, useEffect, useMemo, useState, useCallback, forwardRef, createContext } from "react";
|
|
15
|
+
import { $ as $bb77f239b46e8c72$export$3274cf84b703fff } from "../../useFilter-bhxeEDg8.js";
|
|
16
|
+
import { b as $e5be200c675c3b3a$export$a763b9476acd3eb, $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10 } from "../../useFormValidation-DQeXkyLm.js";
|
|
17
|
+
import { $ as $a0d645289fe9b86b$export$e7f05e985daf4b5f } from "../../useSingleSelectListState-BBTu4shO.js";
|
|
18
|
+
import { c as $a02d57049d202695$export$d085fb9e920b5ca7 } from "../../useListState-ZKhRO8ML.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-Bycb7BsD.js";
|
|
20
|
+
import { b as $ea8dcbcb9ea1b556$export$9a302a45f65d0572 } from "../../usePress-B8OteQMu.js";
|
|
21
|
+
import { $ as $313b98861ee5dd6c$export$d6875122194c7b44 } from "../../useLabels-B49ptFDX.js";
|
|
22
|
+
import { $ as $e9faafb641e167db$export$90fc3a17d93f704c } from "../../useEvent-BD7Olibq.js";
|
|
23
|
+
import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "../../useLocalizedStringFormatter-NETP-8H8.js";
|
|
24
|
+
import { _ as __ } from "../../default-i18n-CnQeC5Pl.js";
|
|
26
25
|
import { icons } from "../../icons/icons.js";
|
|
26
|
+
import { Spinner } from "../../icons/spinner.js";
|
|
27
27
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
28
|
-
import { Spacer } from "../spacer/spacer.js";
|
|
29
28
|
import { Tooltip } from "../tooltip/tooltip.js";
|
|
30
29
|
import { AnimatedVisibility } from "../animated-visibility/animated-visibility.js";
|
|
31
30
|
import { BaseControl } from "../base-control/base-control.js";
|
|
32
31
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
32
|
+
import { c as cva } from "../../index-BHpUy2Ix.js";
|
|
33
33
|
import { $ as $f86e6c1ec7da6ebb$export$bc3384a35de93d66 } from "../../useAsyncList-D52mQcrH.js";
|
|
34
34
|
function $4f58c5f72bcf79f7$export$496315a1608d9602(effect, dependencies) {
|
|
35
35
|
const isInitialMount = useRef(true);
|
|
@@ -1277,7 +1277,7 @@ const $d01f2c01039c0eec$export$72b9695b8216309a = /* @__PURE__ */ forwardRef(fun
|
|
|
1277
1277
|
let { children, isDisabled = false, isInvalid = false, isRequired = false } = props;
|
|
1278
1278
|
let content = useMemo(() => {
|
|
1279
1279
|
var _props_items;
|
|
1280
|
-
return /* @__PURE__ */
|
|
1280
|
+
return /* @__PURE__ */ $dbSRa$react__default.createElement($eed445e0843c11d0$export$7ff8f37d2d81a48d.Provider, {
|
|
1281
1281
|
value: {
|
|
1282
1282
|
items: (_props_items = props.items) !== null && _props_items !== void 0 ? _props_items : props.defaultItems
|
|
1283
1283
|
}
|
|
@@ -1296,9 +1296,9 @@ const $d01f2c01039c0eec$export$72b9695b8216309a = /* @__PURE__ */ forwardRef(fun
|
|
|
1296
1296
|
props.items,
|
|
1297
1297
|
props.defaultItems
|
|
1298
1298
|
]);
|
|
1299
|
-
return /* @__PURE__ */
|
|
1299
|
+
return /* @__PURE__ */ $dbSRa$react__default.createElement($e1995378a142960e$export$bf788dd355e3a401, {
|
|
1300
1300
|
content
|
|
1301
|
-
}, (collection) => /* @__PURE__ */
|
|
1301
|
+
}, (collection) => /* @__PURE__ */ $dbSRa$react__default.createElement($d01f2c01039c0eec$var$ComboBoxInner, {
|
|
1302
1302
|
props,
|
|
1303
1303
|
collection,
|
|
1304
1304
|
comboBoxRef: ref
|
|
@@ -1384,7 +1384,7 @@ function $d01f2c01039c0eec$var$ComboBoxInner({ props, collection, comboBoxRef: r
|
|
|
1384
1384
|
});
|
|
1385
1385
|
delete DOMProps.id;
|
|
1386
1386
|
var _state_selectedKey;
|
|
1387
|
-
return /* @__PURE__ */
|
|
1387
|
+
return /* @__PURE__ */ $dbSRa$react__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
|
|
1388
1388
|
values: [
|
|
1389
1389
|
[
|
|
1390
1390
|
$d01f2c01039c0eec$export$c02625b26074192c,
|
|
@@ -1463,7 +1463,7 @@ function $d01f2c01039c0eec$var$ComboBoxInner({ props, collection, comboBoxRef: r
|
|
|
1463
1463
|
validation
|
|
1464
1464
|
]
|
|
1465
1465
|
]
|
|
1466
|
-
}, /* @__PURE__ */
|
|
1466
|
+
}, /* @__PURE__ */ $dbSRa$react__default.createElement("div", {
|
|
1467
1467
|
...DOMProps,
|
|
1468
1468
|
...renderProps,
|
|
1469
1469
|
ref,
|
|
@@ -1473,7 +1473,7 @@ function $d01f2c01039c0eec$var$ComboBoxInner({ props, collection, comboBoxRef: r
|
|
|
1473
1473
|
"data-disabled": props.isDisabled || void 0,
|
|
1474
1474
|
"data-invalid": validation.isInvalid || void 0,
|
|
1475
1475
|
"data-required": props.isRequired || void 0
|
|
1476
|
-
}), name && formValue === "key" && /* @__PURE__ */
|
|
1476
|
+
}), name && formValue === "key" && /* @__PURE__ */ $dbSRa$react__default.createElement("input", {
|
|
1477
1477
|
type: "hidden",
|
|
1478
1478
|
name,
|
|
1479
1479
|
form: props.form,
|
|
@@ -1500,8 +1500,13 @@ function $d01f2c01039c0eec$var$ComboBoxInner({ props, collection, comboBoxRef: r
|
|
|
1500
1500
|
* @param {number} [props.inputDebounceDelay=500] - The delay in milliseconds before the input value is considered final.
|
|
1501
1501
|
* @param {Function} [props.suggestionTypeIconOverride] - Allows overriding the default icon for the suggestion type, e.g. when using CPTs. Should be in the format: `(type) => icon or React component`.
|
|
1502
1502
|
* @param {boolean} [props.showSuggestionsWhenEmpty] - If `true`, the suggestion list will be shown when down arrow is pressed even the input is empty.
|
|
1503
|
+
* @param {boolean} [props.flat] - If `true`, component will look more flat. Useful for nested layer of controls.
|
|
1504
|
+
* @param {boolean} [props.keyboardShortcuts] - If `true`, keyboard shortcuts are shown in the suggestion list.
|
|
1505
|
+
* @param {InputSize} [props.size='default'] - Sets the size of the input field.
|
|
1503
1506
|
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
1504
1507
|
*
|
|
1508
|
+
* @typedef {'small' | 'medium' | 'default' | 'large'} InputSize
|
|
1509
|
+
*
|
|
1505
1510
|
* @returns {JSX.Element} The LinkInput component.
|
|
1506
1511
|
*
|
|
1507
1512
|
* @example
|
|
@@ -1528,10 +1533,12 @@ const LinkInput = (props) => {
|
|
|
1528
1533
|
showSuggestionsWhenEmpty,
|
|
1529
1534
|
fetchSuggestions,
|
|
1530
1535
|
className,
|
|
1536
|
+
keyboardShortcuts,
|
|
1537
|
+
flat,
|
|
1538
|
+
size = "default",
|
|
1531
1539
|
hidden
|
|
1532
1540
|
} = props;
|
|
1533
1541
|
const canShowSuggestions = typeof fetchSuggestions !== "undefined";
|
|
1534
|
-
const triggerRef = useRef(null);
|
|
1535
1542
|
let shouldShowSuggestions = true;
|
|
1536
1543
|
if (!canShowSuggestions || !showSuggestionsWhenEmpty && url.length < 1) {
|
|
1537
1544
|
shouldShowSuggestions = false;
|
|
@@ -1551,9 +1558,67 @@ const LinkInput = (props) => {
|
|
|
1551
1558
|
};
|
|
1552
1559
|
}
|
|
1553
1560
|
});
|
|
1561
|
+
const inputClass = cva(
|
|
1562
|
+
[
|
|
1563
|
+
"es:text-13 es:leading-none",
|
|
1564
|
+
"es:w-fill",
|
|
1565
|
+
"es:border-none",
|
|
1566
|
+
"es:rounded-lg es:focus:rounded-xl es:aria-[controls]:rounded-xl",
|
|
1567
|
+
"es:transition-plus",
|
|
1568
|
+
"es:any-focus:outline-hidden",
|
|
1569
|
+
"es:inset-ring",
|
|
1570
|
+
"es:focus-visible:ring-2 es:focus-visible:ring-accent-500/30",
|
|
1571
|
+
"es:focus-visible:text-accent-950 es:focus-visible:inset-ring-accent-500",
|
|
1572
|
+
"es:placeholder-shown:pr-0 es:pr-10",
|
|
1573
|
+
"es:focus:placeholder:text-surface-400",
|
|
1574
|
+
'es:font-variation-["wdth"_80,"YTLC"_520,"wght"_300,"slnt"_0] es:tracking-wide es:placeholder-shown:font-variation-["wdth"_100,"YTLC"_500,"wght"_250,"slnt"_-8]',
|
|
1575
|
+
className
|
|
1576
|
+
],
|
|
1577
|
+
{
|
|
1578
|
+
variants: {
|
|
1579
|
+
size: {
|
|
1580
|
+
small: ["es:min-h-8", "es:py-2 es:px-2.5"],
|
|
1581
|
+
medium: ["es:min-h-9", "es:py-2 es:px-3"],
|
|
1582
|
+
default: ["es:min-h-10", "es:py-2 es:px-3"],
|
|
1583
|
+
large: ["es:min-h-12", "es:py-2 es:px-4"]
|
|
1584
|
+
}
|
|
1585
|
+
},
|
|
1586
|
+
compoundVariants: [
|
|
1587
|
+
{
|
|
1588
|
+
flat: false,
|
|
1589
|
+
disabled: false,
|
|
1590
|
+
class: [
|
|
1591
|
+
"es:bg-white",
|
|
1592
|
+
"es:bg-linear-to-b es:from-secondary-100/0 es:to-secondary-100/50 es:from-25%",
|
|
1593
|
+
"es:hover:from-surface-100/0 es:hover:to-surface-100/50",
|
|
1594
|
+
"es:inset-ring-secondary-400/50 es:hover:inset-ring-surface-300 es:focus:inset-ring-surface-400",
|
|
1595
|
+
"es:inset-shadow-sm es:inset-shadow-secondary-100/50",
|
|
1596
|
+
"es:hover:placeholder:text-surface-400",
|
|
1597
|
+
"es:placeholder:text-secondary-400",
|
|
1598
|
+
"es:shadow-xs es:shadow-black/5"
|
|
1599
|
+
]
|
|
1600
|
+
},
|
|
1601
|
+
{
|
|
1602
|
+
flat: true,
|
|
1603
|
+
disabled: false,
|
|
1604
|
+
class: [
|
|
1605
|
+
"es:inset-ring-secondary-100",
|
|
1606
|
+
"es:focus:text-accent-950",
|
|
1607
|
+
"es:placeholder:text-secondary-500/80",
|
|
1608
|
+
"es:bg-secondary-100 es:focus:bg-surface-50",
|
|
1609
|
+
"es:inset-ring-secondary-200/15 es:hover:inset-ring-secondary-200/65 es:focus:inset-ring-surface-200",
|
|
1610
|
+
"es:shadow-none"
|
|
1611
|
+
]
|
|
1612
|
+
},
|
|
1613
|
+
{ disabled: true, class: ["es:bg-white es:inset-ring-secondary-200 es:text-secondary-400"] }
|
|
1614
|
+
],
|
|
1615
|
+
defaultVariants: { disabled: false, flat: false }
|
|
1616
|
+
}
|
|
1617
|
+
);
|
|
1554
1618
|
if (hidden) {
|
|
1555
1619
|
return null;
|
|
1556
1620
|
}
|
|
1621
|
+
const noResults = shouldShowSuggestions && !suggestionList.isLoading && suggestionList.items.length === 0;
|
|
1557
1622
|
return /* @__PURE__ */ jsxs(
|
|
1558
1623
|
$d01f2c01039c0eec$export$72b9695b8216309a,
|
|
1559
1624
|
{
|
|
@@ -1568,6 +1633,7 @@ const LinkInput = (props) => {
|
|
|
1568
1633
|
allowsCustomValue: true,
|
|
1569
1634
|
allowsEmptyCollection: true,
|
|
1570
1635
|
isDisabled: disabled,
|
|
1636
|
+
className: "es:selection:bg-surface-100 es:selection:text-accent-800",
|
|
1571
1637
|
children: [
|
|
1572
1638
|
/* @__PURE__ */ jsx(
|
|
1573
1639
|
BaseControl,
|
|
@@ -1579,65 +1645,48 @@ const LinkInput = (props) => {
|
|
|
1579
1645
|
actions,
|
|
1580
1646
|
labelAs: $01b77f81d0f07f68$export$b04be29aa201d4f5,
|
|
1581
1647
|
help,
|
|
1582
|
-
children: /* @__PURE__ */ jsxs(
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
"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",
|
|
1599
|
-
"es:not-readonly:focus:shadow-md",
|
|
1600
|
-
"es:[&::-webkit-search-cancel-button]:hidden",
|
|
1601
|
-
url?.length > 0 && "es:pr-10",
|
|
1602
|
-
className
|
|
1603
|
-
)
|
|
1604
|
-
}
|
|
1605
|
-
),
|
|
1606
|
-
/* @__PURE__ */ jsx(
|
|
1607
|
-
AnimatedVisibility,
|
|
1648
|
+
children: /* @__PURE__ */ jsxs($a049562f99e7db0e$export$eb2fcfdbd7ba97d4, { className: "es:relative es:group", children: [
|
|
1649
|
+
/* @__PURE__ */ jsx(
|
|
1650
|
+
$3985021b0ad6602f$export$f5b8910cec6cf069,
|
|
1651
|
+
{
|
|
1652
|
+
placeholder: disabled ? null : placeholder,
|
|
1653
|
+
className: inputClass({ disabled, flat, size })
|
|
1654
|
+
}
|
|
1655
|
+
),
|
|
1656
|
+
/* @__PURE__ */ jsx(
|
|
1657
|
+
AnimatedVisibility,
|
|
1658
|
+
{
|
|
1659
|
+
visible: !disabled && url?.length > 0,
|
|
1660
|
+
className: "es:absolute es:inset-y-1 es:right-1",
|
|
1661
|
+
transition: "scaleFade",
|
|
1662
|
+
children: /* @__PURE__ */ jsxs(
|
|
1663
|
+
$d2b4bc8c273e7be6$export$353f5b6fc5456de1,
|
|
1608
1664
|
{
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
"
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
children: removeIcon
|
|
1630
|
-
}
|
|
1631
|
-
) }),
|
|
1632
|
-
shouldShowSuggestions && suggestionList.isLoading && /* @__PURE__ */ jsx("div", { className: "es:p-1.5", children: cloneElement(icons.loader, { className: "es:text-accent-600! es:stroke-2 es:motion-preset-spin es:motion-duration-1500" }) })
|
|
1633
|
-
]
|
|
1634
|
-
}
|
|
1635
|
-
)
|
|
1665
|
+
slot: null,
|
|
1666
|
+
onPress: () => {
|
|
1667
|
+
onChange({ url: void 0, isAnchor: false });
|
|
1668
|
+
},
|
|
1669
|
+
className: "es:any-focus:outline-hidden es:rounded-xs es:transition-plus es:focus-visible:rounded-md es:focus-visible:bg-surface-200 es:focus-visible:text-accent-900",
|
|
1670
|
+
children: [
|
|
1671
|
+
!(shouldShowSuggestions && suggestionList.isLoading) && /* @__PURE__ */ jsx(Tooltip, { text: __("Clear", "eightshift-ui-components"), children: /* @__PURE__ */ jsx(
|
|
1672
|
+
"div",
|
|
1673
|
+
{
|
|
1674
|
+
className: clsx(
|
|
1675
|
+
"es:opacity-0 es:group-hover:opacity-100 es:group-focus-within:opacity-100 es:focus-visible:opacity-100",
|
|
1676
|
+
"es:flex es:size-8 es:items-center es:justify-center es:rounded-md es:text-secondary-600 es:backdrop-blur es:transition es:cursor-pointer",
|
|
1677
|
+
"es:hover:bg-red-600/5 es:hover:text-red-600",
|
|
1678
|
+
"es:icon:size-6"
|
|
1679
|
+
),
|
|
1680
|
+
children: removeIcon
|
|
1681
|
+
}
|
|
1682
|
+
) }),
|
|
1683
|
+
shouldShowSuggestions && suggestionList.isLoading && /* @__PURE__ */ jsx(Spinner, { className: "es:size-5! es:m-1.5 es:spinner-4!" })
|
|
1684
|
+
]
|
|
1636
1685
|
}
|
|
1637
1686
|
)
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
)
|
|
1687
|
+
}
|
|
1688
|
+
)
|
|
1689
|
+
] })
|
|
1641
1690
|
}
|
|
1642
1691
|
),
|
|
1643
1692
|
canShowSuggestions && shouldShowSuggestions && /* @__PURE__ */ jsxs(
|
|
@@ -1645,33 +1694,45 @@ const LinkInput = (props) => {
|
|
|
1645
1694
|
{
|
|
1646
1695
|
"aria-label": __("URL suggestions", "eightshift-ui-components"),
|
|
1647
1696
|
className: ({ isEntering, isExiting }) => clsx(
|
|
1648
|
-
"es:
|
|
1649
|
-
"es:
|
|
1697
|
+
"es:w-(--trigger-width)",
|
|
1698
|
+
"es:rounded-xl es:outline-hidden es:min-w-72",
|
|
1699
|
+
"es:has-first-selected:rounded-t-18!",
|
|
1700
|
+
"es:has-last-selected:rounded-b-18!",
|
|
1701
|
+
"es:inset-ring es:inset-ring-surface-500/10",
|
|
1702
|
+
"es:inset-shadow-sm es:inset-shadow-white/50",
|
|
1703
|
+
noResults ? "es:bg-surface-50/50" : "es:bg-surface-50/65",
|
|
1704
|
+
noResults ? "es:backdrop-blur-sm" : "es:backdrop-blur-md",
|
|
1705
|
+
noResults ? "es:backdrop-brightness-105" : "es:backdrop-brightness-110",
|
|
1706
|
+
"es:backdrop-saturate-125",
|
|
1707
|
+
"es:shadow-lg es:shadow-black/10",
|
|
1708
|
+
"es:transition-plus",
|
|
1709
|
+
"es:motion-duration-250 es:motion-ease-spring-bouncy",
|
|
1650
1710
|
"es:placement-bottom:origin-top-left es:placement-top:origin-bottom-left",
|
|
1651
|
-
(isEntering || !(suggestionList.isLoading || !shouldShowSuggestions)) && "es:motion-
|
|
1652
|
-
(isEntering || !(suggestionList.isLoading || !shouldShowSuggestions)) && "es:
|
|
1653
|
-
isExiting && "es:motion-
|
|
1654
|
-
isExiting && "es:
|
|
1711
|
+
(isEntering || !(suggestionList.isLoading || !shouldShowSuggestions)) && "es:motion-scale-x-in-95 es:motion-scale-y-in-85 es:motion-opacity-in-0 es:motion-blur-in-[2px]",
|
|
1712
|
+
(isEntering || !(suggestionList.isLoading || !shouldShowSuggestions)) && "es:placement-top:motion-translate-y-in-[0.5rem] es:placement-bottom:motion-translate-y-in-[-0.5rem]",
|
|
1713
|
+
isExiting && "es:motion-scale-x-out-95 es:motion-scale-y-out-85 es:motion-opacity-out-0 es:motion-blur-out-xs",
|
|
1714
|
+
isExiting && "es:placement-top:motion-translate-y-out-[0.5rem] es:placement-bottom:motion-translate-y-out-[-0.5rem]",
|
|
1655
1715
|
(suggestionList.isLoading || !shouldShowSuggestions) && "es:invisible"
|
|
1656
1716
|
),
|
|
1657
1717
|
offset: 3,
|
|
1658
|
-
|
|
1659
|
-
width: `${triggerRef.current?.offsetWidth}px`
|
|
1660
|
-
},
|
|
1718
|
+
maxHeight: 0.8 * (window?.innerWidth ?? 1e3),
|
|
1661
1719
|
children: [
|
|
1662
|
-
|
|
1720
|
+
noResults && /* @__PURE__ */ jsx(
|
|
1663
1721
|
RichLabel,
|
|
1664
1722
|
{
|
|
1665
1723
|
icon: icons.searchEmpty,
|
|
1666
1724
|
label: __("No results", "eightshift-ui-components"),
|
|
1667
1725
|
subtitle: __("Try a different search term", "eightshift-ui-components"),
|
|
1668
|
-
className: "es:
|
|
1669
|
-
iconClassName: "es:text-accent-700 es:icon:size-7!",
|
|
1726
|
+
className: "es:p-4 es:w-fit es:mx-auto es:flex-col es:items-center es:gap-2.5",
|
|
1727
|
+
iconClassName: "es:text-accent-50 es:bg-linear-to-br es:from-accent-600 es:to-accent-700 es:p-2 es:rounded-full es:icon:size-7!",
|
|
1728
|
+
labelClassName: "es:mx-auto",
|
|
1729
|
+
subtitleClassName: "es:mx-auto",
|
|
1730
|
+
fullSizeSubtitle: true,
|
|
1670
1731
|
noColor: true
|
|
1671
1732
|
}
|
|
1672
1733
|
),
|
|
1673
1734
|
suggestionList.items.length > 0 && !suggestionList.isLoading && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1674
|
-
/* @__PURE__ */ jsx($eed445e0843c11d0$export$41f133550aa26f48, { className: "es:space-y-
|
|
1735
|
+
/* @__PURE__ */ jsx($eed445e0843c11d0$export$41f133550aa26f48, { className: "es:space-y-0.75 es:p-1.5", children: (item) => {
|
|
1675
1736
|
const {
|
|
1676
1737
|
label: title,
|
|
1677
1738
|
value: url2,
|
|
@@ -1701,10 +1762,13 @@ const LinkInput = (props) => {
|
|
|
1701
1762
|
{
|
|
1702
1763
|
id: item.value,
|
|
1703
1764
|
className: clsx(
|
|
1704
|
-
"es:
|
|
1705
|
-
"es:
|
|
1706
|
-
"es:
|
|
1707
|
-
"
|
|
1765
|
+
"es:transition-plus",
|
|
1766
|
+
"es:px-2 es:py-2.5",
|
|
1767
|
+
"es:bg-accent-900/4 es:rounded-sm es:first:rounded-t-lg es:last:rounded-b-lg es:after-current:rounded-t-lg es:before-current:rounded-b-lg",
|
|
1768
|
+
"es:focus-visible:bg-surface-200/65 es:focus-visible:rounded-2xl es:focus-visible:text-accent-950",
|
|
1769
|
+
"es:hover:bg-surface-200/50 es:hover:rounded-2xl es:hover:text-accent-900",
|
|
1770
|
+
"es:pressed:rounded-3xl!",
|
|
1771
|
+
"es:text-surface-950"
|
|
1708
1772
|
),
|
|
1709
1773
|
textValue: url2,
|
|
1710
1774
|
children: /* @__PURE__ */ jsx(
|
|
@@ -1713,32 +1777,28 @@ const LinkInput = (props) => {
|
|
|
1713
1777
|
icon: typeIcon,
|
|
1714
1778
|
label: title,
|
|
1715
1779
|
subtitle: url2?.replace(location.origin, "").replace(/\/$/, ""),
|
|
1780
|
+
className: "es:select-none",
|
|
1781
|
+
subtitleClassName: 'es:font-variation-["wdth"_40,"wght"_250]!',
|
|
1782
|
+
iconClassName: "es:p-1 es:text-accent-900 es:bg-surface-50/65 es:rounded-md",
|
|
1716
1783
|
noColor: true
|
|
1717
1784
|
}
|
|
1718
1785
|
)
|
|
1719
1786
|
}
|
|
1720
1787
|
);
|
|
1721
1788
|
} }),
|
|
1722
|
-
/* @__PURE__ */
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
className: "es:
|
|
1727
|
-
}
|
|
1728
|
-
),
|
|
1729
|
-
/* @__PURE__ */ jsxs("div", { className: "es:flex es:flex-wrap es:items-center es:justify-end es:gap-x-3 es:gap-y-1.5 es:p-2 es:text-sm es:text-secondary-500", children: [
|
|
1730
|
-
/* @__PURE__ */ jsxs("div", { className: "es:flex es:gap-1", children: [
|
|
1731
|
-
/* @__PURE__ */ jsx("kbd", { className: "es:flex es:size-4 es:items-center es:justify-center es:rounded es:bg-radial es:from-secondary-100 es:to-secondary-200 es:font-mono es:text-xs es:text-secondary-600", children: "↓" }),
|
|
1732
|
-
/* @__PURE__ */ jsx("kbd", { className: "es:flex es:size-4 es:items-center es:justify-center es:rounded es:bg-radial es:from-secondary-100 es:to-secondary-200 es:font-mono es:text-xs es:text-secondary-600", children: "↑" }),
|
|
1733
|
-
__("Navigate", "eightshift-ui-components")
|
|
1789
|
+
keyboardShortcuts && /* @__PURE__ */ jsxs("div", { className: "es:flex es:flex-wrap es:items-center es:justify-end-safe es:gap-x-4 es:gap-y-0.5 es:px-2.5 es:pb-2 es:pt-0.5", children: [
|
|
1790
|
+
/* @__PURE__ */ jsxs("div", { className: "es:flex es:gap-1 es:items-center", children: [
|
|
1791
|
+
/* @__PURE__ */ jsx("kbd", { className: "es:flex es:size-4 es:items-center es:justify-center es:rounded es:bg-surface-600/15 es:text-surface-600 es:font-mono es:text-13 es:text-box-trim es:tracking-tighter", children: "↓" }),
|
|
1792
|
+
/* @__PURE__ */ jsx("kbd", { className: "es:flex es:size-4 es:items-center es:justify-center es:rounded es:bg-surface-600/15 es:text-surface-600 es:font-mono es:text-13 es:text-box-trim es:tracking-tighter", children: "↑" }),
|
|
1793
|
+
/* @__PURE__ */ jsx("span", { className: 'es:font-variation-["wdth"_64,"wght"_250] es:text-12 es:text-box-trim es:text-surface-700', children: __("Navigate", "eightshift-ui-components") })
|
|
1734
1794
|
] }),
|
|
1735
|
-
/* @__PURE__ */ jsxs("div", { className: "es:flex es:gap-1", children: [
|
|
1736
|
-
/* @__PURE__ */ jsx("kbd", { className: "es:flex es:size-4 es:items-center es:justify-center es:rounded es:bg-
|
|
1737
|
-
__("Select", "eightshift-ui-components")
|
|
1795
|
+
/* @__PURE__ */ jsxs("div", { className: "es:flex es:gap-1 es:items-center", children: [
|
|
1796
|
+
/* @__PURE__ */ jsx("kbd", { className: "es:flex es:size-4 es:items-center es:justify-center es:rounded es:bg-surface-600/15 es:text-surface-600 es:font-mono es:text-13 es:text-box-trim es:tracking-tighter", children: "↵" }),
|
|
1797
|
+
/* @__PURE__ */ jsx("span", { className: 'es:font-variation-["wdth"_64,"wght"_250] es:text-12 es:text-box-trim es:text-surface-700', children: __("Select", "eightshift-ui-components") })
|
|
1738
1798
|
] }),
|
|
1739
|
-
/* @__PURE__ */ jsxs("div", { className: "es:flex es:gap-1", children: [
|
|
1740
|
-
/* @__PURE__ */ jsx("kbd", { className: "es:flex es:h-4 es:items-center es:justify-center es:rounded es:bg-
|
|
1741
|
-
__("Hide", "eightshift-ui-components")
|
|
1799
|
+
/* @__PURE__ */ jsxs("div", { className: "es:flex es:gap-1 es:items-center", children: [
|
|
1800
|
+
/* @__PURE__ */ jsx("kbd", { className: "es:flex es:h-4 es:items-center es:justify-center es:rounded es:bg-surface-600/15 es:text-surface-600 es:font-mono es:text-10 es:text-box-trim es:tracking-tighter es:px-0.75", children: "Esc" }),
|
|
1801
|
+
/* @__PURE__ */ jsx("span", { className: 'es:font-variation-["wdth"_64,"wght"_250] es:text-12 es:text-box-trim es:text-surface-700', children: __("Hide", "eightshift-ui-components") })
|
|
1742
1802
|
] })
|
|
1743
1803
|
] })
|
|
1744
1804
|
] })
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { _ as __ } from "../../default-i18n-
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { _ as __ } from "../../default-i18n-CnQeC5Pl.js";
|
|
3
3
|
import { icons } from "../../icons/icons.js";
|
|
4
|
-
import {
|
|
5
|
-
import { Menu, MenuItem } from "../menu/menu.js";
|
|
4
|
+
import { upperFirst, camelCase } from "../../utilities/es-dash.js";
|
|
6
5
|
import { BaseControl } from "../base-control/base-control.js";
|
|
6
|
+
import { TriggeredPopover } from "../popover/popover.js";
|
|
7
|
+
import { $ as $b6c3ddc6086f204d$export$a98f0dcb43a68a25, a as $b6c3ddc6086f204d$export$d7b12c4107be0d61 } from "../../RadioGroup-BVFvITWO.js";
|
|
8
|
+
import { RichLabel } from "../rich-label/rich-label.js";
|
|
9
|
+
import { c as clsx } from "../../clsx-DgYk2OaC.js";
|
|
7
10
|
/**
|
|
8
11
|
* A component that can provide a 3x3 or a 2x2 grid of positions to pick from.
|
|
9
12
|
* Replaces the default Gutenberg `AlignmentMatrixControl`/`BlockAlignmentMatrixControl`/`BlockAlignmentMatrixToolbar`.
|
|
@@ -97,6 +100,18 @@ const MatrixAlign = (props) => {
|
|
|
97
100
|
}
|
|
98
101
|
];
|
|
99
102
|
const sizeOptions = allSizeOptions.filter(({ availableOn }) => availableOn.includes(size));
|
|
103
|
+
const currentItemLabel = sizeOptions.find(({ value: itemValue }) => itemValue === value)?.label;
|
|
104
|
+
let triggerTooltip = currentItemLabel;
|
|
105
|
+
if (!label) {
|
|
106
|
+
triggerTooltip = /* @__PURE__ */ jsx(
|
|
107
|
+
RichLabel,
|
|
108
|
+
{
|
|
109
|
+
label: tooltip,
|
|
110
|
+
subtitle: currentItemLabel,
|
|
111
|
+
noColor: true
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
}
|
|
100
115
|
return /* @__PURE__ */ jsx(
|
|
101
116
|
BaseControl,
|
|
102
117
|
{
|
|
@@ -104,23 +119,42 @@ const MatrixAlign = (props) => {
|
|
|
104
119
|
label,
|
|
105
120
|
subtitle,
|
|
106
121
|
inline: true,
|
|
107
|
-
children: /* @__PURE__ */
|
|
108
|
-
|
|
122
|
+
children: /* @__PURE__ */ jsxs(
|
|
123
|
+
TriggeredPopover,
|
|
109
124
|
{
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
125
|
+
triggerButtonIcon: icons[`position${size}${upperFirst(camelCase(value))}`],
|
|
126
|
+
triggerButtonProps: {
|
|
127
|
+
"aria-label": ariaLabel,
|
|
128
|
+
tooltip: triggerTooltip
|
|
129
|
+
},
|
|
130
|
+
wrapperClassName: "es:from-surface-300/30 es:to-surface-300/30 es:p-0.5",
|
|
131
|
+
children: [
|
|
132
|
+
/* @__PURE__ */ jsx("div", { className: "es:bg-accent-50/60 es:inset-ring es:inset-ring-accent-800/3 es:rounded-t-xl es:rounded-b-md", children: /* @__PURE__ */ jsx(
|
|
133
|
+
$b6c3ddc6086f204d$export$a98f0dcb43a68a25,
|
|
134
|
+
{
|
|
135
|
+
"aria-label": tooltip,
|
|
136
|
+
value,
|
|
137
|
+
onChange,
|
|
138
|
+
orientation: "horizontal",
|
|
139
|
+
className: clsx("es:grid es:gap-1 es:w-fit es:mx-auto", size === "2x2" && "es:grid-cols-2 es:p-5", size === "3x3" && "es:grid-cols-3 es:p-3"),
|
|
140
|
+
children: sizeOptions.map(({ value: itemValue, label: label2 }) => /* @__PURE__ */ jsx(
|
|
141
|
+
$b6c3ddc6086f204d$export$d7b12c4107be0d61,
|
|
142
|
+
{
|
|
143
|
+
"aria-label": label2,
|
|
144
|
+
autoFocus: itemValue === value,
|
|
145
|
+
value: itemValue,
|
|
146
|
+
className: ({ isSelected }) => clsx(
|
|
147
|
+
"es:size-6 es:rounded-sm es:transition-plus es:ease-spring-bouncy es:inset-ring es:pressed:scale-90",
|
|
148
|
+
isSelected && "es:bg-accent-500 es:rounded-xl es:inset-ring-accent-700 es:inset-shadow-sm es:inset-shadow-accent-50/25 es:bg-linear-to-b es:from-25% es:from-accent-700/5 es:to-accent-700/30 es:shadow-xs es:shadow-black/10",
|
|
149
|
+
!isSelected && "es:bg-surface-300 es:hover:bg-surface-400 es:hover:rounded-md es:focus-visible:rounded-lg es:pressed:rounded-xl es:inset-ring-surface-400/20"
|
|
150
|
+
)
|
|
151
|
+
},
|
|
152
|
+
itemValue
|
|
153
|
+
))
|
|
154
|
+
}
|
|
155
|
+
) }),
|
|
156
|
+
/* @__PURE__ */ jsx("div", { className: "es:bg-accent-50/60 es:inset-ring es:inset-ring-accent-800/3 es:rounded-b-xl es:rounded-t-md es:p-2 es:mt-0.75 es:text-12 es:text-center es:text-accent-900", children: currentItemLabel })
|
|
157
|
+
]
|
|
124
158
|
}
|
|
125
159
|
)
|
|
126
160
|
}
|