@atlaskit/ds-explorations 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/cjs/components/box.partial.js +4 -4
- package/dist/cjs/components/inline.partial.js +42 -19
- package/dist/cjs/components/interaction-surface.partial.js +2 -2
- package/dist/cjs/components/stack.partial.js +4 -4
- package/dist/cjs/components/text.partial.js +6 -4
- package/dist/cjs/internal/color-map.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/box.partial.js +4 -4
- package/dist/es2019/components/inline.partial.js +32 -9
- package/dist/es2019/components/interaction-surface.partial.js +2 -2
- package/dist/es2019/components/stack.partial.js +5 -5
- package/dist/es2019/components/text.partial.js +6 -4
- package/dist/es2019/internal/color-map.js +2 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/box.partial.js +4 -4
- package/dist/esm/components/inline.partial.js +41 -17
- package/dist/esm/components/interaction-surface.partial.js +2 -2
- package/dist/esm/components/stack.partial.js +5 -5
- package/dist/esm/components/text.partial.js +6 -4
- package/dist/esm/internal/color-map.js +2 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/components/box.partial.d.ts +9 -9
- package/dist/types/components/inline.partial.d.ts +14 -5
- package/dist/types/components/stack.partial.d.ts +7 -6
- package/dist/types/components/text.partial.d.ts +6 -2
- package/dist/types/components/types.d.ts +0 -1
- package/dist/types/internal/color-map.d.ts +2 -2
- package/examples/02-text.tsx +1 -0
- package/inline/package.json +15 -0
- package/package.json +4 -2
- package/report.api.md +9 -12
- package/src/components/__tests__/unit/text.test.tsx +9 -1
- package/src/components/box.partial.tsx +69 -68
- package/src/components/inline.partial.tsx +79 -58
- package/src/components/interaction-surface.partial.tsx +2 -2
- package/src/components/stack.partial.tsx +48 -46
- package/src/components/text.partial.tsx +8 -2
- package/src/components/types.tsx +0 -2
- package/src/internal/color-map.tsx +2 -2
- package/stack/package.json +15 -0
- package/tmp/api-report-tmp.d.ts +7 -10
- package/dist/types-ts4.0/components/box.partial.d.ts +0 -303
- package/dist/types-ts4.0/components/inline.partial.d.ts +0 -86
- package/dist/types-ts4.0/components/interaction-surface.partial.d.ts +0 -49
- package/dist/types-ts4.0/components/stack.partial.d.ts +0 -80
- package/dist/types-ts4.0/components/surface-provider.d.ts +0 -15
- package/dist/types-ts4.0/components/text.partial.d.ts +0 -131
- package/dist/types-ts4.0/components/types.d.ts +0 -14
- package/dist/types-ts4.0/index.d.ts +0 -7
- package/dist/types-ts4.0/internal/color-map.d.ts +0 -36
- package/dist/types-ts4.0/internal/role-to-element.d.ts +0 -32
- package/dist/types-ts4.0/internal/spacing-scale.d.ts +0 -22
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/ds-explorations
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`e6fb7598867`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e6fb7598867) - Exposes additional public entrypoints for `Inline` and `Stack`.
|
|
8
|
+
Loosens the types of `children` for the `Inline`, `Stack` and `Box` as it was causing unexpected friction.
|
|
9
|
+
|
|
10
|
+
## 1.1.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [`93d75a4e289`](https://bitbucket.org/atlassian/atlassian-frontend/commits/93d75a4e289) - Adding id prop for Text component so that element can be updated with id attribute. It's a way for an element to be uniquely identifiable for a range of reasons. For example: URL anchors, reference target for integrations and accessible label references.
|
|
15
|
+
|
|
3
16
|
## 1.0.0
|
|
4
17
|
|
|
5
18
|
### Major Changes
|
|
@@ -180,11 +180,11 @@ var baseStyles = (0, _react2.css)({
|
|
|
180
180
|
});
|
|
181
181
|
/**
|
|
182
182
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
183
|
-
* @codegen <<SignedSource::
|
|
183
|
+
* @codegen <<SignedSource::2d25a493458fa1cefdafcd559404f2ec>>
|
|
184
184
|
* @codegenId spacing
|
|
185
185
|
* @codegenCommand yarn codegen-styles
|
|
186
186
|
* @codegenParams ["padding", "paddingBlock", "paddingInline", "width", "height"]
|
|
187
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::
|
|
187
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::07ef29d58a2b23af8b098515466d7e22>>
|
|
188
188
|
*/
|
|
189
189
|
|
|
190
190
|
var paddingMap = {
|
|
@@ -384,11 +384,11 @@ var heightMap = {
|
|
|
384
384
|
|
|
385
385
|
/**
|
|
386
386
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
387
|
-
* @codegen <<SignedSource::
|
|
387
|
+
* @codegen <<SignedSource::781636715c2bee941d6836a5a90fed5b>>
|
|
388
388
|
* @codegenId colors
|
|
389
389
|
* @codegenCommand yarn codegen-styles
|
|
390
390
|
* @codegenParams ["border", "background"]
|
|
391
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::
|
|
391
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::07ef29d58a2b23af8b098515466d7e22>>
|
|
392
392
|
*/
|
|
393
393
|
var borderColorMap = {
|
|
394
394
|
'color.border': (0, _react2.css)({
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -11,8 +9,6 @@ var _react = require("react");
|
|
|
11
9
|
|
|
12
10
|
var _react2 = require("@emotion/react");
|
|
13
11
|
|
|
14
|
-
var _text = _interopRequireDefault(require("./text.partial"));
|
|
15
|
-
|
|
16
12
|
/** @jsx jsx */
|
|
17
13
|
var flexAlignItemsMap = {
|
|
18
14
|
center: (0, _react2.css)({
|
|
@@ -61,42 +57,69 @@ var baseStyles = (0, _react2.css)({
|
|
|
61
57
|
boxSizing: 'border-box',
|
|
62
58
|
flexDirection: 'row'
|
|
63
59
|
});
|
|
60
|
+
var dividerStyles = (0, _react2.css)({
|
|
61
|
+
margin: '0 -2px',
|
|
62
|
+
color: "var(--ds-text-subtle, #42526E)",
|
|
63
|
+
pointerEvents: 'none'
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
var Divider = function Divider(_ref) {
|
|
67
|
+
var children = _ref.children;
|
|
68
|
+
return (0, _react2.jsx)("span", {
|
|
69
|
+
css: dividerStyles
|
|
70
|
+
}, children);
|
|
71
|
+
};
|
|
64
72
|
/**
|
|
65
73
|
* __Inline__
|
|
66
74
|
*
|
|
67
75
|
* Inline is a primitive component based on flexbox that manages the horizontal layout of direct children.
|
|
68
76
|
* Renders a `div` by default.
|
|
69
77
|
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```tsx
|
|
80
|
+
* const App = () => (
|
|
81
|
+
* <Inline gap="space.100">
|
|
82
|
+
* <Button />
|
|
83
|
+
* <Button />
|
|
84
|
+
* </Inline>
|
|
85
|
+
* )
|
|
86
|
+
* ```
|
|
70
87
|
*/
|
|
71
88
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
89
|
+
|
|
90
|
+
var Inline = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
91
|
+
var gap = _ref2.gap,
|
|
92
|
+
alignItems = _ref2.alignItems,
|
|
93
|
+
justifyContent = _ref2.justifyContent,
|
|
94
|
+
flexWrap = _ref2.flexWrap,
|
|
95
|
+
divider = _ref2.divider,
|
|
96
|
+
UNSAFE_style = _ref2.UNSAFE_style,
|
|
97
|
+
children = _ref2.children,
|
|
98
|
+
testId = _ref2.testId;
|
|
99
|
+
var dividerComponent = typeof divider === 'string' ? (0, _react2.jsx)(Divider, null, divider) : divider;
|
|
100
|
+
|
|
101
|
+
var childrenArray = _react.Children.toArray(children).filter(Boolean);
|
|
102
|
+
|
|
82
103
|
return (0, _react2.jsx)("div", {
|
|
83
104
|
style: UNSAFE_style,
|
|
84
105
|
css: [baseStyles, gap && columnGapMap[gap], alignItems && flexAlignItemsMap[alignItems], justifyContent && flexJustifyContentMap[justifyContent], flexWrap && flexWrapMap[flexWrap]],
|
|
85
106
|
"data-testid": testId,
|
|
86
107
|
ref: ref
|
|
87
|
-
},
|
|
88
|
-
return (0, _react2.jsx)(_react.Fragment,
|
|
108
|
+
}, childrenArray.map(function (child, index) {
|
|
109
|
+
return (0, _react2.jsx)(_react.Fragment, {
|
|
110
|
+
key: index
|
|
111
|
+
}, divider && index > 0 ? dividerComponent : null, child);
|
|
89
112
|
}));
|
|
90
|
-
});
|
|
113
|
+
}));
|
|
91
114
|
Inline.displayName = 'Inline';
|
|
92
115
|
var _default = Inline;
|
|
93
116
|
/**
|
|
94
117
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
95
|
-
* @codegen <<SignedSource::
|
|
118
|
+
* @codegen <<SignedSource::2dd7c6b8450b1bbd1fb8fabf12fffa33>>
|
|
96
119
|
* @codegenId spacing
|
|
97
120
|
* @codegenCommand yarn codegen-styles
|
|
98
121
|
* @codegenParams ["columnGap"]
|
|
99
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::
|
|
122
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::07ef29d58a2b23af8b098515466d7e22>>
|
|
100
123
|
*/
|
|
101
124
|
|
|
102
125
|
exports.default = _default;
|
|
@@ -58,11 +58,11 @@ var InteractionSurface = function InteractionSurface(_ref) {
|
|
|
58
58
|
var _default = InteractionSurface;
|
|
59
59
|
/**
|
|
60
60
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
61
|
-
* @codegen <<SignedSource::
|
|
61
|
+
* @codegen <<SignedSource::5289ea44928c279ad02274850623c9d1>>
|
|
62
62
|
* @codegenId interactions
|
|
63
63
|
* @codegenCommand yarn codegen-styles
|
|
64
64
|
* @codegenParams ["background"]
|
|
65
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::
|
|
65
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::07ef29d58a2b23af8b098515466d7e22>>
|
|
66
66
|
*/
|
|
67
67
|
|
|
68
68
|
exports.default = _default;
|
|
@@ -65,7 +65,7 @@ var baseStyles = (0, _react2.css)({
|
|
|
65
65
|
*
|
|
66
66
|
*/
|
|
67
67
|
|
|
68
|
-
var Stack = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
68
|
+
var Stack = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
69
69
|
var gap = _ref.gap,
|
|
70
70
|
alignItems = _ref.alignItems,
|
|
71
71
|
justifyContent = _ref.justifyContent,
|
|
@@ -79,16 +79,16 @@ var Stack = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
79
79
|
"data-testid": testId,
|
|
80
80
|
ref: ref
|
|
81
81
|
}, children);
|
|
82
|
-
});
|
|
82
|
+
}));
|
|
83
83
|
Stack.displayName = 'Stack';
|
|
84
84
|
var _default = Stack;
|
|
85
85
|
/**
|
|
86
86
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
87
|
-
* @codegen <<SignedSource::
|
|
87
|
+
* @codegen <<SignedSource::5d82d50cdeb38664c4c45d02608e447d>>
|
|
88
88
|
* @codegenId spacing
|
|
89
89
|
* @codegenCommand yarn codegen-styles
|
|
90
90
|
* @codegenParams ["rowGap"]
|
|
91
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::
|
|
91
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::07ef29d58a2b23af8b098515466d7e22>>
|
|
92
92
|
*/
|
|
93
93
|
|
|
94
94
|
exports.default = _default;
|
|
@@ -162,7 +162,8 @@ var Text = function Text(_ref) {
|
|
|
162
162
|
textTransform = props.textTransform,
|
|
163
163
|
verticalAlign = props.verticalAlign,
|
|
164
164
|
testId = props.testId,
|
|
165
|
-
UNSAFE_style = props.UNSAFE_style
|
|
165
|
+
UNSAFE_style = props.UNSAFE_style,
|
|
166
|
+
id = props.id;
|
|
166
167
|
(0, _tinyInvariant.default)(asAllowlist.includes(Component), "@atlaskit/ds-explorations: Text received an invalid \"as\" value of \"".concat(Component, "\""));
|
|
167
168
|
var color = useColor(colorProp);
|
|
168
169
|
var isWrapped = useHasTextAncestor();
|
|
@@ -178,7 +179,8 @@ var Text = function Text(_ref) {
|
|
|
178
179
|
var component = (0, _react2.jsx)(Component, {
|
|
179
180
|
style: UNSAFE_style,
|
|
180
181
|
css: [baseStyles, color && textColorMap[color], fontSize && fontSizeMap[fontSize], fontWeight && fontWeightMap[fontWeight], lineHeight && lineHeightMap[lineHeight], shouldTruncate && truncateStyles, textAlign && textAlignMap[textAlign], textTransform && textTransformMap[textTransform], verticalAlign && verticalAlignMap[verticalAlign]],
|
|
181
|
-
"data-testid": testId
|
|
182
|
+
"data-testid": testId,
|
|
183
|
+
id: id
|
|
182
184
|
}, children);
|
|
183
185
|
return isWrapped ? // no need to re-apply context if the text is already wrapped
|
|
184
186
|
component : (0, _react2.jsx)(HasTextAncestorContext.Provider, {
|
|
@@ -189,11 +191,11 @@ var Text = function Text(_ref) {
|
|
|
189
191
|
var _default = Text;
|
|
190
192
|
/**
|
|
191
193
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
192
|
-
* @codegen <<SignedSource::
|
|
194
|
+
* @codegen <<SignedSource::3d4d694e49f72e72f83ec28c1feafb76>>
|
|
193
195
|
* @codegenId colors
|
|
194
196
|
* @codegenCommand yarn codegen-styles
|
|
195
197
|
* @codegenParams ["text"]
|
|
196
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::
|
|
198
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::07ef29d58a2b23af8b098515466d7e22>>
|
|
197
199
|
*/
|
|
198
200
|
|
|
199
201
|
exports.default = _default;
|
|
@@ -10,9 +10,9 @@ exports.default = void 0;
|
|
|
10
10
|
*
|
|
11
11
|
* The color map is used to map a background color token to a matching text color that will meet contrast.
|
|
12
12
|
*
|
|
13
|
-
* @codegen <<SignedSource::
|
|
13
|
+
* @codegen <<SignedSource::b80b2a3d75c3215df8be35a6f5bda68d>>
|
|
14
14
|
* @codegenCommand yarn codegen-styles
|
|
15
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::
|
|
15
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::07ef29d58a2b23af8b098515466d7e22>>
|
|
16
16
|
*/
|
|
17
17
|
var _default = {
|
|
18
18
|
'neutral.bold': 'inverse',
|
package/dist/cjs/version.json
CHANGED
|
@@ -163,11 +163,11 @@ const baseStyles = css({
|
|
|
163
163
|
});
|
|
164
164
|
/**
|
|
165
165
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
166
|
-
* @codegen <<SignedSource::
|
|
166
|
+
* @codegen <<SignedSource::2d25a493458fa1cefdafcd559404f2ec>>
|
|
167
167
|
* @codegenId spacing
|
|
168
168
|
* @codegenCommand yarn codegen-styles
|
|
169
169
|
* @codegenParams ["padding", "paddingBlock", "paddingInline", "width", "height"]
|
|
170
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::
|
|
170
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::07ef29d58a2b23af8b098515466d7e22>>
|
|
171
171
|
*/
|
|
172
172
|
|
|
173
173
|
const paddingMap = {
|
|
@@ -367,11 +367,11 @@ const heightMap = {
|
|
|
367
367
|
|
|
368
368
|
/**
|
|
369
369
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
370
|
-
* @codegen <<SignedSource::
|
|
370
|
+
* @codegen <<SignedSource::781636715c2bee941d6836a5a90fed5b>>
|
|
371
371
|
* @codegenId colors
|
|
372
372
|
* @codegenCommand yarn codegen-styles
|
|
373
373
|
* @codegenParams ["border", "background"]
|
|
374
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::
|
|
374
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::07ef29d58a2b23af8b098515466d7e22>>
|
|
375
375
|
*/
|
|
376
376
|
const borderColorMap = {
|
|
377
377
|
'color.border': css({
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { Children, forwardRef, Fragment } from 'react';
|
|
2
|
+
import { Children, forwardRef, Fragment, memo } from 'react';
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
|
-
import Text from './text.partial';
|
|
5
4
|
const flexAlignItemsMap = {
|
|
6
5
|
center: css({
|
|
7
6
|
alignItems: 'center'
|
|
@@ -49,15 +48,36 @@ const baseStyles = css({
|
|
|
49
48
|
boxSizing: 'border-box',
|
|
50
49
|
flexDirection: 'row'
|
|
51
50
|
});
|
|
51
|
+
const dividerStyles = css({
|
|
52
|
+
margin: '0 -2px',
|
|
53
|
+
color: "var(--ds-text-subtle, #42526E)",
|
|
54
|
+
pointerEvents: 'none'
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const Divider = ({
|
|
58
|
+
children
|
|
59
|
+
}) => jsx("span", {
|
|
60
|
+
css: dividerStyles
|
|
61
|
+
}, children);
|
|
52
62
|
/**
|
|
53
63
|
* __Inline__
|
|
54
64
|
*
|
|
55
65
|
* Inline is a primitive component based on flexbox that manages the horizontal layout of direct children.
|
|
56
66
|
* Renders a `div` by default.
|
|
57
67
|
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```tsx
|
|
70
|
+
* const App = () => (
|
|
71
|
+
* <Inline gap="space.100">
|
|
72
|
+
* <Button />
|
|
73
|
+
* <Button />
|
|
74
|
+
* </Inline>
|
|
75
|
+
* )
|
|
76
|
+
* ```
|
|
58
77
|
*/
|
|
59
78
|
|
|
60
|
-
|
|
79
|
+
|
|
80
|
+
const Inline = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
61
81
|
gap,
|
|
62
82
|
alignItems,
|
|
63
83
|
justifyContent,
|
|
@@ -67,25 +87,28 @@ const Inline = /*#__PURE__*/forwardRef(({
|
|
|
67
87
|
children,
|
|
68
88
|
testId
|
|
69
89
|
}, ref) => {
|
|
70
|
-
const dividerComponent = typeof divider === 'string' ? jsx(
|
|
90
|
+
const dividerComponent = typeof divider === 'string' ? jsx(Divider, null, divider) : divider;
|
|
91
|
+
const childrenArray = Children.toArray(children).filter(Boolean);
|
|
71
92
|
return jsx("div", {
|
|
72
93
|
style: UNSAFE_style,
|
|
73
94
|
css: [baseStyles, gap && columnGapMap[gap], alignItems && flexAlignItemsMap[alignItems], justifyContent && flexJustifyContentMap[justifyContent], flexWrap && flexWrapMap[flexWrap]],
|
|
74
95
|
"data-testid": testId,
|
|
75
96
|
ref: ref
|
|
76
|
-
},
|
|
77
|
-
return jsx(Fragment,
|
|
97
|
+
}, childrenArray.map((child, index) => {
|
|
98
|
+
return jsx(Fragment, {
|
|
99
|
+
key: index
|
|
100
|
+
}, divider && index > 0 ? dividerComponent : null, child);
|
|
78
101
|
}));
|
|
79
|
-
});
|
|
102
|
+
}));
|
|
80
103
|
Inline.displayName = 'Inline';
|
|
81
104
|
export default Inline;
|
|
82
105
|
/**
|
|
83
106
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
84
|
-
* @codegen <<SignedSource::
|
|
107
|
+
* @codegen <<SignedSource::2dd7c6b8450b1bbd1fb8fabf12fffa33>>
|
|
85
108
|
* @codegenId spacing
|
|
86
109
|
* @codegenCommand yarn codegen-styles
|
|
87
110
|
* @codegenParams ["columnGap"]
|
|
88
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::
|
|
111
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::07ef29d58a2b23af8b098515466d7e22>>
|
|
89
112
|
*/
|
|
90
113
|
|
|
91
114
|
const columnGapMap = {
|
|
@@ -49,11 +49,11 @@ const InteractionSurface = ({
|
|
|
49
49
|
export default InteractionSurface;
|
|
50
50
|
/**
|
|
51
51
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
52
|
-
* @codegen <<SignedSource::
|
|
52
|
+
* @codegen <<SignedSource::5289ea44928c279ad02274850623c9d1>>
|
|
53
53
|
* @codegenId interactions
|
|
54
54
|
* @codegenCommand yarn codegen-styles
|
|
55
55
|
* @codegenParams ["background"]
|
|
56
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::
|
|
56
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::07ef29d58a2b23af8b098515466d7e22>>
|
|
57
57
|
*/
|
|
58
58
|
|
|
59
59
|
const backgroundActiveColorMap = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { forwardRef } from 'react';
|
|
2
|
+
import { forwardRef, memo } from 'react';
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
4
|
const flexAlignItemsMap = {
|
|
5
5
|
center: css({
|
|
@@ -56,7 +56,7 @@ const baseStyles = css({
|
|
|
56
56
|
*
|
|
57
57
|
*/
|
|
58
58
|
|
|
59
|
-
const Stack = /*#__PURE__*/forwardRef(({
|
|
59
|
+
const Stack = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
60
60
|
gap,
|
|
61
61
|
alignItems,
|
|
62
62
|
justifyContent,
|
|
@@ -71,16 +71,16 @@ const Stack = /*#__PURE__*/forwardRef(({
|
|
|
71
71
|
"data-testid": testId,
|
|
72
72
|
ref: ref
|
|
73
73
|
}, children);
|
|
74
|
-
});
|
|
74
|
+
}));
|
|
75
75
|
Stack.displayName = 'Stack';
|
|
76
76
|
export default Stack;
|
|
77
77
|
/**
|
|
78
78
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
79
|
-
* @codegen <<SignedSource::
|
|
79
|
+
* @codegen <<SignedSource::5d82d50cdeb38664c4c45d02608e447d>>
|
|
80
80
|
* @codegenId spacing
|
|
81
81
|
* @codegenCommand yarn codegen-styles
|
|
82
82
|
* @codegenParams ["rowGap"]
|
|
83
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::
|
|
83
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::07ef29d58a2b23af8b098515466d7e22>>
|
|
84
84
|
*/
|
|
85
85
|
|
|
86
86
|
const rowGapMap = {
|
|
@@ -144,7 +144,8 @@ const Text = ({
|
|
|
144
144
|
textTransform,
|
|
145
145
|
verticalAlign,
|
|
146
146
|
testId,
|
|
147
|
-
UNSAFE_style
|
|
147
|
+
UNSAFE_style,
|
|
148
|
+
id
|
|
148
149
|
} = props;
|
|
149
150
|
invariant(asAllowlist.includes(Component), `@atlaskit/ds-explorations: Text received an invalid "as" value of "${Component}"`);
|
|
150
151
|
const color = useColor(colorProp);
|
|
@@ -161,7 +162,8 @@ const Text = ({
|
|
|
161
162
|
const component = jsx(Component, {
|
|
162
163
|
style: UNSAFE_style,
|
|
163
164
|
css: [baseStyles, color && textColorMap[color], fontSize && fontSizeMap[fontSize], fontWeight && fontWeightMap[fontWeight], lineHeight && lineHeightMap[lineHeight], shouldTruncate && truncateStyles, textAlign && textAlignMap[textAlign], textTransform && textTransformMap[textTransform], verticalAlign && verticalAlignMap[verticalAlign]],
|
|
164
|
-
"data-testid": testId
|
|
165
|
+
"data-testid": testId,
|
|
166
|
+
id: id
|
|
165
167
|
}, children);
|
|
166
168
|
return isWrapped ? // no need to re-apply context if the text is already wrapped
|
|
167
169
|
component : jsx(HasTextAncestorContext.Provider, {
|
|
@@ -172,11 +174,11 @@ const Text = ({
|
|
|
172
174
|
export default Text;
|
|
173
175
|
/**
|
|
174
176
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
175
|
-
* @codegen <<SignedSource::
|
|
177
|
+
* @codegen <<SignedSource::3d4d694e49f72e72f83ec28c1feafb76>>
|
|
176
178
|
* @codegenId colors
|
|
177
179
|
* @codegenCommand yarn codegen-styles
|
|
178
180
|
* @codegenParams ["text"]
|
|
179
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::
|
|
181
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::07ef29d58a2b23af8b098515466d7e22>>
|
|
180
182
|
*/
|
|
181
183
|
|
|
182
184
|
const textColorMap = {
|
|
@@ -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::b80b2a3d75c3215df8be35a6f5bda68d>>
|
|
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::07ef29d58a2b23af8b098515466d7e22>>
|
|
9
9
|
*/
|
|
10
10
|
export default {
|
|
11
11
|
'neutral.bold': 'inverse',
|
package/dist/es2019/version.json
CHANGED
|
@@ -167,11 +167,11 @@ var baseStyles = css({
|
|
|
167
167
|
});
|
|
168
168
|
/**
|
|
169
169
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
170
|
-
* @codegen <<SignedSource::
|
|
170
|
+
* @codegen <<SignedSource::2d25a493458fa1cefdafcd559404f2ec>>
|
|
171
171
|
* @codegenId spacing
|
|
172
172
|
* @codegenCommand yarn codegen-styles
|
|
173
173
|
* @codegenParams ["padding", "paddingBlock", "paddingInline", "width", "height"]
|
|
174
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::
|
|
174
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::07ef29d58a2b23af8b098515466d7e22>>
|
|
175
175
|
*/
|
|
176
176
|
|
|
177
177
|
var paddingMap = {
|
|
@@ -371,11 +371,11 @@ var heightMap = {
|
|
|
371
371
|
|
|
372
372
|
/**
|
|
373
373
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
374
|
-
* @codegen <<SignedSource::
|
|
374
|
+
* @codegen <<SignedSource::781636715c2bee941d6836a5a90fed5b>>
|
|
375
375
|
* @codegenId colors
|
|
376
376
|
* @codegenCommand yarn codegen-styles
|
|
377
377
|
* @codegenParams ["border", "background"]
|
|
378
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::
|
|
378
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::07ef29d58a2b23af8b098515466d7e22>>
|
|
379
379
|
*/
|
|
380
380
|
var borderColorMap = {
|
|
381
381
|
'color.border': css({
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { Children, forwardRef, Fragment } from 'react';
|
|
2
|
+
import { Children, forwardRef, Fragment, memo } from 'react';
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
|
-
import Text from './text.partial';
|
|
5
4
|
var flexAlignItemsMap = {
|
|
6
5
|
center: css({
|
|
7
6
|
alignItems: 'center'
|
|
@@ -49,42 +48,67 @@ var baseStyles = css({
|
|
|
49
48
|
boxSizing: 'border-box',
|
|
50
49
|
flexDirection: 'row'
|
|
51
50
|
});
|
|
51
|
+
var dividerStyles = css({
|
|
52
|
+
margin: '0 -2px',
|
|
53
|
+
color: "var(--ds-text-subtle, #42526E)",
|
|
54
|
+
pointerEvents: 'none'
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
var Divider = function Divider(_ref) {
|
|
58
|
+
var children = _ref.children;
|
|
59
|
+
return jsx("span", {
|
|
60
|
+
css: dividerStyles
|
|
61
|
+
}, children);
|
|
62
|
+
};
|
|
52
63
|
/**
|
|
53
64
|
* __Inline__
|
|
54
65
|
*
|
|
55
66
|
* Inline is a primitive component based on flexbox that manages the horizontal layout of direct children.
|
|
56
67
|
* Renders a `div` by default.
|
|
57
68
|
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```tsx
|
|
71
|
+
* const App = () => (
|
|
72
|
+
* <Inline gap="space.100">
|
|
73
|
+
* <Button />
|
|
74
|
+
* <Button />
|
|
75
|
+
* </Inline>
|
|
76
|
+
* )
|
|
77
|
+
* ```
|
|
58
78
|
*/
|
|
59
79
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
80
|
+
|
|
81
|
+
var Inline = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
82
|
+
var gap = _ref2.gap,
|
|
83
|
+
alignItems = _ref2.alignItems,
|
|
84
|
+
justifyContent = _ref2.justifyContent,
|
|
85
|
+
flexWrap = _ref2.flexWrap,
|
|
86
|
+
divider = _ref2.divider,
|
|
87
|
+
UNSAFE_style = _ref2.UNSAFE_style,
|
|
88
|
+
children = _ref2.children,
|
|
89
|
+
testId = _ref2.testId;
|
|
90
|
+
var dividerComponent = typeof divider === 'string' ? jsx(Divider, null, divider) : divider;
|
|
91
|
+
var childrenArray = Children.toArray(children).filter(Boolean);
|
|
70
92
|
return jsx("div", {
|
|
71
93
|
style: UNSAFE_style,
|
|
72
94
|
css: [baseStyles, gap && columnGapMap[gap], alignItems && flexAlignItemsMap[alignItems], justifyContent && flexJustifyContentMap[justifyContent], flexWrap && flexWrapMap[flexWrap]],
|
|
73
95
|
"data-testid": testId,
|
|
74
96
|
ref: ref
|
|
75
|
-
},
|
|
76
|
-
return jsx(Fragment,
|
|
97
|
+
}, childrenArray.map(function (child, index) {
|
|
98
|
+
return jsx(Fragment, {
|
|
99
|
+
key: index
|
|
100
|
+
}, divider && index > 0 ? dividerComponent : null, child);
|
|
77
101
|
}));
|
|
78
|
-
});
|
|
102
|
+
}));
|
|
79
103
|
Inline.displayName = 'Inline';
|
|
80
104
|
export default Inline;
|
|
81
105
|
/**
|
|
82
106
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
83
|
-
* @codegen <<SignedSource::
|
|
107
|
+
* @codegen <<SignedSource::2dd7c6b8450b1bbd1fb8fabf12fffa33>>
|
|
84
108
|
* @codegenId spacing
|
|
85
109
|
* @codegenCommand yarn codegen-styles
|
|
86
110
|
* @codegenParams ["columnGap"]
|
|
87
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::
|
|
111
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::07ef29d58a2b23af8b098515466d7e22>>
|
|
88
112
|
*/
|
|
89
113
|
|
|
90
114
|
var columnGapMap = {
|
|
@@ -48,11 +48,11 @@ var InteractionSurface = function InteractionSurface(_ref) {
|
|
|
48
48
|
export default InteractionSurface;
|
|
49
49
|
/**
|
|
50
50
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
51
|
-
* @codegen <<SignedSource::
|
|
51
|
+
* @codegen <<SignedSource::5289ea44928c279ad02274850623c9d1>>
|
|
52
52
|
* @codegenId interactions
|
|
53
53
|
* @codegenCommand yarn codegen-styles
|
|
54
54
|
* @codegenParams ["background"]
|
|
55
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::
|
|
55
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::07ef29d58a2b23af8b098515466d7e22>>
|
|
56
56
|
*/
|
|
57
57
|
|
|
58
58
|
var backgroundActiveColorMap = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { forwardRef } from 'react';
|
|
2
|
+
import { forwardRef, memo } from 'react';
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
4
|
var flexAlignItemsMap = {
|
|
5
5
|
center: css({
|
|
@@ -56,7 +56,7 @@ var baseStyles = css({
|
|
|
56
56
|
*
|
|
57
57
|
*/
|
|
58
58
|
|
|
59
|
-
var Stack = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
59
|
+
var Stack = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
60
60
|
var gap = _ref.gap,
|
|
61
61
|
alignItems = _ref.alignItems,
|
|
62
62
|
justifyContent = _ref.justifyContent,
|
|
@@ -70,16 +70,16 @@ var Stack = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
70
70
|
"data-testid": testId,
|
|
71
71
|
ref: ref
|
|
72
72
|
}, children);
|
|
73
|
-
});
|
|
73
|
+
}));
|
|
74
74
|
Stack.displayName = 'Stack';
|
|
75
75
|
export default Stack;
|
|
76
76
|
/**
|
|
77
77
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
78
|
-
* @codegen <<SignedSource::
|
|
78
|
+
* @codegen <<SignedSource::5d82d50cdeb38664c4c45d02608e447d>>
|
|
79
79
|
* @codegenId spacing
|
|
80
80
|
* @codegenCommand yarn codegen-styles
|
|
81
81
|
* @codegenParams ["rowGap"]
|
|
82
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::
|
|
82
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::07ef29d58a2b23af8b098515466d7e22>>
|
|
83
83
|
*/
|
|
84
84
|
|
|
85
85
|
var rowGapMap = {
|