@atlaskit/ds-explorations 2.3.1 → 2.4.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 +70 -58
- package/box/package.json +15 -0
- package/dist/cjs/components/box.partial.js +620 -0
- package/dist/cjs/components/inline.partial.js +182 -0
- package/dist/cjs/components/interaction-surface.partial.js +1 -2
- package/dist/cjs/components/stack.partial.js +148 -0
- package/dist/cjs/components/surface-provider.js +2 -4
- package/dist/cjs/components/text.partial.js +5 -6
- package/dist/cjs/constants.js +2 -3
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/internal/color-map.js +2 -3
- package/dist/cjs/internal/role-to-element.js +1 -2
- package/dist/cjs/internal/spacing-scale.js +1 -2
- package/dist/es2019/components/box.partial.js +614 -0
- package/dist/es2019/components/inline.partial.js +177 -0
- package/dist/es2019/components/stack.partial.js +144 -0
- package/dist/es2019/components/text.partial.js +4 -4
- package/dist/es2019/index.js +3 -0
- package/dist/esm/components/box.partial.js +617 -0
- package/dist/esm/components/inline.partial.js +177 -0
- package/dist/esm/components/stack.partial.js +143 -0
- package/dist/esm/components/text.partial.js +4 -4
- package/dist/esm/index.js +3 -0
- package/dist/types/components/box.partial.d.ts +357 -0
- package/dist/types/components/inline.partial.d.ts +108 -0
- package/dist/types/components/stack.partial.d.ts +92 -0
- package/dist/types/components/surface-provider.d.ts +2 -2
- package/dist/types/components/text.partial.d.ts +2 -2
- package/dist/types/index.d.ts +6 -0
- package/dist/types-ts4.5/components/box.partial.d.ts +357 -0
- package/dist/types-ts4.5/components/inline.partial.d.ts +108 -0
- package/dist/types-ts4.5/components/stack.partial.d.ts +92 -0
- package/dist/types-ts4.5/components/surface-provider.d.ts +2 -2
- package/dist/types-ts4.5/components/text.partial.d.ts +2 -2
- package/dist/types-ts4.5/index.d.ts +6 -0
- package/examples/00-basic.tsx +22 -0
- package/examples/01-box.tsx +171 -0
- package/examples/02-text-advanced.tsx +20 -11
- package/examples/02-text.tsx +10 -15
- package/examples/03-stack.tsx +99 -0
- package/examples/04-inline.tsx +99 -0
- package/examples/05-badge.tsx +5 -9
- package/examples/06-section-message.tsx +4 -2
- package/examples/07-comment.tsx +3 -1
- package/examples/08-lozenge.tsx +4 -8
- package/examples/99-interactions.tsx +33 -49
- package/inline/package.json +15 -0
- package/package.json +6 -4
- package/report.api.md +465 -0
- package/scripts/codegen-styles.tsx +89 -16
- package/src/components/__tests__/unit/box.test.tsx +55 -0
- package/src/components/__tests__/unit/inline.test.tsx +43 -0
- package/src/components/__tests__/unit/interaction-suface.test.tsx +2 -2
- package/src/components/__tests__/unit/stack.test.tsx +31 -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/inline-snapshot-test.tsx +28 -0
- package/src/components/__tests__/visual-regression/stack-snapshot-test.tsx +28 -0
- package/src/components/__tests__/vr-tests/__snapshots__/box--default.png +0 -0
- package/src/components/__tests__/vr-tests/box-snapshot-test.vr.tsx +6 -0
- package/src/components/box.partial.tsx +706 -0
- package/src/components/inline.partial.tsx +218 -0
- package/src/components/stack.partial.tsx +174 -0
- package/src/components/surface-provider.tsx +1 -1
- package/src/components/text.partial.tsx +4 -4
- package/src/index.tsx +6 -0
- package/stack/package.json +15 -0
- package/tmp/api-report-tmp.d.ts +451 -0
- package/tsconfig.app.json +0 -3
- package/tsconfig.dev.json +6 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { Children, forwardRef, Fragment, memo } from 'react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @private
|
|
7
|
+
* @deprecated DSP-8009: This type is scheduled for deletion.
|
|
8
|
+
* Please use `Inline` from `@atlaskit/primitives` instead.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
var flexAlignItemsMap = {
|
|
12
|
+
center: css({
|
|
13
|
+
alignItems: 'center'
|
|
14
|
+
}),
|
|
15
|
+
baseline: css({
|
|
16
|
+
alignItems: 'baseline'
|
|
17
|
+
}),
|
|
18
|
+
flexStart: css({
|
|
19
|
+
alignItems: 'flex-start'
|
|
20
|
+
}),
|
|
21
|
+
flexEnd: css({
|
|
22
|
+
alignItems: 'flex-end'
|
|
23
|
+
}),
|
|
24
|
+
start: css({
|
|
25
|
+
alignItems: 'start'
|
|
26
|
+
}),
|
|
27
|
+
end: css({
|
|
28
|
+
alignItems: 'end'
|
|
29
|
+
})
|
|
30
|
+
};
|
|
31
|
+
var flexJustifyContentMap = {
|
|
32
|
+
center: css({
|
|
33
|
+
justifyContent: 'center'
|
|
34
|
+
}),
|
|
35
|
+
flexStart: css({
|
|
36
|
+
justifyContent: 'flex-start'
|
|
37
|
+
}),
|
|
38
|
+
'space-between': css({
|
|
39
|
+
justifyContent: 'space-between'
|
|
40
|
+
}),
|
|
41
|
+
flexEnd: css({
|
|
42
|
+
justifyContent: 'flex-end'
|
|
43
|
+
}),
|
|
44
|
+
start: css({
|
|
45
|
+
justifyContent: 'start'
|
|
46
|
+
}),
|
|
47
|
+
end: css({
|
|
48
|
+
justifyContent: 'end'
|
|
49
|
+
}),
|
|
50
|
+
spaceBetween: css({
|
|
51
|
+
justifyContent: 'space-between'
|
|
52
|
+
})
|
|
53
|
+
};
|
|
54
|
+
var flexWrapMap = {
|
|
55
|
+
wrap: css({
|
|
56
|
+
flexWrap: 'wrap'
|
|
57
|
+
})
|
|
58
|
+
};
|
|
59
|
+
var baseStyles = css({
|
|
60
|
+
display: 'flex',
|
|
61
|
+
boxSizing: 'border-box',
|
|
62
|
+
flexDirection: 'row'
|
|
63
|
+
});
|
|
64
|
+
var dividerStyles = css({
|
|
65
|
+
margin: "0 ".concat("var(--ds-space-negative-025, -2px)"),
|
|
66
|
+
color: "var(--ds-text-subtle, #42526E)",
|
|
67
|
+
pointerEvents: 'none',
|
|
68
|
+
userSelect: 'none'
|
|
69
|
+
});
|
|
70
|
+
var Divider = function Divider(_ref) {
|
|
71
|
+
var children = _ref.children;
|
|
72
|
+
return jsx("span", {
|
|
73
|
+
css: dividerStyles
|
|
74
|
+
}, children);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* __Inline__
|
|
79
|
+
*
|
|
80
|
+
* Inline is a primitive component based on flexbox that manages the horizontal layout of direct children.
|
|
81
|
+
* Renders a `div` by default.
|
|
82
|
+
*
|
|
83
|
+
* @private
|
|
84
|
+
* @deprecated DSP-8009: This primitive is scheduled for deletion.
|
|
85
|
+
* Please use `Inline` from `@atlaskit/primitives` instead.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```tsx
|
|
89
|
+
* const App = () => (
|
|
90
|
+
* <Inline gap="space.100">
|
|
91
|
+
* <Button />
|
|
92
|
+
* <Button />
|
|
93
|
+
* </Inline>
|
|
94
|
+
* )
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
var Inline = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
98
|
+
var gap = _ref2.gap,
|
|
99
|
+
alignItems = _ref2.alignItems,
|
|
100
|
+
justifyContent = _ref2.justifyContent,
|
|
101
|
+
flexWrap = _ref2.flexWrap,
|
|
102
|
+
divider = _ref2.divider,
|
|
103
|
+
UNSAFE_style = _ref2.UNSAFE_style,
|
|
104
|
+
rawChildren = _ref2.children,
|
|
105
|
+
testId = _ref2.testId;
|
|
106
|
+
var dividerComponent = typeof divider === 'string' ? jsx(Divider, null, divider) : divider;
|
|
107
|
+
var children = divider ? Children.toArray(rawChildren).filter(Boolean).map(function (child, index) {
|
|
108
|
+
return jsx(Fragment, {
|
|
109
|
+
key: index
|
|
110
|
+
}, divider && index > 0 ? dividerComponent : null, child);
|
|
111
|
+
}) : rawChildren;
|
|
112
|
+
return jsx("div", {
|
|
113
|
+
style: UNSAFE_style,
|
|
114
|
+
css: [baseStyles, gap && columnGapMap[gap], alignItems && flexAlignItemsMap[alignItems], justifyContent && flexJustifyContentMap[justifyContent], flexWrap && flexWrapMap[flexWrap]],
|
|
115
|
+
"data-testid": testId,
|
|
116
|
+
ref: ref
|
|
117
|
+
}, children);
|
|
118
|
+
}));
|
|
119
|
+
Inline.displayName = 'Inline';
|
|
120
|
+
export default Inline;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
124
|
+
* @codegen <<SignedSource::63747c8b92ba373ad2259fa1fff3f434>>
|
|
125
|
+
* @codegenId spacing
|
|
126
|
+
* @codegenCommand yarn codegen-styles
|
|
127
|
+
* @codegenParams ["columnGap"]
|
|
128
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::298080e8024fb3eb37589721413e0156>>
|
|
129
|
+
*/
|
|
130
|
+
var columnGapMap = {
|
|
131
|
+
'space.0': css({
|
|
132
|
+
columnGap: "var(--ds-space-0, 0px)"
|
|
133
|
+
}),
|
|
134
|
+
'space.025': css({
|
|
135
|
+
columnGap: "var(--ds-space-025, 2px)"
|
|
136
|
+
}),
|
|
137
|
+
'space.050': css({
|
|
138
|
+
columnGap: "var(--ds-space-050, 4px)"
|
|
139
|
+
}),
|
|
140
|
+
'space.075': css({
|
|
141
|
+
columnGap: "var(--ds-space-075, 6px)"
|
|
142
|
+
}),
|
|
143
|
+
'space.100': css({
|
|
144
|
+
columnGap: "var(--ds-space-100, 8px)"
|
|
145
|
+
}),
|
|
146
|
+
'space.1000': css({
|
|
147
|
+
columnGap: "var(--ds-space-1000, 80px)"
|
|
148
|
+
}),
|
|
149
|
+
'space.150': css({
|
|
150
|
+
columnGap: "var(--ds-space-150, 12px)"
|
|
151
|
+
}),
|
|
152
|
+
'space.200': css({
|
|
153
|
+
columnGap: "var(--ds-space-200, 16px)"
|
|
154
|
+
}),
|
|
155
|
+
'space.250': css({
|
|
156
|
+
columnGap: "var(--ds-space-250, 20px)"
|
|
157
|
+
}),
|
|
158
|
+
'space.300': css({
|
|
159
|
+
columnGap: "var(--ds-space-300, 24px)"
|
|
160
|
+
}),
|
|
161
|
+
'space.400': css({
|
|
162
|
+
columnGap: "var(--ds-space-400, 32px)"
|
|
163
|
+
}),
|
|
164
|
+
'space.500': css({
|
|
165
|
+
columnGap: "var(--ds-space-500, 40px)"
|
|
166
|
+
}),
|
|
167
|
+
'space.600': css({
|
|
168
|
+
columnGap: "var(--ds-space-600, 48px)"
|
|
169
|
+
}),
|
|
170
|
+
'space.800': css({
|
|
171
|
+
columnGap: "var(--ds-space-800, 64px)"
|
|
172
|
+
})
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* @codegenEnd
|
|
177
|
+
*/
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { forwardRef, memo } from 'react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @private
|
|
7
|
+
* @deprecated DSP-8009: This type is scheduled for deletion.
|
|
8
|
+
* Please use `Stack` from `@atlaskit/primitives` instead.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
var flexAlignItemsMap = {
|
|
12
|
+
center: css({
|
|
13
|
+
alignItems: 'center'
|
|
14
|
+
}),
|
|
15
|
+
baseline: css({
|
|
16
|
+
alignItems: 'baseline'
|
|
17
|
+
}),
|
|
18
|
+
flexStart: css({
|
|
19
|
+
alignItems: 'flex-start'
|
|
20
|
+
}),
|
|
21
|
+
flexEnd: css({
|
|
22
|
+
alignItems: 'flex-end'
|
|
23
|
+
}),
|
|
24
|
+
start: css({
|
|
25
|
+
alignItems: 'start'
|
|
26
|
+
}),
|
|
27
|
+
end: css({
|
|
28
|
+
alignItems: 'end'
|
|
29
|
+
})
|
|
30
|
+
};
|
|
31
|
+
var flexJustifyContentMap = {
|
|
32
|
+
center: css({
|
|
33
|
+
justifyContent: 'center'
|
|
34
|
+
}),
|
|
35
|
+
flexStart: css({
|
|
36
|
+
justifyContent: 'flex-start'
|
|
37
|
+
}),
|
|
38
|
+
flexEnd: css({
|
|
39
|
+
justifyContent: 'flex-end'
|
|
40
|
+
}),
|
|
41
|
+
start: css({
|
|
42
|
+
justifyContent: 'start'
|
|
43
|
+
}),
|
|
44
|
+
end: css({
|
|
45
|
+
justifyContent: 'end'
|
|
46
|
+
})
|
|
47
|
+
};
|
|
48
|
+
var flexWrapMap = {
|
|
49
|
+
wrap: css({
|
|
50
|
+
flexWrap: 'wrap'
|
|
51
|
+
})
|
|
52
|
+
};
|
|
53
|
+
var baseStyles = css({
|
|
54
|
+
display: 'flex',
|
|
55
|
+
boxSizing: 'border-box',
|
|
56
|
+
flexDirection: 'column'
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* __Stack__
|
|
61
|
+
*
|
|
62
|
+
* Stack is a primitive component based on flexbox that manages the vertical layout of direct children.
|
|
63
|
+
* Renders a `div` by default.
|
|
64
|
+
*
|
|
65
|
+
* @private
|
|
66
|
+
* @deprecated DSP-8009: This primitive is scheduled for deletion.
|
|
67
|
+
* Please use `Stack` from `@atlaskit/primitives` instead.
|
|
68
|
+
*
|
|
69
|
+
*/
|
|
70
|
+
var Stack = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
71
|
+
var gap = _ref.gap,
|
|
72
|
+
alignItems = _ref.alignItems,
|
|
73
|
+
justifyContent = _ref.justifyContent,
|
|
74
|
+
flexWrap = _ref.flexWrap,
|
|
75
|
+
children = _ref.children,
|
|
76
|
+
UNSAFE_style = _ref.UNSAFE_style,
|
|
77
|
+
testId = _ref.testId;
|
|
78
|
+
return jsx("div", {
|
|
79
|
+
style: UNSAFE_style,
|
|
80
|
+
css: [baseStyles, gap && rowGapMap[gap], alignItems && flexAlignItemsMap[alignItems], justifyContent && flexJustifyContentMap[justifyContent], flexWrap && flexWrapMap[flexWrap]],
|
|
81
|
+
"data-testid": testId,
|
|
82
|
+
ref: ref
|
|
83
|
+
}, children);
|
|
84
|
+
}));
|
|
85
|
+
Stack.displayName = 'Stack';
|
|
86
|
+
export default Stack;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
90
|
+
* @codegen <<SignedSource::02ffa7c4ee52871441d288f44a054685>>
|
|
91
|
+
* @codegenId spacing
|
|
92
|
+
* @codegenCommand yarn codegen-styles
|
|
93
|
+
* @codegenParams ["rowGap"]
|
|
94
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::298080e8024fb3eb37589721413e0156>>
|
|
95
|
+
*/
|
|
96
|
+
var rowGapMap = {
|
|
97
|
+
'space.0': css({
|
|
98
|
+
rowGap: "var(--ds-space-0, 0px)"
|
|
99
|
+
}),
|
|
100
|
+
'space.025': css({
|
|
101
|
+
rowGap: "var(--ds-space-025, 2px)"
|
|
102
|
+
}),
|
|
103
|
+
'space.050': css({
|
|
104
|
+
rowGap: "var(--ds-space-050, 4px)"
|
|
105
|
+
}),
|
|
106
|
+
'space.075': css({
|
|
107
|
+
rowGap: "var(--ds-space-075, 6px)"
|
|
108
|
+
}),
|
|
109
|
+
'space.100': css({
|
|
110
|
+
rowGap: "var(--ds-space-100, 8px)"
|
|
111
|
+
}),
|
|
112
|
+
'space.1000': css({
|
|
113
|
+
rowGap: "var(--ds-space-1000, 80px)"
|
|
114
|
+
}),
|
|
115
|
+
'space.150': css({
|
|
116
|
+
rowGap: "var(--ds-space-150, 12px)"
|
|
117
|
+
}),
|
|
118
|
+
'space.200': css({
|
|
119
|
+
rowGap: "var(--ds-space-200, 16px)"
|
|
120
|
+
}),
|
|
121
|
+
'space.250': css({
|
|
122
|
+
rowGap: "var(--ds-space-250, 20px)"
|
|
123
|
+
}),
|
|
124
|
+
'space.300': css({
|
|
125
|
+
rowGap: "var(--ds-space-300, 24px)"
|
|
126
|
+
}),
|
|
127
|
+
'space.400': css({
|
|
128
|
+
rowGap: "var(--ds-space-400, 32px)"
|
|
129
|
+
}),
|
|
130
|
+
'space.500': css({
|
|
131
|
+
rowGap: "var(--ds-space-500, 40px)"
|
|
132
|
+
}),
|
|
133
|
+
'space.600': css({
|
|
134
|
+
rowGap: "var(--ds-space-600, 48px)"
|
|
135
|
+
}),
|
|
136
|
+
'space.800': css({
|
|
137
|
+
rowGap: "var(--ds-space-800, 64px)"
|
|
138
|
+
})
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* @codegenEnd
|
|
143
|
+
*/
|
|
@@ -129,11 +129,11 @@ export default Text;
|
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
131
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
132
|
-
* @codegen <<SignedSource::
|
|
132
|
+
* @codegen <<SignedSource::14dcf59f69533f453ffa8a5c5d165d19>>
|
|
133
133
|
* @codegenId typography
|
|
134
134
|
* @codegenCommand yarn codegen-styles
|
|
135
135
|
* @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight"]
|
|
136
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-typography.tsx <<SignedSource::
|
|
136
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-typography.tsx <<SignedSource::b01e60e475c0cb12960865631f2b4e2c>>
|
|
137
137
|
*/
|
|
138
138
|
var fontSizeMap = {
|
|
139
139
|
'size.050': css({
|
|
@@ -177,7 +177,7 @@ var fontWeightMap = {
|
|
|
177
177
|
};
|
|
178
178
|
var fontFamilyMap = {
|
|
179
179
|
body: css({
|
|
180
|
-
fontFamily: "var(--ds-font-family-body, ui-sans-serif, \"Segoe UI\", system-ui,
|
|
180
|
+
fontFamily: "var(--ds-font-family-body, ui-sans-serif, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
181
181
|
}),
|
|
182
182
|
brand: css({
|
|
183
183
|
fontFamily: "var(--ds-font-family-brand, Charlie Sans)"
|
|
@@ -186,7 +186,7 @@ var fontFamilyMap = {
|
|
|
186
186
|
fontFamily: "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)"
|
|
187
187
|
}),
|
|
188
188
|
heading: css({
|
|
189
|
-
fontFamily: "var(--ds-font-family-heading, ui-sans-serif, \"Segoe UI\", system-ui,
|
|
189
|
+
fontFamily: "var(--ds-font-family-heading, ui-sans-serif, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
190
190
|
}),
|
|
191
191
|
monospace: css({
|
|
192
192
|
fontFamily: "var(--ds-font-family-monospace, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)"
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
export { default as UNSAFE_Box } from './components/box.partial';
|
|
1
2
|
export { default as UNSAFE_Text } from './components/text.partial';
|
|
3
|
+
export { default as UNSAFE_Inline } from './components/inline.partial';
|
|
4
|
+
export { default as UNSAFE_Stack } from './components/stack.partial';
|
|
2
5
|
export { default as UNSAFE_InteractionSurface } from './components/interaction-surface.partial';
|