@djangocfg/ui-core 2.1.382 → 2.1.383
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 +5 -12
- package/src/components/boundary/boundary.story.tsx +0 -191
- package/src/components/data/avatar/avatar.story.tsx +0 -115
- package/src/components/data/badge/badge.story.tsx +0 -56
- package/src/components/data/calendar/calendar.story.tsx +0 -127
- package/src/components/data/carousel/carousel.story.tsx +0 -122
- package/src/components/data/progress/progress.story.tsx +0 -97
- package/src/components/data/table/table.story.tsx +0 -148
- package/src/components/data/toggle/toggle.story.tsx +0 -104
- package/src/components/data/toggle-group/toggle-group.story.tsx +0 -118
- package/src/components/feedback/alert/alert.story.tsx +0 -77
- package/src/components/feedback/empty/empty.story.tsx +0 -115
- package/src/components/feedback/preloader/preloader.story.tsx +0 -86
- package/src/components/feedback/spinner/spinner.story.tsx +0 -66
- package/src/components/forms/button/button.story.tsx +0 -116
- package/src/components/forms/button-download/button-download.story.tsx +0 -112
- package/src/components/forms/button-group/button-group.story.tsx +0 -79
- package/src/components/forms/checkbox/checkbox.story.tsx +0 -89
- package/src/components/forms/input/input.story.tsx +0 -77
- package/src/components/forms/input-group/input-group.story.tsx +0 -119
- package/src/components/forms/input-otp/input-otp.story.tsx +0 -105
- package/src/components/forms/label/label.story.tsx +0 -52
- package/src/components/forms/radio-group/radio-group.story.tsx +0 -113
- package/src/components/forms/slider/slider.story.tsx +0 -134
- package/src/components/forms/switch/switch.story.tsx +0 -98
- package/src/components/forms/textarea/textarea.story.tsx +0 -94
- package/src/components/layout/aspect-ratio/aspect-ratio.story.tsx +0 -94
- package/src/components/layout/card/card.story.tsx +0 -105
- package/src/components/layout/resizable/resizable.story.tsx +0 -119
- package/src/components/layout/scroll-area/scroll-area.story.tsx +0 -172
- package/src/components/layout/separator/separator.story.tsx +0 -69
- package/src/components/layout/skeleton/skeleton.story.tsx +0 -101
- package/src/components/navigation/accordion/accordion.story.tsx +0 -110
- package/src/components/navigation/collapsible/collapsible.story.tsx +0 -133
- package/src/components/navigation/command/command.story.tsx +0 -121
- package/src/components/navigation/context-menu/context-menu.story.tsx +0 -125
- package/src/components/navigation/dropdown-menu/dropdown-menu.story.tsx +0 -208
- package/src/components/navigation/menubar/menubar.story.tsx +0 -152
- package/src/components/navigation/navigation-menu/navigation-menu.story.tsx +0 -154
- package/src/components/navigation/tabs/tabs.story.tsx +0 -98
- package/src/components/overlay/alert-dialog/alert-dialog.story.tsx +0 -104
- package/src/components/overlay/dialog/dialog.story.tsx +0 -212
- package/src/components/overlay/drawer/drawer.story.tsx +0 -359
- package/src/components/overlay/hover-card/hover-card.story.tsx +0 -102
- package/src/components/overlay/popover/popover.story.tsx +0 -127
- package/src/components/overlay/responsive-sheet/responsive-sheet.story.tsx +0 -117
- package/src/components/overlay/sheet/sheet.story.tsx +0 -148
- package/src/components/overlay/tooltip/tooltip.story.tsx +0 -139
- package/src/components/select/combobox-async.story.tsx +0 -215
- package/src/components/select/combobox.story.tsx +0 -226
- package/src/components/select/country-select.story.tsx +0 -261
- package/src/components/select/language-select.story.tsx +0 -264
- package/src/components/select/multi-select.story.tsx +0 -122
- package/src/components/select/select.story.tsx +0 -112
- package/src/components/specialized/copy/copy.story.tsx +0 -77
- package/src/components/specialized/flag/flag.story.tsx +0 -82
- package/src/components/specialized/image-with-fallback/image-with-fallback.story.tsx +0 -105
- package/src/components/specialized/kbd/kbd.story.tsx +0 -113
- package/src/lib/dialog-service/dialog-service.story.tsx +0 -263
- package/src/stories/index.ts +0 -28
- package/src/styles/theme/theme-tokens.story.tsx +0 -157
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import { defineStory } from '@djangocfg/playground';
|
|
2
|
-
import {
|
|
3
|
-
DropdownMenu,
|
|
4
|
-
DropdownMenuTrigger,
|
|
5
|
-
DropdownMenuContent,
|
|
6
|
-
DropdownMenuItem,
|
|
7
|
-
DropdownMenuCheckboxItem,
|
|
8
|
-
DropdownMenuRadioItem,
|
|
9
|
-
DropdownMenuLabel,
|
|
10
|
-
DropdownMenuSeparator,
|
|
11
|
-
DropdownMenuShortcut,
|
|
12
|
-
DropdownMenuGroup,
|
|
13
|
-
DropdownMenuSub,
|
|
14
|
-
DropdownMenuSubContent,
|
|
15
|
-
DropdownMenuSubTrigger,
|
|
16
|
-
DropdownMenuRadioGroup,
|
|
17
|
-
} from '.';
|
|
18
|
-
import { Button } from '../../forms/button';
|
|
19
|
-
import { useState } from 'react';
|
|
20
|
-
import {
|
|
21
|
-
User,
|
|
22
|
-
CreditCard,
|
|
23
|
-
Settings,
|
|
24
|
-
Keyboard,
|
|
25
|
-
Users,
|
|
26
|
-
UserPlus,
|
|
27
|
-
Mail,
|
|
28
|
-
MessageSquare,
|
|
29
|
-
PlusCircle,
|
|
30
|
-
Plus,
|
|
31
|
-
Github,
|
|
32
|
-
LifeBuoy,
|
|
33
|
-
Cloud,
|
|
34
|
-
LogOut,
|
|
35
|
-
} from 'lucide-react';
|
|
36
|
-
|
|
37
|
-
export default defineStory({
|
|
38
|
-
title: 'Core/Dropdown Menu',
|
|
39
|
-
component: DropdownMenu,
|
|
40
|
-
description: 'Context menu with items, submenus, and shortcuts.',
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
export const Default = () => (
|
|
44
|
-
<DropdownMenu>
|
|
45
|
-
<DropdownMenuTrigger asChild>
|
|
46
|
-
<Button variant="outline">Open Menu</Button>
|
|
47
|
-
</DropdownMenuTrigger>
|
|
48
|
-
<DropdownMenuContent className="w-56">
|
|
49
|
-
<DropdownMenuLabel>My Account</DropdownMenuLabel>
|
|
50
|
-
<DropdownMenuSeparator />
|
|
51
|
-
<DropdownMenuGroup>
|
|
52
|
-
<DropdownMenuItem>
|
|
53
|
-
<User className="mr-2 h-4 w-4" />
|
|
54
|
-
<span>Profile</span>
|
|
55
|
-
<DropdownMenuShortcut>⇧⌘P</DropdownMenuShortcut>
|
|
56
|
-
</DropdownMenuItem>
|
|
57
|
-
<DropdownMenuItem>
|
|
58
|
-
<CreditCard className="mr-2 h-4 w-4" />
|
|
59
|
-
<span>Billing</span>
|
|
60
|
-
<DropdownMenuShortcut>⌘B</DropdownMenuShortcut>
|
|
61
|
-
</DropdownMenuItem>
|
|
62
|
-
<DropdownMenuItem>
|
|
63
|
-
<Settings className="mr-2 h-4 w-4" />
|
|
64
|
-
<span>Settings</span>
|
|
65
|
-
<DropdownMenuShortcut>⌘S</DropdownMenuShortcut>
|
|
66
|
-
</DropdownMenuItem>
|
|
67
|
-
<DropdownMenuItem>
|
|
68
|
-
<Keyboard className="mr-2 h-4 w-4" />
|
|
69
|
-
<span>Keyboard shortcuts</span>
|
|
70
|
-
<DropdownMenuShortcut>⌘K</DropdownMenuShortcut>
|
|
71
|
-
</DropdownMenuItem>
|
|
72
|
-
</DropdownMenuGroup>
|
|
73
|
-
<DropdownMenuSeparator />
|
|
74
|
-
<DropdownMenuItem>
|
|
75
|
-
<LogOut className="mr-2 h-4 w-4" />
|
|
76
|
-
<span>Log out</span>
|
|
77
|
-
<DropdownMenuShortcut>⇧⌘Q</DropdownMenuShortcut>
|
|
78
|
-
</DropdownMenuItem>
|
|
79
|
-
</DropdownMenuContent>
|
|
80
|
-
</DropdownMenu>
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
export const WithSubmenus = () => (
|
|
84
|
-
<DropdownMenu>
|
|
85
|
-
<DropdownMenuTrigger asChild>
|
|
86
|
-
<Button variant="outline">Open Menu</Button>
|
|
87
|
-
</DropdownMenuTrigger>
|
|
88
|
-
<DropdownMenuContent className="w-56">
|
|
89
|
-
<DropdownMenuLabel>My Account</DropdownMenuLabel>
|
|
90
|
-
<DropdownMenuSeparator />
|
|
91
|
-
<DropdownMenuGroup>
|
|
92
|
-
<DropdownMenuItem>
|
|
93
|
-
<User className="mr-2 h-4 w-4" />
|
|
94
|
-
<span>Profile</span>
|
|
95
|
-
</DropdownMenuItem>
|
|
96
|
-
<DropdownMenuSub>
|
|
97
|
-
<DropdownMenuSubTrigger>
|
|
98
|
-
<UserPlus className="mr-2 h-4 w-4" />
|
|
99
|
-
<span>Invite users</span>
|
|
100
|
-
</DropdownMenuSubTrigger>
|
|
101
|
-
<DropdownMenuSubContent>
|
|
102
|
-
<DropdownMenuItem>
|
|
103
|
-
<Mail className="mr-2 h-4 w-4" />
|
|
104
|
-
<span>Email</span>
|
|
105
|
-
</DropdownMenuItem>
|
|
106
|
-
<DropdownMenuItem>
|
|
107
|
-
<MessageSquare className="mr-2 h-4 w-4" />
|
|
108
|
-
<span>Message</span>
|
|
109
|
-
</DropdownMenuItem>
|
|
110
|
-
<DropdownMenuSeparator />
|
|
111
|
-
<DropdownMenuItem>
|
|
112
|
-
<PlusCircle className="mr-2 h-4 w-4" />
|
|
113
|
-
<span>More...</span>
|
|
114
|
-
</DropdownMenuItem>
|
|
115
|
-
</DropdownMenuSubContent>
|
|
116
|
-
</DropdownMenuSub>
|
|
117
|
-
<DropdownMenuItem>
|
|
118
|
-
<Plus className="mr-2 h-4 w-4" />
|
|
119
|
-
<span>New Team</span>
|
|
120
|
-
</DropdownMenuItem>
|
|
121
|
-
</DropdownMenuGroup>
|
|
122
|
-
<DropdownMenuSeparator />
|
|
123
|
-
<DropdownMenuItem>
|
|
124
|
-
<Github className="mr-2 h-4 w-4" />
|
|
125
|
-
<span>GitHub</span>
|
|
126
|
-
</DropdownMenuItem>
|
|
127
|
-
<DropdownMenuItem>
|
|
128
|
-
<LifeBuoy className="mr-2 h-4 w-4" />
|
|
129
|
-
<span>Support</span>
|
|
130
|
-
</DropdownMenuItem>
|
|
131
|
-
<DropdownMenuItem disabled>
|
|
132
|
-
<Cloud className="mr-2 h-4 w-4" />
|
|
133
|
-
<span>API</span>
|
|
134
|
-
</DropdownMenuItem>
|
|
135
|
-
</DropdownMenuContent>
|
|
136
|
-
</DropdownMenu>
|
|
137
|
-
);
|
|
138
|
-
|
|
139
|
-
export const WithCheckboxes = () => {
|
|
140
|
-
const [showStatusBar, setShowStatusBar] = useState(true);
|
|
141
|
-
const [showActivityBar, setShowActivityBar] = useState(false);
|
|
142
|
-
const [showPanel, setShowPanel] = useState(false);
|
|
143
|
-
|
|
144
|
-
return (
|
|
145
|
-
<DropdownMenu>
|
|
146
|
-
<DropdownMenuTrigger asChild>
|
|
147
|
-
<Button variant="outline">View Options</Button>
|
|
148
|
-
</DropdownMenuTrigger>
|
|
149
|
-
<DropdownMenuContent className="w-56">
|
|
150
|
-
<DropdownMenuLabel>Appearance</DropdownMenuLabel>
|
|
151
|
-
<DropdownMenuSeparator />
|
|
152
|
-
<DropdownMenuCheckboxItem
|
|
153
|
-
checked={showStatusBar}
|
|
154
|
-
onCheckedChange={setShowStatusBar}
|
|
155
|
-
>
|
|
156
|
-
Status Bar
|
|
157
|
-
</DropdownMenuCheckboxItem>
|
|
158
|
-
<DropdownMenuCheckboxItem
|
|
159
|
-
checked={showActivityBar}
|
|
160
|
-
onCheckedChange={setShowActivityBar}
|
|
161
|
-
>
|
|
162
|
-
Activity Bar
|
|
163
|
-
</DropdownMenuCheckboxItem>
|
|
164
|
-
<DropdownMenuCheckboxItem
|
|
165
|
-
checked={showPanel}
|
|
166
|
-
onCheckedChange={setShowPanel}
|
|
167
|
-
>
|
|
168
|
-
Panel
|
|
169
|
-
</DropdownMenuCheckboxItem>
|
|
170
|
-
</DropdownMenuContent>
|
|
171
|
-
</DropdownMenu>
|
|
172
|
-
);
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
export const WithRadioGroup = () => {
|
|
176
|
-
const [position, setPosition] = useState('bottom');
|
|
177
|
-
|
|
178
|
-
return (
|
|
179
|
-
<DropdownMenu>
|
|
180
|
-
<DropdownMenuTrigger asChild>
|
|
181
|
-
<Button variant="outline">Panel Position</Button>
|
|
182
|
-
</DropdownMenuTrigger>
|
|
183
|
-
<DropdownMenuContent className="w-56">
|
|
184
|
-
<DropdownMenuLabel>Panel Position</DropdownMenuLabel>
|
|
185
|
-
<DropdownMenuSeparator />
|
|
186
|
-
<DropdownMenuRadioGroup value={position} onValueChange={setPosition}>
|
|
187
|
-
<DropdownMenuRadioItem value="top">Top</DropdownMenuRadioItem>
|
|
188
|
-
<DropdownMenuRadioItem value="bottom">Bottom</DropdownMenuRadioItem>
|
|
189
|
-
<DropdownMenuRadioItem value="right">Right</DropdownMenuRadioItem>
|
|
190
|
-
</DropdownMenuRadioGroup>
|
|
191
|
-
</DropdownMenuContent>
|
|
192
|
-
</DropdownMenu>
|
|
193
|
-
);
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
export const Simple = () => (
|
|
197
|
-
<DropdownMenu>
|
|
198
|
-
<DropdownMenuTrigger asChild>
|
|
199
|
-
<Button variant="outline">Actions</Button>
|
|
200
|
-
</DropdownMenuTrigger>
|
|
201
|
-
<DropdownMenuContent>
|
|
202
|
-
<DropdownMenuItem>Edit</DropdownMenuItem>
|
|
203
|
-
<DropdownMenuItem>Duplicate</DropdownMenuItem>
|
|
204
|
-
<DropdownMenuSeparator />
|
|
205
|
-
<DropdownMenuItem className="text-destructive">Delete</DropdownMenuItem>
|
|
206
|
-
</DropdownMenuContent>
|
|
207
|
-
</DropdownMenu>
|
|
208
|
-
);
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import { defineStory } from '@djangocfg/playground';
|
|
3
|
-
import {
|
|
4
|
-
Menubar,
|
|
5
|
-
MenubarMenu,
|
|
6
|
-
MenubarTrigger,
|
|
7
|
-
MenubarContent,
|
|
8
|
-
MenubarItem,
|
|
9
|
-
MenubarSeparator,
|
|
10
|
-
MenubarShortcut,
|
|
11
|
-
MenubarSub,
|
|
12
|
-
MenubarSubTrigger,
|
|
13
|
-
MenubarSubContent,
|
|
14
|
-
MenubarCheckboxItem,
|
|
15
|
-
MenubarRadioGroup,
|
|
16
|
-
MenubarRadioItem,
|
|
17
|
-
} from '.';
|
|
18
|
-
|
|
19
|
-
export default defineStory({
|
|
20
|
-
title: 'Core/Menubar',
|
|
21
|
-
component: Menubar,
|
|
22
|
-
description: 'Horizontal menu bar with dropdowns.',
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
export const Default = () => (
|
|
26
|
-
<Menubar>
|
|
27
|
-
<MenubarMenu>
|
|
28
|
-
<MenubarTrigger>File</MenubarTrigger>
|
|
29
|
-
<MenubarContent>
|
|
30
|
-
<MenubarItem>
|
|
31
|
-
New Tab <MenubarShortcut>⌘T</MenubarShortcut>
|
|
32
|
-
</MenubarItem>
|
|
33
|
-
<MenubarItem>
|
|
34
|
-
New Window <MenubarShortcut>⌘N</MenubarShortcut>
|
|
35
|
-
</MenubarItem>
|
|
36
|
-
<MenubarSeparator />
|
|
37
|
-
<MenubarItem>Share</MenubarItem>
|
|
38
|
-
<MenubarSeparator />
|
|
39
|
-
<MenubarItem>
|
|
40
|
-
Print <MenubarShortcut>⌘P</MenubarShortcut>
|
|
41
|
-
</MenubarItem>
|
|
42
|
-
</MenubarContent>
|
|
43
|
-
</MenubarMenu>
|
|
44
|
-
<MenubarMenu>
|
|
45
|
-
<MenubarTrigger>Edit</MenubarTrigger>
|
|
46
|
-
<MenubarContent>
|
|
47
|
-
<MenubarItem>
|
|
48
|
-
Undo <MenubarShortcut>⌘Z</MenubarShortcut>
|
|
49
|
-
</MenubarItem>
|
|
50
|
-
<MenubarItem>
|
|
51
|
-
Redo <MenubarShortcut>⇧⌘Z</MenubarShortcut>
|
|
52
|
-
</MenubarItem>
|
|
53
|
-
<MenubarSeparator />
|
|
54
|
-
<MenubarItem>
|
|
55
|
-
Cut <MenubarShortcut>⌘X</MenubarShortcut>
|
|
56
|
-
</MenubarItem>
|
|
57
|
-
<MenubarItem>
|
|
58
|
-
Copy <MenubarShortcut>⌘C</MenubarShortcut>
|
|
59
|
-
</MenubarItem>
|
|
60
|
-
<MenubarItem>
|
|
61
|
-
Paste <MenubarShortcut>⌘V</MenubarShortcut>
|
|
62
|
-
</MenubarItem>
|
|
63
|
-
</MenubarContent>
|
|
64
|
-
</MenubarMenu>
|
|
65
|
-
<MenubarMenu>
|
|
66
|
-
<MenubarTrigger>View</MenubarTrigger>
|
|
67
|
-
<MenubarContent>
|
|
68
|
-
<MenubarItem>Zoom In</MenubarItem>
|
|
69
|
-
<MenubarItem>Zoom Out</MenubarItem>
|
|
70
|
-
<MenubarSeparator />
|
|
71
|
-
<MenubarItem>
|
|
72
|
-
Toggle Fullscreen <MenubarShortcut>F11</MenubarShortcut>
|
|
73
|
-
</MenubarItem>
|
|
74
|
-
</MenubarContent>
|
|
75
|
-
</MenubarMenu>
|
|
76
|
-
</Menubar>
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
export const WithSubMenus = () => (
|
|
80
|
-
<Menubar>
|
|
81
|
-
<MenubarMenu>
|
|
82
|
-
<MenubarTrigger>File</MenubarTrigger>
|
|
83
|
-
<MenubarContent>
|
|
84
|
-
<MenubarItem>New File</MenubarItem>
|
|
85
|
-
<MenubarSub>
|
|
86
|
-
<MenubarSubTrigger>New</MenubarSubTrigger>
|
|
87
|
-
<MenubarSubContent>
|
|
88
|
-
<MenubarItem>Project...</MenubarItem>
|
|
89
|
-
<MenubarItem>Folder...</MenubarItem>
|
|
90
|
-
<MenubarItem>File...</MenubarItem>
|
|
91
|
-
</MenubarSubContent>
|
|
92
|
-
</MenubarSub>
|
|
93
|
-
<MenubarSeparator />
|
|
94
|
-
<MenubarItem>Open...</MenubarItem>
|
|
95
|
-
<MenubarSub>
|
|
96
|
-
<MenubarSubTrigger>Open Recent</MenubarSubTrigger>
|
|
97
|
-
<MenubarSubContent>
|
|
98
|
-
<MenubarItem>Project 1</MenubarItem>
|
|
99
|
-
<MenubarItem>Project 2</MenubarItem>
|
|
100
|
-
<MenubarItem>Project 3</MenubarItem>
|
|
101
|
-
</MenubarSubContent>
|
|
102
|
-
</MenubarSub>
|
|
103
|
-
</MenubarContent>
|
|
104
|
-
</MenubarMenu>
|
|
105
|
-
</Menubar>
|
|
106
|
-
);
|
|
107
|
-
|
|
108
|
-
export const WithCheckboxes = () => {
|
|
109
|
-
const [showStatusBar, setShowStatusBar] = useState(true);
|
|
110
|
-
const [showActivityBar, setShowActivityBar] = useState(false);
|
|
111
|
-
|
|
112
|
-
return (
|
|
113
|
-
<Menubar>
|
|
114
|
-
<MenubarMenu>
|
|
115
|
-
<MenubarTrigger>View</MenubarTrigger>
|
|
116
|
-
<MenubarContent>
|
|
117
|
-
<MenubarCheckboxItem
|
|
118
|
-
checked={showStatusBar}
|
|
119
|
-
onCheckedChange={setShowStatusBar}
|
|
120
|
-
>
|
|
121
|
-
Status Bar
|
|
122
|
-
</MenubarCheckboxItem>
|
|
123
|
-
<MenubarCheckboxItem
|
|
124
|
-
checked={showActivityBar}
|
|
125
|
-
onCheckedChange={setShowActivityBar}
|
|
126
|
-
>
|
|
127
|
-
Activity Bar
|
|
128
|
-
</MenubarCheckboxItem>
|
|
129
|
-
</MenubarContent>
|
|
130
|
-
</MenubarMenu>
|
|
131
|
-
</Menubar>
|
|
132
|
-
);
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
export const WithRadioGroup = () => {
|
|
136
|
-
const [theme, setTheme] = useState('system');
|
|
137
|
-
|
|
138
|
-
return (
|
|
139
|
-
<Menubar>
|
|
140
|
-
<MenubarMenu>
|
|
141
|
-
<MenubarTrigger>Preferences</MenubarTrigger>
|
|
142
|
-
<MenubarContent>
|
|
143
|
-
<MenubarRadioGroup value={theme} onValueChange={setTheme}>
|
|
144
|
-
<MenubarRadioItem value="light">Light</MenubarRadioItem>
|
|
145
|
-
<MenubarRadioItem value="dark">Dark</MenubarRadioItem>
|
|
146
|
-
<MenubarRadioItem value="system">System</MenubarRadioItem>
|
|
147
|
-
</MenubarRadioGroup>
|
|
148
|
-
</MenubarContent>
|
|
149
|
-
</MenubarMenu>
|
|
150
|
-
</Menubar>
|
|
151
|
-
);
|
|
152
|
-
};
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { defineStory } from '@djangocfg/playground';
|
|
2
|
-
import {
|
|
3
|
-
NavigationMenu,
|
|
4
|
-
NavigationMenuList,
|
|
5
|
-
NavigationMenuItem,
|
|
6
|
-
NavigationMenuTrigger,
|
|
7
|
-
NavigationMenuContent,
|
|
8
|
-
NavigationMenuLink,
|
|
9
|
-
navigationMenuTriggerStyle,
|
|
10
|
-
} from '.';
|
|
11
|
-
import { cn } from '../../../lib';
|
|
12
|
-
|
|
13
|
-
export default defineStory({
|
|
14
|
-
title: 'Core/NavigationMenu',
|
|
15
|
-
component: NavigationMenu,
|
|
16
|
-
description: 'Navigation menu with dropdowns and links.',
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
const ListItem = ({
|
|
20
|
-
className,
|
|
21
|
-
title,
|
|
22
|
-
children,
|
|
23
|
-
href,
|
|
24
|
-
}: {
|
|
25
|
-
className?: string;
|
|
26
|
-
title: string;
|
|
27
|
-
children: React.ReactNode;
|
|
28
|
-
href: string;
|
|
29
|
-
}) => (
|
|
30
|
-
<li>
|
|
31
|
-
<NavigationMenuLink asChild>
|
|
32
|
-
<a
|
|
33
|
-
className={cn(
|
|
34
|
-
'block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground',
|
|
35
|
-
className
|
|
36
|
-
)}
|
|
37
|
-
href={href}
|
|
38
|
-
>
|
|
39
|
-
<div className="text-sm font-medium leading-none">{title}</div>
|
|
40
|
-
<p className="line-clamp-2 text-sm leading-snug text-muted-foreground">
|
|
41
|
-
{children}
|
|
42
|
-
</p>
|
|
43
|
-
</a>
|
|
44
|
-
</NavigationMenuLink>
|
|
45
|
-
</li>
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
export const Default = () => (
|
|
49
|
-
<NavigationMenu>
|
|
50
|
-
<NavigationMenuList>
|
|
51
|
-
<NavigationMenuItem>
|
|
52
|
-
<NavigationMenuTrigger>Getting Started</NavigationMenuTrigger>
|
|
53
|
-
<NavigationMenuContent>
|
|
54
|
-
<ul className="grid gap-3 p-4 w-[400px]">
|
|
55
|
-
<ListItem href="#" title="Introduction">
|
|
56
|
-
Re-usable components built with Radix UI and Tailwind CSS.
|
|
57
|
-
</ListItem>
|
|
58
|
-
<ListItem href="#" title="Installation">
|
|
59
|
-
How to install dependencies and structure your app.
|
|
60
|
-
</ListItem>
|
|
61
|
-
<ListItem href="#" title="Typography">
|
|
62
|
-
Styles for headings, paragraphs, lists, and more.
|
|
63
|
-
</ListItem>
|
|
64
|
-
</ul>
|
|
65
|
-
</NavigationMenuContent>
|
|
66
|
-
</NavigationMenuItem>
|
|
67
|
-
<NavigationMenuItem>
|
|
68
|
-
<NavigationMenuTrigger>Components</NavigationMenuTrigger>
|
|
69
|
-
<NavigationMenuContent>
|
|
70
|
-
<ul className="grid w-[400px] gap-3 p-4 md:w-[500px] md:grid-cols-2">
|
|
71
|
-
<ListItem href="#" title="Alert Dialog">
|
|
72
|
-
A modal dialog that interrupts the user.
|
|
73
|
-
</ListItem>
|
|
74
|
-
<ListItem href="#" title="Hover Card">
|
|
75
|
-
For sighted users to preview content.
|
|
76
|
-
</ListItem>
|
|
77
|
-
<ListItem href="#" title="Progress">
|
|
78
|
-
Displays an indicator showing completion progress.
|
|
79
|
-
</ListItem>
|
|
80
|
-
<ListItem href="#" title="Scroll Area">
|
|
81
|
-
Visually or semantically separates content.
|
|
82
|
-
</ListItem>
|
|
83
|
-
</ul>
|
|
84
|
-
</NavigationMenuContent>
|
|
85
|
-
</NavigationMenuItem>
|
|
86
|
-
<NavigationMenuItem>
|
|
87
|
-
<NavigationMenuLink className={navigationMenuTriggerStyle()} href="#">
|
|
88
|
-
Documentation
|
|
89
|
-
</NavigationMenuLink>
|
|
90
|
-
</NavigationMenuItem>
|
|
91
|
-
</NavigationMenuList>
|
|
92
|
-
</NavigationMenu>
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
export const Simple = () => (
|
|
96
|
-
<NavigationMenu>
|
|
97
|
-
<NavigationMenuList>
|
|
98
|
-
<NavigationMenuItem>
|
|
99
|
-
<NavigationMenuLink className={navigationMenuTriggerStyle()} href="#">
|
|
100
|
-
Home
|
|
101
|
-
</NavigationMenuLink>
|
|
102
|
-
</NavigationMenuItem>
|
|
103
|
-
<NavigationMenuItem>
|
|
104
|
-
<NavigationMenuLink className={navigationMenuTriggerStyle()} href="#">
|
|
105
|
-
About
|
|
106
|
-
</NavigationMenuLink>
|
|
107
|
-
</NavigationMenuItem>
|
|
108
|
-
<NavigationMenuItem>
|
|
109
|
-
<NavigationMenuLink className={navigationMenuTriggerStyle()} href="#">
|
|
110
|
-
Contact
|
|
111
|
-
</NavigationMenuLink>
|
|
112
|
-
</NavigationMenuItem>
|
|
113
|
-
</NavigationMenuList>
|
|
114
|
-
</NavigationMenu>
|
|
115
|
-
);
|
|
116
|
-
|
|
117
|
-
export const WithFeatureCard = () => (
|
|
118
|
-
<NavigationMenu>
|
|
119
|
-
<NavigationMenuList>
|
|
120
|
-
<NavigationMenuItem>
|
|
121
|
-
<NavigationMenuTrigger>Products</NavigationMenuTrigger>
|
|
122
|
-
<NavigationMenuContent>
|
|
123
|
-
<ul className="grid gap-3 p-6 w-[400px] md:w-[500px] lg:grid-cols-[.75fr_1fr]">
|
|
124
|
-
<li className="row-span-3">
|
|
125
|
-
<NavigationMenuLink asChild>
|
|
126
|
-
<a
|
|
127
|
-
className="flex h-full w-full select-none flex-col justify-end rounded-md bg-gradient-to-b from-muted/50 to-muted p-6 no-underline outline-none focus:shadow-md"
|
|
128
|
-
href="#"
|
|
129
|
-
>
|
|
130
|
-
<div className="mb-2 mt-4 text-lg font-medium">
|
|
131
|
-
Featured Product
|
|
132
|
-
</div>
|
|
133
|
-
<p className="text-sm leading-tight text-muted-foreground">
|
|
134
|
-
Beautifully designed components built with Radix UI and
|
|
135
|
-
Tailwind CSS.
|
|
136
|
-
</p>
|
|
137
|
-
</a>
|
|
138
|
-
</NavigationMenuLink>
|
|
139
|
-
</li>
|
|
140
|
-
<ListItem href="#" title="Product A">
|
|
141
|
-
A high-performance solution for modern needs.
|
|
142
|
-
</ListItem>
|
|
143
|
-
<ListItem href="#" title="Product B">
|
|
144
|
-
Enterprise-grade security and reliability.
|
|
145
|
-
</ListItem>
|
|
146
|
-
<ListItem href="#" title="Product C">
|
|
147
|
-
Scalable infrastructure for growing teams.
|
|
148
|
-
</ListItem>
|
|
149
|
-
</ul>
|
|
150
|
-
</NavigationMenuContent>
|
|
151
|
-
</NavigationMenuItem>
|
|
152
|
-
</NavigationMenuList>
|
|
153
|
-
</NavigationMenu>
|
|
154
|
-
);
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { defineStory } from '@djangocfg/playground';
|
|
2
|
-
import { Tabs, TabsContent, TabsList, TabsTrigger } from '.';
|
|
3
|
-
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '../../layout/card';
|
|
4
|
-
import { Input } from '../../forms/input';
|
|
5
|
-
import { Label } from '../../forms/label';
|
|
6
|
-
import { Button } from '../../forms/button';
|
|
7
|
-
|
|
8
|
-
export default defineStory({
|
|
9
|
-
title: 'Core/Tabs',
|
|
10
|
-
component: Tabs,
|
|
11
|
-
description: 'Tabbed interface for organizing content.',
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export const Default = () => (
|
|
15
|
-
<Tabs defaultValue="account" className="w-full max-w-md">
|
|
16
|
-
<TabsList className="grid w-full grid-cols-2">
|
|
17
|
-
<TabsTrigger value="account">Account</TabsTrigger>
|
|
18
|
-
<TabsTrigger value="password">Password</TabsTrigger>
|
|
19
|
-
</TabsList>
|
|
20
|
-
<TabsContent value="account">
|
|
21
|
-
<Card>
|
|
22
|
-
<CardHeader>
|
|
23
|
-
<CardTitle>Account</CardTitle>
|
|
24
|
-
<CardDescription>
|
|
25
|
-
Make changes to your account here.
|
|
26
|
-
</CardDescription>
|
|
27
|
-
</CardHeader>
|
|
28
|
-
<CardContent className="space-y-4">
|
|
29
|
-
<div className="space-y-2">
|
|
30
|
-
<Label htmlFor="name">Name</Label>
|
|
31
|
-
<Input id="name" defaultValue="John Doe" />
|
|
32
|
-
</div>
|
|
33
|
-
<div className="space-y-2">
|
|
34
|
-
<Label htmlFor="username">Username</Label>
|
|
35
|
-
<Input id="username" defaultValue="@johndoe" />
|
|
36
|
-
</div>
|
|
37
|
-
<Button>Save changes</Button>
|
|
38
|
-
</CardContent>
|
|
39
|
-
</Card>
|
|
40
|
-
</TabsContent>
|
|
41
|
-
<TabsContent value="password">
|
|
42
|
-
<Card>
|
|
43
|
-
<CardHeader>
|
|
44
|
-
<CardTitle>Password</CardTitle>
|
|
45
|
-
<CardDescription>
|
|
46
|
-
Change your password here.
|
|
47
|
-
</CardDescription>
|
|
48
|
-
</CardHeader>
|
|
49
|
-
<CardContent className="space-y-4">
|
|
50
|
-
<div className="space-y-2">
|
|
51
|
-
<Label htmlFor="current">Current password</Label>
|
|
52
|
-
<Input id="current" type="password" />
|
|
53
|
-
</div>
|
|
54
|
-
<div className="space-y-2">
|
|
55
|
-
<Label htmlFor="new">New password</Label>
|
|
56
|
-
<Input id="new" type="password" />
|
|
57
|
-
</div>
|
|
58
|
-
<Button>Save password</Button>
|
|
59
|
-
</CardContent>
|
|
60
|
-
</Card>
|
|
61
|
-
</TabsContent>
|
|
62
|
-
</Tabs>
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
export const SimpleTabs = () => (
|
|
66
|
-
<Tabs defaultValue="tab1" className="w-full max-w-lg">
|
|
67
|
-
<TabsList>
|
|
68
|
-
<TabsTrigger value="tab1">Tab 1</TabsTrigger>
|
|
69
|
-
<TabsTrigger value="tab2">Tab 2</TabsTrigger>
|
|
70
|
-
<TabsTrigger value="tab3">Tab 3</TabsTrigger>
|
|
71
|
-
</TabsList>
|
|
72
|
-
<TabsContent value="tab1" className="p-4">
|
|
73
|
-
Content for Tab 1
|
|
74
|
-
</TabsContent>
|
|
75
|
-
<TabsContent value="tab2" className="p-4">
|
|
76
|
-
Content for Tab 2
|
|
77
|
-
</TabsContent>
|
|
78
|
-
<TabsContent value="tab3" className="p-4">
|
|
79
|
-
Content for Tab 3
|
|
80
|
-
</TabsContent>
|
|
81
|
-
</Tabs>
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
export const DisabledTab = () => (
|
|
85
|
-
<Tabs defaultValue="active" className="w-full max-w-lg">
|
|
86
|
-
<TabsList>
|
|
87
|
-
<TabsTrigger value="active">Active</TabsTrigger>
|
|
88
|
-
<TabsTrigger value="disabled" disabled>Disabled</TabsTrigger>
|
|
89
|
-
<TabsTrigger value="another">Another</TabsTrigger>
|
|
90
|
-
</TabsList>
|
|
91
|
-
<TabsContent value="active" className="p-4">
|
|
92
|
-
This tab is active.
|
|
93
|
-
</TabsContent>
|
|
94
|
-
<TabsContent value="another" className="p-4">
|
|
95
|
-
Another active tab.
|
|
96
|
-
</TabsContent>
|
|
97
|
-
</Tabs>
|
|
98
|
-
);
|