@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.
Files changed (144) hide show
  1. package/package.json +101 -101
  2. package/dist/Button-BPLceDeW.js +0 -185
  3. package/dist/Collection-CZxddMZS.js +0 -2332
  4. package/dist/Color-MV5kBVXr.js +0 -2452
  5. package/dist/ColorSwatch-BqQfVu4L.js +0 -64
  6. package/dist/ComboBox-_RfyhwZw.js +0 -1906
  7. package/dist/Dialog-8tYeQ9n4.js +0 -2300
  8. package/dist/FieldError-52GVSGgC.js +0 -42
  9. package/dist/FocusScope-Cri5BFRz.js +0 -831
  10. package/dist/Form-Cq3fu75_.js +0 -5
  11. package/dist/Group-_emcIVxI.js +0 -48
  12. package/dist/Heading-B2153VXe.js +0 -16
  13. package/dist/Hidden-rE6uR-lr.js +0 -41
  14. package/dist/Input-BxpFEIXV.js +0 -133
  15. package/dist/Label-icmbmNdI.js +0 -17
  16. package/dist/List-CZMUbkFU.js +0 -593
  17. package/dist/ListBox-Ca6hiCqz.js +0 -581
  18. package/dist/NumberFormatter-DA8u1Ot7.js +0 -140
  19. package/dist/OverlayArrow-CYXQSlEU.js +0 -629
  20. package/dist/RSPContexts-2lR5GG9p.js +0 -14
  21. package/dist/Select-aab027f3.esm-PDJCDE95.js +0 -2469
  22. package/dist/Separator-4IIDRlV_.js +0 -322
  23. package/dist/Slider-rz2XRMGm.js +0 -853
  24. package/dist/Text-DVSAPY-K.js +0 -16
  25. package/dist/VisuallyHidden-f9zX67a_.js +0 -48
  26. package/dist/_commonjsHelpers-CUmg6egw.js +0 -6
  27. package/dist/assets/index.css +0 -37
  28. package/dist/assets/style-admin.css +0 -5255
  29. package/dist/assets/style-editor.css +0 -5255
  30. package/dist/assets/style.css +0 -5261
  31. package/dist/assets/wp-font-enhancements.css +0 -8
  32. package/dist/assets/wp-ui-enhancements.css +0 -299
  33. package/dist/components/animated-visibility/animated-visibility.js +0 -105
  34. package/dist/components/base-control/base-control.js +0 -86
  35. package/dist/components/breakpoint-preview/breakpoint-preview.js +0 -161
  36. package/dist/components/button/button.js +0 -387
  37. package/dist/components/checkbox/checkbox.js +0 -320
  38. package/dist/components/color-pickers/color-picker.js +0 -272
  39. package/dist/components/color-pickers/color-swatch.js +0 -58
  40. package/dist/components/color-pickers/gradient-editor.js +0 -534
  41. package/dist/components/color-pickers/solid-color-picker.js +0 -1567
  42. package/dist/components/component-toggle/component-toggle.js +0 -158
  43. package/dist/components/container-panel/container-panel.js +0 -131
  44. package/dist/components/draggable/draggable-context.js +0 -5
  45. package/dist/components/draggable/draggable-handle.js +0 -46
  46. package/dist/components/draggable/draggable.js +0 -6207
  47. package/dist/components/draggable-list/draggable-list-context.js +0 -5
  48. package/dist/components/draggable-list/draggable-list-item.js +0 -77
  49. package/dist/components/draggable-list/draggable-list.js +0 -151
  50. package/dist/components/expandable/expandable.js +0 -342
  51. package/dist/components/index.js +0 -137
  52. package/dist/components/input-field/input-field.js +0 -231
  53. package/dist/components/item-collection/item-collection.js +0 -59
  54. package/dist/components/layout/hstack.js +0 -30
  55. package/dist/components/layout/vstack.js +0 -30
  56. package/dist/components/link-input/link-input.js +0 -293
  57. package/dist/components/matrix-align/matrix-align.js +0 -134
  58. package/dist/components/menu/menu.js +0 -285
  59. package/dist/components/modal/modal.js +0 -305
  60. package/dist/components/notice/notice.js +0 -123
  61. package/dist/components/number-picker/number-picker.js +0 -292
  62. package/dist/components/option-select/option-select.js +0 -264
  63. package/dist/components/options-panel/options-panel.js +0 -158
  64. package/dist/components/placeholders/file-placeholder.js +0 -42
  65. package/dist/components/placeholders/image-placeholder.js +0 -88
  66. package/dist/components/placeholders/media-placeholder.js +0 -63
  67. package/dist/components/popover/popover.js +0 -207
  68. package/dist/components/radio/radio.js +0 -579
  69. package/dist/components/repeater/repeater-context.js +0 -5
  70. package/dist/components/repeater/repeater-item.js +0 -119
  71. package/dist/components/repeater/repeater.js +0 -280
  72. package/dist/components/responsive/mini-responsive.js +0 -498
  73. package/dist/components/responsive/responsive-legacy.js +0 -343
  74. package/dist/components/responsive/responsive.js +0 -580
  75. package/dist/components/responsive-preview/responsive-preview.js +0 -123
  76. package/dist/components/rich-label/rich-label.js +0 -66
  77. package/dist/components/select/async-multi-select.js +0 -157
  78. package/dist/components/select/async-single-select.js +0 -137
  79. package/dist/components/select/custom-select-default-components.js +0 -38
  80. package/dist/components/select/multi-select-components.js +0 -8
  81. package/dist/components/select/multi-select.js +0 -151
  82. package/dist/components/select/react-select-component-wrappers.js +0 -90
  83. package/dist/components/select/shared.js +0 -26
  84. package/dist/components/select/single-select.js +0 -131
  85. package/dist/components/select/styles.js +0 -49
  86. package/dist/components/select/v2/async-select.js +0 -297
  87. package/dist/components/select/v2/shared.js +0 -24
  88. package/dist/components/select/v2/single-select.js +0 -990
  89. package/dist/components/slider/column-config-slider.js +0 -210
  90. package/dist/components/slider/slider.js +0 -343
  91. package/dist/components/slider/utils.js +0 -84
  92. package/dist/components/spacer/spacer.js +0 -97
  93. package/dist/components/tabs/tabs.js +0 -702
  94. package/dist/components/toggle/switch.js +0 -155
  95. package/dist/components/toggle/toggle.js +0 -64
  96. package/dist/components/toggle-button/toggle-button.js +0 -324
  97. package/dist/components/tooltip/tooltip.js +0 -525
  98. package/dist/context-D2KUdwNL.js +0 -92
  99. package/dist/default-i18n-CT_oS1Fy.js +0 -922
  100. package/dist/filterDOMProps-EDDcM64A.js +0 -28
  101. package/dist/icons/block-icon.js +0 -42
  102. package/dist/icons/generic-color-swatch.js +0 -113
  103. package/dist/icons/icons.js +0 -30371
  104. package/dist/icons/index.js +0 -11
  105. package/dist/icons/jsx-svg.js +0 -50
  106. package/dist/index-641ee5b8.esm-DIuJijyT.js +0 -3137
  107. package/dist/index-BKGQ6jGS.js +0 -44
  108. package/dist/index-CFozsmNS.js +0 -28321
  109. package/dist/index.js +0 -139
  110. package/dist/lite-DVmmD_-j.js +0 -7
  111. package/dist/modifiers.esm-BuJQPI1X.js +0 -31
  112. package/dist/multi-select-components-Sp-JEFEX.js +0 -3744
  113. package/dist/number-GajL10e1.js +0 -36
  114. package/dist/react-jsx-parser.min-DZCiis5V.js +0 -11753
  115. package/dist/react-select-async.esm-Bql4G5iV.js +0 -107
  116. package/dist/react-select.esm-B_TudhTU.js +0 -15
  117. package/dist/style-admin.js +0 -1
  118. package/dist/style-editor.js +0 -1
  119. package/dist/style.js +0 -1
  120. package/dist/textSelection-0UUS8Yfg.js +0 -46
  121. package/dist/useButton-Cg474OYB.js +0 -71
  122. package/dist/useEvent-B0b-6KBr.js +0 -23
  123. package/dist/useFocusRing-CV5l3lf6.js +0 -107
  124. package/dist/useFormReset-C5OggHsw.js +0 -22
  125. package/dist/useFormValidation-DhDNSjws.js +0 -224
  126. package/dist/useHover-DwDr6ozG.js +0 -900
  127. package/dist/useLabel-D7HkNEHT.js +0 -27
  128. package/dist/useLabels-D8cxd1Z8.js +0 -23
  129. package/dist/useListState-DVr6aYd_.js +0 -161
  130. package/dist/useLocalizedStringFormatter-CFP1YZWQ.js +0 -121
  131. package/dist/useNumberField-TwM0Z9D1.js +0 -1204
  132. package/dist/useNumberFormatter-321rAb4J.js +0 -13
  133. package/dist/usePress-Cucx-xSA.js +0 -664
  134. package/dist/useSingleSelectListState-CMGsRHHh.js +0 -38
  135. package/dist/useToggle-C0I3vs0g.js +0 -59
  136. package/dist/useToggleState-CmQX3SoX.js +0 -19
  137. package/dist/utilities/array-helpers.js +0 -56
  138. package/dist/utilities/debounce-throttle.js +0 -123
  139. package/dist/utilities/es-dash.js +0 -376
  140. package/dist/utilities/index.js +0 -27
  141. package/dist/utilities/text-helpers.js +0 -136
  142. package/dist/utils-DkCSC521.js +0 -370
  143. package/dist/wp/wp-font-enhancements.js +0 -1
  144. package/dist/wp/wp-ui-enhancements.js +0 -1
@@ -1,343 +0,0 @@
1
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { useState } from "react";
3
- import { DecorativeTooltip } from "../tooltip/tooltip.js";
4
- import { c as clsx } from "../../lite-DVmmD_-j.js";
5
- import { s as sprintf, _ as __ } from "../../default-i18n-CT_oS1Fy.js";
6
- import { BreakpointPreview } from "../breakpoint-preview/breakpoint-preview.js";
7
- import { upperFirst } from "../../utilities/es-dash.js";
8
- import { icons } from "../../icons/icons.js";
9
- import { Button } from "../button/button.js";
10
- import { AnimatedVisibility } from "../animated-visibility/animated-visibility.js";
11
- import { ToggleButton } from "../toggle-button/toggle-button.js";
12
- import { BaseControl } from "../base-control/base-control.js";
13
- /**
14
- * A component that allows the user to set different values for different breakpoints.
15
- *
16
- * Replacement for the `Responsive` component from Eightshift Frontend libs v12 (and older).
17
- *
18
- * Meant to be used with a more complex attribute setup, with one attribute per breakpoint,
19
- * and a single value object that contains all the values.
20
- *
21
- * Inner items should be passed as a render function.
22
- * The following props are passed to the render function:
23
- * - `breakpoint: string` - Name of the current breakpoint.
24
- * - `currentValue: any` - Current value.
25
- * - `handleChange: Function<(attributeName: string, value: any) => void>` - A function to change the value for the breakpoint..
26
- * - `options: Object<string, any>` - (Optional) Options list passed to the `ResponsiveLegacy` component. (optional)
27
- * - `isInlineCollapsedView: boolean` - (Optional) `true` if in `inline` mode, and the details are collapsed.
28
- * - `isInlineExpandedView: boolean` - (Optional) `true` if in `inline` mode, and the details are shown.
29
- *
30
- * @component
31
- * @param {Object} props - Component props.
32
- * @param {Object} props.value - The current value of the component.
33
- * @param {Function} props.onChange - Function to run when the value changes. `(newValue: Object) => void`.
34
- * @param {Object} props.attribute - The attribute the component is linked to. `{ [breakpoint: string]: string }`.
35
- * @param {JSX.Element} [props.icon] - The icon of the component.
36
- * @param {string} [props.help] - The help text of the component.
37
- * @param {string} [props.label] - The label of the component.
38
- * @param {string} [props.subtitle] - The subtitle of the component.
39
- * @param {{label: string, value: string}[]} props.options - Options of the attribute the component is linked to. `{ value: string, label: string }[]`.
40
- * @param {any} [props.inheritValue=''] - Value that will be used as a default for breakpoints that don't have a value set. If `undefined`, needs to be used, use `allowUndefined` instead.
41
- * @param {boolean?} [props.allowUndefined] - If `true`, `undefined` is used as a default value for breakpoints that don't have a value set. Overrides `inheritValue`.
42
- * @param {Object} props.globalManifest - The global manifest.
43
- * @param {boolean} [props.inline] - If `true`, the default breakpoint is shown inline with the label. In the expanded state, all breakpoints are shown below the label.
44
- * @param {Object<string, number>} [props.breakpointData] - Breakpoints to use. `{ [breakpoint: string]: number }`.
45
- * @param {string[]} [props.breakpoints] - Breakpoints to use. `{ [breakpoint: string]: number }`.
46
- * @param {boolean} [props.hidden] - If `true`, the component is not rendered.
47
- * @param {'start' | 'center' | 'end' | 'stretch'} [props.innerContentAlign='start'] - Determines inner content alignment
48
- *
49
- * @returns {JSX.Element} The ResponsiveLegacy component.
50
- *
51
- * @example
52
- * // Basic example
53
- * <ResponsiveLegacy
54
- * attribute={myResponsiveAttribute} // from 'responsiveAttributes' in manifest
55
- * value={value} // attributes
56
- * onChange={(attributeName, value) => setAttributes({
57
- * [attributeName]: value,
58
- * })}
59
- * icon={icons.myIcon}
60
- * label={__('Label', 'eightshift-ui-components')}
61
- * options={[
62
- * { value: 'value1', label: 'Value 1' },
63
- * { value: 'value2', label: 'Value 2' },
64
- * { value: 'value3', label: 'Value 3' },
65
- * ]}
66
- * breakpointData={breakpoints} // From global manifest
67
- * >
68
- * {({ currentValue, options, handleChange }) => (
69
- * <Select
70
- * value={currentValue}
71
- * options={options}
72
- * onChange={handleChange}
73
- * />
74
- * )}
75
- * </ResponsiveLegacy>
76
- *
77
- * @preserve
78
- */
79
- const ResponsiveLegacy = (props) => {
80
- const {
81
- value,
82
- onChange,
83
- attribute,
84
- icon,
85
- help,
86
- label,
87
- subtitle,
88
- options,
89
- inheritValue: rawInheritValue = "",
90
- allowUndefined,
91
- children,
92
- inline,
93
- breakpointData,
94
- breakpoints: rawBreakpoints = Object.entries(breakpointData).toSorted((a, b) => a[1] - b[1]).map(([breakpoint]) => breakpoint).toReversed(),
95
- hidden,
96
- innerContentAlign = "start"
97
- } = props;
98
- const inheritValue = allowUndefined ? void 0 : rawInheritValue;
99
- const [detailsVisible, setDetailsVisible] = useState(false);
100
- const breakpoints = rawBreakpoints.slice(1);
101
- const globalOverride = breakpoints.find((breakpoint) => (value == null ? void 0 : value[attribute[breakpoint]]) !== inheritValue);
102
- const defaultBreakpoint = rawBreakpoints[0];
103
- if (hidden) {
104
- return null;
105
- }
106
- const DefaultTooltip = () => {
107
- var _a, _b;
108
- return /* @__PURE__ */ jsx(
109
- DecorativeTooltip,
110
- {
111
- placement: "left",
112
- className: "es:p-3",
113
- theme: "light",
114
- offset: 7.5,
115
- arrow: true,
116
- text: /* @__PURE__ */ jsxs("div", { className: "es:max-w-64 es:p-1", children: [
117
- /* @__PURE__ */ jsx("span", { className: "es:block es:text-balance es:font-semibold es:tabular-nums", children: __("Default", "eightshift-ui-components") }),
118
- /* @__PURE__ */ jsxs("span", { className: "es:block es:text-balance es:tabular-nums", children: [
119
- !globalOverride && __("Always applied, regardless of browser width.", "eightshift-ui-components"),
120
- globalOverride && sprintf(__("Applied when the browser width is %dpx or wider.", "eightshift-ui-components"), breakpointData[globalOverride] + 1)
121
- ] }),
122
- globalOverride && /* @__PURE__ */ jsx("div", { className: "es:mx-auto es:mt-2", children: /* @__PURE__ */ jsx(
123
- BreakpointPreview,
124
- {
125
- blocks: [
126
- {
127
- breakpoint: globalOverride,
128
- value: ((_a = options == null ? void 0 : options.find((opt) => opt.value === (value == null ? void 0 : value[attribute[globalOverride]]))) == null ? void 0 : _a.label) ?? upperFirst(value == null ? void 0 : value[globalOverride]),
129
- dotsStart: true,
130
- alignEnd: true
131
- },
132
- {
133
- breakpoint: __("Default", "eightshift-ui-components"),
134
- value: ((_b = options == null ? void 0 : options.find((opt) => opt.value === (value == null ? void 0 : value[attribute[defaultBreakpoint]]))) == null ? void 0 : _b.label) ?? upperFirst(value == null ? void 0 : value[defaultBreakpoint]),
135
- width: breakpointData[globalOverride] + 1,
136
- dotsEnd: true,
137
- active: true
138
- }
139
- ]
140
- }
141
- ) })
142
- ] }),
143
- children: /* @__PURE__ */ jsx("div", { className: "es:flex es:size-7 es:items-center es:justify-center es:rounded es:border es:border-accent-500/10 es:bg-accent-50 es:p-0.5 es:text-accent-800 es:shadow-sm es:shadow-accent-600/25 es:icon:size-5", children: icons[`screen${upperFirst(defaultBreakpoint)}`] ?? icons.play })
144
- }
145
- );
146
- };
147
- return /* @__PURE__ */ jsxs(
148
- BaseControl,
149
- {
150
- icon,
151
- label,
152
- subtitle,
153
- help,
154
- className: "es:w-full",
155
- actions: /* @__PURE__ */ jsxs(Fragment, { children: [
156
- inline && /* @__PURE__ */ jsx(
157
- AnimatedVisibility,
158
- {
159
- visible: !detailsVisible,
160
- transition: "scaleFade",
161
- noInitial: true,
162
- children: children({
163
- breakpoint: defaultBreakpoint,
164
- currentValue: value == null ? void 0 : value[attribute[defaultBreakpoint]],
165
- options,
166
- handleChange: (newValue) => onChange(attribute[defaultBreakpoint], newValue),
167
- isInlineCollapsedView: true
168
- })
169
- },
170
- defaultBreakpoint
171
- ),
172
- /* @__PURE__ */ jsx(
173
- ToggleButton,
174
- {
175
- icon: icons.responsiveOverridesAlt,
176
- onChange: () => setDetailsVisible(!detailsVisible),
177
- selected: detailsVisible,
178
- tooltip: detailsVisible ? __("Hide responsive overrides", "eightshift-ui-components") : __("Show responsive overrides", "eightshift-ui-components")
179
- }
180
- )
181
- ] }),
182
- children: [
183
- !inline && /* @__PURE__ */ jsxs(
184
- "div",
185
- {
186
- className: clsx(
187
- "es:grid es:items-center es:gap-x-2 es:transition-[grid-template-columns,margin-block-end] es:duration-150",
188
- innerContentAlign === "start" && "es:justify-items-start",
189
- innerContentAlign === "center" && "es:justify-items-center",
190
- innerContentAlign === "end" && "es:justify-items-end",
191
- innerContentAlign === "stretch" && "es:justify-items-stretch",
192
- detailsVisible ? "es:mb-2 es:grid-cols-[minmax(0,1.75rem)_minmax(0,1fr)_minmax(0,2.25rem)]" : "es:grid-cols-[minmax(0,0rem)_minmax(0,1fr)_minmax(0,2.25rem)]"
193
- ),
194
- children: [
195
- detailsVisible && /* @__PURE__ */ jsx(DefaultTooltip, {}),
196
- /* @__PURE__ */ jsx("div", { className: clsx(detailsVisible ? "es:col-start-2 es:col-end-2" : "es:col-span-full"), children: children({
197
- breakpoint: defaultBreakpoint,
198
- currentValue: value == null ? void 0 : value[attribute[defaultBreakpoint]],
199
- options,
200
- handleChange: (newValue) => onChange(attribute[defaultBreakpoint], newValue)
201
- }) })
202
- ]
203
- },
204
- defaultBreakpoint
205
- ),
206
- inline && /* @__PURE__ */ jsxs(
207
- AnimatedVisibility,
208
- {
209
- className: clsx(
210
- "es:mb-2 es:grid es:grid-cols-[minmax(0,auto)_minmax(0,1fr)_minmax(0,2.25rem)] es:items-center es:gap-x-2",
211
- innerContentAlign === "start" && "es:justify-items-start",
212
- innerContentAlign === "center" && "es:justify-items-center",
213
- innerContentAlign === "end" && "es:justify-items-end",
214
- innerContentAlign === "stretch" && "es:justify-items-stretch"
215
- ),
216
- visible: detailsVisible,
217
- children: [
218
- /* @__PURE__ */ jsx(DefaultTooltip, {}),
219
- /* @__PURE__ */ jsx("div", { className: "es:col-start-2 es:col-end-2", children: children({
220
- breakpoint: defaultBreakpoint,
221
- currentValue: value == null ? void 0 : value[attribute[defaultBreakpoint]],
222
- options,
223
- handleChange: (newValue) => onChange(attribute[defaultBreakpoint], newValue),
224
- isInlineExpandedView: true
225
- }) })
226
- ]
227
- },
228
- defaultBreakpoint
229
- ),
230
- /* @__PURE__ */ jsx(
231
- AnimatedVisibility,
232
- {
233
- visible: detailsVisible,
234
- className: "es:space-y-2",
235
- children: breakpoints.map((breakpoint, i) => {
236
- var _a, _b, _c, _d, _e;
237
- const isOverrideSet = value[attribute[breakpoint]] !== inheritValue;
238
- const aboveOverride = rawBreakpoints.slice(0, i + 1).toReversed().find((breakpoint2) => (value == null ? void 0 : value[attribute[breakpoint2]]) !== inheritValue);
239
- const belowOverride = rawBreakpoints.slice(i + 2).find((breakpoint2) => (value == null ? void 0 : value[attribute[breakpoint2]]) !== inheritValue);
240
- return /* @__PURE__ */ jsxs(
241
- "div",
242
- {
243
- className: clsx(
244
- "es:grid es:grid-cols-[minmax(0,auto)_minmax(0,1fr)_minmax(0,2.25rem)] es:items-center es:gap-x-2",
245
- innerContentAlign === "start" && "es:justify-items-start",
246
- innerContentAlign === "center" && "es:justify-items-center",
247
- innerContentAlign === "end" && "es:justify-items-end",
248
- innerContentAlign === "stretch" && "es:justify-items-stretch"
249
- ),
250
- children: [
251
- /* @__PURE__ */ jsx(
252
- DecorativeTooltip,
253
- {
254
- placement: "left",
255
- theme: "light",
256
- offset: 7.5,
257
- arrow: true,
258
- text: /* @__PURE__ */ jsxs("div", { className: "es:max-w-96 es:p-1", children: [
259
- /* @__PURE__ */ jsx("span", { className: "es:block es:font-semibold", children: upperFirst(breakpoint) }),
260
- /* @__PURE__ */ jsxs("span", { className: "es:block es:text-balance es:tabular-nums", children: [
261
- aboveOverride && (aboveOverride !== rawBreakpoints[0] || !belowOverride) && isOverrideSet && sprintf(__("Applied when the browser width is %dpx or less.", "eightshift-ui-components"), breakpointData[breakpoint]),
262
- aboveOverride && aboveOverride === rawBreakpoints[0] && belowOverride && isOverrideSet && sprintf(
263
- __("Applied when the browser width is between %dpx and %dpx.", "eightshift-ui-components"),
264
- breakpointData[belowOverride] + 1,
265
- breakpointData[breakpoint]
266
- ),
267
- (!aboveOverride || !isOverrideSet) && sprintf(__("Up to %dpx", "eightshift-ui-components"), breakpointData[breakpoint])
268
- ] }),
269
- (aboveOverride && !isOverrideSet || !aboveOverride) && /* @__PURE__ */ jsx("span", { className: "es:mt-2 es:block es:font-medium es:italic", children: __("Not set", "eightshift-ui-components") }),
270
- aboveOverride && isOverrideSet && /* @__PURE__ */ jsx("div", { className: "es:mx-auto es:mt-2", children: /* @__PURE__ */ jsx(
271
- BreakpointPreview,
272
- {
273
- blocks: [
274
- belowOverride && {
275
- breakpoint: belowOverride,
276
- value: ((_a = options == null ? void 0 : options.find((opt) => opt.value === (value == null ? void 0 : value[attribute[belowOverride]]))) == null ? void 0 : _a.label) ?? upperFirst(value == null ? void 0 : value[belowOverride]),
277
- widthEnd: breakpointData[belowOverride],
278
- dotsStart: true,
279
- alignEnd: true
280
- },
281
- {
282
- breakpoint,
283
- value: ((_b = options == null ? void 0 : options.find((opt) => opt.value === (value == null ? void 0 : value[attribute[breakpoint]]))) == null ? void 0 : _b.label) ?? upperFirst(value == null ? void 0 : value[breakpoint]),
284
- widthEnd: breakpointData[breakpoint],
285
- active: true,
286
- alignEnd: true,
287
- dotsStart: aboveOverride === breakpoint
288
- },
289
- aboveOverride !== defaultBreakpoint && {
290
- breakpoint: aboveOverride,
291
- value: ((_c = options == null ? void 0 : options.find((opt) => opt.value === (value == null ? void 0 : value[attribute[aboveOverride]]))) == null ? void 0 : _c.label) ?? upperFirst(value == null ? void 0 : value[aboveOverride]),
292
- dotsEnd: true
293
- },
294
- aboveOverride === defaultBreakpoint && {
295
- breakpoint: __("Default", "eightshift-ui-components"),
296
- value: ((_d = options == null ? void 0 : options.find((opt) => opt.value === (value == null ? void 0 : value[attribute[defaultBreakpoint]]))) == null ? void 0 : _d.label) ?? upperFirst(value == null ? void 0 : value[defaultBreakpoint]),
297
- dotsEnd: true
298
- }
299
- ]
300
- }
301
- ) })
302
- ] }),
303
- children: /* @__PURE__ */ jsx(
304
- "div",
305
- {
306
- className: clsx(
307
- "es:flex es:size-7 es:items-center es:justify-center es:rounded es:border es:p-0.5 es:shadow-sm es:transition-colors es:icon:size-5",
308
- value[attribute[breakpoint]] === inheritValue ? "es:border-secondary-200 es:bg-secondary-50 es:text-secondary-700" : "es:border-secondary-100 es:bg-white es:text-secondary-500"
309
- ),
310
- children: (_e = icons) == null ? void 0 : _e[`screen${upperFirst(breakpoint)}`]
311
- }
312
- )
313
- }
314
- ),
315
- children({
316
- breakpoint,
317
- currentValue: value == null ? void 0 : value[attribute[breakpoint]],
318
- options,
319
- handleChange: (newValue) => onChange(attribute[breakpoint], newValue)
320
- }),
321
- /* @__PURE__ */ jsx(
322
- Button,
323
- {
324
- onPress: () => onChange(attribute[breakpoint], inheritValue),
325
- icon: icons.clearAlt,
326
- disabled: (value == null ? void 0 : value[attribute[breakpoint]]) === inheritValue,
327
- type: "ghost"
328
- }
329
- )
330
- ]
331
- },
332
- breakpoint
333
- );
334
- })
335
- }
336
- )
337
- ]
338
- }
339
- );
340
- };
341
- export {
342
- ResponsiveLegacy
343
- };