@eightshift/ui-components 3.0.1 → 5.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/package.json +101 -101
- package/dist/Button-BPLceDeW.js +0 -185
- package/dist/Collection-CZxddMZS.js +0 -2332
- package/dist/Color-MV5kBVXr.js +0 -2452
- package/dist/ColorSwatch-BqQfVu4L.js +0 -64
- package/dist/ComboBox-_RfyhwZw.js +0 -1906
- package/dist/Dialog-8tYeQ9n4.js +0 -2300
- package/dist/FieldError-52GVSGgC.js +0 -42
- package/dist/FocusScope-Cri5BFRz.js +0 -831
- package/dist/Form-Cq3fu75_.js +0 -5
- package/dist/Group-_emcIVxI.js +0 -48
- package/dist/Heading-B2153VXe.js +0 -16
- package/dist/Hidden-rE6uR-lr.js +0 -41
- package/dist/Input-BxpFEIXV.js +0 -133
- package/dist/Label-icmbmNdI.js +0 -17
- package/dist/List-CZMUbkFU.js +0 -593
- package/dist/ListBox-Ca6hiCqz.js +0 -581
- package/dist/NumberFormatter-DA8u1Ot7.js +0 -140
- package/dist/OverlayArrow-CYXQSlEU.js +0 -629
- package/dist/RSPContexts-2lR5GG9p.js +0 -14
- package/dist/Select-aab027f3.esm-PDJCDE95.js +0 -2469
- package/dist/Separator-4IIDRlV_.js +0 -322
- package/dist/Slider-rz2XRMGm.js +0 -853
- package/dist/Text-DVSAPY-K.js +0 -16
- package/dist/VisuallyHidden-f9zX67a_.js +0 -48
- package/dist/_commonjsHelpers-CUmg6egw.js +0 -6
- package/dist/assets/index.css +0 -37
- package/dist/assets/style-admin.css +0 -5255
- package/dist/assets/style-editor.css +0 -5255
- package/dist/assets/style.css +0 -5261
- package/dist/assets/wp-font-enhancements.css +0 -8
- package/dist/assets/wp-ui-enhancements.css +0 -299
- package/dist/components/animated-visibility/animated-visibility.js +0 -105
- package/dist/components/base-control/base-control.js +0 -86
- package/dist/components/breakpoint-preview/breakpoint-preview.js +0 -161
- package/dist/components/button/button.js +0 -387
- package/dist/components/checkbox/checkbox.js +0 -320
- package/dist/components/color-pickers/color-picker.js +0 -272
- package/dist/components/color-pickers/color-swatch.js +0 -58
- package/dist/components/color-pickers/gradient-editor.js +0 -534
- package/dist/components/color-pickers/solid-color-picker.js +0 -1567
- package/dist/components/component-toggle/component-toggle.js +0 -158
- package/dist/components/container-panel/container-panel.js +0 -131
- package/dist/components/draggable/draggable-context.js +0 -5
- package/dist/components/draggable/draggable-handle.js +0 -46
- package/dist/components/draggable/draggable.js +0 -6207
- package/dist/components/draggable-list/draggable-list-context.js +0 -5
- package/dist/components/draggable-list/draggable-list-item.js +0 -77
- package/dist/components/draggable-list/draggable-list.js +0 -151
- package/dist/components/expandable/expandable.js +0 -342
- package/dist/components/index.js +0 -137
- package/dist/components/input-field/input-field.js +0 -231
- package/dist/components/item-collection/item-collection.js +0 -59
- package/dist/components/layout/hstack.js +0 -30
- package/dist/components/layout/vstack.js +0 -30
- package/dist/components/link-input/link-input.js +0 -293
- package/dist/components/matrix-align/matrix-align.js +0 -134
- package/dist/components/menu/menu.js +0 -285
- package/dist/components/modal/modal.js +0 -305
- package/dist/components/notice/notice.js +0 -123
- package/dist/components/number-picker/number-picker.js +0 -292
- package/dist/components/option-select/option-select.js +0 -264
- package/dist/components/options-panel/options-panel.js +0 -158
- package/dist/components/placeholders/file-placeholder.js +0 -42
- package/dist/components/placeholders/image-placeholder.js +0 -88
- package/dist/components/placeholders/media-placeholder.js +0 -63
- package/dist/components/popover/popover.js +0 -207
- package/dist/components/radio/radio.js +0 -579
- package/dist/components/repeater/repeater-context.js +0 -5
- package/dist/components/repeater/repeater-item.js +0 -119
- package/dist/components/repeater/repeater.js +0 -280
- package/dist/components/responsive/mini-responsive.js +0 -498
- package/dist/components/responsive/responsive-legacy.js +0 -343
- package/dist/components/responsive/responsive.js +0 -580
- package/dist/components/responsive-preview/responsive-preview.js +0 -123
- package/dist/components/rich-label/rich-label.js +0 -66
- package/dist/components/select/async-multi-select.js +0 -157
- package/dist/components/select/async-single-select.js +0 -137
- package/dist/components/select/custom-select-default-components.js +0 -38
- package/dist/components/select/multi-select-components.js +0 -8
- package/dist/components/select/multi-select.js +0 -151
- package/dist/components/select/react-select-component-wrappers.js +0 -90
- package/dist/components/select/shared.js +0 -26
- package/dist/components/select/single-select.js +0 -131
- package/dist/components/select/styles.js +0 -49
- package/dist/components/select/v2/async-select.js +0 -297
- package/dist/components/select/v2/shared.js +0 -24
- package/dist/components/select/v2/single-select.js +0 -990
- package/dist/components/slider/column-config-slider.js +0 -210
- package/dist/components/slider/slider.js +0 -343
- package/dist/components/slider/utils.js +0 -84
- package/dist/components/spacer/spacer.js +0 -97
- package/dist/components/tabs/tabs.js +0 -702
- package/dist/components/toggle/switch.js +0 -155
- package/dist/components/toggle/toggle.js +0 -64
- package/dist/components/toggle-button/toggle-button.js +0 -324
- package/dist/components/tooltip/tooltip.js +0 -525
- package/dist/context-D2KUdwNL.js +0 -92
- package/dist/default-i18n-CT_oS1Fy.js +0 -922
- package/dist/filterDOMProps-EDDcM64A.js +0 -28
- package/dist/icons/block-icon.js +0 -42
- package/dist/icons/generic-color-swatch.js +0 -113
- package/dist/icons/icons.js +0 -30371
- package/dist/icons/index.js +0 -11
- package/dist/icons/jsx-svg.js +0 -50
- package/dist/index-641ee5b8.esm-DIuJijyT.js +0 -3137
- package/dist/index-BKGQ6jGS.js +0 -44
- package/dist/index-CFozsmNS.js +0 -28321
- package/dist/index.js +0 -139
- package/dist/lite-DVmmD_-j.js +0 -7
- package/dist/modifiers.esm-BuJQPI1X.js +0 -31
- package/dist/multi-select-components-Sp-JEFEX.js +0 -3744
- package/dist/number-GajL10e1.js +0 -36
- package/dist/react-jsx-parser.min-DZCiis5V.js +0 -11753
- package/dist/react-select-async.esm-Bql4G5iV.js +0 -107
- package/dist/react-select.esm-B_TudhTU.js +0 -15
- package/dist/style-admin.js +0 -1
- package/dist/style-editor.js +0 -1
- package/dist/style.js +0 -1
- package/dist/textSelection-0UUS8Yfg.js +0 -46
- package/dist/useButton-Cg474OYB.js +0 -71
- package/dist/useEvent-B0b-6KBr.js +0 -23
- package/dist/useFocusRing-CV5l3lf6.js +0 -107
- package/dist/useFormReset-C5OggHsw.js +0 -22
- package/dist/useFormValidation-DhDNSjws.js +0 -224
- package/dist/useHover-DwDr6ozG.js +0 -900
- package/dist/useLabel-D7HkNEHT.js +0 -27
- package/dist/useLabels-D8cxd1Z8.js +0 -23
- package/dist/useListState-DVr6aYd_.js +0 -161
- package/dist/useLocalizedStringFormatter-CFP1YZWQ.js +0 -121
- package/dist/useNumberField-TwM0Z9D1.js +0 -1204
- package/dist/useNumberFormatter-321rAb4J.js +0 -13
- package/dist/usePress-Cucx-xSA.js +0 -664
- package/dist/useSingleSelectListState-CMGsRHHh.js +0 -38
- package/dist/useToggle-C0I3vs0g.js +0 -59
- package/dist/useToggleState-CmQX3SoX.js +0 -19
- package/dist/utilities/array-helpers.js +0 -56
- package/dist/utilities/debounce-throttle.js +0 -123
- package/dist/utilities/es-dash.js +0 -376
- package/dist/utilities/index.js +0 -27
- package/dist/utilities/text-helpers.js +0 -136
- package/dist/utils-DkCSC521.js +0 -370
- package/dist/wp/wp-font-enhancements.js +0 -1
- package/dist/wp/wp-ui-enhancements.js +0 -1
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
3
|
-
import { RichLabel } from "../rich-label/rich-label.js";
|
|
4
|
-
import { $ as $5cb03073d3f54797$export$a8a3e93435678ff9 } from "../../Heading-B2153VXe.js";
|
|
5
|
-
/**
|
|
6
|
-
* Component that provides a container panel for options, with an optional title.
|
|
7
|
-
* Best used within the Gutenberg sidebar, instead of the default `PanelBody` component.
|
|
8
|
-
* Ensures that the content is spaced nicely.
|
|
9
|
-
*
|
|
10
|
-
* @component
|
|
11
|
-
* @param {Object} props - Component props.
|
|
12
|
-
* @param {string} [props.className] - Classes to pass to the container.
|
|
13
|
-
* @param {string} [props.title] - Title to display on the top of the panel.
|
|
14
|
-
* @param {JSX.Element} [props.icon] - Icon to display on the top of the panel.
|
|
15
|
-
* @param {string} [props.subtitle] - Subtitle to display on the top of the panel.
|
|
16
|
-
* @param {string} [props.help] - Help text to show below the panel.
|
|
17
|
-
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
18
|
-
*
|
|
19
|
-
* @returns {JSX.Element} The OptionsPanel component.
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* <OptionsPanel title='Paragraph'>
|
|
23
|
-
* ...
|
|
24
|
-
* </OptionsPanel>
|
|
25
|
-
*
|
|
26
|
-
* @preserve
|
|
27
|
-
*/
|
|
28
|
-
const OptionsPanel = (props) => {
|
|
29
|
-
const { children, className, title, icon, subtitle, help, hidden } = props;
|
|
30
|
-
if (hidden) {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
return /* @__PURE__ */ jsxs("div", { className: "es:not-last:mb-10", children: [
|
|
34
|
-
/* @__PURE__ */ jsxs("div", { className: clsx("es:bg-white es:rounded-xl es:border es:border-secondary-300 es:overflow-clip es:max-w-lg es:shadow-xs", className), children: [
|
|
35
|
-
title && /* @__PURE__ */ jsx(
|
|
36
|
-
RichLabel,
|
|
37
|
-
{
|
|
38
|
-
icon,
|
|
39
|
-
label: title,
|
|
40
|
-
subtitle,
|
|
41
|
-
className: clsx(
|
|
42
|
-
"es:bg-secondary-50 es:shrink-0 es:text-secondary-700 es:px-4 es:**:first:text-base! es:border-b es:border-b-secondary-200",
|
|
43
|
-
subtitle ? "es:py-3" : "es:pt-2.25 es:pb-1.75"
|
|
44
|
-
),
|
|
45
|
-
noColor: true
|
|
46
|
-
}
|
|
47
|
-
),
|
|
48
|
-
/* @__PURE__ */ jsx("div", { className: "es:divide-y es:divide-secondary-200/75 es:py-4", children })
|
|
49
|
-
] }),
|
|
50
|
-
help && /* @__PURE__ */ jsx("span", { className: "es:mx-0.5 es:mt-1 es:block es:text-sm es:text-secondary-400", children: help })
|
|
51
|
-
] });
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Component that provides a container for grouping related options within the `OptionsPanel` component.
|
|
55
|
-
*
|
|
56
|
-
* @component
|
|
57
|
-
* @param {Object} props - Component props.
|
|
58
|
-
* @param {string} [props.className] - Classes to pass to the container.
|
|
59
|
-
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
60
|
-
*
|
|
61
|
-
* @returns {JSX.Element} The OptionsPanelSection component.
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* <OptionsPanelSection>
|
|
65
|
-
* ...
|
|
66
|
-
* </OptionsPanelSection>
|
|
67
|
-
*
|
|
68
|
-
* @preserve
|
|
69
|
-
*/
|
|
70
|
-
const OptionsPanelSection = ({ children, className, hidden }) => {
|
|
71
|
-
if (hidden) {
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
return /* @__PURE__ */ jsx("div", { className: clsx("es:space-y-2.5 es:not-last:pb-4 es:not-first:pt-4 es:px-4", className), children });
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* Component that provides a header for the top of an options page.
|
|
78
|
-
*
|
|
79
|
-
* @component
|
|
80
|
-
* @param {Object} props - Component props.
|
|
81
|
-
* @param {boolean} [props.sticky] - If `true`, the header will be sticky (scroll with content). Make sure to pass a background color!
|
|
82
|
-
* @param {string} [props.title] - Title to show.
|
|
83
|
-
* @param {Number} [props.level=2] - Heading level of the title.
|
|
84
|
-
* @param {string} [props.className] - Classes to pass to the container.
|
|
85
|
-
* @param {boolean} [props.limitWidth] - If `true`, the width is limited.
|
|
86
|
-
* @param {JSX.Element|JSX.Element[]} [props.actions] - Controls to show on the right side of the header.
|
|
87
|
-
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
88
|
-
*
|
|
89
|
-
* @returns {JSX.Element} The OptionsPanelHeader component.
|
|
90
|
-
*
|
|
91
|
-
* @example
|
|
92
|
-
* <OptionsPanelHeader title='Theme options'>
|
|
93
|
-
* ...
|
|
94
|
-
* </OptionsPanelHeader>
|
|
95
|
-
*
|
|
96
|
-
* @preserve
|
|
97
|
-
*/
|
|
98
|
-
const OptionsPanelHeader = ({ children, sticky, title, className, actions, level = 2, limitWidth, hidden }) => {
|
|
99
|
-
if (hidden) {
|
|
100
|
-
return null;
|
|
101
|
-
}
|
|
102
|
-
return /* @__PURE__ */ jsxs("div", { className: clsx("es:space-y-2.5", limitWidth && "es:max-w-md", sticky && "es:sticky es:top-0 es:z-10 es:bg-white", className), children: [
|
|
103
|
-
/* @__PURE__ */ jsxs("div", { className: "es:flex es:flex-wrap es:items-center es:justify-between es:gap-x-8 es:gap-y-4", children: [
|
|
104
|
-
/* @__PURE__ */ jsx(
|
|
105
|
-
$5cb03073d3f54797$export$a8a3e93435678ff9,
|
|
106
|
-
{
|
|
107
|
-
className: "es:text-2xl es:font-medium es:tracking-tight",
|
|
108
|
-
level,
|
|
109
|
-
children: title
|
|
110
|
-
}
|
|
111
|
-
),
|
|
112
|
-
/* @__PURE__ */ jsx("div", { className: "es:flex es:items-center es:gap-2", children: actions })
|
|
113
|
-
] }),
|
|
114
|
-
children
|
|
115
|
-
] });
|
|
116
|
-
};
|
|
117
|
-
/**
|
|
118
|
-
* Component that provides an intro for an options page.
|
|
119
|
-
*
|
|
120
|
-
* @component
|
|
121
|
-
* @param {Object} props - Component props.
|
|
122
|
-
* @param {string} [props.title] - Title to show.
|
|
123
|
-
* @param {string} [props.subtitle] - Subtitle to show.
|
|
124
|
-
* @param {Number} [props.level=2] - Heading level of the title.
|
|
125
|
-
* @param {string} [props.className] - Classes to pass to the container.
|
|
126
|
-
* @param {JSX.Element|JSX.Element[]} [props.actions] - Controls to show on the right side of the header.
|
|
127
|
-
* @param {boolean} [props.border] - If `true`, a border is shown below the text.
|
|
128
|
-
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
129
|
-
*
|
|
130
|
-
* @returns {JSX.Element} The OptionsPanelIntro component.
|
|
131
|
-
*
|
|
132
|
-
* @example
|
|
133
|
-
* <OptionsPanelIntro title='Theme options' />
|
|
134
|
-
*
|
|
135
|
-
* @preserve
|
|
136
|
-
*/
|
|
137
|
-
const OptionsPanelIntro = ({ title, subtitle, className, level = 3, border, hidden }) => {
|
|
138
|
-
if (hidden) {
|
|
139
|
-
return null;
|
|
140
|
-
}
|
|
141
|
-
return /* @__PURE__ */ jsxs("div", { className: clsx("es:pb-2.5", border && "es:mb-5 es:border-b es:border-b-secondary-200", className), children: [
|
|
142
|
-
/* @__PURE__ */ jsx(
|
|
143
|
-
$5cb03073d3f54797$export$a8a3e93435678ff9,
|
|
144
|
-
{
|
|
145
|
-
className: "es:text-lg es:tracking-tight es:text-secondary-800",
|
|
146
|
-
level,
|
|
147
|
-
children: title
|
|
148
|
-
}
|
|
149
|
-
),
|
|
150
|
-
subtitle && /* @__PURE__ */ jsx("p", { className: "es:text-sm es:text-secondary-500 es:mt-0.5", children: subtitle })
|
|
151
|
-
] });
|
|
152
|
-
};
|
|
153
|
-
export {
|
|
154
|
-
OptionsPanel,
|
|
155
|
-
OptionsPanelHeader,
|
|
156
|
-
OptionsPanelIntro,
|
|
157
|
-
OptionsPanelSection
|
|
158
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { _ as __ } from "../../default-i18n-CT_oS1Fy.js";
|
|
3
|
-
import { icons } from "../../icons/icons.js";
|
|
4
|
-
import { RichLabel } from "../rich-label/rich-label.js";
|
|
5
|
-
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
6
|
-
/**
|
|
7
|
-
* A simple file placeholder.
|
|
8
|
-
*
|
|
9
|
-
* @component
|
|
10
|
-
* @param {Object} props - Component props.
|
|
11
|
-
* @param {JSX.Element} [props.icon] - File type icon override.
|
|
12
|
-
* @param {string} [props.fileName] - Current file name.
|
|
13
|
-
* @param {string} [props.className] - Classes to pass to the component.
|
|
14
|
-
*
|
|
15
|
-
* @returns {JSX.Element} The FilePlaceholder component.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* <FilePlaceholder />
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* <FilePlaceholder fileName='demo.json' />
|
|
22
|
-
*
|
|
23
|
-
* @preserve
|
|
24
|
-
*/
|
|
25
|
-
const FilePlaceholder = (props) => {
|
|
26
|
-
const { icon, fileName, className, children } = props;
|
|
27
|
-
return /* @__PURE__ */ jsx(
|
|
28
|
-
RichLabel,
|
|
29
|
-
{
|
|
30
|
-
icon: icon ?? icons.file,
|
|
31
|
-
label: (fileName ? fileName : children) ?? __("No file selected", "eightshift-ui-components"),
|
|
32
|
-
className: clsx(
|
|
33
|
-
"es:w-fit es:rounded-xl es:border es:border-secondary-300 es:bg-secondary-50 es:p-2 es:pr-3 es:text-xs es:text-secondary-300 es:shadow-xs",
|
|
34
|
-
fileName && "es:font-mono",
|
|
35
|
-
className
|
|
36
|
-
)
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
};
|
|
40
|
-
export {
|
|
41
|
-
FilePlaceholder
|
|
42
|
-
};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
3
|
-
import { icons } from "../../icons/icons.js";
|
|
4
|
-
/**
|
|
5
|
-
* A simple image placeholder, with an empty state.
|
|
6
|
-
*
|
|
7
|
-
* @component
|
|
8
|
-
* @param {Object} props - Component props.
|
|
9
|
-
* @param {string} [props.url] - The image URL.
|
|
10
|
-
* @param {string} [props.alt] - The image alt text.
|
|
11
|
-
* @param {ImagePlaceholderStyle} [props.style='default'] - Style of the image placeholder.
|
|
12
|
-
* @param {ImagePlaceholderSize} [props.size='default'] - Size of the image placeholder.
|
|
13
|
-
* @param {boolean} [props.noImage] - If `true`, the image within the placeholder will not be displayed, even if `url` is provided.
|
|
14
|
-
* @param {string} [props.className] - Classes to pass to the component.
|
|
15
|
-
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
16
|
-
* @param {ImagePlaceholderImageMode} [props.imageMode='cover'] - Determines inner image display mode.
|
|
17
|
-
*
|
|
18
|
-
* @returns {JSX.Element} The ImagePlaceholder component.
|
|
19
|
-
*
|
|
20
|
-
* @typedef {'default' | 'simple'} ImagePlaceholderStyle
|
|
21
|
-
* @typedef {'cover'|'contain' | 'fill'} ImagePlaceholderImageMode
|
|
22
|
-
* @typedef @typedef {'auto' | 'default' | 'large' | 'fullWidth' | 'fullHeight' | 'full' | 'video'} ImagePlaceholderSize
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* <ImagePlaceholder url="https://example.com/image.jpg" alt="Image alt text" />
|
|
26
|
-
*
|
|
27
|
-
* @preserve
|
|
28
|
-
*/
|
|
29
|
-
const ImagePlaceholder = (props) => {
|
|
30
|
-
const { url, alt, style = "default", size = "default", noImage, className, hidden, imageMode = "cover" } = props;
|
|
31
|
-
if (hidden) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
const styleClassName = {
|
|
35
|
-
default: "es:rounded-xl es:border es:border-secondary-300 es:bg-secondary-50 es:text-secondary-300 es:shadow-xs",
|
|
36
|
-
simple: "es:rounded-xl es:border es:border-secondary-300 es:border-dashed es:text-secondary-300"
|
|
37
|
-
};
|
|
38
|
-
const sizeClassName = {
|
|
39
|
-
auto: "",
|
|
40
|
-
default: "es:size-20",
|
|
41
|
-
large: "es:size-40",
|
|
42
|
-
fullWidth: "es:w-full",
|
|
43
|
-
fullHeight: "es:h-full",
|
|
44
|
-
full: "es:size-full",
|
|
45
|
-
video: "es:w-full es:aspect-video"
|
|
46
|
-
};
|
|
47
|
-
return /* @__PURE__ */ jsxs(
|
|
48
|
-
"div",
|
|
49
|
-
{
|
|
50
|
-
className: clsx(
|
|
51
|
-
"es:grid es:grid-cols-1 es:grid-rows-1 es:overflow-hidden",
|
|
52
|
-
"es:*:col-start-1 es:*:col-end-1 es:*:row-start-1 es:*:row-end-1",
|
|
53
|
-
styleClassName[style] ?? (styleClassName == null ? void 0 : styleClassName.default),
|
|
54
|
-
sizeClassName[size] ?? (sizeClassName == null ? void 0 : sizeClassName.default),
|
|
55
|
-
className
|
|
56
|
-
),
|
|
57
|
-
children: [
|
|
58
|
-
!noImage && /* @__PURE__ */ jsx(
|
|
59
|
-
"img",
|
|
60
|
-
{
|
|
61
|
-
className: clsx(
|
|
62
|
-
"es:size-full! es:select-none es:fill-mode-forwards",
|
|
63
|
-
imageMode === "cover" && "es:object-cover",
|
|
64
|
-
imageMode === "contain" && "es:object-contain",
|
|
65
|
-
imageMode === "fill" && "es:object-fill",
|
|
66
|
-
(url == null ? void 0 : url.length) > 0 ? "es:motion-opacity-in es:motion-scale-in-125 es:motion-blur-in-xs es:motion-delay-300/blur es:motion-duration-300 es:motion-ease-spring-snappy/scale" : "es:hidden"
|
|
67
|
-
),
|
|
68
|
-
src: url,
|
|
69
|
-
alt
|
|
70
|
-
}
|
|
71
|
-
),
|
|
72
|
-
/* @__PURE__ */ jsx(
|
|
73
|
-
"div",
|
|
74
|
-
{
|
|
75
|
-
className: clsx(
|
|
76
|
-
"es:place-self-center es:justify-self-center es:transition es:fill-mode-forwards es:icon:size-7",
|
|
77
|
-
!url ? "es:motion-opacity-in es:motion-scale-in-90 es:motion-duration-300 es:motion-ease-spring-snappy/scale" : "es:invisible"
|
|
78
|
-
),
|
|
79
|
-
children: icons.image
|
|
80
|
-
}
|
|
81
|
-
)
|
|
82
|
-
]
|
|
83
|
-
}
|
|
84
|
-
);
|
|
85
|
-
};
|
|
86
|
-
export {
|
|
87
|
-
ImagePlaceholder
|
|
88
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
3
|
-
import { icons } from "../../icons/icons.js";
|
|
4
|
-
/**
|
|
5
|
-
* A simple media placeholder, with an empty state.
|
|
6
|
-
*
|
|
7
|
-
* @component
|
|
8
|
-
* @param {Object} props - Component props.
|
|
9
|
-
* @param {MediaPlaceholderStyle} [props.style='default'] - Style of the image placeholder.
|
|
10
|
-
* @param {MediaPlaceholderSize} [props.size='default'] - Size of the image placeholder.
|
|
11
|
-
* @param {string} [props.className] - Classes to pass to the component.
|
|
12
|
-
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
13
|
-
* @param {JSX.Element} [props.icon] - Icon to show within the placeholder.
|
|
14
|
-
* @param {string|JSX.Element} [props.helpText] - Text to show below the icon.
|
|
15
|
-
*
|
|
16
|
-
* @returns {JSX.Element} The MediaPlaceholder component.
|
|
17
|
-
*
|
|
18
|
-
* @typedef {'default'|'simple'} MediaPlaceholderStyle
|
|
19
|
-
* @typedef {'auto' | 'default' | 'large' | 'fullWidth' | 'fullHeight' | 'full' | 'video'} MediaPlaceholderSize
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* <MediaPlaceholder url="https://example.com/image.jpg" alt="Image alt text" />
|
|
23
|
-
*
|
|
24
|
-
* @preserve
|
|
25
|
-
*/
|
|
26
|
-
const MediaPlaceholder = (props) => {
|
|
27
|
-
const { style = "default", size = "default", className, icon, helpText, children, hidden } = props;
|
|
28
|
-
if (hidden) {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
const styleClassName = {
|
|
32
|
-
default: "es:rounded-xl es:border es:border-secondary-300 es:bg-secondary-50 es:text-secondary-400 es:shadow-xs",
|
|
33
|
-
simple: "es:rounded-xl es:border es:border-secondary-300 es:border-dashed es:text-secondary-400"
|
|
34
|
-
};
|
|
35
|
-
const sizeClassName = {
|
|
36
|
-
auto: "",
|
|
37
|
-
default: "es:size-20",
|
|
38
|
-
large: "es:size-40",
|
|
39
|
-
fullWidth: "es:w-full",
|
|
40
|
-
fullHeight: "es:h-full",
|
|
41
|
-
full: "es:size-full",
|
|
42
|
-
video: "es:w-full es:aspect-video"
|
|
43
|
-
};
|
|
44
|
-
return /* @__PURE__ */ jsxs(
|
|
45
|
-
"div",
|
|
46
|
-
{
|
|
47
|
-
className: clsx(
|
|
48
|
-
"es:flex es:flex-col es:items-center es:justify-center es:gap-2 es:overflow-hidden es:p-2",
|
|
49
|
-
styleClassName[style] ?? (styleClassName == null ? void 0 : styleClassName.default),
|
|
50
|
-
sizeClassName[size] ?? (sizeClassName == null ? void 0 : sizeClassName.default),
|
|
51
|
-
className
|
|
52
|
-
),
|
|
53
|
-
children: [
|
|
54
|
-
/* @__PURE__ */ jsx("div", { className: "es:icon:size-7", children: icon ?? icons.image }),
|
|
55
|
-
helpText && /* @__PURE__ */ jsx("div", { className: "es:text-sm es:text-secondary-500", children: helpText }),
|
|
56
|
-
children && /* @__PURE__ */ jsx("div", { className: "es:mt-2 es:flex es:items-center es:gap-x-2 es:gap-y-2.5 es:text-sm", children })
|
|
57
|
-
]
|
|
58
|
-
}
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
export {
|
|
62
|
-
MediaPlaceholder
|
|
63
|
-
};
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { $ as $07b14b47974efb58$export$5b6b19405a83ff9d, f as $de32f1b87079253c$export$3ddf2d174ce01153, g as $de32f1b87079253c$export$2e1e1122cf0cba88 } from "../../Dialog-8tYeQ9n4.js";
|
|
3
|
-
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
4
|
-
import { _ as __ } from "../../default-i18n-CT_oS1Fy.js";
|
|
5
|
-
import { Button } from "../button/button.js";
|
|
6
|
-
/**
|
|
7
|
-
* A popover component.
|
|
8
|
-
*
|
|
9
|
-
* Two modes of operation are supported:
|
|
10
|
-
* - **controlled mode**: pass `isOpen` and `onOpenChange` to control when the popover is open.
|
|
11
|
-
* - **uncontrolled mode**: pass `openByDefault` to set the initial popover state. The show/hide state will be managed internally, based on the interaction with the trigger button.
|
|
12
|
-
*
|
|
13
|
-
* @component
|
|
14
|
-
* @param {Object} props - Component props.
|
|
15
|
-
* @param {React.Ref} props.triggerRef - Ref of the trigger button. In uncontrolled mode, this element will be used to open the popover. In controlled mode, the popover will be anchored to this element.
|
|
16
|
-
* @param {boolean} [props.openByDefault=false] - (**Controlled mode**) If `true`, the popover is open by default.
|
|
17
|
-
* @param {boolean} props.isOpen - (**Uncontrolled mode**) If `true`, the popover is open.
|
|
18
|
-
* @param {Function} props.onOpenChange - (**Uncontrolled mode**) Function to run when the popover is opened or closed. `(isOpen: boolean) => void`.
|
|
19
|
-
* @param {PopoverPlacement} props.placement - The placement of the popover.
|
|
20
|
-
* @param {string} [props.className] - Classes to pass to the popover contents.
|
|
21
|
-
* @param {string} [props.wrapperClassName] - Classes to pass to the popover wrapper.
|
|
22
|
-
* @param {Object} props.style - Styles to pass to the popover.
|
|
23
|
-
* @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).
|
|
24
|
-
* @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).
|
|
25
|
-
* @param {number} props.containerPadding - Space that should be left between the popover and the edge of the container (the default container is browser window).
|
|
26
|
-
* @param {boolean} props.shouldFlip - If `true`, the popover should flip when there is not enough space.
|
|
27
|
-
* @param {Function} [props.shouldCloseOnInteractOutside=() => true] - Allows ignoring close events for certain elements. `(element: HTMLElement) => boolean`.
|
|
28
|
-
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
29
|
-
*
|
|
30
|
-
* @returns {JSX.Element} The Popover component.
|
|
31
|
-
*
|
|
32
|
-
* @typedef {'bottom' | 'bottom left' | 'bottom right' | 'bottom start' | 'bottom end' | 'top' | 'top left' | 'top right' | 'top start' | 'top end' | 'left' | 'left top' | 'left bottom' | 'start' | 'start top' | 'start bottom' | 'right' | 'right top' | 'right bottom' | 'end' | 'end top' | 'end bottom'} PopoverPlacement
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* // Uncontrolled mode.
|
|
36
|
-
* const ref = useRef(null);
|
|
37
|
-
*
|
|
38
|
-
* <Button forwardedRef={ref}>Open popover</Button>
|
|
39
|
-
*
|
|
40
|
-
* <Popover
|
|
41
|
-
* triggerRef={triggerRef}
|
|
42
|
-
* openByDefault={true}
|
|
43
|
-
* >
|
|
44
|
-
* ...
|
|
45
|
-
* </Popover>
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* // Controlled mode.
|
|
49
|
-
* const [open, setOpen] = useState(false);
|
|
50
|
-
*
|
|
51
|
-
* <Button onPress={() => setOpen(true)}>Open popover</Button>
|
|
52
|
-
*
|
|
53
|
-
* <Popover
|
|
54
|
-
* onOpenChange={setOpen}
|
|
55
|
-
* isOpen={open}
|
|
56
|
-
* triggerRef={triggerRef}
|
|
57
|
-
* >
|
|
58
|
-
* ...
|
|
59
|
-
* <Button onPress={() => setOpen(false)}>Close popover</Button>
|
|
60
|
-
* </Popover>
|
|
61
|
-
*
|
|
62
|
-
* @preserve
|
|
63
|
-
*/
|
|
64
|
-
const Popover = (props) => {
|
|
65
|
-
const {
|
|
66
|
-
children,
|
|
67
|
-
triggerRef,
|
|
68
|
-
openByDefault,
|
|
69
|
-
isOpen,
|
|
70
|
-
onOpenChange,
|
|
71
|
-
placement,
|
|
72
|
-
className,
|
|
73
|
-
wrapperClassName,
|
|
74
|
-
style,
|
|
75
|
-
offset,
|
|
76
|
-
crossOffset,
|
|
77
|
-
containerPadding,
|
|
78
|
-
shouldFlip,
|
|
79
|
-
shouldCloseOnInteractOutside = () => true,
|
|
80
|
-
"aria-label": rawAriaLabel,
|
|
81
|
-
hidden,
|
|
82
|
-
...other
|
|
83
|
-
} = props;
|
|
84
|
-
let ariaLabel = rawAriaLabel;
|
|
85
|
-
if (ariaLabel === false) {
|
|
86
|
-
ariaLabel = void 0;
|
|
87
|
-
}
|
|
88
|
-
if (hidden) {
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
return /* @__PURE__ */ jsx(
|
|
92
|
-
$07b14b47974efb58$export$5b6b19405a83ff9d,
|
|
93
|
-
{
|
|
94
|
-
shouldFlip,
|
|
95
|
-
shouldCloseOnInteractOutside,
|
|
96
|
-
triggerRef,
|
|
97
|
-
isOpen,
|
|
98
|
-
onOpenChange,
|
|
99
|
-
defaultOpen: openByDefault,
|
|
100
|
-
placement,
|
|
101
|
-
offset,
|
|
102
|
-
crossOffset,
|
|
103
|
-
containerPadding,
|
|
104
|
-
className: ({ isEntering, isExiting }) => clsx(
|
|
105
|
-
"es:rounded-lg es:border es:border-secondary-300 es:bg-white es:shadow-lg es:outline-hidden",
|
|
106
|
-
"es:motion-safe:motion-ease-spring-smooth",
|
|
107
|
-
isEntering && "es:motion-safe:motion-preset-slide-down-sm es:motion-safe:motion-duration-300 es:motion-reduce:motion-preset-fade-md",
|
|
108
|
-
isExiting && "es:not-motion-reduce:motion-translate-y-out-[-2.5%] es:motion-opacity-out-0 es:motion-duration-200",
|
|
109
|
-
wrapperClassName
|
|
110
|
-
),
|
|
111
|
-
style,
|
|
112
|
-
children: /* @__PURE__ */ jsx(
|
|
113
|
-
$de32f1b87079253c$export$3ddf2d174ce01153,
|
|
114
|
-
{
|
|
115
|
-
className: clsx("es:p-1 es:text-sm es:outline-hidden", className),
|
|
116
|
-
"aria-label": ariaLabel,
|
|
117
|
-
...other,
|
|
118
|
-
children
|
|
119
|
-
}
|
|
120
|
-
)
|
|
121
|
-
}
|
|
122
|
-
);
|
|
123
|
-
};
|
|
124
|
-
/**
|
|
125
|
-
* A simple version of the Popover component that includes a trigger button.
|
|
126
|
-
* The control of the popover is handled internally. A custom trigger can be provided.
|
|
127
|
-
*
|
|
128
|
-
* If you need more control over the trigger, use the Popover component directly.
|
|
129
|
-
*
|
|
130
|
-
* @component
|
|
131
|
-
* @param {Object} props - Component props.
|
|
132
|
-
* @param {JSX.Element} props.trigger - Allows using a custom trigger element.
|
|
133
|
-
* @param {JSX.Element} [props.triggerButtonIcon] - The icon for the built-in trigger button.
|
|
134
|
-
* @param {string} props.triggerButtonLabel - The label for the built-in trigger button.
|
|
135
|
-
* @param {Object} props.triggerButtonProps - Props to pass to the built-in trigger button.
|
|
136
|
-
* @param {Function} props.onOpenChange - Function to run when the popover is opened or closed. `(isOpen: boolean) => void`.
|
|
137
|
-
* @param {boolean} props.openByDefault - If `true`, the popover is open by default.
|
|
138
|
-
* @param {PopoverPlacement} props.placement - The placement of the popover.
|
|
139
|
-
* @param {string} props.className - Classes to pass to the popover.
|
|
140
|
-
* @param {Object} props.style - Styles to pass to the popover.
|
|
141
|
-
* @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).
|
|
142
|
-
* @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).
|
|
143
|
-
* @param {number} props.containerPadding - Space that should be left between the popover and the edge of the container (the default container is browser window).
|
|
144
|
-
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
145
|
-
*
|
|
146
|
-
* @returns {JSX.Element} The TriggeredPopover component.
|
|
147
|
-
*
|
|
148
|
-
* @typedef {'bottom' | 'bottom left' | 'bottom right' | 'bottom start' | 'bottom end' | 'top' | 'top left' | 'top right' | 'top start' | 'top end' | 'left' | 'left top' | 'left bottom' | 'start' | 'start top' | 'start bottom' | 'right' | 'right top' | 'right bottom' | 'end' | 'end top' | 'end bottom'} PopoverPlacement
|
|
149
|
-
*
|
|
150
|
-
* @example
|
|
151
|
-
* <TriggeredPopover>
|
|
152
|
-
* ...
|
|
153
|
-
* </TriggeredPopover>
|
|
154
|
-
*
|
|
155
|
-
* @preserve
|
|
156
|
-
*/
|
|
157
|
-
const TriggeredPopover = (props) => {
|
|
158
|
-
const {
|
|
159
|
-
trigger,
|
|
160
|
-
triggerButtonIcon,
|
|
161
|
-
triggerButtonLabel = !triggerButtonIcon && __("Open", "eightshift-ui-components"),
|
|
162
|
-
triggerButtonProps,
|
|
163
|
-
children,
|
|
164
|
-
onOpenChange,
|
|
165
|
-
openByDefault,
|
|
166
|
-
placement,
|
|
167
|
-
style,
|
|
168
|
-
className,
|
|
169
|
-
offset,
|
|
170
|
-
crossOffset,
|
|
171
|
-
containerPadding,
|
|
172
|
-
hidden,
|
|
173
|
-
...rest
|
|
174
|
-
} = props;
|
|
175
|
-
if (hidden) {
|
|
176
|
-
return null;
|
|
177
|
-
}
|
|
178
|
-
return /* @__PURE__ */ jsxs($de32f1b87079253c$export$2e1e1122cf0cba88, { onOpenChange, children: [
|
|
179
|
-
trigger,
|
|
180
|
-
!trigger && /* @__PURE__ */ jsx(
|
|
181
|
-
Button,
|
|
182
|
-
{
|
|
183
|
-
icon: triggerButtonIcon,
|
|
184
|
-
...triggerButtonProps,
|
|
185
|
-
children: triggerButtonLabel
|
|
186
|
-
}
|
|
187
|
-
),
|
|
188
|
-
/* @__PURE__ */ jsx(
|
|
189
|
-
Popover,
|
|
190
|
-
{
|
|
191
|
-
placement,
|
|
192
|
-
openByDefault,
|
|
193
|
-
offset,
|
|
194
|
-
crossOffset,
|
|
195
|
-
containerPadding,
|
|
196
|
-
className,
|
|
197
|
-
style,
|
|
198
|
-
...rest,
|
|
199
|
-
children
|
|
200
|
-
}
|
|
201
|
-
)
|
|
202
|
-
] });
|
|
203
|
-
};
|
|
204
|
-
export {
|
|
205
|
-
Popover,
|
|
206
|
-
TriggeredPopover
|
|
207
|
-
};
|