@atlaskit/primitives 0.7.0 → 0.8.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 +20 -0
- package/constellation/accessibility/examples.mdx +9 -0
- package/constellation/box/code.mdx +9 -0
- package/constellation/box/examples.mdx +9 -0
- package/constellation/overview/examples.mdx +9 -0
- package/dist/cjs/components/{inline.partial.js → inline.js} +2 -34
- package/dist/cjs/components/stack.js +86 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/internal/style-maps.partial.js +34 -6
- package/dist/cjs/internal/xcss.js +5 -9
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/{inline.partial.js → inline.js} +2 -58
- package/dist/es2019/components/stack.js +79 -0
- package/dist/es2019/index.js +2 -2
- package/dist/es2019/internal/style-maps.partial.js +30 -5
- package/dist/es2019/internal/xcss.js +5 -8
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/{inline.partial.js → inline.js} +2 -33
- package/dist/esm/components/stack.js +78 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/internal/style-maps.partial.js +30 -5
- package/dist/esm/internal/xcss.js +5 -8
- package/dist/esm/version.json +1 -1
- package/dist/types/components/{inline.partial.d.ts → inline.d.ts} +1 -28
- package/dist/types/components/{stack.partial.d.ts → stack.d.ts} +1 -27
- package/dist/types/index.d.ts +2 -2
- package/dist/types/internal/style-maps.partial.d.ts +31 -5
- package/dist/types/internal/xcss.d.ts +1 -6
- package/inline/package.json +5 -5
- package/package.json +35 -9
- package/report.api.md +31 -47
- package/scripts/codegen-file-templates/flex-direction.tsx +6 -0
- package/scripts/codegen-styles.tsx +70 -71
- package/scripts/misc-codegen-template.tsx +1 -0
- package/scripts/spacing-codegen-template.tsx +1 -6
- package/stack/package.json +5 -5
- package/tmp/api-report-tmp.d.ts +31 -47
- package/dist/cjs/components/stack.partial.js +0 -118
- package/dist/es2019/components/stack.partial.js +0 -135
- package/dist/esm/components/stack.partial.js +0 -109
package/report.api.md
CHANGED
|
@@ -31,7 +31,6 @@ import { ReactElement } from 'react';
|
|
|
31
31
|
import { ReactNode } from 'react';
|
|
32
32
|
import { RefAttributes } from 'react';
|
|
33
33
|
import { SerializedStyles } from '@emotion/serialize';
|
|
34
|
-
import { SerializedStyles as SerializedStyles_2 } from '@emotion/react';
|
|
35
34
|
|
|
36
35
|
// @public (undocumented)
|
|
37
36
|
type AlignBlock = 'baseline' | 'center' | 'end' | 'start';
|
|
@@ -315,6 +314,15 @@ type Display = 'block' | 'flex' | 'inline' | 'inline-block' | 'inline-flex';
|
|
|
315
314
|
// @public (undocumented)
|
|
316
315
|
type Flex = keyof typeof flexMap;
|
|
317
316
|
|
|
317
|
+
// @public (undocumented)
|
|
318
|
+
type FlexDirection = keyof typeof flexDirectionMap;
|
|
319
|
+
|
|
320
|
+
// @public (undocumented)
|
|
321
|
+
const flexDirectionMap: {
|
|
322
|
+
readonly row: 'row';
|
|
323
|
+
readonly column: 'column';
|
|
324
|
+
};
|
|
325
|
+
|
|
318
326
|
// @public (undocumented)
|
|
319
327
|
type FlexGrow = keyof typeof flexGrowMap;
|
|
320
328
|
|
|
@@ -339,10 +347,7 @@ const flexShrinkMap: {
|
|
|
339
347
|
};
|
|
340
348
|
|
|
341
349
|
// @public (undocumented)
|
|
342
|
-
type Gap = keyof typeof
|
|
343
|
-
|
|
344
|
-
// @public (undocumented)
|
|
345
|
-
type Gap_2 = keyof typeof stackSpaceMap.gap;
|
|
350
|
+
type Gap = keyof typeof spaceMap;
|
|
346
351
|
|
|
347
352
|
// @public (undocumented)
|
|
348
353
|
type Grow = 'fill' | 'hug';
|
|
@@ -390,26 +395,6 @@ export interface InlineProps<T extends ElementType = 'div'> {
|
|
|
390
395
|
testId?: string;
|
|
391
396
|
}
|
|
392
397
|
|
|
393
|
-
// @public
|
|
394
|
-
const inlineSpaceMap: {
|
|
395
|
-
[k: string]: {
|
|
396
|
-
readonly '0': SerializedStyles_2;
|
|
397
|
-
readonly '025': SerializedStyles_2;
|
|
398
|
-
readonly '050': SerializedStyles_2;
|
|
399
|
-
readonly '075': SerializedStyles_2;
|
|
400
|
-
readonly '100': SerializedStyles_2;
|
|
401
|
-
readonly '150': SerializedStyles_2;
|
|
402
|
-
readonly '200': SerializedStyles_2;
|
|
403
|
-
readonly '250': SerializedStyles_2;
|
|
404
|
-
readonly '300': SerializedStyles_2;
|
|
405
|
-
readonly '400': SerializedStyles_2;
|
|
406
|
-
readonly '500': SerializedStyles_2;
|
|
407
|
-
readonly '600': SerializedStyles_2;
|
|
408
|
-
readonly '800': SerializedStyles_2;
|
|
409
|
-
readonly '1000': SerializedStyles_2;
|
|
410
|
-
};
|
|
411
|
-
};
|
|
412
|
-
|
|
413
398
|
// @public (undocumented)
|
|
414
399
|
type InlineStyles = SerializedStyles & {
|
|
415
400
|
[inlineTag]: true;
|
|
@@ -529,7 +514,7 @@ type PublicBoxPropsBase = {
|
|
|
529
514
|
};
|
|
530
515
|
|
|
531
516
|
// @public (undocumented)
|
|
532
|
-
type RowGap = keyof typeof
|
|
517
|
+
type RowGap = keyof typeof spaceMap;
|
|
533
518
|
|
|
534
519
|
// @public (undocumented)
|
|
535
520
|
type SafeCSSObject = CSSPseudos &
|
|
@@ -554,6 +539,24 @@ const shadowMap: {
|
|
|
554
539
|
readonly raised: 'var(--ds-shadow-raised)';
|
|
555
540
|
};
|
|
556
541
|
|
|
542
|
+
// @public (undocumented)
|
|
543
|
+
const spaceMap: {
|
|
544
|
+
readonly 'space.0': 'var(--ds-space-0)';
|
|
545
|
+
readonly 'space.025': 'var(--ds-space-025)';
|
|
546
|
+
readonly 'space.050': 'var(--ds-space-050)';
|
|
547
|
+
readonly 'space.075': 'var(--ds-space-075)';
|
|
548
|
+
readonly 'space.100': 'var(--ds-space-100)';
|
|
549
|
+
readonly 'space.150': 'var(--ds-space-150)';
|
|
550
|
+
readonly 'space.200': 'var(--ds-space-200)';
|
|
551
|
+
readonly 'space.250': 'var(--ds-space-250)';
|
|
552
|
+
readonly 'space.300': 'var(--ds-space-300)';
|
|
553
|
+
readonly 'space.400': 'var(--ds-space-400)';
|
|
554
|
+
readonly 'space.500': 'var(--ds-space-500)';
|
|
555
|
+
readonly 'space.600': 'var(--ds-space-600)';
|
|
556
|
+
readonly 'space.800': 'var(--ds-space-800)';
|
|
557
|
+
readonly 'space.1000': 'var(--ds-space-1000)';
|
|
558
|
+
};
|
|
559
|
+
|
|
557
560
|
// @public (undocumented)
|
|
558
561
|
type Spread = 'space-between';
|
|
559
562
|
|
|
@@ -586,31 +589,11 @@ export interface StackProps<T extends ElementType = 'div'> {
|
|
|
586
589
|
children: ReactNode;
|
|
587
590
|
grow?: Grow_2;
|
|
588
591
|
ref?: ComponentPropsWithRef<T>['ref'];
|
|
589
|
-
space?:
|
|
592
|
+
space?: Gap;
|
|
590
593
|
spread?: Spread_2;
|
|
591
594
|
testId?: string;
|
|
592
595
|
}
|
|
593
596
|
|
|
594
|
-
// @public
|
|
595
|
-
const stackSpaceMap: {
|
|
596
|
-
[k: string]: {
|
|
597
|
-
readonly '0': SerializedStyles_2;
|
|
598
|
-
readonly '025': SerializedStyles_2;
|
|
599
|
-
readonly '050': SerializedStyles_2;
|
|
600
|
-
readonly '075': SerializedStyles_2;
|
|
601
|
-
readonly '100': SerializedStyles_2;
|
|
602
|
-
readonly '150': SerializedStyles_2;
|
|
603
|
-
readonly '200': SerializedStyles_2;
|
|
604
|
-
readonly '250': SerializedStyles_2;
|
|
605
|
-
readonly '300': SerializedStyles_2;
|
|
606
|
-
readonly '400': SerializedStyles_2;
|
|
607
|
-
readonly '500': SerializedStyles_2;
|
|
608
|
-
readonly '600': SerializedStyles_2;
|
|
609
|
-
readonly '800': SerializedStyles_2;
|
|
610
|
-
readonly '1000': SerializedStyles_2;
|
|
611
|
-
};
|
|
612
|
-
};
|
|
613
|
-
|
|
614
597
|
// @public (undocumented)
|
|
615
598
|
type TextColor = keyof typeof textColorMap;
|
|
616
599
|
|
|
@@ -659,6 +642,7 @@ type TokenisedProps = {
|
|
|
659
642
|
borderWidth?: BorderWidth;
|
|
660
643
|
display?: Display;
|
|
661
644
|
flex?: Flex;
|
|
645
|
+
flexDirection?: FlexDirection;
|
|
662
646
|
flexGrow?: FlexGrow;
|
|
663
647
|
flexShrink?: FlexShrink;
|
|
664
648
|
height?: Height;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { readdirSync, writeFileSync } from 'fs';
|
|
3
3
|
import { join } from 'path';
|
|
4
4
|
|
|
5
|
-
import { createPartialSignedArtifact } from '@
|
|
5
|
+
import { createPartialSignedArtifact } from '@atlassian/codegen';
|
|
6
6
|
|
|
7
7
|
import { createBorderStylesFromTemplate } from './border-codegen-template';
|
|
8
8
|
import { createColorStylesFromTemplate } from './color-codegen-template';
|
|
@@ -18,82 +18,81 @@ const spacingTokensDependencyPath = require.resolve(
|
|
|
18
18
|
const shapeTokensDependencyPath = require.resolve(
|
|
19
19
|
'../../tokens/src/artifacts/tokens-raw/atlassian-shape',
|
|
20
20
|
);
|
|
21
|
+
|
|
21
22
|
const templateFiles = readdirSync(join(__dirname, 'codegen-file-templates'), {
|
|
22
23
|
withFileTypes: true,
|
|
23
24
|
})
|
|
24
25
|
.filter(item => !item.isDirectory())
|
|
25
26
|
.map(item => join(__dirname, 'codegen-file-templates', item.name));
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
const sourceFns = [
|
|
37
|
-
// width, height, minWidth, maxWidth, minHeight, maxHeight
|
|
38
|
-
() =>
|
|
39
|
-
createPartialSignedArtifact(
|
|
40
|
-
options => options.map(createStylesFromFileTemplate).join('\n'),
|
|
41
|
-
'yarn codegen-styles',
|
|
42
|
-
{
|
|
43
|
-
id: 'dimensions',
|
|
44
|
-
absoluteFilePath: targetPath,
|
|
45
|
-
dependencies: templateFiles.filter(v => v.includes('dimensions')),
|
|
46
|
-
},
|
|
47
|
-
),
|
|
48
|
-
// padding, paddingBlock, paddingBlockStart, paddingBlockEnd, paddingInline, paddingInlineStart, paddingInlineEnd, gap, rowGap
|
|
49
|
-
() =>
|
|
50
|
-
createPartialSignedArtifact(
|
|
51
|
-
options => options.map(createSpacingStylesFromTemplate).join('\n'),
|
|
52
|
-
'yarn codegen-styles',
|
|
53
|
-
{
|
|
54
|
-
id: 'spacing',
|
|
55
|
-
absoluteFilePath: targetPath,
|
|
56
|
-
dependencies: [spacingTokensDependencyPath],
|
|
57
|
-
},
|
|
58
|
-
),
|
|
59
|
-
// text color, background-color, border-color, shadow
|
|
60
|
-
() =>
|
|
61
|
-
createPartialSignedArtifact(
|
|
62
|
-
options => options.map(createColorStylesFromTemplate).join('\n'),
|
|
63
|
-
'yarn codegen-styles',
|
|
64
|
-
{
|
|
65
|
-
id: 'colors',
|
|
66
|
-
absoluteFilePath: targetPath,
|
|
67
|
-
dependencies: [colorTokensDependencyPath],
|
|
68
|
-
},
|
|
69
|
-
),
|
|
70
|
-
// border-width, border-radius
|
|
71
|
-
() =>
|
|
72
|
-
createPartialSignedArtifact(
|
|
73
|
-
options => options.map(createBorderStylesFromTemplate).join('\n'),
|
|
74
|
-
'yarn codegen-styles',
|
|
75
|
-
{
|
|
76
|
-
id: 'border',
|
|
77
|
-
absoluteFilePath: targetPath,
|
|
78
|
-
dependencies: [shapeTokensDependencyPath],
|
|
79
|
-
},
|
|
80
|
-
),
|
|
81
|
-
// align-self, border-color, border-radius, border-style, border-width, display, flex-grow, flex-shrink, flex, layer, overflow, position',
|
|
82
|
-
() =>
|
|
83
|
-
createPartialSignedArtifact(
|
|
84
|
-
options => options.map(createStylesFromFileTemplate).join('\n'),
|
|
85
|
-
'yarn codegen-styles',
|
|
86
|
-
{
|
|
87
|
-
id: 'misc',
|
|
88
|
-
absoluteFilePath: targetPath,
|
|
89
|
-
dependencies: templateFiles,
|
|
90
|
-
},
|
|
91
|
-
),
|
|
92
|
-
];
|
|
28
|
+
const targetPath = join(
|
|
29
|
+
__dirname,
|
|
30
|
+
'../',
|
|
31
|
+
'src',
|
|
32
|
+
'internal',
|
|
33
|
+
'style-maps.partial.tsx',
|
|
34
|
+
);
|
|
93
35
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
36
|
+
const sourceFns = [
|
|
37
|
+
// width, height, minWidth, maxWidth, minHeight, maxHeight
|
|
38
|
+
() =>
|
|
39
|
+
createPartialSignedArtifact(
|
|
40
|
+
options => options.map(createStylesFromFileTemplate).join('\n'),
|
|
41
|
+
'yarn codegen-styles',
|
|
42
|
+
{
|
|
43
|
+
id: 'dimensions',
|
|
44
|
+
absoluteFilePath: targetPath,
|
|
45
|
+
dependencies: templateFiles.filter(v => v.includes('dimensions')),
|
|
46
|
+
},
|
|
47
|
+
),
|
|
48
|
+
// padding, paddingBlock, paddingBlockStart, paddingBlockEnd, paddingInline, paddingInlineStart, paddingInlineEnd, gap, rowGap
|
|
49
|
+
() =>
|
|
50
|
+
createPartialSignedArtifact(
|
|
51
|
+
options => options.map(createSpacingStylesFromTemplate).join('\n'),
|
|
52
|
+
'yarn codegen-styles',
|
|
53
|
+
{
|
|
54
|
+
id: 'spacing',
|
|
55
|
+
absoluteFilePath: targetPath,
|
|
56
|
+
dependencies: [spacingTokensDependencyPath],
|
|
57
|
+
},
|
|
58
|
+
),
|
|
59
|
+
// text color, background-color, border-color, shadow
|
|
60
|
+
() =>
|
|
61
|
+
createPartialSignedArtifact(
|
|
62
|
+
options => options.map(createColorStylesFromTemplate).join('\n'),
|
|
63
|
+
'yarn codegen-styles',
|
|
64
|
+
{
|
|
65
|
+
id: 'colors',
|
|
66
|
+
absoluteFilePath: targetPath,
|
|
67
|
+
dependencies: [colorTokensDependencyPath],
|
|
68
|
+
},
|
|
69
|
+
),
|
|
70
|
+
// border-width, border-radius
|
|
71
|
+
() =>
|
|
72
|
+
createPartialSignedArtifact(
|
|
73
|
+
options => options.map(createBorderStylesFromTemplate).join('\n'),
|
|
74
|
+
'yarn codegen-styles',
|
|
75
|
+
{
|
|
76
|
+
id: 'border',
|
|
77
|
+
absoluteFilePath: targetPath,
|
|
78
|
+
dependencies: [shapeTokensDependencyPath],
|
|
79
|
+
},
|
|
80
|
+
),
|
|
81
|
+
// align-self, border-color, border-radius, border-style, border-width, display, flex-grow, flex-shrink, flex, layer, overflow, position',
|
|
82
|
+
() =>
|
|
83
|
+
createPartialSignedArtifact(
|
|
84
|
+
options => options.map(createStylesFromFileTemplate).join('\n'),
|
|
85
|
+
'yarn codegen-styles',
|
|
86
|
+
{
|
|
87
|
+
id: 'misc',
|
|
88
|
+
absoluteFilePath: targetPath,
|
|
89
|
+
dependencies: templateFiles,
|
|
90
|
+
},
|
|
91
|
+
),
|
|
92
|
+
];
|
|
97
93
|
|
|
98
|
-
|
|
94
|
+
sourceFns.forEach(sourceFn => {
|
|
95
|
+
writeFileSync(targetPath, sourceFn());
|
|
99
96
|
});
|
|
97
|
+
|
|
98
|
+
console.log(`${targetPath} written!`);
|
|
@@ -23,13 +23,8 @@ const spacingProperties: Record<
|
|
|
23
23
|
'paddingInlineEnd',
|
|
24
24
|
],
|
|
25
25
|
},
|
|
26
|
-
|
|
26
|
+
space: {
|
|
27
27
|
cssProperties: ['gap', 'rowGap'],
|
|
28
|
-
propNameFormatter: tokenName => tokenName.replace(spacingTokenPrefix, ''),
|
|
29
|
-
},
|
|
30
|
-
stackSpace: {
|
|
31
|
-
cssProperties: ['gap'],
|
|
32
|
-
propNameFormatter: tokenName => tokenName.replace(spacingTokenPrefix, ''),
|
|
33
28
|
},
|
|
34
29
|
} as const;
|
|
35
30
|
|
package/stack/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/primitives/stack",
|
|
3
|
-
"main": "../dist/cjs/components/stack.
|
|
4
|
-
"module": "../dist/esm/components/stack.
|
|
5
|
-
"module:es2019": "../dist/es2019/components/stack.
|
|
3
|
+
"main": "../dist/cjs/components/stack.js",
|
|
4
|
+
"module": "../dist/esm/components/stack.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/components/stack.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/components/stack.
|
|
7
|
+
"types": "../dist/types/components/stack.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
9
|
">=4.0 <4.5": {
|
|
10
10
|
"*": [
|
|
11
|
-
"../dist/types-ts4.0/components/stack.
|
|
11
|
+
"../dist/types-ts4.0/components/stack.d.ts"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
}
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -20,7 +20,6 @@ import { ReactElement } from 'react';
|
|
|
20
20
|
import { ReactNode } from 'react';
|
|
21
21
|
import { RefAttributes } from 'react';
|
|
22
22
|
import { SerializedStyles } from '@emotion/serialize';
|
|
23
|
-
import { SerializedStyles as SerializedStyles_2 } from '@emotion/react';
|
|
24
23
|
|
|
25
24
|
// @public (undocumented)
|
|
26
25
|
type AlignBlock = 'baseline' | 'center' | 'end' | 'start';
|
|
@@ -290,6 +289,15 @@ type Display = 'block' | 'flex' | 'inline' | 'inline-block' | 'inline-flex';
|
|
|
290
289
|
// @public (undocumented)
|
|
291
290
|
type Flex = keyof typeof flexMap;
|
|
292
291
|
|
|
292
|
+
// @public (undocumented)
|
|
293
|
+
type FlexDirection = keyof typeof flexDirectionMap;
|
|
294
|
+
|
|
295
|
+
// @public (undocumented)
|
|
296
|
+
const flexDirectionMap: {
|
|
297
|
+
readonly row: "row";
|
|
298
|
+
readonly column: "column";
|
|
299
|
+
};
|
|
300
|
+
|
|
293
301
|
// @public (undocumented)
|
|
294
302
|
type FlexGrow = keyof typeof flexGrowMap;
|
|
295
303
|
|
|
@@ -314,10 +322,7 @@ const flexShrinkMap: {
|
|
|
314
322
|
};
|
|
315
323
|
|
|
316
324
|
// @public (undocumented)
|
|
317
|
-
type Gap = keyof typeof
|
|
318
|
-
|
|
319
|
-
// @public (undocumented)
|
|
320
|
-
type Gap_2 = keyof typeof stackSpaceMap.gap;
|
|
325
|
+
type Gap = keyof typeof spaceMap;
|
|
321
326
|
|
|
322
327
|
// @public (undocumented)
|
|
323
328
|
type Grow = 'fill' | 'hug';
|
|
@@ -347,26 +352,6 @@ export interface InlineProps<T extends ElementType = 'div'> {
|
|
|
347
352
|
testId?: string;
|
|
348
353
|
}
|
|
349
354
|
|
|
350
|
-
// @public
|
|
351
|
-
const inlineSpaceMap: {
|
|
352
|
-
[k: string]: {
|
|
353
|
-
readonly '0': SerializedStyles_2;
|
|
354
|
-
readonly '025': SerializedStyles_2;
|
|
355
|
-
readonly '050': SerializedStyles_2;
|
|
356
|
-
readonly '075': SerializedStyles_2;
|
|
357
|
-
readonly '100': SerializedStyles_2;
|
|
358
|
-
readonly '150': SerializedStyles_2;
|
|
359
|
-
readonly '200': SerializedStyles_2;
|
|
360
|
-
readonly '250': SerializedStyles_2;
|
|
361
|
-
readonly '300': SerializedStyles_2;
|
|
362
|
-
readonly '400': SerializedStyles_2;
|
|
363
|
-
readonly '500': SerializedStyles_2;
|
|
364
|
-
readonly '600': SerializedStyles_2;
|
|
365
|
-
readonly '800': SerializedStyles_2;
|
|
366
|
-
readonly '1000': SerializedStyles_2;
|
|
367
|
-
};
|
|
368
|
-
};
|
|
369
|
-
|
|
370
355
|
// @public (undocumented)
|
|
371
356
|
type InlineStyles = SerializedStyles & {
|
|
372
357
|
[inlineTag]: true;
|
|
@@ -486,7 +471,7 @@ type PublicBoxPropsBase = {
|
|
|
486
471
|
};
|
|
487
472
|
|
|
488
473
|
// @public (undocumented)
|
|
489
|
-
type RowGap = keyof typeof
|
|
474
|
+
type RowGap = keyof typeof spaceMap;
|
|
490
475
|
|
|
491
476
|
// @public (undocumented)
|
|
492
477
|
type SafeCSSObject = CSSPseudos & TokenisedProps & Omit<CSSPropertiesWithMultiValues, keyof TokenisedProps>;
|
|
@@ -506,6 +491,24 @@ const shadowMap: {
|
|
|
506
491
|
readonly raised: "var(--ds-shadow-raised)";
|
|
507
492
|
};
|
|
508
493
|
|
|
494
|
+
// @public (undocumented)
|
|
495
|
+
const spaceMap: {
|
|
496
|
+
readonly 'space.0': "var(--ds-space-0)";
|
|
497
|
+
readonly 'space.025': "var(--ds-space-025)";
|
|
498
|
+
readonly 'space.050': "var(--ds-space-050)";
|
|
499
|
+
readonly 'space.075': "var(--ds-space-075)";
|
|
500
|
+
readonly 'space.100': "var(--ds-space-100)";
|
|
501
|
+
readonly 'space.150': "var(--ds-space-150)";
|
|
502
|
+
readonly 'space.200': "var(--ds-space-200)";
|
|
503
|
+
readonly 'space.250': "var(--ds-space-250)";
|
|
504
|
+
readonly 'space.300': "var(--ds-space-300)";
|
|
505
|
+
readonly 'space.400': "var(--ds-space-400)";
|
|
506
|
+
readonly 'space.500': "var(--ds-space-500)";
|
|
507
|
+
readonly 'space.600': "var(--ds-space-600)";
|
|
508
|
+
readonly 'space.800': "var(--ds-space-800)";
|
|
509
|
+
readonly 'space.1000': "var(--ds-space-1000)";
|
|
510
|
+
};
|
|
511
|
+
|
|
509
512
|
// @public (undocumented)
|
|
510
513
|
type Spread = 'space-between';
|
|
511
514
|
|
|
@@ -523,31 +526,11 @@ export interface StackProps<T extends ElementType = 'div'> {
|
|
|
523
526
|
children: ReactNode;
|
|
524
527
|
grow?: Grow_2;
|
|
525
528
|
ref?: ComponentPropsWithRef<T>['ref'];
|
|
526
|
-
space?:
|
|
529
|
+
space?: Gap;
|
|
527
530
|
spread?: Spread_2;
|
|
528
531
|
testId?: string;
|
|
529
532
|
}
|
|
530
533
|
|
|
531
|
-
// @public
|
|
532
|
-
const stackSpaceMap: {
|
|
533
|
-
[k: string]: {
|
|
534
|
-
readonly '0': SerializedStyles_2;
|
|
535
|
-
readonly '025': SerializedStyles_2;
|
|
536
|
-
readonly '050': SerializedStyles_2;
|
|
537
|
-
readonly '075': SerializedStyles_2;
|
|
538
|
-
readonly '100': SerializedStyles_2;
|
|
539
|
-
readonly '150': SerializedStyles_2;
|
|
540
|
-
readonly '200': SerializedStyles_2;
|
|
541
|
-
readonly '250': SerializedStyles_2;
|
|
542
|
-
readonly '300': SerializedStyles_2;
|
|
543
|
-
readonly '400': SerializedStyles_2;
|
|
544
|
-
readonly '500': SerializedStyles_2;
|
|
545
|
-
readonly '600': SerializedStyles_2;
|
|
546
|
-
readonly '800': SerializedStyles_2;
|
|
547
|
-
readonly '1000': SerializedStyles_2;
|
|
548
|
-
};
|
|
549
|
-
};
|
|
550
|
-
|
|
551
534
|
// @public (undocumented)
|
|
552
535
|
type TextColor = keyof typeof textColorMap;
|
|
553
536
|
|
|
@@ -596,6 +579,7 @@ type TokenisedProps = {
|
|
|
596
579
|
borderWidth?: BorderWidth;
|
|
597
580
|
display?: Display;
|
|
598
581
|
flex?: Flex;
|
|
582
|
+
flexDirection?: FlexDirection;
|
|
599
583
|
flexGrow?: FlexGrow;
|
|
600
584
|
flexShrink?: FlexShrink;
|
|
601
585
|
height?: Height;
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _react = require("react");
|
|
10
|
-
var _react2 = require("@emotion/react");
|
|
11
|
-
/* eslint-disable @repo/internal/styles/no-exported-styles */
|
|
12
|
-
/** @jsx jsx */
|
|
13
|
-
|
|
14
|
-
var justifyContentMap = {
|
|
15
|
-
start: (0, _react2.css)({
|
|
16
|
-
justifyContent: 'start'
|
|
17
|
-
}),
|
|
18
|
-
center: (0, _react2.css)({
|
|
19
|
-
justifyContent: 'center'
|
|
20
|
-
}),
|
|
21
|
-
end: (0, _react2.css)({
|
|
22
|
-
justifyContent: 'end'
|
|
23
|
-
}),
|
|
24
|
-
'space-between': (0, _react2.css)({
|
|
25
|
-
justifyContent: 'space-between'
|
|
26
|
-
})
|
|
27
|
-
};
|
|
28
|
-
var alignItemsMap = {
|
|
29
|
-
start: (0, _react2.css)({
|
|
30
|
-
alignItems: 'start'
|
|
31
|
-
}),
|
|
32
|
-
center: (0, _react2.css)({
|
|
33
|
-
alignItems: 'center'
|
|
34
|
-
}),
|
|
35
|
-
end: (0, _react2.css)({
|
|
36
|
-
alignItems: 'end'
|
|
37
|
-
})
|
|
38
|
-
};
|
|
39
|
-
var flexGrowMap = {
|
|
40
|
-
hug: (0, _react2.css)({
|
|
41
|
-
flexGrow: 0
|
|
42
|
-
}),
|
|
43
|
-
fill: (0, _react2.css)({
|
|
44
|
-
width: '100%',
|
|
45
|
-
flexGrow: 1
|
|
46
|
-
})
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
51
|
-
* @codegen <<SignedSource::4eb2c996d6ce5791acad51e2b226635f>>
|
|
52
|
-
* @codegenId spacing
|
|
53
|
-
* @codegenCommand yarn codegen-styles
|
|
54
|
-
* @codegenParams ["stackSpace"]
|
|
55
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
56
|
-
*/
|
|
57
|
-
var stackSpaceMap = Object.fromEntries(['gap'].map(function (property) {
|
|
58
|
-
return [property, {
|
|
59
|
-
'0': (0, _react2.css)((0, _defineProperty2.default)({}, property, "var(--ds-space-0, 0px)")),
|
|
60
|
-
'025': (0, _react2.css)((0, _defineProperty2.default)({}, property, "var(--ds-space-025, 2px)")),
|
|
61
|
-
'050': (0, _react2.css)((0, _defineProperty2.default)({}, property, "var(--ds-space-050, 4px)")),
|
|
62
|
-
'075': (0, _react2.css)((0, _defineProperty2.default)({}, property, "var(--ds-space-075, 6px)")),
|
|
63
|
-
'100': (0, _react2.css)((0, _defineProperty2.default)({}, property, "var(--ds-space-100, 8px)")),
|
|
64
|
-
'150': (0, _react2.css)((0, _defineProperty2.default)({}, property, "var(--ds-space-150, 12px)")),
|
|
65
|
-
'200': (0, _react2.css)((0, _defineProperty2.default)({}, property, "var(--ds-space-200, 16px)")),
|
|
66
|
-
'250': (0, _react2.css)((0, _defineProperty2.default)({}, property, "var(--ds-space-250, 20px)")),
|
|
67
|
-
'300': (0, _react2.css)((0, _defineProperty2.default)({}, property, "var(--ds-space-300, 24px)")),
|
|
68
|
-
'400': (0, _react2.css)((0, _defineProperty2.default)({}, property, "var(--ds-space-400, 32px)")),
|
|
69
|
-
'500': (0, _react2.css)((0, _defineProperty2.default)({}, property, "var(--ds-space-500, 40px)")),
|
|
70
|
-
'600': (0, _react2.css)((0, _defineProperty2.default)({}, property, "var(--ds-space-600, 48px)")),
|
|
71
|
-
'800': (0, _react2.css)((0, _defineProperty2.default)({}, property, "var(--ds-space-800, 64px)")),
|
|
72
|
-
'1000': (0, _react2.css)((0, _defineProperty2.default)({}, property, "var(--ds-space-1000, 80px)"))
|
|
73
|
-
}];
|
|
74
|
-
}));
|
|
75
|
-
/**
|
|
76
|
-
* @codegenEnd
|
|
77
|
-
*/
|
|
78
|
-
|
|
79
|
-
var baseStyles = (0, _react2.css)({
|
|
80
|
-
display: 'flex',
|
|
81
|
-
boxSizing: 'border-box',
|
|
82
|
-
flexDirection: 'column'
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* __Stack__
|
|
87
|
-
*
|
|
88
|
-
* Stack is a primitive component based on flexbox that manages the vertical layout of direct children.
|
|
89
|
-
*
|
|
90
|
-
* @example
|
|
91
|
-
* ```tsx
|
|
92
|
-
* <Stack>
|
|
93
|
-
* <Box padding="space.100" backgroundColor="neutral"></Box>
|
|
94
|
-
* <Box padding="space.100" backgroundColor="neutral"></Box>
|
|
95
|
-
* </Stack>
|
|
96
|
-
* ```
|
|
97
|
-
*
|
|
98
|
-
*/
|
|
99
|
-
var Stack = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
100
|
-
var as = _ref.as,
|
|
101
|
-
alignItems = _ref.alignInline,
|
|
102
|
-
alignBlock = _ref.alignBlock,
|
|
103
|
-
spread = _ref.spread,
|
|
104
|
-
grow = _ref.grow,
|
|
105
|
-
space = _ref.space,
|
|
106
|
-
children = _ref.children,
|
|
107
|
-
testId = _ref.testId;
|
|
108
|
-
var Component = as || 'div';
|
|
109
|
-
var justifyContent = spread || alignBlock;
|
|
110
|
-
return (0, _react2.jsx)(Component, {
|
|
111
|
-
css: [baseStyles, space && stackSpaceMap.gap[space], alignItems && alignItemsMap[alignItems], grow && flexGrowMap[grow], justifyContent && justifyContentMap[justifyContent]],
|
|
112
|
-
"data-testid": testId,
|
|
113
|
-
ref: ref
|
|
114
|
-
}, children);
|
|
115
|
-
}));
|
|
116
|
-
Stack.displayName = 'Stack';
|
|
117
|
-
var _default = Stack;
|
|
118
|
-
exports.default = _default;
|