@@ -43,43 +43,91 @@ type Story = StoryObj<EuiSideNavProps>;
4343
4444const sharedSideNavItems = [
4545 {
46- name : 'Has nested children ' ,
47- id : 'normal_children ' ,
46+ name : 'Root item with carets ' ,
47+ id : 'root_1 ' ,
4848 items : [
4949 {
50- name : 'Child 1' ,
51- id : 'child_1 ' ,
50+ name : 'Trunk 1' ,
51+ id : 'trunk_1 ' ,
5252 items : [
5353 {
54- name : 'Selected item' ,
55- id : 'selected_item' ,
54+ name : 'Emphasized branch' ,
55+ id : 'emphasized_branch' ,
56+ icon : < EuiIcon type = "faceHappy" /> ,
57+ emphasize : true ,
58+ items : [
59+ {
60+ name : 'Yet another branch' ,
61+ id : 'branch_1' ,
62+ onClick : ( ) => { } ,
63+ } ,
64+ ] ,
65+ } ,
66+ ] ,
67+ } ,
68+ ] ,
69+ } ,
70+ {
71+ name : 'Root item without carets' ,
72+ id : 'root_2' ,
73+ items : [
74+ {
75+ name : 'Trunk 2' ,
76+ id : 'trunk_2' ,
77+ onClick : ( ) => { } , // Causes the caret to not render
78+ items : [
79+ {
80+ name : 'Branch 2' ,
81+ id : 'branch_2' ,
5682 onClick : ( ) => { } ,
57- isSelected : true ,
58- items : [ ] ,
83+ items : [
84+ {
85+ name : 'All parents are open because this branch is selected' ,
86+ id : 'selected_branch' ,
87+ onClick : ( ) => { } ,
88+ isSelected : true ,
89+ truncate : false ,
90+ } ,
91+ ] ,
5992 } ,
6093 ] ,
6194 } ,
6295 ] ,
6396 } ,
6497 {
65- name : 'Has forceOpen: true' ,
66- id : 'force_open' ,
67- forceOpen : true ,
98+ name : 'Root item with forced open children' ,
99+ id : 'root_3' ,
68100 items : [
69101 {
70- name : 'Child 3' ,
71- id : 'child_3' ,
102+ name : 'Trunk 3' ,
103+ id : 'trunk_3' ,
104+ onClick : ( ) => { } ,
105+ forceOpen : true ,
106+ items : [
107+ {
108+ name : 'Disabled branch' ,
109+ id : 'disabled_branch' ,
110+ href : '#' ,
111+ disabled : true ,
112+ icon : < EuiIcon type = "faceSad" /> ,
113+ } ,
114+ ] ,
72115 } ,
73116 ] ,
74117 } ,
75118 {
76- name : 'Children only without link ' ,
77- id : 'children_only' ,
78- onClick : undefined ,
119+ name : 'Root item with icon and truncation ' ,
120+ icon : < EuiIcon type = "logoElastic" /> ,
121+ id : 'root_4' ,
79122 items : [
80123 {
81- name : 'Child 4' ,
82- id : 'child_4' ,
124+ name : 'Very very long text, truncated by default' ,
125+ id : 'truncated' ,
126+ } ,
127+ {
128+ name : 'Very very long text, truncate set to false' ,
129+ id : 'truncateFalse' ,
130+ truncate : false ,
83131 } ,
84132 ] ,
85133 } ,
0 commit comments