@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,765 +0,0 @@
|
|
|
1
|
-
import CloseIcon from '@mui/icons-material/Close';
|
|
2
|
-
import { Box, Button, IconButton,Typography } from '@mui/material';
|
|
3
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
4
|
-
import { useState } from 'react';
|
|
5
|
-
|
|
6
|
-
import { Modal, ModalContent } from './Modal';
|
|
7
|
-
|
|
8
|
-
const meta: Meta<typeof Modal> = {
|
|
9
|
-
title: 'Feedback/Modal',
|
|
10
|
-
component: Modal,
|
|
11
|
-
tags: ['autodocs', 'component:Modal'],
|
|
12
|
-
parameters: {
|
|
13
|
-
layout: 'centered',
|
|
14
|
-
docs: {
|
|
15
|
-
description: {
|
|
16
|
-
component: 'A flexible modal component with beautiful animations and glass morphism effects.',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
argTypes: {
|
|
21
|
-
variant: {
|
|
22
|
-
control: 'select',
|
|
23
|
-
options: ['center', 'top', 'bottom', 'glass'],
|
|
24
|
-
description: 'Position and style variant of the modal',
|
|
25
|
-
},
|
|
26
|
-
size: {
|
|
27
|
-
control: 'select',
|
|
28
|
-
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
29
|
-
description: 'Size of the modal',
|
|
30
|
-
},
|
|
31
|
-
glass: {
|
|
32
|
-
control: 'boolean',
|
|
33
|
-
description: 'Enable glass morphism effect',
|
|
34
|
-
},
|
|
35
|
-
gradient: {
|
|
36
|
-
control: 'boolean',
|
|
37
|
-
description: 'Enable gradient background',
|
|
38
|
-
},
|
|
39
|
-
glow: {
|
|
40
|
-
control: 'boolean',
|
|
41
|
-
description: 'Enable glow effect',
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export default meta;
|
|
47
|
-
type Story = StoryObj<typeof Modal>;
|
|
48
|
-
|
|
49
|
-
interface ModalWrapperProps {
|
|
50
|
-
children: React.ReactNode;
|
|
51
|
-
[key: string]: unknown;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const ModalWrapper = ({ children, ...args }: ModalWrapperProps) => {
|
|
55
|
-
const [open, setOpen] = useState(false);
|
|
56
|
-
|
|
57
|
-
return (
|
|
58
|
-
<Box>
|
|
59
|
-
<Button variant="contained" onClick={() => setOpen(true)}>
|
|
60
|
-
Open Modal
|
|
61
|
-
</Button>
|
|
62
|
-
<Modal {...args} open={open} onClose={() => setOpen(false)}>
|
|
63
|
-
{children}
|
|
64
|
-
</Modal>
|
|
65
|
-
</Box>
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
// Default story - minimal props
|
|
70
|
-
export const Default: Story = {
|
|
71
|
-
render: (args) => (
|
|
72
|
-
<ModalWrapper {...args}>
|
|
73
|
-
<ModalContent>
|
|
74
|
-
<Typography variant="h6" gutterBottom>
|
|
75
|
-
Default Modal
|
|
76
|
-
</Typography>
|
|
77
|
-
<Typography paragraph>
|
|
78
|
-
This is a default modal with minimal props.
|
|
79
|
-
</Typography>
|
|
80
|
-
<Button variant="contained">Close</Button>
|
|
81
|
-
</ModalContent>
|
|
82
|
-
</ModalWrapper>
|
|
83
|
-
),
|
|
84
|
-
args: {
|
|
85
|
-
variant: 'center',
|
|
86
|
-
size: 'md',
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
export const Center: Story = {
|
|
91
|
-
render: (args) => (
|
|
92
|
-
<ModalWrapper {...args}>
|
|
93
|
-
<ModalContent>
|
|
94
|
-
<Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', mb: 2 }}>
|
|
95
|
-
<Typography variant="h6">
|
|
96
|
-
Center Modal
|
|
97
|
-
</Typography>
|
|
98
|
-
<IconButton onClick={() => { /** do nothing */}}>
|
|
99
|
-
<CloseIcon />
|
|
100
|
-
</IconButton>
|
|
101
|
-
</Box>
|
|
102
|
-
<Typography paragraph>
|
|
103
|
-
This modal appears in the center of the screen with a smooth fade animation.
|
|
104
|
-
Perfect for confirmations, forms, or any content that needs focus.
|
|
105
|
-
</Typography>
|
|
106
|
-
<Box sx={{ mt: 3, display: 'flex', gap: 2, justifyContent: 'flex-end' }}>
|
|
107
|
-
<Button>Cancel</Button>
|
|
108
|
-
<Button variant="contained">Confirm</Button>
|
|
109
|
-
</Box>
|
|
110
|
-
</ModalContent>
|
|
111
|
-
</ModalWrapper>
|
|
112
|
-
),
|
|
113
|
-
args: {
|
|
114
|
-
variant: 'center',
|
|
115
|
-
size: 'md',
|
|
116
|
-
},
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
export const TopSlide: Story = {
|
|
120
|
-
render: (args) => (
|
|
121
|
-
<ModalWrapper {...args}>
|
|
122
|
-
<ModalContent>
|
|
123
|
-
<Box sx={{ textAlign: 'center', py: 2 }}>
|
|
124
|
-
<Typography variant="h6" gutterBottom>
|
|
125
|
-
Top Slide Modal
|
|
126
|
-
</Typography>
|
|
127
|
-
<Typography paragraph>
|
|
128
|
-
This modal slides down from the top, creating an elegant entrance animation.
|
|
129
|
-
Great for notifications or announcements.
|
|
130
|
-
</Typography>
|
|
131
|
-
<Button variant="contained">
|
|
132
|
-
Got it
|
|
133
|
-
</Button>
|
|
134
|
-
</Box>
|
|
135
|
-
</ModalContent>
|
|
136
|
-
</ModalWrapper>
|
|
137
|
-
),
|
|
138
|
-
args: {
|
|
139
|
-
variant: 'top',
|
|
140
|
-
size: 'sm',
|
|
141
|
-
},
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
export const BottomSlide: Story = {
|
|
145
|
-
render: (args) => (
|
|
146
|
-
<ModalWrapper {...args}>
|
|
147
|
-
<ModalContent>
|
|
148
|
-
<Box sx={{ py: 2 }}>
|
|
149
|
-
<Typography variant="h6" gutterBottom>
|
|
150
|
-
Bottom Slide Modal
|
|
151
|
-
</Typography>
|
|
152
|
-
<Typography paragraph>
|
|
153
|
-
This modal slides up from the bottom, similar to mobile app sheets.
|
|
154
|
-
Ideal for mobile-first designs and quick actions.
|
|
155
|
-
</Typography>
|
|
156
|
-
<Box sx={{ display: 'flex', gap: 2, mt: 3 }}>
|
|
157
|
-
<Button fullWidth>Cancel</Button>
|
|
158
|
-
<Button variant="contained" fullWidth>Continue</Button>
|
|
159
|
-
</Box>
|
|
160
|
-
</Box>
|
|
161
|
-
</ModalContent>
|
|
162
|
-
</ModalWrapper>
|
|
163
|
-
),
|
|
164
|
-
args: {
|
|
165
|
-
variant: 'bottom',
|
|
166
|
-
size: 'md',
|
|
167
|
-
},
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
export const GlassEffect: Story = {
|
|
171
|
-
render: (args) => (
|
|
172
|
-
<Box sx={{
|
|
173
|
-
minHeight: '400px',
|
|
174
|
-
background: 'linear-gradient(45deg, #1976d2 30%, #21cbf3 90%)',
|
|
175
|
-
p: 4,
|
|
176
|
-
borderRadius: 2,
|
|
177
|
-
}}>
|
|
178
|
-
<ModalWrapper {...args}>
|
|
179
|
-
<ModalContent padding={4}>
|
|
180
|
-
<Typography variant="h5" gutterBottom sx={{ fontWeight: 600 }}>
|
|
181
|
-
Glass Morphism Modal
|
|
182
|
-
</Typography>
|
|
183
|
-
<Typography paragraph sx={{ opacity: 0.9 }}>
|
|
184
|
-
Experience the beauty of glass morphism with backdrop blur effects
|
|
185
|
-
and translucent surfaces. This creates depth and modern aesthetics.
|
|
186
|
-
</Typography>
|
|
187
|
-
<Box sx={{
|
|
188
|
-
p: 2,
|
|
189
|
-
bgcolor: 'rgba(255,255,255,0.1)',
|
|
190
|
-
borderRadius: 1,
|
|
191
|
-
backdropFilter: 'blur(10px)',
|
|
192
|
-
mb: 3,
|
|
193
|
-
}}>
|
|
194
|
-
<Typography variant="body2">
|
|
195
|
-
Even nested glass elements work perfectly with proper layering.
|
|
196
|
-
</Typography>
|
|
197
|
-
</Box>
|
|
198
|
-
<Box sx={{ display: 'flex', gap: 2 }}>
|
|
199
|
-
<Button sx={{ backdropFilter: 'blur(10px)', bgcolor: 'rgba(255,255,255,0.2)' }}>
|
|
200
|
-
Cancel
|
|
201
|
-
</Button>
|
|
202
|
-
<Button variant="contained">
|
|
203
|
-
Continue
|
|
204
|
-
</Button>
|
|
205
|
-
</Box>
|
|
206
|
-
</ModalContent>
|
|
207
|
-
</ModalWrapper>
|
|
208
|
-
</Box>
|
|
209
|
-
),
|
|
210
|
-
args: {
|
|
211
|
-
variant: 'glass',
|
|
212
|
-
size: 'lg',
|
|
213
|
-
glow: true,
|
|
214
|
-
},
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
export const GradientGlow: Story = {
|
|
218
|
-
render: (args) => (
|
|
219
|
-
<Box sx={{ bgcolor: 'grey.900', p: 4, borderRadius: 2 }}>
|
|
220
|
-
<ModalWrapper {...args}>
|
|
221
|
-
<ModalContent padding={4}>
|
|
222
|
-
<Typography variant="h5" gutterBottom sx={{ fontWeight: 600 }}>
|
|
223
|
-
Premium Feature
|
|
224
|
-
</Typography>
|
|
225
|
-
<Typography paragraph>
|
|
226
|
-
This modal showcases gradient backgrounds with glow effects,
|
|
227
|
-
perfect for premium features, upgrades, or special announcements.
|
|
228
|
-
</Typography>
|
|
229
|
-
<Box sx={{
|
|
230
|
-
display: 'flex',
|
|
231
|
-
alignItems: 'center',
|
|
232
|
-
gap: 2,
|
|
233
|
-
p: 2,
|
|
234
|
-
bgcolor: 'rgba(255,255,255,0.05)',
|
|
235
|
-
borderRadius: 1,
|
|
236
|
-
mb: 3,
|
|
237
|
-
}}>
|
|
238
|
-
<Typography variant="h6">✨</Typography>
|
|
239
|
-
<Typography>
|
|
240
|
-
Unlock advanced features with Pro
|
|
241
|
-
</Typography>
|
|
242
|
-
</Box>
|
|
243
|
-
<Box sx={{ display: 'flex', gap: 2 }}>
|
|
244
|
-
<Button>Maybe Later</Button>
|
|
245
|
-
<Button variant="contained" sx={{
|
|
246
|
-
background: 'linear-gradient(45deg, #ff6b6b, #ffd93d)',
|
|
247
|
-
'&:hover': {
|
|
248
|
-
background: 'linear-gradient(45deg, #ff5252, #ffcc02)',
|
|
249
|
-
}
|
|
250
|
-
}}>
|
|
251
|
-
Upgrade Now
|
|
252
|
-
</Button>
|
|
253
|
-
</Box>
|
|
254
|
-
</ModalContent>
|
|
255
|
-
</ModalWrapper>
|
|
256
|
-
</Box>
|
|
257
|
-
),
|
|
258
|
-
args: {
|
|
259
|
-
variant: 'center',
|
|
260
|
-
gradient: true,
|
|
261
|
-
glow: true,
|
|
262
|
-
size: 'md',
|
|
263
|
-
},
|
|
264
|
-
};
|
|
265
|
-
|
|
266
|
-
const ResponsiveSizesComponent = () => {
|
|
267
|
-
const sizes = ['xs', 'sm', 'md', 'lg', 'xl'] as const;
|
|
268
|
-
const [openStates, setOpenStates] = useState<Record<string, boolean>>({});
|
|
269
|
-
|
|
270
|
-
return (
|
|
271
|
-
<Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap' }}>
|
|
272
|
-
{sizes.map(size => (
|
|
273
|
-
<Box key={size}>
|
|
274
|
-
<Button
|
|
275
|
-
variant="outlined"
|
|
276
|
-
onClick={() => setOpenStates(prev => ({ ...prev, [size]: true }))}
|
|
277
|
-
>
|
|
278
|
-
{size.toUpperCase()}
|
|
279
|
-
</Button>
|
|
280
|
-
<Modal
|
|
281
|
-
open={openStates[size] || false}
|
|
282
|
-
onClose={() => setOpenStates(prev => ({ ...prev, [size]: false }))}
|
|
283
|
-
variant="center"
|
|
284
|
-
size={size}
|
|
285
|
-
glass={true}
|
|
286
|
-
>
|
|
287
|
-
<ModalContent>
|
|
288
|
-
<Typography variant="h6" gutterBottom>
|
|
289
|
-
Size: {size.toUpperCase()}
|
|
290
|
-
</Typography>
|
|
291
|
-
<Typography>
|
|
292
|
-
This demonstrates the {size} size modal with responsive behavior
|
|
293
|
-
and glass morphism effects.
|
|
294
|
-
</Typography>
|
|
295
|
-
<Box sx={{ mt: 2 }}>
|
|
296
|
-
<Button
|
|
297
|
-
onClick={() => setOpenStates(prev => ({ ...prev, [size]: false }))}
|
|
298
|
-
fullWidth
|
|
299
|
-
variant="contained"
|
|
300
|
-
>
|
|
301
|
-
Close
|
|
302
|
-
</Button>
|
|
303
|
-
</Box>
|
|
304
|
-
</ModalContent>
|
|
305
|
-
</Modal>
|
|
306
|
-
</Box>
|
|
307
|
-
))}
|
|
308
|
-
</Box>
|
|
309
|
-
);
|
|
310
|
-
};
|
|
311
|
-
|
|
312
|
-
export const ResponsiveSizes: Story = {
|
|
313
|
-
render: () => <ResponsiveSizesComponent />,
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
// AllSizes story - showing all size variations
|
|
317
|
-
const AllSizesComponent = () => {
|
|
318
|
-
const sizes = ['xs', 'sm', 'md', 'lg', 'xl'] as const;
|
|
319
|
-
const [openStates, setOpenStates] = useState<Record<string, boolean>>({});
|
|
320
|
-
|
|
321
|
-
return (
|
|
322
|
-
<Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap' }}>
|
|
323
|
-
{sizes.map(size => (
|
|
324
|
-
<Box key={size}>
|
|
325
|
-
<Button
|
|
326
|
-
variant="outlined"
|
|
327
|
-
onClick={() => setOpenStates(prev => ({ ...prev, [size]: true }))}
|
|
328
|
-
>
|
|
329
|
-
Size: {size.toUpperCase()}
|
|
330
|
-
</Button>
|
|
331
|
-
<Modal
|
|
332
|
-
open={openStates[size] || false}
|
|
333
|
-
onClose={() => setOpenStates(prev => ({ ...prev, [size]: false }))}
|
|
334
|
-
variant="center"
|
|
335
|
-
size={size}
|
|
336
|
-
>
|
|
337
|
-
<ModalContent>
|
|
338
|
-
<Typography variant="h6" gutterBottom>
|
|
339
|
-
Size: {size.toUpperCase()}
|
|
340
|
-
</Typography>
|
|
341
|
-
<Typography>
|
|
342
|
-
This modal demonstrates the {size} size.
|
|
343
|
-
</Typography>
|
|
344
|
-
<Box sx={{ mt: 2 }}>
|
|
345
|
-
<Button
|
|
346
|
-
onClick={() => setOpenStates(prev => ({ ...prev, [size]: false }))}
|
|
347
|
-
fullWidth
|
|
348
|
-
variant="contained"
|
|
349
|
-
>
|
|
350
|
-
Close
|
|
351
|
-
</Button>
|
|
352
|
-
</Box>
|
|
353
|
-
</ModalContent>
|
|
354
|
-
</Modal>
|
|
355
|
-
</Box>
|
|
356
|
-
))}
|
|
357
|
-
</Box>
|
|
358
|
-
);
|
|
359
|
-
};
|
|
360
|
-
|
|
361
|
-
export const AllSizes: Story = {
|
|
362
|
-
render: () => <AllSizesComponent />,
|
|
363
|
-
};
|
|
364
|
-
|
|
365
|
-
// AllStates story - showing all modal states
|
|
366
|
-
const AllStatesComponent = () => {
|
|
367
|
-
const [openStates, setOpenStates] = useState<Record<string, boolean>>({});
|
|
368
|
-
const states = [
|
|
369
|
-
{ name: 'normal', props: {} },
|
|
370
|
-
{ name: 'glass', props: { glass: true } },
|
|
371
|
-
{ name: 'gradient', props: { gradient: true } },
|
|
372
|
-
{ name: 'glow', props: { glow: true } },
|
|
373
|
-
{ name: 'persistent', props: { persistent: true } },
|
|
374
|
-
];
|
|
375
|
-
|
|
376
|
-
return (
|
|
377
|
-
<Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap' }}>
|
|
378
|
-
{states.map(state => (
|
|
379
|
-
<Box key={state.name}>
|
|
380
|
-
<Button
|
|
381
|
-
variant="contained"
|
|
382
|
-
onClick={() => setOpenStates(prev => ({ ...prev, [state.name]: true }))}
|
|
383
|
-
>
|
|
384
|
-
{state.name.charAt(0).toUpperCase() + state.name.slice(1)} State
|
|
385
|
-
</Button>
|
|
386
|
-
<Modal
|
|
387
|
-
open={openStates[state.name] || false}
|
|
388
|
-
onClose={() => setOpenStates(prev => ({ ...prev, [state.name]: false }))}
|
|
389
|
-
variant="center"
|
|
390
|
-
size="md"
|
|
391
|
-
{...state.props}
|
|
392
|
-
>
|
|
393
|
-
<ModalContent>
|
|
394
|
-
<Typography variant="h6" gutterBottom>
|
|
395
|
-
{state.name.charAt(0).toUpperCase() + state.name.slice(1)} State
|
|
396
|
-
</Typography>
|
|
397
|
-
<Typography>
|
|
398
|
-
This demonstrates the {state.name} state of the modal.
|
|
399
|
-
</Typography>
|
|
400
|
-
<Button
|
|
401
|
-
onClick={() => setOpenStates(prev => ({ ...prev, [state.name]: false }))}
|
|
402
|
-
variant="contained"
|
|
403
|
-
fullWidth
|
|
404
|
-
sx={{ mt: 2 }}
|
|
405
|
-
>
|
|
406
|
-
Close
|
|
407
|
-
</Button>
|
|
408
|
-
</ModalContent>
|
|
409
|
-
</Modal>
|
|
410
|
-
</Box>
|
|
411
|
-
))}
|
|
412
|
-
</Box>
|
|
413
|
-
);
|
|
414
|
-
};
|
|
415
|
-
|
|
416
|
-
export const AllStates: Story = {
|
|
417
|
-
render: () => <AllStatesComponent />,
|
|
418
|
-
};
|
|
419
|
-
|
|
420
|
-
// InteractiveStates story - showing interactive behaviors
|
|
421
|
-
const InteractiveStatesComponent = () => {
|
|
422
|
-
const [openStates, setOpenStates] = useState<Record<string, boolean>>({});
|
|
423
|
-
const interactions = [
|
|
424
|
-
{ name: 'hover-effects', label: 'Hover Effects', props: { glow: true } },
|
|
425
|
-
{ name: 'click-outside', label: 'Click Outside to Close', props: {} },
|
|
426
|
-
{ name: 'escape-key', label: 'Escape Key to Close', props: {} },
|
|
427
|
-
{ name: 'persistent-no-close', label: 'Persistent (No Close)', props: { persistent: true } },
|
|
428
|
-
];
|
|
429
|
-
|
|
430
|
-
return (
|
|
431
|
-
<Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap' }}>
|
|
432
|
-
{interactions.map(interaction => (
|
|
433
|
-
<Box key={interaction.name}>
|
|
434
|
-
<Button
|
|
435
|
-
variant="outlined"
|
|
436
|
-
onClick={() => setOpenStates(prev => ({ ...prev, [interaction.name]: true }))}
|
|
437
|
-
>
|
|
438
|
-
{interaction.label}
|
|
439
|
-
</Button>
|
|
440
|
-
<Modal
|
|
441
|
-
open={openStates[interaction.name] || false}
|
|
442
|
-
onClose={() => setOpenStates(prev => ({ ...prev, [interaction.name]: false }))}
|
|
443
|
-
variant="center"
|
|
444
|
-
size="md"
|
|
445
|
-
{...interaction.props}
|
|
446
|
-
>
|
|
447
|
-
<ModalContent>
|
|
448
|
-
<Typography variant="h6" gutterBottom>
|
|
449
|
-
{interaction.label}
|
|
450
|
-
</Typography>
|
|
451
|
-
<Typography>
|
|
452
|
-
Test the {interaction.label.toLowerCase()} behavior of this modal.
|
|
453
|
-
</Typography>
|
|
454
|
-
<Button
|
|
455
|
-
onClick={() => setOpenStates(prev => ({ ...prev, [interaction.name]: false }))}
|
|
456
|
-
variant="contained"
|
|
457
|
-
fullWidth
|
|
458
|
-
sx={{ mt: 2 }}
|
|
459
|
-
>
|
|
460
|
-
Close Modal
|
|
461
|
-
</Button>
|
|
462
|
-
</ModalContent>
|
|
463
|
-
</Modal>
|
|
464
|
-
</Box>
|
|
465
|
-
))}
|
|
466
|
-
</Box>
|
|
467
|
-
);
|
|
468
|
-
};
|
|
469
|
-
|
|
470
|
-
export const InteractiveStates: Story = {
|
|
471
|
-
render: () => <InteractiveStatesComponent />,
|
|
472
|
-
};
|
|
473
|
-
|
|
474
|
-
// Responsive story - showing responsive behavior
|
|
475
|
-
const ResponsiveComponent = () => {
|
|
476
|
-
const [open, setOpen] = useState(false);
|
|
477
|
-
|
|
478
|
-
return (
|
|
479
|
-
<Box>
|
|
480
|
-
<Typography variant="body2" sx={{ mb: 2 }}>
|
|
481
|
-
This modal adapts to different screen sizes. Try resizing your browser window.
|
|
482
|
-
</Typography>
|
|
483
|
-
<Button variant="contained" onClick={() => setOpen(true)}>
|
|
484
|
-
Open Responsive Modal
|
|
485
|
-
</Button>
|
|
486
|
-
<Modal
|
|
487
|
-
open={open}
|
|
488
|
-
onClose={() => setOpen(false)}
|
|
489
|
-
variant="center"
|
|
490
|
-
size="lg"
|
|
491
|
-
>
|
|
492
|
-
<ModalContent>
|
|
493
|
-
<Typography variant="h5" gutterBottom>
|
|
494
|
-
Responsive Modal
|
|
495
|
-
</Typography>
|
|
496
|
-
<Typography paragraph>
|
|
497
|
-
This modal is responsive and adapts to different screen sizes.
|
|
498
|
-
On mobile devices, it takes most of the screen width.
|
|
499
|
-
On tablets and desktops, it maintains a comfortable reading width.
|
|
500
|
-
</Typography>
|
|
501
|
-
<Box sx={{
|
|
502
|
-
display: 'grid',
|
|
503
|
-
gridTemplateColumns: { xs: '1fr', sm: '1fr 1fr', md: '1fr 1fr 1fr' },
|
|
504
|
-
gap: 2,
|
|
505
|
-
mb: 3
|
|
506
|
-
}}>
|
|
507
|
-
<Box sx={{ p: 2, bgcolor: 'background.paper', borderRadius: 1 }}>
|
|
508
|
-
<Typography variant="body2">Mobile</Typography>
|
|
509
|
-
</Box>
|
|
510
|
-
<Box sx={{ p: 2, bgcolor: 'background.paper', borderRadius: 1 }}>
|
|
511
|
-
<Typography variant="body2">Tablet</Typography>
|
|
512
|
-
</Box>
|
|
513
|
-
<Box sx={{ p: 2, bgcolor: 'background.paper', borderRadius: 1 }}>
|
|
514
|
-
<Typography variant="body2">Desktop</Typography>
|
|
515
|
-
</Box>
|
|
516
|
-
</Box>
|
|
517
|
-
<Button
|
|
518
|
-
onClick={() => setOpen(false)}
|
|
519
|
-
variant="contained"
|
|
520
|
-
fullWidth
|
|
521
|
-
>
|
|
522
|
-
Close
|
|
523
|
-
</Button>
|
|
524
|
-
</ModalContent>
|
|
525
|
-
</Modal>
|
|
526
|
-
</Box>
|
|
527
|
-
);
|
|
528
|
-
};
|
|
529
|
-
|
|
530
|
-
export const Responsive: Story = {
|
|
531
|
-
render: () => <ResponsiveComponent />,
|
|
532
|
-
parameters: {
|
|
533
|
-
viewport: {
|
|
534
|
-
viewports: {
|
|
535
|
-
mobile: { name: 'Mobile', styles: { width: '360px', height: '640px' } },
|
|
536
|
-
tablet: { name: 'Tablet', styles: { width: '768px', height: '1024px' } },
|
|
537
|
-
desktop: { name: 'Desktop', styles: { width: '1920px', height: '1080px' } },
|
|
538
|
-
},
|
|
539
|
-
},
|
|
540
|
-
},
|
|
541
|
-
};
|
|
542
|
-
|
|
543
|
-
// Enhanced story for all variants
|
|
544
|
-
const AllVariantsComponent = () => {
|
|
545
|
-
const variants = ['center', 'top', 'bottom', 'glass'] as const;
|
|
546
|
-
const [openStates, setOpenStates] = useState<Record<string, boolean>>({});
|
|
547
|
-
|
|
548
|
-
return (
|
|
549
|
-
<Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap' }}>
|
|
550
|
-
{variants.map(variant => (
|
|
551
|
-
<Box key={variant}>
|
|
552
|
-
<Button
|
|
553
|
-
variant="contained"
|
|
554
|
-
color={variant === 'glass' ? 'secondary' : 'primary'}
|
|
555
|
-
onClick={() => setOpenStates(prev => ({ ...prev, [variant]: true }))}
|
|
556
|
-
>
|
|
557
|
-
{variant.charAt(0).toUpperCase() + variant.slice(1)} Modal
|
|
558
|
-
</Button>
|
|
559
|
-
<Modal
|
|
560
|
-
open={openStates[variant] || false}
|
|
561
|
-
onClose={() => setOpenStates(prev => ({ ...prev, [variant]: false }))}
|
|
562
|
-
variant={variant}
|
|
563
|
-
size="md"
|
|
564
|
-
glass={variant === 'glass'}
|
|
565
|
-
glow={variant === 'glass'}
|
|
566
|
-
>
|
|
567
|
-
<ModalContent>
|
|
568
|
-
<Typography variant="h6" gutterBottom>
|
|
569
|
-
{variant.charAt(0).toUpperCase() + variant.slice(1)} Variant
|
|
570
|
-
</Typography>
|
|
571
|
-
<Typography paragraph>
|
|
572
|
-
This demonstrates the {variant} variant with appropriate animations and styling.
|
|
573
|
-
</Typography>
|
|
574
|
-
<Button
|
|
575
|
-
onClick={() => setOpenStates(prev => ({ ...prev, [variant]: false }))}
|
|
576
|
-
variant="contained"
|
|
577
|
-
fullWidth
|
|
578
|
-
>
|
|
579
|
-
Close
|
|
580
|
-
</Button>
|
|
581
|
-
</ModalContent>
|
|
582
|
-
</Modal>
|
|
583
|
-
</Box>
|
|
584
|
-
))}
|
|
585
|
-
</Box>
|
|
586
|
-
);
|
|
587
|
-
};
|
|
588
|
-
|
|
589
|
-
export const AllVariants: Story = {
|
|
590
|
-
render: () => <AllVariantsComponent />,
|
|
591
|
-
|
|
592
|
-
};
|
|
593
|
-
|
|
594
|
-
// Story for testing all border radius options
|
|
595
|
-
const BorderRadiusVariationsComponent = () => {
|
|
596
|
-
const borderRadii = ['none', 'sm', 'md', 'lg', 'xl'] as const;
|
|
597
|
-
const [openStates, setOpenStates] = useState<Record<string, boolean>>({});
|
|
598
|
-
|
|
599
|
-
return (
|
|
600
|
-
<Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap' }}>
|
|
601
|
-
{borderRadii.map(radius => (
|
|
602
|
-
<Box key={radius}>
|
|
603
|
-
<Button
|
|
604
|
-
variant="outlined"
|
|
605
|
-
onClick={() => setOpenStates(prev => ({ ...prev, [radius]: true }))}
|
|
606
|
-
>
|
|
607
|
-
{radius.toUpperCase()} Radius
|
|
608
|
-
</Button>
|
|
609
|
-
<Modal
|
|
610
|
-
open={openStates[radius] || false}
|
|
611
|
-
onClose={() => setOpenStates(prev => ({ ...prev, [radius]: false }))}
|
|
612
|
-
variant="center"
|
|
613
|
-
size="sm"
|
|
614
|
-
borderRadius={radius}
|
|
615
|
-
glass={true}
|
|
616
|
-
>
|
|
617
|
-
<ModalContent>
|
|
618
|
-
<Typography variant="h6" gutterBottom>
|
|
619
|
-
Border Radius: {radius.toUpperCase()}
|
|
620
|
-
</Typography>
|
|
621
|
-
<Typography paragraph>
|
|
622
|
-
This modal demonstrates the {radius} border radius setting.
|
|
623
|
-
</Typography>
|
|
624
|
-
<Button
|
|
625
|
-
onClick={() => setOpenStates(prev => ({ ...prev, [radius]: false }))}
|
|
626
|
-
variant="contained"
|
|
627
|
-
fullWidth
|
|
628
|
-
>
|
|
629
|
-
Close
|
|
630
|
-
</Button>
|
|
631
|
-
</ModalContent>
|
|
632
|
-
</Modal>
|
|
633
|
-
</Box>
|
|
634
|
-
))}
|
|
635
|
-
</Box>
|
|
636
|
-
);
|
|
637
|
-
};
|
|
638
|
-
|
|
639
|
-
export const BorderRadiusVariations: Story = {
|
|
640
|
-
render: () => <BorderRadiusVariationsComponent />,
|
|
641
|
-
|
|
642
|
-
};
|
|
643
|
-
|
|
644
|
-
// Story for testing special effects
|
|
645
|
-
const SpecialEffectsComponent = () => {
|
|
646
|
-
const effects = [
|
|
647
|
-
{ name: 'Pulse', props: { pulse: true } },
|
|
648
|
-
{ name: 'Glow', props: { glow: true } },
|
|
649
|
-
{ name: 'Gradient', props: { gradient: true } },
|
|
650
|
-
{ name: 'Combined', props: { pulse: true, glow: true, gradient: true } },
|
|
651
|
-
];
|
|
652
|
-
const [openStates, setOpenStates] = useState<Record<string, boolean>>({});
|
|
653
|
-
|
|
654
|
-
return (
|
|
655
|
-
<Box sx={{
|
|
656
|
-
bgcolor: 'grey.900',
|
|
657
|
-
p: 4,
|
|
658
|
-
borderRadius: 2,
|
|
659
|
-
display: 'flex',
|
|
660
|
-
gap: 2,
|
|
661
|
-
flexWrap: 'wrap'
|
|
662
|
-
}}>
|
|
663
|
-
{effects.map(effect => (
|
|
664
|
-
<Box key={effect.name}>
|
|
665
|
-
<Button
|
|
666
|
-
variant="contained"
|
|
667
|
-
color="secondary"
|
|
668
|
-
onClick={() => setOpenStates(prev => ({ ...prev, [effect.name]: true }))}
|
|
669
|
-
>
|
|
670
|
-
{effect.name} Effect
|
|
671
|
-
</Button>
|
|
672
|
-
<Modal
|
|
673
|
-
open={openStates[effect.name] || false}
|
|
674
|
-
onClose={() => setOpenStates(prev => ({ ...prev, [effect.name]: false }))}
|
|
675
|
-
variant="center"
|
|
676
|
-
size="md"
|
|
677
|
-
{...effect.props}
|
|
678
|
-
>
|
|
679
|
-
<ModalContent>
|
|
680
|
-
<Typography variant="h6" gutterBottom>
|
|
681
|
-
{effect.name} Effect Modal
|
|
682
|
-
</Typography>
|
|
683
|
-
<Typography paragraph>
|
|
684
|
-
This modal showcases the {effect.name.toLowerCase()} effect.
|
|
685
|
-
</Typography>
|
|
686
|
-
<Button
|
|
687
|
-
onClick={() => setOpenStates(prev => ({ ...prev, [effect.name]: false }))}
|
|
688
|
-
variant="contained"
|
|
689
|
-
fullWidth
|
|
690
|
-
>
|
|
691
|
-
Close
|
|
692
|
-
</Button>
|
|
693
|
-
</ModalContent>
|
|
694
|
-
</Modal>
|
|
695
|
-
</Box>
|
|
696
|
-
))}
|
|
697
|
-
</Box>
|
|
698
|
-
);
|
|
699
|
-
};
|
|
700
|
-
|
|
701
|
-
export const SpecialEffects: Story = {
|
|
702
|
-
render: () => <SpecialEffectsComponent />,
|
|
703
|
-
|
|
704
|
-
};
|
|
705
|
-
|
|
706
|
-
// Story for testing persistent modals
|
|
707
|
-
const PersistentModalComponent = () => {
|
|
708
|
-
const [open, setOpen] = useState(false);
|
|
709
|
-
const [forceClose, setForceClose] = useState(false);
|
|
710
|
-
|
|
711
|
-
return (
|
|
712
|
-
<Box>
|
|
713
|
-
<Button
|
|
714
|
-
variant="contained"
|
|
715
|
-
color="warning"
|
|
716
|
-
onClick={() => {
|
|
717
|
-
setOpen(true);
|
|
718
|
-
setForceClose(false);
|
|
719
|
-
}}
|
|
720
|
-
>
|
|
721
|
-
Open Persistent Modal
|
|
722
|
-
</Button>
|
|
723
|
-
<Modal
|
|
724
|
-
open={open && !forceClose}
|
|
725
|
-
onClose={() => {
|
|
726
|
-
// This will be ignored due to persistent=true
|
|
727
|
-
// eslint-disable-next-line no-console -- demo output for the Storybook docs page
|
|
728
|
-
console.log('Close attempted but modal is persistent');
|
|
729
|
-
}}
|
|
730
|
-
variant="center"
|
|
731
|
-
size="sm"
|
|
732
|
-
persistent={true}
|
|
733
|
-
glass={true}
|
|
734
|
-
>
|
|
735
|
-
<ModalContent>
|
|
736
|
-
<Box sx={{ textAlign: 'center' }}>
|
|
737
|
-
<Typography variant="h6" gutterBottom color="warning.main">
|
|
738
|
-
⚠️ Persistent Modal
|
|
739
|
-
</Typography>
|
|
740
|
-
<Typography paragraph>
|
|
741
|
-
This modal cannot be closed by clicking the backdrop or pressing Escape.
|
|
742
|
-
You must use the close button.
|
|
743
|
-
</Typography>
|
|
744
|
-
<Typography variant="body2" color="text.secondary" paragraph>
|
|
745
|
-
Try clicking outside or pressing Escape - it won't work!
|
|
746
|
-
</Typography>
|
|
747
|
-
<Button
|
|
748
|
-
variant="contained"
|
|
749
|
-
color="error"
|
|
750
|
-
onClick={() => setForceClose(true)}
|
|
751
|
-
fullWidth
|
|
752
|
-
>
|
|
753
|
-
Force Close
|
|
754
|
-
</Button>
|
|
755
|
-
</Box>
|
|
756
|
-
</ModalContent>
|
|
757
|
-
</Modal>
|
|
758
|
-
</Box>
|
|
759
|
-
);
|
|
760
|
-
};
|
|
761
|
-
|
|
762
|
-
export const PersistentModal: Story = {
|
|
763
|
-
render: () => <PersistentModalComponent />,
|
|
764
|
-
|
|
765
|
-
};
|