@atlaskit/primitives 0.4.2 → 0.6.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 +12 -0
- package/dist/cjs/components/inline.partial.js +23 -91
- package/dist/cjs/components/internal/base-box.partial.js +81 -99
- package/dist/cjs/components/stack.partial.js +23 -47
- package/dist/cjs/internal/xcss.js +16 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/inline.partial.js +19 -63
- package/dist/es2019/components/internal/base-box.partial.js +72 -68
- package/dist/es2019/components/stack.partial.js +19 -19
- package/dist/es2019/internal/xcss.js +9 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/inline.partial.js +22 -91
- package/dist/esm/components/internal/base-box.partial.js +81 -99
- package/dist/esm/components/stack.partial.js +22 -47
- package/dist/esm/internal/xcss.js +13 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/components/box.d.ts +1 -2
- package/dist/types/components/inline.partial.d.ts +28 -39
- package/dist/types/components/internal/base-box.partial.d.ts +42 -43
- package/dist/types/components/stack.partial.d.ts +25 -20
- package/dist/types/components/types.d.ts +2 -48
- package/dist/types/internal/xcss.d.ts +37 -8
- package/package.json +2 -3
- package/report.api.md +160 -144
- package/scripts/spacing-codegen-template.tsx +30 -30
- package/tmp/api-report-tmp.d.ts +124 -130
- package/dist/cjs/components/internal/types.js +0 -8
- package/dist/cjs/components/internal/utils.js +0 -16
- package/dist/es2019/components/internal/types.js +0 -1
- package/dist/es2019/components/internal/utils.js +0 -2
- package/dist/esm/components/internal/types.js +0 -1
- package/dist/esm/components/internal/utils.js +0 -7
- package/dist/types/components/internal/types.d.ts +0 -8
- package/dist/types/components/internal/utils.d.ts +0 -3
|
@@ -44,100 +44,56 @@ const flexWrapStyles = css({
|
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
47
|
-
* @codegen <<SignedSource::
|
|
47
|
+
* @codegen <<SignedSource::fb7587b114753ed19425e2b07b5deb0d>>
|
|
48
48
|
* @codegenId spacing
|
|
49
49
|
* @codegenCommand yarn codegen-styles
|
|
50
|
-
* @codegenParams ["
|
|
50
|
+
* @codegenParams ["inlineSpace"]
|
|
51
51
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
52
52
|
*/
|
|
53
|
-
const
|
|
53
|
+
const inlineSpaceMap = Object.fromEntries(['gap', 'rowGap'].map(property => [property, {
|
|
54
54
|
'0': css({
|
|
55
|
-
|
|
55
|
+
[property]: "var(--ds-space-0, 0px)"
|
|
56
56
|
}),
|
|
57
57
|
'025': css({
|
|
58
|
-
|
|
58
|
+
[property]: "var(--ds-space-025, 2px)"
|
|
59
59
|
}),
|
|
60
60
|
'050': css({
|
|
61
|
-
|
|
61
|
+
[property]: "var(--ds-space-050, 4px)"
|
|
62
62
|
}),
|
|
63
63
|
'075': css({
|
|
64
|
-
|
|
64
|
+
[property]: "var(--ds-space-075, 6px)"
|
|
65
65
|
}),
|
|
66
66
|
'100': css({
|
|
67
|
-
|
|
67
|
+
[property]: "var(--ds-space-100, 8px)"
|
|
68
68
|
}),
|
|
69
69
|
'150': css({
|
|
70
|
-
|
|
70
|
+
[property]: "var(--ds-space-150, 12px)"
|
|
71
71
|
}),
|
|
72
72
|
'200': css({
|
|
73
|
-
|
|
73
|
+
[property]: "var(--ds-space-200, 16px)"
|
|
74
74
|
}),
|
|
75
75
|
'250': css({
|
|
76
|
-
|
|
76
|
+
[property]: "var(--ds-space-250, 20px)"
|
|
77
77
|
}),
|
|
78
78
|
'300': css({
|
|
79
|
-
|
|
79
|
+
[property]: "var(--ds-space-300, 24px)"
|
|
80
80
|
}),
|
|
81
81
|
'400': css({
|
|
82
|
-
|
|
82
|
+
[property]: "var(--ds-space-400, 32px)"
|
|
83
83
|
}),
|
|
84
84
|
'500': css({
|
|
85
|
-
|
|
85
|
+
[property]: "var(--ds-space-500, 40px)"
|
|
86
86
|
}),
|
|
87
87
|
'600': css({
|
|
88
|
-
|
|
88
|
+
[property]: "var(--ds-space-600, 48px)"
|
|
89
89
|
}),
|
|
90
90
|
'800': css({
|
|
91
|
-
|
|
91
|
+
[property]: "var(--ds-space-800, 64px)"
|
|
92
92
|
}),
|
|
93
93
|
'1000': css({
|
|
94
|
-
|
|
94
|
+
[property]: "var(--ds-space-1000, 80px)"
|
|
95
95
|
})
|
|
96
|
-
};
|
|
97
|
-
const rowSpaceMap = {
|
|
98
|
-
'0': css({
|
|
99
|
-
rowGap: "var(--ds-space-0, 0px)"
|
|
100
|
-
}),
|
|
101
|
-
'025': css({
|
|
102
|
-
rowGap: "var(--ds-space-025, 2px)"
|
|
103
|
-
}),
|
|
104
|
-
'050': css({
|
|
105
|
-
rowGap: "var(--ds-space-050, 4px)"
|
|
106
|
-
}),
|
|
107
|
-
'075': css({
|
|
108
|
-
rowGap: "var(--ds-space-075, 6px)"
|
|
109
|
-
}),
|
|
110
|
-
'100': css({
|
|
111
|
-
rowGap: "var(--ds-space-100, 8px)"
|
|
112
|
-
}),
|
|
113
|
-
'150': css({
|
|
114
|
-
rowGap: "var(--ds-space-150, 12px)"
|
|
115
|
-
}),
|
|
116
|
-
'200': css({
|
|
117
|
-
rowGap: "var(--ds-space-200, 16px)"
|
|
118
|
-
}),
|
|
119
|
-
'250': css({
|
|
120
|
-
rowGap: "var(--ds-space-250, 20px)"
|
|
121
|
-
}),
|
|
122
|
-
'300': css({
|
|
123
|
-
rowGap: "var(--ds-space-300, 24px)"
|
|
124
|
-
}),
|
|
125
|
-
'400': css({
|
|
126
|
-
rowGap: "var(--ds-space-400, 32px)"
|
|
127
|
-
}),
|
|
128
|
-
'500': css({
|
|
129
|
-
rowGap: "var(--ds-space-500, 40px)"
|
|
130
|
-
}),
|
|
131
|
-
'600': css({
|
|
132
|
-
rowGap: "var(--ds-space-600, 48px)"
|
|
133
|
-
}),
|
|
134
|
-
'800': css({
|
|
135
|
-
rowGap: "var(--ds-space-800, 64px)"
|
|
136
|
-
}),
|
|
137
|
-
'1000': css({
|
|
138
|
-
rowGap: "var(--ds-space-1000, 80px)"
|
|
139
|
-
})
|
|
140
|
-
};
|
|
96
|
+
}]));
|
|
141
97
|
/**
|
|
142
98
|
* @codegenEnd
|
|
143
99
|
*/
|
|
@@ -197,7 +153,7 @@ const Inline = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
197
153
|
}) : rawChildren;
|
|
198
154
|
const justifyContent = spread || alignInline;
|
|
199
155
|
return jsx(Component, {
|
|
200
|
-
css: [baseStyles, space &&
|
|
156
|
+
css: [baseStyles, space && inlineSpaceMap.gap[space], justifyContent && justifyContentMap[justifyContent], grow && flexGrowMap[grow], alignItems && alignItemsMap[alignItems], shouldWrap && flexWrapStyles, rowSpace && inlineSpaceMap.rowGap[rowSpace]],
|
|
201
157
|
"data-testid": testId,
|
|
202
158
|
ref: ref
|
|
203
159
|
}, children);
|
|
@@ -2,46 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { css, jsx } from '@emotion/react';
|
|
5
|
-
import invariant from 'tiny-invariant';
|
|
6
5
|
import { LAYERS } from '../../constants';
|
|
7
|
-
import { UNSAFE_buildAboveMediaQueryCSS } from '../../helpers/responsive';
|
|
8
|
-
import { BOX_RESPONSIVE_PROPS } from './types';
|
|
9
|
-
import { isResponsiveStyleProp, isStaticStyleProp } from './utils';
|
|
10
|
-
const responsiveRules = BOX_RESPONSIVE_PROPS.reduce((mapping, cssProperty) => {
|
|
11
|
-
return Object.assign(mapping, {
|
|
12
|
-
[cssProperty]: {
|
|
13
|
-
static: css({
|
|
14
|
-
[cssProperty]: `var(--ds-box-static-${cssProperty})`
|
|
15
|
-
}),
|
|
16
|
-
...UNSAFE_buildAboveMediaQueryCSS(breakpoint => ({
|
|
17
|
-
[cssProperty]: `var(--ds-box-responsive-${cssProperty}-${breakpoint})`
|
|
18
|
-
}))
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}, {});
|
|
22
|
-
const getResponsiveVars = (propertyName, propertyValue, mapping) => {
|
|
23
|
-
if (isResponsiveStyleProp(propertyValue)) {
|
|
24
|
-
return Object.keys(propertyValue).reduce((vars, breakpoint) => ({
|
|
25
|
-
...vars,
|
|
26
|
-
[`--ds-box-responsive-${propertyName}-${breakpoint}`]: mapping[propertyValue[breakpoint]]
|
|
27
|
-
}), {});
|
|
28
|
-
} else if (isStaticStyleProp(propertyValue)) {
|
|
29
|
-
return {
|
|
30
|
-
[`--ds-box-static-${propertyName}`]: mapping[propertyValue]
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
const getResponsiveStyles = (propertyName, propertyValue) => {
|
|
35
|
-
invariant(typeof responsiveRules[propertyName] !== 'undefined', `Responsive rules for "${propertyName}" have not been statically defined.`);
|
|
36
|
-
if (isResponsiveStyleProp(propertyValue)) {
|
|
37
|
-
return Object.keys(propertyValue).map(breakpoint => responsiveRules[propertyName][breakpoint]);
|
|
38
|
-
} else if (isStaticStyleProp(propertyValue)) {
|
|
39
|
-
return responsiveRules[propertyName].static;
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
// Without this type annotation on Box we don't get autocomplete for props due to forwardRef types
|
|
44
|
-
|
|
45
6
|
/**
|
|
46
7
|
* __Box__
|
|
47
8
|
*
|
|
@@ -78,21 +39,20 @@ export const BaseBox = /*#__PURE__*/forwardRef(({
|
|
|
78
39
|
paddingInlineEnd,
|
|
79
40
|
height,
|
|
80
41
|
width,
|
|
81
|
-
display =
|
|
42
|
+
display = 'block',
|
|
82
43
|
position = 'static',
|
|
83
44
|
style,
|
|
84
45
|
testId,
|
|
85
46
|
...htmlAttributes
|
|
86
47
|
}, ref) => {
|
|
87
48
|
const Component = as || 'div';
|
|
88
|
-
const inlineStyles = Object.assign({}, style, getResponsiveVars('borderWidth', borderWidth, borderWidthMap), getResponsiveVars('display', display, displayMap), getResponsiveVars('padding', padding, paddingMap), getResponsiveVars('paddingBlock', paddingBlock, paddingMap), getResponsiveVars('paddingBlockStart', paddingBlockStart, paddingMap), getResponsiveVars('paddingBlockEnd', paddingBlockEnd, paddingMap), getResponsiveVars('paddingInline', paddingInline, paddingMap), getResponsiveVars('paddingInlineStart', paddingInlineStart, paddingMap), getResponsiveVars('paddingInlineEnd', paddingInlineEnd, paddingMap));
|
|
89
49
|
const node = jsx(Component, _extends({
|
|
90
|
-
style:
|
|
50
|
+
style: style,
|
|
91
51
|
ref: ref
|
|
92
52
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
93
53
|
}, htmlAttributes, {
|
|
94
54
|
className: className,
|
|
95
|
-
css: [baseStyles,
|
|
55
|
+
css: [baseStyles, alignSelf && alignSelfMap[alignSelf], backgroundColor && backgroundColorMap[backgroundColor], borderColor && borderColorMap[borderColor], borderRadius && borderRadiusMap[borderRadius], borderStyle && borderStyleMap[borderStyle], borderWidth && borderWidthMap[borderWidth], color && textColorMap[color], display && displayMap[display], flex && flexMap[flex], flexGrow && flexGrowMap[flexGrow], flexShrink && flexShrinkMap[flexShrink], height && heightMap[height], layer && layerMap[layer], overflow && overflowMap[overflow], overflow && overflowMap[overflow], overflowBlock && overflowBlockMap[overflowBlock], overflowInline && overflowInlineMap[overflowInline], padding && paddingMap.padding[padding], paddingBlock && paddingMap.paddingBlock[paddingBlock], paddingBlockStart && paddingMap.paddingBlockStart[paddingBlockStart], paddingBlockEnd && paddingMap.paddingBlockEnd[paddingBlockEnd], paddingInline && paddingMap.paddingInline[paddingInline], paddingInlineStart && paddingMap.paddingInlineStart[paddingInlineStart], paddingInlineEnd && paddingMap.paddingInlineEnd[paddingInlineEnd], padding && paddingMap.padding[padding], position && positionMap[position], shadow && shadowMap[shadow], width && widthMap[width]],
|
|
96
56
|
"data-testid": testId
|
|
97
57
|
}), children);
|
|
98
58
|
return node;
|
|
@@ -111,9 +71,15 @@ const borderStyleMap = {
|
|
|
111
71
|
})
|
|
112
72
|
};
|
|
113
73
|
const borderWidthMap = {
|
|
114
|
-
'size.0':
|
|
115
|
-
|
|
116
|
-
|
|
74
|
+
'size.0': css({
|
|
75
|
+
borderWidth: "var(--ds-width-0, 0)"
|
|
76
|
+
}),
|
|
77
|
+
'size.050': css({
|
|
78
|
+
borderWidth: "var(--ds-width-050, 1px)"
|
|
79
|
+
}),
|
|
80
|
+
'size.100': css({
|
|
81
|
+
borderWidth: "var(--ds-width-100, 2px)"
|
|
82
|
+
})
|
|
117
83
|
};
|
|
118
84
|
const borderRadiusMap = {
|
|
119
85
|
'radius.100': css({
|
|
@@ -171,11 +137,21 @@ const alignSelfMap = {
|
|
|
171
137
|
})
|
|
172
138
|
};
|
|
173
139
|
const displayMap = {
|
|
174
|
-
block:
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
140
|
+
block: css({
|
|
141
|
+
display: 'block'
|
|
142
|
+
}),
|
|
143
|
+
inline: css({
|
|
144
|
+
display: 'inline'
|
|
145
|
+
}),
|
|
146
|
+
flex: css({
|
|
147
|
+
display: 'flex'
|
|
148
|
+
}),
|
|
149
|
+
'inline-flex': css({
|
|
150
|
+
display: 'inline-flex'
|
|
151
|
+
}),
|
|
152
|
+
'inline-block': css({
|
|
153
|
+
display: 'inline-block'
|
|
154
|
+
})
|
|
179
155
|
};
|
|
180
156
|
const positionMap = {
|
|
181
157
|
absolute: css({
|
|
@@ -390,28 +366,56 @@ const maxHeightMap = {
|
|
|
390
366
|
|
|
391
367
|
/**
|
|
392
368
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
393
|
-
* @codegen <<SignedSource::
|
|
369
|
+
* @codegen <<SignedSource::6da0ceaa2c227230e3a93bc724ff8648>>
|
|
394
370
|
* @codegenId spacing
|
|
395
371
|
* @codegenCommand yarn codegen-styles
|
|
396
372
|
* @codegenParams ["padding"]
|
|
397
373
|
* @codegenDependency ../../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
398
374
|
*/
|
|
399
|
-
const paddingMap = {
|
|
400
|
-
'space.0':
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
'space.
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
'space.
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
'space.
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
'space.
|
|
413
|
-
|
|
414
|
-
}
|
|
375
|
+
const paddingMap = Object.fromEntries(['padding', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd'].map(property => [property, {
|
|
376
|
+
'space.0': css({
|
|
377
|
+
[property]: "var(--ds-space-0, 0px)"
|
|
378
|
+
}),
|
|
379
|
+
'space.025': css({
|
|
380
|
+
[property]: "var(--ds-space-025, 2px)"
|
|
381
|
+
}),
|
|
382
|
+
'space.050': css({
|
|
383
|
+
[property]: "var(--ds-space-050, 4px)"
|
|
384
|
+
}),
|
|
385
|
+
'space.075': css({
|
|
386
|
+
[property]: "var(--ds-space-075, 6px)"
|
|
387
|
+
}),
|
|
388
|
+
'space.100': css({
|
|
389
|
+
[property]: "var(--ds-space-100, 8px)"
|
|
390
|
+
}),
|
|
391
|
+
'space.150': css({
|
|
392
|
+
[property]: "var(--ds-space-150, 12px)"
|
|
393
|
+
}),
|
|
394
|
+
'space.200': css({
|
|
395
|
+
[property]: "var(--ds-space-200, 16px)"
|
|
396
|
+
}),
|
|
397
|
+
'space.250': css({
|
|
398
|
+
[property]: "var(--ds-space-250, 20px)"
|
|
399
|
+
}),
|
|
400
|
+
'space.300': css({
|
|
401
|
+
[property]: "var(--ds-space-300, 24px)"
|
|
402
|
+
}),
|
|
403
|
+
'space.400': css({
|
|
404
|
+
[property]: "var(--ds-space-400, 32px)"
|
|
405
|
+
}),
|
|
406
|
+
'space.500': css({
|
|
407
|
+
[property]: "var(--ds-space-500, 40px)"
|
|
408
|
+
}),
|
|
409
|
+
'space.600': css({
|
|
410
|
+
[property]: "var(--ds-space-600, 48px)"
|
|
411
|
+
}),
|
|
412
|
+
'space.800': css({
|
|
413
|
+
[property]: "var(--ds-space-800, 64px)"
|
|
414
|
+
}),
|
|
415
|
+
'space.1000': css({
|
|
416
|
+
[property]: "var(--ds-space-1000, 80px)"
|
|
417
|
+
})
|
|
418
|
+
}]));
|
|
415
419
|
/**
|
|
416
420
|
* @codegenEnd
|
|
417
421
|
*/
|
|
@@ -38,56 +38,56 @@ const flexGrowMap = {
|
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
41
|
-
* @codegen <<SignedSource::
|
|
41
|
+
* @codegen <<SignedSource::4eb2c996d6ce5791acad51e2b226635f>>
|
|
42
42
|
* @codegenId spacing
|
|
43
43
|
* @codegenCommand yarn codegen-styles
|
|
44
|
-
* @codegenParams ["
|
|
44
|
+
* @codegenParams ["stackSpace"]
|
|
45
45
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
46
46
|
*/
|
|
47
|
-
const
|
|
47
|
+
const stackSpaceMap = Object.fromEntries(['gap'].map(property => [property, {
|
|
48
48
|
'0': css({
|
|
49
|
-
|
|
49
|
+
[property]: "var(--ds-space-0, 0px)"
|
|
50
50
|
}),
|
|
51
51
|
'025': css({
|
|
52
|
-
|
|
52
|
+
[property]: "var(--ds-space-025, 2px)"
|
|
53
53
|
}),
|
|
54
54
|
'050': css({
|
|
55
|
-
|
|
55
|
+
[property]: "var(--ds-space-050, 4px)"
|
|
56
56
|
}),
|
|
57
57
|
'075': css({
|
|
58
|
-
|
|
58
|
+
[property]: "var(--ds-space-075, 6px)"
|
|
59
59
|
}),
|
|
60
60
|
'100': css({
|
|
61
|
-
|
|
61
|
+
[property]: "var(--ds-space-100, 8px)"
|
|
62
62
|
}),
|
|
63
63
|
'150': css({
|
|
64
|
-
|
|
64
|
+
[property]: "var(--ds-space-150, 12px)"
|
|
65
65
|
}),
|
|
66
66
|
'200': css({
|
|
67
|
-
|
|
67
|
+
[property]: "var(--ds-space-200, 16px)"
|
|
68
68
|
}),
|
|
69
69
|
'250': css({
|
|
70
|
-
|
|
70
|
+
[property]: "var(--ds-space-250, 20px)"
|
|
71
71
|
}),
|
|
72
72
|
'300': css({
|
|
73
|
-
|
|
73
|
+
[property]: "var(--ds-space-300, 24px)"
|
|
74
74
|
}),
|
|
75
75
|
'400': css({
|
|
76
|
-
|
|
76
|
+
[property]: "var(--ds-space-400, 32px)"
|
|
77
77
|
}),
|
|
78
78
|
'500': css({
|
|
79
|
-
|
|
79
|
+
[property]: "var(--ds-space-500, 40px)"
|
|
80
80
|
}),
|
|
81
81
|
'600': css({
|
|
82
|
-
|
|
82
|
+
[property]: "var(--ds-space-600, 48px)"
|
|
83
83
|
}),
|
|
84
84
|
'800': css({
|
|
85
|
-
|
|
85
|
+
[property]: "var(--ds-space-800, 64px)"
|
|
86
86
|
}),
|
|
87
87
|
'1000': css({
|
|
88
|
-
|
|
88
|
+
[property]: "var(--ds-space-1000, 80px)"
|
|
89
89
|
})
|
|
90
|
-
};
|
|
90
|
+
}]));
|
|
91
91
|
/**
|
|
92
92
|
* @codegenEnd
|
|
93
93
|
*/
|
|
@@ -125,7 +125,7 @@ const Stack = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
125
125
|
const Component = as || 'div';
|
|
126
126
|
const justifyContent = spread || alignBlock;
|
|
127
127
|
return jsx(Component, {
|
|
128
|
-
css: [baseStyles, space &&
|
|
128
|
+
css: [baseStyles, space && stackSpaceMap.gap[space], alignItems && alignItemsMap[alignItems], grow && flexGrowMap[grow], justifyContent && justifyContentMap[justifyContent]],
|
|
129
129
|
"data-testid": testId,
|
|
130
130
|
ref: ref
|
|
131
131
|
}, children);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
1
2
|
import { css as cssEmotion } from '@emotion/react';
|
|
2
3
|
import { backgroundColorMap, borderColorMap, borderRadiusMap, borderWidthMap, dimensionMap, paddingMap, textColorMap } from './style-maps';
|
|
3
4
|
const tokensMap = {
|
|
@@ -69,7 +70,7 @@ export const transformStyles = styleObj => {
|
|
|
69
70
|
});
|
|
70
71
|
return styleObj;
|
|
71
72
|
};
|
|
72
|
-
|
|
73
|
+
const baseXcss = style => {
|
|
73
74
|
const transformedStyles = transformStyles(style);
|
|
74
75
|
return {
|
|
75
76
|
symbol: uniqueSymbol,
|
|
@@ -94,4 +95,10 @@ export const parseXcss = args => {
|
|
|
94
95
|
throw new Error('Styles generated from unsafe source, use the `xcss` export from `@atlaskit/primitives`.');
|
|
95
96
|
}
|
|
96
97
|
return styles;
|
|
97
|
-
};
|
|
98
|
+
};
|
|
99
|
+
// unused private functions only so we can extract the return type from a generic function
|
|
100
|
+
const boxWrapper = style => xcss(style);
|
|
101
|
+
const inlineWrapper = style => xcss(style);
|
|
102
|
+
export function xcss(style) {
|
|
103
|
+
return baseXcss(style);
|
|
104
|
+
}
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
/** @jsx jsx */
|
|
2
3
|
import { Children, forwardRef, Fragment, memo } from 'react';
|
|
3
4
|
import { css, jsx } from '@emotion/react';
|
|
@@ -44,100 +45,30 @@ var flexWrapStyles = css({
|
|
|
44
45
|
|
|
45
46
|
/**
|
|
46
47
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
47
|
-
* @codegen <<SignedSource::
|
|
48
|
+
* @codegen <<SignedSource::fb7587b114753ed19425e2b07b5deb0d>>
|
|
48
49
|
* @codegenId spacing
|
|
49
50
|
* @codegenCommand yarn codegen-styles
|
|
50
|
-
* @codegenParams ["
|
|
51
|
+
* @codegenParams ["inlineSpace"]
|
|
51
52
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
52
53
|
*/
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}),
|
|
72
|
-
'200': css({
|
|
73
|
-
gap: "var(--ds-space-200, 16px)"
|
|
74
|
-
}),
|
|
75
|
-
'250': css({
|
|
76
|
-
gap: "var(--ds-space-250, 20px)"
|
|
77
|
-
}),
|
|
78
|
-
'300': css({
|
|
79
|
-
gap: "var(--ds-space-300, 24px)"
|
|
80
|
-
}),
|
|
81
|
-
'400': css({
|
|
82
|
-
gap: "var(--ds-space-400, 32px)"
|
|
83
|
-
}),
|
|
84
|
-
'500': css({
|
|
85
|
-
gap: "var(--ds-space-500, 40px)"
|
|
86
|
-
}),
|
|
87
|
-
'600': css({
|
|
88
|
-
gap: "var(--ds-space-600, 48px)"
|
|
89
|
-
}),
|
|
90
|
-
'800': css({
|
|
91
|
-
gap: "var(--ds-space-800, 64px)"
|
|
92
|
-
}),
|
|
93
|
-
'1000': css({
|
|
94
|
-
gap: "var(--ds-space-1000, 80px)"
|
|
95
|
-
})
|
|
96
|
-
};
|
|
97
|
-
var rowSpaceMap = {
|
|
98
|
-
'0': css({
|
|
99
|
-
rowGap: "var(--ds-space-0, 0px)"
|
|
100
|
-
}),
|
|
101
|
-
'025': css({
|
|
102
|
-
rowGap: "var(--ds-space-025, 2px)"
|
|
103
|
-
}),
|
|
104
|
-
'050': css({
|
|
105
|
-
rowGap: "var(--ds-space-050, 4px)"
|
|
106
|
-
}),
|
|
107
|
-
'075': css({
|
|
108
|
-
rowGap: "var(--ds-space-075, 6px)"
|
|
109
|
-
}),
|
|
110
|
-
'100': css({
|
|
111
|
-
rowGap: "var(--ds-space-100, 8px)"
|
|
112
|
-
}),
|
|
113
|
-
'150': css({
|
|
114
|
-
rowGap: "var(--ds-space-150, 12px)"
|
|
115
|
-
}),
|
|
116
|
-
'200': css({
|
|
117
|
-
rowGap: "var(--ds-space-200, 16px)"
|
|
118
|
-
}),
|
|
119
|
-
'250': css({
|
|
120
|
-
rowGap: "var(--ds-space-250, 20px)"
|
|
121
|
-
}),
|
|
122
|
-
'300': css({
|
|
123
|
-
rowGap: "var(--ds-space-300, 24px)"
|
|
124
|
-
}),
|
|
125
|
-
'400': css({
|
|
126
|
-
rowGap: "var(--ds-space-400, 32px)"
|
|
127
|
-
}),
|
|
128
|
-
'500': css({
|
|
129
|
-
rowGap: "var(--ds-space-500, 40px)"
|
|
130
|
-
}),
|
|
131
|
-
'600': css({
|
|
132
|
-
rowGap: "var(--ds-space-600, 48px)"
|
|
133
|
-
}),
|
|
134
|
-
'800': css({
|
|
135
|
-
rowGap: "var(--ds-space-800, 64px)"
|
|
136
|
-
}),
|
|
137
|
-
'1000': css({
|
|
138
|
-
rowGap: "var(--ds-space-1000, 80px)"
|
|
139
|
-
})
|
|
140
|
-
};
|
|
54
|
+
var inlineSpaceMap = Object.fromEntries(['gap', 'rowGap'].map(function (property) {
|
|
55
|
+
return [property, {
|
|
56
|
+
'0': css(_defineProperty({}, property, "var(--ds-space-0, 0px)")),
|
|
57
|
+
'025': css(_defineProperty({}, property, "var(--ds-space-025, 2px)")),
|
|
58
|
+
'050': css(_defineProperty({}, property, "var(--ds-space-050, 4px)")),
|
|
59
|
+
'075': css(_defineProperty({}, property, "var(--ds-space-075, 6px)")),
|
|
60
|
+
'100': css(_defineProperty({}, property, "var(--ds-space-100, 8px)")),
|
|
61
|
+
'150': css(_defineProperty({}, property, "var(--ds-space-150, 12px)")),
|
|
62
|
+
'200': css(_defineProperty({}, property, "var(--ds-space-200, 16px)")),
|
|
63
|
+
'250': css(_defineProperty({}, property, "var(--ds-space-250, 20px)")),
|
|
64
|
+
'300': css(_defineProperty({}, property, "var(--ds-space-300, 24px)")),
|
|
65
|
+
'400': css(_defineProperty({}, property, "var(--ds-space-400, 32px)")),
|
|
66
|
+
'500': css(_defineProperty({}, property, "var(--ds-space-500, 40px)")),
|
|
67
|
+
'600': css(_defineProperty({}, property, "var(--ds-space-600, 48px)")),
|
|
68
|
+
'800': css(_defineProperty({}, property, "var(--ds-space-800, 64px)")),
|
|
69
|
+
'1000': css(_defineProperty({}, property, "var(--ds-space-1000, 80px)"))
|
|
70
|
+
}];
|
|
71
|
+
}));
|
|
141
72
|
/**
|
|
142
73
|
* @codegenEnd
|
|
143
74
|
*/
|
|
@@ -198,7 +129,7 @@ var Inline = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
198
129
|
}) : rawChildren;
|
|
199
130
|
var justifyContent = spread || alignInline;
|
|
200
131
|
return jsx(Component, {
|
|
201
|
-
css: [baseStyles, space &&
|
|
132
|
+
css: [baseStyles, space && inlineSpaceMap.gap[space], justifyContent && justifyContentMap[justifyContent], grow && flexGrowMap[grow], alignItems && alignItemsMap[alignItems], shouldWrap && flexWrapStyles, rowSpace && inlineSpaceMap.rowGap[rowSpace]],
|
|
202
133
|
"data-testid": testId,
|
|
203
134
|
ref: ref
|
|
204
135
|
}, children);
|