@eightshift/ui-components 1.1.4 → 1.2.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/dist/assets/style.css +1 -1
- package/dist/components/checkbox/checkbox.js +2 -2
- package/dist/components/color-pickers/gradient-editor.js +25 -13
- package/dist/components/color-pickers/solid-color-picker.js +7 -3
- package/dist/components/component-toggle/component-toggle.js +1 -1
- package/dist/components/container-panel/container-panel.js +4 -4
- package/dist/components/expandable/expandable.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/input-field/input-field.js +1 -0
- package/dist/components/link-input/link-input.js +1 -2
- package/dist/components/matrix-align/matrix-align.js +1 -1
- package/dist/components/menu/menu.js +15 -5
- package/dist/components/options-panel/options-panel.js +1 -1
- package/dist/components/popover/popover.js +1 -1
- package/dist/components/radio/radio.js +2 -2
- package/dist/components/repeater/repeater.js +6 -3
- package/dist/components/responsive-preview/responsive-preview.js +5 -5
- package/dist/components/select/async-multi-select.js +1 -1
- package/dist/components/select/async-single-select.js +2 -2
- package/dist/components/select/shared.js +4 -0
- package/dist/components/select/styles.js +9 -8
- package/dist/components/slider/slider.js +4 -5
- package/dist/components/tabs/tabs.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{popover-BAjlU5GY.js → popover-CdonDPqG.js} +5 -0
- package/package.json +1 -1
|
@@ -79,13 +79,13 @@ const Checkbox = (props) => {
|
|
|
79
79
|
{
|
|
80
80
|
className: clsx(
|
|
81
81
|
"es-uic-flex es-uic-size-5 es-uic-items-center es-uic-justify-center es-uic-rounded-md es-uic-border es-uic-text-gray-600 es-uic-shadow-sm es-uic-transition",
|
|
82
|
-
isSelected ? "es-uic-border-teal-600 es-uic-bg-teal-600 es-uic-text-white" : "es-uic-border-gray-300"
|
|
82
|
+
isSelected || indeterminate ? "es-uic-border-teal-600 es-uic-bg-teal-600 es-uic-text-white" : "es-uic-border-gray-300"
|
|
83
83
|
),
|
|
84
84
|
children: [
|
|
85
85
|
/* @__PURE__ */ jsx(
|
|
86
86
|
AnimatedVisibility,
|
|
87
87
|
{
|
|
88
|
-
transition: "
|
|
88
|
+
transition: "scaleFade",
|
|
89
89
|
visible: isIndeterminate,
|
|
90
90
|
children: /* @__PURE__ */ jsx("div", { className: "es-uic-h-[1.5px] es-uic-w-3 es-uic-rounded es-uic-bg-white" })
|
|
91
91
|
}
|
|
@@ -146,42 +146,50 @@ const linearDirections = [
|
|
|
146
146
|
{
|
|
147
147
|
label: __("Right"),
|
|
148
148
|
value: "right",
|
|
149
|
-
iconClass: "es-uic-bg-gradient-to-r"
|
|
149
|
+
iconClass: "es-uic-bg-gradient-to-r",
|
|
150
|
+
valueDegrees: 90
|
|
150
151
|
},
|
|
151
152
|
{
|
|
152
153
|
label: __("Left"),
|
|
153
154
|
value: "left",
|
|
154
|
-
iconClass: "es-uic-bg-gradient-to-l"
|
|
155
|
+
iconClass: "es-uic-bg-gradient-to-l",
|
|
156
|
+
valueDegrees: 180
|
|
155
157
|
},
|
|
156
158
|
{
|
|
157
159
|
label: __("Top"),
|
|
158
160
|
value: "top",
|
|
159
|
-
iconClass: "es-uic-bg-gradient-to-t"
|
|
161
|
+
iconClass: "es-uic-bg-gradient-to-t",
|
|
162
|
+
valueDegrees: 270
|
|
160
163
|
},
|
|
161
164
|
{
|
|
162
165
|
label: __("Bottom"),
|
|
163
166
|
value: "bottom",
|
|
164
|
-
iconClass: "es-uic-bg-gradient-to-b"
|
|
167
|
+
iconClass: "es-uic-bg-gradient-to-b",
|
|
168
|
+
valueDegrees: 90
|
|
165
169
|
},
|
|
166
170
|
{
|
|
167
171
|
label: __("Top-right"),
|
|
168
172
|
value: "top right",
|
|
169
|
-
iconClass: "es-uic-bg-gradient-to-tr"
|
|
173
|
+
iconClass: "es-uic-bg-gradient-to-tr",
|
|
174
|
+
valueDegrees: 45
|
|
170
175
|
},
|
|
171
176
|
{
|
|
172
177
|
label: __("Top-left"),
|
|
173
178
|
value: "top left",
|
|
174
|
-
iconClass: "es-uic-bg-gradient-to-tl"
|
|
179
|
+
iconClass: "es-uic-bg-gradient-to-tl",
|
|
180
|
+
valueDegrees: 315
|
|
175
181
|
},
|
|
176
182
|
{
|
|
177
183
|
label: __("Bottom-right"),
|
|
178
184
|
value: "bottom right",
|
|
179
|
-
iconClass: "es-uic-bg-gradient-to-br"
|
|
185
|
+
iconClass: "es-uic-bg-gradient-to-br",
|
|
186
|
+
valueDegrees: 135
|
|
180
187
|
},
|
|
181
188
|
{
|
|
182
189
|
label: __("Bottom-left"),
|
|
183
190
|
value: "bottom left",
|
|
184
|
-
iconClass: "es-uic-bg-gradient-to-bl"
|
|
191
|
+
iconClass: "es-uic-bg-gradient-to-bl",
|
|
192
|
+
valueDegrees: 225
|
|
185
193
|
}
|
|
186
194
|
];
|
|
187
195
|
/**
|
|
@@ -205,7 +213,7 @@ const linearDirections = [
|
|
|
205
213
|
* @preserve
|
|
206
214
|
*/
|
|
207
215
|
const GradientEditor = (props) => {
|
|
208
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
216
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
209
217
|
const { value, onChange, hidden } = props;
|
|
210
218
|
const gradientData = useMemo(() => {
|
|
211
219
|
if ((value == null ? void 0 : value.startsWith("radial-gradient")) || (value == null ? void 0 : value.startsWith("repeating-radial-gradient"))) {
|
|
@@ -273,7 +281,11 @@ const GradientEditor = (props) => {
|
|
|
273
281
|
},
|
|
274
282
|
suffix: "°",
|
|
275
283
|
size: "small",
|
|
276
|
-
className: "es-uic-grow"
|
|
284
|
+
className: "es-uic-grow",
|
|
285
|
+
placeholder: ((_d = linearDirections.find(({ value: value2 }) => {
|
|
286
|
+
var _a2;
|
|
287
|
+
return value2 === ((_a2 = gradientData == null ? void 0 : gradientData.orientation) == null ? void 0 : _a2.value);
|
|
288
|
+
})) == null ? void 0 : _d.valueDegrees) ?? ""
|
|
277
289
|
}
|
|
278
290
|
),
|
|
279
291
|
/* @__PURE__ */ jsx(
|
|
@@ -347,7 +359,7 @@ const GradientEditor = (props) => {
|
|
|
347
359
|
{
|
|
348
360
|
icon: icons.centerPoint,
|
|
349
361
|
label: __("Center point", "eightshift-ui-components"),
|
|
350
|
-
value: `${((
|
|
362
|
+
value: `${((_f = (_e = gradientData == null ? void 0 : gradientData.position) == null ? void 0 : _e.y) == null ? void 0 : _f.value) ?? "center"} ${((_h = (_g = gradientData == null ? void 0 : gradientData.position) == null ? void 0 : _g.x) == null ? void 0 : _h.value) ?? "center"}`,
|
|
351
363
|
onChange: (position) => {
|
|
352
364
|
const [x2, y2] = position.split(" ");
|
|
353
365
|
setGradientData({
|
|
@@ -387,7 +399,7 @@ const GradientEditor = (props) => {
|
|
|
387
399
|
{
|
|
388
400
|
icon: icons.centerPoint,
|
|
389
401
|
label: __("Center point", "eightshift-ui-components"),
|
|
390
|
-
value: `${((
|
|
402
|
+
value: `${((_j = (_i = gradientData == null ? void 0 : gradientData.position) == null ? void 0 : _i.y) == null ? void 0 : _j.value) ?? "center"} ${((_l = (_k = gradientData == null ? void 0 : gradientData.position) == null ? void 0 : _k.x) == null ? void 0 : _l.value) ?? "center"}`,
|
|
391
403
|
onChange: (value2) => {
|
|
392
404
|
setGradientData({
|
|
393
405
|
...gradientData,
|
|
@@ -473,7 +485,7 @@ const GradientEditor = (props) => {
|
|
|
473
485
|
min: 0,
|
|
474
486
|
max: 100,
|
|
475
487
|
step: 1,
|
|
476
|
-
value: (
|
|
488
|
+
value: (_m = gradientData == null ? void 0 : gradientData.stops) == null ? void 0 : _m.map(({ offset }, i) => {
|
|
477
489
|
if (!offset) {
|
|
478
490
|
return i * 100 / (gradientData.stops.length - 1);
|
|
479
491
|
}
|
|
@@ -24,7 +24,7 @@ import { $ as $de67e98908f0c6ee$export$7f629e9dc1ecf37c, b as $d2e8511e6f209edf$
|
|
|
24
24
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
25
25
|
import { BaseControl } from "../base-control/base-control.js";
|
|
26
26
|
import { _ as __ } from "../../default-i18n-BqwLkgZv.js";
|
|
27
|
-
import { T as TriggeredPopover } from "../../popover-
|
|
27
|
+
import { T as TriggeredPopover } from "../../popover-CdonDPqG.js";
|
|
28
28
|
import { icons } from "../../icons/icons.js";
|
|
29
29
|
import { Spacer } from "../spacer/spacer.js";
|
|
30
30
|
const $e2b71ec1d6016406$export$c80c0ea2ca5cb846 = /* @__PURE__ */ createContext(null);
|
|
@@ -1246,9 +1246,12 @@ const $1cca5300a3c2e7f9$export$44fd664bcca5b6fb = /* @__PURE__ */ forwardRef($1c
|
|
|
1246
1246
|
* @param {boolean} [props.disabled] - Whether the color picker is disabled.
|
|
1247
1247
|
* @param {Function} [props.onChangeEnd] - The change end handler.
|
|
1248
1248
|
* @param {boolean} [props.allowTransparency=false] - Whether the color picker allows transparency.
|
|
1249
|
-
* @param {
|
|
1249
|
+
* @param {OutputColorFormat} [props.outputFormat] - The output format. Default is 'hex' (or 'hexa' if `allowTransparency` is true).
|
|
1250
|
+
* @param {boolean} [props.noAdvancedOptions] - If `true`, the advanced options are hidden.
|
|
1250
1251
|
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
1251
1252
|
*
|
|
1253
|
+
* @typedef {'hex' | 'hexa' | 'rgb' | 'rgba' | 'hsl' | 'hsla' | 'hsb' | 'hsba'} OutputColorFormat
|
|
1254
|
+
*
|
|
1252
1255
|
* @returns {JSX.Element} The ButtonGroup component.
|
|
1253
1256
|
*
|
|
1254
1257
|
* @example
|
|
@@ -1257,7 +1260,7 @@ const $1cca5300a3c2e7f9$export$44fd664bcca5b6fb = /* @__PURE__ */ forwardRef($1c
|
|
|
1257
1260
|
* @preserve
|
|
1258
1261
|
*/
|
|
1259
1262
|
const SolidColorPicker = (props) => {
|
|
1260
|
-
const { value: rawValue, onChange, disabled, onChangeEnd, allowTransparency = false, outputFormat, hidden } = props;
|
|
1263
|
+
const { value: rawValue, onChange, disabled, onChangeEnd, allowTransparency = false, outputFormat, hidden, noAdvancedOptions } = props;
|
|
1261
1264
|
const value = rawValue == null ? void 0 : rawValue.replace("transparent", "rgba(0, 0, 0, 0)");
|
|
1262
1265
|
const defaultColor = $799cddbef784668f$export$6e865ea70d7724f("#00000000").toFormat(allowTransparency ? "hsla" : "hsl");
|
|
1263
1266
|
const modifiedValue = value && (value == null ? void 0 : value.length) > 1 ? $799cddbef784668f$export$6e865ea70d7724f(value) : defaultColor;
|
|
@@ -1405,6 +1408,7 @@ const SolidColorPicker = (props) => {
|
|
|
1405
1408
|
disabled,
|
|
1406
1409
|
tooltip: __("Advanced color options", "eightshift-ui-components")
|
|
1407
1410
|
},
|
|
1411
|
+
hidden: noAdvancedOptions,
|
|
1408
1412
|
children: [
|
|
1409
1413
|
/* @__PURE__ */ jsx($01b77f81d0f07f68$export$b04be29aa201d4f5, { className: "es-uic-text-sm", children: __("Advanced color options", "eightshift-ui-components") }),
|
|
1410
1414
|
/* @__PURE__ */ jsx(
|
|
@@ -3,7 +3,7 @@ import { s as sprintf, _ as __ } from "../../default-i18n-BqwLkgZv.js";
|
|
|
3
3
|
import { Expandable } from "../expandable/expandable.js";
|
|
4
4
|
import { icons } from "../../icons/icons.js";
|
|
5
5
|
import { Switch } from "../toggle/switch.js";
|
|
6
|
-
import { T as TriggeredPopover } from "../../popover-
|
|
6
|
+
import { T as TriggeredPopover } from "../../popover-CdonDPqG.js";
|
|
7
7
|
import { a as ButtonGroup } from "../../button-MFj-FKsM.js";
|
|
8
8
|
import { ToggleButton } from "../toggle-button/toggle-button.js";
|
|
9
9
|
import { Spacer } from "../spacer/spacer.js";
|
|
@@ -36,7 +36,7 @@ import { BaseControl } from "../base-control/base-control.js";
|
|
|
36
36
|
const ContainerPanel = (props) => {
|
|
37
37
|
const { children, className, title, icon, subtitle, use, onUseChange, closable, startOpen = false, actions } = props;
|
|
38
38
|
const [open, setOpen] = useState(startOpen);
|
|
39
|
-
if (!title) {
|
|
39
|
+
if (!title && typeof use === "undefined") {
|
|
40
40
|
return /* @__PURE__ */ jsx("div", { className: "es-uic-space-y-2 es-uic-border-t es-uic-border-t-gray-200 es-uic-p-4", children });
|
|
41
41
|
}
|
|
42
42
|
const justUse = !closable && typeof onUseChange !== "undefined";
|
|
@@ -90,14 +90,14 @@ const ContainerPanel = (props) => {
|
|
|
90
90
|
justUse && use && "es-uic-pb-4",
|
|
91
91
|
useAndClosable && use && open && "es-uic-pb-4",
|
|
92
92
|
!justClosable && !justUse && !useAndClosable && "es-uic-pb-4",
|
|
93
|
-
!closable && !onUseChange && "es-uic-px-4",
|
|
93
|
+
!closable && !onUseChange && typeof use === "undefined" && "es-uic-px-4",
|
|
94
94
|
className
|
|
95
95
|
),
|
|
96
96
|
labelContainerClassName: clsx((closable || onUseChange) && "es-uic-pl-4 es-uic-pr-3 es-uic-min-h-12", !(closable || onUseChange) && "es-uic-mt-3", "!es-uic-pb-0"),
|
|
97
97
|
controlContainerClassName: "es-uic-px-4",
|
|
98
98
|
labelClassName: "!es-uic-text-gray-500",
|
|
99
99
|
children: [
|
|
100
|
-
!closable && !onUseChange && children,
|
|
100
|
+
!closable && !onUseChange && typeof use === "undefined" && children,
|
|
101
101
|
closable && typeof use === "undefined" && /* @__PURE__ */ jsx(
|
|
102
102
|
AnimatedVisibility,
|
|
103
103
|
{
|
|
@@ -106,7 +106,7 @@ const ContainerPanel = (props) => {
|
|
|
106
106
|
children
|
|
107
107
|
}
|
|
108
108
|
),
|
|
109
|
-
typeof use !== "undefined" && /* @__PURE__ */ jsx(
|
|
109
|
+
typeof use !== "undefined" && !closable && /* @__PURE__ */ jsx(
|
|
110
110
|
AnimatedVisibility,
|
|
111
111
|
{
|
|
112
112
|
visible: closable ? use && open : use,
|
|
@@ -113,7 +113,7 @@ const Expandable = (props) => {
|
|
|
113
113
|
AnimatedVisibility,
|
|
114
114
|
{
|
|
115
115
|
visible: isOpen,
|
|
116
|
-
className: clsx("es-uic-space-y-2.5 es-uic-border-t es-uic-p-2", contentClassName),
|
|
116
|
+
className: clsx("es-uic-space-y-2.5 es-uic-border-t es-uic-border-t-gray-200 es-uic-p-2", contentClassName),
|
|
117
117
|
transition: "slideFade",
|
|
118
118
|
noInitial: true,
|
|
119
119
|
children
|
package/dist/components/index.js
CHANGED
|
@@ -24,7 +24,7 @@ import { MediaPlaceholder } from "./placeholders/media-placeholder.js";
|
|
|
24
24
|
import { Menu, MenuItem, MenuSection, MenuSeparator, SubMenuItem } from "./menu/menu.js";
|
|
25
25
|
import { Notice } from "./notice/notice.js";
|
|
26
26
|
import { NumberPicker } from "./number-picker/number-picker.js";
|
|
27
|
-
import { P, T } from "../popover-
|
|
27
|
+
import { P, T } from "../popover-CdonDPqG.js";
|
|
28
28
|
import { RadioButton, RadioButtonGroup } from "./radio/radio.js";
|
|
29
29
|
import { Repeater } from "./repeater/repeater.js";
|
|
30
30
|
import { RepeaterItem } from "./repeater/repeater-item.js";
|
|
@@ -185,6 +185,7 @@ const InputField = (props) => {
|
|
|
185
185
|
$3985021b0ad6602f$export$f5b8910cec6cf069,
|
|
186
186
|
{
|
|
187
187
|
...other,
|
|
188
|
+
type,
|
|
188
189
|
className: clsx(
|
|
189
190
|
"es-uic-min-h-10 es-uic-w-full es-uic-rounded-md es-uic-border es-uic-border-gray-300 es-uic-p-2 es-uic-text-sm es-uic-shadow-sm es-uic-transition selection:es-uic-bg-teal-500/20 selection:es-uic-text-teal-950",
|
|
190
191
|
"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",
|
|
@@ -20,7 +20,7 @@ import { T as Tooltip } from "../../tooltip-Do_imFfg.js";
|
|
|
20
20
|
import { AnimatedVisibility } from "../animated-visibility/animated-visibility.js";
|
|
21
21
|
import { BaseControl } from "../base-control/base-control.js";
|
|
22
22
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
23
|
-
import { P as Popover } from "../../popover-
|
|
23
|
+
import { P as Popover } from "../../popover-CdonDPqG.js";
|
|
24
24
|
import { a as $0d86e9c8f07f9a7b$export$79c0c687a5963b0a } from "../../useListData-BpYQj7kK.js";
|
|
25
25
|
var $03c9a1a10de12f06$exports = {};
|
|
26
26
|
$03c9a1a10de12f06$exports = {
|
|
@@ -649,7 +649,6 @@ function c(e, u, c2) {
|
|
|
649
649
|
* @param {JSX.Element} [props.icon=icons.globe] - Icon to display in the label.
|
|
650
650
|
* @param {JSX.Element} [props.removeIcon=icons.clearAlt] - Icon to display in the input's clear button.
|
|
651
651
|
* @param {boolean} [props.disabled=false] - If `true`, the input is disabled.
|
|
652
|
-
* @param {Function} [props.suggestionTypeIconOverride] - Function
|
|
653
652
|
* @param {Function} [props.fetchSuggestions] - A function that fetches suggestions based on the input value.
|
|
654
653
|
* @param {string} [props.className] - Classes to pass to the input field.
|
|
655
654
|
* @param {number} [props.inputDebounceDelay=500] - The delay in milliseconds before the input value is considered final.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useRef } from "react";
|
|
3
3
|
import { _ as __ } from "../../default-i18n-BqwLkgZv.js";
|
|
4
|
-
import { P as Popover } from "../../popover-
|
|
4
|
+
import { P as Popover } from "../../popover-CdonDPqG.js";
|
|
5
5
|
import { B as Button } from "../../button-MFj-FKsM.js";
|
|
6
6
|
import { icons } from "../../icons/icons.js";
|
|
7
7
|
import { upperFirst, camelCase } from "../../utilities/es-dash.js";
|
|
@@ -3,7 +3,7 @@ import { $ as $982254629710d113$export$b95089534ab7c1fd, b as $453cc9f0df89c0a5$
|
|
|
3
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-XOAt-Ekx.js";
|
|
4
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-Dc35LwuT.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-
|
|
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-CdonDPqG.js";
|
|
7
7
|
import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-WqetJduR.js";
|
|
8
8
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-EDDcM64A.js";
|
|
9
9
|
import { $ as $9daab02d461809db$export$683480f191c0e3ea, a as $fc909762b330b746$export$61c6a8c84e605fb6 } from "../../tooltip-Do_imFfg.js";
|
|
@@ -1417,10 +1417,20 @@ const Menu = (props) => {
|
|
|
1417
1417
|
*/
|
|
1418
1418
|
const MenuSection = (props) => {
|
|
1419
1419
|
const { children, label } = props;
|
|
1420
|
-
return /* @__PURE__ */ jsxs(
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1420
|
+
return /* @__PURE__ */ jsxs(
|
|
1421
|
+
$7135fc7d473fd974$export$6e2c8f0811a474ce,
|
|
1422
|
+
{
|
|
1423
|
+
className: clsx(
|
|
1424
|
+
"es-uic-space-y-1 es-uic-border-b es-uic-border-b-gray-200 es-uic-pb-1 last:es-uic-border-b-0",
|
|
1425
|
+
label && "es-uic-pt-2 first:es-uic-pt-1.5",
|
|
1426
|
+
!label && "last:es-uic-pb-1"
|
|
1427
|
+
),
|
|
1428
|
+
children: [
|
|
1429
|
+
label && /* @__PURE__ */ jsx($72a5793c14baf454$export$8b251419efc915eb, { className: "es-uic-ml-1.5 es-uic-text-xs es-uic-font-medium es-uic-text-gray-400", children: label }),
|
|
1430
|
+
children
|
|
1431
|
+
]
|
|
1432
|
+
}
|
|
1433
|
+
);
|
|
1424
1434
|
};
|
|
1425
1435
|
/**
|
|
1426
1436
|
* A menu separator.
|
|
@@ -36,7 +36,7 @@ const OptionsPanel = (props) => {
|
|
|
36
36
|
}
|
|
37
37
|
),
|
|
38
38
|
/* @__PURE__ */ jsx("div", { className: "es-uic-divide-y es-uic-divide-gray-200 es-uic-rounded-lg es-uic-border es-uic-border-gray-200 es-uic-bg-white es-uic-shadow", children }),
|
|
39
|
-
help && /* @__PURE__ */ jsx("span", { className: "
|
|
39
|
+
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
40
|
] });
|
|
41
41
|
};
|
|
42
42
|
const OptionsPanelSection = ({ children, className }) => {
|
|
@@ -375,12 +375,12 @@ const RadioButton = (props) => {
|
|
|
375
375
|
}
|
|
376
376
|
const styleClassName = {
|
|
377
377
|
segmented: clsx(
|
|
378
|
-
"es-uic-py-1 es-uic-px-1.5 es-uic-border hover:es-uic-bg-gray-50 es-uic-transition es-uic-min-h-10",
|
|
378
|
+
"es-uic-py-1 es-uic-px-1.5 es-uic-border es-uic-border-gray-300 hover:es-uic-bg-gray-50 es-uic-transition es-uic-min-h-10",
|
|
379
379
|
"first:es-uic-rounded-t-lg last:es-uic-rounded-b-lg",
|
|
380
380
|
"focus-visible:es-uic-ring focus-visible:es-uic-ring-teal-500 focus-visible:es-uic-ring-opacity-50 focus-visible:es-uic-z-10"
|
|
381
381
|
),
|
|
382
382
|
segmentedHorizontal: clsx(
|
|
383
|
-
"es-uic-py-1 es-uic-px-1.5 es-uic-border hover:es-uic-bg-gray-50 es-uic-transition es-uic-grow es-uic-min-h-10",
|
|
383
|
+
"es-uic-py-1 es-uic-px-1.5 es-uic-border es-uic-border-gray-300 hover:es-uic-bg-gray-50 es-uic-transition es-uic-grow es-uic-min-h-10",
|
|
384
384
|
"first:es-uic-rounded-l-lg last:es-uic-rounded-r-lg",
|
|
385
385
|
"focus-visible:es-uic-ring focus-visible:es-uic-ring-teal-500 focus-visible:es-uic-ring-opacity-50 focus-visible:es-uic-z-10"
|
|
386
386
|
)
|
|
@@ -108,7 +108,7 @@ const Repeater = (props) => {
|
|
|
108
108
|
selectedKeys: rawList.selectionManager.selectedKeys,
|
|
109
109
|
setSelectedKeys: (ids) => rawList.selectionManager.setSelectedKeys(ids),
|
|
110
110
|
getKey: ({ id }) => items.find((item) => item.id === id),
|
|
111
|
-
getItem: (id) => items.find((item) => item.id === id),
|
|
111
|
+
getItem: (id) => items == null ? void 0 : items.find((item) => item.id === id),
|
|
112
112
|
update: (id, newValue) => {
|
|
113
113
|
const index = [...items].findIndex((item) => item.id === id);
|
|
114
114
|
items[index] = { ...items[index], ...newValue };
|
|
@@ -135,7 +135,10 @@ const Repeater = (props) => {
|
|
|
135
135
|
};
|
|
136
136
|
let { dragAndDropHooks } = $d8f176866e6dc039$export$2cfc5be7a55829f6({
|
|
137
137
|
isDisabled: selectable || !canReorder,
|
|
138
|
-
getItems: (ids) => [...ids].map((id) =>
|
|
138
|
+
getItems: (ids) => [...ids].map((id) => {
|
|
139
|
+
var _a;
|
|
140
|
+
return { "text/plain": (_a = list == null ? void 0 : list.getItem(id)) == null ? void 0 : _a.id };
|
|
141
|
+
}),
|
|
139
142
|
onReorder(e) {
|
|
140
143
|
if (e.target.dropPosition === "before") {
|
|
141
144
|
list.move(e.target.key, e.keys);
|
|
@@ -178,7 +181,7 @@ const Repeater = (props) => {
|
|
|
178
181
|
{
|
|
179
182
|
onPress: () => {
|
|
180
183
|
var _a;
|
|
181
|
-
const removedItems = [...((_a = list == null ? void 0 : list.selectedKeys.keys()) == null ? void 0 : _a.map((id) => list.getItem(id))) ?? []];
|
|
184
|
+
const removedItems = [...((_a = list == null ? void 0 : list.selectedKeys.keys()) == null ? void 0 : _a.map((id) => list == null ? void 0 : list.getItem(id))) ?? []];
|
|
182
185
|
list.removeSelectedItems();
|
|
183
186
|
setSelectable(false);
|
|
184
187
|
setCanDelete(false);
|
|
@@ -36,19 +36,20 @@ const ResponsivePreview = (props) => {
|
|
|
36
36
|
var _a, _b;
|
|
37
37
|
const {
|
|
38
38
|
value,
|
|
39
|
-
isDesktopFirst,
|
|
39
|
+
isDesktopFirst: rawIsDesktopFirst,
|
|
40
40
|
breakpoints: rawBreakpoints,
|
|
41
41
|
desktopFirstBreakpoints: rawDesktopFirstBreakpoints,
|
|
42
42
|
options,
|
|
43
43
|
breakpointData,
|
|
44
44
|
breakpointUiData
|
|
45
45
|
} = props;
|
|
46
|
+
const isDesktopFirst = rawIsDesktopFirst ?? (value == null ? void 0 : value["_desktopFirst"]) ?? false;
|
|
46
47
|
const breakpoints = rawBreakpoints;
|
|
47
48
|
const desktopFirstBreakpoints = rawDesktopFirstBreakpoints ?? rawBreakpoints.slice(0, -1);
|
|
48
49
|
const firstMobileFirstOverride = breakpoints.find((breakpoint) => value == null ? void 0 : value[breakpoint]);
|
|
49
50
|
const lastDesktopFirstOverride = desktopFirstBreakpoints.toReversed().find((breakpoint) => value == null ? void 0 : value[breakpoint]);
|
|
50
51
|
let previewItems = [];
|
|
51
|
-
if (firstMobileFirstOverride) {
|
|
52
|
+
if (firstMobileFirstOverride && !isDesktopFirst) {
|
|
52
53
|
previewItems = [
|
|
53
54
|
...previewItems,
|
|
54
55
|
{
|
|
@@ -71,7 +72,7 @@ const ResponsivePreview = (props) => {
|
|
|
71
72
|
];
|
|
72
73
|
});
|
|
73
74
|
}
|
|
74
|
-
if (lastDesktopFirstOverride) {
|
|
75
|
+
if (lastDesktopFirstOverride && isDesktopFirst) {
|
|
75
76
|
desktopFirstBreakpoints.forEach((breakpoint) => {
|
|
76
77
|
var _a2, _b2;
|
|
77
78
|
if (typeof (value == null ? void 0 : value[breakpoint]) === "undefined") {
|
|
@@ -90,13 +91,12 @@ const ResponsivePreview = (props) => {
|
|
|
90
91
|
previewItems = [
|
|
91
92
|
...previewItems,
|
|
92
93
|
{
|
|
93
|
-
alignEnd: true,
|
|
94
94
|
breakpoint: __("Default", "eightshift-ui-components"),
|
|
95
95
|
value: ((_b = options == null ? void 0 : options.find((opt) => opt.value === (value == null ? void 0 : value["_default"]))) == null ? void 0 : _b.label) ?? upperFirst(value == null ? void 0 : value["_default"])
|
|
96
96
|
}
|
|
97
97
|
];
|
|
98
98
|
}
|
|
99
|
-
return /* @__PURE__ */ jsxs("div", { className: "es-uic-flex es-uic-min-w-72 es-uic-flex-col es-uic-items-start es-uic-gap-4 es-uic-p-2", children: [
|
|
99
|
+
return /* @__PURE__ */ jsxs("div", { className: "es-uic-flex es-uic-min-w-72 es-uic-flex-col es-uic-items-start es-uic-gap-4 es-uic-p-2 es-uic-text-sm", children: [
|
|
100
100
|
/* @__PURE__ */ jsxs("div", { className: "es-uic-flex es-uic-w-full es-uic-items-center es-uic-gap-2.5", children: [
|
|
101
101
|
/* @__PURE__ */ jsx(
|
|
102
102
|
RichLabel,
|
|
@@ -18,7 +18,7 @@ import { c as components } from "../../index-a301f526.esm-ByOfDxiG.js";
|
|
|
18
18
|
* @param {string} [props.subtitle] - Subtitle of the component.
|
|
19
19
|
* @param {JSX.Element|JSX.Element[]} [props.actions] - Actions to show to the right of the label.
|
|
20
20
|
* @param {boolean} [props.inline] - Whether the Select menu is displayed inline with the label, to the right.
|
|
21
|
-
* @param {boolean|{label: string, value: string, metadata: Object<string, any>?}[]
|
|
21
|
+
* @param {boolean|{label: string, value: string, metadata: Object<string, any>?}[]} [props.preloadOptions=true] - If `true`, the initial loading is done as soon as the component is loaded. If an array of `{label: '', value: ''}` option is provided, that is loaded immediately, dynamic fetching only happens in search. If `false`, nothing is loaded immediately, fetching only happens when an user types to search.
|
|
22
22
|
* @param {Function<Promise>} props.loadOptions - Async function that returns an array of `{label: '', value: ''}`-formatted items. `loadOptions(searchText: string): Promise<{label: string, value: string, [metadata]: Array}[]>`.
|
|
23
23
|
* @param {{label: string, value: string, metadata: Object<string, any>?}[]} props.value - Current value of the select.
|
|
24
24
|
* @param {Function} props.onChange - Function to call when the value changes.
|
|
@@ -15,8 +15,8 @@ import { c as components } from "../../index-a301f526.esm-ByOfDxiG.js";
|
|
|
15
15
|
* @param {string} [props.subtitle] - Subtitle of the component.
|
|
16
16
|
* @param {JSX.Element|JSX.Element[]} [props.actions] - Actions to show to the right of the label.
|
|
17
17
|
* @param {boolean} [props.inline] - Whether the Select menu is displayed inline with the label, to the right.
|
|
18
|
-
* @param {boolean|{label: string, value: string, metadata: Object<string, any>?}[]
|
|
19
|
-
* @param {Function
|
|
18
|
+
* @param {boolean|{label: string, value: string, metadata: Object<string, any>?}[]} [props.preloadOptions=true] - If `true`, the initial loading is done as soon as the component is loaded. If an array of `{label: '', value: ''}` option is provided, that is loaded immediately, dynamic fetching only happens in search. If `false`, nothing is loaded immediately, fetching only happens when an user types to search.
|
|
19
|
+
* @param {Function} props.loadOptions - Async function that returns an array of `{label: '', value: ''}`-formatted items. `loadOptions(searchText: string): Promise<{label: string, value: string, metadata: Object<string, any>?}[]>`.
|
|
20
20
|
* @param {{label: string, value: string, metadata: Object<string, any>?}} props.value - Current value of the select.
|
|
21
21
|
* @param {Function} props.onChange - Function to call when the value changes.
|
|
22
22
|
* @param {boolean} [props.clearable=false] - Whether the select is clearable.
|
|
@@ -29,6 +29,10 @@ const getValue = (simpleValue, value, options) => {
|
|
|
29
29
|
* @preserve
|
|
30
30
|
*/
|
|
31
31
|
const customOnChange = (simpleValue, newValue, onChange) => {
|
|
32
|
+
if (typeof newValue === "undefined" || newValue === null || newValue === "") {
|
|
33
|
+
onChange(void 0);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
32
36
|
delete newValue.id;
|
|
33
37
|
if (!simpleValue) {
|
|
34
38
|
onChange(newValue);
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
2
2
|
const controlStyles = {
|
|
3
|
-
base: "es-uic-border es-uic-rounded-md es-uic-bg-white es-uic-text-sm es-uic-transition es-uic-group es-uic-shadow-sm !es-uic-min-h-10",
|
|
4
|
-
focus: "es-uic-ring es-uic-ring-teal-500 es-uic-ring-opacity-50"
|
|
5
|
-
nonFocus: "es-uic-border-gray-300"
|
|
3
|
+
base: "es-uic-border es-uic-border-gray-300 es-uic-rounded-md es-uic-bg-white es-uic-text-sm es-uic-transition es-uic-group es-uic-shadow-sm !es-uic-min-h-10",
|
|
4
|
+
focus: "es-uic-ring es-uic-ring-teal-500 es-uic-ring-opacity-50"
|
|
6
5
|
};
|
|
7
6
|
const placeholderStyles = "es-uic-text-gray-400 es-uic-ml-0.5";
|
|
8
7
|
const selectInputStyles = "focus:es-uic-outline-none [&_input]:!es-uic-shadow-none [&_input:focus]:!es-uic-shadow-none";
|
|
9
8
|
const valueContainerStyles = "es-uic-gap-1 es-uic-ml-1 es-uic-my-1 !es-uic-overflow-visible";
|
|
10
9
|
const singleValueStyles = "es-uic-ml-0.5";
|
|
11
10
|
const multiValueStyles = clsx(
|
|
12
|
-
"es-uic-bg-gray-100 es-uic-rounded es-uic-p-1 es-uic-border es-uic-border-gray-100
|
|
11
|
+
"es-uic-bg-gray-100 es-uic-rounded es-uic-p-1 es-uic-border es-uic-border-gray-100 hover:border-gray-300 es-uic-items-center es-uic-gap-1.5 es-uic-transition es-uic-overflow-visible",
|
|
13
12
|
"[:focus-visible_&]:es-uic-outline-none [:focus-visible_&]:es-uic-ring",
|
|
14
13
|
"[:focus-visible_&]:es-uic-ring-teal-500 [:focus-visible_&]:es-uic-ring-opacity-50"
|
|
15
14
|
);
|
|
16
15
|
const multiValueLabelStyles = "es-uic-select-none";
|
|
17
16
|
const multiValueRemoveStyles = "hover:es-uic-bg-red-500/15 hover:es-uic-text-red-900 es-uic-text-gray-500 es-uic-rounded es-uic-p-0.5 [&>svg]:es-uic-size-3.5 [&>svg]:es-uic-stroke-[1.5] es-uic-transition";
|
|
18
|
-
const clearIndicatorStyles = "es-uic-text-gray-500 es-uic-p-1 es-uic-rounded-md
|
|
17
|
+
const clearIndicatorStyles = "es-uic-text-gray-500 es-uic-p-1 es-uic-rounded-md hover:bg-red-50 hover:text-red-800 es-uic-transition";
|
|
19
18
|
const dropdownIndicatorStyles = "es-uic-text-gray-500 es-uic-px-1 group-hover:es-uic-text-black [&>svg]:es-uic-transition-transform [&>svg]:es-uic-duration-500 [&>svg]:es-uic-size-5.5";
|
|
20
19
|
const menuStyles = "es-uic-rounded-md es-uic-border es-uic-border-gray-200 es-uic-bg-white es-uic-shadow-lg es-uic-mt-1 es-uic-text-sm es-uic-overflow-x-hidden";
|
|
21
20
|
const optionStyles = {
|
|
@@ -25,10 +24,11 @@ const optionStyles = {
|
|
|
25
24
|
};
|
|
26
25
|
const noOptionsMessageStyles = "es-uic-text-gray-400 es-uic-p-4";
|
|
27
26
|
const groupHeadingStyles = "es-uic-ml-3 es-uic-mt-2 es-uic-text-gray-500 es-uic-empty:hidden";
|
|
28
|
-
const groupStyles = "es-uic-border-b last:es-uic-border-b-0";
|
|
27
|
+
const groupStyles = "es-uic-border-b es-uic-border-b-gray-200 last:es-uic-border-b-0";
|
|
28
|
+
const loadingMessageStyles = "es-uic-p-4";
|
|
29
29
|
const eightshiftSelectClasses = {
|
|
30
30
|
clearIndicator: () => clearIndicatorStyles,
|
|
31
|
-
control: ({ isFocused }) => clsx(isFocused
|
|
31
|
+
control: ({ isFocused }) => clsx(isFocused && controlStyles.focus, controlStyles.base),
|
|
32
32
|
dropdownIndicator: () => dropdownIndicatorStyles,
|
|
33
33
|
group: () => groupStyles,
|
|
34
34
|
groupHeading: () => groupHeadingStyles,
|
|
@@ -41,7 +41,8 @@ const eightshiftSelectClasses = {
|
|
|
41
41
|
option: ({ isFocused, isSelected }) => clsx(isFocused && optionStyles.focus, isSelected && optionStyles.selected, optionStyles.base),
|
|
42
42
|
placeholder: () => placeholderStyles,
|
|
43
43
|
singleValue: () => singleValueStyles,
|
|
44
|
-
valueContainer: () => valueContainerStyles
|
|
44
|
+
valueContainer: () => valueContainerStyles,
|
|
45
|
+
loadingMessage: () => loadingMessageStyles
|
|
45
46
|
};
|
|
46
47
|
export {
|
|
47
48
|
eightshiftSelectClasses
|
|
@@ -101,10 +101,10 @@ const Slider = (props) => {
|
|
|
101
101
|
step,
|
|
102
102
|
isDisabled: disabled,
|
|
103
103
|
orientation: vertical ? "vertical" : "horizontal",
|
|
104
|
-
className: "es-uic-w-full es-uic-pb-3.5",
|
|
104
|
+
className: clsx("es-uic-w-full", (markerEntries == null ? void 0 : markerEntries.some(([_, value2]) => (value2 == null ? void 0 : value2.length) > 0)) && "es-uic-pb-3.5"),
|
|
105
105
|
onChangeEnd,
|
|
106
106
|
...other,
|
|
107
|
-
children: /* @__PURE__ */
|
|
107
|
+
children: /* @__PURE__ */ jsx(
|
|
108
108
|
BaseControl,
|
|
109
109
|
{
|
|
110
110
|
icon,
|
|
@@ -128,8 +128,7 @@ const Slider = (props) => {
|
|
|
128
128
|
] }),
|
|
129
129
|
labelAs: $01b77f81d0f07f68$export$b04be29aa201d4f5,
|
|
130
130
|
className: labelClassName,
|
|
131
|
-
|
|
132
|
-
children: [
|
|
131
|
+
children: /* @__PURE__ */ jsxs("div", { className: clsx("es-uic-flex es-uic-items-center es-uic-gap-2.5 !es-uic-space-y-0", vertical && "es-uic-flex-col"), children: [
|
|
133
132
|
before && /* @__PURE__ */ jsx("div", { className: "es-uic-flex es-uic-shrink-0 es-uic-items-center es-uic-gap-1", children: before }),
|
|
134
133
|
/* @__PURE__ */ jsx(
|
|
135
134
|
$6f909507e6374d18$export$105594979f116971,
|
|
@@ -312,7 +311,7 @@ const Slider = (props) => {
|
|
|
312
311
|
}
|
|
313
312
|
),
|
|
314
313
|
after && /* @__PURE__ */ jsx("div", { className: "es-uic-flex es-uic-shrink-0 es-uic-items-center es-uic-gap-1", children: after })
|
|
315
|
-
]
|
|
314
|
+
] })
|
|
316
315
|
}
|
|
317
316
|
)
|
|
318
317
|
}
|
|
@@ -468,7 +468,7 @@ const Tabs = (props) => {
|
|
|
468
468
|
cloneElement(child, {
|
|
469
469
|
id: `tab-${baseId}-${tabPanelCounter++}`,
|
|
470
470
|
key: index,
|
|
471
|
-
className: clsx(child.props.className, vertical && "es-uic-border-l es-uic-border-l-300 es-uic-pl-3")
|
|
471
|
+
className: clsx(child.props.className, vertical && "es-uic-border-l es-uic-border-l-gray-300 es-uic-pl-3")
|
|
472
472
|
})
|
|
473
473
|
];
|
|
474
474
|
}
|
package/dist/index.js
CHANGED
|
@@ -24,7 +24,7 @@ import { MediaPlaceholder } from "./components/placeholders/media-placeholder.js
|
|
|
24
24
|
import { Menu, MenuItem, MenuSection, MenuSeparator, SubMenuItem } from "./components/menu/menu.js";
|
|
25
25
|
import { Notice } from "./components/notice/notice.js";
|
|
26
26
|
import { NumberPicker } from "./components/number-picker/number-picker.js";
|
|
27
|
-
import { P, T } from "./popover-
|
|
27
|
+
import { P, T } from "./popover-CdonDPqG.js";
|
|
28
28
|
import { RadioButton, RadioButtonGroup } from "./components/radio/radio.js";
|
|
29
29
|
import { Repeater } from "./components/repeater/repeater.js";
|
|
30
30
|
import { RepeaterItem } from "./components/repeater/repeater-item.js";
|
|
@@ -958,6 +958,7 @@ const Popover = (props) => {
|
|
|
958
958
|
* @param {number} props.offset - Offset from the trigger element, on the same axis as the placement of the popover (e.g. if `placement` is `left`, this controls the horizontal spacing from the element).
|
|
959
959
|
* @param {number} props.crossOffset - Offset from the trigger element, on the opposite axis as the placement of the popover (e.g. if `placement` is `left`, this controls the vertical spacing from the element).
|
|
960
960
|
* @param {number} props.containerPadding - Space that should be left between the popover and the edge of the container (the default container is browser window).
|
|
961
|
+
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
961
962
|
*
|
|
962
963
|
* @returns {JSX.Element} The TriggeredPopover component.
|
|
963
964
|
*
|
|
@@ -985,8 +986,12 @@ const TriggeredPopover = (props) => {
|
|
|
985
986
|
offset,
|
|
986
987
|
crossOffset,
|
|
987
988
|
containerPadding,
|
|
989
|
+
hidden,
|
|
988
990
|
...rest
|
|
989
991
|
} = props;
|
|
992
|
+
if (hidden) {
|
|
993
|
+
return null;
|
|
994
|
+
}
|
|
990
995
|
return /* @__PURE__ */ jsxs($de32f1b87079253c$export$2e1e1122cf0cba88, { onOpenChange, children: [
|
|
991
996
|
trigger,
|
|
992
997
|
!trigger && /* @__PURE__ */ jsx(
|