@eightshift/ui-components 1.9.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -7
- package/dist/{Button-BMFbEXg1.js → Button-OQ5EIPvt.js} +8 -8
- package/dist/{SelectionManager-D-89MUJW.js → Collection-CJM_asJz.js} +345 -197
- package/dist/{Color-B-cqXgPz.js → Color-B0HgM8f4.js} +1 -1
- package/dist/{ColorSwatch-B6s54Jb3.js → ColorSwatch-Dv3Wxdl_.js} +6 -7
- package/dist/{ComboBox-VR9-vNZv.js → ComboBox-BnlZjJ3T.js} +21 -22
- package/dist/{Dialog-BlYTPzgB.js → Dialog-CIh-hX93.js} +77 -65
- package/dist/{FieldError-DKicm3R0.js → FieldError-D7A6s7O5.js} +2 -2
- package/dist/{FocusScope-EoLYfbMp.js → FocusScope-Cs5_OoeA.js} +6 -4
- package/dist/{Group-D96edUPC.js → Group-D6tr3U_n.js} +5 -6
- package/dist/{Heading-GytTjUsy.js → Heading-DiYTXoIW.js} +3 -4
- package/dist/{Hidden-D3hHnmPI.js → Hidden-DnOd_jPX.js} +2 -2
- package/dist/{Input-BXSxJ_44.js → Input-Se0m3ubj.js} +13 -11
- package/dist/{Label-BtoiUpt8.js → Label-Ca9uelsn.js} +4 -5
- package/dist/{List-Ct3nzFZG.js → List-Br274SP1.js} +16 -8
- package/dist/{ListBox-BMpo-Cem.js → ListBox-D9dFEh5A.js} +36 -23
- package/dist/{OverlayArrow-4epQ99-E.js → OverlayArrow-1jx-ZyCR.js} +75 -13
- package/dist/{Select-aab027f3.esm-C7BxKjSc.js → Select-aab027f3.esm-HFNIFFya.js} +4 -4
- package/dist/{Separator-DUhFmbD-.js → Separator-BhZycTUp.js} +9 -7
- package/dist/{Slider-QNPrj4N9.js → Slider-BZNaJylD.js} +20 -24
- package/dist/{Text-DNDWaukZ.js → Text-aOUPPvTO.js} +3 -4
- package/dist/{VisuallyHidden-BHNhi-ls.js → VisuallyHidden-ClTQo25k.js} +2 -2
- package/dist/assets/index.css +37 -0
- package/dist/assets/style-editor.css +5287 -0
- package/dist/assets/style.css +5293 -1
- package/dist/assets/wp-font-enhancements.css +8 -1
- package/dist/assets/wp-ui-enhancements.css +299 -1
- package/dist/components/animated-visibility/animated-visibility.js +17 -21
- package/dist/components/base-control/base-control.js +7 -7
- package/dist/components/breakpoint-preview/breakpoint-preview.js +50 -50
- package/dist/components/button/button.js +190 -86
- package/dist/components/checkbox/checkbox.js +44 -27
- package/dist/components/color-pickers/color-picker.js +13 -9
- package/dist/components/color-pickers/color-swatch.js +4 -4
- package/dist/components/color-pickers/gradient-editor.js +25 -24
- package/dist/components/color-pickers/solid-color-picker.js +197 -229
- package/dist/components/component-toggle/component-toggle.js +3 -3
- package/dist/components/container-panel/container-panel.js +17 -17
- package/dist/components/draggable/draggable-handle.js +6 -6
- package/dist/components/draggable/draggable.js +1414 -699
- package/dist/components/draggable-list/draggable-list-item.js +3 -3
- package/dist/components/draggable-list/draggable-list.js +12 -12
- package/dist/components/expandable/expandable.js +66 -78
- package/dist/components/index.js +2 -3
- package/dist/components/input-field/input-field.js +35 -22
- package/dist/components/layout/hstack.js +1 -1
- package/dist/components/layout/vstack.js +1 -1
- package/dist/components/link-input/link-input.js +69 -57
- package/dist/components/matrix-align/matrix-align.js +34 -86
- package/dist/components/menu/menu.js +22 -23
- package/dist/components/modal/modal.js +24 -25
- package/dist/components/notice/notice.js +32 -32
- package/dist/components/number-picker/number-picker.js +41 -40
- package/dist/components/option-select/option-select.js +9 -4
- package/dist/components/options-panel/options-panel.js +63 -28
- package/dist/components/placeholders/file-placeholder.js +6 -17
- package/dist/components/placeholders/image-placeholder.js +17 -17
- package/dist/components/placeholders/media-placeholder.js +12 -12
- package/dist/components/popover/popover.js +6 -5
- package/dist/components/radio/radio.js +60 -43
- package/dist/components/repeater/repeater-item.js +10 -10
- package/dist/components/repeater/repeater.js +8 -8
- package/dist/components/responsive/mini-responsive.js +41 -41
- package/dist/components/responsive/responsive-legacy.js +33 -33
- package/dist/components/responsive/responsive.js +48 -48
- package/dist/components/responsive-preview/responsive-preview.js +4 -4
- package/dist/components/rich-label/rich-label.js +13 -11
- package/dist/components/select/async-multi-select.js +3 -3
- package/dist/components/select/async-single-select.js +2 -2
- package/dist/components/select/custom-select-default-components.js +3 -3
- package/dist/components/select/multi-select-components.js +1 -1
- package/dist/components/select/multi-select.js +3 -3
- package/dist/components/select/react-select-component-wrappers.js +1 -1
- package/dist/components/select/single-select.js +2 -2
- package/dist/components/select/styles.js +21 -21
- package/dist/components/select/v2/async-select.js +37 -47
- package/dist/components/select/v2/shared.js +8 -8
- package/dist/components/select/v2/single-select.js +44 -48
- package/dist/components/slider/column-config-slider.js +25 -25
- package/dist/components/slider/slider.js +173 -182
- package/dist/components/spacer/spacer.js +21 -21
- package/dist/components/tabs/tabs.js +111 -63
- package/dist/components/toggle/switch.js +27 -21
- package/dist/components/toggle/toggle.js +1 -1
- package/dist/components/toggle-button/toggle-button.js +160 -83
- package/dist/components/tooltip/tooltip.js +25 -28
- package/dist/{context-KeRYAbEi.js → context-CDOs-GuR.js} +1 -1
- package/dist/{focusSafely-CZY36ssv.js → focusSafely-CiqTTjWy.js} +18 -17
- package/dist/icons/icons.js +52 -0
- package/dist/{index-641ee5b8.esm-DEB-c58F.js → index-641ee5b8.esm-DbdaYaxR.js} +45 -45
- package/dist/index-BRp93Yfa.js +28318 -0
- package/dist/index-CcCn9HWX.js +44 -0
- package/dist/index.js +2 -3
- package/dist/{multi-select-components-DM3GsNfb.js → multi-select-components-CkF3LyTF.js} +4 -4
- package/dist/{react-select-async.esm-Bq3N1-Wi.js → react-select-async.esm-DcVLw9X5.js} +3 -3
- package/dist/{react-select.esm-B38nY7_U.js → react-select.esm-OZ0cmTjg.js} +3 -3
- package/dist/style-editor.js +1 -0
- package/dist/style.js +1 -1
- package/dist/{textSelection-G2G-nukT.js → textSelection-BlTDSskG.js} +2 -2
- package/dist/{useButton-CFtcz1T6.js → useButton-CmLbE5vg.js} +3 -3
- package/dist/{useEvent-B0yfN_Zu.js → useEvent-cLDJlznQ.js} +1 -1
- package/dist/{useFocusRing-DMAlRYjX.js → useFocusRing-CGp3guTX.js} +1 -1
- package/dist/{useFocusable-BlkOMLma.js → useFocusable-087cO5Ct.js} +9 -6
- package/dist/{useFormReset-BAEM0o25.js → useFormReset-NpLM2e3G.js} +1 -1
- package/dist/{useFormValidation-BNzOc2t9.js → useFormValidation-BWwmZQE2.js} +3 -3
- package/dist/{useLabel-D6FSp5_M.js → useLabel-C85N3Hzw.js} +2 -2
- package/dist/{useLabels-CraZ2Sej.js → useLabels-C_2wWraB.js} +1 -1
- package/dist/{useListState-C3dnPq2F.js → useListState-Z7FB_NzO.js} +1 -1
- package/dist/{useLocalizedStringFormatter-B73fhEA7.js → useLocalizedStringFormatter-BQ4TF72x.js} +1 -1
- package/dist/{useNumberField-CQP9-nH5.js → useNumberField-Bm6_BVl9.js} +10 -10
- package/dist/{useNumberFormatter-Cdctl6fg.js → useNumberFormatter-DlUVKkO7.js} +1 -1
- package/dist/{usePress-xTkcGUkt.js → usePress-rg_OQIGW.js} +15 -14
- package/dist/{useSingleSelectListState-BGXQSTy7.js → useSingleSelectListState-Cu3xtEJS.js} +2 -2
- package/dist/{useToggle-Dpw3WpSw.js → useToggle-DzlgBLAJ.js} +4 -4
- package/dist/{useToggleState-BSKwCUIW.js → useToggleState-DhSBQxkp.js} +1 -1
- package/dist/{utils-BSLBwuuO.js → utils-39D0mStj.js} +41 -93
- package/package.json +43 -41
- package/dist/GeistMonoVF.woff2 +0 -0
- package/dist/GeistVF.woff2 +0 -0
- package/dist/assets/fonts.css +0 -1
- package/dist/components/list-box/list-box.js +0 -157
- package/dist/fonts.js +0 -1
- package/dist/index-BYHhzLf-.js +0 -444
|
@@ -31,13 +31,13 @@ const DraggableListItem = (props) => {
|
|
|
31
31
|
icon,
|
|
32
32
|
label,
|
|
33
33
|
subtitle,
|
|
34
|
-
className: clsx("es
|
|
34
|
+
className: clsx("es:w-full", className),
|
|
35
35
|
fullWidthLabel: true,
|
|
36
36
|
inline: true,
|
|
37
37
|
...rest,
|
|
38
38
|
children: [
|
|
39
39
|
cloneElement(icons.reorderGrabberV, {
|
|
40
|
-
className: "es
|
|
40
|
+
className: "es:opacity-0 es:transition-opacity es:group-focus-visible:opacity-100 es:text-secondary-400 es:size-4 es:group-hover:opacity-100"
|
|
41
41
|
}),
|
|
42
42
|
children
|
|
43
43
|
]
|
|
@@ -63,7 +63,7 @@ const DraggableListItemHandle = (props) => {
|
|
|
63
63
|
return /* @__PURE__ */ jsx(
|
|
64
64
|
"button",
|
|
65
65
|
{
|
|
66
|
-
className: className ?? 'es
|
|
66
|
+
className: className ?? 'es:relative es:h-6 es:w-2 es:cursor-pointer es:items-center es:justify-center es:self-center es:rounded es:border es:border-secondary-300 es:bg-secondary-50 es:transition es:after:absolute es:after:inset-0 es:after:m-auto es:after:h-4 es:after:w-px es:after:bg-secondary-200 es:after:transition es:after:content-[""] es:hover:border-accent-500 es:hover:bg-accent-400 es:hover:after:bg-accent-500',
|
|
67
67
|
...rest,
|
|
68
68
|
"data-movable-handle": true,
|
|
69
69
|
tabIndex: -1,
|
|
@@ -3,7 +3,7 @@ import { useId } from "react";
|
|
|
3
3
|
import { _ as __ } from "../../default-i18n-CM1-Xvzf.js";
|
|
4
4
|
import { BaseControl } from "../base-control/base-control.js";
|
|
5
5
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
6
|
-
import { L as List, a as arrayRemove, b as arrayMove } from "../../List-
|
|
6
|
+
import { L as List, a as arrayRemove, b as arrayMove } from "../../List-Br274SP1.js";
|
|
7
7
|
const fixIds = (items, itemIdBase) => {
|
|
8
8
|
return items == null ? void 0 : items.map((item, i) => ({
|
|
9
9
|
...item,
|
|
@@ -87,7 +87,7 @@ const DraggableList = (props) => {
|
|
|
87
87
|
subtitle,
|
|
88
88
|
help,
|
|
89
89
|
actions,
|
|
90
|
-
className: "es
|
|
90
|
+
className: "es:w-full",
|
|
91
91
|
...rest,
|
|
92
92
|
children: /* @__PURE__ */ jsx(
|
|
93
93
|
List,
|
|
@@ -99,7 +99,7 @@ const DraggableList = (props) => {
|
|
|
99
99
|
return /* @__PURE__ */ jsx(
|
|
100
100
|
"ul",
|
|
101
101
|
{
|
|
102
|
-
className: "es
|
|
102
|
+
className: "es:w-full es:list-none",
|
|
103
103
|
...rest2,
|
|
104
104
|
children: children2
|
|
105
105
|
},
|
|
@@ -112,15 +112,15 @@ const DraggableList = (props) => {
|
|
|
112
112
|
"li",
|
|
113
113
|
{
|
|
114
114
|
className: clsx(
|
|
115
|
-
"es
|
|
116
|
-
"es
|
|
117
|
-
"es
|
|
118
|
-
"es
|
|
119
|
-
"focus:
|
|
120
|
-
isDisabled && "es
|
|
121
|
-
isDragged && "es
|
|
122
|
-
isSelected && "es
|
|
123
|
-
isDragged ? "es
|
|
115
|
+
"es:group",
|
|
116
|
+
"es:min-h-8 es:w-full",
|
|
117
|
+
"es:flex es:items-center es:gap-1 es:rounded-lg",
|
|
118
|
+
"es:transition-[box-shadow,background-color,filter,opacity,border-color]",
|
|
119
|
+
"es:focus:outline-hidden es:focus-visible:ring es:focus-visible:ring-accent-500/50",
|
|
120
|
+
isDisabled && "es:grayscale",
|
|
121
|
+
isDragged && "es:bg-white es:opacity-50",
|
|
122
|
+
isSelected && "es:bg-accent-50",
|
|
123
|
+
isDragged ? "es:cursor-grabbing" : "es:cursor-grab"
|
|
124
124
|
),
|
|
125
125
|
...rest2,
|
|
126
126
|
children: children({
|
|
@@ -6,14 +6,14 @@ import { Button } from "../button/button.js";
|
|
|
6
6
|
import { icons } from "../../icons/icons.js";
|
|
7
7
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
8
8
|
import { _ as __ } from "../../default-i18n-CM1-Xvzf.js";
|
|
9
|
-
import { a as $d2b4bc8c273e7be6$export$24d547caef80ccd1 } from "../../Button-
|
|
10
|
-
import { f as $bdb11010cef70236$export$f680877a34711e37, e as $b5e257d569688ac6$export$535bd6ca7f90a273, l as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, a as $64fa3d84918910a7$export$29f1550f4b0d4415, b as $64fa3d84918910a7$export$4d86445c2cf5e3, j as $64fa3d84918910a7$export$2881499e37b75b9a, o as $64fa3d84918910a7$export$c62b8e45d58ddad9, n as $5dc95899b306f630$export$c9058316764c140e, d as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "../../utils-
|
|
11
|
-
import { r as reactDomExports } from "../../index-
|
|
12
|
-
import { $ as $e9faafb641e167db$export$90fc3a17d93f704c } from "../../useEvent-
|
|
13
|
-
import { e as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "../../focusSafely-
|
|
9
|
+
import { a as $d2b4bc8c273e7be6$export$24d547caef80ccd1 } from "../../Button-OQ5EIPvt.js";
|
|
10
|
+
import { f as $bdb11010cef70236$export$f680877a34711e37, e as $b5e257d569688ac6$export$535bd6ca7f90a273, l as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, a as $64fa3d84918910a7$export$29f1550f4b0d4415, b as $64fa3d84918910a7$export$4d86445c2cf5e3, j as $64fa3d84918910a7$export$2881499e37b75b9a, o as $64fa3d84918910a7$export$c62b8e45d58ddad9, n as $5dc95899b306f630$export$c9058316764c140e, d as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "../../utils-39D0mStj.js";
|
|
11
|
+
import { r as reactDomExports } from "../../index-BRp93Yfa.js";
|
|
12
|
+
import { $ as $e9faafb641e167db$export$90fc3a17d93f704c } from "../../useEvent-cLDJlznQ.js";
|
|
13
|
+
import { e as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "../../focusSafely-CiqTTjWy.js";
|
|
14
14
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-EDDcM64A.js";
|
|
15
|
-
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-
|
|
16
|
-
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-
|
|
15
|
+
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-CGp3guTX.js";
|
|
16
|
+
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-Ca9uelsn.js";
|
|
17
17
|
function $5e910fae8e128ead$export$6e3e27031a30522f(props, state, ref) {
|
|
18
18
|
let { isDisabled } = props;
|
|
19
19
|
let triggerId = $bdb11010cef70236$export$f680877a34711e37();
|
|
@@ -103,7 +103,7 @@ const $28f4fd908f0de97f$export$1d40e3e0cc4d5de = /* @__PURE__ */ createContext(n
|
|
|
103
103
|
const $28f4fd908f0de97f$export$d665dd135a51b28a = /* @__PURE__ */ createContext(null);
|
|
104
104
|
const $28f4fd908f0de97f$export$dab3ea4a6ef094da = /* @__PURE__ */ createContext(null);
|
|
105
105
|
const $28f4fd908f0de97f$var$InternalDisclosureContext = /* @__PURE__ */ createContext(null);
|
|
106
|
-
|
|
106
|
+
const $28f4fd908f0de97f$export$74a362b31437ec83 = /* @__PURE__ */ forwardRef(function Disclosure(props, ref) {
|
|
107
107
|
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $28f4fd908f0de97f$export$d665dd135a51b28a);
|
|
108
108
|
let groupState = useContext($28f4fd908f0de97f$export$1d40e3e0cc4d5de);
|
|
109
109
|
let { id, ...otherProps } = props;
|
|
@@ -173,8 +173,8 @@ function $28f4fd908f0de97f$var$Disclosure(props, ref) {
|
|
|
173
173
|
...focusWithinProps,
|
|
174
174
|
...renderProps
|
|
175
175
|
}, renderProps.children));
|
|
176
|
-
}
|
|
177
|
-
|
|
176
|
+
});
|
|
177
|
+
const $28f4fd908f0de97f$export$feabaa331e1d464c = /* @__PURE__ */ forwardRef(function DisclosurePanel(props, ref) {
|
|
178
178
|
let { role = "group" } = props;
|
|
179
179
|
let { panelProps, panelRef } = useContext($28f4fd908f0de97f$var$InternalDisclosureContext);
|
|
180
180
|
let { isFocusVisible: isFocusVisibleWithin, focusProps: focusWithinProps } = $f7dceffc5ad7768b$export$4e328f61c538687f({
|
|
@@ -203,9 +203,7 @@ function $28f4fd908f0de97f$var$DisclosurePanel(props, ref) {
|
|
|
203
203
|
]
|
|
204
204
|
]
|
|
205
205
|
}, props.children));
|
|
206
|
-
}
|
|
207
|
-
const $28f4fd908f0de97f$export$74a362b31437ec83 = /* @__PURE__ */ forwardRef($28f4fd908f0de97f$var$Disclosure);
|
|
208
|
-
const $28f4fd908f0de97f$export$feabaa331e1d464c = /* @__PURE__ */ forwardRef($28f4fd908f0de97f$var$DisclosurePanel);
|
|
206
|
+
});
|
|
209
207
|
/**
|
|
210
208
|
* A component that allows hiding content in an expandable panel, to declutter the UI.
|
|
211
209
|
*
|
|
@@ -274,78 +272,68 @@ const Expandable = (props) => {
|
|
|
274
272
|
onOpenChange(!isOpen);
|
|
275
273
|
}
|
|
276
274
|
},
|
|
277
|
-
className: clsx(
|
|
278
|
-
"es-uic-w-full es-uic-rounded-lg es-uic-border es-uic-border-gray-300/0 es-uic-text-sm es-uic-transition",
|
|
279
|
-
isOpen && "es-uic-border-gray-300/100 es-uic-shadow-lg",
|
|
280
|
-
className
|
|
281
|
-
),
|
|
275
|
+
className: clsx("es:w-full es:rounded-xl es:border es:border-secondary-300/0 es:text-sm es:transition", isOpen && "es:border-secondary-300/100 es:shadow-lg", className),
|
|
282
276
|
...other,
|
|
283
277
|
children: [
|
|
284
|
-
/* @__PURE__ */ jsxs(
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
278
|
+
/* @__PURE__ */ jsxs("div", { className: clsx("es:flex es:h-10 es:items-center es:gap-1 es:transition-[padding]", isOpen && "es:py-1 es:pl-2 es:pr-1", headerClassName), children: [
|
|
279
|
+
/* @__PURE__ */ jsx(
|
|
280
|
+
RichLabel,
|
|
281
|
+
{
|
|
282
|
+
icon,
|
|
283
|
+
label,
|
|
284
|
+
subtitle,
|
|
285
|
+
className: labelClassName,
|
|
286
|
+
as: $01b77f81d0f07f68$export$b04be29aa201d4f5,
|
|
287
|
+
fullWidth: true
|
|
288
|
+
}
|
|
289
|
+
),
|
|
290
|
+
actions && !keepActionsOnExpand && /* @__PURE__ */ jsx(
|
|
291
|
+
AnimatedVisibility,
|
|
292
|
+
{
|
|
293
|
+
visible: !isOpen,
|
|
294
|
+
className: "es:ml-auto es:flex es:gap-2",
|
|
295
|
+
transition: "slideFadeDownSlight",
|
|
296
|
+
noInitial: true,
|
|
297
|
+
children: actions
|
|
298
|
+
}
|
|
299
|
+
),
|
|
300
|
+
actions && keepActionsOnExpand && /* @__PURE__ */ jsx("div", { className: "es:ml-auto es:flex es:gap-2", children: actions }),
|
|
301
|
+
customOpenButton && customOpenButton({
|
|
302
|
+
open: isOpen,
|
|
303
|
+
toggleOpen: () => {
|
|
304
|
+
setIsOpen(!isOpen);
|
|
305
|
+
if (onOpenChange) {
|
|
306
|
+
onOpenChange(!isOpen);
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
tooltip: isOpen ? __("Close", "eightshift-ui-components") : __("Open", "eightshift-ui-components"),
|
|
310
|
+
disabled
|
|
311
|
+
}),
|
|
312
|
+
!customOpenButton && /* @__PURE__ */ jsx(
|
|
313
|
+
Button,
|
|
314
|
+
{
|
|
315
|
+
slot: "trigger",
|
|
316
|
+
type: "ghost",
|
|
317
|
+
icon: isOpen ? icons.caretDownFill : icons.caretDown,
|
|
318
|
+
onPress: () => {
|
|
319
|
+
setIsOpen(!isOpen);
|
|
320
|
+
if (onOpenChange) {
|
|
321
|
+
onOpenChange(!isOpen);
|
|
298
322
|
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
children: actions
|
|
308
|
-
}
|
|
309
|
-
),
|
|
310
|
-
actions && keepActionsOnExpand && /* @__PURE__ */ jsx("div", { className: "es-uic-ml-auto es-uic-flex es-uic-gap-2", children: actions }),
|
|
311
|
-
customOpenButton && customOpenButton({
|
|
312
|
-
open: isOpen,
|
|
313
|
-
toggleOpen: () => {
|
|
314
|
-
setIsOpen(!isOpen);
|
|
315
|
-
if (onOpenChange) {
|
|
316
|
-
onOpenChange(!isOpen);
|
|
317
|
-
}
|
|
318
|
-
},
|
|
319
|
-
tooltip: isOpen ? __("Close", "eightshift-ui-components") : __("Open", "eightshift-ui-components"),
|
|
320
|
-
disabled
|
|
321
|
-
}),
|
|
322
|
-
!customOpenButton && /* @__PURE__ */ jsx(
|
|
323
|
-
Button,
|
|
324
|
-
{
|
|
325
|
-
slot: "trigger",
|
|
326
|
-
type: "ghost",
|
|
327
|
-
icon: isOpen ? icons.caretDownFill : icons.caretDown,
|
|
328
|
-
onPress: () => {
|
|
329
|
-
setIsOpen(!isOpen);
|
|
330
|
-
if (onOpenChange) {
|
|
331
|
-
onOpenChange(!isOpen);
|
|
332
|
-
}
|
|
333
|
-
},
|
|
334
|
-
tooltip: isOpen ? __("Close", "eightshift-ui-components") : __("Open", "eightshift-ui-components"),
|
|
335
|
-
disabled,
|
|
336
|
-
className: clsx("[&>svg]:es-uic-size-5 [&>svg]:es-uic-transition-transform", isOpen && "[&>svg]:-es-uic-scale-y-100"),
|
|
337
|
-
size: "small"
|
|
338
|
-
}
|
|
339
|
-
)
|
|
340
|
-
]
|
|
341
|
-
}
|
|
342
|
-
),
|
|
323
|
+
},
|
|
324
|
+
tooltip: isOpen ? __("Close", "eightshift-ui-components") : __("Open", "eightshift-ui-components"),
|
|
325
|
+
disabled,
|
|
326
|
+
className: clsx("es:icon:size-5 es:icon:transition-transform", isOpen && "es:icon:-scale-y-100"),
|
|
327
|
+
size: "small"
|
|
328
|
+
}
|
|
329
|
+
)
|
|
330
|
+
] }),
|
|
343
331
|
/* @__PURE__ */ jsx(
|
|
344
332
|
$28f4fd908f0de97f$export$feabaa331e1d464c,
|
|
345
333
|
{
|
|
346
334
|
className: clsx(
|
|
347
|
-
isOpen && "es
|
|
348
|
-
isOpen && "es-
|
|
335
|
+
isOpen && "es:space-y-2.5 es:border-t es:border-t-secondary-200 es:p-2",
|
|
336
|
+
isOpen && "es:motion-safe:motion-preset-slide-down-sm es:motion-safe:motion-ease-spring-smooth es:motion-safe:motion-ease-linear/opacity es:motion-safe:motion-duration-300 es:motion-reduce:motion-preset-fade-md",
|
|
349
337
|
contentClassName
|
|
350
338
|
),
|
|
351
339
|
children
|
package/dist/components/index.js
CHANGED
|
@@ -22,7 +22,6 @@ import { InputField } from "./input-field/input-field.js";
|
|
|
22
22
|
import { ImagePlaceholder } from "./placeholders/image-placeholder.js";
|
|
23
23
|
import { ItemCollection } from "./item-collection/item-collection.js";
|
|
24
24
|
import { LinkInput } from "./link-input/link-input.js";
|
|
25
|
-
import { ListBox } from "./list-box/list-box.js";
|
|
26
25
|
import { MatrixAlign } from "./matrix-align/matrix-align.js";
|
|
27
26
|
import { MediaPlaceholder } from "./placeholders/media-placeholder.js";
|
|
28
27
|
import { Menu, MenuItem, MenuSection, MenuSeparator, SubMenuItem } from "./menu/menu.js";
|
|
@@ -44,7 +43,7 @@ import { Modal } from "./modal/modal.js";
|
|
|
44
43
|
import { MultiSelect } from "./select/multi-select.js";
|
|
45
44
|
import { RSClearIndicator, RSDropdownIndicator, RSMultiValue, RSMultiValueContainer, RSMultiValueLabel, RSMultiValueRemove, RSOption, RSSingleValue } from "./select/react-select-component-wrappers.js";
|
|
46
45
|
import { OptionSelect } from "./option-select/option-select.js";
|
|
47
|
-
import { OptionsPanel, OptionsPanelHeader, OptionsPanelSection } from "./options-panel/options-panel.js";
|
|
46
|
+
import { OptionsPanel, OptionsPanelHeader, OptionsPanelIntro, OptionsPanelSection } from "./options-panel/options-panel.js";
|
|
48
47
|
import { Select } from "./select/single-select.js";
|
|
49
48
|
import { Slider } from "./slider/slider.js";
|
|
50
49
|
import { SolidColorPicker } from "./color-pickers/solid-color-picker.js";
|
|
@@ -85,7 +84,6 @@ export {
|
|
|
85
84
|
InputField,
|
|
86
85
|
ItemCollection,
|
|
87
86
|
LinkInput,
|
|
88
|
-
ListBox,
|
|
89
87
|
MatrixAlign,
|
|
90
88
|
MediaPlaceholder,
|
|
91
89
|
Menu,
|
|
@@ -100,6 +98,7 @@ export {
|
|
|
100
98
|
OptionSelect,
|
|
101
99
|
OptionsPanel,
|
|
102
100
|
OptionsPanelHeader,
|
|
101
|
+
OptionsPanelIntro,
|
|
103
102
|
OptionsPanelSection,
|
|
104
103
|
Popover,
|
|
105
104
|
RSClearIndicator,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-
|
|
4
|
-
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415, b as $64fa3d84918910a7$export$4d86445c2cf5e3, d as $3ef42575df84b30b$export$9d1611c77c2fe928, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, h as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, i as $64fa3d84918910a7$export$ef03459518577ad4, j as $64fa3d84918910a7$export$2881499e37b75b9a } from "../../utils-
|
|
2
|
+
import { a as $3985021b0ad6602f$export$37fb8590cf2c088c, b as $2d73ec29415bd339$export$712718f7aec83d5, $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-Se0m3ubj.js";
|
|
3
|
+
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-Ca9uelsn.js";
|
|
4
|
+
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415, b as $64fa3d84918910a7$export$4d86445c2cf5e3, d as $3ef42575df84b30b$export$9d1611c77c2fe928, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, h as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, i as $64fa3d84918910a7$export$ef03459518577ad4, j as $64fa3d84918910a7$export$2881499e37b75b9a } from "../../utils-39D0mStj.js";
|
|
5
5
|
import React__default, { forwardRef, createContext, useRef, useState, useCallback } from "react";
|
|
6
|
-
import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../focusSafely-
|
|
7
|
-
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-
|
|
8
|
-
import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-
|
|
6
|
+
import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../focusSafely-CiqTTjWy.js";
|
|
7
|
+
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-CGp3guTX.js";
|
|
8
|
+
import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-D7A6s7O5.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-aOUPPvTO.js";
|
|
11
11
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-EDDcM64A.js";
|
|
12
12
|
import { BaseControl } from "../base-control/base-control.js";
|
|
13
13
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
@@ -16,7 +16,7 @@ let $216918bed6669f72$var$filterHoverProps = (props) => {
|
|
|
16
16
|
let { onHoverStart, onHoverChange, onHoverEnd, ...otherProps } = props;
|
|
17
17
|
return otherProps;
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
const $216918bed6669f72$export$f5c9f3c2c4054eec = /* @__PURE__ */ forwardRef(function TextArea(props, ref) {
|
|
20
20
|
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $216918bed6669f72$export$2dc6166a7e65358c);
|
|
21
21
|
let { hoverProps, isHovered } = $6179b936705e76d3$export$ae780daf29e6d456(props);
|
|
22
22
|
let { isFocused, isFocusVisible, focusProps } = $f7dceffc5ad7768b$export$4e328f61c538687f({
|
|
@@ -45,15 +45,15 @@ function $216918bed6669f72$var$TextArea(props, ref) {
|
|
|
45
45
|
"data-focus-visible": isFocusVisible || void 0,
|
|
46
46
|
"data-invalid": isInvalid || void 0
|
|
47
47
|
});
|
|
48
|
-
}
|
|
49
|
-
const $216918bed6669f72$export$f5c9f3c2c4054eec = /* @__PURE__ */ forwardRef($216918bed6669f72$var$TextArea);
|
|
48
|
+
});
|
|
50
49
|
const $bcdf0525bf22703d$export$2129e27b3ef0d483 = /* @__PURE__ */ createContext(null);
|
|
51
|
-
|
|
50
|
+
const $bcdf0525bf22703d$export$2c73285ae9390cec = /* @__PURE__ */ forwardRef(function TextField(props, ref) {
|
|
52
51
|
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $bcdf0525bf22703d$export$2129e27b3ef0d483);
|
|
53
52
|
let { validationBehavior: formValidationBehavior } = $64fa3d84918910a7$export$fabf2dc03a41866e($d3e0e05bdfcf66bd$export$c24727297075ec6a) || {};
|
|
54
53
|
var _props_validationBehavior, _ref;
|
|
55
54
|
let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : "native";
|
|
56
55
|
let inputRef = useRef(null);
|
|
56
|
+
let [inputContextProps, mergedInputRef] = $64fa3d84918910a7$export$29f1550f4b0d4415({}, inputRef, $3985021b0ad6602f$export$37fb8590cf2c088c);
|
|
57
57
|
let [labelRef, label] = $64fa3d84918910a7$export$9d4c57ee4c6ffdd8();
|
|
58
58
|
let [inputElementType, setInputElementType] = useState("input");
|
|
59
59
|
let { labelProps, inputProps, descriptionProps, errorMessageProps, ...validation } = $2d73ec29415bd339$export$712718f7aec83d5({
|
|
@@ -61,11 +61,13 @@ function $bcdf0525bf22703d$var$TextField(props, ref) {
|
|
|
61
61
|
inputElementType,
|
|
62
62
|
label,
|
|
63
63
|
validationBehavior
|
|
64
|
-
},
|
|
64
|
+
}, mergedInputRef);
|
|
65
65
|
let inputOrTextAreaRef = useCallback((el) => {
|
|
66
|
-
|
|
66
|
+
mergedInputRef.current = el;
|
|
67
67
|
if (el) setInputElementType(el instanceof HTMLTextAreaElement ? "textarea" : "input");
|
|
68
|
-
}, [
|
|
68
|
+
}, [
|
|
69
|
+
mergedInputRef
|
|
70
|
+
]);
|
|
69
71
|
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
70
72
|
...props,
|
|
71
73
|
values: {
|
|
@@ -99,7 +101,7 @@ function $bcdf0525bf22703d$var$TextField(props, ref) {
|
|
|
99
101
|
[
|
|
100
102
|
$3985021b0ad6602f$export$37fb8590cf2c088c,
|
|
101
103
|
{
|
|
102
|
-
|
|
104
|
+
...$3ef42575df84b30b$export$9d1611c77c2fe928(inputProps, inputContextProps),
|
|
103
105
|
ref: inputOrTextAreaRef
|
|
104
106
|
}
|
|
105
107
|
],
|
|
@@ -125,8 +127,7 @@ function $bcdf0525bf22703d$var$TextField(props, ref) {
|
|
|
125
127
|
]
|
|
126
128
|
]
|
|
127
129
|
}, renderProps.children));
|
|
128
|
-
}
|
|
129
|
-
const $bcdf0525bf22703d$export$2c73285ae9390cec = /* @__PURE__ */ forwardRef($bcdf0525bf22703d$var$TextField);
|
|
130
|
+
});
|
|
130
131
|
/**
|
|
131
132
|
* An input field.
|
|
132
133
|
*
|
|
@@ -137,6 +138,7 @@ const $bcdf0525bf22703d$export$2c73285ae9390cec = /* @__PURE__ */ forwardRef($bc
|
|
|
137
138
|
* @param {string} [props.subtitle] - Subtitle to display.
|
|
138
139
|
* @param {string} [props.help] - Help text to display below the input.
|
|
139
140
|
* @param {JSX.Element|JSX.Element[]} [props.actions] - Actions to display to the right of the label.
|
|
141
|
+
* @param {boolean} [props.inline] - Whether the element menu is displayed inline with the label, to the right of it.
|
|
140
142
|
* @param {string} [props.value] - The current value of the input.
|
|
141
143
|
* @param {Function} [props.onChange] - Function to run when the input value changes.
|
|
142
144
|
* @param {InputType} [props.type='text'] - The input type. Renders a `<textarea>` instead of `<input>` if set to 'multiline'.
|
|
@@ -144,6 +146,7 @@ const $bcdf0525bf22703d$export$2c73285ae9390cec = /* @__PURE__ */ forwardRef($bc
|
|
|
144
146
|
* @param {boolean} [props.readOnly] - If `true`, the input is read-only.
|
|
145
147
|
* @param {string} [props.className] - Classes to pass to the input field.
|
|
146
148
|
* @param {string} [props.wrapperClassName] - Classes to pass to the input field wrapping element.
|
|
149
|
+
* @param {boolean} [props.monospaceFont] - If `true`, the input uses a monospace font. Useful for things like IDs to make them easier to read.
|
|
147
150
|
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
148
151
|
*
|
|
149
152
|
* @returns {JSX.Element} The InputField component.
|
|
@@ -160,7 +163,7 @@ const $bcdf0525bf22703d$export$2c73285ae9390cec = /* @__PURE__ */ forwardRef($bc
|
|
|
160
163
|
* @preserve
|
|
161
164
|
*/
|
|
162
165
|
const InputField = (props) => {
|
|
163
|
-
const { icon, label, subtitle, help, actions, value, onChange, type = "text", disabled, readOnly, className, wrapperClassName, hidden, ...other } = props;
|
|
166
|
+
const { icon, label, subtitle, help, actions, inline, value, onChange, type = "text", disabled, readOnly, className, wrapperClassName, hidden, monospaceFont, ...other } = props;
|
|
164
167
|
if (hidden) {
|
|
165
168
|
return null;
|
|
166
169
|
}
|
|
@@ -180,6 +183,7 @@ const InputField = (props) => {
|
|
|
180
183
|
label,
|
|
181
184
|
subtitle,
|
|
182
185
|
actions,
|
|
186
|
+
inline,
|
|
183
187
|
labelAs: $01b77f81d0f07f68$export$b04be29aa201d4f5,
|
|
184
188
|
help,
|
|
185
189
|
children: [
|
|
@@ -189,8 +193,13 @@ const InputField = (props) => {
|
|
|
189
193
|
...other,
|
|
190
194
|
type,
|
|
191
195
|
className: clsx(
|
|
192
|
-
"es
|
|
193
|
-
"
|
|
196
|
+
"es:min-h-10 es:w-full es:rounded-lg es:border es:border-secondary-300 es:p-2 es:text-sm es:shadow-xs es:transition es:selection:bg-accent-500/20 es:selection:text-accent-950",
|
|
197
|
+
"es:any-focus:outline-hidden",
|
|
198
|
+
"es:focus-visible:ring-2 es:focus-visible:ring-accent-500/50",
|
|
199
|
+
"es:focus-visible:border-accent-500",
|
|
200
|
+
"es:inset-ring es:inset-ring-secondary-100",
|
|
201
|
+
"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",
|
|
202
|
+
(monospaceFont || type === "password") && "es:font-mono",
|
|
194
203
|
className
|
|
195
204
|
)
|
|
196
205
|
}
|
|
@@ -200,8 +209,12 @@ const InputField = (props) => {
|
|
|
200
209
|
{
|
|
201
210
|
...other,
|
|
202
211
|
className: clsx(
|
|
203
|
-
"es
|
|
204
|
-
"
|
|
212
|
+
"es:min-h-10 es:w-full es:rounded-lg es:border es:border-secondary-300 es:p-2 es:text-sm es:shadow-xs es:transition es:selection:bg-accent-500/20 es:selection:text-accent-950",
|
|
213
|
+
"es:any-focus:outline-hidden",
|
|
214
|
+
"es:focus-visible:ring-2 es:focus-visible:ring-accent-500/50",
|
|
215
|
+
"es:focus-visible:border-accent-500",
|
|
216
|
+
"es:inset-ring es:inset-ring-secondary-100",
|
|
217
|
+
"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",
|
|
205
218
|
className
|
|
206
219
|
)
|
|
207
220
|
}
|
|
@@ -23,7 +23,7 @@ const HStack = (props) => {
|
|
|
23
23
|
if (hidden) {
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
26
|
-
return /* @__PURE__ */ jsx("div", { className: clsx("es
|
|
26
|
+
return /* @__PURE__ */ jsx("div", { className: clsx("es:flex es:items-center es:gap-x-1.5 es:gap-y-2", !noWrap && "es:flex-wrap", className), children });
|
|
27
27
|
};
|
|
28
28
|
export {
|
|
29
29
|
HStack
|
|
@@ -23,7 +23,7 @@ const VStack = (props) => {
|
|
|
23
23
|
if (hidden) {
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
26
|
-
return /* @__PURE__ */ jsx("div", { className: clsx("es
|
|
26
|
+
return /* @__PURE__ */ jsx("div", { className: clsx("es:flex es:flex-col es:gap-x-1.5 es:gap-y-1.5", !noWrap && "es:flex-wrap", className), children });
|
|
27
27
|
};
|
|
28
28
|
export {
|
|
29
29
|
VStack
|