@12-apps/ui 1.4.1 → 1.5.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 +17 -8
- 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 -77
- 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 -753
- 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 -503
- package/src/components/data-display/Carousel/Carousel.stories.tsx +0 -607
- package/src/components/data-display/Carousel/Carousel.test.stories.tsx +0 -691
- 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 -1101
- 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 -955
- 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 -975
- 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 -909
- 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 -918
- 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 -750
- 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 -472
- 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 -762
- 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,578 +0,0 @@
|
|
|
1
|
-
import Add from '@mui/icons-material/Add';
|
|
2
|
-
import Check from '@mui/icons-material/Check';
|
|
3
|
-
import Close from '@mui/icons-material/Close';
|
|
4
|
-
import Delete from '@mui/icons-material/Delete';
|
|
5
|
-
import Download from '@mui/icons-material/Download';
|
|
6
|
-
import Edit from '@mui/icons-material/Edit';
|
|
7
|
-
import FileCopy from '@mui/icons-material/FileCopy';
|
|
8
|
-
import Logout from '@mui/icons-material/Logout';
|
|
9
|
-
import MoreVert from '@mui/icons-material/MoreVert';
|
|
10
|
-
import Person from '@mui/icons-material/Person';
|
|
11
|
-
import Print from '@mui/icons-material/Print';
|
|
12
|
-
import Refresh from '@mui/icons-material/Refresh';
|
|
13
|
-
import Remove from '@mui/icons-material/Remove';
|
|
14
|
-
import Save from '@mui/icons-material/Save';
|
|
15
|
-
import Settings from '@mui/icons-material/Settings';
|
|
16
|
-
import Share from '@mui/icons-material/Share';
|
|
17
|
-
import Upload from '@mui/icons-material/Upload';
|
|
18
|
-
import { Box, IconButton } from '@mui/material';
|
|
19
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
20
|
-
|
|
21
|
-
import { Button } from '../../form/Button';
|
|
22
|
-
import { DropdownMenu } from './DropdownMenu';
|
|
23
|
-
|
|
24
|
-
const meta: Meta<typeof DropdownMenu> = {
|
|
25
|
-
title: 'Navigation/DropdownMenu',
|
|
26
|
-
component: DropdownMenu,
|
|
27
|
-
parameters: {
|
|
28
|
-
layout: 'centered',
|
|
29
|
-
docs: {
|
|
30
|
-
description: {
|
|
31
|
-
component:
|
|
32
|
-
'A versatile dropdown menu component with support for icons, shortcuts, dividers, and multiple variants.',
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
tags: ['autodocs', 'component:DropdownMenu'],
|
|
37
|
-
argTypes: {
|
|
38
|
-
variant: {
|
|
39
|
-
control: 'select',
|
|
40
|
-
options: ['default', 'glass', 'minimal'],
|
|
41
|
-
description: 'Visual variant of the dropdown menu',
|
|
42
|
-
},
|
|
43
|
-
size: {
|
|
44
|
-
control: 'select',
|
|
45
|
-
options: ['sm', 'md', 'lg'],
|
|
46
|
-
description: 'Size of the menu items',
|
|
47
|
-
},
|
|
48
|
-
closeOnItemClick: {
|
|
49
|
-
control: 'boolean',
|
|
50
|
-
description: 'Whether to close the menu when an item is clicked',
|
|
51
|
-
},
|
|
52
|
-
showIconSpace: {
|
|
53
|
-
control: 'boolean',
|
|
54
|
-
description: "Whether to reserve space for icons even when items don't have them",
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export default meta;
|
|
60
|
-
type Story = StoryObj<typeof meta>;
|
|
61
|
-
|
|
62
|
-
const basicItems = [
|
|
63
|
-
{ id: '1', label: 'Edit', icon: <Edit fontSize="small" /> },
|
|
64
|
-
{ id: '2', label: 'Duplicate', icon: <FileCopy fontSize="small" /> },
|
|
65
|
-
{ id: '3', label: 'Share', icon: <Share fontSize="small" /> },
|
|
66
|
-
{ id: 'divider1', type: 'divider' as const },
|
|
67
|
-
{ id: '4', label: 'Delete', icon: <Delete fontSize="small" />, color: 'error' as const },
|
|
68
|
-
];
|
|
69
|
-
|
|
70
|
-
const itemsWithShortcuts = [
|
|
71
|
-
{ id: '1', label: 'Save', icon: <Save fontSize="small" />, shortcut: 'Ctrl+S' },
|
|
72
|
-
{ id: '2', label: 'Save As...', icon: <Save fontSize="small" />, shortcut: 'Ctrl+Shift+S' },
|
|
73
|
-
{ id: '3', label: 'Print', icon: <Print fontSize="small" />, shortcut: 'Ctrl+P' },
|
|
74
|
-
{ id: 'divider1', type: 'divider' as const },
|
|
75
|
-
{ id: '4', label: 'Refresh', icon: <Refresh fontSize="small" />, shortcut: 'F5' },
|
|
76
|
-
{ id: '5', label: 'Settings', icon: <Settings fontSize="small" />, shortcut: 'Ctrl+,' },
|
|
77
|
-
];
|
|
78
|
-
|
|
79
|
-
const itemsWithHeaders = [
|
|
80
|
-
{ id: 'header1', type: 'header' as const, label: 'File Operations' },
|
|
81
|
-
{ id: '1', label: 'New File', icon: <Add fontSize="small" />, shortcut: 'Ctrl+N' },
|
|
82
|
-
{ id: '2', label: 'Open File', icon: <Upload fontSize="small" />, shortcut: 'Ctrl+O' },
|
|
83
|
-
{ id: '3', label: 'Save File', icon: <Save fontSize="small" />, shortcut: 'Ctrl+S' },
|
|
84
|
-
{ id: 'divider1', type: 'divider' as const },
|
|
85
|
-
{ id: 'header2', type: 'header' as const, label: 'Edit Operations' },
|
|
86
|
-
{ id: '4', label: 'Cut', shortcut: 'Ctrl+X' },
|
|
87
|
-
{ id: '5', label: 'Copy', shortcut: 'Ctrl+C' },
|
|
88
|
-
{ id: '6', label: 'Paste', shortcut: 'Ctrl+V' },
|
|
89
|
-
];
|
|
90
|
-
|
|
91
|
-
const userMenuItems = [
|
|
92
|
-
{ id: '1', label: 'Profile', icon: <Person fontSize="small" /> },
|
|
93
|
-
{ id: '2', label: 'Settings', icon: <Settings fontSize="small" /> },
|
|
94
|
-
{ id: 'divider1', type: 'divider' as const },
|
|
95
|
-
{ id: '3', label: 'Logout', icon: <Logout fontSize="small" />, color: 'error' as const },
|
|
96
|
-
];
|
|
97
|
-
|
|
98
|
-
const mixedItems = [
|
|
99
|
-
{ id: '1', label: 'Enabled Item', icon: <Check fontSize="small" /> },
|
|
100
|
-
{ id: '2', label: 'Disabled Item', icon: <Close fontSize="small" />, disabled: true },
|
|
101
|
-
{ id: 'divider1', type: 'divider' as const },
|
|
102
|
-
{ id: '3', label: 'Primary Color', color: 'primary' as const },
|
|
103
|
-
{ id: '4', label: 'Success Color', icon: <Check fontSize="small" />, color: 'success' as const },
|
|
104
|
-
{ id: '5', label: 'Warning Color', color: 'warning' as const },
|
|
105
|
-
{ id: '6', label: 'Error Color', icon: <Delete fontSize="small" />, color: 'error' as const },
|
|
106
|
-
];
|
|
107
|
-
|
|
108
|
-
export const Default: Story = {
|
|
109
|
-
args: {
|
|
110
|
-
items: basicItems as never,
|
|
111
|
-
trigger: <Button variant="outline">Open Menu</Button>,
|
|
112
|
-
variant: 'default',
|
|
113
|
-
size: 'md',
|
|
114
|
-
},
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
export const GlassVariant: Story = {
|
|
118
|
-
args: {
|
|
119
|
-
items: basicItems as never,
|
|
120
|
-
trigger: <Button variant="glass">Glass Menu</Button>,
|
|
121
|
-
variant: 'glass',
|
|
122
|
-
size: 'md',
|
|
123
|
-
},
|
|
124
|
-
decorators: [
|
|
125
|
-
(Story) => (
|
|
126
|
-
<Box
|
|
127
|
-
sx={{
|
|
128
|
-
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
129
|
-
minHeight: '400px',
|
|
130
|
-
padding: 4,
|
|
131
|
-
display: 'flex',
|
|
132
|
-
alignItems: 'center',
|
|
133
|
-
justifyContent: 'center',
|
|
134
|
-
borderRadius: 2,
|
|
135
|
-
}}
|
|
136
|
-
>
|
|
137
|
-
<Story />
|
|
138
|
-
</Box>
|
|
139
|
-
),
|
|
140
|
-
],
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
export const MinimalVariant: Story = {
|
|
144
|
-
args: {
|
|
145
|
-
items: basicItems as never,
|
|
146
|
-
trigger: <Button variant="ghost">Minimal Menu</Button>,
|
|
147
|
-
variant: 'minimal',
|
|
148
|
-
size: 'md',
|
|
149
|
-
},
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
export const WithShortcuts: Story = {
|
|
153
|
-
args: {
|
|
154
|
-
items: itemsWithShortcuts as never,
|
|
155
|
-
trigger: <Button variant="solid">File Menu</Button>,
|
|
156
|
-
variant: 'default',
|
|
157
|
-
size: 'md',
|
|
158
|
-
},
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
export const WithHeaders: Story = {
|
|
162
|
-
args: {
|
|
163
|
-
items: itemsWithHeaders as never as never,
|
|
164
|
-
trigger: <Button variant="outline">Operations</Button>,
|
|
165
|
-
variant: 'default',
|
|
166
|
-
size: 'md',
|
|
167
|
-
showIconSpace: true,
|
|
168
|
-
},
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
export const SmallSize: Story = {
|
|
172
|
-
args: {
|
|
173
|
-
items: basicItems as never,
|
|
174
|
-
trigger: (
|
|
175
|
-
<Button size="sm" variant="outline">
|
|
176
|
-
Small Menu
|
|
177
|
-
</Button>
|
|
178
|
-
),
|
|
179
|
-
variant: 'default',
|
|
180
|
-
size: 'sm',
|
|
181
|
-
},
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
export const LargeSize: Story = {
|
|
185
|
-
args: {
|
|
186
|
-
items: basicItems as never,
|
|
187
|
-
trigger: (
|
|
188
|
-
<Button size="lg" variant="outline">
|
|
189
|
-
Large Menu
|
|
190
|
-
</Button>
|
|
191
|
-
),
|
|
192
|
-
variant: 'default',
|
|
193
|
-
size: 'lg',
|
|
194
|
-
},
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
export const UserMenu: Story = {
|
|
198
|
-
args: {
|
|
199
|
-
items: userMenuItems as never,
|
|
200
|
-
trigger: (
|
|
201
|
-
<IconButton>
|
|
202
|
-
<Person />
|
|
203
|
-
</IconButton>
|
|
204
|
-
),
|
|
205
|
-
variant: 'glass',
|
|
206
|
-
size: 'md',
|
|
207
|
-
},
|
|
208
|
-
decorators: [
|
|
209
|
-
(Story) => (
|
|
210
|
-
<Box
|
|
211
|
-
sx={{
|
|
212
|
-
background: 'linear-gradient(45deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%)',
|
|
213
|
-
minHeight: '300px',
|
|
214
|
-
padding: 4,
|
|
215
|
-
display: 'flex',
|
|
216
|
-
alignItems: 'center',
|
|
217
|
-
justifyContent: 'center',
|
|
218
|
-
borderRadius: 2,
|
|
219
|
-
}}
|
|
220
|
-
>
|
|
221
|
-
<Story />
|
|
222
|
-
</Box>
|
|
223
|
-
),
|
|
224
|
-
],
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
export const IconTrigger: Story = {
|
|
228
|
-
args: {
|
|
229
|
-
items: basicItems as never,
|
|
230
|
-
trigger: (
|
|
231
|
-
<IconButton>
|
|
232
|
-
<MoreVert />
|
|
233
|
-
</IconButton>
|
|
234
|
-
),
|
|
235
|
-
variant: 'default',
|
|
236
|
-
size: 'md',
|
|
237
|
-
},
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
export const MixedStates: Story = {
|
|
241
|
-
args: {
|
|
242
|
-
items: mixedItems as never,
|
|
243
|
-
trigger: <Button variant="outline">Mixed Items</Button>,
|
|
244
|
-
variant: 'default',
|
|
245
|
-
size: 'md',
|
|
246
|
-
},
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
export const WithClickHandlers: Story = {
|
|
250
|
-
args: {
|
|
251
|
-
items: basicItems.map((item) => ({
|
|
252
|
-
...item,
|
|
253
|
-
onClick: item.type !== 'divider' ? () => void 0 : undefined,
|
|
254
|
-
})) as never,
|
|
255
|
-
trigger: <Button variant="solid">Interactive Menu</Button>,
|
|
256
|
-
variant: 'default',
|
|
257
|
-
size: 'md',
|
|
258
|
-
},
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
export const NoIcons: Story = {
|
|
262
|
-
args: {
|
|
263
|
-
items: [
|
|
264
|
-
{ id: '1', label: 'Option 1' },
|
|
265
|
-
{ id: '2', label: 'Option 2' },
|
|
266
|
-
{ id: '3', label: 'Option 3' },
|
|
267
|
-
{ id: 'divider1', type: 'divider' as const } as never,
|
|
268
|
-
{ id: '4', label: 'Option 4' },
|
|
269
|
-
],
|
|
270
|
-
trigger: <Button variant="outline">No Icons</Button>,
|
|
271
|
-
variant: 'default',
|
|
272
|
-
size: 'md',
|
|
273
|
-
},
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
export const WithIconSpace: Story = {
|
|
277
|
-
args: {
|
|
278
|
-
items: [
|
|
279
|
-
{ id: '1', label: 'Has Icon', icon: <Check fontSize="small" /> },
|
|
280
|
-
{ id: '2', label: 'No Icon' },
|
|
281
|
-
{ id: '3', label: 'Also No Icon' },
|
|
282
|
-
{ id: '4', label: 'Has Icon Too', icon: <Settings fontSize="small" /> },
|
|
283
|
-
],
|
|
284
|
-
trigger: <Button variant="outline">Mixed Icons</Button>,
|
|
285
|
-
variant: 'default',
|
|
286
|
-
size: 'md',
|
|
287
|
-
showIconSpace: true,
|
|
288
|
-
},
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
// Glass Effect Showcase - Multiple Variants
|
|
292
|
-
export const GlassShowcase: Story = {
|
|
293
|
-
args: {
|
|
294
|
-
items: [],
|
|
295
|
-
trigger: <Button>Dummy</Button>,
|
|
296
|
-
},
|
|
297
|
-
render: () => {
|
|
298
|
-
const showcaseItems = [
|
|
299
|
-
{ id: '1', label: 'Download', icon: <Download fontSize="small" />, shortcut: 'Ctrl+D' },
|
|
300
|
-
{ id: '2', label: 'Share Link', icon: <Share fontSize="small" /> },
|
|
301
|
-
{ id: 'divider1', type: 'divider' as const },
|
|
302
|
-
{ id: '3', label: 'Settings', icon: <Settings fontSize="small" /> },
|
|
303
|
-
{ id: '4', label: 'Remove', icon: <Remove fontSize="small" />, color: 'error' as const },
|
|
304
|
-
];
|
|
305
|
-
|
|
306
|
-
return (
|
|
307
|
-
<Box
|
|
308
|
-
sx={{
|
|
309
|
-
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%)',
|
|
310
|
-
minHeight: '500px',
|
|
311
|
-
padding: 4,
|
|
312
|
-
display: 'flex',
|
|
313
|
-
flexDirection: 'column',
|
|
314
|
-
gap: 3,
|
|
315
|
-
borderRadius: 2,
|
|
316
|
-
}}
|
|
317
|
-
>
|
|
318
|
-
<Box sx={{ color: 'white', textAlign: 'center', mb: 2 }}>
|
|
319
|
-
<h2>Glass Morphism Effect Showcase</h2>
|
|
320
|
-
<p>Click the buttons below to see the glass effect against this colorful background</p>
|
|
321
|
-
</Box>
|
|
322
|
-
<Box
|
|
323
|
-
sx={{
|
|
324
|
-
display: 'flex',
|
|
325
|
-
gap: 3,
|
|
326
|
-
flexWrap: 'wrap',
|
|
327
|
-
justifyContent: 'center',
|
|
328
|
-
}}
|
|
329
|
-
>
|
|
330
|
-
<DropdownMenu
|
|
331
|
-
items={showcaseItems as never}
|
|
332
|
-
trigger={<Button variant="glass">Glass Menu</Button>}
|
|
333
|
-
variant="glass"
|
|
334
|
-
size="md"
|
|
335
|
-
/>
|
|
336
|
-
<DropdownMenu
|
|
337
|
-
items={showcaseItems as never}
|
|
338
|
-
trigger={<Button variant="solid">Compare: Default</Button>}
|
|
339
|
-
variant="default"
|
|
340
|
-
size="md"
|
|
341
|
-
/>
|
|
342
|
-
<DropdownMenu
|
|
343
|
-
items={showcaseItems as never}
|
|
344
|
-
trigger={<Button variant="outline">Compare: Minimal</Button>}
|
|
345
|
-
variant="minimal"
|
|
346
|
-
size="md"
|
|
347
|
-
/>
|
|
348
|
-
</Box>
|
|
349
|
-
{/* Add some background elements to enhance the glass effect */}
|
|
350
|
-
<Box
|
|
351
|
-
sx={{
|
|
352
|
-
position: 'absolute',
|
|
353
|
-
top: '20%',
|
|
354
|
-
left: '10%',
|
|
355
|
-
width: 100,
|
|
356
|
-
height: 100,
|
|
357
|
-
borderRadius: '50%',
|
|
358
|
-
background: 'rgba(255, 255, 255, 0.1)',
|
|
359
|
-
backdropFilter: 'blur(10px)',
|
|
360
|
-
}}
|
|
361
|
-
/>
|
|
362
|
-
<Box
|
|
363
|
-
sx={{
|
|
364
|
-
position: 'absolute',
|
|
365
|
-
bottom: '30%',
|
|
366
|
-
right: '15%',
|
|
367
|
-
width: 150,
|
|
368
|
-
height: 80,
|
|
369
|
-
borderRadius: 2,
|
|
370
|
-
background: 'rgba(255, 255, 255, 0.05)',
|
|
371
|
-
backdropFilter: 'blur(5px)',
|
|
372
|
-
}}
|
|
373
|
-
/>
|
|
374
|
-
</Box>
|
|
375
|
-
);
|
|
376
|
-
},
|
|
377
|
-
parameters: {
|
|
378
|
-
docs: {
|
|
379
|
-
description: {
|
|
380
|
-
story:
|
|
381
|
-
'Demonstrates the glass morphism effect with enhanced backdrop blur, transparency, and subtle borders against colorful backgrounds.',
|
|
382
|
-
},
|
|
383
|
-
},
|
|
384
|
-
},
|
|
385
|
-
};
|
|
386
|
-
|
|
387
|
-
export const LongMenu: Story = {
|
|
388
|
-
args: {
|
|
389
|
-
items: Array.from({ length: 20 }, (_, i) => ({
|
|
390
|
-
id: `item-${i}`,
|
|
391
|
-
label: `Option ${i + 1}`,
|
|
392
|
-
icon: i % 3 === 0 ? <Check fontSize="small" /> : undefined,
|
|
393
|
-
})),
|
|
394
|
-
trigger: <Button variant="outline">Long List</Button>,
|
|
395
|
-
variant: 'default',
|
|
396
|
-
size: 'md',
|
|
397
|
-
maxHeight: 300,
|
|
398
|
-
},
|
|
399
|
-
};
|
|
400
|
-
|
|
401
|
-
// Dark Mode Glass Effect
|
|
402
|
-
export const DarkModeGlass: Story = {
|
|
403
|
-
args: {
|
|
404
|
-
items: [
|
|
405
|
-
{ id: '1', label: 'New Document', icon: <Add fontSize="small" />, shortcut: 'Ctrl+N' },
|
|
406
|
-
{ id: '2', label: 'Open Recent', icon: <Upload fontSize="small" /> },
|
|
407
|
-
{ id: 'divider1', type: 'divider' as const } as never,
|
|
408
|
-
{ id: '3', label: 'Export PDF', icon: <Download fontSize="small" /> },
|
|
409
|
-
{ id: '4', label: 'Print', icon: <Print fontSize="small" />, shortcut: 'Ctrl+P' },
|
|
410
|
-
],
|
|
411
|
-
trigger: <Button variant="glass">Dark Glass Menu</Button>,
|
|
412
|
-
variant: 'glass',
|
|
413
|
-
size: 'md',
|
|
414
|
-
},
|
|
415
|
-
decorators: [
|
|
416
|
-
(Story) => (
|
|
417
|
-
<Box
|
|
418
|
-
sx={{
|
|
419
|
-
background: 'linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%)',
|
|
420
|
-
minHeight: '400px',
|
|
421
|
-
padding: 4,
|
|
422
|
-
display: 'flex',
|
|
423
|
-
alignItems: 'center',
|
|
424
|
-
justifyContent: 'center',
|
|
425
|
-
borderRadius: 2,
|
|
426
|
-
position: 'relative',
|
|
427
|
-
'&::before': {
|
|
428
|
-
content: '""',
|
|
429
|
-
position: 'absolute',
|
|
430
|
-
top: 0,
|
|
431
|
-
left: 0,
|
|
432
|
-
right: 0,
|
|
433
|
-
bottom: 0,
|
|
434
|
-
backgroundImage: `
|
|
435
|
-
radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
|
|
436
|
-
radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
|
|
437
|
-
radial-gradient(circle at 40% 80%, rgba(120, 219, 226, 0.3) 0%, transparent 50%)
|
|
438
|
-
`,
|
|
439
|
-
borderRadius: 'inherit',
|
|
440
|
-
},
|
|
441
|
-
}}
|
|
442
|
-
>
|
|
443
|
-
<Box sx={{ position: 'relative', zIndex: 1 }}>
|
|
444
|
-
<Story />
|
|
445
|
-
</Box>
|
|
446
|
-
</Box>
|
|
447
|
-
),
|
|
448
|
-
],
|
|
449
|
-
parameters: {
|
|
450
|
-
backgrounds: { default: 'dark' },
|
|
451
|
-
docs: {
|
|
452
|
-
description: {
|
|
453
|
-
story:
|
|
454
|
-
'Glass effect optimized for dark themes with enhanced contrast and subtle lighting effects.',
|
|
455
|
-
},
|
|
456
|
-
},
|
|
457
|
-
},
|
|
458
|
-
};
|
|
459
|
-
|
|
460
|
-
// Required story exports for validation
|
|
461
|
-
export const AllVariants: Story = {
|
|
462
|
-
args: {
|
|
463
|
-
items: [],
|
|
464
|
-
trigger: <Button>Dummy</Button>,
|
|
465
|
-
},
|
|
466
|
-
render: () => (
|
|
467
|
-
<Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap' }}>
|
|
468
|
-
<DropdownMenu
|
|
469
|
-
items={basicItems as never}
|
|
470
|
-
trigger={<Button variant="outline">Default</Button>}
|
|
471
|
-
variant="default"
|
|
472
|
-
size="md"
|
|
473
|
-
/>
|
|
474
|
-
<DropdownMenu
|
|
475
|
-
items={basicItems as never}
|
|
476
|
-
trigger={<Button variant="glass">Glass</Button>}
|
|
477
|
-
variant="glass"
|
|
478
|
-
size="md"
|
|
479
|
-
/>
|
|
480
|
-
<DropdownMenu
|
|
481
|
-
items={basicItems as never}
|
|
482
|
-
trigger={<Button variant="ghost">Minimal</Button>}
|
|
483
|
-
variant="minimal"
|
|
484
|
-
size="md"
|
|
485
|
-
/>
|
|
486
|
-
</Box>
|
|
487
|
-
),
|
|
488
|
-
};
|
|
489
|
-
|
|
490
|
-
export const AllSizes: Story = {
|
|
491
|
-
args: {
|
|
492
|
-
items: [],
|
|
493
|
-
trigger: <Button>Dummy</Button>,
|
|
494
|
-
},
|
|
495
|
-
render: () => (
|
|
496
|
-
<Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap' }}>
|
|
497
|
-
<DropdownMenu
|
|
498
|
-
items={basicItems as never}
|
|
499
|
-
trigger={<Button size="sm">Small</Button>}
|
|
500
|
-
variant="default"
|
|
501
|
-
size="sm"
|
|
502
|
-
/>
|
|
503
|
-
<DropdownMenu
|
|
504
|
-
items={basicItems as never}
|
|
505
|
-
trigger={<Button size="md">Medium</Button>}
|
|
506
|
-
variant="default"
|
|
507
|
-
size="md"
|
|
508
|
-
/>
|
|
509
|
-
<DropdownMenu
|
|
510
|
-
items={basicItems as never}
|
|
511
|
-
trigger={<Button size="lg">Large</Button>}
|
|
512
|
-
variant="default"
|
|
513
|
-
size="lg"
|
|
514
|
-
/>
|
|
515
|
-
</Box>
|
|
516
|
-
),
|
|
517
|
-
};
|
|
518
|
-
|
|
519
|
-
export const AllStates: Story = {
|
|
520
|
-
args: {
|
|
521
|
-
items: [],
|
|
522
|
-
trigger: <Button>Dummy</Button>,
|
|
523
|
-
},
|
|
524
|
-
render: () => (
|
|
525
|
-
<Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap' }}>
|
|
526
|
-
<DropdownMenu
|
|
527
|
-
items={mixedItems as never}
|
|
528
|
-
trigger={<Button variant="outline">Mixed States</Button>}
|
|
529
|
-
variant="default"
|
|
530
|
-
size="md"
|
|
531
|
-
/>
|
|
532
|
-
</Box>
|
|
533
|
-
),
|
|
534
|
-
};
|
|
535
|
-
|
|
536
|
-
export const InteractiveStates: Story = {
|
|
537
|
-
args: {
|
|
538
|
-
items: [],
|
|
539
|
-
trigger: <Button>Dummy</Button>,
|
|
540
|
-
},
|
|
541
|
-
render: () => (
|
|
542
|
-
<Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap' }}>
|
|
543
|
-
<DropdownMenu
|
|
544
|
-
items={
|
|
545
|
-
basicItems.map((item) => ({
|
|
546
|
-
...item,
|
|
547
|
-
onClick: item.type !== 'divider' ? () => void 0 : undefined,
|
|
548
|
-
})) as never
|
|
549
|
-
}
|
|
550
|
-
trigger={<Button variant="solid">Click Items</Button>}
|
|
551
|
-
variant="default"
|
|
552
|
-
size="md"
|
|
553
|
-
/>
|
|
554
|
-
</Box>
|
|
555
|
-
),
|
|
556
|
-
};
|
|
557
|
-
|
|
558
|
-
export const Responsive: Story = {
|
|
559
|
-
args: {
|
|
560
|
-
items: [],
|
|
561
|
-
trigger: <Button>Dummy</Button>,
|
|
562
|
-
},
|
|
563
|
-
render: () => (
|
|
564
|
-
<Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap', width: '100%' }}>
|
|
565
|
-
<DropdownMenu
|
|
566
|
-
items={basicItems as never}
|
|
567
|
-
trigger={<Button variant="outline">Responsive Menu</Button>}
|
|
568
|
-
variant="default"
|
|
569
|
-
size="md"
|
|
570
|
-
/>
|
|
571
|
-
</Box>
|
|
572
|
-
),
|
|
573
|
-
parameters: {
|
|
574
|
-
viewport: {
|
|
575
|
-
defaultViewport: 'mobile1',
|
|
576
|
-
},
|
|
577
|
-
},
|
|
578
|
-
};
|