@konstructio/ui 0.1.2-alpha.105 → 0.1.2-alpha.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +118 -31
- package/dist/{AdditionalOptions-D0BAS2HG.js → AdditionalOptions-Crcnz0_g.js} +1 -1
- package/dist/{AlertDialogTrigger-BGo_acd5.js → AlertDialogTrigger-ouMGAlJW.js} +39 -39
- package/dist/{Breadcrumb-Cp3abB2w.js → Breadcrumb-MrF1Z6w2.js} +3 -3
- package/dist/{Checkbox-B_ngk9Dj.js → Checkbox-8KnRLpQG.js} +60 -61
- package/dist/{CommandInput-BLq69pOT.js → CommandInput-CGnqfudl.js} +4 -4
- package/dist/{Counter-BV680M5r.js → Counter-CDXdP1Af.js} +3 -3
- package/dist/{DayPicker-kweJz134.js → DayPicker-C22j0Y-u.js} +539 -518
- package/dist/{DropdownButton-DfNojmCW.js → DropdownButton-D4QlKGg7.js} +7 -7
- package/dist/{FlagSelectorList-CkTR3j6O.js → FlagSelectorList-tYZNl-tz.js} +31 -24
- package/dist/{HamburgerTrigger-DRylBL2d.js → HamburgerTrigger-B_NGSZ2r.js} +20 -20
- package/dist/{ImageUpload-DiwymQcU.js → ImageUpload-D7HKSXK8.js} +71 -66
- package/dist/Input-is8n7emP.js +195 -0
- package/dist/{Loading-DUh9PMJN.js → Loading-DO8JOWBV.js} +1 -1
- package/dist/{Modal-Dyn088X7.js → Modal-Dq9BHD_9.js} +4 -4
- package/dist/{Spinner-CUwE2bLm.js → Spinner-BJE79VTl.js} +1 -1
- package/dist/{StepIndicatorContent-CjbjVjS1.js → StepIndicatorContent-BGDvxLzV.js} +1 -1
- package/dist/Switch-C7286Bcu.js +199 -0
- package/dist/{Toast-3NEz7LLa.js → Toast-jSx3Lao8.js} +8 -7
- package/dist/Wrapper-2AUlYAHQ.js +195 -0
- package/dist/{Wrapper-CVJSuYWx.js → Wrapper-CyHxGs4E.js} +4 -4
- package/dist/{Wrapper-DP6Sxngx.js → Wrapper-a7RVCcrn.js} +248 -242
- package/dist/components/Alert/Alert.js +2 -2
- package/dist/components/AlertDialog/AlertDialog.js +2 -2
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Autocomplete/Autocomplete.js +1 -1
- package/dist/components/Autocomplete/components/List/List.js +1 -1
- package/dist/components/Autocomplete/hooks/useAutocomplete.js +27 -25
- package/dist/components/Autocomplete/hooks/useNavigationList.js +2 -3
- package/dist/components/Badge/Badge.js +2 -2
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/components/BackButton/BackButton.js +2 -2
- package/dist/components/Breadcrumb/components/Item/Item.js +2 -2
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.js +65 -60
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.js +2 -2
- package/dist/components/ButtonGroup/components/ButtonGroupLabel/ButtonGroupLabel.js +10 -9
- package/dist/components/ButtonGroup/components/ButtonGroupMessage/ButtonGroupMessage.js +8 -6
- package/dist/components/Card/Card.js +25 -22
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Command/Command.js +2 -2
- package/dist/components/Command/components/Command.js +1 -1
- package/dist/components/Command/components/CommandEmpty.js +1 -1
- package/dist/components/Command/components/CommandGroup.js +2 -2
- package/dist/components/Command/components/CommandInput.js +1 -1
- package/dist/components/Command/components/CommandItem.js +2 -2
- package/dist/components/Command/components/CommandList.js +2 -2
- package/dist/components/Command/components/CommandSeparator.js +2 -2
- package/dist/components/Command/components/CommandShortcut.js +1 -1
- package/dist/components/Command/components/DialogContent.js +3 -3
- package/dist/components/Command/components/DialogOverlay.js +2 -2
- package/dist/components/Command/components/index.js +1 -1
- package/dist/components/Counter/Counter.js +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarDivider/CalendarDivider.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +3 -3
- package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +3 -3
- package/dist/components/DateRangePicker/components/CalendarPanel/components/NavigationButton/NavigationButton.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +2 -2
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/dayPickerClassNames.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/index.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/index.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useIndependentCarousel.js +30 -28
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.js +23 -21
- package/dist/components/DateRangePicker/components/CalendarPanel/utils/index.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/DateTimeInputs.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.js +48 -41
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.js +48 -41
- package/dist/components/DateRangePicker/components/PresetPanel/PresetPanel.js +1 -1
- package/dist/components/Datepicker/DatePicker.js +2 -2
- package/dist/components/Divider/Divider.js +7 -7
- package/dist/components/Drawer/Drawer.js +28 -26
- package/dist/components/Drawer/components/Body/Body.js +1 -1
- package/dist/components/Drawer/components/Footer/Footer.js +1 -1
- package/dist/components/Drawer/components/Header/Header.js +1 -1
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/Filter.js +1 -1
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +51 -36
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +40 -38
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +1 -1
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.js +1 -1
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.js +1 -1
- package/dist/components/Filter/components/FilterDropdown/FilterDropdown.js +2 -2
- package/dist/components/Filter/components/ResetButton/ResetButton.js +1 -1
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +43 -41
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.js +1 -1
- package/dist/components/Filter/utils/index.js +1 -1
- package/dist/components/ImageUpload/ImageUpload.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/LineChart/LineChart.js +2 -2
- package/dist/components/Loading/Loading.js +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/components/Body/Body.js +1 -1
- package/dist/components/Modal/components/Footer/Footer.js +1 -1
- package/dist/components/Modal/components/Header/Header.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +1 -1
- package/dist/components/MultiSelectDropdown/components/Item/Item.js +1 -1
- package/dist/components/MultiSelectDropdown/components/List/List.js +1 -1
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/MultiSelectDropdown/components/index.js +1 -1
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.context.js +4 -3
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.provider.js +17 -16
- package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +11 -11
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +2 -2
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +1 -1
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +1 -1
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +3 -3
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +3 -3
- package/dist/components/PhoneNumberInput/components/Wrapper.js +1 -1
- package/dist/components/PhoneNumberInput/components/index.js +2 -2
- package/dist/components/PhoneNumberInput/contexts/index.js +1 -1
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +1 -1
- package/dist/components/PhoneNumberInput/utils/index.js +1 -1
- package/dist/components/PieChart/PieChart.js +31 -28
- package/dist/components/ProgressBar/ProgressBar.js +1 -1
- package/dist/components/Radio/Radio.js +1 -1
- package/dist/components/RadioCard/RadioCard.js +1 -1
- package/dist/components/RadioCardGroup/RadioCardGroup.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/Range/Range.js +2 -2
- package/dist/components/Select/Select.js +43 -36
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.js +1 -1
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.variants.js +1 -1
- package/dist/components/Select/components/List/List.js +78 -67
- package/dist/components/Select/components/ListItem/ListItem.js +1 -1
- package/dist/components/Select/components/Wrapper.js +1 -1
- package/dist/components/Select/components/index.js +2 -2
- package/dist/components/Select/hooks/useNavigationList.js +2 -3
- package/dist/components/Select/hooks/useSelect.js +8 -8
- package/dist/components/Sidebar/components/CollapseTrigger/CollapseTrigger.js +1 -1
- package/dist/components/Sidebar/components/Footer/Footer.js +1 -1
- package/dist/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.js +1 -1
- package/dist/components/Sidebar/components/Label/Label.js +1 -1
- package/dist/components/Sidebar/components/Logo/Logo.js +1 -1
- package/dist/components/Sidebar/components/Navigation/Navigation.js +1 -1
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.js +1 -1
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +2 -2
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.js +1 -1
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.js +1 -1
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +25 -24
- package/dist/components/Sidebar/components/index.js +1 -1
- package/dist/components/Slider/Slider.js +2 -2
- package/dist/components/Spinner/Spinner.js +1 -1
- package/dist/components/Stepper/Stepper.js +1 -1
- package/dist/components/Stepper/components/HorizontalStepItem/HorizontalStepItem.js +2 -2
- package/dist/components/Stepper/components/StepConnector/StepConnector.js +1 -1
- package/dist/components/Stepper/components/StepIndicatorContent/StepIndicatorContent.js +1 -1
- package/dist/components/Stepper/components/VerticalStepItem/VerticalStepItem.js +2 -2
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Switch/Switch.variants.js +15 -7
- package/dist/components/Table/Table.js +1 -1
- package/dist/components/Table/components/Body.js +1 -1
- package/dist/components/Table/components/Filter.js +1 -1
- package/dist/components/Table/components/Head.js +1 -1
- package/dist/components/Table/components/Row.js +1 -1
- package/dist/components/Tabs/Tabs.js +2 -2
- package/dist/components/Tabs/components/Content.js +2 -2
- package/dist/components/Tabs/components/List.js +2 -2
- package/dist/components/Tabs/components/Trigger.js +2 -2
- package/dist/components/Tag/Tag.js +8 -8
- package/dist/components/TagSelect/TagSelect.js +1 -1
- package/dist/components/TagSelect/components/Item/Item.js +1 -1
- package/dist/components/TagSelect/components/List/List.js +1 -1
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/TagSelect/components/index.js +1 -1
- package/dist/components/TagSelect/hooks/useTagSelect.js +11 -11
- package/dist/components/TextArea/TextArea.js +71 -26
- package/dist/components/TextArea/TextArea.variants.js +49 -13
- package/dist/components/TimePicker/components/HoursList/HoursList.js +1 -1
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +1 -1
- package/dist/components/TimePicker/components/MinutesList/MinutesList.js +1 -1
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +114 -99
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +19 -18
- package/dist/components/Toast/Toast.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +2 -2
- package/dist/components/Typography/Typography.js +19 -16
- package/dist/components/VirtualizedTable/VirtualizedTable.js +2 -2
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +1 -1
- package/dist/components/VirtualizedTable/components/Body/Body.js +2 -2
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +1 -1
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +2 -2
- package/dist/components/VirtualizedTable/components/ExpandableRow/ExpandableRow.js +1 -1
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +4 -4
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +1 -1
- package/dist/components/VirtualizedTable/components/Header/Header.js +2 -2
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +1 -1
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +1 -1
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +3 -3
- package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +1 -1
- package/dist/components/VirtualizedTable/contexts/index.js +1 -1
- package/dist/components/VirtualizedTable/contexts/table.provider.js +1 -1
- package/dist/components/index.js +12 -12
- package/dist/{components-Cf345jTv.js → components-CaEW5ge4.js} +32 -32
- package/dist/{constants-CxJJRVK3.js → constants-HQIXhj2t.js} +2 -2
- package/dist/contexts/index.js +1 -1
- package/dist/contexts/theme.provider.js +1 -1
- package/dist/{debounce-C5Ycjilj.js → debounce-BdyZeJQk.js} +2 -2
- package/dist/{dist-DFCz63oC2.js → dist-9WbMf_jT.js} +158 -159
- package/dist/{dist-tGUUcv8n.js → dist-AxOGvL82.js} +114 -115
- package/dist/{dist-DDck_2lb.js → dist-BIBFLVt1.js} +117 -116
- package/dist/{dist-BZNE2Tnx.js → dist-BbX4Nrk2.js} +1 -1
- package/dist/{dist-BaPW7qXd2.js → dist-BnCbAI-c.js} +1 -1
- package/dist/{dist-BdobXn93.js → dist-CszFjHAP.js} +2 -2
- package/dist/{dist-C3YVLapk.js → dist-DO3apbIh.js} +24 -24
- package/dist/{dist-CzKqHuqJ2.js → dist-DwxO2RoR.js} +38 -38
- package/dist/{dist-AihTpWdF.js → dist-iUAHw-3y.js} +272 -272
- package/dist/{dist-BlPTJNIm.js → dist-pxvIAJzo.js} +2 -2
- package/dist/es2015-B_07N-UL.js +796 -0
- package/dist/hooks/useMediaQuery.js +1 -1
- package/dist/index.js +14 -14
- package/dist/{isObject-BeFFiVJK.js → isObject-pLoSfdr0.js} +1 -1
- package/dist/lib/components/ButtonGroup/components/ButtonGroupLabel/ButtonGroupLabel.types.d.ts +1 -1
- package/dist/lib/components/ButtonGroup/components/ButtonGroupMessage/ButtonGroupMessage.types.d.ts +2 -0
- package/dist/lib/components/Card/Card.types.d.ts +1 -0
- package/dist/lib/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/lib/components/Checkbox/Checkbox.types.d.ts +2 -1
- package/dist/lib/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.types.d.ts +1 -0
- package/dist/lib/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.types.d.ts +1 -0
- package/dist/lib/components/Divider/Divider.d.ts +3 -2
- package/dist/lib/components/Divider/Divider.types.d.ts +4 -0
- package/dist/lib/components/Input/Input.types.d.ts +4 -0
- package/dist/lib/components/MultiSelectDropdown/MultiSelectDropdown.types.d.ts +2 -0
- package/dist/lib/components/MultiSelectDropdown/contexts/MultiSelectDropdown.types.d.ts +2 -0
- package/dist/lib/components/Select/Select.types.d.ts +2 -0
- package/dist/lib/components/Select/components/List/List.types.d.ts +3 -0
- package/dist/lib/components/Select/components/Wrapper.d.ts +2 -0
- package/dist/lib/components/Sidebar/Sidebar.types.d.ts +2 -0
- package/dist/lib/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.types.d.ts +2 -0
- package/dist/lib/components/Switch/Switch.variants.d.ts +3 -1
- package/dist/lib/components/Tag/Tag.types.d.ts +1 -0
- package/dist/lib/components/TextArea/TextArea.d.ts +6 -0
- package/dist/lib/components/TextArea/TextArea.types.d.ts +13 -2
- package/dist/lib/components/TextArea/TextArea.variants.d.ts +4 -1
- package/dist/lib/components/TimePicker/TimePicker.types.d.ts +4 -0
- package/dist/lib/components/TimePicker/components/WrapperList/WrapperList.types.d.ts +1 -0
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/{libphonenumber-hGupNnJu.js → libphonenumber-BMq3Thej.js} +356 -347
- package/dist/package.json +27 -27
- package/dist/{phone-number.provider-BxQCTxp8.js → phone-number.provider-Dkq_p1Gi.js} +2 -2
- package/dist/{prop-types-CfEYxTbR.js → prop-types-BCUW56rg.js} +1 -1
- package/dist/{react-CvUtBTMg.js → react-7zQ6bvbE.js} +837 -828
- package/dist/{rolldown-runtime-Ck3dxwZt.js → rolldown-runtime-Dw9YIBcH.js} +1 -1
- package/dist/styles.css +1 -1
- package/dist/{table.provider-B0BafHuU.js → table.provider-CWzODR1t.js} +96 -96
- package/dist/{theme.provider-Dw4O3ocC.js → theme.provider-CSL1WCYG.js} +1 -1
- package/dist/{useBreadcrumb-DYfZL_2p.js → useBreadcrumb-Ds_9BeFz.js} +7 -6
- package/dist/utils/index.js +6 -5
- package/dist/{utils-Cx-WzRZF.js → utils-B-6R7kNE.js} +8 -4
- package/dist/{utils-B-BTGYA5.js → utils-DVYdP0CJ.js} +2 -3
- package/dist/{x-BI9jmc7e.js → x-Ierxf0uI.js} +2 -2
- package/package.json +27 -27
- package/dist/Input-Cf44DzfE.js +0 -188
- package/dist/Switch-aPhL5rNG.js +0 -196
- package/dist/Wrapper-R8fik3ah.js +0 -182
- package/dist/es2015-DigR3dar.js +0 -795
- /package/dist/{dist-DGOjiAnB2.js → dist-DGOjiAnB.js} +0 -0
- /package/dist/{dist-pWlMx4Fi2.js → dist-pWlMx4Fi.js} +0 -0
- /package/dist/{x-a_LpoXzG2.js → x-a_LpoXzG.js} +0 -0
|
@@ -0,0 +1,796 @@
|
|
|
1
|
+
import { o as Se } from "./rolldown-runtime-Dw9YIBcH.js";
|
|
2
|
+
import { t as Ne } from "./prop-types-BCUW56rg.js";
|
|
3
|
+
import { i as Te, n as ir, r as Pe } from "./Combination-CnMM05mt.js";
|
|
4
|
+
import O, { Fragment as Cr, PureComponent as _e, createContext as Ae, forwardRef as Lr, useCallback as L, useEffect as De, useMemo as Me, useRef as X, useState as Z } from "react";
|
|
5
|
+
function Ce(r, e) {
|
|
6
|
+
if (r == null) return {};
|
|
7
|
+
var t = {};
|
|
8
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
9
|
+
if (e.indexOf(n) !== -1) continue;
|
|
10
|
+
t[n] = r[n];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
}
|
|
14
|
+
function W() {
|
|
15
|
+
return W = Object.assign ? Object.assign.bind() : function(r) {
|
|
16
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
17
|
+
var t = arguments[e];
|
|
18
|
+
for (var n in t) ({}).hasOwnProperty.call(t, n) && (r[n] = t[n]);
|
|
19
|
+
}
|
|
20
|
+
return r;
|
|
21
|
+
}, W.apply(null, arguments);
|
|
22
|
+
}
|
|
23
|
+
var nr = "data-focus-lock", kr = "data-focus-lock-disabled", Le = "data-no-focus-lock", ke = "data-autofocus-inside", Re = "data-no-autofocus", d = /* @__PURE__ */ Se(Ne()), R = {
|
|
24
|
+
width: "1px",
|
|
25
|
+
height: "0px",
|
|
26
|
+
padding: 0,
|
|
27
|
+
overflow: "hidden",
|
|
28
|
+
position: "fixed",
|
|
29
|
+
top: "1px",
|
|
30
|
+
left: "1px"
|
|
31
|
+
}, We = function(e) {
|
|
32
|
+
var t = e.children, n = t === void 0 ? null : t;
|
|
33
|
+
return /* @__PURE__ */ O.createElement(Cr, null, /* @__PURE__ */ O.createElement("div", {
|
|
34
|
+
key: "guard-first",
|
|
35
|
+
"data-focus-guard": !0,
|
|
36
|
+
"data-focus-auto-guard": !0,
|
|
37
|
+
style: R
|
|
38
|
+
}), n, n && /* @__PURE__ */ O.createElement("div", {
|
|
39
|
+
key: "guard-last",
|
|
40
|
+
"data-focus-guard": !0,
|
|
41
|
+
"data-focus-auto-guard": !0,
|
|
42
|
+
style: R
|
|
43
|
+
}));
|
|
44
|
+
};
|
|
45
|
+
We.propTypes = process.env.NODE_ENV !== "production" ? { children: d.default.node } : {};
|
|
46
|
+
var Rr = ir({}, function(r) {
|
|
47
|
+
return {
|
|
48
|
+
target: r.target,
|
|
49
|
+
currentTarget: r.currentTarget
|
|
50
|
+
};
|
|
51
|
+
}), Wr = ir(), Ue = ir(), Be = Pe({
|
|
52
|
+
async: !0,
|
|
53
|
+
ssr: typeof document < "u"
|
|
54
|
+
}), Ge = /* @__PURE__ */ Ae(void 0), je = [], cr = /* @__PURE__ */ Lr(function(e, t) {
|
|
55
|
+
var n, o = Z(), u = o[0], a = o[1], f = X(), v = X(!1), c = X(null), m = Z({})[1], s = e.children, i = e.disabled, l = i === void 0 ? !1 : i, p = e.noFocusGuards, h = p === void 0 ? !1 : p, F = e.persistentFocus, x = F === void 0 ? !1 : F, b = e.crossFrame, y = b === void 0 ? !0 : b, E = e.autoFocus, S = E === void 0 ? !0 : E, H = e.allowTextSelection, V = e.group, Y = e.className, se = e.whiteList, de = e.hasPositiveIndices, gr = e.shards, z = gr === void 0 ? je : gr, Fr = e.as, Er = Fr === void 0 ? "div" : Fr, Or = e.lockProps, le = Or === void 0 ? {} : Or, ve = e.sideCar, xr = e.returnFocus, q = xr === void 0 ? !1 : xr, me = e.focusOptions, J = e.onActivation, Q = e.onDeactivation, pe = Z({})[0], be = L(function(I) {
|
|
56
|
+
var _ = I.captureFocusRestore;
|
|
57
|
+
if (!c.current) {
|
|
58
|
+
var A, N = (A = document) == null ? void 0 : A.activeElement;
|
|
59
|
+
c.current = N, N !== document.body && (c.current = _(N));
|
|
60
|
+
}
|
|
61
|
+
f.current && J && J(f.current), v.current = !0, m();
|
|
62
|
+
}, [J]), he = L(function() {
|
|
63
|
+
v.current = !1, Q && Q(f.current), m();
|
|
64
|
+
}, [Q]), ye = L(function(I) {
|
|
65
|
+
var _ = c.current;
|
|
66
|
+
if (_) {
|
|
67
|
+
var A = (typeof _ == "function" ? _() : _) || document.body, N = typeof q == "function" ? q(A) : q;
|
|
68
|
+
if (N) {
|
|
69
|
+
var Ir = typeof N == "object" ? N : void 0;
|
|
70
|
+
c.current = null, I ? Promise.resolve().then(function() {
|
|
71
|
+
return A.focus(Ir);
|
|
72
|
+
}) : A.focus(Ir);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}, [q]), ge = L(function(I) {
|
|
76
|
+
v.current && Rr.useMedium(I);
|
|
77
|
+
}, []), Fe = Wr.useMedium, Ee = L(function(I) {
|
|
78
|
+
f.current !== I && (f.current = I, a(I));
|
|
79
|
+
}, []);
|
|
80
|
+
process.env.NODE_ENV !== "production" && (typeof H < "u" && console.warn("React-Focus-Lock: allowTextSelection is deprecated and enabled by default"), De(function() {
|
|
81
|
+
!f.current && typeof Er != "string" && console.error("FocusLock: could not obtain ref to internal node");
|
|
82
|
+
}, []));
|
|
83
|
+
var Oe = W((n = {}, n[kr] = l && "disabled", n[nr] = V, n), le), wr = h !== !0, xe = wr && h !== "tail", we = Te([t, Ee]), Ie = Me(function() {
|
|
84
|
+
return {
|
|
85
|
+
observed: f,
|
|
86
|
+
shards: z,
|
|
87
|
+
enabled: !l,
|
|
88
|
+
get active() {
|
|
89
|
+
return v.current;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}, [
|
|
93
|
+
l,
|
|
94
|
+
v,
|
|
95
|
+
z,
|
|
96
|
+
f
|
|
97
|
+
]);
|
|
98
|
+
return /* @__PURE__ */ O.createElement(Cr, null, wr && [/* @__PURE__ */ O.createElement("div", {
|
|
99
|
+
key: "guard-first",
|
|
100
|
+
"data-focus-guard": !0,
|
|
101
|
+
tabIndex: l ? -1 : 0,
|
|
102
|
+
style: R
|
|
103
|
+
}), de ? /* @__PURE__ */ O.createElement("div", {
|
|
104
|
+
key: "guard-nearest",
|
|
105
|
+
"data-focus-guard": !0,
|
|
106
|
+
tabIndex: l ? -1 : 1,
|
|
107
|
+
style: R
|
|
108
|
+
}) : null], !l && /* @__PURE__ */ O.createElement(ve, {
|
|
109
|
+
id: pe,
|
|
110
|
+
sideCar: Be,
|
|
111
|
+
observed: u,
|
|
112
|
+
disabled: l,
|
|
113
|
+
persistentFocus: x,
|
|
114
|
+
crossFrame: y,
|
|
115
|
+
autoFocus: S,
|
|
116
|
+
whiteList: se,
|
|
117
|
+
shards: z,
|
|
118
|
+
onActivation: be,
|
|
119
|
+
onDeactivation: he,
|
|
120
|
+
returnFocus: ye,
|
|
121
|
+
focusOptions: me,
|
|
122
|
+
noFocusGuards: h
|
|
123
|
+
}), /* @__PURE__ */ O.createElement(Er, W({ ref: we }, Oe, {
|
|
124
|
+
className: Y,
|
|
125
|
+
onBlur: Fe,
|
|
126
|
+
onFocus: ge
|
|
127
|
+
}), /* @__PURE__ */ O.createElement(Ge.Provider, { value: Ie }, s)), xe && /* @__PURE__ */ O.createElement("div", {
|
|
128
|
+
"data-focus-guard": !0,
|
|
129
|
+
tabIndex: l ? -1 : 0,
|
|
130
|
+
style: R
|
|
131
|
+
}));
|
|
132
|
+
});
|
|
133
|
+
cr.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
134
|
+
children: d.node,
|
|
135
|
+
disabled: d.bool,
|
|
136
|
+
returnFocus: (0, d.oneOfType)([
|
|
137
|
+
d.bool,
|
|
138
|
+
d.object,
|
|
139
|
+
d.func
|
|
140
|
+
]),
|
|
141
|
+
focusOptions: d.object,
|
|
142
|
+
noFocusGuards: d.bool,
|
|
143
|
+
hasPositiveIndices: d.bool,
|
|
144
|
+
allowTextSelection: d.bool,
|
|
145
|
+
autoFocus: d.bool,
|
|
146
|
+
persistentFocus: d.bool,
|
|
147
|
+
crossFrame: d.bool,
|
|
148
|
+
group: d.string,
|
|
149
|
+
className: d.string,
|
|
150
|
+
whiteList: d.func,
|
|
151
|
+
shards: (0, d.arrayOf)(d.any),
|
|
152
|
+
as: (0, d.oneOfType)([
|
|
153
|
+
d.string,
|
|
154
|
+
d.func,
|
|
155
|
+
d.object
|
|
156
|
+
]),
|
|
157
|
+
lockProps: d.object,
|
|
158
|
+
onActivation: d.func,
|
|
159
|
+
onDeactivation: d.func,
|
|
160
|
+
sideCar: d.any.isRequired
|
|
161
|
+
} : {};
|
|
162
|
+
function or(r, e) {
|
|
163
|
+
return or = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, n) {
|
|
164
|
+
return t.__proto__ = n, t;
|
|
165
|
+
}, or(r, e);
|
|
166
|
+
}
|
|
167
|
+
function He(r, e) {
|
|
168
|
+
r.prototype = Object.create(e.prototype), r.prototype.constructor = r, or(r, e);
|
|
169
|
+
}
|
|
170
|
+
function U(r) {
|
|
171
|
+
"@babel/helpers - typeof";
|
|
172
|
+
return U = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
173
|
+
return typeof e;
|
|
174
|
+
} : function(e) {
|
|
175
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
176
|
+
}, U(r);
|
|
177
|
+
}
|
|
178
|
+
function Ve(r, e) {
|
|
179
|
+
if (U(r) != "object" || !r) return r;
|
|
180
|
+
var t = r[Symbol.toPrimitive];
|
|
181
|
+
if (t !== void 0) {
|
|
182
|
+
var n = t.call(r, e || "default");
|
|
183
|
+
if (U(n) != "object") return n;
|
|
184
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
185
|
+
}
|
|
186
|
+
return (e === "string" ? String : Number)(r);
|
|
187
|
+
}
|
|
188
|
+
function qe(r) {
|
|
189
|
+
var e = Ve(r, "string");
|
|
190
|
+
return U(e) == "symbol" ? e : e + "";
|
|
191
|
+
}
|
|
192
|
+
function $e(r, e, t) {
|
|
193
|
+
return (e = qe(e)) in r ? Object.defineProperty(r, e, {
|
|
194
|
+
value: t,
|
|
195
|
+
enumerable: !0,
|
|
196
|
+
configurable: !0,
|
|
197
|
+
writable: !0
|
|
198
|
+
}) : r[e] = t, r;
|
|
199
|
+
}
|
|
200
|
+
function Ke(r, e) {
|
|
201
|
+
if (process.env.NODE_ENV !== "production") {
|
|
202
|
+
if (typeof r != "function") throw new Error("Expected reducePropsToState to be a function.");
|
|
203
|
+
if (typeof e != "function") throw new Error("Expected handleStateChangeOnClient to be a function.");
|
|
204
|
+
}
|
|
205
|
+
function t(n) {
|
|
206
|
+
return n.displayName || n.name || "Component";
|
|
207
|
+
}
|
|
208
|
+
return function(o) {
|
|
209
|
+
if (process.env.NODE_ENV !== "production" && typeof o != "function")
|
|
210
|
+
throw new Error("Expected WrappedComponent to be a React component.");
|
|
211
|
+
var u = [], a;
|
|
212
|
+
function f() {
|
|
213
|
+
a = r(u.map(function(c) {
|
|
214
|
+
return c.props;
|
|
215
|
+
})), e(a);
|
|
216
|
+
}
|
|
217
|
+
var v = /* @__PURE__ */ (function(c) {
|
|
218
|
+
He(m, c);
|
|
219
|
+
function m() {
|
|
220
|
+
return c.apply(this, arguments) || this;
|
|
221
|
+
}
|
|
222
|
+
m.peek = function() {
|
|
223
|
+
return a;
|
|
224
|
+
};
|
|
225
|
+
var s = m.prototype;
|
|
226
|
+
return s.componentDidMount = function() {
|
|
227
|
+
u.push(this), f();
|
|
228
|
+
}, s.componentDidUpdate = function() {
|
|
229
|
+
f();
|
|
230
|
+
}, s.componentWillUnmount = function() {
|
|
231
|
+
var l = u.indexOf(this);
|
|
232
|
+
u.splice(l, 1), f();
|
|
233
|
+
}, s.render = function() {
|
|
234
|
+
return /* @__PURE__ */ O.createElement(o, this.props);
|
|
235
|
+
}, m;
|
|
236
|
+
})(_e);
|
|
237
|
+
return $e(v, "displayName", "SideEffect(" + t(o) + ")"), v;
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
var w = function(r) {
|
|
241
|
+
for (var e = Array(r.length), t = 0; t < r.length; ++t) e[t] = r[t];
|
|
242
|
+
return e;
|
|
243
|
+
}, P = function(r) {
|
|
244
|
+
return Array.isArray(r) ? r : [r];
|
|
245
|
+
}, Ur = function(r) {
|
|
246
|
+
return Array.isArray(r) ? r[0] : r;
|
|
247
|
+
}, Ye = function(r) {
|
|
248
|
+
if (r.nodeType !== Node.ELEMENT_NODE) return !1;
|
|
249
|
+
var e = window.getComputedStyle(r, null);
|
|
250
|
+
return !e || !e.getPropertyValue ? !1 : e.getPropertyValue("display") === "none" || e.getPropertyValue("visibility") === "hidden";
|
|
251
|
+
}, Br = function(r) {
|
|
252
|
+
return r.parentNode && r.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? r.parentNode.host : r.parentNode;
|
|
253
|
+
}, Gr = function(r) {
|
|
254
|
+
return r === document || r && r.nodeType === Node.DOCUMENT_NODE;
|
|
255
|
+
}, ze = function(r) {
|
|
256
|
+
return r.hasAttribute("inert");
|
|
257
|
+
}, Je = function(r, e) {
|
|
258
|
+
return !r || Gr(r) || !Ye(r) && !ze(r) && e(Br(r));
|
|
259
|
+
}, jr = function(r, e) {
|
|
260
|
+
var t = r.get(e);
|
|
261
|
+
if (t !== void 0) return t;
|
|
262
|
+
var n = Je(e, jr.bind(void 0, r));
|
|
263
|
+
return r.set(e, n), n;
|
|
264
|
+
}, Qe = function(r, e) {
|
|
265
|
+
return r && !Gr(r) ? rt(r) ? e(Br(r)) : !1 : !0;
|
|
266
|
+
}, Hr = function(r, e) {
|
|
267
|
+
var t = r.get(e);
|
|
268
|
+
if (t !== void 0) return t;
|
|
269
|
+
var n = Qe(e, Hr.bind(void 0, r));
|
|
270
|
+
return r.set(e, n), n;
|
|
271
|
+
}, Vr = function(r) {
|
|
272
|
+
return r.dataset;
|
|
273
|
+
}, Xe = function(r) {
|
|
274
|
+
return r.tagName === "BUTTON";
|
|
275
|
+
}, qr = function(r) {
|
|
276
|
+
return r.tagName === "INPUT";
|
|
277
|
+
}, $r = function(r) {
|
|
278
|
+
return qr(r) && r.type === "radio";
|
|
279
|
+
}, Ze = function(r) {
|
|
280
|
+
return !((qr(r) || Xe(r)) && (r.type === "hidden" || r.disabled));
|
|
281
|
+
}, rt = function(r) {
|
|
282
|
+
var e = r.getAttribute(Re);
|
|
283
|
+
return ![
|
|
284
|
+
!0,
|
|
285
|
+
"true",
|
|
286
|
+
""
|
|
287
|
+
].includes(e);
|
|
288
|
+
}, fr = function(r) {
|
|
289
|
+
var e;
|
|
290
|
+
return !!(r && (!((e = Vr(r)) === null || e === void 0) && e.focusGuard));
|
|
291
|
+
}, ur = function(r) {
|
|
292
|
+
return !fr(r);
|
|
293
|
+
}, et = function(r) {
|
|
294
|
+
return !!r;
|
|
295
|
+
}, tt = function(r, e) {
|
|
296
|
+
var t = Math.max(0, r.tabIndex), n = Math.max(0, e.tabIndex), o = t - n, u = r.index - e.index;
|
|
297
|
+
if (o) {
|
|
298
|
+
if (!t) return 1;
|
|
299
|
+
if (!n) return -1;
|
|
300
|
+
}
|
|
301
|
+
return o || u;
|
|
302
|
+
}, nt = function(r) {
|
|
303
|
+
return r.tabIndex < 0 && !r.hasAttribute("tabindex") ? 0 : r.tabIndex;
|
|
304
|
+
}, sr = function(r, e, t) {
|
|
305
|
+
return w(r).map(function(n, o) {
|
|
306
|
+
var u = nt(n);
|
|
307
|
+
return {
|
|
308
|
+
node: n,
|
|
309
|
+
index: o,
|
|
310
|
+
tabIndex: t && u === -1 ? (n.dataset || {}).focusGuard ? 0 : -1 : u
|
|
311
|
+
};
|
|
312
|
+
}).filter(function(n) {
|
|
313
|
+
return !e || n.tabIndex >= 0;
|
|
314
|
+
}).sort(tt);
|
|
315
|
+
}, ot = [
|
|
316
|
+
"button:enabled",
|
|
317
|
+
"select:enabled",
|
|
318
|
+
"textarea:enabled",
|
|
319
|
+
"input:enabled",
|
|
320
|
+
"a[href]",
|
|
321
|
+
"area[href]",
|
|
322
|
+
"summary",
|
|
323
|
+
"iframe",
|
|
324
|
+
"object",
|
|
325
|
+
"embed",
|
|
326
|
+
"audio[controls]",
|
|
327
|
+
"video[controls]",
|
|
328
|
+
"[tabindex]",
|
|
329
|
+
"[contenteditable]",
|
|
330
|
+
"[autofocus]"
|
|
331
|
+
], dr = ot.join(","), ut = "".concat(dr, ", [data-focus-guard]"), Kr = function(r, e) {
|
|
332
|
+
return w((r.shadowRoot || r).children).reduce(function(t, n) {
|
|
333
|
+
return t.concat(n.matches(e ? ut : dr) ? [n] : [], Kr(n));
|
|
334
|
+
}, []);
|
|
335
|
+
}, at = function(r, e) {
|
|
336
|
+
var t;
|
|
337
|
+
return r instanceof HTMLIFrameElement && (!((t = r.contentDocument) === null || t === void 0) && t.body) ? C([r.contentDocument.body], e) : [r];
|
|
338
|
+
}, C = function(r, e) {
|
|
339
|
+
return r.reduce(function(t, n) {
|
|
340
|
+
var o, u = Kr(n, e), a = (o = []).concat.apply(o, u.map(function(f) {
|
|
341
|
+
return at(f, e);
|
|
342
|
+
}));
|
|
343
|
+
return t.concat(a, n.parentNode ? w(n.parentNode.querySelectorAll(dr)).filter(function(f) {
|
|
344
|
+
return f === n;
|
|
345
|
+
}) : []);
|
|
346
|
+
}, []);
|
|
347
|
+
}, it = function(r) {
|
|
348
|
+
var e = r.querySelectorAll("[".concat(ke, "]"));
|
|
349
|
+
return w(e).map(function(t) {
|
|
350
|
+
return C([t]);
|
|
351
|
+
}).reduce(function(t, n) {
|
|
352
|
+
return t.concat(n);
|
|
353
|
+
}, []);
|
|
354
|
+
}, lr = function(r, e) {
|
|
355
|
+
return w(r).filter(function(t) {
|
|
356
|
+
return jr(e, t);
|
|
357
|
+
}).filter(function(t) {
|
|
358
|
+
return Ze(t);
|
|
359
|
+
});
|
|
360
|
+
}, Sr = function(r, e) {
|
|
361
|
+
return e === void 0 && (e = /* @__PURE__ */ new Map()), w(r).filter(function(t) {
|
|
362
|
+
return Hr(e, t);
|
|
363
|
+
});
|
|
364
|
+
}, vr = function(r, e, t) {
|
|
365
|
+
return sr(lr(C(r, t), e), !0, t);
|
|
366
|
+
}, B = function(r, e) {
|
|
367
|
+
return sr(lr(C(r), e), !1);
|
|
368
|
+
}, ct = function(r, e) {
|
|
369
|
+
return lr(it(r), e);
|
|
370
|
+
}, T = function(r, e) {
|
|
371
|
+
return r.shadowRoot ? T(r.shadowRoot, e) : Object.getPrototypeOf(r).contains !== void 0 && Object.getPrototypeOf(r).contains.call(r, e) ? !0 : w(r.children).some(function(t) {
|
|
372
|
+
var n;
|
|
373
|
+
if (t instanceof HTMLIFrameElement) {
|
|
374
|
+
var o = (n = t.contentDocument) === null || n === void 0 ? void 0 : n.body;
|
|
375
|
+
return o ? T(o, e) : !1;
|
|
376
|
+
}
|
|
377
|
+
return T(t, e);
|
|
378
|
+
});
|
|
379
|
+
}, ft = function(r) {
|
|
380
|
+
for (var e = /* @__PURE__ */ new Set(), t = r.length, n = 0; n < t; n += 1) for (var o = n + 1; o < t; o += 1) {
|
|
381
|
+
var u = r[n].compareDocumentPosition(r[o]);
|
|
382
|
+
(u & Node.DOCUMENT_POSITION_CONTAINED_BY) > 0 && e.add(o), (u & Node.DOCUMENT_POSITION_CONTAINS) > 0 && e.add(n);
|
|
383
|
+
}
|
|
384
|
+
return r.filter(function(a, f) {
|
|
385
|
+
return !e.has(f);
|
|
386
|
+
});
|
|
387
|
+
}, Yr = function(r) {
|
|
388
|
+
return r.parentNode ? Yr(r.parentNode) : r;
|
|
389
|
+
}, mr = function(r) {
|
|
390
|
+
return P(r).filter(Boolean).reduce(function(e, t) {
|
|
391
|
+
var n = t.getAttribute(nr);
|
|
392
|
+
return e.push.apply(e, n ? ft(w(Yr(t).querySelectorAll("[".concat(nr, '="').concat(n, '"]:not([').concat(kr, '="disabled"])')))) : [t]), e;
|
|
393
|
+
}, []);
|
|
394
|
+
}, st = function(r) {
|
|
395
|
+
try {
|
|
396
|
+
return r();
|
|
397
|
+
} catch {
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
}, G = function(r) {
|
|
401
|
+
if (r === void 0 && (r = document), !(!r || !r.activeElement)) {
|
|
402
|
+
var e = r.activeElement;
|
|
403
|
+
return e.shadowRoot ? G(e.shadowRoot) : e instanceof HTMLIFrameElement && st(function() {
|
|
404
|
+
return e.contentWindow.document;
|
|
405
|
+
}) ? G(e.contentWindow.document) : e;
|
|
406
|
+
}
|
|
407
|
+
}, dt = function(r, e) {
|
|
408
|
+
return r === e;
|
|
409
|
+
}, lt = function(r, e) {
|
|
410
|
+
return !!w(r.querySelectorAll("iframe")).some(function(t) {
|
|
411
|
+
return dt(t, e);
|
|
412
|
+
});
|
|
413
|
+
}, zr = function(r, e) {
|
|
414
|
+
return e === void 0 && (e = G(Ur(r).ownerDocument)), !e || e.dataset && e.dataset.focusGuard ? !1 : mr(r).some(function(t) {
|
|
415
|
+
return T(t, e) || lt(t, e);
|
|
416
|
+
});
|
|
417
|
+
}, vt = function(r) {
|
|
418
|
+
r === void 0 && (r = document);
|
|
419
|
+
var e = G(r);
|
|
420
|
+
return e ? w(r.querySelectorAll("[".concat(Le, "]"))).some(function(t) {
|
|
421
|
+
return T(t, e);
|
|
422
|
+
}) : !1;
|
|
423
|
+
}, mt = function(r, e) {
|
|
424
|
+
return e.filter($r).filter(function(t) {
|
|
425
|
+
return t.name === r.name;
|
|
426
|
+
}).filter(function(t) {
|
|
427
|
+
return t.checked;
|
|
428
|
+
})[0] || r;
|
|
429
|
+
}, pr = function(r, e) {
|
|
430
|
+
return $r(r) && r.name ? mt(r, e) : r;
|
|
431
|
+
}, pt = function(r) {
|
|
432
|
+
var e = /* @__PURE__ */ new Set();
|
|
433
|
+
return r.forEach(function(t) {
|
|
434
|
+
return e.add(pr(t, r));
|
|
435
|
+
}), r.filter(function(t) {
|
|
436
|
+
return e.has(t);
|
|
437
|
+
});
|
|
438
|
+
}, Nr = function(r) {
|
|
439
|
+
return r[0] && r.length > 1 ? pr(r[0], r) : r[0];
|
|
440
|
+
}, Tr = function(r, e) {
|
|
441
|
+
return r.indexOf(pr(e, r));
|
|
442
|
+
}, Pr = "NEW_FOCUS", bt = function(r, e, t, n, o) {
|
|
443
|
+
var u = r.length, a = r[0], f = r[u - 1], v = fr(n);
|
|
444
|
+
if (!(n && r.indexOf(n) >= 0)) {
|
|
445
|
+
var c = n !== void 0 ? t.indexOf(n) : -1, m = o ? t.indexOf(o) : c, s = o ? r.indexOf(o) : -1;
|
|
446
|
+
if (c === -1)
|
|
447
|
+
return s !== -1 ? s : Pr;
|
|
448
|
+
if (s === -1) return Pr;
|
|
449
|
+
var i = c - m, l = t.indexOf(a), p = t.indexOf(f), h = pt(t), F = n !== void 0 ? h.indexOf(n) : -1, x = o ? h.indexOf(o) : F, b = h.filter(function(Y) {
|
|
450
|
+
return Y.tabIndex >= 0;
|
|
451
|
+
}), y = n !== void 0 ? b.indexOf(n) : -1, E = o ? b.indexOf(o) : y, S = y >= 0 && E >= 0 ? E - y : x - F;
|
|
452
|
+
if (!i && s >= 0 || e.length === 0) return s;
|
|
453
|
+
var H = Tr(r, e[0]), V = Tr(r, e[e.length - 1]);
|
|
454
|
+
if (c <= l && v && Math.abs(i) > 1) return V;
|
|
455
|
+
if (c >= p && v && Math.abs(i) > 1) return H;
|
|
456
|
+
if (i && Math.abs(S) > 1) return s;
|
|
457
|
+
if (c <= l) return V;
|
|
458
|
+
if (c > p) return H;
|
|
459
|
+
if (i)
|
|
460
|
+
return Math.abs(i) > 1 ? s : (u + s + i) % u;
|
|
461
|
+
}
|
|
462
|
+
}, ht = function(r) {
|
|
463
|
+
return function(e) {
|
|
464
|
+
var t, n = (t = Vr(e)) === null || t === void 0 ? void 0 : t.autofocus;
|
|
465
|
+
return e.autofocus || n !== void 0 && n !== "false" || r.indexOf(e) >= 0;
|
|
466
|
+
};
|
|
467
|
+
}, _r = function(r, e, t) {
|
|
468
|
+
var n = r.map(function(u) {
|
|
469
|
+
return u.node;
|
|
470
|
+
}), o = Sr(n.filter(ht(t)));
|
|
471
|
+
return o && o.length ? Nr(o) : Nr(Sr(e));
|
|
472
|
+
}, ar = function(r, e) {
|
|
473
|
+
return e === void 0 && (e = []), e.push(r), r.parentNode && ar(r.parentNode.host || r.parentNode, e), e;
|
|
474
|
+
}, rr = function(r, e) {
|
|
475
|
+
for (var t = ar(r), n = ar(e), o = 0; o < t.length; o += 1) {
|
|
476
|
+
var u = t[o];
|
|
477
|
+
if (n.indexOf(u) >= 0) return u;
|
|
478
|
+
}
|
|
479
|
+
return !1;
|
|
480
|
+
}, Jr = function(r, e, t) {
|
|
481
|
+
var n = P(r), o = P(e), u = n[0], a = !1;
|
|
482
|
+
return o.filter(Boolean).forEach(function(f) {
|
|
483
|
+
a = rr(a || f, f) || a, t.filter(Boolean).forEach(function(v) {
|
|
484
|
+
var c = rr(u, v);
|
|
485
|
+
c && (!a || T(c, a) ? a = c : a = rr(c, a));
|
|
486
|
+
});
|
|
487
|
+
}), a;
|
|
488
|
+
}, Ar = function(r, e) {
|
|
489
|
+
return r.reduce(function(t, n) {
|
|
490
|
+
return t.concat(ct(n, e));
|
|
491
|
+
}, []);
|
|
492
|
+
}, yt = function(r, e) {
|
|
493
|
+
var t = /* @__PURE__ */ new Map();
|
|
494
|
+
return e.forEach(function(n) {
|
|
495
|
+
return t.set(n.node, n);
|
|
496
|
+
}), r.map(function(n) {
|
|
497
|
+
return t.get(n);
|
|
498
|
+
}).filter(et);
|
|
499
|
+
}, gt = function(r, e) {
|
|
500
|
+
var t = G(P(r).length > 0 ? document : Ur(r).ownerDocument), n = mr(r).filter(ur), o = Jr(t || r, r, n), u = /* @__PURE__ */ new Map(), a = B(n, u), f = a.filter(function(p) {
|
|
501
|
+
var h = p.node;
|
|
502
|
+
return ur(h);
|
|
503
|
+
});
|
|
504
|
+
if (f[0]) {
|
|
505
|
+
var v = B([o], u).map(function(p) {
|
|
506
|
+
return p.node;
|
|
507
|
+
}), c = yt(v, f), m = c.map(function(p) {
|
|
508
|
+
return p.node;
|
|
509
|
+
}), s = c.filter(function(p) {
|
|
510
|
+
return p.tabIndex >= 0;
|
|
511
|
+
}).map(function(p) {
|
|
512
|
+
return p.node;
|
|
513
|
+
}), i = bt(m, s, v, t, e);
|
|
514
|
+
if (i === "NEW_FOCUS") {
|
|
515
|
+
var l = _r(a, s, Ar(n, u)) || _r(a, m, Ar(n, u));
|
|
516
|
+
if (l) return { node: l };
|
|
517
|
+
console.warn("focus-lock: cannot find any node to move focus into");
|
|
518
|
+
return;
|
|
519
|
+
}
|
|
520
|
+
return i === void 0 ? i : c[i];
|
|
521
|
+
}
|
|
522
|
+
}, Ft = function(r) {
|
|
523
|
+
var e = mr(r).filter(ur), t = Jr(r, r, e), n = sr(C([t], !0), !0, !0), o = C(e, !1);
|
|
524
|
+
return n.map(function(u) {
|
|
525
|
+
var a = u.node;
|
|
526
|
+
return {
|
|
527
|
+
node: a,
|
|
528
|
+
index: u.index,
|
|
529
|
+
lockItem: o.indexOf(a) >= 0,
|
|
530
|
+
guard: fr(a)
|
|
531
|
+
};
|
|
532
|
+
});
|
|
533
|
+
}, br = function(r, e) {
|
|
534
|
+
r && ("focus" in r && r.focus(e), "contentWindow" in r && r.contentWindow && r.contentWindow.focus());
|
|
535
|
+
}, er = 0, tr = !1, Qr = function(r, e, t) {
|
|
536
|
+
t === void 0 && (t = {});
|
|
537
|
+
var n = gt(r, e);
|
|
538
|
+
if (!tr && n) {
|
|
539
|
+
if (er > 2) {
|
|
540
|
+
console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"), tr = !0, setTimeout(function() {
|
|
541
|
+
tr = !1;
|
|
542
|
+
}, 1);
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
er++, br(n.node, t.focusOptions), er--;
|
|
546
|
+
}
|
|
547
|
+
};
|
|
548
|
+
function k(r) {
|
|
549
|
+
if (!r) return null;
|
|
550
|
+
if (typeof WeakRef > "u") return function() {
|
|
551
|
+
return r || null;
|
|
552
|
+
};
|
|
553
|
+
var e = r ? new WeakRef(r) : null;
|
|
554
|
+
return function() {
|
|
555
|
+
return e?.deref() || null;
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
var Et = function(r) {
|
|
559
|
+
if (!r) return null;
|
|
560
|
+
for (var e = [], t = r; t && t !== document.body; )
|
|
561
|
+
e.push({
|
|
562
|
+
current: k(t),
|
|
563
|
+
parent: k(t.parentElement),
|
|
564
|
+
left: k(t.previousElementSibling),
|
|
565
|
+
right: k(t.nextElementSibling)
|
|
566
|
+
}), t = t.parentElement;
|
|
567
|
+
return {
|
|
568
|
+
element: k(r),
|
|
569
|
+
stack: e,
|
|
570
|
+
ownerDocument: r.ownerDocument
|
|
571
|
+
};
|
|
572
|
+
}, Ot = function(r) {
|
|
573
|
+
var e, t, n, o, u;
|
|
574
|
+
if (r)
|
|
575
|
+
for (var a = r.stack, f = r.ownerDocument, v = /* @__PURE__ */ new Map(), c = 0, m = a; c < m.length; c++) {
|
|
576
|
+
var s = m[c], i = (e = s.parent) === null || e === void 0 ? void 0 : e.call(s);
|
|
577
|
+
if (i && f.contains(i)) {
|
|
578
|
+
for (var l = (t = s.left) === null || t === void 0 ? void 0 : t.call(s), p = s.current(), h = i.contains(p) ? p : void 0, F = (n = s.right) === null || n === void 0 ? void 0 : n.call(s), x = vr([i], v), b = (u = (o = h ?? l?.nextElementSibling) !== null && o !== void 0 ? o : F) !== null && u !== void 0 ? u : l; b; ) {
|
|
579
|
+
for (var y = 0, E = x; y < E.length; y++) {
|
|
580
|
+
var S = E[y];
|
|
581
|
+
if (b?.contains(S.node)) return S.node;
|
|
582
|
+
}
|
|
583
|
+
b = b.nextElementSibling;
|
|
584
|
+
}
|
|
585
|
+
if (x.length) return x[0].node;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}, Xr = function(r) {
|
|
589
|
+
var e = Et(r);
|
|
590
|
+
return function() {
|
|
591
|
+
return Ot(e);
|
|
592
|
+
};
|
|
593
|
+
}, xt = function(r, e, t) {
|
|
594
|
+
if (!r || !e)
|
|
595
|
+
return console.error("no element or scope given"), {};
|
|
596
|
+
var n = P(e);
|
|
597
|
+
if (n.every(function(a) {
|
|
598
|
+
return !T(a, r);
|
|
599
|
+
}))
|
|
600
|
+
return console.error("Active element is not contained in the scope"), {};
|
|
601
|
+
var o = t ? vr(n, /* @__PURE__ */ new Map()) : B(n, /* @__PURE__ */ new Map()), u = o.findIndex(function(a) {
|
|
602
|
+
return a.node === r;
|
|
603
|
+
});
|
|
604
|
+
if (u !== -1)
|
|
605
|
+
return {
|
|
606
|
+
prev: o[u - 1],
|
|
607
|
+
next: o[u + 1],
|
|
608
|
+
first: o[0],
|
|
609
|
+
last: o[o.length - 1]
|
|
610
|
+
};
|
|
611
|
+
}, wt = function(r, e) {
|
|
612
|
+
var t = e ? vr(P(r), /* @__PURE__ */ new Map()) : B(P(r), /* @__PURE__ */ new Map());
|
|
613
|
+
return {
|
|
614
|
+
first: t[0],
|
|
615
|
+
last: t[t.length - 1]
|
|
616
|
+
};
|
|
617
|
+
}, It = function(r) {
|
|
618
|
+
return Object.assign({
|
|
619
|
+
scope: document.body,
|
|
620
|
+
cycle: !0,
|
|
621
|
+
onlyTabbable: !0
|
|
622
|
+
}, r);
|
|
623
|
+
}, Zr = function(r, e, t) {
|
|
624
|
+
e === void 0 && (e = {});
|
|
625
|
+
var n = It(e), o = xt(r, n.scope, n.onlyTabbable);
|
|
626
|
+
if (o) {
|
|
627
|
+
var u = t(o, n.cycle);
|
|
628
|
+
u && br(u.node, n.focusOptions);
|
|
629
|
+
}
|
|
630
|
+
}, St = function(r, e) {
|
|
631
|
+
e === void 0 && (e = {}), Zr(r, e, function(t, n) {
|
|
632
|
+
var o = t.next, u = t.first;
|
|
633
|
+
return o || n && u;
|
|
634
|
+
});
|
|
635
|
+
}, Nt = function(r, e) {
|
|
636
|
+
e === void 0 && (e = {}), Zr(r, e, function(t, n) {
|
|
637
|
+
var o = t.prev, u = t.last;
|
|
638
|
+
return o || n && u;
|
|
639
|
+
});
|
|
640
|
+
}, re = function(r, e, t) {
|
|
641
|
+
var n, o = wt(r, (n = e.onlyTabbable) !== null && n !== void 0 ? n : !0)[t];
|
|
642
|
+
o && br(o.node, e.focusOptions);
|
|
643
|
+
}, Tt = function(r, e) {
|
|
644
|
+
e === void 0 && (e = {}), re(r, e, "first");
|
|
645
|
+
}, Pt = function(r, e) {
|
|
646
|
+
e === void 0 && (e = {}), re(r, e, "last");
|
|
647
|
+
};
|
|
648
|
+
function hr(r) {
|
|
649
|
+
setTimeout(r, 1);
|
|
650
|
+
}
|
|
651
|
+
var _t = function(e) {
|
|
652
|
+
return e && "current" in e ? e.current : e;
|
|
653
|
+
}, ee = function() {
|
|
654
|
+
return document && document.activeElement === document.body;
|
|
655
|
+
}, At = function() {
|
|
656
|
+
return ee() || vt();
|
|
657
|
+
}, D = null, g = null, Dr = function() {
|
|
658
|
+
return null;
|
|
659
|
+
}, M = null, j = !1, yr = !1, Dt = function() {
|
|
660
|
+
return !0;
|
|
661
|
+
}, Mt = function(e) {
|
|
662
|
+
return (D.whiteList || Dt)(e);
|
|
663
|
+
}, Ct = function(e, t) {
|
|
664
|
+
M = {
|
|
665
|
+
observerNode: e,
|
|
666
|
+
portaledElement: t
|
|
667
|
+
};
|
|
668
|
+
}, Lt = function(e) {
|
|
669
|
+
return M && M.portaledElement === e;
|
|
670
|
+
};
|
|
671
|
+
function Mr(r, e, t, n) {
|
|
672
|
+
var o = null, u = r;
|
|
673
|
+
do {
|
|
674
|
+
var a = n[u];
|
|
675
|
+
if (a.guard)
|
|
676
|
+
a.node.dataset.focusAutoGuard && (o = a);
|
|
677
|
+
else if (a.lockItem) {
|
|
678
|
+
if (u !== r) return;
|
|
679
|
+
o = null;
|
|
680
|
+
} else break;
|
|
681
|
+
} while ((u += t) !== e);
|
|
682
|
+
o && (o.node.tabIndex = 0);
|
|
683
|
+
}
|
|
684
|
+
var kt = function(e) {
|
|
685
|
+
return e ? !!j : j === "meanwhile";
|
|
686
|
+
}, Rt = function r(e, t, n) {
|
|
687
|
+
return t && (t.host === e && (!t.activeElement || n.contains(t.activeElement)) || t.parentNode && r(e, t.parentNode, n));
|
|
688
|
+
}, Wt = function(e, t) {
|
|
689
|
+
return t.some(function(n) {
|
|
690
|
+
return Rt(e, n, n);
|
|
691
|
+
});
|
|
692
|
+
}, te = function(e) {
|
|
693
|
+
return B(e, /* @__PURE__ */ new Map());
|
|
694
|
+
}, Ut = function(e) {
|
|
695
|
+
return !te([e.parentNode]).some(function(t) {
|
|
696
|
+
return t.node === e;
|
|
697
|
+
});
|
|
698
|
+
}, $ = function() {
|
|
699
|
+
var e = !1;
|
|
700
|
+
if (D) {
|
|
701
|
+
var t = D, n = t.observed, o = t.persistentFocus, u = t.autoFocus, a = t.shards, f = t.crossFrame, v = t.focusOptions, c = t.noFocusGuards, m = n || M && M.portaledElement;
|
|
702
|
+
if (ee() && g && g !== document.body && (!document.body.contains(g) || Ut(g))) {
|
|
703
|
+
var s = Dr();
|
|
704
|
+
s && s.focus();
|
|
705
|
+
}
|
|
706
|
+
var i = document && document.activeElement;
|
|
707
|
+
if (m) {
|
|
708
|
+
var l = [m].concat(a.map(_t).filter(Boolean)), p = function() {
|
|
709
|
+
if (!kt(f) || !c || !g || yr) return !1;
|
|
710
|
+
var y = te(l), E = y.findIndex(function(S) {
|
|
711
|
+
return S.node === g;
|
|
712
|
+
});
|
|
713
|
+
return E === 0 || E === y.length - 1;
|
|
714
|
+
};
|
|
715
|
+
if ((!i || Mt(i)) && (o || p() || !At() || !g && u) && (m && !(zr(l) || i && Wt(i, l) || Lt(i, m)) && (document && !g && i && !u ? (i.blur && i.blur(), document.body.focus()) : (e = Qr(l, g, { focusOptions: v }), M = {})), g = document && document.activeElement, g !== document.body && (Dr = Xr(g)), j = !1), document && i !== document.activeElement && document.querySelector("[data-focus-auto-guard]")) {
|
|
716
|
+
var h = document && document.activeElement, F = Ft(l), x = F.map(function(b) {
|
|
717
|
+
return b.node;
|
|
718
|
+
}).indexOf(h);
|
|
719
|
+
x > -1 && (F.filter(function(b) {
|
|
720
|
+
var y = b.guard, E = b.node;
|
|
721
|
+
return y && E.dataset.focusAutoGuard;
|
|
722
|
+
}).forEach(function(b) {
|
|
723
|
+
return b.node.removeAttribute("tabIndex");
|
|
724
|
+
}), Mr(x, F.length, 1, F), Mr(x, -1, -1, F));
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
return e;
|
|
729
|
+
}, ne = function(e) {
|
|
730
|
+
$() && e && (e.stopPropagation(), e.preventDefault());
|
|
731
|
+
}, K = function() {
|
|
732
|
+
return hr($);
|
|
733
|
+
}, oe = function(e) {
|
|
734
|
+
var t = e.target, n = e.currentTarget;
|
|
735
|
+
n.contains(t) || Ct(n, t);
|
|
736
|
+
}, Bt = function() {
|
|
737
|
+
return null;
|
|
738
|
+
}, Gt = function(e) {
|
|
739
|
+
var t = e.children;
|
|
740
|
+
return /* @__PURE__ */ O.createElement("div", {
|
|
741
|
+
onBlur: K,
|
|
742
|
+
onFocus: oe
|
|
743
|
+
}, t);
|
|
744
|
+
};
|
|
745
|
+
Gt.propTypes = process.env.NODE_ENV !== "production" ? { children: d.default.node.isRequired } : {};
|
|
746
|
+
var ue = function() {
|
|
747
|
+
yr = !0;
|
|
748
|
+
}, ae = function() {
|
|
749
|
+
yr = !1, j = "just", hr(function() {
|
|
750
|
+
j = "meanwhile";
|
|
751
|
+
});
|
|
752
|
+
}, jt = function() {
|
|
753
|
+
document.addEventListener("focusin", ne), document.addEventListener("focusout", K), window.addEventListener("focus", ue), window.addEventListener("blur", ae);
|
|
754
|
+
}, Ht = function() {
|
|
755
|
+
document.removeEventListener("focusin", ne), document.removeEventListener("focusout", K), window.removeEventListener("focus", ue), window.removeEventListener("blur", ae);
|
|
756
|
+
};
|
|
757
|
+
function Vt(r) {
|
|
758
|
+
return r.filter(function(e) {
|
|
759
|
+
return !e.disabled;
|
|
760
|
+
});
|
|
761
|
+
}
|
|
762
|
+
var ie = {
|
|
763
|
+
moveFocusInside: Qr,
|
|
764
|
+
focusInside: zr,
|
|
765
|
+
focusNextElement: St,
|
|
766
|
+
focusPrevElement: Nt,
|
|
767
|
+
focusFirstElement: Tt,
|
|
768
|
+
focusLastElement: Pt,
|
|
769
|
+
captureFocusRestore: Xr
|
|
770
|
+
};
|
|
771
|
+
function qt(r) {
|
|
772
|
+
var e = r.slice(-1)[0];
|
|
773
|
+
e && !D && jt();
|
|
774
|
+
var t = D, n = t && e && e.id === t.id;
|
|
775
|
+
D = e, t && !n && (t.onDeactivation(), r.filter(function(o) {
|
|
776
|
+
return o.id === t.id;
|
|
777
|
+
}).length || t.returnFocus(!e)), e ? (g = null, (!n || t.observed !== e.observed) && e.onActivation(ie), $(!0), hr($)) : (Ht(), g = null);
|
|
778
|
+
}
|
|
779
|
+
Rr.assignSyncMedium(oe);
|
|
780
|
+
Wr.assignMedium(K);
|
|
781
|
+
Ue.assignMedium(function(r) {
|
|
782
|
+
return r(ie);
|
|
783
|
+
});
|
|
784
|
+
var $t = Ke(Vt, qt)(Bt), ce = /* @__PURE__ */ Lr(function(e, t) {
|
|
785
|
+
return /* @__PURE__ */ O.createElement(cr, W({
|
|
786
|
+
sideCar: $t,
|
|
787
|
+
ref: t
|
|
788
|
+
}, e));
|
|
789
|
+
}), fe = cr.propTypes || {};
|
|
790
|
+
fe.sideCar;
|
|
791
|
+
var Kt = Ce(fe, ["sideCar"]);
|
|
792
|
+
ce.propTypes = process.env.NODE_ENV !== "production" ? Kt : {};
|
|
793
|
+
var Xt = ce;
|
|
794
|
+
export {
|
|
795
|
+
Xt as t
|
|
796
|
+
};
|