145
145
{{ /let }}
146
146
</Shw::Flex >
147
147
148
+ </section >
149
+
150
+ <Shw::Divider />
151
+
152
+ <section data-test-percy>
153
+
154
+ <Shw::Text::H2 >Flex::Item</Shw::Text::H2 >
155
+
156
+ <Shw::Grid @columns ={{ 1 }} as |SG|>
157
+ <SG .Item @label =" used directly or via yielded component" >
158
+ <Shw::Outliner >
159
+ <Hds::Layout::Flex as |HLF|>
160
+ <Shw::Placeholder @text =" item #1" @height =" 40" @background =" #e4c5f3" />
161
+ <Hds::Layout::Flex::Item >
162
+ <Shw::Placeholder @text =" item #2 within Flex::Item" @height =" 40" @background =" #e5ffd2" />
163
+ </Hds::Layout::Flex::Item >
164
+ <Shw::Placeholder @text =" item #3" @height =" 40" @background =" #d2f4ff" />
165
+ <HLF .Item>
166
+ <Shw::Placeholder @text =" item #4 within HLF.Item" @height =" 40" @background =" #fff8d2" />
167
+ </HLF .Item>
168
+ </Hds::Layout::Flex >
169
+ </Shw::Outliner >
170
+ </SG .Item>
171
+ </Shw::Grid >
172
+
173
+ <Shw::Text::H3 >Basis</Shw::Text::H3 >
174
+
175
+ <Shw::Grid @columns ={{ 1 }} as |SG|>
176
+ <SG .Item as |SGI|>
177
+ <SGI .Label>with <code >size</code > values</SGI .Label>
178
+ <Shw::Outliner >
179
+ <Hds::Layout::Flex as |HLF|>
180
+ <Hds::Layout::Flex::Item @basis =" 10em" >
181
+ <Shw::Placeholder @text =" item #1 with basis=10em" @height =" 40" @background =" #e4c5f3" />
182
+ </Hds::Layout::Flex::Item >
183
+ <Hds::Layout::Flex::Item @basis =" 200px" >
184
+ <Shw::Placeholder @text =" item #2 with basis=200px" @height =" 40" @background =" #e5ffd2" />
185
+ </Hds::Layout::Flex::Item >
186
+ <HLF .Item @basis =" 40%" >
187
+ <Shw::Placeholder @text =" item #3 with basis=40%" @height =" 40" @background =" #d2f4ff" />
188
+ </HLF .Item>
189
+ <HLF .Item @basis =" auto" >
190
+ <Shw::Placeholder @text =" item #4 with basis=auto" @height =" 40" @background =" #fff8d2" />
191
+ </HLF .Item>
192
+ </Hds::Layout::Flex >
193
+ </Shw::Outliner >
194
+ </SG .Item>
195
+ <SG .Item as |SGI|>
196
+ <SGI .Label>with <code >keyword</code > values</SGI .Label>
197
+ <Shw::Outliner >
198
+ <Hds::Layout::Flex as |HLF|>
199
+ <Hds::Layout::Flex::Item @basis =" auto" >
200
+ <Shw::Placeholder @text =" item #1 with basis=auto" @height =" 40" @background =" #e4c5f3" />
201
+ </Hds::Layout::Flex::Item >
202
+ <Hds::Layout::Flex::Item @basis =" content" >
203
+ <Shw::Placeholder @text =" item #2 with basis=content" @height =" 40" @background =" #e5ffd2" />
204
+ </Hds::Layout::Flex::Item >
205
+ <HLF .Item @basis =" max-content" >
206
+ <Shw::Placeholder @text =" item #3 with basis=max-content" @height =" 40" @background =" #d2f4ff" />
207
+ </HLF .Item>
208
+ <HLF .Item @basis =" fit-content" >
209
+ <Shw::Placeholder @text =" item #4 with basis=fit-content" @height =" 40" @background =" #fff8d2" />
210
+ </HLF .Item>
211
+ </Hds::Layout::Flex >
212
+ </Shw::Outliner >
213
+ </SG .Item>
214
+ </Shw::Grid >
215
+
216
+ <Shw::Text::H3 >Grow</Shw::Text::H3 >
217
+
218
+ <Shw::Grid @columns ={{ 1 }} as |SG|>
219
+ <SG .Item as |SGI|>
220
+ <SGI .Label>with <code >0/1</code > and <code >true/false</code > values</SGI .Label>
221
+ <Shw::Outliner >
222
+ <Hds::Layout::Flex as |HLF|>
223
+ <Hds::Layout::Flex::Item @grow ={{ 0 }} >
224
+ <Shw::Placeholder @text =" item #1 with grow=0" @height =" 40" @background =" #e4c5f3" />
225
+ </Hds::Layout::Flex::Item >
226
+ <Hds::Layout::Flex::Item @grow ={{ 1 }} >
227
+ <Shw::Placeholder @text =" item #2 with grow=1" @height =" 40" @background =" #e5ffd2" />
228
+ </Hds::Layout::Flex::Item >
229
+ <HLF .Item @grow ={{ false }} >
230
+ <Shw::Placeholder @text =" item #3 with grow=false" @height =" 40" @background =" #d2f4ff" />
231
+ </HLF .Item>
232
+ <HLF .Item @grow ={{ true }} >
233
+ <Shw::Placeholder @text =" item #4 with grow=true" @height =" 40" @background =" #fff8d2" />
234
+ </HLF .Item>
235
+ </Hds::Layout::Flex >
236
+ </Shw::Outliner >
237
+ </SG .Item>
238
+ <SG .Item as |SGI|>
239
+ <SGI .Label>with <code >numeric/string</code > values (to handle special cases)</SGI .Label>
240
+ <Shw::Outliner >
241
+ <Hds::Layout::Flex as |HLF|>
242
+ <Hds::Layout::Flex::Item @grow ={{ 1 }} >
243
+ <Shw::Placeholder @text =" item #1 with grow=1" @height =" 40" @background =" #e4c5f3" />
244
+ </Hds::Layout::Flex::Item >
245
+ <Hds::Layout::Flex::Item @grow ={{ 2 }} >
246
+ <Shw::Placeholder @text =" item #2 with grow=2" @height =" 40" @background =" #e5ffd2" />
247
+ </Hds::Layout::Flex::Item >
248
+ <HLF .Item @grow =" 3" >
249
+ <Shw::Placeholder @text =" item #3 with grow='3'" @height =" 40" @background =" #d2f4ff" />
250
+ </HLF .Item>
251
+ <HLF .Item @grow =" 4" >
252
+ <Shw::Placeholder @text =" item #4 with grow='4'" @height =" 40" @background =" #fff8d2" />
253
+ </HLF .Item>
254
+ </Hds::Layout::Flex >
255
+ </Shw::Outliner >
256
+ </SG .Item>
257
+ </Shw::Grid >
258
+
259
+ <Shw::Text::H3 >Shrink</Shw::Text::H3 >
260
+
261
+ <Shw::Grid @columns ={{ 1 }} as |SG|>
262
+ <SG .Item as |SGI|>
263
+ <SGI .Label>with <code >0/1</code > and <code >true/false</code > values</SGI .Label>
264
+ <Shw::Outliner {{ style max-width =" 600px" }} >
265
+ <Hds::Layout::Flex as |HLF|>
266
+ <Hds::Layout::Flex::Item @basis =" 300px" @shrink ={{ 0 }} >
267
+ <Shw::Placeholder @text =" item #1 with shrink=0" @height =" 40" @background =" #e4c5f3" />
268
+ </Hds::Layout::Flex::Item >
269
+ <Hds::Layout::Flex::Item @basis =" 300px" @shrink ={{ 1 }} >
270
+ <Shw::Placeholder @text =" item #2 with shrink=1" @height =" 40" @background =" #e5ffd2" />
271
+ </Hds::Layout::Flex::Item >
272
+ <HLF .Item @basis =" 300px" @shrink ={{ false }} >
273
+ <Shw::Placeholder @text =" item #3 with shrink=false" @height =" 40" @background =" #d2f4ff" />
274
+ </HLF .Item>
275
+ <HLF .Item @basis =" 300px" @shrink ={{ true }} >
276
+ <Shw::Placeholder @text =" item #4 with shrink=true" @height =" 40" @background =" #fff8d2" />
277
+ </HLF .Item>
278
+ </Hds::Layout::Flex >
279
+ </Shw::Outliner >
280
+ </SG .Item>
281
+ <SG .Item as |SGI|>
282
+ <SGI .Label>with <code >numeric/string</code > values (to handle special cases)</SGI .Label>
283
+ <Shw::Outliner {{ style max-width =" 600px" }} >
284
+ <Hds::Layout::Flex as |HLF|>
285
+ <Hds::Layout::Flex::Item @basis =" 300px" @shrink ={{ 1 }} >
286
+ <Shw::Placeholder @text =" item #1 with shrink=1" @height =" 40" @background =" #e4c5f3" />
287
+ </Hds::Layout::Flex::Item >
288
+ <Hds::Layout::Flex::Item @basis =" 300px" @shrink ={{ 2 }} >
289
+ <Shw::Placeholder @text =" item #2 with shrink=2" @height =" 40" @background =" #e5ffd2" />
290
+ </Hds::Layout::Flex::Item >
291
+ <HLF .Item @basis =" 300px" @shrink =" 3" >
292
+ <Shw::Placeholder @text =" item #3 with shrink='3'" @height =" 40" @background =" #d2f4ff" />
293
+ </HLF .Item>
294
+ <HLF .Item @basis =" 300px" @shrink =" 4" >
295
+ <Shw::Placeholder @text =" item #4 with shrink='4'" @height =" 40" @background =" #fff8d2" />
296
+ </HLF .Item>
297
+ </Hds::Layout::Flex >
298
+ </Shw::Outliner >
299
+ </SG .Item>
300
+ </Shw::Grid >
301
+
148
302
</section >
0 commit comments