@eightshift/ui-components 1.7.1 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Button-VbCAu4hd.js → Button-Xa6Ny0p_.js} +7 -7
- package/dist/{Color-BpLubxWI.js → Color-VsesNqCf.js} +5 -17
- package/dist/{ColorSwatch-CinC14s3.js → ColorSwatch-xOFAZO_h.js} +4 -4
- package/dist/ComboBox-CP_SqnqT.js +1886 -0
- package/dist/Dialog-jcIYer1n.js +2177 -0
- package/dist/{FieldError-BttM1Nxd.js → FieldError-BPe3YgNH.js} +2 -2
- package/dist/{FocusScope-CtCX0OGo.js → FocusScope-uV-xoRHT.js} +8 -9
- package/dist/{Group-XzWUooix.js → Group-Bvmb49y7.js} +5 -5
- package/dist/{Heading-DZelepHV.js → Heading-Bfhyr4ZC.js} +1 -1
- package/dist/{Hidden-CcFqOzrp.js → Hidden-7ZhNuLM9.js} +2 -2
- package/dist/{Input-CV1qVS6t.js → Input-C2dTSp9z.js} +10 -10
- package/dist/{Label-BwqMVkuV.js → Label-DqNX_sAU.js} +2 -2
- package/dist/{List-Bx2anbX-.js → List-C7L49CxW.js} +1 -1
- package/dist/{ListBox-DuZPdnkk.js → ListBox-B9r1QoSm.js} +19 -18
- package/dist/{NumberFormatter-U_Gx0UDq.js → NumberFormatter-DA8u1Ot7.js} +4 -6
- package/dist/OverlayArrow-ClRhYjQu.js +567 -0
- package/dist/{Select-c7902d94.esm-DtzFQzf-.js → Select-aab027f3.esm-B8nEum75.js} +4 -4
- package/dist/{SelectionManager-x27KqnAT.js → SelectionManager-DP537Pbu.js} +177 -141
- package/dist/{Separator-BM58t3PP.js → Separator-Dmxzf3m_.js} +62 -52
- package/dist/{Slider-D9Cs6yKr.js → Slider-BgHBCyI7.js} +16 -14
- package/dist/{Text-BVIXT8qq.js → Text-DImhB4rT.js} +1 -1
- package/dist/{VisuallyHidden-WhC7vZaL.js → VisuallyHidden-wryJF4qQ.js} +2 -2
- package/dist/assets/style.css +1 -1
- package/dist/assets/wp-ui-enhancements.css +1 -1
- package/dist/components/animated-visibility/animated-visibility.js +141 -113
- package/dist/components/base-control/base-control.js +1 -1
- package/dist/components/button/button.js +10 -7
- package/dist/components/checkbox/checkbox.js +19 -11
- package/dist/components/color-pickers/color-picker.js +1 -1
- package/dist/components/color-pickers/color-swatch.js +3 -3
- package/dist/components/color-pickers/gradient-editor.js +2 -2
- package/dist/components/color-pickers/solid-color-picker.js +21 -21
- package/dist/components/component-toggle/component-toggle.js +1 -1
- package/dist/components/draggable/draggable-handle.js +2 -2
- package/dist/components/draggable/draggable.js +2 -2
- package/dist/components/draggable-list/draggable-list-item.js +2 -2
- package/dist/components/draggable-list/draggable-list.js +2 -2
- package/dist/components/expandable/expandable.js +3 -3
- package/dist/components/index.js +8 -4
- package/dist/components/input-field/input-field.js +7 -7
- package/dist/components/item-collection/item-collection.js +1 -1
- package/dist/components/link-input/link-input.js +10 -1872
- package/dist/components/list-box/list-box.js +2 -2
- package/dist/components/matrix-align/matrix-align.js +2 -2
- package/dist/components/menu/menu.js +7 -974
- package/dist/components/modal/modal.js +7 -7
- package/dist/components/number-picker/number-picker.js +10 -10
- package/dist/components/option-select/option-select.js +1 -1
- package/dist/components/options-panel/options-panel.js +1 -1
- package/dist/components/placeholders/file-placeholder.js +1 -1
- package/dist/components/popover/popover.js +2 -2
- package/dist/components/radio/radio.js +13 -13
- package/dist/components/repeater/repeater-item.js +1 -1
- package/dist/components/repeater/repeater.js +2 -2
- package/dist/components/responsive/mini-responsive.js +3 -3
- package/dist/components/responsive/responsive-legacy.js +2 -2
- package/dist/components/responsive/responsive.js +2 -2
- package/dist/components/responsive-preview/responsive-preview.js +1 -1
- package/dist/components/select/async-multi-select.js +3 -3
- package/dist/components/select/async-single-select.js +2 -2
- package/dist/components/select/custom-select-default-components.js +1 -1
- package/dist/components/select/multi-select-components.js +1 -1
- package/dist/components/select/multi-select.js +3 -3
- package/dist/components/select/react-select-component-wrappers.js +1 -1
- package/dist/components/select/single-select.js +2 -2
- package/dist/components/select/v2/async-select.js +307 -0
- package/dist/components/select/v2/shared.js +24 -0
- package/dist/components/select/v2/single-select.js +993 -0
- package/dist/components/slider/column-config-slider.js +3 -3
- package/dist/components/slider/slider.js +3 -3
- package/dist/components/slider/utils.js +1 -1
- package/dist/components/tabs/tabs.js +16 -16
- package/dist/components/toggle/switch.js +6 -6
- package/dist/components/toggle/toggle.js +1 -1
- package/dist/components/toggle-button/toggle-button.js +55 -12
- package/dist/components/tooltip/tooltip.js +532 -8
- package/dist/{context-Cs-ZD1nu.js → context-BI3VdU0Z.js} +2 -2
- package/dist/{default-i18n-DRnM8y4w.js → default-i18n-CM1-Xvzf.js} +183 -176
- package/dist/{focusSafely-CgFLw4FA.js → focusSafely-Cl9cN7Qx.js} +14 -14
- package/dist/icons/icons.js +171 -1
- package/dist/icons/jsx-svg.js +16 -3
- package/dist/{index-a301f526.esm-BMg114iK.js → index-641ee5b8.esm-BclOH4xf.js} +165 -29
- package/dist/{index-BTCzc3zb.js → index-D0mHceYg.js} +81 -17
- package/dist/index.js +7 -3
- package/dist/{multi-select-components-DTvEidE3.js → multi-select-components-BGQBvx-z.js} +55 -44
- package/dist/{react-jsx-parser.min-B5HVwW_W.js → react-jsx-parser.min-CVit0rZn.js} +5620 -7409
- package/dist/{react-select-async.esm-CxA8wpeT.js → react-select-async.esm-B8kK0aL4.js} +3 -3
- package/dist/{react-select.esm-CeE7o5M9.js → react-select.esm-ucYwBxq5.js} +3 -3
- package/dist/{textSelection-CvK0YHTZ.js → textSelection-DDDNsS-g.js} +1 -1
- package/dist/{useButton-Cy9eEev7.js → useButton-CRKy9xk2.js} +4 -4
- package/dist/{useEvent-LZebwyrb.js → useEvent-D54lIBrO.js} +1 -1
- package/dist/{useFocusRing-BMOTWmOx.js → useFocusRing-DKxoCzVD.js} +1 -1
- package/dist/{useFocusable-ByyKSVQv.js → useFocusable-CPKTGWPn.js} +4 -4
- package/dist/{useFormReset-B8m1uz1J.js → useFormReset-CTp--h9B.js} +1 -1
- package/dist/{useFormValidationState-BjMhz_VI.js → useFormValidation-BNBrliSj.js} +92 -88
- package/dist/{useLabel-B6uO0wVK.js → useLabel-CzGdEzIq.js} +2 -2
- package/dist/{useLabels-5dFkeiXx.js → useLabels-eGSmZC_Z.js} +1 -1
- package/dist/{useListState-eKxv7HPC.js → useListState-D7mE1Y00.js} +1 -1
- package/dist/{useLocalizedStringFormatter-BaKmjFNp.js → useLocalizedStringFormatter-BBeUyA9l.js} +1 -1
- package/dist/{useNumberField-DMMUTZ-h.js → useNumberField-BmEJmL3K.js} +27 -20
- package/dist/{useNumberFormatter-Cyx5Dxkf.js → useNumberFormatter-CTY_UZxq.js} +2 -2
- package/dist/{usePress-D8nPoIQm.js → usePress-BG9At5Lb.js} +4 -4
- package/dist/{useSingleSelectListState-CABciySJ.js → useSingleSelectListState-DeJEr7lC.js} +2 -2
- package/dist/{useToggle-BmltE9Zr.js → useToggle-QlyoyPYv.js} +4 -4
- package/dist/{useToggleState-DZXLEnA_.js → useToggleState-C1mnFRiI.js} +1 -1
- package/dist/utilities/text-helpers.js +6 -0
- package/dist/{utils-BCJajCwh.js → utils-BSxcP7tv.js} +15 -14
- package/package.json +20 -20
- package/dist/Dialog-BN5EE7UH.js +0 -934
- package/dist/isScrollable-Dh9D9IOd.js +0 -9
- package/dist/tooltip-eKaARDoV.js +0 -1084
- package/dist/useMenuTrigger-4fwEmto8.js +0 -246
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { _ as __ } from "../../default-i18n-
|
|
3
|
-
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-
|
|
4
|
-
import { $ as $6f909507e6374d18$export$472062a354075cee, a as $6f909507e6374d18$export$105594979f116971, b as $6f909507e6374d18$export$2c1b491743890dec, c as $6f909507e6374d18$export$a590f758a961cb5b } from "../../Slider-
|
|
2
|
+
import { _ as __ } from "../../default-i18n-CM1-Xvzf.js";
|
|
3
|
+
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-DqNX_sAU.js";
|
|
4
|
+
import { $ as $6f909507e6374d18$export$472062a354075cee, a as $6f909507e6374d18$export$105594979f116971, b as $6f909507e6374d18$export$2c1b491743890dec, c as $6f909507e6374d18$export$a590f758a961cb5b } from "../../Slider-BgHBCyI7.js";
|
|
5
5
|
import { BaseControl } from "../base-control/base-control.js";
|
|
6
6
|
import { icons } from "../../icons/icons.js";
|
|
7
7
|
import { getColumnConfigOutputText } from "./utils.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { $ as $64fa3d84918910a7$export$fabf2dc03a41866e } from "../../utils-
|
|
3
|
-
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5, a as $01b77f81d0f07f68$export$75b6ee27786ba447 } from "../../Label-
|
|
4
|
-
import { $ as $6f909507e6374d18$export$472062a354075cee, c as $6f909507e6374d18$export$a590f758a961cb5b, a as $6f909507e6374d18$export$105594979f116971, b as $6f909507e6374d18$export$2c1b491743890dec, d as $6f909507e6374d18$export$1e7083018727fa60 } from "../../Slider-
|
|
2
|
+
import { $ as $64fa3d84918910a7$export$fabf2dc03a41866e } from "../../utils-BSxcP7tv.js";
|
|
3
|
+
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5, a as $01b77f81d0f07f68$export$75b6ee27786ba447 } from "../../Label-DqNX_sAU.js";
|
|
4
|
+
import { $ as $6f909507e6374d18$export$472062a354075cee, c as $6f909507e6374d18$export$a590f758a961cb5b, a as $6f909507e6374d18$export$105594979f116971, b as $6f909507e6374d18$export$2c1b491743890dec, d as $6f909507e6374d18$export$1e7083018727fa60 } from "../../Slider-BgHBCyI7.js";
|
|
5
5
|
import { BaseControl } from "../base-control/base-control.js";
|
|
6
6
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
7
7
|
import { NumberPicker } from "../number-picker/number-picker.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as __, s as sprintf, a as _n } from "../../default-i18n-
|
|
1
|
+
import { _ as __, s as sprintf, a as _n } from "../../default-i18n-CM1-Xvzf.js";
|
|
2
2
|
/**
|
|
3
3
|
* Generates an array of markers based on the provided minimum and maximum values and step.
|
|
4
4
|
* If the step is less than 10, only markers divisible by 5 and 10 are included.
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { $ as $f39a9eba43920ace$export$86427a43e3e48ebb } from "../../Hidden-
|
|
2
|
+
import { d as $880e95eb8b93ba9a$export$ecf600387e221c37, k as $ae20dd8cbca75726$export$d6daf82dcd84e87c, e as $e1995378a142960e$export$18af5c7a9e9b3664, f as $e1995378a142960e$export$bf788dd355e3a401, g as $e1995378a142960e$export$fb8073518f34e6ec, h as $7135fc7d473fd974$export$4feb769f8ddf26c5, m as $7135fc7d473fd974$export$90e00781bc59d8f9 } from "../../SelectionManager-DP537Pbu.js";
|
|
3
|
+
import { k as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, d as $3ef42575df84b30b$export$9d1611c77c2fe928, f as $bdb11010cef70236$export$f680877a34711e37, m as $df56164dff5785e2$export$4338b53315abf666, b as $64fa3d84918910a7$export$4d86445c2cf5e3, a as $64fa3d84918910a7$export$29f1550f4b0d4415, j as $64fa3d84918910a7$export$2881499e37b75b9a, $ as $64fa3d84918910a7$export$fabf2dc03a41866e } from "../../utils-BSxcP7tv.js";
|
|
4
|
+
import { $ as $f39a9eba43920ace$export$86427a43e3e48ebb } from "../../Hidden-7ZhNuLM9.js";
|
|
5
5
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-EDDcM64A.js";
|
|
6
6
|
import React__default, { useState, useMemo, useRef, useEffect, forwardRef, useContext, createContext, useId, cloneElement } from "react";
|
|
7
|
-
import { a as $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 } from "../../usePress-
|
|
8
|
-
import { $ as $313b98861ee5dd6c$export$d6875122194c7b44 } from "../../useLabels-
|
|
9
|
-
import { b as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "../../FocusScope-
|
|
10
|
-
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-
|
|
11
|
-
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-
|
|
12
|
-
import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../focusSafely-
|
|
13
|
-
import { $ as $a0d645289fe9b86b$export$e7f05e985daf4b5f } from "../../useSingleSelectListState-
|
|
14
|
-
import { _ as __, s as sprintf } from "../../default-i18n-
|
|
7
|
+
import { a as $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 } from "../../usePress-BG9At5Lb.js";
|
|
8
|
+
import { $ as $313b98861ee5dd6c$export$d6875122194c7b44 } from "../../useLabels-eGSmZC_Z.js";
|
|
9
|
+
import { b as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "../../FocusScope-uV-xoRHT.js";
|
|
10
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-BI3VdU0Z.js";
|
|
11
|
+
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-DKxoCzVD.js";
|
|
12
|
+
import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../focusSafely-Cl9cN7Qx.js";
|
|
13
|
+
import { $ as $a0d645289fe9b86b$export$e7f05e985daf4b5f } from "../../useSingleSelectListState-DeJEr7lC.js";
|
|
14
|
+
import { _ as __, s as sprintf } from "../../default-i18n-CM1-Xvzf.js";
|
|
15
15
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
16
16
|
import { Notice } from "../notice/notice.js";
|
|
17
17
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
@@ -195,17 +195,17 @@ function $58d314389b21fa3f$export$773e389e644c5874(props, state, ref) {
|
|
|
195
195
|
};
|
|
196
196
|
}
|
|
197
197
|
function $76f919a04c5a7d14$export$4ba071daf4e486(props) {
|
|
198
|
-
var _props_defaultSelectedKey;
|
|
198
|
+
var _props_defaultSelectedKey, _ref;
|
|
199
199
|
let state = $a0d645289fe9b86b$export$e7f05e985daf4b5f({
|
|
200
200
|
...props,
|
|
201
201
|
suppressTextValueWarning: true,
|
|
202
|
-
defaultSelectedKey: (_props_defaultSelectedKey = props.defaultSelectedKey) !== null && _props_defaultSelectedKey !== void 0 ? _props_defaultSelectedKey : $76f919a04c5a7d14$var$findDefaultSelectedKey(props.collection, props.disabledKeys ? new Set(props.disabledKeys) : /* @__PURE__ */ new Set())
|
|
202
|
+
defaultSelectedKey: (_ref = (_props_defaultSelectedKey = props.defaultSelectedKey) !== null && _props_defaultSelectedKey !== void 0 ? _props_defaultSelectedKey : $76f919a04c5a7d14$var$findDefaultSelectedKey(props.collection, props.disabledKeys ? new Set(props.disabledKeys) : /* @__PURE__ */ new Set())) !== null && _ref !== void 0 ? _ref : void 0
|
|
203
203
|
});
|
|
204
204
|
let { selectionManager, collection, selectedKey: currentSelectedKey } = state;
|
|
205
205
|
let lastSelectedKey = useRef(currentSelectedKey);
|
|
206
206
|
useEffect(() => {
|
|
207
207
|
let selectedKey = currentSelectedKey;
|
|
208
|
-
if (selectionManager.isEmpty || !collection.getItem(selectedKey)) {
|
|
208
|
+
if (selectionManager.isEmpty || selectedKey == null || !collection.getItem(selectedKey)) {
|
|
209
209
|
selectedKey = $76f919a04c5a7d14$var$findDefaultSelectedKey(collection, state.disabledKeys);
|
|
210
210
|
if (selectedKey != null)
|
|
211
211
|
selectionManager.setSelectedKeys([
|
|
@@ -225,8 +225,8 @@ function $76f919a04c5a7d14$var$findDefaultSelectedKey(collection, disabledKeys)
|
|
|
225
225
|
if (collection) {
|
|
226
226
|
var _collection_getItem_props, _collection_getItem, _collection_getItem_props1, _collection_getItem1;
|
|
227
227
|
selectedKey = collection.getFirstKey();
|
|
228
|
-
while ((disabledKeys.has(selectedKey) || ((_collection_getItem = collection.getItem(selectedKey)) === null || _collection_getItem === void 0 ? void 0 : (_collection_getItem_props = _collection_getItem.props) === null || _collection_getItem_props === void 0 ? void 0 : _collection_getItem_props.isDisabled)) && selectedKey !== collection.getLastKey()) selectedKey = collection.getKeyAfter(selectedKey);
|
|
229
|
-
if ((disabledKeys.has(selectedKey) || ((_collection_getItem1 = collection.getItem(selectedKey)) === null || _collection_getItem1 === void 0 ? void 0 : (_collection_getItem_props1 = _collection_getItem1.props) === null || _collection_getItem_props1 === void 0 ? void 0 : _collection_getItem_props1.isDisabled)) && selectedKey === collection.getLastKey()) selectedKey = collection.getFirstKey();
|
|
228
|
+
while (selectedKey != null && (disabledKeys.has(selectedKey) || ((_collection_getItem = collection.getItem(selectedKey)) === null || _collection_getItem === void 0 ? void 0 : (_collection_getItem_props = _collection_getItem.props) === null || _collection_getItem_props === void 0 ? void 0 : _collection_getItem_props.isDisabled)) && selectedKey !== collection.getLastKey()) selectedKey = collection.getKeyAfter(selectedKey);
|
|
229
|
+
if (selectedKey != null && (disabledKeys.has(selectedKey) || ((_collection_getItem1 = collection.getItem(selectedKey)) === null || _collection_getItem1 === void 0 ? void 0 : (_collection_getItem_props1 = _collection_getItem1.props) === null || _collection_getItem_props1 === void 0 ? void 0 : _collection_getItem_props1.isDisabled)) && selectedKey === collection.getLastKey()) selectedKey = collection.getFirstKey();
|
|
230
230
|
}
|
|
231
231
|
return selectedKey;
|
|
232
232
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415,
|
|
2
|
+
import { a as $64fa3d84918910a7$export$29f1550f4b0d4415, m as $df56164dff5785e2$export$4338b53315abf666, n as $5dc95899b306f630$export$c9058316764c140e, i as $64fa3d84918910a7$export$ef03459518577ad4, b as $64fa3d84918910a7$export$4d86445c2cf5e3, d as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "../../utils-BSxcP7tv.js";
|
|
3
3
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-EDDcM64A.js";
|
|
4
4
|
import React__default, { forwardRef, createContext } from "react";
|
|
5
|
-
import { $ as $3017fa7ffdddec74$export$8042c6c013fd5226 } from "../../useToggleState-
|
|
6
|
-
import { $ as $d2c8e2b0480f3f34$export$cbe85ee05b554577 } from "../../useToggle-
|
|
7
|
-
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-
|
|
8
|
-
import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../focusSafely-
|
|
9
|
-
import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "../../VisuallyHidden-
|
|
5
|
+
import { $ as $3017fa7ffdddec74$export$8042c6c013fd5226 } from "../../useToggleState-C1mnFRiI.js";
|
|
6
|
+
import { $ as $d2c8e2b0480f3f34$export$cbe85ee05b554577 } from "../../useToggle-QlyoyPYv.js";
|
|
7
|
+
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-DKxoCzVD.js";
|
|
8
|
+
import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../focusSafely-Cl9cN7Qx.js";
|
|
9
|
+
import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "../../VisuallyHidden-wryJF4qQ.js";
|
|
10
10
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
11
11
|
function $b418ec0c85c52f27$export$d853f7095ae95f88(props, state, ref) {
|
|
12
12
|
let { labelProps, inputProps, isSelected, isPressed, isDisabled, isReadOnly } = $d2c8e2b0480f3f34$export$cbe85ee05b554577(props, state, ref);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-
|
|
2
|
+
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-DqNX_sAU.js";
|
|
3
3
|
import { Switch } from "./switch.js";
|
|
4
4
|
import { RichLabel } from "../rich-label/rich-label.js";
|
|
5
5
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import React__default, { forwardRef,
|
|
4
|
-
import { $ as $3017fa7ffdddec74$export$8042c6c013fd5226 } from "../../useToggleState-
|
|
5
|
-
import { $ as $701a24aa0da5b062$export$ea18c227d4417cc3 } from "../../useButton-
|
|
6
|
-
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-
|
|
7
|
-
import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../focusSafely-
|
|
2
|
+
import { q as $ff5963eb1fccf552$export$e08e3b67e392101e, d as $3ef42575df84b30b$export$9d1611c77c2fe928, a as $64fa3d84918910a7$export$29f1550f4b0d4415, b as $64fa3d84918910a7$export$4d86445c2cf5e3 } from "../../utils-BSxcP7tv.js";
|
|
3
|
+
import React__default, { createContext, forwardRef, useContext } from "react";
|
|
4
|
+
import { $ as $3017fa7ffdddec74$export$8042c6c013fd5226 } from "../../useToggleState-C1mnFRiI.js";
|
|
5
|
+
import { $ as $701a24aa0da5b062$export$ea18c227d4417cc3 } from "../../useButton-CRKy9xk2.js";
|
|
6
|
+
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-DKxoCzVD.js";
|
|
7
|
+
import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../focusSafely-Cl9cN7Qx.js";
|
|
8
8
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
9
|
-
import {
|
|
9
|
+
import { Tooltip } from "../tooltip/tooltip.js";
|
|
10
10
|
function $55f54f7887471b58$export$51e84d46ca0bc451(props, state, ref) {
|
|
11
11
|
const { isSelected } = state;
|
|
12
12
|
const { isPressed, buttonProps } = $701a24aa0da5b062$export$ea18c227d4417cc3({
|
|
@@ -15,27 +15,70 @@ function $55f54f7887471b58$export$51e84d46ca0bc451(props, state, ref) {
|
|
|
15
15
|
}, ref);
|
|
16
16
|
return {
|
|
17
17
|
isPressed,
|
|
18
|
+
isSelected,
|
|
19
|
+
isDisabled: props.isDisabled || false,
|
|
18
20
|
buttonProps: $3ef42575df84b30b$export$9d1611c77c2fe928(buttonProps, {
|
|
19
21
|
"aria-pressed": isSelected
|
|
20
22
|
})
|
|
21
23
|
};
|
|
22
24
|
}
|
|
25
|
+
function $4547d1bf40011fdf$export$bc53712daae3d6e6(props, state, ref) {
|
|
26
|
+
let toggleState = {
|
|
27
|
+
isSelected: state.selectedKeys.has(props.id),
|
|
28
|
+
setSelected(isSelected2) {
|
|
29
|
+
state.setSelected(props.id, isSelected2);
|
|
30
|
+
},
|
|
31
|
+
toggle() {
|
|
32
|
+
state.toggleKey(props.id);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
let { isPressed, isSelected, isDisabled, buttonProps } = $55f54f7887471b58$export$51e84d46ca0bc451({
|
|
36
|
+
...props,
|
|
37
|
+
id: void 0,
|
|
38
|
+
isDisabled: props.isDisabled || state.isDisabled
|
|
39
|
+
}, toggleState, ref);
|
|
40
|
+
if (state.selectionMode === "single") {
|
|
41
|
+
buttonProps.role = "radio";
|
|
42
|
+
buttonProps["aria-checked"] = toggleState.isSelected;
|
|
43
|
+
delete buttonProps["aria-pressed"];
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
isPressed,
|
|
47
|
+
isSelected,
|
|
48
|
+
isDisabled,
|
|
49
|
+
buttonProps
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const $84b7d8702d4ff4a8$export$a8a71863db173133 = /* @__PURE__ */ createContext(null);
|
|
23
53
|
const $efde0372d7a700fe$export$43506d75ebd2e218 = /* @__PURE__ */ createContext({});
|
|
24
54
|
function $efde0372d7a700fe$var$ToggleButton(props, ref) {
|
|
25
55
|
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $efde0372d7a700fe$export$43506d75ebd2e218);
|
|
26
|
-
let
|
|
27
|
-
let
|
|
56
|
+
let groupState = useContext($84b7d8702d4ff4a8$export$a8a71863db173133);
|
|
57
|
+
let state = $3017fa7ffdddec74$export$8042c6c013fd5226(groupState && props.id != null ? {
|
|
58
|
+
isSelected: groupState.selectedKeys.has(props.id),
|
|
59
|
+
onChange(isSelected2) {
|
|
60
|
+
groupState.setSelected(props.id, isSelected2);
|
|
61
|
+
}
|
|
62
|
+
} : props);
|
|
63
|
+
let { buttonProps, isPressed, isSelected, isDisabled } = groupState && props.id != null ? $4547d1bf40011fdf$export$bc53712daae3d6e6({
|
|
64
|
+
...props,
|
|
65
|
+
id: props.id
|
|
66
|
+
}, groupState, ref) : $55f54f7887471b58$export$51e84d46ca0bc451({
|
|
67
|
+
...props,
|
|
68
|
+
id: props.id != null ? String(props.id) : void 0
|
|
69
|
+
}, state, ref);
|
|
28
70
|
let { focusProps, isFocused, isFocusVisible } = $f7dceffc5ad7768b$export$4e328f61c538687f(props);
|
|
29
71
|
let { hoverProps, isHovered } = $6179b936705e76d3$export$ae780daf29e6d456(props);
|
|
30
72
|
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
31
73
|
...props,
|
|
74
|
+
id: void 0,
|
|
32
75
|
values: {
|
|
33
76
|
isHovered,
|
|
34
77
|
isPressed,
|
|
35
78
|
isFocused,
|
|
36
79
|
isSelected: state.isSelected,
|
|
37
80
|
isFocusVisible,
|
|
38
|
-
isDisabled
|
|
81
|
+
isDisabled,
|
|
39
82
|
state
|
|
40
83
|
},
|
|
41
84
|
defaultClassName: "react-aria-ToggleButton"
|
|
@@ -46,9 +89,9 @@ function $efde0372d7a700fe$var$ToggleButton(props, ref) {
|
|
|
46
89
|
ref,
|
|
47
90
|
slot: props.slot || void 0,
|
|
48
91
|
"data-focused": isFocused || void 0,
|
|
49
|
-
"data-disabled":
|
|
92
|
+
"data-disabled": isDisabled || void 0,
|
|
50
93
|
"data-pressed": isPressed || void 0,
|
|
51
|
-
"data-selected":
|
|
94
|
+
"data-selected": isSelected || void 0,
|
|
52
95
|
"data-hovered": isHovered || void 0,
|
|
53
96
|
"data-focus-visible": isFocusVisible || void 0
|
|
54
97
|
});
|