@eightshift/ui-components 1.5.1 → 1.6.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/{Dialog-DSquJZb-.js → Dialog-BdtBguys.js} +1 -1
- package/dist/Heading-DGnF6JDc.js +17 -0
- package/dist/List-Bx2anbX-.js +583 -0
- package/dist/{RSPContexts-DQtGvvpM.js → RSPContexts-2lR5GG9p.js} +2 -2
- package/dist/{Select-49a62830.esm-D8voKavK.js → Select-c7902d94.esm-DtzFQzf-.js} +6 -4
- package/dist/assets/style.css +1 -1
- package/dist/assets/wp-ui-enhancements.css +1 -1
- package/dist/components/animated-visibility/animated-visibility.js +139 -118
- package/dist/components/checkbox/checkbox.js +1 -1
- package/dist/components/color-pickers/color-picker.js +18 -11
- package/dist/components/color-pickers/solid-color-picker.js +1 -1
- package/dist/components/component-toggle/component-toggle.js +1 -0
- package/dist/components/draggable/draggable-handle.js +45 -0
- package/dist/components/draggable/draggable.js +5138 -96
- package/dist/components/draggable-list/draggable-list-item.js +16 -25
- package/dist/components/draggable-list/draggable-list.js +54 -86
- package/dist/components/expandable/expandable.js +63 -40
- package/dist/components/index.js +6 -4
- package/dist/components/link-input/link-input.js +2 -2
- package/dist/components/menu/menu.js +2 -2
- package/dist/components/modal/modal.js +4 -15
- package/dist/components/options-panel/options-panel.js +69 -3
- package/dist/components/popover/popover.js +1 -1
- package/dist/components/repeater/repeater-item.js +76 -27
- package/dist/components/repeater/repeater.js +72 -5110
- package/dist/components/select/async-multi-select.js +1 -1
- package/dist/components/select/async-single-select.js +4 -2
- package/dist/components/select/multi-select.js +1 -1
- package/dist/components/select/single-select.js +4 -2
- package/dist/components/select/styles.js +1 -1
- package/dist/components/tabs/tabs.js +1 -1
- package/dist/icons/jsx-svg.js +1 -1
- package/dist/index.js +6 -4
- package/dist/{react-jsx-parser.min-CAGfntg1.js → react-jsx-parser.min-sPC96O_U.js} +124 -85
- package/dist/{react-select-async.esm-DY-cP0QK.js → react-select-async.esm-CxA8wpeT.js} +1 -1
- package/dist/{react-select.esm-DNlXj0hV.js → react-select.esm-CeE7o5M9.js} +1 -1
- package/dist/{useMenuTrigger-BbwpSVmh.js → useMenuTrigger-CT2-BFLo.js} +1 -1
- package/package.json +14 -14
- package/dist/components/draggable/draggable-item.js +0 -66
- package/dist/swapy-qb4t7itb.js +0 -3059
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
3
3
|
import "../../default-i18n-BqWys-1G.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { BaseControl } from "../base-control/base-control.js";
|
|
5
|
+
import { icons } from "../../icons/icons.js";
|
|
6
|
+
import { cloneElement } from "react";
|
|
7
|
+
import "../../react-jsx-parser.min-sPC96O_U.js";
|
|
7
8
|
/**
|
|
8
9
|
* A DraggableList item.
|
|
9
10
|
*
|
|
@@ -15,7 +16,6 @@ import { useContext } from "react";
|
|
|
15
16
|
* @param {JSX.Element|JSX.Element[]} [props.actions] - Actions to display to the right of the label.
|
|
16
17
|
* @param {string} [props.textValue] - The text value of the item.
|
|
17
18
|
* @param {string} [props.className] - Classes to pass to the label.
|
|
18
|
-
* @param {string} [props.containerClassName] - Classes to pass to the item container.
|
|
19
19
|
*
|
|
20
20
|
* @returns {JSX.Element} The DraggableList component.
|
|
21
21
|
*
|
|
@@ -24,31 +24,21 @@ import { useContext } from "react";
|
|
|
24
24
|
* @preserve
|
|
25
25
|
*/
|
|
26
26
|
const DraggableListItem = (props) => {
|
|
27
|
-
const { children, icon, label, subtitle, className,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
RichLabel,
|
|
27
|
+
const { children, icon, label, subtitle, className, ...rest } = props;
|
|
28
|
+
return /* @__PURE__ */ jsxs(
|
|
29
|
+
BaseControl,
|
|
31
30
|
{
|
|
32
|
-
hidden: !(icon || label || subtitle),
|
|
33
31
|
icon,
|
|
34
32
|
label,
|
|
35
33
|
subtitle,
|
|
36
|
-
className,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
);
|
|
40
|
-
return /* @__PURE__ */ jsxs(
|
|
41
|
-
"div",
|
|
42
|
-
{
|
|
43
|
-
className: clsx(
|
|
44
|
-
"es-uic-flex es-uic-min-h-7 es-uic-items-center es-uic-gap-1 es-uic-rounded-lg es-uic-transition",
|
|
45
|
-
"focus:es-uic-outline-none focus-visible:es-uic-ring focus-visible:es-uic-ring-teal-500 focus-visible:es-uic-ring-opacity-50",
|
|
46
|
-
containerClassName
|
|
47
|
-
),
|
|
34
|
+
className: clsx("es-uic-w-full", className),
|
|
35
|
+
fullWidthLabel: true,
|
|
36
|
+
inline: true,
|
|
48
37
|
...rest,
|
|
49
38
|
children: [
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
cloneElement(icons.reorderGrabberV, {
|
|
40
|
+
className: "es-uic-opacity-0 es-uic-transition-opacity group-focus-visible:es-uic-opacity-100 es-uic-text-gray-400 es-uic-size-4 group-hover:es-uic-opacity-100"
|
|
41
|
+
}),
|
|
52
42
|
children
|
|
53
43
|
]
|
|
54
44
|
}
|
|
@@ -71,11 +61,12 @@ const DraggableListItem = (props) => {
|
|
|
71
61
|
const DraggableListItemHandle = (props) => {
|
|
72
62
|
const { className, children, ...rest } = props;
|
|
73
63
|
return /* @__PURE__ */ jsx(
|
|
74
|
-
"
|
|
64
|
+
"button",
|
|
75
65
|
{
|
|
76
|
-
"data-swapy-handle": true,
|
|
77
66
|
className: className ?? 'es-uic-relative es-uic-h-6 es-uic-w-2 es-uic-cursor-pointer es-uic-items-center es-uic-justify-center es-uic-self-center es-uic-rounded es-uic-border es-uic-border-gray-300 es-uic-bg-gray-50 es-uic-transition after:es-uic-absolute after:es-uic-inset-0 after:es-uic-m-auto after:es-uic-h-4 after:es-uic-w-px after:es-uic-bg-gray-200 after:es-uic-transition after:es-uic-content-[""] hover:es-uic-border-teal-500 hover:es-uic-bg-teal-400 hover:after:es-uic-bg-teal-500',
|
|
78
67
|
...rest,
|
|
68
|
+
"data-movable-handle": true,
|
|
69
|
+
tabIndex: -1,
|
|
79
70
|
children
|
|
80
71
|
}
|
|
81
72
|
);
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useId
|
|
2
|
+
import { useId } from "react";
|
|
3
3
|
import "../../default-i18n-BqWys-1G.js";
|
|
4
4
|
import { BaseControl } from "../base-control/base-control.js";
|
|
5
|
-
import { j as je } from "../../swapy-qb4t7itb.js";
|
|
6
|
-
import { DraggableListContext } from "./draggable-list-context.js";
|
|
7
5
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
6
|
+
import { L as List, a as arrayRemove, b as arrayMove } from "../../List-Bx2anbX-.js";
|
|
8
7
|
const fixIds = (items, itemIdBase) => {
|
|
9
8
|
return items.map((item, i) => ({
|
|
10
9
|
...item,
|
|
@@ -26,7 +25,6 @@ const fixIds = (items, itemIdBase) => {
|
|
|
26
25
|
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
27
26
|
* @param {boolean} [props.disabled] - If `true`, item reordering is disabled.
|
|
28
27
|
* @param {string} [props.className] - Classes to pass to the item wrapper.
|
|
29
|
-
* @param {boolean} [props.labelAsHandle=false] - If `true`, the label will be used as the handle for dragging.
|
|
30
28
|
*
|
|
31
29
|
* @returns {JSX.Element} The DraggableList component.
|
|
32
30
|
*
|
|
@@ -74,52 +72,7 @@ const DraggableList = (props) => {
|
|
|
74
72
|
hidden,
|
|
75
73
|
...rest
|
|
76
74
|
} = props;
|
|
77
|
-
const items =
|
|
78
|
-
const ref = useRef(null);
|
|
79
|
-
const swapyRef = useRef(null);
|
|
80
|
-
const [slotItemsMap, setSlotItemsMap] = useState([
|
|
81
|
-
...items.map((item) => ({
|
|
82
|
-
slotId: item.id,
|
|
83
|
-
itemId: item.id
|
|
84
|
-
})),
|
|
85
|
-
{ slotId: `${Math.round(Math.random() * 99999)}`, itemId: null }
|
|
86
|
-
]);
|
|
87
|
-
const slottedItems = useMemo(
|
|
88
|
-
() => slotItemsMap.map(({ slotId, itemId }) => ({
|
|
89
|
-
slotId,
|
|
90
|
-
itemId,
|
|
91
|
-
item: items.find((item) => item.id === itemId)
|
|
92
|
-
})),
|
|
93
|
-
[items, slotItemsMap]
|
|
94
|
-
);
|
|
95
|
-
useEffect(() => {
|
|
96
|
-
var _a;
|
|
97
|
-
const newItems = items.filter((item) => !slotItemsMap.some((slotItem) => slotItem.itemId === item.id)).map((item) => ({
|
|
98
|
-
slotId: item.id,
|
|
99
|
-
itemId: item.id
|
|
100
|
-
}));
|
|
101
|
-
const withoutRemovedItems = slotItemsMap.filter((slotItem) => items.some((item) => item.id === slotItem.itemId) || !slotItem.itemId);
|
|
102
|
-
const updatedSlotItemsMap = [...withoutRemovedItems, ...newItems];
|
|
103
|
-
setSlotItemsMap(updatedSlotItemsMap);
|
|
104
|
-
(_a = swapyRef.current) == null ? void 0 : _a.setData({ array: updatedSlotItemsMap });
|
|
105
|
-
}, [items]);
|
|
106
|
-
useEffect(() => {
|
|
107
|
-
const container = ref == null ? void 0 : ref.current;
|
|
108
|
-
swapyRef.current = je(container, {
|
|
109
|
-
manualSwap: true
|
|
110
|
-
});
|
|
111
|
-
swapyRef.current.onSwap(({ data }) => {
|
|
112
|
-
var _a;
|
|
113
|
-
const tweakedItems = data.array.filter(({ itemId }) => itemId !== null).map(({ itemId }) => items.find((item) => (item == null ? void 0 : item.id) === itemId));
|
|
114
|
-
onChange(tweakedItems);
|
|
115
|
-
(_a = swapyRef.current) == null ? void 0 : _a.setData({ array: data.array });
|
|
116
|
-
setSlotItemsMap(data.array);
|
|
117
|
-
});
|
|
118
|
-
return () => {
|
|
119
|
-
var _a;
|
|
120
|
-
(_a = swapyRef.current) == null ? void 0 : _a.destroy();
|
|
121
|
-
};
|
|
122
|
-
}, []);
|
|
75
|
+
const items = fixIds(rawItems, itemIdBase);
|
|
123
76
|
if (hidden) {
|
|
124
77
|
return null;
|
|
125
78
|
}
|
|
@@ -132,45 +85,60 @@ const DraggableList = (props) => {
|
|
|
132
85
|
help,
|
|
133
86
|
actions,
|
|
134
87
|
className: "es-uic-w-full",
|
|
135
|
-
|
|
136
|
-
|
|
88
|
+
...rest,
|
|
89
|
+
children: /* @__PURE__ */ jsx(
|
|
90
|
+
List,
|
|
137
91
|
{
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
92
|
+
values: items,
|
|
93
|
+
onChange: ({ oldIndex, newIndex }) => onChange(newIndex === -1 ? arrayRemove(items, oldIndex) : arrayMove(items, oldIndex, newIndex)),
|
|
94
|
+
renderList: ({ children: children2, props: props2 }) => {
|
|
95
|
+
const { key, ...rest2 } = props2;
|
|
96
|
+
return /* @__PURE__ */ jsx(
|
|
97
|
+
"ul",
|
|
98
|
+
{
|
|
99
|
+
className: "es-uic-w-full es-uic-list-none",
|
|
100
|
+
...rest2,
|
|
101
|
+
children: children2
|
|
102
|
+
},
|
|
103
|
+
key
|
|
104
|
+
);
|
|
105
|
+
},
|
|
106
|
+
renderItem: ({ value, index, isDisabled, isDragged, isSelected, isOutOfBounds, props: props2 }) => {
|
|
107
|
+
const { key, ...rest2 } = props2;
|
|
108
|
+
return /* @__PURE__ */ jsx(
|
|
109
|
+
"li",
|
|
110
|
+
{
|
|
111
|
+
className: clsx(
|
|
112
|
+
"es-uic-group",
|
|
113
|
+
"es-uic-min-h-8 es-uic-w-full",
|
|
114
|
+
"es-uic-flex es-uic-items-center es-uic-gap-1 es-uic-rounded-lg",
|
|
115
|
+
"es-uic-transition-[box-shadow,_background-color,_filter,_opacity,_border-color]",
|
|
116
|
+
"focus:es-uic-outline-none focus-visible:es-uic-ring focus-visible:es-uic-ring-teal-500 focus-visible:es-uic-ring-opacity-50",
|
|
117
|
+
isDisabled && "es-uic-grayscale",
|
|
118
|
+
isDragged && "es-uic-bg-white es-uic-opacity-50",
|
|
119
|
+
isSelected && "es-uic-bg-teal-50",
|
|
120
|
+
isDragged ? "es-uic-cursor-grabbing" : "es-uic-cursor-grab"
|
|
121
|
+
),
|
|
122
|
+
...rest2,
|
|
123
|
+
children: children({
|
|
124
|
+
...value,
|
|
125
|
+
updateData: (newValue) => {
|
|
126
|
+
onChange(items.map((i) => i.id === value.id ? { ...i, ...newValue } : i));
|
|
127
|
+
},
|
|
128
|
+
itemIndex: index,
|
|
129
|
+
deleteItem: () => {
|
|
130
|
+
onChange(items.filter((i) => i.id !== value.id));
|
|
131
|
+
if (value.onAfterItemRemove) {
|
|
132
|
+
onAfterItemRemove(value);
|
|
164
133
|
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
)
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
))
|
|
134
|
+
}
|
|
135
|
+
})
|
|
136
|
+
},
|
|
137
|
+
(value == null ? void 0 : value.id) ?? key
|
|
138
|
+
);
|
|
139
|
+
}
|
|
172
140
|
}
|
|
173
|
-
)
|
|
141
|
+
)
|
|
174
142
|
}
|
|
175
143
|
);
|
|
176
144
|
};
|
|
@@ -19,12 +19,14 @@ import { $ as $9bf71ea28793e738$export$20e40289641fbbb6 } from "../../FocusScope
|
|
|
19
19
|
* @param {string} [props.className] - Classes to pass to the container.
|
|
20
20
|
* @param {string} [props.contentClassName] - Classes to pass to the inner content wrapper.
|
|
21
21
|
* @param {string} [props.labelClassName] - Classes to pass to the label.
|
|
22
|
+
* @param {string} [props.headerClassName] - Classes to pass to the header (label + trigger).
|
|
22
23
|
* @param {JSX.Element|JSX.Element[]} [props.actions] - Actions to display in the panel header, left of the expand button.
|
|
23
24
|
* @param {boolean} [props.keepActionsOnExpand=false] - If `true`, the actions are not hidden when the panel is expanded.
|
|
24
25
|
* @param {boolean} [props.disabled] - If `true`, the expand button is disabled.
|
|
25
26
|
* @param {boolean} [props.noFocusHandling] - If `true`, the focus trapping when the item is expanded is disabled. Useful when part of another component that manages focus itself.
|
|
26
27
|
* @param {boolean} [props.open] - Whether the expandable is open.
|
|
27
28
|
* @param {Function} [props.onOpenChange] - Function is called when the panel is opened or closed.
|
|
29
|
+
* @param {object} [props.headerProps] - Props to pass to the header (label + trigger).
|
|
28
30
|
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
29
31
|
*
|
|
30
32
|
* @returns {JSX.Element} The Expandable component.
|
|
@@ -44,6 +46,7 @@ const Expandable = (props) => {
|
|
|
44
46
|
className,
|
|
45
47
|
labelClassName,
|
|
46
48
|
contentClassName,
|
|
49
|
+
headerClassName,
|
|
47
50
|
actions,
|
|
48
51
|
keepActionsOnExpand = false,
|
|
49
52
|
disabled,
|
|
@@ -51,6 +54,8 @@ const Expandable = (props) => {
|
|
|
51
54
|
children,
|
|
52
55
|
open = false,
|
|
53
56
|
onOpenChange,
|
|
57
|
+
customOpenButton,
|
|
58
|
+
headerProps,
|
|
54
59
|
hidden,
|
|
55
60
|
...other
|
|
56
61
|
} = props;
|
|
@@ -71,47 +76,65 @@ const Expandable = (props) => {
|
|
|
71
76
|
),
|
|
72
77
|
...other,
|
|
73
78
|
children: [
|
|
74
|
-
/* @__PURE__ */ jsxs(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
{
|
|
100
|
-
type: "ghost",
|
|
101
|
-
icon: isOpen ? icons.caretDownFill : icons.caretDown,
|
|
102
|
-
onPress: () => {
|
|
103
|
-
setIsOpen(!isOpen);
|
|
104
|
-
if (onOpenChange) {
|
|
105
|
-
onOpenChange(!isOpen);
|
|
79
|
+
/* @__PURE__ */ jsxs(
|
|
80
|
+
"div",
|
|
81
|
+
{
|
|
82
|
+
className: clsx("es-uic-flex es-uic-h-10 es-uic-items-center es-uic-gap-1 es-uic-transition-[padding]", isOpen && "es-uic-py-1 es-uic-pl-2 es-uic-pr-1", headerClassName),
|
|
83
|
+
...headerProps,
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ jsx(
|
|
86
|
+
RichLabel,
|
|
87
|
+
{
|
|
88
|
+
icon,
|
|
89
|
+
label,
|
|
90
|
+
subtitle,
|
|
91
|
+
className: labelClassName,
|
|
92
|
+
as: $01b77f81d0f07f68$export$b04be29aa201d4f5,
|
|
93
|
+
fullWidth: true
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
actions && !keepActionsOnExpand && /* @__PURE__ */ jsx(
|
|
97
|
+
AnimatedVisibility,
|
|
98
|
+
{
|
|
99
|
+
visible: !isOpen,
|
|
100
|
+
className: "es-uic-ml-auto es-uic-flex es-uic-gap-2",
|
|
101
|
+
transition: "scaleFade",
|
|
102
|
+
noInitial: true,
|
|
103
|
+
children: actions
|
|
106
104
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
105
|
+
),
|
|
106
|
+
actions && keepActionsOnExpand && /* @__PURE__ */ jsx("div", { className: "es-uic-ml-auto es-uic-flex es-uic-gap-2", children: actions }),
|
|
107
|
+
customOpenButton && customOpenButton({
|
|
108
|
+
open: isOpen,
|
|
109
|
+
toggleOpen: () => {
|
|
110
|
+
setIsOpen(!isOpen);
|
|
111
|
+
if (onOpenChange) {
|
|
112
|
+
onOpenChange(!isOpen);
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
tooltip: isOpen ? __("Close", "eightshift-ui-components") : __("Open", "eightshift-ui-components"),
|
|
116
|
+
disabled
|
|
117
|
+
}),
|
|
118
|
+
!customOpenButton && /* @__PURE__ */ jsx(
|
|
119
|
+
Button,
|
|
120
|
+
{
|
|
121
|
+
type: "ghost",
|
|
122
|
+
icon: isOpen ? icons.caretDownFill : icons.caretDown,
|
|
123
|
+
onPress: () => {
|
|
124
|
+
setIsOpen(!isOpen);
|
|
125
|
+
if (onOpenChange) {
|
|
126
|
+
onOpenChange(!isOpen);
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
tooltip: isOpen ? __("Close", "eightshift-ui-components") : __("Open", "eightshift-ui-components"),
|
|
130
|
+
disabled,
|
|
131
|
+
className: clsx("[&>svg]:es-uic-size-5 [&>svg]:es-uic-transition-transform", isOpen && "[&>svg]:-es-uic-scale-y-100"),
|
|
132
|
+
size: "small"
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
),
|
|
115
138
|
/* @__PURE__ */ jsx(
|
|
116
139
|
AnimatedVisibility,
|
|
117
140
|
{
|
package/dist/components/index.js
CHANGED
|
@@ -10,8 +10,9 @@ import { ColorPicker } from "./color-pickers/color-picker.js";
|
|
|
10
10
|
import { ColumnConfigSlider, ColumnConfigSliderOutput } from "./slider/column-config-slider.js";
|
|
11
11
|
import { DraggableList } from "./draggable-list/draggable-list.js";
|
|
12
12
|
import { DraggableListItem, DraggableListItemHandle } from "./draggable-list/draggable-list-item.js";
|
|
13
|
+
import { DraggableContext } from "./draggable/draggable-context.js";
|
|
13
14
|
import { Draggable } from "./draggable/draggable.js";
|
|
14
|
-
import {
|
|
15
|
+
import { DraggableHandle } from "./draggable/draggable-handle.js";
|
|
15
16
|
import { Expandable } from "./expandable/expandable.js";
|
|
16
17
|
import { FilePlaceholder } from "./placeholders/file-placeholder.js";
|
|
17
18
|
import { GradientEditor } from "./color-pickers/gradient-editor.js";
|
|
@@ -40,7 +41,7 @@ import { Modal } from "./modal/modal.js";
|
|
|
40
41
|
import { MultiSelect } from "./select/multi-select.js";
|
|
41
42
|
import { RSClearIndicator, RSDropdownIndicator, RSMultiValue, RSMultiValueContainer, RSMultiValueLabel, RSMultiValueRemove, RSOption, RSSingleValue } from "./select/react-select-component-wrappers.js";
|
|
42
43
|
import { OptionSelect } from "./option-select/option-select.js";
|
|
43
|
-
import { OptionsPanel, OptionsPanelSection } from "./options-panel/options-panel.js";
|
|
44
|
+
import { OptionsPanel, OptionsPanelHeader, OptionsPanelSection } from "./options-panel/options-panel.js";
|
|
44
45
|
import { Select } from "./select/single-select.js";
|
|
45
46
|
import { Slider } from "./slider/slider.js";
|
|
46
47
|
import { SolidColorPicker } from "./color-pickers/solid-color-picker.js";
|
|
@@ -68,8 +69,8 @@ export {
|
|
|
68
69
|
ContainerPanel,
|
|
69
70
|
D as DecorativeTooltip,
|
|
70
71
|
Draggable,
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
DraggableContext,
|
|
73
|
+
DraggableHandle,
|
|
73
74
|
DraggableList,
|
|
74
75
|
DraggableListItem,
|
|
75
76
|
DraggableListItemHandle,
|
|
@@ -94,6 +95,7 @@ export {
|
|
|
94
95
|
NumberPicker,
|
|
95
96
|
OptionSelect,
|
|
96
97
|
OptionsPanel,
|
|
98
|
+
OptionsPanelHeader,
|
|
97
99
|
OptionsPanelSection,
|
|
98
100
|
Popover,
|
|
99
101
|
RSClearIndicator,
|
|
@@ -7,7 +7,7 @@ import { $ as $a049562f99e7db0e$export$f9c6924e160136d1, a as $a049562f99e7db0e$
|
|
|
7
7
|
import { b as $2d73ec29415bd339$export$712718f7aec83d5, $ as $3985021b0ad6602f$export$37fb8590cf2c088c, a as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-BoNEjaXM.js";
|
|
8
8
|
import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-BqW0M3HN.js";
|
|
9
9
|
import { b as $b1f0cad8af73213b$export$3585ede4d035bf14, c as $b1f0cad8af73213b$export$9145995848b05025, d as $eed445e0843c11d0$export$7ff8f37d2d81a48d, e as $eed445e0843c11d0$export$7c5906fe4f1f2af2, $ as $eed445e0843c11d0$export$41f133550aa26f48, a as $eed445e0843c11d0$export$a11e76429ed99b4 } from "../../ListBox-civ86c_v.js";
|
|
10
|
-
import { f as $5e3802645cc19319$export$1c3ebcada18427bf, g as $de32f1b87079253c$export$d2f961adcb0afbe, j as $07b14b47974efb58$export$9b9a0cd73afb7ca4, $ as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../Dialog-
|
|
10
|
+
import { f as $5e3802645cc19319$export$1c3ebcada18427bf, g as $de32f1b87079253c$export$d2f961adcb0afbe, j as $07b14b47974efb58$export$9b9a0cd73afb7ca4, $ as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../Dialog-BdtBguys.js";
|
|
11
11
|
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-CdwRBXol.js";
|
|
12
12
|
import { i as $ae20dd8cbca75726$export$d6daf82dcd84e87c, j as $c5a24bc478652b5f$export$1005530eda016c13, e as $e1995378a142960e$export$bf788dd355e3a401 } from "../../SelectionManager-Ctbzoj1E.js";
|
|
13
13
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-EDDcM64A.js";
|
|
@@ -22,7 +22,7 @@ import { $ as $319e236875307eab$export$a9b970dcc4ae71a9 } from "../../LiveAnnoun
|
|
|
22
22
|
import { b as $ea8dcbcb9ea1b556$export$9a302a45f65d0572 } from "../../usePress-Cs8K7gKw.js";
|
|
23
23
|
import { $ as $313b98861ee5dd6c$export$d6875122194c7b44 } from "../../useLabels-DmsOywGg.js";
|
|
24
24
|
import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "../../useLocalizedStringFormatter-m03yY3xi.js";
|
|
25
|
-
import { $ as $168583247155ddda$export$dc9c12ed27dd1b49 } from "../../useMenuTrigger-
|
|
25
|
+
import { $ as $168583247155ddda$export$dc9c12ed27dd1b49 } from "../../useMenuTrigger-CT2-BFLo.js";
|
|
26
26
|
import { _ as __ } from "../../default-i18n-BqWys-1G.js";
|
|
27
27
|
import { icons } from "../../icons/icons.js";
|
|
28
28
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
@@ -3,12 +3,12 @@ import { $ as $982254629710d113$export$b95089534ab7c1fd, a as $453cc9f0df89c0a5$
|
|
|
3
3
|
import { c as $880e95eb8b93ba9a$export$ecf600387e221c37, $ as $7af3f5b51489e0b5$export$253fe78d46329472, a as $7613b1592d41b092$export$6cd28814d92fa9c9, b as $d496c0a20b6e58ec$export$6c8a5aaad13c9852, l as $e1995378a142960e$export$e953bb1cd0f19726, g as $7135fc7d473fd974$export$4feb769f8ddf26c5, d as $e1995378a142960e$export$18af5c7a9e9b3664, e as $e1995378a142960e$export$bf788dd355e3a401, f as $e1995378a142960e$export$fb8073518f34e6ec, h as $7135fc7d473fd974$export$d40e14dec8b060a8, k as $7135fc7d473fd974$export$90e00781bc59d8f9, m as $7135fc7d473fd974$export$6e2c8f0811a474ce } from "../../SelectionManager-Ctbzoj1E.js";
|
|
4
4
|
import { c as $3ef42575df84b30b$export$9d1611c77c2fe928, k as $bdb11010cef70236$export$b4cc09c592e8fdb8, e as $bdb11010cef70236$export$f680877a34711e37, f as $8ae05eaa5c114e9c$export$7f54fc3180508a52, j as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, i as $64fa3d84918910a7$export$2881499e37b75b9a, l as $df56164dff5785e2$export$4338b53315abf666, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, a as $64fa3d84918910a7$export$29f1550f4b0d4415, b as $64fa3d84918910a7$export$4d86445c2cf5e3, g as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8 } from "../../utils-Du2x3YVu.js";
|
|
5
5
|
import React__default, { useRef, useState, useEffect, useCallback, useMemo, createContext, useContext, forwardRef, cloneElement } from "react";
|
|
6
|
-
import { g as $de32f1b87079253c$export$d2f961adcb0afbe, j as $07b14b47974efb58$export$9b9a0cd73afb7ca4, k as $f1ab8c75478c6f73$export$3351871ee4b288b8, l as $e0b6e0b68ec7f50f$export$872b660ac5a1ff98 } from "../../Dialog-
|
|
6
|
+
import { g as $de32f1b87079253c$export$d2f961adcb0afbe, j as $07b14b47974efb58$export$9b9a0cd73afb7ca4, k as $f1ab8c75478c6f73$export$3351871ee4b288b8, l as $e0b6e0b68ec7f50f$export$872b660ac5a1ff98 } from "../../Dialog-BdtBguys.js";
|
|
7
7
|
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-CdwRBXol.js";
|
|
8
8
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-EDDcM64A.js";
|
|
9
9
|
import { a as $9daab02d461809db$export$683480f191c0e3ea, $ as $fc909762b330b746$export$61c6a8c84e605fb6 } from "../../tooltip-srrt1p-b.js";
|
|
10
10
|
import { $ as $6179b936705e76d3$export$ae780daf29e6d456, a as $507fabe10e71c6fb$export$b9b3dfddab17db27, c as $a1ea59d68270f0dd$export$f8168d8dd8fd66e6, t as $507fabe10e71c6fb$export$98e20ec92f614cfe, e as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "../../focusSafely-xMzk3syC.js";
|
|
11
|
-
import { $ as $168583247155ddda$export$dc9c12ed27dd1b49 } from "../../useMenuTrigger-
|
|
11
|
+
import { $ as $168583247155ddda$export$dc9c12ed27dd1b49 } from "../../useMenuTrigger-CT2-BFLo.js";
|
|
12
12
|
import { b as $ea8dcbcb9ea1b556$export$9a302a45f65d0572, $ as $f6c31cce2adf654f$export$45712eceda6fad21, a as $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 } from "../../usePress-Cs8K7gKw.js";
|
|
13
13
|
import { a as $46d819fcbaf35654$export$8f71654801c2f7cd } from "../../useFocusable-Bu2Ovohk.js";
|
|
14
14
|
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-kCEA3M_y.js";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { c as $a11501f3d1d39e6c$export$ea8f71083e90600f, d as $49c51c25361d4cd2$export$ee0f7cc6afcd1c18, e as $337b884510726a0d$export$14c98a7594375490, f as $5e3802645cc19319$export$1c3ebcada18427bf, g as $de32f1b87079253c$export$d2f961adcb0afbe, h as $337b884510726a0d$export$c6fdb837b070b4ff, i as $86ea4cb521eb2e37$export$2317d149ed6f78c4, b as $de32f1b87079253c$export$2e1e1122cf0cba88, a as $de32f1b87079253c$export$3ddf2d174ce01153 } from "../../Dialog-
|
|
3
|
-
import {
|
|
2
|
+
import { c as $a11501f3d1d39e6c$export$ea8f71083e90600f, d as $49c51c25361d4cd2$export$ee0f7cc6afcd1c18, e as $337b884510726a0d$export$14c98a7594375490, f as $5e3802645cc19319$export$1c3ebcada18427bf, g as $de32f1b87079253c$export$d2f961adcb0afbe, h as $337b884510726a0d$export$c6fdb837b070b4ff, i as $86ea4cb521eb2e37$export$2317d149ed6f78c4, b as $de32f1b87079253c$export$2e1e1122cf0cba88, a as $de32f1b87079253c$export$3ddf2d174ce01153 } from "../../Dialog-BdtBguys.js";
|
|
3
|
+
import { $ as $5cb03073d3f54797$export$a8a3e93435678ff9 } from "../../Heading-DGnF6JDc.js";
|
|
4
4
|
import { d as $b5e257d569688ac6$export$535bd6ca7f90a273, c as $3ef42575df84b30b$export$9d1611c77c2fe928, a as $64fa3d84918910a7$export$29f1550f4b0d4415, l as $df56164dff5785e2$export$4338b53315abf666, o as $64fa3d84918910a7$export$45fda7c47f93fd48, p as $64fa3d84918910a7$export$6d3443f2c48bfc20, b as $64fa3d84918910a7$export$4d86445c2cf5e3, i as $64fa3d84918910a7$export$2881499e37b75b9a, m as $5dc95899b306f630$export$c9058316764c140e } from "../../utils-Du2x3YVu.js";
|
|
5
|
-
import React__default, { useState, useEffect, forwardRef, useContext, useRef, useMemo, createContext } from "react";
|
|
6
5
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-EDDcM64A.js";
|
|
6
|
+
import React__default, { useState, useEffect, forwardRef, useContext, useRef, useMemo, createContext } from "react";
|
|
7
7
|
import { $ as $fc909762b330b746$export$61c6a8c84e605fb6 } from "../../tooltip-srrt1p-b.js";
|
|
8
8
|
import { Button } from "../button/button.js";
|
|
9
9
|
import { _ as __ } from "../../default-i18n-BqWys-1G.js";
|
|
10
10
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
11
11
|
import { icons } from "../../icons/icons.js";
|
|
12
|
-
import "../../react-jsx-parser.min-
|
|
12
|
+
import "../../react-jsx-parser.min-sPC96O_U.js";
|
|
13
13
|
import { HStack } from "../layout/hstack.js";
|
|
14
14
|
let $5df64b3807dc15ee$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
|
|
15
15
|
function $5df64b3807dc15ee$export$d699905dd57c73ca() {
|
|
@@ -64,17 +64,6 @@ function $8ac8429251c45e4b$export$dbc0f175b25fb0fb(props, state, ref) {
|
|
|
64
64
|
underlayProps
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
-
function $5cb03073d3f54797$var$Heading(props, ref) {
|
|
68
|
-
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $4e85f108e88277b8$export$d688439359537581);
|
|
69
|
-
let { children, level = 3, className, ...domProps } = props;
|
|
70
|
-
let Element = `h${level}`;
|
|
71
|
-
return /* @__PURE__ */ React__default.createElement(Element, {
|
|
72
|
-
...domProps,
|
|
73
|
-
ref,
|
|
74
|
-
className: className !== null && className !== void 0 ? className : "react-aria-Heading"
|
|
75
|
-
}, children);
|
|
76
|
-
}
|
|
77
|
-
const $5cb03073d3f54797$export$a8a3e93435678ff9 = /* @__PURE__ */ forwardRef($5cb03073d3f54797$var$Heading);
|
|
78
67
|
const $f3f84453ead64de5$export$ab57792b9b6974a6 = /* @__PURE__ */ createContext(null);
|
|
79
68
|
const $f3f84453ead64de5$var$InternalModalContext = /* @__PURE__ */ createContext(null);
|
|
80
69
|
function $f3f84453ead64de5$var$Modal(props, ref) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
3
3
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
4
|
+
import { $ as $5cb03073d3f54797$export$a8a3e93435678ff9 } from "../../Heading-DGnF6JDc.js";
|
|
4
5
|
/**
|
|
5
6
|
* Component that provides a container panel for options, with an optional title.
|
|
6
7
|
* Best used within the Gutenberg sidebar, instead of the default `PanelBody` component.
|
|
@@ -13,6 +14,7 @@ import { RichLabel } from "../rich-label/rich-label.js";
|
|
|
13
14
|
* @param {JSX.Element} [props.icon] - Icon to display on the top of the panel.
|
|
14
15
|
* @param {string} [props.subtitle] - Subtitle to display on the top of the panel.
|
|
15
16
|
* @param {string} [props.help] - Help text to show below the panel.
|
|
17
|
+
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
16
18
|
*
|
|
17
19
|
* @returns {JSX.Element} The OptionsPanel component.
|
|
18
20
|
*
|
|
@@ -24,8 +26,11 @@ import { RichLabel } from "../rich-label/rich-label.js";
|
|
|
24
26
|
* @preserve
|
|
25
27
|
*/
|
|
26
28
|
const OptionsPanel = (props) => {
|
|
27
|
-
const { children, className, title, icon, subtitle, help } = props;
|
|
28
|
-
|
|
29
|
+
const { children, className, title, icon, subtitle, help, hidden } = props;
|
|
30
|
+
if (hidden) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx("es-uic-max-w-md", className), children: [
|
|
29
34
|
title && /* @__PURE__ */ jsx(
|
|
30
35
|
RichLabel,
|
|
31
36
|
{
|
|
@@ -39,7 +44,27 @@ const OptionsPanel = (props) => {
|
|
|
39
44
|
help && /* @__PURE__ */ jsx("span", { className: "es-uic-mt-1.5 es-uic-block es-uic-text-sm es-uic-text-gray-400", children: help })
|
|
40
45
|
] });
|
|
41
46
|
};
|
|
42
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Component that provides a container for grouping related options within the `OptionsPanel` component.
|
|
49
|
+
*
|
|
50
|
+
* @component
|
|
51
|
+
* @param {Object} props - Component props.
|
|
52
|
+
* @param {string} [props.className] - Classes to pass to the container.
|
|
53
|
+
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
54
|
+
*
|
|
55
|
+
* @returns {JSX.Element} The OptionsPanelSection component.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* <OptionsPanelSection>
|
|
59
|
+
* ...
|
|
60
|
+
* </OptionsPanelSection>
|
|
61
|
+
*
|
|
62
|
+
* @preserve
|
|
63
|
+
*/
|
|
64
|
+
const OptionsPanelSection = ({ children, className, hidden }) => {
|
|
65
|
+
if (hidden) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
43
68
|
return /* @__PURE__ */ jsx(
|
|
44
69
|
"div",
|
|
45
70
|
{
|
|
@@ -51,7 +76,48 @@ const OptionsPanelSection = ({ children, className }) => {
|
|
|
51
76
|
}
|
|
52
77
|
);
|
|
53
78
|
};
|
|
79
|
+
/**
|
|
80
|
+
* Component that provides a header for the top of an options page.
|
|
81
|
+
*
|
|
82
|
+
* @component
|
|
83
|
+
* @param {Object} props - Component props.
|
|
84
|
+
* @param {boolean} [props.sticky] - If `true`, the header will be sticky (scroll with content). Make sure to pass a background color!
|
|
85
|
+
* @param {string} [props.title] - Title to show.
|
|
86
|
+
* @param {Number} [props.level=2] - Heading level of the title.
|
|
87
|
+
* @param {string} [props.className] - Classes to pass to the container.
|
|
88
|
+
* @param {JSX.Element|JSX.Element[]} [props.actions] - Controls to show on the right side of the header.
|
|
89
|
+
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
90
|
+
*
|
|
91
|
+
* @returns {JSX.Element} The OptionsPanelHeader component.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* <OptionsPanelHeader title='Theme options'>
|
|
95
|
+
* ...
|
|
96
|
+
* </OptionsPanelHeader>
|
|
97
|
+
*
|
|
98
|
+
* @preserve
|
|
99
|
+
*/
|
|
100
|
+
const OptionsPanelHeader = ({ children, sticky, title, className, actions, level = 2, hidden }) => {
|
|
101
|
+
if (hidden) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx("es-uic-max-w-md es-uic-space-y-2.5", sticky && "es-uic-sticky es-uic-top-0 es-uic-z-10", className), children: [
|
|
105
|
+
/* @__PURE__ */ jsxs("div", { className: "es-uic-flex es-uic-flex-wrap es-uic-items-center es-uic-justify-between es-uic-gap-x-8 es-uic-gap-y-4", children: [
|
|
106
|
+
/* @__PURE__ */ jsx(
|
|
107
|
+
$5cb03073d3f54797$export$a8a3e93435678ff9,
|
|
108
|
+
{
|
|
109
|
+
className: "es-uic-text-2xl es-uic-font-medium es-uic-tracking-tight",
|
|
110
|
+
level,
|
|
111
|
+
children: title
|
|
112
|
+
}
|
|
113
|
+
),
|
|
114
|
+
/* @__PURE__ */ jsx("div", { className: "es-uic-flex es-uic-items-center es-uic-gap-2", children: actions })
|
|
115
|
+
] }),
|
|
116
|
+
children
|
|
117
|
+
] });
|
|
118
|
+
};
|
|
54
119
|
export {
|
|
55
120
|
OptionsPanel,
|
|
121
|
+
OptionsPanelHeader,
|
|
56
122
|
OptionsPanelSection
|
|
57
123
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { $ as $07b14b47974efb58$export$5b6b19405a83ff9d, a as $de32f1b87079253c$export$3ddf2d174ce01153, b as $de32f1b87079253c$export$2e1e1122cf0cba88 } from "../../Dialog-
|
|
2
|
+
import { $ as $07b14b47974efb58$export$5b6b19405a83ff9d, a as $de32f1b87079253c$export$3ddf2d174ce01153, b as $de32f1b87079253c$export$2e1e1122cf0cba88 } from "../../Dialog-BdtBguys.js";
|
|
3
3
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
4
4
|
import { _ as __ } from "../../default-i18n-BqWys-1G.js";
|
|
5
5
|
import { Button } from "../button/button.js";
|