@atlaskit/ds-explorations 2.0.1 → 2.0.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 +7 -0
- package/dist/cjs/components/box.partial.js +34 -43
- package/dist/cjs/components/inline.partial.js +10 -14
- package/dist/cjs/components/interaction-surface.partial.js +9 -14
- package/dist/cjs/components/stack.partial.js +9 -11
- package/dist/cjs/components/surface-provider.js +1 -5
- package/dist/cjs/components/text.partial.js +23 -36
- package/dist/cjs/index.js +0 -6
- package/dist/cjs/internal/color-map.js +2 -3
- package/dist/cjs/internal/role-to-element.js +0 -1
- package/dist/cjs/internal/spacing-scale.js +0 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/box.partial.js +12 -11
- package/dist/es2019/components/inline.partial.js +3 -4
- package/dist/es2019/components/interaction-surface.partial.js +7 -8
- package/dist/es2019/components/stack.partial.js +3 -2
- package/dist/es2019/components/surface-provider.js +1 -2
- package/dist/es2019/components/text.partial.js +10 -14
- package/dist/es2019/internal/color-map.js +2 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/box.partial.js +37 -37
- package/dist/esm/components/inline.partial.js +10 -11
- package/dist/esm/components/interaction-surface.partial.js +9 -10
- package/dist/esm/components/stack.partial.js +9 -8
- package/dist/esm/components/surface-provider.js +1 -2
- package/dist/esm/components/text.partial.js +24 -30
- package/dist/esm/internal/color-map.js +2 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/components/box.partial.d.ts +2 -2
- package/dist/types/components/text.partial.d.ts +2 -2
- package/dist/types/internal/color-map.d.ts +2 -2
- package/package.json +2 -2
- package/src/components/box.partial.tsx +2 -2
- package/src/components/interaction-surface.partial.tsx +2 -2
- package/src/components/text.partial.tsx +2 -2
- package/src/internal/color-map.tsx +2 -2
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
2
|
/** @jsx jsx */
|
|
4
3
|
import { forwardRef } from 'react';
|
|
5
4
|
import { css, jsx } from '@emotion/react';
|
|
6
5
|
import { LAYERS } from '../constants';
|
|
7
6
|
import { SurfaceContext } from './surface-provider';
|
|
8
|
-
|
|
9
7
|
/**
|
|
10
8
|
* __Box__
|
|
11
9
|
*
|
|
@@ -43,8 +41,8 @@ export const Box = /*#__PURE__*/forwardRef(({
|
|
|
43
41
|
const Component = as || 'div';
|
|
44
42
|
const node = jsx(Component, _extends({
|
|
45
43
|
style: UNSAFE_style,
|
|
46
|
-
ref: ref
|
|
47
|
-
|
|
44
|
+
ref: ref
|
|
45
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
48
46
|
}, htmlAttributes, {
|
|
49
47
|
className: className,
|
|
50
48
|
css: [baseStyles, display && displayMap[display], padding && paddingMap[padding], position && positionMap[position], paddingBlock && paddingBlockMap[paddingBlock], paddingInline && paddingInlineMap[paddingInline], alignItems && flexAlignItemsMap[alignItems], justifyContent && flexJustifyContentMap[justifyContent], backgroundColor && backgroundColorMap[backgroundColor], borderColor && borderColorMap[borderColor], borderStyle && borderStyleMap[borderStyle], borderWidth && borderWidthMap[borderWidth], borderRadius && borderRadiusMap[borderRadius], shadow && shadowMap[shadow], layer && layerMap[layer], flexDirection && flexDirectionMap[flexDirection], overflow && overflowMap[overflow], width && widthMap[width], height && heightMap[height]],
|
|
@@ -55,7 +53,9 @@ export const Box = /*#__PURE__*/forwardRef(({
|
|
|
55
53
|
}, node) : node;
|
|
56
54
|
});
|
|
57
55
|
Box.displayName = 'Box';
|
|
58
|
-
export default Box;
|
|
56
|
+
export default Box;
|
|
57
|
+
|
|
58
|
+
// <<< STYLES GO HERE >>>
|
|
59
59
|
|
|
60
60
|
const borderStyleMap = {
|
|
61
61
|
none: css({
|
|
@@ -96,6 +96,7 @@ const borderRadiusMap = {
|
|
|
96
96
|
borderRadius: '8px'
|
|
97
97
|
})
|
|
98
98
|
};
|
|
99
|
+
|
|
99
100
|
/**
|
|
100
101
|
* @experimental - this is likely to be removed
|
|
101
102
|
*/
|
|
@@ -108,6 +109,7 @@ const flexDirectionMap = {
|
|
|
108
109
|
flexDirection: 'row'
|
|
109
110
|
})
|
|
110
111
|
};
|
|
112
|
+
|
|
111
113
|
/**
|
|
112
114
|
* @experimental - this is likely to be removed
|
|
113
115
|
*/
|
|
@@ -132,6 +134,7 @@ const flexAlignItemsMap = {
|
|
|
132
134
|
alignItems: 'end'
|
|
133
135
|
})
|
|
134
136
|
};
|
|
137
|
+
|
|
135
138
|
/**
|
|
136
139
|
* @experimental - this is likely to be removed
|
|
137
140
|
*/
|
|
@@ -197,6 +200,7 @@ const baseStyles = css({
|
|
|
197
200
|
appearance: 'none',
|
|
198
201
|
border: 'none'
|
|
199
202
|
});
|
|
203
|
+
|
|
200
204
|
/**
|
|
201
205
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
202
206
|
* @codegen <<SignedSource::327e769aaa3da9422a919a0ca9490070>>
|
|
@@ -204,7 +208,6 @@ const baseStyles = css({
|
|
|
204
208
|
* @codegenCommand yarn codegen-styles
|
|
205
209
|
* @codegenParams ["width", "height"]
|
|
206
210
|
*/
|
|
207
|
-
|
|
208
211
|
const widthMap = {
|
|
209
212
|
'100%': css({
|
|
210
213
|
width: '100%'
|
|
@@ -257,7 +260,6 @@ const heightMap = {
|
|
|
257
260
|
height: '96px'
|
|
258
261
|
})
|
|
259
262
|
};
|
|
260
|
-
|
|
261
263
|
/**
|
|
262
264
|
* @codegenEnd
|
|
263
265
|
*/
|
|
@@ -402,18 +404,17 @@ const paddingInlineMap = {
|
|
|
402
404
|
paddingInline: "var(--ds-space-800, 64px)"
|
|
403
405
|
})
|
|
404
406
|
};
|
|
405
|
-
|
|
406
407
|
/**
|
|
407
408
|
* @codegenEnd
|
|
408
409
|
*/
|
|
409
410
|
|
|
410
411
|
/**
|
|
411
412
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
412
|
-
* @codegen <<SignedSource::
|
|
413
|
+
* @codegen <<SignedSource::514663609a5a48a284de40c5c4ad200b>>
|
|
413
414
|
* @codegenId colors
|
|
414
415
|
* @codegenCommand yarn codegen-styles
|
|
415
416
|
* @codegenParams ["border", "background", "shadow"]
|
|
416
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::
|
|
417
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::10aa7e87eca39e4d6594a764e78e0698>>
|
|
417
418
|
*/
|
|
418
419
|
const borderColorMap = {
|
|
419
420
|
'color.border': css({
|
|
@@ -553,7 +554,6 @@ const shadowMap = {
|
|
|
553
554
|
boxShadow: "var(--ds-shadow-raised, 0px 1px 1px #091e423f, 0px 0px 1px #091e4221)"
|
|
554
555
|
})
|
|
555
556
|
};
|
|
556
|
-
|
|
557
557
|
/**
|
|
558
558
|
* @codegenEnd
|
|
559
559
|
*/
|
|
@@ -594,6 +594,7 @@ const layerMap = {
|
|
|
594
594
|
zIndex: LAYERS['tooltip']
|
|
595
595
|
})
|
|
596
596
|
};
|
|
597
|
+
|
|
597
598
|
/**
|
|
598
599
|
* @codegenEnd
|
|
599
600
|
*/
|
|
@@ -60,12 +60,12 @@ const dividerStyles = css({
|
|
|
60
60
|
pointerEvents: 'none',
|
|
61
61
|
userSelect: 'none'
|
|
62
62
|
});
|
|
63
|
-
|
|
64
63
|
const Divider = ({
|
|
65
64
|
children
|
|
66
65
|
}) => jsx("span", {
|
|
67
66
|
css: dividerStyles
|
|
68
67
|
}, children);
|
|
68
|
+
|
|
69
69
|
/**
|
|
70
70
|
* __Inline__
|
|
71
71
|
*
|
|
@@ -82,8 +82,6 @@ const Divider = ({
|
|
|
82
82
|
* )
|
|
83
83
|
* ```
|
|
84
84
|
*/
|
|
85
|
-
|
|
86
|
-
|
|
87
85
|
const Inline = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
88
86
|
gap,
|
|
89
87
|
alignItems,
|
|
@@ -109,6 +107,7 @@ const Inline = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
109
107
|
}));
|
|
110
108
|
Inline.displayName = 'Inline';
|
|
111
109
|
export default Inline;
|
|
110
|
+
|
|
112
111
|
/**
|
|
113
112
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
114
113
|
* @codegen <<SignedSource::e4218f7c850d1484a192d5b8b5dce136>>
|
|
@@ -117,7 +116,6 @@ export default Inline;
|
|
|
117
116
|
* @codegenParams ["columnGap"]
|
|
118
117
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::b0b8f1a822ed84e0407ad83e6fda5a1c>>
|
|
119
118
|
*/
|
|
120
|
-
|
|
121
119
|
const columnGapMap = {
|
|
122
120
|
'space.0': css({
|
|
123
121
|
columnGap: "var(--ds-space-0, 0px)"
|
|
@@ -162,6 +160,7 @@ const columnGapMap = {
|
|
|
162
160
|
columnGap: "var(--ds-space-800, 64px)"
|
|
163
161
|
})
|
|
164
162
|
};
|
|
163
|
+
|
|
165
164
|
/**
|
|
166
165
|
* @codegenEnd
|
|
167
166
|
*/
|
|
@@ -13,7 +13,6 @@ const baseStyles = css({
|
|
|
13
13
|
pointerEvents: 'none'
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
|
|
17
16
|
/**
|
|
18
17
|
*
|
|
19
18
|
* @example
|
|
@@ -32,30 +31,29 @@ const InteractionSurface = ({
|
|
|
32
31
|
testId
|
|
33
32
|
}) => {
|
|
34
33
|
const defaultSurface = useContext(SurfaceContext);
|
|
35
|
-
let surface = appearance || defaultSurface;
|
|
34
|
+
let surface = appearance || defaultSurface;
|
|
35
|
+
|
|
36
|
+
// This case will occur if the Box has not set a bg color and the ancestor surface
|
|
36
37
|
// is an elevation. An alternative would be to throw an error here as it may be better
|
|
37
38
|
// to ensure correct predictable behaviour based on user specification.
|
|
38
|
-
|
|
39
39
|
if (!(surface in backgroundActiveColorMap)) {
|
|
40
40
|
surface = 'neutral';
|
|
41
41
|
}
|
|
42
|
-
|
|
43
42
|
return jsx(Fragment, null, jsx("span", {
|
|
44
43
|
"data-testid": testId,
|
|
45
44
|
css: [baseStyles, surface && backgroundHoverColorMap[surface], surface && backgroundActiveColorMap[surface]]
|
|
46
45
|
}), children);
|
|
47
46
|
};
|
|
48
|
-
|
|
49
47
|
export default InteractionSurface;
|
|
48
|
+
|
|
50
49
|
/**
|
|
51
50
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
52
|
-
* @codegen <<SignedSource::
|
|
51
|
+
* @codegen <<SignedSource::4f6bde99739600abea2bbe6e62397bc4>>
|
|
53
52
|
* @codegenId interactions
|
|
54
53
|
* @codegenCommand yarn codegen-styles
|
|
55
54
|
* @codegenParams ["background"]
|
|
56
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::
|
|
55
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::10aa7e87eca39e4d6594a764e78e0698>>
|
|
57
56
|
*/
|
|
58
|
-
|
|
59
57
|
const backgroundActiveColorMap = {
|
|
60
58
|
input: css({
|
|
61
59
|
':active': {
|
|
@@ -270,6 +268,7 @@ const backgroundHoverColorMap = {
|
|
|
270
268
|
}
|
|
271
269
|
})
|
|
272
270
|
};
|
|
271
|
+
|
|
273
272
|
/**
|
|
274
273
|
* @codegenEnd
|
|
275
274
|
*/
|
|
@@ -48,6 +48,7 @@ const baseStyles = css({
|
|
|
48
48
|
boxSizing: 'border-box',
|
|
49
49
|
flexDirection: 'column'
|
|
50
50
|
});
|
|
51
|
+
|
|
51
52
|
/**
|
|
52
53
|
* __Stack__
|
|
53
54
|
*
|
|
@@ -55,7 +56,6 @@ const baseStyles = css({
|
|
|
55
56
|
* Renders a `div` by default.
|
|
56
57
|
*
|
|
57
58
|
*/
|
|
58
|
-
|
|
59
59
|
const Stack = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
60
60
|
gap,
|
|
61
61
|
alignItems,
|
|
@@ -74,6 +74,7 @@ const Stack = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
74
74
|
}));
|
|
75
75
|
Stack.displayName = 'Stack';
|
|
76
76
|
export default Stack;
|
|
77
|
+
|
|
77
78
|
/**
|
|
78
79
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
79
80
|
* @codegen <<SignedSource::91d26b1ace8b38363779ae85a7ddc51b>>
|
|
@@ -82,7 +83,6 @@ export default Stack;
|
|
|
82
83
|
* @codegenParams ["rowGap"]
|
|
83
84
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::b0b8f1a822ed84e0407ad83e6fda5a1c>>
|
|
84
85
|
*/
|
|
85
|
-
|
|
86
86
|
const rowGapMap = {
|
|
87
87
|
'space.0': css({
|
|
88
88
|
rowGap: "var(--ds-space-0, 0px)"
|
|
@@ -127,6 +127,7 @@ const rowGapMap = {
|
|
|
127
127
|
rowGap: "var(--ds-space-800, 64px)"
|
|
128
128
|
})
|
|
129
129
|
};
|
|
130
|
+
|
|
130
131
|
/**
|
|
131
132
|
* @codegenEnd
|
|
132
133
|
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createContext, useContext } from 'react';
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* __Surface context__
|
|
5
4
|
*
|
|
6
5
|
* A surface context provides context information on the current background (if set).
|
|
7
6
|
*/
|
|
8
7
|
export const SurfaceContext = /*#__PURE__*/createContext('elevation.surface');
|
|
8
|
+
|
|
9
9
|
/**
|
|
10
10
|
* __useSurface__
|
|
11
11
|
*
|
|
@@ -13,7 +13,6 @@ export const SurfaceContext = /*#__PURE__*/createContext('elevation.surface');
|
|
|
13
13
|
*
|
|
14
14
|
* @see SurfaceContext
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
16
|
export const useSurface = () => {
|
|
18
17
|
return useContext(SurfaceContext);
|
|
19
18
|
};
|
|
@@ -48,25 +48,24 @@ const truncateStyles = css({
|
|
|
48
48
|
textOverflow: 'ellipsis',
|
|
49
49
|
whiteSpace: 'nowrap'
|
|
50
50
|
});
|
|
51
|
+
|
|
51
52
|
/**
|
|
52
53
|
* Custom hook designed to abstract the parsing of the color props and make it clearer in the future how color is reconciled between themes and tokens.
|
|
53
54
|
*/
|
|
54
|
-
|
|
55
55
|
const useColor = colorProp => {
|
|
56
56
|
const surface = useSurface();
|
|
57
57
|
const inverseTextColor = surfaceColorMap[surface];
|
|
58
|
+
|
|
58
59
|
/**
|
|
59
60
|
* Where the color of the surface is inverted we override the user choice
|
|
60
61
|
* as there is no valid choice that is not covered by the override.
|
|
61
62
|
*/
|
|
62
|
-
|
|
63
63
|
const color = inverseTextColor !== null && inverseTextColor !== void 0 ? inverseTextColor : colorProp;
|
|
64
64
|
return color;
|
|
65
65
|
};
|
|
66
|
-
|
|
67
66
|
const HasTextAncestorContext = /*#__PURE__*/createContext(false);
|
|
68
|
-
|
|
69
67
|
const useHasTextAncestor = () => useContext(HasTextAncestorContext);
|
|
68
|
+
|
|
70
69
|
/**
|
|
71
70
|
* __Text__
|
|
72
71
|
*
|
|
@@ -76,8 +75,6 @@ const useHasTextAncestor = () => useContext(HasTextAncestorContext);
|
|
|
76
75
|
*
|
|
77
76
|
* @internal
|
|
78
77
|
*/
|
|
79
|
-
|
|
80
|
-
|
|
81
78
|
const Text = ({
|
|
82
79
|
children,
|
|
83
80
|
...props
|
|
@@ -99,28 +96,28 @@ const Text = ({
|
|
|
99
96
|
invariant(asAllowlist.includes(Component), `@atlaskit/ds-explorations: Text received an invalid "as" value of "${Component}"`);
|
|
100
97
|
const color = useColor(colorProp);
|
|
101
98
|
const isWrapped = useHasTextAncestor();
|
|
99
|
+
|
|
102
100
|
/**
|
|
103
101
|
* If the text is already wrapped and applies no props we can just
|
|
104
102
|
* render the children directly as a fragment.
|
|
105
103
|
*/
|
|
106
|
-
|
|
107
104
|
if (isWrapped && Object.keys(props).length === 0) {
|
|
108
105
|
return jsx(Fragment, null, children);
|
|
109
106
|
}
|
|
110
|
-
|
|
111
107
|
const component = jsx(Component, {
|
|
112
108
|
style: UNSAFE_style,
|
|
113
109
|
css: [baseStyles, fontFamilyMap.sans, color && textColorMap[color], fontSize && fontSizeMap[fontSize], fontWeight && fontWeightMap[fontWeight], lineHeight && lineHeightMap[lineHeight], shouldTruncate && truncateStyles, textAlign && textAlignMap[textAlign], textTransform && textTransformMap[textTransform], verticalAlign && verticalAlignMap[verticalAlign]],
|
|
114
110
|
"data-testid": testId,
|
|
115
111
|
id: id
|
|
116
112
|
}, children);
|
|
117
|
-
return isWrapped ?
|
|
113
|
+
return isWrapped ?
|
|
114
|
+
// no need to re-apply context if the text is already wrapped
|
|
118
115
|
component : jsx(HasTextAncestorContext.Provider, {
|
|
119
116
|
value: true
|
|
120
117
|
}, component);
|
|
121
118
|
};
|
|
122
|
-
|
|
123
119
|
export default Text;
|
|
120
|
+
|
|
124
121
|
/**
|
|
125
122
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
126
123
|
* @codegen <<SignedSource::9f746e797b8b5262d58b40dfecb39e6d>>
|
|
@@ -129,7 +126,6 @@ export default Text;
|
|
|
129
126
|
* @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight"]
|
|
130
127
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-typography.tsx <<SignedSource::e6bf70c53b8eecdb84ae4c79966537e3>>
|
|
131
128
|
*/
|
|
132
|
-
|
|
133
129
|
const fontSizeMap = {
|
|
134
130
|
'size.050': css({
|
|
135
131
|
fontSize: "var(--ds-font-size-050, 11px)"
|
|
@@ -198,18 +194,17 @@ const lineHeightMap = {
|
|
|
198
194
|
lineHeight: "var(--ds-font-lineHeight-600, 40px)"
|
|
199
195
|
})
|
|
200
196
|
};
|
|
201
|
-
|
|
202
197
|
/**
|
|
203
198
|
* @codegenEnd
|
|
204
199
|
*/
|
|
205
200
|
|
|
206
201
|
/**
|
|
207
202
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
208
|
-
* @codegen <<SignedSource::
|
|
203
|
+
* @codegen <<SignedSource::3780858df77f5fe0c6e0f39a4c989741>>
|
|
209
204
|
* @codegenId colors
|
|
210
205
|
* @codegenCommand yarn codegen-styles
|
|
211
206
|
* @codegenParams ["text"]
|
|
212
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::
|
|
207
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::10aa7e87eca39e4d6594a764e78e0698>>
|
|
213
208
|
*/
|
|
214
209
|
const textColorMap = {
|
|
215
210
|
'color.text': css({
|
|
@@ -252,6 +247,7 @@ const textColorMap = {
|
|
|
252
247
|
color: "var(--ds-text-subtle, #42526E)"
|
|
253
248
|
})
|
|
254
249
|
};
|
|
250
|
+
|
|
255
251
|
/**
|
|
256
252
|
* @codegenEnd
|
|
257
253
|
*/
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The color map is used to map a background color token to a matching text color that will meet contrast.
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::d168519874a16bbb92cfbfd4747a39b4>>
|
|
7
7
|
* @codegenCommand yarn codegen-styles
|
|
8
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::10aa7e87eca39e4d6594a764e78e0698>>
|
|
9
9
|
*/
|
|
10
10
|
export default {
|
|
11
11
|
'neutral.bold': 'inverse',
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["children", "as", "className", "display", "flexDirection", "alignItems", "justifyContent", "backgroundColor", "borderColor", "borderStyle", "borderWidth", "borderRadius", "shadow", "layer", "padding", "paddingBlock", "paddingInline", "position", "height", "overflow", "width", "UNSAFE_style", "testId"];
|
|
4
|
-
|
|
5
4
|
/** @jsx jsx */
|
|
6
5
|
import { forwardRef } from 'react';
|
|
7
6
|
import { css, jsx } from '@emotion/react';
|
|
8
7
|
import { LAYERS } from '../constants';
|
|
9
8
|
import { SurfaceContext } from './surface-provider';
|
|
10
|
-
|
|
11
9
|
/**
|
|
12
10
|
* __Box__
|
|
13
11
|
*
|
|
@@ -18,37 +16,36 @@ import { SurfaceContext } from './surface-provider';
|
|
|
18
16
|
*/
|
|
19
17
|
export var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
20
18
|
var children = _ref.children,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
19
|
+
as = _ref.as,
|
|
20
|
+
className = _ref.className,
|
|
21
|
+
_ref$display = _ref.display,
|
|
22
|
+
display = _ref$display === void 0 ? 'flex' : _ref$display,
|
|
23
|
+
flexDirection = _ref.flexDirection,
|
|
24
|
+
alignItems = _ref.alignItems,
|
|
25
|
+
justifyContent = _ref.justifyContent,
|
|
26
|
+
backgroundColor = _ref.backgroundColor,
|
|
27
|
+
borderColor = _ref.borderColor,
|
|
28
|
+
borderStyle = _ref.borderStyle,
|
|
29
|
+
borderWidth = _ref.borderWidth,
|
|
30
|
+
borderRadius = _ref.borderRadius,
|
|
31
|
+
shadow = _ref.shadow,
|
|
32
|
+
layer = _ref.layer,
|
|
33
|
+
padding = _ref.padding,
|
|
34
|
+
paddingBlock = _ref.paddingBlock,
|
|
35
|
+
paddingInline = _ref.paddingInline,
|
|
36
|
+
_ref$position = _ref.position,
|
|
37
|
+
position = _ref$position === void 0 ? 'relative' : _ref$position,
|
|
38
|
+
height = _ref.height,
|
|
39
|
+
overflow = _ref.overflow,
|
|
40
|
+
width = _ref.width,
|
|
41
|
+
UNSAFE_style = _ref.UNSAFE_style,
|
|
42
|
+
testId = _ref.testId,
|
|
43
|
+
htmlAttributes = _objectWithoutProperties(_ref, _excluded);
|
|
47
44
|
var Component = as || 'div';
|
|
48
45
|
var node = jsx(Component, _extends({
|
|
49
46
|
style: UNSAFE_style,
|
|
50
|
-
ref: ref
|
|
51
|
-
|
|
47
|
+
ref: ref
|
|
48
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
52
49
|
}, htmlAttributes, {
|
|
53
50
|
className: className,
|
|
54
51
|
css: [baseStyles, display && displayMap[display], padding && paddingMap[padding], position && positionMap[position], paddingBlock && paddingBlockMap[paddingBlock], paddingInline && paddingInlineMap[paddingInline], alignItems && flexAlignItemsMap[alignItems], justifyContent && flexJustifyContentMap[justifyContent], backgroundColor && backgroundColorMap[backgroundColor], borderColor && borderColorMap[borderColor], borderStyle && borderStyleMap[borderStyle], borderWidth && borderWidthMap[borderWidth], borderRadius && borderRadiusMap[borderRadius], shadow && shadowMap[shadow], layer && layerMap[layer], flexDirection && flexDirectionMap[flexDirection], overflow && overflowMap[overflow], width && widthMap[width], height && heightMap[height]],
|
|
@@ -59,7 +56,9 @@ export var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
59
56
|
}, node) : node;
|
|
60
57
|
});
|
|
61
58
|
Box.displayName = 'Box';
|
|
62
|
-
export default Box;
|
|
59
|
+
export default Box;
|
|
60
|
+
|
|
61
|
+
// <<< STYLES GO HERE >>>
|
|
63
62
|
|
|
64
63
|
var borderStyleMap = {
|
|
65
64
|
none: css({
|
|
@@ -100,6 +99,7 @@ var borderRadiusMap = {
|
|
|
100
99
|
borderRadius: '8px'
|
|
101
100
|
})
|
|
102
101
|
};
|
|
102
|
+
|
|
103
103
|
/**
|
|
104
104
|
* @experimental - this is likely to be removed
|
|
105
105
|
*/
|
|
@@ -112,6 +112,7 @@ var flexDirectionMap = {
|
|
|
112
112
|
flexDirection: 'row'
|
|
113
113
|
})
|
|
114
114
|
};
|
|
115
|
+
|
|
115
116
|
/**
|
|
116
117
|
* @experimental - this is likely to be removed
|
|
117
118
|
*/
|
|
@@ -136,6 +137,7 @@ var flexAlignItemsMap = {
|
|
|
136
137
|
alignItems: 'end'
|
|
137
138
|
})
|
|
138
139
|
};
|
|
140
|
+
|
|
139
141
|
/**
|
|
140
142
|
* @experimental - this is likely to be removed
|
|
141
143
|
*/
|
|
@@ -201,6 +203,7 @@ var baseStyles = css({
|
|
|
201
203
|
appearance: 'none',
|
|
202
204
|
border: 'none'
|
|
203
205
|
});
|
|
206
|
+
|
|
204
207
|
/**
|
|
205
208
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
206
209
|
* @codegen <<SignedSource::327e769aaa3da9422a919a0ca9490070>>
|
|
@@ -208,7 +211,6 @@ var baseStyles = css({
|
|
|
208
211
|
* @codegenCommand yarn codegen-styles
|
|
209
212
|
* @codegenParams ["width", "height"]
|
|
210
213
|
*/
|
|
211
|
-
|
|
212
214
|
var widthMap = {
|
|
213
215
|
'100%': css({
|
|
214
216
|
width: '100%'
|
|
@@ -261,7 +263,6 @@ var heightMap = {
|
|
|
261
263
|
height: '96px'
|
|
262
264
|
})
|
|
263
265
|
};
|
|
264
|
-
|
|
265
266
|
/**
|
|
266
267
|
* @codegenEnd
|
|
267
268
|
*/
|
|
@@ -406,18 +407,17 @@ var paddingInlineMap = {
|
|
|
406
407
|
paddingInline: "var(--ds-space-800, 64px)"
|
|
407
408
|
})
|
|
408
409
|
};
|
|
409
|
-
|
|
410
410
|
/**
|
|
411
411
|
* @codegenEnd
|
|
412
412
|
*/
|
|
413
413
|
|
|
414
414
|
/**
|
|
415
415
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
416
|
-
* @codegen <<SignedSource::
|
|
416
|
+
* @codegen <<SignedSource::514663609a5a48a284de40c5c4ad200b>>
|
|
417
417
|
* @codegenId colors
|
|
418
418
|
* @codegenCommand yarn codegen-styles
|
|
419
419
|
* @codegenParams ["border", "background", "shadow"]
|
|
420
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::
|
|
420
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::10aa7e87eca39e4d6594a764e78e0698>>
|
|
421
421
|
*/
|
|
422
422
|
var borderColorMap = {
|
|
423
423
|
'color.border': css({
|
|
@@ -557,7 +557,6 @@ var shadowMap = {
|
|
|
557
557
|
boxShadow: "var(--ds-shadow-raised, 0px 1px 1px #091e423f, 0px 0px 1px #091e4221)"
|
|
558
558
|
})
|
|
559
559
|
};
|
|
560
|
-
|
|
561
560
|
/**
|
|
562
561
|
* @codegenEnd
|
|
563
562
|
*/
|
|
@@ -598,6 +597,7 @@ var layerMap = {
|
|
|
598
597
|
zIndex: LAYERS['tooltip']
|
|
599
598
|
})
|
|
600
599
|
};
|
|
600
|
+
|
|
601
601
|
/**
|
|
602
602
|
* @codegenEnd
|
|
603
603
|
*/
|
|
@@ -60,13 +60,13 @@ var dividerStyles = css({
|
|
|
60
60
|
pointerEvents: 'none',
|
|
61
61
|
userSelect: 'none'
|
|
62
62
|
});
|
|
63
|
-
|
|
64
63
|
var Divider = function Divider(_ref) {
|
|
65
64
|
var children = _ref.children;
|
|
66
65
|
return jsx("span", {
|
|
67
66
|
css: dividerStyles
|
|
68
67
|
}, children);
|
|
69
68
|
};
|
|
69
|
+
|
|
70
70
|
/**
|
|
71
71
|
* __Inline__
|
|
72
72
|
*
|
|
@@ -83,17 +83,15 @@ var Divider = function Divider(_ref) {
|
|
|
83
83
|
* )
|
|
84
84
|
* ```
|
|
85
85
|
*/
|
|
86
|
-
|
|
87
|
-
|
|
88
86
|
var Inline = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
89
87
|
var gap = _ref2.gap,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
88
|
+
alignItems = _ref2.alignItems,
|
|
89
|
+
justifyContent = _ref2.justifyContent,
|
|
90
|
+
flexWrap = _ref2.flexWrap,
|
|
91
|
+
divider = _ref2.divider,
|
|
92
|
+
UNSAFE_style = _ref2.UNSAFE_style,
|
|
93
|
+
rawChildren = _ref2.children,
|
|
94
|
+
testId = _ref2.testId;
|
|
97
95
|
var dividerComponent = typeof divider === 'string' ? jsx(Divider, null, divider) : divider;
|
|
98
96
|
var children = divider ? Children.toArray(rawChildren).filter(Boolean).map(function (child, index) {
|
|
99
97
|
return jsx(Fragment, {
|
|
@@ -109,6 +107,7 @@ var Inline = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
109
107
|
}));
|
|
110
108
|
Inline.displayName = 'Inline';
|
|
111
109
|
export default Inline;
|
|
110
|
+
|
|
112
111
|
/**
|
|
113
112
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
114
113
|
* @codegen <<SignedSource::e4218f7c850d1484a192d5b8b5dce136>>
|
|
@@ -117,7 +116,6 @@ export default Inline;
|
|
|
117
116
|
* @codegenParams ["columnGap"]
|
|
118
117
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::b0b8f1a822ed84e0407ad83e6fda5a1c>>
|
|
119
118
|
*/
|
|
120
|
-
|
|
121
119
|
var columnGapMap = {
|
|
122
120
|
'space.0': css({
|
|
123
121
|
columnGap: "var(--ds-space-0, 0px)"
|
|
@@ -162,6 +160,7 @@ var columnGapMap = {
|
|
|
162
160
|
columnGap: "var(--ds-space-800, 64px)"
|
|
163
161
|
})
|
|
164
162
|
};
|
|
163
|
+
|
|
165
164
|
/**
|
|
166
165
|
* @codegenEnd
|
|
167
166
|
*/
|