@eightshift/ui-components 1.9.1 → 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-BEIi9mB_.js → Button-OQ5EIPvt.js} +8 -8
- package/dist/{SelectionManager-DGbP8Ntl.js → Collection-CJM_asJz.js} +345 -197
- package/dist/{Color-CZxTZUqH.js → Color-B0HgM8f4.js} +1 -1
- package/dist/{ColorSwatch-Iijp9hzP.js → ColorSwatch-Dv3Wxdl_.js} +6 -7
- package/dist/{ComboBox-DVPU5XzU.js → ComboBox-BnlZjJ3T.js} +21 -22
- package/dist/{Dialog-17uxPRe5.js → Dialog-CIh-hX93.js} +77 -65
- package/dist/{FieldError-huHsqqMP.js → FieldError-D7A6s7O5.js} +2 -2
- package/dist/{FocusScope-7r2_SUa9.js → FocusScope-Cs5_OoeA.js} +6 -4
- package/dist/{Group-k_oyd3Te.js → Group-D6tr3U_n.js} +5 -6
- package/dist/{Heading-DRBzKYHb.js → Heading-DiYTXoIW.js} +3 -4
- package/dist/{Hidden-5cXbU70C.js → Hidden-DnOd_jPX.js} +2 -2
- package/dist/{Input-DCmTv_Qw.js → Input-Se0m3ubj.js} +13 -11
- package/dist/{Label-D8G0GMsc.js → Label-Ca9uelsn.js} +4 -5
- package/dist/{List-C7L49CxW.js → List-Br274SP1.js} +16 -8
- package/dist/{ListBox-BxZwDp9o.js → ListBox-D9dFEh5A.js} +36 -23
- package/dist/{OverlayArrow-Dca2JXYU.js → OverlayArrow-1jx-ZyCR.js} +75 -13
- package/dist/{Select-aab027f3.esm-OvJ8lZs8.js → Select-aab027f3.esm-HFNIFFya.js} +4 -4
- package/dist/{Separator-B_VdRHCf.js → Separator-BhZycTUp.js} +9 -7
- package/dist/{Slider-CgEZmlNY.js → Slider-BZNaJylD.js} +20 -24
- package/dist/{Text-Cld9rkzJ.js → Text-aOUPPvTO.js} +3 -4
- package/dist/{VisuallyHidden-D0lsNfi4.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-DtrQ3I5U.js → context-CDOs-GuR.js} +1 -1
- package/dist/{focusSafely-ChK5oW-0.js → focusSafely-CiqTTjWy.js} +18 -17
- package/dist/icons/icons.js +52 -0
- package/dist/{index-641ee5b8.esm-DRaWil7u.js → index-641ee5b8.esm-DbdaYaxR.js} +45 -45
- package/dist/{index-D0mHceYg.js → index-BRp93Yfa.js} +24 -31
- package/dist/index-CcCn9HWX.js +44 -0
- package/dist/index.js +2 -3
- package/dist/{multi-select-components-2Ax71j9a.js → multi-select-components-CkF3LyTF.js} +4 -4
- package/dist/{react-select-async.esm-BZwl7Ddb.js → react-select-async.esm-DcVLw9X5.js} +3 -3
- package/dist/{react-select.esm-DI0eSkd8.js → react-select.esm-OZ0cmTjg.js} +3 -3
- package/dist/style-editor.js +1 -0
- package/dist/style.js +1 -1
- package/dist/{textSelection-CdZPiDxh.js → textSelection-BlTDSskG.js} +2 -2
- package/dist/{useButton-C5e_EJlC.js → useButton-CmLbE5vg.js} +3 -3
- package/dist/{useEvent-BW_vevRp.js → useEvent-cLDJlznQ.js} +1 -1
- package/dist/{useFocusRing-Dbj6MsFR.js → useFocusRing-CGp3guTX.js} +1 -1
- package/dist/{useFocusable-C2xrPFl6.js → useFocusable-087cO5Ct.js} +9 -6
- package/dist/{useFormReset-DDCE2RPv.js → useFormReset-NpLM2e3G.js} +1 -1
- package/dist/{useFormValidation-BxnASugK.js → useFormValidation-BWwmZQE2.js} +3 -3
- package/dist/{useLabel-C3sAYsiC.js → useLabel-C85N3Hzw.js} +2 -2
- package/dist/{useLabels-WnPbJUyQ.js → useLabels-C_2wWraB.js} +1 -1
- package/dist/{useListState-BmTFGt2_.js → useListState-Z7FB_NzO.js} +1 -1
- package/dist/{useLocalizedStringFormatter-BurzRhbk.js → useLocalizedStringFormatter-BQ4TF72x.js} +1 -1
- package/dist/{useNumberField-D_Azw6A1.js → useNumberField-Bm6_BVl9.js} +10 -10
- package/dist/{useNumberFormatter-B58dTQ-c.js → useNumberFormatter-DlUVKkO7.js} +1 -1
- package/dist/{usePress-DZ9pn6Jl.js → usePress-rg_OQIGW.js} +15 -14
- package/dist/{useSingleSelectListState-Dr843geC.js → useSingleSelectListState-Cu3xtEJS.js} +2 -2
- package/dist/{useToggle-Dq9VpeCd.js → useToggle-DzlgBLAJ.js} +4 -4
- package/dist/{useToggleState-DA_b3LG_.js → useToggleState-DhSBQxkp.js} +1 -1
- package/dist/{utils-BmaSD6gC.js → utils-39D0mStj.js} +41 -93
- package/package.json +40 -38
- 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
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { $ as $eed445e0843c11d0$export$41f133550aa26f48, a as $eed445e0843c11d0$export$a11e76429ed99b4 } from "../../ListBox-BxZwDp9o.js";
|
|
3
|
-
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
4
|
-
import { BaseControl } from "../base-control/base-control.js";
|
|
5
|
-
import { _ as __ } from "../../default-i18n-CM1-Xvzf.js";
|
|
6
|
-
import { RichLabel } from "../rich-label/rich-label.js";
|
|
7
|
-
/**
|
|
8
|
-
* A component that allows selecting a single or multiple options from a list.
|
|
9
|
-
*
|
|
10
|
-
* @component
|
|
11
|
-
* @param {Object} props - Component props.
|
|
12
|
-
* @param {JSX.Element} [props.icon] - Icon to display in the label.
|
|
13
|
-
* @param {string} [props.label] - Label to display.
|
|
14
|
-
* @param {string} [props.subtitle] - Subtitle to display.
|
|
15
|
-
* @param {JSX.Element|JSX.Element[]} [props.actions] - Actions to display in the header.
|
|
16
|
-
* @param {string} [props.help] - Help text to display below the list.
|
|
17
|
-
* @param {boolean} [props.inline] - If `true`, the list is displayed inline with the label.
|
|
18
|
-
* @param {Object[]} props.options - The list of options to display.
|
|
19
|
-
* @param {string} props.options[].value - The value of the option. Should be unique!
|
|
20
|
-
* @param {string} [props.options[].label] - The label of the option.
|
|
21
|
-
* @param {JSX.Element} [props.options[].icon] - The icon of the option.
|
|
22
|
-
* @param {string} [props.options[].subtitle] - The subtitle of the option.
|
|
23
|
-
* @param {string} [props.options[].tooltip] - The tooltip text of the option.
|
|
24
|
-
* @param {boolean} [props.options[].disabled] - If `true`, the option is cannot be selected.
|
|
25
|
-
* @param {ListBoxSelectionMode} [props.selectionMode='single'] - The selection mode.
|
|
26
|
-
* @param {string} props.value - The currently selected value.
|
|
27
|
-
* @param {Function} props.onChange - Function to run when the selection changes.
|
|
28
|
-
* @param {boolean} [props.canDeselect=false] - If `true`, the selected value can be deselected (`null` is set in that case).
|
|
29
|
-
* @param {ListBoxOrientation} [props.orientation='horizontal'] - The orientation of the list. If all options have only an icon set, the orientation is forced to be horizontal.
|
|
30
|
-
* @param {string} [props.className] - Classes to pass to the list.
|
|
31
|
-
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
32
|
-
*
|
|
33
|
-
* @returns {JSX.Element} The ListBox component.
|
|
34
|
-
*
|
|
35
|
-
* @typedef {'single' | 'multiple'} ListBoxSelectionMode
|
|
36
|
-
* @typedef {'horizontal' | 'vertical' | 'horizontal-tiles'} ListBoxOrientation
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* <ListBox
|
|
40
|
-
* label='My list'
|
|
41
|
-
* options={[
|
|
42
|
-
* { value: 'option1', label: 'Option 1' },
|
|
43
|
-
* { value: 'option2', label: 'Option 2' },
|
|
44
|
-
* ]}
|
|
45
|
-
* value={selectedValue}
|
|
46
|
-
* onChange={setSelectedValue}
|
|
47
|
-
* />
|
|
48
|
-
*
|
|
49
|
-
* @preserve
|
|
50
|
-
*/
|
|
51
|
-
const ListBox = (props) => {
|
|
52
|
-
const {
|
|
53
|
-
icon,
|
|
54
|
-
label,
|
|
55
|
-
subtitle,
|
|
56
|
-
actions,
|
|
57
|
-
help,
|
|
58
|
-
inline,
|
|
59
|
-
options,
|
|
60
|
-
"aria-label": ariaLabel,
|
|
61
|
-
selectionMode = "single",
|
|
62
|
-
value,
|
|
63
|
-
onChange,
|
|
64
|
-
canDeselect = false,
|
|
65
|
-
orientation: setOrientation = "horizontal",
|
|
66
|
-
className,
|
|
67
|
-
hidden,
|
|
68
|
-
...rest
|
|
69
|
-
} = props;
|
|
70
|
-
if (hidden) {
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
const mappedOptions = options.map((option) => ({
|
|
74
|
-
...option,
|
|
75
|
-
id: option.id ?? option.value
|
|
76
|
-
}));
|
|
77
|
-
let orientation = setOrientation;
|
|
78
|
-
if (options.every(({ icon: icon2, label: label2, subtitle: subtitle2 }) => icon2 && !label2 && !subtitle2)) {
|
|
79
|
-
orientation = "horizontal";
|
|
80
|
-
}
|
|
81
|
-
let orientationPropValue = orientation;
|
|
82
|
-
if (orientation === "horizontal-tiles") {
|
|
83
|
-
orientationPropValue = "horizontal";
|
|
84
|
-
}
|
|
85
|
-
return /* @__PURE__ */ jsx(
|
|
86
|
-
BaseControl,
|
|
87
|
-
{
|
|
88
|
-
icon,
|
|
89
|
-
label,
|
|
90
|
-
subtitle,
|
|
91
|
-
actions,
|
|
92
|
-
inline,
|
|
93
|
-
help,
|
|
94
|
-
children: /* @__PURE__ */ jsx(
|
|
95
|
-
$eed445e0843c11d0$export$41f133550aa26f48,
|
|
96
|
-
{
|
|
97
|
-
selectionMode,
|
|
98
|
-
className: clsx(
|
|
99
|
-
"es-uic-rounded-lg es-uic-border es-uic-border-gray-300 es-uic-p-1 es-uic-text-sm es-uic-shadow-sm es-uic-transition",
|
|
100
|
-
"focus:es-uic-outline-none",
|
|
101
|
-
orientation === "horizontal" && "es-uic-flex es-uic-w-fit es-uic-max-w-full es-uic-gap-0.5",
|
|
102
|
-
orientation === "vertical" && "es-uic-flex es-uic-flex-col es-uic-gap-0.5",
|
|
103
|
-
orientation === "horizontal-tiles" && "es-uic-grid es-uic-min-h-20 es-uic-w-fit es-uic-max-w-full es-uic-auto-cols-[fit-content(6rem)] es-uic-grid-rows-[1fr,_minmax(auto,_0.5fr),_auto] es-uic-gap-x-0.5",
|
|
104
|
-
className
|
|
105
|
-
),
|
|
106
|
-
"aria-label": ariaLabel ?? __("Choose", "eightshift-ui-components"),
|
|
107
|
-
items: mappedOptions,
|
|
108
|
-
disallowEmptySelection: !canDeselect,
|
|
109
|
-
orientation: orientationPropValue,
|
|
110
|
-
selectedKeys: [value],
|
|
111
|
-
onSelectionChange: (key) => {
|
|
112
|
-
onChange((key == null ? void 0 : key.currentKey) ?? (key == null ? void 0 : key.anchorKey));
|
|
113
|
-
},
|
|
114
|
-
...rest,
|
|
115
|
-
children: (item) => {
|
|
116
|
-
const { label: label2, icon: icon2, subtitle: subtitle2, tooltip, disabled } = item;
|
|
117
|
-
return /* @__PURE__ */ jsx(
|
|
118
|
-
$eed445e0843c11d0$export$a11e76429ed99b4,
|
|
119
|
-
{
|
|
120
|
-
textValue: label2 ?? tooltip,
|
|
121
|
-
isDisabled: disabled,
|
|
122
|
-
className: ({ isDisabled, isSelected }) => {
|
|
123
|
-
return clsx(
|
|
124
|
-
"es-uic-flex es-uic-min-h-9 es-uic-select-none es-uic-rounded-md es-uic-border es-uic-transition",
|
|
125
|
-
"focus:es-uic-outline-none focus-visible:es-uic-outline-none focus-visible:es-uic-ring focus-visible:es-uic-ring-teal-500 focus-visible:es-uic-ring-opacity-50",
|
|
126
|
-
isSelected && !disabled && "es-uic-border es-uic-border-teal-600 es-uic-bg-teal-600 es-uic-text-white es-uic-shadow-md es-uic-shadow-teal-500/25 after:es-uic-opacity-45",
|
|
127
|
-
isSelected && !disabled && 'es-uic-relative es-uic-isolate after:es-uic-absolute after:es-uic-inset-0 after:-es-uic-z-10 after:es-uic-rounded-[0.3125rem] after:es-uic-bg-gradient-to-br after:es-uic-from-teal-100/40 after:es-uic-via-transparent after:es-uic-to-teal-200/50 after:es-uic-opacity-0 after:es-uic-transition-opacity after:es-uic-content-[""]',
|
|
128
|
-
!isSelected && !disabled && "es-uic-border-transparent hover:es-uic-bg-gray-100",
|
|
129
|
-
isDisabled && "es-uic-border-transparent es-uic-opacity-30 es-uic-grayscale",
|
|
130
|
-
orientation !== "horizontal-tiles" && "es-uic-px-2 es-uic-py-1.5",
|
|
131
|
-
icon2 && !label2 && !subtitle2 && "es-uic-size-9 !es-uic-p-1.5",
|
|
132
|
-
orientation === "horizontal-tiles" && "es-uic-row-start-1 es-uic-row-end-4 es-uic-grid es-uic-min-w-18 es-uic-grid-rows-subgrid es-uic-items-center es-uic-justify-items-center es-uic-p-1.5 es-uic-text-center es-uic-leading-tight",
|
|
133
|
-
orientation === "horizontal-tiles" && subtitle2 && "[&_svg]:es-uic-mb-1"
|
|
134
|
-
);
|
|
135
|
-
},
|
|
136
|
-
children: /* @__PURE__ */ jsx(
|
|
137
|
-
RichLabel,
|
|
138
|
-
{
|
|
139
|
-
icon: icon2,
|
|
140
|
-
label: label2,
|
|
141
|
-
subtitle: subtitle2,
|
|
142
|
-
className: clsx(orientation === "horizontal" && "leading-none"),
|
|
143
|
-
contentsOnly: orientation === "horizontal-tiles",
|
|
144
|
-
noColor: true
|
|
145
|
-
}
|
|
146
|
-
)
|
|
147
|
-
}
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
)
|
|
152
|
-
}
|
|
153
|
-
);
|
|
154
|
-
};
|
|
155
|
-
export {
|
|
156
|
-
ListBox
|
|
157
|
-
};
|
package/dist/fonts.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './assets/fonts.css';
|