1
+ import { Template as ActionButton } from "@spectrum-css/actionbutton/stories/template.js" ;
1
2
import { Template as Button } from "@spectrum-css/button/stories/template.js" ;
2
3
import { Template as Icon } from "@spectrum-css/icon/stories/template.js" ;
3
4
import { html } from "lit" ;
4
5
import { classMap } from "lit/directives/class-map.js" ;
5
6
import { ifDefined } from "lit/directives/if-defined.js" ;
6
7
import { styleMap } from "lit/directives/style-map.js" ;
8
+ import { useArgs } from "@storybook/preview-api" ;
7
9
import { when } from "lit/directives/when.js" ;
8
10
9
11
import "@spectrum-css/appframesidenav/index.css" ;
@@ -19,6 +21,8 @@ export const Template = ({
19
21
customClasses = [ ] ,
20
22
customStyles = { } ,
21
23
} ) => {
24
+ const [ , updateArgs ] = useArgs ( ) ;
25
+
22
26
const topButtonMarkup = Button ( {
23
27
variant : "accent" ,
24
28
label : topButtonText ,
@@ -61,6 +65,16 @@ export const Template = ({
61
65
</ li > `
62
66
) }
63
67
</ 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
+ } ) }
64
78
</ nav >
65
79
` ;
66
80
} ;
@@ -114,9 +128,4 @@ export const defaultSideNavItems = [
114
128
label : "Plugins" ,
115
129
workflowIconName : "Plugin" ,
116
130
} ,
117
- {
118
- label : "Settings" ,
119
- workflowIconName : "Settings" ,
120
- isEndSectionStart : true ,
121
- } ,
122
131
] ;
0 commit comments