@helpwave/hightide 0.1.6 → 0.1.7
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.cts → shading.d.mts} +1 -1
- package/dist/coloring/shading.js +14 -3329
- package/dist/coloring/shading.js.map +1 -1
- package/dist/coloring/shading.mjs +47 -0
- package/dist/coloring/shading.mjs.map +1 -0
- package/dist/coloring/types.js +26 -2
- package/dist/coloring/types.js.map +1 -1
- package/dist/coloring/types.mjs +6 -0
- package/dist/coloring/{types.cjs.map → types.mjs.map} +1 -1
- package/dist/components/branding/HelpwaveBadge.js +59 -25
- package/dist/components/branding/HelpwaveBadge.js.map +1 -1
- package/dist/components/branding/HelpwaveBadge.mjs +122 -0
- package/dist/components/branding/HelpwaveBadge.mjs.map +1 -0
- package/dist/components/date/{DatePicker.d.cts → DatePicker.d.mts} +5 -5
- package/dist/components/date/DatePicker.js +119 -83
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/{DatePicker.cjs → DatePicker.mjs} +85 -120
- package/dist/components/date/DatePicker.mjs.map +1 -0
- package/dist/components/date/{DayPicker.d.cts → DayPicker.d.mts} +1 -1
- package/dist/components/date/DayPicker.js +55 -18
- package/dist/components/date/DayPicker.js.map +1 -1
- package/dist/components/date/{DayPicker.cjs → DayPicker.mjs} +19 -57
- package/dist/components/date/DayPicker.mjs.map +1 -0
- package/dist/components/date/{TimeDisplay.d.cts → TimeDisplay.d.mts} +2 -2
- package/dist/components/date/TimeDisplay.js +35 -9
- package/dist/components/date/TimeDisplay.js.map +1 -1
- package/dist/components/date/{TimeDisplay.cjs → TimeDisplay.mjs} +10 -37
- package/dist/components/date/TimeDisplay.mjs.map +1 -0
- package/dist/components/date/TimePicker.js +57 -22
- package/dist/components/date/TimePicker.js.map +1 -1
- package/dist/components/date/{TimePicker.cjs → TimePicker.mjs} +23 -59
- package/dist/components/date/TimePicker.mjs.map +1 -0
- package/dist/components/date/{YearMonthPicker.d.cts → YearMonthPicker.d.mts} +1 -1
- package/dist/components/date/YearMonthPicker.d.ts +1 -1
- package/dist/components/date/YearMonthPicker.js +73 -38
- package/dist/components/date/YearMonthPicker.js.map +1 -1
- package/dist/components/date/{YearMonthPicker.cjs → YearMonthPicker.mjs} +39 -75
- package/dist/components/date/YearMonthPicker.mjs.map +1 -0
- package/dist/components/dialogs/{ConfirmDialog.d.cts → ConfirmDialog.d.mts} +4 -4
- package/dist/components/dialogs/ConfirmDialog.js +98 -62
- package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
- package/dist/components/dialogs/{ConfirmDialog.cjs → ConfirmDialog.mjs} +63 -100
- package/dist/components/dialogs/ConfirmDialog.mjs.map +1 -0
- package/dist/components/icons-and-geometry/Avatar.js +47 -10
- package/dist/components/icons-and-geometry/Avatar.js.map +1 -1
- package/dist/components/icons-and-geometry/Avatar.mjs +81 -0
- package/dist/components/icons-and-geometry/{Avatar.cjs.map → Avatar.mjs.map} +1 -1
- package/dist/components/icons-and-geometry/Circle.js +40 -6
- package/dist/components/icons-and-geometry/Circle.js.map +1 -1
- package/dist/components/icons-and-geometry/Circle.mjs +27 -0
- package/dist/components/icons-and-geometry/{Circle.cjs.map → Circle.mjs.map} +1 -1
- package/dist/components/icons-and-geometry/Helpwave.js +38 -14
- package/dist/components/icons-and-geometry/Helpwave.js.map +1 -1
- package/dist/components/icons-and-geometry/Helpwave.mjs +75 -0
- package/dist/components/icons-and-geometry/{Helpwave.cjs.map → Helpwave.mjs.map} +1 -1
- package/dist/components/icons-and-geometry/Ring.js +74 -37
- package/dist/components/icons-and-geometry/Ring.js.map +1 -1
- package/dist/components/icons-and-geometry/{Ring.cjs → Ring.mjs} +38 -76
- package/dist/components/icons-and-geometry/{Ring.cjs.map → Ring.mjs.map} +1 -1
- package/dist/components/icons-and-geometry/Tag.js +28 -4
- package/dist/components/icons-and-geometry/Tag.js.map +1 -1
- package/dist/components/icons-and-geometry/Tag.mjs +22 -0
- package/dist/components/icons-and-geometry/{Tag.cjs.map → Tag.mjs.map} +1 -1
- package/dist/components/layout-and-navigation/BreadCrumb.js +195 -191
- package/dist/components/layout-and-navigation/BreadCrumb.js.map +1 -1
- package/dist/components/layout-and-navigation/{BreadCrumb.cjs → BreadCrumb.mjs} +191 -198
- package/dist/components/layout-and-navigation/{BreadCrumb.cjs.map → BreadCrumb.mjs.map} +1 -1
- package/dist/components/layout-and-navigation/Carousel.js +68 -34
- package/dist/components/layout-and-navigation/Carousel.js.map +1 -1
- package/dist/components/layout-and-navigation/{Carousel.cjs → Carousel.mjs} +35 -70
- package/dist/components/layout-and-navigation/{Carousel.cjs.map → Carousel.mjs.map} +1 -1
- package/dist/components/layout-and-navigation/Chip.js +43 -8
- package/dist/components/layout-and-navigation/Chip.js.map +1 -1
- package/dist/components/layout-and-navigation/Chip.mjs +69 -0
- package/dist/components/layout-and-navigation/{Chip.cjs.map → Chip.mjs.map} +1 -1
- package/dist/components/layout-and-navigation/DividerInserter.js +39 -5
- package/dist/components/layout-and-navigation/DividerInserter.js.map +1 -1
- package/dist/components/layout-and-navigation/DividerInserter.mjs +25 -0
- package/dist/components/layout-and-navigation/{DividerInserter.cjs.map → DividerInserter.mjs.map} +1 -1
- package/dist/components/layout-and-navigation/Expandable.js +52 -17
- package/dist/components/layout-and-navigation/Expandable.js.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.mjs +81 -0
- package/dist/components/layout-and-navigation/Expandable.mjs.map +1 -0
- package/dist/components/layout-and-navigation/{FAQSection.d.cts → FAQSection.d.mts} +1 -1
- package/dist/components/layout-and-navigation/FAQSection.js +75 -41
- package/dist/components/layout-and-navigation/FAQSection.js.map +1 -1
- package/dist/components/layout-and-navigation/{FAQSection.cjs → FAQSection.mjs} +42 -77
- package/dist/components/layout-and-navigation/FAQSection.mjs.map +1 -0
- package/dist/components/layout-and-navigation/{MarkdownInterpreter.d.cts → MarkdownInterpreter.d.mts} +1 -1
- package/dist/components/layout-and-navigation/MarkdownInterpreter.d.ts +1 -1
- package/dist/components/layout-and-navigation/MarkdownInterpreter.js +43 -18
- package/dist/components/layout-and-navigation/MarkdownInterpreter.js.map +1 -1
- package/dist/components/layout-and-navigation/{MarkdownInterpreter.cjs → MarkdownInterpreter.mjs} +19 -45
- package/dist/components/layout-and-navigation/{MarkdownInterpreter.cjs.map → MarkdownInterpreter.mjs.map} +1 -1
- package/dist/components/layout-and-navigation/{Overlay.d.cts → Overlay.d.mts} +3 -3
- package/dist/components/layout-and-navigation/Overlay.d.ts +1 -1
- package/dist/components/layout-and-navigation/Overlay.js +91 -54
- package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
- package/dist/components/layout-and-navigation/{Overlay.cjs → Overlay.mjs} +55 -93
- package/dist/components/layout-and-navigation/Overlay.mjs.map +1 -0
- package/dist/components/layout-and-navigation/{Pagination.d.cts → Pagination.d.mts} +2 -2
- package/dist/components/layout-and-navigation/Pagination.js +53 -19
- package/dist/components/layout-and-navigation/Pagination.js.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.mjs +82 -0
- package/dist/components/layout-and-navigation/Pagination.mjs.map +1 -0
- package/dist/components/layout-and-navigation/{SearchableList.d.cts → SearchableList.d.mts} +2 -2
- package/dist/components/layout-and-navigation/SearchableList.js +76 -42
- package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.mjs +252 -0
- package/dist/components/layout-and-navigation/SearchableList.mjs.map +1 -0
- package/dist/components/layout-and-navigation/{StepperBar.d.cts → StepperBar.d.mts} +3 -3
- package/dist/components/layout-and-navigation/StepperBar.d.ts +1 -1
- package/dist/components/layout-and-navigation/StepperBar.js +69 -34
- package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
- package/dist/components/layout-and-navigation/{StepperBar.cjs → StepperBar.mjs} +35 -71
- package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -0
- package/dist/components/layout-and-navigation/{Table.d.cts → Table.d.mts} +4 -4
- package/dist/components/layout-and-navigation/Table.d.ts +3 -3
- package/dist/components/layout-and-navigation/Table.js +111 -68
- package/dist/components/layout-and-navigation/Table.js.map +1 -1
- package/dist/components/layout-and-navigation/{Table.cjs → Table.mjs} +69 -113
- package/dist/components/layout-and-navigation/Table.mjs.map +1 -0
- package/dist/components/layout-and-navigation/{TextImage.d.cts → TextImage.d.mts} +2 -2
- package/dist/components/layout-and-navigation/TextImage.js +54 -18
- package/dist/components/layout-and-navigation/TextImage.js.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.mjs +101 -0
- package/dist/components/layout-and-navigation/TextImage.mjs.map +1 -0
- package/dist/components/layout-and-navigation/Tile.js +42 -8
- package/dist/components/layout-and-navigation/Tile.js.map +1 -1
- package/dist/components/layout-and-navigation/Tile.mjs +23 -0
- package/dist/components/layout-and-navigation/{Tile.cjs.map → Tile.mjs.map} +1 -1
- package/dist/components/layout-and-navigation/VerticalDivider.js +33 -9
- package/dist/components/layout-and-navigation/VerticalDivider.js.map +1 -1
- package/dist/components/layout-and-navigation/VerticalDivider.mjs +56 -0
- package/dist/components/layout-and-navigation/{VerticalDivider.cjs.map → VerticalDivider.mjs.map} +1 -1
- package/dist/components/loading-states/{ErrorComponent.d.cts → ErrorComponent.d.mts} +2 -2
- package/dist/components/loading-states/ErrorComponent.js +46 -12
- package/dist/components/loading-states/ErrorComponent.js.map +1 -1
- package/dist/components/loading-states/ErrorComponent.mjs +68 -0
- package/dist/components/loading-states/ErrorComponent.mjs.map +1 -0
- package/dist/components/loading-states/{LoadingAndErrorComponent.d.cts → LoadingAndErrorComponent.d.mts} +5 -5
- package/dist/components/loading-states/LoadingAndErrorComponent.d.ts +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.js +68 -34
- package/dist/components/loading-states/LoadingAndErrorComponent.js.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs +194 -0
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs.map +1 -0
- package/dist/components/loading-states/{LoadingAnimation.d.cts → LoadingAnimation.d.mts} +2 -2
- package/dist/components/loading-states/LoadingAnimation.js +59 -23
- package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.mjs +139 -0
- package/dist/components/loading-states/LoadingAnimation.mjs.map +1 -0
- package/dist/components/loading-states/{LoadingButton.d.cts → LoadingButton.d.mts} +1 -1
- package/dist/components/loading-states/LoadingButton.js +62 -28
- package/dist/components/loading-states/LoadingButton.js.map +1 -1
- package/dist/components/loading-states/{LoadingButton.cjs → LoadingButton.mjs} +29 -64
- package/dist/components/loading-states/LoadingButton.mjs.map +1 -0
- package/dist/components/loading-states/ProgressIndicator.js +30 -6
- package/dist/components/loading-states/ProgressIndicator.js.map +1 -1
- package/dist/components/loading-states/ProgressIndicator.mjs +59 -0
- package/dist/components/loading-states/{ProgressIndicator.cjs.map → ProgressIndicator.mjs.map} +1 -1
- package/dist/components/modals/{ConfirmModal.d.cts → ConfirmModal.d.mts} +4 -4
- package/dist/components/modals/ConfirmModal.js +99 -63
- package/dist/components/modals/ConfirmModal.js.map +1 -1
- package/dist/components/modals/{ConfirmModal.cjs → ConfirmModal.mjs} +64 -101
- package/dist/components/modals/ConfirmModal.mjs.map +1 -0
- package/dist/components/modals/{DiscardChangesModal.d.cts → DiscardChangesModal.d.mts} +5 -5
- package/dist/components/modals/DiscardChangesModal.js +101 -65
- package/dist/components/modals/DiscardChangesModal.js.map +1 -1
- package/dist/components/modals/{DiscardChangesModal.cjs → DiscardChangesModal.mjs} +66 -103
- package/dist/components/modals/DiscardChangesModal.mjs.map +1 -0
- package/dist/components/modals/{InputModal.d.cts → InputModal.d.mts} +7 -7
- package/dist/components/modals/InputModal.js +124 -88
- package/dist/components/modals/InputModal.js.map +1 -1
- package/dist/components/modals/{InputModal.cjs → InputModal.mjs} +89 -126
- package/dist/components/modals/InputModal.mjs.map +1 -0
- package/dist/components/modals/{LanguageModal.d.cts → LanguageModal.d.mts} +3 -3
- package/dist/components/modals/LanguageModal.js +130 -95
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/{LanguageModal.cjs → LanguageModal.mjs} +95 -133
- package/dist/components/modals/LanguageModal.mjs.map +1 -0
- package/dist/components/modals/{ThemeModal.d.cts → ThemeModal.d.mts} +4 -4
- package/dist/components/modals/ThemeModal.js +134 -99
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/{ThemeModal.cjs → ThemeModal.mjs} +99 -137
- package/dist/components/modals/ThemeModal.mjs.map +1 -0
- package/dist/components/properties/{CheckboxProperty.d.cts → CheckboxProperty.d.mts} +3 -3
- package/dist/components/properties/CheckboxProperty.js +87 -53
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/{CheckboxProperty.cjs → CheckboxProperty.mjs} +54 -89
- package/dist/components/properties/CheckboxProperty.mjs.map +1 -0
- package/dist/components/properties/{DateProperty.d.cts → DateProperty.d.mts} +3 -3
- package/dist/components/properties/DateProperty.js +94 -60
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/{DateProperty.cjs → DateProperty.mjs} +61 -96
- package/dist/components/properties/DateProperty.mjs.map +1 -0
- package/dist/components/properties/{MultiSelectProperty.d.cts → MultiSelectProperty.d.mts} +5 -5
- package/dist/components/properties/MultiSelectProperty.js +157 -123
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/{MultiSelectProperty.cjs → MultiSelectProperty.mjs} +124 -159
- package/dist/components/properties/MultiSelectProperty.mjs.map +1 -0
- package/dist/components/properties/{NumberProperty.d.cts → NumberProperty.d.mts} +3 -3
- package/dist/components/properties/NumberProperty.js +95 -61
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/{NumberProperty.cjs → NumberProperty.mjs} +62 -97
- package/dist/components/properties/NumberProperty.mjs.map +1 -0
- package/dist/components/properties/{PropertyBase.d.cts → PropertyBase.d.mts} +2 -2
- package/dist/components/properties/PropertyBase.js +63 -29
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs +188 -0
- package/dist/components/properties/PropertyBase.mjs.map +1 -0
- package/dist/components/properties/{SelectProperty.d.cts → SelectProperty.d.mts} +5 -5
- package/dist/components/properties/SelectProperty.js +119 -86
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/{SelectProperty.cjs → SelectProperty.mjs} +86 -122
- package/dist/components/properties/SelectProperty.mjs.map +1 -0
- package/dist/components/properties/{TextProperty.d.cts → TextProperty.d.mts} +3 -3
- package/dist/components/properties/TextProperty.js +92 -58
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/{TextProperty.cjs → TextProperty.mjs} +59 -94
- package/dist/components/properties/TextProperty.mjs.map +1 -0
- package/dist/components/user-action/Button.js +67 -28
- package/dist/components/user-action/Button.js.map +1 -1
- package/dist/components/user-action/{Button.cjs → Button.mjs} +29 -69
- package/dist/components/user-action/{Button.cjs.map → Button.mjs.map} +1 -1
- package/dist/components/user-action/{Checkbox.d.cts → Checkbox.d.mts} +1 -1
- package/dist/components/user-action/Checkbox.js +58 -23
- package/dist/components/user-action/Checkbox.js.map +1 -1
- package/dist/components/user-action/Checkbox.mjs +122 -0
- package/dist/components/user-action/Checkbox.mjs.map +1 -0
- package/dist/components/user-action/{DateAndTimePicker.d.cts → DateAndTimePicker.d.mts} +7 -7
- package/dist/components/user-action/DateAndTimePicker.js +142 -107
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/{DateAndTimePicker.cjs → DateAndTimePicker.mjs} +109 -143
- package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -0
- package/dist/components/user-action/{Input.d.cts → Input.d.mts} +1 -1
- package/dist/components/user-action/Input.js +62 -26
- package/dist/components/user-action/Input.js.map +1 -1
- package/dist/components/user-action/Input.mjs +186 -0
- package/dist/components/user-action/Input.mjs.map +1 -0
- package/dist/components/user-action/Label.js +39 -5
- package/dist/components/user-action/Label.js.map +1 -1
- package/dist/components/user-action/Label.mjs +21 -0
- package/dist/components/user-action/{Label.cjs.map → Label.mjs.map} +1 -1
- package/dist/components/user-action/Menu.js +54 -19
- package/dist/components/user-action/Menu.js.map +1 -1
- package/dist/components/user-action/Menu.mjs +127 -0
- package/dist/components/user-action/Menu.mjs.map +1 -0
- package/dist/components/user-action/{MultiSelect.d.cts → MultiSelect.d.mts} +3 -3
- package/dist/components/user-action/MultiSelect.js +118 -84
- package/dist/components/user-action/MultiSelect.js.map +1 -1
- package/dist/components/user-action/{MultiSelect.cjs → MultiSelect.mjs} +85 -120
- package/dist/components/user-action/MultiSelect.mjs.map +1 -0
- package/dist/components/user-action/ScrollPicker.js +50 -16
- package/dist/components/user-action/ScrollPicker.js.map +1 -1
- package/dist/components/user-action/{ScrollPicker.cjs → ScrollPicker.mjs} +17 -52
- package/dist/components/user-action/ScrollPicker.mjs.map +1 -0
- package/dist/components/user-action/{Select.d.cts → Select.d.mts} +2 -2
- package/dist/components/user-action/Select.d.ts +1 -1
- package/dist/components/user-action/Select.js +88 -53
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/{Select.cjs → Select.mjs} +53 -91
- package/dist/components/user-action/Select.mjs.map +1 -0
- package/dist/components/user-action/{Textarea.d.cts → Textarea.d.mts} +1 -1
- package/dist/components/user-action/Textarea.js +60 -25
- package/dist/components/user-action/Textarea.js.map +1 -1
- package/dist/components/user-action/Textarea.mjs +163 -0
- package/dist/components/user-action/Textarea.mjs.map +1 -0
- package/dist/components/user-action/ToggleableInput.js +61 -26
- package/dist/components/user-action/ToggleableInput.js.map +1 -1
- package/dist/components/user-action/ToggleableInput.mjs +156 -0
- package/dist/components/user-action/ToggleableInput.mjs.map +1 -0
- package/dist/components/user-action/Tooltip.js +41 -15
- package/dist/components/user-action/Tooltip.js.map +1 -1
- package/dist/components/user-action/{Tooltip.cjs → Tooltip.mjs} +16 -43
- package/dist/components/user-action/Tooltip.mjs.map +1 -0
- package/dist/css/globals.css +33 -24
- package/dist/css/uncompiled/globals.css +19 -7
- package/dist/hooks/useHoverState.js +31 -7
- package/dist/hooks/useHoverState.js.map +1 -1
- package/dist/hooks/useHoverState.mjs +47 -0
- package/dist/hooks/{useHoverState.cjs.map → useHoverState.mjs.map} +1 -1
- package/dist/hooks/useLocalStorage.js +31 -7
- package/dist/hooks/useLocalStorage.js.map +1 -1
- package/dist/hooks/useLocalStorage.mjs +58 -0
- package/dist/hooks/{useLocalStorage.cjs.map → useLocalStorage.mjs.map} +1 -1
- package/dist/hooks/useOutsideClick.js +28 -4
- package/dist/hooks/useOutsideClick.js.map +1 -1
- package/dist/hooks/useOutsideClick.mjs +23 -0
- package/dist/hooks/{useOutsideClick.cjs.map → useOutsideClick.mjs.map} +1 -1
- package/dist/hooks/useSaveDelay.js +30 -6
- package/dist/hooks/useSaveDelay.js.map +1 -1
- package/dist/hooks/useSaveDelay.mjs +43 -0
- package/dist/hooks/{useSaveDelay.cjs.map → useSaveDelay.mjs.map} +1 -1
- package/dist/{index.d.cts → index.d.mts} +78 -78
- package/dist/index.js +1038 -885
- package/dist/index.js.map +1 -1
- package/dist/{index.cjs → index.mjs} +886 -1038
- package/dist/index.mjs.map +1 -0
- package/dist/localization/{LanguageProvider.d.cts → LanguageProvider.d.mts} +1 -1
- package/dist/localization/LanguageProvider.js +43 -16
- package/dist/localization/LanguageProvider.js.map +1 -1
- package/dist/localization/{LanguageProvider.cjs → LanguageProvider.mjs} +17 -45
- package/dist/localization/LanguageProvider.mjs.map +1 -0
- package/dist/localization/{useTranslation.d.cts → useTranslation.d.mts} +1 -1
- package/dist/localization/useTranslation.js +33 -7
- package/dist/localization/useTranslation.js.map +1 -1
- package/dist/localization/useTranslation.mjs +42 -0
- package/dist/localization/useTranslation.mjs.map +1 -0
- package/dist/localization/util.js +26 -2
- package/dist/localization/util.js.map +1 -1
- package/dist/localization/util.mjs +16 -0
- package/dist/localization/{util.cjs.map → util.mjs.map} +1 -1
- package/dist/theming/{useTheme.d.cts → useTheme.d.mts} +2 -2
- package/dist/theming/useTheme.js +37 -10
- package/dist/theming/useTheme.js.map +1 -1
- package/dist/theming/useTheme.mjs +48 -0
- package/dist/theming/useTheme.mjs.map +1 -0
- package/dist/util/array.js +32 -2
- package/dist/util/array.js.map +1 -1
- package/dist/util/{array.cjs → array.mjs} +3 -34
- package/dist/util/{array.cjs.map → array.mjs.map} +1 -1
- package/dist/util/builder.js +26 -2
- package/dist/util/builder.js.map +1 -1
- package/dist/util/builder.mjs +9 -0
- package/dist/util/{builder.cjs.map → builder.mjs.map} +1 -1
- package/dist/util/date.js +39 -2
- package/dist/util/date.js.map +1 -1
- package/dist/util/{date.cjs → date.mjs} +3 -41
- package/dist/util/date.mjs.map +1 -0
- package/dist/util/easeFunctions.js +28 -2
- package/dist/util/easeFunctions.js.map +1 -1
- package/dist/util/easeFunctions.mjs +36 -0
- package/dist/util/easeFunctions.mjs.map +1 -0
- package/dist/util/emailValidation.js +26 -2
- package/dist/util/emailValidation.js.map +1 -1
- package/dist/util/emailValidation.mjs +8 -0
- package/dist/util/{emailValidation.cjs.map → emailValidation.mjs.map} +1 -1
- package/dist/util/loopingArray.js +26 -2
- package/dist/util/loopingArray.js.map +1 -1
- package/dist/util/{loopingArray.cjs → loopingArray.mjs} +3 -28
- package/dist/util/{loopingArray.cjs.map → loopingArray.mjs.map} +1 -1
- package/dist/util/math.js +26 -2
- package/dist/util/math.js.map +1 -1
- package/dist/util/math.mjs +8 -0
- package/dist/util/{math.cjs.map → math.mjs.map} +1 -1
- package/dist/util/news.d.mts +101 -0
- package/dist/util/news.d.ts +54 -54
- package/dist/util/news.js +39 -12
- package/dist/util/news.js.map +1 -1
- package/dist/util/news.mjs +49 -0
- package/dist/util/news.mjs.map +1 -0
- package/dist/util/noop.d.mts +3 -0
- package/dist/util/noop.d.ts +1 -1
- package/dist/util/noop.js +26 -2
- package/dist/util/noop.js.map +1 -1
- package/dist/util/noop.mjs +6 -0
- package/dist/util/noop.mjs.map +1 -0
- package/dist/util/simpleSearch.js +29 -2
- package/dist/util/simpleSearch.js.map +1 -1
- package/dist/util/simpleSearch.mjs +26 -0
- package/dist/util/{simpleSearch.cjs.map → simpleSearch.mjs.map} +1 -1
- package/dist/util/storage.js +27 -2
- package/dist/util/storage.js.map +1 -1
- package/dist/util/storage.mjs +38 -0
- package/dist/util/{storage.cjs.map → storage.mjs.map} +1 -1
- package/dist/util/types.js +17 -0
- package/dist/util/types.js.map +1 -1
- package/dist/util/types.mjs +1 -0
- package/dist/util/types.mjs.map +1 -0
- package/package.json +5 -7
- package/dist/coloring/shading.cjs +0 -3402
- package/dist/coloring/shading.cjs.map +0 -1
- package/dist/coloring/types.cjs +0 -31
- package/dist/components/branding/HelpwaveBadge.cjs +0 -157
- package/dist/components/branding/HelpwaveBadge.cjs.map +0 -1
- package/dist/components/date/DatePicker.cjs.map +0 -1
- package/dist/components/date/DayPicker.cjs.map +0 -1
- package/dist/components/date/TimeDisplay.cjs.map +0 -1
- package/dist/components/date/TimePicker.cjs.map +0 -1
- package/dist/components/date/YearMonthPicker.cjs.map +0 -1
- package/dist/components/dialogs/ConfirmDialog.cjs.map +0 -1
- package/dist/components/icons-and-geometry/Avatar.cjs +0 -119
- package/dist/components/icons-and-geometry/Circle.cjs +0 -62
- package/dist/components/icons-and-geometry/Helpwave.cjs +0 -100
- package/dist/components/icons-and-geometry/Tag.cjs +0 -47
- package/dist/components/layout-and-navigation/Chip.cjs +0 -105
- package/dist/components/layout-and-navigation/DividerInserter.cjs +0 -60
- package/dist/components/layout-and-navigation/Expandable.cjs +0 -117
- package/dist/components/layout-and-navigation/Expandable.cjs.map +0 -1
- package/dist/components/layout-and-navigation/FAQSection.cjs.map +0 -1
- package/dist/components/layout-and-navigation/Overlay.cjs.map +0 -1
- package/dist/components/layout-and-navigation/Pagination.cjs +0 -117
- package/dist/components/layout-and-navigation/Pagination.cjs.map +0 -1
- package/dist/components/layout-and-navigation/SearchableList.cjs +0 -287
- package/dist/components/layout-and-navigation/SearchableList.cjs.map +0 -1
- package/dist/components/layout-and-navigation/StepperBar.cjs.map +0 -1
- package/dist/components/layout-and-navigation/Table.cjs.map +0 -1
- package/dist/components/layout-and-navigation/TextImage.cjs +0 -138
- package/dist/components/layout-and-navigation/TextImage.cjs.map +0 -1
- package/dist/components/layout-and-navigation/Tile.cjs +0 -58
- package/dist/components/layout-and-navigation/VerticalDivider.cjs +0 -81
- package/dist/components/loading-states/ErrorComponent.cjs +0 -103
- package/dist/components/loading-states/ErrorComponent.cjs.map +0 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.cjs +0 -229
- package/dist/components/loading-states/LoadingAndErrorComponent.cjs.map +0 -1
- package/dist/components/loading-states/LoadingAnimation.cjs +0 -176
- package/dist/components/loading-states/LoadingAnimation.cjs.map +0 -1
- package/dist/components/loading-states/LoadingButton.cjs.map +0 -1
- package/dist/components/loading-states/ProgressIndicator.cjs +0 -84
- package/dist/components/modals/ConfirmModal.cjs.map +0 -1
- package/dist/components/modals/DiscardChangesModal.cjs.map +0 -1
- package/dist/components/modals/InputModal.cjs.map +0 -1
- package/dist/components/modals/LanguageModal.cjs.map +0 -1
- package/dist/components/modals/ThemeModal.cjs.map +0 -1
- package/dist/components/properties/CheckboxProperty.cjs.map +0 -1
- package/dist/components/properties/DateProperty.cjs.map +0 -1
- package/dist/components/properties/MultiSelectProperty.cjs.map +0 -1
- package/dist/components/properties/NumberProperty.cjs.map +0 -1
- package/dist/components/properties/PropertyBase.cjs +0 -223
- package/dist/components/properties/PropertyBase.cjs.map +0 -1
- package/dist/components/properties/SelectProperty.cjs.map +0 -1
- package/dist/components/properties/TextProperty.cjs.map +0 -1
- package/dist/components/user-action/Checkbox.cjs +0 -158
- package/dist/components/user-action/Checkbox.cjs.map +0 -1
- package/dist/components/user-action/DateAndTimePicker.cjs.map +0 -1
- package/dist/components/user-action/Input.cjs +0 -223
- package/dist/components/user-action/Input.cjs.map +0 -1
- package/dist/components/user-action/Label.cjs +0 -56
- package/dist/components/user-action/Menu.cjs +0 -163
- package/dist/components/user-action/Menu.cjs.map +0 -1
- package/dist/components/user-action/MultiSelect.cjs.map +0 -1
- package/dist/components/user-action/ScrollPicker.cjs.map +0 -1
- package/dist/components/user-action/Select.cjs.map +0 -1
- package/dist/components/user-action/Textarea.cjs +0 -199
- package/dist/components/user-action/Textarea.cjs.map +0 -1
- package/dist/components/user-action/ToggleableInput.cjs +0 -192
- package/dist/components/user-action/ToggleableInput.cjs.map +0 -1
- package/dist/components/user-action/Tooltip.cjs.map +0 -1
- package/dist/hooks/useHoverState.cjs +0 -72
- package/dist/hooks/useLocalStorage.cjs +0 -83
- package/dist/hooks/useOutsideClick.cjs +0 -48
- package/dist/hooks/useSaveDelay.cjs +0 -68
- package/dist/index.cjs.map +0 -1
- package/dist/localization/LanguageProvider.cjs.map +0 -1
- package/dist/localization/useTranslation.cjs +0 -69
- package/dist/localization/useTranslation.cjs.map +0 -1
- package/dist/localization/util.cjs +0 -41
- package/dist/theming/useTheme.cjs +0 -76
- package/dist/theming/useTheme.cjs.map +0 -1
- package/dist/util/builder.cjs +0 -34
- package/dist/util/date.cjs.map +0 -1
- package/dist/util/easeFunctions.cjs +0 -63
- package/dist/util/easeFunctions.cjs.map +0 -1
- package/dist/util/emailValidation.cjs +0 -33
- package/dist/util/math.cjs +0 -33
- package/dist/util/news.cjs +0 -77
- package/dist/util/news.cjs.map +0 -1
- package/dist/util/news.d.cts +0 -101
- package/dist/util/noop.cjs +0 -31
- package/dist/util/noop.cjs.map +0 -1
- package/dist/util/noop.d.cts +0 -3
- package/dist/util/simpleSearch.cjs +0 -54
- package/dist/util/storage.cjs +0 -64
- package/dist/util/types.cjs +0 -19
- package/dist/util/types.cjs.map +0 -1
- /package/dist/coloring/{types.d.cts → types.d.mts} +0 -0
- /package/dist/components/branding/{HelpwaveBadge.d.cts → HelpwaveBadge.d.mts} +0 -0
- /package/dist/components/date/{TimePicker.d.cts → TimePicker.d.mts} +0 -0
- /package/dist/components/icons-and-geometry/{Avatar.d.cts → Avatar.d.mts} +0 -0
- /package/dist/components/icons-and-geometry/{Circle.d.cts → Circle.d.mts} +0 -0
- /package/dist/components/icons-and-geometry/{Helpwave.d.cts → Helpwave.d.mts} +0 -0
- /package/dist/components/icons-and-geometry/{Ring.d.cts → Ring.d.mts} +0 -0
- /package/dist/components/icons-and-geometry/{Tag.d.cts → Tag.d.mts} +0 -0
- /package/dist/components/layout-and-navigation/{BreadCrumb.d.cts → BreadCrumb.d.mts} +0 -0
- /package/dist/components/layout-and-navigation/{Carousel.d.cts → Carousel.d.mts} +0 -0
- /package/dist/components/layout-and-navigation/{Chip.d.cts → Chip.d.mts} +0 -0
- /package/dist/components/layout-and-navigation/{DividerInserter.d.cts → DividerInserter.d.mts} +0 -0
- /package/dist/components/layout-and-navigation/{Expandable.d.cts → Expandable.d.mts} +0 -0
- /package/dist/components/layout-and-navigation/{Tile.d.cts → Tile.d.mts} +0 -0
- /package/dist/components/layout-and-navigation/{VerticalDivider.d.cts → VerticalDivider.d.mts} +0 -0
- /package/dist/components/loading-states/{ProgressIndicator.d.cts → ProgressIndicator.d.mts} +0 -0
- /package/dist/components/user-action/{Button.d.cts → Button.d.mts} +0 -0
- /package/dist/components/user-action/{Label.d.cts → Label.d.mts} +0 -0
- /package/dist/components/user-action/{Menu.d.cts → Menu.d.mts} +0 -0
- /package/dist/components/user-action/{ScrollPicker.d.cts → ScrollPicker.d.mts} +0 -0
- /package/dist/components/user-action/{ToggleableInput.d.cts → ToggleableInput.d.mts} +0 -0
- /package/dist/components/user-action/{Tooltip.d.cts → Tooltip.d.mts} +0 -0
- /package/dist/hooks/{useHoverState.d.cts → useHoverState.d.mts} +0 -0
- /package/dist/hooks/{useLocalStorage.d.cts → useLocalStorage.d.mts} +0 -0
- /package/dist/hooks/{useOutsideClick.d.cts → useOutsideClick.d.mts} +0 -0
- /package/dist/hooks/{useSaveDelay.d.cts → useSaveDelay.d.mts} +0 -0
- /package/dist/localization/{util.d.cts → util.d.mts} +0 -0
- /package/dist/util/{array.d.cts → array.d.mts} +0 -0
- /package/dist/util/{builder.d.cts → builder.d.mts} +0 -0
- /package/dist/util/{date.d.cts → date.d.mts} +0 -0
- /package/dist/util/{easeFunctions.d.cts → easeFunctions.d.mts} +0 -0
- /package/dist/util/{emailValidation.d.cts → emailValidation.d.mts} +0 -0
- /package/dist/util/{loopingArray.d.cts → loopingArray.d.mts} +0 -0
- /package/dist/util/{math.d.cts → math.d.mts} +0 -0
- /package/dist/util/{simpleSearch.d.cts → simpleSearch.d.mts} +0 -0
- /package/dist/util/{storage.d.cts → storage.d.mts} +0 -0
- /package/dist/util/{types.d.cts → types.d.mts} +0 -0
|
@@ -1,192 +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/user-action/ToggleableInput.tsx
|
|
31
|
-
var ToggleableInput_exports = {};
|
|
32
|
-
__export(ToggleableInput_exports, {
|
|
33
|
-
ToggleableInput: () => ToggleableInput,
|
|
34
|
-
ToggleableInputUncontrolled: () => ToggleableInputUncontrolled
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(ToggleableInput_exports);
|
|
37
|
-
var import_react2 = require("react");
|
|
38
|
-
var import_lucide_react = require("lucide-react");
|
|
39
|
-
var import_clsx = __toESM(require("clsx"), 1);
|
|
40
|
-
|
|
41
|
-
// src/hooks/useSaveDelay.ts
|
|
42
|
-
var import_react = require("react");
|
|
43
|
-
function useSaveDelay(setNotificationStatus, delay) {
|
|
44
|
-
const [updateTimer, setUpdateTimer] = (0, import_react.useState)(void 0);
|
|
45
|
-
const [notificationTimer, setNotificationTimer] = (0, import_react.useState)(void 0);
|
|
46
|
-
const restartTimer = (onSave) => {
|
|
47
|
-
clearTimeout(updateTimer);
|
|
48
|
-
setUpdateTimer(setTimeout(() => {
|
|
49
|
-
onSave();
|
|
50
|
-
setNotificationStatus(true);
|
|
51
|
-
clearTimeout(notificationTimer);
|
|
52
|
-
setNotificationTimer(setTimeout(() => {
|
|
53
|
-
setNotificationStatus(false);
|
|
54
|
-
clearTimeout(notificationTimer);
|
|
55
|
-
}, delay));
|
|
56
|
-
clearTimeout(updateTimer);
|
|
57
|
-
}, delay));
|
|
58
|
-
};
|
|
59
|
-
const clearUpdateTimer = (hasSaved = true) => {
|
|
60
|
-
clearTimeout(updateTimer);
|
|
61
|
-
if (hasSaved) {
|
|
62
|
-
setNotificationStatus(true);
|
|
63
|
-
clearTimeout(notificationTimer);
|
|
64
|
-
setNotificationTimer(setTimeout(() => {
|
|
65
|
-
setNotificationStatus(false);
|
|
66
|
-
clearTimeout(notificationTimer);
|
|
67
|
-
}, delay));
|
|
68
|
-
} else {
|
|
69
|
-
setNotificationStatus(false);
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
(0, import_react.useEffect)(() => {
|
|
73
|
-
return () => {
|
|
74
|
-
clearTimeout(updateTimer);
|
|
75
|
-
clearTimeout(notificationTimer);
|
|
76
|
-
};
|
|
77
|
-
}, []);
|
|
78
|
-
return { restartTimer, clearUpdateTimer };
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// src/util/noop.ts
|
|
82
|
-
var noop = () => void 0;
|
|
83
|
-
|
|
84
|
-
// src/components/user-action/ToggleableInput.tsx
|
|
85
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
86
|
-
var ToggleableInput = ({
|
|
87
|
-
type = "text",
|
|
88
|
-
value,
|
|
89
|
-
onChange = noop,
|
|
90
|
-
onChangeText = noop,
|
|
91
|
-
onEditCompleted = noop,
|
|
92
|
-
labelClassName = "",
|
|
93
|
-
initialState = "display",
|
|
94
|
-
size = 16,
|
|
95
|
-
disclaimer,
|
|
96
|
-
onBlur,
|
|
97
|
-
...restProps
|
|
98
|
-
}) => {
|
|
99
|
-
const [isEditing, setIsEditing] = (0, import_react2.useState)(initialState !== "display");
|
|
100
|
-
const { restartTimer, clearUpdateTimer } = useSaveDelay(() => void 0, 3e3);
|
|
101
|
-
const ref = (0, import_react2.useRef)(null);
|
|
102
|
-
const onEditCompletedWrapper = (text) => {
|
|
103
|
-
onEditCompleted(text);
|
|
104
|
-
clearUpdateTimer();
|
|
105
|
-
};
|
|
106
|
-
(0, import_react2.useEffect)(() => {
|
|
107
|
-
if (isEditing) {
|
|
108
|
-
ref.current?.focus();
|
|
109
|
-
}
|
|
110
|
-
}, [isEditing]);
|
|
111
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
112
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
113
|
-
"div",
|
|
114
|
-
{
|
|
115
|
-
className: (0, import_clsx.default)("row items-center w-full gap-x-2 overflow-hidden", { "cursor-pointer": !isEditing }),
|
|
116
|
-
onClick: () => !isEditing ? setIsEditing(!isEditing) : void 0,
|
|
117
|
-
children: [
|
|
118
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_clsx.default)("row overflow-hidden", { "flex-1": isEditing }), children: isEditing ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
119
|
-
"input",
|
|
120
|
-
{
|
|
121
|
-
ref,
|
|
122
|
-
...restProps,
|
|
123
|
-
value,
|
|
124
|
-
type,
|
|
125
|
-
onChange: (event) => {
|
|
126
|
-
const value2 = event.target.value;
|
|
127
|
-
restartTimer(() => {
|
|
128
|
-
onEditCompletedWrapper(value2);
|
|
129
|
-
});
|
|
130
|
-
onChangeText(value2);
|
|
131
|
-
onChange(event);
|
|
132
|
-
},
|
|
133
|
-
onBlur: (event) => {
|
|
134
|
-
if (onBlur) {
|
|
135
|
-
onBlur(event);
|
|
136
|
-
}
|
|
137
|
-
onEditCompletedWrapper(value);
|
|
138
|
-
setIsEditing(false);
|
|
139
|
-
},
|
|
140
|
-
onKeyDown: (event) => {
|
|
141
|
-
if (event.key === "Enter") {
|
|
142
|
-
setIsEditing(false);
|
|
143
|
-
onEditCompletedWrapper(value);
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
className: (0, import_clsx.default)(`w-full border-none rounded-none ring-0 outline-0 text-inherit bg-inherit shadow-transparent decoration-primary p-0 underline-offset-4`, {
|
|
147
|
-
underline: isEditing
|
|
148
|
-
}, labelClassName),
|
|
149
|
-
onFocus: (event) => event.target.select()
|
|
150
|
-
}
|
|
151
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_clsx.default)("max-w-xs break-words overflow-hidden", labelClassName), children: value }) }),
|
|
152
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
153
|
-
import_lucide_react.Pencil,
|
|
154
|
-
{
|
|
155
|
-
className: (0, import_clsx.default)(`cursor-pointer`, { "text-transparent": isEditing }),
|
|
156
|
-
size,
|
|
157
|
-
style: { minWidth: `${size}px` }
|
|
158
|
-
}
|
|
159
|
-
)
|
|
160
|
-
]
|
|
161
|
-
}
|
|
162
|
-
),
|
|
163
|
-
isEditing && disclaimer && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: "text-negative", children: disclaimer })
|
|
164
|
-
] });
|
|
165
|
-
};
|
|
166
|
-
var ToggleableInputUncontrolled = ({
|
|
167
|
-
value: initialValue,
|
|
168
|
-
onChangeText = noop,
|
|
169
|
-
...restProps
|
|
170
|
-
}) => {
|
|
171
|
-
const [value, setValue] = (0, import_react2.useState)(initialValue);
|
|
172
|
-
(0, import_react2.useEffect)(() => {
|
|
173
|
-
setValue(initialValue);
|
|
174
|
-
}, [initialValue]);
|
|
175
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
176
|
-
ToggleableInput,
|
|
177
|
-
{
|
|
178
|
-
value,
|
|
179
|
-
onChangeText: (text) => {
|
|
180
|
-
setValue(text);
|
|
181
|
-
onChangeText(text);
|
|
182
|
-
},
|
|
183
|
-
...restProps
|
|
184
|
-
}
|
|
185
|
-
);
|
|
186
|
-
};
|
|
187
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
188
|
-
0 && (module.exports = {
|
|
189
|
-
ToggleableInput,
|
|
190
|
-
ToggleableInputUncontrolled
|
|
191
|
-
});
|
|
192
|
-
//# sourceMappingURL=ToggleableInput.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/user-action/ToggleableInput.tsx","../../../src/hooks/useSaveDelay.ts","../../../src/util/noop.ts"],"sourcesContent":["import type { HTMLInputTypeAttribute, InputHTMLAttributes } from 'react'\nimport { useEffect, useRef, useState } from 'react'\nimport { Pencil } from 'lucide-react'\nimport clsx from 'clsx'\nimport { useSaveDelay } from '@/hooks/useSaveDelay'\nimport { noop } from '@/util/noop'\n\ntype InputProps = {\n /**\n * The value\n */\n value: string,\n /**\n * @default 'text'\n */\n type?: HTMLInputTypeAttribute,\n /**\n * Callback for when the input's value changes\n * This is pretty much required but made optional for the rare cases where it actually isn't need such as when used with disabled\n * That could be enforced through a union type but that seems a bit overkill\n * @default noop\n */\n onChangeText?: (text: string) => void,\n onEditCompleted?: (text: string) => void,\n labelClassName?: string,\n initialState?: 'editing' | 'display',\n size?: number,\n disclaimer?: string,\n} & Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'label' | 'type' | 'crossOrigin'>\n\n/**\n * A Text input component for inputting text. It changes appearance upon entering the edit mode and switches\n * back to display mode on loss of focus or on enter\n *\n * The State is managed by the parent\n */\nexport const ToggleableInput = ({\n type = 'text',\n value,\n onChange = noop,\n onChangeText = noop,\n onEditCompleted = noop,\n labelClassName = '',\n initialState = 'display',\n size = 16,\n disclaimer,\n onBlur,\n ...restProps\n }: InputProps) => {\n const [isEditing, setIsEditing] = useState(initialState !== 'display')\n const { restartTimer, clearUpdateTimer } = useSaveDelay(() => undefined, 3000)\n const ref = useRef<HTMLInputElement>(null)\n\n const onEditCompletedWrapper = (text: string) => {\n onEditCompleted(text)\n clearUpdateTimer()\n }\n\n useEffect(() => {\n if (isEditing) {\n ref.current?.focus()\n }\n }, [isEditing])\n\n return (\n <div>\n <div\n className={clsx('row items-center w-full gap-x-2 overflow-hidden', { 'cursor-pointer': !isEditing })}\n onClick={() => !isEditing ? setIsEditing(!isEditing) : undefined}\n >\n <div className={clsx('row overflow-hidden', { 'flex-1': isEditing })}>\n {isEditing ? (\n <input\n ref={ref}\n {...restProps}\n value={value}\n type={type}\n onChange={event => {\n const value = event.target.value\n restartTimer(() => {\n onEditCompletedWrapper(value)\n })\n onChangeText(value)\n onChange(event)\n }}\n onBlur={(event) => {\n if (onBlur) {\n onBlur(event)\n }\n onEditCompletedWrapper(value)\n setIsEditing(false)\n }}\n onKeyDown={event => {\n if (event.key === 'Enter') {\n setIsEditing(false)\n onEditCompletedWrapper(value)\n }\n }}\n className={clsx(`w-full border-none rounded-none ring-0 outline-0 text-inherit bg-inherit shadow-transparent decoration-primary p-0 underline-offset-4`, {\n underline: isEditing\n }, labelClassName)}\n onFocus={event => event.target.select()}\n />\n ) : (\n <span className={clsx('max-w-xs break-words overflow-hidden', labelClassName)}>\n {value}\n </span>\n )}\n </div>\n <Pencil\n className={clsx(`cursor-pointer`, { 'text-transparent': isEditing })}\n size={size}\n style={{ minWidth: `${size}px` }}\n />\n </div>\n {(isEditing && disclaimer) && (\n <label className=\"text-negative\">\n {disclaimer}\n </label>\n )}\n </div>\n )\n}\n\nexport const ToggleableInputUncontrolled = ({\n value: initialValue,\n onChangeText = noop,\n ...restProps\n }: InputProps) => {\n const [value, setValue] = useState(initialValue)\n\n useEffect(() => {\n setValue(initialValue)\n }, [initialValue])\n\n return (\n <ToggleableInput\n value={value}\n onChangeText={text => {\n setValue(text)\n onChangeText(text)\n }}\n {...restProps}\n />\n )\n}\n","import { useEffect, useState } from 'react'\n\nexport function useSaveDelay(setNotificationStatus: (isShowing: boolean) => void, delay: number) {\n const [updateTimer, setUpdateTimer] = useState<NodeJS.Timeout | undefined>(undefined)\n const [notificationTimer, setNotificationTimer] = useState<NodeJS.Timeout | undefined>(undefined)\n\n const restartTimer = (onSave: () => void) => {\n clearTimeout(updateTimer)\n setUpdateTimer(setTimeout(() => {\n onSave()\n setNotificationStatus(true)\n // Show Saved Notification for fade animation duration\n clearTimeout(notificationTimer)\n setNotificationTimer(setTimeout(() => {\n setNotificationStatus(false)\n clearTimeout(notificationTimer)\n }, delay))\n clearTimeout(updateTimer)\n }, delay))\n }\n\n const clearUpdateTimer = (hasSaved = true) => {\n clearTimeout(updateTimer)\n if (hasSaved) {\n setNotificationStatus(true)\n clearTimeout(notificationTimer)\n setNotificationTimer(setTimeout(() => {\n setNotificationStatus(false)\n clearTimeout(notificationTimer)\n }, delay))\n } else {\n setNotificationStatus(false)\n }\n }\n\n useEffect(() => {\n return () => {\n clearTimeout(updateTimer)\n clearTimeout(notificationTimer)\n }\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n return { restartTimer, clearUpdateTimer }\n}","export const noop = () => undefined\n"],"mappings":"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","names":["import_react","clsx","value"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/user-action/Tooltip.tsx","../../../src/hooks/useHoverState.ts"],"sourcesContent":["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 modal)\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-tooltip-background border-l-transparent border-r-transparent`,\n bottom: `bottom-full left-1/2 -translate-x-1/2 border-b-tooltip-background border-l-transparent border-r-transparent`,\n left: `left-full top-1/2 -translate-y-1/2 border-l-tooltip-background border-t-transparent border-b-transparent`,\n right: `right-full top-1/2 -translate-y-1/2 border-r-tooltip-background 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(\n `opacity-0 absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap\n animate-tooltip-fade-in shadow-lg bg-tooltip-background`,\n positionClasses[position], tooltipClassName\n )}\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 { 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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,mBAAoC;AAmCpC,IAAM,4BAAgD;AAAA,EACpD,cAAc;AAAA,EACd,YAAY;AACd;AAQO,IAAM,gBAAgB,CAAC,QAAiD,WAAuC;AACpH,QAAM,EAAE,cAAc,WAAW,IAAI,EAAE,GAAG,2BAA2B,GAAG,MAAM;AAE9E,QAAM,CAAC,WAAW,YAAY,QAAI,uBAAS,KAAK;AAChD,QAAM,CAAC,OAAO,QAAQ,QAAI,uBAAyB;AAEnD,QAAM,eAAe,MAAM;AACzB,QAAI,YAAY;AACd;AAAA,IACF;AACA,iBAAa,KAAK;AAClB,iBAAa,IAAI;AAAA,EACnB;AAEA,QAAM,eAAe,MAAM;AACzB,QAAI,YAAY;AACd;AAAA,IACF;AACA,aAAS,WAAW,MAAM;AACxB,mBAAa,KAAK;AAAA,IACpB,GAAG,YAAY,CAAC;AAAA,EAClB;AAEA,8BAAU,MAAM;AACd,QAAI,OAAO;AACT,aAAO,MAAM;AACX,qBAAa,KAAK;AAAA,MACpB;AAAA,IACF;AAAA,EACF,CAAC;AAED,8BAAU,MAAM;AACd,QAAI,OAAO;AACT,mBAAa,KAAK;AAAA,IACpB;AAAA,EACF,GAAG,CAAC,UAAU,CAAC;AAEf,SAAO;AAAA,IACL;AAAA,IAAW;AAAA,IAAc,UAAU,EAAE,cAAc,aAAa;AAAA,EAClE;AACF;;;ADrFA,kBAAqB;AA2Eb;AAxCD,IAAM,UAAU,CAAC;AAAA,EACE;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,qBAAqB;AAAA,EACrB,WAAW;AAAA,EACX,SAAS;AACX,MAAoB;AAC1C,QAAM,EAAE,WAAW,SAAS,IAAI,cAAc;AAE9C,QAAM,kBAAkB;AAAA,IACtB,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AAEA,QAAM,eAAe;AACrB,QAAM,kBAAkB;AAAA,IACtB,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AAEA,QAAM,gBAAiD;AAAA,IACrD,KAAK,EAAE,aAAa,GAAG,YAAY,MAAM,YAAY,QAAQ,YAAY,KAAK;AAAA,IAC9E,QAAQ,EAAE,aAAa,KAAK,YAAY,MAAM,YAAY,MAAM,YAAY,KAAK;AAAA,IACjF,MAAM,EAAE,aAAa,GAAG,YAAY,QAAQ,YAAY,MAAM,YAAY,KAAK;AAAA,IAC/E,OAAO,EAAE,aAAa,GAAG,YAAY,MAAM,YAAY,MAAM,YAAY,OAAO;AAAA,EAClF;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW,kBAAK,yBAAyB,kBAAkB;AAAA,MAC1D,GAAG;AAAA,MAEH;AAAA;AAAA,QACA,aACC;AAAA,UAAC;AAAA;AAAA,YACC,eAAW;AAAA,cACT;AAAA;AAAA,cAEA,gBAAgB,QAAQ;AAAA,cAAG;AAAA,YAC7B;AAAA,YACA,OAAO,EAAE,QAAQ,gBAAgB,iBAAiB,KAAK;AAAA,YAEtD;AAAA;AAAA,cACD;AAAA,gBAAC;AAAA;AAAA,kBACC,eAAW,kBAAK,oBAAoB,gBAAgB,QAAQ,CAAC;AAAA,kBAC7D,OAAO,EAAE,GAAG,cAAc,QAAQ,GAAG,OAAO;AAAA;AAAA,cAC9C;AAAA;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":[]}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/hooks/useHoverState.ts
|
|
21
|
-
var useHoverState_exports = {};
|
|
22
|
-
__export(useHoverState_exports, {
|
|
23
|
-
useHoverState: () => useHoverState
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(useHoverState_exports);
|
|
26
|
-
var import_react = require("react");
|
|
27
|
-
var defaultUseHoverStateProps = {
|
|
28
|
-
closingDelay: 200,
|
|
29
|
-
isDisabled: false
|
|
30
|
-
};
|
|
31
|
-
var useHoverState = (props = void 0) => {
|
|
32
|
-
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
33
|
-
const [isHovered, setIsHovered] = (0, import_react.useState)(false);
|
|
34
|
-
const [timer, setTimer] = (0, import_react.useState)();
|
|
35
|
-
const onMouseEnter = () => {
|
|
36
|
-
if (isDisabled) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
clearTimeout(timer);
|
|
40
|
-
setIsHovered(true);
|
|
41
|
-
};
|
|
42
|
-
const onMouseLeave = () => {
|
|
43
|
-
if (isDisabled) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
setTimer(setTimeout(() => {
|
|
47
|
-
setIsHovered(false);
|
|
48
|
-
}, closingDelay));
|
|
49
|
-
};
|
|
50
|
-
(0, import_react.useEffect)(() => {
|
|
51
|
-
if (timer) {
|
|
52
|
-
return () => {
|
|
53
|
-
clearTimeout(timer);
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
(0, import_react.useEffect)(() => {
|
|
58
|
-
if (timer) {
|
|
59
|
-
clearTimeout(timer);
|
|
60
|
-
}
|
|
61
|
-
}, [isDisabled]);
|
|
62
|
-
return {
|
|
63
|
-
isHovered,
|
|
64
|
-
setIsHovered,
|
|
65
|
-
handlers: { onMouseEnter, onMouseLeave }
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
69
|
-
0 && (module.exports = {
|
|
70
|
-
useHoverState
|
|
71
|
-
});
|
|
72
|
-
//# sourceMappingURL=useHoverState.cjs.map
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/hooks/useLocalStorage.ts
|
|
21
|
-
var useLocalStorage_exports = {};
|
|
22
|
-
__export(useLocalStorage_exports, {
|
|
23
|
-
useLocalStorage: () => useLocalStorage
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(useLocalStorage_exports);
|
|
26
|
-
var import_react = require("react");
|
|
27
|
-
|
|
28
|
-
// src/util/storage.ts
|
|
29
|
-
var StorageService = class {
|
|
30
|
-
// this seems to be a bug in eslint as 'paramter-properties' is a special syntax of typescript
|
|
31
|
-
constructor(storage) {
|
|
32
|
-
this.storage = storage;
|
|
33
|
-
}
|
|
34
|
-
get(key) {
|
|
35
|
-
const value = this.storage.getItem(key);
|
|
36
|
-
if (value === null) {
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
return JSON.parse(value);
|
|
40
|
-
}
|
|
41
|
-
set(key, value) {
|
|
42
|
-
this.storage.setItem(key, JSON.stringify(value));
|
|
43
|
-
}
|
|
44
|
-
delete(key) {
|
|
45
|
-
this.storage.removeItem(key);
|
|
46
|
-
}
|
|
47
|
-
deleteAll() {
|
|
48
|
-
this.storage.clear();
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
var LocalStorageService = class extends StorageService {
|
|
52
|
-
constructor() {
|
|
53
|
-
super(window.localStorage);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
// src/hooks/useLocalStorage.ts
|
|
58
|
-
var useLocalStorage = (key, initValue) => {
|
|
59
|
-
const get = (0, import_react.useCallback)(() => {
|
|
60
|
-
if (typeof window === "undefined") {
|
|
61
|
-
return initValue;
|
|
62
|
-
}
|
|
63
|
-
const storageService = new LocalStorageService();
|
|
64
|
-
const value = storageService.get(key);
|
|
65
|
-
return value || initValue;
|
|
66
|
-
}, [initValue, key]);
|
|
67
|
-
const [storedValue, setStoredValue] = (0, import_react.useState)(get);
|
|
68
|
-
const setValue = (0, import_react.useCallback)((value) => {
|
|
69
|
-
const newValue = value instanceof Function ? value(storedValue) : value;
|
|
70
|
-
const storageService = new LocalStorageService();
|
|
71
|
-
storageService.set(key, value);
|
|
72
|
-
setStoredValue(newValue);
|
|
73
|
-
}, [storedValue, setStoredValue, key]);
|
|
74
|
-
(0, import_react.useEffect)(() => {
|
|
75
|
-
setStoredValue(get());
|
|
76
|
-
}, []);
|
|
77
|
-
return [storedValue, setValue];
|
|
78
|
-
};
|
|
79
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
80
|
-
0 && (module.exports = {
|
|
81
|
-
useLocalStorage
|
|
82
|
-
});
|
|
83
|
-
//# sourceMappingURL=useLocalStorage.cjs.map
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/hooks/useOutsideClick.ts
|
|
21
|
-
var useOutsideClick_exports = {};
|
|
22
|
-
__export(useOutsideClick_exports, {
|
|
23
|
-
useOutsideClick: () => useOutsideClick
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(useOutsideClick_exports);
|
|
26
|
-
var import_react = require("react");
|
|
27
|
-
var useOutsideClick = (refs, handler) => {
|
|
28
|
-
(0, import_react.useEffect)(() => {
|
|
29
|
-
const listener = (event) => {
|
|
30
|
-
if (event.target === null) return;
|
|
31
|
-
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
handler();
|
|
35
|
-
};
|
|
36
|
-
document.addEventListener("mousedown", listener);
|
|
37
|
-
document.addEventListener("touchstart", listener);
|
|
38
|
-
return () => {
|
|
39
|
-
document.removeEventListener("mousedown", listener);
|
|
40
|
-
document.removeEventListener("touchstart", listener);
|
|
41
|
-
};
|
|
42
|
-
}, [refs, handler]);
|
|
43
|
-
};
|
|
44
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
45
|
-
0 && (module.exports = {
|
|
46
|
-
useOutsideClick
|
|
47
|
-
});
|
|
48
|
-
//# sourceMappingURL=useOutsideClick.cjs.map
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/hooks/useSaveDelay.ts
|
|
21
|
-
var useSaveDelay_exports = {};
|
|
22
|
-
__export(useSaveDelay_exports, {
|
|
23
|
-
useSaveDelay: () => useSaveDelay
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(useSaveDelay_exports);
|
|
26
|
-
var import_react = require("react");
|
|
27
|
-
function useSaveDelay(setNotificationStatus, delay) {
|
|
28
|
-
const [updateTimer, setUpdateTimer] = (0, import_react.useState)(void 0);
|
|
29
|
-
const [notificationTimer, setNotificationTimer] = (0, import_react.useState)(void 0);
|
|
30
|
-
const restartTimer = (onSave) => {
|
|
31
|
-
clearTimeout(updateTimer);
|
|
32
|
-
setUpdateTimer(setTimeout(() => {
|
|
33
|
-
onSave();
|
|
34
|
-
setNotificationStatus(true);
|
|
35
|
-
clearTimeout(notificationTimer);
|
|
36
|
-
setNotificationTimer(setTimeout(() => {
|
|
37
|
-
setNotificationStatus(false);
|
|
38
|
-
clearTimeout(notificationTimer);
|
|
39
|
-
}, delay));
|
|
40
|
-
clearTimeout(updateTimer);
|
|
41
|
-
}, delay));
|
|
42
|
-
};
|
|
43
|
-
const clearUpdateTimer = (hasSaved = true) => {
|
|
44
|
-
clearTimeout(updateTimer);
|
|
45
|
-
if (hasSaved) {
|
|
46
|
-
setNotificationStatus(true);
|
|
47
|
-
clearTimeout(notificationTimer);
|
|
48
|
-
setNotificationTimer(setTimeout(() => {
|
|
49
|
-
setNotificationStatus(false);
|
|
50
|
-
clearTimeout(notificationTimer);
|
|
51
|
-
}, delay));
|
|
52
|
-
} else {
|
|
53
|
-
setNotificationStatus(false);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
(0, import_react.useEffect)(() => {
|
|
57
|
-
return () => {
|
|
58
|
-
clearTimeout(updateTimer);
|
|
59
|
-
clearTimeout(notificationTimer);
|
|
60
|
-
};
|
|
61
|
-
}, []);
|
|
62
|
-
return { restartTimer, clearUpdateTimer };
|
|
63
|
-
}
|
|
64
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
65
|
-
0 && (module.exports = {
|
|
66
|
-
useSaveDelay
|
|
67
|
-
});
|
|
68
|
-
//# sourceMappingURL=useSaveDelay.cjs.map
|