@@ -4,231 +4,231 @@ import { getStoryFactory } from "./getStory";
44
55const { meta, getStory } = getStoryFactory ( {
66 sectionName,
7- wrappedComponent : { SideMenu } ,
8- defaultContainerWidth : 300 ,
9- description : `
7+ " wrappedComponent" : { SideMenu } ,
8+ " defaultContainerWidth" : 300 ,
9+ " description" : `
1010- [See DSFR documentation](https://www.systeme-de-design.gouv.fr/elements-d-interface/composants/menu-lateral)
1111- [See DSFR demos](https://main--ds-gouv.netlify.app/example/component/sidemenu/)
1212- [See source code](https://github.com/codegouvfr/react-dsfr/blob/main/src/Sidemenu.tsx)` ,
13- disabledProps : [ "lang" ] ,
14- argTypes : {
15- title : {
16- description : "Title displayed above the menu"
17- } ,
18- items : {
19- control : "object" ,
20- type : { name : "string" , required : true } ,
21- description : "Items used to populate the menu"
22- } ,
23- burgerMenuButtonText : {
24- type : { name : "string" , required : true } ,
25- description : "Label to display next to the burger menu button"
26- } ,
27- sticky : {
28- defaultValue : false ,
29- control : { type : "radio" } ,
30- description : "Make the menu sticky" ,
31- options : [ false , true , "full-height" ]
32- } ,
33- align : {
34- defaultValue : "left" ,
35- options : [ "left" , "right" ] ,
36- control : { type : "radio" } ,
37- description : "Align the menu on the left or the right of the page"
13+ " disabledProps" : [ "lang" ] ,
14+ " argTypes" : {
15+ " title" : {
16+ " description" : "Title displayed above the menu"
17+ } ,
18+ " items" : {
19+ " control" : "object" ,
20+ " type" : { " name" : "string" , " required" : true } ,
21+ " description" : "Items used to populate the menu"
22+ } ,
23+ " burgerMenuButtonText" : {
24+ " type" : { " name" : "string" , " required" : true } ,
25+ " description" : "Label to display next to the burger menu button"
26+ } ,
27+ " sticky" : {
28+ " defaultValue" : false ,
29+ " control" : { " type" : "radio" } ,
30+ " description" : "Make the menu sticky" ,
31+ " options" : [ false , true , "full-height" ]
32+ } ,
33+ " align" : {
34+ " defaultValue" : "left" ,
35+ " options" : [ "left" , "right" ] ,
36+ " control" : { type : "radio" } ,
37+ " description" : "Align the menu on the left or the right of the page"
3838 }
3939 }
4040} ) ;
4141
4242export default meta ;
4343
4444export const Default = getStory ( {
45- title : "Titre de rubrique" ,
46- burgerMenuButtonText : "Dans cette rubrique" ,
47- items : [
45+ " title" : "Titre de rubrique" ,
46+ " burgerMenuButtonText" : "Dans cette rubrique" ,
47+ " items" : [
4848 {
49- isActive : true ,
50- text : "Accès direct" ,
51- linkProps : { href : "#" }
49+ " isActive" : true ,
50+ " text" : "Accès direct" ,
51+ " linkProps" : { " href" : "#" }
5252 } ,
5353 {
54- text : "Accès direct" ,
55- linkProps : { href : "#" }
54+ " text" : "Accès direct" ,
55+ " linkProps" : { " href" : "#" }
5656 } ,
5757 {
58- text : "Accès direct" ,
59- linkProps : { href : "#" }
58+ " text" : "Accès direct" ,
59+ " linkProps" : { " href" : "#" }
6060 } ,
6161 {
62- text : "Accès direct" ,
63- linkProps : { href : "#" }
62+ " text" : "Accès direct" ,
63+ " linkProps" : { " href" : "#" }
6464 } ,
6565 {
66- text : "Accès direct" ,
67- linkProps : { href : "#" }
66+ " text" : "Accès direct" ,
67+ " linkProps" : { " href" : "#" }
6868 } ,
6969 {
70- text : "Accès direct" ,
71- linkProps : { href : "#" }
70+ " text" : "Accès direct" ,
71+ " linkProps" : { " href" : "#" }
7272 }
7373 ]
7474} ) ;
7575
7676export const SideMenuWith2Levels = getStory ( {
77- title : "Titre de rubrique" ,
78- burgerMenuButtonText : "Dans cette rubrique" ,
79- items : [
77+ " title" : "Titre de rubrique" ,
78+ " burgerMenuButtonText" : "Dans cette rubrique" ,
79+ " items" : [
8080 {
81- text : "Niveau 1" ,
82- items : [
81+ " text" : "Niveau 1" ,
82+ " items" : [
8383 {
84- text : "Accès direct niveau 2" ,
85- linkProps : { href : "#" }
84+ " text" : "Accès direct niveau 2" ,
85+ " linkProps" : { " href" : "#" }
8686 } ,
8787 {
88- text : "Accès direct niveau 2" ,
89- linkProps : { href : "#" }
88+ " text" : "Accès direct niveau 2" ,
89+ " linkProps" : { " href" : "#" }
9090 } ,
9191 {
92- text : "Accès direct niveau 2" ,
93- linkProps : { href : "#" }
92+ " text" : "Accès direct niveau 2" ,
93+ " linkProps" : { " href" : "#" }
9494 }
9595 ]
9696 } ,
9797 {
98- isActive : true ,
99- text : "Entrée menu active" ,
100- items : [
98+ " isActive" : true ,
99+ " text" : "Entrée menu active" ,
100+ " items" : [
101101 {
102- text : "Accès direct niveau 2" ,
103- linkProps : { href : "#" }
102+ " text" : "Accès direct niveau 2" ,
103+ " linkProps" : { " href" : "#" }
104104 } ,
105105 {
106- isActive : true ,
107- text : "Accès direct niveau 2" ,
108- linkProps : { href : "#" }
106+ " isActive" : true ,
107+ " text" : "Accès direct niveau 2" ,
108+ " linkProps" : { " href" : "#" }
109109 } ,
110110 {
111- text : "Accès direct niveau 2" ,
112- linkProps : { href : "#" }
111+ " text" : "Accès direct niveau 2" ,
112+ " linkProps" : { " href" : "#" }
113113 } ,
114114 {
115- text : "Accès direct niveau 2" ,
116- linkProps : { href : "#" }
115+ " text" : "Accès direct niveau 2" ,
116+ " linkProps" : { " href" : "#" }
117117 }
118118 ]
119119 } ,
120120 {
121- text : "Accès direct" ,
122- linkProps : { href : "#" }
121+ " text" : "Accès direct" ,
122+ " linkProps" : { " href" : "#" }
123123 } ,
124124 {
125- text : "Accès direct" ,
126- linkProps : { href : "#" }
125+ " text" : "Accès direct" ,
126+ " linkProps" : { " href" : "#" }
127127 } ,
128128 {
129- text : "Niveau 1" ,
130- items : [
129+ " text" : "Niveau 1" ,
130+ " items" : [
131131 {
132- text : "Accès direct niveau 2" ,
133- linkProps : { href : "#" }
132+ " text" : "Accès direct niveau 2" ,
133+ " linkProps" : { " href" : "#" }
134134 } ,
135135 {
136- text : "Accès direct niveau 2" ,
137- linkProps : { href : "#" }
136+ " text" : "Accès direct niveau 2" ,
137+ " linkProps" : { " href" : "#" }
138138 } ,
139139 {
140- text : "Accès direct niveau 2" ,
141- linkProps : { href : "#" }
140+ " text" : "Accès direct niveau 2" ,
141+ " linkProps" : { " href" : "#" }
142142 }
143143 ]
144144 }
145145 ]
146146} ) ;
147147
148148export const SideMenuWith3Levels = getStory ( {
149- title : "Titre de rubrique" ,
150- burgerMenuButtonText : "Dans cette rubrique" ,
151- items : [
149+ " title" : "Titre de rubrique" ,
150+ " burgerMenuButtonText" : "Dans cette rubrique" ,
151+ " items" : [
152152 {
153- text : "Niveau 1" ,
154- items : [
153+ " text" : "Niveau 1" ,
154+ " items" : [
155155 {
156- text : "Accès direct niveau 2" ,
157- linkProps : { href : "#" }
156+ " text" : "Accès direct niveau 2" ,
157+ " linkProps" : { " href" : "#" }
158158 } ,
159159 {
160- text : "Accès direct niveau 2" ,
161- linkProps : { href : "#" }
160+ " text" : "Accès direct niveau 2" ,
161+ " linkProps" : { " href" : "#" }
162162 } ,
163163 {
164- text : "Accès direct niveau 2" ,
165- linkProps : { href : "#" }
164+ " text" : "Accès direct niveau 2" ,
165+ " linkProps" : { " href" : "#" }
166166 }
167167 ]
168168 } ,
169169 {
170- isActive : true ,
171- text : "Entrée menu active" ,
172- items : [
170+ " isActive" : true ,
171+ " text" : "Entrée menu active" ,
172+ " items" : [
173173 {
174- text : "Accès direct niveau 2" ,
175- linkProps : { href : "#" }
174+ " text" : "Accès direct niveau 2" ,
175+ " linkProps" : { " href" : "#" }
176176 } ,
177177 {
178- isActive : true ,
179- text : "Entrée menu active niveau 2" ,
180- items : [
178+ " isActive" : true ,
179+ " text" : "Entrée menu active niveau 2" ,
180+ " items" : [
181181 {
182- text : "Accès direct niveau 3" ,
183- linkProps : { href : "#" }
182+ " text" : "Accès direct niveau 3" ,
183+ " linkProps" : { " href" : "#" }
184184 } ,
185185 {
186- isActive : true ,
187- text : "Accès direct niveau 3" ,
188- linkProps : { href : "#" }
186+ " isActive" : true ,
187+ " text" : "Accès direct niveau 3" ,
188+ " linkProps" : { " href" : "#" }
189189 } ,
190190 {
191- text : "Accès direct niveau 3" ,
192- linkProps : { href : "#" }
191+ " text" : "Accès direct niveau 3" ,
192+ " linkProps" : { " href" : "#" }
193193 } ,
194194 {
195- text : "Accès direct niveau 3" ,
196- linkProps : { href : "#" }
195+ " text" : "Accès direct niveau 3" ,
196+ " linkProps" : { " href" : "#" }
197197 }
198198 ]
199199 } ,
200200 {
201- text : "Accès direct niveau 2" ,
202- linkProps : { href : "#" }
201+ " text" : "Accès direct niveau 2" ,
202+ " linkProps" : { " href" : "#" }
203203 } ,
204204 {
205- text : "Accès direct niveau 2" ,
206- linkProps : { href : "#" }
205+ " text" : "Accès direct niveau 2" ,
206+ " linkProps" : { " href" : "#" }
207207 }
208208 ]
209209 } ,
210210 {
211- text : "Accès direct" ,
212- linkProps : { href : "#" }
211+ " text" : "Accès direct" ,
212+ " linkProps" : { " href" : "#" }
213213 } ,
214214 {
215- text : "Accès direct" ,
216- linkProps : { href : "#" }
215+ " text" : "Accès direct" ,
216+ " linkProps" : { " href" : "#" }
217217 } ,
218218 {
219- text : "Niveau 1" ,
220- items : [
219+ " text" : "Niveau 1" ,
220+ " items" : [
221221 {
222- text : "Accès direct niveau 2" ,
223- linkProps : { href : "#" }
222+ " text" : "Accès direct niveau 2" ,
223+ " linkProps" : { " href" : "#" }
224224 } ,
225225 {
226- text : "Accès direct niveau 2" ,
227- linkProps : { href : "#" }
226+ " text" : "Accès direct niveau 2" ,
227+ " linkProps" : { " href" : "#" }
228228 } ,
229229 {
230- text : "Accès direct niveau 2" ,
231- linkProps : { href : "#" }
230+ " text" : "Accès direct niveau 2" ,
231+ " linkProps" : { " href" : "#" }
232232 }
233233 ]
234234 }
0 commit comments