@eightshift/ui-components 0.0.1 → 0.0.2
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/README.md +0 -1
- package/dist/Button-eebLs4cp.js +54 -0
- package/dist/{Checkbox-BLcVbhiO.js → Checkbox-BN0TEda-.js} +7 -7
- package/dist/{ColorSwatch-Cmlex_kT.js → ColorSwatch-BrowHhTG.js} +4 -4
- package/dist/{FieldError-wtMA4667.js → FieldError-ILxgMZy5.js} +2 -2
- package/dist/{FocusScope-1u9yyfIN.js → FocusScope-B9b0VMib.js} +2 -2
- package/dist/GeistMonoVF.woff2 +0 -0
- package/dist/GeistVF.woff2 +0 -0
- package/dist/{GridList-BZPXp3_O.js → GridList-CzpWxJsS.js} +18 -18
- package/dist/{Group-DyqpTRPe.js → Group-Dkdm2-E7.js} +3 -3
- package/dist/{Input-jsbb4ugq.js → Input-BJA4rmIo.js} +7 -7
- package/dist/{Label-BPzS-sR7.js → Label-9x5iLJ-Y.js} +1 -1
- package/dist/{ListBox-w9gDaJkV.js → ListBox-D3Vr4vvC.js} +18 -18
- package/dist/{Select-49a62830.esm-C-RFtLiD.js → Select-49a62830.esm-CKPmlkza.js} +1 -1
- package/dist/{SelectionManager-mefd0ThJ.js → SelectionManager-sedvcM-1.js} +8 -8
- package/dist/{Separator-DHn0CwdK.js → Separator-B6rnDabE.js} +3 -3
- package/dist/{Slider-Pyh2V4bY.js → Slider-C5U5N7uM.js} +11 -11
- package/dist/{Text-BM136LvS.js → Text-Cyxp9ewv.js} +1 -1
- package/dist/{VisuallyHidden-BYRI1Lfo.js → VisuallyHidden-BPJVSUyp.js} +2 -2
- package/dist/_commonjsHelpers-DWwsNxpa.js +8 -0
- package/dist/assets/fonts.css +1 -0
- package/dist/assets/style.css +1 -1
- package/dist/assets/wp.css +1 -0
- package/dist/{button-BkkdyHfJ.js → button-idVI4jmd.js} +45 -64
- package/dist/components/base-control/base-control.js +29 -39
- package/dist/components/breakpoint-preview/breakpoint-preview.js +7 -7
- package/dist/components/button/button.js +6 -5
- package/dist/components/checkbox/checkbox.js +9 -7
- package/dist/components/color-pickers/color-picker.js +27 -36
- package/dist/components/color-pickers/color-swatch.js +6 -6
- package/dist/components/color-pickers/gradient-editor.js +10 -6
- package/dist/components/color-pickers/solid-color-picker.js +35 -38
- package/dist/components/component-toggle/component-toggle.js +52 -6
- package/dist/components/container-panel/container-panel.js +55 -6
- package/dist/components/draggable-list/draggable-list-item.js +74 -0
- package/dist/components/draggable-list/draggable-list.js +157 -0
- package/dist/components/expandable/expandable.js +19 -12
- package/dist/components/input-field/input-field.js +15 -10
- package/dist/components/layout/hstack.js +40 -0
- package/dist/components/layout/vstack.js +40 -0
- package/dist/components/link-input/link-input.js +35 -31
- package/dist/components/list-box/list-box.js +11 -6
- package/dist/components/matrix-align/matrix-align.js +12 -7
- package/dist/components/menu/menu.js +26 -21
- package/dist/components/notice/notice.js +11 -7
- package/dist/components/number-picker/number-picker.js +19 -13
- package/dist/components/option-select/option-select.js +231 -0
- package/dist/components/placeholders/file-placeholder.js +53 -0
- package/dist/components/placeholders/image-placeholder.js +88 -0
- package/dist/components/placeholders/media-placeholder.js +62 -0
- package/dist/components/popover/popover.js +4 -4
- package/dist/components/radio/radio.js +56 -38
- package/dist/components/repeater/repeater-item.js +46 -39
- package/dist/components/repeater/repeater.js +83 -56
- package/dist/components/responsive/responsive-legacy.js +17 -12
- package/dist/components/responsive/responsive.js +227 -160
- package/dist/components/responsive-preview/responsive-preview.js +5 -3
- package/dist/components/rich-label/rich-label.js +12 -8
- package/dist/components/select/async-multi-select.js +9 -6
- package/dist/components/select/async-single-select.js +7 -2
- package/dist/components/select/custom-select-default-components.js +3 -3
- package/dist/components/select/multi-select-components.js +2 -2
- package/dist/components/select/multi-select.js +9 -6
- package/dist/components/select/react-select-component-wrappers.js +1 -1
- package/dist/components/select/single-select.js +7 -2
- package/dist/components/select/styles.js +4 -4
- package/dist/components/slider/column-config-slider.js +18 -34
- package/dist/components/slider/slider.js +19 -26
- package/dist/components/slider/utils.js +44 -1
- package/dist/components/spacer/spacer.js +21 -11
- package/dist/components/tabs/tabs.js +21 -20
- package/dist/components/toggle/switch.js +18 -12
- package/dist/components/toggle/toggle.js +8 -2
- package/dist/components/toggle-button/toggle-button.js +25 -13
- package/dist/components/tooltip/tooltip.js +4 -4
- package/dist/{context-jMy6xdVq.js → context-BAcFg5GO.js} +1 -1
- package/dist/{default-i18n-BhE-OUmt.js → default-i18n-Bk1GxDHz.js} +1 -1
- package/dist/{focusSafely-C3K8zAKj.js → focusSafely-B0hyd-S4.js} +1 -1
- package/dist/fonts.js +1 -0
- package/dist/icons/icons.js +184 -164
- package/dist/icons/jsx-svg.js +4957 -0
- package/dist/{index-Bfb9bWcb.js → index-BDk0TPWz.js} +1 -1
- package/dist/{index-a301f526.esm-Bioi4cGX.js → index-a301f526.esm-BzTuHLdr.js} +1 -1
- package/dist/index.js +30 -4
- package/dist/{intlStrings-CUhoK9EN.js → intlStrings-Ctkp0HDc.js} +1 -1
- package/dist/lite-pbIeT7tm.js +8 -0
- package/dist/{multi-select-components-CjVpCNko.js → multi-select-components-nORKdJ-2.js} +3 -3
- package/dist/{popover-Dx3vKXUX.js → popover-o2Q28Ljn.js} +19 -14
- package/dist/{react-select-async.esm-TFb_ZX6C.js → react-select-async.esm-CLj9uZTq.js} +3 -3
- package/dist/{react-select.esm-BjRWqf0E.js → react-select.esm-3tyTZmrx.js} +3 -3
- package/dist/{textSelection-BosCCRVE.js → textSelection-BRZdHY-4.js} +1 -1
- package/dist/{tooltip-CkCndvTI.js → tooltip-T6H9uF-Z.js} +10 -10
- package/dist/{useButton-CuG5UzUw.js → useButton-D-xACzEY.js} +3 -3
- package/dist/{useEvent-DHv-yhOH.js → useEvent-XlYPKgwX.js} +1 -1
- package/dist/{useFocusRing-Cc-4eouh.js → useFocusRing-CRx_hYC4.js} +1 -1
- package/dist/{useFocusable-5q1Gek1J.js → useFocusable-CHfpEdlE.js} +2 -2
- package/dist/{useFormReset-Buc9YJcv.js → useFormReset-aHn6-wRk.js} +1 -1
- package/dist/{useFormValidationState-BAPPNXic.js → useFormValidationState-CdYmOaXI.js} +2 -2
- package/dist/{useHasTabbableChild-D3uUNhJ0.js → useHasTabbableChild-domoFB7A.js} +2 -2
- package/dist/{useLabel-CGlkoFG0.js → useLabel-DVhXVhtH.js} +2 -2
- package/dist/{useLabels-Dg62M_3P.js → useLabels-C7E5SkOi.js} +1 -1
- package/dist/{useListState-Domq0blV.js → useListState-BRsq7O1C.js} +1 -1
- package/dist/{useLocalizedStringFormatter-Prmz0h0A.js → useLocalizedStringFormatter-WsEL47qR.js} +1 -1
- package/dist/{useNumberFieldState-BLU3uhSR.js → useNumberFieldState-ZH2Qyyxh.js} +9 -9
- package/dist/{useNumberFormatter-BLc2xjZn.js → useNumberFormatter-mhdYLxWQ.js} +1 -1
- package/dist/{usePress-BQgVor4T.js → usePress-B42RawCH.js} +3 -3
- package/dist/{useToggle-C9ETOBaZ.js → useToggle-CExfZM8x.js} +4 -4
- package/dist/{useToggleState-DJ_z5E2S.js → useToggleState-DghG5ImG.js} +1 -1
- package/dist/utilities/array-helpers.js +30 -0
- package/dist/utilities/index.js +8 -0
- package/dist/utilities/text-helpers.js +30 -4
- package/dist/{utils-BsiH7-5Y.js → utils-DIBzm1e4.js} +1 -1
- package/dist/wp.js +1 -0
- package/package.json +11 -4
- package/dist/_commonjsHelpers-CUmg6egw.js +0 -6
- package/dist/utilities/classnames.js +0 -16
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { $ as $d2b4bc8c273e7be6$export$24d547caef80ccd1,
|
|
3
|
-
import { $ as $a049562f99e7db0e$export$f9c6924e160136d1, a as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4 } from "../../Group-
|
|
4
|
-
import { b as $2d73ec29415bd339$export$712718f7aec83d5, $ as $3985021b0ad6602f$export$37fb8590cf2c088c, a as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-
|
|
5
|
-
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-
|
|
6
|
-
import { n as $ff5963eb1fccf552$export$e08e3b67e392101e, a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, h as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, i as $64fa3d84918910a7$export$ef03459518577ad4, c as $64fa3d84918910a7$export$4d86445c2cf5e3, j as $64fa3d84918910a7$export$2881499e37b75b9a } from "../../utils-
|
|
7
|
-
import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-
|
|
2
|
+
import { $ as $d2b4bc8c273e7be6$export$24d547caef80ccd1, a as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../Button-eebLs4cp.js";
|
|
3
|
+
import { $ as $a049562f99e7db0e$export$f9c6924e160136d1, a as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4 } from "../../Group-Dkdm2-E7.js";
|
|
4
|
+
import { b as $2d73ec29415bd339$export$712718f7aec83d5, $ as $3985021b0ad6602f$export$37fb8590cf2c088c, a as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-BJA4rmIo.js";
|
|
5
|
+
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-9x5iLJ-Y.js";
|
|
6
|
+
import { n as $ff5963eb1fccf552$export$e08e3b67e392101e, a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, h as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, i as $64fa3d84918910a7$export$ef03459518577ad4, c as $64fa3d84918910a7$export$4d86445c2cf5e3, j as $64fa3d84918910a7$export$2881499e37b75b9a } from "../../utils-DIBzm1e4.js";
|
|
7
|
+
import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-ILxgMZy5.js";
|
|
8
8
|
import { $ as $d3e0e05bdfcf66bd$export$c24727297075ec6a } from "../../Form-Cq3fu75_.js";
|
|
9
|
-
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-
|
|
9
|
+
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-Cyxp9ewv.js";
|
|
10
10
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-DG2RfOUr.js";
|
|
11
|
-
import React__default, { useReducer, useRef, useEffect, forwardRef, createContext, useMemo, useState
|
|
12
|
-
import { e as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "../../focusSafely-
|
|
13
|
-
import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "../../useLocalizedStringFormatter-
|
|
14
|
-
import {
|
|
11
|
+
import React__default, { useReducer, useRef, useEffect, forwardRef, createContext, useMemo, useState } from "react";
|
|
12
|
+
import { e as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "../../focusSafely-B0hyd-S4.js";
|
|
13
|
+
import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "../../useLocalizedStringFormatter-WsEL47qR.js";
|
|
14
|
+
import { $ as $13c3c67164f4d5be$export$4c260019440d418f, B as Button } from "../../button-idVI4jmd.js";
|
|
15
|
+
import { _ as __ } from "../../default-i18n-Bk1GxDHz.js";
|
|
15
16
|
import { icons } from "../../icons/icons.js";
|
|
16
|
-
import {
|
|
17
|
+
import { c as clsx } from "../../lite-pbIeT7tm.js";
|
|
17
18
|
import { Spacer } from "../spacer/spacer.js";
|
|
18
|
-
import { T as Tooltip } from "../../tooltip-
|
|
19
|
+
import { T as Tooltip } from "../../tooltip-T6H9uF-Z.js";
|
|
19
20
|
import { AnimatedVisibility } from "../animated-visibility/animated-visibility.js";
|
|
20
21
|
import { BaseControl } from "../base-control/base-control.js";
|
|
21
22
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
22
|
-
import { P as Popover } from "../../popover-
|
|
23
|
+
import { P as Popover } from "../../popover-o2Q28Ljn.js";
|
|
23
24
|
import { a as $0d86e9c8f07f9a7b$export$79c0c687a5963b0a } from "../../useListData-BelKu4kx.js";
|
|
24
25
|
var $03c9a1a10de12f06$exports = {};
|
|
25
26
|
$03c9a1a10de12f06$exports = {
|
|
@@ -670,6 +671,7 @@ function c(e, u, c2) {
|
|
|
670
671
|
* @param {string} [props.className] - Classes to pass to the input field.
|
|
671
672
|
* @param {number} [props.inputDebounceDelay=500] - The delay in milliseconds before the input value is considered final.
|
|
672
673
|
* @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`.
|
|
674
|
+
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
673
675
|
*
|
|
674
676
|
* @returns {JSX.Element} The LinkInput component.
|
|
675
677
|
*
|
|
@@ -697,7 +699,8 @@ const LinkInput = (props) => {
|
|
|
697
699
|
suggestionTypeIconOverride,
|
|
698
700
|
fetchSuggestions,
|
|
699
701
|
className,
|
|
700
|
-
inputDebounceDelay = 500
|
|
702
|
+
inputDebounceDelay = 500,
|
|
703
|
+
hidden
|
|
701
704
|
} = props;
|
|
702
705
|
const [inputValue, setInputValue] = useState(url ?? "");
|
|
703
706
|
const [suggestionsVisible, setSuggestionsVisible] = useState(false);
|
|
@@ -720,21 +723,21 @@ const LinkInput = (props) => {
|
|
|
720
723
|
return ((_a2 = url2 == null ? void 0 : url2.trim()) == null ? void 0 : _a2.length) < 3 || (url2 == null ? void 0 : url2.startsWith("#")) || (url2 == null ? void 0 : url2.startsWith(":")) || (url2 == null ? void 0 : url2.startsWith("mailto:")) || (url2 == null ? void 0 : url2.startsWith("tel:")) || (url2 == null ? void 0 : url2.startsWith("http://")) || (url2 == null ? void 0 : url2.startsWith("https://"));
|
|
721
724
|
};
|
|
722
725
|
const debounced = c(
|
|
723
|
-
|
|
724
|
-
(value)
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
},
|
|
733
|
-
[onChange, suggestionList]
|
|
734
|
-
),
|
|
726
|
+
(value) => {
|
|
727
|
+
onChange({ url: value, isAnchor: value == null ? void 0 : value.includes("#") });
|
|
728
|
+
if (shouldNotShowSuggestions(value)) {
|
|
729
|
+
setSuggestionsVisible(false);
|
|
730
|
+
} else {
|
|
731
|
+
suggestionList.setFilterText(value);
|
|
732
|
+
setSuggestionsVisible((value == null ? void 0 : value.length) > 3);
|
|
733
|
+
}
|
|
734
|
+
},
|
|
735
735
|
inputDebounceDelay,
|
|
736
736
|
{ maxWait: 2e3 }
|
|
737
737
|
);
|
|
738
|
+
if (hidden) {
|
|
739
|
+
return null;
|
|
740
|
+
}
|
|
738
741
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
739
742
|
/* @__PURE__ */ jsx(
|
|
740
743
|
$440f4836bcb56932$export$b94867ecbd698f21,
|
|
@@ -768,7 +771,7 @@ const LinkInput = (props) => {
|
|
|
768
771
|
{
|
|
769
772
|
placeholder,
|
|
770
773
|
ref: inputRef,
|
|
771
|
-
className:
|
|
774
|
+
className: clsx(
|
|
772
775
|
"es-uic-min-h-10 es-uic-w-full es-uic-rounded-md es-uic-border es-uic-border-gray-300 es-uic-py-2 es-uic-pl-2 es-uic-pr-1 es-uic-text-sm es-uic-shadow-sm es-uic-transition selection:es-uic-bg-teal-500/20 selection:es-uic-text-teal-950",
|
|
773
776
|
"focus:es-uic-outline-none focus-visible:es-uic-outline-none focus-visible:es-uic-ring focus-visible:es-uic-ring-teal-500 focus-visible:es-uic-ring-opacity-50",
|
|
774
777
|
(inputValue == null ? void 0 : inputValue.length) > 0 && "es-uic-pr-8",
|
|
@@ -791,7 +794,7 @@ const LinkInput = (props) => {
|
|
|
791
794
|
children: /* @__PURE__ */ jsx($d2b4bc8c273e7be6$export$353f5b6fc5456de1, { children: /* @__PURE__ */ jsx(Tooltip, { text: __("Clear", "eightshift-ui-components"), children: /* @__PURE__ */ jsx(
|
|
792
795
|
"div",
|
|
793
796
|
{
|
|
794
|
-
className:
|
|
797
|
+
className: clsx(
|
|
795
798
|
"es-uic-flex es-uic-size-8 es-uic-items-center es-uic-justify-center es-uic-rounded es-uic-bg-white/85 es-uic-text-gray-600 es-uic-backdrop-blur es-uic-transition",
|
|
796
799
|
"hover:es-uic-bg-red-50 hover:es-uic-text-red-500",
|
|
797
800
|
"[&>svg]:es-uic-size-6"
|
|
@@ -852,8 +855,9 @@ const LinkInput = (props) => {
|
|
|
852
855
|
const {
|
|
853
856
|
label: title,
|
|
854
857
|
value: url2,
|
|
855
|
-
metadata: { subtype }
|
|
858
|
+
metadata: { subtype: rawSubtype }
|
|
856
859
|
} = item;
|
|
860
|
+
const subtype = rawSubtype ?? "page";
|
|
857
861
|
let typeIcon = icons.file;
|
|
858
862
|
if (subtype.toLowerCase() === "url") {
|
|
859
863
|
typeIcon = icons.externalLink;
|
|
@@ -878,7 +882,7 @@ const LinkInput = (props) => {
|
|
|
878
882
|
textValue: label,
|
|
879
883
|
size: "large",
|
|
880
884
|
type: "ghost",
|
|
881
|
-
className:
|
|
885
|
+
className: clsx(
|
|
882
886
|
"es-uic-w-full es-uic-text-start",
|
|
883
887
|
"es-uic-grid es-uic-grid-cols-[auto,_minmax(0,_1fr)] es-uic-grid-rows-2 es-uic-items-center es-uic-justify-items-start es-uic-gap-x-2 es-uic-gap-y-0",
|
|
884
888
|
"[&>svg]:es-uic-row-span-2 [&>svg]:es-uic-shrink-0",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { b as $eed445e0843c11d0$export$41f133550aa26f48, c as $eed445e0843c11d0$export$a11e76429ed99b4 } from "../../ListBox-D3Vr4vvC.js";
|
|
3
|
+
import { c as clsx } from "../../lite-pbIeT7tm.js";
|
|
4
4
|
import { BaseControl } from "../base-control/base-control.js";
|
|
5
|
-
import { _ as __ } from "../../default-i18n-
|
|
5
|
+
import { _ as __ } from "../../default-i18n-Bk1GxDHz.js";
|
|
6
6
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
7
7
|
/**
|
|
8
8
|
* A component that allows selecting a single or multiple options from a list.
|
|
@@ -28,6 +28,7 @@ import { RichLabel } from "../rich-label/rich-label.js";
|
|
|
28
28
|
* @param {boolean} [props.canDeselect=false] - If `true`, the selected value can be deselected (`null` is set in that case).
|
|
29
29
|
* @param {ListBoxOrientation} [props.orientation='horizontal'] - The orientation of the list. If all options have only an icon set, the orientation is forced to be horizontal.
|
|
30
30
|
* @param {string} [props.className] - Classes to pass to the list.
|
|
31
|
+
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
31
32
|
*
|
|
32
33
|
* @returns {JSX.Element} The ListBox component.
|
|
33
34
|
*
|
|
@@ -63,8 +64,12 @@ const ListBox = (props) => {
|
|
|
63
64
|
canDeselect = false,
|
|
64
65
|
orientation: setOrientation = "horizontal",
|
|
65
66
|
className,
|
|
67
|
+
hidden,
|
|
66
68
|
...rest
|
|
67
69
|
} = props;
|
|
70
|
+
if (hidden) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
68
73
|
const mappedOptions = options.map((option) => ({
|
|
69
74
|
...option,
|
|
70
75
|
id: option.id ?? option.value
|
|
@@ -90,7 +95,7 @@ const ListBox = (props) => {
|
|
|
90
95
|
$eed445e0843c11d0$export$41f133550aa26f48,
|
|
91
96
|
{
|
|
92
97
|
selectionMode,
|
|
93
|
-
className:
|
|
98
|
+
className: clsx(
|
|
94
99
|
"es-uic-rounded-lg es-uic-border es-uic-border-gray-300 es-uic-p-1 es-uic-text-sm es-uic-shadow-sm es-uic-transition",
|
|
95
100
|
"focus:es-uic-outline-none",
|
|
96
101
|
orientation === "horizontal" && "es-uic-flex es-uic-w-fit es-uic-max-w-full es-uic-gap-0.5",
|
|
@@ -115,7 +120,7 @@ const ListBox = (props) => {
|
|
|
115
120
|
textValue: label2 ?? tooltip,
|
|
116
121
|
isDisabled: disabled,
|
|
117
122
|
className: ({ isDisabled, isSelected }) => {
|
|
118
|
-
return
|
|
123
|
+
return clsx(
|
|
119
124
|
"es-uic-flex es-uic-min-h-9 es-uic-select-none es-uic-rounded-md es-uic-border es-uic-transition",
|
|
120
125
|
"focus:es-uic-outline-none focus-visible:es-uic-outline-none focus-visible:es-uic-ring focus-visible:es-uic-ring-teal-500 focus-visible:es-uic-ring-opacity-50",
|
|
121
126
|
isSelected && !disabled && "es-uic-bg-teal-600 es-uic-text-white es-uic-border-teal-600 after:es-uic-opacity-45 es-uic-border es-uic-shadow-md es-uic-shadow-teal-500/25",
|
|
@@ -135,7 +140,7 @@ const ListBox = (props) => {
|
|
|
135
140
|
icon: icon2,
|
|
136
141
|
label: label2,
|
|
137
142
|
subtitle: subtitle2,
|
|
138
|
-
className:
|
|
143
|
+
className: clsx(orientation === "horizontal" && "leading-none"),
|
|
139
144
|
contentsOnly: orientation === "horizontal-tiles"
|
|
140
145
|
}
|
|
141
146
|
)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useRef } from "react";
|
|
3
|
-
import { _ as __ } from "../../default-i18n-
|
|
4
|
-
import { P as Popover } from "../../popover-
|
|
5
|
-
import { B as Button } from "../../button-
|
|
3
|
+
import { _ as __ } from "../../default-i18n-Bk1GxDHz.js";
|
|
4
|
+
import { P as Popover } from "../../popover-o2Q28Ljn.js";
|
|
5
|
+
import { B as Button } from "../../button-idVI4jmd.js";
|
|
6
6
|
import { icons } from "../../icons/icons.js";
|
|
7
7
|
import { upperFirst, camelCase } from "../../utilities/text-helpers.js";
|
|
8
|
-
import {
|
|
9
|
-
import { T as Tooltip } from "../../tooltip-
|
|
8
|
+
import { c as clsx } from "../../lite-pbIeT7tm.js";
|
|
9
|
+
import { T as Tooltip } from "../../tooltip-T6H9uF-Z.js";
|
|
10
10
|
import { BaseControl } from "../base-control/base-control.js";
|
|
11
11
|
/**
|
|
12
12
|
* A component that can provide a 3x3 or a 2x2 grid of positions to pick from.
|
|
@@ -22,6 +22,7 @@ import { BaseControl } from "../base-control/base-control.js";
|
|
|
22
22
|
* @param {JSX.Element} [props.icon] - Icon to display within the button.
|
|
23
23
|
* @param {string} [props.subtitle] - Subtitle to display.
|
|
24
24
|
* @param {string} [props.popoverPosition='bottom'] - The position of the popover.
|
|
25
|
+
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
25
26
|
*
|
|
26
27
|
* @returns {JSX.Element} The MatrixAlign component.
|
|
27
28
|
*
|
|
@@ -47,13 +48,17 @@ const MatrixAlign = (props) => {
|
|
|
47
48
|
icon,
|
|
48
49
|
subtitle,
|
|
49
50
|
"aria-label": ariaLabel,
|
|
50
|
-
popoverPosition
|
|
51
|
+
popoverPosition,
|
|
52
|
+
hidden
|
|
51
53
|
} = props;
|
|
52
54
|
const [currentValue, setCurrentValue] = useState(value);
|
|
53
55
|
const [tooltipText, setTooltipText] = useState(null);
|
|
54
56
|
const [popoverOpen, setPopoverOpen] = useState(false);
|
|
55
57
|
const ref = useRef(null);
|
|
56
58
|
const innerRef = useRef(null);
|
|
59
|
+
if (hidden) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
57
62
|
const allSizeOptions = [
|
|
58
63
|
{
|
|
59
64
|
value: "top left",
|
|
@@ -150,7 +155,7 @@ const MatrixAlign = (props) => {
|
|
|
150
155
|
"div",
|
|
151
156
|
{
|
|
152
157
|
ref: innerRef,
|
|
153
|
-
className:
|
|
158
|
+
className: clsx(
|
|
154
159
|
"es-uic-grid",
|
|
155
160
|
size === "3x3" && "es-uic-grid-cols-3 es-uic-grid-rows-3",
|
|
156
161
|
size === "2x2" && "es-uic-grid-cols-2 es-uic-grid-rows-2"
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { $ as $982254629710d113$export$b95089534ab7c1fd, b as $453cc9f0df89c0a5$export$77d5aafae4e095b2, c as $431f98aba6844401$export$1ff3c3f08ae963c0, d as $431f98aba6844401$export$6615d83f6de245ce, e as $72a5793c14baf454$export$8b251419efc915eb } from "../../Separator-
|
|
3
|
-
import { p as $8a26561d2877236e$export$c24ed0104d07eab9, f as $880e95eb8b93ba9a$export$ecf600387e221c37, $ as $7af3f5b51489e0b5$export$253fe78d46329472, a as $7613b1592d41b092$export$6cd28814d92fa9c9, b as $d496c0a20b6e58ec$export$6c8a5aaad13c9852, j as $7135fc7d473fd974$export$e7c29ae2353b16ea, n as $7135fc7d473fd974$export$6cd28814d92fa9c9, o as $7135fc7d473fd974$export$727c8fc270210f13, q as $7135fc7d473fd974$export$6e2c8f0811a474ce } from "../../SelectionManager-
|
|
4
|
-
import { e as $bdb11010cef70236$export$f680877a34711e37, d as $3ef42575df84b30b$export$9d1611c77c2fe928, k as $bdb11010cef70236$export$b4cc09c592e8fdb8, f as $8ae05eaa5c114e9c$export$7f54fc3180508a52, g as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, j as $64fa3d84918910a7$export$2881499e37b75b9a, a as $64fa3d84918910a7$export$29f1550f4b0d4415, h as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, m as $5dc95899b306f630$export$c9058316764c140e, l as $df56164dff5785e2$export$4338b53315abf666, c as $64fa3d84918910a7$export$4d86445c2cf5e3, $ as $64fa3d84918910a7$export$fabf2dc03a41866e } from "../../utils-
|
|
2
|
+
import { $ as $982254629710d113$export$b95089534ab7c1fd, b as $453cc9f0df89c0a5$export$77d5aafae4e095b2, c as $431f98aba6844401$export$1ff3c3f08ae963c0, d as $431f98aba6844401$export$6615d83f6de245ce, e as $72a5793c14baf454$export$8b251419efc915eb } from "../../Separator-B6rnDabE.js";
|
|
3
|
+
import { p as $8a26561d2877236e$export$c24ed0104d07eab9, f as $880e95eb8b93ba9a$export$ecf600387e221c37, $ as $7af3f5b51489e0b5$export$253fe78d46329472, a as $7613b1592d41b092$export$6cd28814d92fa9c9, b as $d496c0a20b6e58ec$export$6c8a5aaad13c9852, j as $7135fc7d473fd974$export$e7c29ae2353b16ea, n as $7135fc7d473fd974$export$6cd28814d92fa9c9, o as $7135fc7d473fd974$export$727c8fc270210f13, q as $7135fc7d473fd974$export$6e2c8f0811a474ce } from "../../SelectionManager-sedvcM-1.js";
|
|
4
|
+
import { e as $bdb11010cef70236$export$f680877a34711e37, d as $3ef42575df84b30b$export$9d1611c77c2fe928, k as $bdb11010cef70236$export$b4cc09c592e8fdb8, f as $8ae05eaa5c114e9c$export$7f54fc3180508a52, g as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, j as $64fa3d84918910a7$export$2881499e37b75b9a, a as $64fa3d84918910a7$export$29f1550f4b0d4415, h as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, m as $5dc95899b306f630$export$c9058316764c140e, l as $df56164dff5785e2$export$4338b53315abf666, c as $64fa3d84918910a7$export$4d86445c2cf5e3, $ as $64fa3d84918910a7$export$fabf2dc03a41866e } from "../../utils-DIBzm1e4.js";
|
|
5
5
|
import React__default, { useRef, useState, useEffect, useCallback, useMemo, createContext, forwardRef, useContext, cloneElement } from "react";
|
|
6
|
-
import { $ as $628037886ba31236$export$f9d5c8beee7d008d, a as $de32f1b87079253c$export$d2f961adcb0afbe, b as $07b14b47974efb58$export$9b9a0cd73afb7ca4, c as $f1ab8c75478c6f73$export$3351871ee4b288b8, d as $e0b6e0b68ec7f50f$export$872b660ac5a1ff98, P as Popover } from "../../popover-
|
|
7
|
-
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-
|
|
6
|
+
import { $ as $628037886ba31236$export$f9d5c8beee7d008d, a as $de32f1b87079253c$export$d2f961adcb0afbe, b as $07b14b47974efb58$export$9b9a0cd73afb7ca4, c as $f1ab8c75478c6f73$export$3351871ee4b288b8, d as $e0b6e0b68ec7f50f$export$872b660ac5a1ff98, P as Popover } from "../../popover-o2Q28Ljn.js";
|
|
7
|
+
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-Cyxp9ewv.js";
|
|
8
8
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-DG2RfOUr.js";
|
|
9
|
-
import { $ as $9daab02d461809db$export$683480f191c0e3ea, a as $fc909762b330b746$export$61c6a8c84e605fb6 } from "../../tooltip-
|
|
10
|
-
import { $ as $6179b936705e76d3$export$ae780daf29e6d456, a as $507fabe10e71c6fb$export$b9b3dfddab17db27, c as $a1ea59d68270f0dd$export$f8168d8dd8fd66e6, w as $507fabe10e71c6fb$export$98e20ec92f614cfe, e as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "../../focusSafely-
|
|
11
|
-
import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "../../useLocalizedStringFormatter-
|
|
12
|
-
import { b as $ea8dcbcb9ea1b556$export$9a302a45f65d0572, $ as $f6c31cce2adf654f$export$45712eceda6fad21, a as $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 } from "../../usePress-
|
|
13
|
-
import { a as $46d819fcbaf35654$export$8f71654801c2f7cd } from "../../useFocusable-
|
|
14
|
-
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-
|
|
15
|
-
import { $ as $9bf71ea28793e738$export$20e40289641fbbb6 } from "../../FocusScope-
|
|
16
|
-
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-
|
|
9
|
+
import { $ as $9daab02d461809db$export$683480f191c0e3ea, a as $fc909762b330b746$export$61c6a8c84e605fb6 } from "../../tooltip-T6H9uF-Z.js";
|
|
10
|
+
import { $ as $6179b936705e76d3$export$ae780daf29e6d456, a as $507fabe10e71c6fb$export$b9b3dfddab17db27, c as $a1ea59d68270f0dd$export$f8168d8dd8fd66e6, w as $507fabe10e71c6fb$export$98e20ec92f614cfe, e as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "../../focusSafely-B0hyd-S4.js";
|
|
11
|
+
import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "../../useLocalizedStringFormatter-WsEL47qR.js";
|
|
12
|
+
import { b as $ea8dcbcb9ea1b556$export$9a302a45f65d0572, $ as $f6c31cce2adf654f$export$45712eceda6fad21, a as $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 } from "../../usePress-B42RawCH.js";
|
|
13
|
+
import { a as $46d819fcbaf35654$export$8f71654801c2f7cd } from "../../useFocusable-CHfpEdlE.js";
|
|
14
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-BAcFg5GO.js";
|
|
15
|
+
import { $ as $9bf71ea28793e738$export$20e40289641fbbb6 } from "../../FocusScope-B9b0VMib.js";
|
|
16
|
+
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-CRx_hYC4.js";
|
|
17
17
|
import { icons } from "../../icons/icons.js";
|
|
18
|
-
import { B as Button } from "../../button-
|
|
19
|
-
import {
|
|
20
|
-
import { _ as __ } from "../../default-i18n-
|
|
18
|
+
import { B as Button } from "../../button-idVI4jmd.js";
|
|
19
|
+
import { c as clsx } from "../../lite-pbIeT7tm.js";
|
|
20
|
+
import { _ as __ } from "../../default-i18n-Bk1GxDHz.js";
|
|
21
21
|
var $c0398ad35c3639b7$exports = {};
|
|
22
22
|
$c0398ad35c3639b7$exports = {
|
|
23
23
|
"longPressMessage": `اضغط مطولاً أو اضغط على Alt + السهم لأسفل لفتح القائمة`
|
|
@@ -1346,6 +1346,7 @@ function $3674c52c6b3c5bce$var$MenuItemTriggerInner({ item, popover, parentMenuR
|
|
|
1346
1346
|
* @param {boolean} [props.keepOpen=false] - If `true`, the menu will not close when an item is selected.
|
|
1347
1347
|
* @param {boolean} [props.openOnLongPress=false] - If `true`, the menu will open on long press instead of click. If enabled, a regular `onPress` event can also be passed to the trigger button to enable dual behavior.
|
|
1348
1348
|
* @param {Object} [props.popoverProps] - Props to pass to the popover.
|
|
1349
|
+
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
1349
1350
|
*
|
|
1350
1351
|
* @returns {JSX.Element} The Menu component.
|
|
1351
1352
|
*
|
|
@@ -1396,8 +1397,12 @@ const Menu = (props) => {
|
|
|
1396
1397
|
tooltip,
|
|
1397
1398
|
keepOpen = false,
|
|
1398
1399
|
"aria-label": ariaLabel = triggerLabel ?? __("Menu", "eightshift-ui-components"),
|
|
1399
|
-
openOnLongPress = false
|
|
1400
|
+
openOnLongPress = false,
|
|
1401
|
+
hidden
|
|
1400
1402
|
} = props;
|
|
1403
|
+
if (hidden) {
|
|
1404
|
+
return null;
|
|
1405
|
+
}
|
|
1401
1406
|
let additionalProps = {};
|
|
1402
1407
|
if (keepOpen) {
|
|
1403
1408
|
additionalProps = {
|
|
@@ -1436,7 +1441,7 @@ const Menu = (props) => {
|
|
|
1436
1441
|
{
|
|
1437
1442
|
className: "!es-uic-p-0 focus:es-uic-outline-none",
|
|
1438
1443
|
"aria-label": ariaLabel,
|
|
1439
|
-
wrapperClassName:
|
|
1444
|
+
wrapperClassName: clsx(!hasSubmenuItems && "es-uic-overflow-y-auto"),
|
|
1440
1445
|
...popoverProps,
|
|
1441
1446
|
children: /* @__PURE__ */ jsx(
|
|
1442
1447
|
$3674c52c6b3c5bce$export$d9b273488cd8ce6f,
|
|
@@ -1474,7 +1479,7 @@ const MenuSection = (props) => {
|
|
|
1474
1479
|
return /* @__PURE__ */ jsxs(
|
|
1475
1480
|
$7135fc7d473fd974$export$6e2c8f0811a474ce,
|
|
1476
1481
|
{
|
|
1477
|
-
className:
|
|
1482
|
+
className: clsx(
|
|
1478
1483
|
"es-uic-space-y-1 es-uic-border-b es-uic-pb-1 last:es-uic-border-b-0",
|
|
1479
1484
|
label && "es-uic-pt-2 first:es-uic-pt-1.5",
|
|
1480
1485
|
!label && "last:es-uic-pb-1"
|
|
@@ -1537,7 +1542,7 @@ const MenuItem = (props) => {
|
|
|
1537
1542
|
...props,
|
|
1538
1543
|
"aria-label": ariaLabel,
|
|
1539
1544
|
isDisabled: disabled,
|
|
1540
|
-
className:
|
|
1545
|
+
className: clsx(
|
|
1541
1546
|
"es-uic-mx-1 es-uic-mb-1 es-uic-flex es-uic-min-w-40 es-uic-items-center es-uic-gap-1.5",
|
|
1542
1547
|
"first:es-uic-mt-1 [&>svg]:es-uic-size-5 [&>svg]:es-uic-text-gray-500",
|
|
1543
1548
|
"es-uic-select-none es-uic-rounded es-uic-border es-uic-border-transparent es-uic-px-1 es-uic-py-1.5 es-uic-text-sm es-uic-transition",
|
|
@@ -1554,7 +1559,7 @@ const MenuItem = (props) => {
|
|
|
1554
1559
|
icon,
|
|
1555
1560
|
children,
|
|
1556
1561
|
shortcut && /* @__PURE__ */ jsx("div", { className: "es-uic-ml-auto es-uic-text-[0.6875rem] es-uic-tracking-tight es-uic-text-gray-400", children: shortcut }),
|
|
1557
|
-
endIcon && /* @__PURE__ */ jsx("div", { className:
|
|
1562
|
+
endIcon && /* @__PURE__ */ jsx("div", { className: clsx(!shortcut && "es-uic-ml-auto"), children: endIcon })
|
|
1558
1563
|
]
|
|
1559
1564
|
}
|
|
1560
1565
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { c as clsx } from "../../lite-pbIeT7tm.js";
|
|
3
3
|
import { icons } from "../../icons/icons.js";
|
|
4
4
|
/**
|
|
5
5
|
* A simple notice component.
|
|
@@ -12,6 +12,7 @@ import { icons } from "../../icons/icons.js";
|
|
|
12
12
|
* @param {string} [props.className] - Classes to pass to the notice.
|
|
13
13
|
* @param {NoticeType} [props.type='default'] - The type of the notice.
|
|
14
14
|
* @param {boolean} [props.alignIconToTitle=false] - If `true`, the icon will be aligned to the first row of title, instead of vertically centered.
|
|
15
|
+
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
15
16
|
*
|
|
16
17
|
* @returns {JSX.Element} The Notice component.
|
|
17
18
|
*
|
|
@@ -23,7 +24,10 @@ import { icons } from "../../icons/icons.js";
|
|
|
23
24
|
* @preserve
|
|
24
25
|
*/
|
|
25
26
|
const Notice = (props) => {
|
|
26
|
-
const { icon, label, subtitle, className, type = "default", alignIconToTitle = false } = props;
|
|
27
|
+
const { icon, label, subtitle, className, type = "default", alignIconToTitle = false, hidden } = props;
|
|
28
|
+
if (hidden) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
27
31
|
const styles = {
|
|
28
32
|
info: {
|
|
29
33
|
icon: icons.infoCircle,
|
|
@@ -70,17 +74,17 @@ const Notice = (props) => {
|
|
|
70
74
|
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
|
|
71
75
|
"div",
|
|
72
76
|
{
|
|
73
|
-
className:
|
|
77
|
+
className: clsx(
|
|
74
78
|
"es-uic-grid es-uic-grid-cols-[auto,_1fr] es-uic-grid-rows-[auto,_auto] es-uic-rounded-md es-uic-border es-uic-bg-gradient-to-tr es-uic-shadow-sm",
|
|
75
79
|
styles[type].className,
|
|
76
|
-
icon || styles[type].icon ? "es-uic-gap-x-1.5 es-uic-p-1.5" : "es-uic-
|
|
80
|
+
icon || styles[type].icon ? "es-uic-gap-x-1.5 es-uic-p-1.5" : "es-uic-px-2 es-uic-py-1.5",
|
|
77
81
|
className
|
|
78
82
|
),
|
|
79
83
|
children: [
|
|
80
84
|
(icon || styles[type].icon) && /* @__PURE__ */ jsx(
|
|
81
85
|
"span",
|
|
82
86
|
{
|
|
83
|
-
className:
|
|
87
|
+
className: clsx(
|
|
84
88
|
"es-uic-col-span-1 es-uic-col-start-1 es-uic-row-span-2 es-uic-row-start-1 es-uic-shrink-0 es-uic-self-center [&>svg]:es-uic-size-7",
|
|
85
89
|
alignIconToTitle ? "es-uic-self-baseline" : "es-uic-self-center",
|
|
86
90
|
styles[type].iconColor
|
|
@@ -91,7 +95,7 @@ const Notice = (props) => {
|
|
|
91
95
|
label && /* @__PURE__ */ jsx(
|
|
92
96
|
"span",
|
|
93
97
|
{
|
|
94
|
-
className:
|
|
98
|
+
className: clsx(
|
|
95
99
|
"es-uic-col-span-2 es-uic-col-start-2 es-uic-text-balance es-uic-text-sm es-uic-leading-tight",
|
|
96
100
|
subtitle ? "es-uic-self-end" : "es-uic-row-span-2 es-uic-self-center",
|
|
97
101
|
styles[type].textColor
|
|
@@ -102,7 +106,7 @@ const Notice = (props) => {
|
|
|
102
106
|
subtitle && /* @__PURE__ */ jsx(
|
|
103
107
|
"span",
|
|
104
108
|
{
|
|
105
|
-
className:
|
|
109
|
+
className: clsx(
|
|
106
110
|
"es-uic-col-span-2 es-uic-col-start-2 es-uic-text-balance es-uic-text-xs es-uic-leading-tight",
|
|
107
111
|
styles[type].subtitleColor,
|
|
108
112
|
label ? "es-uic-self-start" : "es-uic-row-span-2 es-uic-self-center"
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React__default, { forwardRef, useRef, createContext, useState, cloneElement } from "react";
|
|
3
|
-
import { $ as $a049562f99e7db0e$export$f9c6924e160136d1, a as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4 } from "../../Group-
|
|
4
|
-
import { $ as $3985021b0ad6602f$export$37fb8590cf2c088c, a as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-
|
|
5
|
-
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-
|
|
6
|
-
import { $ as $d2b4bc8c273e7be6$export$24d547caef80ccd1
|
|
7
|
-
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, h as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, i as $64fa3d84918910a7$export$ef03459518577ad4, c as $64fa3d84918910a7$export$4d86445c2cf5e3, j as $64fa3d84918910a7$export$2881499e37b75b9a } from "../../utils-
|
|
8
|
-
import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-
|
|
3
|
+
import { $ as $a049562f99e7db0e$export$f9c6924e160136d1, a as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4 } from "../../Group-Dkdm2-E7.js";
|
|
4
|
+
import { $ as $3985021b0ad6602f$export$37fb8590cf2c088c, a as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-BJA4rmIo.js";
|
|
5
|
+
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-9x5iLJ-Y.js";
|
|
6
|
+
import { $ as $d2b4bc8c273e7be6$export$24d547caef80ccd1 } from "../../Button-eebLs4cp.js";
|
|
7
|
+
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, h as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, i as $64fa3d84918910a7$export$ef03459518577ad4, c as $64fa3d84918910a7$export$4d86445c2cf5e3, j as $64fa3d84918910a7$export$2881499e37b75b9a } from "../../utils-DIBzm1e4.js";
|
|
8
|
+
import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-ILxgMZy5.js";
|
|
9
9
|
import { $ as $d3e0e05bdfcf66bd$export$c24727297075ec6a } from "../../Form-Cq3fu75_.js";
|
|
10
|
-
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-
|
|
10
|
+
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-Cyxp9ewv.js";
|
|
11
11
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-DG2RfOUr.js";
|
|
12
|
-
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-
|
|
13
|
-
import { $ as $de67e98908f0c6ee$export$7f629e9dc1ecf37c, a as $81397a9303501bda$export$23f548e970bdf099 } from "../../useNumberFieldState-
|
|
12
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-BAcFg5GO.js";
|
|
13
|
+
import { $ as $de67e98908f0c6ee$export$7f629e9dc1ecf37c, a as $81397a9303501bda$export$23f548e970bdf099 } from "../../useNumberFieldState-ZH2Qyyxh.js";
|
|
14
|
+
import { B as Button } from "../../button-idVI4jmd.js";
|
|
14
15
|
import { icons } from "../../icons/icons.js";
|
|
15
|
-
import {
|
|
16
|
+
import { c as clsx } from "../../lite-pbIeT7tm.js";
|
|
16
17
|
import { BaseControl } from "../base-control/base-control.js";
|
|
17
18
|
const $b91743d66a0ed188$export$b414a48cf5dcbc11 = /* @__PURE__ */ createContext(null);
|
|
18
19
|
const $b91743d66a0ed188$export$6cc906c6cff9bec5 = /* @__PURE__ */ createContext(null);
|
|
@@ -129,6 +130,7 @@ const $b91743d66a0ed188$export$63c5fa0b2fdccd2e = /* @__PURE__ */ forwardRef($b9
|
|
|
129
130
|
* @param {boolean} [props.inline] - If `true`, the number picker is displayed inline.
|
|
130
131
|
* @param {boolean} [props.noScrollToChange=false] - If `true`, the number picker does not change value when scrolling.
|
|
131
132
|
* @param {NumberPickerSize} [props.size='default'] - Determines the input field size.
|
|
133
|
+
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
132
134
|
*
|
|
133
135
|
* @returns {JSX.Element} The NumberPicker component.
|
|
134
136
|
*
|
|
@@ -162,10 +164,14 @@ const NumberPicker = ({
|
|
|
162
164
|
inline,
|
|
163
165
|
noScrollToChange = false,
|
|
164
166
|
size = "default",
|
|
167
|
+
hidden,
|
|
165
168
|
...props
|
|
166
169
|
}) => {
|
|
167
170
|
var _a, _b, _c, _d;
|
|
168
171
|
const [isInputFocused, setIsInputFocused] = useState(false);
|
|
172
|
+
if (hidden) {
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
169
175
|
const sizes = {
|
|
170
176
|
compact: {
|
|
171
177
|
field: "es-uic-min-h-5",
|
|
@@ -205,7 +211,7 @@ const NumberPicker = ({
|
|
|
205
211
|
children: /* @__PURE__ */ jsxs(
|
|
206
212
|
$a049562f99e7db0e$export$eb2fcfdbd7ba97d4,
|
|
207
213
|
{
|
|
208
|
-
className:
|
|
214
|
+
className: clsx(
|
|
209
215
|
"es-uic-flex es-uic-w-fit es-uic-items-center es-uic-rounded-md es-uic-border es-uic-border-gray-300 es-uic-pl-1 es-uic-pr-0.5 es-uic-shadow-sm es-uic-transition",
|
|
210
216
|
isInputFocused && "es-uic-outline-none focus-visible:es-uic-ring focus-visible:es-uic-ring-teal-500 focus-visible:es-uic-ring-opacity-50",
|
|
211
217
|
!prefix && (((_a = sizes == null ? void 0 : sizes[size]) == null ? void 0 : _a.noPrefixPadding) ?? sizes.default.noPrefixPadding),
|
|
@@ -216,7 +222,7 @@ const NumberPicker = ({
|
|
|
216
222
|
"span",
|
|
217
223
|
{
|
|
218
224
|
slot: "prefix",
|
|
219
|
-
className: "es-uic-col-start-1 es-uic-row-span-2 es-uic-mr-0.5 es-uic-select-none es-uic-self-center es-uic-text-gray-500",
|
|
225
|
+
className: "es-uic-col-start-1 es-uic-row-span-2 es-uic-mr-0.5 es-uic-select-none es-uic-self-center es-uic-text-gray-500 es-uic-text-xs",
|
|
220
226
|
children: prefix
|
|
221
227
|
}
|
|
222
228
|
),
|
|
@@ -236,7 +242,7 @@ const NumberPicker = ({
|
|
|
236
242
|
"span",
|
|
237
243
|
{
|
|
238
244
|
slot: "suffix",
|
|
239
|
-
className: "es-uic-col-start-3 es-uic-row-span-2 es-uic-select-none es-uic-self-center es-uic-text-gray-500",
|
|
245
|
+
className: "es-uic-col-start-3 es-uic-row-span-2 es-uic-select-none es-uic-self-center es-uic-text-gray-500 es-uic-text-xs",
|
|
240
246
|
children: suffix
|
|
241
247
|
}
|
|
242
248
|
),
|