@pautena/react-design-system 0.12.0 → 0.12.2
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/.eslintrc.cjs +40 -0
- package/.prettierrc.cjs +5 -0
- package/package.json +1 -1
- package/src/components/alerts/alerts.stories.mdx +0 -10
- package/src/components/alerts/expandable-alert/expandable-alert.stories.tsx +0 -96
- package/src/components/alerts/expandable-alert/expandable-alert.test.tsx +0 -137
- package/src/components/alerts/expandable-alert/expandable-alert.tsx +0 -78
- package/src/components/alerts/expandable-alert/index.ts +0 -1
- package/src/components/alerts/index.ts +0 -1
- package/src/components/components.stories.mdx +0 -20
- package/src/components/containers/center-container/center-container.stories.tsx +0 -52
- package/src/components/containers/center-container/center-container.test.tsx +0 -16
- package/src/components/containers/center-container/center-container.tsx +0 -32
- package/src/components/containers/center-container/index.ts +0 -1
- package/src/components/containers/containers.stories.mdx +0 -12
- package/src/components/containers/content/content.stories.tsx +0 -20
- package/src/components/containers/content/content.test.tsx +0 -26
- package/src/components/containers/content/content.tsx +0 -11
- package/src/components/containers/content/content.types.ts +0 -5
- package/src/components/containers/content/index.ts +0 -2
- package/src/components/containers/index.ts +0 -3
- package/src/components/containers/list-panel/index.ts +0 -2
- package/src/components/containers/list-panel/list-panel-panel.tsx +0 -17
- package/src/components/containers/list-panel/list-panel.context.tsx +0 -5
- package/src/components/containers/list-panel/list-panel.mocks.tsx +0 -117
- package/src/components/containers/list-panel/list-panel.stories.tsx +0 -38
- package/src/components/containers/list-panel/list-panel.test.tsx +0 -65
- package/src/components/containers/list-panel/list-panel.tsx +0 -88
- package/src/components/data-display/board/board.stories.tsx +0 -58
- package/src/components/data-display/board/board.test.tsx +0 -118
- package/src/components/data-display/board/board.tsx +0 -80
- package/src/components/data-display/board/index.ts +0 -1
- package/src/components/data-display/bullet/bullet.stories.tsx +0 -47
- package/src/components/data-display/bullet/bullet.test.tsx +0 -24
- package/src/components/data-display/bullet/bullet.tsx +0 -35
- package/src/components/data-display/bullet/index.ts +0 -1
- package/src/components/data-display/data-display.stories.mdx +0 -15
- package/src/components/data-display/header/header-title.tsx +0 -51
- package/src/components/data-display/header/header.dummy.ts +0 -56
- package/src/components/data-display/header/header.stories.tsx +0 -212
- package/src/components/data-display/header/header.test.tsx +0 -299
- package/src/components/data-display/header/header.tsx +0 -144
- package/src/components/data-display/header/header.types.ts +0 -96
- package/src/components/data-display/header/index.ts +0 -3
- package/src/components/data-display/index.ts +0 -5
- package/src/components/data-display/label/index.ts +0 -1
- package/src/components/data-display/label/label.stories.tsx +0 -53
- package/src/components/data-display/label/label.test.tsx +0 -30
- package/src/components/data-display/label/label.tsx +0 -93
- package/src/components/data-display/link-card/index.ts +0 -0
- package/src/components/data-display/link-card/link-card.stories.tsx +0 -59
- package/src/components/data-display/link-card/link-card.test.tsx +0 -43
- package/src/components/data-display/link-card/link-card.tsx +0 -52
- package/src/components/data-display/markdown/index.ts +0 -1
- package/src/components/data-display/markdown/markdown.stories.tsx +0 -25
- package/src/components/data-display/markdown/markdown.test.tsx +0 -64
- package/src/components/data-display/markdown/markdown.tsx +0 -38
- package/src/components/dialogs/bootstrap-dialog/bootstrap-dialog.stories.tsx +0 -86
- package/src/components/dialogs/bootstrap-dialog/bootstrap-dialog.test.tsx +0 -268
- package/src/components/dialogs/bootstrap-dialog/bootstrap-dialog.tsx +0 -97
- package/src/components/dialogs/bootstrap-dialog/index.ts +0 -1
- package/src/components/dialogs/confirm-dialog/confirm-dialog.stories.tsx +0 -58
- package/src/components/dialogs/confirm-dialog/confirm-dialog.test.tsx +0 -186
- package/src/components/dialogs/confirm-dialog/confirm-dialog.tsx +0 -67
- package/src/components/dialogs/confirm-dialog/index.ts +0 -1
- package/src/components/dialogs/dialog-hooks/index.ts +0 -1
- package/src/components/dialogs/dialog-hooks/use-dialog.ts +0 -10
- package/src/components/dialogs/dialog.types.ts +0 -29
- package/src/components/dialogs/dialogs.stories.mdx +0 -12
- package/src/components/dialogs/form-dialog/form-dialog.stories.tsx +0 -54
- package/src/components/dialogs/form-dialog/form-dialog.test.tsx +0 -165
- package/src/components/dialogs/form-dialog/form-dialog.tsx +0 -63
- package/src/components/dialogs/form-dialog/index.ts +0 -1
- package/src/components/dialogs/index.ts +0 -5
- package/src/components/drawers/drawer/drawer.stories.tsx +0 -35
- package/src/components/drawers/drawer/drawer.test.tsx +0 -83
- package/src/components/drawers/drawer/drawer.tsx +0 -94
- package/src/components/drawers/drawer/index.ts +0 -1
- package/src/components/drawers/drawer-app-bar/drawer-app-bar.stories.tsx +0 -26
- package/src/components/drawers/drawer-app-bar/drawer-app-bar.test.tsx +0 -83
- package/src/components/drawers/drawer-app-bar/drawer-app-bar.tsx +0 -87
- package/src/components/drawers/drawer-app-bar/index.ts +0 -1
- package/src/components/drawers/drawer-content/drawer-content.stories.tsx +0 -48
- package/src/components/drawers/drawer-content/drawer-content.test.tsx +0 -64
- package/src/components/drawers/drawer-content/drawer-content.tsx +0 -19
- package/src/components/drawers/drawer-content/index.ts +0 -1
- package/src/components/drawers/drawer-demo.stories.tsx +0 -94
- package/src/components/drawers/drawer-item/drawer-item-link.tsx +0 -149
- package/src/components/drawers/drawer-item/drawer-item.stories.tsx +0 -148
- package/src/components/drawers/drawer-item/drawer-item.test.tsx +0 -270
- package/src/components/drawers/drawer-item/drawer-item.tsx +0 -53
- package/src/components/drawers/drawer-item/drawer-menu-item.tsx +0 -137
- package/src/components/drawers/drawer-item/index.ts +0 -3
- package/src/components/drawers/drawer-main/drawer-main.tsx +0 -42
- package/src/components/drawers/drawer-main/index.ts +0 -1
- package/src/components/drawers/drawer-provider/drawer-context.test.tsx +0 -24
- package/src/components/drawers/drawer-provider/drawer-context.ts +0 -28
- package/src/components/drawers/drawer-provider/drawer-mixins.test.tsx +0 -25
- package/src/components/drawers/drawer-provider/drawer-mixins.ts +0 -24
- package/src/components/drawers/drawer-provider/drawer-provider.test.tsx +0 -165
- package/src/components/drawers/drawer-provider/drawer.provider.tsx +0 -64
- package/src/components/drawers/drawer-provider/index.ts +0 -3
- package/src/components/drawers/drawer-section/drawer-section.stories.tsx +0 -55
- package/src/components/drawers/drawer-section/drawer-section.test.tsx +0 -88
- package/src/components/drawers/drawer-section/drawer-section.tsx +0 -49
- package/src/components/drawers/drawer-section/index.ts +0 -1
- package/src/components/drawers/drawer-subheader/drawer-subheader.stories.tsx +0 -27
- package/src/components/drawers/drawer-subheader/drawer-subheader.tsx +0 -15
- package/src/components/drawers/drawer-subheader/index.ts +0 -1
- package/src/components/drawers/drawer.mock.tsx +0 -195
- package/src/components/drawers/drawer.types.ts +0 -78
- package/src/components/drawers/drawers.stories.mdx +0 -15
- package/src/components/drawers/index.ts +0 -8
- package/src/components/feedback/feedback.stories.mdx +0 -13
- package/src/components/feedback/index.ts +0 -2
- package/src/components/feedback/loading-area/index.ts +0 -1
- package/src/components/feedback/loading-area/loading-area.stories.tsx +0 -15
- package/src/components/feedback/loading-area/loading-area.test.tsx +0 -12
- package/src/components/feedback/loading-area/loading-area.tsx +0 -13
- package/src/components/feedback/query-container/index.ts +0 -1
- package/src/components/feedback/query-container/query-container.stories.tsx +0 -87
- package/src/components/feedback/query-container/query-container.test.tsx +0 -144
- package/src/components/feedback/query-container/query-container.tsx +0 -86
- package/src/components/index.ts +0 -11
- package/src/components/inputs/action/action-header.test.tsx +0 -11
- package/src/components/inputs/action/action-header.tsx +0 -37
- package/src/components/inputs/action/action.stories.tsx +0 -77
- package/src/components/inputs/action/action.test.tsx +0 -97
- package/src/components/inputs/action/action.tsx +0 -88
- package/src/components/inputs/action/index.ts +0 -2
- package/src/components/inputs/autocomplete/autocomplete.stories.tsx +0 -123
- package/src/components/inputs/autocomplete/autocomplete.test.tsx +0 -75
- package/src/components/inputs/autocomplete/autocomplete.tsx +0 -68
- package/src/components/inputs/autocomplete/index.ts +0 -1
- package/src/components/inputs/date-range-calendar/date-range-calendar.stories.tsx +0 -19
- package/src/components/inputs/date-range-calendar/date-range-calendar.test.tsx +0 -150
- package/src/components/inputs/date-range-calendar/date-range-calendar.tsx +0 -118
- package/src/components/inputs/date-range-calendar/index.ts +0 -1
- package/src/components/inputs/date-range-picker/date-range-picker.stories.tsx +0 -32
- package/src/components/inputs/date-range-picker/date-range-picker.test.tsx +0 -165
- package/src/components/inputs/date-range-picker/date-range-picker.tsx +0 -67
- package/src/components/inputs/date-range-picker/index.ts +0 -1
- package/src/components/inputs/index.ts +0 -7
- package/src/components/inputs/inputs.stories.mdx +0 -17
- package/src/components/inputs/search-input/index.ts +0 -1
- package/src/components/inputs/search-input/search-input.stories.tsx +0 -60
- package/src/components/inputs/search-input/search-input.test.tsx +0 -166
- package/src/components/inputs/search-input/search-input.tsx +0 -218
- package/src/components/inputs/select/index.ts +0 -1
- package/src/components/inputs/select/select.stories.tsx +0 -107
- package/src/components/inputs/select/select.test.tsx +0 -96
- package/src/components/inputs/select/select.tsx +0 -108
- package/src/components/inputs/sign-in/index.ts +0 -1
- package/src/components/inputs/sign-in/sign-in.stories.tsx +0 -37
- package/src/components/inputs/sign-in/sign-in.test.tsx +0 -97
- package/src/components/inputs/sign-in/sign-in.tsx +0 -97
- package/src/components/inputs/text-field/index.ts +0 -1
- package/src/components/inputs/text-field/text-field.stories.tsx +0 -136
- package/src/components/inputs/text-field/text-field.test.tsx +0 -64
- package/src/components/inputs/text-field/text-field.tsx +0 -101
- package/src/components/navigation/index.ts +0 -2
- package/src/components/navigation/link/index.ts +0 -1
- package/src/components/navigation/link/link.tsx +0 -17
- package/src/components/navigation/navigation.stories.mdx +0 -10
- package/src/components/navigation/tab-card/index.ts +0 -2
- package/src/components/navigation/tab-card/tab-card-panel.tsx +0 -19
- package/src/components/navigation/tab-card/tab-card.context.tsx +0 -7
- package/src/components/navigation/tab-card/tab-card.dummy.tsx +0 -34
- package/src/components/navigation/tab-card/tab-card.stories.tsx +0 -21
- package/src/components/navigation/tab-card/tab-card.test.tsx +0 -74
- package/src/components/navigation/tab-card/tab-card.tsx +0 -81
- package/src/components/navigation/tab-panel/index.ts +0 -1
- package/src/components/navigation/tab-panel/tab-panel.test.tsx +0 -26
- package/src/components/navigation/tab-panel/tab-panel.tsx +0 -27
- package/src/components/placeholders/content-placeholder/content-placeholder.stories.tsx +0 -13
- package/src/components/placeholders/content-placeholder/content-placeholder.tsx +0 -17
- package/src/components/placeholders/content-placeholder/index.ts +0 -1
- package/src/components/placeholders/index.ts +0 -5
- package/src/components/placeholders/lorem-ipsum-placeholder/index.ts +0 -1
- package/src/components/placeholders/lorem-ipsum-placeholder/lorem-ipsum-placeholder.stories.tsx +0 -13
- package/src/components/placeholders/lorem-ipsum-placeholder/lorem-ipsum-placeholder.tsx +0 -26
- package/src/components/placeholders/placeholder/index.ts +0 -1
- package/src/components/placeholders/placeholder/placeholder.mock.ts +0 -15
- package/src/components/placeholders/placeholder/placeholder.stories.tsx +0 -45
- package/src/components/placeholders/placeholder/placeholder.test.tsx +0 -78
- package/src/components/placeholders/placeholder/placeholder.tsx +0 -77
- package/src/components/placeholders/placeholders.stories.mdx +0 -14
- package/src/components/placeholders/skeleton-card/index.ts +0 -1
- package/src/components/placeholders/skeleton-card/skeleton-card.stories.tsx +0 -17
- package/src/components/placeholders/skeleton-card/skeleton-card.tsx +0 -17
- package/src/components/placeholders/skeleton-grid/index.ts +0 -1
- package/src/components/placeholders/skeleton-grid/skeleton-grid.stories.tsx +0 -13
- package/src/components/placeholders/skeleton-grid/skeleton-grid.tsx +0 -20
- package/src/components/tables/enhanced-remote-table/enhanced-remote-table.mock.tsx +0 -28
- package/src/components/tables/enhanced-remote-table/enhanced-remote-table.stories.tsx +0 -22
- package/src/components/tables/enhanced-remote-table/enhanced-remote-table.test.tsx +0 -78
- package/src/components/tables/enhanced-remote-table/enhanced-remote-table.tsx +0 -74
- package/src/components/tables/enhanced-remote-table/index.ts +0 -1
- package/src/components/tables/enhanced-table/enhanced-table-head.tsx +0 -63
- package/src/components/tables/enhanced-table/enhanced-table.mock.tsx +0 -99
- package/src/components/tables/enhanced-table/enhanced-table.stories.tsx +0 -20
- package/src/components/tables/enhanced-table/enhanced-table.test.tsx +0 -108
- package/src/components/tables/enhanced-table/enhanced-table.tsx +0 -136
- package/src/components/tables/enhanced-table/index.ts +0 -2
- package/src/components/tables/index.ts +0 -2
- package/src/components/tables/table.stories.mdx +0 -11
- package/src/components/value-displays/group-value-card/group-value-card.mock.tsx +0 -61
- package/src/components/value-displays/group-value-card/group-value-card.stories.tsx +0 -76
- package/src/components/value-displays/group-value-card/group-value-card.test.tsx +0 -61
- package/src/components/value-displays/group-value-card/group-value-card.tsx +0 -60
- package/src/components/value-displays/group-value-card/index.ts +0 -1
- package/src/components/value-displays/index.ts +0 -10
- package/src/components/value-displays/value-base/index.ts +0 -2
- package/src/components/value-displays/value-base/value-displays.types.ts +0 -36
- package/src/components/value-displays/value-base/value-edit.test.tsx +0 -88
- package/src/components/value-displays/value-base/value-edit.tsx +0 -81
- package/src/components/value-displays/value-boolean/index.ts +0 -1
- package/src/components/value-displays/value-boolean/value-boolean.stories.tsx +0 -49
- package/src/components/value-displays/value-boolean/value-boolean.test.tsx +0 -133
- package/src/components/value-displays/value-boolean/value-boolean.tsx +0 -66
- package/src/components/value-displays/value-card/index.ts +0 -1
- package/src/components/value-displays/value-card/value-card.stories.tsx +0 -22
- package/src/components/value-displays/value-card/value-card.test.tsx +0 -18
- package/src/components/value-displays/value-card/value-card.tsx +0 -12
- package/src/components/value-displays/value-content/index.ts +0 -1
- package/src/components/value-displays/value-content/value-content.stories.tsx +0 -27
- package/src/components/value-displays/value-content/value-content.test.tsx +0 -64
- package/src/components/value-displays/value-content/value-content.tsx +0 -81
- package/src/components/value-displays/value-datetime/index.ts +0 -1
- package/src/components/value-displays/value-datetime/value-datetime.stories.tsx +0 -86
- package/src/components/value-displays/value-datetime/value-datetime.test.tsx +0 -141
- package/src/components/value-displays/value-datetime/value-datetime.tsx +0 -99
- package/src/components/value-displays/value-displays.stories.mdx +0 -39
- package/src/components/value-displays/value-image/index.ts +0 -1
- package/src/components/value-displays/value-image/value-image.stories.tsx +0 -37
- package/src/components/value-displays/value-image/value-image.test.tsx +0 -22
- package/src/components/value-displays/value-image/value-image.tsx +0 -26
- package/src/components/value-displays/value-item/index.ts +0 -1
- package/src/components/value-displays/value-item/value-item.stories.tsx +0 -45
- package/src/components/value-displays/value-item/value-item.test.tsx +0 -20
- package/src/components/value-displays/value-item/value-item.tsx +0 -54
- package/src/components/value-displays/value-label/index.ts +0 -1
- package/src/components/value-displays/value-label/value-label.stories.tsx +0 -78
- package/src/components/value-displays/value-label/value-label.test.tsx +0 -72
- package/src/components/value-displays/value-label/value-label.tsx +0 -45
- package/src/components/value-displays/value-rating/index.ts +0 -1
- package/src/components/value-displays/value-rating/value-rating.stories.tsx +0 -55
- package/src/components/value-displays/value-rating/value-rating.test.tsx +0 -105
- package/src/components/value-displays/value-rating/value-rating.tsx +0 -48
- package/src/components/value-displays/value-text/index.ts +0 -1
- package/src/components/value-displays/value-text/value-text.stories.tsx +0 -72
- package/src/components/value-displays/value-text/value-text.test.tsx +0 -129
- package/src/components/value-displays/value-text/value-text.tsx +0 -67
- package/src/generators/generators.mock.ts +0 -298
- package/src/generators/generators.model.test.ts +0 -79
- package/src/generators/generators.model.ts +0 -180
- package/src/generators/generators.stories.mdx +0 -13
- package/src/generators/index.ts +0 -5
- package/src/generators/model-form/index.ts +0 -1
- package/src/generators/model-form/model-form-field.tsx +0 -269
- package/src/generators/model-form/model-form.stories.tsx +0 -40
- package/src/generators/model-form/model-form.test.tsx +0 -133
- package/src/generators/model-form/model-form.tsx +0 -62
- package/src/generators/model-router/index.ts +0 -2
- package/src/generators/model-router/model-router.test.tsx +0 -1104
- package/src/generators/model-router/model-router.tsx +0 -30
- package/src/generators/model-router/model-router.types.ts +0 -18
- package/src/generators/model-router/screens/add-screen.tsx +0 -67
- package/src/generators/model-router/screens/details-screen.tsx +0 -64
- package/src/generators/model-router/screens/index.ts +0 -4
- package/src/generators/model-router/screens/list-screen.tsx +0 -143
- package/src/generators/model-router/screens/screens.types.ts +0 -38
- package/src/generators/model-router/screens/update-screen.tsx +0 -105
- package/src/generators/model-router/stories/details-screen.stories.tsx +0 -39
- package/src/generators/model-router/stories/list-screen.stories.tsx +0 -102
- package/src/generators/model-router/stories/model-router.stories.tsx +0 -229
- package/src/generators/model-router/stories/templates.tsx +0 -33
- package/src/generators/object-details/index.ts +0 -1
- package/src/generators/object-details/object-details.stories.tsx +0 -30
- package/src/generators/object-details/object-details.test.tsx +0 -22
- package/src/generators/object-details/object-details.tsx +0 -169
- package/src/generators/table-list/index.ts +0 -1
- package/src/generators/table-list/table-list.stories.tsx +0 -91
- package/src/generators/table-list/table-list.test.tsx +0 -297
- package/src/generators/table-list/table-list.tsx +0 -138
- package/src/hooks/index.ts +0 -1
- package/src/hooks/routing/index.ts +0 -1
- package/src/hooks/routing/routing.hooks.ts +0 -23
- package/src/hooks/routing/routing.test.tsx +0 -83
- package/src/index.ts +0 -5
- package/src/layouts/drawer-layout/drawer-layout.stories.tsx +0 -57
- package/src/layouts/drawer-layout/drawer-layout.test.tsx +0 -41
- package/src/layouts/drawer-layout/drawer-layout.tsx +0 -26
- package/src/layouts/drawer-layout/index.ts +0 -1
- package/src/layouts/header-layout/header-layout.stories.tsx +0 -245
- package/src/layouts/header-layout/header-layout.test.tsx +0 -102
- package/src/layouts/header-layout/header-layout.tsx +0 -49
- package/src/layouts/header-layout/index.ts +0 -1
- package/src/layouts/index.ts +0 -2
- package/src/layouts/layouts.stories.mdx +0 -11
- package/src/providers/index.ts +0 -2
- package/src/providers/notification-center/index.ts +0 -3
- package/src/providers/notification-center/notification-center.context.ts +0 -31
- package/src/providers/notification-center/notification-center.hooks.ts +0 -23
- package/src/providers/notification-center/notification-center.provider.tsx +0 -51
- package/src/providers/notification-center/notification-center.stories.tsx +0 -52
- package/src/providers/notification-center/notification-center.test.tsx +0 -198
- package/src/providers/tab-provider/index.ts +0 -2
- package/src/providers/tab-provider/tab-provider.context.ts +0 -8
- package/src/providers/tab-provider/tab-provider.provider.tsx +0 -13
- package/src/stories/Introduction.stories.mdx +0 -33
- package/src/stories/assets/code-brackets.svg +0 -1
- package/src/stories/assets/colors.svg +0 -1
- package/src/stories/assets/comments.svg +0 -1
- package/src/stories/assets/direction.svg +0 -1
- package/src/stories/assets/flow.svg +0 -1
- package/src/stories/assets/plugin.svg +0 -1
- package/src/stories/assets/repo.svg +0 -1
- package/src/stories/assets/stackalt.svg +0 -1
- package/src/stories/assets/work-in-progress.jpg +0 -0
- package/src/stories/getting-started.stories.mdx +0 -23
- package/src/storybook.tsx +0 -139
- package/src/tests/actions.ts +0 -48
- package/src/tests/assertions.ts +0 -206
- package/src/tests/datatable-placeholder/datatable-placeholder.stories.tsx +0 -13
- package/src/tests/datatable-placeholder/datatable-placeholder.tsx +0 -38
- package/src/tests/datatable-placeholder/index.ts +0 -1
- package/src/tests/file-mock.ts +0 -1
- package/src/tests/mocks/markdown.mock.ts +0 -25
- package/src/tests/mocks.ts +0 -23
- package/src/tests/testing-library.tsx +0 -79
- package/src/types/index.d.ts +0 -10
- package/src/types.d.ts +0 -4
- package/src/utils/arrays.test.ts +0 -9
- package/src/utils/arrays.ts +0 -7
- package/src/utils/breakpoints.test.ts +0 -42
- package/src/utils/breakpoints.ts +0 -62
- package/src/utils/forms.ts +0 -11
- package/src/utils/index.ts +0 -4
- package/src/utils/theme.ts +0 -11
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
import React, { ReactElement } from "react";
|
|
2
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
3
|
-
import { HeaderLayout, HeaderLayoutProps } from "./header-layout";
|
|
4
|
-
import { withLocalizationProvider, withMemoryRouter } from "~/storybook";
|
|
5
|
-
import { withFullHeight } from "../../storybook";
|
|
6
|
-
import { Content, Header, HeaderProps, HeaderTab, SkeletonGrid, TabPanel } from "../../components";
|
|
7
|
-
import { Box, Typography } from "@mui/material";
|
|
8
|
-
import { useDemoData } from "@mui/x-data-grid-generator";
|
|
9
|
-
import { ModelForm, ObjectDetails, TableList } from "../../generators";
|
|
10
|
-
import { mockModel, createModelInstance } from "../../generators/generators.mock";
|
|
11
|
-
import { action } from "@storybook/addon-actions";
|
|
12
|
-
import { DataGrid } from "@mui/x-data-grid";
|
|
13
|
-
|
|
14
|
-
const breadcrumbs = [
|
|
15
|
-
{
|
|
16
|
-
id: "list",
|
|
17
|
-
text: "Items",
|
|
18
|
-
link: "/items",
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
id: "item",
|
|
22
|
-
text: "Item 1",
|
|
23
|
-
link: "/items/1",
|
|
24
|
-
},
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
const actions = [
|
|
28
|
-
{
|
|
29
|
-
id: "new",
|
|
30
|
-
text: "Add",
|
|
31
|
-
},
|
|
32
|
-
];
|
|
33
|
-
|
|
34
|
-
const tabs: HeaderTab[] = [
|
|
35
|
-
{
|
|
36
|
-
id: "tab1",
|
|
37
|
-
label: "Tab 1",
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
id: "tab2",
|
|
41
|
-
label: "Tab 2",
|
|
42
|
-
disabled: true,
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
id: "tab3",
|
|
46
|
-
label: "Tab 3",
|
|
47
|
-
},
|
|
48
|
-
];
|
|
49
|
-
|
|
50
|
-
interface HeaderLayoutStoryProps extends HeaderLayoutProps {
|
|
51
|
-
headerProps: HeaderProps;
|
|
52
|
-
contentChildren: ReactElement;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const DummyHeaderLayout = ({ headerProps, contentChildren, ...rest }: HeaderLayoutStoryProps) => {
|
|
56
|
-
return (
|
|
57
|
-
<HeaderLayout {...rest}>
|
|
58
|
-
<Header {...headerProps} />
|
|
59
|
-
<Content>{contentChildren}</Content>
|
|
60
|
-
</HeaderLayout>
|
|
61
|
-
);
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export default {
|
|
65
|
-
title: "Layouts/HeaderLayout",
|
|
66
|
-
component: DummyHeaderLayout,
|
|
67
|
-
decorators: [withMemoryRouter(), withFullHeight, withLocalizationProvider],
|
|
68
|
-
parameters: {
|
|
69
|
-
layout: "fullscreen",
|
|
70
|
-
},
|
|
71
|
-
} satisfies Meta<typeof DummyHeaderLayout>;
|
|
72
|
-
type Story = StoryObj<typeof DummyHeaderLayout>;
|
|
73
|
-
|
|
74
|
-
export const Skeleton: Story = {
|
|
75
|
-
args: {
|
|
76
|
-
headerProps: {
|
|
77
|
-
title: "Lorem ipsum",
|
|
78
|
-
subtitle: "Dolor sit amet",
|
|
79
|
-
breadcrumbs,
|
|
80
|
-
actions,
|
|
81
|
-
},
|
|
82
|
-
contentChildren: <SkeletonGrid />,
|
|
83
|
-
},
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
const ListContent = () => {
|
|
87
|
-
const { data } = useDemoData({
|
|
88
|
-
dataSet: "Commodity",
|
|
89
|
-
rowLength: 100,
|
|
90
|
-
maxColumns: 3,
|
|
91
|
-
editable: true,
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
const { rows } = data;
|
|
95
|
-
const columns = data.columns.map(({ field, headerName }) => ({
|
|
96
|
-
id: field,
|
|
97
|
-
label: headerName || "",
|
|
98
|
-
sort: true,
|
|
99
|
-
disablePadding: false,
|
|
100
|
-
numeric: false,
|
|
101
|
-
}));
|
|
102
|
-
|
|
103
|
-
return (
|
|
104
|
-
<TableList
|
|
105
|
-
data={rows as any}
|
|
106
|
-
columns={columns}
|
|
107
|
-
defaultSort={columns[0].id}
|
|
108
|
-
defaultOrder="asc"
|
|
109
|
-
/>
|
|
110
|
-
);
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
export const List: Story = {
|
|
114
|
-
args: {
|
|
115
|
-
headerProps: {
|
|
116
|
-
title: "Lorem ipsum",
|
|
117
|
-
subtitle: "Dolor sit amet",
|
|
118
|
-
breadcrumbs,
|
|
119
|
-
actions,
|
|
120
|
-
},
|
|
121
|
-
contentChildren: <ListContent />,
|
|
122
|
-
},
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
export const Details: Story = {
|
|
126
|
-
args: {
|
|
127
|
-
headerProps: {
|
|
128
|
-
title: "Lorem ipsum",
|
|
129
|
-
subtitle: "Dolor sit amet",
|
|
130
|
-
breadcrumbs,
|
|
131
|
-
actions,
|
|
132
|
-
},
|
|
133
|
-
contentChildren: <ObjectDetails model={mockModel} instance={createModelInstance(mockModel)} />,
|
|
134
|
-
},
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
export const Form: Story = {
|
|
138
|
-
args: {
|
|
139
|
-
headerProps: {
|
|
140
|
-
title: "Lorem ipsum",
|
|
141
|
-
subtitle: "Dolor sit amet",
|
|
142
|
-
breadcrumbs,
|
|
143
|
-
actions,
|
|
144
|
-
},
|
|
145
|
-
contentChildren: (
|
|
146
|
-
<ModelForm
|
|
147
|
-
model={mockModel}
|
|
148
|
-
initialValues={createModelInstance(mockModel)}
|
|
149
|
-
saveButtonText="Save"
|
|
150
|
-
onSubmit={action("Save form data")}
|
|
151
|
-
/>
|
|
152
|
-
),
|
|
153
|
-
},
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
const DataTableContent = () => {
|
|
157
|
-
const {
|
|
158
|
-
data: { rows, columns },
|
|
159
|
-
} = useDemoData({
|
|
160
|
-
dataSet: "Commodity",
|
|
161
|
-
rowLength: 100,
|
|
162
|
-
maxColumns: 7,
|
|
163
|
-
editable: true,
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
return <DataGrid rows={rows} columns={columns as any} pagination sx={{ height: 400 }} />;
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
export const DataTable: Story = {
|
|
170
|
-
args: {
|
|
171
|
-
headerProps: {
|
|
172
|
-
title: "Lorem ipsum",
|
|
173
|
-
subtitle: "Dolor sit amet",
|
|
174
|
-
breadcrumbs,
|
|
175
|
-
actions,
|
|
176
|
-
},
|
|
177
|
-
contentChildren: <DataTableContent />,
|
|
178
|
-
},
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
export const Tabs: Story = {
|
|
182
|
-
args: {
|
|
183
|
-
headerProps: {
|
|
184
|
-
title: "Lorem ipsum",
|
|
185
|
-
subtitle: "Dolor sit amet",
|
|
186
|
-
breadcrumbs,
|
|
187
|
-
actions,
|
|
188
|
-
tabs,
|
|
189
|
-
},
|
|
190
|
-
contentChildren: (
|
|
191
|
-
<Box>
|
|
192
|
-
<TabPanel index={0}>
|
|
193
|
-
<Typography>Panel 1</Typography>
|
|
194
|
-
</TabPanel>
|
|
195
|
-
<TabPanel index={[1, 2]}>
|
|
196
|
-
<Typography>Panel 2</Typography>
|
|
197
|
-
</TabPanel>
|
|
198
|
-
<TabPanel index={3}>
|
|
199
|
-
<Typography>Panel 3</Typography>
|
|
200
|
-
</TabPanel>
|
|
201
|
-
</Box>
|
|
202
|
-
),
|
|
203
|
-
},
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
export const Loading: Story = {
|
|
207
|
-
args: {
|
|
208
|
-
loading: true,
|
|
209
|
-
headerProps: {
|
|
210
|
-
title: "Lorem ipsum",
|
|
211
|
-
subtitle: "Dolor sit amet",
|
|
212
|
-
breadcrumbs,
|
|
213
|
-
actions,
|
|
214
|
-
},
|
|
215
|
-
contentChildren: <SkeletonGrid />,
|
|
216
|
-
},
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
export const Fetching: Story = {
|
|
220
|
-
args: {
|
|
221
|
-
fetching: true,
|
|
222
|
-
headerProps: {
|
|
223
|
-
title: "Lorem ipsum",
|
|
224
|
-
subtitle: "Dolor sit amet",
|
|
225
|
-
breadcrumbs,
|
|
226
|
-
actions,
|
|
227
|
-
},
|
|
228
|
-
contentChildren: <SkeletonGrid />,
|
|
229
|
-
},
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
export const Error: Story = {
|
|
233
|
-
args: {
|
|
234
|
-
error: {
|
|
235
|
-
message: "There is no user with that id",
|
|
236
|
-
},
|
|
237
|
-
headerProps: {
|
|
238
|
-
title: "Lorem ipsum",
|
|
239
|
-
subtitle: "Dolor sit amet",
|
|
240
|
-
breadcrumbs,
|
|
241
|
-
actions,
|
|
242
|
-
},
|
|
243
|
-
contentChildren: <SkeletonGrid />,
|
|
244
|
-
},
|
|
245
|
-
};
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { HeaderLayout, HeaderLayoutError } from "./header-layout";
|
|
3
|
-
import { render, screen } from "~/tests/testing-library";
|
|
4
|
-
import { Content, Header } from "../../components";
|
|
5
|
-
import { Typography } from "@mui/material";
|
|
6
|
-
import { expectProgressIndicator } from "~/tests/assertions";
|
|
7
|
-
|
|
8
|
-
describe("HeaderLayout", () => {
|
|
9
|
-
const renderComponent = ({
|
|
10
|
-
loading,
|
|
11
|
-
fetching,
|
|
12
|
-
error,
|
|
13
|
-
}: { loading?: boolean; fetching?: boolean; error?: HeaderLayoutError } = {}) => {
|
|
14
|
-
return render(
|
|
15
|
-
<HeaderLayout loading={loading} fetching={fetching} error={error}>
|
|
16
|
-
<Header title="Lorem ipsum" subtitle="Dolor sit amet" />
|
|
17
|
-
<Content>
|
|
18
|
-
<Typography>Test content</Typography>
|
|
19
|
-
</Content>
|
|
20
|
-
</HeaderLayout>,
|
|
21
|
-
);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
it("should render the header", () => {
|
|
25
|
-
renderComponent();
|
|
26
|
-
|
|
27
|
-
expect(screen.getByRole("heading", { level: 1, name: /lorem ipsum/i })).toBeInTheDocument();
|
|
28
|
-
expect(screen.getByRole("heading", { level: 2, name: /dolor sit amet/i })).toBeInTheDocument();
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it("should render a main element", () => {
|
|
32
|
-
renderComponent();
|
|
33
|
-
|
|
34
|
-
expect(screen.getByRole("main")).toBeVisible();
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it("should render the content", () => {
|
|
38
|
-
renderComponent();
|
|
39
|
-
|
|
40
|
-
expect(screen.getByText(/test content/i)).toBeVisible();
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it("should render a loading indicator if loading=true", () => {
|
|
44
|
-
renderComponent({ loading: true });
|
|
45
|
-
|
|
46
|
-
expectProgressIndicator();
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
describe("fetching=true", () => {
|
|
50
|
-
it("should render a loading indicator", () => {
|
|
51
|
-
renderComponent({ fetching: true });
|
|
52
|
-
|
|
53
|
-
expectProgressIndicator();
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it("should render the content", () => {
|
|
57
|
-
renderComponent({ fetching: true });
|
|
58
|
-
|
|
59
|
-
expect(screen.getByText(/test content/i)).toBeVisible();
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
describe("error", () => {
|
|
64
|
-
it("should not render the error if there is no one", () => {
|
|
65
|
-
renderComponent({ error: undefined });
|
|
66
|
-
|
|
67
|
-
expect(screen.queryByText(/there has been an error/i)).not.toBeInTheDocument();
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it("should render a title if there is an error without title", () => {
|
|
71
|
-
renderComponent({
|
|
72
|
-
error: {
|
|
73
|
-
message: "Invalid user id",
|
|
74
|
-
},
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
expect(screen.queryByText(/there has been an error/i)).toBeVisible();
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
it("should render a title if there is an error with title", () => {
|
|
81
|
-
renderComponent({
|
|
82
|
-
error: {
|
|
83
|
-
title: "We had an error",
|
|
84
|
-
message: "Invalid user id",
|
|
85
|
-
},
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
expect(screen.queryByText(/we had an error/i)).toBeVisible();
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
it("should render the message", () => {
|
|
92
|
-
renderComponent({
|
|
93
|
-
error: {
|
|
94
|
-
title: "We had an error",
|
|
95
|
-
message: "Invalid user id",
|
|
96
|
-
},
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
expect(screen.queryByText(/invalid user id/i)).toBeVisible();
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
});
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { Box, LinearProgress } from "@mui/material";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { ContentElement, HeaderElement, Placeholder, PlaceholderIcon } from "../../components";
|
|
4
|
-
import { LoadingArea } from "../../components/feedback/loading-area";
|
|
5
|
-
import { TabProvider } from "../../providers";
|
|
6
|
-
import ReportProblemIcon from "@mui/icons-material/ReportProblem";
|
|
7
|
-
|
|
8
|
-
export interface HeaderLayoutError {
|
|
9
|
-
icon?: PlaceholderIcon;
|
|
10
|
-
title?: string;
|
|
11
|
-
message: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface HeaderLayoutProps {
|
|
15
|
-
loading?: boolean;
|
|
16
|
-
fetching?: boolean;
|
|
17
|
-
error?: HeaderLayoutError;
|
|
18
|
-
children: [HeaderElement, ContentElement];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const DefaultErrorIcon = () => <ReportProblemIcon color="error" sx={{ width: 200, height: 200 }} />;
|
|
22
|
-
|
|
23
|
-
export const HeaderLayout = ({ loading, children, fetching, error }: HeaderLayoutProps) => {
|
|
24
|
-
const [headerElement, contentElement] = children;
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<TabProvider>
|
|
28
|
-
<Box display="flex" flexDirection="column" height={1}>
|
|
29
|
-
{headerElement}
|
|
30
|
-
{fetching && (
|
|
31
|
-
<Box width={1}>
|
|
32
|
-
<LinearProgress />
|
|
33
|
-
</Box>
|
|
34
|
-
)}
|
|
35
|
-
{loading && <LoadingArea />}
|
|
36
|
-
{error && (
|
|
37
|
-
<Box mt={4}>
|
|
38
|
-
<Placeholder
|
|
39
|
-
icon={error.icon || DefaultErrorIcon}
|
|
40
|
-
title={error.title || "There has been an error"}
|
|
41
|
-
subtitle={error.message}
|
|
42
|
-
/>
|
|
43
|
-
</Box>
|
|
44
|
-
)}
|
|
45
|
-
{!loading && !error && contentElement}
|
|
46
|
-
</Box>
|
|
47
|
-
</TabProvider>
|
|
48
|
-
);
|
|
49
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./header-layout";
|
package/src/layouts/index.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Meta } from '@storybook/addon-docs';
|
|
2
|
-
import LinkTo from '@storybook/addon-links/react';
|
|
3
|
-
|
|
4
|
-
<Meta title="Layouts/Introduction" />
|
|
5
|
-
|
|
6
|
-
## Layouts
|
|
7
|
-
|
|
8
|
-
<ul>
|
|
9
|
-
<li><LinkTo kind="Layouts/DrawerLayout">DrawerLayout</LinkTo></li>
|
|
10
|
-
<li><LinkTo kind="Layouts/HeaderLayout">HeaderLayout</LinkTo></li>
|
|
11
|
-
</ul>
|
package/src/providers/index.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { AlertColor } from "@mui/material";
|
|
2
|
-
import React from "react";
|
|
3
|
-
|
|
4
|
-
export const NotificationCenterProviderUndefinedError = new Error(
|
|
5
|
-
"NotificationCenterContext.Provider is required and was undefined",
|
|
6
|
-
);
|
|
7
|
-
|
|
8
|
-
export interface Notification {
|
|
9
|
-
severity: AlertColor;
|
|
10
|
-
title?: string;
|
|
11
|
-
message: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface NotificationCenterProps {
|
|
15
|
-
show(notification: Notification): void;
|
|
16
|
-
hide(): void;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const NotificationCenterContext = React.createContext<NotificationCenterProps | undefined>(
|
|
20
|
-
undefined,
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
export const useNotificationCenter = () => {
|
|
24
|
-
const context = React.useContext(NotificationCenterContext);
|
|
25
|
-
|
|
26
|
-
if (context === undefined) {
|
|
27
|
-
throw NotificationCenterProviderUndefinedError;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return context;
|
|
31
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef } from "react";
|
|
2
|
-
import { useNotificationCenter, Notification } from "./notification-center.context";
|
|
3
|
-
|
|
4
|
-
export interface NotifyWhenValueChangesOptions<T> {
|
|
5
|
-
from: T;
|
|
6
|
-
to: T;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const useNotifyWhenValueChanges = <T>(
|
|
10
|
-
notification: Notification,
|
|
11
|
-
value: T | undefined,
|
|
12
|
-
{ from, to }: NotifyWhenValueChangesOptions<T>,
|
|
13
|
-
) => {
|
|
14
|
-
const prevRef = useRef<T>();
|
|
15
|
-
const { show } = useNotificationCenter();
|
|
16
|
-
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
if (prevRef.current === from && value === to) {
|
|
19
|
-
show(notification);
|
|
20
|
-
}
|
|
21
|
-
prevRef.current = value;
|
|
22
|
-
}, [value]);
|
|
23
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { useState } from "react";
|
|
2
|
-
import { Snackbar, Alert, AlertTitle } from "@mui/material";
|
|
3
|
-
import React, { PropsWithChildren } from "react";
|
|
4
|
-
import { Notification, NotificationCenterContext } from "./notification-center.context";
|
|
5
|
-
|
|
6
|
-
export type NotificationCenterProviderProps = PropsWithChildren<{
|
|
7
|
-
autoHideDuration?: number;
|
|
8
|
-
}>;
|
|
9
|
-
|
|
10
|
-
export const NotificationCenterProvider = ({
|
|
11
|
-
children,
|
|
12
|
-
autoHideDuration = 6000,
|
|
13
|
-
}: NotificationCenterProviderProps) => {
|
|
14
|
-
const [notification, setNotification] = useState<Notification | undefined>(undefined);
|
|
15
|
-
const [open, setOpen] = useState(false);
|
|
16
|
-
const show = (notification: Notification) => {
|
|
17
|
-
setNotification(notification);
|
|
18
|
-
setOpen(true);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const hide = () => {
|
|
22
|
-
setOpen(false);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<NotificationCenterContext.Provider
|
|
27
|
-
value={{
|
|
28
|
-
show,
|
|
29
|
-
hide,
|
|
30
|
-
}}
|
|
31
|
-
>
|
|
32
|
-
<Snackbar
|
|
33
|
-
open={open}
|
|
34
|
-
autoHideDuration={autoHideDuration}
|
|
35
|
-
onClose={hide}
|
|
36
|
-
anchorOrigin={{ vertical: "top", horizontal: "right" }}
|
|
37
|
-
>
|
|
38
|
-
<Alert
|
|
39
|
-
onClose={hide}
|
|
40
|
-
severity={notification?.severity}
|
|
41
|
-
aria-label={notification?.severity}
|
|
42
|
-
sx={{ width: "100%" }}
|
|
43
|
-
>
|
|
44
|
-
{notification?.title && <AlertTitle>{notification?.title}</AlertTitle>}
|
|
45
|
-
{notification?.message}
|
|
46
|
-
</Alert>
|
|
47
|
-
</Snackbar>
|
|
48
|
-
{children}
|
|
49
|
-
</NotificationCenterContext.Provider>
|
|
50
|
-
);
|
|
51
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Meta } from "@storybook/react";
|
|
3
|
-
import { NotificationCenterProvider } from "./notification-center.provider";
|
|
4
|
-
import { useNotificationCenter } from "./notification-center.context";
|
|
5
|
-
import { Button, Box } from "@mui/material";
|
|
6
|
-
import { ContentPlaceholder } from "~/components";
|
|
7
|
-
|
|
8
|
-
const DummyError = {
|
|
9
|
-
title: "Internal Server error",
|
|
10
|
-
message: "Unable to save the item",
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export default {
|
|
14
|
-
title: "Components/Feedback/NotificationCenter",
|
|
15
|
-
component: ContentPlaceholder,
|
|
16
|
-
decorators: [
|
|
17
|
-
(Story) => (
|
|
18
|
-
<NotificationCenterProvider>
|
|
19
|
-
<Story />
|
|
20
|
-
</NotificationCenterProvider>
|
|
21
|
-
),
|
|
22
|
-
],
|
|
23
|
-
parameters: {
|
|
24
|
-
layout: "fullscreen",
|
|
25
|
-
},
|
|
26
|
-
} satisfies Meta<typeof ContentPlaceholder>;
|
|
27
|
-
|
|
28
|
-
export const Default = () => {
|
|
29
|
-
const { show, hide } = useNotificationCenter();
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<ContentPlaceholder size={3} p={2}>
|
|
33
|
-
<Box pb={2}>
|
|
34
|
-
<Button onClick={() => show({ ...DummyError, severity: "info" })} variant="contained">
|
|
35
|
-
Show info
|
|
36
|
-
</Button>
|
|
37
|
-
<Button onClick={() => show({ ...DummyError, severity: "success" })} variant="contained">
|
|
38
|
-
Show success
|
|
39
|
-
</Button>
|
|
40
|
-
<Button onClick={() => show({ ...DummyError, severity: "warning" })} variant="contained">
|
|
41
|
-
Show warning
|
|
42
|
-
</Button>
|
|
43
|
-
<Button onClick={() => show({ ...DummyError, severity: "error" })} variant="contained">
|
|
44
|
-
Show error
|
|
45
|
-
</Button>
|
|
46
|
-
<Button onClick={hide} variant="contained">
|
|
47
|
-
hide
|
|
48
|
-
</Button>
|
|
49
|
-
</Box>
|
|
50
|
-
</ContentPlaceholder>
|
|
51
|
-
);
|
|
52
|
-
};
|