@konstructio/ui 0.1.2-alpha.77 → 0.1.2-alpha.78
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-C2FDVZhu.js +45 -0
- package/dist/Modal-DAWdufZ_.js +120 -0
- package/dist/assets/icons/components/Accounts.js +35 -23
- package/dist/assets/icons/components/AddChart.js +26 -20
- package/dist/assets/icons/components/AlertOutline.js +26 -20
- package/dist/assets/icons/components/AppRepo.js +26 -20
- package/dist/assets/icons/components/Apps.js +26 -20
- package/dist/assets/icons/components/Archives.js +26 -20
- package/dist/assets/icons/components/ArrowDown.js +26 -20
- package/dist/assets/icons/components/ArrowLeft.js +26 -20
- package/dist/assets/icons/components/ArrowRight.js +26 -20
- package/dist/assets/icons/components/ArrowUp.js +25 -19
- package/dist/assets/icons/components/BarChart.js +36 -24
- package/dist/assets/icons/components/BookOpen.js +30 -20
- package/dist/assets/icons/components/CalendarMonth.js +26 -20
- package/dist/assets/icons/components/Check.js +26 -20
- package/dist/assets/icons/components/CheckCircleFilled.js +29 -25
- package/dist/assets/icons/components/CheckCircleOutline.js +26 -20
- package/dist/assets/icons/components/CheckboxMarkedCircleOutline.js +24 -20
- package/dist/assets/icons/components/ClockAlert.js +26 -20
- package/dist/assets/icons/components/ClockOutline.js +26 -20
- package/dist/assets/icons/components/Close.js +26 -20
- package/dist/assets/icons/components/Cloud.js +20 -20
- package/dist/assets/icons/components/CloudLockOutline.js +26 -20
- package/dist/assets/icons/components/Clusters.js +42 -24
- package/dist/assets/icons/components/CogOutline.js +26 -20
- package/dist/assets/icons/components/Copy.js +26 -20
- package/dist/assets/icons/components/Cpu.js +39 -23
- package/dist/assets/icons/components/Cube.js +26 -20
- package/dist/assets/icons/components/Datacenter.js +26 -20
- package/dist/assets/icons/components/Delete.js +26 -20
- package/dist/assets/icons/components/DollarSign.js +28 -20
- package/dist/assets/icons/components/Download.js +26 -20
- package/dist/assets/icons/components/Edit.js +26 -20
- package/dist/assets/icons/components/Ellipses.js +26 -20
- package/dist/assets/icons/components/Environments.js +28 -20
- package/dist/assets/icons/components/Error.js +26 -20
- package/dist/assets/icons/components/ErrorOutline.js +26 -20
- package/dist/assets/icons/components/Exclamation.js +26 -20
- package/dist/assets/icons/components/Git.js +26 -20
- package/dist/assets/icons/components/GitOpsCatalog.js +39 -23
- package/dist/assets/icons/components/GridView.js +20 -20
- package/dist/assets/icons/components/Help.js +23 -25
- package/dist/assets/icons/components/HideOutline.js +35 -23
- package/dist/assets/icons/components/Home.js +26 -20
- package/dist/assets/icons/components/Home2.js +26 -20
- package/dist/assets/icons/components/Id.js +25 -19
- package/dist/assets/icons/components/InfoCircle.js +29 -25
- package/dist/assets/icons/components/InformationOutline.js +26 -20
- package/dist/assets/icons/components/InvoiceList.js +26 -20
- package/dist/assets/icons/components/Key.js +26 -20
- package/dist/assets/icons/components/LightBulb.js +41 -23
- package/dist/assets/icons/components/Loader.js +26 -20
- package/dist/assets/icons/components/Network.js +26 -20
- package/dist/assets/icons/components/PagesStack.js +23 -25
- package/dist/assets/icons/components/Pageview.js +26 -20
- package/dist/assets/icons/components/People.js +26 -20
- package/dist/assets/icons/components/PhotoLibrary.js +25 -19
- package/dist/assets/icons/components/Pipeline.js +28 -20
- package/dist/assets/icons/components/Plus.js +26 -20
- package/dist/assets/icons/components/PowerSettings.js +26 -20
- package/dist/assets/icons/components/Preview.js +26 -20
- package/dist/assets/icons/components/ReceiptLong.js +20 -20
- package/dist/assets/icons/components/Refresh.js +26 -20
- package/dist/assets/icons/components/ScatterPlot.js +20 -20
- package/dist/assets/icons/components/Search.js +30 -25
- package/dist/assets/icons/components/Server.js +26 -20
- package/dist/assets/icons/components/Start.js +26 -20
- package/dist/assets/icons/components/TabNew.js +48 -24
- package/dist/assets/icons/components/Teams.js +26 -20
- package/dist/assets/icons/components/Upload.js +25 -19
- package/dist/assets/icons/components/Warning.js +26 -20
- package/dist/assets/icons/components/WarningTriangle.js +26 -20
- package/dist/assets/icons/components/X.js +26 -20
- package/dist/components/Alert/Alert.js +61 -78
- package/dist/components/Alert/Alert.variants.js +85 -30
- package/dist/components/AlertDialog/AlertDialog.js +128 -102
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +2 -3
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/AlertDialog/hooks/useAlertDialog.js +7 -25
- package/dist/components/Autocomplete/Autocomplete.js +83 -55
- package/dist/components/Autocomplete/Autocomplete.variants.js +21 -1
- package/dist/components/Autocomplete/components/List/List.js +45 -48
- package/dist/components/Autocomplete/components/List/List.variants.js +29 -1
- package/dist/components/Autocomplete/hooks/useAutocomplete.js +58 -74
- package/dist/components/Autocomplete/hooks/useNavigationList.js +62 -68
- package/dist/components/Badge/Badge.js +77 -66
- package/dist/components/Badge/Badge.variants.js +96 -33
- package/dist/components/Breadcrumb/Breadcrumb.js +70 -78
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +7 -1
- package/dist/components/Breadcrumb/components/Item/Item.js +47 -33
- package/dist/components/Breadcrumb/components/Item/Item.variants.js +63 -26
- package/dist/components/Button/Button.js +40 -37
- package/dist/components/Button/Button.variants.js +292 -96
- package/dist/components/ButtonGroup/ButtonGroup.js +138 -101
- package/dist/components/ButtonGroup/ButtonGroup.variants.js +31 -9
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.js +113 -105
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.variants.js +94 -48
- package/dist/components/ButtonGroup/components/ButtonGroupLabel/ButtonGroupLabel.js +43 -26
- package/dist/components/ButtonGroup/components/ButtonGroupMessage/ButtonGroupMessage.js +35 -28
- package/dist/components/ButtonGroup/hooks/useButtonGroup.js +61 -63
- package/dist/components/Card/Card.js +35 -35
- package/dist/components/Card/Card.variants.js +37 -25
- package/dist/components/Checkbox/Checkbox.js +268 -247
- package/dist/components/Checkbox/Checkbox.variants.js +65 -18
- package/dist/components/Command/Command.js +38 -46
- package/dist/components/Command/Command.variants.js +44 -1
- package/dist/components/Command/components/Command.js +6 -19
- package/dist/components/Command/components/CommandEmpty.js +13 -11
- package/dist/components/Command/components/CommandGroup.js +17 -19
- package/dist/components/Command/components/CommandInput.js +52 -60
- package/dist/components/Command/components/CommandItem.js +26 -28
- package/dist/components/Command/components/CommandList.js +14 -19
- package/dist/components/Command/components/CommandSeparator.js +14 -19
- package/dist/components/Command/components/CommandShortcut.js +16 -16
- package/dist/components/Command/components/DialogContent.js +29 -35
- package/dist/components/Command/components/DialogOverlay.js +16 -18
- package/dist/components/Command/contexts/Command.provider.js +21 -23
- package/dist/components/Counter/Counter.js +154 -151
- package/dist/components/Counter/Counter.variants.js +53 -6
- package/dist/components/DateRangePicker/DateRangePicker.js +162 -93
- package/dist/components/DateRangePicker/DateRangePicker.variants.js +20 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/CalendarPanel.js +115 -81
- package/dist/components/DateRangePicker/components/CalendarPanel/CalendarPanel.variants.js +45 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarDivider/CalendarDivider.js +20 -14
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +57 -50
- package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +250 -55
- package/dist/components/DateRangePicker/components/CalendarPanel/components/NavigationButton/NavigationButton.js +37 -33
- package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +94 -29
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/index.js +126 -10
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useIndependentCarousel.js +113 -138
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.js +16 -2
- package/dist/components/DateRangePicker/components/DateTimeInputs/DateTimeInputs.js +102 -68
- package/dist/components/DateRangePicker/components/DateTimeInputs/DateTimeInputs.variants.js +22 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.js +90 -55
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.js +90 -55
- package/dist/components/DateRangePicker/components/DateTimeInputs/hooks/useDateTimeInputs.js +177 -204
- package/dist/components/DateRangePicker/components/PresetPanel/PresetPanel.js +63 -58
- package/dist/components/DateRangePicker/components/PresetPanel/PresetPanel.variants.js +19 -1
- package/dist/components/DateRangePicker/constants/presets.js +7 -16
- package/dist/components/DateRangePicker/contexts/date-range-picker.hook.js +3 -1
- package/dist/components/DateRangePicker/contexts/date-range-picker.provider.js +171 -187
- package/dist/components/DateRangePicker/utils/disabled-dates.js +22 -16
- package/dist/components/DateRangePicker/utils/validation.js +17 -2
- package/dist/components/Datepicker/DatePicker.js +135 -80
- package/dist/components/Divider/Divider.js +7 -18
- package/dist/components/Drawer/Drawer.js +130 -108
- package/dist/components/Drawer/Drawer.variants.js +81 -17
- package/dist/components/Drawer/components/Body/Body.js +21 -18
- package/dist/components/Drawer/components/Footer/Footer.js +23 -18
- package/dist/components/Drawer/components/Header/Header.js +24 -20
- package/dist/components/Drawer/contexts/Drawer.context.js +2 -2
- package/dist/components/Drawer/hooks/useDrawer.js +57 -81
- package/dist/components/DropdownButton/DropdownButton.js +114 -99
- package/dist/components/Filter/Filter.js +29 -40
- package/dist/components/Filter/Filter.variants.js +17 -1
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +94 -128
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +144 -83
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +81 -87
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +120 -66
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.js +34 -22
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.js +117 -74
- package/dist/components/Filter/components/ResetButton/ResetButton.js +29 -24
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +135 -83
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.js +69 -83
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.js +151 -80
- package/dist/components/Filter/contexts/filter.provider.js +4 -16
- package/dist/components/Filter/events/index.js +3 -3
- package/dist/components/ImageUpload/ImageUpload.js +150 -48
- package/dist/components/ImageUpload/ImageUpload.variants.js +93 -41
- package/dist/components/Input/Input.js +168 -43
- package/dist/components/Input/Input.variants.js +51 -9
- package/dist/components/LineChart/LineChart.js +120 -83
- package/dist/components/Loading/Loading.js +18 -22
- package/dist/components/Loading/Loading.variants.js +8 -1
- package/dist/components/Modal/Modal.js +2 -3
- package/dist/components/Modal/components/Body/Body.js +5 -16
- package/dist/components/Modal/components/Footer/Footer.js +11 -16
- package/dist/components/Modal/components/Header/Header.js +11 -16
- package/dist/components/Modal/components/Wrapper/Wrapper.js +3 -4
- package/dist/components/Modal/components/Wrapper/Wrapper.variants.js +28 -1
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/Modal/contexts/Modal.context.js +3 -1
- package/dist/components/Modal/contexts/Modal.provider.js +23 -33
- package/dist/components/Modal/hooks/useModal.js +18 -29
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +32 -26
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +25 -1
- package/dist/components/MultiSelectDropdown/components/Item/Item.js +27 -32
- package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +32 -13
- package/dist/components/MultiSelectDropdown/components/List/List.js +27 -26
- package/dist/components/MultiSelectDropdown/components/List/List.variants.js +21 -1
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +123 -73
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.hook.js +3 -1
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.provider.js +131 -128
- package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +26 -30
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +6 -19
- package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +39 -9
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +33 -28
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +79 -21
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +41 -7
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +36 -47
- package/dist/components/PhoneNumberInput/components/Wrapper.js +503 -465
- package/dist/components/PhoneNumberInput/contexts/phone-number.hook.js +3 -1
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +1135 -1163
- package/dist/components/PieChart/PieChart.js +72 -82
- package/dist/components/ProgressBar/ProgressBar.js +38 -47
- package/dist/components/ProgressBar/ProgressBar.variants.js +28 -11
- package/dist/components/Radio/Radio.js +95 -71
- package/dist/components/Radio/Radio.variants.js +85 -33
- package/dist/components/RadioCard/RadioCard.js +36 -32
- package/dist/components/RadioCardGroup/RadioCardGroup.js +43 -42
- package/dist/components/RadioGroup/RadioGroup.js +48 -48
- package/dist/components/Range/Range.js +61 -83
- package/dist/components/Range/Range.variants.js +49 -19
- package/dist/components/Select/Select.js +65 -52
- package/dist/components/Select/Select.variants.js +66 -13
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.js +2 -3
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.variants.js +22 -1
- package/dist/components/Select/components/EmptyList.js +3 -8
- package/dist/components/Select/components/List/List.js +168 -89
- package/dist/components/Select/components/List/List.variants.js +41 -1
- package/dist/components/Select/components/ListItem/ListItem.js +96 -41
- package/dist/components/Select/components/ListItem/ListItem.variants.js +19 -1
- package/dist/components/Select/components/Wrapper.js +233 -110
- package/dist/components/Select/components/index.js +1 -1
- package/dist/components/Select/contexts/select.provider.js +41 -34
- package/dist/components/Select/hooks/useNavigationList.js +44 -50
- package/dist/components/Select/hooks/useSelect.js +94 -104
- package/dist/components/Sidebar/Sidebar.js +21 -26
- package/dist/components/Sidebar/Sidebar.variants.js +27 -1
- package/dist/components/Sidebar/components/Footer/Footer.js +6 -18
- package/dist/components/Sidebar/components/Footer/Footer.variants.js +8 -1
- package/dist/components/Sidebar/components/Logo/Logo.js +6 -18
- package/dist/components/Sidebar/components/Logo/Logo.variants.js +19 -1
- package/dist/components/Sidebar/components/Navigation/Navigation.js +17 -26
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.js +24 -33
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +24 -24
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +39 -12
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.js +6 -17
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.variants.js +5 -1
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.js +5 -20
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.variants.js +10 -1
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +60 -21
- package/dist/components/Slider/Slider.js +56 -70
- package/dist/components/Slider/Slider.variants.js +41 -19
- package/dist/components/Spinner/Spinner.js +55 -56
- package/dist/components/Spinner/Spinner.variants.js +45 -19
- package/dist/components/Stepper/Stepper.js +72 -56
- package/dist/components/Stepper/Stepper.variants.js +188 -132
- package/dist/components/Stepper/components/HorizontalStepItem/HorizontalStepItem.js +197 -151
- package/dist/components/Stepper/components/StepConnector/StepConnector.js +27 -24
- package/dist/components/Stepper/components/StepIndicatorContent/StepIndicatorContent.js +20 -39
- package/dist/components/Stepper/components/StepItem/StepItem.js +6 -15
- package/dist/components/Stepper/components/VerticalStepItem/VerticalStepItem.js +111 -93
- package/dist/components/Stepper/hooks/useStepItemLogic.js +6 -3
- package/dist/components/Switch/Switch.js +178 -135
- package/dist/components/Switch/Switch.variants.js +40 -1
- package/dist/components/Table/Table.js +25 -29
- package/dist/components/Table/Table.variants.js +30 -6
- package/dist/components/Table/components/Body.js +16 -20
- package/dist/components/Table/components/Filter.js +7 -21
- package/dist/components/Table/components/Head.js +16 -20
- package/dist/components/Table/components/Row.js +26 -28
- package/dist/components/Tabs/Tabs.js +26 -34
- package/dist/components/Tabs/Tabs.variants.js +39 -10
- package/dist/components/Tabs/components/Content.js +14 -23
- package/dist/components/Tabs/components/List.js +19 -28
- package/dist/components/Tabs/components/Trigger.js +21 -25
- package/dist/components/Tag/Tag.js +17 -33
- package/dist/components/Tag/Tag.variants.js +36 -23
- package/dist/components/TagSelect/TagSelect.js +8 -19
- package/dist/components/TagSelect/TagSelect.variants.js +22 -1
- package/dist/components/TagSelect/components/Item/Item.js +18 -24
- package/dist/components/TagSelect/components/Item/Item.variants.js +26 -13
- package/dist/components/TagSelect/components/List/List.js +9 -22
- package/dist/components/TagSelect/components/List/List.variants.js +19 -1
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +84 -68
- package/dist/components/TagSelect/contexts/TagSelect.provider.js +65 -75
- package/dist/components/TagSelect/hooks/useTagSelect.js +26 -30
- package/dist/components/TextArea/TextArea.js +34 -35
- package/dist/components/TextArea/TextArea.variants.js +16 -1
- package/dist/components/TimePicker/TimePicker.js +11 -21
- package/dist/components/TimePicker/TimePicker.variants.js +64 -1
- package/dist/components/TimePicker/components/HoursList/HoursList.js +116 -77
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +88 -79
- package/dist/components/TimePicker/components/MinutesList/MinutesList.js +89 -66
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +228 -144
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +75 -44
- package/dist/components/TimePicker/contexts/time-picker.hook.js +3 -1
- package/dist/components/TimePicker/contexts/time-picker.provider.js +58 -76
- package/dist/components/Toast/Toast.js +338 -374
- package/dist/components/Toast/Toast.variants.js +43 -10
- package/dist/components/Tooltip/Tooltip.js +35 -36
- package/dist/components/Typography/Typography.js +23 -26
- package/dist/components/Typography/Typography.variants.js +59 -24
- package/dist/components/VirtualizedTable/VirtualizedTable.js +91 -9
- package/dist/components/VirtualizedTable/assets/chevron-down.js +23 -13
- package/dist/components/VirtualizedTable/assets/chevron-up.js +22 -12
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +115 -62
- package/dist/components/VirtualizedTable/components/Body/Body.js +83 -29
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +165 -104
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +19 -13
- package/dist/components/VirtualizedTable/components/ExpandableRow/ExpandableRow.js +49 -43
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +174 -116
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +57 -32
- package/dist/components/VirtualizedTable/components/Header/Header.js +98 -61
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +63 -65
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +102 -32
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +58 -51
- package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +24 -20
- package/dist/components/VirtualizedTable/contexts/table.provider.js +158 -129
- package/dist/components/VirtualizedTable/events/index.js +18 -18
- package/dist/components/index.js +1 -1
- package/dist/contexts/theme.provider.js +49 -61
- package/dist/hooks/useToggle.js +8 -10
- package/dist/index-C7zAY3xv.js +139 -0
- package/dist/{index-kTGTSLpq.js → index-Cmf-IG4l.js} +1 -1
- package/dist/{index-Dy4FVowi.js → index-CrCTywU1.js} +1 -1
- package/dist/{index-C6mt--X_.js → index-DWyM654o.js} +5 -5
- package/dist/{index-B9v5VxE2.js → index-Jr0cra7i.js} +6 -6
- package/dist/{index-CiACf4ao.js → index-mPinF0Ho.js} +3 -3
- package/dist/index.js +1 -1
- package/dist/package.json +1 -2
- package/dist/utils/index.js +3 -1
- package/package.json +1 -2
- package/dist/AdditionalOptions-DiXvUzhu.js +0 -42
- package/dist/Modal-h5H4yxYg.js +0 -128
- package/dist/compiler-runtime-DA41awpA.js +0 -36
- package/dist/index-0g-eSmV1.js +0 -142
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as A } from "react/jsx-runtime";
|
|
2
|
-
import { V as
|
|
3
|
-
import { useQuery as
|
|
4
|
-
import { u as
|
|
5
|
-
import { useState as o, useMemo as g, useCallback as c, useEffect as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { VirtualizedTableEvent as
|
|
8
|
-
import { TableContext as
|
|
9
|
-
import { C as
|
|
10
|
-
import { DEFAULT_PAGE_SIZE as
|
|
2
|
+
import { V as $e } from "../../../index-BKjcReYh.js";
|
|
3
|
+
import { useQuery as qe } from "@tanstack/react-query";
|
|
4
|
+
import { u as ze, g as Ne, a as ve } from "../../../index-CSWGJT-v.js";
|
|
5
|
+
import { useState as o, useMemo as g, useCallback as c, useEffect as G } from "react";
|
|
6
|
+
import { cn as _ } from "../../../utils/index.js";
|
|
7
|
+
import { VirtualizedTableEvent as Q } from "../events/index.js";
|
|
8
|
+
import { TableContext as Re } from "./table.context.js";
|
|
9
|
+
import { C as We } from "../../../chevron-right-DvXGOiS_.js";
|
|
10
|
+
import { DEFAULT_PAGE_SIZE as Ge } from "../constants/pagination.js";
|
|
11
11
|
const et = ({
|
|
12
12
|
children: J,
|
|
13
13
|
classNameExpandedCell: Y,
|
|
@@ -16,7 +16,7 @@ const et = ({
|
|
|
16
16
|
classNameExpandedHeader: ne,
|
|
17
17
|
classNameActiveExpandedRow: oe,
|
|
18
18
|
classNameHoverRow: re,
|
|
19
|
-
columns:
|
|
19
|
+
columns: K = [],
|
|
20
20
|
data: k = [],
|
|
21
21
|
defaultExpanded: se,
|
|
22
22
|
enableExpandedRow: d,
|
|
@@ -29,13 +29,16 @@ const et = ({
|
|
|
29
29
|
getRowId: h,
|
|
30
30
|
fetchData: u,
|
|
31
31
|
onExpandedChange: H,
|
|
32
|
-
renderExpandedRow:
|
|
32
|
+
renderExpandedRow: w,
|
|
33
33
|
keepExpandColumnVisible: l
|
|
34
34
|
}) => {
|
|
35
|
-
const [U, V] = o([]), [ce, de] = o(!!u), [
|
|
35
|
+
const [U, V] = o([]), [ce, de] = o(!!u), [M, p] = o(0), [I, ue] = o(), [y, me] = o(Ge), [fe, ge] = o(D), P = u ? fe : D, he = g(
|
|
36
|
+
() => Math.ceil(P / y),
|
|
37
|
+
[P, y]
|
|
38
|
+
), [O, pe] = o({}), [x, ye] = o({}), [F, Se] = o({}), [E, be] = o({}), $ = qe({
|
|
36
39
|
queryKey: (() => {
|
|
37
40
|
const e = typeof i == "string" || typeof i == "number" ? [i] : i;
|
|
38
|
-
return ie && e.push(
|
|
41
|
+
return ie && e.push(M, y), I && e.push(I), Object.entries(O).forEach(([t, n]) => {
|
|
39
42
|
e.push(`${t}:${n.join(",")}`);
|
|
40
43
|
}), Object.entries(x).forEach(([t, n]) => {
|
|
41
44
|
n && e.push(`${t}:${n}`);
|
|
@@ -50,19 +53,16 @@ const et = ({
|
|
|
50
53
|
initialData: k,
|
|
51
54
|
enabled: !!u,
|
|
52
55
|
queryFn: async () => u({
|
|
53
|
-
page: Math.max(
|
|
56
|
+
page: Math.max(M + 1, 1),
|
|
54
57
|
pageSize: y,
|
|
55
58
|
termOfSearch: I,
|
|
56
59
|
...Object.keys(O).length > 0 ? O : {},
|
|
57
60
|
...Object.keys(x).length > 0 ? x : {},
|
|
58
61
|
...Object.keys(F).length > 0 ? F : {},
|
|
59
62
|
...Object.keys(E).length > 0 ? E : {}
|
|
60
|
-
}).then(({
|
|
61
|
-
data: e,
|
|
62
|
-
totalItemsCount: t
|
|
63
|
-
}) => (de(!1), t && ge(t), e)),
|
|
63
|
+
}).then(({ data: e, totalItemsCount: t }) => (de(!1), t && ge(t), e)),
|
|
64
64
|
...le
|
|
65
|
-
}), S = u ?
|
|
65
|
+
}), S = u ? $.data : k, Ce = u ? $.isLoading : !1, q = u ? $.isFetching : !1, we = c((e) => {
|
|
66
66
|
ue(e), p(0);
|
|
67
67
|
}, []), Ie = c((e, t) => {
|
|
68
68
|
const n = e.toLowerCase().replace(/\s+/g, "_");
|
|
@@ -76,80 +76,83 @@ const et = ({
|
|
|
76
76
|
...a,
|
|
77
77
|
[n]: t?.toISOString()
|
|
78
78
|
})), p(0);
|
|
79
|
-
}, []), xe = c(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
from: t.from?.toISOString(),
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
79
|
+
}, []), xe = c(
|
|
80
|
+
(e, t) => {
|
|
81
|
+
const n = e.toLowerCase().replace(/\s+/g, "_");
|
|
82
|
+
Se((a) => ({
|
|
83
|
+
...a,
|
|
84
|
+
[n]: t ? { from: t.from?.toISOString(), to: t.to?.toISOString() } : void 0
|
|
85
|
+
})), p(0);
|
|
86
|
+
},
|
|
87
|
+
[]
|
|
88
|
+
), Fe = c((e, t) => {
|
|
89
89
|
const n = e.toLowerCase().replace(/\s+/g, "_");
|
|
90
90
|
be((a) => ({
|
|
91
91
|
...a,
|
|
92
92
|
[n]: t?.toISOString()
|
|
93
93
|
})), p(0);
|
|
94
|
-
}, []), Ee = c((e) => p(e), []), Le = c(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
}, []), Ee = c((e) => p(e), []), Le = c(
|
|
95
|
+
(e) => me(e),
|
|
96
|
+
[]
|
|
97
|
+
), [je, Te] = o(
|
|
98
|
+
se ?? {}
|
|
99
|
+
), z = B !== void 0, m = z ? B : je, b = c(
|
|
100
|
+
(e) => {
|
|
101
|
+
const t = typeof e == "function" ? e(m) : e;
|
|
102
|
+
z || Te(t), H?.(e);
|
|
103
|
+
},
|
|
104
|
+
[m, z, H]
|
|
105
|
+
);
|
|
106
|
+
G(() => {
|
|
99
107
|
if (!d) return;
|
|
100
|
-
const e = Array.isArray(i) ? i.join(",") : String(i), t = new AbortController(), n = (
|
|
101
|
-
const {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
[r.rowId]: !0
|
|
106
|
-
} : {
|
|
107
|
-
...s,
|
|
108
|
-
[r.rowId]: !0
|
|
109
|
-
});
|
|
110
|
-
}, a = (w) => {
|
|
111
|
-
const {
|
|
112
|
-
detail: r
|
|
113
|
-
} = w;
|
|
108
|
+
const e = Array.isArray(i) ? i.join(",") : String(i), t = new AbortController(), n = (C) => {
|
|
109
|
+
const { detail: r } = C;
|
|
110
|
+
r.tableId === e && b((s) => typeof s == "boolean" ? { [r.rowId]: !0 } : { ...s, [r.rowId]: !0 });
|
|
111
|
+
}, a = (C) => {
|
|
112
|
+
const { detail: r } = C;
|
|
114
113
|
r.tableId === e && b((s) => {
|
|
115
114
|
if (typeof s == "boolean") return {};
|
|
116
|
-
const T = {
|
|
117
|
-
...s
|
|
118
|
-
};
|
|
115
|
+
const T = { ...s };
|
|
119
116
|
return delete T[r.rowId], T;
|
|
120
117
|
});
|
|
121
|
-
},
|
|
122
|
-
const {
|
|
123
|
-
detail: r
|
|
124
|
-
} = w;
|
|
118
|
+
}, Pe = (C) => {
|
|
119
|
+
const { detail: r } = C;
|
|
125
120
|
r.tableId === e && b((s) => {
|
|
126
|
-
if (typeof s == "boolean") return {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const T = !!s[r.rowId], G = {
|
|
130
|
-
...s
|
|
131
|
-
};
|
|
132
|
-
return T ? delete G[r.rowId] : G[r.rowId] = !0, G;
|
|
121
|
+
if (typeof s == "boolean") return { [r.rowId]: !s };
|
|
122
|
+
const T = !!s[r.rowId], W = { ...s };
|
|
123
|
+
return T ? delete W[r.rowId] : W[r.rowId] = !0, W;
|
|
133
124
|
});
|
|
134
125
|
};
|
|
135
|
-
return document.addEventListener(
|
|
136
|
-
signal: t.signal
|
|
137
|
-
}), document.addEventListener(_.COLLAPSE_ROW, a, {
|
|
126
|
+
return document.addEventListener(Q.EXPAND_ROW, n, {
|
|
138
127
|
signal: t.signal
|
|
139
|
-
}), document.addEventListener(
|
|
128
|
+
}), document.addEventListener(
|
|
129
|
+
Q.COLLAPSE_ROW,
|
|
130
|
+
a,
|
|
131
|
+
{ signal: t.signal }
|
|
132
|
+
), document.addEventListener(Q.TOGGLE_ROW, Pe, {
|
|
140
133
|
signal: t.signal
|
|
141
134
|
}), () => t.abort();
|
|
142
135
|
}, [d, i, b]);
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
136
|
+
const N = g(
|
|
137
|
+
() => S.some((e) => !!e.meta?.expandedRow),
|
|
138
|
+
[S]
|
|
139
|
+
), L = g(
|
|
140
|
+
() => q ? [] : S.map(
|
|
141
|
+
(e, t) => h ? h(e, t) : String(t)
|
|
142
|
+
),
|
|
143
|
+
[S, h, q]
|
|
144
|
+
), Ae = g(() => typeof m == "boolean" ? m : L.some((e) => !!m[e]), [m, L]), _e = g(() => typeof l == "boolean" ? l : typeof l == "object" ? L.some((e) => !!l[e]) : !1, [l, L]), v = N || w && (Ae || _e), [f, X] = o(!!v);
|
|
145
|
+
G(() => {
|
|
146
|
+
if (v) {
|
|
146
147
|
const e = requestAnimationFrame(() => X(!0));
|
|
147
148
|
return () => cancelAnimationFrame(e);
|
|
148
149
|
} else
|
|
149
150
|
X(!1);
|
|
150
|
-
}, [
|
|
151
|
-
const [j, Z] = o(
|
|
152
|
-
|
|
151
|
+
}, [v]);
|
|
152
|
+
const [j, Z] = o(
|
|
153
|
+
!f
|
|
154
|
+
);
|
|
155
|
+
G(() => {
|
|
153
156
|
if (f)
|
|
154
157
|
Z(!1);
|
|
155
158
|
else {
|
|
@@ -157,84 +160,110 @@ const et = ({
|
|
|
157
160
|
return () => clearTimeout(e);
|
|
158
161
|
}
|
|
159
162
|
}, [f]);
|
|
160
|
-
const
|
|
163
|
+
const R = g(() => !d || !N && !w ? null : {
|
|
161
164
|
id: "__expand",
|
|
162
|
-
header: () => /* @__PURE__ */ A(
|
|
163
|
-
cell: ({
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
165
|
+
header: () => /* @__PURE__ */ A($e, { children: "Expand Column" }),
|
|
166
|
+
cell: ({ row: e }) => {
|
|
167
|
+
const { meta: t } = e.original, n = typeof l == "object" && !!l[e.id];
|
|
168
|
+
return !t?.expandedRow && !e.getIsExpanded() && !n ? null : /* @__PURE__ */ A(
|
|
169
|
+
"button",
|
|
170
|
+
{
|
|
171
|
+
type: "button",
|
|
172
|
+
className: "hover:cursor-pointer",
|
|
173
|
+
onClick: () => e.toggleExpanded(),
|
|
174
|
+
"aria-label": e.getIsExpanded() ? "Collapse row" : "Expand row",
|
|
175
|
+
children: /* @__PURE__ */ A(
|
|
176
|
+
We,
|
|
177
|
+
{
|
|
178
|
+
className: _(
|
|
179
|
+
"size-4 transition-transform text-slate-400 dark:text-metal-400",
|
|
180
|
+
{
|
|
181
|
+
"-rotate-90": e.getIsExpanded()
|
|
182
|
+
}
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
)
|
|
186
|
+
}
|
|
187
|
+
);
|
|
172
188
|
},
|
|
173
189
|
enableSorting: !1,
|
|
174
190
|
meta: {
|
|
175
|
-
headerClassName:
|
|
191
|
+
headerClassName: _(
|
|
176
192
|
"transition-[width,max-width,padding] duration-300 ease-in-out overflow-hidden",
|
|
177
193
|
// Width: immediate change, CSS transition handles animation
|
|
178
194
|
f ? "w-10 max-w-10 px-2" : "w-0 max-w-0 !p-0",
|
|
179
195
|
// Border/radius: deferred on collapse so border stays during exit
|
|
180
196
|
j && "!border-0 !rounded-none [&+th]:rounded-tl-lg dark:[&+th]:border-l"
|
|
181
197
|
),
|
|
182
|
-
className:
|
|
198
|
+
className: _(
|
|
199
|
+
"transition-[width,max-width,padding] duration-300 ease-in-out overflow-hidden",
|
|
200
|
+
f ? _("w-10 max-w-10 px-1 text-center", ne) : "w-0 max-w-0 !p-0",
|
|
201
|
+
j && "!border-0 dark:[&+td]:border-l"
|
|
202
|
+
)
|
|
183
203
|
}
|
|
184
|
-
}, [
|
|
204
|
+
}, [
|
|
205
|
+
d,
|
|
206
|
+
N,
|
|
207
|
+
w,
|
|
208
|
+
f,
|
|
209
|
+
j,
|
|
210
|
+
l
|
|
211
|
+
]), Ke = g(() => R ? [R, ...K] : K, [K, R]), Me = ze({
|
|
185
212
|
data: S,
|
|
186
|
-
columns:
|
|
187
|
-
...h ? {
|
|
188
|
-
getRowId: h
|
|
189
|
-
} : {},
|
|
213
|
+
columns: Ke,
|
|
214
|
+
...h ? { getRowId: h } : {},
|
|
190
215
|
state: {
|
|
191
216
|
sorting: U,
|
|
192
|
-
...d ? {
|
|
193
|
-
expanded: m
|
|
194
|
-
} : {}
|
|
217
|
+
...d ? { expanded: m } : {}
|
|
195
218
|
},
|
|
196
219
|
onSortingChange: V,
|
|
197
220
|
...d ? {
|
|
198
221
|
onExpandedChange: b,
|
|
199
222
|
manualExpanding: !0
|
|
200
223
|
} : {},
|
|
201
|
-
getCoreRowModel:
|
|
202
|
-
getSortedRowModel:
|
|
224
|
+
getCoreRowModel: ve(),
|
|
225
|
+
getSortedRowModel: Ne()
|
|
203
226
|
});
|
|
204
|
-
return /* @__PURE__ */ A(
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
227
|
+
return /* @__PURE__ */ A(
|
|
228
|
+
Re.Provider,
|
|
229
|
+
{
|
|
230
|
+
value: {
|
|
231
|
+
classNameActiveExpandedRow: oe,
|
|
232
|
+
classNameExpandedCell: Y,
|
|
233
|
+
classNameExpandedContent: ee,
|
|
234
|
+
classNameExpandedRow: te,
|
|
235
|
+
classNameHoverRow: re,
|
|
236
|
+
enableExpandedRow: d,
|
|
237
|
+
enableHoverRow: ae,
|
|
238
|
+
isBorderOnAdjacentCell: j,
|
|
239
|
+
isExpandColumnVisible: f,
|
|
240
|
+
isFirstLoad: ce,
|
|
241
|
+
multiselectSelected: O,
|
|
242
|
+
dateFilters: x,
|
|
243
|
+
dateRangeFilters: F,
|
|
244
|
+
timeFilters: E,
|
|
245
|
+
page: M,
|
|
246
|
+
pageSize: y,
|
|
247
|
+
sortedData: U,
|
|
248
|
+
table: Me,
|
|
249
|
+
tableFetching: q,
|
|
250
|
+
tableLoading: Ce,
|
|
251
|
+
termOfSearch: I,
|
|
252
|
+
totalItems: P,
|
|
253
|
+
totalPages: he,
|
|
254
|
+
handlePage: Ee,
|
|
255
|
+
onChangeTermOfSearch: we,
|
|
256
|
+
onPageSize: Le,
|
|
257
|
+
onSelectMultiselect: Ie,
|
|
258
|
+
onSelectDateFilter: Oe,
|
|
259
|
+
onSelectDateRangeFilter: xe,
|
|
260
|
+
onSelectTimeFilter: Fe,
|
|
261
|
+
onSorting: V,
|
|
262
|
+
renderExpandedRow: w
|
|
263
|
+
},
|
|
264
|
+
children: J
|
|
265
|
+
}
|
|
266
|
+
);
|
|
238
267
|
};
|
|
239
268
|
export {
|
|
240
269
|
et as TableProvider
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
var n = /* @__PURE__ */ ((t) => (t.EXPAND_ROW = "@konstructio/VirtualizedTable/event-EXPAND_ROW", t.COLLAPSE_ROW = "@konstructio/VirtualizedTable/event-COLLAPSE_ROW", t.TOGGLE_ROW = "@konstructio/VirtualizedTable/event-TOGGLE_ROW", t))(n || {});
|
|
2
2
|
const o = (t, e) => {
|
|
3
|
-
document.dispatchEvent(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
rowId: e
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
document.dispatchEvent(
|
|
4
|
+
new CustomEvent(
|
|
5
|
+
"@konstructio/VirtualizedTable/event-EXPAND_ROW",
|
|
6
|
+
{ detail: { tableId: t, rowId: e } }
|
|
7
|
+
)
|
|
8
|
+
);
|
|
9
9
|
}, i = (t, e) => {
|
|
10
|
-
document.dispatchEvent(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
rowId: e
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
document.dispatchEvent(
|
|
11
|
+
new CustomEvent(
|
|
12
|
+
"@konstructio/VirtualizedTable/event-COLLAPSE_ROW",
|
|
13
|
+
{ detail: { tableId: t, rowId: e } }
|
|
14
|
+
)
|
|
15
|
+
);
|
|
16
16
|
}, s = (t, e) => {
|
|
17
|
-
document.dispatchEvent(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
rowId: e
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
document.dispatchEvent(
|
|
18
|
+
new CustomEvent(
|
|
19
|
+
"@konstructio/VirtualizedTable/event-TOGGLE_ROW",
|
|
20
|
+
{ detail: { tableId: t, rowId: e } }
|
|
21
|
+
)
|
|
22
|
+
);
|
|
23
23
|
};
|
|
24
24
|
export {
|
|
25
25
|
n as VirtualizedTableEvent,
|
package/dist/components/index.js
CHANGED
|
@@ -18,7 +18,7 @@ import { ImageUpload as k } from "./ImageUpload/ImageUpload.js";
|
|
|
18
18
|
import { Input as G } from "./Input/Input.js";
|
|
19
19
|
import { LineChart as y } from "./LineChart/LineChart.js";
|
|
20
20
|
import { Loading as U } from "./Loading/Loading.js";
|
|
21
|
-
import { M as j } from "../Modal-
|
|
21
|
+
import { M as j } from "../Modal-DAWdufZ_.js";
|
|
22
22
|
import { MultiSelectDropdown as H } from "./MultiSelectDropdown/MultiSelectDropdown.js";
|
|
23
23
|
import { PhoneNumberInput as K } from "./PhoneNumberInput/PhoneNumberInput.js";
|
|
24
24
|
import { PieChart as X } from "./PieChart/PieChart.js";
|
|
@@ -1,98 +1,86 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { isClient as g } from "../utils/index.js";
|
|
1
|
+
import { jsx as v } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h, useEffect as g } from "react";
|
|
3
|
+
import { isClient as l } from "../utils/index.js";
|
|
5
4
|
import { ThemeContext as C } from "./theme.context.js";
|
|
6
|
-
function
|
|
7
|
-
for (var
|
|
8
|
-
var
|
|
9
|
-
for (var
|
|
10
|
-
|
|
5
|
+
function p(r) {
|
|
6
|
+
for (var o = 1; o < arguments.length; o++) {
|
|
7
|
+
var t = arguments[o];
|
|
8
|
+
for (var f in t)
|
|
9
|
+
r[f] = t[f];
|
|
11
10
|
}
|
|
12
|
-
return
|
|
11
|
+
return r;
|
|
13
12
|
}
|
|
14
|
-
var
|
|
15
|
-
read: function(
|
|
16
|
-
return
|
|
13
|
+
var a = {
|
|
14
|
+
read: function(r) {
|
|
15
|
+
return r[0] === '"' && (r = r.slice(1, -1)), r.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
17
16
|
},
|
|
18
|
-
write: function(
|
|
19
|
-
return encodeURIComponent(
|
|
17
|
+
write: function(r) {
|
|
18
|
+
return encodeURIComponent(r).replace(
|
|
20
19
|
/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
|
|
21
20
|
decodeURIComponent
|
|
22
21
|
);
|
|
23
22
|
}
|
|
24
23
|
};
|
|
25
|
-
function
|
|
26
|
-
function
|
|
24
|
+
function s(r, o) {
|
|
25
|
+
function t(n, u, e) {
|
|
27
26
|
if (!(typeof document > "u")) {
|
|
28
|
-
|
|
27
|
+
e = p({}, o, e), typeof e.expires == "number" && (e.expires = new Date(Date.now() + e.expires * 864e5)), e.expires && (e.expires = e.expires.toUTCString()), n = encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
29
28
|
var i = "";
|
|
30
|
-
for (var c in
|
|
31
|
-
|
|
32
|
-
return document.cookie =
|
|
29
|
+
for (var c in e)
|
|
30
|
+
e[c] && (i += "; " + c, e[c] !== !0 && (i += "=" + e[c].split(";")[0]));
|
|
31
|
+
return document.cookie = n + "=" + r.write(u, n) + i;
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
|
-
function
|
|
36
|
-
if (!(typeof document > "u" || arguments.length && !
|
|
37
|
-
for (var
|
|
38
|
-
var c =
|
|
34
|
+
function f(n) {
|
|
35
|
+
if (!(typeof document > "u" || arguments.length && !n)) {
|
|
36
|
+
for (var u = document.cookie ? document.cookie.split("; ") : [], e = {}, i = 0; i < u.length; i++) {
|
|
37
|
+
var c = u[i].split("="), m = c.slice(1).join("=");
|
|
39
38
|
try {
|
|
40
|
-
var
|
|
41
|
-
if (
|
|
39
|
+
var d = decodeURIComponent(c[0]);
|
|
40
|
+
if (e[d] = r.read(m, d), n === d)
|
|
42
41
|
break;
|
|
43
42
|
} catch {
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
|
-
return
|
|
45
|
+
return n ? e[n] : e;
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
return Object.create(
|
|
50
49
|
{
|
|
51
|
-
set:
|
|
52
|
-
get:
|
|
53
|
-
remove: function(
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
set: t,
|
|
51
|
+
get: f,
|
|
52
|
+
remove: function(n, u) {
|
|
53
|
+
t(
|
|
54
|
+
n,
|
|
56
55
|
"",
|
|
57
|
-
|
|
56
|
+
p({}, u, {
|
|
58
57
|
expires: -1
|
|
59
58
|
})
|
|
60
59
|
);
|
|
61
60
|
},
|
|
62
|
-
withAttributes: function(
|
|
63
|
-
return
|
|
61
|
+
withAttributes: function(n) {
|
|
62
|
+
return s(this.converter, p({}, this.attributes, n));
|
|
64
63
|
},
|
|
65
|
-
withConverter: function(
|
|
66
|
-
return
|
|
64
|
+
withConverter: function(n) {
|
|
65
|
+
return s(p({}, this.converter, n), this.attributes);
|
|
67
66
|
}
|
|
68
67
|
},
|
|
69
68
|
{
|
|
70
|
-
attributes: { value: Object.freeze(
|
|
71
|
-
converter: { value: Object.freeze(
|
|
69
|
+
attributes: { value: Object.freeze(o) },
|
|
70
|
+
converter: { value: Object.freeze(r) }
|
|
72
71
|
}
|
|
73
72
|
);
|
|
74
73
|
}
|
|
75
|
-
var
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
let i, c;
|
|
85
|
-
e[2] !== o ? (i = () => {
|
|
86
|
-
document.querySelector("body")?.setAttribute("data-theme", o);
|
|
87
|
-
}, c = [o], e[2] = o, e[3] = i, e[4] = c) : (i = e[3], c = e[4]), a(i, c);
|
|
88
|
-
let p;
|
|
89
|
-
e[5] !== o ? (p = {
|
|
90
|
-
theme: o,
|
|
91
|
-
setTheme: t
|
|
92
|
-
}, e[5] = o, e[6] = p) : p = e[6];
|
|
93
|
-
let u;
|
|
94
|
-
return e[7] !== f || e[8] !== p ? (u = /* @__PURE__ */ l(C.Provider, { value: p, children: f }), e[7] = f, e[8] = p, e[9] = u) : u = e[9], u;
|
|
74
|
+
var x = s(a, { path: "/" });
|
|
75
|
+
const R = ({
|
|
76
|
+
children: r,
|
|
77
|
+
theme: o
|
|
78
|
+
}) => {
|
|
79
|
+
const [t, f] = h(() => o || (l ? x.get("konstruct-theme") : "kubefirst"));
|
|
80
|
+
return g(() => {
|
|
81
|
+
document.querySelector("body")?.setAttribute("data-theme", t);
|
|
82
|
+
}, [t]), /* @__PURE__ */ v(C.Provider, { value: { theme: t, setTheme: f }, children: r });
|
|
95
83
|
};
|
|
96
84
|
export {
|
|
97
|
-
|
|
85
|
+
R as ThemeProvider
|
|
98
86
|
};
|
package/dist/hooks/useToggle.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
let s;
|
|
9
|
-
return t[2] !== l || t[3] !== e ? (s = [e, l], t[2] = l, t[3] = e, t[4] = s) : s = t[4], s;
|
|
1
|
+
import { useState as l, useCallback as u } from "react";
|
|
2
|
+
const c = (t = !1) => {
|
|
3
|
+
const [e, o] = l(t), s = u(
|
|
4
|
+
(a) => o(a ?? !e),
|
|
5
|
+
[e]
|
|
6
|
+
);
|
|
7
|
+
return [e, s];
|
|
10
8
|
};
|
|
11
9
|
export {
|
|
12
|
-
|
|
10
|
+
c as useToggle
|
|
13
11
|
};
|