@konstructio/ui 0.1.2-alpha.77 → 0.1.2-alpha.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AdditionalOptions-Cx9wU01w.js +37 -0
- package/dist/AlertDialogTrigger-C-NMEoDd.js +146 -0
- package/dist/Breadcrumb-C95aOsYk.js +77 -0
- package/dist/CalendarPanel.css +1 -1
- package/dist/Checkbox-Cn0UWlk8.js +239 -0
- package/dist/Combination-DUTBK_qM.js +486 -0
- package/dist/CommandInput-BKv-EZ7T.js +76 -0
- package/dist/Counter-DtQu_T-D.js +191 -0
- package/dist/DayPicker-CNWQ1Oyd.js +2884 -0
- package/dist/DropdownButton-B2XkEqPt.js +92 -0
- package/dist/FlagSelectorList-C17nmEBM.js +597 -0
- package/dist/ImageUpload-BzXjGZ2w.js +181 -0
- package/dist/Input-GBMxM3Z7.js +188 -0
- package/dist/Loading-DKqxR-oV.js +16 -0
- package/dist/Modal-DbTe8PVX.js +76 -0
- package/dist/Spinner-CyuXAaC8.js +41 -0
- package/dist/StepIndicatorContent-D5z1Ziqg.js +30 -0
- package/dist/Switch-DjbC0A8y.js +136 -0
- package/dist/Toast-C3XjAvtC.js +478 -0
- package/dist/Wrapper-BWSOaT1y.js +1056 -0
- package/dist/Wrapper-CjUokv72.js +110 -0
- package/dist/Wrapper-DEJ-hyar.js +161 -0
- package/dist/assets/icons/components/Accounts.js +21 -23
- package/dist/assets/icons/components/AddChart.js +18 -20
- package/dist/assets/icons/components/AlertOutline.js +18 -20
- package/dist/assets/icons/components/AppRepo.js +18 -20
- package/dist/assets/icons/components/Apps.js +18 -20
- package/dist/assets/icons/components/Archives.js +18 -20
- package/dist/assets/icons/components/ArrowDown.js +18 -20
- package/dist/assets/icons/components/ArrowLeft.js +18 -20
- package/dist/assets/icons/components/ArrowRight.js +17 -19
- package/dist/assets/icons/components/ArrowUp.js +18 -20
- package/dist/assets/icons/components/BarChart.js +28 -24
- package/dist/assets/icons/components/BookOpen.js +22 -20
- package/dist/assets/icons/components/CalendarMonth.js +18 -20
- package/dist/assets/icons/components/Check.js +18 -20
- package/dist/assets/icons/components/CheckCircleFilled.js +28 -25
- package/dist/assets/icons/components/CheckCircleOutline.js +18 -20
- package/dist/assets/icons/components/CheckboxMarkedCircleOutline.js +18 -20
- package/dist/assets/icons/components/ClockAlert.js +18 -20
- package/dist/assets/icons/components/ClockOutline.js +18 -20
- package/dist/assets/icons/components/Close.js +18 -20
- package/dist/assets/icons/components/Cloud.js +12 -17
- package/dist/assets/icons/components/CloudLockOutline.js +18 -20
- package/dist/assets/icons/components/Clusters.js +28 -24
- package/dist/assets/icons/components/CogOutline.js +18 -20
- package/dist/assets/icons/components/Copy.js +18 -20
- package/dist/assets/icons/components/Cpu.js +25 -23
- package/dist/assets/icons/components/Cube.js +18 -20
- package/dist/assets/icons/components/Datacenter.js +18 -20
- package/dist/assets/icons/components/Delete.js +18 -20
- package/dist/assets/icons/components/DollarSign.js +20 -20
- package/dist/assets/icons/components/Download.js +17 -19
- package/dist/assets/icons/components/Edit.js +18 -20
- package/dist/assets/icons/components/Ellipses.js +18 -20
- package/dist/assets/icons/components/Environments.js +20 -20
- package/dist/assets/icons/components/Error.js +18 -20
- package/dist/assets/icons/components/ErrorOutline.js +18 -20
- package/dist/assets/icons/components/Exclamation.js +21 -20
- package/dist/assets/icons/components/Git.js +15 -17
- package/dist/assets/icons/components/GitOpsCatalog.js +25 -23
- package/dist/assets/icons/components/GridView.js +15 -20
- package/dist/assets/icons/components/Help.js +24 -25
- package/dist/assets/icons/components/HideOutline.js +21 -23
- package/dist/assets/icons/components/Home.js +18 -20
- package/dist/assets/icons/components/Home2.js +21 -20
- package/dist/assets/icons/components/Id.js +17 -19
- package/dist/assets/icons/components/InfoCircle.js +28 -25
- package/dist/assets/icons/components/InformationOutline.js +18 -20
- package/dist/assets/icons/components/InvoiceList.js +18 -20
- package/dist/assets/icons/components/Key.js +18 -20
- package/dist/assets/icons/components/LightBulb.js +27 -23
- package/dist/assets/icons/components/Loader.js +18 -20
- package/dist/assets/icons/components/Network.js +18 -20
- package/dist/assets/icons/components/PagesStack.js +24 -25
- package/dist/assets/icons/components/Pageview.js +18 -20
- package/dist/assets/icons/components/People.js +18 -20
- package/dist/assets/icons/components/PhotoLibrary.js +14 -16
- package/dist/assets/icons/components/Pipeline.js +20 -20
- package/dist/assets/icons/components/Plus.js +18 -20
- package/dist/assets/icons/components/PowerSettings.js +18 -20
- package/dist/assets/icons/components/Preview.js +18 -20
- package/dist/assets/icons/components/ReceiptLong.js +15 -20
- package/dist/assets/icons/components/Refresh.js +18 -20
- package/dist/assets/icons/components/ScatterPlot.js +15 -20
- package/dist/assets/icons/components/Search.js +30 -25
- package/dist/assets/icons/components/Server.js +18 -20
- package/dist/assets/icons/components/Start.js +18 -20
- package/dist/assets/icons/components/TabNew.js +34 -24
- package/dist/assets/icons/components/Teams.js +17 -19
- package/dist/assets/icons/components/Upload.js +18 -20
- package/dist/assets/icons/components/Warning.js +18 -20
- package/dist/assets/icons/components/WarningTriangle.js +18 -20
- package/dist/assets/icons/components/X.js +18 -20
- package/dist/assets/icons/components/index.js +82 -82
- package/dist/assets/icons/index.js +88 -88
- package/dist/chevron-down-DgssmYWu.js +8 -0
- package/dist/chevron-left-DRJXef9g.js +8 -0
- package/dist/chevron-right-BooB_b7g.js +8 -0
- package/dist/chevron-up-DuS9MUNr.js +8 -0
- package/dist/chunk-D1xtDmiO.js +31 -0
- package/dist/{clsx-OuTLNxxd.js → clsx-kDhLfUq2.js} +1 -1
- package/dist/components/Alert/Alert.js +58 -79
- package/dist/components/Alert/Alert.variants.js +86 -46
- package/dist/components/AlertDialog/AlertDialog.js +71 -103
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +2 -7
- package/dist/components/AlertDialog/components/index.js +2 -2
- package/dist/components/AlertDialog/hooks/useAlertDialog.js +12 -25
- package/dist/components/Autocomplete/Autocomplete.js +58 -54
- package/dist/components/Autocomplete/Autocomplete.variants.js +26 -2
- package/dist/components/Autocomplete/components/List/List.js +33 -48
- package/dist/components/Autocomplete/components/List/List.variants.js +33 -5
- package/dist/components/Autocomplete/components/index.js +2 -2
- package/dist/components/Autocomplete/hooks/useAutocomplete.js +32 -79
- package/dist/components/Autocomplete/hooks/useNavigationList.js +47 -65
- package/dist/components/Badge/Badge.js +62 -66
- package/dist/components/Badge/Badge.variants.js +69 -16
- package/dist/components/Breadcrumb/Breadcrumb.js +2 -97
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +14 -4
- package/dist/components/Breadcrumb/components/Item/Item.js +33 -33
- package/dist/components/Breadcrumb/components/Item/Item.variants.js +47 -23
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +2 -2
- package/dist/components/Button/Button.js +22 -37
- package/dist/components/Button/Button.variants.js +294 -75
- package/dist/components/ButtonGroup/ButtonGroup.js +84 -101
- package/dist/components/ButtonGroup/ButtonGroup.variants.js +29 -14
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.js +57 -105
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.variants.js +60 -27
- package/dist/components/ButtonGroup/components/ButtonGroupItem/index.js +2 -2
- package/dist/components/ButtonGroup/components/ButtonGroupLabel/ButtonGroupLabel.js +20 -25
- package/dist/components/ButtonGroup/components/ButtonGroupLabel/index.js +2 -2
- package/dist/components/ButtonGroup/components/ButtonGroupMessage/ButtonGroupMessage.js +16 -28
- package/dist/components/ButtonGroup/components/index.js +6 -6
- package/dist/components/ButtonGroup/hooks/index.js +2 -2
- package/dist/components/ButtonGroup/hooks/useButtonGroup.js +49 -64
- package/dist/components/Card/Card.js +22 -34
- package/dist/components/Card/Card.variants.js +26 -13
- package/dist/components/Checkbox/Checkbox.js +2 -343
- package/dist/components/Checkbox/Checkbox.variants.js +50 -13
- package/dist/components/Command/Command.js +29 -46
- package/dist/components/Command/Command.variants.js +46 -3
- package/dist/components/Command/components/Command.js +14 -19
- package/dist/components/Command/components/CommandEmpty.js +9 -10
- package/dist/components/Command/components/CommandGroup.js +10 -18
- package/dist/components/Command/components/CommandInput.js +2 -90
- package/dist/components/Command/components/CommandItem.js +17 -28
- package/dist/components/Command/components/CommandList.js +11 -19
- package/dist/components/Command/components/CommandSeparator.js +11 -19
- package/dist/components/Command/components/CommandShortcut.js +7 -16
- package/dist/components/Command/components/DialogContent.js +20 -35
- package/dist/components/Command/components/DialogOverlay.js +11 -19
- package/dist/components/Command/components/index.js +16 -16
- package/dist/components/Command/contexts/Command.context.js +1 -1
- package/dist/components/Command/contexts/Command.provider.js +15 -23
- package/dist/components/Command/contexts/index.js +2 -2
- package/dist/components/Counter/Counter.js +3 -206
- package/dist/components/Counter/Counter.variants.js +53 -19
- package/dist/components/DateRangePicker/DateRangePicker.js +77 -93
- package/dist/components/DateRangePicker/DateRangePicker.variants.js +23 -4
- package/dist/components/DateRangePicker/components/CalendarPanel/CalendarPanel.js +75 -81
- package/dist/components/DateRangePicker/components/CalendarPanel/CalendarPanel.variants.js +54 -10
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarDivider/CalendarDivider.js +8 -14
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +35 -50
- package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +179 -107
- package/dist/components/DateRangePicker/components/CalendarPanel/components/NavigationButton/NavigationButton.js +19 -34
- package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +78 -61
- package/dist/components/DateRangePicker/components/CalendarPanel/components/index.js +6 -6
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/dayPickerClassNames.js +2 -3
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/index.js +10 -31
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/index.js +19 -19
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useIndependentCarousel.js +121 -144
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.js +82 -53
- package/dist/components/DateRangePicker/components/CalendarPanel/utils/index.js +8 -8
- package/dist/components/DateRangePicker/components/DateTimeInputs/DateTimeInputs.js +60 -69
- package/dist/components/DateRangePicker/components/DateTimeInputs/DateTimeInputs.variants.js +31 -5
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.js +43 -55
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.js +43 -55
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/index.js +2 -2
- package/dist/components/DateRangePicker/components/DateTimeInputs/hooks/index.js +2 -2
- package/dist/components/DateRangePicker/components/DateTimeInputs/hooks/useDateTimeInputs.js +144 -176
- package/dist/components/DateRangePicker/components/PresetPanel/PresetPanel.js +37 -56
- package/dist/components/DateRangePicker/components/PresetPanel/PresetPanel.variants.js +20 -2
- package/dist/components/DateRangePicker/components/index.js +6 -6
- package/dist/components/DateRangePicker/constants/index.js +2 -2
- package/dist/components/DateRangePicker/constants/presets.js +22 -16
- package/dist/components/DateRangePicker/contexts/date-range-picker.context.js +3 -3
- package/dist/components/DateRangePicker/contexts/date-range-picker.hook.js +4 -5
- package/dist/components/DateRangePicker/contexts/date-range-picker.provider.js +114 -187
- package/dist/components/DateRangePicker/contexts/index.js +6 -6
- package/dist/components/DateRangePicker/utils/disabled-dates.js +25 -39
- package/dist/components/DateRangePicker/utils/index.js +20 -20
- package/dist/components/DateRangePicker/utils/presets.js +6 -8
- package/dist/components/DateRangePicker/utils/validation.js +60 -57
- package/dist/components/Datepicker/DatePicker.js +48 -81
- package/dist/components/Datepicker/DatePicker.variants.js +3 -3
- package/dist/components/Divider/Divider.js +6 -17
- package/dist/components/Divider/Divider.variants.js +9 -11
- package/dist/components/Drawer/Drawer.js +73 -109
- package/dist/components/Drawer/Drawer.variants.js +74 -24
- package/dist/components/Drawer/components/Body/Body.js +12 -18
- package/dist/components/Drawer/components/Body/index.js +2 -2
- package/dist/components/Drawer/components/Footer/Footer.js +12 -18
- package/dist/components/Drawer/components/Footer/index.js +2 -2
- package/dist/components/Drawer/components/Header/Header.js +13 -20
- package/dist/components/Drawer/components/Header/index.js +2 -2
- package/dist/components/Drawer/components/index.js +6 -6
- package/dist/components/Drawer/constants/index.js +1 -1
- package/dist/components/Drawer/contexts/Drawer.context.js +3 -3
- package/dist/components/Drawer/contexts/index.js +3 -3
- package/dist/components/Drawer/hooks/index.js +2 -2
- package/dist/components/Drawer/hooks/useDrawer.js +54 -82
- package/dist/components/DropdownButton/DropdownButton.js +2 -118
- package/dist/components/Filter/Filter.js +32 -40
- package/dist/components/Filter/Filter.variants.js +24 -4
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +59 -127
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +73 -84
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +47 -84
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +52 -67
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.js +29 -39
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.js +55 -75
- package/dist/components/Filter/components/ResetButton/ResetButton.js +19 -25
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +73 -84
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.js +48 -83
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.js +81 -81
- package/dist/components/Filter/components/index.js +6 -6
- package/dist/components/Filter/contexts/filter.context.js +2 -4
- package/dist/components/Filter/contexts/filter.hook.js +5 -6
- package/dist/components/Filter/contexts/filter.provider.js +7 -16
- package/dist/components/Filter/contexts/index.js +4 -4
- package/dist/components/Filter/events/index.js +4 -8
- package/dist/components/Filter/utils/index.js +2 -2435
- package/dist/components/ImageUpload/ImageUpload.js +2 -119
- package/dist/components/ImageUpload/ImageUpload.variants.js +86 -51
- package/dist/components/Input/Input.js +2 -161
- package/dist/components/Input/Input.variants.js +46 -11
- package/dist/components/LineChart/LineChart.js +63 -56
- package/dist/components/Loading/Loading.js +2 -22
- package/dist/components/Loading/Loading.variants.js +9 -2
- package/dist/components/Modal/Modal.js +3 -9
- package/dist/components/Modal/components/Body/Body.js +8 -16
- package/dist/components/Modal/components/Footer/Footer.js +8 -16
- package/dist/components/Modal/components/Header/Header.js +8 -16
- package/dist/components/Modal/components/Wrapper/Wrapper.js +2 -11
- package/dist/components/Modal/components/Wrapper/Wrapper.variants.js +29 -2
- package/dist/components/Modal/components/index.js +8 -8
- package/dist/components/Modal/contexts/Modal.context.js +1 -1
- package/dist/components/Modal/contexts/Modal.provider.js +20 -33
- package/dist/components/Modal/contexts/index.js +2 -2
- package/dist/components/Modal/hooks/useModal.js +20 -31
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +2 -26
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +29 -5
- package/dist/components/MultiSelectDropdown/components/Item/Item.js +19 -32
- package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +21 -11
- package/dist/components/MultiSelectDropdown/components/List/List.js +2 -27
- package/dist/components/MultiSelectDropdown/components/List/List.variants.js +23 -3
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +2 -74
- package/dist/components/MultiSelectDropdown/components/index.js +4 -5
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.context.js +4 -4
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.hook.js +3 -4
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.provider.js +94 -122
- package/dist/components/MultiSelectDropdown/contexts/index.js +2 -2
- package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +18 -31
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +11 -18
- package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +37 -14
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +16 -28
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +2 -670
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +22 -20
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +48 -52
- package/dist/components/PhoneNumberInput/components/Wrapper.js +2 -612
- package/dist/components/PhoneNumberInput/components/index.js +4 -4
- package/dist/components/PhoneNumberInput/contexts/index.js +3 -3
- package/dist/components/PhoneNumberInput/contexts/phone-number.context.js +1 -1
- package/dist/components/PhoneNumberInput/contexts/phone-number.hook.js +5 -6
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +2 -6092
- package/dist/components/PhoneNumberInput/utils/index.js +7 -8
- package/dist/components/PieChart/PieChart.js +49 -85
- package/dist/components/ProgressBar/ProgressBar.js +29 -47
- package/dist/components/ProgressBar/ProgressBar.variants.js +24 -14
- package/dist/components/Radio/Radio.js +50 -70
- package/dist/components/Radio/Radio.variants.js +76 -30
- package/dist/components/RadioCard/RadioCard.js +19 -32
- package/dist/components/RadioCard/RadioCard.variants.js +7 -2
- package/dist/components/RadioCardGroup/RadioCardGroup.js +25 -42
- package/dist/components/RadioCardGroup/RadioCardGroup.variants.js +8 -12
- package/dist/components/RadioGroup/RadioGroup.js +26 -48
- package/dist/components/RadioGroup/RadioGroup.variants.js +8 -12
- package/dist/components/Range/Range.js +49 -83
- package/dist/components/Range/Range.variants.js +46 -25
- package/dist/components/Select/Select.js +36 -56
- package/dist/components/Select/Select.variants.js +59 -5
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.js +2 -10
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.variants.js +3 -3
- package/dist/components/Select/components/EmptyList.js +3 -8
- package/dist/components/Select/components/List/List.js +113 -88
- package/dist/components/Select/components/List/List.variants.js +42 -2
- package/dist/components/Select/components/ListItem/ListItem.js +51 -49
- package/dist/components/Select/components/ListItem/ListItem.variants.js +21 -3
- package/dist/components/Select/components/Wrapper.js +2 -125
- package/dist/components/Select/components/index.js +8 -8
- package/dist/components/Select/constants/index.js +4 -4
- package/dist/components/Select/constants/list.js +2 -2
- package/dist/components/Select/constants/pagination.js +2 -2
- package/dist/components/Select/contexts/index.js +4 -4
- package/dist/components/Select/contexts/select.context.js +2 -2
- package/dist/components/Select/contexts/select.hook.js +6 -7
- package/dist/components/Select/contexts/select.provider.js +39 -42
- package/dist/components/Select/hooks/useNavigationList.js +34 -49
- package/dist/components/Select/hooks/useSelect.js +54 -100
- package/dist/components/Sidebar/Sidebar.js +22 -26
- package/dist/components/Sidebar/Sidebar.variants.js +29 -3
- package/dist/components/Sidebar/components/Footer/Footer.js +9 -18
- package/dist/components/Sidebar/components/Footer/Footer.variants.js +9 -2
- package/dist/components/Sidebar/components/Logo/Logo.js +9 -18
- package/dist/components/Sidebar/components/Logo/Logo.variants.js +20 -2
- package/dist/components/Sidebar/components/Navigation/Navigation.js +17 -26
- package/dist/components/Sidebar/components/Navigation/Navigation.variants.js +8 -3
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.js +14 -33
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.variants.js +6 -2
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +14 -25
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +28 -8
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.js +6 -17
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.variants.js +6 -2
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.js +9 -21
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.variants.js +12 -3
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +27 -34
- package/dist/components/Sidebar/components/index.js +14 -14
- package/dist/components/Slider/Slider.js +38 -70
- package/dist/components/Slider/Slider.variants.js +39 -26
- package/dist/components/Spinner/Spinner.js +2 -56
- package/dist/components/Spinner/Spinner.variants.js +36 -24
- package/dist/components/Stepper/Stepper.js +45 -56
- package/dist/components/Stepper/Stepper.variants.js +174 -77
- package/dist/components/Stepper/components/HorizontalStepItem/HorizontalStepItem.js +120 -151
- package/dist/components/Stepper/components/StepConnector/StepConnector.js +15 -24
- package/dist/components/Stepper/components/StepIndicatorContent/StepIndicatorContent.js +2 -40
- package/dist/components/Stepper/components/StepItem/StepItem.js +6 -15
- package/dist/components/Stepper/components/VerticalStepItem/VerticalStepItem.js +70 -94
- package/dist/components/Stepper/constants/index.js +1 -1
- package/dist/components/Stepper/hooks/index.js +2 -2
- package/dist/components/Stepper/hooks/useStepItemLogic.js +15 -15
- package/dist/components/Stepper/utils/index.js +4 -5
- package/dist/components/Switch/Switch.js +2 -185
- package/dist/components/Switch/Switch.variants.js +41 -2
- package/dist/components/Table/Table.js +18 -29
- package/dist/components/Table/Table.variants.js +29 -12
- package/dist/components/Table/components/Body.js +9 -20
- package/dist/components/Table/components/Filter.js +13 -21
- package/dist/components/Table/components/Head.js +9 -20
- package/dist/components/Table/components/Row.js +14 -28
- package/dist/components/Table/components/index.js +6 -6
- package/dist/components/Tabs/Tabs.js +26 -34
- package/dist/components/Tabs/Tabs.variants.js +54 -42
- package/dist/components/Tabs/components/Content.js +12 -21
- package/dist/components/Tabs/components/List.js +17 -28
- package/dist/components/Tabs/components/Trigger.js +19 -25
- package/dist/components/Tabs/components/index.js +4 -4
- package/dist/components/Tag/Tag.js +26 -33
- package/dist/components/Tag/Tag.variants.js +31 -25
- package/dist/components/TagSelect/TagSelect.js +13 -18
- package/dist/components/TagSelect/TagSelect.variants.js +26 -5
- package/dist/components/TagSelect/components/Item/Item.js +14 -23
- package/dist/components/TagSelect/components/Item/Item.variants.js +16 -12
- package/dist/components/TagSelect/components/List/List.js +17 -22
- package/dist/components/TagSelect/components/List/List.variants.js +21 -3
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +2 -69
- package/dist/components/TagSelect/components/index.js +6 -6
- package/dist/components/TagSelect/contexts/TagSelect.context.js +1 -1
- package/dist/components/TagSelect/contexts/TagSelect.hook.js +6 -7
- package/dist/components/TagSelect/contexts/TagSelect.provider.js +49 -75
- package/dist/components/TagSelect/contexts/index.js +4 -4
- package/dist/components/TagSelect/hooks/useTagSelect.js +18 -31
- package/dist/components/TextArea/TextArea.js +27 -35
- package/dist/components/TextArea/TextArea.variants.js +18 -3
- package/dist/components/TimePicker/TimePicker.js +15 -23
- package/dist/components/TimePicker/TimePicker.variants.js +65 -2
- package/dist/components/TimePicker/components/HoursList/HoursList.js +88 -75
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +53 -79
- package/dist/components/TimePicker/components/MinutesList/MinutesList.js +61 -64
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +134 -143
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +38 -44
- package/dist/components/TimePicker/components/index.js +2 -2
- package/dist/components/TimePicker/contexts/index.js +6 -6
- package/dist/components/TimePicker/contexts/time-picker.context.js +1 -1
- package/dist/components/TimePicker/contexts/time-picker.hook.js +4 -5
- package/dist/components/TimePicker/contexts/time-picker.provider.js +56 -76
- package/dist/components/TimePicker/utils/index.js +17 -19
- package/dist/components/Toast/Toast.js +3 -547
- package/dist/components/Toast/Toast.variants.js +44 -14
- package/dist/components/Tooltip/Tooltip.js +16 -36
- package/dist/components/Typography/Typography.js +16 -27
- package/dist/components/Typography/Typography.variants.js +71 -26
- package/dist/components/VirtualizedTable/VirtualizedTable.js +89 -77
- package/dist/components/VirtualizedTable/VirtualizedTable.types.d.ts +1 -1
- package/dist/components/VirtualizedTable/VirtualizedTable.variants.js +2 -2
- package/dist/components/VirtualizedTable/assets/chevron-down.js +14 -13
- package/dist/components/VirtualizedTable/assets/chevron-up.js +14 -13
- package/dist/components/VirtualizedTable/assets/index.js +4 -4
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +35 -63
- package/dist/components/VirtualizedTable/components/Body/Body.js +49 -57
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +100 -105
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +18 -20
- package/dist/components/VirtualizedTable/components/ExpandableRow/ExpandableRow.js +29 -43
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +110 -117
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +42 -32
- package/dist/components/VirtualizedTable/components/Header/Header.js +33 -58
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +29 -65
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +39 -32
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +39 -52
- package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +9 -19
- package/dist/components/VirtualizedTable/components/index.js +10 -10
- package/dist/components/VirtualizedTable/constants/index.js +3 -3
- package/dist/components/VirtualizedTable/constants/pagination.js +6 -1
- package/dist/components/VirtualizedTable/contexts/index.js +6 -6
- package/dist/components/VirtualizedTable/contexts/table.context.js +3 -3
- package/dist/components/VirtualizedTable/contexts/table.hook.js +7 -8
- package/dist/components/VirtualizedTable/contexts/table.provider.js +2 -239
- package/dist/components/VirtualizedTable/contexts/table.types.d.ts +1 -1
- package/dist/components/VirtualizedTable/events/index.js +19 -24
- package/dist/components/index.js +140 -140
- package/dist/components-DNFycJGm.js +120 -0
- package/dist/constants-D96yCePL.js +31 -0
- package/dist/contexts/index.js +6 -6
- package/dist/contexts/theme.context.js +2 -2
- package/dist/contexts/theme.hook.js +2 -2
- package/dist/contexts/theme.provider.js +2 -96
- package/dist/createLucideIcon-BVGkzDZC.js +42 -0
- package/dist/debounce-CzFlgg9h.js +86 -0
- package/dist/dist-B5SlrgYz.js +263 -0
- package/dist/{index-BZPx6jYI.js → dist-BL-H4bEw2.js} +5 -2
- package/dist/dist-BL8l9uRy.js +361 -0
- package/dist/{index-DLcqcWxM.js → dist-ByyYBtbL.js} +9 -11
- package/dist/dist-C8r5DW7s.js +10 -0
- package/dist/dist-CBnErrr1.js +58 -0
- package/dist/dist-COY3FRYC.js +480 -0
- package/dist/dist-CSP6X06u.js +1701 -0
- package/dist/dist-DNSmoWJp.js +469 -0
- package/dist/dist-DRmqW28Z2.js +7479 -0
- package/dist/dist-DXJSck4j.js +74 -0
- package/dist/dist-DXXHfL7M.js +132 -0
- package/dist/dist-DZNdbzbm.js +120 -0
- package/dist/dist-DZcOdXgW.js +13 -0
- package/dist/dist-DeVdyMHW2.js +31 -0
- package/dist/{index-3fEdeexs.js → dist-DpqiA4Yn.js} +25 -28
- package/dist/dist-DstQl8xY.js +10 -0
- package/dist/dist-DtEbXv47.js +34 -0
- package/dist/dist-uVUx9i0a.js +223 -0
- package/dist/ellipsis-vertical-My0S9QY5.js +24 -0
- package/dist/hooks/index.js +2 -2
- package/dist/hooks/useToggle.js +5 -10
- package/dist/icons.js +88 -88
- package/dist/index.js +150 -149
- package/dist/isObject--aYwGuhx.js +62 -0
- package/dist/libphonenumber-7uXgv7U8.js +81977 -0
- package/dist/package.json +18 -19
- package/dist/phone-number.provider-B5TfHi8y.js +6646 -0
- package/dist/prop-types-DTnODft1.js +547 -0
- package/dist/proxy-uLtw-ZML.js +4690 -0
- package/dist/style.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/{index-CSWGJT-v.js → table.provider-4OQNqxH3.js} +805 -674
- package/dist/theme.provider-BgxXUOMP.js +74 -0
- package/dist/useBreadcrumb-BBm5lX0U.js +1263 -0
- package/dist/utils/index.js +5 -2920
- package/dist/utils-CQSRNcoF.js +2022 -0
- package/dist/utils-DHuiYnx1.js +1689 -0
- package/dist/x-BwIi6Wii.js +63 -0
- package/dist/x-a0ouxoIM.js +11 -0
- package/package.json +18 -19
- package/dist/AdditionalOptions-DiXvUzhu.js +0 -42
- package/dist/Combination-BtmnusWq.js +0 -480
- package/dist/DayPicker-CaeUXRCF.js +0 -2798
- package/dist/Modal-h5H4yxYg.js +0 -128
- package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
- package/dist/chevron-down-BBFYYzZq.js +0 -5
- package/dist/chevron-left-BHBf-gQY.js +0 -5
- package/dist/chevron-right-DvXGOiS_.js +0 -5
- package/dist/chevron-up-DEfvgPCw.js +0 -54
- package/dist/chevron-up-IlDPxR7j.js +0 -5
- package/dist/compiler-runtime-DA41awpA.js +0 -36
- package/dist/createLucideIcon-CP-mMPfa.js +0 -75
- package/dist/debounce-DJveWHr_.js +0 -114
- package/dist/ellipsis-vertical-Cl3yNtOy.js +0 -9
- package/dist/index--l0zux8V.js +0 -200
- package/dist/index-0g-eSmV1.js +0 -142
- package/dist/index-0ioNhtNM.js +0 -10
- package/dist/index-B9v5VxE2.js +0 -431
- package/dist/index-BKMaItIC.js +0 -13
- package/dist/index-BKjcReYh.js +0 -55
- package/dist/index-BOE_3f_Z.js +0 -646
- package/dist/index-BRXMsxSL.js +0 -27
- package/dist/index-BdMNhZnh.js +0 -9
- package/dist/index-BmVmDQGH.js +0 -662
- package/dist/index-BvEpLnOv.js +0 -144
- package/dist/index-BvoZGpli.js +0 -60
- package/dist/index-C6mt--X_.js +0 -478
- package/dist/index-CJnS4BVW.js +0 -93
- package/dist/index-CiACf4ao.js +0 -1885
- package/dist/index-D29mdTf5.js +0 -34
- package/dist/index-Dy4FVowi.js +0 -314
- package/dist/index-kTGTSLpq.js +0 -322
- package/dist/index-qDQP8rW4.js +0 -7281
- package/dist/isObject-9XxUefZH.js +0 -97
- package/dist/libphonenumber-aZ-2KWIf.js +0 -11581
- package/dist/proxy-BGrSEZuV.js +0 -5046
- package/dist/useBreadcrumb-C_Wb2cXs.js +0 -1435
- package/dist/x-B9bYxG31.js +0 -8
- package/dist/x-Eoa9FJjA.js +0 -62
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { o as x } from "./chunk-D1xtDmiO.js";
|
|
2
|
+
import { t as C } from "./prop-types-DTnODft1.js";
|
|
3
|
+
import { t as l } from "./utils-DHuiYnx1.js";
|
|
4
|
+
import { Button as E } from "./components/Button/Button.js";
|
|
5
|
+
import v, { forwardRef as _, useCallback as h, useEffect as z, useRef as w, useState as L } from "react";
|
|
6
|
+
import { jsx as d, jsxs as b } from "react/jsx-runtime";
|
|
7
|
+
var c = /* @__PURE__ */ x(C());
|
|
8
|
+
function m() {
|
|
9
|
+
return m = Object.assign || function(e) {
|
|
10
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
11
|
+
var r = arguments[i];
|
|
12
|
+
for (var t in r) Object.prototype.hasOwnProperty.call(r, t) && (e[t] = r[t]);
|
|
13
|
+
}
|
|
14
|
+
return e;
|
|
15
|
+
}, m.apply(this, arguments);
|
|
16
|
+
}
|
|
17
|
+
function N(e, i) {
|
|
18
|
+
if (e == null) return {};
|
|
19
|
+
var r = D(e, i), t, n;
|
|
20
|
+
if (Object.getOwnPropertySymbols) {
|
|
21
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
22
|
+
for (n = 0; n < o.length; n++)
|
|
23
|
+
t = o[n], !(i.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(e, t) && (r[t] = e[t]);
|
|
24
|
+
}
|
|
25
|
+
return r;
|
|
26
|
+
}
|
|
27
|
+
function D(e, i) {
|
|
28
|
+
if (e == null) return {};
|
|
29
|
+
var r = {}, t = Object.keys(e), n, o;
|
|
30
|
+
for (o = 0; o < t.length; o++)
|
|
31
|
+
n = t[o], !(i.indexOf(n) >= 0) && (r[n] = e[n]);
|
|
32
|
+
return r;
|
|
33
|
+
}
|
|
34
|
+
var g = _(function(e, i) {
|
|
35
|
+
var r = e.color, t = r === void 0 ? "currentColor" : r, n = e.size, o = n === void 0 ? 24 : n, s = N(e, ["color", "size"]);
|
|
36
|
+
return /* @__PURE__ */ v.createElement("svg", m({
|
|
37
|
+
ref: i,
|
|
38
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
39
|
+
width: o,
|
|
40
|
+
height: o,
|
|
41
|
+
viewBox: "0 0 24 24",
|
|
42
|
+
fill: "none",
|
|
43
|
+
stroke: t,
|
|
44
|
+
strokeWidth: "2",
|
|
45
|
+
strokeLinecap: "round",
|
|
46
|
+
strokeLinejoin: "round"
|
|
47
|
+
}, s), /* @__PURE__ */ v.createElement("polyline", { points: "6 9 12 15 18 9" }));
|
|
48
|
+
});
|
|
49
|
+
g.propTypes = {
|
|
50
|
+
color: c.default.string,
|
|
51
|
+
size: c.default.oneOfType([c.default.string, c.default.number])
|
|
52
|
+
};
|
|
53
|
+
g.displayName = "ChevronDown";
|
|
54
|
+
var T = ({ buttonClassName: e, className: i, itemClassName: r, listClassName: t, options: n }) => {
|
|
55
|
+
const [o, s] = L(!1), y = w(null), f = w(null), O = h(() => s((a) => !a), []), k = h((a) => {
|
|
56
|
+
s(!1), a?.();
|
|
57
|
+
}, []);
|
|
58
|
+
return z(() => {
|
|
59
|
+
const a = new AbortController(), u = (p) => {
|
|
60
|
+
p.key === "Escape" && s(!1);
|
|
61
|
+
}, j = (p) => {
|
|
62
|
+
f.current?.contains(p.target) || s(!1);
|
|
63
|
+
};
|
|
64
|
+
return document.addEventListener("keydown", u, { signal: a.signal }), document.addEventListener("mousedown", j, { signal: a.signal }), document.addEventListener("visibilitychange", () => {
|
|
65
|
+
document.hidden && s(!1);
|
|
66
|
+
}, { signal: a.signal }), () => {
|
|
67
|
+
a.abort();
|
|
68
|
+
};
|
|
69
|
+
}, [f]), /* @__PURE__ */ b("div", {
|
|
70
|
+
ref: f,
|
|
71
|
+
className: l("relative w-full", i),
|
|
72
|
+
children: [/* @__PURE__ */ b(E, {
|
|
73
|
+
ref: y,
|
|
74
|
+
className: l("flex gap-2 items-center justify-between w-full", e),
|
|
75
|
+
onClick: O,
|
|
76
|
+
children: ["Download Invoice as", /* @__PURE__ */ d(g, { className: l({
|
|
77
|
+
"transform rotate-180": o,
|
|
78
|
+
"transition-transform duration-200": !0
|
|
79
|
+
}) })]
|
|
80
|
+
}), o && /* @__PURE__ */ d("ul", {
|
|
81
|
+
className: l("absolute z-10 mt-1 w-full bg-white border border-gray-200 rounded shadow-xs animate-in fade-in-0 py-2", t),
|
|
82
|
+
children: n.map((a, u) => /* @__PURE__ */ d("li", {
|
|
83
|
+
className: l("hover:bg-gray-50 px-6 py-1.5 hover:cursor-pointer", r),
|
|
84
|
+
onClick: () => k(a.onClick),
|
|
85
|
+
children: a.label
|
|
86
|
+
}, u))
|
|
87
|
+
})]
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
export {
|
|
91
|
+
T as t
|
|
92
|
+
};
|
|
@@ -0,0 +1,597 @@
|
|
|
1
|
+
import { t as y } from "./utils-DHuiYnx1.js";
|
|
2
|
+
import { Typography as M } from "./components/Typography/Typography.js";
|
|
3
|
+
import { usePhoneNumberContext as _ } from "./components/PhoneNumberInput/contexts/phone-number.hook.js";
|
|
4
|
+
import { TruncateText as T } from "./components/PhoneNumberInput/components/TruncateText/TruncateText.js";
|
|
5
|
+
import * as E from "react";
|
|
6
|
+
import { useEffect as N, useMemo as k, useRef as D } from "react";
|
|
7
|
+
import { flushSync as W } from "react-dom";
|
|
8
|
+
import { jsx as m, jsxs as L } from "react/jsx-runtime";
|
|
9
|
+
function b(r, t, e) {
|
|
10
|
+
let s = e.initialDeps ?? [], n, l = !0;
|
|
11
|
+
function i() {
|
|
12
|
+
var o, h, c;
|
|
13
|
+
let u;
|
|
14
|
+
e.key && ((o = e.debug) != null && o.call(e)) && (u = Date.now());
|
|
15
|
+
const a = r();
|
|
16
|
+
if (!(a.length !== s.length || a.some((v, f) => s[f] !== v))) return n;
|
|
17
|
+
s = a;
|
|
18
|
+
let d;
|
|
19
|
+
if (e.key && ((h = e.debug) != null && h.call(e)) && (d = Date.now()), n = t(...a), e.key && ((c = e.debug) != null && c.call(e))) {
|
|
20
|
+
const v = Math.round((Date.now() - u) * 100) / 100, f = Math.round((Date.now() - d) * 100) / 100, S = f / 16, x = (g, w) => {
|
|
21
|
+
for (g = String(g); g.length < w; ) g = " " + g;
|
|
22
|
+
return g;
|
|
23
|
+
};
|
|
24
|
+
console.info(`%c⏱ ${x(f, 5)} /${x(v, 5)} ms`, `
|
|
25
|
+
font-size: .6rem;
|
|
26
|
+
font-weight: bold;
|
|
27
|
+
color: hsl(${Math.max(0, Math.min(120 - 120 * S, 120))}deg 100% 31%);`, e?.key);
|
|
28
|
+
}
|
|
29
|
+
return e?.onChange && !(l && e.skipInitialOnChange) && e.onChange(n), l = !1, n;
|
|
30
|
+
}
|
|
31
|
+
return i.updateDeps = (o) => {
|
|
32
|
+
s = o;
|
|
33
|
+
}, i;
|
|
34
|
+
}
|
|
35
|
+
function I(r, t) {
|
|
36
|
+
if (r === void 0) throw new Error(`Unexpected undefined${t ? `: ${t}` : ""}`);
|
|
37
|
+
return r;
|
|
38
|
+
}
|
|
39
|
+
var V = (r, t) => Math.abs(r - t) < 1.01, j = (r, t, e) => {
|
|
40
|
+
let s;
|
|
41
|
+
return function(...n) {
|
|
42
|
+
r.clearTimeout(s), s = r.setTimeout(() => t.apply(this, n), e);
|
|
43
|
+
};
|
|
44
|
+
}, z = (r) => {
|
|
45
|
+
const { offsetWidth: t, offsetHeight: e } = r;
|
|
46
|
+
return {
|
|
47
|
+
width: t,
|
|
48
|
+
height: e
|
|
49
|
+
};
|
|
50
|
+
}, P = (r) => r, B = (r) => {
|
|
51
|
+
const t = Math.max(r.startIndex - r.overscan, 0), e = Math.min(r.endIndex + r.overscan, r.count - 1), s = [];
|
|
52
|
+
for (let n = t; n <= e; n++) s.push(n);
|
|
53
|
+
return s;
|
|
54
|
+
}, H = (r, t) => {
|
|
55
|
+
const e = r.scrollElement;
|
|
56
|
+
if (!e) return;
|
|
57
|
+
const s = r.targetWindow;
|
|
58
|
+
if (!s) return;
|
|
59
|
+
const n = (i) => {
|
|
60
|
+
const { width: o, height: h } = i;
|
|
61
|
+
t({
|
|
62
|
+
width: Math.round(o),
|
|
63
|
+
height: Math.round(h)
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
if (n(z(e)), !s.ResizeObserver) return () => {
|
|
67
|
+
};
|
|
68
|
+
const l = new s.ResizeObserver((i) => {
|
|
69
|
+
const o = () => {
|
|
70
|
+
const h = i[0];
|
|
71
|
+
if (h?.borderBoxSize) {
|
|
72
|
+
const c = h.borderBoxSize[0];
|
|
73
|
+
if (c) {
|
|
74
|
+
n({
|
|
75
|
+
width: c.inlineSize,
|
|
76
|
+
height: c.blockSize
|
|
77
|
+
});
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
n(z(e));
|
|
82
|
+
};
|
|
83
|
+
r.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(o) : o();
|
|
84
|
+
});
|
|
85
|
+
return l.observe(e, { box: "border-box" }), () => {
|
|
86
|
+
l.unobserve(e);
|
|
87
|
+
};
|
|
88
|
+
}, C = { passive: !0 }, A = typeof window > "u" ? !0 : "onscrollend" in window, $ = (r, t) => {
|
|
89
|
+
const e = r.scrollElement;
|
|
90
|
+
if (!e) return;
|
|
91
|
+
const s = r.targetWindow;
|
|
92
|
+
if (!s) return;
|
|
93
|
+
let n = 0;
|
|
94
|
+
const l = r.options.useScrollendEvent && A ? () => {
|
|
95
|
+
} : j(s, () => {
|
|
96
|
+
t(n, !1);
|
|
97
|
+
}, r.options.isScrollingResetDelay), i = (u) => () => {
|
|
98
|
+
const { horizontal: a, isRtl: d } = r.options;
|
|
99
|
+
n = a ? e.scrollLeft * (d && -1 || 1) : e.scrollTop, l(), t(n, u);
|
|
100
|
+
}, o = i(!0), h = i(!1);
|
|
101
|
+
e.addEventListener("scroll", o, C);
|
|
102
|
+
const c = r.options.useScrollendEvent && A;
|
|
103
|
+
return c && e.addEventListener("scrollend", h, C), () => {
|
|
104
|
+
e.removeEventListener("scroll", o), c && e.removeEventListener("scrollend", h);
|
|
105
|
+
};
|
|
106
|
+
}, q = (r, t, e) => {
|
|
107
|
+
if (t?.borderBoxSize) {
|
|
108
|
+
const s = t.borderBoxSize[0];
|
|
109
|
+
if (s) return Math.round(s[e.options.horizontal ? "inlineSize" : "blockSize"]);
|
|
110
|
+
}
|
|
111
|
+
return r[e.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
112
|
+
}, K = (r, { adjustments: t = 0, behavior: e }, s) => {
|
|
113
|
+
var n, l;
|
|
114
|
+
const i = r + t;
|
|
115
|
+
(l = (n = s.scrollElement) == null ? void 0 : n.scrollTo) == null || l.call(n, {
|
|
116
|
+
[s.options.horizontal ? "left" : "top"]: i,
|
|
117
|
+
behavior: e
|
|
118
|
+
});
|
|
119
|
+
}, U = class {
|
|
120
|
+
constructor(r) {
|
|
121
|
+
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollState = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.now = () => {
|
|
122
|
+
var t, e, s;
|
|
123
|
+
return ((s = (e = (t = this.targetWindow) == null ? void 0 : t.performance) == null ? void 0 : e.now) == null ? void 0 : s.call(e)) ?? Date.now();
|
|
124
|
+
}, this.observer = /* @__PURE__ */ (() => {
|
|
125
|
+
let t = null;
|
|
126
|
+
const e = () => t || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : t = new this.targetWindow.ResizeObserver((s) => {
|
|
127
|
+
s.forEach((n) => {
|
|
128
|
+
const l = () => {
|
|
129
|
+
const i = n.target, o = this.indexFromElement(i);
|
|
130
|
+
if (!i.isConnected) {
|
|
131
|
+
this.observer.unobserve(i);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
this.shouldMeasureDuringScroll(o) && this.resizeItem(o, this.options.measureElement(i, n, this));
|
|
135
|
+
};
|
|
136
|
+
this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(l) : l();
|
|
137
|
+
});
|
|
138
|
+
}));
|
|
139
|
+
return {
|
|
140
|
+
disconnect: () => {
|
|
141
|
+
var s;
|
|
142
|
+
(s = e()) == null || s.disconnect(), t = null;
|
|
143
|
+
},
|
|
144
|
+
observe: (s) => {
|
|
145
|
+
var n;
|
|
146
|
+
return (n = e()) == null ? void 0 : n.observe(s, { box: "border-box" });
|
|
147
|
+
},
|
|
148
|
+
unobserve: (s) => {
|
|
149
|
+
var n;
|
|
150
|
+
return (n = e()) == null ? void 0 : n.unobserve(s);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
})(), this.range = null, this.setOptions = (t) => {
|
|
154
|
+
Object.entries(t).forEach(([e, s]) => {
|
|
155
|
+
typeof s > "u" && delete t[e];
|
|
156
|
+
}), this.options = {
|
|
157
|
+
debug: !1,
|
|
158
|
+
initialOffset: 0,
|
|
159
|
+
overscan: 1,
|
|
160
|
+
paddingStart: 0,
|
|
161
|
+
paddingEnd: 0,
|
|
162
|
+
scrollPaddingStart: 0,
|
|
163
|
+
scrollPaddingEnd: 0,
|
|
164
|
+
horizontal: !1,
|
|
165
|
+
getItemKey: P,
|
|
166
|
+
rangeExtractor: B,
|
|
167
|
+
onChange: () => {
|
|
168
|
+
},
|
|
169
|
+
measureElement: q,
|
|
170
|
+
initialRect: {
|
|
171
|
+
width: 0,
|
|
172
|
+
height: 0
|
|
173
|
+
},
|
|
174
|
+
scrollMargin: 0,
|
|
175
|
+
gap: 0,
|
|
176
|
+
indexAttribute: "data-index",
|
|
177
|
+
initialMeasurementsCache: [],
|
|
178
|
+
lanes: 1,
|
|
179
|
+
isScrollingResetDelay: 150,
|
|
180
|
+
enabled: !0,
|
|
181
|
+
isRtl: !1,
|
|
182
|
+
useScrollendEvent: !1,
|
|
183
|
+
useAnimationFrameWithResizeObserver: !1,
|
|
184
|
+
...t
|
|
185
|
+
};
|
|
186
|
+
}, this.notify = (t) => {
|
|
187
|
+
var e, s;
|
|
188
|
+
(s = (e = this.options).onChange) == null || s.call(e, this, t);
|
|
189
|
+
}, this.maybeNotify = b(() => (this.calculateRange(), [
|
|
190
|
+
this.isScrolling,
|
|
191
|
+
this.range ? this.range.startIndex : null,
|
|
192
|
+
this.range ? this.range.endIndex : null
|
|
193
|
+
]), (t) => {
|
|
194
|
+
this.notify(t);
|
|
195
|
+
}, {
|
|
196
|
+
key: process.env.NODE_ENV !== "production" && "maybeNotify",
|
|
197
|
+
debug: () => this.options.debug,
|
|
198
|
+
initialDeps: [
|
|
199
|
+
this.isScrolling,
|
|
200
|
+
this.range ? this.range.startIndex : null,
|
|
201
|
+
this.range ? this.range.endIndex : null
|
|
202
|
+
]
|
|
203
|
+
}), this.cleanup = () => {
|
|
204
|
+
this.unsubs.filter(Boolean).forEach((t) => t()), this.unsubs = [], this.observer.disconnect(), this.rafId != null && this.targetWindow && (this.targetWindow.cancelAnimationFrame(this.rafId), this.rafId = null), this.scrollState = null, this.scrollElement = null, this.targetWindow = null;
|
|
205
|
+
}, this._didMount = () => () => {
|
|
206
|
+
this.cleanup();
|
|
207
|
+
}, this._willUpdate = () => {
|
|
208
|
+
var t;
|
|
209
|
+
const e = this.options.enabled ? this.options.getScrollElement() : null;
|
|
210
|
+
if (this.scrollElement !== e) {
|
|
211
|
+
if (this.cleanup(), !e) {
|
|
212
|
+
this.maybeNotify();
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
this.scrollElement = e, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((t = this.scrollElement) == null ? void 0 : t.window) ?? null, this.elementsCache.forEach((s) => {
|
|
216
|
+
this.observer.observe(s);
|
|
217
|
+
}), this.unsubs.push(this.options.observeElementRect(this, (s) => {
|
|
218
|
+
this.scrollRect = s, this.maybeNotify();
|
|
219
|
+
})), this.unsubs.push(this.options.observeElementOffset(this, (s, n) => {
|
|
220
|
+
this.scrollAdjustments = 0, this.scrollDirection = n ? this.getScrollOffset() < s ? "forward" : "backward" : null, this.scrollOffset = s, this.isScrolling = n, this.scrollState && this.scheduleScrollReconcile(), this.maybeNotify();
|
|
221
|
+
})), this._scrollToOffset(this.getScrollOffset(), {
|
|
222
|
+
adjustments: void 0,
|
|
223
|
+
behavior: void 0
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
}, this.rafId = null, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (t, e) => {
|
|
227
|
+
const s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
228
|
+
for (let l = e - 1; l >= 0; l--) {
|
|
229
|
+
const i = t[l];
|
|
230
|
+
if (s.has(i.lane)) continue;
|
|
231
|
+
const o = n.get(i.lane);
|
|
232
|
+
if (o == null || i.end > o.end ? n.set(i.lane, i) : i.end < o.end && s.set(i.lane, !0), s.size === this.options.lanes) break;
|
|
233
|
+
}
|
|
234
|
+
return n.size === this.options.lanes ? Array.from(n.values()).sort((l, i) => l.end === i.end ? l.index - i.index : l.end - i.end)[0] : void 0;
|
|
235
|
+
}, this.getMeasurementOptions = b(() => [
|
|
236
|
+
this.options.count,
|
|
237
|
+
this.options.paddingStart,
|
|
238
|
+
this.options.scrollMargin,
|
|
239
|
+
this.options.getItemKey,
|
|
240
|
+
this.options.enabled,
|
|
241
|
+
this.options.lanes
|
|
242
|
+
], (t, e, s, n, l, i) => (this.prevLanes !== void 0 && this.prevLanes !== i && (this.lanesChangedFlag = !0), this.prevLanes = i, this.pendingMeasuredCacheIndexes = [], {
|
|
243
|
+
count: t,
|
|
244
|
+
paddingStart: e,
|
|
245
|
+
scrollMargin: s,
|
|
246
|
+
getItemKey: n,
|
|
247
|
+
enabled: l,
|
|
248
|
+
lanes: i
|
|
249
|
+
}), { key: !1 }), this.getMeasurements = b(() => [this.getMeasurementOptions(), this.itemSizeCache], ({ count: t, paddingStart: e, scrollMargin: s, getItemKey: n, enabled: l, lanes: i }, o) => {
|
|
250
|
+
if (!l)
|
|
251
|
+
return this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
|
|
252
|
+
if (this.laneAssignments.size > t)
|
|
253
|
+
for (const a of this.laneAssignments.keys()) a >= t && this.laneAssignments.delete(a);
|
|
254
|
+
this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMeasuredCacheIndexes = []), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((a) => {
|
|
255
|
+
this.itemSizeCache.set(a.key, a.size);
|
|
256
|
+
}));
|
|
257
|
+
const h = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
258
|
+
this.pendingMeasuredCacheIndexes = [], this.lanesSettling && this.measurementsCache.length === t && (this.lanesSettling = !1);
|
|
259
|
+
const c = this.measurementsCache.slice(0, h), u = new Array(i).fill(void 0);
|
|
260
|
+
for (let a = 0; a < h; a++) {
|
|
261
|
+
const d = c[a];
|
|
262
|
+
d && (u[d.lane] = a);
|
|
263
|
+
}
|
|
264
|
+
for (let a = h; a < t; a++) {
|
|
265
|
+
const d = n(a), v = this.laneAssignments.get(a);
|
|
266
|
+
let f, S;
|
|
267
|
+
if (v !== void 0 && this.options.lanes > 1) {
|
|
268
|
+
f = v;
|
|
269
|
+
const p = u[f], O = p !== void 0 ? c[p] : void 0;
|
|
270
|
+
S = O ? O.end + this.options.gap : e + s;
|
|
271
|
+
} else {
|
|
272
|
+
const p = this.options.lanes === 1 ? c[a - 1] : this.getFurthestMeasurement(c, a);
|
|
273
|
+
S = p ? p.end + this.options.gap : e + s, f = p ? p.lane : a % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(a, f);
|
|
274
|
+
}
|
|
275
|
+
const x = o.get(d), g = typeof x == "number" ? x : this.options.estimateSize(a), w = S + g;
|
|
276
|
+
c[a] = {
|
|
277
|
+
index: a,
|
|
278
|
+
start: S,
|
|
279
|
+
size: g,
|
|
280
|
+
end: w,
|
|
281
|
+
key: d,
|
|
282
|
+
lane: f
|
|
283
|
+
}, u[f] = a;
|
|
284
|
+
}
|
|
285
|
+
return this.measurementsCache = c, c;
|
|
286
|
+
}, {
|
|
287
|
+
key: process.env.NODE_ENV !== "production" && "getMeasurements",
|
|
288
|
+
debug: () => this.options.debug
|
|
289
|
+
}), this.calculateRange = b(() => [
|
|
290
|
+
this.getMeasurements(),
|
|
291
|
+
this.getSize(),
|
|
292
|
+
this.getScrollOffset(),
|
|
293
|
+
this.options.lanes
|
|
294
|
+
], (t, e, s, n) => this.range = t.length > 0 && e > 0 ? G({
|
|
295
|
+
measurements: t,
|
|
296
|
+
outerSize: e,
|
|
297
|
+
scrollOffset: s,
|
|
298
|
+
lanes: n
|
|
299
|
+
}) : null, {
|
|
300
|
+
key: process.env.NODE_ENV !== "production" && "calculateRange",
|
|
301
|
+
debug: () => this.options.debug
|
|
302
|
+
}), this.getVirtualIndexes = b(() => {
|
|
303
|
+
let t = null, e = null;
|
|
304
|
+
const s = this.calculateRange();
|
|
305
|
+
return s && (t = s.startIndex, e = s.endIndex), this.maybeNotify.updateDeps([
|
|
306
|
+
this.isScrolling,
|
|
307
|
+
t,
|
|
308
|
+
e
|
|
309
|
+
]), [
|
|
310
|
+
this.options.rangeExtractor,
|
|
311
|
+
this.options.overscan,
|
|
312
|
+
this.options.count,
|
|
313
|
+
t,
|
|
314
|
+
e
|
|
315
|
+
];
|
|
316
|
+
}, (t, e, s, n, l) => n === null || l === null ? [] : t({
|
|
317
|
+
startIndex: n,
|
|
318
|
+
endIndex: l,
|
|
319
|
+
overscan: e,
|
|
320
|
+
count: s
|
|
321
|
+
}), {
|
|
322
|
+
key: process.env.NODE_ENV !== "production" && "getVirtualIndexes",
|
|
323
|
+
debug: () => this.options.debug
|
|
324
|
+
}), this.indexFromElement = (t) => {
|
|
325
|
+
const e = this.options.indexAttribute, s = t.getAttribute(e);
|
|
326
|
+
return s ? parseInt(s, 10) : (console.warn(`Missing attribute name '${e}={index}' on measured element.`), -1);
|
|
327
|
+
}, this.shouldMeasureDuringScroll = (t) => {
|
|
328
|
+
var e;
|
|
329
|
+
if (!this.scrollState || this.scrollState.behavior !== "smooth") return !0;
|
|
330
|
+
const s = this.scrollState.index ?? ((e = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? void 0 : e.index);
|
|
331
|
+
if (s !== void 0 && this.range) {
|
|
332
|
+
const n = Math.max(this.options.overscan, Math.ceil((this.range.endIndex - this.range.startIndex) / 2)), l = Math.max(0, s - n), i = Math.min(this.options.count - 1, s + n);
|
|
333
|
+
return t >= l && t <= i;
|
|
334
|
+
}
|
|
335
|
+
return !0;
|
|
336
|
+
}, this.measureElement = (t) => {
|
|
337
|
+
if (!t) {
|
|
338
|
+
this.elementsCache.forEach((l, i) => {
|
|
339
|
+
l.isConnected || (this.observer.unobserve(l), this.elementsCache.delete(i));
|
|
340
|
+
});
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
const e = this.indexFromElement(t), s = this.options.getItemKey(e), n = this.elementsCache.get(s);
|
|
344
|
+
n !== t && (n && this.observer.unobserve(n), this.observer.observe(t), this.elementsCache.set(s, t)), (!this.isScrolling || this.scrollState) && this.shouldMeasureDuringScroll(e) && this.resizeItem(e, this.options.measureElement(t, void 0, this));
|
|
345
|
+
}, this.resizeItem = (t, e) => {
|
|
346
|
+
var s;
|
|
347
|
+
const n = this.measurementsCache[t];
|
|
348
|
+
if (!n) return;
|
|
349
|
+
const l = e - (this.itemSizeCache.get(n.key) ?? n.size);
|
|
350
|
+
l !== 0 && (((s = this.scrollState) == null ? void 0 : s.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(n, l, this) : n.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", l), this._scrollToOffset(this.getScrollOffset(), {
|
|
351
|
+
adjustments: this.scrollAdjustments += l,
|
|
352
|
+
behavior: void 0
|
|
353
|
+
})), this.pendingMeasuredCacheIndexes.push(n.index), this.itemSizeCache = new Map(this.itemSizeCache.set(n.key, e)), this.notify(!1));
|
|
354
|
+
}, this.getVirtualItems = b(() => [this.getVirtualIndexes(), this.getMeasurements()], (t, e) => {
|
|
355
|
+
const s = [];
|
|
356
|
+
for (let n = 0, l = t.length; n < l; n++) {
|
|
357
|
+
const i = e[t[n]];
|
|
358
|
+
s.push(i);
|
|
359
|
+
}
|
|
360
|
+
return s;
|
|
361
|
+
}, {
|
|
362
|
+
key: process.env.NODE_ENV !== "production" && "getVirtualItems",
|
|
363
|
+
debug: () => this.options.debug
|
|
364
|
+
}), this.getVirtualItemForOffset = (t) => {
|
|
365
|
+
const e = this.getMeasurements();
|
|
366
|
+
if (e.length !== 0)
|
|
367
|
+
return I(e[R(0, e.length - 1, (s) => I(e[s]).start, t)]);
|
|
368
|
+
}, this.getMaxScrollOffset = () => {
|
|
369
|
+
if (!this.scrollElement) return 0;
|
|
370
|
+
if ("scrollHeight" in this.scrollElement) return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
|
|
371
|
+
{
|
|
372
|
+
const t = this.scrollElement.document.documentElement;
|
|
373
|
+
return this.options.horizontal ? t.scrollWidth - this.scrollElement.innerWidth : t.scrollHeight - this.scrollElement.innerHeight;
|
|
374
|
+
}
|
|
375
|
+
}, this.getOffsetForAlignment = (t, e, s = 0) => {
|
|
376
|
+
if (!this.scrollElement) return 0;
|
|
377
|
+
const n = this.getSize(), l = this.getScrollOffset();
|
|
378
|
+
e === "auto" && (e = t >= l + n ? "end" : "start"), e === "center" ? t += (s - n) / 2 : e === "end" && (t -= n);
|
|
379
|
+
const i = this.getMaxScrollOffset();
|
|
380
|
+
return Math.max(Math.min(i, t), 0);
|
|
381
|
+
}, this.getOffsetForIndex = (t, e = "auto") => {
|
|
382
|
+
t = Math.max(0, Math.min(t, this.options.count - 1));
|
|
383
|
+
const s = this.getSize(), n = this.getScrollOffset(), l = this.measurementsCache[t];
|
|
384
|
+
if (!l) return;
|
|
385
|
+
if (e === "auto") if (l.end >= n + s - this.options.scrollPaddingEnd) e = "end";
|
|
386
|
+
else if (l.start <= n + this.options.scrollPaddingStart) e = "start";
|
|
387
|
+
else return [n, e];
|
|
388
|
+
if (e === "end" && t === this.options.count - 1) return [this.getMaxScrollOffset(), e];
|
|
389
|
+
const i = e === "end" ? l.end + this.options.scrollPaddingEnd : l.start - this.options.scrollPaddingStart;
|
|
390
|
+
return [this.getOffsetForAlignment(i, e, l.size), e];
|
|
391
|
+
}, this.scrollToOffset = (t, { align: e = "start", behavior: s = "auto" } = {}) => {
|
|
392
|
+
const n = this.getOffsetForAlignment(t, e);
|
|
393
|
+
this.scrollState = {
|
|
394
|
+
index: null,
|
|
395
|
+
align: e,
|
|
396
|
+
behavior: s,
|
|
397
|
+
startedAt: this.now(),
|
|
398
|
+
lastTargetOffset: n,
|
|
399
|
+
stableFrames: 0
|
|
400
|
+
}, this._scrollToOffset(n, {
|
|
401
|
+
adjustments: void 0,
|
|
402
|
+
behavior: s
|
|
403
|
+
}), this.scheduleScrollReconcile();
|
|
404
|
+
}, this.scrollToIndex = (t, { align: e = "auto", behavior: s = "auto" } = {}) => {
|
|
405
|
+
t = Math.max(0, Math.min(t, this.options.count - 1));
|
|
406
|
+
const n = this.getOffsetForIndex(t, e);
|
|
407
|
+
if (!n) return;
|
|
408
|
+
const [l, i] = n, o = this.now();
|
|
409
|
+
this.scrollState = {
|
|
410
|
+
index: t,
|
|
411
|
+
align: i,
|
|
412
|
+
behavior: s,
|
|
413
|
+
startedAt: o,
|
|
414
|
+
lastTargetOffset: l,
|
|
415
|
+
stableFrames: 0
|
|
416
|
+
}, this._scrollToOffset(l, {
|
|
417
|
+
adjustments: void 0,
|
|
418
|
+
behavior: s
|
|
419
|
+
}), this.scheduleScrollReconcile();
|
|
420
|
+
}, this.scrollBy = (t, { behavior: e = "auto" } = {}) => {
|
|
421
|
+
const s = this.getScrollOffset() + t;
|
|
422
|
+
this.scrollState = {
|
|
423
|
+
index: null,
|
|
424
|
+
align: "start",
|
|
425
|
+
behavior: e,
|
|
426
|
+
startedAt: this.now(),
|
|
427
|
+
lastTargetOffset: s,
|
|
428
|
+
stableFrames: 0
|
|
429
|
+
}, this._scrollToOffset(s, {
|
|
430
|
+
adjustments: void 0,
|
|
431
|
+
behavior: e
|
|
432
|
+
}), this.scheduleScrollReconcile();
|
|
433
|
+
}, this.getTotalSize = () => {
|
|
434
|
+
var t;
|
|
435
|
+
const e = this.getMeasurements();
|
|
436
|
+
let s;
|
|
437
|
+
if (e.length === 0) s = this.options.paddingStart;
|
|
438
|
+
else if (this.options.lanes === 1) s = ((t = e[e.length - 1]) == null ? void 0 : t.end) ?? 0;
|
|
439
|
+
else {
|
|
440
|
+
const n = Array(this.options.lanes).fill(null);
|
|
441
|
+
let l = e.length - 1;
|
|
442
|
+
for (; l >= 0 && n.some((i) => i === null); ) {
|
|
443
|
+
const i = e[l];
|
|
444
|
+
n[i.lane] === null && (n[i.lane] = i.end), l--;
|
|
445
|
+
}
|
|
446
|
+
s = Math.max(...n.filter((i) => i !== null));
|
|
447
|
+
}
|
|
448
|
+
return Math.max(s - this.options.scrollMargin + this.options.paddingEnd, 0);
|
|
449
|
+
}, this._scrollToOffset = (t, { adjustments: e, behavior: s }) => {
|
|
450
|
+
this.options.scrollToFn(t, {
|
|
451
|
+
behavior: s,
|
|
452
|
+
adjustments: e
|
|
453
|
+
}, this);
|
|
454
|
+
}, this.measure = () => {
|
|
455
|
+
this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.notify(!1);
|
|
456
|
+
}, this.setOptions(r);
|
|
457
|
+
}
|
|
458
|
+
scheduleScrollReconcile() {
|
|
459
|
+
if (!this.targetWindow) {
|
|
460
|
+
this.scrollState = null;
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
this.rafId == null && (this.rafId = this.targetWindow.requestAnimationFrame(() => {
|
|
464
|
+
this.rafId = null, this.reconcileScroll();
|
|
465
|
+
}));
|
|
466
|
+
}
|
|
467
|
+
reconcileScroll() {
|
|
468
|
+
if (!this.scrollState || !this.scrollElement) return;
|
|
469
|
+
if (this.now() - this.scrollState.startedAt > 5e3) {
|
|
470
|
+
this.scrollState = null;
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
const r = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : void 0, t = r ? r[0] : this.scrollState.lastTargetOffset, e = 1, s = t !== this.scrollState.lastTargetOffset;
|
|
474
|
+
if (!s && V(t, this.getScrollOffset())) {
|
|
475
|
+
if (this.scrollState.stableFrames++, this.scrollState.stableFrames >= e) {
|
|
476
|
+
this.scrollState = null;
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
} else
|
|
480
|
+
this.scrollState.stableFrames = 0, s && (this.scrollState.lastTargetOffset = t, this.scrollState.behavior = "auto", this._scrollToOffset(t, {
|
|
481
|
+
adjustments: void 0,
|
|
482
|
+
behavior: "auto"
|
|
483
|
+
}));
|
|
484
|
+
this.scheduleScrollReconcile();
|
|
485
|
+
}
|
|
486
|
+
}, R = (r, t, e, s) => {
|
|
487
|
+
for (; r <= t; ) {
|
|
488
|
+
const n = (r + t) / 2 | 0, l = e(n);
|
|
489
|
+
if (l < s) r = n + 1;
|
|
490
|
+
else if (l > s) t = n - 1;
|
|
491
|
+
else return n;
|
|
492
|
+
}
|
|
493
|
+
return r > 0 ? r - 1 : 0;
|
|
494
|
+
};
|
|
495
|
+
function G({ measurements: r, outerSize: t, scrollOffset: e, lanes: s }) {
|
|
496
|
+
const n = r.length - 1, l = (h) => r[h].start;
|
|
497
|
+
if (r.length <= s) return {
|
|
498
|
+
startIndex: 0,
|
|
499
|
+
endIndex: n
|
|
500
|
+
};
|
|
501
|
+
let i = R(0, n, l, e), o = i;
|
|
502
|
+
if (s === 1) for (; o < n && r[o].end < e + t; ) o++;
|
|
503
|
+
else if (s > 1) {
|
|
504
|
+
const h = Array(s).fill(0);
|
|
505
|
+
for (; o < n && h.some((u) => u < e + t); ) {
|
|
506
|
+
const u = r[o];
|
|
507
|
+
h[u.lane] = u.end, o++;
|
|
508
|
+
}
|
|
509
|
+
const c = Array(s).fill(e + t);
|
|
510
|
+
for (; i >= 0 && c.some((u) => u >= e); ) {
|
|
511
|
+
const u = r[i];
|
|
512
|
+
c[u.lane] = u.start, i--;
|
|
513
|
+
}
|
|
514
|
+
i = Math.max(0, i - i % s), o = Math.min(n, o + (s - 1 - o % s));
|
|
515
|
+
}
|
|
516
|
+
return {
|
|
517
|
+
startIndex: i,
|
|
518
|
+
endIndex: o
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
var F = typeof document < "u" ? E.useLayoutEffect : E.useEffect;
|
|
522
|
+
function J({ useFlushSync: r = !0, ...t }) {
|
|
523
|
+
const e = E.useReducer(() => ({}), {})[1], s = {
|
|
524
|
+
...t,
|
|
525
|
+
onChange: (l, i) => {
|
|
526
|
+
var o;
|
|
527
|
+
r && i ? W(e) : e(), (o = t.onChange) == null || o.call(t, l, i);
|
|
528
|
+
}
|
|
529
|
+
}, [n] = E.useState(() => new U(s));
|
|
530
|
+
return n.setOptions(s), F(() => n._didMount(), []), F(() => n._willUpdate()), n;
|
|
531
|
+
}
|
|
532
|
+
function Q(r) {
|
|
533
|
+
return J({
|
|
534
|
+
observeElementRect: H,
|
|
535
|
+
observeElementOffset: $,
|
|
536
|
+
scrollToFn: K,
|
|
537
|
+
...r
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
var ie = ({ showFlagOnSearch: r, showNameOnSearch: t }) => {
|
|
541
|
+
const e = D(null), { termOfSearch: s, countries: n, handleSelectCountry: l } = _(), i = k(() => n.filter((h) => h.name.toLocaleLowerCase().includes(s.toLowerCase())), [s]), o = Q({
|
|
542
|
+
count: i.length,
|
|
543
|
+
overscan: 5,
|
|
544
|
+
getScrollElement: () => e.current,
|
|
545
|
+
estimateSize: () => 40
|
|
546
|
+
});
|
|
547
|
+
return N(() => {
|
|
548
|
+
i.length > 0 && o.scrollToIndex(0);
|
|
549
|
+
}, [s, o]), i.length === 0 ? /* @__PURE__ */ m("div", {
|
|
550
|
+
className: "overflow-y-auto max-h-60 snap-y snap-mandatory",
|
|
551
|
+
children: /* @__PURE__ */ m("ul", {
|
|
552
|
+
className: "relative",
|
|
553
|
+
children: /* @__PURE__ */ m("li", {
|
|
554
|
+
className: "w-full flex items-center h-10 select-none px-6",
|
|
555
|
+
children: /* @__PURE__ */ m(M, {
|
|
556
|
+
variant: "body2",
|
|
557
|
+
component: "span",
|
|
558
|
+
className: "flex gap-2 items-center text-left",
|
|
559
|
+
children: "No options"
|
|
560
|
+
})
|
|
561
|
+
})
|
|
562
|
+
})
|
|
563
|
+
}) : /* @__PURE__ */ m("div", {
|
|
564
|
+
ref: e,
|
|
565
|
+
className: "overflow-y-auto max-h-60 snap-y snap-mandatory scrollbar",
|
|
566
|
+
children: /* @__PURE__ */ m("ul", {
|
|
567
|
+
className: "relative",
|
|
568
|
+
style: { height: o.getTotalSize() },
|
|
569
|
+
children: o.getVirtualItems().map((h) => {
|
|
570
|
+
const c = i[h.index], { flag: u, name: a, prefix: d } = c;
|
|
571
|
+
return /* @__PURE__ */ m("li", {
|
|
572
|
+
className: y("absolute", "w-full", "snap-start", "snap-always", "scroll-m-0", "flex", "items-center", "h-10"),
|
|
573
|
+
style: {
|
|
574
|
+
top: h.start,
|
|
575
|
+
height: h.size
|
|
576
|
+
},
|
|
577
|
+
children: /* @__PURE__ */ m("button", {
|
|
578
|
+
className: y("w-full", "h-full", "cursor-pointer", "px-6", "hover:bg-gray-50", "transition-colors", "duration-150", "focus-visible:outline-0", "hover:outline-gray-100", "focus:bg-gray-50", "dark:hover:bg-metal-700"),
|
|
579
|
+
onClick: () => l(c),
|
|
580
|
+
children: /* @__PURE__ */ L(M, {
|
|
581
|
+
variant: "body2",
|
|
582
|
+
component: "span",
|
|
583
|
+
className: "flex gap-2 items-center text-left",
|
|
584
|
+
children: [r && /* @__PURE__ */ m(u, {}), t && /* @__PURE__ */ m(T, {
|
|
585
|
+
text: a,
|
|
586
|
+
prefix: d
|
|
587
|
+
})]
|
|
588
|
+
})
|
|
589
|
+
})
|
|
590
|
+
}, h.key);
|
|
591
|
+
})
|
|
592
|
+
})
|
|
593
|
+
});
|
|
594
|
+
};
|
|
595
|
+
export {
|
|
596
|
+
ie as t
|
|
597
|
+
};
|