@eightshift/ui-components 0.0.1 → 0.0.3

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 (116) hide show
  1. package/README.md +0 -1
  2. package/dist/Button-eebLs4cp.js +54 -0
  3. package/dist/{Checkbox-BLcVbhiO.js → Checkbox-BN0TEda-.js} +7 -7
  4. package/dist/{ColorSwatch-Cmlex_kT.js → ColorSwatch-BrowHhTG.js} +4 -4
  5. package/dist/{FieldError-wtMA4667.js → FieldError-ILxgMZy5.js} +2 -2
  6. package/dist/{FocusScope-1u9yyfIN.js → FocusScope-B9b0VMib.js} +2 -2
  7. package/dist/GeistMonoVF.woff2 +0 -0
  8. package/dist/GeistVF.woff2 +0 -0
  9. package/dist/{GridList-BZPXp3_O.js → GridList-CzpWxJsS.js} +18 -18
  10. package/dist/{Group-DyqpTRPe.js → Group-Dkdm2-E7.js} +3 -3
  11. package/dist/{Input-jsbb4ugq.js → Input-BJA4rmIo.js} +7 -7
  12. package/dist/{Label-BPzS-sR7.js → Label-9x5iLJ-Y.js} +1 -1
  13. package/dist/{ListBox-w9gDaJkV.js → ListBox-D3Vr4vvC.js} +18 -18
  14. package/dist/{Select-49a62830.esm-C-RFtLiD.js → Select-49a62830.esm-CKPmlkza.js} +1 -1
  15. package/dist/{SelectionManager-mefd0ThJ.js → SelectionManager-sedvcM-1.js} +8 -8
  16. package/dist/{Separator-DHn0CwdK.js → Separator-B6rnDabE.js} +3 -3
  17. package/dist/{Slider-Pyh2V4bY.js → Slider-C5U5N7uM.js} +11 -11
  18. package/dist/{Text-BM136LvS.js → Text-Cyxp9ewv.js} +1 -1
  19. package/dist/{VisuallyHidden-BYRI1Lfo.js → VisuallyHidden-BPJVSUyp.js} +2 -2
  20. package/dist/_commonjsHelpers-DWwsNxpa.js +8 -0
  21. package/dist/assets/fonts.css +1 -0
  22. package/dist/assets/style.css +1 -1
  23. package/dist/assets/wp.css +1 -0
  24. package/dist/{button-BkkdyHfJ.js → button-idVI4jmd.js} +45 -64
  25. package/dist/components/base-control/base-control.js +29 -39
  26. package/dist/components/breakpoint-preview/breakpoint-preview.js +7 -7
  27. package/dist/components/button/button.js +6 -5
  28. package/dist/components/checkbox/checkbox.js +9 -7
  29. package/dist/components/color-pickers/color-picker.js +27 -36
  30. package/dist/components/color-pickers/color-swatch.js +6 -6
  31. package/dist/components/color-pickers/gradient-editor.js +10 -6
  32. package/dist/components/color-pickers/solid-color-picker.js +35 -38
  33. package/dist/components/component-toggle/component-toggle.js +52 -6
  34. package/dist/components/container-panel/container-panel.js +55 -6
  35. package/dist/components/draggable-list/draggable-list-item.js +74 -0
  36. package/dist/components/draggable-list/draggable-list.js +157 -0
  37. package/dist/components/expandable/expandable.js +19 -12
  38. package/dist/components/input-field/input-field.js +15 -10
  39. package/dist/components/layout/hstack.js +40 -0
  40. package/dist/components/layout/vstack.js +40 -0
  41. package/dist/components/link-input/link-input.js +35 -31
  42. package/dist/components/list-box/list-box.js +11 -6
  43. package/dist/components/matrix-align/matrix-align.js +12 -7
  44. package/dist/components/menu/menu.js +26 -21
  45. package/dist/components/notice/notice.js +11 -7
  46. package/dist/components/number-picker/number-picker.js +19 -13
  47. package/dist/components/option-select/option-select.js +231 -0
  48. package/dist/components/placeholders/file-placeholder.js +53 -0
  49. package/dist/components/placeholders/image-placeholder.js +88 -0
  50. package/dist/components/placeholders/media-placeholder.js +62 -0
  51. package/dist/components/popover/popover.js +4 -4
  52. package/dist/components/radio/radio.js +56 -38
  53. package/dist/components/repeater/repeater-item.js +46 -39
  54. package/dist/components/repeater/repeater.js +82 -56
  55. package/dist/components/responsive/responsive-legacy.js +17 -12
  56. package/dist/components/responsive/responsive.js +227 -160
  57. package/dist/components/responsive-preview/responsive-preview.js +5 -3
  58. package/dist/components/rich-label/rich-label.js +12 -8
  59. package/dist/components/select/async-multi-select.js +9 -6
  60. package/dist/components/select/async-single-select.js +7 -2
  61. package/dist/components/select/custom-select-default-components.js +3 -3
  62. package/dist/components/select/multi-select-components.js +2 -2
  63. package/dist/components/select/multi-select.js +9 -6
  64. package/dist/components/select/react-select-component-wrappers.js +1 -1
  65. package/dist/components/select/single-select.js +7 -2
  66. package/dist/components/select/styles.js +4 -4
  67. package/dist/components/slider/column-config-slider.js +18 -34
  68. package/dist/components/slider/slider.js +19 -26
  69. package/dist/components/slider/utils.js +44 -1
  70. package/dist/components/spacer/spacer.js +21 -11
  71. package/dist/components/tabs/tabs.js +21 -20
  72. package/dist/components/toggle/switch.js +18 -12
  73. package/dist/components/toggle/toggle.js +8 -2
  74. package/dist/components/toggle-button/toggle-button.js +25 -13
  75. package/dist/components/tooltip/tooltip.js +4 -4
  76. package/dist/{context-jMy6xdVq.js → context-BAcFg5GO.js} +1 -1
  77. package/dist/{default-i18n-BhE-OUmt.js → default-i18n-Bk1GxDHz.js} +1 -1
  78. package/dist/{focusSafely-C3K8zAKj.js → focusSafely-B0hyd-S4.js} +1 -1
  79. package/dist/fonts.js +1 -0
  80. package/dist/icons/icons.js +184 -164
  81. package/dist/icons/jsx-svg.js +4957 -0
  82. package/dist/{index-Bfb9bWcb.js → index-BDk0TPWz.js} +1 -1
  83. package/dist/{index-a301f526.esm-Bioi4cGX.js → index-a301f526.esm-BzTuHLdr.js} +1 -1
  84. package/dist/index.js +30 -4
  85. package/dist/{intlStrings-CUhoK9EN.js → intlStrings-Ctkp0HDc.js} +1 -1
  86. package/dist/lite-pbIeT7tm.js +8 -0
  87. package/dist/{multi-select-components-CjVpCNko.js → multi-select-components-nORKdJ-2.js} +3 -3
  88. package/dist/{popover-Dx3vKXUX.js → popover-o2Q28Ljn.js} +19 -14
  89. package/dist/{react-select-async.esm-TFb_ZX6C.js → react-select-async.esm-CLj9uZTq.js} +3 -3
  90. package/dist/{react-select.esm-BjRWqf0E.js → react-select.esm-3tyTZmrx.js} +3 -3
  91. package/dist/{textSelection-BosCCRVE.js → textSelection-BRZdHY-4.js} +1 -1
  92. package/dist/{tooltip-CkCndvTI.js → tooltip-T6H9uF-Z.js} +10 -10
  93. package/dist/{useButton-CuG5UzUw.js → useButton-D-xACzEY.js} +3 -3
  94. package/dist/{useEvent-DHv-yhOH.js → useEvent-XlYPKgwX.js} +1 -1
  95. package/dist/{useFocusRing-Cc-4eouh.js → useFocusRing-CRx_hYC4.js} +1 -1
  96. package/dist/{useFocusable-5q1Gek1J.js → useFocusable-CHfpEdlE.js} +2 -2
  97. package/dist/{useFormReset-Buc9YJcv.js → useFormReset-aHn6-wRk.js} +1 -1
  98. package/dist/{useFormValidationState-BAPPNXic.js → useFormValidationState-CdYmOaXI.js} +2 -2
  99. package/dist/{useHasTabbableChild-D3uUNhJ0.js → useHasTabbableChild-domoFB7A.js} +2 -2
  100. package/dist/{useLabel-CGlkoFG0.js → useLabel-DVhXVhtH.js} +2 -2
  101. package/dist/{useLabels-Dg62M_3P.js → useLabels-C7E5SkOi.js} +1 -1
  102. package/dist/{useListState-Domq0blV.js → useListState-BRsq7O1C.js} +1 -1
  103. package/dist/{useLocalizedStringFormatter-Prmz0h0A.js → useLocalizedStringFormatter-WsEL47qR.js} +1 -1
  104. package/dist/{useNumberFieldState-BLU3uhSR.js → useNumberFieldState-ZH2Qyyxh.js} +9 -9
  105. package/dist/{useNumberFormatter-BLc2xjZn.js → useNumberFormatter-mhdYLxWQ.js} +1 -1
  106. package/dist/{usePress-BQgVor4T.js → usePress-B42RawCH.js} +3 -3
  107. package/dist/{useToggle-C9ETOBaZ.js → useToggle-CExfZM8x.js} +4 -4
  108. package/dist/{useToggleState-DJ_z5E2S.js → useToggleState-DghG5ImG.js} +1 -1
  109. package/dist/utilities/array-helpers.js +30 -0
  110. package/dist/utilities/index.js +8 -0
  111. package/dist/utilities/text-helpers.js +30 -4
  112. package/dist/{utils-BsiH7-5Y.js → utils-DIBzm1e4.js} +1 -1
  113. package/dist/wp.js +1 -0
  114. package/package.json +11 -4
  115. package/dist/_commonjsHelpers-CUmg6egw.js +0 -6
  116. package/dist/utilities/classnames.js +0 -16
@@ -0,0 +1,231 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { icons } from "../../icons/icons.js";
3
+ import { BaseControl } from "../base-control/base-control.js";
4
+ import { a as ButtonGroup } from "../../button-idVI4jmd.js";
5
+ import { Menu, MenuItem } from "../menu/menu.js";
6
+ import { RadioButtonGroup, RadioButton } from "../radio/radio.js";
7
+ import { RichLabel } from "../rich-label/rich-label.js";
8
+ import { ToggleButton } from "../toggle-button/toggle-button.js";
9
+ /**
10
+ * A component that allows the user to select an option from a list of options.
11
+ *
12
+ * @component
13
+ * @param {Object} props - Component props.
14
+ * @param {JSX.Element} [props.icon] - Icon to display in the label.
15
+ * @param {string} props.label - Label to display.
16
+ * @param {string} [props.subtitle] - Subtitle to display below the label.
17
+ * @param {JSX.Element|JSX.Element[]} [props.actions] - Actions to show to the right of the label.
18
+ * @param {string} [props.help] - Help text to show below the component.
19
+ * @param {boolean} [props.inline] - If `true`, the component is displayed inline - icon/label/subtitle are on the left, the passed content is on the right. **Note:** not compatible with `actions`.
20
+ * @param {string} props.value - The currently selected value.
21
+ * @param {Function} props.onChange - Function to run when the selected value changes.
22
+ * @param {{label: string, value: any, tooltip: string|JSX.Element, icon: JSX.Element|string, ariaLabel: string, subtitle:string|JSX.Element }[]} props.options - The list of options to choose from.
23
+ * @param {string} [props.disabled] - If `true`, the option select component is disabled.
24
+ * @param {boolean} [props.vertical] - If `true`, the options are displayed vertically. Not applicable to the `menu` type.
25
+ * @param {OptionSelectType} [props.type='toggleButton'] - The type of the option select component.
26
+ * @param {string} [props.className] - Classes to pass to the main element wrapper.
27
+ * @param {string} [props.itemClassName] - Classes to pass to each item.
28
+ * @param {Object} [props.wrapperProps] - Props to pass to the wrapper.
29
+ * @param {Object} [props.itemProps] - Props to pass to each item.
30
+ * @param {boolean} [props.noTriggerLabel] - Whether the trigger label should be hidden. Applies only to the `menu` type.
31
+ * @param {boolean} [props.noTriggerIcon] - Whether the trigger icon should be hidden. Applies only to the `menu` type.
32
+ * @param {boolean} [props.noItemLabel] - Whether the option label should be hidden.
33
+ * @param {boolean} [props.noItemIcon] - Whether the option icon should be hidden.
34
+ * @param {boolean} [props.hidden] - If `true`, the component is not rendered.
35
+ *
36
+ * @returns {JSX.Element} The OptionSelect component.
37
+ *
38
+ * @typedef {'toggleButtons' | 'radios' | 'radiosSegmented' | 'menu'} OptionSelectType
39
+ *
40
+ * @example
41
+ * <OptionSelect
42
+ * label='My component'
43
+ * icon={icons.myIcon}
44
+ * value={value}
45
+ * onChange={setValue}
46
+ * options={[
47
+ * { label: 'Option 1', value: 'option1' },
48
+ * { label: 'Option 2', value: 'option2' },
49
+ * ]}
50
+ * />
51
+ *
52
+ * @preserve
53
+ */
54
+ const OptionSelect = (props) => {
55
+ var _a;
56
+ const {
57
+ icon,
58
+ label,
59
+ subtitle,
60
+ actions,
61
+ help,
62
+ inline,
63
+ value,
64
+ onChange,
65
+ options,
66
+ disabled,
67
+ vertical,
68
+ type = "toggleButtons",
69
+ className,
70
+ itemClassName,
71
+ wrapperProps,
72
+ itemProps,
73
+ noTriggerLabel,
74
+ noTriggerIcon,
75
+ noItemLabel,
76
+ noItemIcon,
77
+ children,
78
+ hidden,
79
+ ...rest
80
+ } = props;
81
+ if (hidden) {
82
+ return null;
83
+ }
84
+ const currentItem = options == null ? void 0 : options.find(({ value: optionValue }) => optionValue === value);
85
+ return /* @__PURE__ */ jsxs(
86
+ BaseControl,
87
+ {
88
+ icon,
89
+ label,
90
+ subtitle,
91
+ actions,
92
+ help,
93
+ inline,
94
+ className,
95
+ ...rest,
96
+ children: [
97
+ type === "toggleButtons" && /* @__PURE__ */ jsx(
98
+ ButtonGroup,
99
+ {
100
+ vertical,
101
+ "aria-label": !label && (props == null ? void 0 : props["aria-label"]),
102
+ ...wrapperProps,
103
+ children: options.map(
104
+ ({
105
+ label: optionLabel,
106
+ value: optionValue,
107
+ icon: optionIcon,
108
+ tooltip: optionTooltip,
109
+ ariaLabel: optionAriaLabel,
110
+ subtitle: optionSubtitle
111
+ }) => {
112
+ var _a2;
113
+ return /* @__PURE__ */ jsxs(
114
+ ToggleButton,
115
+ {
116
+ selected: optionValue === value,
117
+ onChange: () => onChange(optionValue),
118
+ disabled,
119
+ className: itemClassName,
120
+ icon: !noItemIcon && (typeof optionIcon === "string" ? (_a2 = icons) == null ? void 0 : _a2[optionIcon] : optionIcon),
121
+ tooltip: optionTooltip ?? optionAriaLabel ?? (noItemLabel && optionLabel),
122
+ "aria-label": optionAriaLabel ?? optionLabel ?? optionTooltip,
123
+ ...itemProps,
124
+ children: [
125
+ !noItemLabel && !optionSubtitle && optionLabel,
126
+ !noItemLabel && optionSubtitle && /* @__PURE__ */ jsx(
127
+ RichLabel,
128
+ {
129
+ label: optionLabel,
130
+ subtitle: optionSubtitle
131
+ }
132
+ )
133
+ ]
134
+ },
135
+ optionValue
136
+ );
137
+ }
138
+ )
139
+ }
140
+ ),
141
+ (type === "radios" || type === "radiosSegmented") && /* @__PURE__ */ jsx(
142
+ RadioButtonGroup,
143
+ {
144
+ orientation: vertical ? "vertical" : "horizontal",
145
+ onChange: (v) => onChange(v),
146
+ design: type === "radios" ? "default" : "segmented",
147
+ "aria-label": !label && (props == null ? void 0 : props["aria-label"]),
148
+ value,
149
+ ...wrapperProps,
150
+ children: options.map(
151
+ ({
152
+ label: optionLabel,
153
+ value: optionValue,
154
+ icon: optionIcon,
155
+ ariaLabel: optionAriaLabel,
156
+ subtitle: optionSubtitle
157
+ }) => {
158
+ var _a2;
159
+ return /* @__PURE__ */ jsx(
160
+ RadioButton,
161
+ {
162
+ value: optionValue,
163
+ disabled,
164
+ className: itemClassName,
165
+ subtitle: !noItemLabel && optionSubtitle,
166
+ icon: !noItemIcon && (typeof optionIcon === "string" ? (_a2 = icons) == null ? void 0 : _a2[optionIcon] : optionIcon),
167
+ "aria-label": optionAriaLabel ?? optionLabel,
168
+ label: !noItemLabel && optionLabel,
169
+ ...itemProps
170
+ },
171
+ optionValue
172
+ );
173
+ }
174
+ )
175
+ }
176
+ ),
177
+ type === "menu" && /* @__PURE__ */ jsxs(
178
+ Menu,
179
+ {
180
+ triggerLabel: !noTriggerLabel && (currentItem == null ? void 0 : currentItem.label),
181
+ triggerIcon: !noTriggerIcon && (typeof (currentItem == null ? void 0 : currentItem.icon) === "string" ? (_a = icons) == null ? void 0 : _a[currentItem == null ? void 0 : currentItem.icon] : currentItem == null ? void 0 : currentItem.icon),
182
+ tooltip: noTriggerLabel && ((currentItem == null ? void 0 : currentItem.tooltip) ?? (currentItem == null ? void 0 : currentItem.label)),
183
+ "aria-label": !label && (props == null ? void 0 : props["aria-label"]),
184
+ keepOpen: true,
185
+ ...wrapperProps,
186
+ children: [
187
+ options.map(
188
+ ({
189
+ label: optionLabel,
190
+ value: optionValue,
191
+ icon: optionIcon,
192
+ ariaLabel: optionAriaLabel,
193
+ subtitle: optionSubtitle
194
+ }) => {
195
+ var _a2;
196
+ return /* @__PURE__ */ jsxs(
197
+ MenuItem,
198
+ {
199
+ selected: value === optionValue,
200
+ disabled,
201
+ className: itemClassName,
202
+ icon: !noItemIcon && (typeof optionIcon === "string" ? (_a2 = icons) == null ? void 0 : _a2[optionIcon] : optionIcon),
203
+ "aria-label": optionAriaLabel ?? optionLabel,
204
+ onClick: () => onChange(optionValue),
205
+ ...itemProps,
206
+ children: [
207
+ !noItemLabel && !optionSubtitle && optionLabel,
208
+ !noItemLabel && optionSubtitle && /* @__PURE__ */ jsx(
209
+ RichLabel,
210
+ {
211
+ label: optionLabel,
212
+ subtitle: optionSubtitle
213
+ }
214
+ )
215
+ ]
216
+ },
217
+ optionValue
218
+ );
219
+ }
220
+ ),
221
+ children
222
+ ]
223
+ }
224
+ )
225
+ ]
226
+ }
227
+ );
228
+ };
229
+ export {
230
+ OptionSelect
231
+ };
@@ -0,0 +1,53 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { _ as __ } from "../../default-i18n-Bk1GxDHz.js";
3
+ import { icons } from "../../icons/icons.js";
4
+ import { RichLabel } from "../rich-label/rich-label.js";
5
+ import { c as clsx } from "../../lite-pbIeT7tm.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
+ const commonClassName = clsx(
28
+ "es-uic-w-fit es-uic-rounded-lg es-uic-border es-uic-border-gray-300 es-uic-bg-gray-50 es-uic-p-2 es-uic-pr-3 es-uic-text-xs es-uic-text-gray-300 es-uic-shadow",
29
+ fileName && "es-uic-font-mono",
30
+ className
31
+ );
32
+ if (!fileName) {
33
+ return /* @__PURE__ */ jsx(
34
+ RichLabel,
35
+ {
36
+ icon: icon ?? icons.file,
37
+ label: children ?? __("No file selected", "eightshift-ui-components"),
38
+ className: commonClassName
39
+ }
40
+ );
41
+ }
42
+ return /* @__PURE__ */ jsx(
43
+ RichLabel,
44
+ {
45
+ icon: icon ?? icons.file,
46
+ label: fileName ?? __("No file selected", "eightshift-ui-components"),
47
+ className: commonClassName
48
+ }
49
+ );
50
+ };
51
+ export {
52
+ FilePlaceholder
53
+ };
@@ -0,0 +1,88 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { c as clsx } from "../../lite-pbIeT7tm.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-uic-rounded-lg es-uic-border es-uic-border-gray-300 es-uic-bg-gray-50 es-uic-text-gray-300 es-uic-shadow",
36
+ simple: "es-uic-rounded-lg es-uic-border es-uic-border-gray-300 es-uic-border-dashed es-uic-text-gray-300"
37
+ };
38
+ const sizeClassName = {
39
+ auto: "",
40
+ default: "es-uic-size-20",
41
+ large: "es-uic-size-40",
42
+ fullWidth: "es-uic-w-full",
43
+ fullHeight: "es-uic-h-full",
44
+ full: "es-uic-size-full",
45
+ video: "es-uic-w-full es-uic-aspect-video"
46
+ };
47
+ return /* @__PURE__ */ jsxs(
48
+ "div",
49
+ {
50
+ className: clsx(
51
+ "es-uic-grid es-uic-grid-cols-1 es-uic-grid-rows-1 es-uic-overflow-hidden",
52
+ "[&>*]:es-uic-col-start-1 [&>*]:es-uic-col-end-1 [&>*]:es-uic-row-start-1 [&>*]:es-uic-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-uic-size-full es-uic-select-none es-uic-fill-mode-forwards",
63
+ imageMode === "cover" && "es-uic-object-cover",
64
+ imageMode === "contain" && "es-uic-object-contain",
65
+ imageMode === "fill" && "es-uic-object-fill",
66
+ (url == null ? void 0 : url.length) > 0 ? "es-uic-animate-in es-uic-fade-in-0 es-uic-zoom-in-95" : "es-uic-animate-out es-uic-fade-out-0 es-uic-zoom-out-95"
67
+ ),
68
+ src: url,
69
+ alt
70
+ }
71
+ ),
72
+ /* @__PURE__ */ jsx(
73
+ "div",
74
+ {
75
+ className: clsx(
76
+ "es-uic-place-self-center es-uic-justify-self-center es-uic-transition es-uic-fill-mode-forwards [&>svg]:es-uic-size-7",
77
+ !url ? "es-uic-animate-in es-uic-fade-in-0 es-uic-zoom-in-95" : "es-uic-animate-out es-uic-fade-out-0 es-uic-zoom-out-95"
78
+ ),
79
+ children: icons.image
80
+ }
81
+ )
82
+ ]
83
+ }
84
+ );
85
+ };
86
+ export {
87
+ ImagePlaceholder
88
+ };
@@ -0,0 +1,62 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { c as clsx } from "../../lite-pbIeT7tm.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, hidden } = props;
28
+ if (hidden) {
29
+ return null;
30
+ }
31
+ const styleClassName = {
32
+ default: "es-uic-rounded-lg es-uic-border es-uic-border-gray-300 es-uic-bg-gray-50 es-uic-text-gray-300 es-uic-shadow",
33
+ simple: "es-uic-rounded-lg es-uic-border es-uic-border-gray-300 es-uic-border-dashed es-uic-text-gray-300"
34
+ };
35
+ const sizeClassName = {
36
+ auto: "",
37
+ default: "es-uic-size-20",
38
+ large: "es-uic-size-40",
39
+ fullWidth: "es-uic-w-full",
40
+ fullHeight: "es-uic-h-full",
41
+ full: "es-uic-size-full",
42
+ video: "es-uic-w-full es-uic-aspect-video"
43
+ };
44
+ return /* @__PURE__ */ jsxs(
45
+ "div",
46
+ {
47
+ className: clsx(
48
+ "es-uic-flex es-uic-flex-col es-uic-items-center es-uic-justify-center es-uic-gap-2 es-uic-overflow-hidden",
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: "[&>svg]:es-uic-size-7", children: icon ?? icons.image }),
55
+ helpText && /* @__PURE__ */ jsx("div", { className: "es-uic-text-sm es-uic-text-gray-400", children: helpText })
56
+ ]
57
+ }
58
+ );
59
+ };
60
+ export {
61
+ MediaPlaceholder
62
+ };
@@ -1,8 +1,8 @@
1
1
  import "react/jsx-runtime";
2
- import { P, T } from "../../popover-Dx3vKXUX.js";
3
- import "../../utilities/classnames.js";
4
- import "../../default-i18n-BhE-OUmt.js";
5
- import "../../button-BkkdyHfJ.js";
2
+ import { P, T } from "../../popover-o2Q28Ljn.js";
3
+ import "../../lite-pbIeT7tm.js";
4
+ import "../../default-i18n-Bk1GxDHz.js";
5
+ import "../../button-idVI4jmd.js";
6
6
  export {
7
7
  P as Popover,
8
8
  T as TriggeredPopover
@@ -1,21 +1,21 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-BPzS-sR7.js";
3
- import { d as $3ef42575df84b30b$export$9d1611c77c2fe928, e as $bdb11010cef70236$export$f680877a34711e37, a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, h as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, c as $64fa3d84918910a7$export$4d86445c2cf5e3, j as $64fa3d84918910a7$export$2881499e37b75b9a, l as $df56164dff5785e2$export$4338b53315abf666, m as $5dc95899b306f630$export$c9058316764c140e, i as $64fa3d84918910a7$export$ef03459518577ad4 } from "../../utils-BsiH7-5Y.js";
4
- import { a as $2baaea4c71418dea$export$294aa081a6c6f55d, $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-wtMA4667.js";
2
+ import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-9x5iLJ-Y.js";
3
+ import { d as $3ef42575df84b30b$export$9d1611c77c2fe928, e as $bdb11010cef70236$export$f680877a34711e37, a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, h as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, c as $64fa3d84918910a7$export$4d86445c2cf5e3, j as $64fa3d84918910a7$export$2881499e37b75b9a, l as $df56164dff5785e2$export$4338b53315abf666, m as $5dc95899b306f630$export$c9058316764c140e, i as $64fa3d84918910a7$export$ef03459518577ad4 } from "../../utils-DIBzm1e4.js";
4
+ import { a as $2baaea4c71418dea$export$294aa081a6c6f55d, $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-ILxgMZy5.js";
5
5
  import { $ as $d3e0e05bdfcf66bd$export$c24727297075ec6a } from "../../Form-Cq3fu75_.js";
6
- import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-BM136LvS.js";
6
+ import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-Cyxp9ewv.js";
7
7
  import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-DG2RfOUr.js";
8
8
  import React__default, { useMemo, useState, forwardRef, createContext, cloneElement } from "react";
9
- import { a as $e93e671b31057976$export$b8473d3665f3a75a, $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10 } from "../../useFormValidationState-BAPPNXic.js";
10
- import { d as $9ab94262bd0047c7$export$420e68273165f4ec, e as $458b0a5536c1a7cf$export$40bfa8c7b0832715, $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../focusSafely-C3K8zAKj.js";
11
- import { a as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "../../FocusScope-1u9yyfIN.js";
12
- import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-jMy6xdVq.js";
13
- import { $ as $99facab73266f662$export$5add1d006293d136 } from "../../useFormReset-Buc9YJcv.js";
14
- import { $ as $e6afbd83fe6ebbd2$export$4c014de7c8940b4c } from "../../useFocusable-5q1Gek1J.js";
15
- import { $ as $f6c31cce2adf654f$export$45712eceda6fad21 } from "../../usePress-BQgVor4T.js";
16
- import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-Cc-4eouh.js";
17
- import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "../../VisuallyHidden-BYRI1Lfo.js";
18
- import { classnames } from "../../utilities/classnames.js";
9
+ import { a as $e93e671b31057976$export$b8473d3665f3a75a, $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10 } from "../../useFormValidationState-CdYmOaXI.js";
10
+ import { d as $9ab94262bd0047c7$export$420e68273165f4ec, e as $458b0a5536c1a7cf$export$40bfa8c7b0832715, $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../focusSafely-B0hyd-S4.js";
11
+ import { a as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "../../FocusScope-B9b0VMib.js";
12
+ import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-BAcFg5GO.js";
13
+ import { $ as $99facab73266f662$export$5add1d006293d136 } from "../../useFormReset-aHn6-wRk.js";
14
+ import { $ as $e6afbd83fe6ebbd2$export$4c014de7c8940b4c } from "../../useFocusable-CHfpEdlE.js";
15
+ import { $ as $f6c31cce2adf654f$export$45712eceda6fad21 } from "../../usePress-B42RawCH.js";
16
+ import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-CRx_hYC4.js";
17
+ import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "../../VisuallyHidden-BPJVSUyp.js";
18
+ import { c as clsx } from "../../lite-pbIeT7tm.js";
19
19
  import { AnimatedVisibility } from "../animated-visibility/animated-visibility.js";
20
20
  import { RichLabel } from "../rich-label/rich-label.js";
21
21
  import { BaseControl } from "../base-control/base-control.js";
@@ -357,6 +357,7 @@ const $b6c3ddc6086f204d$export$d7b12c4107be0d61 = /* @__PURE__ */ forwardRef($b6
357
357
  * @param {string} [props.className] - Additional classes to add to the checkbox container.
358
358
  * @param {string} [props.labelClassName] - Additional classes to add to the label container.
359
359
  * @param {boolean} [props.alignEnd] - Whether the label should be aligned to the end.
360
+ * @param {boolean} [props.hidden] - If `true`, the component is not rendered.
360
361
  *
361
362
  * @returns {JSX.Element} The RadioButton component.
362
363
  *
@@ -375,16 +376,20 @@ const RadioButton = (props) => {
375
376
  design = "default",
376
377
  alignEnd,
377
378
  children,
378
- ...other
379
+ hidden,
380
+ ...rest
379
381
  } = props;
380
- const styles = {
381
- segmented: classnames(
382
- "es-uic-py-1 es-uic-px-1.5 es-uic-border hover:es-uic-bg-gray-50 es-uic-transition",
382
+ if (hidden) {
383
+ return null;
384
+ }
385
+ const styleClassName = {
386
+ segmented: clsx(
387
+ "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",
383
388
  "first:es-uic-rounded-t-lg last:es-uic-rounded-b-lg",
384
389
  "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"
385
390
  ),
386
- segmentedHorizontal: classnames(
387
- "es-uic-py-1 es-uic-px-1.5 es-uic-border hover:es-uic-bg-gray-50 es-uic-transition es-uic-grow",
391
+ segmentedHorizontal: clsx(
392
+ "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",
388
393
  "first:es-uic-rounded-l-lg last:es-uic-rounded-r-lg",
389
394
  "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"
390
395
  )
@@ -393,14 +398,14 @@ const RadioButton = (props) => {
393
398
  $b6c3ddc6086f204d$export$d7b12c4107be0d61,
394
399
  {
395
400
  isDisabled: disabled,
396
- className: classnames(
401
+ className: clsx(
397
402
  "es-uic-flex es-uic-items-center es-uic-gap-1.5 es-uic-text-sm",
398
- styles[design],
403
+ styleClassName[design],
399
404
  className
400
405
  ),
401
- ...other,
402
- children: ({ isSelected }) => /* @__PURE__ */ jsxs(Fragment, { children: [
403
- (icon || alignEnd) && (label || subtitle) && /* @__PURE__ */ jsx(
406
+ ...rest,
407
+ children: ({ isSelected, isFocusVisible }) => /* @__PURE__ */ jsxs(Fragment, { children: [
408
+ alignEnd && (label || subtitle || icon) && /* @__PURE__ */ jsx(
404
409
  RichLabel,
405
410
  {
406
411
  icon,
@@ -413,9 +418,10 @@ const RadioButton = (props) => {
413
418
  /* @__PURE__ */ jsx(
414
419
  "div",
415
420
  {
416
- className: classnames(
421
+ className: clsx(
417
422
  "es-uic-flex es-uic-size-5 es-uic-items-center es-uic-justify-center es-uic-rounded-full es-uic-border es-uic-text-gray-600 es-uic-shadow-sm es-uic-transition",
418
- isSelected ? "es-uic-border-teal-600 es-uic-bg-teal-600 es-uic-text-white" : "es-uic-border-gray-300"
423
+ isSelected ? "es-uic-border-teal-600 es-uic-bg-teal-600 es-uic-text-white" : "es-uic-border-gray-300",
424
+ !(design == null ? void 0 : design.startsWith("segmented")) && isFocusVisible && "es-uic-ring es-uic-ring-teal-500 es-uic-ring-opacity-50"
419
425
  ),
420
426
  children: /* @__PURE__ */ jsx(
421
427
  AnimatedVisibility,
@@ -429,12 +435,13 @@ const RadioButton = (props) => {
429
435
  )
430
436
  }
431
437
  ),
432
- !icon && !alignEnd && (label || subtitle) && /* @__PURE__ */ jsx(
438
+ !alignEnd && /* @__PURE__ */ jsx(
433
439
  RichLabel,
434
440
  {
441
+ icon,
435
442
  label,
436
443
  subtitle,
437
- className: labelClassName
444
+ className: clsx(labelClassName, "[&_>_span_>_svg]:!es-uic-size-5")
438
445
  }
439
446
  ),
440
447
  !(icon || label || subtitle) && children
@@ -464,6 +471,7 @@ RadioButton.displayName = "RadioButton";
464
471
  * @param {Function} [props.onChange] - Function to call when the value of the selected radio button changes.
465
472
  * @param {string} [props.className] - Additional classes to add to the group container.
466
473
  * @param {string} [props.labelClassName] - Additional classes to add to the label container.
474
+ * @param {boolean} [props.hidden] - If `true`, the component is not rendered.
467
475
  *
468
476
  * @returns {JSX.Element} The RadioButtonGroup component.
469
477
  *
@@ -500,8 +508,12 @@ const RadioButtonGroup = (props) => {
500
508
  children,
501
509
  className,
502
510
  labelClassName,
503
- ...other
511
+ hidden,
512
+ ...rest
504
513
  } = props;
514
+ if (hidden) {
515
+ return null;
516
+ }
505
517
  let mappedChildren = children ?? [];
506
518
  if (!Array.isArray(children)) {
507
519
  mappedChildren = [children];
@@ -518,13 +530,13 @@ const RadioButtonGroup = (props) => {
518
530
  return /* @__PURE__ */ jsx(
519
531
  $b6c3ddc6086f204d$export$a98f0dcb43a68a25,
520
532
  {
521
- className: classnames("es-uic-w-full", className),
533
+ className: clsx("es-uic-w-full", className),
522
534
  isDisabled: disabled,
523
535
  isReadOnly: readOnly,
524
536
  onChange,
525
537
  value,
526
538
  orientation,
527
- ...other,
539
+ ...rest,
528
540
  children: /* @__PURE__ */ jsx(
529
541
  BaseControl,
530
542
  {
@@ -535,12 +547,18 @@ const RadioButtonGroup = (props) => {
535
547
  help,
536
548
  labelAs: $01b77f81d0f07f68$export$b04be29aa201d4f5,
537
549
  className: labelClassName,
538
- controlContainerClassName: classnames(
539
- orientation === "horizontal" && "es-uic-flex es-uic-flex-wrap !es-uic-space-y-0 es-uic-gap-2.5",
540
- design === "segmented" && orientation === "vertical" && "!-es-uic-space-y-px",
541
- design === "segmented" && orientation === "horizontal" && "!es-uic-gap-0 !es-uic-nowrap -es-uic-space-x-px"
542
- ),
543
- children: mappedChildren
550
+ children: /* @__PURE__ */ jsx(
551
+ "div",
552
+ {
553
+ className: clsx(
554
+ design === "default" && orientation === "horizontal" && "es-uic-flex es-uic-flex-wrap es-uic-gap-2.5",
555
+ design === "default" && orientation === "vertical" && "es-uic-flex es-uic-flex-col es-uic-gap-2.5",
556
+ design === "segmented" && orientation === "vertical" && "es-uic-flex es-uic-flex-col -es-uic-space-y-px",
557
+ design === "segmented" && orientation === "horizontal" && "es-uic-nowrap es-uic-flex -es-uic-space-x-px"
558
+ ),
559
+ children: mappedChildren
560
+ }
561
+ )
544
562
  }
545
563
  )
546
564
  }