Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

fix(DropdownMenu): restore closed default story (#6806)

Cindy Zhangcaa129cc65a2
diff --git a/apps/storybook/stories/DropdownMenu.stories.tsx b/apps/storybook/stories/DropdownMenu.stories.tsx
index 413ce5faf6..e9798a8998 100644
--- a/apps/storybook/stories/DropdownMenu.stories.tsx
+++ b/apps/storybook/stories/DropdownMenu.stories.tsx
@@ -152,48 +152,8 @@ const PROJECT_DESTINATIONS = [
['Website refresh', 'Brand'],
] as const;
-// Open action sheet used by the stable visual surface.
+// Basic usage
export const Default: Story = {
- parameters: {
- layout: 'fullscreen',
- docs: {
- story: {inline: false, height: '560px'},
- description: {
- story:
- 'Shows titled sections in the bottom-sheet presentation. Section headings and spacious action rows share the same inline content edge.',
- },
- },
- },
- globals: {viewport: {value: 'mobile1', isRotated: false}},
- render: () => (
- <div {...stylex.props(readinessStyles.viewportStoryCanvas)}>
- <DropdownMenu
- presentation="bottom-sheet"
- button={{label: 'File actions'}}
- items={[
- {
- type: 'section',
- title: 'Create',
- items: [{label: 'New file'}, {label: 'New folder'}],
- },
- {
- type: 'section',
- title: 'Manage',
- items: [{label: 'Share file'}, {label: 'Archive file'}],
- },
- ]}
- />
- </div>
- ),
- play: async ({canvasElement}) => {
- const trigger = canvasElement.querySelector('button');
- if (trigger instanceof HTMLElement) {
- trigger.click();
- }
- },
-};
-
-export const BasicPopover: Story = {
render: () => (
<DropdownMenu
button={{label: 'Actions'}}
@@ -1056,6 +1016,47 @@ export const ActionSheetPresentation: Story = {
},
};
+export const SectionedActionSheetPresentation: Story = {
+ name: 'Presentation / sectioned action sheet',
+ parameters: {
+ layout: 'fullscreen',
+ docs: {
+ story: {inline: false, height: '560px'},
+ description: {
+ story:
+ 'Shows titled sections in the bottom-sheet presentation. Section headings and spacious action rows share the same inline content edge.',
+ },
+ },
+ },
+ globals: {viewport: {value: 'mobile1', isRotated: false}},
+ render: () => (
+ <div {...stylex.props(readinessStyles.viewportStoryCanvas)}>
+ <DropdownMenu
+ presentation="bottom-sheet"
+ button={{label: 'File actions'}}
+ items={[
+ {
+ type: 'section',
+ title: 'Create',
+ items: [{label: 'New file'}, {label: 'New folder'}],
+ },
+ {
+ type: 'section',
+ title: 'Manage',
+ items: [{label: 'Share file'}, {label: 'Archive file'}],
+ },
+ ]}
+ />
+ </div>
+ ),
+ play: async ({canvasElement}) => {
+ const trigger = canvasElement.querySelector('button');
+ if (trigger instanceof HTMLElement) {
+ trigger.click();
+ }
+ },
+};
+
export const AdaptiveActionPresentation: Story = {
name: 'Presentation / adaptive action menu',
parameters: {