@easypost/easy-ui 1.0.0-alpha.61 → 1.0.0-alpha.62
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 +1 -1
- package/Calendar/index.mjs +1 -1
- 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 +14 -14
- package/CodeBlock/index.mjs +16 -16
- package/CodeSnippet/index.js +1 -1
- package/CodeSnippet/index.mjs +1 -1
- package/DataGrid/index.js +63 -63
- package/DataGrid/index.mjs +72 -72
- package/DatePicker/index.js +5 -5
- package/DatePicker/index.mjs +12 -12
- package/DateRangePicker/index.js +5 -5
- package/DateRangePicker/index.mjs +12 -12
- package/Drawer/index.js +23 -22
- package/Drawer/index.mjs +22 -21
- package/DropdownButton/index.js +13 -13
- package/DropdownButton/index.mjs +13 -13
- package/EmptyStateCard/index.js +8 -8
- package/EmptyStateCard/index.mjs +8 -8
- package/FocusedProductLayout/index.js +25 -78
- package/FocusedProductLayout/index.mjs +24 -61
- package/ForgeLayout/ForgeLayout.d.ts +14 -22
- package/ForgeLayout/ForgeLayout.d.ts.map +1 -1
- package/ForgeLayout/ForgeLayout.stories.d.ts.map +1 -1
- package/ForgeLayout/ForgeLayoutControls.d.ts +38 -0
- package/ForgeLayout/ForgeLayoutControls.d.ts.map +1 -0
- package/ForgeLayout/ForgeLayoutHeader.d.ts +18 -0
- package/ForgeLayout/ForgeLayoutHeader.d.ts.map +1 -0
- package/ForgeLayout/index.js +426 -62
- package/ForgeLayout/index.mjs +429 -65
- 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 +13 -13
- package/IconButton/index.mjs +13 -13
- 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 +24 -23
- package/Modal/index.mjs +23 -22
- package/NexusLayout/index.js +30 -30
- package/NexusLayout/index.mjs +32 -32
- package/Notification/index.js +1 -1
- package/Notification/index.mjs +1 -1
- package/Pagination/index.js +8 -8
- package/Pagination/index.mjs +8 -8
- package/PillGroup/index.js +15 -14
- package/PillGroup/index.mjs +23 -22
- package/ProductLayout/index.js +27 -26
- package/ProductLayout/index.mjs +26 -25
- package/Provider/index.js +2 -2
- package/Provider/index.mjs +2 -2
- package/RadioButtonGroup/index.js +5 -5
- package/RadioButtonGroup/index.mjs +8 -8
- package/RadioGroup/index.js +3 -332
- package/RadioGroup/index.mjs +3 -332
- package/RangeCalendar/index.js +1 -1
- package/RangeCalendar/index.mjs +1 -1
- package/SearchNav/index.js +50 -86
- package/SearchNav/index.mjs +50 -86
- package/SectionCard/index.js +7 -7
- package/SectionCard/index.mjs +7 -7
- package/Select/index.js +6 -6
- package/Select/index.mjs +6 -6
- 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 +4 -4
- package/TabPanels/index.mjs +7 -7
- 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 +2 -43
- package/TextField/index.mjs +2 -43
- 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/UnstyledButton/index.js +1 -1
- package/UnstyledButton/index.mjs +1 -1
- package/VerticalNav/index.js +25 -25
- package/VerticalNav/index.mjs +26 -26
- package/VerticalStack/index.js +1 -1
- package/VerticalStack/index.mjs +1 -1
- package/__chunks__/ArrowBack-BFS-tCpV.mjs +41 -0
- package/__chunks__/ArrowBack-C_LSatif.js +57 -0
- package/__chunks__/{Button-jgkOum0d.js → Button-BvLvcmfd.js} +6 -2
- package/__chunks__/{Button-DcYNVtp7.mjs → Button-CDRssWxC.mjs} +12 -8
- package/__chunks__/{Button-gxCTl22H.mjs → Button-D7ivIUf4.mjs} +18 -18
- package/__chunks__/{Button-BzB8v2mS.js → Button-Dcxti-xS.js} +18 -18
- package/__chunks__/{Calendar-BS8zgZK8.js → Calendar-D9bC6_UA.js} +1 -1
- package/__chunks__/{Calendar-C9hD67Rz.mjs → Calendar-WxiJzkoO.mjs} +2 -2
- package/__chunks__/{CalendarBase-saNix6u1.js → CalendarBase-BYEUj-DL.js} +21 -21
- package/__chunks__/{CalendarBase-4iGD1mPK.mjs → CalendarBase-B_2qDiO8.mjs} +28 -28
- package/__chunks__/{Card-DaFTIHZD.js → Card-B0ACXPm1.js} +12 -12
- package/__chunks__/{Card-Cr-bIjoN.mjs → Card-CwZYA0Rd.mjs} +12 -12
- package/__chunks__/{Checkbox-BY4UkCg7.js → Checkbox-CO5WIkp8.js} +21 -21
- package/__chunks__/{Checkbox-BR4RBHLp.mjs → Checkbox-DGX3jXaj.mjs} +24 -24
- package/__chunks__/{CodeSnippet-H-6ta_Y8.js → CodeSnippet-CY3KR9Ex.js} +2 -2
- package/__chunks__/{CodeSnippet-ChZIz_CO.mjs → CodeSnippet-DIWeGxFL.mjs} +2 -2
- package/__chunks__/{DatePickerBase-DlbnqBLN.mjs → DatePickerBase-BP_jPq4G.mjs} +31 -31
- package/__chunks__/{DatePickerBase-vorBKIfJ.js → DatePickerBase-C6kR9zvT.js} +20 -20
- package/__chunks__/{FocusScope-Co1hHX8R.js → FocusScope-DFE0IeGl.js} +1 -1
- package/__chunks__/{FocusScope-CjcZn1Rq.mjs → FocusScope-Qg8vUhZ_.mjs} +2 -2
- package/__chunks__/{HelpMenu-yEjZgR1V.mjs → HelpMenu-QryDILTE.mjs} +7 -7
- package/__chunks__/{HelpMenu-BzUSoyPi.js → HelpMenu-nmkAgUqs.js} +7 -7
- package/__chunks__/{HorizontalGrid-D4bJqbQV.mjs → HorizontalGrid-CX45xj2U.mjs} +1 -1
- package/__chunks__/{HorizontalGrid-Bhj16LbM.js → HorizontalGrid-cSfGLAIn.js} +1 -1
- package/__chunks__/{HorizontalStack-BDZp8p9E.mjs → HorizontalStack-CdtNq_TW.mjs} +1 -1
- package/__chunks__/{HorizontalStack-_DnrRlDb.js → HorizontalStack-D4ecxt6R.js} +1 -1
- package/__chunks__/{Icon-BdtOD2WX.mjs → Icon-BNi1LKXX.mjs} +2 -2
- package/__chunks__/{Icon-DJ8CpeVT.js → Icon-Pxk1cmPj.js} +2 -2
- package/__chunks__/{InputCaption-CEIuQ6BY.js → InputCaption-BzH_oClR.js} +2 -2
- package/__chunks__/{InputCaption-BBbxPdvJ.mjs → InputCaption-DaOqqN-Z.mjs} +2 -2
- package/__chunks__/{InputField-CPxOg_cd.mjs → InputField-0omK7H0I.mjs} +10 -10
- package/__chunks__/{InputField-BUU9HZ1I.js → InputField-Blilgkum.js} +6 -6
- package/__chunks__/{InputIcon-MHt_XLtO.mjs → InputIcon-CUhKpP7V.mjs} +31 -31
- package/__chunks__/{InputIcon-nUumrcJ5.js → InputIcon-DGOX-4el.js} +31 -31
- package/__chunks__/{KebabButton-BapJTvS6.mjs → KebabButton-CrkSDYoR.mjs} +5 -5
- package/__chunks__/{KebabButton-C3KI5LDA.js → KebabButton-DH5KZwlY.js} +5 -5
- package/__chunks__/{Menu-LzJveIa-.mjs → Menu-CbEch8RV.mjs} +22 -21
- package/__chunks__/{Menu-CkQaJJAH.js → Menu-D8tCyOf5.js} +19 -18
- package/__chunks__/{Notification-CAmvbAK1.mjs → Notification-BS8B_D0s.mjs} +20 -20
- package/__chunks__/{Notification-C5_bwXj4.js → Notification-COhKVqOV.js} +16 -16
- package/__chunks__/{Overlay-ZinDp2HW.js → Overlay-Dmwy9VjC.js} +59 -3
- package/__chunks__/{Overlay-d3z5W5Nn.mjs → Overlay-DyfvFsGi.mjs} +63 -7
- package/__chunks__/RadioGroup-CCObCqda.js +333 -0
- package/__chunks__/RadioGroup-DZxaIqD6.mjs +334 -0
- package/__chunks__/{RangeCalendar-Bhk32GB_.mjs → RangeCalendar-CPEW2_Ij.mjs} +3 -3
- package/__chunks__/{RangeCalendar-5enltd2P.js → RangeCalendar-V_YZXfhI.js} +1 -1
- package/__chunks__/Search-BY7IgEyX.js +57 -0
- package/__chunks__/Search-Cyblmqo5.mjs +41 -0
- package/__chunks__/{SelectOverlay-DKJvzJJ7.js → SelectOverlay-CvCbJFfX.js} +25 -25
- package/__chunks__/{SelectOverlay-MLWWpDpl.mjs → SelectOverlay-DdC6a9yW.mjs} +34 -34
- package/__chunks__/{SelectorErrorTooltip-DowQ2whn.js → SelectorErrorTooltip-BK76kp1j.js} +4 -4
- package/__chunks__/{SelectorErrorTooltip-DLyZgeUf.mjs → SelectorErrorTooltip-Cja4A8Yq.mjs} +4 -4
- package/__chunks__/{Spinner-BFydR08g.js → Spinner-BOumHc9g.js} +5 -5
- package/__chunks__/{Spinner-hJoFNoHJ.mjs → Spinner-D5Cnx9wv.mjs} +8 -8
- package/__chunks__/{Stepper-BY8zQdW2.mjs → Stepper-B4VoJaxe.mjs} +28 -28
- package/__chunks__/{Stepper-CxWpMLEW.js → Stepper-CZsNTl_A.js} +26 -26
- package/__chunks__/{TabNav-burpvHrg.mjs → TabNav-C0dTC1c_.mjs} +1 -1
- package/__chunks__/{TabNav-1cTg6TWo.js → TabNav-DFFWhGpM.js} +1 -1
- package/__chunks__/{Tabs-DHXJckwb.js → Tabs-DbfPjHiY.js} +17 -17
- package/__chunks__/{Tabs-BzZ9w82m.mjs → Tabs-MBY9JDS4.mjs} +19 -19
- package/__chunks__/{Text-Dfbyoxsz.js → Text-Bbhl1fdd.js} +34 -34
- package/__chunks__/{Text-CQ_8wg0t.mjs → Text-tpkE6IlH.mjs} +34 -34
- package/__chunks__/TextField-B57OAIEI.mjs +45 -0
- package/__chunks__/TextField-Mi3s9lvx.js +44 -0
- package/__chunks__/{Toggle-BiaALtul.mjs → Toggle-CHcQwbtX.mjs} +14 -14
- package/__chunks__/{Toggle-CYKsPbEK.js → Toggle-Ctc8EPUL.js} +12 -12
- package/__chunks__/{Tooltip-Bzqm5boz.js → Tooltip-Cf1iqjg9.js} +11 -11
- package/__chunks__/{Tooltip-5ZgKkdk8.mjs → Tooltip-DdaxfuX_.mjs} +13 -13
- package/__chunks__/{UnstyledButton-BlB066YT.mjs → UnstyledButton-CrSLb-W8.mjs} +2 -2
- package/__chunks__/{UnstyledButton-Dn8KZHdh.js → UnstyledButton-DfjYrePV.js} +1 -1
- package/__chunks__/{VerticalStack-_gyNJbOa.js → VerticalStack-BkqSVZuy.js} +3 -3
- package/__chunks__/{VerticalStack-eKUWFHU3.mjs → VerticalStack-CeDKl8Ee.mjs} +3 -3
- package/__chunks__/{VisuallyHidden-DmDK0fH3.mjs → VisuallyHidden-BC5PXI9q.mjs} +2 -2
- package/__chunks__/{ariaHideOutside-a1MUBVQF.js → ariaHideOutside-B6WqGXJj.js} +1 -1
- package/__chunks__/{ariaHideOutside-B-UoCW1g.mjs → ariaHideOutside-CxWZQtI1.mjs} +3 -3
- package/__chunks__/{context-DEwqildc.mjs → context-BZCcafjG.mjs} +1 -1
- package/__chunks__/{context-C6CFGY_J.js → context-CYcq9Zvo.js} +12 -0
- package/__chunks__/{context-CgOWZch5.mjs → context-EpOG85wC.mjs} +13 -1
- package/__chunks__/{focusSafely-DcMa3q3g.mjs → focusSafely-BWGCG3W3.mjs} +2 -2
- package/__chunks__/{focusSafely-sLifanM7.js → focusSafely-BvrXUhlW.js} +1 -1
- package/__chunks__/{mergeProps-T961Q1yJ.mjs → mergeProps-DSi85raC.mjs} +4 -4
- package/__chunks__/{scrollIntoView-GfnXaOCE.mjs → scrollIntoView-CZM0k-rp.mjs} +1 -1
- package/__chunks__/{useButton-BoMy_zYC.mjs → useButton-BK6hwK02.mjs} +3 -3
- package/__chunks__/{useButton-DvulUoU2.js → useButton-DZ0C3d-K.js} +2 -2
- package/__chunks__/{useCollator-DXoNI6C-.mjs → useCollator-B-keb3wA.mjs} +1 -1
- package/__chunks__/{useDialog-o0QWfg2a.mjs → useDialog-c-C07qhw.mjs} +5 -29
- package/__chunks__/{useDialog-DILXRLSs.js → useDialog-wy_ru95P.js} +3 -27
- package/__chunks__/{useEdgeInterceptors-DfiAHAYW.js → useEdgeInterceptors-CnwnUfBU.js} +5 -5
- package/__chunks__/{useEdgeInterceptors-wWqxCUZX.mjs → useEdgeInterceptors-ax9tmtdh.mjs} +5 -5
- package/__chunks__/{useEvent-C5RCZjKr.mjs → useEvent-B0fsKtsf.mjs} +1 -1
- package/__chunks__/{useField-DWmSslhe.mjs → useField-B6VplZ_n.mjs} +2 -2
- package/__chunks__/{useFocus-BEhCbr7O.mjs → useFocus-BJ7JikEx.mjs} +1 -1
- package/__chunks__/{useFocusRing-BUwbt1Yv.mjs → useFocusRing-YOWeCHgO.mjs} +3 -3
- package/__chunks__/{useFocusVisible-8tH_I2iV.mjs → useFocusVisible-ng1Hn25t.mjs} +1 -1
- package/__chunks__/{useFocusWithin-CfhMwfXS.mjs → useFocusWithin-B-vQAW9V.mjs} +1 -1
- package/__chunks__/{useFocusable-BfXLORiH.js → useFocusable-8kJcp2yc.js} +5 -5
- package/__chunks__/{useFocusable-DoNt-Wd3.mjs → useFocusable-CNor_Zjt.mjs} +4 -4
- package/__chunks__/{useFormReset-CmXMJVpO.mjs → useFormReset-DA1Lwdha.mjs} +1 -1
- package/__chunks__/{useFormValidation-D5Y_7NR2.mjs → useFormValidation-v2O6VL2V.mjs} +2 -2
- package/__chunks__/{useHasTabbableChild-DUcbkV37.mjs → useHasTabbableChild-BKgmY6ej.mjs} +2 -2
- package/__chunks__/{useHasTabbableChild-C34XhtMr.js → useHasTabbableChild-Cs10TUUE.js} +1 -1
- package/__chunks__/{useHighlightSelectionDescription-DWm7Wr6h.mjs → useHighlightSelectionDescription-Cebr-N8X.mjs} +3 -3
- package/__chunks__/{useLabel-C0Q8946u.mjs → useLabel-D37VV43W.mjs} +2 -2
- package/__chunks__/{useLabels-Bly436JP.mjs → useLabels-5f58TiCH.mjs} +1 -1
- package/__chunks__/{useLink-BOdtE_Mk.js → useLink-DSnaSTQf.js} +2 -2
- package/__chunks__/{useLink-B_g4ae9e.mjs → useLink-xdTgcuUM.mjs} +3 -3
- package/__chunks__/{useLocalizedStringFormatter-CLrYoOi9.mjs → useLocalizedStringFormatter-BHXy3Wtu.mjs} +1 -1
- package/__chunks__/useModalOverlay-BljLSPJ0.js +47 -0
- package/__chunks__/useModalOverlay-S0R2uVTX.mjs +48 -0
- package/__chunks__/useObjectRef-BOGMJ5vM.js +18 -0
- package/__chunks__/useObjectRef-wU82Pkgx.mjs +19 -0
- package/__chunks__/{useOverlayPosition-B_X4JGFp.mjs → useOverlayPosition-BjK7cu6U.mjs} +3 -3
- package/__chunks__/{useOverlayPosition-ucZjuzzI.js → useOverlayPosition-CMvGmqVL.js} +1 -1
- package/__chunks__/{useOverlayTrigger-Do68TGFi.mjs → useOverlayTrigger-DDcXdZOM.mjs} +2 -2
- package/__chunks__/{useOverlayTrigger-MyMg5wFE.js → useOverlayTrigger-Dp7RXQ9B.js} +1 -1
- package/__chunks__/{usePress-Dz8YYpge.js → usePress-DNETV97g.js} +2 -3
- package/__chunks__/{usePress-BAsZaqDB.mjs → usePress-Db4pSZfY.mjs} +2 -3
- package/__chunks__/{useSelectableItem-DL-4kc1g.mjs → useSelectableItem-D61t76J1.mjs} +9 -9
- package/__chunks__/{useSelectableItem-BGvBbIwY.js → useSelectableItem-DpEX9QBc.js} +4 -4
- package/__chunks__/{useSelectableList-BQ06AmlV.mjs → useSelectableList-BdG5I7cy.mjs} +2 -2
- package/__chunks__/{useSelectableList-F8fB4Dtg.js → useSelectableList-UkBCcTuC.js} +1 -1
- package/__chunks__/{useToggle-CU6aSiOx.mjs → useToggle-BDx-p-Zv.mjs} +4 -4
- package/__chunks__/{useToggle-D7gzXCXF.js → useToggle-BfpHeO2F.js} +2 -2
- package/__chunks__/{useTriggerWidth-DA668KiC.mjs → useTriggerWidth-CRz8zSDa.mjs} +4 -4
- package/__chunks__/{useTriggerWidth-ROE4ZhGv.js → useTriggerWidth-Dj7C0lza.js} +2 -2
- package/__chunks__/{utilities-DKvHenAr.js → utilities-CaBPUKEB.js} +2 -2
- package/__chunks__/{utilities-DmLL16up.mjs → utilities-DASknbaa.mjs} +6 -6
- package/__chunks__/{utils-XuD3IFpv.mjs → utils-D4ddhsBL.mjs} +58 -21
- package/__chunks__/{utils-DXO9zsKE.js → utils-DIF5XAA2.js} +55 -18
- package/package.json +1 -1
- package/style.css +1646 -1575
- package/__chunks__/useSyncRef-CPg4onT-.js +0 -13
- package/__chunks__/useSyncRef-CpaiKz0R.mjs +0 -14
package/RadioGroup/index.js
CHANGED
|
@@ -1,334 +1,5 @@
|
|
|
1
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
|
-
var __objRest = (source, exclude) => {
|
|
22
|
-
var target = {};
|
|
23
|
-
for (var prop in source)
|
|
24
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
-
target[prop] = source[prop];
|
|
26
|
-
if (source != null && __getOwnPropSymbols)
|
|
27
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
}
|
|
31
|
-
return target;
|
|
32
|
-
};
|
|
33
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const SelectorErrorTooltip = require("../__chunks__/SelectorErrorTooltip-DowQ2whn.js");
|
|
38
|
-
const utilities_css = require("../utilities/css.js");
|
|
39
|
-
const mergeProps = require("../__chunks__/mergeProps-DniMwM6P.js");
|
|
40
|
-
const filterDOMProps = require("../__chunks__/filterDOMProps-D3iOHP0H.js");
|
|
41
|
-
const useFormReset = require("../__chunks__/useFormReset-Bgj93eR3.js");
|
|
42
|
-
const useFocusable = require("../__chunks__/useFocusable-BfXLORiH.js");
|
|
43
|
-
const useFormValidation = require("../__chunks__/useFormValidation-DYz5WFze.js");
|
|
44
|
-
const usePress = require("../__chunks__/usePress-Dz8YYpge.js");
|
|
45
|
-
const useFocusRing = require("../__chunks__/useFocusRing-DFRFvht_.js");
|
|
46
|
-
const useHover = require("../__chunks__/useHover-BIKwjrCT.js");
|
|
47
|
-
const useControlledState = require("../__chunks__/useControlledState-mnKBd6Uc.js");
|
|
48
|
-
const FocusScope = require("../__chunks__/FocusScope-Co1hHX8R.js");
|
|
49
|
-
const useField = require("../__chunks__/useField-BJW_bXVD.js");
|
|
50
|
-
const useFocusWithin = require("../__chunks__/useFocusWithin-C1ioGWec.js");
|
|
51
|
-
const context = require("../__chunks__/context-D3NeXov7.js");
|
|
52
|
-
let $a54cdc5c1942b639$var$instance = Math.round(Math.random() * 1e10);
|
|
53
|
-
let $a54cdc5c1942b639$var$i = 0;
|
|
54
|
-
function $a54cdc5c1942b639$export$bca9d026f8e704eb(props) {
|
|
55
|
-
let name = React.useMemo(() => props.name || `radio-group-${$a54cdc5c1942b639$var$instance}-${++$a54cdc5c1942b639$var$i}`, [
|
|
56
|
-
props.name
|
|
57
|
-
]);
|
|
58
|
-
var _props_defaultValue;
|
|
59
|
-
let [selectedValue, setSelected] = useControlledState.$458b0a5536c1a7cf$export$40bfa8c7b0832715(props.value, (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !== void 0 ? _props_defaultValue : null, props.onChange);
|
|
60
|
-
let [lastFocusedValue, setLastFocusedValue] = React.useState(null);
|
|
61
|
-
let validation = useFormValidation.$e5be200c675c3b3a$export$fc1a364ae1f3ff10(__spreadProps(__spreadValues({}, props), {
|
|
62
|
-
value: selectedValue
|
|
63
|
-
}));
|
|
64
|
-
let setSelectedValue = (value) => {
|
|
65
|
-
if (!props.isReadOnly && !props.isDisabled) {
|
|
66
|
-
setSelected(value);
|
|
67
|
-
validation.commitValidation();
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
let isInvalid = validation.displayValidation.isInvalid;
|
|
71
|
-
return __spreadProps(__spreadValues({}, validation), {
|
|
72
|
-
name,
|
|
73
|
-
selectedValue,
|
|
74
|
-
setSelectedValue,
|
|
75
|
-
lastFocusedValue,
|
|
76
|
-
setLastFocusedValue,
|
|
77
|
-
isDisabled: props.isDisabled || false,
|
|
78
|
-
isReadOnly: props.isReadOnly || false,
|
|
79
|
-
isRequired: props.isRequired || false,
|
|
80
|
-
validationState: props.validationState || (isInvalid ? "invalid" : null),
|
|
81
|
-
isInvalid
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
const $884aeceb3d67f00f$export$37b65e5b5444d35c = /* @__PURE__ */ new WeakMap();
|
|
85
|
-
function $0d5c49892c1215da$export$37b0961d2f4751e2(props, state, ref) {
|
|
86
|
-
let { value, children, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby } = props;
|
|
87
|
-
const isDisabled = props.isDisabled || state.isDisabled;
|
|
88
|
-
let hasChildren = children != null;
|
|
89
|
-
let hasAriaLabel = ariaLabel != null || ariaLabelledby != null;
|
|
90
|
-
if (!hasChildren && !hasAriaLabel) console.warn("If you do not provide children, you must specify an aria-label for accessibility");
|
|
91
|
-
let checked = state.selectedValue === value;
|
|
92
|
-
let onChange = (e) => {
|
|
93
|
-
e.stopPropagation();
|
|
94
|
-
state.setSelectedValue(value);
|
|
95
|
-
};
|
|
96
|
-
let { pressProps, isPressed } = usePress.$f6c31cce2adf654f$export$45712eceda6fad21({
|
|
97
|
-
isDisabled
|
|
98
|
-
});
|
|
99
|
-
let { pressProps: labelProps, isPressed: isLabelPressed } = usePress.$f6c31cce2adf654f$export$45712eceda6fad21({
|
|
100
|
-
isDisabled,
|
|
101
|
-
onPress() {
|
|
102
|
-
state.setSelectedValue(value);
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
let { focusableProps } = useFocusable.$e6afbd83fe6ebbd2$export$4c014de7c8940b4c(mergeProps.$3ef42575df84b30b$export$9d1611c77c2fe928(props, {
|
|
106
|
-
onFocus: () => state.setLastFocusedValue(value)
|
|
107
|
-
}), ref);
|
|
108
|
-
let interactions = mergeProps.$3ef42575df84b30b$export$9d1611c77c2fe928(pressProps, focusableProps);
|
|
109
|
-
let domProps = filterDOMProps.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
110
|
-
labelable: true
|
|
111
|
-
});
|
|
112
|
-
let tabIndex = -1;
|
|
113
|
-
if (state.selectedValue != null) {
|
|
114
|
-
if (state.selectedValue === value) tabIndex = 0;
|
|
115
|
-
} else if (state.lastFocusedValue === value || state.lastFocusedValue == null) tabIndex = 0;
|
|
116
|
-
if (isDisabled) tabIndex = void 0;
|
|
117
|
-
let { name, descriptionId, errorMessageId, validationBehavior } = $884aeceb3d67f00f$export$37b65e5b5444d35c.get(state);
|
|
118
|
-
useFormReset.$99facab73266f662$export$5add1d006293d136(ref, state.selectedValue, state.setSelectedValue);
|
|
119
|
-
useFormValidation.$e93e671b31057976$export$b8473d3665f3a75a({
|
|
120
|
-
validationBehavior
|
|
121
|
-
}, state, ref);
|
|
122
|
-
return {
|
|
123
|
-
labelProps: mergeProps.$3ef42575df84b30b$export$9d1611c77c2fe928(labelProps, {
|
|
124
|
-
onClick: (e) => e.preventDefault()
|
|
125
|
-
}),
|
|
126
|
-
inputProps: mergeProps.$3ef42575df84b30b$export$9d1611c77c2fe928(domProps, __spreadProps(__spreadValues({}, interactions), {
|
|
127
|
-
type: "radio",
|
|
128
|
-
name,
|
|
129
|
-
tabIndex,
|
|
130
|
-
disabled: isDisabled,
|
|
131
|
-
required: state.isRequired && validationBehavior === "native",
|
|
132
|
-
checked,
|
|
133
|
-
value,
|
|
134
|
-
onChange,
|
|
135
|
-
"aria-describedby": [
|
|
136
|
-
props["aria-describedby"],
|
|
137
|
-
state.isInvalid ? errorMessageId : null,
|
|
138
|
-
descriptionId
|
|
139
|
-
].filter(Boolean).join(" ") || void 0
|
|
140
|
-
})),
|
|
141
|
-
isDisabled,
|
|
142
|
-
isSelected: checked,
|
|
143
|
-
isPressed: isPressed || isLabelPressed
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
function $430f30ed08ec25fa$export$62b9571f283ff5c2(props, state) {
|
|
147
|
-
let { name, isReadOnly, isRequired, isDisabled, orientation = "vertical", validationBehavior = "aria" } = props;
|
|
148
|
-
let { direction } = context.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
|
|
149
|
-
let { isInvalid, validationErrors, validationDetails } = state.displayValidation;
|
|
150
|
-
let { labelProps, fieldProps, descriptionProps, errorMessageProps } = useField.$2baaea4c71418dea$export$294aa081a6c6f55d(__spreadProps(__spreadValues({}, props), {
|
|
151
|
-
// Radio group is not an HTML input element so it
|
|
152
|
-
// shouldn't be labeled by a <label> element.
|
|
153
|
-
labelElementType: "span",
|
|
154
|
-
isInvalid: state.isInvalid,
|
|
155
|
-
errorMessage: props.errorMessage || validationErrors
|
|
156
|
-
}));
|
|
157
|
-
let domProps = filterDOMProps.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
158
|
-
labelable: true
|
|
159
|
-
});
|
|
160
|
-
let { focusWithinProps } = useFocusWithin.$9ab94262bd0047c7$export$420e68273165f4ec({
|
|
161
|
-
onBlurWithin(e) {
|
|
162
|
-
var _props_onBlur;
|
|
163
|
-
(_props_onBlur = props.onBlur) === null || _props_onBlur === void 0 ? void 0 : _props_onBlur.call(props, e);
|
|
164
|
-
if (!state.selectedValue) state.setLastFocusedValue(null);
|
|
165
|
-
},
|
|
166
|
-
onFocusWithin: props.onFocus,
|
|
167
|
-
onFocusWithinChange: props.onFocusChange
|
|
168
|
-
});
|
|
169
|
-
let onKeyDown = (e) => {
|
|
170
|
-
let nextDir;
|
|
171
|
-
switch (e.key) {
|
|
172
|
-
case "ArrowRight":
|
|
173
|
-
if (direction === "rtl" && orientation !== "vertical") nextDir = "prev";
|
|
174
|
-
else nextDir = "next";
|
|
175
|
-
break;
|
|
176
|
-
case "ArrowLeft":
|
|
177
|
-
if (direction === "rtl" && orientation !== "vertical") nextDir = "next";
|
|
178
|
-
else nextDir = "prev";
|
|
179
|
-
break;
|
|
180
|
-
case "ArrowDown":
|
|
181
|
-
nextDir = "next";
|
|
182
|
-
break;
|
|
183
|
-
case "ArrowUp":
|
|
184
|
-
nextDir = "prev";
|
|
185
|
-
break;
|
|
186
|
-
default:
|
|
187
|
-
return;
|
|
188
|
-
}
|
|
189
|
-
e.preventDefault();
|
|
190
|
-
let walker = FocusScope.$9bf71ea28793e738$export$2d6ec8fc375ceafa(e.currentTarget, {
|
|
191
|
-
from: e.target
|
|
192
|
-
});
|
|
193
|
-
let nextElem;
|
|
194
|
-
if (nextDir === "next") {
|
|
195
|
-
nextElem = walker.nextNode();
|
|
196
|
-
if (!nextElem) {
|
|
197
|
-
walker.currentNode = e.currentTarget;
|
|
198
|
-
nextElem = walker.firstChild();
|
|
199
|
-
}
|
|
200
|
-
} else {
|
|
201
|
-
nextElem = walker.previousNode();
|
|
202
|
-
if (!nextElem) {
|
|
203
|
-
walker.currentNode = e.currentTarget;
|
|
204
|
-
nextElem = walker.lastChild();
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
if (nextElem) {
|
|
208
|
-
nextElem.focus();
|
|
209
|
-
state.setSelectedValue(nextElem.value);
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
let groupName = mergeProps.$bdb11010cef70236$export$f680877a34711e37(name);
|
|
213
|
-
$884aeceb3d67f00f$export$37b65e5b5444d35c.set(state, {
|
|
214
|
-
name: groupName,
|
|
215
|
-
descriptionId: descriptionProps.id,
|
|
216
|
-
errorMessageId: errorMessageProps.id,
|
|
217
|
-
validationBehavior
|
|
218
|
-
});
|
|
219
|
-
return {
|
|
220
|
-
radioGroupProps: mergeProps.$3ef42575df84b30b$export$9d1611c77c2fe928(domProps, __spreadValues(__spreadValues({
|
|
221
|
-
// https://www.w3.org/TR/wai-aria-1.2/#radiogroup
|
|
222
|
-
role: "radiogroup",
|
|
223
|
-
onKeyDown,
|
|
224
|
-
"aria-invalid": state.isInvalid || void 0,
|
|
225
|
-
"aria-errormessage": props["aria-errormessage"],
|
|
226
|
-
"aria-readonly": isReadOnly || void 0,
|
|
227
|
-
"aria-required": isRequired || void 0,
|
|
228
|
-
"aria-disabled": isDisabled || void 0,
|
|
229
|
-
"aria-orientation": orientation
|
|
230
|
-
}, fieldProps), focusWithinProps)),
|
|
231
|
-
labelProps,
|
|
232
|
-
descriptionProps,
|
|
233
|
-
errorMessageProps,
|
|
234
|
-
isInvalid,
|
|
235
|
-
validationErrors,
|
|
236
|
-
validationDetails
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
const RadioGroupContext = React.createContext(null);
|
|
240
|
-
const useRadioGroupContext = () => {
|
|
241
|
-
const radioGroupContext = React.useContext(RadioGroupContext);
|
|
242
|
-
if (!radioGroupContext) {
|
|
243
|
-
throw new Error("Must be within a RadioGroup");
|
|
244
|
-
}
|
|
245
|
-
return radioGroupContext;
|
|
246
|
-
};
|
|
247
|
-
const RadioGroupItem$1 = "_RadioGroupItem_1eiq3_5";
|
|
248
|
-
const label = "_label_1eiq3_11";
|
|
249
|
-
const radioOuter = "_radioOuter_1eiq3_29";
|
|
250
|
-
const radioInner = "_radioInner_1eiq3_30";
|
|
251
|
-
const focusVisible = "_focusVisible_1eiq3_44";
|
|
252
|
-
const selected = "_selected_1eiq3_63";
|
|
253
|
-
const invalid = "_invalid_1eiq3_67";
|
|
254
|
-
const disabled = "_disabled_1eiq3_71";
|
|
255
|
-
const hovered = "_hovered_1eiq3_83";
|
|
256
|
-
const readOnly = "_readOnly_1eiq3_83";
|
|
257
|
-
const styles$1 = {
|
|
258
|
-
RadioGroupItem: RadioGroupItem$1,
|
|
259
|
-
label,
|
|
260
|
-
radioOuter,
|
|
261
|
-
radioInner,
|
|
262
|
-
focusVisible,
|
|
263
|
-
selected,
|
|
264
|
-
invalid,
|
|
265
|
-
disabled,
|
|
266
|
-
hovered,
|
|
267
|
-
readOnly
|
|
268
|
-
};
|
|
269
|
-
function RadioGroupItem(props) {
|
|
270
|
-
const { children, errorText, validationState } = props;
|
|
271
|
-
const ref = React.useRef(null);
|
|
272
|
-
const state = useRadioGroupContext();
|
|
273
|
-
const { inputProps, isSelected, isDisabled } = $0d5c49892c1215da$export$37b0961d2f4751e2(props, state, ref);
|
|
274
|
-
const { isFocusVisible, focusProps } = useFocusRing.$f7dceffc5ad7768b$export$4e328f61c538687f();
|
|
275
|
-
const { isHovered, hoverProps } = useHover.$6179b936705e76d3$export$ae780daf29e6d456(props);
|
|
276
|
-
const className = utilities_css.classNames(styles$1.RadioGroupItem, isSelected && styles$1.selected, isDisabled && styles$1.disabled, isFocusVisible && styles$1.focusVisible, isHovered && styles$1.hovered, validationState === "invalid" && styles$1.invalid);
|
|
277
|
-
const textColor = isDisabled ? "neutral.300" : validationState === "invalid" ? "negative.600" : "primary.800";
|
|
278
|
-
return React.createElement("div", {
|
|
279
|
-
className
|
|
280
|
-
}, React.createElement(HorizontalStack.HorizontalStack, {
|
|
281
|
-
gap: "1",
|
|
282
|
-
blockAlign: "center"
|
|
283
|
-
}, React.createElement("label", {
|
|
284
|
-
className: styles$1.label
|
|
285
|
-
}, React.createElement(HorizontalStack.HorizontalStack, __spreadValues({
|
|
286
|
-
blockAlign: "start",
|
|
287
|
-
gap: "1",
|
|
288
|
-
wrap: false
|
|
289
|
-
}, hoverProps), React.createElement("input", __spreadProps(__spreadValues(__spreadValues({
|
|
290
|
-
"aria-invalid": validationState === "invalid"
|
|
291
|
-
}, inputProps), focusProps), {
|
|
292
|
-
className: styles$1.input,
|
|
293
|
-
ref
|
|
294
|
-
})), React.createElement("span", {
|
|
295
|
-
className: styles$1.radioOuter
|
|
296
|
-
}, React.createElement("span", {
|
|
297
|
-
className: styles$1.radioInner
|
|
298
|
-
})), React.createElement(Text.Text, {
|
|
299
|
-
variant: "body1",
|
|
300
|
-
color: textColor
|
|
301
|
-
}, children))), validationState === "invalid" && errorText && React.createElement(SelectorErrorTooltip.SelectorErrorTooltip, {
|
|
302
|
-
content: errorText
|
|
303
|
-
})));
|
|
304
|
-
}
|
|
305
|
-
const RadioGroup$1 = "_RadioGroup_zx68y_5";
|
|
306
|
-
const list = "_list_zx68y_14";
|
|
307
|
-
const styles = {
|
|
308
|
-
RadioGroup: RadioGroup$1,
|
|
309
|
-
list
|
|
310
|
-
};
|
|
311
|
-
function RadioGroupContainer(props) {
|
|
312
|
-
const { children, label: label2 } = props;
|
|
313
|
-
const state = $a54cdc5c1942b639$export$bca9d026f8e704eb(props);
|
|
314
|
-
const { radioGroupProps, labelProps } = $430f30ed08ec25fa$export$62b9571f283ff5c2(props, state);
|
|
315
|
-
return React.createElement("fieldset", __spreadValues({
|
|
316
|
-
className: styles.RadioGroup
|
|
317
|
-
}, radioGroupProps), label2 && React.createElement("div", null, React.createElement(Text.Text, __spreadValues({
|
|
318
|
-
as: "legend",
|
|
319
|
-
variant: "subtitle1",
|
|
320
|
-
color: "gray.bold"
|
|
321
|
-
}, labelProps), label2)), React.createElement(RadioGroupContext.Provider, {
|
|
322
|
-
value: state
|
|
323
|
-
}, children));
|
|
324
|
-
}
|
|
325
|
-
function RadioGroup(props) {
|
|
326
|
-
const _a = props, { children } = _a, containerProps = __objRest(_a, ["children"]);
|
|
327
|
-
return React.createElement(RadioGroupContainer, __spreadValues({}, containerProps), React.createElement("div", {
|
|
328
|
-
className: styles.list
|
|
329
|
-
}, children));
|
|
330
|
-
}
|
|
331
|
-
RadioGroup.Container = RadioGroupContainer;
|
|
332
|
-
RadioGroup.Item = RadioGroupItem;
|
|
333
|
-
exports.RadioGroup = RadioGroup;
|
|
334
|
-
exports.useRadioGroupContext = useRadioGroupContext;
|
|
3
|
+
const RadioGroup = require("../__chunks__/RadioGroup-CCObCqda.js");
|
|
4
|
+
exports.RadioGroup = RadioGroup.RadioGroup;
|
|
5
|
+
exports.useRadioGroupContext = RadioGroup.useRadioGroupContext;
|
package/RadioGroup/index.mjs
CHANGED
|
@@ -1,334 +1,5 @@
|
|
|
1
|
-
|
|
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
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
import React__default, { useMemo, useState, useContext } from "react";
|
|
33
|
-
import { T as Text } from "../__chunks__/Text-CQ_8wg0t.mjs";
|
|
34
|
-
import { H as HorizontalStack } from "../__chunks__/HorizontalStack-BDZp8p9E.mjs";
|
|
35
|
-
import { S as SelectorErrorTooltip } from "../__chunks__/SelectorErrorTooltip-DLyZgeUf.mjs";
|
|
36
|
-
import { classNames } from "../utilities/css.mjs";
|
|
37
|
-
import { $ as $3ef42575df84b30b$export$9d1611c77c2fe928, d as $bdb11010cef70236$export$f680877a34711e37 } from "../__chunks__/mergeProps-T961Q1yJ.mjs";
|
|
38
|
-
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../__chunks__/filterDOMProps-EDDcM64A.mjs";
|
|
39
|
-
import { $ as $99facab73266f662$export$5add1d006293d136 } from "../__chunks__/useFormReset-CmXMJVpO.mjs";
|
|
40
|
-
import { $ as $e6afbd83fe6ebbd2$export$4c014de7c8940b4c } from "../__chunks__/useFocusable-DoNt-Wd3.mjs";
|
|
41
|
-
import { $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10, d as $e93e671b31057976$export$b8473d3665f3a75a } from "../__chunks__/useFormValidation-D5Y_7NR2.mjs";
|
|
42
|
-
import { $ as $f6c31cce2adf654f$export$45712eceda6fad21 } from "../__chunks__/usePress-BAsZaqDB.mjs";
|
|
43
|
-
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../__chunks__/useFocusRing-BUwbt1Yv.mjs";
|
|
44
|
-
import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../__chunks__/useHover-BOYR4wqI.mjs";
|
|
45
|
-
import { $ as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "../__chunks__/useControlledState-CFWhSD5C.mjs";
|
|
46
|
-
import { $ as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "../__chunks__/FocusScope-CjcZn1Rq.mjs";
|
|
47
|
-
import { $ as $2baaea4c71418dea$export$294aa081a6c6f55d } from "../__chunks__/useField-DWmSslhe.mjs";
|
|
48
|
-
import { $ as $9ab94262bd0047c7$export$420e68273165f4ec } from "../__chunks__/useFocusWithin-CfhMwfXS.mjs";
|
|
49
|
-
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../__chunks__/context-DEwqildc.mjs";
|
|
50
|
-
let $a54cdc5c1942b639$var$instance = Math.round(Math.random() * 1e10);
|
|
51
|
-
let $a54cdc5c1942b639$var$i = 0;
|
|
52
|
-
function $a54cdc5c1942b639$export$bca9d026f8e704eb(props) {
|
|
53
|
-
let name = useMemo(() => props.name || `radio-group-${$a54cdc5c1942b639$var$instance}-${++$a54cdc5c1942b639$var$i}`, [
|
|
54
|
-
props.name
|
|
55
|
-
]);
|
|
56
|
-
var _props_defaultValue;
|
|
57
|
-
let [selectedValue, setSelected] = $458b0a5536c1a7cf$export$40bfa8c7b0832715(props.value, (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !== void 0 ? _props_defaultValue : null, props.onChange);
|
|
58
|
-
let [lastFocusedValue, setLastFocusedValue] = useState(null);
|
|
59
|
-
let validation = $e5be200c675c3b3a$export$fc1a364ae1f3ff10(__spreadProps(__spreadValues({}, props), {
|
|
60
|
-
value: selectedValue
|
|
61
|
-
}));
|
|
62
|
-
let setSelectedValue = (value) => {
|
|
63
|
-
if (!props.isReadOnly && !props.isDisabled) {
|
|
64
|
-
setSelected(value);
|
|
65
|
-
validation.commitValidation();
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
let isInvalid = validation.displayValidation.isInvalid;
|
|
69
|
-
return __spreadProps(__spreadValues({}, validation), {
|
|
70
|
-
name,
|
|
71
|
-
selectedValue,
|
|
72
|
-
setSelectedValue,
|
|
73
|
-
lastFocusedValue,
|
|
74
|
-
setLastFocusedValue,
|
|
75
|
-
isDisabled: props.isDisabled || false,
|
|
76
|
-
isReadOnly: props.isReadOnly || false,
|
|
77
|
-
isRequired: props.isRequired || false,
|
|
78
|
-
validationState: props.validationState || (isInvalid ? "invalid" : null),
|
|
79
|
-
isInvalid
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
const $884aeceb3d67f00f$export$37b65e5b5444d35c = /* @__PURE__ */ new WeakMap();
|
|
83
|
-
function $0d5c49892c1215da$export$37b0961d2f4751e2(props, state, ref) {
|
|
84
|
-
let { value, children, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby } = props;
|
|
85
|
-
const isDisabled = props.isDisabled || state.isDisabled;
|
|
86
|
-
let hasChildren = children != null;
|
|
87
|
-
let hasAriaLabel = ariaLabel != null || ariaLabelledby != null;
|
|
88
|
-
if (!hasChildren && !hasAriaLabel) console.warn("If you do not provide children, you must specify an aria-label for accessibility");
|
|
89
|
-
let checked = state.selectedValue === value;
|
|
90
|
-
let onChange = (e) => {
|
|
91
|
-
e.stopPropagation();
|
|
92
|
-
state.setSelectedValue(value);
|
|
93
|
-
};
|
|
94
|
-
let { pressProps, isPressed } = $f6c31cce2adf654f$export$45712eceda6fad21({
|
|
95
|
-
isDisabled
|
|
96
|
-
});
|
|
97
|
-
let { pressProps: labelProps, isPressed: isLabelPressed } = $f6c31cce2adf654f$export$45712eceda6fad21({
|
|
98
|
-
isDisabled,
|
|
99
|
-
onPress() {
|
|
100
|
-
state.setSelectedValue(value);
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
let { focusableProps } = $e6afbd83fe6ebbd2$export$4c014de7c8940b4c($3ef42575df84b30b$export$9d1611c77c2fe928(props, {
|
|
104
|
-
onFocus: () => state.setLastFocusedValue(value)
|
|
105
|
-
}), ref);
|
|
106
|
-
let interactions = $3ef42575df84b30b$export$9d1611c77c2fe928(pressProps, focusableProps);
|
|
107
|
-
let domProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
108
|
-
labelable: true
|
|
109
|
-
});
|
|
110
|
-
let tabIndex = -1;
|
|
111
|
-
if (state.selectedValue != null) {
|
|
112
|
-
if (state.selectedValue === value) tabIndex = 0;
|
|
113
|
-
} else if (state.lastFocusedValue === value || state.lastFocusedValue == null) tabIndex = 0;
|
|
114
|
-
if (isDisabled) tabIndex = void 0;
|
|
115
|
-
let { name, descriptionId, errorMessageId, validationBehavior } = $884aeceb3d67f00f$export$37b65e5b5444d35c.get(state);
|
|
116
|
-
$99facab73266f662$export$5add1d006293d136(ref, state.selectedValue, state.setSelectedValue);
|
|
117
|
-
$e93e671b31057976$export$b8473d3665f3a75a({
|
|
118
|
-
validationBehavior
|
|
119
|
-
}, state, ref);
|
|
120
|
-
return {
|
|
121
|
-
labelProps: $3ef42575df84b30b$export$9d1611c77c2fe928(labelProps, {
|
|
122
|
-
onClick: (e) => e.preventDefault()
|
|
123
|
-
}),
|
|
124
|
-
inputProps: $3ef42575df84b30b$export$9d1611c77c2fe928(domProps, __spreadProps(__spreadValues({}, interactions), {
|
|
125
|
-
type: "radio",
|
|
126
|
-
name,
|
|
127
|
-
tabIndex,
|
|
128
|
-
disabled: isDisabled,
|
|
129
|
-
required: state.isRequired && validationBehavior === "native",
|
|
130
|
-
checked,
|
|
131
|
-
value,
|
|
132
|
-
onChange,
|
|
133
|
-
"aria-describedby": [
|
|
134
|
-
props["aria-describedby"],
|
|
135
|
-
state.isInvalid ? errorMessageId : null,
|
|
136
|
-
descriptionId
|
|
137
|
-
].filter(Boolean).join(" ") || void 0
|
|
138
|
-
})),
|
|
139
|
-
isDisabled,
|
|
140
|
-
isSelected: checked,
|
|
141
|
-
isPressed: isPressed || isLabelPressed
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
function $430f30ed08ec25fa$export$62b9571f283ff5c2(props, state) {
|
|
145
|
-
let { name, isReadOnly, isRequired, isDisabled, orientation = "vertical", validationBehavior = "aria" } = props;
|
|
146
|
-
let { direction } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
|
|
147
|
-
let { isInvalid, validationErrors, validationDetails } = state.displayValidation;
|
|
148
|
-
let { labelProps, fieldProps, descriptionProps, errorMessageProps } = $2baaea4c71418dea$export$294aa081a6c6f55d(__spreadProps(__spreadValues({}, props), {
|
|
149
|
-
// Radio group is not an HTML input element so it
|
|
150
|
-
// shouldn't be labeled by a <label> element.
|
|
151
|
-
labelElementType: "span",
|
|
152
|
-
isInvalid: state.isInvalid,
|
|
153
|
-
errorMessage: props.errorMessage || validationErrors
|
|
154
|
-
}));
|
|
155
|
-
let domProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
156
|
-
labelable: true
|
|
157
|
-
});
|
|
158
|
-
let { focusWithinProps } = $9ab94262bd0047c7$export$420e68273165f4ec({
|
|
159
|
-
onBlurWithin(e) {
|
|
160
|
-
var _props_onBlur;
|
|
161
|
-
(_props_onBlur = props.onBlur) === null || _props_onBlur === void 0 ? void 0 : _props_onBlur.call(props, e);
|
|
162
|
-
if (!state.selectedValue) state.setLastFocusedValue(null);
|
|
163
|
-
},
|
|
164
|
-
onFocusWithin: props.onFocus,
|
|
165
|
-
onFocusWithinChange: props.onFocusChange
|
|
166
|
-
});
|
|
167
|
-
let onKeyDown = (e) => {
|
|
168
|
-
let nextDir;
|
|
169
|
-
switch (e.key) {
|
|
170
|
-
case "ArrowRight":
|
|
171
|
-
if (direction === "rtl" && orientation !== "vertical") nextDir = "prev";
|
|
172
|
-
else nextDir = "next";
|
|
173
|
-
break;
|
|
174
|
-
case "ArrowLeft":
|
|
175
|
-
if (direction === "rtl" && orientation !== "vertical") nextDir = "next";
|
|
176
|
-
else nextDir = "prev";
|
|
177
|
-
break;
|
|
178
|
-
case "ArrowDown":
|
|
179
|
-
nextDir = "next";
|
|
180
|
-
break;
|
|
181
|
-
case "ArrowUp":
|
|
182
|
-
nextDir = "prev";
|
|
183
|
-
break;
|
|
184
|
-
default:
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
e.preventDefault();
|
|
188
|
-
let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(e.currentTarget, {
|
|
189
|
-
from: e.target
|
|
190
|
-
});
|
|
191
|
-
let nextElem;
|
|
192
|
-
if (nextDir === "next") {
|
|
193
|
-
nextElem = walker.nextNode();
|
|
194
|
-
if (!nextElem) {
|
|
195
|
-
walker.currentNode = e.currentTarget;
|
|
196
|
-
nextElem = walker.firstChild();
|
|
197
|
-
}
|
|
198
|
-
} else {
|
|
199
|
-
nextElem = walker.previousNode();
|
|
200
|
-
if (!nextElem) {
|
|
201
|
-
walker.currentNode = e.currentTarget;
|
|
202
|
-
nextElem = walker.lastChild();
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
if (nextElem) {
|
|
206
|
-
nextElem.focus();
|
|
207
|
-
state.setSelectedValue(nextElem.value);
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
let groupName = $bdb11010cef70236$export$f680877a34711e37(name);
|
|
211
|
-
$884aeceb3d67f00f$export$37b65e5b5444d35c.set(state, {
|
|
212
|
-
name: groupName,
|
|
213
|
-
descriptionId: descriptionProps.id,
|
|
214
|
-
errorMessageId: errorMessageProps.id,
|
|
215
|
-
validationBehavior
|
|
216
|
-
});
|
|
217
|
-
return {
|
|
218
|
-
radioGroupProps: $3ef42575df84b30b$export$9d1611c77c2fe928(domProps, __spreadValues(__spreadValues({
|
|
219
|
-
// https://www.w3.org/TR/wai-aria-1.2/#radiogroup
|
|
220
|
-
role: "radiogroup",
|
|
221
|
-
onKeyDown,
|
|
222
|
-
"aria-invalid": state.isInvalid || void 0,
|
|
223
|
-
"aria-errormessage": props["aria-errormessage"],
|
|
224
|
-
"aria-readonly": isReadOnly || void 0,
|
|
225
|
-
"aria-required": isRequired || void 0,
|
|
226
|
-
"aria-disabled": isDisabled || void 0,
|
|
227
|
-
"aria-orientation": orientation
|
|
228
|
-
}, fieldProps), focusWithinProps)),
|
|
229
|
-
labelProps,
|
|
230
|
-
descriptionProps,
|
|
231
|
-
errorMessageProps,
|
|
232
|
-
isInvalid,
|
|
233
|
-
validationErrors,
|
|
234
|
-
validationDetails
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
const RadioGroupContext = React__default.createContext(null);
|
|
238
|
-
const useRadioGroupContext = () => {
|
|
239
|
-
const radioGroupContext = useContext(RadioGroupContext);
|
|
240
|
-
if (!radioGroupContext) {
|
|
241
|
-
throw new Error("Must be within a RadioGroup");
|
|
242
|
-
}
|
|
243
|
-
return radioGroupContext;
|
|
244
|
-
};
|
|
245
|
-
const RadioGroupItem$1 = "_RadioGroupItem_1eiq3_5";
|
|
246
|
-
const label = "_label_1eiq3_11";
|
|
247
|
-
const radioOuter = "_radioOuter_1eiq3_29";
|
|
248
|
-
const radioInner = "_radioInner_1eiq3_30";
|
|
249
|
-
const focusVisible = "_focusVisible_1eiq3_44";
|
|
250
|
-
const selected = "_selected_1eiq3_63";
|
|
251
|
-
const invalid = "_invalid_1eiq3_67";
|
|
252
|
-
const disabled = "_disabled_1eiq3_71";
|
|
253
|
-
const hovered = "_hovered_1eiq3_83";
|
|
254
|
-
const readOnly = "_readOnly_1eiq3_83";
|
|
255
|
-
const styles$1 = {
|
|
256
|
-
RadioGroupItem: RadioGroupItem$1,
|
|
257
|
-
label,
|
|
258
|
-
radioOuter,
|
|
259
|
-
radioInner,
|
|
260
|
-
focusVisible,
|
|
261
|
-
selected,
|
|
262
|
-
invalid,
|
|
263
|
-
disabled,
|
|
264
|
-
hovered,
|
|
265
|
-
readOnly
|
|
266
|
-
};
|
|
267
|
-
function RadioGroupItem(props) {
|
|
268
|
-
const { children, errorText, validationState } = props;
|
|
269
|
-
const ref = React__default.useRef(null);
|
|
270
|
-
const state = useRadioGroupContext();
|
|
271
|
-
const { inputProps, isSelected, isDisabled } = $0d5c49892c1215da$export$37b0961d2f4751e2(props, state, ref);
|
|
272
|
-
const { isFocusVisible, focusProps } = $f7dceffc5ad7768b$export$4e328f61c538687f();
|
|
273
|
-
const { isHovered, hoverProps } = $6179b936705e76d3$export$ae780daf29e6d456(props);
|
|
274
|
-
const className = classNames(styles$1.RadioGroupItem, isSelected && styles$1.selected, isDisabled && styles$1.disabled, isFocusVisible && styles$1.focusVisible, isHovered && styles$1.hovered, validationState === "invalid" && styles$1.invalid);
|
|
275
|
-
const textColor = isDisabled ? "neutral.300" : validationState === "invalid" ? "negative.600" : "primary.800";
|
|
276
|
-
return React__default.createElement("div", {
|
|
277
|
-
className
|
|
278
|
-
}, React__default.createElement(HorizontalStack, {
|
|
279
|
-
gap: "1",
|
|
280
|
-
blockAlign: "center"
|
|
281
|
-
}, React__default.createElement("label", {
|
|
282
|
-
className: styles$1.label
|
|
283
|
-
}, React__default.createElement(HorizontalStack, __spreadValues({
|
|
284
|
-
blockAlign: "start",
|
|
285
|
-
gap: "1",
|
|
286
|
-
wrap: false
|
|
287
|
-
}, hoverProps), React__default.createElement("input", __spreadProps(__spreadValues(__spreadValues({
|
|
288
|
-
"aria-invalid": validationState === "invalid"
|
|
289
|
-
}, inputProps), focusProps), {
|
|
290
|
-
className: styles$1.input,
|
|
291
|
-
ref
|
|
292
|
-
})), React__default.createElement("span", {
|
|
293
|
-
className: styles$1.radioOuter
|
|
294
|
-
}, React__default.createElement("span", {
|
|
295
|
-
className: styles$1.radioInner
|
|
296
|
-
})), React__default.createElement(Text, {
|
|
297
|
-
variant: "body1",
|
|
298
|
-
color: textColor
|
|
299
|
-
}, children))), validationState === "invalid" && errorText && React__default.createElement(SelectorErrorTooltip, {
|
|
300
|
-
content: errorText
|
|
301
|
-
})));
|
|
302
|
-
}
|
|
303
|
-
const RadioGroup$1 = "_RadioGroup_zx68y_5";
|
|
304
|
-
const list = "_list_zx68y_14";
|
|
305
|
-
const styles = {
|
|
306
|
-
RadioGroup: RadioGroup$1,
|
|
307
|
-
list
|
|
308
|
-
};
|
|
309
|
-
function RadioGroupContainer(props) {
|
|
310
|
-
const { children, label: label2 } = props;
|
|
311
|
-
const state = $a54cdc5c1942b639$export$bca9d026f8e704eb(props);
|
|
312
|
-
const { radioGroupProps, labelProps } = $430f30ed08ec25fa$export$62b9571f283ff5c2(props, state);
|
|
313
|
-
return React__default.createElement("fieldset", __spreadValues({
|
|
314
|
-
className: styles.RadioGroup
|
|
315
|
-
}, radioGroupProps), label2 && React__default.createElement("div", null, React__default.createElement(Text, __spreadValues({
|
|
316
|
-
as: "legend",
|
|
317
|
-
variant: "subtitle1",
|
|
318
|
-
color: "gray.bold"
|
|
319
|
-
}, labelProps), label2)), React__default.createElement(RadioGroupContext.Provider, {
|
|
320
|
-
value: state
|
|
321
|
-
}, children));
|
|
322
|
-
}
|
|
323
|
-
function RadioGroup(props) {
|
|
324
|
-
const _a = props, { children } = _a, containerProps = __objRest(_a, ["children"]);
|
|
325
|
-
return React__default.createElement(RadioGroupContainer, __spreadValues({}, containerProps), React__default.createElement("div", {
|
|
326
|
-
className: styles.list
|
|
327
|
-
}, children));
|
|
328
|
-
}
|
|
329
|
-
RadioGroup.Container = RadioGroupContainer;
|
|
330
|
-
RadioGroup.Item = RadioGroupItem;
|
|
1
|
+
import { R, u } from "../__chunks__/RadioGroup-DZxaIqD6.mjs";
|
|
331
2
|
export {
|
|
332
|
-
RadioGroup,
|
|
333
|
-
useRadioGroupContext
|
|
3
|
+
R as RadioGroup,
|
|
4
|
+
u as useRadioGroupContext
|
|
334
5
|
};
|
package/RangeCalendar/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const RangeCalendar = require("../__chunks__/RangeCalendar-
|
|
3
|
+
const RangeCalendar = require("../__chunks__/RangeCalendar-V_YZXfhI.js");
|
|
4
4
|
exports.RangeCalendar = RangeCalendar.RangeCalendar;
|
package/RangeCalendar/index.mjs
CHANGED