@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,65 +1,836 @@
|
|
|
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
|
-
|
|
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/user-input/DateAndTimePicker.tsx
|
|
31
|
+
var DateAndTimePicker_exports = {};
|
|
32
|
+
__export(DateAndTimePicker_exports, {
|
|
33
|
+
DateTimePicker: () => DateTimePicker
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(DateAndTimePicker_exports);
|
|
36
|
+
var import_clsx7 = __toESM(require("clsx"));
|
|
37
|
+
|
|
38
|
+
// src/hooks/useLanguage.tsx
|
|
39
|
+
var import_react2 = require("react");
|
|
40
|
+
|
|
41
|
+
// src/hooks/useLocalStorage.tsx
|
|
42
|
+
var import_react = require("react");
|
|
43
|
+
|
|
44
|
+
// src/hooks/useLanguage.tsx
|
|
45
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
46
|
+
var DEFAULT_LANGUAGE = "en";
|
|
47
|
+
var LanguageContext = (0, import_react2.createContext)({ language: DEFAULT_LANGUAGE, setLanguage: (v) => v });
|
|
48
|
+
var useLanguage = () => (0, import_react2.useContext)(LanguageContext);
|
|
49
|
+
var useLocale = (overWriteLanguage) => {
|
|
50
|
+
const { language } = useLanguage();
|
|
51
|
+
const mapping = {
|
|
52
|
+
en: "en-US",
|
|
53
|
+
de: "de-DE"
|
|
54
|
+
};
|
|
55
|
+
return mapping[overWriteLanguage ?? language];
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// src/hooks/useTranslation.ts
|
|
59
|
+
var useTranslation = (defaults, translationOverwrite = {}) => {
|
|
60
|
+
const { language: languageProp, translation: overwrite } = translationOverwrite;
|
|
61
|
+
const { language: inferredLanguage } = useLanguage();
|
|
62
|
+
const usedLanguage = languageProp ?? inferredLanguage;
|
|
63
|
+
let defaultValues = defaults[usedLanguage];
|
|
64
|
+
if (overwrite && overwrite[usedLanguage]) {
|
|
65
|
+
defaultValues = { ...defaultValues, ...overwrite[usedLanguage] };
|
|
66
|
+
}
|
|
67
|
+
return defaultValues;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// src/util/noop.ts
|
|
71
|
+
var noop = () => void 0;
|
|
72
|
+
|
|
73
|
+
// src/util/array.ts
|
|
74
|
+
var equalSizeGroups = (array, groupSize) => {
|
|
75
|
+
if (groupSize <= 0) {
|
|
76
|
+
console.warn(`group size should be greater than 0: groupSize = ${groupSize}`);
|
|
77
|
+
return [[...array]];
|
|
78
|
+
}
|
|
79
|
+
const groups = [];
|
|
80
|
+
for (let i = 0; i < array.length; i += groupSize) {
|
|
81
|
+
groups.push(array.slice(i, Math.min(i + groupSize, array.length)));
|
|
82
|
+
}
|
|
83
|
+
return groups;
|
|
84
|
+
};
|
|
85
|
+
var range = (start, end, allowEmptyRange = false) => {
|
|
86
|
+
if (end < start) {
|
|
87
|
+
if (!allowEmptyRange) {
|
|
88
|
+
console.warn(`range: end (${end}) < start (${start}) should be allowed explicitly, set allowEmptyRange to true`);
|
|
89
|
+
}
|
|
90
|
+
return [];
|
|
91
|
+
}
|
|
92
|
+
return Array.from({ length: end - start + 1 }, (_, index) => index + start);
|
|
93
|
+
};
|
|
94
|
+
var closestMatch = (list, firstCloser) => {
|
|
95
|
+
return list.reduce((item1, item2) => {
|
|
96
|
+
return firstCloser(item1, item2) ? item1 : item2;
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
// src/util/date.ts
|
|
101
|
+
var monthsList = ["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"];
|
|
102
|
+
var weekDayList = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"];
|
|
103
|
+
var changeDuration = (date, duration, isAdding) => {
|
|
104
|
+
const {
|
|
105
|
+
years = 0,
|
|
106
|
+
months = 0,
|
|
107
|
+
days = 0,
|
|
108
|
+
hours = 0,
|
|
109
|
+
minutes = 0,
|
|
110
|
+
seconds = 0,
|
|
111
|
+
milliseconds = 0
|
|
112
|
+
} = duration;
|
|
113
|
+
if (years < 0) {
|
|
114
|
+
console.error(`Range error years must be greater than 0: received ${years}`);
|
|
115
|
+
return new Date(date);
|
|
116
|
+
}
|
|
117
|
+
if (months < 0 || months > 11) {
|
|
118
|
+
console.error(`Range error month must be 0 <= month <= 11: received ${months}`);
|
|
119
|
+
return new Date(date);
|
|
120
|
+
}
|
|
121
|
+
if (days < 0) {
|
|
122
|
+
console.error(`Range error days must be greater than 0: received ${days}`);
|
|
123
|
+
return new Date(date);
|
|
124
|
+
}
|
|
125
|
+
if (hours < 0 || hours > 23) {
|
|
126
|
+
console.error(`Range error hours must be 0 <= hours <= 23: received ${hours}`);
|
|
127
|
+
return new Date(date);
|
|
128
|
+
}
|
|
129
|
+
if (minutes < 0 || minutes > 59) {
|
|
130
|
+
console.error(`Range error minutes must be 0 <= minutes <= 59: received ${minutes}`);
|
|
131
|
+
return new Date(date);
|
|
132
|
+
}
|
|
133
|
+
if (seconds < 0 || seconds > 59) {
|
|
134
|
+
console.error(`Range error seconds must be 0 <= seconds <= 59: received ${seconds}`);
|
|
135
|
+
return new Date(date);
|
|
136
|
+
}
|
|
137
|
+
if (milliseconds < 0) {
|
|
138
|
+
console.error(`Range error seconds must be greater than 0: received ${milliseconds}`);
|
|
139
|
+
return new Date(date);
|
|
140
|
+
}
|
|
141
|
+
const multiplier = isAdding ? 1 : -1;
|
|
142
|
+
const newDate = new Date(date);
|
|
143
|
+
newDate.setFullYear(newDate.getFullYear() + multiplier * years);
|
|
144
|
+
newDate.setMonth(newDate.getMonth() + multiplier * months);
|
|
145
|
+
newDate.setDate(newDate.getDate() + multiplier * days);
|
|
146
|
+
newDate.setHours(newDate.getHours() + multiplier * hours);
|
|
147
|
+
newDate.setMinutes(newDate.getMinutes() + multiplier * minutes);
|
|
148
|
+
newDate.setSeconds(newDate.getSeconds() + multiplier * seconds);
|
|
149
|
+
newDate.setMilliseconds(newDate.getMilliseconds() + multiplier * milliseconds);
|
|
150
|
+
return newDate;
|
|
151
|
+
};
|
|
152
|
+
var addDuration = (date, duration) => {
|
|
153
|
+
return changeDuration(date, duration, true);
|
|
154
|
+
};
|
|
155
|
+
var subtractDuration = (date, duration) => {
|
|
156
|
+
return changeDuration(date, duration, false);
|
|
157
|
+
};
|
|
158
|
+
var isInTimeSpan = (value, startDate, endDate) => {
|
|
159
|
+
if (startDate && endDate) {
|
|
160
|
+
console.assert(startDate <= endDate);
|
|
161
|
+
return startDate <= value && value <= endDate;
|
|
162
|
+
} else if (startDate) {
|
|
163
|
+
return startDate <= value;
|
|
164
|
+
} else if (endDate) {
|
|
165
|
+
return endDate >= value;
|
|
166
|
+
} else {
|
|
167
|
+
return true;
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
var equalDate = (date1, date2) => {
|
|
171
|
+
return date1.getFullYear() === date2.getFullYear() && date1.getMonth() === date2.getMonth() && date1.getDate() === date2.getDate();
|
|
172
|
+
};
|
|
173
|
+
var getWeeksForCalenderMonth = (date, weekStart, weeks = 6) => {
|
|
174
|
+
const month = date.getMonth();
|
|
175
|
+
const year = date.getFullYear();
|
|
176
|
+
const dayList = [];
|
|
177
|
+
let currentDate = new Date(year, month, 1);
|
|
178
|
+
const weekStartIndex = weekDayList.indexOf(weekStart);
|
|
179
|
+
while (currentDate.getDay() !== weekStartIndex) {
|
|
180
|
+
currentDate = subtractDuration(currentDate, { days: 1 });
|
|
181
|
+
}
|
|
182
|
+
while (dayList.length < 7 * weeks) {
|
|
183
|
+
const date2 = new Date(currentDate);
|
|
184
|
+
date2.setHours(date2.getHours(), date2.getMinutes());
|
|
185
|
+
dayList.push(date2);
|
|
186
|
+
currentDate = addDuration(currentDate, { days: 1 });
|
|
187
|
+
}
|
|
188
|
+
return equalSizeGroups(dayList, 7);
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
// src/components/Button.tsx
|
|
192
|
+
var import_clsx = __toESM(require("clsx"));
|
|
193
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
194
|
+
var ButtonSizePaddings = {
|
|
195
|
+
small: "btn-sm",
|
|
196
|
+
medium: "btn-md",
|
|
197
|
+
large: "btn-lg"
|
|
198
|
+
};
|
|
199
|
+
var SolidButton = ({
|
|
200
|
+
children,
|
|
201
|
+
disabled = false,
|
|
202
|
+
color = "primary",
|
|
203
|
+
size = "medium",
|
|
204
|
+
startIcon,
|
|
205
|
+
endIcon,
|
|
206
|
+
onClick,
|
|
207
|
+
className,
|
|
208
|
+
...restProps
|
|
209
|
+
}) => {
|
|
210
|
+
const colorClasses = {
|
|
211
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
212
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
213
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
214
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
215
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
216
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text"
|
|
217
|
+
}[color];
|
|
218
|
+
const iconColorClasses = {
|
|
219
|
+
primary: "text-button-solid-primary-icon",
|
|
220
|
+
secondary: "text-button-solid-secondary-icon",
|
|
221
|
+
tertiary: "text-button-solid-tertiary-icon",
|
|
222
|
+
positive: "text-button-solid-positive-icon",
|
|
223
|
+
warning: "text-button-solid-warning-icon",
|
|
224
|
+
negative: "text-button-solid-negative-icon"
|
|
225
|
+
}[color];
|
|
226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
227
|
+
"button",
|
|
228
|
+
{
|
|
229
|
+
onClick: disabled ? void 0 : onClick,
|
|
230
|
+
disabled: disabled || onClick === void 0,
|
|
231
|
+
className: (0, import_clsx.default)(
|
|
232
|
+
className,
|
|
233
|
+
{
|
|
234
|
+
"text-disabled-text bg-disabled-background": disabled,
|
|
235
|
+
[(0, import_clsx.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
236
|
+
},
|
|
237
|
+
ButtonSizePaddings[size]
|
|
238
|
+
),
|
|
239
|
+
...restProps,
|
|
240
|
+
children: [
|
|
241
|
+
startIcon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
242
|
+
"span",
|
|
243
|
+
{
|
|
244
|
+
className: (0, import_clsx.default)({
|
|
245
|
+
[iconColorClasses]: !disabled,
|
|
246
|
+
[`text-disabled-icon`]: disabled
|
|
247
|
+
}),
|
|
248
|
+
children: startIcon
|
|
249
|
+
}
|
|
250
|
+
),
|
|
251
|
+
children,
|
|
252
|
+
endIcon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
253
|
+
"span",
|
|
254
|
+
{
|
|
255
|
+
className: (0, import_clsx.default)({
|
|
256
|
+
[iconColorClasses]: !disabled,
|
|
257
|
+
[`text-disabled-icon`]: disabled
|
|
258
|
+
}),
|
|
259
|
+
children: endIcon
|
|
260
|
+
}
|
|
261
|
+
)
|
|
262
|
+
]
|
|
47
263
|
}
|
|
264
|
+
);
|
|
48
265
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
266
|
+
var TextButton = ({
|
|
267
|
+
children,
|
|
268
|
+
disabled = false,
|
|
269
|
+
color = "neutral",
|
|
270
|
+
size = "medium",
|
|
271
|
+
startIcon,
|
|
272
|
+
endIcon,
|
|
273
|
+
onClick,
|
|
274
|
+
className,
|
|
275
|
+
...restProps
|
|
276
|
+
}) => {
|
|
277
|
+
const colorClasses = {
|
|
278
|
+
negative: "bg-transparent text-button-text-negative-text",
|
|
279
|
+
neutral: "bg-transparent text-button-text-neutral-text"
|
|
280
|
+
}[color];
|
|
281
|
+
const iconColorClasses = {
|
|
282
|
+
negative: "text-button-text-negative-icon",
|
|
283
|
+
neutral: "text-button-text-neutral-icon"
|
|
284
|
+
}[color];
|
|
285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
286
|
+
"button",
|
|
287
|
+
{
|
|
288
|
+
onClick: disabled ? void 0 : onClick,
|
|
289
|
+
disabled: disabled || onClick === void 0,
|
|
290
|
+
className: (0, import_clsx.default)(
|
|
291
|
+
className,
|
|
292
|
+
{
|
|
293
|
+
"text-disabled-text": disabled,
|
|
294
|
+
[(0, import_clsx.default)(colorClasses, "hover:bg-button-text-hover-background rounded-full")]: !disabled
|
|
295
|
+
},
|
|
296
|
+
ButtonSizePaddings[size]
|
|
297
|
+
),
|
|
298
|
+
...restProps,
|
|
299
|
+
children: [
|
|
300
|
+
startIcon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
301
|
+
"span",
|
|
302
|
+
{
|
|
303
|
+
className: (0, import_clsx.default)({
|
|
304
|
+
[iconColorClasses]: !disabled,
|
|
305
|
+
[`text-disabled-icon`]: disabled
|
|
306
|
+
}),
|
|
307
|
+
children: startIcon
|
|
308
|
+
}
|
|
309
|
+
),
|
|
310
|
+
children,
|
|
311
|
+
endIcon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
312
|
+
"span",
|
|
313
|
+
{
|
|
314
|
+
className: (0, import_clsx.default)({
|
|
315
|
+
[iconColorClasses]: !disabled,
|
|
316
|
+
[`text-disabled-icon`]: disabled
|
|
317
|
+
}),
|
|
318
|
+
children: endIcon
|
|
319
|
+
}
|
|
320
|
+
)
|
|
321
|
+
]
|
|
60
322
|
}
|
|
61
|
-
|
|
62
|
-
|
|
323
|
+
);
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
// src/components/date/TimePicker.tsx
|
|
327
|
+
var import_react3 = require("react");
|
|
328
|
+
var import_react_custom_scrollbars_2 = require("react-custom-scrollbars-2");
|
|
329
|
+
var import_clsx2 = __toESM(require("clsx"));
|
|
330
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
331
|
+
var TimePicker = ({
|
|
332
|
+
time = /* @__PURE__ */ new Date(),
|
|
333
|
+
onChange = noop,
|
|
334
|
+
is24HourFormat = true,
|
|
335
|
+
minuteIncrement = "5min",
|
|
336
|
+
maxHeight = 300,
|
|
337
|
+
className = ""
|
|
338
|
+
}) => {
|
|
339
|
+
const minuteRef = (0, import_react3.useRef)(null);
|
|
340
|
+
const hourRef = (0, import_react3.useRef)(null);
|
|
341
|
+
const isPM = time.getHours() >= 11;
|
|
342
|
+
const hours = is24HourFormat ? range(0, 23) : range(1, 12);
|
|
343
|
+
let minutes = range(0, 59);
|
|
344
|
+
(0, import_react3.useEffect)(() => {
|
|
345
|
+
const scrollToItem = () => {
|
|
346
|
+
if (minuteRef.current) {
|
|
347
|
+
const container = minuteRef.current.parentElement;
|
|
348
|
+
const hasOverflow = container.scrollHeight > maxHeight;
|
|
349
|
+
if (hasOverflow) {
|
|
350
|
+
minuteRef.current.scrollIntoView({
|
|
351
|
+
behavior: "instant",
|
|
352
|
+
block: "nearest"
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
scrollToItem();
|
|
358
|
+
}, [minuteRef, minuteRef.current]);
|
|
359
|
+
(0, import_react3.useEffect)(() => {
|
|
360
|
+
const scrollToItem = () => {
|
|
361
|
+
if (hourRef.current) {
|
|
362
|
+
const container = hourRef.current.parentElement;
|
|
363
|
+
const hasOverflow = container.scrollHeight > maxHeight;
|
|
364
|
+
if (hasOverflow) {
|
|
365
|
+
hourRef.current.scrollIntoView({
|
|
366
|
+
behavior: "instant",
|
|
367
|
+
block: "nearest"
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
scrollToItem();
|
|
373
|
+
}, [hourRef, hourRef.current]);
|
|
374
|
+
switch (minuteIncrement) {
|
|
375
|
+
case "5min":
|
|
376
|
+
minutes = minutes.filter((value) => value % 5 === 0);
|
|
377
|
+
break;
|
|
378
|
+
case "10min":
|
|
379
|
+
minutes = minutes.filter((value) => value % 10 === 0);
|
|
380
|
+
break;
|
|
381
|
+
case "15min":
|
|
382
|
+
minutes = minutes.filter((value) => value % 15 === 0);
|
|
383
|
+
break;
|
|
384
|
+
case "30min":
|
|
385
|
+
minutes = minutes.filter((value) => value % 30 === 0);
|
|
386
|
+
break;
|
|
387
|
+
}
|
|
388
|
+
const closestMinute = closestMatch(minutes, (item1, item2) => Math.abs(item1 - time.getMinutes()) < Math.abs(item2 - time.getMinutes()));
|
|
389
|
+
const style = (selected) => (0, import_clsx2.default)(
|
|
390
|
+
"chip-full hover:brightness-90 hover:bg-primary hover:text-on-primary rounded-md mr-3",
|
|
391
|
+
{ "bg-primary text-on-primary": selected, "bg-white text-black": !selected }
|
|
392
|
+
);
|
|
393
|
+
const onChangeWrapper = (transformer) => {
|
|
394
|
+
const newDate = new Date(time);
|
|
395
|
+
transformer(newDate);
|
|
396
|
+
onChange(newDate);
|
|
397
|
+
};
|
|
398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: (0, import_clsx2.default)("row gap-x-2 w-fit min-w-[150px] select-none", className), children: [
|
|
399
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_custom_scrollbars_2.Scrollbars, { autoHeight: true, autoHeightMax: maxHeight, style: { height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "col gap-y-1 h-full", children: hours.map((hour) => {
|
|
400
|
+
const currentHour = hour === time.getHours() - (!is24HourFormat && isPM ? 12 : 0);
|
|
401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
402
|
+
"button",
|
|
403
|
+
{
|
|
404
|
+
ref: currentHour ? hourRef : void 0,
|
|
405
|
+
className: style(currentHour),
|
|
406
|
+
onClick: () => onChangeWrapper((newDate) => newDate.setHours(hour + (!is24HourFormat && isPM ? 12 : 0))),
|
|
407
|
+
children: hour.toString().padStart(2, "0")
|
|
408
|
+
},
|
|
409
|
+
hour
|
|
410
|
+
);
|
|
411
|
+
}) }) }),
|
|
412
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_custom_scrollbars_2.Scrollbars, { autoHeight: true, autoHeightMax: maxHeight, style: { height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "col gap-y-1 h-full", children: minutes.map((minute) => {
|
|
413
|
+
const currentMinute = minute === closestMinute;
|
|
414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
415
|
+
"button",
|
|
416
|
+
{
|
|
417
|
+
ref: currentMinute ? minuteRef : void 0,
|
|
418
|
+
className: style(currentMinute),
|
|
419
|
+
onClick: () => onChangeWrapper((newDate) => newDate.setMinutes(minute)),
|
|
420
|
+
children: minute.toString().padStart(2, "0")
|
|
421
|
+
},
|
|
422
|
+
minute + minuteIncrement
|
|
423
|
+
);
|
|
424
|
+
}) }) }),
|
|
425
|
+
!is24HourFormat && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "col gap-y-1", children: [
|
|
426
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
427
|
+
"button",
|
|
428
|
+
{
|
|
429
|
+
className: style(!isPM),
|
|
430
|
+
onClick: () => onChangeWrapper((newDate) => isPM && newDate.setHours(newDate.getHours() - 12)),
|
|
431
|
+
children: "AM"
|
|
432
|
+
}
|
|
433
|
+
),
|
|
434
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
435
|
+
"button",
|
|
436
|
+
{
|
|
437
|
+
className: style(isPM),
|
|
438
|
+
onClick: () => onChangeWrapper((newDate) => !isPM && newDate.setHours(newDate.getHours() + 12)),
|
|
439
|
+
children: "PM"
|
|
440
|
+
}
|
|
441
|
+
)
|
|
442
|
+
] })
|
|
443
|
+
] });
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
// src/components/date/DatePicker.tsx
|
|
447
|
+
var import_react7 = require("react");
|
|
448
|
+
var import_lucide_react2 = require("lucide-react");
|
|
449
|
+
var import_clsx6 = __toESM(require("clsx"));
|
|
450
|
+
|
|
451
|
+
// src/components/date/YearMonthPicker.tsx
|
|
452
|
+
var import_react5 = require("react");
|
|
453
|
+
var import_react_custom_scrollbars_22 = require("react-custom-scrollbars-2");
|
|
454
|
+
var import_clsx4 = __toESM(require("clsx"));
|
|
455
|
+
|
|
456
|
+
// src/components/Expandable.tsx
|
|
457
|
+
var import_react4 = require("react");
|
|
458
|
+
var import_lucide_react = require("lucide-react");
|
|
459
|
+
var import_clsx3 = __toESM(require("clsx"));
|
|
460
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
461
|
+
var DefaultIcon = (expanded) => expanded ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.ChevronUp, { size: 16, className: "min-w-[16px]" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.ChevronDown, { size: 16, className: "min-w-[16px]" });
|
|
462
|
+
var Expandable = (0, import_react4.forwardRef)(({
|
|
463
|
+
children,
|
|
464
|
+
label,
|
|
465
|
+
icon,
|
|
466
|
+
initialExpansion = false,
|
|
467
|
+
clickOnlyOnHeader = true,
|
|
468
|
+
className = "",
|
|
469
|
+
headerClassName = ""
|
|
470
|
+
}, ref) => {
|
|
471
|
+
const [isExpanded, setIsExpanded] = (0, import_react4.useState)(initialExpansion);
|
|
472
|
+
icon ??= DefaultIcon;
|
|
473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
474
|
+
"div",
|
|
475
|
+
{
|
|
476
|
+
ref,
|
|
477
|
+
className: (0, import_clsx3.default)("col bg-surface text-on-surface group rounded-lg shadow-sm", { "cursor-pointer": !clickOnlyOnHeader }, className),
|
|
478
|
+
onClick: () => !clickOnlyOnHeader && setIsExpanded(!isExpanded),
|
|
479
|
+
children: [
|
|
480
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
481
|
+
"button",
|
|
482
|
+
{
|
|
483
|
+
className: (0, import_clsx3.default)("btn-md rounded-lg justify-between items-center bg-surface text-on-surface", { "group-hover:brightness-95": !isExpanded }, headerClassName),
|
|
484
|
+
onClick: () => clickOnlyOnHeader && setIsExpanded(!isExpanded),
|
|
485
|
+
children: [
|
|
486
|
+
label,
|
|
487
|
+
icon(isExpanded)
|
|
488
|
+
]
|
|
489
|
+
}
|
|
490
|
+
),
|
|
491
|
+
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "col", children })
|
|
492
|
+
]
|
|
63
493
|
}
|
|
64
|
-
|
|
494
|
+
);
|
|
495
|
+
});
|
|
496
|
+
Expandable.displayName = "Expandable";
|
|
497
|
+
|
|
498
|
+
// src/components/date/YearMonthPicker.tsx
|
|
499
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
500
|
+
var YearMonthPicker = ({
|
|
501
|
+
displayedYearMonth = /* @__PURE__ */ new Date(),
|
|
502
|
+
start = subtractDuration(/* @__PURE__ */ new Date(), { years: 50 }),
|
|
503
|
+
end = addDuration(/* @__PURE__ */ new Date(), { years: 50 }),
|
|
504
|
+
onChange = noop,
|
|
505
|
+
className = "",
|
|
506
|
+
maxHeight = 300,
|
|
507
|
+
showValueOpen = true
|
|
508
|
+
}) => {
|
|
509
|
+
const locale = useLocale();
|
|
510
|
+
const ref = (0, import_react5.useRef)(null);
|
|
511
|
+
(0, import_react5.useEffect)(() => {
|
|
512
|
+
const scrollToItem = () => {
|
|
513
|
+
if (ref.current) {
|
|
514
|
+
ref.current.scrollIntoView({
|
|
515
|
+
behavior: "instant",
|
|
516
|
+
block: "center"
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
};
|
|
520
|
+
scrollToItem();
|
|
521
|
+
}, [ref]);
|
|
522
|
+
if (end < start) {
|
|
523
|
+
console.error(`startYear: (${start}) less than endYear: (${end})`);
|
|
524
|
+
return null;
|
|
525
|
+
}
|
|
526
|
+
const years = range(start.getFullYear(), end.getFullYear());
|
|
527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: (0, import_clsx4.default)("col select-none", className), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_custom_scrollbars_22.Scrollbars, { autoHeight: true, autoHeightMax: maxHeight, style: { height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "col gap-y-1 mr-3", children: years.map((year) => {
|
|
528
|
+
const selectedYear = displayedYearMonth.getFullYear() === year;
|
|
529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
530
|
+
Expandable,
|
|
531
|
+
{
|
|
532
|
+
ref: (displayedYearMonth.getFullYear() ?? (/* @__PURE__ */ new Date()).getFullYear()) === year ? ref : void 0,
|
|
533
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: (0, import_clsx4.default)({ "text-primary font-bold": selectedYear }), children: year }),
|
|
534
|
+
initialExpansion: showValueOpen && selectedYear,
|
|
535
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "col gap-y-1 px-2 pb-2", children: equalSizeGroups([...monthsList], 3).map((monthList, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "row", children: monthList.map((month) => {
|
|
536
|
+
const monthIndex = monthsList.indexOf(month);
|
|
537
|
+
const newDate = new Date(year, monthIndex);
|
|
538
|
+
const selectedMonth = selectedYear && monthIndex === displayedYearMonth.getMonth();
|
|
539
|
+
const firstOfMonth = new Date(year, monthIndex, 1);
|
|
540
|
+
const lastOfMonth = new Date(year, monthIndex, 1);
|
|
541
|
+
const isAfterStart = start === void 0 || start <= addDuration(subtractDuration(lastOfMonth, { days: 1 }), { months: 1 });
|
|
542
|
+
const isBeforeEnd = end === void 0 || firstOfMonth <= end;
|
|
543
|
+
const isValid = isAfterStart && isBeforeEnd;
|
|
544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
545
|
+
"button",
|
|
546
|
+
{
|
|
547
|
+
disabled: !isValid,
|
|
548
|
+
className: (0, import_clsx4.default)(
|
|
549
|
+
"chip hover:brightness-95 flex-1",
|
|
550
|
+
{
|
|
551
|
+
"bg-gray-50 text-black": !selectedMonth && isValid,
|
|
552
|
+
"bg-primary text-on-primary": selectedMonth && isValid,
|
|
553
|
+
"bg-disabled-background text-disabled-text": !isValid
|
|
554
|
+
}
|
|
555
|
+
),
|
|
556
|
+
onClick: () => {
|
|
557
|
+
onChange(newDate);
|
|
558
|
+
},
|
|
559
|
+
children: new Intl.DateTimeFormat(locale, { month: "short" }).format(newDate)
|
|
560
|
+
},
|
|
561
|
+
month
|
|
562
|
+
);
|
|
563
|
+
}) }, index)) })
|
|
564
|
+
},
|
|
565
|
+
year
|
|
566
|
+
);
|
|
567
|
+
}) }) }) });
|
|
568
|
+
};
|
|
569
|
+
|
|
570
|
+
// src/components/date/DayPicker.tsx
|
|
571
|
+
var import_clsx5 = __toESM(require("clsx"));
|
|
572
|
+
var import_react6 = require("react");
|
|
573
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
574
|
+
var DayPicker = ({
|
|
575
|
+
displayedMonth,
|
|
576
|
+
selected,
|
|
577
|
+
start,
|
|
578
|
+
end,
|
|
579
|
+
onChange = noop,
|
|
580
|
+
weekStart = "monday",
|
|
581
|
+
markToday = true,
|
|
582
|
+
className = ""
|
|
583
|
+
}) => {
|
|
584
|
+
const locale = useLocale();
|
|
585
|
+
const month = displayedMonth.getMonth();
|
|
586
|
+
const weeks = getWeeksForCalenderMonth(displayedMonth, weekStart);
|
|
587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_clsx5.default)("col gap-y-1 min-w-[220px] select-none", className), children: [
|
|
588
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "row text-center", children: weeks[0].map((weekDay, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex-1 font-semibold", children: new Intl.DateTimeFormat(locale, { weekday: "long" }).format(weekDay).substring(0, 2) }, index)) }),
|
|
589
|
+
weeks.map((week, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "row text-center", children: week.map((date) => {
|
|
590
|
+
const isSelected = !!selected && equalDate(selected, date);
|
|
591
|
+
const isToday = equalDate(/* @__PURE__ */ new Date(), date);
|
|
592
|
+
const isSameMonth = date.getMonth() === month;
|
|
593
|
+
const isDayValid = isInTimeSpan(date, start, end);
|
|
594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
595
|
+
"button",
|
|
596
|
+
{
|
|
597
|
+
disabled: !isDayValid,
|
|
598
|
+
className: (0, import_clsx5.default)(
|
|
599
|
+
"flex-1 rounded-full border-2 border-transparent shadow-sm",
|
|
600
|
+
{
|
|
601
|
+
"text-gray-700 bg-gray-100": !isSameMonth && isDayValid,
|
|
602
|
+
"text-black bg-white": !isSelected && isSameMonth && isDayValid,
|
|
603
|
+
"text-on-primary bg-primary": isSelected,
|
|
604
|
+
"border-black": isToday && markToday,
|
|
605
|
+
"hover:brightness-90 hover:bg-primary hover:text-on-primary": isDayValid,
|
|
606
|
+
"text-disabled-text bg-disabled-background": !isDayValid
|
|
607
|
+
}
|
|
608
|
+
),
|
|
609
|
+
onClick: () => onChange(date),
|
|
610
|
+
children: date.getDate()
|
|
611
|
+
},
|
|
612
|
+
date.getDate()
|
|
613
|
+
);
|
|
614
|
+
}) }, index))
|
|
615
|
+
] });
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
// src/components/date/DatePicker.tsx
|
|
619
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
620
|
+
var defaultDatePickerTranslation = {
|
|
621
|
+
en: {
|
|
622
|
+
today: "Today"
|
|
623
|
+
},
|
|
624
|
+
de: {
|
|
625
|
+
today: "Heute"
|
|
626
|
+
}
|
|
627
|
+
};
|
|
628
|
+
var DatePicker = ({
|
|
629
|
+
overwriteTranslation,
|
|
630
|
+
value = /* @__PURE__ */ new Date(),
|
|
631
|
+
start = subtractDuration(/* @__PURE__ */ new Date(), { years: 50 }),
|
|
632
|
+
end = addDuration(/* @__PURE__ */ new Date(), { years: 50 }),
|
|
633
|
+
initialDisplay = "day",
|
|
634
|
+
onChange = noop,
|
|
635
|
+
yearMonthPickerProps,
|
|
636
|
+
dayPickerProps,
|
|
637
|
+
className = ""
|
|
638
|
+
}) => {
|
|
639
|
+
const locale = useLocale();
|
|
640
|
+
const translation = useTranslation(defaultDatePickerTranslation, overwriteTranslation);
|
|
641
|
+
const [displayedMonth, setDisplayedMonth] = (0, import_react7.useState)(value);
|
|
642
|
+
const [displayMode, setDisplayMode] = (0, import_react7.useState)(initialDisplay);
|
|
643
|
+
(0, import_react7.useEffect)(() => {
|
|
644
|
+
setDisplayedMonth(value);
|
|
645
|
+
}, [value]);
|
|
646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: (0, import_clsx6.default)("col gap-y-4", className), children: [
|
|
647
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "row items-center justify-between h-7", children: [
|
|
648
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
649
|
+
TextButton,
|
|
650
|
+
{
|
|
651
|
+
className: (0, import_clsx6.default)("row gap-x-1 items-center cursor-pointer select-none", {
|
|
652
|
+
"text-disabled-text": displayMode !== "day"
|
|
653
|
+
}),
|
|
654
|
+
onClick: () => setDisplayMode(displayMode === "day" ? "yearMonth" : "day"),
|
|
655
|
+
children: [
|
|
656
|
+
`${new Intl.DateTimeFormat(locale, { month: "long" }).format(displayedMonth)} ${displayedMonth.getFullYear()}`,
|
|
657
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react2.ChevronDown, { size: 16 })
|
|
658
|
+
]
|
|
659
|
+
}
|
|
660
|
+
),
|
|
661
|
+
displayMode === "day" && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "row justify-end", children: [
|
|
662
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
663
|
+
SolidButton,
|
|
664
|
+
{
|
|
665
|
+
size: "small",
|
|
666
|
+
color: "primary",
|
|
667
|
+
disabled: !isInTimeSpan(subtractDuration(displayedMonth, { months: 1 }), start, end),
|
|
668
|
+
onClick: () => {
|
|
669
|
+
setDisplayedMonth(subtractDuration(displayedMonth, { months: 1 }));
|
|
670
|
+
},
|
|
671
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react2.ArrowUp, { size: 20 })
|
|
672
|
+
}
|
|
673
|
+
),
|
|
674
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
675
|
+
SolidButton,
|
|
676
|
+
{
|
|
677
|
+
size: "small",
|
|
678
|
+
color: "primary",
|
|
679
|
+
disabled: !isInTimeSpan(addDuration(displayedMonth, { months: 1 }), start, end),
|
|
680
|
+
onClick: () => {
|
|
681
|
+
setDisplayedMonth(addDuration(displayedMonth, { months: 1 }));
|
|
682
|
+
},
|
|
683
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react2.ArrowDown, { size: 20 })
|
|
684
|
+
}
|
|
685
|
+
)
|
|
686
|
+
] })
|
|
687
|
+
] }),
|
|
688
|
+
displayMode === "yearMonth" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
689
|
+
YearMonthPicker,
|
|
690
|
+
{
|
|
691
|
+
...yearMonthPickerProps,
|
|
692
|
+
displayedYearMonth: value,
|
|
693
|
+
start,
|
|
694
|
+
end,
|
|
695
|
+
onChange: (newDate) => {
|
|
696
|
+
setDisplayedMonth(newDate);
|
|
697
|
+
setDisplayMode("day");
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
701
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
702
|
+
DayPicker,
|
|
703
|
+
{
|
|
704
|
+
...dayPickerProps,
|
|
705
|
+
displayedMonth,
|
|
706
|
+
start,
|
|
707
|
+
end,
|
|
708
|
+
selected: value,
|
|
709
|
+
onChange: (date) => {
|
|
710
|
+
onChange(date);
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
),
|
|
714
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
715
|
+
TextButton,
|
|
716
|
+
{
|
|
717
|
+
onClick: () => {
|
|
718
|
+
const newDate = /* @__PURE__ */ new Date();
|
|
719
|
+
newDate.setHours(value.getHours(), value.getMinutes());
|
|
720
|
+
onChange(newDate);
|
|
721
|
+
},
|
|
722
|
+
children: translation.today
|
|
723
|
+
}
|
|
724
|
+
) })
|
|
725
|
+
] })
|
|
726
|
+
] });
|
|
727
|
+
};
|
|
728
|
+
|
|
729
|
+
// src/components/user-input/DateAndTimePicker.tsx
|
|
730
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
731
|
+
var defaultTimeTranslation = {
|
|
732
|
+
en: {
|
|
733
|
+
clear: "Clear",
|
|
734
|
+
change: "Change",
|
|
735
|
+
year: "Year",
|
|
736
|
+
month: "Month",
|
|
737
|
+
day: "Day",
|
|
738
|
+
january: "January",
|
|
739
|
+
february: "Febuary",
|
|
740
|
+
march: "March",
|
|
741
|
+
april: "April",
|
|
742
|
+
may: "May",
|
|
743
|
+
june: "June",
|
|
744
|
+
july: "July",
|
|
745
|
+
august: "August",
|
|
746
|
+
september: "September",
|
|
747
|
+
october: "October",
|
|
748
|
+
november: "November",
|
|
749
|
+
december: "December"
|
|
750
|
+
},
|
|
751
|
+
de: {
|
|
752
|
+
clear: "Entfernen",
|
|
753
|
+
change: "\xC4ndern",
|
|
754
|
+
year: "Jahr",
|
|
755
|
+
month: "Monat",
|
|
756
|
+
day: "Tag",
|
|
757
|
+
january: "Januar",
|
|
758
|
+
february: "Febuar",
|
|
759
|
+
march: "M\xE4rz",
|
|
760
|
+
april: "April",
|
|
761
|
+
may: "Mai",
|
|
762
|
+
june: "Juni",
|
|
763
|
+
july: "Juli",
|
|
764
|
+
august: "August",
|
|
765
|
+
september: "September",
|
|
766
|
+
october: "October",
|
|
767
|
+
november: "November",
|
|
768
|
+
december: "December"
|
|
769
|
+
}
|
|
770
|
+
};
|
|
771
|
+
var DateTimePicker = ({
|
|
772
|
+
overwriteTranslation,
|
|
773
|
+
value = /* @__PURE__ */ new Date(),
|
|
774
|
+
start = subtractDuration(/* @__PURE__ */ new Date(), { years: 50 }),
|
|
775
|
+
end = addDuration(/* @__PURE__ */ new Date(), { years: 50 }),
|
|
776
|
+
mode = "dateTime",
|
|
777
|
+
onFinish = noop,
|
|
778
|
+
onChange = noop,
|
|
779
|
+
onRemove = noop,
|
|
780
|
+
timePickerProps,
|
|
781
|
+
datePickerProps
|
|
782
|
+
}) => {
|
|
783
|
+
const translation = useTranslation(defaultTimeTranslation, overwriteTranslation);
|
|
784
|
+
const useDate = mode === "dateTime" || mode === "date";
|
|
785
|
+
const useTime = mode === "dateTime" || mode === "time";
|
|
786
|
+
let dateDisplay;
|
|
787
|
+
let timeDisplay;
|
|
788
|
+
if (useDate) {
|
|
789
|
+
dateDisplay = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
790
|
+
DatePicker,
|
|
791
|
+
{
|
|
792
|
+
...datePickerProps,
|
|
793
|
+
className: "min-w-[320px] min-h-[250px]",
|
|
794
|
+
yearMonthPickerProps: { maxHeight: 218 },
|
|
795
|
+
value,
|
|
796
|
+
start,
|
|
797
|
+
end,
|
|
798
|
+
onChange
|
|
799
|
+
}
|
|
800
|
+
);
|
|
801
|
+
}
|
|
802
|
+
if (useTime) {
|
|
803
|
+
timeDisplay = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
804
|
+
TimePicker,
|
|
805
|
+
{
|
|
806
|
+
...timePickerProps,
|
|
807
|
+
className: (0, import_clsx7.default)("h-full", { "justify-between w-full": mode === "time" }),
|
|
808
|
+
maxHeight: 250,
|
|
809
|
+
time: value,
|
|
810
|
+
onChange
|
|
811
|
+
}
|
|
812
|
+
);
|
|
813
|
+
}
|
|
814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "col w-fit", children: [
|
|
815
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "row gap-x-4", children: [
|
|
816
|
+
dateDisplay,
|
|
817
|
+
timeDisplay
|
|
818
|
+
] }),
|
|
819
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "row justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "row gap-x-2 mt-1", children: [
|
|
820
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SolidButton, { size: "medium", color: "negative", onClick: onRemove, children: translation.clear }),
|
|
821
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
822
|
+
SolidButton,
|
|
823
|
+
{
|
|
824
|
+
size: "medium",
|
|
825
|
+
onClick: () => onFinish(value),
|
|
826
|
+
children: translation.change
|
|
827
|
+
}
|
|
828
|
+
)
|
|
829
|
+
] }) })
|
|
830
|
+
] });
|
|
65
831
|
};
|
|
832
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
833
|
+
0 && (module.exports = {
|
|
834
|
+
DateTimePicker
|
|
835
|
+
});
|
|
836
|
+
//# sourceMappingURL=DateAndTimePicker.js.map
|