@atlaskit/primitives 0.2.0 → 0.2.2
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/box.js +14 -2
- package/dist/cjs/components/inline.partial.js +47 -23
- package/dist/cjs/components/internal/base-box.partial.js +99 -78
- package/dist/cjs/components/internal/types.js +8 -0
- package/dist/cjs/components/internal/utils.js +16 -0
- package/dist/cjs/components/stack.partial.js +46 -22
- package/dist/cjs/constants.js +13 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/box.js +12 -1
- package/dist/es2019/components/inline.partial.js +19 -19
- package/dist/es2019/components/internal/base-box.partial.js +75 -70
- package/dist/es2019/components/internal/types.js +1 -0
- package/dist/es2019/components/internal/utils.js +2 -0
- package/dist/es2019/components/stack.partial.js +18 -18
- package/dist/es2019/constants.js +3 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/box.js +12 -1
- package/dist/esm/components/inline.partial.js +47 -22
- package/dist/esm/components/internal/base-box.partial.js +100 -79
- package/dist/esm/components/internal/types.js +1 -0
- package/dist/esm/components/internal/utils.js +7 -0
- package/dist/esm/components/stack.partial.js +46 -21
- package/dist/esm/constants.js +3 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/components/box.d.ts +13 -6
- package/dist/types/components/inline.partial.d.ts +16 -18
- package/dist/types/components/internal/base-box.partial.d.ts +50 -51
- package/dist/types/components/internal/types.d.ts +6 -0
- package/dist/types/components/internal/utils.d.ts +3 -0
- package/dist/types/components/stack.partial.d.ts +16 -18
- package/dist/types/components/types.d.ts +49 -0
- package/dist/types/constants.d.ts +2 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +4 -2
- package/report.api.md +112 -79
- package/scripts/spacing-codegen-template.tsx +29 -24
- package/scripts/utils.tsx +4 -1
- package/tmp/api-report-tmp.d.ts +89 -78
|
@@ -43,56 +43,56 @@ const flexWrapStyles = css({
|
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
46
|
-
* @codegen <<SignedSource::
|
|
46
|
+
* @codegen <<SignedSource::41d7002b7f69aa44d0d8598e07a1afc6>>
|
|
47
47
|
* @codegenId spacing
|
|
48
48
|
* @codegenCommand yarn codegen-styles
|
|
49
49
|
* @codegenParams ["space"]
|
|
50
50
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
51
51
|
*/
|
|
52
|
-
const spaceMap =
|
|
52
|
+
const spaceMap = {
|
|
53
53
|
'0': css({
|
|
54
|
-
|
|
54
|
+
gap: "var(--ds-space-0, 0px)"
|
|
55
55
|
}),
|
|
56
56
|
'025': css({
|
|
57
|
-
|
|
57
|
+
gap: "var(--ds-space-025, 2px)"
|
|
58
58
|
}),
|
|
59
59
|
'050': css({
|
|
60
|
-
|
|
60
|
+
gap: "var(--ds-space-050, 4px)"
|
|
61
61
|
}),
|
|
62
62
|
'075': css({
|
|
63
|
-
|
|
63
|
+
gap: "var(--ds-space-075, 6px)"
|
|
64
64
|
}),
|
|
65
65
|
'100': css({
|
|
66
|
-
|
|
66
|
+
gap: "var(--ds-space-100, 8px)"
|
|
67
67
|
}),
|
|
68
68
|
'150': css({
|
|
69
|
-
|
|
69
|
+
gap: "var(--ds-space-150, 12px)"
|
|
70
70
|
}),
|
|
71
71
|
'200': css({
|
|
72
|
-
|
|
72
|
+
gap: "var(--ds-space-200, 16px)"
|
|
73
73
|
}),
|
|
74
74
|
'250': css({
|
|
75
|
-
|
|
75
|
+
gap: "var(--ds-space-250, 20px)"
|
|
76
76
|
}),
|
|
77
77
|
'300': css({
|
|
78
|
-
|
|
78
|
+
gap: "var(--ds-space-300, 24px)"
|
|
79
79
|
}),
|
|
80
80
|
'400': css({
|
|
81
|
-
|
|
81
|
+
gap: "var(--ds-space-400, 32px)"
|
|
82
82
|
}),
|
|
83
83
|
'500': css({
|
|
84
|
-
|
|
84
|
+
gap: "var(--ds-space-500, 40px)"
|
|
85
85
|
}),
|
|
86
86
|
'600': css({
|
|
87
|
-
|
|
87
|
+
gap: "var(--ds-space-600, 48px)"
|
|
88
88
|
}),
|
|
89
89
|
'800': css({
|
|
90
|
-
|
|
90
|
+
gap: "var(--ds-space-800, 64px)"
|
|
91
91
|
}),
|
|
92
92
|
'1000': css({
|
|
93
|
-
|
|
93
|
+
gap: "var(--ds-space-1000, 80px)"
|
|
94
94
|
})
|
|
95
|
-
}
|
|
95
|
+
};
|
|
96
96
|
/**
|
|
97
97
|
* @codegenEnd
|
|
98
98
|
*/
|
|
@@ -105,7 +105,7 @@ const baseStyles = css({
|
|
|
105
105
|
const separatorStyles = css({
|
|
106
106
|
color: "var(--ds-text-subtle, #42526E)",
|
|
107
107
|
marginBlock: "var(--ds-space-0, 0px)",
|
|
108
|
-
marginInline:
|
|
108
|
+
marginInline: `calc(-1 * ${"var(--ds-space-025, 2px)"})`,
|
|
109
109
|
pointerEvents: 'none',
|
|
110
110
|
userSelect: 'none'
|
|
111
111
|
});
|
|
@@ -149,7 +149,7 @@ const Inline = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
149
149
|
}) : rawChildren;
|
|
150
150
|
const justifyContent = spread || alignInline;
|
|
151
151
|
return jsx("div", {
|
|
152
|
-
css: [baseStyles, space && spaceMap
|
|
152
|
+
css: [baseStyles, space && spaceMap[space], justifyContent && justifyContentMap[justifyContent], grow && flexGrowMap[grow], alignItems && alignItemsMap[alignItems], shouldWrap && flexWrapStyles],
|
|
153
153
|
"data-testid": testId,
|
|
154
154
|
ref: ref
|
|
155
155
|
}, children);
|
|
@@ -2,7 +2,52 @@ 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
|
|
5
|
+
import invariant from 'tiny-invariant';
|
|
6
|
+
import { BREAKPOINTS_CONFIG, BREAKPOINTS_LIST, LAYERS } from '../../constants';
|
|
7
|
+
import { BOX_RESPONSIVE_PROPS } from './types';
|
|
8
|
+
import { isResponsiveStyleProp, isStaticStyleProp } from './utils';
|
|
9
|
+
const responsiveRules = BOX_RESPONSIVE_PROPS.reduce((mapping, cssProperty) => {
|
|
10
|
+
return Object.assign(mapping, {
|
|
11
|
+
[cssProperty]: BREAKPOINTS_LIST.reduce((configs, breakpoint) => {
|
|
12
|
+
const config = BREAKPOINTS_CONFIG[breakpoint];
|
|
13
|
+
return Object.assign(configs, {
|
|
14
|
+
[breakpoint]: css({
|
|
15
|
+
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
16
|
+
[`@media (min-width: ${config.min}px)`]: {
|
|
17
|
+
[cssProperty]: `var(--ds-box-responsive-${cssProperty}-${breakpoint})`
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
}, {
|
|
22
|
+
static: css({
|
|
23
|
+
[cssProperty]: `var(--ds-box-static-${cssProperty})`
|
|
24
|
+
})
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
}, {});
|
|
28
|
+
const getResponsiveVars = (propertyName, propertyValue, mapping) => {
|
|
29
|
+
if (isResponsiveStyleProp(propertyValue)) {
|
|
30
|
+
return Object.keys(propertyValue).reduce((vars, breakpoint) => ({
|
|
31
|
+
...vars,
|
|
32
|
+
[`--ds-box-responsive-${propertyName}-${breakpoint}`]: mapping[propertyValue[breakpoint]]
|
|
33
|
+
}), {});
|
|
34
|
+
} else if (isStaticStyleProp(propertyValue)) {
|
|
35
|
+
return {
|
|
36
|
+
[`--ds-box-static-${propertyName}`]: mapping[propertyValue]
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const getResponsiveStyles = (propertyName, propertyValue) => {
|
|
41
|
+
invariant(typeof responsiveRules[propertyName] !== 'undefined', `Responsive rules for "${propertyName}" have not been statically defined.`);
|
|
42
|
+
if (isResponsiveStyleProp(propertyValue)) {
|
|
43
|
+
return Object.keys(propertyValue).map(responsiveProp => responsiveRules[propertyName][responsiveProp]);
|
|
44
|
+
} else if (isStaticStyleProp(propertyValue)) {
|
|
45
|
+
return responsiveRules[propertyName].static;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// Without this type annotation on Box we don't get autocomplete for props due to forwardRef types
|
|
50
|
+
|
|
6
51
|
/**
|
|
7
52
|
* __Box__
|
|
8
53
|
*
|
|
@@ -39,20 +84,21 @@ export const BaseBox = /*#__PURE__*/forwardRef(({
|
|
|
39
84
|
paddingInlineEnd,
|
|
40
85
|
height,
|
|
41
86
|
width,
|
|
42
|
-
display =
|
|
87
|
+
display = displayMap.block,
|
|
43
88
|
position = 'static',
|
|
44
89
|
UNSAFE_style,
|
|
45
90
|
testId,
|
|
46
91
|
...htmlAttributes
|
|
47
92
|
}, ref) => {
|
|
48
93
|
const Component = as || 'div';
|
|
94
|
+
const inlineStyles = Object.assign({}, UNSAFE_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));
|
|
49
95
|
const node = jsx(Component, _extends({
|
|
50
|
-
style:
|
|
96
|
+
style: inlineStyles,
|
|
51
97
|
ref: ref
|
|
52
98
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
53
99
|
}, htmlAttributes, {
|
|
54
100
|
className: className,
|
|
55
|
-
css: [baseStyles, display
|
|
101
|
+
css: [baseStyles, ...[getResponsiveStyles('borderWidth', borderWidth), getResponsiveStyles('display', display), getResponsiveStyles('padding', padding), getResponsiveStyles('paddingBlock', paddingBlock), getResponsiveStyles('paddingBlockStart', paddingBlockStart), getResponsiveStyles('paddingBlockEnd', paddingBlockEnd), getResponsiveStyles('paddingInline', paddingInline), getResponsiveStyles('paddingInlineStart', paddingInlineStart), getResponsiveStyles('paddingInlineEnd', paddingInlineEnd)], backgroundColor && backgroundColorMap[backgroundColor], borderColor && borderColorMap[borderColor], color && textColorMap[color], flex && flexMap[flex], flexGrow && flexGrowMap[flexGrow], flexShrink && flexShrinkMap[flexShrink], alignSelf && alignSelfMap[alignSelf], overflow && overflowMap[overflow], overflowInline && overflowInlineMap[overflowInline], overflowBlock && overflowBlockMap[overflowBlock], position && positionMap[position], borderStyle && borderStyleMap[borderStyle], borderRadius && borderRadiusMap[borderRadius], shadow && shadowMap[shadow], layer && layerMap[layer], overflow && overflowMap[overflow], width && widthMap[width], height && heightMap[height]],
|
|
56
102
|
"data-testid": testId
|
|
57
103
|
}), children);
|
|
58
104
|
return node;
|
|
@@ -71,12 +117,9 @@ const borderStyleMap = {
|
|
|
71
117
|
})
|
|
72
118
|
};
|
|
73
119
|
const borderWidthMap = {
|
|
74
|
-
'size.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
'size.100': css({
|
|
78
|
-
borderWidth: "var(--ds-width-100, 2px)"
|
|
79
|
-
})
|
|
120
|
+
'size.0': "var(--ds-width-0, 0)",
|
|
121
|
+
'size.050': "var(--ds-width-050, 1px)",
|
|
122
|
+
'size.100': "var(--ds-width-100, 2px)"
|
|
80
123
|
};
|
|
81
124
|
const borderRadiusMap = {
|
|
82
125
|
'radius.100': css({
|
|
@@ -134,21 +177,11 @@ const alignSelfMap = {
|
|
|
134
177
|
})
|
|
135
178
|
};
|
|
136
179
|
const displayMap = {
|
|
137
|
-
block:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
inline:
|
|
141
|
-
|
|
142
|
-
}),
|
|
143
|
-
flex: css({
|
|
144
|
-
display: 'flex'
|
|
145
|
-
}),
|
|
146
|
-
'inline-flex': css({
|
|
147
|
-
display: 'inline-flex'
|
|
148
|
-
}),
|
|
149
|
-
'inline-block': css({
|
|
150
|
-
display: 'inline-block'
|
|
151
|
-
})
|
|
180
|
+
block: 'block',
|
|
181
|
+
inline: 'inline',
|
|
182
|
+
flex: 'flex',
|
|
183
|
+
'inline-flex': 'inline-flex',
|
|
184
|
+
'inline-block': 'inline-block'
|
|
152
185
|
};
|
|
153
186
|
const positionMap = {
|
|
154
187
|
absolute: css({
|
|
@@ -363,56 +396,28 @@ const maxHeightMap = {
|
|
|
363
396
|
|
|
364
397
|
/**
|
|
365
398
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
366
|
-
* @codegen <<SignedSource::
|
|
399
|
+
* @codegen <<SignedSource::84fd352b0e6509d380a0dcf8ad023ca2>>
|
|
367
400
|
* @codegenId spacing
|
|
368
401
|
* @codegenCommand yarn codegen-styles
|
|
369
402
|
* @codegenParams ["padding"]
|
|
370
403
|
* @codegenDependency ../../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
371
404
|
*/
|
|
372
|
-
const paddingMap =
|
|
373
|
-
'space.0':
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
'space.
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
'space.
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
'space.
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
'space.
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
'space.150': css({
|
|
389
|
-
[property]: "var(--ds-space-150, 12px)"
|
|
390
|
-
}),
|
|
391
|
-
'space.200': css({
|
|
392
|
-
[property]: "var(--ds-space-200, 16px)"
|
|
393
|
-
}),
|
|
394
|
-
'space.250': css({
|
|
395
|
-
[property]: "var(--ds-space-250, 20px)"
|
|
396
|
-
}),
|
|
397
|
-
'space.300': css({
|
|
398
|
-
[property]: "var(--ds-space-300, 24px)"
|
|
399
|
-
}),
|
|
400
|
-
'space.400': css({
|
|
401
|
-
[property]: "var(--ds-space-400, 32px)"
|
|
402
|
-
}),
|
|
403
|
-
'space.500': css({
|
|
404
|
-
[property]: "var(--ds-space-500, 40px)"
|
|
405
|
-
}),
|
|
406
|
-
'space.600': css({
|
|
407
|
-
[property]: "var(--ds-space-600, 48px)"
|
|
408
|
-
}),
|
|
409
|
-
'space.800': css({
|
|
410
|
-
[property]: "var(--ds-space-800, 64px)"
|
|
411
|
-
}),
|
|
412
|
-
'space.1000': css({
|
|
413
|
-
[property]: "var(--ds-space-1000, 80px)"
|
|
414
|
-
})
|
|
415
|
-
}]));
|
|
405
|
+
const paddingMap = {
|
|
406
|
+
'space.0': "var(--ds-space-0, 0px)",
|
|
407
|
+
'space.025': "var(--ds-space-025, 2px)",
|
|
408
|
+
'space.050': "var(--ds-space-050, 4px)",
|
|
409
|
+
'space.075': "var(--ds-space-075, 6px)",
|
|
410
|
+
'space.100': "var(--ds-space-100, 8px)",
|
|
411
|
+
'space.150': "var(--ds-space-150, 12px)",
|
|
412
|
+
'space.200': "var(--ds-space-200, 16px)",
|
|
413
|
+
'space.250': "var(--ds-space-250, 20px)",
|
|
414
|
+
'space.300': "var(--ds-space-300, 24px)",
|
|
415
|
+
'space.400': "var(--ds-space-400, 32px)",
|
|
416
|
+
'space.500': "var(--ds-space-500, 40px)",
|
|
417
|
+
'space.600': "var(--ds-space-600, 48px)",
|
|
418
|
+
'space.800': "var(--ds-space-800, 64px)",
|
|
419
|
+
'space.1000': "var(--ds-space-1000, 80px)"
|
|
420
|
+
};
|
|
416
421
|
/**
|
|
417
422
|
* @codegenEnd
|
|
418
423
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const BOX_RESPONSIVE_PROPS = ['borderWidth', 'display', 'padding', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd'];
|
|
@@ -37,56 +37,56 @@ const flexGrowMap = {
|
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
40
|
-
* @codegen <<SignedSource::
|
|
40
|
+
* @codegen <<SignedSource::41d7002b7f69aa44d0d8598e07a1afc6>>
|
|
41
41
|
* @codegenId spacing
|
|
42
42
|
* @codegenCommand yarn codegen-styles
|
|
43
43
|
* @codegenParams ["space"]
|
|
44
44
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
45
45
|
*/
|
|
46
|
-
const spaceMap =
|
|
46
|
+
const spaceMap = {
|
|
47
47
|
'0': css({
|
|
48
|
-
|
|
48
|
+
gap: "var(--ds-space-0, 0px)"
|
|
49
49
|
}),
|
|
50
50
|
'025': css({
|
|
51
|
-
|
|
51
|
+
gap: "var(--ds-space-025, 2px)"
|
|
52
52
|
}),
|
|
53
53
|
'050': css({
|
|
54
|
-
|
|
54
|
+
gap: "var(--ds-space-050, 4px)"
|
|
55
55
|
}),
|
|
56
56
|
'075': css({
|
|
57
|
-
|
|
57
|
+
gap: "var(--ds-space-075, 6px)"
|
|
58
58
|
}),
|
|
59
59
|
'100': css({
|
|
60
|
-
|
|
60
|
+
gap: "var(--ds-space-100, 8px)"
|
|
61
61
|
}),
|
|
62
62
|
'150': css({
|
|
63
|
-
|
|
63
|
+
gap: "var(--ds-space-150, 12px)"
|
|
64
64
|
}),
|
|
65
65
|
'200': css({
|
|
66
|
-
|
|
66
|
+
gap: "var(--ds-space-200, 16px)"
|
|
67
67
|
}),
|
|
68
68
|
'250': css({
|
|
69
|
-
|
|
69
|
+
gap: "var(--ds-space-250, 20px)"
|
|
70
70
|
}),
|
|
71
71
|
'300': css({
|
|
72
|
-
|
|
72
|
+
gap: "var(--ds-space-300, 24px)"
|
|
73
73
|
}),
|
|
74
74
|
'400': css({
|
|
75
|
-
|
|
75
|
+
gap: "var(--ds-space-400, 32px)"
|
|
76
76
|
}),
|
|
77
77
|
'500': css({
|
|
78
|
-
|
|
78
|
+
gap: "var(--ds-space-500, 40px)"
|
|
79
79
|
}),
|
|
80
80
|
'600': css({
|
|
81
|
-
|
|
81
|
+
gap: "var(--ds-space-600, 48px)"
|
|
82
82
|
}),
|
|
83
83
|
'800': css({
|
|
84
|
-
|
|
84
|
+
gap: "var(--ds-space-800, 64px)"
|
|
85
85
|
}),
|
|
86
86
|
'1000': css({
|
|
87
|
-
|
|
87
|
+
gap: "var(--ds-space-1000, 80px)"
|
|
88
88
|
})
|
|
89
|
-
}
|
|
89
|
+
};
|
|
90
90
|
/**
|
|
91
91
|
* @codegenEnd
|
|
92
92
|
*/
|
|
@@ -122,7 +122,7 @@ const Stack = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
122
122
|
}, ref) => {
|
|
123
123
|
const justifyContent = spread || alignBlock;
|
|
124
124
|
return jsx("div", {
|
|
125
|
-
css: [baseStyles, space && spaceMap
|
|
125
|
+
css: [baseStyles, space && spaceMap[space], alignItems && alignItemsMap[alignItems], grow && flexGrowMap[grow], justifyContent && justifyContentMap[justifyContent]],
|
|
126
126
|
"data-testid": testId,
|
|
127
127
|
ref: ref
|
|
128
128
|
}, children);
|
package/dist/es2019/constants.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UNSAFE_Breakpoint as Breakpoint, UNSAFE_BreakpointConfig as BreakpointConfig, UNSAFE_BREAKPOINTS_CONFIG as BREAKPOINTS_CONFIG, UNSAFE_BREAKPOINTS_LIST as BREAKPOINTS_LIST } from '@atlaskit/ds-explorations';
|
|
1
2
|
export const LAYERS = {
|
|
2
3
|
card: 100,
|
|
3
4
|
navigation: 200,
|
|
@@ -8,4 +9,5 @@ export const LAYERS = {
|
|
|
8
9
|
flag: 600,
|
|
9
10
|
spotlight: 700,
|
|
10
11
|
tooltip: 800
|
|
11
|
-
};
|
|
12
|
+
};
|
|
13
|
+
export { BREAKPOINTS_CONFIG, BREAKPOINTS_LIST };
|
package/dist/es2019/index.js
CHANGED
package/dist/es2019/version.json
CHANGED
|
@@ -4,6 +4,17 @@ var _excluded = ["as", "children", "color", "backgroundColor", "shadow", "border
|
|
|
4
4
|
_excluded2 = ["style", "className"];
|
|
5
5
|
import React, { forwardRef } from 'react';
|
|
6
6
|
import { BaseBox } from './internal/base-box.partial';
|
|
7
|
+
// TODO: Fill in the component {description} and ensure links point to the correct {packageName} location.
|
|
8
|
+
// Remove links that the component does not have (such as usage). If there are no links remove them all.
|
|
9
|
+
/**
|
|
10
|
+
* __Box__
|
|
11
|
+
*
|
|
12
|
+
* A box {description}.
|
|
13
|
+
*
|
|
14
|
+
* - [Examples](https://atlassian.design/components/{packageName}/examples)
|
|
15
|
+
* - [Code](https://atlassian.design/components/{packageName}/code)
|
|
16
|
+
* - [Usage](https://atlassian.design/components/{packageName}/usage)
|
|
17
|
+
*/
|
|
7
18
|
var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
8
19
|
var as = _ref.as,
|
|
9
20
|
children = _ref.children,
|
|
@@ -74,4 +85,4 @@ var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
74
85
|
ref: ref
|
|
75
86
|
}, safeHtmlAttributes), children);
|
|
76
87
|
});
|
|
77
|
-
export
|
|
88
|
+
export default Box;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
/** @jsx jsx */
|
|
3
2
|
import { Children, forwardRef, Fragment, memo } from 'react';
|
|
4
3
|
import { css, jsx } from '@emotion/react';
|
|
@@ -44,30 +43,56 @@ var flexWrapStyles = css({
|
|
|
44
43
|
|
|
45
44
|
/**
|
|
46
45
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
47
|
-
* @codegen <<SignedSource::
|
|
46
|
+
* @codegen <<SignedSource::41d7002b7f69aa44d0d8598e07a1afc6>>
|
|
48
47
|
* @codegenId spacing
|
|
49
48
|
* @codegenCommand yarn codegen-styles
|
|
50
49
|
* @codegenParams ["space"]
|
|
51
50
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
52
51
|
*/
|
|
53
|
-
var spaceMap =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
52
|
+
var spaceMap = {
|
|
53
|
+
'0': css({
|
|
54
|
+
gap: "var(--ds-space-0, 0px)"
|
|
55
|
+
}),
|
|
56
|
+
'025': css({
|
|
57
|
+
gap: "var(--ds-space-025, 2px)"
|
|
58
|
+
}),
|
|
59
|
+
'050': css({
|
|
60
|
+
gap: "var(--ds-space-050, 4px)"
|
|
61
|
+
}),
|
|
62
|
+
'075': css({
|
|
63
|
+
gap: "var(--ds-space-075, 6px)"
|
|
64
|
+
}),
|
|
65
|
+
'100': css({
|
|
66
|
+
gap: "var(--ds-space-100, 8px)"
|
|
67
|
+
}),
|
|
68
|
+
'150': css({
|
|
69
|
+
gap: "var(--ds-space-150, 12px)"
|
|
70
|
+
}),
|
|
71
|
+
'200': css({
|
|
72
|
+
gap: "var(--ds-space-200, 16px)"
|
|
73
|
+
}),
|
|
74
|
+
'250': css({
|
|
75
|
+
gap: "var(--ds-space-250, 20px)"
|
|
76
|
+
}),
|
|
77
|
+
'300': css({
|
|
78
|
+
gap: "var(--ds-space-300, 24px)"
|
|
79
|
+
}),
|
|
80
|
+
'400': css({
|
|
81
|
+
gap: "var(--ds-space-400, 32px)"
|
|
82
|
+
}),
|
|
83
|
+
'500': css({
|
|
84
|
+
gap: "var(--ds-space-500, 40px)"
|
|
85
|
+
}),
|
|
86
|
+
'600': css({
|
|
87
|
+
gap: "var(--ds-space-600, 48px)"
|
|
88
|
+
}),
|
|
89
|
+
'800': css({
|
|
90
|
+
gap: "var(--ds-space-800, 64px)"
|
|
91
|
+
}),
|
|
92
|
+
'1000': css({
|
|
93
|
+
gap: "var(--ds-space-1000, 80px)"
|
|
94
|
+
})
|
|
95
|
+
};
|
|
71
96
|
/**
|
|
72
97
|
* @codegenEnd
|
|
73
98
|
*/
|
|
@@ -80,7 +105,7 @@ var baseStyles = css({
|
|
|
80
105
|
var separatorStyles = css({
|
|
81
106
|
color: "var(--ds-text-subtle, #42526E)",
|
|
82
107
|
marginBlock: "var(--ds-space-0, 0px)",
|
|
83
|
-
marginInline: "-".concat("var(--ds-space-025, 2px)"),
|
|
108
|
+
marginInline: "calc(-1 * ".concat("var(--ds-space-025, 2px)", ")"),
|
|
84
109
|
pointerEvents: 'none',
|
|
85
110
|
userSelect: 'none'
|
|
86
111
|
});
|
|
@@ -125,7 +150,7 @@ var Inline = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
125
150
|
}) : rawChildren;
|
|
126
151
|
var justifyContent = spread || alignInline;
|
|
127
152
|
return jsx("div", {
|
|
128
|
-
css: [baseStyles, space && spaceMap
|
|
153
|
+
css: [baseStyles, space && spaceMap[space], justifyContent && justifyContentMap[justifyContent], grow && flexGrowMap[grow], alignItems && alignItemsMap[alignItems], shouldWrap && flexWrapStyles],
|
|
129
154
|
"data-testid": testId,
|
|
130
155
|
ref: ref
|
|
131
156
|
}, children);
|