@helpwave/hightide 0.0.18 → 0.1.0
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/README.md +21 -2
- package/dist/coloring/shading.cjs +556 -0
- package/dist/coloring/shading.cjs.map +1 -0
- package/dist/coloring/{shading.d.mts → shading.d.cts} +1 -1
- package/dist/coloring/shading.js +476 -37
- package/dist/coloring/shading.js.map +1 -1
- package/dist/coloring/types.cjs +31 -0
- package/dist/coloring/{types.mjs.map → types.cjs.map} +1 -1
- package/dist/coloring/types.js +2 -27
- package/dist/coloring/types.js.map +1 -1
- package/dist/components/{HelpwaveBadge.js → branding/HelpwaveBadge.cjs} +65 -33
- package/dist/components/branding/HelpwaveBadge.cjs.map +1 -0
- package/dist/components/branding/HelpwaveBadge.js +123 -0
- package/dist/components/branding/HelpwaveBadge.js.map +1 -0
- package/dist/components/date/{DatePicker.mjs → DatePicker.cjs} +158 -94
- package/dist/components/date/DatePicker.cjs.map +1 -0
- package/dist/components/date/{DatePicker.d.mts → DatePicker.d.cts} +7 -8
- package/dist/components/date/DatePicker.d.ts +4 -5
- package/dist/components/date/DatePicker.js +121 -129
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/{DayPicker.mjs → DayPicker.cjs} +77 -24
- package/dist/components/date/DayPicker.cjs.map +1 -0
- package/dist/components/date/{DayPicker.d.mts → DayPicker.d.cts} +3 -3
- package/dist/components/date/DayPicker.d.ts +2 -2
- package/dist/components/date/DayPicker.js +38 -61
- package/dist/components/date/DayPicker.js.map +1 -1
- package/dist/components/{TimeDisplay.js → date/TimeDisplay.cjs} +24 -9
- package/dist/components/date/TimeDisplay.cjs.map +1 -0
- package/dist/components/{TimeDisplay.d.mts → date/TimeDisplay.d.cts} +2 -3
- package/dist/components/{TimeDisplay.d.ts → date/TimeDisplay.d.ts} +2 -3
- package/dist/components/{TimeDisplay.mjs → date/TimeDisplay.js} +23 -8
- package/dist/components/date/TimeDisplay.js.map +1 -0
- package/dist/components/date/{TimePicker.mjs → TimePicker.cjs} +62 -26
- package/dist/components/date/TimePicker.cjs.map +1 -0
- package/dist/components/date/{TimePicker.d.mts → TimePicker.d.cts} +2 -2
- package/dist/components/date/TimePicker.d.ts +2 -2
- package/dist/components/date/TimePicker.js +25 -61
- package/dist/components/date/TimePicker.js.map +1 -1
- package/dist/components/date/{YearMonthPicker.mjs → YearMonthPicker.cjs} +93 -42
- package/dist/components/date/YearMonthPicker.cjs.map +1 -0
- package/dist/components/date/{YearMonthPicker.d.mts → YearMonthPicker.d.cts} +2 -2
- package/dist/components/date/YearMonthPicker.d.ts +2 -2
- package/dist/components/date/YearMonthPicker.js +56 -77
- package/dist/components/date/YearMonthPicker.js.map +1 -1
- package/dist/components/{AvatarGroup.js → icons-and-geometry/Avatar.cjs} +23 -19
- package/dist/components/icons-and-geometry/Avatar.cjs.map +1 -0
- package/dist/components/icons-and-geometry/Avatar.d.cts +30 -0
- package/dist/components/icons-and-geometry/Avatar.d.ts +30 -0
- package/dist/components/{AvatarGroup.mjs → icons-and-geometry/Avatar.js} +13 -10
- package/dist/components/icons-and-geometry/Avatar.js.map +1 -0
- package/dist/components/{Circle.js → icons-and-geometry/Circle.cjs} +3 -3
- package/dist/components/icons-and-geometry/Circle.cjs.map +1 -0
- package/dist/components/{Circle.mjs → icons-and-geometry/Circle.js} +2 -2
- package/dist/components/icons-and-geometry/Circle.js.map +1 -0
- package/dist/components/{icons/Helpwave.js → icons-and-geometry/Helpwave.cjs} +38 -6
- package/dist/components/icons-and-geometry/Helpwave.cjs.map +1 -0
- package/dist/components/icons-and-geometry/Helpwave.js +75 -0
- package/dist/components/icons-and-geometry/Helpwave.js.map +1 -0
- package/dist/components/{Ring.js → icons-and-geometry/Ring.cjs} +6 -6
- package/dist/components/icons-and-geometry/Ring.cjs.map +1 -0
- package/dist/components/{Ring.mjs → icons-and-geometry/Ring.js} +4 -4
- package/dist/components/icons-and-geometry/Ring.js.map +1 -0
- package/dist/components/{icons/Tag.js → icons-and-geometry/Tag.cjs} +3 -3
- package/dist/components/icons-and-geometry/Tag.cjs.map +1 -0
- package/dist/components/{icons/Tag.mjs → icons-and-geometry/Tag.js} +2 -2
- package/dist/components/icons-and-geometry/Tag.js.map +1 -0
- package/dist/components/{BreadCrumb.js → layout-and-navigation/BreadCrumb.cjs} +12 -5
- package/dist/components/layout-and-navigation/BreadCrumb.cjs.map +1 -0
- package/dist/components/{BreadCrumb.mjs → layout-and-navigation/BreadCrumb.js} +10 -3
- package/dist/components/layout-and-navigation/BreadCrumb.js.map +1 -0
- package/dist/components/{layout/Carousel.js → layout-and-navigation/Carousel.cjs} +4 -4
- package/dist/components/layout-and-navigation/Carousel.cjs.map +1 -0
- package/dist/components/{layout/Carousel.mjs → layout-and-navigation/Carousel.js} +4 -4
- package/dist/components/layout-and-navigation/Carousel.js.map +1 -0
- package/dist/components/{ChipList.js → layout-and-navigation/Chip.cjs} +6 -6
- package/dist/components/layout-and-navigation/Chip.cjs.map +1 -0
- package/dist/components/{ChipList.mjs → layout-and-navigation/Chip.js} +2 -2
- package/dist/components/layout-and-navigation/Chip.js.map +1 -0
- package/dist/components/{layout/DividerInserter.js → layout-and-navigation/DividerInserter.cjs} +3 -3
- package/dist/components/layout-and-navigation/DividerInserter.cjs.map +1 -0
- package/dist/components/{layout/DividerInserter.mjs → layout-and-navigation/DividerInserter.js} +2 -2
- package/dist/components/layout-and-navigation/DividerInserter.js.map +1 -0
- package/dist/components/{Expandable.js → layout-and-navigation/Expandable.cjs} +3 -3
- package/dist/components/layout-and-navigation/Expandable.cjs.map +1 -0
- package/dist/components/{Expandable.mjs → layout-and-navigation/Expandable.js} +2 -2
- package/dist/components/layout-and-navigation/Expandable.js.map +1 -0
- package/dist/components/{layout/FAQSection.js → layout-and-navigation/FAQSection.cjs} +7 -7
- package/dist/components/layout-and-navigation/FAQSection.cjs.map +1 -0
- package/dist/components/{layout/FAQSection.d.mts → layout-and-navigation/FAQSection.d.cts} +1 -1
- package/dist/components/{layout → layout-and-navigation}/FAQSection.d.ts +1 -1
- package/dist/components/{layout/FAQSection.mjs → layout-and-navigation/FAQSection.js} +5 -5
- package/dist/components/layout-and-navigation/FAQSection.js.map +1 -0
- package/dist/components/{MarkdownInterpreter.js → layout-and-navigation/MarkdownInterpreter.cjs} +2 -2
- package/dist/components/layout-and-navigation/MarkdownInterpreter.cjs.map +1 -0
- package/dist/components/{MarkdownInterpreter.mjs → layout-and-navigation/MarkdownInterpreter.js} +2 -2
- package/dist/components/layout-and-navigation/MarkdownInterpreter.js.map +1 -0
- package/dist/components/layout-and-navigation/Overlay.cjs +467 -0
- package/dist/components/layout-and-navigation/Overlay.cjs.map +1 -0
- package/dist/components/layout-and-navigation/Overlay.d.cts +63 -0
- package/dist/components/layout-and-navigation/Overlay.d.ts +63 -0
- package/dist/components/layout-and-navigation/Overlay.js +429 -0
- package/dist/components/layout-and-navigation/Overlay.js.map +1 -0
- package/dist/components/{Pagination.js → layout-and-navigation/Pagination.cjs} +25 -10
- package/dist/components/layout-and-navigation/Pagination.cjs.map +1 -0
- package/dist/components/{Pagination.d.mts → layout-and-navigation/Pagination.d.cts} +2 -3
- package/dist/components/{Pagination.d.ts → layout-and-navigation/Pagination.d.ts} +2 -3
- package/dist/components/{Pagination.mjs → layout-and-navigation/Pagination.js} +25 -10
- package/dist/components/layout-and-navigation/Pagination.js.map +1 -0
- package/dist/components/{SearchableList.js → layout-and-navigation/SearchableList.cjs} +51 -34
- package/dist/components/layout-and-navigation/SearchableList.cjs.map +1 -0
- package/dist/components/{SearchableList.d.mts → layout-and-navigation/SearchableList.d.cts} +2 -2
- package/dist/components/{SearchableList.d.ts → layout-and-navigation/SearchableList.d.ts} +2 -2
- package/dist/components/{SearchableList.mjs → layout-and-navigation/SearchableList.js} +52 -40
- package/dist/components/layout-and-navigation/SearchableList.js.map +1 -0
- package/dist/components/{StepperBar.js → layout-and-navigation/StepperBar.cjs} +42 -16
- package/dist/components/layout-and-navigation/StepperBar.cjs.map +1 -0
- package/dist/components/{StepperBar.d.mts → layout-and-navigation/StepperBar.d.cts} +2 -3
- package/dist/components/{StepperBar.d.ts → layout-and-navigation/StepperBar.d.ts} +2 -3
- package/dist/components/{StepperBar.mjs → layout-and-navigation/StepperBar.js} +40 -14
- package/dist/components/layout-and-navigation/StepperBar.js.map +1 -0
- package/dist/components/{Table.js → layout-and-navigation/Table.cjs} +176 -40
- package/dist/components/layout-and-navigation/Table.cjs.map +1 -0
- package/dist/components/{Table.d.mts → layout-and-navigation/Table.d.cts} +10 -1
- package/dist/components/{Table.d.ts → layout-and-navigation/Table.d.ts} +10 -1
- package/dist/components/{Table.mjs → layout-and-navigation/Table.js} +175 -40
- package/dist/components/layout-and-navigation/Table.js.map +1 -0
- package/dist/components/{TextImage.js → layout-and-navigation/TextImage.cjs} +25 -10
- package/dist/components/layout-and-navigation/TextImage.cjs.map +1 -0
- package/dist/components/{TextImage.d.mts → layout-and-navigation/TextImage.d.cts} +2 -3
- package/dist/components/{TextImage.d.ts → layout-and-navigation/TextImage.d.ts} +2 -3
- package/dist/components/{TextImage.mjs → layout-and-navigation/TextImage.js} +23 -8
- package/dist/components/layout-and-navigation/TextImage.js.map +1 -0
- package/dist/components/{layout/Tile.js → layout-and-navigation/Tile.cjs} +4 -4
- package/dist/components/layout-and-navigation/Tile.cjs.map +1 -0
- package/dist/components/{layout/Tile.mjs → layout-and-navigation/Tile.js} +2 -2
- package/dist/components/layout-and-navigation/Tile.js.map +1 -0
- package/dist/components/{VerticalDivider.js → layout-and-navigation/VerticalDivider.cjs} +2 -2
- package/dist/components/layout-and-navigation/VerticalDivider.cjs.map +1 -0
- package/dist/components/{VerticalDivider.mjs → layout-and-navigation/VerticalDivider.js} +2 -2
- package/dist/components/layout-and-navigation/VerticalDivider.js.map +1 -0
- package/dist/components/{ErrorComponent.js → loading-states/ErrorComponent.cjs} +25 -10
- package/dist/components/loading-states/ErrorComponent.cjs.map +1 -0
- package/dist/components/{ErrorComponent.d.mts → loading-states/ErrorComponent.d.cts} +2 -3
- package/dist/components/{ErrorComponent.d.ts → loading-states/ErrorComponent.d.ts} +2 -3
- package/dist/components/{ErrorComponent.mjs → loading-states/ErrorComponent.js} +24 -9
- package/dist/components/loading-states/ErrorComponent.js.map +1 -0
- package/dist/components/{LoadingAndErrorComponent.js → loading-states/LoadingAndErrorComponent.cjs} +67 -18
- package/dist/components/loading-states/LoadingAndErrorComponent.cjs.map +1 -0
- package/dist/components/{LoadingAndErrorComponent.d.mts → loading-states/LoadingAndErrorComponent.d.cts} +6 -6
- package/dist/components/{LoadingAndErrorComponent.d.ts → loading-states/LoadingAndErrorComponent.d.ts} +4 -4
- package/dist/components/{LoadingAndErrorComponent.mjs → loading-states/LoadingAndErrorComponent.js} +66 -17
- package/dist/components/loading-states/LoadingAndErrorComponent.js.map +1 -0
- package/dist/components/{LoadingAnimation.js → loading-states/LoadingAnimation.cjs} +64 -15
- package/dist/components/loading-states/LoadingAnimation.cjs.map +1 -0
- package/dist/components/{LoadingAnimation.d.mts → loading-states/LoadingAnimation.d.cts} +2 -3
- package/dist/components/{LoadingAnimation.d.ts → loading-states/LoadingAnimation.d.ts} +2 -3
- package/dist/components/{LoadingAnimation.mjs → loading-states/LoadingAnimation.js} +63 -14
- package/dist/components/loading-states/LoadingAnimation.js.map +1 -0
- package/dist/components/{LoadingButton.js → loading-states/LoadingButton.cjs} +101 -58
- package/dist/components/loading-states/LoadingButton.cjs.map +1 -0
- package/dist/components/{LoadingButton.d.mts → loading-states/LoadingButton.d.cts} +1 -1
- package/dist/components/{LoadingButton.d.ts → loading-states/LoadingButton.d.ts} +1 -1
- package/dist/components/{LoadingButton.mjs → loading-states/LoadingButton.js} +100 -57
- package/dist/components/loading-states/LoadingButton.js.map +1 -0
- package/dist/components/{ProgressIndicator.js → loading-states/ProgressIndicator.cjs} +2 -2
- package/dist/components/loading-states/ProgressIndicator.cjs.map +1 -0
- package/dist/components/{ProgressIndicator.mjs → loading-states/ProgressIndicator.js} +2 -2
- package/dist/components/loading-states/ProgressIndicator.js.map +1 -0
- package/dist/components/modals/ConfirmDialog.cjs +353 -0
- package/dist/components/modals/ConfirmDialog.cjs.map +1 -0
- package/dist/components/modals/{ConfirmDialog.d.mts → ConfirmDialog.d.cts} +6 -6
- package/dist/components/modals/ConfirmDialog.d.ts +6 -6
- package/dist/components/modals/ConfirmDialog.js +157 -266
- package/dist/components/modals/ConfirmDialog.js.map +1 -1
- package/dist/components/modals/{DiscardChangesDialog.js → DiscardChangesModal.cjs} +213 -117
- package/dist/components/modals/DiscardChangesModal.cjs.map +1 -0
- package/dist/components/modals/DiscardChangesModal.d.cts +23 -0
- package/dist/components/modals/DiscardChangesModal.d.ts +23 -0
- package/dist/components/modals/{DiscardChangesDialog.mjs → DiscardChangesModal.js} +202 -106
- package/dist/components/modals/DiscardChangesModal.js.map +1 -0
- package/dist/components/modals/InputModal.cjs +533 -0
- package/dist/components/modals/InputModal.cjs.map +1 -0
- package/dist/components/modals/{InputModal.d.mts → InputModal.d.cts} +7 -7
- package/dist/components/modals/InputModal.d.ts +6 -6
- package/dist/components/modals/InputModal.js +197 -299
- package/dist/components/modals/InputModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.cjs +667 -0
- package/dist/components/modals/LanguageModal.cjs.map +1 -0
- package/dist/components/modals/LanguageModal.d.cts +20 -0
- package/dist/components/modals/LanguageModal.d.ts +7 -8
- package/dist/components/modals/LanguageModal.js +308 -204
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.cjs +694 -0
- package/dist/components/modals/ThemeModal.cjs.map +1 -0
- package/dist/components/modals/ThemeModal.d.cts +21 -0
- package/dist/components/modals/ThemeModal.d.ts +21 -0
- package/dist/components/modals/ThemeModal.js +657 -0
- package/dist/components/modals/ThemeModal.js.map +1 -0
- package/dist/components/properties/CheckboxProperty.cjs +362 -0
- package/dist/components/properties/CheckboxProperty.cjs.map +1 -0
- package/dist/components/properties/{CheckboxProperty.d.mts → CheckboxProperty.d.cts} +3 -3
- package/dist/components/properties/CheckboxProperty.d.ts +2 -2
- package/dist/components/properties/CheckboxProperty.js +94 -93
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.cjs +451 -0
- package/dist/components/properties/DateProperty.cjs.map +1 -0
- package/dist/components/properties/{DateProperty.d.mts → DateProperty.d.cts} +3 -3
- package/dist/components/properties/DateProperty.d.ts +2 -2
- package/dist/components/properties/DateProperty.js +110 -116
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/{MultiSelectProperty.mjs → MultiSelectProperty.cjs} +216 -155
- package/dist/components/properties/MultiSelectProperty.cjs.map +1 -0
- package/dist/components/properties/{MultiSelectProperty.d.mts → MultiSelectProperty.d.cts} +5 -5
- package/dist/components/properties/MultiSelectProperty.d.ts +4 -4
- package/dist/components/properties/MultiSelectProperty.js +180 -184
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.cjs +459 -0
- package/dist/components/properties/NumberProperty.cjs.map +1 -0
- package/dist/components/properties/{NumberProperty.d.mts → NumberProperty.d.cts} +3 -3
- package/dist/components/properties/NumberProperty.d.ts +2 -2
- package/dist/components/properties/NumberProperty.js +109 -116
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/PropertyBase.cjs +223 -0
- package/dist/components/properties/PropertyBase.cjs.map +1 -0
- package/dist/components/properties/{PropertyBase.d.mts → PropertyBase.d.cts} +2 -2
- package/dist/components/properties/PropertyBase.d.ts +2 -2
- package/dist/components/properties/PropertyBase.js +60 -69
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/{SelectProperty.mjs → SelectProperty.cjs} +251 -199
- package/dist/components/properties/SelectProperty.cjs.map +1 -0
- package/dist/components/properties/{SelectProperty.d.mts → SelectProperty.d.cts} +5 -6
- package/dist/components/properties/SelectProperty.d.ts +4 -5
- package/dist/components/properties/SelectProperty.js +215 -228
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.cjs +428 -0
- package/dist/components/properties/TextProperty.cjs.map +1 -0
- package/dist/components/properties/{TextProperty.d.mts → TextProperty.d.cts} +3 -3
- package/dist/components/properties/TextProperty.d.ts +2 -2
- package/dist/components/properties/TextProperty.js +134 -121
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/{Button.js → user-action/Button.cjs} +70 -12
- package/dist/components/user-action/Button.cjs.map +1 -0
- package/dist/components/{Button.d.mts → user-action/Button.d.cts} +32 -5
- package/dist/components/{Button.d.ts → user-action/Button.d.ts} +32 -5
- package/dist/components/{Button.mjs → user-action/Button.js} +66 -10
- package/dist/components/user-action/Button.js.map +1 -0
- package/dist/components/{user-input/Checkbox.js → user-action/Checkbox.cjs} +26 -16
- package/dist/components/user-action/Checkbox.cjs.map +1 -0
- package/dist/components/{user-input/Checkbox.d.mts → user-action/Checkbox.d.cts} +5 -5
- package/dist/components/{user-input → user-action}/Checkbox.d.ts +4 -4
- package/dist/components/{user-input/Checkbox.mjs → user-action/Checkbox.js} +24 -14
- package/dist/components/user-action/Checkbox.js.map +1 -0
- package/dist/components/{user-input/DateAndTimePicker.js → user-action/DateAndTimePicker.cjs} +51 -23
- package/dist/components/user-action/DateAndTimePicker.cjs.map +1 -0
- package/dist/components/{user-input/DateAndTimePicker.d.mts → user-action/DateAndTimePicker.d.cts} +7 -8
- package/dist/components/{user-input → user-action}/DateAndTimePicker.d.ts +2 -3
- package/dist/components/{user-input/DateAndTimePicker.mjs → user-action/DateAndTimePicker.js} +44 -16
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -0
- package/dist/components/{user-input/Input.js → user-action/Input.cjs} +35 -34
- package/dist/components/user-action/Input.cjs.map +1 -0
- package/dist/components/{user-input/Input.d.mts → user-action/Input.d.cts} +9 -16
- package/dist/components/{user-input → user-action}/Input.d.ts +8 -15
- package/dist/components/{user-input/Input.mjs → user-action/Input.js} +35 -39
- package/dist/components/user-action/Input.js.map +1 -0
- package/dist/components/{user-input/Label.js → user-action/Label.cjs} +15 -3
- package/dist/components/user-action/Label.cjs.map +1 -0
- package/dist/components/{user-input/Label.d.mts → user-action/Label.d.cts} +1 -1
- package/dist/components/{user-input → user-action}/Label.d.ts +1 -1
- package/dist/components/{user-input/Label.mjs → user-action/Label.js} +5 -3
- package/dist/components/user-action/Label.js.map +1 -0
- package/dist/components/{user-input/Menu.js → user-action/Menu.cjs} +4 -4
- package/dist/components/user-action/Menu.cjs.map +1 -0
- package/dist/components/{user-input/Menu.mjs → user-action/Menu.js} +3 -3
- package/dist/components/user-action/Menu.js.map +1 -0
- package/dist/components/{user-input/MultiSelect.js → user-action/MultiSelect.cjs} +76 -51
- package/dist/components/user-action/MultiSelect.cjs.map +1 -0
- package/dist/components/{user-input/MultiSelect.d.mts → user-action/MultiSelect.d.cts} +3 -3
- package/dist/components/{user-input → user-action}/MultiSelect.d.ts +2 -2
- package/dist/components/{user-input/MultiSelect.mjs → user-action/MultiSelect.js} +75 -55
- package/dist/components/user-action/MultiSelect.js.map +1 -0
- package/dist/components/{user-input/ScrollPicker.js → user-action/ScrollPicker.cjs} +4 -4
- package/dist/components/user-action/ScrollPicker.cjs.map +1 -0
- package/dist/components/{user-input/ScrollPicker.mjs → user-action/ScrollPicker.js} +3 -3
- package/dist/components/user-action/ScrollPicker.js.map +1 -0
- package/dist/components/{user-input/SearchableSelect.js → user-action/Select.cjs} +181 -152
- package/dist/components/user-action/Select.cjs.map +1 -0
- package/dist/components/user-action/Select.d.cts +49 -0
- package/dist/components/user-action/Select.d.ts +49 -0
- package/dist/components/{user-input/SearchableSelect.mjs → user-action/Select.js} +167 -145
- package/dist/components/user-action/Select.js.map +1 -0
- package/dist/components/{user-input/Textarea.js → user-action/Textarea.cjs} +80 -35
- package/dist/components/user-action/Textarea.cjs.map +1 -0
- package/dist/components/user-action/Textarea.d.cts +28 -0
- package/dist/components/{user-input → user-action}/Textarea.d.ts +9 -5
- package/dist/components/user-action/Textarea.js +163 -0
- package/dist/components/user-action/Textarea.js.map +1 -0
- package/dist/components/{user-input/ToggleableInput.js → user-action/ToggleableInput.cjs} +9 -15
- package/dist/components/user-action/ToggleableInput.cjs.map +1 -0
- package/dist/components/{user-input/ToggleableInput.mjs → user-action/ToggleableInput.js} +8 -14
- package/dist/components/user-action/ToggleableInput.js.map +1 -0
- package/dist/components/{Tooltip.js → user-action/Tooltip.cjs} +13 -9
- package/dist/components/user-action/Tooltip.cjs.map +1 -0
- package/dist/components/{Tooltip.d.mts → user-action/Tooltip.d.cts} +1 -1
- package/dist/components/{Tooltip.d.ts → user-action/Tooltip.d.ts} +1 -1
- package/dist/components/{Tooltip.mjs → user-action/Tooltip.js} +12 -8
- package/dist/components/user-action/Tooltip.js.map +1 -0
- package/dist/css/globals.css +178 -126
- package/dist/css/uncompiled/globals.css +65 -29
- package/dist/hooks/useHoverState.cjs +72 -0
- package/dist/hooks/{useHoverState.mjs.map → useHoverState.cjs.map} +1 -1
- package/dist/hooks/useHoverState.js +7 -32
- package/dist/hooks/useHoverState.js.map +1 -1
- package/dist/hooks/useLocalStorage.cjs +83 -0
- package/dist/hooks/useLocalStorage.cjs.map +1 -0
- package/dist/hooks/useLocalStorage.js +9 -34
- package/dist/hooks/useLocalStorage.js.map +1 -1
- package/dist/hooks/useOutsideClick.cjs +48 -0
- package/dist/hooks/{useOutsideClick.mjs.map → useOutsideClick.cjs.map} +1 -1
- package/dist/hooks/useOutsideClick.js +4 -29
- package/dist/hooks/useOutsideClick.js.map +1 -1
- package/dist/hooks/useSaveDelay.cjs +68 -0
- package/dist/hooks/{useSaveDelay.mjs.map → useSaveDelay.cjs.map} +1 -1
- package/dist/hooks/useSaveDelay.js +6 -31
- package/dist/hooks/useSaveDelay.js.map +1 -1
- package/dist/{index.mjs → index.cjs} +4008 -3882
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +82 -0
- package/dist/index.d.ts +49 -55
- package/dist/index.js +3825 -4056
- package/dist/index.js.map +1 -1
- package/dist/{hooks/useLanguage.js → localization/LanguageProvider.cjs} +30 -26
- package/dist/localization/LanguageProvider.cjs.map +1 -0
- package/dist/localization/LanguageProvider.d.cts +18 -0
- package/dist/localization/LanguageProvider.d.ts +18 -0
- package/dist/{hooks/useLanguage.mjs → localization/LanguageProvider.js} +26 -19
- package/dist/localization/LanguageProvider.js.map +1 -0
- package/dist/{hooks/useTranslation.js → localization/useTranslation.cjs} +23 -8
- package/dist/localization/useTranslation.cjs.map +1 -0
- package/dist/{hooks/useTranslation.d.mts → localization/useTranslation.d.cts} +5 -7
- package/dist/{hooks → localization}/useTranslation.d.ts +5 -7
- package/dist/{hooks/useTranslation.mjs → localization/useTranslation.js} +22 -7
- package/dist/localization/useTranslation.js.map +1 -0
- package/dist/localization/util.cjs +41 -0
- package/dist/localization/util.cjs.map +1 -0
- package/dist/localization/util.d.cts +18 -0
- package/dist/localization/util.d.ts +18 -0
- package/dist/localization/util.js +16 -0
- package/dist/localization/util.js.map +1 -0
- package/dist/{hooks/useTheme.js → theming/useTheme.cjs} +19 -11
- package/dist/theming/useTheme.cjs.map +1 -0
- package/dist/{hooks/useTheme.d.mts → theming/useTheme.d.cts} +9 -5
- package/dist/{hooks → theming}/useTheme.d.ts +9 -5
- package/dist/{hooks/useTheme.mjs → theming/useTheme.js} +15 -7
- package/dist/theming/useTheme.js.map +1 -0
- package/dist/util/{array.mjs → array.cjs} +34 -3
- package/dist/util/array.cjs.map +1 -0
- package/dist/util/array.js +2 -33
- package/dist/util/array.js.map +1 -1
- package/dist/util/builder.cjs +34 -0
- package/dist/util/{builder.mjs.map → builder.cjs.map} +1 -1
- package/dist/util/builder.js +2 -27
- package/dist/util/builder.js.map +1 -1
- package/dist/util/{date.mjs → date.cjs} +41 -3
- package/dist/util/date.cjs.map +1 -0
- package/dist/util/date.js +2 -40
- package/dist/util/date.js.map +1 -1
- package/dist/util/easeFunctions.cjs +63 -0
- package/dist/util/easeFunctions.cjs.map +1 -0
- package/dist/util/easeFunctions.js +2 -29
- package/dist/util/easeFunctions.js.map +1 -1
- package/dist/util/emailValidation.cjs +33 -0
- package/dist/util/{emailValidation.mjs.map → emailValidation.cjs.map} +1 -1
- package/dist/util/emailValidation.js +2 -27
- package/dist/util/emailValidation.js.map +1 -1
- package/dist/util/{loopingArray.mjs → loopingArray.cjs} +28 -3
- package/dist/util/{loopingArray.mjs.map → loopingArray.cjs.map} +1 -1
- package/dist/util/loopingArray.js +2 -27
- package/dist/util/loopingArray.js.map +1 -1
- package/dist/util/math.cjs +33 -0
- package/dist/util/{math.mjs.map → math.cjs.map} +1 -1
- package/dist/util/math.js +2 -27
- package/dist/util/math.js.map +1 -1
- package/dist/util/news.cjs +77 -0
- package/dist/util/news.cjs.map +1 -0
- package/dist/util/{news.d.mts → news.d.cts} +11 -13
- package/dist/util/news.d.ts +11 -13
- package/dist/util/news.js +22 -49
- package/dist/util/news.js.map +1 -1
- package/dist/util/noop.cjs +31 -0
- package/dist/util/noop.cjs.map +1 -0
- package/dist/util/noop.js +2 -27
- package/dist/util/noop.js.map +1 -1
- package/dist/util/simpleSearch.cjs +54 -0
- package/dist/util/simpleSearch.cjs.map +1 -0
- package/dist/util/simpleSearch.js +2 -30
- package/dist/util/simpleSearch.js.map +1 -1
- package/dist/util/storage.cjs +64 -0
- package/dist/util/storage.cjs.map +1 -0
- package/dist/util/storage.js +2 -28
- package/dist/util/storage.js.map +1 -1
- package/dist/util/types.cjs +19 -0
- package/dist/util/types.cjs.map +1 -0
- package/dist/util/types.js +0 -18
- package/dist/util/types.js.map +1 -1
- package/package.json +9 -12
- package/dist/coloring/shading.mjs +0 -47
- package/dist/coloring/shading.mjs.map +0 -1
- package/dist/coloring/types.mjs +0 -6
- package/dist/components/Avatar.d.mts +0 -17
- package/dist/components/Avatar.d.ts +0 -17
- package/dist/components/Avatar.js +0 -85
- package/dist/components/Avatar.js.map +0 -1
- package/dist/components/Avatar.mjs +0 -48
- package/dist/components/Avatar.mjs.map +0 -1
- package/dist/components/AvatarGroup.d.mts +0 -14
- package/dist/components/AvatarGroup.d.ts +0 -14
- package/dist/components/AvatarGroup.js.map +0 -1
- package/dist/components/AvatarGroup.mjs.map +0 -1
- package/dist/components/BreadCrumb.js.map +0 -1
- package/dist/components/BreadCrumb.mjs.map +0 -1
- package/dist/components/Button.js.map +0 -1
- package/dist/components/Button.mjs.map +0 -1
- package/dist/components/ChipList.js.map +0 -1
- package/dist/components/ChipList.mjs.map +0 -1
- package/dist/components/Circle.js.map +0 -1
- package/dist/components/Circle.mjs.map +0 -1
- package/dist/components/ErrorComponent.js.map +0 -1
- package/dist/components/ErrorComponent.mjs.map +0 -1
- package/dist/components/Expandable.js.map +0 -1
- package/dist/components/Expandable.mjs.map +0 -1
- package/dist/components/HelpwaveBadge.js.map +0 -1
- package/dist/components/HelpwaveBadge.mjs +0 -91
- package/dist/components/HelpwaveBadge.mjs.map +0 -1
- package/dist/components/HideableContentSection.d.mts +0 -14
- package/dist/components/HideableContentSection.d.ts +0 -14
- package/dist/components/HideableContentSection.js +0 -70
- package/dist/components/HideableContentSection.js.map +0 -1
- package/dist/components/HideableContentSection.mjs +0 -35
- package/dist/components/HideableContentSection.mjs.map +0 -1
- package/dist/components/InputGroup.d.mts +0 -17
- package/dist/components/InputGroup.d.ts +0 -17
- package/dist/components/InputGroup.js +0 -97
- package/dist/components/InputGroup.js.map +0 -1
- package/dist/components/InputGroup.mjs +0 -62
- package/dist/components/InputGroup.mjs.map +0 -1
- package/dist/components/LoadingAndErrorComponent.js.map +0 -1
- package/dist/components/LoadingAndErrorComponent.mjs.map +0 -1
- package/dist/components/LoadingAnimation.js.map +0 -1
- package/dist/components/LoadingAnimation.mjs.map +0 -1
- package/dist/components/LoadingButton.js.map +0 -1
- package/dist/components/LoadingButton.mjs.map +0 -1
- package/dist/components/MarkdownInterpreter.js.map +0 -1
- package/dist/components/MarkdownInterpreter.mjs.map +0 -1
- package/dist/components/Pagination.js.map +0 -1
- package/dist/components/Pagination.mjs.map +0 -1
- package/dist/components/Profile.d.mts +0 -31
- package/dist/components/Profile.d.ts +0 -31
- package/dist/components/Profile.js +0 -197
- package/dist/components/Profile.js.map +0 -1
- package/dist/components/Profile.mjs +0 -162
- package/dist/components/Profile.mjs.map +0 -1
- package/dist/components/ProgressIndicator.js.map +0 -1
- package/dist/components/ProgressIndicator.mjs.map +0 -1
- package/dist/components/Ring.js.map +0 -1
- package/dist/components/Ring.mjs.map +0 -1
- package/dist/components/SearchableList.js.map +0 -1
- package/dist/components/SearchableList.mjs.map +0 -1
- package/dist/components/SortButton.d.mts +0 -15
- package/dist/components/SortButton.d.ts +0 -15
- package/dist/components/SortButton.js +0 -132
- package/dist/components/SortButton.js.map +0 -1
- package/dist/components/SortButton.mjs +0 -97
- package/dist/components/SortButton.mjs.map +0 -1
- package/dist/components/StepperBar.js.map +0 -1
- package/dist/components/StepperBar.mjs.map +0 -1
- package/dist/components/Table.js.map +0 -1
- package/dist/components/Table.mjs.map +0 -1
- package/dist/components/TechRadar.d.mts +0 -39
- package/dist/components/TechRadar.d.ts +0 -39
- package/dist/components/TechRadar.js +0 -243
- package/dist/components/TechRadar.js.map +0 -1
- package/dist/components/TechRadar.mjs +0 -208
- package/dist/components/TechRadar.mjs.map +0 -1
- package/dist/components/TextImage.js.map +0 -1
- package/dist/components/TextImage.mjs.map +0 -1
- package/dist/components/TimeDisplay.js.map +0 -1
- package/dist/components/TimeDisplay.mjs.map +0 -1
- package/dist/components/Tooltip.js.map +0 -1
- package/dist/components/Tooltip.mjs.map +0 -1
- package/dist/components/VerticalDivider.js.map +0 -1
- package/dist/components/VerticalDivider.mjs.map +0 -1
- package/dist/components/date/DatePicker.mjs.map +0 -1
- package/dist/components/date/DayPicker.mjs.map +0 -1
- package/dist/components/date/TimePicker.mjs.map +0 -1
- package/dist/components/date/YearMonthPicker.mjs.map +0 -1
- package/dist/components/icons/Helpwave.js.map +0 -1
- package/dist/components/icons/Helpwave.mjs +0 -43
- package/dist/components/icons/Helpwave.mjs.map +0 -1
- package/dist/components/icons/Tag.js.map +0 -1
- package/dist/components/icons/Tag.mjs.map +0 -1
- package/dist/components/layout/Carousel.js.map +0 -1
- package/dist/components/layout/Carousel.mjs.map +0 -1
- package/dist/components/layout/DividerInserter.js.map +0 -1
- package/dist/components/layout/DividerInserter.mjs.map +0 -1
- package/dist/components/layout/FAQSection.js.map +0 -1
- package/dist/components/layout/FAQSection.mjs.map +0 -1
- package/dist/components/layout/Tile.js.map +0 -1
- package/dist/components/layout/Tile.mjs.map +0 -1
- package/dist/components/modals/ConfirmDialog.mjs +0 -388
- package/dist/components/modals/ConfirmDialog.mjs.map +0 -1
- package/dist/components/modals/DiscardChangesDialog.d.mts +0 -23
- package/dist/components/modals/DiscardChangesDialog.d.ts +0 -23
- package/dist/components/modals/DiscardChangesDialog.js.map +0 -1
- package/dist/components/modals/DiscardChangesDialog.mjs.map +0 -1
- package/dist/components/modals/InputModal.mjs +0 -566
- package/dist/components/modals/InputModal.mjs.map +0 -1
- package/dist/components/modals/LanguageModal.d.mts +0 -21
- package/dist/components/modals/LanguageModal.mjs +0 -489
- package/dist/components/modals/LanguageModal.mjs.map +0 -1
- package/dist/components/modals/Modal.d.mts +0 -43
- package/dist/components/modals/Modal.d.ts +0 -43
- package/dist/components/modals/Modal.js +0 -286
- package/dist/components/modals/Modal.js.map +0 -1
- package/dist/components/modals/Modal.mjs +0 -249
- package/dist/components/modals/Modal.mjs.map +0 -1
- package/dist/components/modals/ModalRegister.d.mts +0 -16
- package/dist/components/modals/ModalRegister.d.ts +0 -16
- package/dist/components/modals/ModalRegister.js +0 -63
- package/dist/components/modals/ModalRegister.js.map +0 -1
- package/dist/components/modals/ModalRegister.mjs +0 -37
- package/dist/components/modals/ModalRegister.mjs.map +0 -1
- package/dist/components/properties/CheckboxProperty.mjs +0 -291
- package/dist/components/properties/CheckboxProperty.mjs.map +0 -1
- package/dist/components/properties/DateProperty.mjs +0 -392
- package/dist/components/properties/DateProperty.mjs.map +0 -1
- package/dist/components/properties/MultiSelectProperty.mjs.map +0 -1
- package/dist/components/properties/NumberProperty.mjs +0 -401
- package/dist/components/properties/NumberProperty.mjs.map +0 -1
- package/dist/components/properties/PropertyBase.mjs +0 -162
- package/dist/components/properties/PropertyBase.mjs.map +0 -1
- package/dist/components/properties/SelectProperty.mjs.map +0 -1
- package/dist/components/properties/TextProperty.mjs +0 -345
- package/dist/components/properties/TextProperty.mjs.map +0 -1
- package/dist/components/user-input/Checkbox.js.map +0 -1
- package/dist/components/user-input/Checkbox.mjs.map +0 -1
- package/dist/components/user-input/DateAndTimePicker.js.map +0 -1
- package/dist/components/user-input/DateAndTimePicker.mjs.map +0 -1
- package/dist/components/user-input/Input.js.map +0 -1
- package/dist/components/user-input/Input.mjs.map +0 -1
- package/dist/components/user-input/Label.js.map +0 -1
- package/dist/components/user-input/Label.mjs.map +0 -1
- package/dist/components/user-input/Menu.js.map +0 -1
- package/dist/components/user-input/Menu.mjs.map +0 -1
- package/dist/components/user-input/MultiSelect.js.map +0 -1
- package/dist/components/user-input/MultiSelect.mjs.map +0 -1
- package/dist/components/user-input/ScrollPicker.js.map +0 -1
- package/dist/components/user-input/ScrollPicker.mjs.map +0 -1
- package/dist/components/user-input/SearchableSelect.d.mts +0 -14
- package/dist/components/user-input/SearchableSelect.d.ts +0 -14
- package/dist/components/user-input/SearchableSelect.js.map +0 -1
- package/dist/components/user-input/SearchableSelect.mjs.map +0 -1
- package/dist/components/user-input/Select.d.mts +0 -36
- package/dist/components/user-input/Select.d.ts +0 -36
- package/dist/components/user-input/Select.js +0 -153
- package/dist/components/user-input/Select.js.map +0 -1
- package/dist/components/user-input/Select.mjs +0 -118
- package/dist/components/user-input/Select.mjs.map +0 -1
- package/dist/components/user-input/Textarea.d.mts +0 -24
- package/dist/components/user-input/Textarea.js.map +0 -1
- package/dist/components/user-input/Textarea.mjs +0 -119
- package/dist/components/user-input/Textarea.mjs.map +0 -1
- package/dist/components/user-input/ToggleableInput.js.map +0 -1
- package/dist/components/user-input/ToggleableInput.mjs.map +0 -1
- package/dist/hooks/useHoverState.mjs +0 -47
- package/dist/hooks/useLanguage.d.mts +0 -21
- package/dist/hooks/useLanguage.d.ts +0 -21
- package/dist/hooks/useLanguage.js.map +0 -1
- package/dist/hooks/useLanguage.mjs.map +0 -1
- package/dist/hooks/useLocalStorage.mjs +0 -58
- package/dist/hooks/useLocalStorage.mjs.map +0 -1
- package/dist/hooks/useOutsideClick.mjs +0 -23
- package/dist/hooks/useSaveDelay.mjs +0 -43
- package/dist/hooks/useTheme.js.map +0 -1
- package/dist/hooks/useTheme.mjs.map +0 -1
- package/dist/hooks/useTranslation.js.map +0 -1
- package/dist/hooks/useTranslation.mjs.map +0 -1
- package/dist/index.d.mts +0 -88
- package/dist/index.mjs.map +0 -1
- package/dist/util/array.mjs.map +0 -1
- package/dist/util/builder.mjs +0 -9
- package/dist/util/date.mjs.map +0 -1
- package/dist/util/easeFunctions.mjs +0 -36
- package/dist/util/easeFunctions.mjs.map +0 -1
- package/dist/util/emailValidation.mjs +0 -8
- package/dist/util/math.mjs +0 -8
- package/dist/util/news.mjs +0 -48
- package/dist/util/news.mjs.map +0 -1
- package/dist/util/noop.mjs +0 -6
- package/dist/util/noop.mjs.map +0 -1
- package/dist/util/simpleSearch.mjs +0 -26
- package/dist/util/simpleSearch.mjs.map +0 -1
- package/dist/util/storage.mjs +0 -38
- package/dist/util/storage.mjs.map +0 -1
- package/dist/util/types.mjs +0 -1
- package/dist/util/types.mjs.map +0 -1
- /package/dist/coloring/{types.d.mts → types.d.cts} +0 -0
- /package/dist/components/{HelpwaveBadge.d.mts → branding/HelpwaveBadge.d.cts} +0 -0
- /package/dist/components/{HelpwaveBadge.d.ts → branding/HelpwaveBadge.d.ts} +0 -0
- /package/dist/components/{Circle.d.mts → icons-and-geometry/Circle.d.cts} +0 -0
- /package/dist/components/{Circle.d.ts → icons-and-geometry/Circle.d.ts} +0 -0
- /package/dist/components/{icons/Helpwave.d.mts → icons-and-geometry/Helpwave.d.cts} +0 -0
- /package/dist/components/{icons → icons-and-geometry}/Helpwave.d.ts +0 -0
- /package/dist/components/{Ring.d.mts → icons-and-geometry/Ring.d.cts} +0 -0
- /package/dist/components/{Ring.d.ts → icons-and-geometry/Ring.d.ts} +0 -0
- /package/dist/components/{icons/Tag.d.mts → icons-and-geometry/Tag.d.cts} +0 -0
- /package/dist/components/{icons → icons-and-geometry}/Tag.d.ts +0 -0
- /package/dist/components/{BreadCrumb.d.mts → layout-and-navigation/BreadCrumb.d.cts} +0 -0
- /package/dist/components/{BreadCrumb.d.ts → layout-and-navigation/BreadCrumb.d.ts} +0 -0
- /package/dist/components/{layout/Carousel.d.mts → layout-and-navigation/Carousel.d.cts} +0 -0
- /package/dist/components/{layout → layout-and-navigation}/Carousel.d.ts +0 -0
- /package/dist/components/{ChipList.d.mts → layout-and-navigation/Chip.d.cts} +0 -0
- /package/dist/components/{ChipList.d.ts → layout-and-navigation/Chip.d.ts} +0 -0
- /package/dist/components/{layout/DividerInserter.d.mts → layout-and-navigation/DividerInserter.d.cts} +0 -0
- /package/dist/components/{layout → layout-and-navigation}/DividerInserter.d.ts +0 -0
- /package/dist/components/{Expandable.d.mts → layout-and-navigation/Expandable.d.cts} +0 -0
- /package/dist/components/{Expandable.d.ts → layout-and-navigation/Expandable.d.ts} +0 -0
- /package/dist/components/{MarkdownInterpreter.d.mts → layout-and-navigation/MarkdownInterpreter.d.cts} +0 -0
- /package/dist/components/{MarkdownInterpreter.d.ts → layout-and-navigation/MarkdownInterpreter.d.ts} +0 -0
- /package/dist/components/{layout/Tile.d.mts → layout-and-navigation/Tile.d.cts} +0 -0
- /package/dist/components/{layout → layout-and-navigation}/Tile.d.ts +0 -0
- /package/dist/components/{VerticalDivider.d.mts → layout-and-navigation/VerticalDivider.d.cts} +0 -0
- /package/dist/components/{VerticalDivider.d.ts → layout-and-navigation/VerticalDivider.d.ts} +0 -0
- /package/dist/components/{ProgressIndicator.d.mts → loading-states/ProgressIndicator.d.cts} +0 -0
- /package/dist/components/{ProgressIndicator.d.ts → loading-states/ProgressIndicator.d.ts} +0 -0
- /package/dist/components/{user-input/Menu.d.mts → user-action/Menu.d.cts} +0 -0
- /package/dist/components/{user-input → user-action}/Menu.d.ts +0 -0
- /package/dist/components/{user-input/ScrollPicker.d.mts → user-action/ScrollPicker.d.cts} +0 -0
- /package/dist/components/{user-input → user-action}/ScrollPicker.d.ts +0 -0
- /package/dist/components/{user-input/ToggleableInput.d.mts → user-action/ToggleableInput.d.cts} +0 -0
- /package/dist/components/{user-input → user-action}/ToggleableInput.d.ts +0 -0
- /package/dist/hooks/{useHoverState.d.mts → useHoverState.d.cts} +0 -0
- /package/dist/hooks/{useLocalStorage.d.mts → useLocalStorage.d.cts} +0 -0
- /package/dist/hooks/{useOutsideClick.d.mts → useOutsideClick.d.cts} +0 -0
- /package/dist/hooks/{useSaveDelay.d.mts → useSaveDelay.d.cts} +0 -0
- /package/dist/util/{array.d.mts → array.d.cts} +0 -0
- /package/dist/util/{builder.d.mts → builder.d.cts} +0 -0
- /package/dist/util/{date.d.mts → date.d.cts} +0 -0
- /package/dist/util/{easeFunctions.d.mts → easeFunctions.d.cts} +0 -0
- /package/dist/util/{emailValidation.d.mts → emailValidation.d.cts} +0 -0
- /package/dist/util/{loopingArray.d.mts → loopingArray.d.cts} +0 -0
- /package/dist/util/{math.d.mts → math.d.cts} +0 -0
- /package/dist/util/{noop.d.mts → noop.d.cts} +0 -0
- /package/dist/util/{simpleSearch.d.mts → simpleSearch.d.cts} +0 -0
- /package/dist/util/{storage.d.mts → storage.d.cts} +0 -0
- /package/dist/util/{types.d.mts → types.d.cts} +0 -0
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { MouseEventHandler, ReactNode, PropsWithChildren } from 'react';
|
|
3
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
import { PropsForTranslation } from '../../hooks/useTranslation.js';
|
|
5
|
-
import '../../hooks/useLanguage.js';
|
|
6
|
-
|
|
7
|
-
type ModalHeaderTranslation = {
|
|
8
|
-
close: string;
|
|
9
|
-
};
|
|
10
|
-
type ModalHeaderProps = {
|
|
11
|
-
onCloseClick?: () => void;
|
|
12
|
-
/** The title of the Modal. If you want to only set the text use `titleText` instead */
|
|
13
|
-
title?: ReactNode;
|
|
14
|
-
/** The title text of the Modal. If you want to set a custom title use `title` instead */
|
|
15
|
-
titleText?: string;
|
|
16
|
-
/** The description of the Modal. If you want to only set the text use `descriptionText` instead */
|
|
17
|
-
description?: ReactNode;
|
|
18
|
-
/** The description text of the Modal. If you want to set a custom description use `description` instead */
|
|
19
|
-
descriptionText?: string;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* A default Header to be used by modals to have a uniform design
|
|
23
|
-
*/
|
|
24
|
-
declare const ModalHeader: ({ overwriteTranslation, onCloseClick, title, titleText, description, descriptionText }: PropsForTranslation<ModalHeaderTranslation, ModalHeaderProps>) => react_jsx_runtime.JSX.Element;
|
|
25
|
-
declare const modalRootName = "modal-root";
|
|
26
|
-
type ModalProps = {
|
|
27
|
-
id: string;
|
|
28
|
-
isOpen: boolean;
|
|
29
|
-
onBackgroundClick?: MouseEventHandler<HTMLDivElement>;
|
|
30
|
-
backgroundClassName?: string;
|
|
31
|
-
modalClassName?: string;
|
|
32
|
-
containerClassName?: string;
|
|
33
|
-
} & ModalHeaderProps;
|
|
34
|
-
/**
|
|
35
|
-
* A Generic Modal Window
|
|
36
|
-
*
|
|
37
|
-
* The state needs to be managed by the parent of this component
|
|
38
|
-
*
|
|
39
|
-
* DO NOT Conditionally render this always use the isOpen to ensure that the ModalRegister is working properly
|
|
40
|
-
*/
|
|
41
|
-
declare const Modal: ({ children, id, isOpen, onBackgroundClick, backgroundClassName, modalClassName, containerClassName, ...modalHeaderProps }: PropsWithChildren<ModalProps>) => react.ReactPortal | null;
|
|
42
|
-
|
|
43
|
-
export { Modal, ModalHeader, type ModalHeaderProps, type ModalProps, modalRootName };
|
|
@@ -1,286 +0,0 @@
|
|
|
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/modals/Modal.tsx
|
|
31
|
-
var Modal_exports = {};
|
|
32
|
-
__export(Modal_exports, {
|
|
33
|
-
Modal: () => Modal,
|
|
34
|
-
ModalHeader: () => ModalHeader,
|
|
35
|
-
modalRootName: () => modalRootName
|
|
36
|
-
});
|
|
37
|
-
module.exports = __toCommonJS(Modal_exports);
|
|
38
|
-
var import_react5 = require("react");
|
|
39
|
-
var import_react_dom = __toESM(require("react-dom"));
|
|
40
|
-
var import_lucide_react = require("lucide-react");
|
|
41
|
-
var import_clsx2 = __toESM(require("clsx"));
|
|
42
|
-
|
|
43
|
-
// src/hooks/useLanguage.tsx
|
|
44
|
-
var import_react2 = require("react");
|
|
45
|
-
|
|
46
|
-
// src/hooks/useLocalStorage.tsx
|
|
47
|
-
var import_react = require("react");
|
|
48
|
-
|
|
49
|
-
// src/hooks/useLanguage.tsx
|
|
50
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
51
|
-
var DEFAULT_LANGUAGE = "en";
|
|
52
|
-
var LanguageContext = (0, import_react2.createContext)({ language: DEFAULT_LANGUAGE, setLanguage: (v) => v });
|
|
53
|
-
var useLanguage = () => (0, import_react2.useContext)(LanguageContext);
|
|
54
|
-
|
|
55
|
-
// src/hooks/useTranslation.ts
|
|
56
|
-
var useTranslation = (defaults, translationOverwrite = {}) => {
|
|
57
|
-
const { language: languageProp, translation: overwrite } = translationOverwrite;
|
|
58
|
-
const { language: inferredLanguage } = useLanguage();
|
|
59
|
-
const usedLanguage = languageProp ?? inferredLanguage;
|
|
60
|
-
let defaultValues = defaults[usedLanguage];
|
|
61
|
-
if (overwrite && overwrite[usedLanguage]) {
|
|
62
|
-
defaultValues = { ...defaultValues, ...overwrite[usedLanguage] };
|
|
63
|
-
}
|
|
64
|
-
return defaultValues;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
// src/hooks/useHoverState.ts
|
|
68
|
-
var import_react3 = require("react");
|
|
69
|
-
var defaultUseHoverStateProps = {
|
|
70
|
-
closingDelay: 200,
|
|
71
|
-
isDisabled: false
|
|
72
|
-
};
|
|
73
|
-
var useHoverState = (props = void 0) => {
|
|
74
|
-
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
75
|
-
const [isHovered, setIsHovered] = (0, import_react3.useState)(false);
|
|
76
|
-
const [timer, setTimer] = (0, import_react3.useState)();
|
|
77
|
-
const onMouseEnter = () => {
|
|
78
|
-
if (isDisabled) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
clearTimeout(timer);
|
|
82
|
-
setIsHovered(true);
|
|
83
|
-
};
|
|
84
|
-
const onMouseLeave = () => {
|
|
85
|
-
if (isDisabled) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
setTimer(setTimeout(() => {
|
|
89
|
-
setIsHovered(false);
|
|
90
|
-
}, closingDelay));
|
|
91
|
-
};
|
|
92
|
-
(0, import_react3.useEffect)(() => {
|
|
93
|
-
if (timer) {
|
|
94
|
-
return () => {
|
|
95
|
-
clearTimeout(timer);
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
(0, import_react3.useEffect)(() => {
|
|
100
|
-
if (timer) {
|
|
101
|
-
clearTimeout(timer);
|
|
102
|
-
}
|
|
103
|
-
}, [isDisabled]);
|
|
104
|
-
return {
|
|
105
|
-
isHovered,
|
|
106
|
-
setIsHovered,
|
|
107
|
-
handlers: { onMouseEnter, onMouseLeave }
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
// src/components/Tooltip.tsx
|
|
112
|
-
var import_clsx = require("clsx");
|
|
113
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
114
|
-
var Tooltip = ({
|
|
115
|
-
tooltip,
|
|
116
|
-
children,
|
|
117
|
-
animationDelay = 650,
|
|
118
|
-
tooltipClassName = "",
|
|
119
|
-
containerClassName = "",
|
|
120
|
-
position = "bottom",
|
|
121
|
-
zIndex = 10
|
|
122
|
-
}) => {
|
|
123
|
-
const { isHovered, handlers } = useHoverState();
|
|
124
|
-
const positionClasses = {
|
|
125
|
-
top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,
|
|
126
|
-
bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,
|
|
127
|
-
left: `right-full top-1/2 -translate-y-1/2 mr-[6px]`,
|
|
128
|
-
right: `left-full top-1/2 -translate-y-1/2 ml-[6px]`
|
|
129
|
-
};
|
|
130
|
-
const triangleSize = 6;
|
|
131
|
-
const triangleClasses = {
|
|
132
|
-
top: `top-full left-1/2 -translate-x-1/2 border-t-gray-600 border-l-transparent border-r-transparent`,
|
|
133
|
-
bottom: `bottom-full left-1/2 -translate-x-1/2 border-b-gray-600 border-l-transparent border-r-transparent`,
|
|
134
|
-
left: `left-full top-1/2 -translate-y-1/2 border-l-gray-600 border-t-transparent border-b-transparent`,
|
|
135
|
-
right: `right-full top-1/2 -translate-y-1/2 border-r-gray-600 border-t-transparent border-b-transparent`
|
|
136
|
-
};
|
|
137
|
-
const triangleStyle = {
|
|
138
|
-
top: { borderWidth: `${triangleSize}px ${triangleSize}px 0 ${triangleSize}px` },
|
|
139
|
-
bottom: { borderWidth: `0 ${triangleSize}px ${triangleSize}px ${triangleSize}px` },
|
|
140
|
-
left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
|
|
141
|
-
right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
|
|
142
|
-
};
|
|
143
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
144
|
-
"div",
|
|
145
|
-
{
|
|
146
|
-
className: (0, import_clsx.clsx)("relative inline-block", containerClassName),
|
|
147
|
-
...handlers,
|
|
148
|
-
children: [
|
|
149
|
-
children,
|
|
150
|
-
isHovered && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
151
|
-
"div",
|
|
152
|
-
{
|
|
153
|
-
className: (0, import_clsx.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
|
|
154
|
-
animate-tooltip-fade-in shadow-lg bg-gray-100`, positionClasses[position], tooltipClassName),
|
|
155
|
-
style: { zIndex, animationDelay: animationDelay + "ms" },
|
|
156
|
-
children: [
|
|
157
|
-
tooltip,
|
|
158
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
159
|
-
"div",
|
|
160
|
-
{
|
|
161
|
-
className: (0, import_clsx.clsx)(`absolute w-0 h-0`, triangleClasses[position]),
|
|
162
|
-
style: { ...triangleStyle[position], zIndex }
|
|
163
|
-
}
|
|
164
|
-
)
|
|
165
|
-
]
|
|
166
|
-
}
|
|
167
|
-
)
|
|
168
|
-
]
|
|
169
|
-
}
|
|
170
|
-
);
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
// src/components/modals/ModalRegister.tsx
|
|
174
|
-
var import_react4 = require("react");
|
|
175
|
-
|
|
176
|
-
// src/util/noop.ts
|
|
177
|
-
var noop = () => void 0;
|
|
178
|
-
|
|
179
|
-
// src/components/modals/ModalRegister.tsx
|
|
180
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
181
|
-
var ModalContext = (0, import_react4.createContext)({
|
|
182
|
-
register: [],
|
|
183
|
-
addToRegister: noop,
|
|
184
|
-
removeFromRegister: noop
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
// src/components/modals/Modal.tsx
|
|
188
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
189
|
-
var defaultModalHeaderTranslation = {
|
|
190
|
-
en: {
|
|
191
|
-
close: "Close"
|
|
192
|
-
},
|
|
193
|
-
de: {
|
|
194
|
-
close: "Schlie\xDFen"
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
var ModalHeader = ({
|
|
198
|
-
overwriteTranslation,
|
|
199
|
-
onCloseClick,
|
|
200
|
-
title,
|
|
201
|
-
titleText = "",
|
|
202
|
-
description,
|
|
203
|
-
descriptionText = ""
|
|
204
|
-
}) => {
|
|
205
|
-
const translation = useTranslation(defaultModalHeaderTranslation, overwriteTranslation);
|
|
206
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "col", children: [
|
|
207
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "row justify-between items-start gap-x-8", children: [
|
|
208
|
-
title ?? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: (0, import_clsx2.default)("textstyle-title-lg", {
|
|
209
|
-
"mb-1": description || descriptionText
|
|
210
|
-
}), children: titleText }),
|
|
211
|
-
!!onCloseClick && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Tooltip, { tooltip: translation.close, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { className: "row bg-gray-200 hover:bg-gray-300 rounded-md p-1", onClick: onCloseClick, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.X, {}) }) })
|
|
212
|
-
] }),
|
|
213
|
-
description ?? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "textstyle-description", children: descriptionText })
|
|
214
|
-
] });
|
|
215
|
-
};
|
|
216
|
-
var modalRootName = "modal-root";
|
|
217
|
-
var Modal = ({
|
|
218
|
-
children,
|
|
219
|
-
id,
|
|
220
|
-
isOpen,
|
|
221
|
-
onBackgroundClick,
|
|
222
|
-
backgroundClassName = "",
|
|
223
|
-
modalClassName = "",
|
|
224
|
-
containerClassName = "",
|
|
225
|
-
...modalHeaderProps
|
|
226
|
-
}) => {
|
|
227
|
-
const modalRoot = typeof window !== "undefined" ? document.getElementById(modalRootName) : null;
|
|
228
|
-
const {
|
|
229
|
-
register,
|
|
230
|
-
addToRegister,
|
|
231
|
-
removeFromRegister
|
|
232
|
-
} = (0, import_react5.useContext)(ModalContext);
|
|
233
|
-
if (!id) {
|
|
234
|
-
console.error("the id cannot be empty");
|
|
235
|
-
}
|
|
236
|
-
(0, import_react5.useEffect)(() => {
|
|
237
|
-
if (isOpen) {
|
|
238
|
-
addToRegister(id);
|
|
239
|
-
} else {
|
|
240
|
-
removeFromRegister(id);
|
|
241
|
-
}
|
|
242
|
-
}, [addToRegister, id, removeFromRegister, isOpen]);
|
|
243
|
-
if (modalRoot === null || !isOpen) return null;
|
|
244
|
-
const isLast = register.length < 1 || register[register.length - 1] === id;
|
|
245
|
-
const isSecondLast = register.length < 2 || register[register.length - 2] === id;
|
|
246
|
-
return import_react_dom.default.createPortal(
|
|
247
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: (0, import_clsx2.default)("fixed inset-0 overflow-y-auto z-[99]", containerClassName), id, children: [
|
|
248
|
-
isLast && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
249
|
-
"div",
|
|
250
|
-
{
|
|
251
|
-
className: (0, import_clsx2.default)("fixed inset-0 h-screen w-screen", backgroundClassName, {
|
|
252
|
-
"bg-black/70": isLast && register.length === 1
|
|
253
|
-
}),
|
|
254
|
-
onClick: onBackgroundClick
|
|
255
|
-
}
|
|
256
|
-
),
|
|
257
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
258
|
-
"div",
|
|
259
|
-
{
|
|
260
|
-
className: (0, import_clsx2.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),
|
|
261
|
-
children: [
|
|
262
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ModalHeader, { ...modalHeaderProps }),
|
|
263
|
-
children
|
|
264
|
-
]
|
|
265
|
-
}
|
|
266
|
-
),
|
|
267
|
-
!isLast && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
268
|
-
"div",
|
|
269
|
-
{
|
|
270
|
-
className: (0, import_clsx2.default)("fixed inset-0 h-screen w-screen", backgroundClassName, {
|
|
271
|
-
"bg-black/70": isSecondLast && register.length > 1
|
|
272
|
-
})
|
|
273
|
-
}
|
|
274
|
-
)
|
|
275
|
-
] }),
|
|
276
|
-
modalRoot,
|
|
277
|
-
id
|
|
278
|
-
);
|
|
279
|
-
};
|
|
280
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
281
|
-
0 && (module.exports = {
|
|
282
|
-
Modal,
|
|
283
|
-
ModalHeader,
|
|
284
|
-
modalRootName
|
|
285
|
-
});
|
|
286
|
-
//# sourceMappingURL=Modal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/modals/Modal.tsx","../../../src/hooks/useLanguage.tsx","../../../src/hooks/useLocalStorage.tsx","../../../src/hooks/useTranslation.ts","../../../src/hooks/useHoverState.ts","../../../src/components/Tooltip.tsx","../../../src/components/modals/ModalRegister.tsx","../../../src/util/noop.ts"],"sourcesContent":["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, 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>>\nexport const 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}","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 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 {children}\n </ModalContext.Provider>\n )\n}\n","export const noop = () => undefined\n"],"mappings":"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","names":["import_react","import_clsx","import_react","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","clsx","ReactDOM"]}
|
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
// src/components/modals/Modal.tsx
|
|
2
|
-
import { useContext as useContext2, useEffect as useEffect4 } from "react";
|
|
3
|
-
import ReactDOM from "react-dom";
|
|
4
|
-
import { X } from "lucide-react";
|
|
5
|
-
import clsx2 from "clsx";
|
|
6
|
-
|
|
7
|
-
// src/hooks/useLanguage.tsx
|
|
8
|
-
import { createContext, useContext, useEffect as useEffect2, useState as useState2 } from "react";
|
|
9
|
-
|
|
10
|
-
// src/hooks/useLocalStorage.tsx
|
|
11
|
-
import { useCallback, useEffect, useState } from "react";
|
|
12
|
-
|
|
13
|
-
// src/hooks/useLanguage.tsx
|
|
14
|
-
import { jsx } from "react/jsx-runtime";
|
|
15
|
-
var DEFAULT_LANGUAGE = "en";
|
|
16
|
-
var LanguageContext = createContext({ language: DEFAULT_LANGUAGE, setLanguage: (v) => v });
|
|
17
|
-
var useLanguage = () => useContext(LanguageContext);
|
|
18
|
-
|
|
19
|
-
// src/hooks/useTranslation.ts
|
|
20
|
-
var useTranslation = (defaults, translationOverwrite = {}) => {
|
|
21
|
-
const { language: languageProp, translation: overwrite } = translationOverwrite;
|
|
22
|
-
const { language: inferredLanguage } = useLanguage();
|
|
23
|
-
const usedLanguage = languageProp ?? inferredLanguage;
|
|
24
|
-
let defaultValues = defaults[usedLanguage];
|
|
25
|
-
if (overwrite && overwrite[usedLanguage]) {
|
|
26
|
-
defaultValues = { ...defaultValues, ...overwrite[usedLanguage] };
|
|
27
|
-
}
|
|
28
|
-
return defaultValues;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
// src/hooks/useHoverState.ts
|
|
32
|
-
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
33
|
-
var defaultUseHoverStateProps = {
|
|
34
|
-
closingDelay: 200,
|
|
35
|
-
isDisabled: false
|
|
36
|
-
};
|
|
37
|
-
var useHoverState = (props = void 0) => {
|
|
38
|
-
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
39
|
-
const [isHovered, setIsHovered] = useState3(false);
|
|
40
|
-
const [timer, setTimer] = useState3();
|
|
41
|
-
const onMouseEnter = () => {
|
|
42
|
-
if (isDisabled) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
clearTimeout(timer);
|
|
46
|
-
setIsHovered(true);
|
|
47
|
-
};
|
|
48
|
-
const onMouseLeave = () => {
|
|
49
|
-
if (isDisabled) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
setTimer(setTimeout(() => {
|
|
53
|
-
setIsHovered(false);
|
|
54
|
-
}, closingDelay));
|
|
55
|
-
};
|
|
56
|
-
useEffect3(() => {
|
|
57
|
-
if (timer) {
|
|
58
|
-
return () => {
|
|
59
|
-
clearTimeout(timer);
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
useEffect3(() => {
|
|
64
|
-
if (timer) {
|
|
65
|
-
clearTimeout(timer);
|
|
66
|
-
}
|
|
67
|
-
}, [isDisabled]);
|
|
68
|
-
return {
|
|
69
|
-
isHovered,
|
|
70
|
-
setIsHovered,
|
|
71
|
-
handlers: { onMouseEnter, onMouseLeave }
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
// src/components/Tooltip.tsx
|
|
76
|
-
import { clsx } from "clsx";
|
|
77
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
78
|
-
var Tooltip = ({
|
|
79
|
-
tooltip,
|
|
80
|
-
children,
|
|
81
|
-
animationDelay = 650,
|
|
82
|
-
tooltipClassName = "",
|
|
83
|
-
containerClassName = "",
|
|
84
|
-
position = "bottom",
|
|
85
|
-
zIndex = 10
|
|
86
|
-
}) => {
|
|
87
|
-
const { isHovered, handlers } = useHoverState();
|
|
88
|
-
const positionClasses = {
|
|
89
|
-
top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,
|
|
90
|
-
bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,
|
|
91
|
-
left: `right-full top-1/2 -translate-y-1/2 mr-[6px]`,
|
|
92
|
-
right: `left-full top-1/2 -translate-y-1/2 ml-[6px]`
|
|
93
|
-
};
|
|
94
|
-
const triangleSize = 6;
|
|
95
|
-
const triangleClasses = {
|
|
96
|
-
top: `top-full left-1/2 -translate-x-1/2 border-t-gray-600 border-l-transparent border-r-transparent`,
|
|
97
|
-
bottom: `bottom-full left-1/2 -translate-x-1/2 border-b-gray-600 border-l-transparent border-r-transparent`,
|
|
98
|
-
left: `left-full top-1/2 -translate-y-1/2 border-l-gray-600 border-t-transparent border-b-transparent`,
|
|
99
|
-
right: `right-full top-1/2 -translate-y-1/2 border-r-gray-600 border-t-transparent border-b-transparent`
|
|
100
|
-
};
|
|
101
|
-
const triangleStyle = {
|
|
102
|
-
top: { borderWidth: `${triangleSize}px ${triangleSize}px 0 ${triangleSize}px` },
|
|
103
|
-
bottom: { borderWidth: `0 ${triangleSize}px ${triangleSize}px ${triangleSize}px` },
|
|
104
|
-
left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
|
|
105
|
-
right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
|
|
106
|
-
};
|
|
107
|
-
return /* @__PURE__ */ jsxs(
|
|
108
|
-
"div",
|
|
109
|
-
{
|
|
110
|
-
className: clsx("relative inline-block", containerClassName),
|
|
111
|
-
...handlers,
|
|
112
|
-
children: [
|
|
113
|
-
children,
|
|
114
|
-
isHovered && /* @__PURE__ */ jsxs(
|
|
115
|
-
"div",
|
|
116
|
-
{
|
|
117
|
-
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
|
|
118
|
-
animate-tooltip-fade-in shadow-lg bg-gray-100`, positionClasses[position], tooltipClassName),
|
|
119
|
-
style: { zIndex, animationDelay: animationDelay + "ms" },
|
|
120
|
-
children: [
|
|
121
|
-
tooltip,
|
|
122
|
-
/* @__PURE__ */ jsx2(
|
|
123
|
-
"div",
|
|
124
|
-
{
|
|
125
|
-
className: clsx(`absolute w-0 h-0`, triangleClasses[position]),
|
|
126
|
-
style: { ...triangleStyle[position], zIndex }
|
|
127
|
-
}
|
|
128
|
-
)
|
|
129
|
-
]
|
|
130
|
-
}
|
|
131
|
-
)
|
|
132
|
-
]
|
|
133
|
-
}
|
|
134
|
-
);
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
// src/components/modals/ModalRegister.tsx
|
|
138
|
-
import { createContext as createContext2, useState as useState4 } from "react";
|
|
139
|
-
|
|
140
|
-
// src/util/noop.ts
|
|
141
|
-
var noop = () => void 0;
|
|
142
|
-
|
|
143
|
-
// src/components/modals/ModalRegister.tsx
|
|
144
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
145
|
-
var ModalContext = createContext2({
|
|
146
|
-
register: [],
|
|
147
|
-
addToRegister: noop,
|
|
148
|
-
removeFromRegister: noop
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
// src/components/modals/Modal.tsx
|
|
152
|
-
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
153
|
-
var defaultModalHeaderTranslation = {
|
|
154
|
-
en: {
|
|
155
|
-
close: "Close"
|
|
156
|
-
},
|
|
157
|
-
de: {
|
|
158
|
-
close: "Schlie\xDFen"
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
var ModalHeader = ({
|
|
162
|
-
overwriteTranslation,
|
|
163
|
-
onCloseClick,
|
|
164
|
-
title,
|
|
165
|
-
titleText = "",
|
|
166
|
-
description,
|
|
167
|
-
descriptionText = ""
|
|
168
|
-
}) => {
|
|
169
|
-
const translation = useTranslation(defaultModalHeaderTranslation, overwriteTranslation);
|
|
170
|
-
return /* @__PURE__ */ jsxs2("div", { className: "col", children: [
|
|
171
|
-
/* @__PURE__ */ jsxs2("div", { className: "row justify-between items-start gap-x-8", children: [
|
|
172
|
-
title ?? /* @__PURE__ */ jsx4("span", { className: clsx2("textstyle-title-lg", {
|
|
173
|
-
"mb-1": description || descriptionText
|
|
174
|
-
}), children: titleText }),
|
|
175
|
-
!!onCloseClick && /* @__PURE__ */ jsx4(Tooltip, { tooltip: translation.close, children: /* @__PURE__ */ jsx4("button", { className: "row bg-gray-200 hover:bg-gray-300 rounded-md p-1", onClick: onCloseClick, children: /* @__PURE__ */ jsx4(X, {}) }) })
|
|
176
|
-
] }),
|
|
177
|
-
description ?? /* @__PURE__ */ jsx4("span", { className: "textstyle-description", children: descriptionText })
|
|
178
|
-
] });
|
|
179
|
-
};
|
|
180
|
-
var modalRootName = "modal-root";
|
|
181
|
-
var Modal = ({
|
|
182
|
-
children,
|
|
183
|
-
id,
|
|
184
|
-
isOpen,
|
|
185
|
-
onBackgroundClick,
|
|
186
|
-
backgroundClassName = "",
|
|
187
|
-
modalClassName = "",
|
|
188
|
-
containerClassName = "",
|
|
189
|
-
...modalHeaderProps
|
|
190
|
-
}) => {
|
|
191
|
-
const modalRoot = typeof window !== "undefined" ? document.getElementById(modalRootName) : null;
|
|
192
|
-
const {
|
|
193
|
-
register,
|
|
194
|
-
addToRegister,
|
|
195
|
-
removeFromRegister
|
|
196
|
-
} = useContext2(ModalContext);
|
|
197
|
-
if (!id) {
|
|
198
|
-
console.error("the id cannot be empty");
|
|
199
|
-
}
|
|
200
|
-
useEffect4(() => {
|
|
201
|
-
if (isOpen) {
|
|
202
|
-
addToRegister(id);
|
|
203
|
-
} else {
|
|
204
|
-
removeFromRegister(id);
|
|
205
|
-
}
|
|
206
|
-
}, [addToRegister, id, removeFromRegister, isOpen]);
|
|
207
|
-
if (modalRoot === null || !isOpen) return null;
|
|
208
|
-
const isLast = register.length < 1 || register[register.length - 1] === id;
|
|
209
|
-
const isSecondLast = register.length < 2 || register[register.length - 2] === id;
|
|
210
|
-
return ReactDOM.createPortal(
|
|
211
|
-
/* @__PURE__ */ jsxs2("div", { className: clsx2("fixed inset-0 overflow-y-auto z-[99]", containerClassName), id, children: [
|
|
212
|
-
isLast && /* @__PURE__ */ jsx4(
|
|
213
|
-
"div",
|
|
214
|
-
{
|
|
215
|
-
className: clsx2("fixed inset-0 h-screen w-screen", backgroundClassName, {
|
|
216
|
-
"bg-black/70": isLast && register.length === 1
|
|
217
|
-
}),
|
|
218
|
-
onClick: onBackgroundClick
|
|
219
|
-
}
|
|
220
|
-
),
|
|
221
|
-
/* @__PURE__ */ jsxs2(
|
|
222
|
-
"div",
|
|
223
|
-
{
|
|
224
|
-
className: clsx2("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),
|
|
225
|
-
children: [
|
|
226
|
-
/* @__PURE__ */ jsx4(ModalHeader, { ...modalHeaderProps }),
|
|
227
|
-
children
|
|
228
|
-
]
|
|
229
|
-
}
|
|
230
|
-
),
|
|
231
|
-
!isLast && /* @__PURE__ */ jsx4(
|
|
232
|
-
"div",
|
|
233
|
-
{
|
|
234
|
-
className: clsx2("fixed inset-0 h-screen w-screen", backgroundClassName, {
|
|
235
|
-
"bg-black/70": isSecondLast && register.length > 1
|
|
236
|
-
})
|
|
237
|
-
}
|
|
238
|
-
)
|
|
239
|
-
] }),
|
|
240
|
-
modalRoot,
|
|
241
|
-
id
|
|
242
|
-
);
|
|
243
|
-
};
|
|
244
|
-
export {
|
|
245
|
-
Modal,
|
|
246
|
-
ModalHeader,
|
|
247
|
-
modalRootName
|
|
248
|
-
};
|
|
249
|
-
//# sourceMappingURL=Modal.mjs.map
|