@atlaskit/ds-explorations 2.4.0 → 3.0.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 (60) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/index.js +0 -21
  3. package/dist/es2019/index.js +0 -3
  4. package/dist/esm/index.js +0 -3
  5. package/dist/types/components/surface-provider.d.ts +2 -2
  6. package/dist/types/index.d.ts +0 -6
  7. package/dist/types-ts4.5/components/surface-provider.d.ts +2 -2
  8. package/dist/types-ts4.5/index.d.ts +0 -6
  9. package/examples/02-text-advanced.tsx +11 -20
  10. package/examples/02-text.tsx +15 -10
  11. package/examples/06-section-message.tsx +2 -4
  12. package/examples/07-comment.tsx +1 -3
  13. package/examples/08-lozenge.tsx +8 -4
  14. package/examples/99-interactions.tsx +49 -33
  15. package/package.json +3 -5
  16. package/report.api.md +0 -465
  17. package/scripts/codegen-styles.tsx +16 -89
  18. package/src/components/__tests__/unit/interaction-suface.test.tsx +2 -2
  19. package/src/components/surface-provider.tsx +1 -1
  20. package/src/index.tsx +0 -6
  21. package/tmp/api-report-tmp.d.ts +0 -451
  22. package/tsconfig.app.json +3 -0
  23. package/tsconfig.dev.json +0 -9
  24. package/box/package.json +0 -15
  25. package/dist/cjs/components/box.partial.js +0 -620
  26. package/dist/cjs/components/inline.partial.js +0 -182
  27. package/dist/cjs/components/stack.partial.js +0 -148
  28. package/dist/es2019/components/box.partial.js +0 -614
  29. package/dist/es2019/components/inline.partial.js +0 -177
  30. package/dist/es2019/components/stack.partial.js +0 -144
  31. package/dist/esm/components/box.partial.js +0 -617
  32. package/dist/esm/components/inline.partial.js +0 -177
  33. package/dist/esm/components/stack.partial.js +0 -143
  34. package/dist/types/components/box.partial.d.ts +0 -357
  35. package/dist/types/components/inline.partial.d.ts +0 -108
  36. package/dist/types/components/stack.partial.d.ts +0 -92
  37. package/dist/types-ts4.5/components/box.partial.d.ts +0 -357
  38. package/dist/types-ts4.5/components/inline.partial.d.ts +0 -108
  39. package/dist/types-ts4.5/components/stack.partial.d.ts +0 -92
  40. package/examples/00-basic.tsx +0 -22
  41. package/examples/01-box.tsx +0 -171
  42. package/examples/03-stack.tsx +0 -99
  43. package/examples/04-inline.tsx +0 -99
  44. package/examples/05-badge.tsx +0 -23
  45. package/inline/package.json +0 -15
  46. package/src/components/__tests__/unit/box.test.tsx +0 -55
  47. package/src/components/__tests__/unit/inline.test.tsx +0 -43
  48. package/src/components/__tests__/unit/stack.test.tsx +0 -31
  49. package/src/components/__tests__/visual-regression/__image_snapshots__/inline-snapshot-test-tsx-inline-alignment-example-should-match-snapshot-1-snap.png +0 -3
  50. package/src/components/__tests__/visual-regression/__image_snapshots__/inline-snapshot-test-tsx-inline-spacing-example-should-match-snapshot-1-snap.png +0 -3
  51. package/src/components/__tests__/visual-regression/__image_snapshots__/stack-snapshot-test-tsx-stack-alignment-example-should-match-snapshot-1-snap.png +0 -3
  52. package/src/components/__tests__/visual-regression/__image_snapshots__/stack-snapshot-test-tsx-stack-spacing-example-should-match-snapshot-1-snap.png +0 -3
  53. package/src/components/__tests__/visual-regression/inline-snapshot-test.tsx +0 -28
  54. package/src/components/__tests__/visual-regression/stack-snapshot-test.tsx +0 -28
  55. package/src/components/__tests__/vr-tests/__snapshots__/box--default.png +0 -0
  56. package/src/components/__tests__/vr-tests/box-snapshot-test.vr.tsx +0 -6
  57. package/src/components/box.partial.tsx +0 -706
  58. package/src/components/inline.partial.tsx +0 -218
  59. package/src/components/stack.partial.tsx +0 -174
  60. package/stack/package.json +0 -15
@@ -1,218 +0,0 @@
1
- /** @jsx jsx */
2
- import { Children, FC, forwardRef, Fragment, memo, ReactNode } from 'react';
3
-
4
- import { css, jsx } from '@emotion/react';
5
-
6
- import { token } from '@atlaskit/tokens';
7
-
8
- import type { BasePrimitiveProps } from './types';
9
-
10
- /**
11
- * @private
12
- * @deprecated DSP-8009: This type is scheduled for deletion.
13
- * Please use `Inline` from `@atlaskit/primitives` instead.
14
- */
15
- export interface InlineProps extends BasePrimitiveProps {
16
- /**
17
- * Used to align children along the cross axis.
18
- */
19
- alignItems?: FlexAlignItems;
20
- /**
21
- * Used to align children along the main axis.
22
- */
23
- justifyContent?: FlexJustifyContent;
24
- /**
25
- * Sets whether children are forced onto one line or can wrap onto multiple lines
26
- */
27
- flexWrap?: FlexWrap;
28
- /**
29
- * Token representing gap between children.
30
- */
31
- gap: ColumnGap;
32
- /**
33
- * Renders a divider between children.
34
- * If a string is provided it will automatically be wrapped in a `<Text>` component.
35
- */
36
- divider?: ReactNode;
37
- /**
38
- * Elements to be rendered inside the Inline.
39
- */
40
- children: ReactNode;
41
- }
42
-
43
- type FlexAlignItems = keyof typeof flexAlignItemsMap;
44
- const flexAlignItemsMap = {
45
- center: css({ alignItems: 'center' }),
46
- baseline: css({ alignItems: 'baseline' }),
47
- flexStart: css({ alignItems: 'flex-start' }),
48
- flexEnd: css({ alignItems: 'flex-end' }),
49
- start: css({ alignItems: 'start' }),
50
- end: css({ alignItems: 'end' }),
51
- };
52
-
53
- type FlexJustifyContent = keyof typeof flexJustifyContentMap;
54
- const flexJustifyContentMap = {
55
- center: css({ justifyContent: 'center' }),
56
- flexStart: css({ justifyContent: 'flex-start' }),
57
- 'space-between': css({ justifyContent: 'space-between' }),
58
- flexEnd: css({ justifyContent: 'flex-end' }),
59
- start: css({ justifyContent: 'start' }),
60
- end: css({ justifyContent: 'end' }),
61
- spaceBetween: css({ justifyContent: 'space-between' }),
62
- };
63
-
64
- type FlexWrap = keyof typeof flexWrapMap;
65
- const flexWrapMap = {
66
- wrap: css({ flexWrap: 'wrap' }),
67
- };
68
-
69
- const baseStyles = css({
70
- display: 'flex',
71
- boxSizing: 'border-box',
72
- flexDirection: 'row',
73
- });
74
-
75
- const dividerStyles = css({
76
- margin: `0 ${token('space.negative.025', '-2px')}`,
77
- color: token('color.text.subtle', '#42526E'),
78
- pointerEvents: 'none',
79
- userSelect: 'none',
80
- });
81
-
82
- const Divider: FC<{ children: string }> = ({ children }) => (
83
- <span css={dividerStyles}>{children}</span>
84
- );
85
-
86
- /**
87
- * __Inline__
88
- *
89
- * Inline is a primitive component based on flexbox that manages the horizontal layout of direct children.
90
- * Renders a `div` by default.
91
- *
92
- * @private
93
- * @deprecated DSP-8009: This primitive is scheduled for deletion.
94
- * Please use `Inline` from `@atlaskit/primitives` instead.
95
- *
96
- * @example
97
- * ```tsx
98
- * const App = () => (
99
- * <Inline gap="space.100">
100
- * <Button />
101
- * <Button />
102
- * </Inline>
103
- * )
104
- * ```
105
- */
106
- const Inline = memo(
107
- forwardRef<HTMLDivElement, InlineProps>(
108
- (
109
- {
110
- gap,
111
- alignItems,
112
- justifyContent,
113
- flexWrap,
114
- divider,
115
- UNSAFE_style,
116
- children: rawChildren,
117
- testId,
118
- },
119
- ref,
120
- ) => {
121
- const dividerComponent =
122
- typeof divider === 'string' ? <Divider>{divider}</Divider> : divider;
123
-
124
- const children = divider
125
- ? Children.toArray(rawChildren)
126
- .filter(Boolean)
127
- .map((child, index) => {
128
- return (
129
- <Fragment key={index}>
130
- {divider && index > 0 ? dividerComponent : null}
131
- {child}
132
- </Fragment>
133
- );
134
- })
135
- : rawChildren;
136
-
137
- return (
138
- <div
139
- style={UNSAFE_style}
140
- css={[
141
- baseStyles,
142
- gap && columnGapMap[gap],
143
- alignItems && flexAlignItemsMap[alignItems],
144
- justifyContent && flexJustifyContentMap[justifyContent],
145
- flexWrap && flexWrapMap[flexWrap],
146
- ]}
147
- data-testid={testId}
148
- ref={ref}
149
- >
150
- {children}
151
- </div>
152
- );
153
- },
154
- ),
155
- );
156
-
157
- Inline.displayName = 'Inline';
158
-
159
- export default Inline;
160
-
161
- /**
162
- * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
163
- * @codegen <<SignedSource::63747c8b92ba373ad2259fa1fff3f434>>
164
- * @codegenId spacing
165
- * @codegenCommand yarn codegen-styles
166
- * @codegenParams ["columnGap"]
167
- * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::298080e8024fb3eb37589721413e0156>>
168
- */
169
- const columnGapMap = {
170
- 'space.0': css({
171
- columnGap: token('space.0', '0px'),
172
- }),
173
- 'space.025': css({
174
- columnGap: token('space.025', '2px'),
175
- }),
176
- 'space.050': css({
177
- columnGap: token('space.050', '4px'),
178
- }),
179
- 'space.075': css({
180
- columnGap: token('space.075', '6px'),
181
- }),
182
- 'space.100': css({
183
- columnGap: token('space.100', '8px'),
184
- }),
185
- 'space.1000': css({
186
- columnGap: token('space.1000', '80px'),
187
- }),
188
- 'space.150': css({
189
- columnGap: token('space.150', '12px'),
190
- }),
191
- 'space.200': css({
192
- columnGap: token('space.200', '16px'),
193
- }),
194
- 'space.250': css({
195
- columnGap: token('space.250', '20px'),
196
- }),
197
- 'space.300': css({
198
- columnGap: token('space.300', '24px'),
199
- }),
200
- 'space.400': css({
201
- columnGap: token('space.400', '32px'),
202
- }),
203
- 'space.500': css({
204
- columnGap: token('space.500', '40px'),
205
- }),
206
- 'space.600': css({
207
- columnGap: token('space.600', '48px'),
208
- }),
209
- 'space.800': css({
210
- columnGap: token('space.800', '64px'),
211
- }),
212
- };
213
-
214
- export type ColumnGap = keyof typeof columnGapMap;
215
-
216
- /**
217
- * @codegenEnd
218
- */
@@ -1,174 +0,0 @@
1
- /** @jsx jsx */
2
- import { forwardRef, memo, ReactNode } from 'react';
3
-
4
- import { css, jsx } from '@emotion/react';
5
-
6
- import { token } from '@atlaskit/tokens';
7
-
8
- import { BasePrimitiveProps } from './types';
9
-
10
- /**
11
- * @private
12
- * @deprecated DSP-8009: This type is scheduled for deletion.
13
- * Please use `Stack` from `@atlaskit/primitives` instead.
14
- */
15
- export interface StackProps extends BasePrimitiveProps {
16
- /**
17
- * Used to align children along the cross axis.
18
- */
19
- alignItems?: FlexAlignItems;
20
- /**
21
- * Used to align children along the main axis.
22
- */
23
- justifyContent?: FlexJustifyContent;
24
- /**
25
- * Sets whether children are forced onto one line or can wrap onto multiple lines
26
- */
27
- flexWrap?: FlexWrap;
28
- /**
29
- * Token representing gap between children.
30
- */
31
- gap: RowGap;
32
- /**
33
- * Elements to be rendered inside the Stack.
34
- */
35
- children: ReactNode;
36
- }
37
-
38
- type FlexAlignItems = keyof typeof flexAlignItemsMap;
39
- const flexAlignItemsMap = {
40
- center: css({ alignItems: 'center' }),
41
- baseline: css({ alignItems: 'baseline' }),
42
- flexStart: css({ alignItems: 'flex-start' }),
43
- flexEnd: css({ alignItems: 'flex-end' }),
44
- start: css({ alignItems: 'start' }),
45
- end: css({ alignItems: 'end' }),
46
- };
47
-
48
- type FlexJustifyContent = keyof typeof flexJustifyContentMap;
49
- const flexJustifyContentMap = {
50
- center: css({ justifyContent: 'center' }),
51
- flexStart: css({ justifyContent: 'flex-start' }),
52
- flexEnd: css({ justifyContent: 'flex-end' }),
53
- start: css({ justifyContent: 'start' }),
54
- end: css({ justifyContent: 'end' }),
55
- };
56
-
57
- type FlexWrap = keyof typeof flexWrapMap;
58
- const flexWrapMap = {
59
- wrap: css({ flexWrap: 'wrap' }),
60
- };
61
-
62
- const baseStyles = css({
63
- display: 'flex',
64
- boxSizing: 'border-box',
65
- flexDirection: 'column',
66
- });
67
-
68
- /**
69
- * __Stack__
70
- *
71
- * Stack is a primitive component based on flexbox that manages the vertical layout of direct children.
72
- * Renders a `div` by default.
73
- *
74
- * @private
75
- * @deprecated DSP-8009: This primitive is scheduled for deletion.
76
- * Please use `Stack` from `@atlaskit/primitives` instead.
77
- *
78
- */
79
- const Stack = memo(
80
- forwardRef<HTMLDivElement, StackProps>(
81
- (
82
- {
83
- gap,
84
- alignItems,
85
- justifyContent,
86
- flexWrap,
87
- children,
88
- UNSAFE_style,
89
- testId,
90
- },
91
- ref,
92
- ) => {
93
- return (
94
- <div
95
- style={UNSAFE_style}
96
- css={[
97
- baseStyles,
98
- gap && rowGapMap[gap],
99
- alignItems && flexAlignItemsMap[alignItems],
100
- justifyContent && flexJustifyContentMap[justifyContent],
101
- flexWrap && flexWrapMap[flexWrap],
102
- ]}
103
- data-testid={testId}
104
- ref={ref}
105
- >
106
- {children}
107
- </div>
108
- );
109
- },
110
- ),
111
- );
112
-
113
- Stack.displayName = 'Stack';
114
-
115
- export default Stack;
116
-
117
- /**
118
- * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
119
- * @codegen <<SignedSource::02ffa7c4ee52871441d288f44a054685>>
120
- * @codegenId spacing
121
- * @codegenCommand yarn codegen-styles
122
- * @codegenParams ["rowGap"]
123
- * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::298080e8024fb3eb37589721413e0156>>
124
- */
125
- const rowGapMap = {
126
- 'space.0': css({
127
- rowGap: token('space.0', '0px'),
128
- }),
129
- 'space.025': css({
130
- rowGap: token('space.025', '2px'),
131
- }),
132
- 'space.050': css({
133
- rowGap: token('space.050', '4px'),
134
- }),
135
- 'space.075': css({
136
- rowGap: token('space.075', '6px'),
137
- }),
138
- 'space.100': css({
139
- rowGap: token('space.100', '8px'),
140
- }),
141
- 'space.1000': css({
142
- rowGap: token('space.1000', '80px'),
143
- }),
144
- 'space.150': css({
145
- rowGap: token('space.150', '12px'),
146
- }),
147
- 'space.200': css({
148
- rowGap: token('space.200', '16px'),
149
- }),
150
- 'space.250': css({
151
- rowGap: token('space.250', '20px'),
152
- }),
153
- 'space.300': css({
154
- rowGap: token('space.300', '24px'),
155
- }),
156
- 'space.400': css({
157
- rowGap: token('space.400', '32px'),
158
- }),
159
- 'space.500': css({
160
- rowGap: token('space.500', '40px'),
161
- }),
162
- 'space.600': css({
163
- rowGap: token('space.600', '48px'),
164
- }),
165
- 'space.800': css({
166
- rowGap: token('space.800', '64px'),
167
- }),
168
- };
169
-
170
- export type RowGap = keyof typeof rowGapMap;
171
-
172
- /**
173
- * @codegenEnd
174
- */
@@ -1,15 +0,0 @@
1
- {
2
- "name": "@atlaskit/ds-explorations/stack",
3
- "main": "../dist/cjs/components/stack.partial.js",
4
- "module": "../dist/esm/components/stack.partial.js",
5
- "module:es2019": "../dist/es2019/components/stack.partial.js",
6
- "sideEffects": false,
7
- "types": "../dist/types/components/stack.partial.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <4.9": {
10
- "*": [
11
- "../dist/types-ts4.5/components/stack.partial.d.ts"
12
- ]
13
- }
14
- }
15
- }