@atlaskit/primitives 0.7.0 → 0.8.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 +20 -0
- package/constellation/accessibility/examples.mdx +9 -0
- package/constellation/box/code.mdx +9 -0
- package/constellation/box/examples.mdx +9 -0
- package/constellation/overview/examples.mdx +9 -0
- package/dist/cjs/components/{inline.partial.js → inline.js} +2 -34
- package/dist/cjs/components/stack.js +86 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/internal/style-maps.partial.js +34 -6
- package/dist/cjs/internal/xcss.js +5 -9
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/{inline.partial.js → inline.js} +2 -58
- package/dist/es2019/components/stack.js +79 -0
- package/dist/es2019/index.js +2 -2
- package/dist/es2019/internal/style-maps.partial.js +30 -5
- package/dist/es2019/internal/xcss.js +5 -8
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/{inline.partial.js → inline.js} +2 -33
- package/dist/esm/components/stack.js +78 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/internal/style-maps.partial.js +30 -5
- package/dist/esm/internal/xcss.js +5 -8
- package/dist/esm/version.json +1 -1
- package/dist/types/components/{inline.partial.d.ts → inline.d.ts} +1 -28
- package/dist/types/components/{stack.partial.d.ts → stack.d.ts} +1 -27
- package/dist/types/index.d.ts +2 -2
- package/dist/types/internal/style-maps.partial.d.ts +31 -5
- package/dist/types/internal/xcss.d.ts +1 -6
- package/inline/package.json +5 -5
- package/package.json +35 -9
- package/report.api.md +31 -47
- package/scripts/codegen-file-templates/flex-direction.tsx +6 -0
- package/scripts/codegen-styles.tsx +70 -71
- package/scripts/misc-codegen-template.tsx +1 -0
- package/scripts/spacing-codegen-template.tsx +1 -6
- package/stack/package.json +5 -5
- package/tmp/api-report-tmp.d.ts +31 -47
- package/dist/cjs/components/stack.partial.js +0 -118
- package/dist/es2019/components/stack.partial.js +0 -135
- package/dist/esm/components/stack.partial.js +0 -109
package/dist/es2019/version.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
/* eslint-disable @repo/internal/styles/no-exported-styles */
|
|
3
2
|
/** @jsx jsx */
|
|
4
3
|
import { Children, forwardRef, Fragment, memo } from 'react';
|
|
5
4
|
import { css, jsx } from '@emotion/react';
|
|
5
|
+
import { spaceStylesMap } from '../internal/style-maps.partial';
|
|
6
6
|
var alignItemsMap = {
|
|
7
7
|
center: css({
|
|
8
8
|
alignItems: 'center'
|
|
@@ -43,37 +43,6 @@ var flexGrowMap = {
|
|
|
43
43
|
var flexWrapStyles = css({
|
|
44
44
|
flexWrap: 'wrap'
|
|
45
45
|
});
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
49
|
-
* @codegen <<SignedSource::fb7587b114753ed19425e2b07b5deb0d>>
|
|
50
|
-
* @codegenId spacing
|
|
51
|
-
* @codegenCommand yarn codegen-styles
|
|
52
|
-
* @codegenParams ["inlineSpace"]
|
|
53
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
54
|
-
*/
|
|
55
|
-
var inlineSpaceMap = Object.fromEntries(['gap', 'rowGap'].map(function (property) {
|
|
56
|
-
return [property, {
|
|
57
|
-
'0': css(_defineProperty({}, property, "var(--ds-space-0, 0px)")),
|
|
58
|
-
'025': css(_defineProperty({}, property, "var(--ds-space-025, 2px)")),
|
|
59
|
-
'050': css(_defineProperty({}, property, "var(--ds-space-050, 4px)")),
|
|
60
|
-
'075': css(_defineProperty({}, property, "var(--ds-space-075, 6px)")),
|
|
61
|
-
'100': css(_defineProperty({}, property, "var(--ds-space-100, 8px)")),
|
|
62
|
-
'150': css(_defineProperty({}, property, "var(--ds-space-150, 12px)")),
|
|
63
|
-
'200': css(_defineProperty({}, property, "var(--ds-space-200, 16px)")),
|
|
64
|
-
'250': css(_defineProperty({}, property, "var(--ds-space-250, 20px)")),
|
|
65
|
-
'300': css(_defineProperty({}, property, "var(--ds-space-300, 24px)")),
|
|
66
|
-
'400': css(_defineProperty({}, property, "var(--ds-space-400, 32px)")),
|
|
67
|
-
'500': css(_defineProperty({}, property, "var(--ds-space-500, 40px)")),
|
|
68
|
-
'600': css(_defineProperty({}, property, "var(--ds-space-600, 48px)")),
|
|
69
|
-
'800': css(_defineProperty({}, property, "var(--ds-space-800, 64px)")),
|
|
70
|
-
'1000': css(_defineProperty({}, property, "var(--ds-space-1000, 80px)"))
|
|
71
|
-
}];
|
|
72
|
-
}));
|
|
73
|
-
/**
|
|
74
|
-
* @codegenEnd
|
|
75
|
-
*/
|
|
76
|
-
|
|
77
46
|
var baseStyles = css({
|
|
78
47
|
display: 'flex',
|
|
79
48
|
boxSizing: 'border-box',
|
|
@@ -130,7 +99,7 @@ var Inline = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
130
99
|
}) : rawChildren;
|
|
131
100
|
var justifyContent = spread || alignInline;
|
|
132
101
|
return jsx(Component, {
|
|
133
|
-
css: [baseStyles, space &&
|
|
102
|
+
css: [baseStyles, space && spaceStylesMap.gap[space], justifyContent && justifyContentMap[justifyContent], grow && flexGrowMap[grow], alignItems && alignItemsMap[alignItems], shouldWrap && flexWrapStyles, rowSpace && spaceStylesMap.rowGap[rowSpace]],
|
|
134
103
|
"data-testid": testId,
|
|
135
104
|
ref: ref
|
|
136
105
|
}, children);
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/* eslint-disable @repo/internal/styles/no-exported-styles */
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { forwardRef, memo } from 'react';
|
|
4
|
+
import { css, jsx } from '@emotion/react';
|
|
5
|
+
import { spaceStylesMap } from '../internal/style-maps.partial';
|
|
6
|
+
var justifyContentMap = {
|
|
7
|
+
start: css({
|
|
8
|
+
justifyContent: 'start'
|
|
9
|
+
}),
|
|
10
|
+
center: css({
|
|
11
|
+
justifyContent: 'center'
|
|
12
|
+
}),
|
|
13
|
+
end: css({
|
|
14
|
+
justifyContent: 'end'
|
|
15
|
+
}),
|
|
16
|
+
'space-between': css({
|
|
17
|
+
justifyContent: 'space-between'
|
|
18
|
+
})
|
|
19
|
+
};
|
|
20
|
+
var alignItemsMap = {
|
|
21
|
+
start: css({
|
|
22
|
+
alignItems: 'start'
|
|
23
|
+
}),
|
|
24
|
+
center: css({
|
|
25
|
+
alignItems: 'center'
|
|
26
|
+
}),
|
|
27
|
+
end: css({
|
|
28
|
+
alignItems: 'end'
|
|
29
|
+
})
|
|
30
|
+
};
|
|
31
|
+
var flexGrowMap = {
|
|
32
|
+
hug: css({
|
|
33
|
+
flexGrow: 0
|
|
34
|
+
}),
|
|
35
|
+
fill: css({
|
|
36
|
+
width: '100%',
|
|
37
|
+
flexGrow: 1
|
|
38
|
+
})
|
|
39
|
+
};
|
|
40
|
+
var baseStyles = css({
|
|
41
|
+
display: 'flex',
|
|
42
|
+
boxSizing: 'border-box',
|
|
43
|
+
flexDirection: 'column'
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* __Stack__
|
|
48
|
+
*
|
|
49
|
+
* Stack is a primitive component based on flexbox that manages the vertical layout of direct children.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```tsx
|
|
53
|
+
* <Stack>
|
|
54
|
+
* <Box padding="space.100" backgroundColor="neutral"></Box>
|
|
55
|
+
* <Box padding="space.100" backgroundColor="neutral"></Box>
|
|
56
|
+
* </Stack>
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
*/
|
|
60
|
+
var Stack = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
61
|
+
var as = _ref.as,
|
|
62
|
+
alignItems = _ref.alignInline,
|
|
63
|
+
alignBlock = _ref.alignBlock,
|
|
64
|
+
spread = _ref.spread,
|
|
65
|
+
grow = _ref.grow,
|
|
66
|
+
space = _ref.space,
|
|
67
|
+
children = _ref.children,
|
|
68
|
+
testId = _ref.testId;
|
|
69
|
+
var Component = as || 'div';
|
|
70
|
+
var justifyContent = spread || alignBlock;
|
|
71
|
+
return jsx(Component, {
|
|
72
|
+
css: [baseStyles, space && spaceStylesMap.gap[space], alignItems && alignItemsMap[alignItems], grow && flexGrowMap[grow], justifyContent && justifyContentMap[justifyContent]],
|
|
73
|
+
"data-testid": testId,
|
|
74
|
+
ref: ref
|
|
75
|
+
}, children);
|
|
76
|
+
}));
|
|
77
|
+
Stack.displayName = 'Stack';
|
|
78
|
+
export default Stack;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as Box } from './components/box';
|
|
2
|
-
export { default as Inline } from './components/inline
|
|
2
|
+
export { default as Inline } from './components/inline';
|
|
3
3
|
export { xcss } from './internal/xcss';
|
|
4
|
-
export { default as Stack } from './components/stack
|
|
4
|
+
export { default as Stack } from './components/stack';
|
|
@@ -23,10 +23,10 @@ export var dimensionMap = {
|
|
|
23
23
|
*/
|
|
24
24
|
/**
|
|
25
25
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
26
|
-
* @codegen <<SignedSource::
|
|
26
|
+
* @codegen <<SignedSource::b8ac4fd29ba83e2ab1c2713c35915067>>
|
|
27
27
|
* @codegenId spacing
|
|
28
28
|
* @codegenCommand yarn codegen-styles
|
|
29
|
-
* @codegenParams ["padding"]
|
|
29
|
+
* @codegenParams ["padding", "space"]
|
|
30
30
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
31
31
|
*/
|
|
32
32
|
export var paddingMap = {
|
|
@@ -45,6 +45,22 @@ export var paddingMap = {
|
|
|
45
45
|
'space.800': "var(--ds-space-800, 64px)",
|
|
46
46
|
'space.1000': "var(--ds-space-1000, 80px)"
|
|
47
47
|
};
|
|
48
|
+
export var spaceMap = {
|
|
49
|
+
'space.0': "var(--ds-space-0, 0px)",
|
|
50
|
+
'space.025': "var(--ds-space-025, 2px)",
|
|
51
|
+
'space.050': "var(--ds-space-050, 4px)",
|
|
52
|
+
'space.075': "var(--ds-space-075, 6px)",
|
|
53
|
+
'space.100': "var(--ds-space-100, 8px)",
|
|
54
|
+
'space.150': "var(--ds-space-150, 12px)",
|
|
55
|
+
'space.200': "var(--ds-space-200, 16px)",
|
|
56
|
+
'space.250': "var(--ds-space-250, 20px)",
|
|
57
|
+
'space.300': "var(--ds-space-300, 24px)",
|
|
58
|
+
'space.400': "var(--ds-space-400, 32px)",
|
|
59
|
+
'space.500': "var(--ds-space-500, 40px)",
|
|
60
|
+
'space.600': "var(--ds-space-600, 48px)",
|
|
61
|
+
'space.800': "var(--ds-space-800, 64px)",
|
|
62
|
+
'space.1000': "var(--ds-space-1000, 80px)"
|
|
63
|
+
};
|
|
48
64
|
/**
|
|
49
65
|
* @codegenEnd
|
|
50
66
|
*/
|
|
@@ -231,14 +247,15 @@ export var textColorMap = {
|
|
|
231
247
|
*/
|
|
232
248
|
/**
|
|
233
249
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
234
|
-
* @codegen <<SignedSource::
|
|
250
|
+
* @codegen <<SignedSource::8ab54fc337c6a02f403dad852dd626a0>>
|
|
235
251
|
* @codegenId misc
|
|
236
252
|
* @codegenCommand yarn codegen-styles
|
|
237
|
-
* @codegenParams ["align-self", "border-style", "display", "flex-grow", "flex-shrink", "flex", "layer", "overflow", "position"]
|
|
253
|
+
* @codegenParams ["align-self", "border-style", "display", "flex-direction", "flex-grow", "flex-shrink", "flex", "layer", "overflow", "position"]
|
|
238
254
|
* @codegenDependency ../../scripts/codegen-file-templates/align-self.tsx <<SignedSource::074079802534462de54bf882bb2073e5>>
|
|
239
255
|
* @codegenDependency ../../scripts/codegen-file-templates/border-style.tsx <<SignedSource::87e7e289ffeaac901997c4af98084a5f>>
|
|
240
256
|
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::89d19ca3937408eb7de5d72f4476a0f9>>
|
|
241
257
|
* @codegenDependency ../../scripts/codegen-file-templates/display.tsx <<SignedSource::e6e390f80609060bfd12a55a489d5f54>>
|
|
258
|
+
* @codegenDependency ../../scripts/codegen-file-templates/flex-direction.tsx <<SignedSource::19809ba11675679c188b0d98fb651dc1>>
|
|
242
259
|
* @codegenDependency ../../scripts/codegen-file-templates/flex-grow.tsx <<SignedSource::b8a06b122cb609170f1f42778a6c270e>>
|
|
243
260
|
* @codegenDependency ../../scripts/codegen-file-templates/flex-shrink.tsx <<SignedSource::bf6626972898bf22d2eeee2130693d47>>
|
|
244
261
|
* @codegenDependency ../../scripts/codegen-file-templates/flex.tsx <<SignedSource::ffa0189d14f1f00a16ec1e9f43a17ce9>>
|
|
@@ -257,6 +274,10 @@ export var borderStyleMap = {
|
|
|
257
274
|
none: 'none',
|
|
258
275
|
solid: 'solid'
|
|
259
276
|
};
|
|
277
|
+
export var flexDirectionMap = {
|
|
278
|
+
row: 'row',
|
|
279
|
+
column: 'column'
|
|
280
|
+
};
|
|
260
281
|
export var flexGrowMap = {
|
|
261
282
|
'0': 0,
|
|
262
283
|
'1': 1
|
|
@@ -326,7 +347,7 @@ export var borderRadiusMap = {
|
|
|
326
347
|
* @codegenEnd
|
|
327
348
|
*/
|
|
328
349
|
|
|
329
|
-
var spacingProperties = ['padding', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd'];
|
|
350
|
+
var spacingProperties = ['padding', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd', 'gap', 'rowGap'];
|
|
330
351
|
var getSerializedStylesMap = function getSerializedStylesMap(cssProperty, tokenMap) {
|
|
331
352
|
return Object.keys(tokenMap).reduce(function (emotionSpacingMap, token) {
|
|
332
353
|
emotionSpacingMap[token] = css(_defineProperty({}, cssProperty, tokenMap[token]));
|
|
@@ -337,4 +358,8 @@ export var paddingStylesMap = spacingProperties.reduce(function (styleMap, spaci
|
|
|
337
358
|
styleMap[spacingProperty] = getSerializedStylesMap(spacingProperty, paddingMap);
|
|
338
359
|
return styleMap;
|
|
339
360
|
}, {});
|
|
361
|
+
export var spaceStylesMap = spacingProperties.reduce(function (styleMap, spacingProperty) {
|
|
362
|
+
styleMap[spacingProperty] = getSerializedStylesMap(spacingProperty, spaceMap);
|
|
363
|
+
return styleMap;
|
|
364
|
+
}, {});
|
|
340
365
|
export var backgroundColorStylesMap = getSerializedStylesMap('backgroundColor', backgroundColorMap);
|
|
@@ -29,12 +29,9 @@ var uniqueSymbol = Symbol('Internal symbol to verify xcss function is called saf
|
|
|
29
29
|
var isSafeEnvToThrow = function isSafeEnvToThrow() {
|
|
30
30
|
return (typeof process === "undefined" ? "undefined" : _typeof(process)) === 'object' && _typeof(process.env) === 'object' && process.env.NODE_ENV !== 'production';
|
|
31
31
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
* @internal
|
|
36
|
-
*/
|
|
37
|
-
export var transformStyles = function transformStyles(styleObj) {
|
|
32
|
+
var reNestedSelectors = /(\.|\s|&+|\*\>|#|\[.*\])/;
|
|
33
|
+
var rePseudos = /^::?.*$/;
|
|
34
|
+
var transformStyles = function transformStyles(styleObj) {
|
|
38
35
|
if (!styleObj || _typeof(styleObj) !== 'object') {
|
|
39
36
|
return styleObj;
|
|
40
37
|
}
|
|
@@ -51,14 +48,14 @@ export var transformStyles = function transformStyles(styleObj) {
|
|
|
51
48
|
value = _ref2[1];
|
|
52
49
|
if (isSafeEnvToThrow()) {
|
|
53
50
|
// We don't support `.class`, `[data-testid]`, `> *`, `#some-id`
|
|
54
|
-
if (
|
|
51
|
+
if (reNestedSelectors.test(key)) {
|
|
55
52
|
throw new Error("Styles not supported for key '".concat(key, "'."));
|
|
56
53
|
}
|
|
57
54
|
}
|
|
58
55
|
|
|
59
56
|
// If key is a pseudo class or a pseudo element, then value should be an object.
|
|
60
57
|
// So, call transformStyles on the value
|
|
61
|
-
if (
|
|
58
|
+
if (rePseudos.test(key)) {
|
|
62
59
|
styleObj[key] = transformStyles(value);
|
|
63
60
|
return;
|
|
64
61
|
}
|
package/dist/esm/version.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { ComponentPropsWithRef, ElementType, ReactNode } from 'react';
|
|
3
|
+
import { type Gap, type RowGap } from '../internal/style-maps.partial';
|
|
3
4
|
export interface InlineProps<T extends ElementType = 'div'> {
|
|
4
5
|
/**
|
|
5
6
|
* The DOM element to render as the Inline. Defaults to `div`.
|
|
@@ -55,34 +56,6 @@ export declare type AlignInline = 'start' | 'center' | 'end';
|
|
|
55
56
|
export declare type AlignBlock = 'start' | 'center' | 'end' | 'baseline';
|
|
56
57
|
export declare type Spread = 'space-between';
|
|
57
58
|
export declare type Grow = 'hug' | 'fill';
|
|
58
|
-
/**
|
|
59
|
-
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
60
|
-
* @codegen <<SignedSource::fb7587b114753ed19425e2b07b5deb0d>>
|
|
61
|
-
* @codegenId spacing
|
|
62
|
-
* @codegenCommand yarn codegen-styles
|
|
63
|
-
* @codegenParams ["inlineSpace"]
|
|
64
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
65
|
-
*/
|
|
66
|
-
declare const inlineSpaceMap: {
|
|
67
|
-
[k: string]: {
|
|
68
|
-
readonly '0': import("@emotion/react").SerializedStyles;
|
|
69
|
-
readonly '025': import("@emotion/react").SerializedStyles;
|
|
70
|
-
readonly '050': import("@emotion/react").SerializedStyles;
|
|
71
|
-
readonly '075': import("@emotion/react").SerializedStyles;
|
|
72
|
-
readonly '100': import("@emotion/react").SerializedStyles;
|
|
73
|
-
readonly '150': import("@emotion/react").SerializedStyles;
|
|
74
|
-
readonly '200': import("@emotion/react").SerializedStyles;
|
|
75
|
-
readonly '250': import("@emotion/react").SerializedStyles;
|
|
76
|
-
readonly '300': import("@emotion/react").SerializedStyles;
|
|
77
|
-
readonly '400': import("@emotion/react").SerializedStyles;
|
|
78
|
-
readonly '500': import("@emotion/react").SerializedStyles;
|
|
79
|
-
readonly '600': import("@emotion/react").SerializedStyles;
|
|
80
|
-
readonly '800': import("@emotion/react").SerializedStyles;
|
|
81
|
-
readonly '1000': import("@emotion/react").SerializedStyles;
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
export declare type Gap = keyof typeof inlineSpaceMap.gap;
|
|
85
|
-
export declare type RowGap = keyof typeof inlineSpaceMap.rowGap;
|
|
86
59
|
/**
|
|
87
60
|
* __Inline__
|
|
88
61
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { ComponentPropsWithRef, ElementType, ReactNode } from 'react';
|
|
3
|
+
import { type Gap } from '../internal/style-maps.partial';
|
|
3
4
|
export interface StackProps<T extends ElementType = 'div'> {
|
|
4
5
|
/**
|
|
5
6
|
* The DOM element to render as the Stack. Defaults to `div`.
|
|
@@ -42,33 +43,6 @@ export declare type AlignInline = 'start' | 'center' | 'end';
|
|
|
42
43
|
export declare type AlignBlock = 'start' | 'center' | 'end';
|
|
43
44
|
export declare type Spread = 'space-between';
|
|
44
45
|
export declare type Grow = 'hug' | 'fill';
|
|
45
|
-
/**
|
|
46
|
-
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
47
|
-
* @codegen <<SignedSource::4eb2c996d6ce5791acad51e2b226635f>>
|
|
48
|
-
* @codegenId spacing
|
|
49
|
-
* @codegenCommand yarn codegen-styles
|
|
50
|
-
* @codegenParams ["stackSpace"]
|
|
51
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
52
|
-
*/
|
|
53
|
-
declare const stackSpaceMap: {
|
|
54
|
-
[k: string]: {
|
|
55
|
-
readonly '0': import("@emotion/react").SerializedStyles;
|
|
56
|
-
readonly '025': import("@emotion/react").SerializedStyles;
|
|
57
|
-
readonly '050': import("@emotion/react").SerializedStyles;
|
|
58
|
-
readonly '075': import("@emotion/react").SerializedStyles;
|
|
59
|
-
readonly '100': import("@emotion/react").SerializedStyles;
|
|
60
|
-
readonly '150': import("@emotion/react").SerializedStyles;
|
|
61
|
-
readonly '200': import("@emotion/react").SerializedStyles;
|
|
62
|
-
readonly '250': import("@emotion/react").SerializedStyles;
|
|
63
|
-
readonly '300': import("@emotion/react").SerializedStyles;
|
|
64
|
-
readonly '400': import("@emotion/react").SerializedStyles;
|
|
65
|
-
readonly '500': import("@emotion/react").SerializedStyles;
|
|
66
|
-
readonly '600': import("@emotion/react").SerializedStyles;
|
|
67
|
-
readonly '800': import("@emotion/react").SerializedStyles;
|
|
68
|
-
readonly '1000': import("@emotion/react").SerializedStyles;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
export declare type Gap = keyof typeof stackSpaceMap.gap;
|
|
72
46
|
/**
|
|
73
47
|
* __Stack__
|
|
74
48
|
*
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as Box, type BoxProps } from './components/box';
|
|
2
|
-
export { default as Inline, type InlineProps
|
|
2
|
+
export { default as Inline, type InlineProps } from './components/inline';
|
|
3
3
|
export { xcss } from './internal/xcss';
|
|
4
|
-
export { default as Stack, type StackProps } from './components/stack
|
|
4
|
+
export { default as Stack, type StackProps } from './components/stack';
|
|
@@ -28,10 +28,10 @@ export declare type MaxHeight = keyof typeof dimensionMap;
|
|
|
28
28
|
*/
|
|
29
29
|
/**
|
|
30
30
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
31
|
-
* @codegen <<SignedSource::
|
|
31
|
+
* @codegen <<SignedSource::b8ac4fd29ba83e2ab1c2713c35915067>>
|
|
32
32
|
* @codegenId spacing
|
|
33
33
|
* @codegenCommand yarn codegen-styles
|
|
34
|
-
* @codegenParams ["padding"]
|
|
34
|
+
* @codegenParams ["padding", "space"]
|
|
35
35
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
36
36
|
*/
|
|
37
37
|
export declare const paddingMap: {
|
|
@@ -57,6 +57,24 @@ export declare type PaddingBlockEnd = keyof typeof paddingMap;
|
|
|
57
57
|
export declare type PaddingInline = keyof typeof paddingMap;
|
|
58
58
|
export declare type PaddingInlineStart = keyof typeof paddingMap;
|
|
59
59
|
export declare type PaddingInlineEnd = keyof typeof paddingMap;
|
|
60
|
+
export declare const spaceMap: {
|
|
61
|
+
readonly 'space.0': "var(--ds-space-0)";
|
|
62
|
+
readonly 'space.025': "var(--ds-space-025)";
|
|
63
|
+
readonly 'space.050': "var(--ds-space-050)";
|
|
64
|
+
readonly 'space.075': "var(--ds-space-075)";
|
|
65
|
+
readonly 'space.100': "var(--ds-space-100)";
|
|
66
|
+
readonly 'space.150': "var(--ds-space-150)";
|
|
67
|
+
readonly 'space.200': "var(--ds-space-200)";
|
|
68
|
+
readonly 'space.250': "var(--ds-space-250)";
|
|
69
|
+
readonly 'space.300': "var(--ds-space-300)";
|
|
70
|
+
readonly 'space.400': "var(--ds-space-400)";
|
|
71
|
+
readonly 'space.500': "var(--ds-space-500)";
|
|
72
|
+
readonly 'space.600': "var(--ds-space-600)";
|
|
73
|
+
readonly 'space.800': "var(--ds-space-800)";
|
|
74
|
+
readonly 'space.1000': "var(--ds-space-1000)";
|
|
75
|
+
};
|
|
76
|
+
export declare type Gap = keyof typeof spaceMap;
|
|
77
|
+
export declare type RowGap = keyof typeof spaceMap;
|
|
60
78
|
/**
|
|
61
79
|
* @codegenEnd
|
|
62
80
|
*/
|
|
@@ -247,14 +265,15 @@ export declare type TextColor = keyof typeof textColorMap;
|
|
|
247
265
|
*/
|
|
248
266
|
/**
|
|
249
267
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
250
|
-
* @codegen <<SignedSource::
|
|
268
|
+
* @codegen <<SignedSource::8ab54fc337c6a02f403dad852dd626a0>>
|
|
251
269
|
* @codegenId misc
|
|
252
270
|
* @codegenCommand yarn codegen-styles
|
|
253
|
-
* @codegenParams ["align-self", "border-style", "display", "flex-grow", "flex-shrink", "flex", "layer", "overflow", "position"]
|
|
271
|
+
* @codegenParams ["align-self", "border-style", "display", "flex-direction", "flex-grow", "flex-shrink", "flex", "layer", "overflow", "position"]
|
|
254
272
|
* @codegenDependency ../../scripts/codegen-file-templates/align-self.tsx <<SignedSource::074079802534462de54bf882bb2073e5>>
|
|
255
273
|
* @codegenDependency ../../scripts/codegen-file-templates/border-style.tsx <<SignedSource::87e7e289ffeaac901997c4af98084a5f>>
|
|
256
274
|
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::89d19ca3937408eb7de5d72f4476a0f9>>
|
|
257
275
|
* @codegenDependency ../../scripts/codegen-file-templates/display.tsx <<SignedSource::e6e390f80609060bfd12a55a489d5f54>>
|
|
276
|
+
* @codegenDependency ../../scripts/codegen-file-templates/flex-direction.tsx <<SignedSource::19809ba11675679c188b0d98fb651dc1>>
|
|
258
277
|
* @codegenDependency ../../scripts/codegen-file-templates/flex-grow.tsx <<SignedSource::b8a06b122cb609170f1f42778a6c270e>>
|
|
259
278
|
* @codegenDependency ../../scripts/codegen-file-templates/flex-shrink.tsx <<SignedSource::bf6626972898bf22d2eeee2130693d47>>
|
|
260
279
|
* @codegenDependency ../../scripts/codegen-file-templates/flex.tsx <<SignedSource::ffa0189d14f1f00a16ec1e9f43a17ce9>>
|
|
@@ -276,6 +295,11 @@ export declare const borderStyleMap: {
|
|
|
276
295
|
};
|
|
277
296
|
export declare type BorderStyle = keyof typeof borderStyleMap;
|
|
278
297
|
export declare type Display = 'flex' | 'block' | 'inline' | 'inline-block' | 'inline-flex';
|
|
298
|
+
export declare const flexDirectionMap: {
|
|
299
|
+
readonly row: "row";
|
|
300
|
+
readonly column: "column";
|
|
301
|
+
};
|
|
302
|
+
export declare type FlexDirection = keyof typeof flexDirectionMap;
|
|
279
303
|
export declare const flexGrowMap: {
|
|
280
304
|
readonly '0': 0;
|
|
281
305
|
readonly '1': 1;
|
|
@@ -362,6 +386,7 @@ export declare type TokenisedProps = {
|
|
|
362
386
|
borderWidth?: BorderWidth;
|
|
363
387
|
display?: Display;
|
|
364
388
|
flex?: Flex;
|
|
389
|
+
flexDirection?: FlexDirection;
|
|
365
390
|
flexGrow?: FlexGrow;
|
|
366
391
|
flexShrink?: FlexShrink;
|
|
367
392
|
height?: Height;
|
|
@@ -385,12 +410,13 @@ export declare type TokenisedProps = {
|
|
|
385
410
|
textColor?: TextColor;
|
|
386
411
|
width?: Width;
|
|
387
412
|
};
|
|
388
|
-
declare const spacingProperties: readonly ["padding", "paddingBlock", "paddingBlockStart", "paddingBlockEnd", "paddingInline", "paddingInlineStart", "paddingInlineEnd"];
|
|
413
|
+
declare const spacingProperties: readonly ["padding", "paddingBlock", "paddingBlockStart", "paddingBlockEnd", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "gap", "rowGap"];
|
|
389
414
|
declare type SpacingProperty = typeof spacingProperties[number];
|
|
390
415
|
declare type SpacingToken = keyof typeof paddingMap;
|
|
391
416
|
declare type BackgroundColorToken = keyof typeof backgroundColorMap;
|
|
392
417
|
declare type SpacingStyleMap = Record<SpacingProperty, Record<SpacingToken, SerializedStyles>>;
|
|
393
418
|
declare type BackgroundColorStyleMap = Record<BackgroundColorToken, SerializedStyles>;
|
|
394
419
|
export declare const paddingStylesMap: SpacingStyleMap;
|
|
420
|
+
export declare const spaceStylesMap: SpacingStyleMap;
|
|
395
421
|
export declare const backgroundColorStylesMap: BackgroundColorStyleMap;
|
|
396
422
|
export {};
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { css as cssEmotion } from '@emotion/react';
|
|
3
|
-
import {
|
|
3
|
+
import { CSSPropertiesWithMultiValues, CSSPseudos, SerializedStyles } from '@emotion/serialize';
|
|
4
4
|
import { Box, Inline } from '../index';
|
|
5
5
|
import { TokenisedProps } from './style-maps.partial';
|
|
6
6
|
declare const uniqueSymbol: unique symbol;
|
|
7
|
-
/**
|
|
8
|
-
* Only exposed for testing.
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
export declare const transformStyles: (styleObj?: CSSObject | CSSObject[] | undefined) => CSSObject | CSSObject[] | undefined;
|
|
12
7
|
/**
|
|
13
8
|
* @internal used in primitives
|
|
14
9
|
* @returns a collection of styles that can be applied to the respective primitive
|
package/inline/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/primitives/inline",
|
|
3
|
-
"main": "../dist/cjs/components/inline.
|
|
4
|
-
"module": "../dist/esm/components/inline.
|
|
5
|
-
"module:es2019": "../dist/es2019/components/inline.
|
|
3
|
+
"main": "../dist/cjs/components/inline.js",
|
|
4
|
+
"module": "../dist/esm/components/inline.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/components/inline.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/components/inline.
|
|
7
|
+
"types": "../dist/types/components/inline.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
9
|
">=4.0 <4.5": {
|
|
10
10
|
"*": [
|
|
11
|
-
"../dist/types-ts4.0/components/inline.
|
|
11
|
+
"../dist/types-ts4.0/components/inline.d.ts"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/primitives",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Primitives are token-backed low-level building blocks.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -14,11 +14,37 @@
|
|
|
14
14
|
"inPublicMirror": false,
|
|
15
15
|
"releaseModel": "continuous",
|
|
16
16
|
"website": {
|
|
17
|
-
"category": "
|
|
17
|
+
"category": "Primitives",
|
|
18
18
|
"name": "Primitives",
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
"pages": [
|
|
20
|
+
{
|
|
21
|
+
"title": "Overview",
|
|
22
|
+
"id": "@atlaskit/primitives",
|
|
23
|
+
"folder": "overview",
|
|
24
|
+
"slug": "primitives/overview",
|
|
25
|
+
"status": {
|
|
26
|
+
"type": "alpha"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"title": "Accessibility",
|
|
31
|
+
"id": "@atlaskit/primitives",
|
|
32
|
+
"folder": "accessibility",
|
|
33
|
+
"slug": "primitives/accessibility",
|
|
34
|
+
"status": {
|
|
35
|
+
"type": "alpha"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"title": "Box",
|
|
40
|
+
"folder": "box",
|
|
41
|
+
"slug": "primitives/box",
|
|
42
|
+
"id": "@atlaskit/primitives/box",
|
|
43
|
+
"status": {
|
|
44
|
+
"type": "alpha"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
]
|
|
22
48
|
}
|
|
23
49
|
},
|
|
24
50
|
"scripts": {
|
|
@@ -33,8 +59,8 @@
|
|
|
33
59
|
"af:exports": {
|
|
34
60
|
".": "./src/index.tsx",
|
|
35
61
|
"./box": "./src/components/box.tsx",
|
|
36
|
-
"./stack": "./src/components/stack.
|
|
37
|
-
"./inline": "./src/components/inline.
|
|
62
|
+
"./stack": "./src/components/stack.tsx",
|
|
63
|
+
"./inline": "./src/components/inline.tsx",
|
|
38
64
|
"./responsive": "./src/helpers/responsive/index.tsx"
|
|
39
65
|
},
|
|
40
66
|
"dependencies": {
|
|
@@ -48,7 +74,6 @@
|
|
|
48
74
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
49
75
|
},
|
|
50
76
|
"devDependencies": {
|
|
51
|
-
"@af/codegen": "*",
|
|
52
77
|
"@atlaskit/docs": "*",
|
|
53
78
|
"@atlaskit/ds-lib": "*",
|
|
54
79
|
"@atlaskit/heading": "*",
|
|
@@ -56,6 +81,7 @@
|
|
|
56
81
|
"@atlaskit/visual-regression": "*",
|
|
57
82
|
"@atlaskit/webdriver-runner": "*",
|
|
58
83
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
84
|
+
"@atlassian/codegen": "^0.0.1",
|
|
59
85
|
"@testing-library/react": "^12.1.5",
|
|
60
86
|
"prettier": "^2.7.0",
|
|
61
87
|
"react-dom": "^16.8.0",
|
|
@@ -89,4 +115,4 @@
|
|
|
89
115
|
}
|
|
90
116
|
},
|
|
91
117
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
|
|
92
|
-
}
|
|
118
|
+
}
|