@eightshift/ui-components 1.3.2 → 1.4.1

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 (110) hide show
  1. package/dist/{Button-DTARR6Ff.js → Button-uYE9D_E3.js} +6 -5
  2. package/dist/{ColorSwatch-5bZ_yIMB.js → ColorSwatch-Bev-9Vbr.js} +4 -4
  3. package/dist/{Dialog-DJgS0mAg.js → Dialog-CGE2ficT.js} +17 -15
  4. package/dist/{FieldError-CviphIN5.js → FieldError-CBPJ4Xx8.js} +2 -2
  5. package/dist/{FocusScope-BjM5iOQC.js → FocusScope-CVd6C65L.js} +24 -8
  6. package/dist/{GridList-DjRnMEae.js → GridList-PBJsm70G.js} +156 -116
  7. package/dist/{Group-BQu67pVS.js → Group-WZgNv9RE.js} +3 -3
  8. package/dist/Hidden-YSmyVF_5.js +45 -0
  9. package/dist/{Input-DWRQF0ro.js → Input-CaS4qmLb.js} +10 -9
  10. package/dist/{Label-BXvY41yE.js → Label-yZgqvhXc.js} +3 -2
  11. package/dist/ListBox-MZyPpwvj.js +567 -0
  12. package/dist/{Select-49a62830.esm-BnlXlUnT.js → Select-49a62830.esm-CqLHaIei.js} +1 -1
  13. package/dist/{SelectionManager-JxXmb3-k.js → SelectionManager-CvRaua4m.js} +1580 -1484
  14. package/dist/{Separator-CX64zwq8.js → Separator-C7Few7L6.js} +80 -62
  15. package/dist/{Slider-Clme2C36.js → Slider-D8a63VhT.js} +14 -12
  16. package/dist/{Text-qjognpzK.js → Text-D8qh3_U7.js} +1 -1
  17. package/dist/{VisuallyHidden-BZPezMV5.js → VisuallyHidden-DD480kAb.js} +2 -2
  18. package/dist/_commonjsHelpers-CUmg6egw.js +6 -0
  19. package/dist/{ariaHideOutside-BZ5z6iCD.js → ariaHideOutside-BzxkODNq.js} +1 -9
  20. package/dist/assets/style.css +1 -1
  21. package/dist/assets/wp-ui-enhancements.css +1 -1
  22. package/dist/components/animated-visibility/animated-visibility.js +311 -198
  23. package/dist/components/base-control/base-control.js +1 -1
  24. package/dist/components/button/button.js +274 -9
  25. package/dist/components/checkbox/checkbox.js +171 -1
  26. package/dist/components/color-pickers/color-picker.js +1 -1
  27. package/dist/components/color-pickers/color-swatch.js +3 -3
  28. package/dist/components/color-pickers/gradient-editor.js +3 -3
  29. package/dist/components/color-pickers/solid-color-picker.js +46 -32
  30. package/dist/components/component-toggle/component-toggle.js +2 -2
  31. package/dist/components/container-panel/container-panel.js +2 -2
  32. package/dist/components/draggable-list/draggable-list-item.js +3 -3
  33. package/dist/components/draggable-list/draggable-list.js +3671 -6
  34. package/dist/components/expandable/expandable.js +7 -4
  35. package/dist/components/index.js +4 -4
  36. package/dist/components/input-field/input-field.js +7 -7
  37. package/dist/components/link-input/link-input.js +1519 -489
  38. package/dist/components/list-box/list-box.js +2 -2
  39. package/dist/components/matrix-align/matrix-align.js +3 -3
  40. package/dist/components/menu/menu.js +164 -466
  41. package/dist/components/modal/modal.js +7 -7
  42. package/dist/components/number-picker/number-picker.js +22 -17
  43. package/dist/components/option-select/option-select.js +2 -2
  44. package/dist/components/placeholders/file-placeholder.js +1 -1
  45. package/dist/components/popover/popover.js +3 -3
  46. package/dist/components/radio/radio.js +13 -13
  47. package/dist/components/repeater/repeater-context.js +5 -0
  48. package/dist/components/repeater/repeater-item.js +46 -91
  49. package/dist/components/repeater/repeater.js +5130 -175
  50. package/dist/components/responsive/responsive-legacy.js +3 -3
  51. package/dist/components/responsive/responsive.js +3 -3
  52. package/dist/components/responsive-preview/responsive-preview.js +1 -1
  53. package/dist/components/select/async-multi-select.js +3 -3
  54. package/dist/components/select/async-single-select.js +2 -2
  55. package/dist/components/select/custom-select-default-components.js +1 -1
  56. package/dist/components/select/multi-select-components.js +1 -1
  57. package/dist/components/select/multi-select.js +5 -5
  58. package/dist/components/select/react-select-component-wrappers.js +1 -1
  59. package/dist/components/select/single-select.js +2 -2
  60. package/dist/components/select/styles.js +1 -1
  61. package/dist/components/slider/column-config-slider.js +3 -3
  62. package/dist/components/slider/slider.js +3 -3
  63. package/dist/components/slider/utils.js +1 -1
  64. package/dist/components/tabs/tabs.js +46 -71
  65. package/dist/components/toggle/switch.js +6 -6
  66. package/dist/components/toggle/toggle.js +1 -1
  67. package/dist/components/toggle-button/toggle-button.js +7 -7
  68. package/dist/components/tooltip/tooltip.js +3 -3
  69. package/dist/{context-BG_1RnbC.js → context-Bon2Gyx5.js} +1 -1
  70. package/dist/{default-i18n-BqwLkgZv.js → default-i18n-BqWys-1G.js} +1 -1
  71. package/dist/{focusSafely-DGZ4R5fj.js → focusSafely-PMGZgZ9-.js} +33 -26
  72. package/dist/getScrollParent-B3XgpXBL.js +10 -0
  73. package/dist/icons/icons.js +205 -0
  74. package/dist/icons/jsx-svg.js +2 -2
  75. package/dist/{index-CAPcSs9K.js → index-BTCzc3zb.js} +1 -1
  76. package/dist/{index-a301f526.esm-ByOfDxiG.js → index-a301f526.esm-B9tWL9yi.js} +80 -603
  77. package/dist/index.js +4 -4
  78. package/dist/{intlStrings-CkuKCPkT.js → intlStrings-KQxgp5tS.js} +14 -9
  79. package/dist/{multi-select-components-7vKCF8dG.js → multi-select-components-DTvEidE3.js} +1 -1
  80. package/dist/react-jsx-parser.min-CAGfntg1.js +13425 -0
  81. package/dist/{react-select-async.esm-5zW9Dv9E.js → react-select-async.esm-8Rba_3KV.js} +3 -3
  82. package/dist/{react-select.esm-Bi6uzjbT.js → react-select.esm-DkSeQzOP.js} +3 -3
  83. package/dist/{textSelection-BLyBtNe2.js → textSelection-DS7-670U.js} +1 -1
  84. package/dist/{tooltip-DSk8I1SO.js → tooltip-C9mg1CP5.js} +54 -18
  85. package/dist/{useButton-EJ9c8fmq.js → useButton-BPY4yXUo.js} +3 -3
  86. package/dist/{useEvent-Cxq_BzP_.js → useEvent-DDLT851Z.js} +1 -1
  87. package/dist/{useFocusRing-Dg5Y_10S.js → useFocusRing-DsxEaA2J.js} +1 -1
  88. package/dist/{useFocusable-CQZyQp4q.js → useFocusable-BFKHuYS9.js} +2 -2
  89. package/dist/{useFormReset-DJMtIgSL.js → useFormReset-BCPbwfnH.js} +1 -1
  90. package/dist/{useFormValidationState-DDC_nImg.js → useFormValidationState-DC5jbhBW.js} +2 -2
  91. package/dist/{useHasTabbableChild-M3O3VIil.js → useHasTabbableChild-Byd7ylXD.js} +2 -2
  92. package/dist/{useLabel-6NqYraET.js → useLabel-DuJhImKc.js} +2 -2
  93. package/dist/{useLabels-D2RG7TdI.js → useLabels-JaBafrnV.js} +1 -1
  94. package/dist/{useListData-BpYQj7kK.js → useListData-B5Pk32vd.js} +6 -3
  95. package/dist/{useListState-IllYYnXV.js → useListState-Csx05BmT.js} +6 -3
  96. package/dist/{useLocalizedStringFormatter-Cwm_siat.js → useLocalizedStringFormatter-CVIIVTgz.js} +1 -1
  97. package/dist/useMenuTrigger-CMgzyMKW.js +246 -0
  98. package/dist/{useNumberFieldState-CVJOJnF1.js → useNumberFieldState-BVFqhboT.js} +12 -11
  99. package/dist/{useNumberFormatter-DVZRQXk3.js → useNumberFormatter-BEeBSV-N.js} +1 -1
  100. package/dist/{usePress-CiXj8dLE.js → usePress-CY8MpqYD.js} +58 -16
  101. package/dist/useSingleSelectListState-CzZUgAt0.js +37 -0
  102. package/dist/{useToggle-CV-IX6nL.js → useToggle-CJp2Fh_L.js} +4 -4
  103. package/dist/{useToggleState-DHIdITtQ.js → useToggleState-B4--Ski0.js} +1 -1
  104. package/dist/{utils-DC-UMp1n.js → utils-B4IdLYb8.js} +48 -85
  105. package/package.json +24 -21
  106. package/dist/Checkbox-CiJIVbAP.js +0 -174
  107. package/dist/ListBox-DTKMdjQC.js +0 -4216
  108. package/dist/_commonjsHelpers-DWwsNxpa.js +0 -8
  109. package/dist/button-IxfzzzbP.js +0 -277
  110. package/dist/react-jsx-parser.min-DhrYeqLL.js +0 -4563
@@ -1,8 +0,0 @@
1
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
2
- function getDefaultExportFromCjs(x) {
3
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
4
- }
5
- export {
6
- commonjsGlobal as c,
7
- getDefaultExportFromCjs as g
8
- };
@@ -1,277 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { a as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "./Button-DTARR6Ff.js";
3
- import { g as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, a as $64fa3d84918910a7$export$29f1550f4b0d4415, c as $64fa3d84918910a7$export$4d86445c2cf5e3, d as $3ef42575df84b30b$export$9d1611c77c2fe928, l as $df56164dff5785e2$export$4338b53315abf666 } from "./utils-DC-UMp1n.js";
4
- import { b as $9bf71ea28793e738$export$c5251b9e124bf29 } from "./FocusScope-BjM5iOQC.js";
5
- import React__default, { useState, useRef, forwardRef, createContext } from "react";
6
- import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-BG_1RnbC.js";
7
- import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-EDDcM64A.js";
8
- import { c as clsx } from "./lite-DVmmD_-j.js";
9
- import { T as Tooltip } from "./tooltip-DSk8I1SO.js";
10
- import { _ as __ } from "./default-i18n-BqwLkgZv.js";
11
- function $2680b1829e803644$export$fa142eb1681c520(props, ref) {
12
- const { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, orientation = "horizontal" } = props;
13
- let [isInToolbar, setInToolbar] = useState(false);
14
- $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
15
- var _ref_current_parentElement;
16
- setInToolbar(!!(ref.current && ((_ref_current_parentElement = ref.current.parentElement) === null || _ref_current_parentElement === void 0 ? void 0 : _ref_current_parentElement.closest('[role="toolbar"]'))));
17
- });
18
- const { direction } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
19
- const shouldReverse = direction === "rtl" && orientation === "horizontal";
20
- let focusManager = $9bf71ea28793e738$export$c5251b9e124bf29(ref);
21
- const onKeyDown = (e) => {
22
- if (!e.currentTarget.contains(e.target)) return;
23
- if (orientation === "horizontal" && e.key === "ArrowRight" || orientation === "vertical" && e.key === "ArrowDown") {
24
- if (shouldReverse) focusManager.focusPrevious();
25
- else focusManager.focusNext();
26
- } else if (orientation === "horizontal" && e.key === "ArrowLeft" || orientation === "vertical" && e.key === "ArrowUp") {
27
- if (shouldReverse) focusManager.focusNext();
28
- else focusManager.focusPrevious();
29
- } else if (e.key === "Tab") {
30
- e.stopPropagation();
31
- lastFocused.current = document.activeElement;
32
- if (e.shiftKey) focusManager.focusFirst();
33
- else focusManager.focusLast();
34
- return;
35
- } else
36
- return;
37
- e.stopPropagation();
38
- e.preventDefault();
39
- };
40
- const lastFocused = useRef(null);
41
- const onBlur = (e) => {
42
- if (!e.currentTarget.contains(e.relatedTarget) && !lastFocused.current) lastFocused.current = e.target;
43
- };
44
- const onFocus = (e) => {
45
- var _ref_current;
46
- if (lastFocused.current && !e.currentTarget.contains(e.relatedTarget) && ((_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.contains(e.target))) {
47
- var _lastFocused_current;
48
- (_lastFocused_current = lastFocused.current) === null || _lastFocused_current === void 0 ? void 0 : _lastFocused_current.focus();
49
- lastFocused.current = null;
50
- }
51
- };
52
- return {
53
- toolbarProps: {
54
- role: !isInToolbar ? "toolbar" : "group",
55
- "aria-orientation": orientation,
56
- "aria-label": ariaLabel,
57
- "aria-labelledby": ariaLabel == null ? ariaLabelledBy : void 0,
58
- onKeyDownCapture: !isInToolbar ? onKeyDown : void 0,
59
- onFocusCapture: !isInToolbar ? onFocus : void 0,
60
- onBlurCapture: !isInToolbar ? onBlur : void 0
61
- }
62
- };
63
- }
64
- const $13c3c67164f4d5be$export$6311e7ab80ef752f = /* @__PURE__ */ createContext({});
65
- function $13c3c67164f4d5be$var$Toolbar(props, ref) {
66
- [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $13c3c67164f4d5be$export$6311e7ab80ef752f);
67
- let { toolbarProps } = $2680b1829e803644$export$fa142eb1681c520(props, ref);
68
- let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
69
- ...props,
70
- values: {
71
- orientation: props.orientation || "horizontal"
72
- },
73
- defaultClassName: "react-aria-Toolbar"
74
- });
75
- let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props);
76
- delete DOMProps.id;
77
- return /* @__PURE__ */ React__default.createElement("div", {
78
- ...$3ef42575df84b30b$export$9d1611c77c2fe928(toolbarProps, DOMProps),
79
- ...renderProps,
80
- ref,
81
- slot: props.slot || void 0,
82
- "data-orientation": props.orientation || "horizontal"
83
- }, renderProps.children);
84
- }
85
- const $13c3c67164f4d5be$export$4c260019440d418f = /* @__PURE__ */ forwardRef($13c3c67164f4d5be$var$Toolbar);
86
- /**
87
- * A simple button component.
88
- *
89
- * @component
90
- * @param {Object} props - Component props.
91
- * @param {JSX.Element} [props.icon] - Icon to display within the button.
92
- * @param {ButtonSize} [props.size='default'] - The size of the button.
93
- * @param {ButtonType} [props.type='default'] - The type of the button.
94
- * @param {boolean} [props.disabled] - If `true`, the button is disabled.
95
- * @param {string} [props.className] - Classes to pass to the button.
96
- * @param {string} [props.tooltip] - Tooltip text to display on hover.
97
- * @param {Function} [props.onPress] - Function to run when the button is pressed.
98
- * @param {React.Ref} [props.forwardedRef] - Ref to forward to the button. Use the same as the `ref` prop.
99
- * @param {string} [props.wrapperClassName] - Classes to pass to the tooltip wrapper.
100
- * @param {Object} [props.tooltipProps] - Props to pass to the tooltip.
101
- * @param {boolean} [props.hidden] - If `true`, the component is not rendered.
102
- *
103
- * @returns {JSX.Element} The Button component.
104
- *
105
- * @typedef {'small' | 'default' | 'large'} ButtonSize
106
- * @typedef {'default' | 'selected' | 'ghost' | 'danger'} ButtonType
107
- *
108
- * @example
109
- * <Button onPress={() => console.log('Hi!')} icon={icons.myIcon} />
110
- *
111
- * <Button onPress={() => console.log('Hi!')} icon={icons.myIcon}>My button</Button>
112
- *
113
- * @preserve
114
- */
115
- const Button = (props) => {
116
- var _a, _b, _c, _d;
117
- const {
118
- children,
119
- icon,
120
- size = "default",
121
- type = "default",
122
- disabled,
123
- className,
124
- tooltip,
125
- onPress,
126
- forwardedRef,
127
- wrapperClassName,
128
- tooltipProps,
129
- "aria-label": ariaLabel = typeof children === "string" ? children : __("Menu item", "eightshift-ui-components"),
130
- hidden,
131
- ...other
132
- } = props;
133
- const objRef = $df56164dff5785e2$export$4338b53315abf666(forwardedRef);
134
- if (hidden) {
135
- return null;
136
- }
137
- const sizes = {
138
- small: {
139
- iconButton: "es-uic-size-7",
140
- button: "es-uic-h-7 es-uic-min-w-7",
141
- iconButtonPadding: "es-uic-px-1",
142
- buttonPadding: "es-uic-px-2",
143
- iconSize: "[&>svg]:es-uic-size-4"
144
- },
145
- default: {
146
- iconButton: "es-uic-size-9",
147
- button: "es-uic-h-9 es-uic-min-w-9",
148
- iconButtonPadding: "es-uic-px-1.5",
149
- buttonPadding: "es-uic-px-2",
150
- iconSize: "[&>svg]:es-uic-size-5.5"
151
- },
152
- large: {
153
- iconButton: "es-uic-size-10",
154
- button: "es-uic-h-10 es-uic-min-w-10",
155
- iconButtonPadding: "es-uic-px-2",
156
- buttonPadding: "es-uic-px-4",
157
- iconSize: "[&>svg]:es-uic-size-6"
158
- }
159
- };
160
- const themes = {
161
- default: {
162
- regular: "es-uic-text-gray-700 es-uic-shadow-sm es-uic-border es-uic-border-gray-300 es-uic-bg-white",
163
- hover: "hover:es-uic-border-gray-300 hover:es-uic-bg-gray-100",
164
- disabled: "disabled:es-uic-border-gray-300 disabled:es-uic-bg-gray-50/50 disabled:es-uic-text-gray-300 es-uic-border",
165
- focus: "focus-visible:es-uic-ring-teal-500 focus-visible:es-uic-ring-opacity-50"
166
- },
167
- selected: {
168
- regular: "es-uic-bg-teal-600 es-uic-text-white es-uic-border-teal-600 after:es-uic-opacity-45 es-uic-border es-uic-shadow-md es-uic-shadow-teal-500/25",
169
- hover: "hover:es-uic-shadow-teal-600/50 hover:after:es-uic-opacity-60"
170
- },
171
- ghost: {
172
- regular: "es-uic-border-transparent es-uic-text-gray-700",
173
- hover: "hover:es-uic-bg-gray-100",
174
- disabled: "disabled:es-uic-text-gray-300 disabled:es-uic-border-transparent"
175
- },
176
- danger: {
177
- regular: "es-uic-border-red-300 es-uic-text-gray-700 es-uic-text-gray-900 es-uic-shadow-red-300/30 [&>svg]:es-uic-text-red-500 es-uic-shadow-sm es-uic-border",
178
- hover: "hover:es-uic-border-red-400 hover:es-uic-bg-red-50 hover:es-uic-text-red-500 hover:es-uic-shadow-red-300/75",
179
- focus: "focus-visible:es-uic-ring-red-500 focus-visible:es-uic-ring-opacity-50"
180
- }
181
- };
182
- const component = /* @__PURE__ */ jsxs(
183
- $d2b4bc8c273e7be6$export$353f5b6fc5456de1,
184
- {
185
- onPress,
186
- isDisabled: disabled,
187
- className: clsx(
188
- "es-uic-flex es-uic-items-center es-uic-gap-1 es-uic-rounded-md es-uic-transition es-uic-duration-300",
189
- icon && children && "es-uic-justify-start",
190
- icon && !children && "es-uic-justify-center",
191
- !icon && children && "es-uic-justify-center",
192
- !disabled && (((_a = themes[type]) == null ? void 0 : _a.regular) ?? themes.default.regular),
193
- !disabled && (((_b = themes[type]) == null ? void 0 : _b.hover) ?? themes.default.hover),
194
- "disabled:es-uic-shadow-none",
195
- disabled && (((_c = themes[type]) == null ? void 0 : _c.disabled) ?? themes.default.disabled),
196
- "focus:es-uic-outline-none focus-visible:es-uic-outline-none focus-visible:es-uic-ring",
197
- ((_d = themes[type]) == null ? void 0 : _d.focus) ?? themes.default.focus,
198
- icon && !children && sizes[size].iconButton,
199
- children && "es-uic-text-sm",
200
- children && sizes[size].button,
201
- children && icon && sizes[size].iconButtonPadding,
202
- children && !icon && sizes[size].buttonPadding,
203
- "[.es-uic-button-group-h_&:not(:first-child)]:es-uic-rounded-l-none [.es-uic-button-group-h_&:not(:last-child)]:-es-uic-mr-px [.es-uic-button-group-h_&:not(:last-child)]:es-uic-rounded-r-none",
204
- "[.es-uic-button-group-h_div:not(:first-child)_>_&]:es-uic-rounded-l-none [.es-uic-button-group-h_div:not(:last-child)_>_&]:-es-uic-mr-px [.es-uic-button-group-h_div:not(:last-child)_>_&]:es-uic-rounded-r-none",
205
- sizes[size].iconSize,
206
- type === "selected" && 'es-uic-relative es-uic-isolate after:es-uic-absolute after:es-uic-inset-0 after:-es-uic-z-10 after:es-uic-rounded-[0.3125rem] after:es-uic-bg-gradient-to-br after:es-uic-from-teal-100/40 after:es-uic-via-transparent after:es-uic-to-teal-200/50 after:es-uic-opacity-0 after:es-uic-transition-opacity after:es-uic-content-[""]',
207
- type === "selected" && "[.es-uic-button-group-h_&:not(:first-child)]:after:es-uic-rounded-l-none [.es-uic-button-group-h_&:not(:last-child)]:after:es-uic-rounded-r-none",
208
- type === "selected" && "[.es-uic-button-group-h_div:not(:first-child)_>_&]:after:es-uic-rounded-l-none [.es-uic-button-group-h_div:not(:last-child)_>_&]:after:es-uic-rounded-r-none",
209
- "[.es-uic-button-group-v_&:not(:first-child)]:es-uic-rounded-t-none [.es-uic-button-group-v_&:not(:last-child)]:-es-uic-mb-px [.es-uic-button-group-v_&:not(:last-child)]:es-uic-rounded-b-none",
210
- "[.es-uic-button-group-v_div:not(:first-child)_>_&]:es-uic-rounded-t-none [.es-uic-button-group-v_div:not(:last-child)_>_&]:-es-uic-mb-px [.es-uic-button-group-v_div:not(:last-child)_>_&]:es-uic-rounded-b-none",
211
- type === "selected" && "[.es-uic-button-group-v_&:not(:first-child)]:after:es-uic-rounded-t-none [.es-uic-button-group-v_&:not(:last-child)]:after:es-uic-rounded-b-none",
212
- type === "selected" && "[.es-uic-button-group-v_div:not(:first-child)_>_&]:after:es-uic-rounded-t-none [.es-uic-button-group-v_div:not(:last-child)_>_&]:after:es-uic-rounded-b-none",
213
- className
214
- ),
215
- ref: objRef,
216
- "aria-label": ariaLabel,
217
- ...other,
218
- children: [
219
- icon,
220
- children
221
- ]
222
- }
223
- );
224
- if (!tooltip) {
225
- return component;
226
- }
227
- return /* @__PURE__ */ jsx(
228
- Tooltip,
229
- {
230
- text: tooltip,
231
- wrapperClassName,
232
- ...tooltipProps,
233
- children: component
234
- }
235
- );
236
- };
237
- /**
238
- * A wrapper for `Button` or `ToggleButton` components that visually groups them and ensures proper keyboard navigation.
239
- *
240
- * **Note**: Only intended for horizontal groups of buttons that don't wrap.
241
- *
242
- * @component
243
- * @param {Object} props - Component props.
244
- * @param {string} [props.className] - Classes to pass to the button group container.
245
- * @param {boolean} [props.vertical] - If `true`, the buttons are displayed vertically.
246
- * @param {boolean} [props.hidden] - If `true`, the component is not rendered.
247
- *
248
- * @returns {JSX.Element} The ButtonGroup component.
249
- *
250
- * @example
251
- * <ButtonGroup>
252
- * <Button ... />
253
- * <Button ... />
254
- * <Button ... />
255
- * </ButtonGroup>
256
- *
257
- * @preserve
258
- */
259
- const ButtonGroup = ({ children, className, vertical, hidden, ...rest }) => {
260
- if (hidden) {
261
- return null;
262
- }
263
- return /* @__PURE__ */ jsx(
264
- $13c3c67164f4d5be$export$4c260019440d418f,
265
- {
266
- className: clsx("es-uic-flex", vertical ? "es-uic-button-group-v es-uic-flex-col" : "es-uic-button-group-h", className),
267
- orientation: vertical ? "vertical" : "horizontal",
268
- ...rest,
269
- children
270
- }
271
- );
272
- };
273
- export {
274
- $13c3c67164f4d5be$export$4c260019440d418f as $,
275
- Button as B,
276
- ButtonGroup as a
277
- };