File tree 2 files changed +55
-32
lines changed
packages/main/src/components/Toolbar
2 files changed +55
-32
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,43 @@ function Name(props: CEM.ClassMember) {
46
46
) ;
47
47
}
48
48
49
+ export function ShadowPartsTable ( { componentName, cssParts } : { componentName : string ; cssParts : CEM . CssPart [ ] } ) {
50
+ return (
51
+ < >
52
+ < Heading > CSS Shadow Parts</ Heading >
53
+ < p >
54
+ < Link target = { '_blank' } href = { 'https://developer.mozilla.org/en-US/docs/Web/CSS/::part' } >
55
+ CSS Shadow Parts
56
+ </ Link > { ' ' }
57
+ allow developers to style elements inside the Shadow DOM.
58
+ </ p >
59
+ < p >
60
+ The < code > { componentName } </ code > exposes the following CSS Shadow Parts:
61
+ </ p >
62
+ < table >
63
+ < thead >
64
+ < tr >
65
+ < th > Name</ th >
66
+ < th > Description</ th >
67
+ </ tr >
68
+ </ thead >
69
+ < tbody >
70
+ { cssParts . map ( ( part ) => (
71
+ < tr key = { part . name } >
72
+ < td >
73
+ < b > { part . name } </ b >
74
+ </ td >
75
+ < td > { part . description } </ td >
76
+ </ tr >
77
+ ) ) }
78
+ </ tbody >
79
+ </ table >
80
+ </ >
81
+ ) ;
82
+ }
83
+
84
+ ShadowPartsTable . displayName = 'ShadowPartsTable' ;
85
+
49
86
export function DomRefTable ( ) {
50
87
const docsContext = useContext ( DocsContext ) ;
51
88
const storyTags : string [ ] = docsContext . attachedCSFFile ?. meta ?. tags ;
@@ -146,38 +183,7 @@ export function DomRefTable() {
146
183
</ >
147
184
) : null }
148
185
149
- { cssParts . length > 0 ? (
150
- < >
151
- < Heading > CSS Shadow Parts</ Heading >
152
- < p >
153
- < Link target = { '_blank' } href = { 'https://developer.mozilla.org/en-US/docs/Web/CSS/::part' } >
154
- CSS Shadow Parts
155
- </ Link > { ' ' }
156
- allow developers to style elements inside the Shadow DOM.
157
- </ p >
158
- < p >
159
- The < code > { componentName } </ code > exposes the following CSS Shadow Parts:
160
- </ p >
161
- < table >
162
- < thead >
163
- < tr >
164
- < th > Name</ th >
165
- < th > Description</ th >
166
- </ tr >
167
- </ thead >
168
- < tbody >
169
- { cssParts . map ( ( part ) => (
170
- < tr key = { part . name } >
171
- < td >
172
- < b > { part . name } </ b >
173
- </ td >
174
- < td > { part . description } </ td >
175
- </ tr >
176
- ) ) }
177
- </ tbody >
178
- </ table >
179
- </ >
180
- ) : null }
186
+ { cssParts . length > 0 ? < ShadowPartsTable cssParts = { cssParts } /> : null }
181
187
</ >
182
188
) ;
183
189
}
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
10
10
ToolbarSpacer ,
11
11
ToolbarSeparator
12
12
} from ' ../..' ;
13
+ import { ShadowPartsTable } from ' @sb/components/DomRefTable' ;
13
14
14
15
<Meta of = { ComponentStories } />
15
16
@@ -254,12 +255,28 @@ const ToolbarComponent = () => {
254
255
255
256
<ArgTypesWithNote of={OverflowToolbarButton} />
256
257
258
+ <ShadowPartsTable
259
+ componentName="OverflowToolbarButton"
260
+ cssParts={[
261
+ { name: 'button', description: 'Used to style the native button element' },
262
+ { name: 'icon', description: 'Used to style the ui5-icon element' }
263
+ ]}
264
+ />
265
+
257
266
## OverflowToolbarToggleButton
258
267
259
268
<Description of={OverflowToolbarToggleButton} />
260
269
261
270
<ArgTypesWithNote of={OverflowToolbarToggleButton} />
262
271
272
+ <ShadowPartsTable
273
+ componentName="OverflowToolbarToggleButton"
274
+ cssParts={[
275
+ { name: 'button', description: 'Used to style the native button element' },
276
+ { name: 'icon', description: 'Used to style the ui5-icon element' }
277
+ ]}
278
+ />
279
+
263
280
## ToolbarSpacer
264
281
265
282
<Description of={ToolbarSpacer} />
You can’t perform that action at this time.
0 commit comments