@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.
Files changed (40) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/constellation/accessibility/examples.mdx +9 -0
  3. package/constellation/box/code.mdx +9 -0
  4. package/constellation/box/examples.mdx +9 -0
  5. package/constellation/overview/examples.mdx +9 -0
  6. package/dist/cjs/components/{inline.partial.js → inline.js} +2 -34
  7. package/dist/cjs/components/stack.js +86 -0
  8. package/dist/cjs/index.js +2 -2
  9. package/dist/cjs/internal/style-maps.partial.js +34 -6
  10. package/dist/cjs/internal/xcss.js +5 -9
  11. package/dist/cjs/version.json +1 -1
  12. package/dist/es2019/components/{inline.partial.js → inline.js} +2 -58
  13. package/dist/es2019/components/stack.js +79 -0
  14. package/dist/es2019/index.js +2 -2
  15. package/dist/es2019/internal/style-maps.partial.js +30 -5
  16. package/dist/es2019/internal/xcss.js +5 -8
  17. package/dist/es2019/version.json +1 -1
  18. package/dist/esm/components/{inline.partial.js → inline.js} +2 -33
  19. package/dist/esm/components/stack.js +78 -0
  20. package/dist/esm/index.js +2 -2
  21. package/dist/esm/internal/style-maps.partial.js +30 -5
  22. package/dist/esm/internal/xcss.js +5 -8
  23. package/dist/esm/version.json +1 -1
  24. package/dist/types/components/{inline.partial.d.ts → inline.d.ts} +1 -28
  25. package/dist/types/components/{stack.partial.d.ts → stack.d.ts} +1 -27
  26. package/dist/types/index.d.ts +2 -2
  27. package/dist/types/internal/style-maps.partial.d.ts +31 -5
  28. package/dist/types/internal/xcss.d.ts +1 -6
  29. package/inline/package.json +5 -5
  30. package/package.json +35 -9
  31. package/report.api.md +31 -47
  32. package/scripts/codegen-file-templates/flex-direction.tsx +6 -0
  33. package/scripts/codegen-styles.tsx +70 -71
  34. package/scripts/misc-codegen-template.tsx +1 -0
  35. package/scripts/spacing-codegen-template.tsx +1 -6
  36. package/stack/package.json +5 -5
  37. package/tmp/api-report-tmp.d.ts +31 -47
  38. package/dist/cjs/components/stack.partial.js +0 -118
  39. package/dist/es2019/components/stack.partial.js +0 -135
  40. package/dist/esm/components/stack.partial.js +0 -109
@@ -1,135 +0,0 @@
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
- const justifyContentMap = {
6
- start: css({
7
- justifyContent: 'start'
8
- }),
9
- center: css({
10
- justifyContent: 'center'
11
- }),
12
- end: css({
13
- justifyContent: 'end'
14
- }),
15
- 'space-between': css({
16
- justifyContent: 'space-between'
17
- })
18
- };
19
- const alignItemsMap = {
20
- start: css({
21
- alignItems: 'start'
22
- }),
23
- center: css({
24
- alignItems: 'center'
25
- }),
26
- end: css({
27
- alignItems: 'end'
28
- })
29
- };
30
- const flexGrowMap = {
31
- hug: css({
32
- flexGrow: 0
33
- }),
34
- fill: css({
35
- width: '100%',
36
- flexGrow: 1
37
- })
38
- };
39
-
40
- /**
41
- * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
42
- * @codegen <<SignedSource::4eb2c996d6ce5791acad51e2b226635f>>
43
- * @codegenId spacing
44
- * @codegenCommand yarn codegen-styles
45
- * @codegenParams ["stackSpace"]
46
- * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
47
- */
48
- const stackSpaceMap = Object.fromEntries(['gap'].map(property => [property, {
49
- '0': css({
50
- [property]: "var(--ds-space-0, 0px)"
51
- }),
52
- '025': css({
53
- [property]: "var(--ds-space-025, 2px)"
54
- }),
55
- '050': css({
56
- [property]: "var(--ds-space-050, 4px)"
57
- }),
58
- '075': css({
59
- [property]: "var(--ds-space-075, 6px)"
60
- }),
61
- '100': css({
62
- [property]: "var(--ds-space-100, 8px)"
63
- }),
64
- '150': css({
65
- [property]: "var(--ds-space-150, 12px)"
66
- }),
67
- '200': css({
68
- [property]: "var(--ds-space-200, 16px)"
69
- }),
70
- '250': css({
71
- [property]: "var(--ds-space-250, 20px)"
72
- }),
73
- '300': css({
74
- [property]: "var(--ds-space-300, 24px)"
75
- }),
76
- '400': css({
77
- [property]: "var(--ds-space-400, 32px)"
78
- }),
79
- '500': css({
80
- [property]: "var(--ds-space-500, 40px)"
81
- }),
82
- '600': css({
83
- [property]: "var(--ds-space-600, 48px)"
84
- }),
85
- '800': css({
86
- [property]: "var(--ds-space-800, 64px)"
87
- }),
88
- '1000': css({
89
- [property]: "var(--ds-space-1000, 80px)"
90
- })
91
- }]));
92
- /**
93
- * @codegenEnd
94
- */
95
-
96
- const baseStyles = css({
97
- display: 'flex',
98
- boxSizing: 'border-box',
99
- flexDirection: 'column'
100
- });
101
-
102
- /**
103
- * __Stack__
104
- *
105
- * Stack is a primitive component based on flexbox that manages the vertical layout of direct children.
106
- *
107
- * @example
108
- * ```tsx
109
- * <Stack>
110
- * <Box padding="space.100" backgroundColor="neutral"></Box>
111
- * <Box padding="space.100" backgroundColor="neutral"></Box>
112
- * </Stack>
113
- * ```
114
- *
115
- */
116
- const Stack = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
117
- as,
118
- alignInline: alignItems,
119
- alignBlock,
120
- spread,
121
- grow,
122
- space,
123
- children,
124
- testId
125
- }, ref) => {
126
- const Component = as || 'div';
127
- const justifyContent = spread || alignBlock;
128
- return jsx(Component, {
129
- css: [baseStyles, space && stackSpaceMap.gap[space], alignItems && alignItemsMap[alignItems], grow && flexGrowMap[grow], justifyContent && justifyContentMap[justifyContent]],
130
- "data-testid": testId,
131
- ref: ref
132
- }, children);
133
- }));
134
- Stack.displayName = 'Stack';
135
- export default Stack;
@@ -1,109 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- /* eslint-disable @repo/internal/styles/no-exported-styles */
3
- /** @jsx jsx */
4
- import { forwardRef, memo } from 'react';
5
- import { css, jsx } from '@emotion/react';
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
-
41
- /**
42
- * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
43
- * @codegen <<SignedSource::4eb2c996d6ce5791acad51e2b226635f>>
44
- * @codegenId spacing
45
- * @codegenCommand yarn codegen-styles
46
- * @codegenParams ["stackSpace"]
47
- * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
48
- */
49
- var stackSpaceMap = Object.fromEntries(['gap'].map(function (property) {
50
- return [property, {
51
- '0': css(_defineProperty({}, property, "var(--ds-space-0, 0px)")),
52
- '025': css(_defineProperty({}, property, "var(--ds-space-025, 2px)")),
53
- '050': css(_defineProperty({}, property, "var(--ds-space-050, 4px)")),
54
- '075': css(_defineProperty({}, property, "var(--ds-space-075, 6px)")),
55
- '100': css(_defineProperty({}, property, "var(--ds-space-100, 8px)")),
56
- '150': css(_defineProperty({}, property, "var(--ds-space-150, 12px)")),
57
- '200': css(_defineProperty({}, property, "var(--ds-space-200, 16px)")),
58
- '250': css(_defineProperty({}, property, "var(--ds-space-250, 20px)")),
59
- '300': css(_defineProperty({}, property, "var(--ds-space-300, 24px)")),
60
- '400': css(_defineProperty({}, property, "var(--ds-space-400, 32px)")),
61
- '500': css(_defineProperty({}, property, "var(--ds-space-500, 40px)")),
62
- '600': css(_defineProperty({}, property, "var(--ds-space-600, 48px)")),
63
- '800': css(_defineProperty({}, property, "var(--ds-space-800, 64px)")),
64
- '1000': css(_defineProperty({}, property, "var(--ds-space-1000, 80px)"))
65
- }];
66
- }));
67
- /**
68
- * @codegenEnd
69
- */
70
-
71
- var baseStyles = css({
72
- display: 'flex',
73
- boxSizing: 'border-box',
74
- flexDirection: 'column'
75
- });
76
-
77
- /**
78
- * __Stack__
79
- *
80
- * Stack is a primitive component based on flexbox that manages the vertical layout of direct children.
81
- *
82
- * @example
83
- * ```tsx
84
- * <Stack>
85
- * <Box padding="space.100" backgroundColor="neutral"></Box>
86
- * <Box padding="space.100" backgroundColor="neutral"></Box>
87
- * </Stack>
88
- * ```
89
- *
90
- */
91
- var Stack = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref) {
92
- var as = _ref.as,
93
- alignItems = _ref.alignInline,
94
- alignBlock = _ref.alignBlock,
95
- spread = _ref.spread,
96
- grow = _ref.grow,
97
- space = _ref.space,
98
- children = _ref.children,
99
- testId = _ref.testId;
100
- var Component = as || 'div';
101
- var justifyContent = spread || alignBlock;
102
- return jsx(Component, {
103
- css: [baseStyles, space && stackSpaceMap.gap[space], alignItems && alignItemsMap[alignItems], grow && flexGrowMap[grow], justifyContent && justifyContentMap[justifyContent]],
104
- "data-testid": testId,
105
- ref: ref
106
- }, children);
107
- }));
108
- Stack.displayName = 'Stack';
109
- export default Stack;