@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,24 +1,407 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
description: 'Do you want to save your changes?'
|
|
12
|
-
},
|
|
13
|
-
de: {
|
|
14
|
-
save: 'Speichern',
|
|
15
|
-
cancel: 'Abbrechen',
|
|
16
|
-
dontSave: 'Nicht Speichern',
|
|
17
|
-
title: 'Ungespeicherte Änderungen',
|
|
18
|
-
description: 'Möchtest du die Änderungen speichern?'
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
export const DiscardChangesDialog = ({ overwriteTranslation, children, title, description, onCancel, onSave, onDontSave, ...modalProps }) => {
|
|
22
|
-
const translation = useTranslation(defaultDiscardChangesDialogTranslation, overwriteTranslation);
|
|
23
|
-
return (_jsxs(Modal, { title: title !== null && title !== void 0 ? title : translation.title, description: description !== null && description !== void 0 ? description : translation.description, ...modalProps, children: [children, _jsxs("div", { className: "row mt-3 gap-x-4 justify-end", children: [_jsx(SolidButton, { color: "positive", onClick: onSave, children: translation.save }), _jsx(SolidButton, { color: "negative", onClick: onDontSave, children: translation.dontSave }), _jsx(SolidButton, { autoFocus: true, color: "primary", onClick: onCancel, children: translation.cancel })] })] }));
|
|
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 });
|
|
24
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/modals/DiscardChangesDialog.tsx
|
|
31
|
+
var DiscardChangesDialog_exports = {};
|
|
32
|
+
__export(DiscardChangesDialog_exports, {
|
|
33
|
+
DiscardChangesDialog: () => DiscardChangesDialog
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(DiscardChangesDialog_exports);
|
|
36
|
+
|
|
37
|
+
// src/components/Button.tsx
|
|
38
|
+
var import_clsx = __toESM(require("clsx"));
|
|
39
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
40
|
+
var ButtonSizePaddings = {
|
|
41
|
+
small: "btn-sm",
|
|
42
|
+
medium: "btn-md",
|
|
43
|
+
large: "btn-lg"
|
|
44
|
+
};
|
|
45
|
+
var SolidButton = ({
|
|
46
|
+
children,
|
|
47
|
+
disabled = false,
|
|
48
|
+
color = "primary",
|
|
49
|
+
size = "medium",
|
|
50
|
+
startIcon,
|
|
51
|
+
endIcon,
|
|
52
|
+
onClick,
|
|
53
|
+
className,
|
|
54
|
+
...restProps
|
|
55
|
+
}) => {
|
|
56
|
+
const colorClasses = {
|
|
57
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
58
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
59
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
60
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
61
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
62
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text"
|
|
63
|
+
}[color];
|
|
64
|
+
const iconColorClasses = {
|
|
65
|
+
primary: "text-button-solid-primary-icon",
|
|
66
|
+
secondary: "text-button-solid-secondary-icon",
|
|
67
|
+
tertiary: "text-button-solid-tertiary-icon",
|
|
68
|
+
positive: "text-button-solid-positive-icon",
|
|
69
|
+
warning: "text-button-solid-warning-icon",
|
|
70
|
+
negative: "text-button-solid-negative-icon"
|
|
71
|
+
}[color];
|
|
72
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
73
|
+
"button",
|
|
74
|
+
{
|
|
75
|
+
onClick: disabled ? void 0 : onClick,
|
|
76
|
+
disabled: disabled || onClick === void 0,
|
|
77
|
+
className: (0, import_clsx.default)(
|
|
78
|
+
className,
|
|
79
|
+
{
|
|
80
|
+
"text-disabled-text bg-disabled-background": disabled,
|
|
81
|
+
[(0, import_clsx.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
82
|
+
},
|
|
83
|
+
ButtonSizePaddings[size]
|
|
84
|
+
),
|
|
85
|
+
...restProps,
|
|
86
|
+
children: [
|
|
87
|
+
startIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
88
|
+
"span",
|
|
89
|
+
{
|
|
90
|
+
className: (0, import_clsx.default)({
|
|
91
|
+
[iconColorClasses]: !disabled,
|
|
92
|
+
[`text-disabled-icon`]: disabled
|
|
93
|
+
}),
|
|
94
|
+
children: startIcon
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
children,
|
|
98
|
+
endIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
99
|
+
"span",
|
|
100
|
+
{
|
|
101
|
+
className: (0, import_clsx.default)({
|
|
102
|
+
[iconColorClasses]: !disabled,
|
|
103
|
+
[`text-disabled-icon`]: disabled
|
|
104
|
+
}),
|
|
105
|
+
children: endIcon
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
// src/hooks/useLanguage.tsx
|
|
114
|
+
var import_react2 = require("react");
|
|
115
|
+
|
|
116
|
+
// src/hooks/useLocalStorage.tsx
|
|
117
|
+
var import_react = require("react");
|
|
118
|
+
|
|
119
|
+
// src/hooks/useLanguage.tsx
|
|
120
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
121
|
+
var DEFAULT_LANGUAGE = "en";
|
|
122
|
+
var LanguageContext = (0, import_react2.createContext)({ language: DEFAULT_LANGUAGE, setLanguage: (v) => v });
|
|
123
|
+
var useLanguage = () => (0, import_react2.useContext)(LanguageContext);
|
|
124
|
+
|
|
125
|
+
// src/hooks/useTranslation.ts
|
|
126
|
+
var useTranslation = (defaults, translationOverwrite = {}) => {
|
|
127
|
+
const { language: languageProp, translation: overwrite } = translationOverwrite;
|
|
128
|
+
const { language: inferredLanguage } = useLanguage();
|
|
129
|
+
const usedLanguage = languageProp ?? inferredLanguage;
|
|
130
|
+
let defaultValues = defaults[usedLanguage];
|
|
131
|
+
if (overwrite && overwrite[usedLanguage]) {
|
|
132
|
+
defaultValues = { ...defaultValues, ...overwrite[usedLanguage] };
|
|
133
|
+
}
|
|
134
|
+
return defaultValues;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
// src/components/modals/Modal.tsx
|
|
138
|
+
var import_react5 = require("react");
|
|
139
|
+
var import_react_dom = __toESM(require("react-dom"));
|
|
140
|
+
var import_lucide_react = require("lucide-react");
|
|
141
|
+
var import_clsx3 = __toESM(require("clsx"));
|
|
142
|
+
|
|
143
|
+
// src/hooks/useHoverState.ts
|
|
144
|
+
var import_react3 = require("react");
|
|
145
|
+
var defaultUseHoverStateProps = {
|
|
146
|
+
closingDelay: 200,
|
|
147
|
+
isDisabled: false
|
|
148
|
+
};
|
|
149
|
+
var useHoverState = (props = void 0) => {
|
|
150
|
+
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
151
|
+
const [isHovered, setIsHovered] = (0, import_react3.useState)(false);
|
|
152
|
+
const [timer, setTimer] = (0, import_react3.useState)();
|
|
153
|
+
const onMouseEnter = () => {
|
|
154
|
+
if (isDisabled) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
clearTimeout(timer);
|
|
158
|
+
setIsHovered(true);
|
|
159
|
+
};
|
|
160
|
+
const onMouseLeave = () => {
|
|
161
|
+
if (isDisabled) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
setTimer(setTimeout(() => {
|
|
165
|
+
setIsHovered(false);
|
|
166
|
+
}, closingDelay));
|
|
167
|
+
};
|
|
168
|
+
(0, import_react3.useEffect)(() => {
|
|
169
|
+
if (timer) {
|
|
170
|
+
return () => {
|
|
171
|
+
clearTimeout(timer);
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
(0, import_react3.useEffect)(() => {
|
|
176
|
+
if (timer) {
|
|
177
|
+
clearTimeout(timer);
|
|
178
|
+
}
|
|
179
|
+
}, [isDisabled]);
|
|
180
|
+
return {
|
|
181
|
+
isHovered,
|
|
182
|
+
setIsHovered,
|
|
183
|
+
handlers: { onMouseEnter, onMouseLeave }
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
// src/components/Tooltip.tsx
|
|
188
|
+
var import_clsx2 = require("clsx");
|
|
189
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
190
|
+
var Tooltip = ({
|
|
191
|
+
tooltip,
|
|
192
|
+
children,
|
|
193
|
+
animationDelay = 650,
|
|
194
|
+
tooltipClassName = "",
|
|
195
|
+
containerClassName = "",
|
|
196
|
+
position = "bottom",
|
|
197
|
+
zIndex = 10
|
|
198
|
+
}) => {
|
|
199
|
+
const { isHovered, handlers } = useHoverState();
|
|
200
|
+
const positionClasses = {
|
|
201
|
+
top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,
|
|
202
|
+
bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,
|
|
203
|
+
left: `right-full top-1/2 -translate-y-1/2 mr-[6px]`,
|
|
204
|
+
right: `left-full top-1/2 -translate-y-1/2 ml-[6px]`
|
|
205
|
+
};
|
|
206
|
+
const triangleSize = 6;
|
|
207
|
+
const triangleClasses = {
|
|
208
|
+
top: `top-full left-1/2 -translate-x-1/2 border-t-gray-600 border-l-transparent border-r-transparent`,
|
|
209
|
+
bottom: `bottom-full left-1/2 -translate-x-1/2 border-b-gray-600 border-l-transparent border-r-transparent`,
|
|
210
|
+
left: `left-full top-1/2 -translate-y-1/2 border-l-gray-600 border-t-transparent border-b-transparent`,
|
|
211
|
+
right: `right-full top-1/2 -translate-y-1/2 border-r-gray-600 border-t-transparent border-b-transparent`
|
|
212
|
+
};
|
|
213
|
+
const triangleStyle = {
|
|
214
|
+
top: { borderWidth: `${triangleSize}px ${triangleSize}px 0 ${triangleSize}px` },
|
|
215
|
+
bottom: { borderWidth: `0 ${triangleSize}px ${triangleSize}px ${triangleSize}px` },
|
|
216
|
+
left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
|
|
217
|
+
right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
|
|
218
|
+
};
|
|
219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
220
|
+
"div",
|
|
221
|
+
{
|
|
222
|
+
className: (0, import_clsx2.clsx)("relative inline-block", containerClassName),
|
|
223
|
+
...handlers,
|
|
224
|
+
children: [
|
|
225
|
+
children,
|
|
226
|
+
isHovered && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
227
|
+
"div",
|
|
228
|
+
{
|
|
229
|
+
className: (0, import_clsx2.clsx)(`opacity-0 absolute text-black text-xs font-semibold text-gray-600 px-2 py-1 rounded whitespace-nowrap border-2 border-gray-600
|
|
230
|
+
animate-tooltip-fade-in shadow-lg bg-gray-100`, positionClasses[position], tooltipClassName),
|
|
231
|
+
style: { zIndex, animationDelay: animationDelay + "ms" },
|
|
232
|
+
children: [
|
|
233
|
+
tooltip,
|
|
234
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
235
|
+
"div",
|
|
236
|
+
{
|
|
237
|
+
className: (0, import_clsx2.clsx)(`absolute w-0 h-0`, triangleClasses[position]),
|
|
238
|
+
style: { ...triangleStyle[position], zIndex }
|
|
239
|
+
}
|
|
240
|
+
)
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
)
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
);
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
// src/components/modals/ModalRegister.tsx
|
|
250
|
+
var import_react4 = require("react");
|
|
251
|
+
|
|
252
|
+
// src/util/noop.ts
|
|
253
|
+
var noop = () => void 0;
|
|
254
|
+
|
|
255
|
+
// src/components/modals/ModalRegister.tsx
|
|
256
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
257
|
+
var ModalContext = (0, import_react4.createContext)({
|
|
258
|
+
register: [],
|
|
259
|
+
addToRegister: noop,
|
|
260
|
+
removeFromRegister: noop
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
// src/components/modals/Modal.tsx
|
|
264
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
265
|
+
var defaultModalHeaderTranslation = {
|
|
266
|
+
en: {
|
|
267
|
+
close: "Close"
|
|
268
|
+
},
|
|
269
|
+
de: {
|
|
270
|
+
close: "Schlie\xDFen"
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
var ModalHeader = ({
|
|
274
|
+
overwriteTranslation,
|
|
275
|
+
onCloseClick,
|
|
276
|
+
title,
|
|
277
|
+
titleText = "",
|
|
278
|
+
description,
|
|
279
|
+
descriptionText = ""
|
|
280
|
+
}) => {
|
|
281
|
+
const translation = useTranslation(defaultModalHeaderTranslation, overwriteTranslation);
|
|
282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "col", children: [
|
|
283
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "row justify-between items-start gap-x-8", children: [
|
|
284
|
+
title ?? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: (0, import_clsx3.default)("textstyle-title-lg", {
|
|
285
|
+
"mb-1": description || descriptionText
|
|
286
|
+
}), children: titleText }),
|
|
287
|
+
!!onCloseClick && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Tooltip, { tooltip: translation.close, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { className: "row bg-gray-200 hover:bg-gray-300 rounded-md p-1", onClick: onCloseClick, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.X, {}) }) })
|
|
288
|
+
] }),
|
|
289
|
+
description ?? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "textstyle-description", children: descriptionText })
|
|
290
|
+
] });
|
|
291
|
+
};
|
|
292
|
+
var modalRootName = "modal-root";
|
|
293
|
+
var Modal = ({
|
|
294
|
+
children,
|
|
295
|
+
id,
|
|
296
|
+
isOpen,
|
|
297
|
+
onBackgroundClick,
|
|
298
|
+
backgroundClassName = "",
|
|
299
|
+
modalClassName = "",
|
|
300
|
+
containerClassName = "",
|
|
301
|
+
...modalHeaderProps
|
|
302
|
+
}) => {
|
|
303
|
+
const modalRoot = typeof window !== "undefined" ? document.getElementById(modalRootName) : null;
|
|
304
|
+
const {
|
|
305
|
+
register,
|
|
306
|
+
addToRegister,
|
|
307
|
+
removeFromRegister
|
|
308
|
+
} = (0, import_react5.useContext)(ModalContext);
|
|
309
|
+
if (!id) {
|
|
310
|
+
console.error("the id cannot be empty");
|
|
311
|
+
}
|
|
312
|
+
(0, import_react5.useEffect)(() => {
|
|
313
|
+
if (isOpen) {
|
|
314
|
+
addToRegister(id);
|
|
315
|
+
} else {
|
|
316
|
+
removeFromRegister(id);
|
|
317
|
+
}
|
|
318
|
+
}, [addToRegister, id, removeFromRegister, isOpen]);
|
|
319
|
+
if (modalRoot === null || !isOpen) return null;
|
|
320
|
+
const isLast = register.length < 1 || register[register.length - 1] === id;
|
|
321
|
+
const isSecondLast = register.length < 2 || register[register.length - 2] === id;
|
|
322
|
+
return import_react_dom.default.createPortal(
|
|
323
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_clsx3.default)("fixed inset-0 overflow-y-auto z-[99]", containerClassName), id, children: [
|
|
324
|
+
isLast && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
325
|
+
"div",
|
|
326
|
+
{
|
|
327
|
+
className: (0, import_clsx3.default)("fixed inset-0 h-screen w-screen", backgroundClassName, {
|
|
328
|
+
"bg-black/70": isLast && register.length === 1
|
|
329
|
+
}),
|
|
330
|
+
onClick: onBackgroundClick
|
|
331
|
+
}
|
|
332
|
+
),
|
|
333
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
334
|
+
"div",
|
|
335
|
+
{
|
|
336
|
+
className: (0, import_clsx3.default)("fixed left-1/2 top-1/2 -translate-y-1/2 -translate-x-1/2 col p-4 bg-white text-black rounded-xl shadow-xl", modalClassName),
|
|
337
|
+
children: [
|
|
338
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ModalHeader, { ...modalHeaderProps }),
|
|
339
|
+
children
|
|
340
|
+
]
|
|
341
|
+
}
|
|
342
|
+
),
|
|
343
|
+
!isLast && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
344
|
+
"div",
|
|
345
|
+
{
|
|
346
|
+
className: (0, import_clsx3.default)("fixed inset-0 h-screen w-screen", backgroundClassName, {
|
|
347
|
+
"bg-black/70": isSecondLast && register.length > 1
|
|
348
|
+
})
|
|
349
|
+
}
|
|
350
|
+
)
|
|
351
|
+
] }),
|
|
352
|
+
modalRoot,
|
|
353
|
+
id
|
|
354
|
+
);
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
// src/components/modals/DiscardChangesDialog.tsx
|
|
358
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
359
|
+
var defaultDiscardChangesDialogTranslation = {
|
|
360
|
+
en: {
|
|
361
|
+
save: "Save",
|
|
362
|
+
cancel: "Cancel",
|
|
363
|
+
dontSave: "Don't save",
|
|
364
|
+
title: "Unsaved Changes",
|
|
365
|
+
description: "Do you want to save your changes?"
|
|
366
|
+
},
|
|
367
|
+
de: {
|
|
368
|
+
save: "Speichern",
|
|
369
|
+
cancel: "Abbrechen",
|
|
370
|
+
dontSave: "Nicht Speichern",
|
|
371
|
+
title: "Ungespeicherte \xC4nderungen",
|
|
372
|
+
description: "M\xF6chtest du die \xC4nderungen speichern?"
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
var DiscardChangesDialog = ({
|
|
376
|
+
overwriteTranslation,
|
|
377
|
+
children,
|
|
378
|
+
title,
|
|
379
|
+
description,
|
|
380
|
+
onCancel,
|
|
381
|
+
onSave,
|
|
382
|
+
onDontSave,
|
|
383
|
+
...modalProps
|
|
384
|
+
}) => {
|
|
385
|
+
const translation = useTranslation(defaultDiscardChangesDialogTranslation, overwriteTranslation);
|
|
386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
387
|
+
Modal,
|
|
388
|
+
{
|
|
389
|
+
title: title ?? translation.title,
|
|
390
|
+
description: description ?? translation.description,
|
|
391
|
+
...modalProps,
|
|
392
|
+
children: [
|
|
393
|
+
children,
|
|
394
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "row mt-3 gap-x-4 justify-end", children: [
|
|
395
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SolidButton, { color: "positive", onClick: onSave, children: translation.save }),
|
|
396
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SolidButton, { color: "negative", onClick: onDontSave, children: translation.dontSave }),
|
|
397
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SolidButton, { autoFocus: true, color: "primary", onClick: onCancel, children: translation.cancel })
|
|
398
|
+
] })
|
|
399
|
+
]
|
|
400
|
+
}
|
|
401
|
+
);
|
|
402
|
+
};
|
|
403
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
404
|
+
0 && (module.exports = {
|
|
405
|
+
DiscardChangesDialog
|
|
406
|
+
});
|
|
407
|
+
//# sourceMappingURL=DiscardChangesDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/modals/DiscardChangesDialog.tsx","../../../src/components/Button.tsx","../../../src/hooks/useLanguage.tsx","../../../src/hooks/useLocalStorage.tsx","../../../src/hooks/useTranslation.ts","../../../src/components/modals/Modal.tsx","../../../src/hooks/useHoverState.ts","../../../src/components/Tooltip.tsx","../../../src/components/modals/ModalRegister.tsx","../../../src/util/noop.ts"],"sourcesContent":["import type { PropsWithChildren } from 'react'\nimport { SolidButton } from '../Button'\nimport type { PropsForTranslation } from '../../hooks/useTranslation'\nimport { useTranslation } from '../../hooks/useTranslation'\nimport { Modal, type ModalProps } from './Modal'\n\ntype DiscardChangesDialogTranslation = {\n save: string,\n cancel: string,\n dontSave: string,\n title: string,\n description: string,\n}\n\nconst defaultDiscardChangesDialogTranslation = {\n en: {\n save: 'Save',\n cancel: 'Cancel',\n dontSave: 'Don\\'t save',\n title: 'Unsaved Changes',\n description: 'Do you want to save your changes?'\n },\n de: {\n save: 'Speichern',\n cancel: 'Abbrechen',\n dontSave: 'Nicht Speichern',\n title: 'Ungespeicherte Änderungen',\n description: 'Möchtest du die Änderungen speichern?'\n }\n}\n\ntype DiscardChangesDialogProps = ModalProps & {\n isShowingDecline?: boolean,\n requireAnswer?: boolean,\n onCancel: () => void,\n onSave: () => void,\n onDontSave: () => void,\n}\n\nexport const DiscardChangesDialog = ({\n overwriteTranslation,\n children,\n title,\n description,\n onCancel,\n onSave,\n onDontSave,\n ...modalProps\n}: PropsForTranslation<DiscardChangesDialogTranslation, PropsWithChildren<DiscardChangesDialogProps>>) => {\n const translation = useTranslation(defaultDiscardChangesDialogTranslation, overwriteTranslation)\n return (\n <Modal\n title={title ?? translation.title}\n description={description ?? translation.description}\n {...modalProps}\n >\n {children}\n <div className=\"row mt-3 gap-x-4 justify-end\">\n <SolidButton color=\"positive\" onClick={onSave}>\n {translation.save}\n </SolidButton>\n <SolidButton color=\"negative\" onClick={onDontSave}>\n {translation.dontSave}\n </SolidButton>\n <SolidButton autoFocus color=\"primary\" onClick={onCancel}>\n {translation.cancel}\n </SolidButton>\n </div>\n </Modal>\n )\n}\n","import type { PropsWithChildren, ButtonHTMLAttributes, ReactNode } from 'react'\nimport clsx from 'clsx'\n\nexport type SolidButtonColor = 'primary' | 'secondary' | 'tertiary' | 'positive' | 'warning'| 'negative'\nexport type OutlineButtonColor = 'primary'\nexport type TextButtonColor = 'negative' | 'neutral'\n\ntype ButtonSizes = 'small' | 'medium' | 'large'\n\n/**\n * The shard properties between all button types\n */\nexport type ButtonProps = PropsWithChildren<{\n /**\n * @default 'medium'\n */\n size?: ButtonSizes,\n}> & ButtonHTMLAttributes<Element>\n\nexport const ButtonSizePaddings: Record<ButtonSizes, string> = {\n small: 'btn-sm',\n medium: 'btn-md',\n large: 'btn-lg'\n}\n\ntype ButtonWithIconsProps = ButtonProps & {\n startIcon?: ReactNode,\n endIcon?: ReactNode,\n}\n\nexport type SolidButtonProps = ButtonWithIconsProps & {\n color?: SolidButtonColor,\n}\n\nexport type OutlineButtonProps = ButtonWithIconsProps & {\n color?: OutlineButtonColor,\n}\n\nexport type TextButtonProps = ButtonWithIconsProps & {\n color?: TextButtonColor,\n}\n\n/**\n * A button with a solid background and different sizes\n */\nconst SolidButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: SolidButtonProps) => {\n const colorClasses = {\n primary: 'bg-button-solid-primary-background text-button-solid-primary-text',\n secondary: 'bg-button-solid-secondary-background text-button-solid-secondary-text',\n tertiary: 'bg-button-solid-tertiary-background text-button-solid-tertiary-text',\n positive: 'bg-button-solid-positive-background text-button-solid-positive-text',\n warning: 'bg-button-solid-warning-background text-button-solid-warning-text',\n negative: 'bg-button-solid-negative-background text-button-solid-negative-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-solid-primary-icon',\n secondary: 'text-button-solid-secondary-icon',\n tertiary: 'text-button-solid-tertiary-icon',\n positive: 'text-button-solid-positive-icon',\n warning: 'text-button-solid-warning-icon',\n negative: 'text-button-solid-negative-icon',\n }[color]\n\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n className,\n {\n 'text-disabled-text bg-disabled-background': disabled,\n [clsx(colorClasses, 'hover:brightness-90')]: !disabled\n },\n ButtonSizePaddings[size]\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n/**\n * A button with an outline border and different sizes\n */\nconst OutlineButton = ({\n children,\n disabled = false,\n color = 'primary',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: OutlineButtonProps) => {\n const colorClasses = {\n primary: 'bg-transparent border-2 border-button-outline-primary-text text-button-outline-primary-text',\n }[color]\n\n const iconColorClasses = {\n primary: 'text-button-outline-primary-icon',\n }[color]\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n className, {\n 'text-disabled-text border-disabled-outline)': disabled,\n [clsx(colorClasses, 'hover:brightness-80')]: !disabled,\n },\n ButtonSizePaddings[size]\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n/**\n * A text that is a button that can have different sizes\n */\nconst TextButton = ({\n children,\n disabled = false,\n color = 'neutral',\n size = 'medium',\n startIcon,\n endIcon,\n onClick,\n className,\n ...restProps\n }: TextButtonProps) => {\n const colorClasses = {\n negative: 'bg-transparent text-button-text-negative-text',\n neutral: 'bg-transparent text-button-text-neutral-text',\n }[color]\n\n const iconColorClasses = {\n negative: 'text-button-text-negative-icon',\n neutral: 'text-button-text-neutral-icon',\n }[color]\n return (\n <button\n onClick={disabled ? undefined : onClick}\n disabled={disabled || onClick === undefined}\n className={clsx(\n className, {\n 'text-disabled-text': disabled,\n [clsx(colorClasses, 'hover:bg-button-text-hover-background rounded-full')]: !disabled,\n },\n ButtonSizePaddings[size]\n )}\n {...restProps}\n >\n {startIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span\n className={clsx({\n [iconColorClasses]: !disabled,\n [`text-disabled-icon`]: disabled\n })}\n >\n {endIcon}\n </span>\n )}\n </button>\n )\n}\n\n// TODO Icon button\n\nexport { SolidButton, OutlineButton, TextButton }\n","import type { Dispatch, PropsWithChildren, SetStateAction } from 'react'\nimport { createContext, useContext, useEffect, useState } from 'react'\nimport useLocalStorage from './useLocalStorage'\n\nexport const languages = ['en', 'de'] as const\nexport type Languages = typeof languages[number]\nexport const languagesLocalNames: Record<Languages, string> = {\n en: 'English',\n de: 'Deutsch',\n}\n\nexport const DEFAULT_LANGUAGE = 'en'\n\nexport type LanguageContextValue = {\n language: Languages,\n setLanguage: Dispatch<SetStateAction<Languages>>,\n}\n\nexport const LanguageContext = createContext<LanguageContextValue>({ language: DEFAULT_LANGUAGE, setLanguage: (v) => v })\n\nexport const useLanguage = () => useContext(LanguageContext)\n\nexport const useLocale = (overWriteLanguage?: Languages) => {\n const { language } = useLanguage()\n const mapping: Record<Languages, string> = {\n en: 'en-US',\n de: 'de-DE'\n }\n return mapping[overWriteLanguage ?? language]\n}\n\ntype ProvideLanguageProps = {\n initialLanguage?: Languages,\n}\n\nexport const ProvideLanguage = ({ initialLanguage, children }: PropsWithChildren<ProvideLanguageProps>) => {\n const [language, setLanguage] = useState<Languages>(initialLanguage ?? DEFAULT_LANGUAGE)\n const [storedLanguage, setStoredLanguage] = useLocalStorage<Languages>('language', initialLanguage ?? DEFAULT_LANGUAGE)\n\n useEffect(() => {\n if(language !== initialLanguage && initialLanguage){\n console.warn('LanguageProvider initial state changed: Prefer using useLanguages\\'s setLanguage instead')\n setLanguage(initialLanguage)\n }\n }, [initialLanguage]) // eslint-disable-line react-hooks/exhaustive-deps\n\n useEffect(() => {\n // TODO set locale of html tag here as well\n setStoredLanguage(language)\n }, [language, setStoredLanguage])\n\n useEffect(() => {\n if (storedLanguage !== null) {\n setLanguage(storedLanguage)\n return\n }\n\n const languagesToTestAgainst = Object.values(languages)\n\n const matchingBrowserLanguages = window.navigator.languages\n .map(language => languagesToTestAgainst.find((test) => language === test || language.split('-')[0] === test))\n .filter(entry => entry !== undefined)\n\n if (matchingBrowserLanguages.length === 0) return\n\n const firstMatch = matchingBrowserLanguages[0] as Languages\n setLanguage(firstMatch)\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n <LanguageContext.Provider value={{\n language,\n setLanguage\n }}>\n {children}\n </LanguageContext.Provider>\n )\n}\n","import type { Dispatch, SetStateAction } from 'react'\nimport { useCallback, useEffect, useState } from 'react'\nimport { LocalStorageService } from '../util/storage'\n\ntype SetValue<T> = Dispatch<SetStateAction<T>>\nconst useLocalStorage = <T, >(key: string, initValue: T): [T, SetValue<T>] => {\n const get = useCallback((): T => {\n if (typeof window === 'undefined') {\n return initValue\n }\n const storageService = new LocalStorageService()\n const value = storageService.get<T>(key)\n return value || initValue\n }, [initValue, key])\n\n const [storedValue, setStoredValue] = useState<T>(get)\n\n const setValue: SetValue<T> = useCallback(value => {\n const newValue = value instanceof Function ? value(storedValue) : value\n const storageService = new LocalStorageService()\n storageService.set(key, value)\n\n setStoredValue(newValue)\n }, [storedValue, setStoredValue, key])\n\n useEffect(() => {\n setStoredValue(get())\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n return [storedValue, setValue]\n}\n\nexport default useLocalStorage\n","import type { Languages } from './useLanguage'\nimport { useLanguage } from './useLanguage'\n\nexport type Translation<T> = Record<Languages, T>\n\ntype OverwriteTranslationType<Translation extends Record<string, unknown>> = {\n language?: Languages,\n translation?: Partial<Record<Languages, Partial<Translation>>>,\n}\n\n/**\n * Adds the `language` prop to the component props.\n *\n * @param Translation the type of the translation object\n *\n * @param Props the type of the component props, defaults to `Record<string, never>`,\n * if you don't expect any other props other than `language` and get an\n * error when using your component (because it uses `forwardRef` etc.)\n * you can try out `Record<string, unknown>`, this might resolve your\n * problem as `SomeType & never` is still `never` but `SomeType & unknown`\n * is `SomeType` which means that adding back props (like `ref` etc.)\n * works properly\n */\nexport type PropsForTranslation<\n Translation extends Record<string, unknown>,\n Props = Record<string, never>\n> = Props & {\n overwriteTranslation?: OverwriteTranslationType<Translation>,\n};\n\nexport const useTranslation = <Translation extends Record<string, unknown>>(\n defaults: Record<Languages, Translation>,\n translationOverwrite: OverwriteTranslationType<Translation> = {}\n) : Translation => {\n const { language: languageProp, translation: overwrite } = translationOverwrite\n const { language: inferredLanguage } = useLanguage()\n const usedLanguage = languageProp ?? inferredLanguage\n let defaultValues: Translation = defaults[usedLanguage]\n if (overwrite && overwrite[usedLanguage]) {\n defaultValues = { ...defaultValues, ...overwrite[usedLanguage] }\n }\n return defaultValues\n}\n","import { useContext, useEffect, type MouseEventHandler, type PropsWithChildren, type ReactNode } from 'react'\nimport ReactDOM from 'react-dom'\nimport { X } from 'lucide-react'\nimport clsx from 'clsx'\nimport type { Languages } from '../../hooks/useLanguage'\nimport type { PropsForTranslation } from '../../hooks/useTranslation'\nimport { useTranslation } from '../../hooks/useTranslation'\nimport { Tooltip } from '../Tooltip'\nimport { ModalContext } from './ModalRegister'\n\ntype ModalHeaderTranslation = {\n close: string,\n}\n\nconst defaultModalHeaderTranslation: Record<Languages, ModalHeaderTranslation> = {\n en: {\n close: 'Close'\n },\n de: {\n close: 'Schließen'\n }\n}\n\nexport type ModalHeaderProps = {\n onCloseClick?: () => void,\n /** The title of the Modal. If you want to only set the text use `titleText` instead */\n title?: ReactNode,\n /** The title text of the Modal. If you want to set a custom title use `title` instead */\n titleText?: string,\n /** The description of the Modal. If you want to only set the text use `descriptionText` instead */\n description?: ReactNode,\n /** The description text of the Modal. If you want to set a custom description use `description` instead */\n descriptionText?: string,\n}\n\n/**\n * A default Header to be used by modals to have a uniform design\n */\nexport const ModalHeader = ({\n overwriteTranslation,\n onCloseClick,\n title,\n titleText = '',\n description,\n descriptionText = ''\n }: PropsForTranslation<ModalHeaderTranslation, ModalHeaderProps>) => {\n const translation = useTranslation(defaultModalHeaderTranslation, overwriteTranslation)\n return (\n <div className=\"col\">\n <div className=\"row justify-between items-start gap-x-8\">\n {title ?? (\n <span className={clsx('textstyle-title-lg', {\n 'mb-1': description || descriptionText,\n })}>\n {titleText}\n </span>\n )}\n {!!onCloseClick && (\n <Tooltip tooltip={translation.close}>\n <button className=\"row bg-gray-200 hover:bg-gray-300 rounded-md p-1\" onClick={onCloseClick}>\n <X/>\n </button>\n </Tooltip>\n )}\n </div>\n {description ?? (<span className=\"textstyle-description\">{descriptionText}</span>)}\n </div>\n )\n}\n\nexport const modalRootName = 'modal-root'\n\nexport type ModalProps = {\n id: string,\n isOpen: boolean,\n onBackgroundClick?: MouseEventHandler<HTMLDivElement>,\n backgroundClassName?: string,\n modalClassName?: string,\n containerClassName?: string,\n} & ModalHeaderProps\n\n/**\n * A Generic Modal Window\n *\n * The state needs to be managed by the parent of this component\n *\n * DO NOT Conditionally render this always use the isOpen to ensure that the ModalRegister is working properly\n */\nexport const Modal = ({\n children,\n id,\n isOpen,\n onBackgroundClick,\n backgroundClassName = '',\n modalClassName = '',\n containerClassName = '',\n ...modalHeaderProps\n }: PropsWithChildren<ModalProps>) => {\n const modalRoot = typeof window !== 'undefined' ? document.getElementById(modalRootName) : null\n const {\n register,\n addToRegister,\n removeFromRegister\n } = useContext(ModalContext)\n\n if (!id) {\n console.error('the id cannot be empty')\n }\n\n useEffect(() => {\n if (isOpen) {\n addToRegister(id)\n } else {\n removeFromRegister(id)\n }\n }, [addToRegister, id, removeFromRegister, isOpen])\n\n if (modalRoot === null || !isOpen) return null\n\n const isLast = register.length < 1 || register[register.length - 1] === id\n const isSecondLast = register.length < 2 || register[register.length - 2] === id\n\n return ReactDOM.createPortal(\n <div className={clsx('fixed inset-0 overflow-y-auto z-[99]', containerClassName)} id={id}>\n {isLast && (\n <div\n className={clsx('fixed inset-0 h-screen w-screen', backgroundClassName, {\n 'bg-black/70': isLast && register.length === 1,\n })}\n onClick={onBackgroundClick}\n />\n )}\n <div\n className={clsx('fixed left-1/2 top-1/2 -translate-y-1/2 -translate-x-1/2 col p-4 bg-white text-black rounded-xl shadow-xl', modalClassName)}>\n <ModalHeader {...modalHeaderProps} />\n {children}\n </div>\n {!isLast && (\n <div\n className={clsx('fixed inset-0 h-screen w-screen', backgroundClassName, {\n 'bg-black/70': isSecondLast && register.length > 1,\n })}\n />\n )}\n </div>,\n modalRoot,\n id\n )\n}\n","import type { Dispatch, SetStateAction } from 'react'\nimport { useEffect, useState } from 'react'\n\ntype UseHoverStateProps = {\n /**\n * The delay after which the menu is closed in milliseconds\n *\n * default: 200ms\n */\n closingDelay: number,\n /**\n * Whether the hover state management should be disabled\n *\n * default: false\n */\n isDisabled: boolean,\n}\n\ntype UseHoverStateReturnType = {\n /**\n * Whether the element is hovered\n */\n isHovered: boolean,\n /**\n * Function to change the current hover status\n */\n setIsHovered: Dispatch<SetStateAction<boolean>>,\n /**\n * Handlers to pass on to the component that should be hovered\n */\n handlers: {\n onMouseEnter: () => void,\n onMouseLeave: () => void,\n },\n}\n\nconst defaultUseHoverStateProps: UseHoverStateProps = {\n closingDelay: 200,\n isDisabled: false,\n}\n\n/**\n * @param props See UseHoverStateProps\n *\n * A react hook for managing the hover state of a component. The handlers provided should be\n * forwarded to the component which should be hovered over\n */\nexport const useHoverState = (props: Partial<UseHoverStateProps> | undefined = undefined): UseHoverStateReturnType => {\n const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props }\n\n const [isHovered, setIsHovered] = useState(false)\n const [timer, setTimer] = useState<NodeJS.Timeout>()\n\n const onMouseEnter = () => {\n if (isDisabled) {\n return\n }\n clearTimeout(timer)\n setIsHovered(true)\n }\n\n const onMouseLeave = () => {\n if (isDisabled) {\n return\n }\n setTimer(setTimeout(() => {\n setIsHovered(false)\n }, closingDelay))\n }\n\n useEffect(() => {\n if (timer) {\n return () => {\n clearTimeout(timer)\n }\n }\n })\n\n useEffect(() => {\n if (timer) {\n clearTimeout(timer)\n }\n }, [isDisabled]) // eslint-disable-line react-hooks/exhaustive-deps\n\n return {\n isHovered, setIsHovered, handlers: { onMouseEnter, onMouseLeave }\n }\n}\n","import type { CSSProperties, PropsWithChildren, ReactNode } from 'react'\nimport { useHoverState } from '../hooks/useHoverState'\nimport { clsx } from 'clsx'\n\ntype Position = 'top' | 'bottom' | 'left' | 'right'\n\nexport type TooltipProps = PropsWithChildren<{\n tooltip: string | ReactNode,\n /**\n * Number of milliseconds until the tooltip appears\n *\n * defaults to 1000ms\n */\n animationDelay?: number,\n /**\n * Class names of additional styling properties for the tooltip\n */\n tooltipClassName?: string,\n /**\n * Class names of additional styling properties for the container from which the tooltip will be created\n */\n containerClassName?: string,\n position?: Position,\n zIndex?: number,\n}>\n\n/**\n * A Component for showing a tooltip when hovering over Content\n * @param tooltip The tooltip to show can be a text or any ReactNode\n * @param children The Content for which the tooltip should be created\n * @param animationDelay The delay before the tooltip appears\n * @param tooltipClassName Additional ClassNames for the Container of the tooltip\n * @param containerClassName Additional ClassNames for the Container holding the content\n * @param position The direction of the tooltip relative to the Container\n * @param zIndex The z Index of the tooltip (you may require this when stacking modals)\n * @constructor\n */\nexport const Tooltip = ({\n tooltip,\n children,\n animationDelay = 650,\n tooltipClassName = '',\n containerClassName = '',\n position = 'bottom',\n zIndex = 10,\n }: TooltipProps) => {\n const { isHovered, handlers } = useHoverState()\n\n const positionClasses = {\n top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,\n bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,\n left: `right-full top-1/2 -translate-y-1/2 mr-[6px]`,\n right: `left-full top-1/2 -translate-y-1/2 ml-[6px]`\n }\n\n const triangleSize = 6\n const triangleClasses = {\n top: `top-full left-1/2 -translate-x-1/2 border-t-gray-600 border-l-transparent border-r-transparent`,\n bottom: `bottom-full left-1/2 -translate-x-1/2 border-b-gray-600 border-l-transparent border-r-transparent`,\n left: `left-full top-1/2 -translate-y-1/2 border-l-gray-600 border-t-transparent border-b-transparent`,\n right: `right-full top-1/2 -translate-y-1/2 border-r-gray-600 border-t-transparent border-b-transparent`\n }\n\n const triangleStyle: Record<Position, CSSProperties> = {\n top: { borderWidth: `${triangleSize}px ${triangleSize}px 0 ${triangleSize}px` },\n bottom: { borderWidth: `0 ${triangleSize}px ${triangleSize}px ${triangleSize}px` },\n left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },\n right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }\n }\n\n return (\n <div\n className={clsx('relative inline-block', containerClassName)}\n {...handlers}\n >\n {children}\n {isHovered && (\n <div\n className={clsx(`opacity-0 absolute text-black text-xs font-semibold text-gray-600 px-2 py-1 rounded whitespace-nowrap border-2 border-gray-600\n animate-tooltip-fade-in shadow-lg bg-gray-100`, positionClasses[position], tooltipClassName)}\n style={{ zIndex, animationDelay: animationDelay + 'ms' }}\n >\n {tooltip}\n <div\n className={clsx(`absolute w-0 h-0`, triangleClasses[position])}\n style={{ ...triangleStyle[position], zIndex }}\n />\n </div>\n )}\n </div>\n )\n}\n","import type { PropsWithChildren } from 'react'\nimport { createContext, useState } from 'react'\nimport { noop } from '../../util/noop'\n\nexport type ModalContextType = {\n register: string[],\n addToRegister: (id: string) => void,\n removeFromRegister: (id: string) => void,\n}\nexport const ModalContext = createContext<ModalContextType>({\n register: [],\n addToRegister: noop,\n removeFromRegister: noop,\n})\n\n/**\n * A Simple Wrapper for the context\n */\nexport const ModalRegister = ({\n children\n}: PropsWithChildren) => {\n const [register, setRegister] = useState<string[]>([])\n\n const inRegister = (id: string) => {\n return !!register.find(value => value === id)\n }\n\n const addToRegister = (id: string) => {\n if (!inRegister(id)) {\n setRegister([...register, id])\n }\n }\n\n const removeFromRegister = (id: string) => {\n if (inRegister(id)) {\n setRegister(register.filter(value => value !== id))\n }\n }\n\n return (\n <ModalContext.Provider value={{ register, addToRegister, removeFromRegister }}>\n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AC,UACA;AAAA,QAAC;AAAA;AAAA,UACC,eAAW,aAAAA,SAAK,mCAAmC,qBAAqB;AAAA,YACtE,eAAe,gBAAgB,SAAS,SAAS;AAAA,UACnD,CAAC;AAAA;AAAA,MACH;AAAA,OAEJ;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;;;AL3FM,IAAAE,sBAAA;AA3CN,IAAM,yCAAyC;AAAA,EAC7C,IAAI;AAAA,IACF,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,OAAO;AAAA,IACP,aAAa;AAAA,EACf;AAAA,EACA,IAAI;AAAA,IACF,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,OAAO;AAAA,IACP,aAAa;AAAA,EACf;AACF;AAUO,IAAM,uBAAuB,CAAC;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAA0G;AACxG,QAAM,cAAc,eAAe,wCAAwC,oBAAoB;AAC/F,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,SAAS,YAAY;AAAA,MAC5B,aAAa,eAAe,YAAY;AAAA,MACvC,GAAG;AAAA,MAEH;AAAA;AAAA,QACD,8CAAC,SAAI,WAAU,gCACb;AAAA,uDAAC,eAAY,OAAM,YAAW,SAAS,QACpC,sBAAY,MACf;AAAA,UACA,6CAAC,eAAY,OAAM,YAAW,SAAS,YACpC,sBAAY,UACf;AAAA,UACA,6CAAC,eAAY,WAAS,MAAC,OAAM,WAAU,SAAS,UAC7C,sBAAY,QACf;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":["clsx","import_react","import_jsx_runtime","import_react","import_clsx","import_react","import_clsx","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","clsx","ReactDOM","import_jsx_runtime"]}
|