@atlaskit/ds-explorations 0.0.1 → 0.1.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 +28 -0
- package/LICENSE +13 -0
- package/dist/cjs/components/box.partial.js +495 -0
- package/dist/cjs/components/inline.partial.js +120 -0
- package/dist/cjs/components/stack.partial.js +112 -0
- package/dist/cjs/components/text.partial.js +169 -0
- package/dist/cjs/components/types.js +5 -0
- package/dist/cjs/constants.js +20 -0
- package/dist/cjs/index.js +34 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/box.partial.js +470 -0
- package/dist/es2019/components/inline.partial.js +107 -0
- package/dist/es2019/components/stack.partial.js +102 -0
- package/dist/es2019/components/text.partial.js +148 -0
- package/dist/es2019/components/types.js +1 -0
- package/dist/es2019/constants.js +13 -0
- package/dist/es2019/index.js +4 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/box.partial.js +479 -0
- package/dist/esm/components/inline.partial.js +106 -0
- package/dist/esm/components/stack.partial.js +101 -0
- package/dist/esm/components/text.partial.js +158 -0
- package/dist/esm/components/types.js +1 -0
- package/dist/esm/constants.js +13 -0
- package/dist/esm/index.js +4 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/components/box.partial.d.ts +186 -0
- package/dist/types/components/inline.partial.d.ts +52 -0
- package/dist/types/components/stack.partial.d.ts +47 -0
- package/dist/types/components/text.partial.d.ts +101 -0
- package/dist/types/components/types.d.ts +13 -0
- package/dist/types/constants.d.ts +14 -0
- package/dist/types/index.d.ts +4 -2
- package/docs/01-basic.tsx +19 -0
- package/examples/00-basic.tsx +18 -1
- package/examples/01-box.tsx +131 -0
- package/examples/02-text.tsx +60 -0
- package/examples/03-stack.tsx +125 -0
- package/examples/04-inline.tsx +134 -0
- package/examples/05-badge.tsx +23 -0
- package/examples/06-section-message.tsx +84 -0
- package/examples/07-comment.tsx +55 -0
- package/examples/08-lozenge.tsx +29 -0
- package/package.json +20 -1
- package/report.api.md +463 -0
- package/scripts/__tests__/__snapshots__/codegen.test.tsx.snap +193 -0
- package/scripts/__tests__/codegen.test.tsx +20 -0
- package/scripts/codegen-styles.tsx +47 -0
- package/scripts/color-codegen-template.tsx +105 -0
- package/scripts/spacing-codegen-template.tsx +52 -0
- package/scripts/utils.tsx +22 -0
- package/src/components/__tests__/unit/box.test.tsx +20 -0
- package/src/components/__tests__/unit/inline.test.tsx +43 -0
- package/src/components/__tests__/unit/stack.test.tsx +31 -0
- package/src/components/__tests__/unit/text.test.tsx +17 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-basic-example-should-match-production-example-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-alignment-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-background-and-padding-block-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-background-and-padding-inline-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-background-and-padding-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-background-color-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-border-color-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-border-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/inline-snapshot-test-tsx-inline-alignment-example-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/inline-snapshot-test-tsx-inline-spacing-example-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/stack-snapshot-test-tsx-stack-alignment-example-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/stack-snapshot-test-tsx-stack-spacing-example-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/text-snapshot-test-tsx-text-example-with-font-sizes-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/text-snapshot-test-tsx-text-example-with-font-weights-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/text-snapshot-test-tsx-text-example-with-line-heights-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/text-snapshot-test-tsx-text-example-with-testing-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/box-snapshot-test.tsx +33 -0
- package/src/components/__tests__/visual-regression/inline-snapshot-test.tsx +28 -0
- package/src/components/__tests__/visual-regression/stack-snapshot-test.tsx +28 -0
- package/src/components/__tests__/visual-regression/text-snapshot-test.tsx +31 -0
- package/src/components/box.partial.tsx +456 -0
- package/src/components/inline.partial.tsx +117 -0
- package/src/components/stack.partial.tsx +101 -0
- package/src/components/text.partial.tsx +194 -0
- package/src/components/types.tsx +15 -0
- package/src/constants.tsx +15 -0
- package/src/index.tsx +4 -1
- package/tsconfig.json +3 -1
- package/dist/cjs/components/box.js +0 -27
- package/dist/cjs/components/inline.js +0 -29
- package/dist/cjs/components/stack.js +0 -29
- package/dist/cjs/components/text.js +0 -25
- package/dist/es2019/components/box.js +0 -18
- package/dist/es2019/components/inline.js +0 -18
- package/dist/es2019/components/stack.js +0 -18
- package/dist/es2019/components/text.js +0 -17
- package/dist/esm/components/box.js +0 -18
- package/dist/esm/components/inline.js +0 -17
- package/dist/esm/components/stack.js +0 -17
- package/dist/esm/components/text.js +0 -16
- package/dist/types/components/box.d.ts +0 -15
- package/dist/types/components/inline.d.ts +0 -14
- package/dist/types/components/stack.d.ts +0 -14
- package/dist/types/components/text.d.ts +0 -13
- package/src/components/box.tsx +0 -22
- package/src/components/inline.tsx +0 -23
- package/src/components/stack.tsx +0 -23
- package/src/components/text.tsx +0 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @atlaskit/ds-explorations
|
|
2
2
|
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`57b94585c64`](https://bitbucket.org/atlassian/atlassian-frontend/commits/57b94585c64) - Breaking change to the color props which now require a fallback. Generated colors now also include additional background color types.
|
|
8
|
+
- [`57c59a5c2d2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/57c59a5c2d2) - Initial implementation of UNSAFE_Box
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- [`72c111790cf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/72c111790cf) - [ux] Refine implementation of Text primitive
|
|
13
|
+
- [`c28d7c86875`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c28d7c86875) - Add base interface to primitives in ds-explorations.
|
|
14
|
+
- [`e11b4abd515`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e11b4abd515) - Adds initial implementation of Inline and Stack. Adds "block" option to Box `display` prop. Removes "baseline" option from Box `justifyContent` prop. Removes `gap` prop from Box.
|
|
15
|
+
- [`0dbb4833163`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0dbb4833163) - Exports primitives components. Adds basic line-height values to Text.
|
|
16
|
+
- [`ea36ea17c4e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ea36ea17c4e) - Text now supports text-align and it's used for Badge to retain existing visuals
|
|
17
|
+
|
|
18
|
+
## 0.0.3
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- [`40151c42d7d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/40151c42d7d) - Update background, text and icon disabled colors to use alpha base tokens
|
|
23
|
+
|
|
24
|
+
## 0.0.2
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- [`232b2b765b9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/232b2b765b9) - Internal changes to the way styles are created for the `Box` and `Text` components. Both components now use a wrapper over the `af/codegen`'s expected API to generate styles and types from the tokens package.
|
|
29
|
+
- [`29b8b26ee79`](https://bitbucket.org/atlassian/atlassian-frontend/commits/29b8b26ee79) - Updates Box, Text to include partial implementations to spike and experiment with different usages.
|
|
30
|
+
|
|
3
31
|
## 0.0.1
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/LICENSE
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright 2019 Atlassian Pty Ltd
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
|
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
+
|
|
16
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
17
|
+
|
|
18
|
+
var _react = require("react");
|
|
19
|
+
|
|
20
|
+
var _core = require("@emotion/core");
|
|
21
|
+
|
|
22
|
+
var _constants = require("../constants");
|
|
23
|
+
|
|
24
|
+
var _excluded = ["children", "as", "display", "flexDirection", "alignItems", "justifyContent", "backgroundColor", "borderColor", "borderStyle", "borderWidth", "borderRadius", "padding", "paddingBlock", "paddingInline", "height", "width", "UNSAFE_style", "testId", "className"];
|
|
25
|
+
|
|
26
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
27
|
+
|
|
28
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
29
|
+
|
|
30
|
+
var borderStyleMap = {
|
|
31
|
+
none: (0, _core.css)({
|
|
32
|
+
borderStyle: 'none'
|
|
33
|
+
}),
|
|
34
|
+
solid: (0, _core.css)({
|
|
35
|
+
borderStyle: 'solid'
|
|
36
|
+
}),
|
|
37
|
+
dashed: (0, _core.css)({
|
|
38
|
+
borderStyle: 'dashed'
|
|
39
|
+
}),
|
|
40
|
+
dotted: (0, _core.css)({
|
|
41
|
+
borderStyle: 'dotted'
|
|
42
|
+
})
|
|
43
|
+
};
|
|
44
|
+
var borderWidthMap = {
|
|
45
|
+
'0px': (0, _core.css)({
|
|
46
|
+
borderWidth: '0px'
|
|
47
|
+
}),
|
|
48
|
+
'1px': (0, _core.css)({
|
|
49
|
+
borderWidth: '1px'
|
|
50
|
+
}),
|
|
51
|
+
'2px': (0, _core.css)({
|
|
52
|
+
borderWidth: '2px'
|
|
53
|
+
}),
|
|
54
|
+
'3px': (0, _core.css)({
|
|
55
|
+
borderWidth: '3px'
|
|
56
|
+
})
|
|
57
|
+
};
|
|
58
|
+
var borderRadiusMap = {
|
|
59
|
+
normal: (0, _core.css)({
|
|
60
|
+
borderRadius: '3px'
|
|
61
|
+
}),
|
|
62
|
+
rounded: (0, _core.css)({
|
|
63
|
+
borderRadius: '50%'
|
|
64
|
+
}),
|
|
65
|
+
badge: (0, _core.css)({
|
|
66
|
+
borderRadius: '8px'
|
|
67
|
+
})
|
|
68
|
+
};
|
|
69
|
+
var flexDirectionMap = {
|
|
70
|
+
column: (0, _core.css)({
|
|
71
|
+
flexDirection: 'column'
|
|
72
|
+
}),
|
|
73
|
+
row: (0, _core.css)({
|
|
74
|
+
flexDirection: 'row'
|
|
75
|
+
})
|
|
76
|
+
};
|
|
77
|
+
var flexAlignItemsMap = {
|
|
78
|
+
center: (0, _core.css)({
|
|
79
|
+
alignItems: 'center'
|
|
80
|
+
}),
|
|
81
|
+
baseline: (0, _core.css)({
|
|
82
|
+
alignItems: 'baseline'
|
|
83
|
+
}),
|
|
84
|
+
flexStart: (0, _core.css)({
|
|
85
|
+
alignItems: 'flex-start'
|
|
86
|
+
}),
|
|
87
|
+
flexEnd: (0, _core.css)({
|
|
88
|
+
alignItems: 'flex-end'
|
|
89
|
+
})
|
|
90
|
+
};
|
|
91
|
+
var flexJustifyContentMap = {
|
|
92
|
+
center: (0, _core.css)({
|
|
93
|
+
justifyContent: 'center'
|
|
94
|
+
}),
|
|
95
|
+
flexStart: (0, _core.css)({
|
|
96
|
+
justifyContent: 'flex-start'
|
|
97
|
+
}),
|
|
98
|
+
flexEnd: (0, _core.css)({
|
|
99
|
+
justifyContent: 'flex-end'
|
|
100
|
+
})
|
|
101
|
+
};
|
|
102
|
+
var displayMap = {
|
|
103
|
+
block: (0, _core.css)({
|
|
104
|
+
display: 'block'
|
|
105
|
+
}),
|
|
106
|
+
inline: (0, _core.css)({
|
|
107
|
+
display: 'inline'
|
|
108
|
+
}),
|
|
109
|
+
flex: (0, _core.css)({
|
|
110
|
+
display: 'flex'
|
|
111
|
+
}),
|
|
112
|
+
inlineFlex: (0, _core.css)({
|
|
113
|
+
display: 'inline-flex'
|
|
114
|
+
})
|
|
115
|
+
};
|
|
116
|
+
var baseStyles = (0, _core.css)({
|
|
117
|
+
boxSizing: 'border-box'
|
|
118
|
+
});
|
|
119
|
+
/**
|
|
120
|
+
* __Box__
|
|
121
|
+
*
|
|
122
|
+
* Box is a primitive component that has the design decisions of the Atlassian Design System baked in.
|
|
123
|
+
* Renders a `div` by default.
|
|
124
|
+
*
|
|
125
|
+
* @internal
|
|
126
|
+
*/
|
|
127
|
+
|
|
128
|
+
var Box = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
129
|
+
var children = _ref.children,
|
|
130
|
+
_ref$as = _ref.as,
|
|
131
|
+
Component = _ref$as === void 0 ? 'div' : _ref$as,
|
|
132
|
+
_ref$display = _ref.display,
|
|
133
|
+
display = _ref$display === void 0 ? 'flex' : _ref$display,
|
|
134
|
+
flexDirection = _ref.flexDirection,
|
|
135
|
+
alignItems = _ref.alignItems,
|
|
136
|
+
justifyContent = _ref.justifyContent,
|
|
137
|
+
backgroundColorTuple = _ref.backgroundColor,
|
|
138
|
+
borderColorTuple = _ref.borderColor,
|
|
139
|
+
borderStyle = _ref.borderStyle,
|
|
140
|
+
borderWidth = _ref.borderWidth,
|
|
141
|
+
borderRadius = _ref.borderRadius,
|
|
142
|
+
padding = _ref.padding,
|
|
143
|
+
paddingBlock = _ref.paddingBlock,
|
|
144
|
+
paddingInline = _ref.paddingInline,
|
|
145
|
+
height = _ref.height,
|
|
146
|
+
width = _ref.width,
|
|
147
|
+
UNSAFE_style = _ref.UNSAFE_style,
|
|
148
|
+
testId = _ref.testId,
|
|
149
|
+
dontUseThisProperty = _ref.className,
|
|
150
|
+
htmlAttributes = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
151
|
+
|
|
152
|
+
var _ref2 = backgroundColorTuple || [],
|
|
153
|
+
_ref3 = (0, _slicedToArray2.default)(_ref2, 2),
|
|
154
|
+
backgroundColor = _ref3[0],
|
|
155
|
+
backgroundColorFallback = _ref3[1];
|
|
156
|
+
|
|
157
|
+
var _ref4 = borderColorTuple || [],
|
|
158
|
+
_ref5 = (0, _slicedToArray2.default)(_ref4, 2),
|
|
159
|
+
borderColor = _ref5[0],
|
|
160
|
+
borderColorFallback = _ref5[1];
|
|
161
|
+
|
|
162
|
+
return (0, _core.jsx)(Component, (0, _extends2.default)({
|
|
163
|
+
style: _objectSpread(_objectSpread(_objectSpread({}, UNSAFE_style), backgroundColorFallback && {
|
|
164
|
+
'--ds-bg-fb': backgroundColorFallback
|
|
165
|
+
}), borderColorFallback && {
|
|
166
|
+
'--ds-bo-fb': borderColorFallback
|
|
167
|
+
}),
|
|
168
|
+
ref: ref // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
169
|
+
|
|
170
|
+
}, htmlAttributes, {
|
|
171
|
+
css: [baseStyles, display && displayMap[display], padding && paddingMap[padding], 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], flexDirection && flexDirectionMap[flexDirection], width && widthMap[width], height && heightMap[height]],
|
|
172
|
+
"data-testid": testId
|
|
173
|
+
}), children);
|
|
174
|
+
});
|
|
175
|
+
var _default = Box;
|
|
176
|
+
/**
|
|
177
|
+
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
178
|
+
* @codegen <<SignedSource::c20a27ff33adec8c016044959564409d>>
|
|
179
|
+
* @codegenId spacing
|
|
180
|
+
* @codegenCommand yarn codegen-styles
|
|
181
|
+
* @codegenParams ["padding", "paddingBlock", "paddingInline", "width", "height"]
|
|
182
|
+
*/
|
|
183
|
+
|
|
184
|
+
exports.default = _default;
|
|
185
|
+
var paddingMap = {
|
|
186
|
+
'sp-0': (0, _core.css)({
|
|
187
|
+
padding: _constants.SPACING_SCALE['sp-0']
|
|
188
|
+
}),
|
|
189
|
+
'sp-25': (0, _core.css)({
|
|
190
|
+
padding: _constants.SPACING_SCALE['sp-25']
|
|
191
|
+
}),
|
|
192
|
+
'sp-50': (0, _core.css)({
|
|
193
|
+
padding: _constants.SPACING_SCALE['sp-50']
|
|
194
|
+
}),
|
|
195
|
+
'sp-75': (0, _core.css)({
|
|
196
|
+
padding: _constants.SPACING_SCALE['sp-75']
|
|
197
|
+
}),
|
|
198
|
+
'sp-100': (0, _core.css)({
|
|
199
|
+
padding: _constants.SPACING_SCALE['sp-100']
|
|
200
|
+
}),
|
|
201
|
+
'sp-200': (0, _core.css)({
|
|
202
|
+
padding: _constants.SPACING_SCALE['sp-200']
|
|
203
|
+
}),
|
|
204
|
+
'sp-300': (0, _core.css)({
|
|
205
|
+
padding: _constants.SPACING_SCALE['sp-300']
|
|
206
|
+
}),
|
|
207
|
+
'sp-400': (0, _core.css)({
|
|
208
|
+
padding: _constants.SPACING_SCALE['sp-400']
|
|
209
|
+
}),
|
|
210
|
+
'sp-500': (0, _core.css)({
|
|
211
|
+
padding: _constants.SPACING_SCALE['sp-500']
|
|
212
|
+
}),
|
|
213
|
+
'sp-600': (0, _core.css)({
|
|
214
|
+
padding: _constants.SPACING_SCALE['sp-600']
|
|
215
|
+
}),
|
|
216
|
+
'sp-800': (0, _core.css)({
|
|
217
|
+
padding: _constants.SPACING_SCALE['sp-800']
|
|
218
|
+
})
|
|
219
|
+
};
|
|
220
|
+
var paddingBlockMap = {
|
|
221
|
+
'sp-0': (0, _core.css)({
|
|
222
|
+
paddingBlock: _constants.SPACING_SCALE['sp-0']
|
|
223
|
+
}),
|
|
224
|
+
'sp-25': (0, _core.css)({
|
|
225
|
+
paddingBlock: _constants.SPACING_SCALE['sp-25']
|
|
226
|
+
}),
|
|
227
|
+
'sp-50': (0, _core.css)({
|
|
228
|
+
paddingBlock: _constants.SPACING_SCALE['sp-50']
|
|
229
|
+
}),
|
|
230
|
+
'sp-75': (0, _core.css)({
|
|
231
|
+
paddingBlock: _constants.SPACING_SCALE['sp-75']
|
|
232
|
+
}),
|
|
233
|
+
'sp-100': (0, _core.css)({
|
|
234
|
+
paddingBlock: _constants.SPACING_SCALE['sp-100']
|
|
235
|
+
}),
|
|
236
|
+
'sp-200': (0, _core.css)({
|
|
237
|
+
paddingBlock: _constants.SPACING_SCALE['sp-200']
|
|
238
|
+
}),
|
|
239
|
+
'sp-300': (0, _core.css)({
|
|
240
|
+
paddingBlock: _constants.SPACING_SCALE['sp-300']
|
|
241
|
+
}),
|
|
242
|
+
'sp-400': (0, _core.css)({
|
|
243
|
+
paddingBlock: _constants.SPACING_SCALE['sp-400']
|
|
244
|
+
}),
|
|
245
|
+
'sp-500': (0, _core.css)({
|
|
246
|
+
paddingBlock: _constants.SPACING_SCALE['sp-500']
|
|
247
|
+
}),
|
|
248
|
+
'sp-600': (0, _core.css)({
|
|
249
|
+
paddingBlock: _constants.SPACING_SCALE['sp-600']
|
|
250
|
+
}),
|
|
251
|
+
'sp-800': (0, _core.css)({
|
|
252
|
+
paddingBlock: _constants.SPACING_SCALE['sp-800']
|
|
253
|
+
})
|
|
254
|
+
};
|
|
255
|
+
var paddingInlineMap = {
|
|
256
|
+
'sp-0': (0, _core.css)({
|
|
257
|
+
paddingInline: _constants.SPACING_SCALE['sp-0']
|
|
258
|
+
}),
|
|
259
|
+
'sp-25': (0, _core.css)({
|
|
260
|
+
paddingInline: _constants.SPACING_SCALE['sp-25']
|
|
261
|
+
}),
|
|
262
|
+
'sp-50': (0, _core.css)({
|
|
263
|
+
paddingInline: _constants.SPACING_SCALE['sp-50']
|
|
264
|
+
}),
|
|
265
|
+
'sp-75': (0, _core.css)({
|
|
266
|
+
paddingInline: _constants.SPACING_SCALE['sp-75']
|
|
267
|
+
}),
|
|
268
|
+
'sp-100': (0, _core.css)({
|
|
269
|
+
paddingInline: _constants.SPACING_SCALE['sp-100']
|
|
270
|
+
}),
|
|
271
|
+
'sp-200': (0, _core.css)({
|
|
272
|
+
paddingInline: _constants.SPACING_SCALE['sp-200']
|
|
273
|
+
}),
|
|
274
|
+
'sp-300': (0, _core.css)({
|
|
275
|
+
paddingInline: _constants.SPACING_SCALE['sp-300']
|
|
276
|
+
}),
|
|
277
|
+
'sp-400': (0, _core.css)({
|
|
278
|
+
paddingInline: _constants.SPACING_SCALE['sp-400']
|
|
279
|
+
}),
|
|
280
|
+
'sp-500': (0, _core.css)({
|
|
281
|
+
paddingInline: _constants.SPACING_SCALE['sp-500']
|
|
282
|
+
}),
|
|
283
|
+
'sp-600': (0, _core.css)({
|
|
284
|
+
paddingInline: _constants.SPACING_SCALE['sp-600']
|
|
285
|
+
}),
|
|
286
|
+
'sp-800': (0, _core.css)({
|
|
287
|
+
paddingInline: _constants.SPACING_SCALE['sp-800']
|
|
288
|
+
})
|
|
289
|
+
};
|
|
290
|
+
var widthMap = {
|
|
291
|
+
'sp-0': (0, _core.css)({
|
|
292
|
+
width: _constants.SPACING_SCALE['sp-0']
|
|
293
|
+
}),
|
|
294
|
+
'sp-25': (0, _core.css)({
|
|
295
|
+
width: _constants.SPACING_SCALE['sp-25']
|
|
296
|
+
}),
|
|
297
|
+
'sp-50': (0, _core.css)({
|
|
298
|
+
width: _constants.SPACING_SCALE['sp-50']
|
|
299
|
+
}),
|
|
300
|
+
'sp-75': (0, _core.css)({
|
|
301
|
+
width: _constants.SPACING_SCALE['sp-75']
|
|
302
|
+
}),
|
|
303
|
+
'sp-100': (0, _core.css)({
|
|
304
|
+
width: _constants.SPACING_SCALE['sp-100']
|
|
305
|
+
}),
|
|
306
|
+
'sp-200': (0, _core.css)({
|
|
307
|
+
width: _constants.SPACING_SCALE['sp-200']
|
|
308
|
+
}),
|
|
309
|
+
'sp-300': (0, _core.css)({
|
|
310
|
+
width: _constants.SPACING_SCALE['sp-300']
|
|
311
|
+
}),
|
|
312
|
+
'sp-400': (0, _core.css)({
|
|
313
|
+
width: _constants.SPACING_SCALE['sp-400']
|
|
314
|
+
}),
|
|
315
|
+
'sp-500': (0, _core.css)({
|
|
316
|
+
width: _constants.SPACING_SCALE['sp-500']
|
|
317
|
+
}),
|
|
318
|
+
'sp-600': (0, _core.css)({
|
|
319
|
+
width: _constants.SPACING_SCALE['sp-600']
|
|
320
|
+
}),
|
|
321
|
+
'sp-800': (0, _core.css)({
|
|
322
|
+
width: _constants.SPACING_SCALE['sp-800']
|
|
323
|
+
})
|
|
324
|
+
};
|
|
325
|
+
var heightMap = {
|
|
326
|
+
'sp-0': (0, _core.css)({
|
|
327
|
+
height: _constants.SPACING_SCALE['sp-0']
|
|
328
|
+
}),
|
|
329
|
+
'sp-25': (0, _core.css)({
|
|
330
|
+
height: _constants.SPACING_SCALE['sp-25']
|
|
331
|
+
}),
|
|
332
|
+
'sp-50': (0, _core.css)({
|
|
333
|
+
height: _constants.SPACING_SCALE['sp-50']
|
|
334
|
+
}),
|
|
335
|
+
'sp-75': (0, _core.css)({
|
|
336
|
+
height: _constants.SPACING_SCALE['sp-75']
|
|
337
|
+
}),
|
|
338
|
+
'sp-100': (0, _core.css)({
|
|
339
|
+
height: _constants.SPACING_SCALE['sp-100']
|
|
340
|
+
}),
|
|
341
|
+
'sp-200': (0, _core.css)({
|
|
342
|
+
height: _constants.SPACING_SCALE['sp-200']
|
|
343
|
+
}),
|
|
344
|
+
'sp-300': (0, _core.css)({
|
|
345
|
+
height: _constants.SPACING_SCALE['sp-300']
|
|
346
|
+
}),
|
|
347
|
+
'sp-400': (0, _core.css)({
|
|
348
|
+
height: _constants.SPACING_SCALE['sp-400']
|
|
349
|
+
}),
|
|
350
|
+
'sp-500': (0, _core.css)({
|
|
351
|
+
height: _constants.SPACING_SCALE['sp-500']
|
|
352
|
+
}),
|
|
353
|
+
'sp-600': (0, _core.css)({
|
|
354
|
+
height: _constants.SPACING_SCALE['sp-600']
|
|
355
|
+
}),
|
|
356
|
+
'sp-800': (0, _core.css)({
|
|
357
|
+
height: _constants.SPACING_SCALE['sp-800']
|
|
358
|
+
})
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* @codegenEnd
|
|
362
|
+
*/
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
366
|
+
* @codegen <<SignedSource::e3f27406477352f51168b4108558f051>>
|
|
367
|
+
* @codegenId colors
|
|
368
|
+
* @codegenCommand yarn codegen-styles
|
|
369
|
+
* @codegenParams ["border", "background"]
|
|
370
|
+
*/
|
|
371
|
+
|
|
372
|
+
var borderColorMap = {
|
|
373
|
+
'color.border': (0, _core.css)({
|
|
374
|
+
borderColor: "var(--ds-border, var(--ds-bo-fb))"
|
|
375
|
+
}),
|
|
376
|
+
bold: (0, _core.css)({
|
|
377
|
+
borderColor: "var(--ds-border-bold, var(--ds-bo-fb))"
|
|
378
|
+
}),
|
|
379
|
+
inverse: (0, _core.css)({
|
|
380
|
+
borderColor: "var(--ds-border-inverse, var(--ds-bo-fb))"
|
|
381
|
+
}),
|
|
382
|
+
focused: (0, _core.css)({
|
|
383
|
+
borderColor: "var(--ds-border-focused, var(--ds-bo-fb))"
|
|
384
|
+
}),
|
|
385
|
+
input: (0, _core.css)({
|
|
386
|
+
borderColor: "var(--ds-border-input, var(--ds-bo-fb))"
|
|
387
|
+
}),
|
|
388
|
+
disabled: (0, _core.css)({
|
|
389
|
+
borderColor: "var(--ds-border-disabled, var(--ds-bo-fb))"
|
|
390
|
+
}),
|
|
391
|
+
brand: (0, _core.css)({
|
|
392
|
+
borderColor: "var(--ds-border-brand, var(--ds-bo-fb))"
|
|
393
|
+
}),
|
|
394
|
+
selected: (0, _core.css)({
|
|
395
|
+
borderColor: "var(--ds-border-selected, var(--ds-bo-fb))"
|
|
396
|
+
}),
|
|
397
|
+
danger: (0, _core.css)({
|
|
398
|
+
borderColor: "var(--ds-border-danger, var(--ds-bo-fb))"
|
|
399
|
+
}),
|
|
400
|
+
warning: (0, _core.css)({
|
|
401
|
+
borderColor: "var(--ds-border-warning, var(--ds-bo-fb))"
|
|
402
|
+
}),
|
|
403
|
+
success: (0, _core.css)({
|
|
404
|
+
borderColor: "var(--ds-border-success, var(--ds-bo-fb))"
|
|
405
|
+
}),
|
|
406
|
+
discovery: (0, _core.css)({
|
|
407
|
+
borderColor: "var(--ds-border-discovery, var(--ds-bo-fb))"
|
|
408
|
+
}),
|
|
409
|
+
information: (0, _core.css)({
|
|
410
|
+
borderColor: "var(--ds-border-information, var(--ds-bo-fb))"
|
|
411
|
+
})
|
|
412
|
+
};
|
|
413
|
+
var backgroundColorMap = {
|
|
414
|
+
disabled: (0, _core.css)({
|
|
415
|
+
backgroundColor: "var(--ds-background-disabled, var(--ds-bg-fb))"
|
|
416
|
+
}),
|
|
417
|
+
'inverse.subtle': (0, _core.css)({
|
|
418
|
+
backgroundColor: "var(--ds-background-inverse-subtle, var(--ds-bg-fb))"
|
|
419
|
+
}),
|
|
420
|
+
input: (0, _core.css)({
|
|
421
|
+
backgroundColor: "var(--ds-background-input, var(--ds-bg-fb))"
|
|
422
|
+
}),
|
|
423
|
+
neutral: (0, _core.css)({
|
|
424
|
+
backgroundColor: "var(--ds-background-neutral, var(--ds-bg-fb))"
|
|
425
|
+
}),
|
|
426
|
+
'neutral.subtle': (0, _core.css)({
|
|
427
|
+
backgroundColor: "var(--ds-background-neutral-subtle, var(--ds-bg-fb))"
|
|
428
|
+
}),
|
|
429
|
+
'neutral.bold': (0, _core.css)({
|
|
430
|
+
backgroundColor: "var(--ds-background-neutral-bold, var(--ds-bg-fb))"
|
|
431
|
+
}),
|
|
432
|
+
'brand.bold': (0, _core.css)({
|
|
433
|
+
backgroundColor: "var(--ds-background-brand-bold, var(--ds-bg-fb))"
|
|
434
|
+
}),
|
|
435
|
+
selected: (0, _core.css)({
|
|
436
|
+
backgroundColor: "var(--ds-background-selected, var(--ds-bg-fb))"
|
|
437
|
+
}),
|
|
438
|
+
'selected.bold': (0, _core.css)({
|
|
439
|
+
backgroundColor: "var(--ds-background-selected-bold, var(--ds-bg-fb))"
|
|
440
|
+
}),
|
|
441
|
+
danger: (0, _core.css)({
|
|
442
|
+
backgroundColor: "var(--ds-background-danger, var(--ds-bg-fb))"
|
|
443
|
+
}),
|
|
444
|
+
'danger.bold': (0, _core.css)({
|
|
445
|
+
backgroundColor: "var(--ds-background-danger-bold, var(--ds-bg-fb))"
|
|
446
|
+
}),
|
|
447
|
+
warning: (0, _core.css)({
|
|
448
|
+
backgroundColor: "var(--ds-background-warning, var(--ds-bg-fb))"
|
|
449
|
+
}),
|
|
450
|
+
'warning.bold': (0, _core.css)({
|
|
451
|
+
backgroundColor: "var(--ds-background-warning-bold, var(--ds-bg-fb))"
|
|
452
|
+
}),
|
|
453
|
+
success: (0, _core.css)({
|
|
454
|
+
backgroundColor: "var(--ds-background-success, var(--ds-bg-fb))"
|
|
455
|
+
}),
|
|
456
|
+
'success.bold': (0, _core.css)({
|
|
457
|
+
backgroundColor: "var(--ds-background-success-bold, var(--ds-bg-fb))"
|
|
458
|
+
}),
|
|
459
|
+
discovery: (0, _core.css)({
|
|
460
|
+
backgroundColor: "var(--ds-background-discovery, var(--ds-bg-fb))"
|
|
461
|
+
}),
|
|
462
|
+
'discovery.bold': (0, _core.css)({
|
|
463
|
+
backgroundColor: "var(--ds-background-discovery-bold, var(--ds-bg-fb))"
|
|
464
|
+
}),
|
|
465
|
+
information: (0, _core.css)({
|
|
466
|
+
backgroundColor: "var(--ds-background-information, var(--ds-bg-fb))"
|
|
467
|
+
}),
|
|
468
|
+
'information.bold': (0, _core.css)({
|
|
469
|
+
backgroundColor: "var(--ds-background-information-bold, var(--ds-bg-fb))"
|
|
470
|
+
}),
|
|
471
|
+
'color.blanket': (0, _core.css)({
|
|
472
|
+
backgroundColor: "var(--ds-blanket, var(--ds-bg-fb))"
|
|
473
|
+
}),
|
|
474
|
+
'color.blanket.selected': (0, _core.css)({
|
|
475
|
+
backgroundColor: "var(--ds-blanket-selected, var(--ds-bg-fb))"
|
|
476
|
+
}),
|
|
477
|
+
'color.blanket.danger': (0, _core.css)({
|
|
478
|
+
backgroundColor: "var(--ds-blanket-danger, var(--ds-bg-fb))"
|
|
479
|
+
}),
|
|
480
|
+
'elevation.surface': (0, _core.css)({
|
|
481
|
+
backgroundColor: "var(--ds-surface, var(--ds-bg-fb))"
|
|
482
|
+
}),
|
|
483
|
+
'elevation.surface.sunken': (0, _core.css)({
|
|
484
|
+
backgroundColor: "var(--ds-surface-sunken, var(--ds-bg-fb))"
|
|
485
|
+
}),
|
|
486
|
+
'elevation.surface.raised': (0, _core.css)({
|
|
487
|
+
backgroundColor: "var(--ds-surface-raised, var(--ds-bg-fb))"
|
|
488
|
+
}),
|
|
489
|
+
'elevation.surface.overlay': (0, _core.css)({
|
|
490
|
+
backgroundColor: "var(--ds-surface-overlay, var(--ds-bg-fb))"
|
|
491
|
+
})
|
|
492
|
+
};
|
|
493
|
+
/**
|
|
494
|
+
* @codegenEnd
|
|
495
|
+
*/
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = require("react");
|
|
11
|
+
|
|
12
|
+
var _core = require("@emotion/core");
|
|
13
|
+
|
|
14
|
+
var _constants = require("../constants");
|
|
15
|
+
|
|
16
|
+
var _text = _interopRequireDefault(require("./text.partial"));
|
|
17
|
+
|
|
18
|
+
/** @jsx jsx */
|
|
19
|
+
var flexAlignItemsMap = {
|
|
20
|
+
center: (0, _core.css)({
|
|
21
|
+
alignItems: 'center'
|
|
22
|
+
}),
|
|
23
|
+
baseline: (0, _core.css)({
|
|
24
|
+
alignItems: 'baseline'
|
|
25
|
+
}),
|
|
26
|
+
flexStart: (0, _core.css)({
|
|
27
|
+
alignItems: 'flex-start'
|
|
28
|
+
}),
|
|
29
|
+
flexEnd: (0, _core.css)({
|
|
30
|
+
alignItems: 'flex-end'
|
|
31
|
+
})
|
|
32
|
+
};
|
|
33
|
+
var flexJustifyContentMap = {
|
|
34
|
+
center: (0, _core.css)({
|
|
35
|
+
justifyContent: 'center'
|
|
36
|
+
}),
|
|
37
|
+
flexStart: (0, _core.css)({
|
|
38
|
+
justifyContent: 'flex-start'
|
|
39
|
+
}),
|
|
40
|
+
flexEnd: (0, _core.css)({
|
|
41
|
+
justifyContent: 'flex-end'
|
|
42
|
+
})
|
|
43
|
+
};
|
|
44
|
+
var baseStyles = (0, _core.css)({
|
|
45
|
+
display: 'flex',
|
|
46
|
+
boxSizing: 'border-box',
|
|
47
|
+
flexDirection: 'row'
|
|
48
|
+
});
|
|
49
|
+
/**
|
|
50
|
+
* __Inline__
|
|
51
|
+
*
|
|
52
|
+
* Inline is a primitive component based on flexbox that manages the horizontal layout of direct children.
|
|
53
|
+
* Renders a `div` by default.
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
var Inline = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
58
|
+
var gap = _ref.gap,
|
|
59
|
+
alignItems = _ref.alignItems,
|
|
60
|
+
justifyContent = _ref.justifyContent,
|
|
61
|
+
divider = _ref.divider,
|
|
62
|
+
children = _ref.children,
|
|
63
|
+
testId = _ref.testId;
|
|
64
|
+
var dividerComponent = typeof divider === 'string' ? (0, _core.jsx)(_text.default, null, divider) : divider;
|
|
65
|
+
return (0, _core.jsx)("div", {
|
|
66
|
+
css: [baseStyles, gap && gapMap[gap], alignItems && flexAlignItemsMap[alignItems], justifyContent && flexJustifyContentMap[justifyContent]],
|
|
67
|
+
"data-testid": testId,
|
|
68
|
+
ref: ref
|
|
69
|
+
}, _react.Children.map(children, function (child, index) {
|
|
70
|
+
return (0, _core.jsx)(_react.Fragment, null, divider && index > 0 ? dividerComponent : null, child);
|
|
71
|
+
}));
|
|
72
|
+
});
|
|
73
|
+
var _default = Inline;
|
|
74
|
+
/**
|
|
75
|
+
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
76
|
+
* @codegen <<SignedSource::ac3192fbc453a94ab5e720d0273556ef>>
|
|
77
|
+
* @codegenId spacing
|
|
78
|
+
* @codegenCommand yarn codegen-styles
|
|
79
|
+
* @codegenParams ["gap"]
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
exports.default = _default;
|
|
83
|
+
var gapMap = {
|
|
84
|
+
'sp-0': (0, _core.css)({
|
|
85
|
+
gap: _constants.SPACING_SCALE['sp-0']
|
|
86
|
+
}),
|
|
87
|
+
'sp-25': (0, _core.css)({
|
|
88
|
+
gap: _constants.SPACING_SCALE['sp-25']
|
|
89
|
+
}),
|
|
90
|
+
'sp-50': (0, _core.css)({
|
|
91
|
+
gap: _constants.SPACING_SCALE['sp-50']
|
|
92
|
+
}),
|
|
93
|
+
'sp-75': (0, _core.css)({
|
|
94
|
+
gap: _constants.SPACING_SCALE['sp-75']
|
|
95
|
+
}),
|
|
96
|
+
'sp-100': (0, _core.css)({
|
|
97
|
+
gap: _constants.SPACING_SCALE['sp-100']
|
|
98
|
+
}),
|
|
99
|
+
'sp-200': (0, _core.css)({
|
|
100
|
+
gap: _constants.SPACING_SCALE['sp-200']
|
|
101
|
+
}),
|
|
102
|
+
'sp-300': (0, _core.css)({
|
|
103
|
+
gap: _constants.SPACING_SCALE['sp-300']
|
|
104
|
+
}),
|
|
105
|
+
'sp-400': (0, _core.css)({
|
|
106
|
+
gap: _constants.SPACING_SCALE['sp-400']
|
|
107
|
+
}),
|
|
108
|
+
'sp-500': (0, _core.css)({
|
|
109
|
+
gap: _constants.SPACING_SCALE['sp-500']
|
|
110
|
+
}),
|
|
111
|
+
'sp-600': (0, _core.css)({
|
|
112
|
+
gap: _constants.SPACING_SCALE['sp-600']
|
|
113
|
+
}),
|
|
114
|
+
'sp-800': (0, _core.css)({
|
|
115
|
+
gap: _constants.SPACING_SCALE['sp-800']
|
|
116
|
+
})
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* @codegenEnd
|
|
120
|
+
*/
|