@@ -3,14 +3,170 @@ import { Label, LabelGroup } from '@patternfly/react-core';
33
44// Documentation for LabelGroups can be found at https://www.patternfly.org/components/label
55
6+ const sharedProps = {
7+ closableLabels : (
8+ < >
9+ < Label onClose = { ( ) => { } } > Label</ Label >
10+ < Label onClose = { ( ) => { } } > Label</ Label >
11+ < Label onClose = { ( ) => { } } > Label</ Label >
12+ < Label onClose = { ( ) => { } } > Label</ Label >
13+ < Label onClose = { ( ) => { } } > Label</ Label >
14+ < Label onClose = { ( ) => { } } > Label</ Label >
15+ < Label onClose = { ( ) => { } } > Label</ Label >
16+ < Label onClose = { ( ) => { } } > Label</ Label >
17+ < Label onClose = { ( ) => { } } > Label</ Label >
18+ </ >
19+ ) ,
20+ editableLabels : (
21+ < >
22+ < Label
23+ color = "grey"
24+ isCompact
25+ onClose = { ( ) => { } }
26+ closeBtnAriaLabel = "Custom close button for compact editable label"
27+ onEditCancel = { ( ) => { } }
28+ onEditComplete = { ( ) => { } }
29+ isEditable
30+ editableProps = { {
31+ 'aria-label' : `Editable compact label with text` ,
32+ id : 'compact-editable-label1'
33+ } }
34+ >
35+ Label
36+ </ Label >
37+ < Label
38+ color = "grey"
39+ isCompact
40+ onClose = { ( ) => { } }
41+ closeBtnAriaLabel = "Custom close button for compact editable label"
42+ onEditCancel = { ( ) => { } }
43+ onEditComplete = { ( ) => { } }
44+ isEditable
45+ editableProps = { {
46+ 'aria-label' : `Editable compact label with text` ,
47+ id : 'compact-editable-label1'
48+ } }
49+ >
50+ Label
51+ </ Label >
52+ < Label
53+ color = "grey"
54+ isCompact
55+ onClose = { ( ) => { } }
56+ closeBtnAriaLabel = "Custom close button for compact editable label"
57+ onEditCancel = { ( ) => { } }
58+ onEditComplete = { ( ) => { } }
59+ isEditable
60+ editableProps = { {
61+ 'aria-label' : `Editable compact label with text` ,
62+ id : 'compact-editable-label2'
63+ } }
64+ >
65+ Label
66+ </ Label >
67+ < Label
68+ color = "grey"
69+ isCompact
70+ onClose = { ( ) => { } }
71+ closeBtnAriaLabel = "Custom close button for compact editable label"
72+ onEditCancel = { ( ) => { } }
73+ onEditComplete = { ( ) => { } }
74+ isEditable
75+ editableProps = { {
76+ 'aria-label' : `Editable compact label with text` ,
77+ id : 'compact-editable-label3'
78+ } }
79+ >
80+ Label
81+ </ Label >
82+ < Label
83+ color = "grey"
84+ isCompact
85+ onClose = { ( ) => { } }
86+ closeBtnAriaLabel = "Custom close button for compact editable label"
87+ onEditCancel = { ( ) => { } }
88+ onEditComplete = { ( ) => { } }
89+ isEditable
90+ editableProps = { {
91+ 'aria-label' : `Editable compact label with text` ,
92+ id : 'compact-editable-label4'
93+ } }
94+ >
95+ Label
96+ </ Label >
97+ < Label
98+ color = "grey"
99+ isCompact
100+ onClose = { ( ) => { } }
101+ closeBtnAriaLabel = "Custom close button for compact editable label"
102+ onEditCancel = { ( ) => { } }
103+ onEditComplete = { ( ) => { } }
104+ isEditable
105+ editableProps = { {
106+ 'aria-label' : `Editable compact label with text` ,
107+ id : 'compact-editable-label5'
108+ } }
109+ >
110+ Label
111+ </ Label >
112+ < Label
113+ color = "grey"
114+ isCompact
115+ onClose = { ( ) => { } }
116+ closeBtnAriaLabel = "Custom close button for compact editable label"
117+ onEditCancel = { ( ) => { } }
118+ onEditComplete = { ( ) => { } }
119+ isEditable
120+ editableProps = { {
121+ 'aria-label' : `Editable compact label with text` ,
122+ id : 'compact-editable-label6'
123+ } }
124+ >
125+ Label
126+ </ Label >
127+ < Label
128+ color = "grey"
129+ isCompact
130+ onClose = { ( ) => { } }
131+ closeBtnAriaLabel = "Custom close button for compact editable label"
132+ onEditCancel = { ( ) => { } }
133+ onEditComplete = { ( ) => { } }
134+ isEditable
135+ editableProps = { {
136+ 'aria-label' : `Editable compact label with text` ,
137+ id : 'compact-editable-label7'
138+ } }
139+ >
140+ Label
141+ </ Label >
142+ < Label
143+ color = "grey"
144+ isCompact
145+ onClose = { ( ) => { } }
146+ closeBtnAriaLabel = "Custom close button for compact editable label"
147+ onEditCancel = { ( ) => { } }
148+ onEditComplete = { ( ) => { } }
149+ isEditable
150+ editableProps = { {
151+ 'aria-label' : `Editable compact label with text` ,
152+ id : 'compact-editable-label8'
153+ } }
154+ >
155+ Label
156+ </ Label >
157+ </ >
158+ )
159+ } ;
160+
6161figma . connect (
7162 LabelGroup ,
8- 'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9 /PatternFly-6--Components-Test ?node-id=2800-1075' ,
163+ 'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp /PatternFly-6--Components?node-id=2800-1075' ,
9164 {
10165 props : {
166+ ...sharedProps ,
11167 // boolean
12168 numLabels : figma . boolean ( 'Has collapsed labels' , {
13- true : 4 ,
169+ true : 6 ,
14170 false : undefined
15171 } ) ,
16172
@@ -21,17 +177,43 @@ figma.connect(
21177 Add label
22178 </ Label >
23179 )
180+ } )
181+ } ,
182+ example : ( props ) => (
183+ < LabelGroup
184+ addLabelControl = { props . addLabelControl }
185+ categoryName = "Group label"
186+ isClosable
187+ numLabels = { props . numLabels }
188+ onClick = { ( ) => { } }
189+ >
190+ { props . closableLabels }
191+ </ LabelGroup >
192+ )
193+ }
194+ ) ;
195+
196+ figma . connect (
197+ LabelGroup ,
198+ 'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components?node-id=2800-1075' ,
199+ {
200+ variant : { Type : 'Label management' } ,
201+ props : {
202+ ...sharedProps ,
203+ // boolean
204+ numLabels : figma . boolean ( 'Has collapsed labels' , {
205+ true : 6 ,
206+ false : undefined
24207 } ) ,
25208
26- children : figma . children ( [
27- 'Label in group 1' ,
28- 'Label in group 2' ,
29- 'Label in group 3' ,
30- 'Label in group 4' ,
31- 'Label in group 5' ,
32- 'Label in group 6' ,
33- 'Label Non-status'
34- ] )
209+ // enum
210+ addLabelControl : figma . enum ( 'Type' , {
211+ 'Label management' : (
212+ < Label variant = "add" onClick = { ( ) => { } } >
213+ Add label
214+ </ Label >
215+ )
216+ } )
35217 } ,
36218 example : ( props ) => (
37219 < LabelGroup
@@ -41,7 +223,7 @@ figma.connect(
41223 numLabels = { props . numLabels }
42224 onClick = { ( ) => { } }
43225 >
44- { props . children }
226+ { props . editableLabels }
45227 </ LabelGroup >
46228 )
47229 }
0 commit comments