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