@eightshift/ui-components 0.0.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.
- package/README.md +27 -0
- package/dist/Checkbox-BLcVbhiO.js +178 -0
- package/dist/ColorSwatch-Cmlex_kT.js +66 -0
- package/dist/FieldError-wtMA4667.js +42 -0
- package/dist/FocusScope-1u9yyfIN.js +725 -0
- package/dist/Form-Cq3fu75_.js +5 -0
- package/dist/GridList-BZPXp3_O.js +1256 -0
- package/dist/Group-DyqpTRPe.js +49 -0
- package/dist/Input-jsbb4ugq.js +130 -0
- package/dist/Label-BPzS-sR7.js +17 -0
- package/dist/ListBox-w9gDaJkV.js +4423 -0
- package/dist/LiveAnnouncer-IsokfWQ5.js +73 -0
- package/dist/NumberFormatter-LzoKy975.js +160 -0
- package/dist/RSPContexts-CrNYmadY.js +14 -0
- package/dist/Select-49a62830.esm-C-RFtLiD.js +2541 -0
- package/dist/SelectionManager-mefd0ThJ.js +2155 -0
- package/dist/Separator-DHn0CwdK.js +325 -0
- package/dist/Slider-Pyh2V4bY.js +885 -0
- package/dist/Text-BM136LvS.js +17 -0
- package/dist/VisuallyHidden-BYRI1Lfo.js +51 -0
- package/dist/_commonjsHelpers-CUmg6egw.js +6 -0
- package/dist/ariaHideOutside-ByKBPHmX.js +113 -0
- package/dist/assets/style.css +1 -0
- package/dist/button-BkkdyHfJ.js +307 -0
- package/dist/components/animated-visibility/animated-visibility.js +7165 -0
- package/dist/components/base-control/base-control.js +97 -0
- package/dist/components/breakpoint-preview/breakpoint-preview.js +218 -0
- package/dist/components/button/button.js +10 -0
- package/dist/components/checkbox/checkbox.js +119 -0
- package/dist/components/color-pickers/color-picker.js +242 -0
- package/dist/components/color-pickers/color-swatch.js +62 -0
- package/dist/components/color-pickers/gradient-editor.js +516 -0
- package/dist/components/color-pickers/solid-color-picker.js +1633 -0
- package/dist/components/component-toggle/component-toggle.js +71 -0
- package/dist/components/container-panel/container-panel.js +39 -0
- package/dist/components/expandable/expandable.js +144 -0
- package/dist/components/input-field/input-field.js +224 -0
- package/dist/components/link-input/link-input.js +937 -0
- package/dist/components/list-box/list-box.js +152 -0
- package/dist/components/matrix-align/matrix-align.js +185 -0
- package/dist/components/menu/menu.js +1608 -0
- package/dist/components/notice/notice.js +119 -0
- package/dist/components/number-picker/number-picker.js +277 -0
- package/dist/components/popover/popover.js +9 -0
- package/dist/components/radio/radio.js +552 -0
- package/dist/components/repeater/repeater-item.js +127 -0
- package/dist/components/repeater/repeater.js +248 -0
- package/dist/components/responsive/responsive-legacy.js +326 -0
- package/dist/components/responsive/responsive.js +499 -0
- package/dist/components/responsive-preview/responsive-preview.js +119 -0
- package/dist/components/rich-label/rich-label.js +56 -0
- package/dist/components/select/async-multi-select.js +144 -0
- package/dist/components/select/async-single-select.js +126 -0
- package/dist/components/select/custom-select-default-components.js +38 -0
- package/dist/components/select/multi-select-components.js +8 -0
- package/dist/components/select/multi-select.js +134 -0
- package/dist/components/select/react-select-component-wrappers.js +90 -0
- package/dist/components/select/shared.js +45 -0
- package/dist/components/select/single-select.js +116 -0
- package/dist/components/select/styles.js +55 -0
- package/dist/components/slider/column-config-slider.js +225 -0
- package/dist/components/slider/slider.js +362 -0
- package/dist/components/slider/utils.js +45 -0
- package/dist/components/spacer/spacer.js +93 -0
- package/dist/components/tabs/tabs.js +626 -0
- package/dist/components/toggle/switch.js +140 -0
- package/dist/components/toggle/toggle.js +58 -0
- package/dist/components/toggle-button/toggle-button.js +206 -0
- package/dist/components/tooltip/tooltip.js +10 -0
- package/dist/context-jMy6xdVq.js +98 -0
- package/dist/default-i18n-BhE-OUmt.js +873 -0
- package/dist/filterDOMProps-DG2RfOUr.js +30 -0
- package/dist/focusSafely-C3K8zAKj.js +743 -0
- package/dist/hooks/use-cell-edit-mode.js +35 -0
- package/dist/icons/block-icon.js +42 -0
- package/dist/icons/generic-color-swatch.js +21 -0
- package/dist/icons/icons.js +3636 -0
- package/dist/index-Bfb9bWcb.js +28844 -0
- package/dist/index-a301f526.esm-Bioi4cGX.js +3576 -0
- package/dist/index.js +109 -0
- package/dist/intlStrings-CUhoK9EN.js +2484 -0
- package/dist/isScrollable-PcyglExV.js +10 -0
- package/dist/modifiers.esm-BuJQPI1X.js +31 -0
- package/dist/multi-select-components-CjVpCNko.js +3677 -0
- package/dist/number-rWqELA8W.js +39 -0
- package/dist/popover-Dx3vKXUX.js +1061 -0
- package/dist/react-select-async.esm-TFb_ZX6C.js +111 -0
- package/dist/react-select.esm-BjRWqf0E.js +15 -0
- package/dist/style.js +1 -0
- package/dist/textSelection-BosCCRVE.js +89 -0
- package/dist/tooltip-CkCndvTI.js +1094 -0
- package/dist/useButton-CuG5UzUw.js +74 -0
- package/dist/useEvent-DHv-yhOH.js +24 -0
- package/dist/useFocusRing-Cc-4eouh.js +41 -0
- package/dist/useFocusable-5q1Gek1J.js +81 -0
- package/dist/useFormReset-Buc9YJcv.js +23 -0
- package/dist/useFormValidationState-BAPPNXic.js +238 -0
- package/dist/useHasTabbableChild-D3uUNhJ0.js +37 -0
- package/dist/useLabel-CGlkoFG0.js +28 -0
- package/dist/useLabels-Dg62M_3P.js +25 -0
- package/dist/useListData-BelKu4kx.js +211 -0
- package/dist/useListState-Domq0blV.js +137 -0
- package/dist/useLocalizedStringFormatter-Prmz0h0A.js +130 -0
- package/dist/useNumberFieldState-BLU3uhSR.js +1253 -0
- package/dist/useNumberFormatter-BLc2xjZn.js +13 -0
- package/dist/usePress-BQgVor4T.js +698 -0
- package/dist/useToggle-C9ETOBaZ.js +58 -0
- package/dist/useToggleState-DJ_z5E2S.js +21 -0
- package/dist/utilities/classnames.js +16 -0
- package/dist/utilities/text-helpers.js +79 -0
- package/dist/utils-BsiH7-5Y.js +488 -0
- package/package.json +71 -0
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { b as $64fa3d84918910a7$export$86427a43e3e48ebb, a as $64fa3d84918910a7$export$29f1550f4b0d4415, c as $64fa3d84918910a7$export$4d86445c2cf5e3, d as $3ef42575df84b30b$export$9d1611c77c2fe928, g as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, l as $df56164dff5785e2$export$4338b53315abf666 } from "./utils-BsiH7-5Y.js";
|
|
3
|
+
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-DG2RfOUr.js";
|
|
4
|
+
import React__default, { createContext, useState, useRef, forwardRef } from "react";
|
|
5
|
+
import { $ as $701a24aa0da5b062$export$ea18c227d4417cc3 } from "./useButton-CuG5UzUw.js";
|
|
6
|
+
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "./useFocusRing-Cc-4eouh.js";
|
|
7
|
+
import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "./focusSafely-C3K8zAKj.js";
|
|
8
|
+
import { b as $9bf71ea28793e738$export$c5251b9e124bf29 } from "./FocusScope-1u9yyfIN.js";
|
|
9
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-jMy6xdVq.js";
|
|
10
|
+
import { classnames } from "./utilities/classnames.js";
|
|
11
|
+
import { T as Tooltip } from "./tooltip-CkCndvTI.js";
|
|
12
|
+
import { _ as __ } from "./default-i18n-BhE-OUmt.js";
|
|
13
|
+
const $d2b4bc8c273e7be6$var$additionalButtonHTMLAttributes = /* @__PURE__ */ new Set([
|
|
14
|
+
"form",
|
|
15
|
+
"formAction",
|
|
16
|
+
"formEncType",
|
|
17
|
+
"formMethod",
|
|
18
|
+
"formNoValidate",
|
|
19
|
+
"formTarget",
|
|
20
|
+
"name",
|
|
21
|
+
"value"
|
|
22
|
+
]);
|
|
23
|
+
const $d2b4bc8c273e7be6$export$24d547caef80ccd1 = /* @__PURE__ */ createContext({});
|
|
24
|
+
function $d2b4bc8c273e7be6$var$Button(props, ref) {
|
|
25
|
+
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $d2b4bc8c273e7be6$export$24d547caef80ccd1);
|
|
26
|
+
let ctx = props;
|
|
27
|
+
let { buttonProps, isPressed } = $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref);
|
|
28
|
+
let { focusProps, isFocused, isFocusVisible } = $f7dceffc5ad7768b$export$4e328f61c538687f(props);
|
|
29
|
+
let { hoverProps, isHovered } = $6179b936705e76d3$export$ae780daf29e6d456(props);
|
|
30
|
+
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
31
|
+
...props,
|
|
32
|
+
values: {
|
|
33
|
+
isHovered,
|
|
34
|
+
isPressed,
|
|
35
|
+
isFocused,
|
|
36
|
+
isFocusVisible,
|
|
37
|
+
isDisabled: props.isDisabled || false
|
|
38
|
+
},
|
|
39
|
+
defaultClassName: "react-aria-Button"
|
|
40
|
+
});
|
|
41
|
+
return /* @__PURE__ */ React__default.createElement("button", {
|
|
42
|
+
...$65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
43
|
+
propNames: $d2b4bc8c273e7be6$var$additionalButtonHTMLAttributes
|
|
44
|
+
}),
|
|
45
|
+
...$3ef42575df84b30b$export$9d1611c77c2fe928(buttonProps, focusProps, hoverProps),
|
|
46
|
+
...renderProps,
|
|
47
|
+
ref,
|
|
48
|
+
slot: props.slot || void 0,
|
|
49
|
+
"data-disabled": props.isDisabled || void 0,
|
|
50
|
+
"data-pressed": ctx.isPressed || isPressed || void 0,
|
|
51
|
+
"data-hovered": isHovered || void 0,
|
|
52
|
+
"data-focused": isFocused || void 0,
|
|
53
|
+
"data-focus-visible": isFocusVisible || void 0
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
const $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = /* @__PURE__ */ $64fa3d84918910a7$export$86427a43e3e48ebb($d2b4bc8c273e7be6$var$Button);
|
|
57
|
+
function $2680b1829e803644$export$fa142eb1681c520(props, ref) {
|
|
58
|
+
const { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, orientation = "horizontal" } = props;
|
|
59
|
+
let [isInToolbar, setInToolbar] = useState(false);
|
|
60
|
+
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
61
|
+
var _ref_current_parentElement;
|
|
62
|
+
setInToolbar(!!(ref.current && ((_ref_current_parentElement = ref.current.parentElement) === null || _ref_current_parentElement === void 0 ? void 0 : _ref_current_parentElement.closest('[role="toolbar"]'))));
|
|
63
|
+
});
|
|
64
|
+
const { direction } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
|
|
65
|
+
const shouldReverse = direction === "rtl" && orientation === "horizontal";
|
|
66
|
+
let focusManager = $9bf71ea28793e738$export$c5251b9e124bf29(ref);
|
|
67
|
+
const onKeyDown = (e) => {
|
|
68
|
+
if (!e.currentTarget.contains(e.target))
|
|
69
|
+
return;
|
|
70
|
+
if (orientation === "horizontal" && e.key === "ArrowRight" || orientation === "vertical" && e.key === "ArrowDown") {
|
|
71
|
+
if (shouldReverse)
|
|
72
|
+
focusManager.focusPrevious();
|
|
73
|
+
else
|
|
74
|
+
focusManager.focusNext();
|
|
75
|
+
} else if (orientation === "horizontal" && e.key === "ArrowLeft" || orientation === "vertical" && e.key === "ArrowUp") {
|
|
76
|
+
if (shouldReverse)
|
|
77
|
+
focusManager.focusNext();
|
|
78
|
+
else
|
|
79
|
+
focusManager.focusPrevious();
|
|
80
|
+
} else if (e.key === "Tab") {
|
|
81
|
+
e.stopPropagation();
|
|
82
|
+
lastFocused.current = document.activeElement;
|
|
83
|
+
if (e.shiftKey)
|
|
84
|
+
focusManager.focusFirst();
|
|
85
|
+
else
|
|
86
|
+
focusManager.focusLast();
|
|
87
|
+
return;
|
|
88
|
+
} else
|
|
89
|
+
return;
|
|
90
|
+
e.stopPropagation();
|
|
91
|
+
e.preventDefault();
|
|
92
|
+
};
|
|
93
|
+
const lastFocused = useRef(null);
|
|
94
|
+
const onBlur = (e) => {
|
|
95
|
+
if (!e.currentTarget.contains(e.relatedTarget) && !lastFocused.current)
|
|
96
|
+
lastFocused.current = e.target;
|
|
97
|
+
};
|
|
98
|
+
const onFocus = (e) => {
|
|
99
|
+
var _ref_current;
|
|
100
|
+
if (lastFocused.current && !e.currentTarget.contains(e.relatedTarget) && ((_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.contains(e.target))) {
|
|
101
|
+
var _lastFocused_current;
|
|
102
|
+
(_lastFocused_current = lastFocused.current) === null || _lastFocused_current === void 0 ? void 0 : _lastFocused_current.focus();
|
|
103
|
+
lastFocused.current = null;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
return {
|
|
107
|
+
toolbarProps: {
|
|
108
|
+
role: !isInToolbar ? "toolbar" : "group",
|
|
109
|
+
"aria-orientation": orientation,
|
|
110
|
+
"aria-label": ariaLabel,
|
|
111
|
+
"aria-labelledby": ariaLabel == null ? ariaLabelledBy : void 0,
|
|
112
|
+
onKeyDownCapture: !isInToolbar ? onKeyDown : void 0,
|
|
113
|
+
onFocusCapture: !isInToolbar ? onFocus : void 0,
|
|
114
|
+
onBlurCapture: !isInToolbar ? onBlur : void 0
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
const $13c3c67164f4d5be$export$6311e7ab80ef752f = /* @__PURE__ */ createContext({});
|
|
119
|
+
function $13c3c67164f4d5be$var$Toolbar(props, ref) {
|
|
120
|
+
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $13c3c67164f4d5be$export$6311e7ab80ef752f);
|
|
121
|
+
let { toolbarProps } = $2680b1829e803644$export$fa142eb1681c520(props, ref);
|
|
122
|
+
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
123
|
+
...props,
|
|
124
|
+
values: {
|
|
125
|
+
orientation: props.orientation || "horizontal"
|
|
126
|
+
},
|
|
127
|
+
defaultClassName: "react-aria-Toolbar"
|
|
128
|
+
});
|
|
129
|
+
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props);
|
|
130
|
+
delete DOMProps.id;
|
|
131
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
132
|
+
...$3ef42575df84b30b$export$9d1611c77c2fe928(toolbarProps, DOMProps),
|
|
133
|
+
...renderProps,
|
|
134
|
+
ref,
|
|
135
|
+
slot: props.slot || void 0,
|
|
136
|
+
"data-orientation": props.orientation || "horizontal"
|
|
137
|
+
}, renderProps.children);
|
|
138
|
+
}
|
|
139
|
+
const $13c3c67164f4d5be$export$4c260019440d418f = /* @__PURE__ */ forwardRef($13c3c67164f4d5be$var$Toolbar);
|
|
140
|
+
/**
|
|
141
|
+
* A simple button component.
|
|
142
|
+
*
|
|
143
|
+
* @component
|
|
144
|
+
* @param {Object} props - Component props.
|
|
145
|
+
* @param {JSX.Element} [props.icon] - Icon to display within the button.
|
|
146
|
+
* @param {ButtonSize} [props.size='default'] - The size of the button.
|
|
147
|
+
* @param {ButtonType} [props.type='default'] - The type of the button.
|
|
148
|
+
* @param {boolean} [props.disabled] - If `true`, the button is disabled.
|
|
149
|
+
* @param {string} [props.className] - Classes to pass to the button.
|
|
150
|
+
* @param {string} [props.tooltip] - Tooltip text to display on hover.
|
|
151
|
+
* @param {Function} [props.onPress] - Function to run when the button is pressed.
|
|
152
|
+
* @param {React.Ref} [props.forwardedRef] - Ref to forward to the button. Use the same as the `ref` prop.
|
|
153
|
+
* @param {string} [props.wrapperClassName] - Classes to pass to the tooltip wrapper.
|
|
154
|
+
* @param {Object} [props.tooltipProps] - Props to pass to the tooltip.
|
|
155
|
+
*
|
|
156
|
+
* @returns {JSX.Element} The Button component.
|
|
157
|
+
*
|
|
158
|
+
* @typedef {'small' | 'default' | 'large'} ButtonSize
|
|
159
|
+
* @typedef {'default' | 'selected' | 'ghost' | 'danger'} ButtonType
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* <Button onPress={() => console.log('Hi!')} icon={icons.myIcon} />
|
|
163
|
+
*
|
|
164
|
+
* <Button onPress={() => console.log('Hi!')} icon={icons.myIcon}>My button</Button>
|
|
165
|
+
*
|
|
166
|
+
* @preserve
|
|
167
|
+
*/
|
|
168
|
+
const Button = (props) => {
|
|
169
|
+
var _a, _b, _c, _d;
|
|
170
|
+
const {
|
|
171
|
+
children,
|
|
172
|
+
icon,
|
|
173
|
+
size = "default",
|
|
174
|
+
type = "default",
|
|
175
|
+
disabled,
|
|
176
|
+
className,
|
|
177
|
+
tooltip,
|
|
178
|
+
onPress,
|
|
179
|
+
forwardedRef,
|
|
180
|
+
wrapperClassName,
|
|
181
|
+
tooltipProps,
|
|
182
|
+
"aria-label": ariaLabel = typeof children === "string" ? children : __("Menu item", "eightshift-ui-components"),
|
|
183
|
+
...other
|
|
184
|
+
} = props;
|
|
185
|
+
const objRef = $df56164dff5785e2$export$4338b53315abf666(forwardedRef);
|
|
186
|
+
const sizes = {
|
|
187
|
+
small: {
|
|
188
|
+
iconButton: "es-uic-size-7",
|
|
189
|
+
button: "es-uic-h-7 es-uic-min-w-7",
|
|
190
|
+
iconButtonPadding: "es-uic-px-1",
|
|
191
|
+
buttonPadding: "es-uic-px-2",
|
|
192
|
+
iconSize: "[&>svg]:es-uic-size-4"
|
|
193
|
+
},
|
|
194
|
+
default: {
|
|
195
|
+
iconButton: "es-uic-size-9",
|
|
196
|
+
button: "es-uic-h-9 es-uic-min-w-9",
|
|
197
|
+
iconButtonPadding: "es-uic-px-1.5",
|
|
198
|
+
buttonPadding: "es-uic-px-2",
|
|
199
|
+
iconSize: "[&>svg]:es-uic-size-5.5"
|
|
200
|
+
},
|
|
201
|
+
large: {
|
|
202
|
+
iconButton: "es-uic-size-10",
|
|
203
|
+
button: "es-uic-h-10 es-uic-min-w-10",
|
|
204
|
+
iconButtonPadding: "es-uic-px-2",
|
|
205
|
+
buttonPadding: "es-uic-px-4",
|
|
206
|
+
iconSize: "[&>svg]:es-uic-size-6"
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
const themes = {
|
|
210
|
+
default: {
|
|
211
|
+
regular: "es-uic-text-gray-700 es-uic-shadow-sm es-uic-border es-uic-border-gray-300 es-uic-bg-white",
|
|
212
|
+
hover: "hover:es-uic-border-gray-300 hover:es-uic-bg-gray-100",
|
|
213
|
+
disabled: "disabled:es-uic-border-gray-300 disabled:es-uic-bg-gray-50/50 disabled:es-uic-text-gray-300 es-uic-border",
|
|
214
|
+
focus: "focus-visible:es-uic-ring-teal-500 focus-visible:es-uic-ring-opacity-50"
|
|
215
|
+
},
|
|
216
|
+
selected: {
|
|
217
|
+
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",
|
|
218
|
+
hover: "hover:es-uic-shadow-teal-600/50 hover:after:es-uic-opacity-60"
|
|
219
|
+
},
|
|
220
|
+
ghost: {
|
|
221
|
+
regular: "es-uic-border-transparent es-uic-text-gray-700",
|
|
222
|
+
hover: "hover:es-uic-bg-gray-100",
|
|
223
|
+
disabled: "disabled:es-uic-text-gray-300 disabled:es-uic-border-transparent"
|
|
224
|
+
},
|
|
225
|
+
danger: {
|
|
226
|
+
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",
|
|
227
|
+
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",
|
|
228
|
+
focus: "focus-visible:es-uic-ring-red-500 focus-visible:es-uic-ring-opacity-50"
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
const component = /* @__PURE__ */ jsxs(
|
|
232
|
+
$d2b4bc8c273e7be6$export$353f5b6fc5456de1,
|
|
233
|
+
{
|
|
234
|
+
onPress,
|
|
235
|
+
isDisabled: disabled,
|
|
236
|
+
className: classnames(
|
|
237
|
+
"es-uic-flex es-uic-items-center es-uic-gap-1 es-uic-rounded-md es-uic-transition es-uic-duration-300",
|
|
238
|
+
icon && !children && "es-uic-justify-center",
|
|
239
|
+
!disabled && (((_a = themes[type]) == null ? void 0 : _a.regular) ?? themes.default.regular),
|
|
240
|
+
!disabled && (((_b = themes[type]) == null ? void 0 : _b.hover) ?? themes.default.hover),
|
|
241
|
+
"disabled:es-uic-shadow-none",
|
|
242
|
+
disabled && (((_c = themes[type]) == null ? void 0 : _c.disabled) ?? themes.default.disabled),
|
|
243
|
+
"focus:es-uic-outline-none focus-visible:es-uic-outline-none focus-visible:es-uic-ring",
|
|
244
|
+
((_d = themes[type]) == null ? void 0 : _d.focus) ?? themes.default.focus,
|
|
245
|
+
icon && !children && sizes[size].iconButton,
|
|
246
|
+
children && "es-uic-text-sm",
|
|
247
|
+
children && sizes[size].button,
|
|
248
|
+
children && icon && sizes[size].iconButtonPadding,
|
|
249
|
+
children && !icon && sizes[size].buttonPadding,
|
|
250
|
+
"[.es-uic-button-group_&:not(:first-child)]:es-uic-rounded-l-none [.es-uic-button-group_&:not(:last-child)]:-es-uic-mr-px [.es-uic-button-group_&:not(:last-child)]:es-uic-rounded-r-none",
|
|
251
|
+
"[.es-uic-button-group_div:not(:first-child)_>_&]:es-uic-rounded-l-none [.es-uic-button-group_div:not(:last-child)_>_&]:-es-uic-mr-px [.es-uic-button-group_div:not(:last-child)_>_&]:es-uic-rounded-r-none",
|
|
252
|
+
sizes[size].iconSize,
|
|
253
|
+
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-[""]',
|
|
254
|
+
type === "selected" && "[.es-uic-button-group_&:not(:first-child)]:after:es-uic-rounded-l-none [.es-uic-button-group_&:not(:last-child)]:after:es-uic-rounded-r-none",
|
|
255
|
+
type === "selected" && "[.es-uic-button-group_div:not(:first-child)_>_&]:after:es-uic-rounded-l-none [.es-uic-button-group_div:not(:last-child)_>_&]:after:es-uic-rounded-r-none",
|
|
256
|
+
className
|
|
257
|
+
),
|
|
258
|
+
ref: objRef,
|
|
259
|
+
"aria-label": ariaLabel,
|
|
260
|
+
...other,
|
|
261
|
+
children: [
|
|
262
|
+
icon,
|
|
263
|
+
children
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
);
|
|
267
|
+
if (!tooltip) {
|
|
268
|
+
return component;
|
|
269
|
+
}
|
|
270
|
+
return /* @__PURE__ */ jsx(
|
|
271
|
+
Tooltip,
|
|
272
|
+
{
|
|
273
|
+
text: tooltip,
|
|
274
|
+
wrapperClassName,
|
|
275
|
+
...tooltipProps,
|
|
276
|
+
children: component
|
|
277
|
+
}
|
|
278
|
+
);
|
|
279
|
+
};
|
|
280
|
+
/**
|
|
281
|
+
* A wrapper for `Button` or `ToggleButton` components that visually groups them and ensures proper keyboard navigation.
|
|
282
|
+
*
|
|
283
|
+
* **Note**: Only intended for horizontal groups of buttons that don't wrap.
|
|
284
|
+
*
|
|
285
|
+
* @component
|
|
286
|
+
* @param {Object} props - Component props.
|
|
287
|
+
* @param {string} [props.className] - Classes to pass to the button group container.
|
|
288
|
+
*
|
|
289
|
+
* @returns {JSX.Element} The ButtonGroup component.
|
|
290
|
+
*
|
|
291
|
+
* @example
|
|
292
|
+
* <ButtonGroup>
|
|
293
|
+
* <Button ... />
|
|
294
|
+
* <Button ... />
|
|
295
|
+
* <Button ... />
|
|
296
|
+
* </ButtonGroup>
|
|
297
|
+
*
|
|
298
|
+
* @preserve
|
|
299
|
+
*/
|
|
300
|
+
const ButtonGroup = ({ children, className }) => /* @__PURE__ */ jsx($13c3c67164f4d5be$export$4c260019440d418f, { className: classnames("es-uic-button-group es-uic-flex", className), children });
|
|
301
|
+
export {
|
|
302
|
+
$d2b4bc8c273e7be6$export$24d547caef80ccd1 as $,
|
|
303
|
+
Button as B,
|
|
304
|
+
ButtonGroup as a,
|
|
305
|
+
$d2b4bc8c273e7be6$export$353f5b6fc5456de1 as b,
|
|
306
|
+
$13c3c67164f4d5be$export$4c260019440d418f as c
|
|
307
|
+
};
|