@onewelcome/react-lib-components 2.2.0 → 3.0.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/dist/cjs/Breadcrumbs/Breadcrumbs.cjs.js +1 -1
- package/dist/cjs/Breadcrumbs/Breadcrumbs.module.cjs.js +1 -1
- package/dist/cjs/Button/BaseButton.module.cjs.js +1 -1
- package/dist/cjs/Button/Button.module.cjs.js +1 -1
- package/dist/cjs/Button/IconButton.module.cjs.js +1 -1
- package/dist/cjs/ContextMenu/ContextMenu.cjs.js +1 -1
- package/dist/cjs/DataGrid/DataGridBody/DataGridCell.module.cjs.js +1 -1
- package/dist/cjs/Form/Fieldset/Fieldset.module.cjs.js +1 -1
- package/dist/cjs/Form/FormGroup/FormGroup.cjs.js +1 -1
- package/dist/cjs/Form/FormGroup/FormGroup.module.cjs.js +1 -1
- package/dist/cjs/Form/FormHelperText/FormHelperText.cjs.js +1 -1
- package/dist/cjs/Form/FormHelperText/FormHelperText.module.cjs.js +1 -1
- package/dist/cjs/Form/Input/Input.module.cjs.js +1 -1
- package/dist/cjs/Form/Select/Option.cjs.js +1 -1
- package/dist/cjs/Form/Select/Select.cjs.js +1 -1
- package/dist/cjs/Form/Select/Select.module.cjs.js +1 -1
- package/dist/cjs/Form/Select/SelectService.cjs.js +1 -1
- package/dist/cjs/Form/Textarea/Textarea.module.cjs.js +1 -1
- package/dist/cjs/Form/Toggle/Toggle.cjs.js +1 -1
- package/dist/cjs/Form/Toggle/Toggle.module.cjs.js +1 -1
- package/dist/cjs/Form/Wrapper/InputWrapper/InputWrapper.module.cjs.js +1 -1
- package/dist/cjs/Form/Wrapper/TextareaWrapper/TextareaWrapper.module.cjs.js +1 -1
- package/dist/cjs/Form/Wrapper/Wrapper/Wrapper.cjs.js +1 -1
- package/dist/cjs/Form/Wrapper/Wrapper/Wrapper.module.cjs.js +1 -1
- package/dist/cjs/Icon/Icon.cjs.js +1 -1
- package/dist/cjs/Icon/Icon.module.cjs.js +1 -1
- package/dist/cjs/Link/Link.cjs.js +1 -1
- package/dist/cjs/Link/Link.module.cjs.js +1 -1
- package/dist/cjs/Notifications/BaseModal/BaseModal.cjs.js +1 -1
- package/dist/cjs/Notifications/BaseModal/BaseModal.module.cjs.js +1 -1
- package/dist/cjs/Notifications/BaseModal/BaseModalActions/BaseModalActions.cjs.js +1 -1
- package/dist/cjs/Notifications/BaseModal/BaseModalActions/BaseModalActions.module.cjs.js +1 -1
- package/dist/cjs/Notifications/BaseModal/BaseModalContent/BaseModalContent.module.cjs.js +1 -1
- package/dist/cjs/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.cjs.js +1 -1
- package/dist/cjs/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.module.cjs.js +1 -1
- package/dist/cjs/Notifications/Dialog/Dialog.cjs.js +1 -1
- package/dist/cjs/Notifications/Dialog/Dialog.module.cjs.js +1 -1
- package/dist/cjs/Notifications/Dialog/DialogActions/DialogActions.cjs.js +1 -1
- package/dist/cjs/Notifications/Dialog/DialogActions/DialogActions.module.cjs.js +1 -1
- package/dist/cjs/Notifications/Dialog/DialogTitle/DialogTitle.cjs.js +1 -1
- package/dist/cjs/Notifications/Dialog/DialogTitle/DialogTitle.module.cjs.js +1 -1
- package/dist/cjs/Notifications/DiscardChangesModal/DiscardChangesDialog/DiscardChangesDialog.cjs.js +1 -1
- package/dist/cjs/Notifications/NotificationProvider/NotificationContext.cjs.js +2 -0
- package/dist/cjs/Notifications/NotificationProvider/NotificationContext.cjs.js.map +1 -0
- package/dist/cjs/Notifications/NotificationProvider/NotificationService.cjs.js +2 -0
- package/dist/cjs/Notifications/NotificationProvider/NotificationService.cjs.js.map +1 -0
- package/dist/cjs/Notifications/SlideInModal/SlideInModal.module.cjs.js +1 -1
- package/dist/cjs/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.module.cjs.js +1 -1
- package/dist/cjs/Notifications/Snackbar/SnackbarItem/SnackbarItem.cjs.js +1 -1
- package/dist/cjs/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.cjs.js +1 -1
- package/dist/cjs/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.cjs.js +1 -1
- package/dist/cjs/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.cjs.js +1 -1
- package/dist/cjs/Notifications/Snackbar/useSnackbar.cjs.js +1 -1
- package/dist/cjs/Pagination/Pagination.cjs.js +1 -1
- package/dist/cjs/Pagination/Pagination.module.cjs.js +1 -1
- package/dist/cjs/Popover/Popover.cjs.js +1 -1
- package/dist/cjs/Popover/Popover.module.cjs.js +1 -1
- package/dist/cjs/ProgressBar/ProgressBar.cjs.js +1 -1
- package/dist/cjs/ProgressBar/ProgressBar.module.cjs.js +1 -1
- package/dist/cjs/Skeleton/Skeleton.module.cjs.js +1 -1
- package/dist/cjs/Tabs/Tabs.module.cjs.js +1 -1
- package/dist/cjs/Tiles/Tile.module.cjs.js +1 -1
- package/dist/cjs/Tooltip/Tooltip.cjs.js +1 -1
- package/dist/cjs/Tooltip/Tooltip.module.cjs.js +1 -1
- package/dist/cjs/Typography/Typography.cjs.js +1 -1
- package/dist/cjs/Wizard/WizardActions/WizardActions.cjs.js +1 -1
- package/dist/cjs/_BaseStyling_/BaseStyling.cjs.js +1 -1
- package/dist/{esm → cjs/src}/components/Form/FormHelperText/FormHelperText.d.ts +1 -0
- package/dist/cjs/{components → src/components}/Form/Select/Option.d.ts +2 -2
- package/dist/{esm → cjs/src}/components/Form/Select/Select.d.ts +1 -0
- package/dist/{esm → cjs/src}/components/Form/Select/Select.interfaces.d.ts +3 -3
- package/dist/{esm → cjs/src}/components/Form/Select/SelectService.d.ts +1 -1
- package/dist/cjs/{components → src/components}/Form/Toggle/Toggle.d.ts +5 -0
- package/dist/cjs/{components → src/components}/Icon/Icon.d.ts +2 -0
- package/dist/{esm → cjs/src}/components/Link/Link.d.ts +3 -1
- package/dist/cjs/{components → src/components}/Notifications/BaseModal/BaseModalActions/BaseModalActions.d.ts +6 -0
- package/dist/cjs/{components → src/components}/Notifications/Dialog/Dialog.d.ts +4 -1
- package/dist/cjs/{components → src/components}/Notifications/Dialog/DialogActions/DialogActions.d.ts +2 -2
- package/dist/cjs/{components → src/components}/Notifications/Dialog/DialogTitle/DialogTitle.d.ts +2 -0
- package/dist/cjs/{components → src/components}/Notifications/DiscardChangesModal/DiscardChangesDialog/DiscardChangesDialog.d.ts +2 -0
- package/dist/cjs/src/components/Notifications/NotificationProvider/NotificationContext.d.ts +35 -0
- package/dist/cjs/src/components/Notifications/NotificationProvider/NotificationService.d.ts +2 -0
- package/dist/cjs/src/components/Notifications/NotificationProvider/notification.interfaces.d.ts +46 -0
- package/dist/{esm → cjs/src}/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.d.ts +3 -2
- package/dist/{esm → cjs/src}/components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.d.ts +2 -1
- package/dist/cjs/{components → src/components}/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.d.ts +4 -3
- package/dist/{esm → cjs/src}/components/Notifications/Snackbar/interfaces.d.ts +2 -1
- package/dist/cjs/src/components/Notifications/Snackbar/useSnackbar.d.ts +6 -0
- package/dist/{esm → cjs/src}/components/Pagination/Pagination.d.ts +1 -1
- package/dist/cjs/{components → src/components}/ProgressBar/ProgressBar.d.ts +4 -1
- package/dist/cjs/src/components/Tag/Tag.d.ts +10 -0
- package/dist/{esm → cjs/src}/components/Tooltip/Tooltip.d.ts +5 -5
- package/dist/cjs/{components → src/components}/Typography/Typography.d.ts +1 -0
- package/dist/cjs/src/components/Wizard/WizardActions/WizardActions.d.ts +28 -0
- package/dist/cjs/{components → src/components}/_BaseStyling_/BaseStyling.d.ts +7 -2
- package/dist/cjs/src/hooks/useDetermineStatusIcon.cjs.js +1 -1
- package/dist/cjs/src/hooks/usePosition.cjs.js +1 -1
- package/dist/cjs/{hooks → src/hooks}/usePosition.d.ts +1 -0
- package/dist/cjs/src/index.cjs.js +1 -1
- package/dist/cjs/{index.d.ts → src/index.d.ts} +3 -0
- package/dist/cjs/{interfaces.d.ts → src/interfaces.d.ts} +3 -0
- package/dist/cjs/src/util/helper.cjs.js +1 -1
- package/dist/{esm → cjs/src}/util/helper.d.ts +5 -0
- package/dist/cjs/stories/utils/helpers.d.ts +3 -0
- package/dist/esm/Breadcrumbs/Breadcrumbs.esm.js +1 -1
- package/dist/esm/Breadcrumbs/Breadcrumbs.module.esm.js +1 -1
- package/dist/esm/Button/BaseButton.module.esm.js +1 -1
- package/dist/esm/Button/Button.module.esm.js +1 -1
- package/dist/esm/Button/IconButton.module.esm.js +1 -1
- package/dist/esm/ContextMenu/ContextMenu.esm.js +1 -1
- package/dist/esm/DataGrid/DataGridBody/DataGridCell.module.esm.js +1 -1
- package/dist/esm/Form/Fieldset/Fieldset.module.esm.js +1 -1
- package/dist/esm/Form/FormGroup/FormGroup.esm.js +1 -1
- package/dist/esm/Form/FormGroup/FormGroup.module.esm.js +1 -1
- package/dist/esm/Form/FormHelperText/FormHelperText.esm.js +1 -1
- package/dist/esm/Form/FormHelperText/FormHelperText.module.esm.js +1 -1
- package/dist/esm/Form/Input/Input.module.esm.js +1 -1
- package/dist/esm/Form/Select/Option.esm.js +1 -1
- package/dist/esm/Form/Select/Select.esm.js +1 -1
- package/dist/esm/Form/Select/Select.module.esm.js +1 -1
- package/dist/esm/Form/Select/SelectService.esm.js +1 -1
- package/dist/esm/Form/Textarea/Textarea.module.esm.js +1 -1
- package/dist/esm/Form/Toggle/Toggle.esm.js +1 -1
- package/dist/esm/Form/Toggle/Toggle.module.esm.js +1 -1
- package/dist/esm/Form/Wrapper/InputWrapper/InputWrapper.module.esm.js +1 -1
- package/dist/esm/Form/Wrapper/TextareaWrapper/TextareaWrapper.module.esm.js +1 -1
- package/dist/esm/Form/Wrapper/Wrapper/Wrapper.esm.js +1 -1
- package/dist/esm/Form/Wrapper/Wrapper/Wrapper.module.esm.js +1 -1
- package/dist/esm/Icon/Icon.esm.js +1 -1
- package/dist/esm/Icon/Icon.module.esm.js +1 -1
- package/dist/esm/Link/Link.esm.js +1 -1
- package/dist/esm/Link/Link.module.esm.js +1 -1
- package/dist/esm/Notifications/BaseModal/BaseModal.esm.js +1 -1
- package/dist/esm/Notifications/BaseModal/BaseModal.module.esm.js +1 -1
- package/dist/esm/Notifications/BaseModal/BaseModalActions/BaseModalActions.esm.js +1 -1
- package/dist/esm/Notifications/BaseModal/BaseModalActions/BaseModalActions.module.esm.js +1 -1
- package/dist/esm/Notifications/BaseModal/BaseModalContent/BaseModalContent.module.esm.js +1 -1
- package/dist/esm/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.esm.js +1 -1
- package/dist/esm/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.module.esm.js +1 -1
- package/dist/esm/Notifications/Dialog/Dialog.esm.js +1 -1
- package/dist/esm/Notifications/Dialog/Dialog.module.esm.js +1 -1
- package/dist/esm/Notifications/Dialog/DialogActions/DialogActions.esm.js +1 -1
- package/dist/esm/Notifications/Dialog/DialogActions/DialogActions.module.esm.js +1 -1
- package/dist/esm/Notifications/Dialog/DialogTitle/DialogTitle.esm.js +1 -1
- package/dist/esm/Notifications/Dialog/DialogTitle/DialogTitle.module.esm.js +1 -1
- package/dist/esm/Notifications/DiscardChangesModal/DiscardChangesDialog/DiscardChangesDialog.esm.js +1 -1
- package/dist/esm/Notifications/NotificationProvider/NotificationContext.esm.js +2 -0
- package/dist/esm/Notifications/NotificationProvider/NotificationContext.esm.js.map +1 -0
- package/dist/esm/Notifications/NotificationProvider/NotificationService.esm.js +2 -0
- package/dist/esm/Notifications/NotificationProvider/NotificationService.esm.js.map +1 -0
- package/dist/esm/Notifications/SlideInModal/SlideInModal.module.esm.js +1 -1
- package/dist/esm/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.module.esm.js +1 -1
- package/dist/esm/Notifications/Snackbar/SnackbarItem/SnackbarItem.esm.js +1 -1
- package/dist/esm/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.esm.js +1 -1
- package/dist/esm/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.esm.js +1 -1
- package/dist/esm/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.esm.js +1 -1
- package/dist/esm/Notifications/Snackbar/useSnackbar.esm.js +1 -1
- package/dist/esm/Pagination/Pagination.esm.js +1 -1
- package/dist/esm/Pagination/Pagination.module.esm.js +1 -1
- package/dist/esm/Popover/Popover.esm.js +1 -1
- package/dist/esm/Popover/Popover.module.esm.js +1 -1
- package/dist/esm/ProgressBar/ProgressBar.esm.js +1 -1
- package/dist/esm/ProgressBar/ProgressBar.module.esm.js +1 -1
- package/dist/esm/Skeleton/Skeleton.module.esm.js +1 -1
- package/dist/esm/Tabs/Tabs.module.esm.js +1 -1
- package/dist/esm/Tiles/Tile.module.esm.js +1 -1
- package/dist/esm/Tooltip/Tooltip.esm.js +1 -1
- package/dist/esm/Tooltip/Tooltip.module.esm.js +1 -1
- package/dist/esm/Typography/Typography.esm.js +1 -1
- package/dist/esm/Wizard/WizardActions/WizardActions.esm.js +1 -1
- package/dist/esm/_BaseStyling_/BaseStyling.esm.js +1 -1
- package/dist/{cjs → esm/src}/components/Form/FormHelperText/FormHelperText.d.ts +1 -0
- package/dist/esm/{components → src/components}/Form/Select/Option.d.ts +2 -2
- package/dist/{cjs → esm/src}/components/Form/Select/Select.d.ts +1 -0
- package/dist/{cjs → esm/src}/components/Form/Select/Select.interfaces.d.ts +3 -3
- package/dist/{cjs → esm/src}/components/Form/Select/SelectService.d.ts +1 -1
- package/dist/esm/{components → src/components}/Form/Toggle/Toggle.d.ts +5 -0
- package/dist/esm/{components → src/components}/Icon/Icon.d.ts +2 -0
- package/dist/{cjs → esm/src}/components/Link/Link.d.ts +3 -1
- package/dist/esm/{components → src/components}/Notifications/BaseModal/BaseModalActions/BaseModalActions.d.ts +6 -0
- package/dist/esm/{components → src/components}/Notifications/Dialog/Dialog.d.ts +4 -1
- package/dist/esm/{components → src/components}/Notifications/Dialog/DialogActions/DialogActions.d.ts +2 -2
- package/dist/esm/{components → src/components}/Notifications/Dialog/DialogTitle/DialogTitle.d.ts +2 -0
- package/dist/esm/{components → src/components}/Notifications/DiscardChangesModal/DiscardChangesDialog/DiscardChangesDialog.d.ts +2 -0
- package/dist/esm/src/components/Notifications/NotificationProvider/NotificationContext.d.ts +35 -0
- package/dist/esm/src/components/Notifications/NotificationProvider/NotificationService.d.ts +2 -0
- package/dist/esm/src/components/Notifications/NotificationProvider/notification.interfaces.d.ts +46 -0
- package/dist/{cjs → esm/src}/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.d.ts +3 -2
- package/dist/{cjs → esm/src}/components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.d.ts +2 -1
- package/dist/esm/{components → src/components}/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.d.ts +4 -3
- package/dist/{cjs → esm/src}/components/Notifications/Snackbar/interfaces.d.ts +2 -1
- package/dist/esm/src/components/Notifications/Snackbar/useSnackbar.d.ts +6 -0
- package/dist/{cjs → esm/src}/components/Pagination/Pagination.d.ts +1 -1
- package/dist/esm/{components → src/components}/ProgressBar/ProgressBar.d.ts +4 -1
- package/dist/esm/src/components/Tag/Tag.d.ts +10 -0
- package/dist/{cjs → esm/src}/components/Tooltip/Tooltip.d.ts +5 -5
- package/dist/esm/{components → src/components}/Typography/Typography.d.ts +1 -0
- package/dist/esm/src/components/Wizard/WizardActions/WizardActions.d.ts +28 -0
- package/dist/esm/{components → src/components}/_BaseStyling_/BaseStyling.d.ts +7 -2
- package/dist/esm/src/hooks/useDetermineStatusIcon.esm.js +1 -1
- package/dist/esm/{hooks → src/hooks}/usePosition.d.ts +1 -0
- package/dist/esm/src/hooks/usePosition.esm.js +1 -1
- package/dist/esm/src/hooks/useSpacing.test.d.ts +1 -0
- package/dist/esm/src/hooks/useUploadFile.test.d.ts +1 -0
- package/dist/esm/src/hooks/useWrapper.test.d.ts +1 -0
- package/dist/esm/{index.d.ts → src/index.d.ts} +3 -0
- package/dist/esm/src/index.esm.js +1 -1
- package/dist/esm/{interfaces.d.ts → src/interfaces.d.ts} +3 -0
- package/dist/{cjs → esm/src}/util/helper.d.ts +5 -0
- package/dist/esm/src/util/helper.esm.js +1 -1
- package/dist/esm/src/util/helper.test.d.ts +1 -0
- package/dist/esm/stories/utils/helpers.d.ts +3 -0
- package/package.json +51 -51
- package/src/components/Breadcrumbs/Breadcrumbs.module.scss +28 -4
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +6 -0
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +11 -1
- package/src/components/ContextMenu/ContextMenu.tsx +6 -1
- package/src/components/Form/Fieldset/Fieldset.module.scss +2 -2
- package/src/components/Form/FileUpload/FileItem/FileItem.tsx +1 -5
- package/src/components/Form/FormGroup/FormGroup.module.scss +2 -4
- package/src/components/Form/FormGroup/FormGroup.tsx +11 -7
- package/src/components/Form/FormHelperText/FormHelperText.module.scss +7 -3
- package/src/components/Form/FormHelperText/FormHelperText.tsx +8 -8
- package/src/components/Form/Input/Input.module.scss +8 -3
- package/src/components/Form/Input/Input.test.tsx +1 -1
- package/src/components/Form/Select/Option.tsx +4 -5
- package/src/components/Form/Select/Select.interfaces.ts +3 -3
- package/src/components/Form/Select/Select.module.scss +36 -31
- package/src/components/Form/Select/Select.test.tsx +106 -7
- package/src/components/Form/Select/Select.tsx +55 -21
- package/src/components/Form/Select/SelectService.ts +38 -10
- package/src/components/Form/Textarea/Textarea.module.scss +19 -5
- package/src/components/Form/Textarea/Textarea.test.tsx +1 -1
- package/src/components/Form/Toggle/Toggle.module.scss +127 -1
- package/src/components/Form/Toggle/Toggle.test.tsx +102 -1
- package/src/components/Form/Toggle/Toggle.tsx +25 -1
- package/src/components/Form/Wrapper/InputWrapper/InputWrapper.module.scss +4 -2
- package/src/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.module.scss +0 -2
- package/src/components/Form/Wrapper/Wrapper/Wrapper.tsx +1 -0
- package/src/components/Icon/Icon.module.scss +14 -6
- package/src/components/Icon/Icon.tsx +2 -0
- package/src/components/Link/Link.tsx +7 -2
- package/src/components/Notifications/BaseModal/BaseModal.module.scss +5 -5
- package/src/components/Notifications/BaseModal/BaseModal.tsx +9 -1
- package/src/components/Notifications/BaseModal/BaseModalActions/BaseModalActions.module.scss +43 -3
- package/src/components/Notifications/BaseModal/BaseModalActions/BaseModalActions.test.tsx +33 -2
- package/src/components/Notifications/BaseModal/BaseModalActions/BaseModalActions.tsx +35 -4
- package/src/components/Notifications/BaseModal/BaseModalContent/BaseModalContent.module.scss +4 -1
- package/src/components/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.module.scss +2 -2
- package/src/components/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.tsx +11 -3
- package/src/components/Notifications/Dialog/Dialog.module.scss +2 -2
- package/src/components/Notifications/Dialog/Dialog.test.tsx +11 -22
- package/src/components/Notifications/Dialog/Dialog.tsx +14 -10
- package/src/components/Notifications/Dialog/DialogActions/DialogActions.module.scss +1 -7
- package/src/components/Notifications/Dialog/DialogActions/DialogActions.test.tsx +2 -8
- package/src/components/Notifications/Dialog/DialogActions/DialogActions.tsx +7 -4
- package/src/components/Notifications/Dialog/DialogTitle/DialogTitle.module.scss +11 -0
- package/src/components/Notifications/Dialog/DialogTitle/DialogTitle.test.tsx +27 -0
- package/src/components/Notifications/Dialog/DialogTitle/DialogTitle.tsx +25 -4
- package/src/components/Notifications/DiscardChangesModal/DiscardChangesDialog/DiscardChangesDialog.tsx +4 -1
- package/src/components/Notifications/DiscardChangesModal/DiscardChangesModal.test.tsx +2 -5
- package/src/components/Notifications/NotificationProvider/NotificationContext.test.tsx +449 -0
- package/src/components/Notifications/NotificationProvider/NotificationContext.tsx +221 -0
- package/src/components/Notifications/NotificationProvider/NotificationService.ts +33 -0
- package/src/components/Notifications/NotificationProvider/notification.interfaces.ts +68 -0
- package/src/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.scss +63 -52
- package/src/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.test.tsx +1 -1
- package/src/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.tsx +31 -18
- package/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.test.tsx +32 -5
- package/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.tsx +16 -4
- package/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.tsx +13 -3
- package/src/components/Notifications/Snackbar/interfaces.ts +2 -1
- package/src/components/Notifications/Snackbar/useSnackbar.ts +1 -0
- package/src/components/Pagination/Pagination.module.scss +43 -27
- package/src/components/Pagination/Pagination.test.tsx +11 -22
- package/src/components/Pagination/Pagination.tsx +62 -105
- package/src/components/Popover/Popover.module.scss +1 -1
- package/src/components/Popover/Popover.tsx +31 -16
- package/src/components/ProgressBar/ProgressBar.module.scss +50 -13
- package/src/components/ProgressBar/ProgressBar.test.tsx +15 -3
- package/src/components/ProgressBar/ProgressBar.tsx +38 -9
- package/src/components/Tag/Tag.module.scss +24 -0
- package/src/components/Tag/Tag.test.tsx +89 -0
- package/src/components/Tag/Tag.tsx +69 -0
- package/src/components/Tiles/Tile.test.tsx +2 -1
- package/src/components/Tooltip/Tooltip.module.scss +158 -5
- package/src/components/Tooltip/Tooltip.test.tsx +339 -75
- package/src/components/Tooltip/Tooltip.tsx +91 -16
- package/src/components/Typography/Typography.test.tsx +23 -2
- package/src/components/Typography/Typography.tsx +3 -2
- package/src/components/Wizard/Wizard.test.tsx +32 -17
- package/src/components/Wizard/WizardActions/WizardActions.test.tsx +39 -23
- package/src/components/Wizard/WizardActions/WizardActions.tsx +40 -28
- package/src/components/_BaseStyling_/BaseStyling.tsx +17 -7
- package/src/font/icomoon.eot +0 -0
- package/src/font/icomoon.svg +4 -2
- package/src/font/icomoon.ttf +0 -0
- package/src/font/icomoon.woff +0 -0
- package/src/font/selection.json +1 -1
- package/src/hooks/useDetermineStatusIcon.tsx +1 -3
- package/src/hooks/usePosition.ts +7 -1
- package/src/index.ts +10 -0
- package/src/interfaces.ts +8 -0
- package/src/mixins.module.scss +6 -19
- package/src/util/helper.test.tsx +39 -1
- package/src/util/helper.tsx +25 -0
- package/src/variables.scss +4 -2
- package/dist/cjs/components/Notifications/Snackbar/useSnackbar.d.ts +0 -5
- package/dist/cjs/components/Wizard/WizardActions/WizardActions.d.ts +0 -12
- package/dist/esm/components/Notifications/Snackbar/useSnackbar.d.ts +0 -5
- package/dist/esm/components/Wizard/WizardActions/WizardActions.d.ts +0 -12
- /package/dist/cjs/{components → src/components}/Breadcrumbs/Breadcrumbs.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Breadcrumbs/Breadcrumbs.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Button/BaseButton.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Button/BaseButton.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Button/Button.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Button/Button.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Button/IconButton.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Button/IconButton.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Button/Spinner.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/ContextMenu/ContextMenu.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/ContextMenu/ContextMenu.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/ContextMenu/ContextMenuItem.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/DataGrid/DataGrid.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/DataGrid/DataGrid.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/DataGrid/DataGridActions/DataGridActions.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/DataGrid/DataGridActions/DataGridActions.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/DataGrid/DataGridActions/DataGridColumnsToggle.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/DataGrid/DataGridActions/DataGridColumnsToggle.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/DataGrid/DataGridBody/DataGridBody.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/DataGrid/DataGridBody/DataGridBody.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/DataGrid/DataGridBody/DataGridCell.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/DataGrid/DataGridBody/DataGridCell.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/DataGrid/DataGridBody/DataGridRow.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/DataGrid/DataGridBody/DataGridRow.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/DataGrid/DataGridHeader/DataGridHeader.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/DataGrid/DataGridHeader/DataGridHeader.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/DataGrid/DataGridHeader/DataGridHeaderCell.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/DataGrid/DataGridHeader/DataGridHeaderCell.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/DataGrid/datagrid.interfaces.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Checkbox/Checkbox.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Checkbox/Checkbox.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Fieldset/Fieldset.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Fieldset/Fieldset.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/FileUpload/FileItem/FileItem.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/FileUpload/FileItem/FileItem.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/FileUpload/FileUpload.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/FileUpload/FileUpload.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Form.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Form.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/FormControl/FormControl.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/FormControl/FormControl.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/FormGroup/FormGroup.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/FormGroup/FormGroup.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/FormHelperText/FormHelperText.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/FormSelectorWrapper/FormSelectorWrapper.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/FormSelectorWrapper/FormSelectorWrapper.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Input/Input.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Input/Input.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Label/Label.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Label/Label.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Radio/Radio.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Radio/Radio.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Select/Option.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Select/Select.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Textarea/Textarea.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Textarea/Textarea.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Toggle/Toggle.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Wrapper/InputWrapper/InputWrapper.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Wrapper/InputWrapper/InputWrapper.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Wrapper/RadioWrapper/RadioWrapper.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Wrapper/RadioWrapper/RadioWrapper.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Wrapper/SelectWrapper/SelectWrapper.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Wrapper/SelectWrapper/SelectWrapper.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Wrapper/TextareaWrapper/TextareaWrapper.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Wrapper/TextareaWrapper/TextareaWrapper.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Wrapper/Wrapper/Wrapper.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/Wrapper/Wrapper/Wrapper.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Form/form.interfaces.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Icon/Icon.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Link/Link.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/Banner/Banner.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/Banner/Banner.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/BaseModal/BaseModal.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/BaseModal/BaseModal.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/BaseModal/BaseModalActions/BaseModalActions.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/BaseModal/BaseModalContent/BaseModalContent.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/BaseModal/BaseModalContent/BaseModalContent.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/BaseModal/BaseModalContext.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/Dialog/Dialog.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/Dialog/DialogActions/DialogActions.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/Dialog/DialogTitle/DialogTitle.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/DiscardChangesModal/DiscardChangesDialog/DiscardChangesDialog.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/DiscardChangesModal/DiscardChangesModal.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/DiscardChangesModal/DiscardChangesModal.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/Modal/Modal.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/Modal/Modal.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/Modal/ModalActions/ModalActions.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/Modal/ModalContent/ModalContent.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/Modal/ModalHeader/ModalHeader.d.ts +0 -0
- /package/dist/cjs/{components/Notifications/SlideInModal/SlideInModal.test.d.ts → src/components/Notifications/NotificationProvider/NotificationContext.test.d.ts} +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/SlideInModal/SlideInModal.d.ts +0 -0
- /package/dist/{esm → cjs/src}/components/Notifications/SlideInModal/SlideInModal.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/Snackbar/SnackbarItem/SnackbarItem.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Pagination/Pagination.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Popover/Popover.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Popover/Popover.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/ProgressBar/ProgressBar.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Skeleton/Skeleton.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Skeleton/Skeleton.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/StatusIndicator/StatusIndicator.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/StatusIndicator/StatusIndicator.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Tabs/Tab.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Tabs/Tab.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Tabs/TabButton.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Tabs/TabButton.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Tabs/Tabs.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Tabs/Tabs.test.d.ts +0 -0
- /package/dist/cjs/{components/TextEllipsis/TextEllipsis.test.d.ts → src/components/Tag/Tag.test.d.ts} +0 -0
- /package/dist/cjs/{components → src/components}/TextEllipsis/TextEllipsis.d.ts +0 -0
- /package/dist/{esm → cjs/src}/components/TextEllipsis/TextEllipsis.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Tiles/Tile.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Tiles/Tile.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Tiles/Tiles.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Tiles/Tiles.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Tooltip/Tooltip.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Typography/Typography.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Wizard/BaseWizardSteps/BaseWizardSteps.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Wizard/BaseWizardSteps/BaseWizardSteps.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Wizard/Wizard.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Wizard/Wizard.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Wizard/WizardActions/WizardActions.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Wizard/WizardStateProvider.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Wizard/WizardSteps/WizardSteps.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Wizard/WizardSteps/WizardSteps.test.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/Wizard/wizardStateReducer.d.ts +0 -0
- /package/dist/cjs/{components → src/components}/_BaseStyling_/BaseStyling.test.d.ts +0 -0
- /package/dist/cjs/{hooks → src/hooks}/useAnimation.d.ts +0 -0
- /package/dist/cjs/{hooks → src/hooks}/useAnimation.test.d.ts +0 -0
- /package/dist/cjs/{hooks → src/hooks}/useBodyClick.d.ts +0 -0
- /package/dist/cjs/{hooks → src/hooks}/useBodyClick.test.d.ts +0 -0
- /package/dist/cjs/{hooks → src/hooks}/useDebouncedCallback.d.ts +0 -0
- /package/dist/cjs/{hooks → src/hooks}/useDebouncedCallback.test.d.ts +0 -0
- /package/dist/cjs/{hooks → src/hooks}/useDetermineStatusIcon.d.ts +0 -0
- /package/dist/cjs/{hooks → src/hooks}/useDetermineStatusIcon.test.d.ts +0 -0
- /package/dist/cjs/{hooks → src/hooks}/useFormSelector.d.ts +0 -0
- /package/dist/cjs/{hooks → src/hooks}/useFormSelector.test.d.ts +0 -0
- /package/dist/cjs/{hooks → src/hooks}/useGetDomRoot.d.ts +0 -0
- /package/dist/cjs/{hooks → src/hooks}/usePosition.test.d.ts +0 -0
- /package/dist/cjs/{hooks → src/hooks}/useRepeater.d.ts +0 -0
- /package/dist/cjs/{hooks → src/hooks}/useRepeater.test.d.ts +0 -0
- /package/dist/cjs/{hooks → src/hooks}/useScroll.d.ts +0 -0
- /package/dist/cjs/{hooks → src/hooks}/useScroll.test.d.ts +0 -0
- /package/dist/cjs/{hooks → src/hooks}/useSpacing.d.ts +0 -0
- /package/dist/cjs/{hooks → src/hooks}/useSpacing.test.d.ts +0 -0
- /package/dist/cjs/{hooks → src/hooks}/useUploadFile.d.ts +0 -0
- /package/dist/cjs/{hooks → src/hooks}/useUploadFile.test.d.ts +0 -0
- /package/dist/cjs/{hooks → src/hooks}/useWrapper.d.ts +0 -0
- /package/dist/cjs/{hooks → src/hooks}/useWrapper.test.d.ts +0 -0
- /package/dist/cjs/{util → src/util}/helper.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Breadcrumbs/Breadcrumbs.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Breadcrumbs/Breadcrumbs.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Button/BaseButton.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Button/BaseButton.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Button/Button.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Button/Button.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Button/IconButton.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Button/IconButton.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Button/Spinner.d.ts +0 -0
- /package/dist/esm/{components → src/components}/ContextMenu/ContextMenu.d.ts +0 -0
- /package/dist/esm/{components → src/components}/ContextMenu/ContextMenu.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/ContextMenu/ContextMenuItem.d.ts +0 -0
- /package/dist/esm/{components → src/components}/DataGrid/DataGrid.d.ts +0 -0
- /package/dist/esm/{components → src/components}/DataGrid/DataGrid.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/DataGrid/DataGridActions/DataGridActions.d.ts +0 -0
- /package/dist/esm/{components → src/components}/DataGrid/DataGridActions/DataGridActions.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/DataGrid/DataGridActions/DataGridColumnsToggle.d.ts +0 -0
- /package/dist/esm/{components → src/components}/DataGrid/DataGridActions/DataGridColumnsToggle.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/DataGrid/DataGridBody/DataGridBody.d.ts +0 -0
- /package/dist/esm/{components → src/components}/DataGrid/DataGridBody/DataGridBody.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/DataGrid/DataGridBody/DataGridCell.d.ts +0 -0
- /package/dist/esm/{components → src/components}/DataGrid/DataGridBody/DataGridCell.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/DataGrid/DataGridBody/DataGridRow.d.ts +0 -0
- /package/dist/esm/{components → src/components}/DataGrid/DataGridBody/DataGridRow.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/DataGrid/DataGridHeader/DataGridHeader.d.ts +0 -0
- /package/dist/esm/{components → src/components}/DataGrid/DataGridHeader/DataGridHeader.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/DataGrid/DataGridHeader/DataGridHeaderCell.d.ts +0 -0
- /package/dist/esm/{components → src/components}/DataGrid/DataGridHeader/DataGridHeaderCell.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/DataGrid/datagrid.interfaces.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Checkbox/Checkbox.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Checkbox/Checkbox.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Fieldset/Fieldset.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Fieldset/Fieldset.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/FileUpload/FileItem/FileItem.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/FileUpload/FileItem/FileItem.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/FileUpload/FileUpload.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/FileUpload/FileUpload.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Form.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Form.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/FormControl/FormControl.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/FormControl/FormControl.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/FormGroup/FormGroup.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/FormGroup/FormGroup.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/FormHelperText/FormHelperText.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/FormSelectorWrapper/FormSelectorWrapper.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/FormSelectorWrapper/FormSelectorWrapper.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Input/Input.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Input/Input.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Label/Label.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Label/Label.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Radio/Radio.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Radio/Radio.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Select/Option.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Select/Select.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Textarea/Textarea.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Textarea/Textarea.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Toggle/Toggle.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Wrapper/InputWrapper/InputWrapper.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Wrapper/InputWrapper/InputWrapper.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Wrapper/RadioWrapper/RadioWrapper.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Wrapper/RadioWrapper/RadioWrapper.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Wrapper/SelectWrapper/SelectWrapper.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Wrapper/SelectWrapper/SelectWrapper.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Wrapper/TextareaWrapper/TextareaWrapper.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Wrapper/TextareaWrapper/TextareaWrapper.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Wrapper/Wrapper/Wrapper.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/Wrapper/Wrapper/Wrapper.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Form/form.interfaces.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Icon/Icon.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Link/Link.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Notifications/Banner/Banner.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Notifications/Banner/Banner.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Notifications/BaseModal/BaseModal.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Notifications/BaseModal/BaseModal.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Notifications/BaseModal/BaseModalActions/BaseModalActions.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Notifications/BaseModal/BaseModalContent/BaseModalContent.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Notifications/BaseModal/BaseModalContent/BaseModalContent.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Notifications/BaseModal/BaseModalContext.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Notifications/Dialog/Dialog.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Notifications/Dialog/DialogActions/DialogActions.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Notifications/Dialog/DialogTitle/DialogTitle.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Notifications/DiscardChangesModal/DiscardChangesDialog/DiscardChangesDialog.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Notifications/DiscardChangesModal/DiscardChangesModal.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Notifications/DiscardChangesModal/DiscardChangesModal.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Notifications/Modal/Modal.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Notifications/Modal/Modal.test.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Notifications/Modal/ModalActions/ModalActions.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Notifications/Modal/ModalContent/ModalContent.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Notifications/Modal/ModalHeader/ModalHeader.d.ts +0 -0
- /package/dist/esm/{components/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.test.d.ts → src/components/Notifications/NotificationProvider/NotificationContext.test.d.ts} +0 -0
- /package/dist/esm/{components → src/components}/Notifications/SlideInModal/SlideInModal.d.ts +0 -0
- /package/dist/esm/{components/Notifications/Snackbar/SnackbarItem/SnackbarItem.test.d.ts → src/components/Notifications/SlideInModal/SlideInModal.test.d.ts} +0 -0
- /package/dist/esm/{components → src/components}/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.d.ts +0 -0
- /package/dist/esm/{components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.test.d.ts → src/components/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.test.d.ts} +0 -0
- /package/dist/esm/{components/Pagination/Pagination.test.d.ts → src/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.test.d.ts} +0 -0
- /package/dist/esm/{components/Popover/Popover.test.d.ts → src/components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.test.d.ts} +0 -0
- /package/dist/esm/{components/ProgressBar/ProgressBar.test.d.ts → src/components/Pagination/Pagination.test.d.ts} +0 -0
- /package/dist/esm/{components → src/components}/Popover/Popover.d.ts +0 -0
- /package/dist/esm/{components/Skeleton/Skeleton.test.d.ts → src/components/Popover/Popover.test.d.ts} +0 -0
- /package/dist/esm/{components/StatusIndicator/StatusIndicator.test.d.ts → src/components/ProgressBar/ProgressBar.test.d.ts} +0 -0
- /package/dist/esm/{components → src/components}/Skeleton/Skeleton.d.ts +0 -0
- /package/dist/esm/{components/Tabs/Tab.test.d.ts → src/components/Skeleton/Skeleton.test.d.ts} +0 -0
- /package/dist/esm/{components → src/components}/StatusIndicator/StatusIndicator.d.ts +0 -0
- /package/dist/esm/{components/Tabs/TabButton.test.d.ts → src/components/StatusIndicator/StatusIndicator.test.d.ts} +0 -0
- /package/dist/esm/{components → src/components}/Tabs/Tab.d.ts +0 -0
- /package/dist/esm/{components/Tabs/Tabs.test.d.ts → src/components/Tabs/Tab.test.d.ts} +0 -0
- /package/dist/esm/{components → src/components}/Tabs/TabButton.d.ts +0 -0
- /package/dist/esm/{components/Tiles/Tile.test.d.ts → src/components/Tabs/TabButton.test.d.ts} +0 -0
- /package/dist/esm/{components → src/components}/Tabs/Tabs.d.ts +0 -0
- /package/dist/esm/{components/Tiles/Tiles.test.d.ts → src/components/Tabs/Tabs.test.d.ts} +0 -0
- /package/dist/esm/{components/Tooltip/Tooltip.test.d.ts → src/components/Tag/Tag.test.d.ts} +0 -0
- /package/dist/esm/{components → src/components}/TextEllipsis/TextEllipsis.d.ts +0 -0
- /package/dist/esm/{components/Typography/Typography.test.d.ts → src/components/TextEllipsis/TextEllipsis.test.d.ts} +0 -0
- /package/dist/esm/{components → src/components}/Tiles/Tile.d.ts +0 -0
- /package/dist/esm/{components/Wizard/BaseWizardSteps/BaseWizardSteps.test.d.ts → src/components/Tiles/Tile.test.d.ts} +0 -0
- /package/dist/esm/{components → src/components}/Tiles/Tiles.d.ts +0 -0
- /package/dist/esm/{components/Wizard/Wizard.test.d.ts → src/components/Tiles/Tiles.test.d.ts} +0 -0
- /package/dist/esm/{components/Wizard/WizardActions/WizardActions.test.d.ts → src/components/Tooltip/Tooltip.test.d.ts} +0 -0
- /package/dist/esm/{components/Wizard/WizardSteps/WizardSteps.test.d.ts → src/components/Typography/Typography.test.d.ts} +0 -0
- /package/dist/esm/{components → src/components}/Wizard/BaseWizardSteps/BaseWizardSteps.d.ts +0 -0
- /package/dist/esm/{components/_BaseStyling_/BaseStyling.test.d.ts → src/components/Wizard/BaseWizardSteps/BaseWizardSteps.test.d.ts} +0 -0
- /package/dist/esm/{components → src/components}/Wizard/Wizard.d.ts +0 -0
- /package/dist/esm/{hooks/useAnimation.test.d.ts → src/components/Wizard/Wizard.test.d.ts} +0 -0
- /package/dist/esm/{hooks/useBodyClick.test.d.ts → src/components/Wizard/WizardActions/WizardActions.test.d.ts} +0 -0
- /package/dist/esm/{components → src/components}/Wizard/WizardStateProvider.d.ts +0 -0
- /package/dist/esm/{components → src/components}/Wizard/WizardSteps/WizardSteps.d.ts +0 -0
- /package/dist/esm/{hooks/useDebouncedCallback.test.d.ts → src/components/Wizard/WizardSteps/WizardSteps.test.d.ts} +0 -0
- /package/dist/esm/{components → src/components}/Wizard/wizardStateReducer.d.ts +0 -0
- /package/dist/esm/{hooks/useDetermineStatusIcon.test.d.ts → src/components/_BaseStyling_/BaseStyling.test.d.ts} +0 -0
- /package/dist/esm/{hooks → src/hooks}/useAnimation.d.ts +0 -0
- /package/dist/esm/{hooks/useFormSelector.test.d.ts → src/hooks/useAnimation.test.d.ts} +0 -0
- /package/dist/esm/{hooks → src/hooks}/useBodyClick.d.ts +0 -0
- /package/dist/esm/{hooks/usePosition.test.d.ts → src/hooks/useBodyClick.test.d.ts} +0 -0
- /package/dist/esm/{hooks → src/hooks}/useDebouncedCallback.d.ts +0 -0
- /package/dist/esm/{hooks/useScroll.test.d.ts → src/hooks/useDebouncedCallback.test.d.ts} +0 -0
- /package/dist/esm/{hooks → src/hooks}/useDetermineStatusIcon.d.ts +0 -0
- /package/dist/esm/{hooks/useSpacing.test.d.ts → src/hooks/useDetermineStatusIcon.test.d.ts} +0 -0
- /package/dist/esm/{hooks → src/hooks}/useFormSelector.d.ts +0 -0
- /package/dist/esm/{hooks/useUploadFile.test.d.ts → src/hooks/useFormSelector.test.d.ts} +0 -0
- /package/dist/esm/{hooks → src/hooks}/useGetDomRoot.d.ts +0 -0
- /package/dist/esm/{hooks/useWrapper.test.d.ts → src/hooks/usePosition.test.d.ts} +0 -0
- /package/dist/esm/{hooks → src/hooks}/useRepeater.d.ts +0 -0
- /package/dist/esm/{hooks → src/hooks}/useRepeater.test.d.ts +0 -0
- /package/dist/esm/{hooks → src/hooks}/useScroll.d.ts +0 -0
- /package/dist/esm/{util/helper.test.d.ts → src/hooks/useScroll.test.d.ts} +0 -0
- /package/dist/esm/{hooks → src/hooks}/useSpacing.d.ts +0 -0
- /package/dist/esm/{hooks → src/hooks}/useUploadFile.d.ts +0 -0
- /package/dist/esm/{hooks → src/hooks}/useWrapper.d.ts +0 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import React, {
|
|
18
|
+
ReactNode,
|
|
19
|
+
createContext,
|
|
20
|
+
useCallback,
|
|
21
|
+
useContext,
|
|
22
|
+
useEffect,
|
|
23
|
+
useReducer
|
|
24
|
+
} from "react";
|
|
25
|
+
import {
|
|
26
|
+
Notification,
|
|
27
|
+
ErrorNotification,
|
|
28
|
+
SuccessNotification,
|
|
29
|
+
Translations,
|
|
30
|
+
AddNotification
|
|
31
|
+
} from "./notification.interfaces";
|
|
32
|
+
import { defaultTranslations } from "./NotificationService";
|
|
33
|
+
import { useSnackbar } from "../Snackbar/useSnackbar";
|
|
34
|
+
import { deepMerge, generateID } from "../../../util/helper";
|
|
35
|
+
import { DeepPartial } from "../../../interfaces";
|
|
36
|
+
|
|
37
|
+
interface NotificationState {
|
|
38
|
+
notifications: Notification<ErrorNotification | SuccessNotification>[];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface NotificationAction {
|
|
42
|
+
type: "add" | "remove" | "handled" | "reset";
|
|
43
|
+
payload?: Notification<ErrorNotification | SuccessNotification> & {
|
|
44
|
+
id?: string;
|
|
45
|
+
handled?: boolean;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const initialState: NotificationState = {
|
|
50
|
+
notifications: []
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export interface NotificationHandlerProps {
|
|
54
|
+
translations?: DeepPartial<Translations>;
|
|
55
|
+
dispatchFn: React.Dispatch<NotificationAction>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const NotificationHandler = ({
|
|
59
|
+
translations = {},
|
|
60
|
+
dispatchFn
|
|
61
|
+
}: NotificationHandlerProps) => {
|
|
62
|
+
const { enqueueErrorSnackbar, enqueueSuccessSnackbar } = useSnackbar();
|
|
63
|
+
const {
|
|
64
|
+
state: { notifications }
|
|
65
|
+
} = useNotificationContext();
|
|
66
|
+
|
|
67
|
+
const mergedTranslations = deepMerge<Translations>(defaultTranslations, translations);
|
|
68
|
+
|
|
69
|
+
const determineNotificationMessage = (notification: Notification<ErrorNotification>) => {
|
|
70
|
+
if (notification.message) {
|
|
71
|
+
return notification.message;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
switch (notification.status) {
|
|
75
|
+
case 500:
|
|
76
|
+
return mergedTranslations.messages.general;
|
|
77
|
+
case 400:
|
|
78
|
+
return mergedTranslations.messages.badRequest;
|
|
79
|
+
case 401:
|
|
80
|
+
return mergedTranslations.messages.unauthorized;
|
|
81
|
+
case 403:
|
|
82
|
+
return mergedTranslations.messages.forbidden;
|
|
83
|
+
case 404:
|
|
84
|
+
return mergedTranslations.messages.notFound;
|
|
85
|
+
case 502:
|
|
86
|
+
case 503:
|
|
87
|
+
return mergedTranslations.messages.unavailable;
|
|
88
|
+
case 504:
|
|
89
|
+
return mergedTranslations.messages.timeout;
|
|
90
|
+
default:
|
|
91
|
+
return mergedTranslations.messages.general;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
useEffect(() => {
|
|
96
|
+
notifications.forEach(notification => {
|
|
97
|
+
if (
|
|
98
|
+
notification.status &&
|
|
99
|
+
notification.handled &&
|
|
100
|
+
(notification.status === 401 || notification.status === 403)
|
|
101
|
+
) {
|
|
102
|
+
dispatchFn({ type: "remove", payload: { id: notification.id } });
|
|
103
|
+
} else if (notification.status && !notification.handled && notification.type === "error") {
|
|
104
|
+
enqueueErrorSnackbar(
|
|
105
|
+
notification.title ?? mergedTranslations.general.error,
|
|
106
|
+
determineNotificationMessage(notification as Notification<ErrorNotification>),
|
|
107
|
+
{
|
|
108
|
+
onClose: () => dispatchFn({ type: "remove", payload: { id: notification.id } })
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
dispatchFn({ type: "handled", payload: { id: notification.id, handled: true } });
|
|
112
|
+
} else if (notification.title && !notification.handled && notification.type === "success") {
|
|
113
|
+
enqueueSuccessSnackbar(
|
|
114
|
+
notification.title ?? mergedTranslations.general.success,
|
|
115
|
+
notification.message,
|
|
116
|
+
{
|
|
117
|
+
onClose: () => dispatchFn({ type: "remove", payload: { id: notification.id } })
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
dispatchFn({ type: "handled", payload: { id: notification.id, handled: true } });
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}, [notifications.length]);
|
|
125
|
+
|
|
126
|
+
return null;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export const NotificationContext = createContext<{
|
|
130
|
+
state: NotificationState;
|
|
131
|
+
dispatch: React.Dispatch<NotificationAction>;
|
|
132
|
+
}>({
|
|
133
|
+
state: initialState,
|
|
134
|
+
dispatch: () => undefined
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
export interface Props {
|
|
138
|
+
children?: ReactNode;
|
|
139
|
+
translations?: DeepPartial<Translations>;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export const NotificationProvider = ({ children, translations }: Props) => {
|
|
143
|
+
const [state, dispatch] = useReducer(notificationReducer, initialState);
|
|
144
|
+
|
|
145
|
+
return (
|
|
146
|
+
<NotificationContext.Provider value={{ state, dispatch }}>
|
|
147
|
+
{children}
|
|
148
|
+
<NotificationHandler translations={translations} dispatchFn={dispatch} />
|
|
149
|
+
</NotificationContext.Provider>
|
|
150
|
+
);
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export const useNotificationContext = () => {
|
|
154
|
+
const ctx = useContext(NotificationContext);
|
|
155
|
+
|
|
156
|
+
const addNotification = useCallback(
|
|
157
|
+
(notification: AddNotification) => {
|
|
158
|
+
ctx.dispatch({ type: "add", payload: notification });
|
|
159
|
+
},
|
|
160
|
+
[ctx]
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
const removeNotification = useCallback(
|
|
164
|
+
(id: string) => {
|
|
165
|
+
ctx.dispatch({ type: "remove", payload: { id } });
|
|
166
|
+
},
|
|
167
|
+
[ctx]
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
const resetNotifications = useCallback(() => {
|
|
171
|
+
ctx.dispatch({ type: "reset" });
|
|
172
|
+
}, [ctx]);
|
|
173
|
+
|
|
174
|
+
return {
|
|
175
|
+
state: ctx.state,
|
|
176
|
+
addNotification,
|
|
177
|
+
removeNotification,
|
|
178
|
+
resetNotifications
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
export const notificationReducer = (
|
|
183
|
+
state: NotificationState,
|
|
184
|
+
action: NotificationAction
|
|
185
|
+
): NotificationState => {
|
|
186
|
+
switch (action.type) {
|
|
187
|
+
case "add":
|
|
188
|
+
return {
|
|
189
|
+
...state,
|
|
190
|
+
notifications: [
|
|
191
|
+
...state.notifications,
|
|
192
|
+
{
|
|
193
|
+
...action.payload,
|
|
194
|
+
id: generateID(),
|
|
195
|
+
handled: false
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
};
|
|
199
|
+
case "remove":
|
|
200
|
+
return {
|
|
201
|
+
...state,
|
|
202
|
+
notifications: state.notifications.filter(
|
|
203
|
+
notification => notification.id !== action.payload?.id
|
|
204
|
+
)
|
|
205
|
+
};
|
|
206
|
+
case "handled":
|
|
207
|
+
return {
|
|
208
|
+
...state,
|
|
209
|
+
notifications: state.notifications.map(notification =>
|
|
210
|
+
notification.id === action.payload?.id ? { ...notification, handled: true } : notification
|
|
211
|
+
)
|
|
212
|
+
};
|
|
213
|
+
case "reset":
|
|
214
|
+
return {
|
|
215
|
+
...state,
|
|
216
|
+
notifications: []
|
|
217
|
+
};
|
|
218
|
+
default:
|
|
219
|
+
return state;
|
|
220
|
+
}
|
|
221
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { Translations } from "./notification.interfaces";
|
|
18
|
+
|
|
19
|
+
export const defaultTranslations: Translations = {
|
|
20
|
+
general: {
|
|
21
|
+
error: "Error",
|
|
22
|
+
success: "Success"
|
|
23
|
+
},
|
|
24
|
+
messages: {
|
|
25
|
+
general: "Something went wrong. Please try again later.",
|
|
26
|
+
badRequest: "Bad request",
|
|
27
|
+
unauthorized: "You are not authorized to perform this action.",
|
|
28
|
+
forbidden: "You are not allowed to perform this action.",
|
|
29
|
+
notFound: "The requested resource could not be found.",
|
|
30
|
+
timeout: "The request timed out.",
|
|
31
|
+
unavailable: "The server is currently unavailable. Please try again later."
|
|
32
|
+
}
|
|
33
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 OneWelcome B.V.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export interface ErrorNotification extends NotificationType {
|
|
18
|
+
response?: string;
|
|
19
|
+
type: "error";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface SuccessNotification extends NotificationType {
|
|
23
|
+
response?: string;
|
|
24
|
+
type: "success";
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface NotificationType {
|
|
28
|
+
type: "error" | "success";
|
|
29
|
+
status: HttpStatuses;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type HttpStatuses = 200 | 500 | 400 | 401 | 403 | 404 | 501 | 502 | 503 | 504;
|
|
33
|
+
|
|
34
|
+
export interface AddNotification {
|
|
35
|
+
type: "error" | "success";
|
|
36
|
+
status: HttpStatuses;
|
|
37
|
+
title?: string;
|
|
38
|
+
message?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface RemoveNotification {
|
|
42
|
+
id: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface Notification<T extends NotificationType> {
|
|
46
|
+
id?: string;
|
|
47
|
+
type?: T["type"];
|
|
48
|
+
status?: HttpStatuses;
|
|
49
|
+
title?: string;
|
|
50
|
+
message?: string;
|
|
51
|
+
handled?: boolean;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface Translations {
|
|
55
|
+
general: {
|
|
56
|
+
error: string;
|
|
57
|
+
success: string;
|
|
58
|
+
};
|
|
59
|
+
messages: {
|
|
60
|
+
general: string;
|
|
61
|
+
badRequest: string;
|
|
62
|
+
unauthorized: string;
|
|
63
|
+
forbidden: string;
|
|
64
|
+
notFound: string;
|
|
65
|
+
timeout: string;
|
|
66
|
+
unavailable: string;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
@@ -18,14 +18,21 @@
|
|
|
18
18
|
@use "../../../../mixins.module.scss";
|
|
19
19
|
|
|
20
20
|
.snackbar {
|
|
21
|
-
padding: 1rem
|
|
21
|
+
padding: 0.5rem 1rem;
|
|
22
22
|
border-radius: var(--snackbar-border-radius);
|
|
23
23
|
display: flex;
|
|
24
|
+
gap: 0.5rem;
|
|
25
|
+
align-items: center;
|
|
24
26
|
width: 100%;
|
|
25
27
|
box-sizing: border-box;
|
|
26
28
|
@include mixins.transition(height, 0.2s, ease-in-out);
|
|
27
29
|
flex-grow: 0;
|
|
28
30
|
|
|
31
|
+
&.has-title {
|
|
32
|
+
align-items: flex-start;
|
|
33
|
+
padding: 1rem;
|
|
34
|
+
}
|
|
35
|
+
|
|
29
36
|
&.info {
|
|
30
37
|
background-color: var(--snackbar-info-background-color);
|
|
31
38
|
}
|
|
@@ -38,72 +45,94 @@
|
|
|
38
45
|
background-color: var(--snackbar-error-background-color);
|
|
39
46
|
}
|
|
40
47
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.container {
|
|
46
|
-
flex: 1;
|
|
48
|
+
&.warning {
|
|
49
|
+
background-color: var(--snackbar-warning-background-color);
|
|
47
50
|
}
|
|
48
51
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
color: var(--snackbar-text-color);
|
|
52
|
+
& + & {
|
|
53
|
+
margin-top: 0.5rem;
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
#close-btn {
|
|
55
57
|
color: var(--snackbar-text-color);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
align-self: center;
|
|
59
|
+
width: 2.5rem;
|
|
60
|
+
height: 2.5rem;
|
|
61
|
+
flex-shrink: 0;
|
|
62
|
+
border: 0;
|
|
63
|
+
|
|
64
|
+
span {
|
|
65
|
+
font-size: 0.875rem;
|
|
60
66
|
}
|
|
61
67
|
|
|
62
|
-
&:
|
|
63
|
-
|
|
68
|
+
&:not(:disabled):hover,
|
|
69
|
+
&:not(:disabled):focus {
|
|
70
|
+
background-color: var(--color-black10);
|
|
71
|
+
}
|
|
64
72
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
height: 100%;
|
|
68
|
-
background-color: var(--snackbar-text-color);
|
|
69
|
-
}
|
|
73
|
+
&:not(:disabled):active {
|
|
74
|
+
background-color: var(--color-black20);
|
|
70
75
|
}
|
|
71
76
|
}
|
|
72
77
|
|
|
73
78
|
.icon {
|
|
74
79
|
color: var(--snackbar-text-color);
|
|
75
|
-
|
|
76
|
-
font-size: 1.25rem;
|
|
80
|
+
font-size: 1rem;
|
|
77
81
|
line-height: var(--default-line-height);
|
|
82
|
+
display: flex;
|
|
78
83
|
}
|
|
79
84
|
|
|
80
85
|
.title {
|
|
81
86
|
color: var(--snackbar-text-color);
|
|
82
87
|
flex: 1;
|
|
83
|
-
|
|
88
|
+
font-size: 0.875rem;
|
|
89
|
+
line-height: var(--default-line-height);
|
|
90
|
+
margin-bottom: 0.25rem;
|
|
91
|
+
margin-top: -2.5px;
|
|
92
|
+
display: block;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.content-wrapper {
|
|
96
|
+
flex-grow: 1;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&.has-title .content-wrapper {
|
|
100
|
+
width: 12.5rem;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@media screen and (min-width: 37.5em) {
|
|
104
|
+
&:not(.has-title) .content {
|
|
105
|
+
white-space: nowrap;
|
|
106
|
+
}
|
|
84
107
|
}
|
|
85
108
|
|
|
86
109
|
.content {
|
|
87
|
-
margin: 0.25rem 0.75rem 0 0.75rem;
|
|
88
110
|
color: var(--snackbar-text-color);
|
|
111
|
+
font-size: 0.875rem;
|
|
112
|
+
margin-bottom: 0;
|
|
113
|
+
line-height: var(--default-line-height);
|
|
89
114
|
}
|
|
90
115
|
|
|
91
116
|
.actions {
|
|
92
|
-
margin: 0.5rem 0.75rem 0 0.75rem;
|
|
93
117
|
text-align: right;
|
|
118
|
+
align-self: center;
|
|
94
119
|
}
|
|
95
120
|
|
|
96
121
|
.action-button {
|
|
97
122
|
border-width: var(--button-border-width);
|
|
98
123
|
border-style: var(--button-border-style);
|
|
99
124
|
border-radius: var(--button-border-radius);
|
|
100
|
-
|
|
125
|
+
white-space: nowrap;
|
|
126
|
+
font-size: 0.875rem;
|
|
101
127
|
line-height: var(--button-font-size);
|
|
102
|
-
font-weight:
|
|
128
|
+
font-weight: 400;
|
|
103
129
|
margin: 0;
|
|
104
130
|
padding: 0.625rem 1.25rem;
|
|
105
131
|
cursor: pointer;
|
|
106
|
-
transition:
|
|
132
|
+
transition:
|
|
133
|
+
color,
|
|
134
|
+
background-color,
|
|
135
|
+
border-color 0.2s ease-in-out;
|
|
107
136
|
font-family: var(--font-family);
|
|
108
137
|
color: var(--snackbar-text-color);
|
|
109
138
|
background-color: transparent;
|
|
@@ -118,36 +147,18 @@
|
|
|
118
147
|
|
|
119
148
|
&:not(:disabled):hover,
|
|
120
149
|
&:not(:disabled):focus {
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
&:active {
|
|
125
|
-
position: relative;
|
|
126
|
-
border: 0 transparent;
|
|
127
|
-
padding: calc(0.625rem + var(--button-border-width))
|
|
128
|
-
calc(1.25rem + var(--button-border-width));
|
|
129
|
-
|
|
130
|
-
&:after {
|
|
131
|
-
content: "";
|
|
132
|
-
position: absolute;
|
|
133
|
-
top: 0;
|
|
134
|
-
left: 0;
|
|
135
|
-
width: 100%;
|
|
136
|
-
height: 100%;
|
|
137
|
-
background-color: var(--snackbar-text-color);
|
|
138
|
-
border-radius: var(--button-border-radius);
|
|
139
|
-
filter: opacity(0.1);
|
|
140
|
-
}
|
|
150
|
+
background-color: var(--color-black10);
|
|
141
151
|
}
|
|
142
152
|
|
|
143
|
-
|
|
144
|
-
|
|
153
|
+
&:not(:disabled):active {
|
|
154
|
+
background-color: var(--color-black20);
|
|
145
155
|
}
|
|
146
156
|
}
|
|
147
157
|
}
|
|
148
158
|
|
|
149
159
|
@media only screen and (min-width: 37.5em) {
|
|
150
160
|
.snackbar {
|
|
151
|
-
width:
|
|
161
|
+
width: min-content;
|
|
162
|
+
min-width: 25rem;
|
|
152
163
|
}
|
|
153
164
|
}
|
|
@@ -32,7 +32,7 @@ describe("SnackbarItem", () => {
|
|
|
32
32
|
it("renders without crashing", () => {
|
|
33
33
|
const { container } = render(<SnackbarItem {...initParams} />);
|
|
34
34
|
|
|
35
|
-
expect(container).toHaveTextContent(initParams.title);
|
|
35
|
+
expect(container).toHaveTextContent(initParams.title!);
|
|
36
36
|
const contentDiv = container.querySelector(".content");
|
|
37
37
|
expect(contentDiv).toBeNull();
|
|
38
38
|
const actionsDiv = container.querySelector(".actions");
|
|
@@ -28,9 +28,10 @@ const textColor = "var(--snackbar-text-color)";
|
|
|
28
28
|
|
|
29
29
|
export interface Props {
|
|
30
30
|
id: string;
|
|
31
|
-
title
|
|
31
|
+
title?: string;
|
|
32
32
|
duration: number;
|
|
33
33
|
variant: Variant;
|
|
34
|
+
className?: string;
|
|
34
35
|
onClose: (key: string) => void;
|
|
35
36
|
closeButtonTitle: string;
|
|
36
37
|
content?: string;
|
|
@@ -56,6 +57,7 @@ export const SnackbarItem = ({
|
|
|
56
57
|
duration,
|
|
57
58
|
variant,
|
|
58
59
|
content,
|
|
60
|
+
className,
|
|
59
61
|
actions = [],
|
|
60
62
|
onClose,
|
|
61
63
|
closeButtonTitle
|
|
@@ -85,7 +87,12 @@ export const SnackbarItem = ({
|
|
|
85
87
|
if (variant === "error") {
|
|
86
88
|
return Icons.Error;
|
|
87
89
|
}
|
|
88
|
-
|
|
90
|
+
|
|
91
|
+
if (variant === "warning") {
|
|
92
|
+
return Icons.Warning;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return variant === "success" ? Icons.CheckmarkCircleAlt : Icons.InfoCircle;
|
|
89
96
|
};
|
|
90
97
|
|
|
91
98
|
const actionButtons = actions.map((actionProp, index) => (
|
|
@@ -102,37 +109,43 @@ export const SnackbarItem = ({
|
|
|
102
109
|
</button>
|
|
103
110
|
));
|
|
104
111
|
|
|
112
|
+
const snackbarClasses = [
|
|
113
|
+
classes["snackbar"],
|
|
114
|
+
classes[variant],
|
|
115
|
+
animationStarted ? readyclasses["slide-out"] : readyclasses["slide-in"],
|
|
116
|
+
title ? classes["has-title"] : "",
|
|
117
|
+
className ?? ""
|
|
118
|
+
].join(" ");
|
|
119
|
+
|
|
105
120
|
return (
|
|
106
121
|
<div
|
|
107
122
|
ref={ref}
|
|
108
123
|
aria-live="polite"
|
|
109
|
-
className={
|
|
110
|
-
animationStarted ? readyclasses["slide-out"] : readyclasses["slide-in"]
|
|
111
|
-
}`}
|
|
124
|
+
className={snackbarClasses}
|
|
112
125
|
onMouseEnter={onMouseEnter}
|
|
113
126
|
onMouseLeave={onMouseLeave}
|
|
114
127
|
>
|
|
115
128
|
<Icon icon={getVariantIcon()} className={classes["icon"]} />
|
|
116
|
-
<div className={classes["
|
|
117
|
-
|
|
118
|
-
<Typography className={classes["title"]} variant="
|
|
129
|
+
<div className={classes["content-wrapper"]}>
|
|
130
|
+
{title && (
|
|
131
|
+
<Typography className={classes["title"]} variant="body-bold" tag="span">
|
|
119
132
|
{title}
|
|
120
133
|
</Typography>
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
onClick={() => startAnimation()}
|
|
124
|
-
title={closeButtonTitle}
|
|
125
|
-
>
|
|
126
|
-
<Icon icon={Icons.Times} color={textColor} />
|
|
127
|
-
</IconButton>
|
|
128
|
-
</div>
|
|
129
|
-
{!!content && (
|
|
134
|
+
)}
|
|
135
|
+
{content && (
|
|
130
136
|
<Typography className={classes["content"]} variant="body">
|
|
131
137
|
{content}
|
|
132
138
|
</Typography>
|
|
133
139
|
)}
|
|
134
|
-
{actionButtons.length > 0 && <div className={classes["actions"]}>{actionButtons}</div>}
|
|
135
140
|
</div>
|
|
141
|
+
{actionButtons.length > 0 && <div className={classes["actions"]}>{actionButtons}</div>}
|
|
142
|
+
<IconButton
|
|
143
|
+
id={classes["close-btn"]}
|
|
144
|
+
onClick={() => startAnimation()}
|
|
145
|
+
title={closeButtonTitle}
|
|
146
|
+
>
|
|
147
|
+
<Icon icon={Icons.Times} color={textColor} />
|
|
148
|
+
</IconButton>
|
|
136
149
|
</div>
|
|
137
150
|
);
|
|
138
151
|
};
|
|
@@ -55,9 +55,22 @@ const infoProps = {
|
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
+
const warningProps = {
|
|
59
|
+
title: "warning title",
|
|
60
|
+
options: {
|
|
61
|
+
duration: 10,
|
|
62
|
+
onClose: jest.fn()
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
58
66
|
const renderSnackbarProvider = (props?: Partial<Props>) => {
|
|
59
67
|
const AppComponent = () => {
|
|
60
|
-
const {
|
|
68
|
+
const {
|
|
69
|
+
enqueueSuccessSnackbar,
|
|
70
|
+
enqueueErrorSnackbar,
|
|
71
|
+
enqueueSnackbar,
|
|
72
|
+
enqueueWarningSnackbar
|
|
73
|
+
} = useSnackbar();
|
|
61
74
|
const [index, setIndex] = useState(0);
|
|
62
75
|
return (
|
|
63
76
|
<div>
|
|
@@ -89,6 +102,15 @@ const renderSnackbarProvider = (props?: Partial<Props>) => {
|
|
|
89
102
|
>
|
|
90
103
|
Info
|
|
91
104
|
</button>
|
|
105
|
+
<button
|
|
106
|
+
data-testid="show-warning"
|
|
107
|
+
onClick={() => {
|
|
108
|
+
enqueueWarningSnackbar(warningProps.title + index, undefined, warningProps.options);
|
|
109
|
+
setIndex(index + 1);
|
|
110
|
+
}}
|
|
111
|
+
>
|
|
112
|
+
Warning
|
|
113
|
+
</button>
|
|
92
114
|
</div>
|
|
93
115
|
);
|
|
94
116
|
};
|
|
@@ -102,12 +124,14 @@ const renderSnackbarProvider = (props?: Partial<Props>) => {
|
|
|
102
124
|
const showSuccessSnackbarBtn = getByTestId(queries.container, "show-success");
|
|
103
125
|
const showErrorSnackbarBtn = getByTestId(queries.container, "show-error");
|
|
104
126
|
const showInfoSnackbarBtn = getByTestId(queries.container, "show-info");
|
|
127
|
+
const showWarningSnackbarBtn = getByTestId(queries.container, "show-warning");
|
|
105
128
|
|
|
106
129
|
return {
|
|
107
130
|
...queries,
|
|
108
131
|
showSuccessSnackbarBtn,
|
|
109
132
|
showErrorSnackbarBtn,
|
|
110
|
-
showInfoSnackbarBtn
|
|
133
|
+
showInfoSnackbarBtn,
|
|
134
|
+
showWarningSnackbarBtn
|
|
111
135
|
};
|
|
112
136
|
};
|
|
113
137
|
|
|
@@ -119,14 +143,17 @@ describe("SnackbarProvider", () => {
|
|
|
119
143
|
});
|
|
120
144
|
|
|
121
145
|
it("should stack 3 snackbars at one time", async () => {
|
|
122
|
-
const { showSuccessSnackbarBtn } = renderSnackbarProvider();
|
|
146
|
+
const { showSuccessSnackbarBtn, showWarningSnackbarBtn } = renderSnackbarProvider();
|
|
123
147
|
|
|
124
148
|
await userEvent.click(showSuccessSnackbarBtn);
|
|
125
|
-
await userEvent.click(
|
|
149
|
+
await userEvent.click(showWarningSnackbarBtn);
|
|
126
150
|
await userEvent.click(showSuccessSnackbarBtn);
|
|
127
151
|
await userEvent.click(showSuccessSnackbarBtn);
|
|
128
152
|
|
|
129
|
-
|
|
153
|
+
await waitFor(() => {
|
|
154
|
+
expect(getAllByText(document.body, new RegExp(successProps.title))).toHaveLength(2);
|
|
155
|
+
expect(getAllByText(document.body, new RegExp(warningProps.title))).toHaveLength(1);
|
|
156
|
+
});
|
|
130
157
|
});
|
|
131
158
|
|
|
132
159
|
it("should render 3 variants of snackbars", async () => {
|