@atlaskit/ds-explorations 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/cjs/components/box.partial.js +119 -101
- package/dist/cjs/components/inline.partial.js +28 -23
- package/dist/cjs/components/stack.partial.js +19 -13
- package/dist/cjs/internal/spacing-scale.js +3 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/box.partial.js +119 -101
- package/dist/es2019/components/inline.partial.js +28 -21
- package/dist/es2019/components/stack.partial.js +19 -13
- package/dist/es2019/internal/spacing-scale.js +3 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/box.partial.js +119 -101
- package/dist/esm/components/inline.partial.js +28 -21
- package/dist/esm/components/stack.partial.js +19 -13
- package/dist/esm/internal/spacing-scale.js +3 -3
- package/dist/esm/version.json +1 -1
- package/dist/types/components/box.partial.d.ts +54 -32
- package/dist/types/components/inline.partial.d.ts +3 -1
- package/dist/types/components/stack.partial.d.ts +3 -1
- package/dist/types/internal/spacing-scale.d.ts +3 -3
- package/examples/04-inline.tsx +5 -11
- package/examples/99-interactions.tsx +1 -1
- package/package.json +2 -2
- package/report.api.md +30 -28
- package/scripts/codegen-styles.tsx +24 -1
- package/scripts/dimension-codegen-template.tsx +63 -0
- package/scripts/spacing-codegen-template.tsx +8 -21
- package/scripts/spacing-scale-template.tsx +6 -13
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-background-and-padding-block-should-match-snapshot-1-snap.png +2 -2
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-background-and-padding-inline-should-match-snapshot-1-snap.png +2 -2
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-background-and-padding-should-match-snapshot-1-snap.png +2 -2
- package/src/components/__tests__/visual-regression/__image_snapshots__/inline-snapshot-test-tsx-inline-spacing-example-should-match-snapshot-1-snap.png +2 -2
- package/src/components/__tests__/visual-regression/__image_snapshots__/stack-snapshot-test-tsx-stack-spacing-example-should-match-snapshot-1-snap.png +2 -2
- package/src/components/box.partial.tsx +106 -119
- package/src/components/inline.partial.tsx +35 -23
- package/src/components/stack.partial.tsx +19 -13
- package/src/internal/spacing-scale.tsx +4 -2
- package/tmp/api-report-tmp.d.ts +30 -28
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
import prettier from 'prettier';
|
|
2
2
|
import parserTypeScript from 'prettier/parser-typescript';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
import tokens from '@atlaskit/tokens/src/artifacts/tokens-raw/atlassian-spacing';
|
|
4
|
+
import tokens from '@atlaskit/tokens/spacing-raw';
|
|
6
5
|
|
|
7
6
|
const onlyScaleTokens = tokens.filter((token) =>
|
|
8
7
|
token.name.startsWith('spacing.scale.'),
|
|
9
8
|
);
|
|
10
9
|
|
|
11
|
-
type Token = {
|
|
12
|
-
name: string;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
10
|
const activeTokens = onlyScaleTokens.map(
|
|
16
|
-
(t)
|
|
17
|
-
name: t.name,
|
|
18
|
-
}),
|
|
11
|
+
(t) => `'${t.name.replace('spacing.', '')}'`,
|
|
19
12
|
);
|
|
20
13
|
|
|
21
14
|
export const createSpacingScaleTemplate = () => {
|
|
@@ -23,10 +16,10 @@ export const createSpacingScaleTemplate = () => {
|
|
|
23
16
|
`
|
|
24
17
|
export const spacingScale = [
|
|
25
18
|
${activeTokens
|
|
26
|
-
.sort((a, b) =>
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
return
|
|
19
|
+
.sort((a, b) => {
|
|
20
|
+
const spaceValueA = Number(a.match(/(\d+)/)![0]);
|
|
21
|
+
const spaceValueB = Number(b.match(/(\d+)/)![0]);
|
|
22
|
+
return spaceValueA < spaceValueB ? -1 : 1;
|
|
30
23
|
})
|
|
31
24
|
.join(',\n\t')}
|
|
32
25
|
] as const;`,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:b334cf257241e9d363e5766654784144f199f517de15854538613938b10c0170
|
|
3
|
+
size 11785
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:03408bfaadb8361d2ae76af2f5b7df4b3ed05d620319820c977150a113e69ece
|
|
3
|
+
size 23901
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:c8a8d044a2a68d47ada4fcf7979eed79b16ead8c56e2dda48a3686b768f04297
|
|
3
|
+
size 12063
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:8e40b6523964f6547d9a5ce9cc870e98846b74eb7ee5bdb4173dcaa110635254
|
|
3
|
+
size 35276
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:773445bdd4fceab46cc30012359833933fb2438dee81c378e1316b93aff8e2a5
|
|
3
|
+
size 12715
|
|
@@ -68,14 +68,17 @@ type BoxPropsBase<T extends ElementType> = {
|
|
|
68
68
|
borderRadius?: BorderRadius;
|
|
69
69
|
/**
|
|
70
70
|
* Defines the main axis direction.
|
|
71
|
+
* @deprecated
|
|
71
72
|
*/
|
|
72
73
|
flexDirection?: FlexDirection;
|
|
73
74
|
/**
|
|
74
75
|
* Used to align children along the cross axis.
|
|
76
|
+
* @deprecated
|
|
75
77
|
*/
|
|
76
78
|
alignItems?: FlexAlignItems;
|
|
77
79
|
/**
|
|
78
80
|
* Used to align children along the main axis.
|
|
81
|
+
* @deprecated
|
|
79
82
|
*/
|
|
80
83
|
justifyContent?: FlexJustifyContent;
|
|
81
84
|
/**
|
|
@@ -99,10 +102,12 @@ type BoxPropsBase<T extends ElementType> = {
|
|
|
99
102
|
paddingInline?: PaddingInline;
|
|
100
103
|
/**
|
|
101
104
|
* Token representing width.
|
|
105
|
+
* @experimental The existing tokens will be replaced to better reflect dimensions.
|
|
102
106
|
*/
|
|
103
107
|
width?: Width;
|
|
104
108
|
/**
|
|
105
109
|
* Token representing height.
|
|
110
|
+
* @experimental The existing tokens will be replaced to better reflect dimensions.
|
|
106
111
|
*/
|
|
107
112
|
height?: Height;
|
|
108
113
|
/**
|
|
@@ -231,12 +236,18 @@ const borderRadiusMap = {
|
|
|
231
236
|
badge: css({ borderRadius: '8px' }),
|
|
232
237
|
};
|
|
233
238
|
|
|
239
|
+
/**
|
|
240
|
+
* @experimental - this is likely to be removed
|
|
241
|
+
*/
|
|
234
242
|
type FlexDirection = keyof typeof flexDirectionMap;
|
|
235
243
|
const flexDirectionMap = {
|
|
236
244
|
column: css({ flexDirection: 'column' }),
|
|
237
245
|
row: css({ flexDirection: 'row' }),
|
|
238
246
|
};
|
|
239
247
|
|
|
248
|
+
/**
|
|
249
|
+
* @experimental - this is likely to be removed
|
|
250
|
+
*/
|
|
240
251
|
type FlexAlignItems = keyof typeof flexAlignItemsMap;
|
|
241
252
|
const flexAlignItemsMap = {
|
|
242
253
|
center: css({ alignItems: 'center' }),
|
|
@@ -245,6 +256,9 @@ const flexAlignItemsMap = {
|
|
|
245
256
|
flexEnd: css({ alignItems: 'flex-end' }),
|
|
246
257
|
};
|
|
247
258
|
|
|
259
|
+
/**
|
|
260
|
+
* @experimental - this is likely to be removed
|
|
261
|
+
*/
|
|
248
262
|
type FlexJustifyContent = keyof typeof flexJustifyContentMap;
|
|
249
263
|
const flexJustifyContentMap = {
|
|
250
264
|
center: css({ justifyContent: 'center' }),
|
|
@@ -280,48 +294,91 @@ const baseStyles = css({
|
|
|
280
294
|
|
|
281
295
|
/**
|
|
282
296
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
283
|
-
* @codegen <<SignedSource::
|
|
297
|
+
* @codegen <<SignedSource::327e769aaa3da9422a919a0ca9490070>>
|
|
298
|
+
* @codegenId dimensions
|
|
299
|
+
* @codegenCommand yarn codegen-styles
|
|
300
|
+
* @codegenParams ["width", "height"]
|
|
301
|
+
*/
|
|
302
|
+
const widthMap = {
|
|
303
|
+
'100%': css({ width: '100%' }),
|
|
304
|
+
'size.100': css({ width: '16px' }),
|
|
305
|
+
'size.1000': css({ width: '192px' }),
|
|
306
|
+
'size.200': css({ width: '24px' }),
|
|
307
|
+
'size.300': css({ width: '32px' }),
|
|
308
|
+
'size.400': css({ width: '40px' }),
|
|
309
|
+
'size.500': css({ width: '48px' }),
|
|
310
|
+
'size.600': css({ width: '96px' }),
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
export type Width = keyof typeof widthMap;
|
|
314
|
+
|
|
315
|
+
const heightMap = {
|
|
316
|
+
'100%': css({ height: '100%' }),
|
|
317
|
+
'size.100': css({ height: '16px' }),
|
|
318
|
+
'size.1000': css({ height: '192px' }),
|
|
319
|
+
'size.200': css({ height: '24px' }),
|
|
320
|
+
'size.300': css({ height: '32px' }),
|
|
321
|
+
'size.400': css({ height: '40px' }),
|
|
322
|
+
'size.500': css({ height: '48px' }),
|
|
323
|
+
'size.600': css({ height: '96px' }),
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
export type Height = keyof typeof heightMap;
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* @codegenEnd
|
|
330
|
+
*/
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
334
|
+
* @codegen <<SignedSource::41980a62e387c13a99802814a0f33d26>>
|
|
284
335
|
* @codegenId spacing
|
|
285
336
|
* @codegenCommand yarn codegen-styles
|
|
286
|
-
* @codegenParams ["padding", "paddingBlock", "paddingInline"
|
|
337
|
+
* @codegenParams ["padding", "paddingBlock", "paddingInline"]
|
|
287
338
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::07ef29d58a2b23af8b098515466d7e22>>
|
|
288
339
|
*/
|
|
289
340
|
const paddingMap = {
|
|
290
341
|
'scale.0': css({
|
|
291
|
-
padding: token('
|
|
342
|
+
padding: token('space.0', '0px'),
|
|
292
343
|
}),
|
|
293
344
|
'scale.025': css({
|
|
294
|
-
padding: token('
|
|
345
|
+
padding: token('space.025', '2px'),
|
|
295
346
|
}),
|
|
296
347
|
'scale.050': css({
|
|
297
|
-
padding: token('
|
|
348
|
+
padding: token('space.050', '4px'),
|
|
298
349
|
}),
|
|
299
350
|
'scale.075': css({
|
|
300
|
-
padding: token('
|
|
351
|
+
padding: token('space.075', '6px'),
|
|
301
352
|
}),
|
|
302
353
|
'scale.100': css({
|
|
303
|
-
padding: token('
|
|
354
|
+
padding: token('space.100', '8px'),
|
|
355
|
+
}),
|
|
356
|
+
'scale.1000': css({
|
|
357
|
+
padding: token('space.1000', '80px'),
|
|
304
358
|
}),
|
|
305
359
|
'scale.150': css({
|
|
306
|
-
padding: token('
|
|
360
|
+
padding: token('space.150', '12px'),
|
|
307
361
|
}),
|
|
308
362
|
'scale.200': css({
|
|
309
|
-
padding: token('
|
|
363
|
+
padding: token('space.200', '16px'),
|
|
310
364
|
}),
|
|
311
365
|
'scale.250': css({
|
|
312
|
-
padding: token('
|
|
366
|
+
padding: token('space.250', '20px'),
|
|
313
367
|
}),
|
|
314
368
|
'scale.300': css({
|
|
315
|
-
padding: token('
|
|
369
|
+
padding: token('space.300', '24px'),
|
|
316
370
|
}),
|
|
317
371
|
'scale.400': css({
|
|
318
|
-
padding: token('
|
|
372
|
+
padding: token('space.400', '32px'),
|
|
319
373
|
}),
|
|
320
374
|
'scale.500': css({
|
|
321
|
-
padding: token('
|
|
375
|
+
padding: token('space.500', '40px'),
|
|
322
376
|
}),
|
|
323
377
|
'scale.600': css({
|
|
324
|
-
padding: token('
|
|
378
|
+
padding: token('space.600', '48px'),
|
|
379
|
+
}),
|
|
380
|
+
'scale.800': css({
|
|
381
|
+
padding: token('space.800', '64px'),
|
|
325
382
|
}),
|
|
326
383
|
};
|
|
327
384
|
|
|
@@ -329,40 +386,46 @@ export type Padding = keyof typeof paddingMap;
|
|
|
329
386
|
|
|
330
387
|
const paddingBlockMap = {
|
|
331
388
|
'scale.0': css({
|
|
332
|
-
paddingBlock: token('
|
|
389
|
+
paddingBlock: token('space.0', '0px'),
|
|
333
390
|
}),
|
|
334
391
|
'scale.025': css({
|
|
335
|
-
paddingBlock: token('
|
|
392
|
+
paddingBlock: token('space.025', '2px'),
|
|
336
393
|
}),
|
|
337
394
|
'scale.050': css({
|
|
338
|
-
paddingBlock: token('
|
|
395
|
+
paddingBlock: token('space.050', '4px'),
|
|
339
396
|
}),
|
|
340
397
|
'scale.075': css({
|
|
341
|
-
paddingBlock: token('
|
|
398
|
+
paddingBlock: token('space.075', '6px'),
|
|
342
399
|
}),
|
|
343
400
|
'scale.100': css({
|
|
344
|
-
paddingBlock: token('
|
|
401
|
+
paddingBlock: token('space.100', '8px'),
|
|
402
|
+
}),
|
|
403
|
+
'scale.1000': css({
|
|
404
|
+
paddingBlock: token('space.1000', '80px'),
|
|
345
405
|
}),
|
|
346
406
|
'scale.150': css({
|
|
347
|
-
paddingBlock: token('
|
|
407
|
+
paddingBlock: token('space.150', '12px'),
|
|
348
408
|
}),
|
|
349
409
|
'scale.200': css({
|
|
350
|
-
paddingBlock: token('
|
|
410
|
+
paddingBlock: token('space.200', '16px'),
|
|
351
411
|
}),
|
|
352
412
|
'scale.250': css({
|
|
353
|
-
paddingBlock: token('
|
|
413
|
+
paddingBlock: token('space.250', '20px'),
|
|
354
414
|
}),
|
|
355
415
|
'scale.300': css({
|
|
356
|
-
paddingBlock: token('
|
|
416
|
+
paddingBlock: token('space.300', '24px'),
|
|
357
417
|
}),
|
|
358
418
|
'scale.400': css({
|
|
359
|
-
paddingBlock: token('
|
|
419
|
+
paddingBlock: token('space.400', '32px'),
|
|
360
420
|
}),
|
|
361
421
|
'scale.500': css({
|
|
362
|
-
paddingBlock: token('
|
|
422
|
+
paddingBlock: token('space.500', '40px'),
|
|
363
423
|
}),
|
|
364
424
|
'scale.600': css({
|
|
365
|
-
paddingBlock: token('
|
|
425
|
+
paddingBlock: token('space.600', '48px'),
|
|
426
|
+
}),
|
|
427
|
+
'scale.800': css({
|
|
428
|
+
paddingBlock: token('space.800', '64px'),
|
|
366
429
|
}),
|
|
367
430
|
};
|
|
368
431
|
|
|
@@ -370,126 +433,50 @@ export type PaddingBlock = keyof typeof paddingBlockMap;
|
|
|
370
433
|
|
|
371
434
|
const paddingInlineMap = {
|
|
372
435
|
'scale.0': css({
|
|
373
|
-
paddingInline: token('
|
|
436
|
+
paddingInline: token('space.0', '0px'),
|
|
374
437
|
}),
|
|
375
438
|
'scale.025': css({
|
|
376
|
-
paddingInline: token('
|
|
439
|
+
paddingInline: token('space.025', '2px'),
|
|
377
440
|
}),
|
|
378
441
|
'scale.050': css({
|
|
379
|
-
paddingInline: token('
|
|
442
|
+
paddingInline: token('space.050', '4px'),
|
|
380
443
|
}),
|
|
381
444
|
'scale.075': css({
|
|
382
|
-
paddingInline: token('
|
|
445
|
+
paddingInline: token('space.075', '6px'),
|
|
383
446
|
}),
|
|
384
447
|
'scale.100': css({
|
|
385
|
-
paddingInline: token('
|
|
386
|
-
}),
|
|
387
|
-
'scale.150': css({
|
|
388
|
-
paddingInline: token('spacing.scale.150', '0.75rem'),
|
|
389
|
-
}),
|
|
390
|
-
'scale.200': css({
|
|
391
|
-
paddingInline: token('spacing.scale.200', '1rem'),
|
|
392
|
-
}),
|
|
393
|
-
'scale.250': css({
|
|
394
|
-
paddingInline: token('spacing.scale.250', '1.25rem'),
|
|
395
|
-
}),
|
|
396
|
-
'scale.300': css({
|
|
397
|
-
paddingInline: token('spacing.scale.300', '1.5rem'),
|
|
398
|
-
}),
|
|
399
|
-
'scale.400': css({
|
|
400
|
-
paddingInline: token('spacing.scale.400', '2rem'),
|
|
401
|
-
}),
|
|
402
|
-
'scale.500': css({
|
|
403
|
-
paddingInline: token('spacing.scale.500', '2.5rem'),
|
|
404
|
-
}),
|
|
405
|
-
'scale.600': css({
|
|
406
|
-
paddingInline: token('spacing.scale.600', '3rem'),
|
|
407
|
-
}),
|
|
408
|
-
};
|
|
409
|
-
|
|
410
|
-
export type PaddingInline = keyof typeof paddingInlineMap;
|
|
411
|
-
|
|
412
|
-
const widthMap = {
|
|
413
|
-
'scale.0': css({
|
|
414
|
-
width: token('spacing.scale.0', '0'),
|
|
415
|
-
}),
|
|
416
|
-
'scale.025': css({
|
|
417
|
-
width: token('spacing.scale.025', '0.125rem'),
|
|
418
|
-
}),
|
|
419
|
-
'scale.050': css({
|
|
420
|
-
width: token('spacing.scale.050', '0.25rem'),
|
|
421
|
-
}),
|
|
422
|
-
'scale.075': css({
|
|
423
|
-
width: token('spacing.scale.075', '0.375rem'),
|
|
448
|
+
paddingInline: token('space.100', '8px'),
|
|
424
449
|
}),
|
|
425
|
-
'scale.
|
|
426
|
-
|
|
450
|
+
'scale.1000': css({
|
|
451
|
+
paddingInline: token('space.1000', '80px'),
|
|
427
452
|
}),
|
|
428
453
|
'scale.150': css({
|
|
429
|
-
|
|
454
|
+
paddingInline: token('space.150', '12px'),
|
|
430
455
|
}),
|
|
431
456
|
'scale.200': css({
|
|
432
|
-
|
|
457
|
+
paddingInline: token('space.200', '16px'),
|
|
433
458
|
}),
|
|
434
459
|
'scale.250': css({
|
|
435
|
-
|
|
460
|
+
paddingInline: token('space.250', '20px'),
|
|
436
461
|
}),
|
|
437
462
|
'scale.300': css({
|
|
438
|
-
|
|
463
|
+
paddingInline: token('space.300', '24px'),
|
|
439
464
|
}),
|
|
440
465
|
'scale.400': css({
|
|
441
|
-
|
|
466
|
+
paddingInline: token('space.400', '32px'),
|
|
442
467
|
}),
|
|
443
468
|
'scale.500': css({
|
|
444
|
-
|
|
469
|
+
paddingInline: token('space.500', '40px'),
|
|
445
470
|
}),
|
|
446
471
|
'scale.600': css({
|
|
447
|
-
|
|
472
|
+
paddingInline: token('space.600', '48px'),
|
|
448
473
|
}),
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
export type Width = keyof typeof widthMap;
|
|
452
|
-
|
|
453
|
-
const heightMap = {
|
|
454
|
-
'scale.0': css({
|
|
455
|
-
height: token('spacing.scale.0', '0'),
|
|
456
|
-
}),
|
|
457
|
-
'scale.025': css({
|
|
458
|
-
height: token('spacing.scale.025', '0.125rem'),
|
|
459
|
-
}),
|
|
460
|
-
'scale.050': css({
|
|
461
|
-
height: token('spacing.scale.050', '0.25rem'),
|
|
462
|
-
}),
|
|
463
|
-
'scale.075': css({
|
|
464
|
-
height: token('spacing.scale.075', '0.375rem'),
|
|
465
|
-
}),
|
|
466
|
-
'scale.100': css({
|
|
467
|
-
height: token('spacing.scale.100', '0.5rem'),
|
|
468
|
-
}),
|
|
469
|
-
'scale.150': css({
|
|
470
|
-
height: token('spacing.scale.150', '0.75rem'),
|
|
471
|
-
}),
|
|
472
|
-
'scale.200': css({
|
|
473
|
-
height: token('spacing.scale.200', '1rem'),
|
|
474
|
-
}),
|
|
475
|
-
'scale.250': css({
|
|
476
|
-
height: token('spacing.scale.250', '1.25rem'),
|
|
477
|
-
}),
|
|
478
|
-
'scale.300': css({
|
|
479
|
-
height: token('spacing.scale.300', '1.5rem'),
|
|
480
|
-
}),
|
|
481
|
-
'scale.400': css({
|
|
482
|
-
height: token('spacing.scale.400', '2rem'),
|
|
483
|
-
}),
|
|
484
|
-
'scale.500': css({
|
|
485
|
-
height: token('spacing.scale.500', '2.5rem'),
|
|
486
|
-
}),
|
|
487
|
-
'scale.600': css({
|
|
488
|
-
height: token('spacing.scale.600', '3rem'),
|
|
474
|
+
'scale.800': css({
|
|
475
|
+
paddingInline: token('space.800', '64px'),
|
|
489
476
|
}),
|
|
490
477
|
};
|
|
491
478
|
|
|
492
|
-
export type
|
|
479
|
+
export type PaddingInline = keyof typeof paddingInlineMap;
|
|
493
480
|
|
|
494
481
|
/**
|
|
495
482
|
* @codegenEnd
|
|
@@ -69,6 +69,7 @@ const dividerStyles = css({
|
|
|
69
69
|
margin: '0 -2px',
|
|
70
70
|
color: token('color.text.subtle', '#42526E'),
|
|
71
71
|
pointerEvents: 'none',
|
|
72
|
+
userSelect: 'none',
|
|
72
73
|
});
|
|
73
74
|
|
|
74
75
|
const Divider: FC = ({ children }) => (
|
|
@@ -101,14 +102,26 @@ const Inline = memo(
|
|
|
101
102
|
flexWrap,
|
|
102
103
|
divider,
|
|
103
104
|
UNSAFE_style,
|
|
104
|
-
children,
|
|
105
|
+
children: rawChildren,
|
|
105
106
|
testId,
|
|
106
107
|
},
|
|
107
108
|
ref,
|
|
108
109
|
) => {
|
|
109
110
|
const dividerComponent =
|
|
110
111
|
typeof divider === 'string' ? <Divider>{divider}</Divider> : divider;
|
|
111
|
-
|
|
112
|
+
|
|
113
|
+
const children = divider
|
|
114
|
+
? Children.toArray(rawChildren)
|
|
115
|
+
.filter(Boolean)
|
|
116
|
+
.map((child, index) => {
|
|
117
|
+
return (
|
|
118
|
+
<Fragment key={index}>
|
|
119
|
+
{divider && index > 0 ? dividerComponent : null}
|
|
120
|
+
{child}
|
|
121
|
+
</Fragment>
|
|
122
|
+
);
|
|
123
|
+
})
|
|
124
|
+
: rawChildren;
|
|
112
125
|
|
|
113
126
|
return (
|
|
114
127
|
<div
|
|
@@ -123,14 +136,7 @@ const Inline = memo(
|
|
|
123
136
|
data-testid={testId}
|
|
124
137
|
ref={ref}
|
|
125
138
|
>
|
|
126
|
-
{
|
|
127
|
-
return (
|
|
128
|
-
<Fragment key={index}>
|
|
129
|
-
{divider && index > 0 ? dividerComponent : null}
|
|
130
|
-
{child}
|
|
131
|
-
</Fragment>
|
|
132
|
-
);
|
|
133
|
-
})}
|
|
139
|
+
{children}
|
|
134
140
|
</div>
|
|
135
141
|
);
|
|
136
142
|
},
|
|
@@ -143,7 +149,7 @@ export default Inline;
|
|
|
143
149
|
|
|
144
150
|
/**
|
|
145
151
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
146
|
-
* @codegen <<SignedSource::
|
|
152
|
+
* @codegen <<SignedSource::76168a57c8f10c9f325865d2189aa0ff>>
|
|
147
153
|
* @codegenId spacing
|
|
148
154
|
* @codegenCommand yarn codegen-styles
|
|
149
155
|
* @codegenParams ["columnGap"]
|
|
@@ -151,40 +157,46 @@ export default Inline;
|
|
|
151
157
|
*/
|
|
152
158
|
const columnGapMap = {
|
|
153
159
|
'scale.0': css({
|
|
154
|
-
columnGap: token('
|
|
160
|
+
columnGap: token('space.0', '0px'),
|
|
155
161
|
}),
|
|
156
162
|
'scale.025': css({
|
|
157
|
-
columnGap: token('
|
|
163
|
+
columnGap: token('space.025', '2px'),
|
|
158
164
|
}),
|
|
159
165
|
'scale.050': css({
|
|
160
|
-
columnGap: token('
|
|
166
|
+
columnGap: token('space.050', '4px'),
|
|
161
167
|
}),
|
|
162
168
|
'scale.075': css({
|
|
163
|
-
columnGap: token('
|
|
169
|
+
columnGap: token('space.075', '6px'),
|
|
164
170
|
}),
|
|
165
171
|
'scale.100': css({
|
|
166
|
-
columnGap: token('
|
|
172
|
+
columnGap: token('space.100', '8px'),
|
|
173
|
+
}),
|
|
174
|
+
'scale.1000': css({
|
|
175
|
+
columnGap: token('space.1000', '80px'),
|
|
167
176
|
}),
|
|
168
177
|
'scale.150': css({
|
|
169
|
-
columnGap: token('
|
|
178
|
+
columnGap: token('space.150', '12px'),
|
|
170
179
|
}),
|
|
171
180
|
'scale.200': css({
|
|
172
|
-
columnGap: token('
|
|
181
|
+
columnGap: token('space.200', '16px'),
|
|
173
182
|
}),
|
|
174
183
|
'scale.250': css({
|
|
175
|
-
columnGap: token('
|
|
184
|
+
columnGap: token('space.250', '20px'),
|
|
176
185
|
}),
|
|
177
186
|
'scale.300': css({
|
|
178
|
-
columnGap: token('
|
|
187
|
+
columnGap: token('space.300', '24px'),
|
|
179
188
|
}),
|
|
180
189
|
'scale.400': css({
|
|
181
|
-
columnGap: token('
|
|
190
|
+
columnGap: token('space.400', '32px'),
|
|
182
191
|
}),
|
|
183
192
|
'scale.500': css({
|
|
184
|
-
columnGap: token('
|
|
193
|
+
columnGap: token('space.500', '40px'),
|
|
185
194
|
}),
|
|
186
195
|
'scale.600': css({
|
|
187
|
-
columnGap: token('
|
|
196
|
+
columnGap: token('space.600', '48px'),
|
|
197
|
+
}),
|
|
198
|
+
'scale.800': css({
|
|
199
|
+
columnGap: token('space.800', '64px'),
|
|
188
200
|
}),
|
|
189
201
|
};
|
|
190
202
|
|
|
@@ -107,7 +107,7 @@ export default Stack;
|
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
109
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
110
|
-
* @codegen <<SignedSource::
|
|
110
|
+
* @codegen <<SignedSource::2b10240c217de584b627a7e2f56d11a0>>
|
|
111
111
|
* @codegenId spacing
|
|
112
112
|
* @codegenCommand yarn codegen-styles
|
|
113
113
|
* @codegenParams ["rowGap"]
|
|
@@ -115,40 +115,46 @@ export default Stack;
|
|
|
115
115
|
*/
|
|
116
116
|
const rowGapMap = {
|
|
117
117
|
'scale.0': css({
|
|
118
|
-
rowGap: token('
|
|
118
|
+
rowGap: token('space.0', '0px'),
|
|
119
119
|
}),
|
|
120
120
|
'scale.025': css({
|
|
121
|
-
rowGap: token('
|
|
121
|
+
rowGap: token('space.025', '2px'),
|
|
122
122
|
}),
|
|
123
123
|
'scale.050': css({
|
|
124
|
-
rowGap: token('
|
|
124
|
+
rowGap: token('space.050', '4px'),
|
|
125
125
|
}),
|
|
126
126
|
'scale.075': css({
|
|
127
|
-
rowGap: token('
|
|
127
|
+
rowGap: token('space.075', '6px'),
|
|
128
128
|
}),
|
|
129
129
|
'scale.100': css({
|
|
130
|
-
rowGap: token('
|
|
130
|
+
rowGap: token('space.100', '8px'),
|
|
131
|
+
}),
|
|
132
|
+
'scale.1000': css({
|
|
133
|
+
rowGap: token('space.1000', '80px'),
|
|
131
134
|
}),
|
|
132
135
|
'scale.150': css({
|
|
133
|
-
rowGap: token('
|
|
136
|
+
rowGap: token('space.150', '12px'),
|
|
134
137
|
}),
|
|
135
138
|
'scale.200': css({
|
|
136
|
-
rowGap: token('
|
|
139
|
+
rowGap: token('space.200', '16px'),
|
|
137
140
|
}),
|
|
138
141
|
'scale.250': css({
|
|
139
|
-
rowGap: token('
|
|
142
|
+
rowGap: token('space.250', '20px'),
|
|
140
143
|
}),
|
|
141
144
|
'scale.300': css({
|
|
142
|
-
rowGap: token('
|
|
145
|
+
rowGap: token('space.300', '24px'),
|
|
143
146
|
}),
|
|
144
147
|
'scale.400': css({
|
|
145
|
-
rowGap: token('
|
|
148
|
+
rowGap: token('space.400', '32px'),
|
|
146
149
|
}),
|
|
147
150
|
'scale.500': css({
|
|
148
|
-
rowGap: token('
|
|
151
|
+
rowGap: token('space.500', '40px'),
|
|
149
152
|
}),
|
|
150
153
|
'scale.600': css({
|
|
151
|
-
rowGap: token('
|
|
154
|
+
rowGap: token('space.600', '48px'),
|
|
155
|
+
}),
|
|
156
|
+
'scale.800': css({
|
|
157
|
+
rowGap: token('space.800', '64px'),
|
|
152
158
|
}),
|
|
153
159
|
};
|
|
154
160
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Internal codegen of the spacing scale values. Only used for internal examples.
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::d351e41acd06f256fb46554409694f31>>
|
|
7
7
|
* @codegenCommand yarn codegen-styles
|
|
8
8
|
*/
|
|
9
9
|
export const spacingScale = [
|
|
@@ -19,4 +19,6 @@ export const spacingScale = [
|
|
|
19
19
|
'scale.400',
|
|
20
20
|
'scale.500',
|
|
21
21
|
'scale.600',
|
|
22
|
+
'scale.800',
|
|
23
|
+
'scale.1000',
|
|
22
24
|
] as const;
|