style(storybook): group overlay, disclosure and navigation story pages
- Sheet + Drawer, Tooltip + Hover Card, Accordion + Collapsible, Dialog + Alert Dialog, Dropdown Menu + Context Menu on one page each (specimens moved to *-examples.tsx; absorbed Stories keep their IDs) - Popover, Tabs content spacing, Breadcrumb, Menubar and Command tidied - Component docs updated to the new representative pages
This commit is contained in:
1 parent
71d504407d
commit
bad2acfc49
35 files changed
+649
-521
No files matched your search
@@ -18,9 +18,12 @@ import {
|
||||
DropdownMenuTrigger,
|
||||
} from "@hm-design/ui"
|
||||
import { StoryPage, StoryPageHeader, StorySection } from "@/components/story-page"
|
||||
import { ContextMenuFull } from "./context-menu-examples"
|
||||
|
||||
// Dropdown Menu is a Radix overlay (Portal), so the representative Story is a trigger that opens the real menu, the same way as
|
||||
// Dialog. The verification Story starts open. Radix owns keyboard navigation, focus return and Escape.
|
||||
// The representative page also shows the Context Menu specimen from ./context-menu-examples, so "팝업 메뉴" is the one
|
||||
// sidebar item for both; the Context Menu Stories keep their IDs and direct URLs but are hidden from the sidebar.
|
||||
|
||||
function Full({ defaultOpen }: { defaultOpen?: boolean }) {
|
||||
const [showStatus, setShowStatus] = useState(true)
|
||||
@@ -42,7 +45,7 @@ function Full({ defaultOpen }: { defaultOpen?: boolean }) {
|
||||
<DropdownMenuItem>
|
||||
설정 <DropdownMenuShortcut>⌘,</DropdownMenuShortcut>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem disabled>결제 (사용 불가)</DropdownMenuItem>
|
||||
<DropdownMenuItem disabled>결제</DropdownMenuItem>
|
||||
</DropdownMenuGroup>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuLabel>보기</DropdownMenuLabel>
|
||||
@@ -78,18 +81,22 @@ const meta = { title: "Components/Overlay/Dropdown Menu", component: DropdownMen
|
||||
export default meta
|
||||
type Story = StoryObj<typeof meta>
|
||||
|
||||
// Representative Story: the trigger opens the full menu (item, disabled, separator, checkbox, radio group, sub menu, destructive).
|
||||
// Representative Story: the trigger opens the full menu (item, disabled, separator, checkbox, radio group, sub menu, destructive);
|
||||
// right click the Context Menu area to open the same kinds of items.
|
||||
export const All: Story = {
|
||||
name: "Dropdown Menu",
|
||||
parameters: { layout: "fullscreen", controls: { disable: true } },
|
||||
render: () => (
|
||||
<StoryPage>
|
||||
<StoryPageHeader
|
||||
title="Dropdown Menu"
|
||||
title="Dropdown Menu · Context Menu"
|
||||
/>
|
||||
<StorySection title="Basic">
|
||||
<StorySection title="Dropdown Menu">
|
||||
<Full />
|
||||
</StorySection>
|
||||
<StorySection title="Context Menu">
|
||||
<ContextMenuFull />
|
||||
</StorySection>
|
||||
</StoryPage>
|
||||
),
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user