@helpwave/hightide 0.0.13 → 0.0.16
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/coloring/shading.d.mts +5 -0
- package/dist/coloring/shading.d.ts +5 -2
- package/dist/coloring/shading.js +80 -38
- package/dist/coloring/shading.js.map +1 -0
- package/dist/coloring/shading.mjs +47 -0
- package/dist/coloring/shading.mjs.map +1 -0
- package/dist/coloring/types.d.mts +13 -0
- package/dist/coloring/types.d.ts +8 -6
- package/dist/coloring/types.js +31 -1
- package/dist/coloring/types.js.map +1 -0
- package/dist/coloring/types.mjs +6 -0
- package/dist/coloring/types.mjs.map +1 -0
- package/dist/components/Avatar.d.mts +17 -0
- package/dist/components/Avatar.d.ts +9 -6
- package/dist/components/Avatar.js +79 -29
- package/dist/components/Avatar.js.map +1 -0
- package/dist/components/Avatar.mjs +48 -0
- package/dist/components/Avatar.mjs.map +1 -0
- package/dist/components/AvatarGroup.d.mts +14 -0
- package/dist/components/AvatarGroup.d.ts +7 -3
- package/dist/components/AvatarGroup.js +117 -12
- package/dist/components/AvatarGroup.js.map +1 -0
- package/dist/components/AvatarGroup.mjs +81 -0
- package/dist/components/AvatarGroup.mjs.map +1 -0
- package/dist/components/BreadCrumb.d.mts +19 -0
- package/dist/components/BreadCrumb.d.ts +6 -3
- package/dist/components/BreadCrumb.js +49 -11
- package/dist/components/BreadCrumb.js.map +1 -0
- package/dist/components/BreadCrumb.mjs +15 -0
- package/dist/components/BreadCrumb.mjs.map +1 -0
- package/dist/components/Button.d.mts +44 -0
- package/dist/components/Button.d.ts +16 -13
- package/dist/components/Button.js +232 -80
- package/dist/components/Button.js.map +1 -0
- package/dist/components/Button.mjs +198 -0
- package/dist/components/Button.mjs.map +1 -0
- package/dist/components/ChipList.d.mts +24 -0
- package/dist/components/ChipList.d.ts +10 -7
- package/dist/components/ChipList.js +103 -36
- package/dist/components/ChipList.js.map +1 -0
- package/dist/components/ChipList.mjs +69 -0
- package/dist/components/ChipList.mjs.map +1 -0
- package/dist/components/Circle.d.mts +10 -0
- package/dist/components/Circle.d.ts +7 -3
- package/dist/components/Circle.js +61 -9
- package/dist/components/Circle.js.map +1 -0
- package/dist/components/Circle.mjs +27 -0
- package/dist/components/Circle.mjs.map +1 -0
- package/dist/components/ErrorComponent.d.mts +18 -0
- package/dist/components/ErrorComponent.d.ts +9 -4
- package/dist/components/ErrorComponent.js +86 -17
- package/dist/components/ErrorComponent.js.map +1 -0
- package/dist/components/ErrorComponent.mjs +53 -0
- package/dist/components/ErrorComponent.mjs.map +1 -0
- package/dist/components/Expandable.d.mts +33 -0
- package/dist/components/Expandable.d.ts +8 -5
- package/dist/components/Expandable.js +79 -15
- package/dist/components/Expandable.js.map +1 -0
- package/dist/components/Expandable.mjs +45 -0
- package/dist/components/Expandable.mjs.map +1 -0
- package/dist/components/HelpwaveBadge.d.mts +14 -0
- package/dist/components/HelpwaveBadge.d.ts +6 -3
- package/dist/components/HelpwaveBadge.js +125 -13
- package/dist/components/HelpwaveBadge.js.map +1 -0
- package/dist/components/HelpwaveBadge.mjs +91 -0
- package/dist/components/HelpwaveBadge.mjs.map +1 -0
- package/dist/components/HideableContentSection.d.mts +14 -0
- package/dist/components/HideableContentSection.d.ts +7 -3
- package/dist/components/HideableContentSection.js +69 -14
- package/dist/components/HideableContentSection.js.map +1 -0
- package/dist/components/HideableContentSection.mjs +35 -0
- package/dist/components/HideableContentSection.mjs.map +1 -0
- package/dist/components/InputGroup.d.mts +17 -0
- package/dist/components/InputGroup.d.ts +7 -3
- package/dist/components/InputGroup.js +96 -32
- package/dist/components/InputGroup.js.map +1 -0
- package/dist/components/InputGroup.mjs +62 -0
- package/dist/components/InputGroup.mjs.map +1 -0
- package/dist/components/LoadingAndErrorComponent.d.mts +24 -0
- package/dist/components/LoadingAndErrorComponent.d.ts +12 -5
- package/dist/components/LoadingAndErrorComponent.js +178 -23
- package/dist/components/LoadingAndErrorComponent.js.map +1 -0
- package/dist/components/LoadingAndErrorComponent.mjs +145 -0
- package/dist/components/LoadingAndErrorComponent.mjs.map +1 -0
- package/dist/components/LoadingAnimation.d.mts +18 -0
- package/dist/components/LoadingAnimation.d.ts +9 -4
- package/dist/components/LoadingAnimation.js +124 -16
- package/dist/components/LoadingAnimation.js.map +1 -0
- package/dist/components/LoadingAnimation.mjs +90 -0
- package/dist/components/LoadingAnimation.mjs.map +1 -0
- package/dist/components/LoadingButton.d.mts +10 -0
- package/dist/components/LoadingButton.d.ts +7 -3
- package/dist/components/LoadingButton.js +169 -9
- package/dist/components/LoadingButton.js.map +1 -0
- package/dist/components/LoadingButton.mjs +135 -0
- package/dist/components/LoadingButton.mjs.map +1 -0
- package/dist/components/MarkdownInterpreter.d.mts +28 -0
- package/dist/components/MarkdownInterpreter.d.ts +8 -5
- package/dist/components/MarkdownInterpreter.js +246 -175
- package/dist/components/MarkdownInterpreter.js.map +1 -0
- package/dist/components/MarkdownInterpreter.mjs +235 -0
- package/dist/components/MarkdownInterpreter.mjs.map +1 -0
- package/dist/components/Pagination.d.mts +19 -0
- package/dist/components/Pagination.d.ts +9 -4
- package/dist/components/Pagination.js +100 -23
- package/dist/components/Pagination.js.map +1 -0
- package/dist/components/Pagination.mjs +67 -0
- package/dist/components/Pagination.mjs.map +1 -0
- package/dist/components/Profile.d.mts +31 -0
- package/dist/components/Profile.d.ts +8 -5
- package/dist/components/Profile.js +194 -42
- package/dist/components/Profile.js.map +1 -0
- package/dist/components/Profile.mjs +162 -0
- package/dist/components/Profile.mjs.map +1 -0
- package/dist/components/ProgressIndicator.d.mts +24 -0
- package/dist/components/ProgressIndicator.d.ts +6 -3
- package/dist/components/ProgressIndicator.js +82 -22
- package/dist/components/ProgressIndicator.js.map +1 -0
- package/dist/components/ProgressIndicator.mjs +59 -0
- package/dist/components/ProgressIndicator.mjs.map +1 -0
- package/dist/components/Ring.d.mts +35 -0
- package/dist/components/Ring.d.ts +13 -9
- package/dist/components/Ring.js +331 -107
- package/dist/components/Ring.js.map +1 -0
- package/dist/components/Ring.mjs +299 -0
- package/dist/components/Ring.mjs.map +1 -0
- package/dist/components/SearchableList.d.mts +22 -0
- package/dist/components/SearchableList.d.ts +9 -5
- package/dist/components/SearchableList.js +268 -24
- package/dist/components/SearchableList.js.map +1 -0
- package/dist/components/SearchableList.mjs +241 -0
- package/dist/components/SearchableList.mjs.map +1 -0
- package/dist/components/SortButton.d.mts +15 -0
- package/dist/components/SortButton.d.ts +9 -4
- package/dist/components/SortButton.js +131 -8
- package/dist/components/SortButton.js.map +1 -0
- package/dist/components/SortButton.mjs +97 -0
- package/dist/components/SortButton.mjs.map +1 -0
- package/dist/components/StepperBar.d.mts +28 -0
- package/dist/components/StepperBar.d.ts +10 -5
- package/dist/components/StepperBar.js +248 -44
- package/dist/components/StepperBar.js.map +1 -0
- package/dist/components/StepperBar.mjs +216 -0
- package/dist/components/StepperBar.mjs.map +1 -0
- package/dist/components/Table.d.mts +90 -0
- package/dist/components/Table.d.ts +20 -17
- package/dist/components/Table.js +396 -170
- package/dist/components/Table.js.map +1 -0
- package/dist/components/Table.mjs +370 -0
- package/dist/components/Table.mjs.map +1 -0
- package/dist/components/TechRadar.d.mts +39 -0
- package/dist/components/TechRadar.d.ts +5 -2
- package/dist/components/TechRadar.js +241 -189
- package/dist/components/TechRadar.js.map +1 -0
- package/dist/components/TechRadar.mjs +208 -0
- package/dist/components/TechRadar.mjs.map +1 -0
- package/dist/components/TextImage.d.mts +25 -0
- package/dist/components/TextImage.d.ts +9 -4
- package/dist/components/TextImage.js +121 -29
- package/dist/components/TextImage.js.map +1 -0
- package/dist/components/TextImage.mjs +86 -0
- package/dist/components/TextImage.mjs.map +1 -0
- package/dist/components/TimeDisplay.d.mts +35 -0
- package/dist/components/TimeDisplay.d.ts +8 -3
- package/dist/components/TimeDisplay.js +134 -81
- package/dist/components/TimeDisplay.js.map +1 -0
- package/dist/components/TimeDisplay.mjs +109 -0
- package/dist/components/TimeDisplay.mjs.map +1 -0
- package/dist/components/Tooltip.d.mts +37 -0
- package/dist/components/Tooltip.d.ts +7 -4
- package/dist/components/Tooltip.js +135 -37
- package/dist/components/Tooltip.js.map +1 -0
- package/dist/components/Tooltip.mjs +109 -0
- package/dist/components/Tooltip.mjs.map +1 -0
- package/dist/components/VerticalDivider.d.mts +15 -0
- package/dist/components/VerticalDivider.d.ts +6 -2
- package/dist/components/VerticalDivider.js +80 -6
- package/dist/components/VerticalDivider.js.map +1 -0
- package/dist/components/VerticalDivider.mjs +56 -0
- package/dist/components/VerticalDivider.mjs.map +1 -0
- package/dist/components/date/DatePicker.d.mts +32 -0
- package/dist/components/date/DatePicker.d.ts +13 -7
- package/dist/components/date/DatePicker.js +624 -55
- package/dist/components/date/DatePicker.js.map +1 -0
- package/dist/components/date/DatePicker.mjs +591 -0
- package/dist/components/date/DatePicker.mjs.map +1 -0
- package/dist/components/date/DayPicker.d.mts +20 -0
- package/dist/components/date/DayPicker.d.ts +8 -4
- package/dist/components/date/DayPicker.js +232 -36
- package/dist/components/date/DayPicker.js.map +1 -0
- package/dist/components/date/DayPicker.mjs +195 -0
- package/dist/components/date/DayPicker.mjs.map +1 -0
- package/dist/components/date/TimePicker.d.mts +15 -0
- package/dist/components/date/TimePicker.d.ts +7 -4
- package/dist/components/date/TimePicker.js +196 -75
- package/dist/components/date/TimePicker.js.map +1 -0
- package/dist/components/date/TimePicker.mjs +164 -0
- package/dist/components/date/TimePicker.mjs.map +1 -0
- package/dist/components/date/YearMonthPicker.d.mts +15 -0
- package/dist/components/date/YearMonthPicker.d.ts +7 -3
- package/dist/components/date/YearMonthPicker.js +281 -57
- package/dist/components/date/YearMonthPicker.js.map +1 -0
- package/dist/components/date/YearMonthPicker.mjs +247 -0
- package/dist/components/date/YearMonthPicker.mjs.map +1 -0
- package/dist/components/icons/Helpwave.d.mts +14 -0
- package/dist/components/icons/Helpwave.d.ts +7 -3
- package/dist/components/icons/Helpwave.js +66 -18
- package/dist/components/icons/Helpwave.js.map +1 -0
- package/dist/components/icons/Helpwave.mjs +43 -0
- package/dist/components/icons/Helpwave.mjs.map +1 -0
- package/dist/components/icons/Tag.d.mts +14 -0
- package/dist/components/icons/Tag.d.ts +7 -3
- package/dist/components/icons/Tag.js +59 -11
- package/dist/components/icons/Tag.js.map +1 -0
- package/dist/components/icons/Tag.mjs +25 -0
- package/dist/components/icons/Tag.mjs.map +1 -0
- package/dist/components/layout/Carousel.d.mts +25 -0
- package/dist/components/layout/Carousel.d.ts +6 -3
- package/dist/components/layout/Carousel.js +477 -226
- package/dist/components/layout/Carousel.js.map +1 -0
- package/dist/components/layout/Carousel.mjs +449 -0
- package/dist/components/layout/Carousel.mjs.map +1 -0
- package/dist/components/layout/DividerInserter.d.mts +15 -0
- package/dist/components/layout/DividerInserter.d.ts +7 -3
- package/dist/components/layout/DividerInserter.js +58 -18
- package/dist/components/layout/DividerInserter.js.map +1 -0
- package/dist/components/layout/DividerInserter.mjs +25 -0
- package/dist/components/layout/DividerInserter.mjs.map +1 -0
- package/dist/components/layout/FAQSection.d.mts +26 -0
- package/dist/components/layout/FAQSection.d.ts +9 -6
- package/dist/components/layout/FAQSection.js +336 -13
- package/dist/components/layout/FAQSection.js.map +1 -0
- package/dist/components/layout/FAQSection.mjs +302 -0
- package/dist/components/layout/FAQSection.mjs.map +1 -0
- package/dist/components/layout/Tile.d.mts +37 -0
- package/dist/components/layout/Tile.d.ts +9 -6
- package/dist/components/layout/Tile.js +76 -16
- package/dist/components/layout/Tile.js.map +1 -0
- package/dist/components/layout/Tile.mjs +42 -0
- package/dist/components/layout/Tile.mjs.map +1 -0
- package/dist/components/modals/ConfirmDialog.d.mts +38 -0
- package/dist/components/modals/ConfirmDialog.d.ts +13 -9
- package/dist/components/modals/ConfirmDialog.js +422 -28
- package/dist/components/modals/ConfirmDialog.js.map +1 -0
- package/dist/components/modals/ConfirmDialog.mjs +388 -0
- package/dist/components/modals/ConfirmDialog.mjs.map +1 -0
- package/dist/components/modals/DiscardChangesDialog.d.mts +23 -0
- package/dist/components/modals/DiscardChangesDialog.d.ts +9 -5
- package/dist/components/modals/DiscardChangesDialog.js +406 -23
- package/dist/components/modals/DiscardChangesDialog.js.map +1 -0
- package/dist/components/modals/DiscardChangesDialog.mjs +370 -0
- package/dist/components/modals/DiscardChangesDialog.mjs.map +1 -0
- package/dist/components/modals/InputModal.d.mts +19 -0
- package/dist/components/modals/InputModal.d.ts +14 -4
- package/dist/components/modals/InputModal.js +598 -8
- package/dist/components/modals/InputModal.js.map +1 -0
- package/dist/components/modals/InputModal.mjs +567 -0
- package/dist/components/modals/InputModal.mjs.map +1 -0
- package/dist/components/modals/LanguageModal.d.mts +21 -0
- package/dist/components/modals/LanguageModal.d.ts +9 -5
- package/dist/components/modals/LanguageModal.js +524 -33
- package/dist/components/modals/LanguageModal.js.map +1 -0
- package/dist/components/modals/LanguageModal.mjs +489 -0
- package/dist/components/modals/LanguageModal.mjs.map +1 -0
- package/dist/components/modals/Modal.d.mts +43 -0
- package/dist/components/modals/Modal.d.ts +13 -8
- package/dist/components/modals/Modal.js +280 -51
- package/dist/components/modals/Modal.js.map +1 -0
- package/dist/components/modals/Modal.mjs +249 -0
- package/dist/components/modals/Modal.mjs.map +1 -0
- package/dist/components/modals/ModalRegister.d.mts +16 -0
- package/dist/components/modals/ModalRegister.d.ts +9 -4
- package/dist/components/modals/ModalRegister.js +61 -26
- package/dist/components/modals/ModalRegister.js.map +1 -0
- package/dist/components/modals/ModalRegister.mjs +37 -0
- package/dist/components/modals/ModalRegister.mjs.map +1 -0
- package/dist/components/properties/CheckboxProperty.d.mts +20 -0
- package/dist/components/properties/CheckboxProperty.d.ts +10 -5
- package/dist/components/properties/CheckboxProperty.js +323 -24
- package/dist/components/properties/CheckboxProperty.js.map +1 -0
- package/dist/components/properties/CheckboxProperty.mjs +291 -0
- package/dist/components/properties/CheckboxProperty.mjs.map +1 -0
- package/dist/components/properties/DateProperty.d.mts +18 -0
- package/dist/components/properties/DateProperty.d.ts +10 -3
- package/dist/components/properties/DateProperty.js +422 -21
- package/dist/components/properties/DateProperty.js.map +1 -0
- package/dist/components/properties/DateProperty.mjs +393 -0
- package/dist/components/properties/DateProperty.mjs.map +1 -0
- package/dist/components/properties/MultiSelectProperty.d.mts +18 -0
- package/dist/components/properties/MultiSelectProperty.d.ts +12 -6
- package/dist/components/properties/MultiSelectProperty.js +815 -31
- package/dist/components/properties/MultiSelectProperty.js.map +1 -0
- package/dist/components/properties/MultiSelectProperty.mjs +787 -0
- package/dist/components/properties/MultiSelectProperty.mjs.map +1 -0
- package/dist/components/properties/NumberProperty.d.mts +21 -0
- package/dist/components/properties/NumberProperty.d.ts +10 -5
- package/dist/components/properties/NumberProperty.js +429 -39
- package/dist/components/properties/NumberProperty.js.map +1 -0
- package/dist/components/properties/NumberProperty.mjs +402 -0
- package/dist/components/properties/NumberProperty.mjs.map +1 -0
- package/dist/components/properties/PropertyBase.d.mts +27 -0
- package/dist/components/properties/PropertyBase.d.ts +9 -5
- package/dist/components/properties/PropertyBase.js +194 -24
- package/dist/components/properties/PropertyBase.js.map +1 -0
- package/dist/components/properties/PropertyBase.mjs +162 -0
- package/dist/components/properties/PropertyBase.mjs.map +1 -0
- package/dist/components/properties/SelectProperty.d.mts +19 -0
- package/dist/components/properties/SelectProperty.d.ts +13 -6
- package/dist/components/properties/SelectProperty.js +547 -19
- package/dist/components/properties/SelectProperty.js.map +1 -0
- package/dist/components/properties/SelectProperty.mjs +520 -0
- package/dist/components/properties/SelectProperty.mjs.map +1 -0
- package/dist/components/properties/TextProperty.d.mts +20 -0
- package/dist/components/properties/TextProperty.d.ts +10 -5
- package/dist/components/properties/TextProperty.js +378 -34
- package/dist/components/properties/TextProperty.js.map +1 -0
- package/dist/components/properties/TextProperty.mjs +346 -0
- package/dist/components/properties/TextProperty.mjs.map +1 -0
- package/dist/components/user-input/Checkbox.d.mts +41 -0
- package/dist/components/user-input/Checkbox.d.ts +9 -5
- package/dist/components/user-input/Checkbox.js +148 -63
- package/dist/components/user-input/Checkbox.js.map +1 -0
- package/dist/components/user-input/Checkbox.mjs +112 -0
- package/dist/components/user-input/Checkbox.mjs.map +1 -0
- package/dist/components/user-input/DateAndTimePicker.d.mts +47 -0
- package/dist/components/user-input/DateAndTimePicker.d.ts +15 -7
- package/dist/components/user-input/DateAndTimePicker.js +831 -60
- package/dist/components/user-input/DateAndTimePicker.js.map +1 -0
- package/dist/components/user-input/DateAndTimePicker.mjs +801 -0
- package/dist/components/user-input/DateAndTimePicker.mjs.map +1 -0
- package/dist/components/user-input/Input.d.mts +64 -0
- package/dist/components/user-input/Input.d.ts +12 -9
- package/dist/components/user-input/Input.js +219 -57
- package/dist/components/user-input/Input.js.map +1 -0
- package/dist/components/user-input/Input.mjs +191 -0
- package/dist/components/user-input/Input.mjs.map +1 -0
- package/dist/components/user-input/Label.d.mts +16 -0
- package/dist/components/user-input/Label.d.ts +8 -4
- package/dist/components/user-input/Label.js +43 -11
- package/dist/components/user-input/Label.js.map +1 -0
- package/dist/components/user-input/Label.mjs +19 -0
- package/dist/components/user-input/Label.mjs.map +1 -0
- package/dist/components/user-input/Menu.d.mts +24 -0
- package/dist/components/user-input/Menu.d.ts +8 -5
- package/dist/components/user-input/Menu.js +162 -25
- package/dist/components/user-input/Menu.js.map +1 -0
- package/dist/components/user-input/Menu.mjs +127 -0
- package/dist/components/user-input/Menu.mjs.map +1 -0
- package/dist/components/user-input/MultiSelect.d.mts +43 -0
- package/dist/components/user-input/MultiSelect.d.ts +12 -8
- package/dist/components/user-input/MultiSelect.js +545 -56
- package/dist/components/user-input/MultiSelect.js.map +1 -0
- package/dist/components/user-input/MultiSelect.mjs +516 -0
- package/dist/components/user-input/MultiSelect.mjs.map +1 -0
- package/dist/components/user-input/ScrollPicker.d.mts +15 -0
- package/dist/components/user-input/ScrollPicker.d.ts +6 -2
- package/dist/components/user-input/ScrollPicker.js +276 -145
- package/dist/components/user-input/ScrollPicker.js.map +1 -0
- package/dist/components/user-input/ScrollPicker.mjs +247 -0
- package/dist/components/user-input/ScrollPicker.mjs.map +1 -0
- package/dist/components/user-input/SearchableSelect.d.mts +14 -0
- package/dist/components/user-input/SearchableSelect.d.ts +9 -3
- package/dist/components/user-input/SearchableSelect.js +334 -13
- package/dist/components/user-input/SearchableSelect.js.map +1 -0
- package/dist/components/user-input/SearchableSelect.mjs +305 -0
- package/dist/components/user-input/SearchableSelect.mjs.map +1 -0
- package/dist/components/user-input/Select.d.mts +36 -0
- package/dist/components/user-input/Select.d.ts +9 -5
- package/dist/components/user-input/Select.js +152 -47
- package/dist/components/user-input/Select.js.map +1 -0
- package/dist/components/user-input/Select.mjs +118 -0
- package/dist/components/user-input/Select.mjs.map +1 -0
- package/dist/components/user-input/Textarea.d.mts +24 -0
- package/dist/components/user-input/Textarea.d.ts +8 -4
- package/dist/components/user-input/Textarea.js +153 -31
- package/dist/components/user-input/Textarea.js.map +1 -0
- package/dist/components/user-input/Textarea.mjs +120 -0
- package/dist/components/user-input/Textarea.mjs.map +1 -0
- package/dist/components/user-input/ToggleableInput.d.mts +35 -0
- package/dist/components/user-input/ToggleableInput.d.ts +6 -3
- package/dist/components/user-input/ToggleableInput.js +161 -38
- package/dist/components/user-input/ToggleableInput.js.map +1 -0
- package/dist/components/user-input/ToggleableInput.mjs +128 -0
- package/dist/components/user-input/ToggleableInput.mjs.map +1 -0
- package/dist/hooks/useHoverState.d.mts +42 -0
- package/dist/hooks/useHoverState.d.ts +5 -3
- package/dist/hooks/useHoverState.js +69 -43
- package/dist/hooks/useHoverState.js.map +1 -0
- package/dist/hooks/useHoverState.mjs +47 -0
- package/dist/hooks/useHoverState.mjs.map +1 -0
- package/dist/hooks/useLanguage.d.mts +21 -0
- package/dist/hooks/useLanguage.d.ts +15 -11
- package/dist/hooks/useLanguage.js +145 -50
- package/dist/hooks/useLanguage.js.map +1 -0
- package/dist/hooks/useLanguage.mjs +115 -0
- package/dist/hooks/useLanguage.mjs.map +1 -0
- package/dist/hooks/useLocalStorage.d.mts +6 -0
- package/dist/hooks/useLocalStorage.d.ts +4 -2
- package/dist/hooks/useLocalStorage.js +79 -23
- package/dist/hooks/useLocalStorage.js.map +1 -0
- package/dist/hooks/useLocalStorage.mjs +59 -0
- package/dist/hooks/useLocalStorage.mjs.map +1 -0
- package/dist/hooks/useOutsideClick.d.mts +5 -0
- package/dist/hooks/useOutsideClick.d.ts +5 -2
- package/dist/hooks/useOutsideClick.js +47 -21
- package/dist/hooks/useOutsideClick.js.map +1 -0
- package/dist/hooks/useOutsideClick.mjs +23 -0
- package/dist/hooks/useOutsideClick.mjs.map +1 -0
- package/dist/hooks/useSaveDelay.d.mts +6 -0
- package/dist/hooks/useSaveDelay.d.ts +2 -1
- package/dist/hooks/useSaveDelay.js +62 -38
- package/dist/hooks/useSaveDelay.js.map +1 -0
- package/dist/hooks/useSaveDelay.mjs +44 -0
- package/dist/hooks/useSaveDelay.mjs.map +1 -0
- package/dist/hooks/useTheme.d.mts +21 -0
- package/dist/hooks/useTheme.d.ts +14 -9
- package/dist/hooks/useTheme.js +65 -29
- package/dist/hooks/useTheme.js.map +1 -0
- package/dist/hooks/useTheme.mjs +40 -0
- package/dist/hooks/useTheme.mjs.map +1 -0
- package/dist/hooks/useTranslation.d.mts +28 -0
- package/dist/hooks/useTranslation.d.ts +9 -5
- package/dist/hooks/useTranslation.js +53 -10
- package/dist/hooks/useTranslation.js.map +1 -0
- package/dist/hooks/useTranslation.mjs +27 -0
- package/dist/hooks/useTranslation.mjs.map +1 -0
- package/dist/index.d.mts +86 -0
- package/dist/index.d.ts +86 -0
- package/dist/index.js +5716 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +5542 -0
- package/dist/index.mjs.map +1 -0
- package/dist/util/array.d.mts +25 -0
- package/dist/util/array.d.ts +9 -7
- package/dist/util/array.js +119 -92
- package/dist/util/array.js.map +1 -0
- package/dist/util/array.mjs +99 -0
- package/dist/util/array.mjs.map +1 -0
- package/dist/util/builder.d.mts +8 -0
- package/dist/util/builder.d.ts +3 -1
- package/dist/util/builder.js +33 -8
- package/dist/util/builder.js.map +1 -0
- package/dist/util/builder.mjs +9 -0
- package/dist/util/builder.mjs.map +1 -0
- package/dist/util/date.d.mts +30 -0
- package/dist/util/date.d.ts +17 -15
- package/dist/util/date.js +184 -123
- package/dist/util/date.js.map +1 -0
- package/dist/util/date.mjs +156 -0
- package/dist/util/date.mjs.map +1 -0
- package/dist/util/easeFunctions.d.mts +11 -0
- package/dist/util/easeFunctions.d.ts +4 -2
- package/dist/util/easeFunctions.js +63 -30
- package/dist/util/easeFunctions.js.map +1 -0
- package/dist/util/easeFunctions.mjs +36 -0
- package/dist/util/easeFunctions.mjs.map +1 -0
- package/dist/util/emailValidation.d.mts +3 -0
- package/dist/util/emailValidation.d.ts +3 -1
- package/dist/util/emailValidation.js +32 -2
- package/dist/util/emailValidation.js.map +1 -0
- package/dist/util/emailValidation.mjs +8 -0
- package/dist/util/emailValidation.mjs.map +1 -0
- package/dist/util/loopingArray.d.mts +25 -0
- package/dist/util/loopingArray.d.ts +4 -2
- package/dist/util/loopingArray.js +89 -59
- package/dist/util/loopingArray.js.map +1 -0
- package/dist/util/loopingArray.mjs +72 -0
- package/dist/util/loopingArray.mjs.map +1 -0
- package/dist/util/math.d.mts +3 -0
- package/dist/util/math.d.ts +3 -1
- package/dist/util/math.js +32 -2
- package/dist/util/math.js.map +1 -0
- package/dist/util/math.mjs +8 -0
- package/dist/util/math.mjs.map +1 -0
- package/dist/util/news.d.mts +103 -0
- package/dist/util/news.d.ts +12 -7
- package/dist/util/news.js +73 -24
- package/dist/util/news.js.map +1 -0
- package/dist/util/news.mjs +48 -0
- package/dist/util/news.mjs.map +1 -0
- package/dist/util/noop.d.mts +3 -0
- package/dist/util/noop.d.ts +3 -1
- package/dist/util/noop.js +31 -1
- package/dist/util/noop.js.map +1 -0
- package/dist/util/noop.mjs +6 -0
- package/dist/util/noop.mjs.map +1 -0
- package/dist/util/simpleSearch.d.mts +50 -0
- package/dist/util/simpleSearch.d.ts +6 -4
- package/dist/util/simpleSearch.js +50 -58
- package/dist/util/simpleSearch.js.map +1 -0
- package/dist/util/simpleSearch.mjs +26 -0
- package/dist/util/simpleSearch.mjs.map +1 -0
- package/dist/util/storage.d.mts +16 -0
- package/dist/util/storage.d.ts +4 -3
- package/dist/util/storage.js +63 -31
- package/dist/util/storage.js.map +1 -0
- package/dist/util/storage.mjs +38 -0
- package/dist/util/storage.mjs.map +1 -0
- package/dist/util/types.d.mts +3 -0
- package/dist/util/types.d.ts +3 -1
- package/dist/util/types.js +19 -1
- package/dist/util/types.js.map +1 -0
- package/dist/util/types.mjs +1 -0
- package/dist/util/types.mjs.map +1 -0
- package/package.json +20 -9
- package/dist/components/Span.d.ts +0 -0
- package/dist/components/Span.js +0 -1
- package/dist/components/examples/InputGroupExample.d.ts +0 -6
- package/dist/components/examples/InputGroupExample.js +0 -21
- package/dist/components/examples/MultiSelectExample.d.ts +0 -7
- package/dist/components/examples/MultiSelectExample.js +0 -27
- package/dist/components/examples/SearchableSelectExample.d.ts +0 -6
- package/dist/components/examples/SearchableSelectExample.js +0 -17
- package/dist/components/examples/SelectExample.d.ts +0 -4
- package/dist/components/examples/SelectExample.js +0 -15
- package/dist/components/examples/StackingModals.d.ts +0 -4
- package/dist/components/examples/StackingModals.js +0 -15
- package/dist/components/examples/TableExample.d.ts +0 -9
- package/dist/components/examples/TableExample.js +0 -92
- package/dist/components/examples/TextareaExample.d.ts +0 -6
- package/dist/components/examples/TextareaExample.js +0 -10
- package/dist/components/examples/TileExample.d.ts +0 -9
- package/dist/components/examples/TileExample.js +0 -9
- package/dist/components/examples/Title.d.ts +0 -0
- package/dist/components/examples/Title.js +0 -1
- package/dist/components/examples/date/DateTimePickerExample.d.ts +0 -10
- package/dist/components/examples/date/DateTimePickerExample.js +0 -21
- package/dist/components/examples/properties/CheckboxPropertyExample.d.ts +0 -8
- package/dist/components/examples/properties/CheckboxPropertyExample.js +0 -13
- package/dist/components/examples/properties/DatePropertyExample.d.ts +0 -8
- package/dist/components/examples/properties/DatePropertyExample.js +0 -23
- package/dist/components/examples/properties/MultiSelectPropertyExample.d.ts +0 -8
- package/dist/components/examples/properties/MultiSelectPropertyExample.js +0 -16
- package/dist/components/examples/properties/NumberPropertyExample.d.ts +0 -6
- package/dist/components/examples/properties/NumberPropertyExample.js +0 -13
- package/dist/components/examples/properties/SelectPropertyExample.d.ts +0 -6
- package/dist/components/examples/properties/SelectPropertyExample.js +0 -18
- package/dist/components/examples/properties/TextPropertyExample.d.ts +0 -8
- package/dist/components/examples/properties/TextPropertyExample.js +0 -13
|
@@ -1,233 +1,484 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
startPosition: currentPosition,
|
|
89
|
-
targetPosition: (currentPosition + 1) % length,
|
|
90
|
-
direction: 1, // always move forward
|
|
91
|
-
isAutoLooping: true
|
|
92
|
-
}
|
|
93
|
-
}));
|
|
94
|
-
useEffect(() => {
|
|
95
|
-
if (!animationId.current && !animationState && !dragState && !timeOut.current) {
|
|
96
|
-
if (autoLoopingTimeOut > 0) {
|
|
97
|
-
timeOut.current = setTimeout(() => {
|
|
98
|
-
startAutoLoop();
|
|
99
|
-
timeOut.current = undefined;
|
|
100
|
-
}, autoLoopingTimeOut);
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
startAutoLoop();
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}, [animationState, dragState, animationId.current, timeOut.current]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
107
|
-
const startAnimation = (targetPosition) => {
|
|
108
|
-
if (targetPosition === undefined) {
|
|
109
|
-
targetPosition = LoopingArrayCalculator.withoutOffset(currentPosition);
|
|
110
|
-
}
|
|
111
|
-
if (targetPosition === currentPosition) {
|
|
112
|
-
return; // we are exactly where we want to be
|
|
113
|
-
}
|
|
114
|
-
// find target index and fastest path to it
|
|
115
|
-
const direction = util.getBestDirection(currentPosition, targetPosition);
|
|
116
|
-
clearTimeout(timeOut.current);
|
|
117
|
-
timeOut.current = undefined;
|
|
118
|
-
if (animationId.current) {
|
|
119
|
-
cancelAnimationFrame(animationId.current);
|
|
120
|
-
animationId.current = undefined;
|
|
121
|
-
}
|
|
122
|
-
setCarouselInformation(prevState => ({
|
|
123
|
-
...prevState,
|
|
124
|
-
dragState: undefined,
|
|
125
|
-
animationState: {
|
|
126
|
-
targetPosition: targetPosition,
|
|
127
|
-
direction,
|
|
128
|
-
startPosition: currentPosition,
|
|
129
|
-
isAutoLooping: false
|
|
130
|
-
},
|
|
131
|
-
timeOut: undefined
|
|
132
|
-
}));
|
|
133
|
-
};
|
|
134
|
-
const canGoLeft = () => {
|
|
135
|
-
return isLooping || currentPosition !== 0;
|
|
136
|
-
};
|
|
137
|
-
const canGoRight = () => {
|
|
138
|
-
return isLooping || currentPosition !== length - 1;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/components/layout/Carousel.tsx
|
|
31
|
+
var Carousel_exports = {};
|
|
32
|
+
__export(Carousel_exports, {
|
|
33
|
+
Carousel: () => Carousel
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(Carousel_exports);
|
|
36
|
+
var import_clsx = __toESM(require("clsx"));
|
|
37
|
+
var import_react = require("react");
|
|
38
|
+
var import_lucide_react = require("lucide-react");
|
|
39
|
+
|
|
40
|
+
// src/util/array.ts
|
|
41
|
+
var range = (start, end, allowEmptyRange = false) => {
|
|
42
|
+
if (end < start) {
|
|
43
|
+
if (!allowEmptyRange) {
|
|
44
|
+
console.warn(`range: end (${end}) < start (${start}) should be allowed explicitly, set allowEmptyRange to true`);
|
|
45
|
+
}
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
return Array.from({ length: end - start + 1 }, (_, index) => index + start);
|
|
49
|
+
};
|
|
50
|
+
var createLoopingListWithIndex = (list, startIndex = 0, length = 0, forwards = true) => {
|
|
51
|
+
if (length < 0) {
|
|
52
|
+
console.warn(`createLoopingList: length must be >= 0, given ${length}`);
|
|
53
|
+
} else if (length === 0) {
|
|
54
|
+
length = list.length;
|
|
55
|
+
}
|
|
56
|
+
const returnList = [];
|
|
57
|
+
if (forwards) {
|
|
58
|
+
for (let i = startIndex; returnList.length < length; i = (i + 1) % list.length) {
|
|
59
|
+
returnList.push([i, list[i]]);
|
|
60
|
+
}
|
|
61
|
+
} else {
|
|
62
|
+
for (let i = startIndex; returnList.length < length; i = i === 0 ? i = list.length - 1 : i - 1) {
|
|
63
|
+
returnList.push([i, list[i]]);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return returnList;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// src/util/math.ts
|
|
70
|
+
var clamp = (value, min = 0, max = 1) => {
|
|
71
|
+
return Math.min(Math.max(value, min), max);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
// src/util/easeFunctions.ts
|
|
75
|
+
var EaseFunctions = class _EaseFunctions {
|
|
76
|
+
static cubicBezierGeneric(x1, y1, x2, y2) {
|
|
77
|
+
const cx = 3 * x1;
|
|
78
|
+
const bx = 3 * (x2 - x1) - cx;
|
|
79
|
+
const ax = 1 - cx - bx;
|
|
80
|
+
const cy = 3 * y1;
|
|
81
|
+
const by = 3 * (y2 - y1) - cy;
|
|
82
|
+
const ay = 1 - cy - by;
|
|
83
|
+
const x = (t) => ((ax * t + bx) * t + cx) * t;
|
|
84
|
+
const y = (t) => ((ay * t + by) * t + cy) * t;
|
|
85
|
+
return {
|
|
86
|
+
x,
|
|
87
|
+
y
|
|
139
88
|
};
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
89
|
+
}
|
|
90
|
+
static cubicBezier(x1, y1, x2, y2) {
|
|
91
|
+
const { y } = _EaseFunctions.cubicBezierGeneric(x1, y1, x2, y2);
|
|
92
|
+
return (t) => {
|
|
93
|
+
t = clamp(t);
|
|
94
|
+
return y(t);
|
|
144
95
|
};
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
96
|
+
}
|
|
97
|
+
static easeInEaseOut(t) {
|
|
98
|
+
return _EaseFunctions.cubicBezier(0.65, 0, 0.35, 1)(t);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// src/util/loopingArray.ts
|
|
103
|
+
var LoopingArrayCalculator = class _LoopingArrayCalculator {
|
|
104
|
+
constructor(length, isLooping = true, allowedOverScroll = 0.1) {
|
|
105
|
+
if (allowedOverScroll < 0 || length < 1) {
|
|
106
|
+
throw new Error("Invalid parameters: allowedOverScroll >= 0 and length >= 1 must be true");
|
|
107
|
+
}
|
|
108
|
+
this.length = length;
|
|
109
|
+
this.isLooping = isLooping;
|
|
110
|
+
this.allowedOverScroll = allowedOverScroll;
|
|
111
|
+
}
|
|
112
|
+
getCorrectedPosition(position) {
|
|
113
|
+
if (!this.isLooping) {
|
|
114
|
+
return Math.max(-this.allowedOverScroll, Math.min(this.allowedOverScroll + this.length - 1, position));
|
|
115
|
+
}
|
|
116
|
+
if (position >= this.length) {
|
|
117
|
+
return position % this.length;
|
|
118
|
+
}
|
|
119
|
+
if (position < 0) {
|
|
120
|
+
return this.length - Math.abs(position) % this.length;
|
|
121
|
+
}
|
|
122
|
+
return position;
|
|
123
|
+
}
|
|
124
|
+
static withoutOffset(position) {
|
|
125
|
+
return position + _LoopingArrayCalculator.getOffset(position);
|
|
126
|
+
}
|
|
127
|
+
static getOffset(position) {
|
|
128
|
+
return Math.round(position) - position;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* @return absolute distance forwards or Infinity when the target cannot be reached (only possible when not isLooping)
|
|
132
|
+
*/
|
|
133
|
+
getDistanceDirectional(position, target, direction) {
|
|
134
|
+
if (!this.isLooping && (position < -this.allowedOverScroll || position > this.allowedOverScroll + this.length - 1)) {
|
|
135
|
+
throw new Error("Invalid parameters: position is out of bounds.");
|
|
136
|
+
}
|
|
137
|
+
const isForwardInvalid = direction === 1 && position > target;
|
|
138
|
+
const isBackwardInvalid = direction === -1 && target < position;
|
|
139
|
+
if (!this.isLooping && (isForwardInvalid || isBackwardInvalid)) {
|
|
140
|
+
return Infinity;
|
|
141
|
+
}
|
|
142
|
+
if (direction === -1) {
|
|
143
|
+
return this.getDistanceDirectional(target, position, 1);
|
|
144
|
+
}
|
|
145
|
+
position = this.getCorrectedPosition(position);
|
|
146
|
+
target = this.getCorrectedPosition(target);
|
|
147
|
+
let distance = (target - position) * direction;
|
|
148
|
+
if (distance < 0) {
|
|
149
|
+
distance = this.length - Math.abs(position) % this.length + target;
|
|
150
|
+
}
|
|
151
|
+
return distance;
|
|
152
|
+
}
|
|
153
|
+
getDistanceForward(position, target) {
|
|
154
|
+
return this.getDistanceDirectional(position, target, 1);
|
|
155
|
+
}
|
|
156
|
+
getDistanceBackward(position, target) {
|
|
157
|
+
return this.getDistanceDirectional(position, target, -1);
|
|
158
|
+
}
|
|
159
|
+
getDistance(position, target) {
|
|
160
|
+
const forwardDistance = this.getDistanceForward(position, target);
|
|
161
|
+
const backwardDistance = this.getDistanceBackward(position, target);
|
|
162
|
+
return Math.min(forwardDistance, backwardDistance);
|
|
163
|
+
}
|
|
164
|
+
getBestDirection(position, target) {
|
|
165
|
+
const forwardDistance = this.getDistanceForward(position, target);
|
|
166
|
+
const backwardDistance = this.getDistanceBackward(position, target);
|
|
167
|
+
return forwardDistance < backwardDistance ? 1 : -1;
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
// src/components/layout/Carousel.tsx
|
|
172
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
173
|
+
var Carousel = ({
|
|
174
|
+
children,
|
|
175
|
+
animationTime = 200,
|
|
176
|
+
isLooping = false,
|
|
177
|
+
isAutoLooping = false,
|
|
178
|
+
autoLoopingTimeOut = 5e3,
|
|
179
|
+
autoLoopAnimationTime = 500,
|
|
180
|
+
hintNext = false,
|
|
181
|
+
arrows = false,
|
|
182
|
+
dots = true,
|
|
183
|
+
overScrollThreshold = 0.1,
|
|
184
|
+
blurColor = "from-white",
|
|
185
|
+
className = "",
|
|
186
|
+
heightClassName = "h-[24rem]",
|
|
187
|
+
widthClassName = "w-[70%] desktop:w-1/2"
|
|
188
|
+
}) => {
|
|
189
|
+
if (isAutoLooping && !isLooping) {
|
|
190
|
+
console.error("When isAutoLooping is true, isLooping should also be true");
|
|
191
|
+
isLooping = true;
|
|
192
|
+
}
|
|
193
|
+
const [{
|
|
194
|
+
currentPosition,
|
|
195
|
+
dragState,
|
|
196
|
+
animationState
|
|
197
|
+
}, setCarouselInformation] = (0, import_react.useState)({
|
|
198
|
+
currentPosition: 0
|
|
199
|
+
});
|
|
200
|
+
const animationId = (0, import_react.useRef)(void 0);
|
|
201
|
+
const timeOut = (0, import_react.useRef)(void 0);
|
|
202
|
+
autoLoopingTimeOut = Math.max(0, autoLoopingTimeOut);
|
|
203
|
+
const length = children.length;
|
|
204
|
+
const paddingItemCount = 3;
|
|
205
|
+
const util = (0, import_react.useMemo)(() => new LoopingArrayCalculator(length, isLooping, overScrollThreshold), [length, isLooping, overScrollThreshold]);
|
|
206
|
+
const currentIndex = util.getCorrectedPosition(LoopingArrayCalculator.withoutOffset(currentPosition));
|
|
207
|
+
animationTime = Math.max(200, animationTime);
|
|
208
|
+
autoLoopAnimationTime = Math.max(200, autoLoopAnimationTime);
|
|
209
|
+
const getStyleOffset = (index) => {
|
|
210
|
+
const baseOffset = -50 + (index - currentPosition) * 100;
|
|
211
|
+
return `${baseOffset}%`;
|
|
212
|
+
};
|
|
213
|
+
const animation = (0, import_react.useCallback)((time) => {
|
|
214
|
+
let keepAnimating = true;
|
|
215
|
+
setCarouselInformation((state) => {
|
|
216
|
+
const {
|
|
217
|
+
animationState: animationState2,
|
|
218
|
+
dragState: dragState2
|
|
219
|
+
} = state;
|
|
220
|
+
if (animationState2 === void 0 || dragState2 !== void 0) {
|
|
221
|
+
keepAnimating = false;
|
|
222
|
+
return state;
|
|
223
|
+
}
|
|
224
|
+
if (!animationState2.startTime || !animationState2.lastUpdateTime) {
|
|
225
|
+
return {
|
|
226
|
+
...state,
|
|
227
|
+
animationState: {
|
|
228
|
+
...animationState2,
|
|
229
|
+
startTime: time,
|
|
230
|
+
lastUpdateTime: time
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
const useAnimationTime = animationState2.isAutoLooping ? autoLoopAnimationTime : animationTime;
|
|
235
|
+
const progress = clamp((time - animationState2.startTime) / useAnimationTime);
|
|
236
|
+
const easedProgress = EaseFunctions.easeInEaseOut(progress);
|
|
237
|
+
const distance = util.getDistanceDirectional(animationState2.startPosition, animationState2.targetPosition, animationState2.direction);
|
|
238
|
+
const newPosition = util.getCorrectedPosition(easedProgress * distance * animationState2.direction + animationState2.startPosition);
|
|
239
|
+
if (animationState2.targetPosition === newPosition || progress === 1) {
|
|
240
|
+
keepAnimating = false;
|
|
241
|
+
return {
|
|
242
|
+
currentPosition: LoopingArrayCalculator.withoutOffset(newPosition),
|
|
243
|
+
animationState: void 0
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
return {
|
|
247
|
+
currentPosition: newPosition,
|
|
248
|
+
animationState: {
|
|
249
|
+
...animationState2,
|
|
250
|
+
lastUpdateTime: time
|
|
148
251
|
}
|
|
252
|
+
};
|
|
253
|
+
});
|
|
254
|
+
if (keepAnimating) {
|
|
255
|
+
animationId.current = requestAnimationFrame((time1) => animation(time1));
|
|
256
|
+
}
|
|
257
|
+
}, [animationTime, autoLoopAnimationTime, util]);
|
|
258
|
+
(0, import_react.useEffect)(() => {
|
|
259
|
+
if (animationState) {
|
|
260
|
+
animationId.current = requestAnimationFrame(animation);
|
|
261
|
+
}
|
|
262
|
+
return () => {
|
|
263
|
+
if (animationId.current) {
|
|
264
|
+
cancelAnimationFrame(animationId.current);
|
|
265
|
+
animationId.current = 0;
|
|
266
|
+
}
|
|
149
267
|
};
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
268
|
+
}, [animationState]);
|
|
269
|
+
const startAutoLoop = () => setCarouselInformation((prevState) => ({
|
|
270
|
+
...prevState,
|
|
271
|
+
dragState: prevState.dragState,
|
|
272
|
+
animationState: prevState.animationState || prevState.dragState ? prevState.animationState : {
|
|
273
|
+
startPosition: currentPosition,
|
|
274
|
+
targetPosition: (currentPosition + 1) % length,
|
|
275
|
+
direction: 1,
|
|
276
|
+
// always move forward
|
|
277
|
+
isAutoLooping: true
|
|
278
|
+
}
|
|
279
|
+
}));
|
|
280
|
+
(0, import_react.useEffect)(() => {
|
|
281
|
+
if (!animationId.current && !animationState && !dragState && !timeOut.current) {
|
|
282
|
+
if (autoLoopingTimeOut > 0) {
|
|
283
|
+
timeOut.current = setTimeout(() => {
|
|
284
|
+
startAutoLoop();
|
|
285
|
+
timeOut.current = void 0;
|
|
286
|
+
}, autoLoopingTimeOut);
|
|
287
|
+
} else {
|
|
288
|
+
startAutoLoop();
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}, [animationState, dragState, animationId.current, timeOut.current]);
|
|
292
|
+
const startAnimation = (targetPosition) => {
|
|
293
|
+
if (targetPosition === void 0) {
|
|
294
|
+
targetPosition = LoopingArrayCalculator.withoutOffset(currentPosition);
|
|
295
|
+
}
|
|
296
|
+
if (targetPosition === currentPosition) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
const direction = util.getBestDirection(currentPosition, targetPosition);
|
|
300
|
+
clearTimeout(timeOut.current);
|
|
301
|
+
timeOut.current = void 0;
|
|
302
|
+
if (animationId.current) {
|
|
303
|
+
cancelAnimationFrame(animationId.current);
|
|
304
|
+
animationId.current = void 0;
|
|
305
|
+
}
|
|
306
|
+
setCarouselInformation((prevState) => ({
|
|
307
|
+
...prevState,
|
|
308
|
+
dragState: void 0,
|
|
309
|
+
animationState: {
|
|
310
|
+
targetPosition,
|
|
311
|
+
direction,
|
|
312
|
+
startPosition: currentPosition,
|
|
313
|
+
isAutoLooping: false
|
|
314
|
+
},
|
|
315
|
+
timeOut: void 0
|
|
153
316
|
}));
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
317
|
+
};
|
|
318
|
+
const canGoLeft = () => {
|
|
319
|
+
return isLooping || currentPosition !== 0;
|
|
320
|
+
};
|
|
321
|
+
const canGoRight = () => {
|
|
322
|
+
return isLooping || currentPosition !== length - 1;
|
|
323
|
+
};
|
|
324
|
+
const left = () => {
|
|
325
|
+
if (canGoLeft()) {
|
|
326
|
+
startAnimation(currentPosition === 0 ? length - 1 : LoopingArrayCalculator.withoutOffset(currentPosition - 1));
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
const right = () => {
|
|
330
|
+
if (canGoRight()) {
|
|
331
|
+
startAnimation(LoopingArrayCalculator.withoutOffset((currentPosition + 1) % length));
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
let items = children.map((item, index) => ({
|
|
335
|
+
index,
|
|
336
|
+
item
|
|
337
|
+
}));
|
|
338
|
+
if (isLooping) {
|
|
339
|
+
const before = createLoopingListWithIndex(children, length - 1, paddingItemCount, false).reverse().map(([index, item]) => ({
|
|
340
|
+
index,
|
|
341
|
+
item
|
|
178
342
|
}));
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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
|
-
|
|
343
|
+
const after = createLoopingListWithIndex(children, 0, paddingItemCount).map(([index, item]) => ({
|
|
344
|
+
index,
|
|
345
|
+
item
|
|
346
|
+
}));
|
|
347
|
+
items = [
|
|
348
|
+
...before,
|
|
349
|
+
...items,
|
|
350
|
+
...after
|
|
351
|
+
];
|
|
352
|
+
}
|
|
353
|
+
const onDragStart = (x) => setCarouselInformation((prevState) => ({
|
|
354
|
+
...prevState,
|
|
355
|
+
dragState: {
|
|
356
|
+
lastX: x,
|
|
357
|
+
startX: x,
|
|
358
|
+
startTime: Date.now(),
|
|
359
|
+
startIndex: currentPosition
|
|
360
|
+
},
|
|
361
|
+
animationState: void 0
|
|
362
|
+
// cancel animation
|
|
363
|
+
}));
|
|
364
|
+
const onDrag = (x, width) => {
|
|
365
|
+
if (!dragState || x === 0) {
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
const offsetUpdate = (dragState.lastX - x) / width;
|
|
369
|
+
const newPosition = util.getCorrectedPosition(currentPosition + offsetUpdate);
|
|
370
|
+
setCarouselInformation((prevState) => ({
|
|
371
|
+
...prevState,
|
|
372
|
+
currentPosition: newPosition,
|
|
373
|
+
dragState: {
|
|
374
|
+
...dragState,
|
|
375
|
+
lastX: x
|
|
376
|
+
}
|
|
377
|
+
}));
|
|
378
|
+
};
|
|
379
|
+
const onDragEnd = (x, width) => {
|
|
380
|
+
if (!dragState) {
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
const distance = dragState.startX - x;
|
|
384
|
+
const relativeDistance = distance / width;
|
|
385
|
+
const duration = Date.now() - dragState.startTime;
|
|
386
|
+
const velocity = distance / (Date.now() - dragState.startTime);
|
|
387
|
+
const isSlide = Math.abs(velocity) > 2 || duration < 200 && (Math.abs(relativeDistance) > 0.2 || Math.abs(distance) > 50);
|
|
388
|
+
if (isSlide) {
|
|
389
|
+
if (distance > 0 && canGoRight()) {
|
|
390
|
+
right();
|
|
391
|
+
return;
|
|
392
|
+
} else if (distance < 0 && canGoLeft()) {
|
|
393
|
+
left();
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
startAnimation();
|
|
398
|
+
};
|
|
399
|
+
const dragHandlers = {
|
|
400
|
+
draggable: true,
|
|
401
|
+
onDragStart: (event) => {
|
|
402
|
+
onDragStart(event.clientX);
|
|
403
|
+
event.dataTransfer.setDragImage(document.createElement("div"), 0, 0);
|
|
404
|
+
},
|
|
405
|
+
onDrag: (event) => onDrag(event.clientX, event.target.getBoundingClientRect().width),
|
|
406
|
+
onDragEnd: (event) => onDragEnd(event.clientX, event.target.getBoundingClientRect().width),
|
|
407
|
+
onTouchStart: (event) => onDragStart(event.touches[0].clientX),
|
|
408
|
+
onTouchMove: (event) => onDrag(event.touches[0].clientX, event.target.getBoundingClientRect().width),
|
|
409
|
+
onTouchEnd: (event) => onDragEnd(event.changedTouches[0].clientX, event.target.getBoundingClientRect().width),
|
|
410
|
+
onTouchCancel: (event) => onDragEnd(event.changedTouches[0].clientX, event.target.getBoundingClientRect().width)
|
|
411
|
+
};
|
|
412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "col items-center w-full gap-y-2", children: [
|
|
413
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_clsx.default)(`relative w-full overflow-hidden`, heightClassName, className), children: [
|
|
414
|
+
arrows && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
415
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
416
|
+
"div",
|
|
417
|
+
{
|
|
418
|
+
className: (0, import_clsx.default)("absolute z-10 left-0 top-1/2 -translate-y-1/2 bg-gray-200 hover:bg-gray-300 rounded-lg cursor-pointer border-black border-2", { hidden: !canGoLeft() }),
|
|
419
|
+
onClick: () => left(),
|
|
420
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronLeft, { size: 32 })
|
|
421
|
+
}
|
|
422
|
+
),
|
|
423
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
424
|
+
"div",
|
|
425
|
+
{
|
|
426
|
+
className: (0, import_clsx.default)("absolute z-10 right-0 top-1/2 -translate-y-1/2 bg-gray-200 hover:bg-gray-300 rounded-lg cursor-pointer border-black border-2", { hidden: !canGoRight() }),
|
|
427
|
+
onClick: () => right(),
|
|
428
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronRight, { size: 32 })
|
|
429
|
+
}
|
|
430
|
+
)
|
|
431
|
+
] }),
|
|
432
|
+
hintNext ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_clsx.default)(`relative row h-full`, heightClassName), children: [
|
|
433
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative row h-full w-full px-2 overflow-hidden", children: items.map(({
|
|
434
|
+
item,
|
|
435
|
+
index
|
|
436
|
+
}, listIndex) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
437
|
+
"div",
|
|
438
|
+
{
|
|
439
|
+
className: (0, import_clsx.default)(`absolute left-[50%] h-full overflow-hidden`, widthClassName, { "!cursor-grabbing": !!dragState }),
|
|
440
|
+
style: { translate: getStyleOffset(listIndex - (isLooping ? paddingItemCount : 0)) },
|
|
441
|
+
...dragHandlers,
|
|
442
|
+
onClick: () => startAnimation(index),
|
|
443
|
+
children: item
|
|
444
|
+
},
|
|
445
|
+
listIndex
|
|
446
|
+
)) }),
|
|
447
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
448
|
+
"div",
|
|
449
|
+
{
|
|
450
|
+
className: (0, import_clsx.default)(`hidden pointer-events-none desktop:block absolute left-0 h-full w-[20%] bg-gradient-to-r to-transparent`, blurColor)
|
|
451
|
+
}
|
|
452
|
+
),
|
|
453
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
454
|
+
"div",
|
|
455
|
+
{
|
|
456
|
+
className: (0, import_clsx.default)(`hidden pointer-events-none desktop:block absolute right-0 h-full w-[20%] bg-gradient-to-l to-transparent`, blurColor)
|
|
457
|
+
}
|
|
458
|
+
)
|
|
459
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_clsx.default)("px-16 h-full", { "!cursor-grabbing": !!dragState }), ...dragHandlers, children: children[currentIndex] })
|
|
460
|
+
] }),
|
|
461
|
+
dots && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
462
|
+
"div",
|
|
463
|
+
{
|
|
464
|
+
className: "row items-center justify-center w-full my-2",
|
|
465
|
+
children: range(0, length - 1).map((index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
466
|
+
"button",
|
|
467
|
+
{
|
|
468
|
+
className: (0, import_clsx.default)("w-[2rem] min-w-[2rem] h-[0.75rem] min-h-[0.75rem] hover:bg-primary hover:brightness-90 first:rounded-l-md last:rounded-r-md", {
|
|
469
|
+
"bg-gray-200": currentIndex !== index,
|
|
470
|
+
"bg-primary": currentIndex === index
|
|
471
|
+
}),
|
|
472
|
+
onClick: () => startAnimation(index)
|
|
473
|
+
},
|
|
474
|
+
index
|
|
475
|
+
))
|
|
476
|
+
}
|
|
477
|
+
)
|
|
478
|
+
] });
|
|
233
479
|
};
|
|
480
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
481
|
+
0 && (module.exports = {
|
|
482
|
+
Carousel
|
|
483
|
+
});
|
|
484
|
+
//# sourceMappingURL=Carousel.js.map
|