@12-apps/ui 1.5.0 → 1.5.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/package.json +17 -9
- package/src/button/index.ts +1 -0
- package/src/social-login-button/index.ts +1 -0
- package/src/{social-login-button.tsx → social-login-button/social-login-button.tsx} +5 -5
- package/src/user-avatar/index.ts +1 -0
- package/src/{user-avatar.tsx → user-avatar/user-avatar.tsx} +4 -4
- package/eslint.config.js +0 -89
- package/src/__tests__/data-grid.test.tsx +0 -125
- package/src/__tests__/package-wiring.test.ts +0 -41
- package/src/__tests__/setup.ts +0 -1
- package/src/__tests__/social-login-button.test.tsx +0 -186
- package/src/__tests__/user-avatar.test.tsx +0 -195
- package/src/__tests__/viewport.test.ts +0 -50
- package/src/components/command/__tests__/command.test.tsx +0 -112
- package/src/components/data-display/Alert/Alert.stories.tsx +0 -559
- package/src/components/data-display/Alert/Alert.test.stories.tsx +0 -707
- package/src/components/data-display/AlertDialog/AlertDialog.stories.tsx +0 -362
- package/src/components/data-display/AlertDialog/AlertDialog.test.stories.tsx +0 -763
- package/src/components/data-display/AsyncStateContainer/AsyncStateContainer.stories.tsx +0 -230
- package/src/components/data-display/AsyncStateContainer/AsyncStateContainer.test.stories.tsx +0 -270
- package/src/components/data-display/Avatar/Avatar.stories.tsx +0 -721
- package/src/components/data-display/Avatar/Avatar.test.stories.tsx +0 -822
- package/src/components/data-display/Badge/Badge.stories.tsx +0 -1134
- package/src/components/data-display/Badge/Badge.test.stories.tsx +0 -1194
- package/src/components/data-display/Banner/Banner.stories.tsx +0 -528
- package/src/components/data-display/Banner/Banner.test.stories.tsx +0 -511
- package/src/components/data-display/Carousel/Carousel.stories.tsx +0 -607
- package/src/components/data-display/Carousel/Carousel.test.stories.tsx +0 -701
- package/src/components/data-display/Chart/Chart.stories.tsx +0 -568
- package/src/components/data-display/Chart/Chart.test.stories.tsx +0 -174
- package/src/components/data-display/Chart/SpecChart.stories.tsx +0 -150
- package/src/components/data-display/Chart/SpecChart.test.stories.tsx +0 -56
- package/src/components/data-display/Chart/__tests__/SpecChart.test.tsx +0 -60
- package/src/components/data-display/Chart/__tests__/chart-format.test.ts +0 -43
- package/src/components/data-display/Chart/__tests__/chart-spec.test.ts +0 -119
- package/src/components/data-display/Chip/Chip.stories.tsx +0 -252
- package/src/components/data-display/Chip/Chip.test.stories.tsx +0 -266
- package/src/components/data-display/DataGrid/DataGrid.stories.tsx +0 -515
- package/src/components/data-display/DataGrid/DataGrid.test.stories.tsx +0 -653
- package/src/components/data-display/DataViews/__tests__/DataViewsGrid.test.tsx +0 -271
- package/src/components/data-display/DataViews/__tests__/DataViewsTableBase.test.tsx +0 -134
- package/src/components/data-display/DataViews/__tests__/SaveViewModal.test.tsx +0 -83
- package/src/components/data-display/DataViews/__tests__/data-views-filter.test.ts +0 -115
- package/src/components/data-display/DataViews/__tests__/data-views-preview.test.ts +0 -53
- package/src/components/data-display/DataViews/__tests__/range-pill.test.tsx +0 -114
- package/src/components/data-display/DataViews/base-card.stories.tsx +0 -136
- package/src/components/data-display/DescriptionItem/DescriptionItem.stories.tsx +0 -254
- package/src/components/data-display/EmptyState/EmptyState.stories.tsx +0 -282
- package/src/components/data-display/EmptyState/EmptyState.test.stories.tsx +0 -441
- package/src/components/data-display/ErrorState/ErrorState.stories.tsx +0 -110
- package/src/components/data-display/ErrorState/ErrorState.test.stories.tsx +0 -133
- package/src/components/data-display/HoverCard/HoverCard.stories.tsx +0 -650
- package/src/components/data-display/HoverCard/HoverCard.test.stories.tsx +0 -929
- package/src/components/data-display/InteractiveTooltip/InteractiveTooltip.stories.tsx +0 -411
- package/src/components/data-display/LazyImage/LazyImage.stories.tsx +0 -387
- package/src/components/data-display/Lightbox/Lightbox.stories.tsx +0 -315
- package/src/components/data-display/Lightbox/Lightbox.test.stories.tsx +0 -598
- package/src/components/data-display/LoadingState/LoadingState.stories.tsx +0 -124
- package/src/components/data-display/LoadingState/LoadingState.test.stories.tsx +0 -99
- package/src/components/data-display/MapPreview/MapPreview.stories.tsx +0 -458
- package/src/components/data-display/MapPreview/MapPreview.test.stories.tsx +0 -394
- package/src/components/data-display/Popover/Popover.stories.tsx +0 -295
- package/src/components/data-display/Popover/Popover.test.stories.tsx +0 -1162
- package/src/components/data-display/Progress/Progress.stories.tsx +0 -481
- package/src/components/data-display/Progress/Progress.test.stories.tsx +0 -2070
- package/src/components/data-display/SectionOnboarding/SectionOnboarding.stories.tsx +0 -160
- package/src/components/data-display/SectionOnboarding/SectionOnboarding.test.stories.tsx +0 -190
- package/src/components/data-display/Sheet/Sheet.stories.tsx +0 -883
- package/src/components/data-display/Sheet/Sheet.test.stories.tsx +0 -1105
- package/src/components/data-display/StatCard/StatCard.stories.tsx +0 -167
- package/src/components/data-display/StatCard/StatCard.test.stories.tsx +0 -240
- package/src/components/data-display/Stepper/Stepper.stories.tsx +0 -540
- package/src/components/data-display/Stepper/Stepper.test.stories.tsx +0 -600
- package/src/components/data-display/Table/Table.stories.tsx +0 -803
- package/src/components/data-display/Table/Table.test.stories.tsx +0 -369
- package/src/components/data-display/Timeline/Timeline.stories.tsx +0 -442
- package/src/components/data-display/Timeline/Timeline.test.stories.tsx +0 -930
- package/src/components/data-display/TimingDiagram/TimingDiagram.stories.tsx +0 -475
- package/src/components/data-display/TimingDiagram/TimingDiagram.test.stories.tsx +0 -734
- package/src/components/data-display/Tooltip/Tooltip.stories.tsx +0 -468
- package/src/components/data-display/Tooltip/Tooltip.test.stories.tsx +0 -1154
- package/src/components/feedback/ConfirmAction/ConfirmAction.stories.tsx +0 -146
- package/src/components/feedback/ConfirmAction/ConfirmAction.test.stories.tsx +0 -114
- package/src/components/feedback/ConfirmAction/__tests__/confirm-action.test.tsx +0 -288
- package/src/components/feedback/Dialog/Dialog.stories.tsx +0 -833
- package/src/components/feedback/Dialog/Dialog.test.stories.tsx +0 -964
- package/src/components/feedback/Dialog/__tests__/dialog-content-spacing.test.tsx +0 -66
- package/src/components/feedback/Modal/Modal.stories.tsx +0 -765
- package/src/components/feedback/Modal/Modal.test.stories.tsx +0 -251
- package/src/components/feedback/Sonner/Sonner.stories.tsx +0 -698
- package/src/components/feedback/Sonner/Sonner.test.stories.tsx +0 -896
- package/src/components/feedback/StackedModal/StackedModal.stories.tsx +0 -1783
- package/src/components/feedback/StackedModal/StackedModal.test.stories.tsx +0 -973
- package/src/components/feedback/StackedModal/__tests__/stacked-modal-viewport.test.tsx +0 -104
- package/src/components/feedback/Toast/Toast.stories.tsx +0 -548
- package/src/components/feedback/Toast/Toast.test.stories.tsx +0 -834
- package/src/components/feedback/TutorialOverlay/TutorialOverlay.stories.tsx +0 -691
- package/src/components/feedback/TutorialOverlay/TutorialOverlay.test.stories.tsx +0 -634
- package/src/components/form/AddressAutocomplete/AddressAutocomplete.stories.tsx +0 -665
- package/src/components/form/AddressAutocomplete/AddressAutocomplete.test.stories.tsx +0 -727
- package/src/components/form/Autocomplete/Autocomplete.stories.tsx +0 -715
- package/src/components/form/Autocomplete/Autocomplete.test.stories.tsx +0 -825
- package/src/components/form/Button/Button.stories.tsx +0 -365
- package/src/components/form/Button/Button.test.stories.tsx +0 -607
- package/src/components/form/Calendar/Calendar.stories.tsx +0 -349
- package/src/components/form/Calendar/Calendar.test.stories.tsx +0 -464
- package/src/components/form/CepField/CepField.stories.tsx +0 -138
- package/src/components/form/CepField/CepField.test.stories.tsx +0 -281
- package/src/components/form/Checkbox/Checkbox.stories.tsx +0 -265
- package/src/components/form/Checkbox/Checkbox.test.stories.tsx +0 -181
- package/src/components/form/CodeEditor/CodeEditor.stories.tsx +0 -871
- package/src/components/form/CodeEditor/CodeEditor.test.stories.tsx +0 -574
- package/src/components/form/Command/Command.stories.tsx +0 -580
- package/src/components/form/Command/Command.test.stories.tsx +0 -215
- package/src/components/form/CreatableSelect/CreatableSelect.stories.tsx +0 -112
- package/src/components/form/CreatableSelect/CreatableSelect.test.stories.tsx +0 -134
- package/src/components/form/Form/Form.stories.tsx +0 -687
- package/src/components/form/Form/Form.test.stories.tsx +0 -601
- package/src/components/form/Input/Input.stories.tsx +0 -260
- package/src/components/form/Input/Input.test.stories.tsx +0 -1191
- package/src/components/form/InputOTP/InputOTP.stories.tsx +0 -774
- package/src/components/form/InputOTP/InputOTP.test.stories.tsx +0 -588
- package/src/components/form/Label/Label.stories.tsx +0 -473
- package/src/components/form/Label/Label.test.stories.tsx +0 -915
- package/src/components/form/Menubar/Menubar.stories.tsx +0 -472
- package/src/components/form/Menubar/Menubar.test.stories.tsx +0 -584
- package/src/components/form/PasswordStrength/PasswordStrength.stories.tsx +0 -562
- package/src/components/form/PasswordStrength/PasswordStrength.test.stories.tsx +0 -327
- package/src/components/form/PhoneInput/PhoneInput.stories.tsx +0 -495
- package/src/components/form/PhoneInput/PhoneInput.test.stories.tsx +0 -666
- package/src/components/form/RadioGroup/RadioGroup.stories.tsx +0 -518
- package/src/components/form/RadioGroup/RadioGroup.test.stories.tsx +0 -685
- package/src/components/form/RichTextEditor/RichTextEditor.stories.tsx +0 -261
- package/src/components/form/RichTextEditor/RichTextEditor.test.stories.tsx +0 -491
- package/src/components/form/SearchPalette/SearchPalette.stories.tsx +0 -135
- package/src/components/form/Select/Select.stories.tsx +0 -364
- package/src/components/form/Select/Select.test.stories.tsx +0 -985
- package/src/components/form/Slider/Slider.stories.tsx +0 -418
- package/src/components/form/Slider/Slider.test.stories.tsx +0 -1042
- package/src/components/form/Switch/Switch.stories.tsx +0 -697
- package/src/components/form/Switch/Switch.test.stories.tsx +0 -597
- package/src/components/form/Textarea/Textarea.stories.tsx +0 -473
- package/src/components/form/Textarea/Textarea.test.stories.tsx +0 -702
- package/src/components/form/Toggle/Toggle.stories.tsx +0 -638
- package/src/components/form/Toggle/Toggle.test.stories.tsx +0 -1159
- package/src/components/form/ToggleGroup/ToggleGroup.stories.tsx +0 -617
- package/src/components/form/ToggleGroup/ToggleGroup.test.stories.tsx +0 -915
- package/src/components/form/UploadButton/UploadButton.stories.tsx +0 -367
- package/src/components/form/UploadButton/UploadButton.test.stories.tsx +0 -573
- package/src/components/form/total-form/total-form.test.tsx +0 -214
- package/src/components/layout/Accordion/Accordion.stories.tsx +0 -694
- package/src/components/layout/Accordion/Accordion.test.stories.tsx +0 -1344
- package/src/components/layout/Card/Card.stories.tsx +0 -591
- package/src/components/layout/Card/Card.test.stories.tsx +0 -1134
- package/src/components/layout/CardGrid/__tests__/CardGrid.test.tsx +0 -92
- package/src/components/layout/Collapsible/Collapsible.stories.tsx +0 -180
- package/src/components/layout/Collapsible/Collapsible.test.stories.tsx +0 -308
- package/src/components/layout/Container/Container.stories.tsx +0 -557
- package/src/components/layout/Container/Container.test.stories.tsx +0 -745
- package/src/components/layout/ContentToolbar/ContentToolbar.stories.tsx +0 -129
- package/src/components/layout/ContentToolbar/ContentToolbar.test.stories.tsx +0 -251
- package/src/components/layout/ContentToolbar/__tests__/ColumnsMenu.test.tsx +0 -39
- package/src/components/layout/ContentToolbar/__tests__/MultiSelectDropdown.test.tsx +0 -131
- package/src/components/layout/ContentToolbar/__tests__/SavedViewsMenu.test.tsx +0 -99
- package/src/components/layout/Dashboard/Dashboard.stories.tsx +0 -104
- package/src/components/layout/Dashboard/Dashboard.test.stories.tsx +0 -190
- package/src/components/layout/Drawer/Drawer.stories.tsx +0 -658
- package/src/components/layout/Drawer/Drawer.test.stories.tsx +0 -1343
- package/src/components/layout/Resizable/Resizable.stories.tsx +0 -1039
- package/src/components/layout/Resizable/Resizable.test.stories.tsx +0 -754
- package/src/components/layout/ScrollArea/ScrollArea.stories.tsx +0 -651
- package/src/components/layout/ScrollArea/ScrollArea.test.stories.tsx +0 -619
- package/src/components/layout/Separator/Separator.stories.tsx +0 -563
- package/src/components/layout/Separator/Separator.test.stories.tsx +0 -518
- package/src/components/layout/SettingsLayout/SettingsLayout.stories.tsx +0 -192
- package/src/components/layout/SettingsLayout/SettingsLayout.test.stories.tsx +0 -175
- package/src/components/layout/Sidebar/Sidebar.stories.tsx +0 -609
- package/src/components/layout/Sidebar/Sidebar.test.stories.tsx +0 -1324
- package/src/components/layout/Skeleton/Skeleton.stories.tsx +0 -689
- package/src/components/layout/Skeleton/Skeleton.test.stories.tsx +0 -521
- package/src/components/layout/Spacer/Spacer.stories.tsx +0 -502
- package/src/components/layout/Spacer/Spacer.test.stories.tsx +0 -474
- package/src/components/layout/TableFilter/TableFilter.stories.tsx +0 -82
- package/src/components/layout/TableFilter/TableFilter.test.stories.tsx +0 -87
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.stories.tsx +0 -638
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.test.stories.tsx +0 -1008
- package/src/components/navigation/CommandPalette/CommandPalette.stories.tsx +0 -386
- package/src/components/navigation/CommandPalette/CommandPalette.test.stories.tsx +0 -435
- package/src/components/navigation/ContextMenu/ContextMenu.stories.tsx +0 -614
- package/src/components/navigation/ContextMenu/ContextMenu.test.stories.tsx +0 -845
- package/src/components/navigation/DropdownMenu/DropdownMenu.stories.tsx +0 -578
- package/src/components/navigation/DropdownMenu/DropdownMenu.test.stories.tsx +0 -660
- package/src/components/navigation/NavigationMenu/stories/NavigationMenu.stories.tsx +0 -516
- package/src/components/navigation/NavigationMenu/stories/NavigationMenu.test.stories.tsx +0 -935
- package/src/components/navigation/NavigationMenu/stories/NavigationMenuHorizontal.stories.tsx +0 -501
- package/src/components/navigation/NavigationMenu/stories/NavigationMenuVertical.stories.tsx +0 -453
- package/src/components/navigation/Pagination/Pagination.stories.tsx +0 -602
- package/src/components/navigation/Pagination/Pagination.test.stories.tsx +0 -520
- package/src/components/navigation/Tabs/Tabs.stories.tsx +0 -1004
- package/src/components/navigation/Tabs/Tabs.test.stories.tsx +0 -1225
- package/src/components/typography/Blockquote/Blockquote.stories.tsx +0 -359
- package/src/components/typography/Blockquote/Blockquote.test.stories.tsx +0 -432
- package/src/components/typography/Code/Code.stories.tsx +0 -686
- package/src/components/typography/Code/Code.test.stories.tsx +0 -703
- package/src/components/typography/Heading/Heading.stories.tsx +0 -451
- package/src/components/typography/Heading/Heading.test.stories.tsx +0 -830
- package/src/components/typography/Paragraph/Paragraph.stories.tsx +0 -280
- package/src/components/typography/Paragraph/Paragraph.test.stories.tsx +0 -231
- package/src/components/typography/Text/Text.stories.tsx +0 -359
- package/src/components/typography/Text/Text.test.stories.tsx +0 -759
- package/src/components/utility/AnimatedIcon/AnimatedIcon.stories.tsx +0 -945
- package/src/components/utility/AnimatedIcon/AnimatedIcon.test.stories.tsx +0 -603
- package/src/components/utility/AspectRatio/AspectRatio.stories.tsx +0 -414
- package/src/components/utility/AspectRatio/AspectRatio.test.stories.tsx +0 -859
- package/src/components/utility/InfiniteScroll/InfiniteScroll.stories.tsx +0 -620
- package/src/components/utility/InfiniteScroll/InfiniteScroll.test.stories.tsx +0 -361
- package/src/components/utility/InstallPrompt/InstallPrompt.stories.tsx +0 -118
- package/src/components/utility/InstallPrompt/InstallPrompt.test.stories.tsx +0 -83
- package/src/components/utility/InstallPrompt/__tests__/InstallPrompt.ios.test.tsx +0 -65
- package/src/components/utility/InstallPrompt/__tests__/usePwaInstall.test.tsx +0 -271
- package/src/components/utility/Portal/Portal.stories.tsx +0 -340
- package/src/components/utility/Portal/Portal.test.stories.tsx +0 -2086
- package/src/components/utility/Transition/Transition.stories.tsx +0 -493
- package/src/components/utility/Transition/Transition.test.stories.tsx +0 -854
- package/src/components/utility/VirtualList/VirtualList.stories.tsx +0 -1073
- package/src/components/utility/VirtualList/VirtualList.test.stories.tsx +0 -1085
- package/src/components/utility/WorkflowStep/WorkflowStep.stories.tsx +0 -431
- package/src/components/utility/WorkflowStep/WorkflowStep.test.stories.tsx +0 -364
- /package/src/{button.tsx → button/button.tsx} +0 -0
|
@@ -1,528 +0,0 @@
|
|
|
1
|
-
import Cookie from '@mui/icons-material/Cookie';
|
|
2
|
-
import Payment from '@mui/icons-material/Payment';
|
|
3
|
-
import Security from '@mui/icons-material/Security';
|
|
4
|
-
import Star from '@mui/icons-material/Star';
|
|
5
|
-
import Update from '@mui/icons-material/Update';
|
|
6
|
-
import { Box, Container, Stack, Typography } from '@mui/material';
|
|
7
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
8
|
-
import React from 'react';
|
|
9
|
-
import { fn } from 'storybook/test';
|
|
10
|
-
|
|
11
|
-
import { Banner } from './Banner';
|
|
12
|
-
|
|
13
|
-
const meta: Meta<typeof Banner> = {
|
|
14
|
-
title: 'DataDisplay/Banner',
|
|
15
|
-
component: Banner,
|
|
16
|
-
parameters: {
|
|
17
|
-
layout: 'fullscreen',
|
|
18
|
-
docs: {
|
|
19
|
-
description: {
|
|
20
|
-
component:
|
|
21
|
-
'A page-level notification bar for system messages. Supports multiple variants, inline actions, dismissible functionality, and can be made sticky to affix to the top on scroll.',
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
tags: ['autodocs', 'component:Banner'],
|
|
26
|
-
argTypes: {
|
|
27
|
-
variant: {
|
|
28
|
-
control: { type: 'select' },
|
|
29
|
-
options: ['info', 'success', 'warning', 'critical'],
|
|
30
|
-
description: 'Message severity type',
|
|
31
|
-
table: {
|
|
32
|
-
defaultValue: { summary: 'info' },
|
|
33
|
-
type: { summary: 'string' },
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
title: {
|
|
37
|
-
control: { type: 'text' },
|
|
38
|
-
description: 'Main message title text',
|
|
39
|
-
table: {
|
|
40
|
-
type: { summary: 'string' },
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
description: {
|
|
44
|
-
control: { type: 'text' },
|
|
45
|
-
description: 'Additional description text',
|
|
46
|
-
table: {
|
|
47
|
-
type: { summary: 'string' },
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
dismissible: {
|
|
51
|
-
control: { type: 'boolean' },
|
|
52
|
-
description: 'Whether banner can be dismissed',
|
|
53
|
-
table: {
|
|
54
|
-
defaultValue: { summary: 'false' },
|
|
55
|
-
type: { summary: 'boolean' },
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
sticky: {
|
|
59
|
-
control: { type: 'boolean' },
|
|
60
|
-
description: 'Affix banner to top on scroll',
|
|
61
|
-
table: {
|
|
62
|
-
defaultValue: { summary: 'false' },
|
|
63
|
-
type: { summary: 'boolean' },
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
fullWidth: {
|
|
67
|
-
control: { type: 'boolean' },
|
|
68
|
-
description: 'Span container or full viewport width',
|
|
69
|
-
table: {
|
|
70
|
-
defaultValue: { summary: 'false' },
|
|
71
|
-
type: { summary: 'boolean' },
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export default meta;
|
|
78
|
-
type Story = StoryObj<typeof meta>;
|
|
79
|
-
|
|
80
|
-
// Basic variants
|
|
81
|
-
export const Default: Story = {
|
|
82
|
-
args: {
|
|
83
|
-
title: 'System Notice',
|
|
84
|
-
description: 'This is a default banner message.',
|
|
85
|
-
},
|
|
86
|
-
parameters: {
|
|
87
|
-
layout: 'padded',
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export const InfoVariant: Story = {
|
|
92
|
-
args: {
|
|
93
|
-
variant: 'info',
|
|
94
|
-
title: 'Information',
|
|
95
|
-
description: 'This is an informational banner with useful details.',
|
|
96
|
-
},
|
|
97
|
-
parameters: {
|
|
98
|
-
layout: 'padded',
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
export const Success: Story = {
|
|
103
|
-
args: {
|
|
104
|
-
variant: 'success',
|
|
105
|
-
title: 'Success!',
|
|
106
|
-
description: 'Your action was completed successfully.',
|
|
107
|
-
},
|
|
108
|
-
parameters: {
|
|
109
|
-
layout: 'padded',
|
|
110
|
-
},
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
export const WarningVariant: Story = {
|
|
114
|
-
args: {
|
|
115
|
-
variant: 'warning',
|
|
116
|
-
title: 'Warning',
|
|
117
|
-
description: 'Please review your settings before continuing.',
|
|
118
|
-
},
|
|
119
|
-
parameters: {
|
|
120
|
-
layout: 'padded',
|
|
121
|
-
},
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
export const Critical: Story = {
|
|
125
|
-
args: {
|
|
126
|
-
variant: 'critical',
|
|
127
|
-
title: 'Critical Error',
|
|
128
|
-
description: 'An error occurred that requires immediate attention.',
|
|
129
|
-
},
|
|
130
|
-
parameters: {
|
|
131
|
-
layout: 'padded',
|
|
132
|
-
},
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
// With custom icon
|
|
136
|
-
export const WithCustomIcon: Story = {
|
|
137
|
-
args: {
|
|
138
|
-
variant: 'info',
|
|
139
|
-
icon: <Star />,
|
|
140
|
-
title: 'Pro Tip',
|
|
141
|
-
description: 'You can customize the banner icon to match your content.',
|
|
142
|
-
},
|
|
143
|
-
parameters: {
|
|
144
|
-
layout: 'padded',
|
|
145
|
-
},
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
// Dismissible banner
|
|
149
|
-
export const Dismissible: Story = {
|
|
150
|
-
args: {
|
|
151
|
-
variant: 'info',
|
|
152
|
-
title: 'Notification',
|
|
153
|
-
description: 'This banner can be closed by clicking the X button.',
|
|
154
|
-
dismissible: true,
|
|
155
|
-
},
|
|
156
|
-
parameters: {
|
|
157
|
-
layout: 'padded',
|
|
158
|
-
},
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
// With actions
|
|
162
|
-
export const WithActions: Story = {
|
|
163
|
-
args: {
|
|
164
|
-
variant: 'info',
|
|
165
|
-
title: 'System Update Available',
|
|
166
|
-
description: 'A new version is available. Update now to get the latest features.',
|
|
167
|
-
actions: [
|
|
168
|
-
{ label: 'Update Now', onClick: fn(), variant: 'primary' },
|
|
169
|
-
{ label: 'Remind Later', onClick: fn(), variant: 'secondary' },
|
|
170
|
-
],
|
|
171
|
-
dismissible: true,
|
|
172
|
-
},
|
|
173
|
-
parameters: {
|
|
174
|
-
layout: 'padded',
|
|
175
|
-
},
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
// With multiple actions
|
|
179
|
-
export const MultipleActions: Story = {
|
|
180
|
-
args: {
|
|
181
|
-
variant: 'warning',
|
|
182
|
-
title: 'Security Alert',
|
|
183
|
-
description: 'Unusual activity detected on your account.',
|
|
184
|
-
actions: [
|
|
185
|
-
{ label: 'Review Activity', onClick: fn(), variant: 'primary' },
|
|
186
|
-
{ label: 'Change Password', onClick: fn(), variant: 'secondary' },
|
|
187
|
-
{ label: 'Contact Support', onClick: fn(), variant: 'secondary' },
|
|
188
|
-
],
|
|
189
|
-
dismissible: true,
|
|
190
|
-
},
|
|
191
|
-
parameters: {
|
|
192
|
-
layout: 'padded',
|
|
193
|
-
},
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
// Sticky banner
|
|
197
|
-
export const Sticky: Story = {
|
|
198
|
-
render: () => (
|
|
199
|
-
<Box>
|
|
200
|
-
<Banner
|
|
201
|
-
variant="warning"
|
|
202
|
-
title="Important Notice"
|
|
203
|
-
description="This banner will stick to the top when you scroll."
|
|
204
|
-
sticky
|
|
205
|
-
dismissible
|
|
206
|
-
/>
|
|
207
|
-
<Container sx={{ mt: 2, minHeight: '200vh', py: 4 }}>
|
|
208
|
-
<Typography variant="h4" gutterBottom>
|
|
209
|
-
Scroll Down to See Sticky Behavior
|
|
210
|
-
</Typography>
|
|
211
|
-
<Typography variant="body1" paragraph>
|
|
212
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt
|
|
213
|
-
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
|
|
214
|
-
ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
215
|
-
</Typography>
|
|
216
|
-
<Typography variant="body1" paragraph>
|
|
217
|
-
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat
|
|
218
|
-
nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia
|
|
219
|
-
deserunt mollit anim id est laborum.
|
|
220
|
-
</Typography>
|
|
221
|
-
<Typography variant="body1" paragraph>
|
|
222
|
-
Continue scrolling to see the sticky banner remain at the top of the viewport.
|
|
223
|
-
</Typography>
|
|
224
|
-
{Array.from({ length: 20 }, (_, i) => (
|
|
225
|
-
<Typography key={i} variant="body1" paragraph>
|
|
226
|
-
Paragraph {i + 1}: More content to demonstrate scrolling behavior. The banner should
|
|
227
|
-
remain visible and accessible at all times.
|
|
228
|
-
</Typography>
|
|
229
|
-
))}
|
|
230
|
-
</Container>
|
|
231
|
-
</Box>
|
|
232
|
-
),
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
// Full width banner
|
|
236
|
-
export const FullWidth: Story = {
|
|
237
|
-
args: {
|
|
238
|
-
variant: 'info',
|
|
239
|
-
title: 'Site-wide Announcement',
|
|
240
|
-
description: 'This banner spans the full viewport width.',
|
|
241
|
-
fullWidth: true,
|
|
242
|
-
dismissible: true,
|
|
243
|
-
},
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
// All variants showcase
|
|
247
|
-
export const AllVariants: Story = {
|
|
248
|
-
render: () => (
|
|
249
|
-
<Stack spacing={2} sx={{ p: 2 }}>
|
|
250
|
-
<Banner
|
|
251
|
-
variant="info"
|
|
252
|
-
title="Information"
|
|
253
|
-
description="Informational message for users"
|
|
254
|
-
dismissible
|
|
255
|
-
/>
|
|
256
|
-
<Banner
|
|
257
|
-
variant="success"
|
|
258
|
-
title="Success"
|
|
259
|
-
description="Operation completed successfully"
|
|
260
|
-
dismissible
|
|
261
|
-
/>
|
|
262
|
-
<Banner
|
|
263
|
-
variant="warning"
|
|
264
|
-
title="Warning"
|
|
265
|
-
description="Please review before proceeding"
|
|
266
|
-
dismissible
|
|
267
|
-
/>
|
|
268
|
-
<Banner
|
|
269
|
-
variant="critical"
|
|
270
|
-
title="Critical Error"
|
|
271
|
-
description="Immediate action required"
|
|
272
|
-
dismissible
|
|
273
|
-
/>
|
|
274
|
-
</Stack>
|
|
275
|
-
),
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
// Different content variations
|
|
279
|
-
export const ContentVariations: Story = {
|
|
280
|
-
render: () => (
|
|
281
|
-
<Stack spacing={2} sx={{ p: 2 }}>
|
|
282
|
-
<Banner variant="info" title="Title Only Banner" />
|
|
283
|
-
<Banner variant="success" description="Description only, no title provided" />
|
|
284
|
-
<Banner variant="warning" title="With Custom Content">
|
|
285
|
-
<Typography variant="body2" sx={{ mt: 1 }}>
|
|
286
|
-
Custom content can be added as children to provide more flexibility in layout and styling.
|
|
287
|
-
</Typography>
|
|
288
|
-
</Banner>
|
|
289
|
-
<Banner variant="info" title="Empty Content Test" description="" />
|
|
290
|
-
</Stack>
|
|
291
|
-
),
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
// Real-world examples
|
|
295
|
-
const RealWorldExamplesComponent = () => {
|
|
296
|
-
const [showCookie, setShowCookie] = React.useState(true);
|
|
297
|
-
const [showMaintenance, setShowMaintenance] = React.useState(true);
|
|
298
|
-
const [showPromo, setShowPromo] = React.useState(true);
|
|
299
|
-
|
|
300
|
-
return (
|
|
301
|
-
<Stack spacing={2} sx={{ p: 2 }}>
|
|
302
|
-
{showCookie && (
|
|
303
|
-
<Banner
|
|
304
|
-
variant="info"
|
|
305
|
-
icon={<Cookie />}
|
|
306
|
-
title="Cookie Notice"
|
|
307
|
-
description="We use cookies to enhance your experience and provide personalized content."
|
|
308
|
-
actions={[
|
|
309
|
-
{ label: 'Accept All', onClick: () => setShowCookie(false), variant: 'primary' },
|
|
310
|
-
{ label: 'Manage Preferences', onClick: fn(), variant: 'secondary' },
|
|
311
|
-
]}
|
|
312
|
-
dismissible
|
|
313
|
-
onDismiss={() => setShowCookie(false)}
|
|
314
|
-
/>
|
|
315
|
-
)}
|
|
316
|
-
|
|
317
|
-
{showMaintenance && (
|
|
318
|
-
<Banner
|
|
319
|
-
variant="warning"
|
|
320
|
-
icon={<Update />}
|
|
321
|
-
title="Scheduled Maintenance"
|
|
322
|
-
description="System maintenance is scheduled for tonight from 2:00 AM to 4:00 AM EST."
|
|
323
|
-
actions={[{ label: 'Learn More', onClick: fn(), variant: 'primary' }]}
|
|
324
|
-
dismissible
|
|
325
|
-
onDismiss={() => setShowMaintenance(false)}
|
|
326
|
-
/>
|
|
327
|
-
)}
|
|
328
|
-
|
|
329
|
-
{showPromo && (
|
|
330
|
-
<Banner
|
|
331
|
-
variant="success"
|
|
332
|
-
icon={<Payment />}
|
|
333
|
-
title="Special Offer!"
|
|
334
|
-
description="Upgrade to Premium and save 50% for the first three months."
|
|
335
|
-
actions={[
|
|
336
|
-
{ label: 'Upgrade Now', onClick: fn(), variant: 'primary' },
|
|
337
|
-
{ label: 'View Details', onClick: fn(), variant: 'secondary' },
|
|
338
|
-
]}
|
|
339
|
-
dismissible
|
|
340
|
-
onDismiss={() => setShowPromo(false)}
|
|
341
|
-
/>
|
|
342
|
-
)}
|
|
343
|
-
|
|
344
|
-
<Banner
|
|
345
|
-
variant="critical"
|
|
346
|
-
icon={<Security />}
|
|
347
|
-
title="Security Alert"
|
|
348
|
-
description="Please verify your identity to continue using the application."
|
|
349
|
-
actions={[{ label: 'Verify Now', onClick: fn(), variant: 'primary' }]}
|
|
350
|
-
/>
|
|
351
|
-
</Stack>
|
|
352
|
-
);
|
|
353
|
-
};
|
|
354
|
-
|
|
355
|
-
export const RealWorldExamples: Story = {
|
|
356
|
-
render: RealWorldExamplesComponent,
|
|
357
|
-
};
|
|
358
|
-
|
|
359
|
-
// Long content handling
|
|
360
|
-
export const LongContent: Story = {
|
|
361
|
-
args: {
|
|
362
|
-
variant: 'info',
|
|
363
|
-
title: 'Terms of Service Update - Important Changes to Review',
|
|
364
|
-
description:
|
|
365
|
-
'We have updated our terms of service to better protect your privacy and improve our services. These changes include enhanced data protection measures, clearer explanations of how we use your information, new rights regarding your personal data, improved security protocols, and updated billing procedures. Please review the updated terms carefully as they affect your use of our services and may impact your account settings.',
|
|
366
|
-
actions: [
|
|
367
|
-
{ label: 'Review Terms', onClick: fn(), variant: 'primary' },
|
|
368
|
-
{ label: 'Accept Changes', onClick: fn(), variant: 'secondary' },
|
|
369
|
-
],
|
|
370
|
-
dismissible: true,
|
|
371
|
-
},
|
|
372
|
-
parameters: {
|
|
373
|
-
layout: 'padded',
|
|
374
|
-
},
|
|
375
|
-
};
|
|
376
|
-
|
|
377
|
-
// Accessibility showcase
|
|
378
|
-
export const AccessibilityFocus: Story = {
|
|
379
|
-
render: () => (
|
|
380
|
-
<Stack spacing={2} sx={{ p: 2 }}>
|
|
381
|
-
<Typography variant="body2" gutterBottom>
|
|
382
|
-
These banners are fully accessible with proper ARIA attributes and keyboard navigation
|
|
383
|
-
</Typography>
|
|
384
|
-
<Banner
|
|
385
|
-
variant="info"
|
|
386
|
-
title="Accessible Info Banner"
|
|
387
|
-
description="This banner uses role='status' and aria-live='polite' for screen readers"
|
|
388
|
-
dismissible
|
|
389
|
-
actions={[{ label: 'Action Button', onClick: fn(), variant: 'primary' }]}
|
|
390
|
-
/>
|
|
391
|
-
<Banner
|
|
392
|
-
variant="critical"
|
|
393
|
-
title="Urgent Critical Banner"
|
|
394
|
-
description="This critical banner uses role='alert' and aria-live='assertive' for immediate announcement"
|
|
395
|
-
dismissible
|
|
396
|
-
actions={[{ label: 'Fix Issue', onClick: fn(), variant: 'primary' }]}
|
|
397
|
-
/>
|
|
398
|
-
</Stack>
|
|
399
|
-
),
|
|
400
|
-
};
|
|
401
|
-
|
|
402
|
-
// Performance with multiple banners
|
|
403
|
-
export const MultipleBanners: Story = {
|
|
404
|
-
render: () => (
|
|
405
|
-
<Stack spacing={1} sx={{ p: 2 }}>
|
|
406
|
-
{Array.from({ length: 8 }, (_, i) => (
|
|
407
|
-
<Banner
|
|
408
|
-
key={i}
|
|
409
|
-
variant={(['info', 'success', 'warning', 'critical'] as const)[i % 4]}
|
|
410
|
-
title={`Banner ${i + 1}`}
|
|
411
|
-
description={`This is banner number ${i + 1} demonstrating performance with multiple instances`}
|
|
412
|
-
dismissible={i % 2 === 0}
|
|
413
|
-
actions={
|
|
414
|
-
i % 3 === 0 ? [{ label: 'Action', onClick: fn(), variant: 'primary' }] : undefined
|
|
415
|
-
}
|
|
416
|
-
/>
|
|
417
|
-
))}
|
|
418
|
-
</Stack>
|
|
419
|
-
),
|
|
420
|
-
};
|
|
421
|
-
|
|
422
|
-
// Required story exports for validation
|
|
423
|
-
export const AllSizes: Story = {
|
|
424
|
-
render: () => (
|
|
425
|
-
<Stack spacing={2} sx={{ p: 2 }}>
|
|
426
|
-
<Banner variant="info" title="Standard Banner" description="Standard size banner message" />
|
|
427
|
-
<Banner
|
|
428
|
-
variant="success"
|
|
429
|
-
title="Success Banner"
|
|
430
|
-
description="Standard size success message"
|
|
431
|
-
/>
|
|
432
|
-
<Banner
|
|
433
|
-
variant="warning"
|
|
434
|
-
title="Warning Banner"
|
|
435
|
-
description="Standard size warning message"
|
|
436
|
-
/>
|
|
437
|
-
</Stack>
|
|
438
|
-
),
|
|
439
|
-
};
|
|
440
|
-
|
|
441
|
-
export const AllStates: Story = {
|
|
442
|
-
render: () => (
|
|
443
|
-
<Stack spacing={2} sx={{ p: 2 }}>
|
|
444
|
-
<Banner variant="info" title="Info State" description="Information banner state" />
|
|
445
|
-
<Banner variant="success" title="Success State" description="Success banner state" />
|
|
446
|
-
<Banner variant="warning" title="Warning State" description="Warning banner state" />
|
|
447
|
-
<Banner variant="critical" title="Critical State" description="Critical error banner state" />
|
|
448
|
-
</Stack>
|
|
449
|
-
),
|
|
450
|
-
};
|
|
451
|
-
|
|
452
|
-
export const InteractiveStates: Story = {
|
|
453
|
-
render: () => (
|
|
454
|
-
<Stack spacing={2} sx={{ p: 2 }}>
|
|
455
|
-
<Banner variant="info" title="Standard Banner" description="Non-interactive banner" />
|
|
456
|
-
<Banner
|
|
457
|
-
variant="success"
|
|
458
|
-
title="Dismissible Banner"
|
|
459
|
-
description="Click the X to close"
|
|
460
|
-
dismissible
|
|
461
|
-
/>
|
|
462
|
-
<Banner
|
|
463
|
-
variant="warning"
|
|
464
|
-
title="With Actions"
|
|
465
|
-
description="Banner with action buttons"
|
|
466
|
-
actions={[
|
|
467
|
-
{ label: 'Primary', onClick: fn(), variant: 'primary' },
|
|
468
|
-
{ label: 'Secondary', onClick: fn(), variant: 'secondary' },
|
|
469
|
-
]}
|
|
470
|
-
/>
|
|
471
|
-
<Banner
|
|
472
|
-
variant="critical"
|
|
473
|
-
title="Full Interactive"
|
|
474
|
-
description="Dismissible with actions"
|
|
475
|
-
dismissible
|
|
476
|
-
actions={[{ label: 'Fix Now', onClick: fn(), variant: 'primary' }]}
|
|
477
|
-
/>
|
|
478
|
-
</Stack>
|
|
479
|
-
),
|
|
480
|
-
};
|
|
481
|
-
|
|
482
|
-
export const Responsive: Story = {
|
|
483
|
-
render: () => (
|
|
484
|
-
<Box>
|
|
485
|
-
<Stack spacing={2} sx={{ p: 2 }}>
|
|
486
|
-
<Banner
|
|
487
|
-
variant="info"
|
|
488
|
-
title="Responsive Banner"
|
|
489
|
-
description="This banner adapts to different screen sizes and container widths"
|
|
490
|
-
dismissible
|
|
491
|
-
actions={[
|
|
492
|
-
{ label: 'Action One', onClick: fn(), variant: 'primary' },
|
|
493
|
-
{ label: 'Action Two', onClick: fn(), variant: 'secondary' },
|
|
494
|
-
]}
|
|
495
|
-
/>
|
|
496
|
-
<Box sx={{ maxWidth: 600 }}>
|
|
497
|
-
<Banner
|
|
498
|
-
variant="success"
|
|
499
|
-
title="Medium Container"
|
|
500
|
-
description="Banner in a medium-width container"
|
|
501
|
-
dismissible
|
|
502
|
-
actions={[{ label: 'Action', onClick: fn(), variant: 'primary' }]}
|
|
503
|
-
/>
|
|
504
|
-
</Box>
|
|
505
|
-
<Box sx={{ maxWidth: 400 }}>
|
|
506
|
-
<Banner
|
|
507
|
-
variant="warning"
|
|
508
|
-
title="Narrow Container"
|
|
509
|
-
description="Banner in a narrow container adapts layout for mobile"
|
|
510
|
-
dismissible
|
|
511
|
-
/>
|
|
512
|
-
</Box>
|
|
513
|
-
<Box sx={{ maxWidth: 300 }}>
|
|
514
|
-
<Banner
|
|
515
|
-
variant="critical"
|
|
516
|
-
title="Very Narrow"
|
|
517
|
-
description="Actions stack on mobile"
|
|
518
|
-
actions={[
|
|
519
|
-
{ label: 'Fix', onClick: fn(), variant: 'primary' },
|
|
520
|
-
{ label: 'Later', onClick: fn(), variant: 'secondary' },
|
|
521
|
-
]}
|
|
522
|
-
dismissible
|
|
523
|
-
/>
|
|
524
|
-
</Box>
|
|
525
|
-
</Stack>
|
|
526
|
-
</Box>
|
|
527
|
-
),
|
|
528
|
-
};
|