@easypost/easy-ui 1.0.0-alpha.53 → 1.0.0-alpha.54
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/Badge/index.js +14 -14
- package/Badge/index.mjs +14 -14
- package/Banner/index.js +5 -5
- package/Banner/index.mjs +5 -5
- package/Button/index.js +1 -1
- package/Button/index.mjs +1 -1
- package/CHANGELOG.md +6 -0
- package/Calendar/index.js +15 -15
- package/Calendar/index.mjs +15 -15
- package/Card/index.js +1 -1
- package/Card/index.mjs +1 -1
- package/Checkbox/index.js +1 -1
- package/Checkbox/index.mjs +1 -1
- package/CodeBlock/index.js +13 -13
- package/CodeBlock/index.mjs +13 -13
- package/CodeSnippet/index.js +1 -1
- package/CodeSnippet/index.mjs +1 -1
- package/DataGrid/index.js +60 -60
- package/DataGrid/index.mjs +60 -60
- package/Drawer/index.js +21 -21
- package/Drawer/index.mjs +21 -21
- package/DropdownButton/index.js +12 -12
- package/DropdownButton/index.mjs +12 -12
- package/EmptyStateCard/index.js +8 -8
- package/EmptyStateCard/index.mjs +8 -8
- package/FocusedProductLayout/index.js +23 -23
- package/FocusedProductLayout/index.mjs +23 -23
- package/FormLayout/index.js +5 -5
- package/FormLayout/index.mjs +5 -5
- package/HorizontalGrid/index.js +1 -1
- package/HorizontalGrid/index.mjs +1 -1
- package/HorizontalStack/index.js +1 -1
- package/HorizontalStack/index.mjs +1 -1
- package/Icon/index.js +1 -1
- package/Icon/index.mjs +1 -1
- package/IconButton/index.js +12 -12
- package/IconButton/index.mjs +12 -12
- package/InputField/index.js +1 -1
- package/InputField/index.mjs +1 -1
- package/KebabButton/index.js +1 -1
- package/KebabButton/index.mjs +1 -1
- package/Menu/index.js +1 -1
- package/Menu/index.mjs +1 -1
- package/Modal/index.js +22 -22
- package/Modal/index.mjs +22 -22
- package/NexusLayout/index.js +28 -28
- package/NexusLayout/index.mjs +28 -28
- package/Notification/index.js +1 -1
- package/Notification/index.mjs +1 -1
- package/Pagination/index.js +7 -7
- package/Pagination/index.mjs +7 -7
- package/PillGroup/index.js +23 -136
- package/PillGroup/index.mjs +12 -125
- package/ProductLayout/index.js +24 -24
- package/ProductLayout/index.mjs +24 -24
- package/Provider/index.js +1 -1
- package/Provider/index.mjs +1 -1
- package/RadioButtonGroup/RadioButtonGroup.d.ts +103 -0
- package/RadioButtonGroup/RadioButtonGroup.d.ts.map +1 -0
- package/RadioButtonGroup/RadioButtonGroup.stories.d.ts +11 -0
- package/RadioButtonGroup/RadioButtonGroup.stories.d.ts.map +1 -0
- package/RadioButtonGroup/RadioButtonGroup.test.d.ts +2 -0
- package/RadioButtonGroup/RadioButtonGroup.test.d.ts.map +1 -0
- package/RadioButtonGroup/index.d.ts +2 -0
- package/RadioButtonGroup/index.d.ts.map +1 -0
- package/RadioButtonGroup/index.js +262 -0
- package/RadioButtonGroup/index.mjs +262 -0
- package/RadioGroup/index.js +16 -16
- package/RadioGroup/index.mjs +16 -16
- package/SearchNav/index.js +29 -29
- package/SearchNav/index.mjs +29 -29
- package/SectionCard/index.js +7 -7
- package/SectionCard/index.mjs +7 -7
- package/Select/index.js +4 -4
- package/Select/index.mjs +4 -4
- package/SelectorErrorTooltip/index.js +1 -1
- package/SelectorErrorTooltip/index.mjs +1 -1
- package/Spinner/index.js +1 -1
- package/Spinner/index.mjs +1 -1
- package/SplitToggleCard/index.js +4 -4
- package/SplitToggleCard/index.mjs +4 -4
- package/Stepper/index.js +1 -1
- package/Stepper/index.mjs +1 -1
- package/TabNav/index.js +1 -1
- package/TabNav/index.mjs +1 -1
- package/TabPanels/index.js +3 -3
- package/TabPanels/index.mjs +3 -3
- package/Tabs/index.js +1 -1
- package/Tabs/index.mjs +1 -1
- package/Text/index.js +1 -1
- package/Text/index.mjs +1 -1
- package/TextField/index.js +1 -1
- package/TextField/index.mjs +1 -1
- package/Textarea/index.js +1 -1
- package/Textarea/index.mjs +1 -1
- package/Toggle/index.js +1 -1
- package/Toggle/index.mjs +1 -1
- package/ToggleCard/index.js +2 -2
- package/ToggleCard/index.mjs +2 -2
- package/Tooltip/index.js +1 -1
- package/Tooltip/index.mjs +1 -1
- package/VerticalNav/index.js +24 -24
- package/VerticalNav/index.mjs +24 -24
- package/VerticalStack/index.js +1 -1
- package/VerticalStack/index.mjs +1 -1
- package/__chunks__/{Button-BLXBu8Ta.js → Button-D_Bk7BuN.js} +17 -17
- package/__chunks__/{Button-KmjMp6fw.mjs → Button-Dy9idhgT.mjs} +17 -17
- package/__chunks__/{Card-Bn_WwYcR.js → Card-9RlZlFEC.js} +12 -12
- package/__chunks__/{Card-YKZzjRiK.mjs → Card-mxjU9S-F.mjs} +12 -12
- package/__chunks__/{Checkbox--LkvUfIF.mjs → Checkbox-BgumKMXU.mjs} +21 -20
- package/__chunks__/{Checkbox-CLLYuQFM.js → Checkbox-CBB8jlZw.js} +22 -21
- package/__chunks__/{CodeSnippet-daiUE0ZZ.mjs → CodeSnippet-BjUoaeh9.mjs} +2 -2
- package/__chunks__/{CodeSnippet-D5b8WTPo.js → CodeSnippet-DVrkwOg4.js} +2 -2
- package/__chunks__/{FocusScope-OD0PXxQI.mjs → FocusScope-C194OB-4.mjs} +83 -1
- package/__chunks__/{FocusScope-D5T6fKI9.js → FocusScope-DJer9ahG.js} +82 -0
- package/__chunks__/{HelpMenu-dUbPE3b6.js → HelpMenu-DF2Bx-bn.js} +6 -6
- package/__chunks__/{HelpMenu-CvYzKDPL.mjs → HelpMenu-m1qJ4EyP.mjs} +6 -6
- package/__chunks__/{HorizontalGrid-BZ6IHKxE.mjs → HorizontalGrid-BYR8Gr-h.mjs} +1 -1
- package/__chunks__/{HorizontalGrid-ijPB5iDF.js → HorizontalGrid-DuHNRhon.js} +1 -1
- package/__chunks__/{HorizontalStack-BhYVqGNF.js → HorizontalStack-By6XdGZh.js} +1 -1
- package/__chunks__/{HorizontalStack-CVOKWs2C.mjs → HorizontalStack-DaZakHYj.mjs} +1 -1
- package/__chunks__/{Icon-ML4td6nu.mjs → Icon-3zFwhVjn.mjs} +2 -2
- package/__chunks__/{Icon-DTlCtPmb.js → Icon-BB9QecRC.js} +2 -2
- package/__chunks__/{InputField-BVj42bl6.js → InputField-CHAxJwME.js} +3 -3
- package/__chunks__/{InputField-BGuPTA6X.mjs → InputField-CdEl4M4-.mjs} +3 -3
- package/__chunks__/{InputIcon-Ds8RTUHn.mjs → InputIcon--PdoGQOO.mjs} +25 -25
- package/__chunks__/{InputIcon-cgR2J0CY.js → InputIcon-oj25h1MN.js} +25 -25
- package/__chunks__/{KebabButton-Dwul0lCB.js → KebabButton-3bAqpgLu.js} +4 -4
- package/__chunks__/{KebabButton-KJLOsFVT.mjs → KebabButton-fmLpDchx.mjs} +4 -4
- package/__chunks__/{Menu-aW3etzMU.js → Menu--B0Fn4Ol.js} +15 -15
- package/__chunks__/{Menu-_F51cSwS.mjs → Menu-B95QYBVQ.mjs} +15 -15
- package/__chunks__/{Notification-B_EYEB85.mjs → Notification-D15awRNG.mjs} +14 -14
- package/__chunks__/{Notification-FLiv_7Pz.js → Notification-DTb3bJn4.js} +14 -14
- package/__chunks__/{Overlay-8RgU2lAl.mjs → Overlay-BtzIt9Ka.mjs} +1 -1
- package/__chunks__/{Overlay-B-di_dfG.js → Overlay-CUtfbILq.js} +1 -1
- package/__chunks__/{SelectOverlay-CE6xQN1A.mjs → SelectOverlay-D39ws5R2.mjs} +22 -22
- package/__chunks__/{SelectOverlay-BXUOr3V4.js → SelectOverlay-_dx1vHML.js} +22 -22
- package/__chunks__/{SelectorErrorTooltip-Kb6OHby6.mjs → SelectorErrorTooltip-D8y5kImH.mjs} +4 -4
- package/__chunks__/{SelectorErrorTooltip-CVmgS1ea.js → SelectorErrorTooltip-DhV9YtiA.js} +4 -4
- package/__chunks__/{Spinner-B824MsLf.js → Spinner-CVcjgzNy.js} +5 -5
- package/__chunks__/{Spinner-B_gLJGR4.mjs → Spinner-CfniY1TS.mjs} +5 -5
- package/__chunks__/{Stepper-jvJMb2AN.mjs → Stepper-D_2YRENa.mjs} +25 -25
- package/__chunks__/{Stepper-BsXgQ8uM.js → Stepper-E2li7kd2.js} +25 -25
- package/__chunks__/{TabNav-DZMmlU0F.mjs → TabNav-BgwlyiLE.mjs} +1 -1
- package/__chunks__/{TabNav-7zvsNpDC.js → TabNav-C7_HMIZx.js} +1 -1
- package/__chunks__/{Tabs-S7stbA0f.mjs → Tabs-CwxqTiAn.mjs} +17 -17
- package/__chunks__/{Tabs-Bno4dYlh.js → Tabs-WKn9NKJy.js} +17 -17
- package/__chunks__/{Text-CT2y5c8a.js → Text-CoOcI-ZA.js} +34 -34
- package/__chunks__/{Text-7pwgbag-.mjs → Text-Dfn-c0km.mjs} +34 -34
- package/__chunks__/{Toggle-DTGHrByH.js → Toggle-DYTnMD3t.js} +14 -13
- package/__chunks__/{Toggle-DnXlXQfM.mjs → Toggle-qa6gbH9Q.mjs} +13 -12
- package/__chunks__/{Tooltip-D3oH4aIj.js → Tooltip-6vJKVOnU.js} +8 -8
- package/__chunks__/{Tooltip-CtI3y9PC.mjs → Tooltip-DnLwtGUV.mjs} +8 -8
- package/__chunks__/{VerticalStack-BiBVFfHt.js → VerticalStack-BUxIVmGp.js} +3 -3
- package/__chunks__/{VerticalStack-BHv8i_jQ.mjs → VerticalStack-ac4iBcxE.mjs} +3 -3
- package/__chunks__/{ariaHideOutside-BYYnLsgt.js → ariaHideOutside-2fSu0FuJ.js} +1 -1
- package/__chunks__/{ariaHideOutside-CGNwwQAc.mjs → ariaHideOutside-Dhj8j6Mb.mjs} +1 -1
- package/__chunks__/{useDialog-BThBdiel.mjs → useDialog-CfUEt_df.mjs} +2 -2
- package/__chunks__/{useDialog-DIiUusMk.js → useDialog-CtMBWxF5.js} +2 -2
- package/__chunks__/{useEdgeInterceptors-CegFcI5C.js → useEdgeInterceptors-CQ1iontu.js} +5 -5
- package/__chunks__/{useEdgeInterceptors-Cg-US2Aq.mjs → useEdgeInterceptors-DYwJNXXm.mjs} +5 -5
- package/__chunks__/{useHasTabbableChild-DU6tKe-i.mjs → useHasTabbableChild-9rS-nuc-.mjs} +1 -1
- package/__chunks__/{useHasTabbableChild-4Ga1outX.js → useHasTabbableChild-BY-g4H3y.js} +1 -1
- package/__chunks__/{useSelectableItem-CJ5_OAlc.js → useSelectableItem-C0qCIU8l.js} +1 -1
- package/__chunks__/{useSelectableItem-SVHzvSUI.mjs → useSelectableItem-CHd6ksRw.mjs} +1 -1
- package/__chunks__/{useSelectableList-ICLJNy5q.js → useSelectableList-CnP9hXkb.js} +1 -1
- package/__chunks__/{useSelectableList-C-_LjaIN.mjs → useSelectableList-FvytdUu7.mjs} +1 -1
- package/__chunks__/{useToggle-CE4Qgz03.js → useToggle-DsYRac30.js} +0 -17
- package/__chunks__/{useToggle-B8pvlPQG.mjs → useToggle-YUgC8qn-.mjs} +1 -18
- package/__chunks__/useToggleState-CdbEMLRz.js +18 -0
- package/__chunks__/useToggleState-kFojjzgV.mjs +19 -0
- package/__chunks__/{useTriggerWidth-BhAxDRD1.mjs → useTriggerWidth-B3JINZlR.mjs} +2 -2
- package/__chunks__/{useTriggerWidth-CCmtSs-d.js → useTriggerWidth-CcKoLR8z.js} +2 -2
- package/__chunks__/utils-DXO9zsKE.js +154 -0
- package/__chunks__/utils-Dm-0qf_-.mjs +155 -0
- package/package.json +1 -1
- package/style.css +993 -948
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
22
|
+
const React = require("react");
|
|
23
|
+
const utils = require("../__chunks__/utils-DXO9zsKE.js");
|
|
24
|
+
const useControlledState = require("../__chunks__/useControlledState-mnKBd6Uc.js");
|
|
25
|
+
const useButton = require("../__chunks__/useButton-DVdJNlul.js");
|
|
26
|
+
const mergeProps = require("../__chunks__/mergeProps-DniMwM6P.js");
|
|
27
|
+
const FocusScope = require("../__chunks__/FocusScope-DJer9ahG.js");
|
|
28
|
+
const filterDOMProps = require("../__chunks__/filterDOMProps-D3iOHP0H.js");
|
|
29
|
+
const context = require("../__chunks__/context-D3NeXov7.js");
|
|
30
|
+
const useToggleState = require("../__chunks__/useToggleState-CdbEMLRz.js");
|
|
31
|
+
const useFocusRing = require("../__chunks__/useFocusRing-DFRFvht_.js");
|
|
32
|
+
const useHover = require("../__chunks__/useHover-BIKwjrCT.js");
|
|
33
|
+
const utilities_css = require("../utilities/css.js");
|
|
34
|
+
const Text = require("../__chunks__/Text-CoOcI-ZA.js");
|
|
35
|
+
function $ad999b7f496648d1$export$8deac67f4addf270(props) {
|
|
36
|
+
let { selectionMode = "single", disallowEmptySelection, isDisabled = false } = props;
|
|
37
|
+
let [selectedKeys, setSelectedKeys] = useControlledState.$458b0a5536c1a7cf$export$40bfa8c7b0832715(React.useMemo(() => props.selectedKeys ? new Set(props.selectedKeys) : void 0, [
|
|
38
|
+
props.selectedKeys
|
|
39
|
+
]), React.useMemo(() => props.defaultSelectedKeys ? new Set(props.defaultSelectedKeys) : /* @__PURE__ */ new Set(), [
|
|
40
|
+
props.defaultSelectedKeys
|
|
41
|
+
]), props.onSelectionChange);
|
|
42
|
+
return {
|
|
43
|
+
selectionMode,
|
|
44
|
+
isDisabled,
|
|
45
|
+
selectedKeys,
|
|
46
|
+
setSelectedKeys,
|
|
47
|
+
toggleKey(key) {
|
|
48
|
+
let keys;
|
|
49
|
+
if (selectionMode === "multiple") {
|
|
50
|
+
keys = new Set(selectedKeys);
|
|
51
|
+
if (keys.has(key) && (!disallowEmptySelection || keys.size > 1)) keys.delete(key);
|
|
52
|
+
else keys.add(key);
|
|
53
|
+
} else keys = new Set(selectedKeys.has(key) && !disallowEmptySelection ? [] : [
|
|
54
|
+
key
|
|
55
|
+
]);
|
|
56
|
+
setSelectedKeys(keys);
|
|
57
|
+
},
|
|
58
|
+
setSelected(key, isSelected) {
|
|
59
|
+
if (isSelected !== selectedKeys.has(key)) this.toggleKey(key);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function $55f54f7887471b58$export$51e84d46ca0bc451(props, state, ref) {
|
|
64
|
+
const { isSelected } = state;
|
|
65
|
+
const { isPressed, buttonProps } = useButton.$701a24aa0da5b062$export$ea18c227d4417cc3(__spreadProps(__spreadValues({}, props), {
|
|
66
|
+
onPress: mergeProps.$ff5963eb1fccf552$export$e08e3b67e392101e(state.toggle, props.onPress)
|
|
67
|
+
}), ref);
|
|
68
|
+
return {
|
|
69
|
+
isPressed,
|
|
70
|
+
isSelected,
|
|
71
|
+
isDisabled: props.isDisabled || false,
|
|
72
|
+
buttonProps: mergeProps.$3ef42575df84b30b$export$9d1611c77c2fe928(buttonProps, {
|
|
73
|
+
"aria-pressed": isSelected
|
|
74
|
+
})
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function $2680b1829e803644$export$fa142eb1681c520(props, ref) {
|
|
78
|
+
const { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, orientation = "horizontal" } = props;
|
|
79
|
+
let [isInToolbar, setInToolbar] = React.useState(false);
|
|
80
|
+
mergeProps.$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
81
|
+
var _ref_current_parentElement;
|
|
82
|
+
setInToolbar(!!(ref.current && ((_ref_current_parentElement = ref.current.parentElement) === null || _ref_current_parentElement === void 0 ? void 0 : _ref_current_parentElement.closest('[role="toolbar"]'))));
|
|
83
|
+
});
|
|
84
|
+
const { direction } = context.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
|
|
85
|
+
const shouldReverse = direction === "rtl" && orientation === "horizontal";
|
|
86
|
+
let focusManager = FocusScope.$9bf71ea28793e738$export$c5251b9e124bf29(ref);
|
|
87
|
+
const onKeyDown = (e) => {
|
|
88
|
+
if (!e.currentTarget.contains(e.target)) return;
|
|
89
|
+
if (orientation === "horizontal" && e.key === "ArrowRight" || orientation === "vertical" && e.key === "ArrowDown") {
|
|
90
|
+
if (shouldReverse) focusManager.focusPrevious();
|
|
91
|
+
else focusManager.focusNext();
|
|
92
|
+
} else if (orientation === "horizontal" && e.key === "ArrowLeft" || orientation === "vertical" && e.key === "ArrowUp") {
|
|
93
|
+
if (shouldReverse) focusManager.focusNext();
|
|
94
|
+
else focusManager.focusPrevious();
|
|
95
|
+
} else if (e.key === "Tab") {
|
|
96
|
+
e.stopPropagation();
|
|
97
|
+
lastFocused.current = document.activeElement;
|
|
98
|
+
if (e.shiftKey) focusManager.focusFirst();
|
|
99
|
+
else focusManager.focusLast();
|
|
100
|
+
return;
|
|
101
|
+
} else
|
|
102
|
+
return;
|
|
103
|
+
e.stopPropagation();
|
|
104
|
+
e.preventDefault();
|
|
105
|
+
};
|
|
106
|
+
const lastFocused = React.useRef(null);
|
|
107
|
+
const onBlur = (e) => {
|
|
108
|
+
if (!e.currentTarget.contains(e.relatedTarget) && !lastFocused.current) lastFocused.current = e.target;
|
|
109
|
+
};
|
|
110
|
+
const onFocus = (e) => {
|
|
111
|
+
var _ref_current;
|
|
112
|
+
if (lastFocused.current && !e.currentTarget.contains(e.relatedTarget) && ((_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.contains(e.target))) {
|
|
113
|
+
var _lastFocused_current;
|
|
114
|
+
(_lastFocused_current = lastFocused.current) === null || _lastFocused_current === void 0 ? void 0 : _lastFocused_current.focus();
|
|
115
|
+
lastFocused.current = null;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
return {
|
|
119
|
+
toolbarProps: __spreadProps(__spreadValues({}, filterDOMProps.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
120
|
+
labelable: true
|
|
121
|
+
})), {
|
|
122
|
+
role: !isInToolbar ? "toolbar" : "group",
|
|
123
|
+
"aria-orientation": orientation,
|
|
124
|
+
"aria-label": ariaLabel,
|
|
125
|
+
"aria-labelledby": ariaLabel == null ? ariaLabelledBy : void 0,
|
|
126
|
+
onKeyDownCapture: !isInToolbar ? onKeyDown : void 0,
|
|
127
|
+
onFocusCapture: !isInToolbar ? onFocus : void 0,
|
|
128
|
+
onBlurCapture: !isInToolbar ? onBlur : void 0
|
|
129
|
+
})
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function $4547d1bf40011fdf$export$dd5580ae642f110f(props, state, ref) {
|
|
133
|
+
let { isDisabled } = props;
|
|
134
|
+
let { toolbarProps } = $2680b1829e803644$export$fa142eb1681c520(props, ref);
|
|
135
|
+
return {
|
|
136
|
+
groupProps: __spreadProps(__spreadValues({}, toolbarProps), {
|
|
137
|
+
role: state.selectionMode === "single" ? "radiogroup" : toolbarProps.role,
|
|
138
|
+
"aria-disabled": isDisabled
|
|
139
|
+
})
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
function $4547d1bf40011fdf$export$bc53712daae3d6e6(props, state, ref) {
|
|
143
|
+
let toggleState = {
|
|
144
|
+
isSelected: state.selectedKeys.has(props.id),
|
|
145
|
+
setSelected(isSelected2) {
|
|
146
|
+
state.setSelected(props.id, isSelected2);
|
|
147
|
+
},
|
|
148
|
+
toggle() {
|
|
149
|
+
state.toggleKey(props.id);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
let { isPressed, isSelected, isDisabled, buttonProps } = $55f54f7887471b58$export$51e84d46ca0bc451(__spreadProps(__spreadValues({}, props), {
|
|
153
|
+
id: void 0,
|
|
154
|
+
isDisabled: props.isDisabled || state.isDisabled
|
|
155
|
+
}), toggleState, ref);
|
|
156
|
+
if (state.selectionMode === "single") {
|
|
157
|
+
buttonProps.role = "radio";
|
|
158
|
+
buttonProps["aria-checked"] = toggleState.isSelected;
|
|
159
|
+
delete buttonProps["aria-pressed"];
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
isPressed,
|
|
163
|
+
isSelected,
|
|
164
|
+
isDisabled,
|
|
165
|
+
buttonProps
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
const $84b7d8702d4ff4a8$export$298258635ae0dd97 = /* @__PURE__ */ React.createContext({});
|
|
169
|
+
const $84b7d8702d4ff4a8$export$a8a71863db173133 = /* @__PURE__ */ React.createContext(null);
|
|
170
|
+
function $84b7d8702d4ff4a8$var$ToggleButtonGroup(props, ref) {
|
|
171
|
+
[props, ref] = utils.$64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $84b7d8702d4ff4a8$export$298258635ae0dd97);
|
|
172
|
+
let state = $ad999b7f496648d1$export$8deac67f4addf270(props);
|
|
173
|
+
let { groupProps } = $4547d1bf40011fdf$export$dd5580ae642f110f(props, state, ref);
|
|
174
|
+
let renderProps = utils.$64fa3d84918910a7$export$4d86445c2cf5e3(__spreadProps(__spreadValues({}, props), {
|
|
175
|
+
values: {
|
|
176
|
+
isDisabled: state.isDisabled,
|
|
177
|
+
state
|
|
178
|
+
},
|
|
179
|
+
defaultClassName: "react-aria-ToggleButtonGroup"
|
|
180
|
+
}));
|
|
181
|
+
return /* @__PURE__ */ React.createElement("div", __spreadProps(__spreadValues(__spreadValues({}, groupProps), renderProps), {
|
|
182
|
+
ref,
|
|
183
|
+
slot: props.slot || void 0,
|
|
184
|
+
"data-orientation": props.orientation || "horizontal",
|
|
185
|
+
"data-disabled": props.isDisabled || void 0
|
|
186
|
+
}), /* @__PURE__ */ React.createElement($84b7d8702d4ff4a8$export$a8a71863db173133.Provider, {
|
|
187
|
+
value: state
|
|
188
|
+
}, renderProps.children));
|
|
189
|
+
}
|
|
190
|
+
const $84b7d8702d4ff4a8$export$40258cc1d95ff477 = /* @__PURE__ */ React.forwardRef($84b7d8702d4ff4a8$var$ToggleButtonGroup);
|
|
191
|
+
const $efde0372d7a700fe$export$43506d75ebd2e218 = /* @__PURE__ */ React.createContext({});
|
|
192
|
+
function $efde0372d7a700fe$var$ToggleButton(props, ref) {
|
|
193
|
+
[props, ref] = utils.$64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $efde0372d7a700fe$export$43506d75ebd2e218);
|
|
194
|
+
let groupState = React.useContext($84b7d8702d4ff4a8$export$a8a71863db173133);
|
|
195
|
+
let state = useToggleState.$3017fa7ffdddec74$export$8042c6c013fd5226(groupState && props.id != null ? {
|
|
196
|
+
isSelected: groupState.selectedKeys.has(props.id),
|
|
197
|
+
onChange(isSelected2) {
|
|
198
|
+
groupState.setSelected(props.id, isSelected2);
|
|
199
|
+
}
|
|
200
|
+
} : props);
|
|
201
|
+
let { buttonProps, isPressed, isSelected, isDisabled } = groupState && props.id != null ? $4547d1bf40011fdf$export$bc53712daae3d6e6(__spreadProps(__spreadValues({}, props), {
|
|
202
|
+
id: props.id
|
|
203
|
+
}), groupState, ref) : $55f54f7887471b58$export$51e84d46ca0bc451(__spreadProps(__spreadValues({}, props), {
|
|
204
|
+
id: props.id != null ? String(props.id) : void 0
|
|
205
|
+
}), state, ref);
|
|
206
|
+
let { focusProps, isFocused, isFocusVisible } = useFocusRing.$f7dceffc5ad7768b$export$4e328f61c538687f(props);
|
|
207
|
+
let { hoverProps, isHovered } = useHover.$6179b936705e76d3$export$ae780daf29e6d456(props);
|
|
208
|
+
let renderProps = utils.$64fa3d84918910a7$export$4d86445c2cf5e3(__spreadProps(__spreadValues({}, props), {
|
|
209
|
+
id: void 0,
|
|
210
|
+
values: {
|
|
211
|
+
isHovered,
|
|
212
|
+
isPressed,
|
|
213
|
+
isFocused,
|
|
214
|
+
isSelected: state.isSelected,
|
|
215
|
+
isFocusVisible,
|
|
216
|
+
isDisabled,
|
|
217
|
+
state
|
|
218
|
+
},
|
|
219
|
+
defaultClassName: "react-aria-ToggleButton"
|
|
220
|
+
}));
|
|
221
|
+
return /* @__PURE__ */ React.createElement("button", __spreadProps(__spreadValues(__spreadValues({}, mergeProps.$3ef42575df84b30b$export$9d1611c77c2fe928(buttonProps, focusProps, hoverProps)), renderProps), {
|
|
222
|
+
ref,
|
|
223
|
+
slot: props.slot || void 0,
|
|
224
|
+
"data-focused": isFocused || void 0,
|
|
225
|
+
"data-disabled": isDisabled || void 0,
|
|
226
|
+
"data-pressed": isPressed || void 0,
|
|
227
|
+
"data-selected": isSelected || void 0,
|
|
228
|
+
"data-hovered": isHovered || void 0,
|
|
229
|
+
"data-focus-visible": isFocusVisible || void 0
|
|
230
|
+
}));
|
|
231
|
+
}
|
|
232
|
+
const $efde0372d7a700fe$export$d2b052e7b4be1756 = /* @__PURE__ */ React.forwardRef($efde0372d7a700fe$var$ToggleButton);
|
|
233
|
+
const RadioButtonGroupButton$1 = "_RadioButtonGroupButton_mfbzo_5";
|
|
234
|
+
const styles = {
|
|
235
|
+
RadioButtonGroupButton: RadioButtonGroupButton$1
|
|
236
|
+
};
|
|
237
|
+
function RadioButtonGroupButton(props) {
|
|
238
|
+
const { children, isDisabled, id } = props;
|
|
239
|
+
return React.createElement($efde0372d7a700fe$export$d2b052e7b4be1756, {
|
|
240
|
+
className: utilities_css.classNames(styles.RadioButtonGroupButton),
|
|
241
|
+
isDisabled,
|
|
242
|
+
id
|
|
243
|
+
}, React.createElement(Text.Text, {
|
|
244
|
+
variant: "small_button"
|
|
245
|
+
}, children));
|
|
246
|
+
}
|
|
247
|
+
function RadioButtonGroup(props) {
|
|
248
|
+
const { color = "primary.500", children, onSelectionChange, selectedKeys, selectionMode = "single", disallowEmptySelection, defaultSelectedKeys, isDisabled } = props;
|
|
249
|
+
const style = __spreadValues({}, utilities_css.getComponentThemeToken("radio-button-group", "color", "color", color));
|
|
250
|
+
return React.createElement($84b7d8702d4ff4a8$export$40258cc1d95ff477, {
|
|
251
|
+
style,
|
|
252
|
+
className: styles.RadiobuttonGroup,
|
|
253
|
+
onSelectionChange,
|
|
254
|
+
selectedKeys,
|
|
255
|
+
selectionMode,
|
|
256
|
+
disallowEmptySelection,
|
|
257
|
+
defaultSelectedKeys,
|
|
258
|
+
isDisabled
|
|
259
|
+
}, children);
|
|
260
|
+
}
|
|
261
|
+
RadioButtonGroup.Button = RadioButtonGroupButton;
|
|
262
|
+
exports.RadioButtonGroup = RadioButtonGroup;
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import React__default, { useMemo, useState, useRef, forwardRef, createContext, useContext } from "react";
|
|
21
|
+
import { $ as $64fa3d84918910a7$export$29f1550f4b0d4415, a as $64fa3d84918910a7$export$4d86445c2cf5e3 } from "../__chunks__/utils-Dm-0qf_-.mjs";
|
|
22
|
+
import { $ as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "../__chunks__/useControlledState-CFWhSD5C.mjs";
|
|
23
|
+
import { $ as $701a24aa0da5b062$export$ea18c227d4417cc3 } from "../__chunks__/useButton-C6QFpa4j.mjs";
|
|
24
|
+
import { f as $ff5963eb1fccf552$export$e08e3b67e392101e, a as $3ef42575df84b30b$export$9d1611c77c2fe928, b as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c } from "../__chunks__/mergeProps-SJQ-f8LF.mjs";
|
|
25
|
+
import { c as $9bf71ea28793e738$export$c5251b9e124bf29 } from "../__chunks__/FocusScope-C194OB-4.mjs";
|
|
26
|
+
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../__chunks__/filterDOMProps-EDDcM64A.mjs";
|
|
27
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../__chunks__/context-D3I6RuRU.mjs";
|
|
28
|
+
import { $ as $3017fa7ffdddec74$export$8042c6c013fd5226 } from "../__chunks__/useToggleState-kFojjzgV.mjs";
|
|
29
|
+
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../__chunks__/useFocusRing-dRPhwlpK.mjs";
|
|
30
|
+
import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../__chunks__/useHover-BOYR4wqI.mjs";
|
|
31
|
+
import { getComponentThemeToken, classNames } from "../utilities/css.mjs";
|
|
32
|
+
import { T as Text } from "../__chunks__/Text-Dfn-c0km.mjs";
|
|
33
|
+
function $ad999b7f496648d1$export$8deac67f4addf270(props) {
|
|
34
|
+
let { selectionMode = "single", disallowEmptySelection, isDisabled = false } = props;
|
|
35
|
+
let [selectedKeys, setSelectedKeys] = $458b0a5536c1a7cf$export$40bfa8c7b0832715(useMemo(() => props.selectedKeys ? new Set(props.selectedKeys) : void 0, [
|
|
36
|
+
props.selectedKeys
|
|
37
|
+
]), useMemo(() => props.defaultSelectedKeys ? new Set(props.defaultSelectedKeys) : /* @__PURE__ */ new Set(), [
|
|
38
|
+
props.defaultSelectedKeys
|
|
39
|
+
]), props.onSelectionChange);
|
|
40
|
+
return {
|
|
41
|
+
selectionMode,
|
|
42
|
+
isDisabled,
|
|
43
|
+
selectedKeys,
|
|
44
|
+
setSelectedKeys,
|
|
45
|
+
toggleKey(key) {
|
|
46
|
+
let keys;
|
|
47
|
+
if (selectionMode === "multiple") {
|
|
48
|
+
keys = new Set(selectedKeys);
|
|
49
|
+
if (keys.has(key) && (!disallowEmptySelection || keys.size > 1)) keys.delete(key);
|
|
50
|
+
else keys.add(key);
|
|
51
|
+
} else keys = new Set(selectedKeys.has(key) && !disallowEmptySelection ? [] : [
|
|
52
|
+
key
|
|
53
|
+
]);
|
|
54
|
+
setSelectedKeys(keys);
|
|
55
|
+
},
|
|
56
|
+
setSelected(key, isSelected) {
|
|
57
|
+
if (isSelected !== selectedKeys.has(key)) this.toggleKey(key);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function $55f54f7887471b58$export$51e84d46ca0bc451(props, state, ref) {
|
|
62
|
+
const { isSelected } = state;
|
|
63
|
+
const { isPressed, buttonProps } = $701a24aa0da5b062$export$ea18c227d4417cc3(__spreadProps(__spreadValues({}, props), {
|
|
64
|
+
onPress: $ff5963eb1fccf552$export$e08e3b67e392101e(state.toggle, props.onPress)
|
|
65
|
+
}), ref);
|
|
66
|
+
return {
|
|
67
|
+
isPressed,
|
|
68
|
+
isSelected,
|
|
69
|
+
isDisabled: props.isDisabled || false,
|
|
70
|
+
buttonProps: $3ef42575df84b30b$export$9d1611c77c2fe928(buttonProps, {
|
|
71
|
+
"aria-pressed": isSelected
|
|
72
|
+
})
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function $2680b1829e803644$export$fa142eb1681c520(props, ref) {
|
|
76
|
+
const { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, orientation = "horizontal" } = props;
|
|
77
|
+
let [isInToolbar, setInToolbar] = useState(false);
|
|
78
|
+
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
79
|
+
var _ref_current_parentElement;
|
|
80
|
+
setInToolbar(!!(ref.current && ((_ref_current_parentElement = ref.current.parentElement) === null || _ref_current_parentElement === void 0 ? void 0 : _ref_current_parentElement.closest('[role="toolbar"]'))));
|
|
81
|
+
});
|
|
82
|
+
const { direction } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
|
|
83
|
+
const shouldReverse = direction === "rtl" && orientation === "horizontal";
|
|
84
|
+
let focusManager = $9bf71ea28793e738$export$c5251b9e124bf29(ref);
|
|
85
|
+
const onKeyDown = (e) => {
|
|
86
|
+
if (!e.currentTarget.contains(e.target)) return;
|
|
87
|
+
if (orientation === "horizontal" && e.key === "ArrowRight" || orientation === "vertical" && e.key === "ArrowDown") {
|
|
88
|
+
if (shouldReverse) focusManager.focusPrevious();
|
|
89
|
+
else focusManager.focusNext();
|
|
90
|
+
} else if (orientation === "horizontal" && e.key === "ArrowLeft" || orientation === "vertical" && e.key === "ArrowUp") {
|
|
91
|
+
if (shouldReverse) focusManager.focusNext();
|
|
92
|
+
else focusManager.focusPrevious();
|
|
93
|
+
} else if (e.key === "Tab") {
|
|
94
|
+
e.stopPropagation();
|
|
95
|
+
lastFocused.current = document.activeElement;
|
|
96
|
+
if (e.shiftKey) focusManager.focusFirst();
|
|
97
|
+
else focusManager.focusLast();
|
|
98
|
+
return;
|
|
99
|
+
} else
|
|
100
|
+
return;
|
|
101
|
+
e.stopPropagation();
|
|
102
|
+
e.preventDefault();
|
|
103
|
+
};
|
|
104
|
+
const lastFocused = useRef(null);
|
|
105
|
+
const onBlur = (e) => {
|
|
106
|
+
if (!e.currentTarget.contains(e.relatedTarget) && !lastFocused.current) lastFocused.current = e.target;
|
|
107
|
+
};
|
|
108
|
+
const onFocus = (e) => {
|
|
109
|
+
var _ref_current;
|
|
110
|
+
if (lastFocused.current && !e.currentTarget.contains(e.relatedTarget) && ((_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.contains(e.target))) {
|
|
111
|
+
var _lastFocused_current;
|
|
112
|
+
(_lastFocused_current = lastFocused.current) === null || _lastFocused_current === void 0 ? void 0 : _lastFocused_current.focus();
|
|
113
|
+
lastFocused.current = null;
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
return {
|
|
117
|
+
toolbarProps: __spreadProps(__spreadValues({}, $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
118
|
+
labelable: true
|
|
119
|
+
})), {
|
|
120
|
+
role: !isInToolbar ? "toolbar" : "group",
|
|
121
|
+
"aria-orientation": orientation,
|
|
122
|
+
"aria-label": ariaLabel,
|
|
123
|
+
"aria-labelledby": ariaLabel == null ? ariaLabelledBy : void 0,
|
|
124
|
+
onKeyDownCapture: !isInToolbar ? onKeyDown : void 0,
|
|
125
|
+
onFocusCapture: !isInToolbar ? onFocus : void 0,
|
|
126
|
+
onBlurCapture: !isInToolbar ? onBlur : void 0
|
|
127
|
+
})
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function $4547d1bf40011fdf$export$dd5580ae642f110f(props, state, ref) {
|
|
131
|
+
let { isDisabled } = props;
|
|
132
|
+
let { toolbarProps } = $2680b1829e803644$export$fa142eb1681c520(props, ref);
|
|
133
|
+
return {
|
|
134
|
+
groupProps: __spreadProps(__spreadValues({}, toolbarProps), {
|
|
135
|
+
role: state.selectionMode === "single" ? "radiogroup" : toolbarProps.role,
|
|
136
|
+
"aria-disabled": isDisabled
|
|
137
|
+
})
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function $4547d1bf40011fdf$export$bc53712daae3d6e6(props, state, ref) {
|
|
141
|
+
let toggleState = {
|
|
142
|
+
isSelected: state.selectedKeys.has(props.id),
|
|
143
|
+
setSelected(isSelected2) {
|
|
144
|
+
state.setSelected(props.id, isSelected2);
|
|
145
|
+
},
|
|
146
|
+
toggle() {
|
|
147
|
+
state.toggleKey(props.id);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
let { isPressed, isSelected, isDisabled, buttonProps } = $55f54f7887471b58$export$51e84d46ca0bc451(__spreadProps(__spreadValues({}, props), {
|
|
151
|
+
id: void 0,
|
|
152
|
+
isDisabled: props.isDisabled || state.isDisabled
|
|
153
|
+
}), toggleState, ref);
|
|
154
|
+
if (state.selectionMode === "single") {
|
|
155
|
+
buttonProps.role = "radio";
|
|
156
|
+
buttonProps["aria-checked"] = toggleState.isSelected;
|
|
157
|
+
delete buttonProps["aria-pressed"];
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
isPressed,
|
|
161
|
+
isSelected,
|
|
162
|
+
isDisabled,
|
|
163
|
+
buttonProps
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
const $84b7d8702d4ff4a8$export$298258635ae0dd97 = /* @__PURE__ */ createContext({});
|
|
167
|
+
const $84b7d8702d4ff4a8$export$a8a71863db173133 = /* @__PURE__ */ createContext(null);
|
|
168
|
+
function $84b7d8702d4ff4a8$var$ToggleButtonGroup(props, ref) {
|
|
169
|
+
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $84b7d8702d4ff4a8$export$298258635ae0dd97);
|
|
170
|
+
let state = $ad999b7f496648d1$export$8deac67f4addf270(props);
|
|
171
|
+
let { groupProps } = $4547d1bf40011fdf$export$dd5580ae642f110f(props, state, ref);
|
|
172
|
+
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3(__spreadProps(__spreadValues({}, props), {
|
|
173
|
+
values: {
|
|
174
|
+
isDisabled: state.isDisabled,
|
|
175
|
+
state
|
|
176
|
+
},
|
|
177
|
+
defaultClassName: "react-aria-ToggleButtonGroup"
|
|
178
|
+
}));
|
|
179
|
+
return /* @__PURE__ */ React__default.createElement("div", __spreadProps(__spreadValues(__spreadValues({}, groupProps), renderProps), {
|
|
180
|
+
ref,
|
|
181
|
+
slot: props.slot || void 0,
|
|
182
|
+
"data-orientation": props.orientation || "horizontal",
|
|
183
|
+
"data-disabled": props.isDisabled || void 0
|
|
184
|
+
}), /* @__PURE__ */ React__default.createElement($84b7d8702d4ff4a8$export$a8a71863db173133.Provider, {
|
|
185
|
+
value: state
|
|
186
|
+
}, renderProps.children));
|
|
187
|
+
}
|
|
188
|
+
const $84b7d8702d4ff4a8$export$40258cc1d95ff477 = /* @__PURE__ */ forwardRef($84b7d8702d4ff4a8$var$ToggleButtonGroup);
|
|
189
|
+
const $efde0372d7a700fe$export$43506d75ebd2e218 = /* @__PURE__ */ createContext({});
|
|
190
|
+
function $efde0372d7a700fe$var$ToggleButton(props, ref) {
|
|
191
|
+
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $efde0372d7a700fe$export$43506d75ebd2e218);
|
|
192
|
+
let groupState = useContext($84b7d8702d4ff4a8$export$a8a71863db173133);
|
|
193
|
+
let state = $3017fa7ffdddec74$export$8042c6c013fd5226(groupState && props.id != null ? {
|
|
194
|
+
isSelected: groupState.selectedKeys.has(props.id),
|
|
195
|
+
onChange(isSelected2) {
|
|
196
|
+
groupState.setSelected(props.id, isSelected2);
|
|
197
|
+
}
|
|
198
|
+
} : props);
|
|
199
|
+
let { buttonProps, isPressed, isSelected, isDisabled } = groupState && props.id != null ? $4547d1bf40011fdf$export$bc53712daae3d6e6(__spreadProps(__spreadValues({}, props), {
|
|
200
|
+
id: props.id
|
|
201
|
+
}), groupState, ref) : $55f54f7887471b58$export$51e84d46ca0bc451(__spreadProps(__spreadValues({}, props), {
|
|
202
|
+
id: props.id != null ? String(props.id) : void 0
|
|
203
|
+
}), state, ref);
|
|
204
|
+
let { focusProps, isFocused, isFocusVisible } = $f7dceffc5ad7768b$export$4e328f61c538687f(props);
|
|
205
|
+
let { hoverProps, isHovered } = $6179b936705e76d3$export$ae780daf29e6d456(props);
|
|
206
|
+
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3(__spreadProps(__spreadValues({}, props), {
|
|
207
|
+
id: void 0,
|
|
208
|
+
values: {
|
|
209
|
+
isHovered,
|
|
210
|
+
isPressed,
|
|
211
|
+
isFocused,
|
|
212
|
+
isSelected: state.isSelected,
|
|
213
|
+
isFocusVisible,
|
|
214
|
+
isDisabled,
|
|
215
|
+
state
|
|
216
|
+
},
|
|
217
|
+
defaultClassName: "react-aria-ToggleButton"
|
|
218
|
+
}));
|
|
219
|
+
return /* @__PURE__ */ React__default.createElement("button", __spreadProps(__spreadValues(__spreadValues({}, $3ef42575df84b30b$export$9d1611c77c2fe928(buttonProps, focusProps, hoverProps)), renderProps), {
|
|
220
|
+
ref,
|
|
221
|
+
slot: props.slot || void 0,
|
|
222
|
+
"data-focused": isFocused || void 0,
|
|
223
|
+
"data-disabled": isDisabled || void 0,
|
|
224
|
+
"data-pressed": isPressed || void 0,
|
|
225
|
+
"data-selected": isSelected || void 0,
|
|
226
|
+
"data-hovered": isHovered || void 0,
|
|
227
|
+
"data-focus-visible": isFocusVisible || void 0
|
|
228
|
+
}));
|
|
229
|
+
}
|
|
230
|
+
const $efde0372d7a700fe$export$d2b052e7b4be1756 = /* @__PURE__ */ forwardRef($efde0372d7a700fe$var$ToggleButton);
|
|
231
|
+
const RadioButtonGroupButton$1 = "_RadioButtonGroupButton_mfbzo_5";
|
|
232
|
+
const styles = {
|
|
233
|
+
RadioButtonGroupButton: RadioButtonGroupButton$1
|
|
234
|
+
};
|
|
235
|
+
function RadioButtonGroupButton(props) {
|
|
236
|
+
const { children, isDisabled, id } = props;
|
|
237
|
+
return React__default.createElement($efde0372d7a700fe$export$d2b052e7b4be1756, {
|
|
238
|
+
className: classNames(styles.RadioButtonGroupButton),
|
|
239
|
+
isDisabled,
|
|
240
|
+
id
|
|
241
|
+
}, React__default.createElement(Text, {
|
|
242
|
+
variant: "small_button"
|
|
243
|
+
}, children));
|
|
244
|
+
}
|
|
245
|
+
function RadioButtonGroup(props) {
|
|
246
|
+
const { color = "primary.500", children, onSelectionChange, selectedKeys, selectionMode = "single", disallowEmptySelection, defaultSelectedKeys, isDisabled } = props;
|
|
247
|
+
const style = __spreadValues({}, getComponentThemeToken("radio-button-group", "color", "color", color));
|
|
248
|
+
return React__default.createElement($84b7d8702d4ff4a8$export$40258cc1d95ff477, {
|
|
249
|
+
style,
|
|
250
|
+
className: styles.RadiobuttonGroup,
|
|
251
|
+
onSelectionChange,
|
|
252
|
+
selectedKeys,
|
|
253
|
+
selectionMode,
|
|
254
|
+
disallowEmptySelection,
|
|
255
|
+
defaultSelectedKeys,
|
|
256
|
+
isDisabled
|
|
257
|
+
}, children);
|
|
258
|
+
}
|
|
259
|
+
RadioButtonGroup.Button = RadioButtonGroupButton;
|
|
260
|
+
export {
|
|
261
|
+
RadioButtonGroup
|
|
262
|
+
};
|
package/RadioGroup/index.js
CHANGED
|
@@ -32,9 +32,9 @@ var __objRest = (source, exclude) => {
|
|
|
32
32
|
};
|
|
33
33
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
34
34
|
const React = require("react");
|
|
35
|
-
const Text = require("../__chunks__/Text-
|
|
36
|
-
const HorizontalStack = require("../__chunks__/HorizontalStack-
|
|
37
|
-
const SelectorErrorTooltip = require("../__chunks__/SelectorErrorTooltip-
|
|
35
|
+
const Text = require("../__chunks__/Text-CoOcI-ZA.js");
|
|
36
|
+
const HorizontalStack = require("../__chunks__/HorizontalStack-By6XdGZh.js");
|
|
37
|
+
const SelectorErrorTooltip = require("../__chunks__/SelectorErrorTooltip-DhV9YtiA.js");
|
|
38
38
|
const utilities_css = require("../utilities/css.js");
|
|
39
39
|
const mergeProps = require("../__chunks__/mergeProps-DniMwM6P.js");
|
|
40
40
|
const filterDOMProps = require("../__chunks__/filterDOMProps-D3iOHP0H.js");
|
|
@@ -45,7 +45,7 @@ const usePress = require("../__chunks__/usePress-BVH8whNd.js");
|
|
|
45
45
|
const useFocusRing = require("../__chunks__/useFocusRing-DFRFvht_.js");
|
|
46
46
|
const useHover = require("../__chunks__/useHover-BIKwjrCT.js");
|
|
47
47
|
const useControlledState = require("../__chunks__/useControlledState-mnKBd6Uc.js");
|
|
48
|
-
const FocusScope = require("../__chunks__/FocusScope-
|
|
48
|
+
const FocusScope = require("../__chunks__/FocusScope-DJer9ahG.js");
|
|
49
49
|
const useField = require("../__chunks__/useField-BJW_bXVD.js");
|
|
50
50
|
const useFocusWithin = require("../__chunks__/useFocusWithin-C1ioGWec.js");
|
|
51
51
|
const context = require("../__chunks__/context-D3NeXov7.js");
|
|
@@ -244,16 +244,16 @@ const useRadioGroupContext = () => {
|
|
|
244
244
|
}
|
|
245
245
|
return radioGroupContext;
|
|
246
246
|
};
|
|
247
|
-
const RadioGroupItem$1 = "
|
|
248
|
-
const label = "
|
|
249
|
-
const radioOuter = "
|
|
250
|
-
const radioInner = "
|
|
251
|
-
const focusVisible = "
|
|
252
|
-
const selected = "
|
|
253
|
-
const invalid = "
|
|
254
|
-
const disabled = "
|
|
255
|
-
const hovered = "
|
|
256
|
-
const readOnly = "
|
|
247
|
+
const RadioGroupItem$1 = "_RadioGroupItem_1m39v_5";
|
|
248
|
+
const label = "_label_1m39v_11";
|
|
249
|
+
const radioOuter = "_radioOuter_1m39v_29";
|
|
250
|
+
const radioInner = "_radioInner_1m39v_30";
|
|
251
|
+
const focusVisible = "_focusVisible_1m39v_44";
|
|
252
|
+
const selected = "_selected_1m39v_63";
|
|
253
|
+
const invalid = "_invalid_1m39v_67";
|
|
254
|
+
const disabled = "_disabled_1m39v_71";
|
|
255
|
+
const hovered = "_hovered_1m39v_83";
|
|
256
|
+
const readOnly = "_readOnly_1m39v_83";
|
|
257
257
|
const styles$1 = {
|
|
258
258
|
RadioGroupItem: RadioGroupItem$1,
|
|
259
259
|
label,
|
|
@@ -302,8 +302,8 @@ function RadioGroupItem(props) {
|
|
|
302
302
|
content: errorText
|
|
303
303
|
})));
|
|
304
304
|
}
|
|
305
|
-
const RadioGroup$1 = "
|
|
306
|
-
const list = "
|
|
305
|
+
const RadioGroup$1 = "_RadioGroup_1g9j9_5";
|
|
306
|
+
const list = "_list_1g9j9_14";
|
|
307
307
|
const styles = {
|
|
308
308
|
RadioGroup: RadioGroup$1,
|
|
309
309
|
list
|
package/RadioGroup/index.mjs
CHANGED
|
@@ -30,9 +30,9 @@ var __objRest = (source, exclude) => {
|
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
32
|
import React__default, { useMemo, useState, useContext } from "react";
|
|
33
|
-
import { T as Text } from "../__chunks__/Text-
|
|
34
|
-
import { H as HorizontalStack } from "../__chunks__/HorizontalStack-
|
|
35
|
-
import { S as SelectorErrorTooltip } from "../__chunks__/SelectorErrorTooltip-
|
|
33
|
+
import { T as Text } from "../__chunks__/Text-Dfn-c0km.mjs";
|
|
34
|
+
import { H as HorizontalStack } from "../__chunks__/HorizontalStack-DaZakHYj.mjs";
|
|
35
|
+
import { S as SelectorErrorTooltip } from "../__chunks__/SelectorErrorTooltip-D8y5kImH.mjs";
|
|
36
36
|
import { classNames } from "../utilities/css.mjs";
|
|
37
37
|
import { a as $3ef42575df84b30b$export$9d1611c77c2fe928, d as $bdb11010cef70236$export$f680877a34711e37 } from "../__chunks__/mergeProps-SJQ-f8LF.mjs";
|
|
38
38
|
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../__chunks__/filterDOMProps-EDDcM64A.mjs";
|
|
@@ -43,7 +43,7 @@ import { $ as $f6c31cce2adf654f$export$45712eceda6fad21 } from "../__chunks__/us
|
|
|
43
43
|
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../__chunks__/useFocusRing-dRPhwlpK.mjs";
|
|
44
44
|
import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../__chunks__/useHover-BOYR4wqI.mjs";
|
|
45
45
|
import { $ as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "../__chunks__/useControlledState-CFWhSD5C.mjs";
|
|
46
|
-
import { $ as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "../__chunks__/FocusScope-
|
|
46
|
+
import { $ as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "../__chunks__/FocusScope-C194OB-4.mjs";
|
|
47
47
|
import { $ as $2baaea4c71418dea$export$294aa081a6c6f55d } from "../__chunks__/useField-DPD-La1H.mjs";
|
|
48
48
|
import { $ as $9ab94262bd0047c7$export$420e68273165f4ec } from "../__chunks__/useFocusWithin-krnNAgDY.mjs";
|
|
49
49
|
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../__chunks__/context-D3I6RuRU.mjs";
|
|
@@ -242,16 +242,16 @@ const useRadioGroupContext = () => {
|
|
|
242
242
|
}
|
|
243
243
|
return radioGroupContext;
|
|
244
244
|
};
|
|
245
|
-
const RadioGroupItem$1 = "
|
|
246
|
-
const label = "
|
|
247
|
-
const radioOuter = "
|
|
248
|
-
const radioInner = "
|
|
249
|
-
const focusVisible = "
|
|
250
|
-
const selected = "
|
|
251
|
-
const invalid = "
|
|
252
|
-
const disabled = "
|
|
253
|
-
const hovered = "
|
|
254
|
-
const readOnly = "
|
|
245
|
+
const RadioGroupItem$1 = "_RadioGroupItem_1m39v_5";
|
|
246
|
+
const label = "_label_1m39v_11";
|
|
247
|
+
const radioOuter = "_radioOuter_1m39v_29";
|
|
248
|
+
const radioInner = "_radioInner_1m39v_30";
|
|
249
|
+
const focusVisible = "_focusVisible_1m39v_44";
|
|
250
|
+
const selected = "_selected_1m39v_63";
|
|
251
|
+
const invalid = "_invalid_1m39v_67";
|
|
252
|
+
const disabled = "_disabled_1m39v_71";
|
|
253
|
+
const hovered = "_hovered_1m39v_83";
|
|
254
|
+
const readOnly = "_readOnly_1m39v_83";
|
|
255
255
|
const styles$1 = {
|
|
256
256
|
RadioGroupItem: RadioGroupItem$1,
|
|
257
257
|
label,
|
|
@@ -300,8 +300,8 @@ function RadioGroupItem(props) {
|
|
|
300
300
|
content: errorText
|
|
301
301
|
})));
|
|
302
302
|
}
|
|
303
|
-
const RadioGroup$1 = "
|
|
304
|
-
const list = "
|
|
303
|
+
const RadioGroup$1 = "_RadioGroup_1g9j9_5";
|
|
304
|
+
const list = "_list_1g9j9_14";
|
|
305
305
|
const styles = {
|
|
306
306
|
RadioGroup: RadioGroup$1,
|
|
307
307
|
list
|