@pautena/react-design-system 0.12.0 → 0.12.1
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/package.json +2 -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
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pautena/react-design-system",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "My custom design system on top of MUI",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
+
"type":"module",
|
|
8
9
|
"scripts": {
|
|
9
10
|
"build": "rollup -c",
|
|
10
11
|
"test": "vitest run",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Meta } from '@storybook/addon-docs';
|
|
2
|
-
import LinkTo from '@storybook/addon-links/react';
|
|
3
|
-
|
|
4
|
-
<Meta title="Components/Alerts/Introduction" />
|
|
5
|
-
|
|
6
|
-
# Alerts
|
|
7
|
-
|
|
8
|
-
<ul>
|
|
9
|
-
<li><LinkTo kind="Components/Alerts/ExpandableAlert">ExpandableAlert</LinkTo></li>
|
|
10
|
-
</ul>
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import React, { useState } from "react";
|
|
3
|
-
import { ExpandableAlert } from "./expandable-alert";
|
|
4
|
-
import { withContainer } from "~/storybook";
|
|
5
|
-
import { Box, Button, Snackbar, Typography } from "@mui/material";
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: "Components/Alerts/ExpandableAlert",
|
|
9
|
-
component: ExpandableAlert,
|
|
10
|
-
decorators: [withContainer({ width: 500 })],
|
|
11
|
-
parameters: {
|
|
12
|
-
layout: "centered",
|
|
13
|
-
},
|
|
14
|
-
} satisfies Meta<typeof ExpandableAlert>;
|
|
15
|
-
type Story = StoryObj<typeof ExpandableAlert>;
|
|
16
|
-
|
|
17
|
-
export const Info: Story = {
|
|
18
|
-
args: {
|
|
19
|
-
severity: "info",
|
|
20
|
-
title: "Lorem ipsum",
|
|
21
|
-
message: "Lorem ipsum dolor sit amet",
|
|
22
|
-
metadata: ["lorem: ipsum", "foo: bar", "header: this", "host: localhost"],
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const Success: Story = {
|
|
27
|
-
args: {
|
|
28
|
-
...Info.args,
|
|
29
|
-
severity: "success",
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const Error: Story = {
|
|
34
|
-
args: {
|
|
35
|
-
...Info.args,
|
|
36
|
-
severity: "error",
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const Warning: Story = {
|
|
41
|
-
args: {
|
|
42
|
-
...Info.args,
|
|
43
|
-
severity: "warning",
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const WihtoutMetadata: Story = {
|
|
48
|
-
args: {
|
|
49
|
-
severity: "info",
|
|
50
|
-
title: "Lorem ipsum",
|
|
51
|
-
message: "Lorem ipsum dolor sit amet",
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export const MetadataCustomComponent = () => (
|
|
56
|
-
<ExpandableAlert
|
|
57
|
-
severity="info"
|
|
58
|
-
onClose={() => null}
|
|
59
|
-
title="Lorem ipsum"
|
|
60
|
-
message="Lorem ipsum dolor sit amet"
|
|
61
|
-
metadata={["lorem: ipsum", "foo: bar", "header: this", "host: localhost"]}
|
|
62
|
-
metadataComponent={
|
|
63
|
-
<>
|
|
64
|
-
<Typography variant="h6">lorem: ipsum</Typography>
|
|
65
|
-
<Typography variant="caption">foo: bar</Typography>
|
|
66
|
-
<Typography variant="body2" sx={{ textDecoration: "line-through" }}>
|
|
67
|
-
header: this
|
|
68
|
-
</Typography>
|
|
69
|
-
<Typography variant="body2" fontWeight={700}>
|
|
70
|
-
host: localhost
|
|
71
|
-
</Typography>
|
|
72
|
-
</>
|
|
73
|
-
}
|
|
74
|
-
/>
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
export const SnackbarAlert = () => {
|
|
78
|
-
const [open, setOpen] = useState(false);
|
|
79
|
-
|
|
80
|
-
return (
|
|
81
|
-
<Box>
|
|
82
|
-
<Button variant="contained" onClick={() => setOpen(true)}>
|
|
83
|
-
Snackbar
|
|
84
|
-
</Button>
|
|
85
|
-
<Snackbar open={open}>
|
|
86
|
-
<ExpandableAlert
|
|
87
|
-
severity="info"
|
|
88
|
-
onClose={() => setOpen(false)}
|
|
89
|
-
title="Lorem ipsum"
|
|
90
|
-
message="Lorem ipsum dolor sit amet"
|
|
91
|
-
metadata={["lorem: ipsum", "foo: bar", "header: this", "host: localhost"]}
|
|
92
|
-
/>
|
|
93
|
-
</Snackbar>
|
|
94
|
-
</Box>
|
|
95
|
-
);
|
|
96
|
-
};
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
import { render, screen, waitFor } from "~/tests/testing-library";
|
|
3
|
-
import { ExpandableAlert } from "./expandable-alert";
|
|
4
|
-
import userEvent from "@testing-library/user-event";
|
|
5
|
-
import { vi } from "vitest";
|
|
6
|
-
import { Box, Button, Snackbar } from "@mui/material";
|
|
7
|
-
|
|
8
|
-
const message = "Lorem ipsum dolor sit amet";
|
|
9
|
-
const metadata =
|
|
10
|
-
"Of recommend residence education be on difficult repulsive offending. Judge views had mirth table seems great him for her. Alone all happy asked begin fully stand own get. Excuse ye seeing result of we. See scale dried songs old may not. Promotion did disposing you household any instantly. Hills we do under times at first short an.";
|
|
11
|
-
const arrayMetadata = ["lorem: ipsum", "foo: bar", "header: this", "host: localhost"];
|
|
12
|
-
|
|
13
|
-
describe("ExpandableAlert", () => {
|
|
14
|
-
const renderComponent = ({
|
|
15
|
-
title,
|
|
16
|
-
metadata,
|
|
17
|
-
}: { title?: string; metadata?: string | string[] } = {}) => {
|
|
18
|
-
const onClose = vi.fn();
|
|
19
|
-
const copy = vi.fn();
|
|
20
|
-
Object.assign(navigator, {
|
|
21
|
-
clipboard: {
|
|
22
|
-
writeText: copy,
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
render(
|
|
27
|
-
<ExpandableAlert
|
|
28
|
-
severity="info"
|
|
29
|
-
title={title}
|
|
30
|
-
message={message}
|
|
31
|
-
metadata={metadata}
|
|
32
|
-
onClose={onClose}
|
|
33
|
-
/>,
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
return { onClose, copy };
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
it("should render a title if is set", () => {
|
|
40
|
-
const title = "This is the title";
|
|
41
|
-
renderComponent({ title });
|
|
42
|
-
|
|
43
|
-
expect(screen.getByText(title)).toBeVisible();
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it("should render a message", () => {
|
|
47
|
-
renderComponent();
|
|
48
|
-
|
|
49
|
-
expect(screen.getByText(message)).toBeVisible();
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it("should call onClose if the close button is clicked", async () => {
|
|
53
|
-
const { onClose } = renderComponent();
|
|
54
|
-
|
|
55
|
-
await userEvent.click(screen.getByTestId("CloseIcon"));
|
|
56
|
-
|
|
57
|
-
expect(onClose).toHaveBeenCalledTimes(1);
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it("should show a button to expand info if it has metadata", () => {
|
|
61
|
-
renderComponent({ metadata });
|
|
62
|
-
|
|
63
|
-
expect(screen.getByTestId("ExpandMoreIcon")).toBeVisible();
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it("shouldn't show a button to expand info if it doesn't have metadata", () => {
|
|
67
|
-
renderComponent({ metadata: undefined });
|
|
68
|
-
|
|
69
|
-
expect(screen.queryByTestId("ExpandMoreIcon")).not.toBeInTheDocument();
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it("should show the metadata if the expand button is clicked", async () => {
|
|
73
|
-
renderComponent({ metadata });
|
|
74
|
-
|
|
75
|
-
await userEvent.click(screen.getByTestId("ExpandMoreIcon"));
|
|
76
|
-
|
|
77
|
-
expect(screen.getByText(metadata)).toBeVisible();
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
it("should show the array metadata if the expand button is clicked", async () => {
|
|
81
|
-
renderComponent({ metadata: arrayMetadata });
|
|
82
|
-
|
|
83
|
-
await userEvent.click(screen.getByTestId("ExpandMoreIcon"));
|
|
84
|
-
|
|
85
|
-
expect(screen.getByText(arrayMetadata[0])).toBeVisible();
|
|
86
|
-
expect(screen.getByText(arrayMetadata[1])).toBeVisible();
|
|
87
|
-
expect(screen.getByText(arrayMetadata[2])).toBeVisible();
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it("should render a button to hide info if the expand button is clicked", async () => {
|
|
91
|
-
renderComponent({ metadata: arrayMetadata });
|
|
92
|
-
|
|
93
|
-
await userEvent.click(screen.getByTestId("ExpandMoreIcon"));
|
|
94
|
-
|
|
95
|
-
expect(screen.getByTestId("ExpandLessIcon")).toBeVisible();
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
it("should hide the metadata if the hide button is clicked", async () => {
|
|
99
|
-
renderComponent({ metadata });
|
|
100
|
-
|
|
101
|
-
await userEvent.click(screen.getByTestId("ExpandMoreIcon"));
|
|
102
|
-
await userEvent.click(screen.getByTestId("ExpandLessIcon"));
|
|
103
|
-
|
|
104
|
-
await waitFor(() => expect(screen.getByText(metadata)).not.toBeVisible());
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
it("should copy the content if the copy button is clicked", async () => {
|
|
108
|
-
const { copy } = renderComponent({ metadata });
|
|
109
|
-
|
|
110
|
-
await userEvent.click(screen.getByTestId("ExpandMoreIcon"));
|
|
111
|
-
await userEvent.click(screen.getByRole("button", { name: /copy/i }));
|
|
112
|
-
|
|
113
|
-
expect(copy).toHaveBeenCalledTimes(1);
|
|
114
|
-
expect(copy).toHaveBeenCalledWith(metadata);
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
it("should work inside a snackbar", async () => {
|
|
118
|
-
const SnackbarAlert = () => {
|
|
119
|
-
const [open, setOpen] = useState(false);
|
|
120
|
-
|
|
121
|
-
return (
|
|
122
|
-
<Box>
|
|
123
|
-
<Button onClick={() => setOpen(true)}>snackbar</Button>
|
|
124
|
-
<Snackbar open={open}>
|
|
125
|
-
<ExpandableAlert severity="info" message="lorem ipsum" onClose={() => setOpen(false)} />
|
|
126
|
-
</Snackbar>
|
|
127
|
-
</Box>
|
|
128
|
-
);
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
render(<SnackbarAlert />);
|
|
132
|
-
|
|
133
|
-
await userEvent.click(screen.getByRole("button", { name: /snackbar/i }));
|
|
134
|
-
|
|
135
|
-
expect(screen.getByText(/lorem ipsum/i)).toBeVisible();
|
|
136
|
-
});
|
|
137
|
-
});
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Alert,
|
|
3
|
-
alertClasses,
|
|
4
|
-
AlertColor,
|
|
5
|
-
AlertTitle,
|
|
6
|
-
Box,
|
|
7
|
-
Collapse,
|
|
8
|
-
IconButton,
|
|
9
|
-
SxProps,
|
|
10
|
-
Theme,
|
|
11
|
-
} from "@mui/material";
|
|
12
|
-
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
|
13
|
-
import ExpandLessIcon from "@mui/icons-material/ExpandLess";
|
|
14
|
-
import CloseIcon from "@mui/icons-material/Close";
|
|
15
|
-
import { forwardRef, ReactElement, useState } from "react";
|
|
16
|
-
import React from "react";
|
|
17
|
-
import { Board } from "~/components/data-display";
|
|
18
|
-
|
|
19
|
-
export interface ExpandableAlertProps {
|
|
20
|
-
severity: AlertColor;
|
|
21
|
-
iconMapping?: Partial<Record<AlertColor, React.ReactNode>>;
|
|
22
|
-
title?: string;
|
|
23
|
-
message: string;
|
|
24
|
-
metadata?: string | string[];
|
|
25
|
-
metadataComponent?: ReactElement;
|
|
26
|
-
onClose: () => void;
|
|
27
|
-
sx?: SxProps<Theme>;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const alertSx = {
|
|
31
|
-
[`& .${alertClasses.message}`]: {
|
|
32
|
-
width: 1,
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const ExpandableAlert = forwardRef<any, ExpandableAlertProps>(
|
|
37
|
-
(
|
|
38
|
-
{ severity, iconMapping, title, message, metadata, metadataComponent, onClose, sx = {} },
|
|
39
|
-
ref,
|
|
40
|
-
) => {
|
|
41
|
-
const [expanded, setExpanded] = useState(false);
|
|
42
|
-
return (
|
|
43
|
-
<Alert
|
|
44
|
-
ref={ref}
|
|
45
|
-
severity={severity}
|
|
46
|
-
iconMapping={iconMapping}
|
|
47
|
-
onClose={onClose}
|
|
48
|
-
action={
|
|
49
|
-
<Box display="flex" flexDirection="column">
|
|
50
|
-
<IconButton color="inherit" onClick={onClose}>
|
|
51
|
-
<CloseIcon fontSize="small" />
|
|
52
|
-
</IconButton>
|
|
53
|
-
{metadata && (
|
|
54
|
-
<IconButton color="inherit" onClick={() => setExpanded((e) => !e)}>
|
|
55
|
-
{expanded ? (
|
|
56
|
-
<ExpandLessIcon fontSize="small" />
|
|
57
|
-
) : (
|
|
58
|
-
<ExpandMoreIcon fontSize="small" />
|
|
59
|
-
)}
|
|
60
|
-
</IconButton>
|
|
61
|
-
)}
|
|
62
|
-
</Box>
|
|
63
|
-
}
|
|
64
|
-
sx={{ ...alertSx, ...sx }}
|
|
65
|
-
>
|
|
66
|
-
<Box sx={{ w: 1 }}>
|
|
67
|
-
{title && <AlertTitle>{title}</AlertTitle>}
|
|
68
|
-
{message}
|
|
69
|
-
{metadata && (
|
|
70
|
-
<Collapse in={expanded} sx={{ mt: 2 }}>
|
|
71
|
-
<Board content={metadata}>{metadataComponent}</Board>
|
|
72
|
-
</Collapse>
|
|
73
|
-
)}
|
|
74
|
-
</Box>
|
|
75
|
-
</Alert>
|
|
76
|
-
);
|
|
77
|
-
},
|
|
78
|
-
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./expandable-alert";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./expandable-alert";
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Meta } from '@storybook/addon-docs';
|
|
2
|
-
import LinkTo from '@storybook/addon-links/react';
|
|
3
|
-
|
|
4
|
-
<Meta title="Components/Introduction" />
|
|
5
|
-
|
|
6
|
-
# Components
|
|
7
|
-
|
|
8
|
-
<ul>
|
|
9
|
-
<li><LinkTo kind="Components/Value displays/Introduction">Value displays</LinkTo></li>
|
|
10
|
-
<li><LinkTo kind="Components/Feedback/Introduction">Feedback</LinkTo></li>
|
|
11
|
-
<li><LinkTo kind="Components/Data Display/Introduction">Data Display</LinkTo></li>
|
|
12
|
-
<li><LinkTo kind="Components/Containers/Introduction">Containers</LinkTo></li>
|
|
13
|
-
<li><LinkTo kind="Components/Drawers/Introduction">Drawers</LinkTo></li>
|
|
14
|
-
<li><LinkTo kind="Components/Inputs/Introduction">Inputs</LinkTo></li>
|
|
15
|
-
<li><LinkTo kind="Components/Navigation/Introduction">Navigation</LinkTo></li>
|
|
16
|
-
<li><LinkTo kind="Components/Placeholders/Introduction">Placeholders</LinkTo></li>
|
|
17
|
-
<li><LinkTo kind="Components/Tables/Introduction">Tables</LinkTo></li>
|
|
18
|
-
<li><LinkTo kind="Components/Alerts/Introduction">Alerts</LinkTo></li>
|
|
19
|
-
<li><LinkTo kind="Components/Dialogs/Introduction">Dialogs</LinkTo></li>
|
|
20
|
-
</ul>
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
3
|
-
import { CenterContainer } from "./center-container";
|
|
4
|
-
import { Label } from "../../data-display/label";
|
|
5
|
-
import { withContainer } from "../../../storybook";
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: "Components/Containers/CenterContainer",
|
|
9
|
-
component: CenterContainer,
|
|
10
|
-
decorators: [withContainer({ height: 500, bordered: true })],
|
|
11
|
-
parameters: {
|
|
12
|
-
layout: "fullscreen",
|
|
13
|
-
},
|
|
14
|
-
render: (args) => (
|
|
15
|
-
<CenterContainer {...args}>
|
|
16
|
-
<Label text="Lorem ipsum" />
|
|
17
|
-
</CenterContainer>
|
|
18
|
-
),
|
|
19
|
-
} satisfies Meta<typeof CenterContainer>;
|
|
20
|
-
type Story = StoryObj<typeof CenterContainer>;
|
|
21
|
-
|
|
22
|
-
export const Default: Story = {
|
|
23
|
-
args: {
|
|
24
|
-
centerVertical: true,
|
|
25
|
-
centerHorizontal: true,
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const VerticalCentered: Story = {
|
|
30
|
-
args: {
|
|
31
|
-
centerVertical: true,
|
|
32
|
-
centerHorizontal: false,
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const HorizontallyCentered: Story = {
|
|
37
|
-
args: {
|
|
38
|
-
centerVertical: false,
|
|
39
|
-
centerHorizontal: true,
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export const CustomStyles: Story = {
|
|
44
|
-
args: {
|
|
45
|
-
centerVertical: false,
|
|
46
|
-
centerHorizontal: false,
|
|
47
|
-
sx: {
|
|
48
|
-
px: 3,
|
|
49
|
-
py: 2,
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Typography } from "@mui/material";
|
|
3
|
-
import { render, screen } from "~/tests/testing-library";
|
|
4
|
-
import { CenterContainer } from "./center-container";
|
|
5
|
-
|
|
6
|
-
describe("CenterContainer", () => {
|
|
7
|
-
it("would render the children", () => {
|
|
8
|
-
render(
|
|
9
|
-
<CenterContainer>
|
|
10
|
-
<Typography>Content</Typography>
|
|
11
|
-
</CenterContainer>,
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
expect(screen.getByText(/content/i)).toBeInTheDocument();
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from "react";
|
|
2
|
-
import { Box, SxProps, Theme } from "@mui/material";
|
|
3
|
-
|
|
4
|
-
export interface CenterContainerProps {
|
|
5
|
-
children: ReactNode | undefined;
|
|
6
|
-
centerVertical?: boolean;
|
|
7
|
-
centerHorizontal?: boolean;
|
|
8
|
-
sx?: SxProps<Theme>;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function CenterContainer({
|
|
12
|
-
children,
|
|
13
|
-
centerVertical = true,
|
|
14
|
-
centerHorizontal = true,
|
|
15
|
-
sx,
|
|
16
|
-
}: CenterContainerProps) {
|
|
17
|
-
return (
|
|
18
|
-
<Box
|
|
19
|
-
width={1}
|
|
20
|
-
height={1}
|
|
21
|
-
sx={{
|
|
22
|
-
...sx,
|
|
23
|
-
display: "flex",
|
|
24
|
-
flexDirection: "column",
|
|
25
|
-
justifyContent: centerVertical ? "center" : "flex-start",
|
|
26
|
-
alignItems: centerHorizontal ? "center" : "flex-start",
|
|
27
|
-
}}
|
|
28
|
-
>
|
|
29
|
-
{children}
|
|
30
|
-
</Box>
|
|
31
|
-
);
|
|
32
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./center-container";
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Meta } from '@storybook/addon-docs';
|
|
2
|
-
import LinkTo from '@storybook/addon-links/react';
|
|
3
|
-
|
|
4
|
-
<Meta title="Components/Containers/Introduction" />
|
|
5
|
-
|
|
6
|
-
# Containers
|
|
7
|
-
|
|
8
|
-
<ul>
|
|
9
|
-
<li><LinkTo kind="Components/Containers/CenterContainer">CenterContainer</LinkTo></li>
|
|
10
|
-
<li><LinkTo kind="Components/Containers/Content">Content</LinkTo></li>
|
|
11
|
-
<li><LinkTo kind="Components/Containers/ListPanel">ListPanel</LinkTo></li>
|
|
12
|
-
</ul>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
3
|
-
import { Content } from "./content";
|
|
4
|
-
import { SkeletonGrid } from "~/components/placeholders";
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: "Components/Containers/Content",
|
|
8
|
-
component: Content,
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: "fullscreen",
|
|
11
|
-
},
|
|
12
|
-
render: () => (
|
|
13
|
-
<Content>
|
|
14
|
-
<SkeletonGrid />
|
|
15
|
-
</Content>
|
|
16
|
-
),
|
|
17
|
-
} satisfies Meta<typeof Content>;
|
|
18
|
-
type Story = StoryObj<typeof Content>;
|
|
19
|
-
|
|
20
|
-
export const Default: Story = {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Content } from "./content";
|
|
3
|
-
import { render, screen } from "~/tests/testing-library";
|
|
4
|
-
import { Typography } from "@mui/material";
|
|
5
|
-
|
|
6
|
-
describe("Content", () => {
|
|
7
|
-
const renderComponent = () => {
|
|
8
|
-
return render(
|
|
9
|
-
<Content>
|
|
10
|
-
<Typography>Children content</Typography>
|
|
11
|
-
</Content>,
|
|
12
|
-
);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
it("would render a children", () => {
|
|
16
|
-
renderComponent();
|
|
17
|
-
|
|
18
|
-
expect(screen.getByText(/children content/i)).toBeInTheDocument();
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it("would render a main element", () => {
|
|
22
|
-
renderComponent();
|
|
23
|
-
|
|
24
|
-
expect(screen.getByRole("main")).toBeInTheDocument();
|
|
25
|
-
});
|
|
26
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Container } from "@mui/material";
|
|
3
|
-
import { ContentProps } from "./content.types";
|
|
4
|
-
|
|
5
|
-
export const Content = ({ children }: ContentProps) => {
|
|
6
|
-
return (
|
|
7
|
-
<Container component="main" sx={{ py: 3, flexGrow: 1 }}>
|
|
8
|
-
{children}
|
|
9
|
-
</Container>
|
|
10
|
-
);
|
|
11
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from "react";
|
|
2
|
-
import { useListPanel } from "./list-panel.context";
|
|
3
|
-
import React from "react";
|
|
4
|
-
|
|
5
|
-
export type ListPanelPanelProps = PropsWithChildren<{
|
|
6
|
-
ids: string[];
|
|
7
|
-
}>;
|
|
8
|
-
|
|
9
|
-
export const ListPanelPanel = ({ ids, children }: ListPanelPanelProps) => {
|
|
10
|
-
const selectedId = useListPanel();
|
|
11
|
-
|
|
12
|
-
if (selectedId && !ids.includes(selectedId)) {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return <>{children}</>;
|
|
17
|
-
};
|