Skip to content

Commit e8a395b

Browse files
chore(appframesidenav): import useArgs hook and action button
1 parent 630e961 commit e8a395b

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

components/appframesidenav/stories/template.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import { Template as ActionButton } from "@spectrum-css/actionbutton/stories/template.js";
12
import { Template as Button } from "@spectrum-css/button/stories/template.js";
23
import { Template as Icon } from "@spectrum-css/icon/stories/template.js";
34
import { html } from "lit";
45
import { classMap } from "lit/directives/class-map.js";
56
import { ifDefined } from "lit/directives/if-defined.js";
67
import { styleMap } from "lit/directives/style-map.js";
8+
import { useArgs } from "@storybook/preview-api";
79
import { when } from "lit/directives/when.js";
810

911
import "@spectrum-css/appframesidenav/index.css";
@@ -19,6 +21,8 @@ export const Template = ({
1921
customClasses = [],
2022
customStyles = {},
2123
}) => {
24+
const [, updateArgs] = useArgs();
25+
2226
const topButtonMarkup = Button({
2327
variant: "accent",
2428
label: topButtonText,
@@ -61,6 +65,16 @@ export const Template = ({
6165
</li>`
6266
)}
6367
</ul>
68+
${ActionButton({
69+
iconName: isMinimized ? "ChevronDoubleRight" : "ChevronDoubleLeft",
70+
isQuiet: true,
71+
hideLabel: true,
72+
customClasses: [`${rootClass}-expand-button`],
73+
onclick: () => {
74+
// Toggle minimized or expanded side nav on click.
75+
updateArgs?.({ isMinimized: !isMinimized });
76+
},
77+
})}
6478
</nav>
6579
`;
6680
};
@@ -114,9 +128,4 @@ export const defaultSideNavItems = [
114128
label: "Plugins",
115129
workflowIconName: "Plugin",
116130
},
117-
{
118-
label: "Settings",
119-
workflowIconName: "Settings",
120-
isEndSectionStart: true,
121-
},
122131
];

0 commit comments

Comments
 (0)