@atlaskit/primitives 0.0.2 → 0.1.1
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 +14 -0
- package/dist/cjs/components/inline.partial.js +161 -7
- package/dist/cjs/components/internal/box.partial.js +16 -16
- package/dist/cjs/components/stack.partial.js +132 -7
- package/dist/cjs/index.js +5 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/inline.partial.js +158 -2
- package/dist/es2019/components/internal/box.partial.js +16 -16
- package/dist/es2019/components/stack.partial.js +131 -2
- package/dist/es2019/index.js +2 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/inline.partial.js +159 -2
- package/dist/esm/components/internal/box.partial.js +16 -16
- package/dist/esm/components/stack.partial.js +130 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/components/inline.partial.d.ts +86 -1
- package/dist/types/components/internal/box.partial.d.ts +7 -7
- package/dist/types/components/stack.partial.d.ts +77 -1
- package/dist/types/index.d.ts +2 -2
- package/package.json +4 -3
- package/report.api.md +103 -4
- package/scripts/codegen-styles.tsx +2 -2
- package/scripts/spacing-codegen-template.tsx +11 -2
- package/tmp/api-report-tmp.d.ts +99 -4
|
@@ -1,2 +1,131 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { forwardRef, memo } from 'react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
|
+
const justifyContentMap = {
|
|
5
|
+
start: css({
|
|
6
|
+
justifyContent: 'start'
|
|
7
|
+
}),
|
|
8
|
+
center: css({
|
|
9
|
+
justifyContent: 'center'
|
|
10
|
+
}),
|
|
11
|
+
end: css({
|
|
12
|
+
justifyContent: 'end'
|
|
13
|
+
}),
|
|
14
|
+
'space-between': css({
|
|
15
|
+
justifyContent: 'space-between'
|
|
16
|
+
})
|
|
17
|
+
};
|
|
18
|
+
const alignItemsMap = {
|
|
19
|
+
start: css({
|
|
20
|
+
alignItems: 'start'
|
|
21
|
+
}),
|
|
22
|
+
center: css({
|
|
23
|
+
alignItems: 'center'
|
|
24
|
+
}),
|
|
25
|
+
end: css({
|
|
26
|
+
alignItems: 'end'
|
|
27
|
+
})
|
|
28
|
+
};
|
|
29
|
+
const flexGrowMap = {
|
|
30
|
+
hug: css({
|
|
31
|
+
flexGrow: 0
|
|
32
|
+
}),
|
|
33
|
+
fill: css({
|
|
34
|
+
flexGrow: 1
|
|
35
|
+
})
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
40
|
+
* @codegen <<SignedSource::e0d436d3312290a98dbfd91d90dd6b9e>>
|
|
41
|
+
* @codegenId spacing
|
|
42
|
+
* @codegenCommand yarn codegen-styles
|
|
43
|
+
* @codegenParams ["space"]
|
|
44
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
45
|
+
*/
|
|
46
|
+
const spaceMap = {
|
|
47
|
+
'0': css({
|
|
48
|
+
gap: "var(--ds-space-0, 0px)"
|
|
49
|
+
}),
|
|
50
|
+
'025': css({
|
|
51
|
+
gap: "var(--ds-space-025, 2px)"
|
|
52
|
+
}),
|
|
53
|
+
'050': css({
|
|
54
|
+
gap: "var(--ds-space-050, 4px)"
|
|
55
|
+
}),
|
|
56
|
+
'075': css({
|
|
57
|
+
gap: "var(--ds-space-075, 6px)"
|
|
58
|
+
}),
|
|
59
|
+
'100': css({
|
|
60
|
+
gap: "var(--ds-space-100, 8px)"
|
|
61
|
+
}),
|
|
62
|
+
'1000': css({
|
|
63
|
+
gap: "var(--ds-space-1000, 80px)"
|
|
64
|
+
}),
|
|
65
|
+
'150': css({
|
|
66
|
+
gap: "var(--ds-space-150, 12px)"
|
|
67
|
+
}),
|
|
68
|
+
'200': css({
|
|
69
|
+
gap: "var(--ds-space-200, 16px)"
|
|
70
|
+
}),
|
|
71
|
+
'250': css({
|
|
72
|
+
gap: "var(--ds-space-250, 20px)"
|
|
73
|
+
}),
|
|
74
|
+
'300': css({
|
|
75
|
+
gap: "var(--ds-space-300, 24px)"
|
|
76
|
+
}),
|
|
77
|
+
'400': css({
|
|
78
|
+
gap: "var(--ds-space-400, 32px)"
|
|
79
|
+
}),
|
|
80
|
+
'500': css({
|
|
81
|
+
gap: "var(--ds-space-500, 40px)"
|
|
82
|
+
}),
|
|
83
|
+
'600': css({
|
|
84
|
+
gap: "var(--ds-space-600, 48px)"
|
|
85
|
+
}),
|
|
86
|
+
'800': css({
|
|
87
|
+
gap: "var(--ds-space-800, 64px)"
|
|
88
|
+
})
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* @codegenEnd
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
const baseStyles = css({
|
|
95
|
+
display: 'flex',
|
|
96
|
+
boxSizing: 'border-box',
|
|
97
|
+
flexDirection: 'column'
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* __Stack__
|
|
102
|
+
*
|
|
103
|
+
* Stack is a primitive component based on flexbox that manages the vertical layout of direct children.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```tsx
|
|
107
|
+
* <Stack>
|
|
108
|
+
* <Box padding="space.100" backgroundColor="neutral"></Box>
|
|
109
|
+
* <Box padding="space.100" backgroundColor="neutral"></Box>
|
|
110
|
+
* </Stack>
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
*/
|
|
114
|
+
const Stack = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
115
|
+
alignInline: alignItems,
|
|
116
|
+
alignBlock,
|
|
117
|
+
spread,
|
|
118
|
+
grow,
|
|
119
|
+
space,
|
|
120
|
+
children,
|
|
121
|
+
testId
|
|
122
|
+
}, ref) => {
|
|
123
|
+
const justifyContent = spread || alignBlock;
|
|
124
|
+
return jsx("div", {
|
|
125
|
+
css: [baseStyles, space && spaceMap[space], alignItems && alignItemsMap[alignItems], grow && flexGrowMap[grow], justifyContent && justifyContentMap[justifyContent]],
|
|
126
|
+
"data-testid": testId,
|
|
127
|
+
ref: ref
|
|
128
|
+
}, children);
|
|
129
|
+
}));
|
|
130
|
+
Stack.displayName = 'Stack';
|
|
131
|
+
export default Stack;
|
package/dist/es2019/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { Stack } from './components/stack.partial';
|
|
1
|
+
export { default as Stack } from './components/stack.partial';
|
|
2
2
|
export { Box } from './components/box';
|
|
3
|
-
export { Inline } from './components/inline.partial';
|
|
3
|
+
export { default as Inline } from './components/inline.partial';
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,2 +1,159 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { Children, forwardRef, Fragment, memo } from 'react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
|
+
var alignItemsMap = {
|
|
5
|
+
center: css({
|
|
6
|
+
alignItems: 'center'
|
|
7
|
+
}),
|
|
8
|
+
baseline: css({
|
|
9
|
+
alignItems: 'baseline'
|
|
10
|
+
}),
|
|
11
|
+
start: css({
|
|
12
|
+
alignItems: 'flex-start'
|
|
13
|
+
}),
|
|
14
|
+
end: css({
|
|
15
|
+
alignItems: 'flex-end'
|
|
16
|
+
})
|
|
17
|
+
};
|
|
18
|
+
var justifyContentMap = {
|
|
19
|
+
start: css({
|
|
20
|
+
justifyContent: 'flex-start'
|
|
21
|
+
}),
|
|
22
|
+
center: css({
|
|
23
|
+
justifyContent: 'center'
|
|
24
|
+
}),
|
|
25
|
+
end: css({
|
|
26
|
+
justifyContent: 'flex-end'
|
|
27
|
+
}),
|
|
28
|
+
'space-between': css({
|
|
29
|
+
justifyContent: 'space-between'
|
|
30
|
+
})
|
|
31
|
+
};
|
|
32
|
+
var flexGrowMap = {
|
|
33
|
+
hug: css({
|
|
34
|
+
flexGrow: 0
|
|
35
|
+
}),
|
|
36
|
+
fill: css({
|
|
37
|
+
flexGrow: 1
|
|
38
|
+
})
|
|
39
|
+
};
|
|
40
|
+
var flexWrapStyles = css({
|
|
41
|
+
flexWrap: 'wrap'
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
46
|
+
* @codegen <<SignedSource::e0d436d3312290a98dbfd91d90dd6b9e>>
|
|
47
|
+
* @codegenId spacing
|
|
48
|
+
* @codegenCommand yarn codegen-styles
|
|
49
|
+
* @codegenParams ["space"]
|
|
50
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
51
|
+
*/
|
|
52
|
+
var spaceMap = {
|
|
53
|
+
'0': css({
|
|
54
|
+
gap: "var(--ds-space-0, 0px)"
|
|
55
|
+
}),
|
|
56
|
+
'025': css({
|
|
57
|
+
gap: "var(--ds-space-025, 2px)"
|
|
58
|
+
}),
|
|
59
|
+
'050': css({
|
|
60
|
+
gap: "var(--ds-space-050, 4px)"
|
|
61
|
+
}),
|
|
62
|
+
'075': css({
|
|
63
|
+
gap: "var(--ds-space-075, 6px)"
|
|
64
|
+
}),
|
|
65
|
+
'100': css({
|
|
66
|
+
gap: "var(--ds-space-100, 8px)"
|
|
67
|
+
}),
|
|
68
|
+
'1000': css({
|
|
69
|
+
gap: "var(--ds-space-1000, 80px)"
|
|
70
|
+
}),
|
|
71
|
+
'150': css({
|
|
72
|
+
gap: "var(--ds-space-150, 12px)"
|
|
73
|
+
}),
|
|
74
|
+
'200': css({
|
|
75
|
+
gap: "var(--ds-space-200, 16px)"
|
|
76
|
+
}),
|
|
77
|
+
'250': css({
|
|
78
|
+
gap: "var(--ds-space-250, 20px)"
|
|
79
|
+
}),
|
|
80
|
+
'300': css({
|
|
81
|
+
gap: "var(--ds-space-300, 24px)"
|
|
82
|
+
}),
|
|
83
|
+
'400': css({
|
|
84
|
+
gap: "var(--ds-space-400, 32px)"
|
|
85
|
+
}),
|
|
86
|
+
'500': css({
|
|
87
|
+
gap: "var(--ds-space-500, 40px)"
|
|
88
|
+
}),
|
|
89
|
+
'600': css({
|
|
90
|
+
gap: "var(--ds-space-600, 48px)"
|
|
91
|
+
}),
|
|
92
|
+
'800': css({
|
|
93
|
+
gap: "var(--ds-space-800, 64px)"
|
|
94
|
+
})
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* @codegenEnd
|
|
98
|
+
*/
|
|
99
|
+
|
|
100
|
+
var baseStyles = css({
|
|
101
|
+
display: 'flex',
|
|
102
|
+
boxSizing: 'border-box',
|
|
103
|
+
flexDirection: 'row'
|
|
104
|
+
});
|
|
105
|
+
var separatorStyles = css({
|
|
106
|
+
color: "var(--ds-text-subtle, #42526E)",
|
|
107
|
+
marginBlock: "var(--ds-space-0, 0px)",
|
|
108
|
+
marginInline: "-".concat("var(--ds-space-025, 2px)"),
|
|
109
|
+
pointerEvents: 'none',
|
|
110
|
+
userSelect: 'none'
|
|
111
|
+
});
|
|
112
|
+
var Separator = function Separator(_ref) {
|
|
113
|
+
var children = _ref.children;
|
|
114
|
+
return jsx("span", {
|
|
115
|
+
css: separatorStyles
|
|
116
|
+
}, children);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* __Inline__
|
|
121
|
+
*
|
|
122
|
+
* Inline is a primitive component based on flexbox that manages the horizontal layout of direct children.
|
|
123
|
+
*
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```tsx
|
|
127
|
+
* <Inline>
|
|
128
|
+
* <Box padding="space.100" backgroundColor="neutral"></Box>
|
|
129
|
+
* <Box padding="space.100" backgroundColor="neutral"></Box>
|
|
130
|
+
* </Inline>
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
133
|
+
*/
|
|
134
|
+
var Inline = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
135
|
+
var alignInline = _ref2.alignInline,
|
|
136
|
+
alignItems = _ref2.alignBlock,
|
|
137
|
+
_ref2$shouldWrap = _ref2.shouldWrap,
|
|
138
|
+
shouldWrap = _ref2$shouldWrap === void 0 ? false : _ref2$shouldWrap,
|
|
139
|
+
spread = _ref2.spread,
|
|
140
|
+
grow = _ref2.grow,
|
|
141
|
+
space = _ref2.space,
|
|
142
|
+
separator = _ref2.separator,
|
|
143
|
+
testId = _ref2.testId,
|
|
144
|
+
rawChildren = _ref2.children;
|
|
145
|
+
var separatorComponent = typeof separator === 'string' ? jsx(Separator, null, separator) : separator;
|
|
146
|
+
var children = separatorComponent ? Children.toArray(rawChildren).filter(Boolean).map(function (child, index) {
|
|
147
|
+
return jsx(Fragment, {
|
|
148
|
+
key: index
|
|
149
|
+
}, separator && index > 0 ? separatorComponent : null, child);
|
|
150
|
+
}) : rawChildren;
|
|
151
|
+
var justifyContent = spread || alignInline;
|
|
152
|
+
return jsx("div", {
|
|
153
|
+
css: [baseStyles, space && spaceMap[space], justifyContent && justifyContentMap[justifyContent], grow && flexGrowMap[grow], alignItems && alignItemsMap[alignItems], shouldWrap && flexWrapStyles],
|
|
154
|
+
"data-testid": testId,
|
|
155
|
+
ref: ref
|
|
156
|
+
}, children);
|
|
157
|
+
}));
|
|
158
|
+
Inline.displayName = 'Inline';
|
|
159
|
+
export default Inline;
|
|
@@ -72,28 +72,28 @@ var borderStyleMap = {
|
|
|
72
72
|
})
|
|
73
73
|
};
|
|
74
74
|
var borderWidthMap = {
|
|
75
|
-
'
|
|
76
|
-
borderWidth:
|
|
75
|
+
'size.050': css({
|
|
76
|
+
borderWidth: "var(--ds-width-050, 1px)"
|
|
77
77
|
}),
|
|
78
|
-
'
|
|
79
|
-
borderWidth:
|
|
80
|
-
}),
|
|
81
|
-
'2px': css({
|
|
82
|
-
borderWidth: '2px'
|
|
83
|
-
}),
|
|
84
|
-
'3px': css({
|
|
85
|
-
borderWidth: '3px'
|
|
78
|
+
'size.100': css({
|
|
79
|
+
borderWidth: "var(--ds-width-100, 2px)"
|
|
86
80
|
})
|
|
87
81
|
};
|
|
88
82
|
var borderRadiusMap = {
|
|
89
|
-
|
|
90
|
-
borderRadius:
|
|
83
|
+
'radius.100': css({
|
|
84
|
+
borderRadius: "var(--ds-radius-200, 2px)"
|
|
85
|
+
}),
|
|
86
|
+
'radius.200': css({
|
|
87
|
+
borderRadius: "var(--ds-radius-200, 3px)"
|
|
88
|
+
}),
|
|
89
|
+
'radius.round': css({
|
|
90
|
+
borderRadius: "var(--ds-radius-round, 50%)"
|
|
91
91
|
}),
|
|
92
|
-
|
|
93
|
-
borderRadius:
|
|
92
|
+
'radius.300': css({
|
|
93
|
+
borderRadius: "var(--ds-radius-300, 8px)"
|
|
94
94
|
}),
|
|
95
|
-
|
|
96
|
-
borderRadius:
|
|
95
|
+
'radius.400': css({
|
|
96
|
+
borderRadius: "var(--ds-radius-400, 16px)"
|
|
97
97
|
})
|
|
98
98
|
};
|
|
99
99
|
|
|
@@ -1,2 +1,130 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { forwardRef, memo } from 'react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
|
+
var justifyContentMap = {
|
|
5
|
+
start: css({
|
|
6
|
+
justifyContent: 'start'
|
|
7
|
+
}),
|
|
8
|
+
center: css({
|
|
9
|
+
justifyContent: 'center'
|
|
10
|
+
}),
|
|
11
|
+
end: css({
|
|
12
|
+
justifyContent: 'end'
|
|
13
|
+
}),
|
|
14
|
+
'space-between': css({
|
|
15
|
+
justifyContent: 'space-between'
|
|
16
|
+
})
|
|
17
|
+
};
|
|
18
|
+
var alignItemsMap = {
|
|
19
|
+
start: css({
|
|
20
|
+
alignItems: 'start'
|
|
21
|
+
}),
|
|
22
|
+
center: css({
|
|
23
|
+
alignItems: 'center'
|
|
24
|
+
}),
|
|
25
|
+
end: css({
|
|
26
|
+
alignItems: 'end'
|
|
27
|
+
})
|
|
28
|
+
};
|
|
29
|
+
var flexGrowMap = {
|
|
30
|
+
hug: css({
|
|
31
|
+
flexGrow: 0
|
|
32
|
+
}),
|
|
33
|
+
fill: css({
|
|
34
|
+
flexGrow: 1
|
|
35
|
+
})
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
40
|
+
* @codegen <<SignedSource::e0d436d3312290a98dbfd91d90dd6b9e>>
|
|
41
|
+
* @codegenId spacing
|
|
42
|
+
* @codegenCommand yarn codegen-styles
|
|
43
|
+
* @codegenParams ["space"]
|
|
44
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
45
|
+
*/
|
|
46
|
+
var spaceMap = {
|
|
47
|
+
'0': css({
|
|
48
|
+
gap: "var(--ds-space-0, 0px)"
|
|
49
|
+
}),
|
|
50
|
+
'025': css({
|
|
51
|
+
gap: "var(--ds-space-025, 2px)"
|
|
52
|
+
}),
|
|
53
|
+
'050': css({
|
|
54
|
+
gap: "var(--ds-space-050, 4px)"
|
|
55
|
+
}),
|
|
56
|
+
'075': css({
|
|
57
|
+
gap: "var(--ds-space-075, 6px)"
|
|
58
|
+
}),
|
|
59
|
+
'100': css({
|
|
60
|
+
gap: "var(--ds-space-100, 8px)"
|
|
61
|
+
}),
|
|
62
|
+
'1000': css({
|
|
63
|
+
gap: "var(--ds-space-1000, 80px)"
|
|
64
|
+
}),
|
|
65
|
+
'150': css({
|
|
66
|
+
gap: "var(--ds-space-150, 12px)"
|
|
67
|
+
}),
|
|
68
|
+
'200': css({
|
|
69
|
+
gap: "var(--ds-space-200, 16px)"
|
|
70
|
+
}),
|
|
71
|
+
'250': css({
|
|
72
|
+
gap: "var(--ds-space-250, 20px)"
|
|
73
|
+
}),
|
|
74
|
+
'300': css({
|
|
75
|
+
gap: "var(--ds-space-300, 24px)"
|
|
76
|
+
}),
|
|
77
|
+
'400': css({
|
|
78
|
+
gap: "var(--ds-space-400, 32px)"
|
|
79
|
+
}),
|
|
80
|
+
'500': css({
|
|
81
|
+
gap: "var(--ds-space-500, 40px)"
|
|
82
|
+
}),
|
|
83
|
+
'600': css({
|
|
84
|
+
gap: "var(--ds-space-600, 48px)"
|
|
85
|
+
}),
|
|
86
|
+
'800': css({
|
|
87
|
+
gap: "var(--ds-space-800, 64px)"
|
|
88
|
+
})
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* @codegenEnd
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
var baseStyles = css({
|
|
95
|
+
display: 'flex',
|
|
96
|
+
boxSizing: 'border-box',
|
|
97
|
+
flexDirection: 'column'
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* __Stack__
|
|
102
|
+
*
|
|
103
|
+
* Stack is a primitive component based on flexbox that manages the vertical layout of direct children.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```tsx
|
|
107
|
+
* <Stack>
|
|
108
|
+
* <Box padding="space.100" backgroundColor="neutral"></Box>
|
|
109
|
+
* <Box padding="space.100" backgroundColor="neutral"></Box>
|
|
110
|
+
* </Stack>
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
*/
|
|
114
|
+
var Stack = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
115
|
+
var alignItems = _ref.alignInline,
|
|
116
|
+
alignBlock = _ref.alignBlock,
|
|
117
|
+
spread = _ref.spread,
|
|
118
|
+
grow = _ref.grow,
|
|
119
|
+
space = _ref.space,
|
|
120
|
+
children = _ref.children,
|
|
121
|
+
testId = _ref.testId;
|
|
122
|
+
var justifyContent = spread || alignBlock;
|
|
123
|
+
return jsx("div", {
|
|
124
|
+
css: [baseStyles, space && spaceMap[space], alignItems && alignItemsMap[alignItems], grow && flexGrowMap[grow], justifyContent && justifyContentMap[justifyContent]],
|
|
125
|
+
"data-testid": testId,
|
|
126
|
+
ref: ref
|
|
127
|
+
}, children);
|
|
128
|
+
}));
|
|
129
|
+
Stack.displayName = 'Stack';
|
|
130
|
+
export default Stack;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { Stack } from './components/stack.partial';
|
|
1
|
+
export { default as Stack } from './components/stack.partial';
|
|
2
2
|
export { Box } from './components/box';
|
|
3
|
-
export { Inline } from './components/inline.partial';
|
|
3
|
+
export { default as Inline } from './components/inline.partial';
|
package/dist/esm/version.json
CHANGED
|
@@ -1 +1,86 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export interface InlineProps {
|
|
4
|
+
/**
|
|
5
|
+
* Used to align children along the main axis.
|
|
6
|
+
*/
|
|
7
|
+
alignBlock?: AlignBlock;
|
|
8
|
+
/**
|
|
9
|
+
* Used to align children along the cross axis.
|
|
10
|
+
*/
|
|
11
|
+
alignInline?: AlignInline;
|
|
12
|
+
/**
|
|
13
|
+
* Used to set whether children are forced onto one line or will wrap onto multiple lines.
|
|
14
|
+
*/
|
|
15
|
+
shouldWrap?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Used to distribute the children along the main axis.
|
|
18
|
+
*/
|
|
19
|
+
spread?: Spread;
|
|
20
|
+
/**
|
|
21
|
+
* Used to set whether the content should grow to fill the available space.
|
|
22
|
+
*/
|
|
23
|
+
grow?: Grow;
|
|
24
|
+
/**
|
|
25
|
+
* Represents the space between each child.
|
|
26
|
+
*/
|
|
27
|
+
space?: Space;
|
|
28
|
+
/**
|
|
29
|
+
* Renders a separator string between each child.
|
|
30
|
+
*/
|
|
31
|
+
separator?: string;
|
|
32
|
+
/**
|
|
33
|
+
* A unique string that appears as data attribute data-testid in the rendered code, serving as a hook for automated tests.
|
|
34
|
+
*/
|
|
35
|
+
testId?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Elements to be rendered inside the Stack.
|
|
38
|
+
*/
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
}
|
|
41
|
+
export declare type AlignInline = 'start' | 'center' | 'end';
|
|
42
|
+
export declare type AlignBlock = 'start' | 'center' | 'end' | 'baseline';
|
|
43
|
+
export declare type Spread = 'space-between';
|
|
44
|
+
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::e0d436d3312290a98dbfd91d90dd6b9e>>
|
|
48
|
+
* @codegenId spacing
|
|
49
|
+
* @codegenCommand yarn codegen-styles
|
|
50
|
+
* @codegenParams ["space"]
|
|
51
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
52
|
+
*/
|
|
53
|
+
declare const spaceMap: {
|
|
54
|
+
'0': import("@emotion/react").SerializedStyles;
|
|
55
|
+
'025': import("@emotion/react").SerializedStyles;
|
|
56
|
+
'050': import("@emotion/react").SerializedStyles;
|
|
57
|
+
'075': import("@emotion/react").SerializedStyles;
|
|
58
|
+
'100': import("@emotion/react").SerializedStyles;
|
|
59
|
+
'1000': import("@emotion/react").SerializedStyles;
|
|
60
|
+
'150': import("@emotion/react").SerializedStyles;
|
|
61
|
+
'200': import("@emotion/react").SerializedStyles;
|
|
62
|
+
'250': import("@emotion/react").SerializedStyles;
|
|
63
|
+
'300': import("@emotion/react").SerializedStyles;
|
|
64
|
+
'400': import("@emotion/react").SerializedStyles;
|
|
65
|
+
'500': import("@emotion/react").SerializedStyles;
|
|
66
|
+
'600': import("@emotion/react").SerializedStyles;
|
|
67
|
+
'800': import("@emotion/react").SerializedStyles;
|
|
68
|
+
};
|
|
69
|
+
export declare type Space = keyof typeof spaceMap;
|
|
70
|
+
/**
|
|
71
|
+
* __Inline__
|
|
72
|
+
*
|
|
73
|
+
* Inline is a primitive component based on flexbox that manages the horizontal layout of direct children.
|
|
74
|
+
*
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```tsx
|
|
78
|
+
* <Inline>
|
|
79
|
+
* <Box padding="space.100" backgroundColor="neutral"></Box>
|
|
80
|
+
* <Box padding="space.100" backgroundColor="neutral"></Box>
|
|
81
|
+
* </Inline>
|
|
82
|
+
* ```
|
|
83
|
+
*
|
|
84
|
+
*/
|
|
85
|
+
declare const Inline: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<InlineProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
86
|
+
export default Inline;
|
|
@@ -126,16 +126,16 @@ declare const borderStyleMap: {
|
|
|
126
126
|
};
|
|
127
127
|
declare type BorderWidth = keyof typeof borderWidthMap;
|
|
128
128
|
declare const borderWidthMap: {
|
|
129
|
-
'
|
|
130
|
-
'
|
|
131
|
-
'2px': import("@emotion/react").SerializedStyles;
|
|
132
|
-
'3px': import("@emotion/react").SerializedStyles;
|
|
129
|
+
'size.050': import("@emotion/react").SerializedStyles;
|
|
130
|
+
'size.100': import("@emotion/react").SerializedStyles;
|
|
133
131
|
};
|
|
134
132
|
declare type BorderRadius = keyof typeof borderRadiusMap;
|
|
135
133
|
declare const borderRadiusMap: {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
134
|
+
'radius.100': import("@emotion/react").SerializedStyles;
|
|
135
|
+
'radius.200': import("@emotion/react").SerializedStyles;
|
|
136
|
+
'radius.round': import("@emotion/react").SerializedStyles;
|
|
137
|
+
'radius.300': import("@emotion/react").SerializedStyles;
|
|
138
|
+
'radius.400': import("@emotion/react").SerializedStyles;
|
|
139
139
|
};
|
|
140
140
|
/**
|
|
141
141
|
* @experimental - this is likely to be removed
|
|
@@ -1 +1,77 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export interface StackProps {
|
|
4
|
+
/**
|
|
5
|
+
* Used to align children along the main axis.
|
|
6
|
+
*/
|
|
7
|
+
alignBlock?: AlignBlock;
|
|
8
|
+
/**
|
|
9
|
+
* Used to align children along the cross axis.
|
|
10
|
+
*/
|
|
11
|
+
alignInline?: AlignInline;
|
|
12
|
+
/**
|
|
13
|
+
* Used to distribute the children along the main axis.
|
|
14
|
+
*/
|
|
15
|
+
spread?: Spread;
|
|
16
|
+
/**
|
|
17
|
+
* Used to set whether the content should grow to fill the available space.
|
|
18
|
+
*/
|
|
19
|
+
grow?: Grow;
|
|
20
|
+
/**
|
|
21
|
+
* Represents the space between each child.
|
|
22
|
+
*/
|
|
23
|
+
space?: Space;
|
|
24
|
+
/**
|
|
25
|
+
* A unique string that appears as data attribute data-testid in the rendered code, serving as a hook for automated tests.
|
|
26
|
+
*/
|
|
27
|
+
testId?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Elements to be rendered inside the Stack.
|
|
30
|
+
*/
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
}
|
|
33
|
+
export declare type AlignInline = 'start' | 'center' | 'end';
|
|
34
|
+
export declare type AlignBlock = 'start' | 'center' | 'end';
|
|
35
|
+
export declare type Spread = 'space-between';
|
|
36
|
+
export declare type Grow = 'hug' | 'fill';
|
|
37
|
+
/**
|
|
38
|
+
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
39
|
+
* @codegen <<SignedSource::e0d436d3312290a98dbfd91d90dd6b9e>>
|
|
40
|
+
* @codegenId spacing
|
|
41
|
+
* @codegenCommand yarn codegen-styles
|
|
42
|
+
* @codegenParams ["space"]
|
|
43
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
44
|
+
*/
|
|
45
|
+
declare const spaceMap: {
|
|
46
|
+
'0': import("@emotion/react").SerializedStyles;
|
|
47
|
+
'025': import("@emotion/react").SerializedStyles;
|
|
48
|
+
'050': import("@emotion/react").SerializedStyles;
|
|
49
|
+
'075': import("@emotion/react").SerializedStyles;
|
|
50
|
+
'100': import("@emotion/react").SerializedStyles;
|
|
51
|
+
'1000': import("@emotion/react").SerializedStyles;
|
|
52
|
+
'150': import("@emotion/react").SerializedStyles;
|
|
53
|
+
'200': import("@emotion/react").SerializedStyles;
|
|
54
|
+
'250': import("@emotion/react").SerializedStyles;
|
|
55
|
+
'300': import("@emotion/react").SerializedStyles;
|
|
56
|
+
'400': import("@emotion/react").SerializedStyles;
|
|
57
|
+
'500': import("@emotion/react").SerializedStyles;
|
|
58
|
+
'600': import("@emotion/react").SerializedStyles;
|
|
59
|
+
'800': import("@emotion/react").SerializedStyles;
|
|
60
|
+
};
|
|
61
|
+
export declare type Space = keyof typeof spaceMap;
|
|
62
|
+
/**
|
|
63
|
+
* __Stack__
|
|
64
|
+
*
|
|
65
|
+
* Stack is a primitive component based on flexbox that manages the vertical layout of direct children.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```tsx
|
|
69
|
+
* <Stack>
|
|
70
|
+
* <Box padding="space.100" backgroundColor="neutral"></Box>
|
|
71
|
+
* <Box padding="space.100" backgroundColor="neutral"></Box>
|
|
72
|
+
* </Stack>
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
*/
|
|
76
|
+
declare const Stack: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<StackProps & import("react").RefAttributes<HTMLDivElement>>>;
|
|
77
|
+
export default Stack;
|