@atlaskit/button 16.3.10 → 16.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 (32) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/cjs/button-group.js +5 -5
  3. package/dist/cjs/entry-points/standard-button.js +1 -1
  4. package/dist/cjs/shared/button-base.js +9 -9
  5. package/dist/cjs/shared/css.js +14 -12
  6. package/dist/cjs/version.json +1 -1
  7. package/dist/es2019/button-group.js +2 -2
  8. package/dist/es2019/entry-points/standard-button.js +1 -1
  9. package/dist/es2019/shared/button-base.js +4 -4
  10. package/dist/es2019/shared/css.js +13 -12
  11. package/dist/es2019/version.json +1 -1
  12. package/dist/esm/button-group.js +2 -2
  13. package/dist/esm/entry-points/standard-button.js +1 -1
  14. package/dist/esm/shared/button-base.js +4 -4
  15. package/dist/esm/shared/css.js +13 -12
  16. package/dist/esm/version.json +1 -1
  17. package/dist/types/button-group.d.ts +2 -1
  18. package/dist/types/custom-theme-button/custom-theme-button-types.d.ts +1 -1
  19. package/dist/types/custom-theme-button/theme.d.ts +1 -1
  20. package/dist/types/entry-points/standard-button.d.ts +1 -1
  21. package/dist/types/shared/block-events.d.ts +1 -0
  22. package/dist/types/shared/button-base.d.ts +1 -1
  23. package/dist/types/shared/css.d.ts +5 -5
  24. package/dist/types-ts4.0/button-group.d.ts +2 -1
  25. package/dist/types-ts4.0/custom-theme-button/custom-theme-button-types.d.ts +1 -1
  26. package/dist/types-ts4.0/custom-theme-button/theme.d.ts +1 -1
  27. package/dist/types-ts4.0/entry-points/standard-button.d.ts +1 -1
  28. package/dist/types-ts4.0/shared/block-events.d.ts +1 -0
  29. package/dist/types-ts4.0/shared/button-base.d.ts +1 -1
  30. package/dist/types-ts4.0/shared/css.d.ts +5 -5
  31. package/package.json +3 -3
  32. package/report.api.md +48 -111
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @atlaskit/button
2
2
 
3
+ ## 16.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`9f6369f5505`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9f6369f5505) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behaviour change.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
3
13
  ## 16.3.10
4
14
 
5
15
  ### Patch Changes
@@ -9,14 +9,14 @@ exports.default = ButtonGroup;
9
9
 
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
 
12
- var _core = require("@emotion/core");
12
+ var _react2 = require("@emotion/react");
13
13
 
14
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
15
 
16
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
17
 
18
18
  /** @jsx jsx */
19
- var buttonGroupStyles = (0, _core.css)({
19
+ var buttonGroupStyles = (0, _react2.css)({
20
20
  display: 'inline-flex',
21
21
  // TODO Delete this comment after verifying spacing token -> previous value `4`
22
22
  gap: "var(--ds-scale-050, 4px)",
@@ -28,14 +28,14 @@ var buttonGroupStyles = (0, _core.css)({
28
28
  function ButtonGroup(_ref) {
29
29
  var appearance = _ref.appearance,
30
30
  children = _ref.children;
31
- return (0, _core.jsx)("div", {
31
+ return (0, _react2.jsx)("div", {
32
32
  css: buttonGroupStyles
33
- }, _react.default.Children.map(children, function (child, idx) {
33
+ }, _react.default.Children.map(_react.default.Children.toArray(children), function (child, idx) {
34
34
  if (!child) {
35
35
  return null;
36
36
  }
37
37
 
38
- return (0, _core.jsx)(_react.Fragment, {
38
+ return (0, _react2.jsx)(_react.Fragment, {
39
39
  key: idx
40
40
  }, appearance ?
41
41
  /*#__PURE__*/
@@ -12,6 +12,6 @@ Object.defineProperty(exports, "default", {
12
12
  }
13
13
  });
14
14
 
15
- require("@emotion/core");
15
+ require("@emotion/react");
16
16
 
17
17
  var _button = _interopRequireDefault(require("../button"));
@@ -15,7 +15,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
15
15
 
16
16
  var _react = _interopRequireWildcard(require("react"));
17
17
 
18
- var _core = require("@emotion/core");
18
+ var _react2 = require("@emotion/react");
19
19
 
20
20
  var _analyticsNext = require("@atlaskit/analytics-next");
21
21
 
@@ -101,7 +101,7 @@ var _default = /*#__PURE__*/_react.default.forwardRef(function ButtonBase(props,
101
101
  action: 'clicked',
102
102
  componentName: 'button',
103
103
  packageName: "@atlaskit/button",
104
- packageVersion: "16.3.10",
104
+ packageVersion: "16.4.0",
105
105
  analyticsData: analyticsContext
106
106
  }); // Button currently calls preventDefault, which is not standard button behaviour
107
107
 
@@ -119,9 +119,9 @@ var _default = /*#__PURE__*/_react.default.forwardRef(function ButtonBase(props,
119
119
  }, [isDisabled]); // we are 'disabling' input with a button when there is an overlay
120
120
 
121
121
  var hasOverlay = Boolean(overlay);
122
- var fadeCss = (0, _css.getFadingCss)({
122
+ var fadeCss = (0, _react2.css)((0, _css.getFadingCss)({
123
123
  hasOverlay: hasOverlay
124
- });
124
+ }));
125
125
  var isInteractive = !isDisabled && !hasOverlay;
126
126
  /**
127
127
  * HACK: Spinner needs to have different colours in the "new" tokens design compared to the old design.
@@ -139,7 +139,7 @@ var _default = /*#__PURE__*/_react.default.forwardRef(function ButtonBase(props,
139
139
  };
140
140
  }
141
141
 
142
- return (0, _core.jsx)(Component, (0, _extends2.default)({}, rest, {
142
+ return (0, _react2.jsx)(Component, (0, _extends2.default)({}, rest, {
143
143
  css: [buttonCss, isInteractive ? null : noPointerEventsOnChildrenCss],
144
144
  className: className,
145
145
  ref: setRef,
@@ -157,19 +157,19 @@ var _default = /*#__PURE__*/_react.default.forwardRef(function ButtonBase(props,
157
157
  tabIndex: isDisabled ? -1 : tabIndex
158
158
  }, (0, _blockEvents.default)({
159
159
  isInteractive: isInteractive
160
- })), iconBefore ? (0, _core.jsx)("span", {
160
+ })), iconBefore ? (0, _react2.jsx)("span", {
161
161
  css: [fadeCss, (0, _css.getIconStyle)({
162
162
  spacing: spacing
163
163
  })]
164
- }, iconBefore) : null, children ? (0, _core.jsx)("span", {
164
+ }, iconBefore) : null, children ? (0, _react2.jsx)("span", {
165
165
  css: [fadeCss, (0, _css.getContentStyle)({
166
166
  spacing: spacing
167
167
  })]
168
- }, children) : null, iconAfter ? (0, _core.jsx)("span", {
168
+ }, children) : null, iconAfter ? (0, _react2.jsx)("span", {
169
169
  css: [fadeCss, (0, _css.getIconStyle)({
170
170
  spacing: spacing
171
171
  })]
172
- }, iconAfter) : null, overlay ? (0, _core.jsx)("span", {
172
+ }, iconAfter) : null, overlay ? (0, _react2.jsx)("span", {
173
173
  css: [_css.overlayCss, spinnerHackCss]
174
174
  }, overlay) : null);
175
175
  });
@@ -13,6 +13,8 @@ exports.overlayCss = void 0;
13
13
 
14
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
15
 
16
+ var _react = require("@emotion/react");
17
+
16
18
  var _constants = require("@atlaskit/theme/constants");
17
19
 
18
20
  var _colors = _interopRequireDefault(require("./colors"));
@@ -212,23 +214,23 @@ function getCss(_ref3) {
212
214
 
213
215
  function getIconStyle(_ref4) {
214
216
  var spacing = _ref4.spacing;
215
- return {
216
- alignSelf: 'center',
217
+ return (0, _react.css)({
217
218
  display: 'flex',
219
+ margin: spacing === 'none' ? 0 : innerMargin.icon,
218
220
  // icon size cannot grow and shrink
219
221
  flexGrow: 0,
220
222
  flexShrink: 0,
221
- lineHeight: 0,
223
+ alignSelf: 'center',
222
224
  fontSize: 0,
223
- userSelect: 'none',
224
- margin: spacing === 'none' ? 0 : innerMargin.icon
225
- };
225
+ lineHeight: 0,
226
+ userSelect: 'none'
227
+ });
226
228
  } // inline-flex child
227
229
 
228
230
 
229
231
  function getContentStyle(_ref5) {
230
232
  var spacing = _ref5.spacing;
231
- return {
233
+ return (0, _react.css)({
232
234
  margin: spacing === 'none' ? 0 : innerMargin.content,
233
235
  // content can grow and shrink
234
236
  flexGrow: 1,
@@ -237,15 +239,15 @@ function getContentStyle(_ref5) {
237
239
  overflow: 'hidden',
238
240
  textOverflow: 'ellipsis',
239
241
  whiteSpace: 'nowrap'
240
- };
242
+ });
241
243
  }
242
244
 
243
245
  function getFadingCss(_ref6) {
244
246
  var hasOverlay = _ref6.hasOverlay;
245
- return {
246
- transition: 'opacity 0.3s',
247
- opacity: hasOverlay ? 0 : 1
248
- };
247
+ return (0, _react.css)({
248
+ opacity: hasOverlay ? 0 : 1,
249
+ transition: 'opacity 0.3s'
250
+ });
249
251
  }
250
252
 
251
253
  var overlayCss = {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/button",
3
- "version": "16.3.10",
3
+ "version": "16.4.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import React, { Fragment } from 'react';
3
- import { css, jsx } from '@emotion/core';
3
+ import { css, jsx } from '@emotion/react';
4
4
  const buttonGroupStyles = css({
5
5
  display: 'inline-flex',
6
6
  // TODO Delete this comment after verifying spacing token -> previous value `4`
@@ -15,7 +15,7 @@ export default function ButtonGroup({
15
15
  }) {
16
16
  return jsx("div", {
17
17
  css: buttonGroupStyles
18
- }, React.Children.map(children, (child, idx) => {
18
+ }, React.Children.map(React.Children.toArray(children), (child, idx) => {
19
19
  if (!child) {
20
20
  return null;
21
21
  }
@@ -2,5 +2,5 @@
2
2
  * Must import '@emotion/core' in order to resolve type error
3
3
  * https://product-fabric.atlassian.net/browse/DSP-3222
4
4
  */
5
- import '@emotion/core';
5
+ import '@emotion/react';
6
6
  export { default } from '../button';
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
3
  /** @jsx jsx */
4
4
  import React, { useCallback, useEffect, useRef } from 'react';
5
- import { jsx } from '@emotion/core';
5
+ import { css, jsx } from '@emotion/react';
6
6
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
7
7
  import noop from '@atlaskit/ds-lib/noop';
8
8
  import useAutoFocus from '@atlaskit/ds-lib/use-auto-focus';
@@ -68,7 +68,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
68
68
  action: 'clicked',
69
69
  componentName: 'button',
70
70
  packageName: "@atlaskit/button",
71
- packageVersion: "16.3.10",
71
+ packageVersion: "16.4.0",
72
72
  analyticsData: analyticsContext
73
73
  }); // Button currently calls preventDefault, which is not standard button behaviour
74
74
 
@@ -86,9 +86,9 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
86
86
  }, [isDisabled]); // we are 'disabling' input with a button when there is an overlay
87
87
 
88
88
  const hasOverlay = Boolean(overlay);
89
- const fadeCss = getFadingCss({
89
+ const fadeCss = css(getFadingCss({
90
90
  hasOverlay
91
- });
91
+ }));
92
92
  const isInteractive = !isDisabled && !hasOverlay;
93
93
  /**
94
94
  * HACK: Spinner needs to have different colours in the "new" tokens design compared to the old design.
@@ -1,3 +1,4 @@
1
+ import { css } from '@emotion/react';
1
2
  import { borderRadius as getBorderRadius, fontSize as getFontSize, gridSize as getGridSize } from '@atlaskit/theme/constants';
2
3
  import colors from './colors';
3
4
  const borderRadius = getBorderRadius();
@@ -198,23 +199,23 @@ export function getCss({
198
199
  export function getIconStyle({
199
200
  spacing
200
201
  }) {
201
- return {
202
- alignSelf: 'center',
202
+ return css({
203
203
  display: 'flex',
204
+ margin: spacing === 'none' ? 0 : innerMargin.icon,
204
205
  // icon size cannot grow and shrink
205
206
  flexGrow: 0,
206
207
  flexShrink: 0,
207
- lineHeight: 0,
208
+ alignSelf: 'center',
208
209
  fontSize: 0,
209
- userSelect: 'none',
210
- margin: spacing === 'none' ? 0 : innerMargin.icon
211
- };
210
+ lineHeight: 0,
211
+ userSelect: 'none'
212
+ });
212
213
  } // inline-flex child
213
214
 
214
215
  export function getContentStyle({
215
216
  spacing
216
217
  }) {
217
- return {
218
+ return css({
218
219
  margin: spacing === 'none' ? 0 : innerMargin.content,
219
220
  // content can grow and shrink
220
221
  flexGrow: 1,
@@ -223,15 +224,15 @@ export function getContentStyle({
223
224
  overflow: 'hidden',
224
225
  textOverflow: 'ellipsis',
225
226
  whiteSpace: 'nowrap'
226
- };
227
+ });
227
228
  }
228
229
  export function getFadingCss({
229
230
  hasOverlay
230
231
  }) {
231
- return {
232
- transition: 'opacity 0.3s',
233
- opacity: hasOverlay ? 0 : 1
234
- };
232
+ return css({
233
+ opacity: hasOverlay ? 0 : 1,
234
+ transition: 'opacity 0.3s'
235
+ });
235
236
  }
236
237
  export const overlayCss = {
237
238
  // stretching to full width / height of button
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/button",
3
- "version": "16.3.10",
3
+ "version": "16.4.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import React, { Fragment } from 'react';
3
- import { css, jsx } from '@emotion/core';
3
+ import { css, jsx } from '@emotion/react';
4
4
  var buttonGroupStyles = css({
5
5
  display: 'inline-flex',
6
6
  // TODO Delete this comment after verifying spacing token -> previous value `4`
@@ -14,7 +14,7 @@ export default function ButtonGroup(_ref) {
14
14
  children = _ref.children;
15
15
  return jsx("div", {
16
16
  css: buttonGroupStyles
17
- }, React.Children.map(children, function (child, idx) {
17
+ }, React.Children.map(React.Children.toArray(children), function (child, idx) {
18
18
  if (!child) {
19
19
  return null;
20
20
  }
@@ -2,5 +2,5 @@
2
2
  * Must import '@emotion/core' in order to resolve type error
3
3
  * https://product-fabric.atlassian.net/browse/DSP-3222
4
4
  */
5
- import '@emotion/core';
5
+ import '@emotion/react';
6
6
  export { default } from '../button';
@@ -4,7 +4,7 @@ var _excluded = ["appearance", "buttonCss", "spacing", "autoFocus", "isDisabled"
4
4
 
5
5
  /** @jsx jsx */
6
6
  import React, { useCallback, useEffect, useRef } from 'react';
7
- import { jsx } from '@emotion/core';
7
+ import { css, jsx } from '@emotion/react';
8
8
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
9
9
  import noop from '@atlaskit/ds-lib/noop';
10
10
  import useAutoFocus from '@atlaskit/ds-lib/use-auto-focus';
@@ -77,7 +77,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
77
77
  action: 'clicked',
78
78
  componentName: 'button',
79
79
  packageName: "@atlaskit/button",
80
- packageVersion: "16.3.10",
80
+ packageVersion: "16.4.0",
81
81
  analyticsData: analyticsContext
82
82
  }); // Button currently calls preventDefault, which is not standard button behaviour
83
83
 
@@ -95,9 +95,9 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
95
95
  }, [isDisabled]); // we are 'disabling' input with a button when there is an overlay
96
96
 
97
97
  var hasOverlay = Boolean(overlay);
98
- var fadeCss = getFadingCss({
98
+ var fadeCss = css(getFadingCss({
99
99
  hasOverlay: hasOverlay
100
- });
100
+ }));
101
101
  var isInteractive = !isDisabled && !hasOverlay;
102
102
  /**
103
103
  * HACK: Spinner needs to have different colours in the "new" tokens design compared to the old design.
@@ -4,6 +4,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
4
4
 
5
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
6
 
7
+ import { css } from '@emotion/react';
7
8
  import { borderRadius as getBorderRadius, fontSize as getFontSize, gridSize as getGridSize } from '@atlaskit/theme/constants';
8
9
  import colors from './colors';
9
10
  var borderRadius = getBorderRadius();
@@ -196,22 +197,22 @@ export function getCss(_ref3) {
196
197
 
197
198
  export function getIconStyle(_ref4) {
198
199
  var spacing = _ref4.spacing;
199
- return {
200
- alignSelf: 'center',
200
+ return css({
201
201
  display: 'flex',
202
+ margin: spacing === 'none' ? 0 : innerMargin.icon,
202
203
  // icon size cannot grow and shrink
203
204
  flexGrow: 0,
204
205
  flexShrink: 0,
205
- lineHeight: 0,
206
+ alignSelf: 'center',
206
207
  fontSize: 0,
207
- userSelect: 'none',
208
- margin: spacing === 'none' ? 0 : innerMargin.icon
209
- };
208
+ lineHeight: 0,
209
+ userSelect: 'none'
210
+ });
210
211
  } // inline-flex child
211
212
 
212
213
  export function getContentStyle(_ref5) {
213
214
  var spacing = _ref5.spacing;
214
- return {
215
+ return css({
215
216
  margin: spacing === 'none' ? 0 : innerMargin.content,
216
217
  // content can grow and shrink
217
218
  flexGrow: 1,
@@ -220,14 +221,14 @@ export function getContentStyle(_ref5) {
220
221
  overflow: 'hidden',
221
222
  textOverflow: 'ellipsis',
222
223
  whiteSpace: 'nowrap'
223
- };
224
+ });
224
225
  }
225
226
  export function getFadingCss(_ref6) {
226
227
  var hasOverlay = _ref6.hasOverlay;
227
- return {
228
- transition: 'opacity 0.3s',
229
- opacity: hasOverlay ? 0 : 1
230
- };
228
+ return css({
229
+ opacity: hasOverlay ? 0 : 1,
230
+ transition: 'opacity 0.3s'
231
+ });
231
232
  }
232
233
  export var overlayCss = {
233
234
  // stretching to full width / height of button
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/button",
3
- "version": "16.3.10",
3
+ "version": "16.4.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
+ import { jsx } from '@emotion/react';
3
4
  import { Appearance } from './types';
4
5
  export declare type ButtonGroupProps = {
5
6
  /**
@@ -8,4 +9,4 @@ export declare type ButtonGroupProps = {
8
9
  appearance?: Appearance;
9
10
  children?: React.ReactNode;
10
11
  };
11
- export default function ButtonGroup({ appearance, children, }: ButtonGroupProps): JSX.Element;
12
+ export default function ButtonGroup({ appearance, children, }: ButtonGroupProps): jsx.JSX.Element;
@@ -1,4 +1,4 @@
1
- import { CSSObject } from '@emotion/core';
1
+ import { CSSObject } from '@emotion/react';
2
2
  import { ThemeModes } from '@atlaskit/theme/types';
3
3
  import { BaseProps } from '../types';
4
4
  export declare type ThemeTokens = {
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { CSSObject } from '@emotion/core';
2
+ import { CSSObject } from '@emotion/react';
3
3
  import { InteractionState, ThemeProps, ThemeTokens } from './custom-theme-button-types';
4
4
  export declare function getCustomCss({ appearance, spacing, mode, isSelected, shouldFitContainer, iconIsOnlyChild, isLoading, state, }: ThemeProps): CSSObject;
5
5
  export declare function getSpecifiers(styles: CSSObject): CSSObject;
@@ -2,6 +2,6 @@
2
2
  * Must import '@emotion/core' in order to resolve type error
3
3
  * https://product-fabric.atlassian.net/browse/DSP-3222
4
4
  */
5
- import '@emotion/core';
5
+ import '@emotion/react';
6
6
  export { default } from '../button';
7
7
  export type { ButtonProps } from '../button';
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export default function blockEvents({ isInteractive, }: {
2
3
  isInteractive: boolean;
3
4
  }): React.DOMAttributes<HTMLElement>;
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
- import { CSSObject } from '@emotion/core';
3
+ import { CSSObject } from '@emotion/react';
4
4
  declare const _default: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.AllHTMLAttributes<HTMLElement>, "disabled">, "data-testid" | "data-has-overlay"> & {
5
5
  'data-testid'?: undefined;
6
6
  'data-has-overlay'?: undefined;
@@ -1,4 +1,4 @@
1
- import { CSSObject } from '@emotion/core';
1
+ import { CSSObject } from '@emotion/react';
2
2
  import { ThemeModes } from '@atlaskit/theme/types';
3
3
  import { Appearance, Spacing } from '../types';
4
4
  export declare type GetCssArgs = {
@@ -12,11 +12,11 @@ export declare type GetCssArgs = {
12
12
  export declare function getCss({ appearance, spacing, mode, isSelected, shouldFitContainer, isOnlySingleIcon, }: GetCssArgs): CSSObject;
13
13
  export declare function getIconStyle({ spacing }: {
14
14
  spacing: Spacing;
15
- }): CSSObject;
15
+ }): import("@emotion/react").SerializedStyles;
16
16
  export declare function getContentStyle({ spacing }: {
17
17
  spacing: Spacing;
18
- }): CSSObject;
19
- export declare function getFadingCss({ hasOverlay, }: {
18
+ }): import("@emotion/react").SerializedStyles;
19
+ export declare function getFadingCss({ hasOverlay }: {
20
20
  hasOverlay: boolean;
21
- }): CSSObject;
21
+ }): import("@emotion/react").SerializedStyles;
22
22
  export declare const overlayCss: CSSObject;
@@ -1,5 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
+ import { jsx } from '@emotion/react';
3
4
  import { Appearance } from './types';
4
5
  export declare type ButtonGroupProps = {
5
6
  /**
@@ -8,4 +9,4 @@ export declare type ButtonGroupProps = {
8
9
  appearance?: Appearance;
9
10
  children?: React.ReactNode;
10
11
  };
11
- export default function ButtonGroup({ appearance, children, }: ButtonGroupProps): JSX.Element;
12
+ export default function ButtonGroup({ appearance, children, }: ButtonGroupProps): jsx.JSX.Element;
@@ -1,4 +1,4 @@
1
- import { CSSObject } from '@emotion/core';
1
+ import { CSSObject } from '@emotion/react';
2
2
  import { ThemeModes } from '@atlaskit/theme/types';
3
3
  import { BaseProps } from '../types';
4
4
  export declare type ThemeTokens = {
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { CSSObject } from '@emotion/core';
2
+ import { CSSObject } from '@emotion/react';
3
3
  import { InteractionState, ThemeProps, ThemeTokens } from './custom-theme-button-types';
4
4
  export declare function getCustomCss({ appearance, spacing, mode, isSelected, shouldFitContainer, iconIsOnlyChild, isLoading, state, }: ThemeProps): CSSObject;
5
5
  export declare function getSpecifiers(styles: CSSObject): CSSObject;
@@ -2,6 +2,6 @@
2
2
  * Must import '@emotion/core' in order to resolve type error
3
3
  * https://product-fabric.atlassian.net/browse/DSP-3222
4
4
  */
5
- import '@emotion/core';
5
+ import '@emotion/react';
6
6
  export { default } from '../button';
7
7
  export type { ButtonProps } from '../button';
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export default function blockEvents({ isInteractive, }: {
2
3
  isInteractive: boolean;
3
4
  }): React.DOMAttributes<HTMLElement>;
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
- import { CSSObject } from '@emotion/core';
3
+ import { CSSObject } from '@emotion/react';
4
4
  declare const _default: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.AllHTMLAttributes<HTMLElement>, "disabled">, "data-testid" | "data-has-overlay"> & {
5
5
  'data-testid'?: undefined;
6
6
  'data-has-overlay'?: undefined;
@@ -1,4 +1,4 @@
1
- import { CSSObject } from '@emotion/core';
1
+ import { CSSObject } from '@emotion/react';
2
2
  import { ThemeModes } from '@atlaskit/theme/types';
3
3
  import { Appearance, Spacing } from '../types';
4
4
  export declare type GetCssArgs = {
@@ -12,11 +12,11 @@ export declare type GetCssArgs = {
12
12
  export declare function getCss({ appearance, spacing, mode, isSelected, shouldFitContainer, isOnlySingleIcon, }: GetCssArgs): CSSObject;
13
13
  export declare function getIconStyle({ spacing }: {
14
14
  spacing: Spacing;
15
- }): CSSObject;
15
+ }): import("@emotion/react").SerializedStyles;
16
16
  export declare function getContentStyle({ spacing }: {
17
17
  spacing: Spacing;
18
- }): CSSObject;
19
- export declare function getFadingCss({ hasOverlay, }: {
18
+ }): import("@emotion/react").SerializedStyles;
19
+ export declare function getFadingCss({ hasOverlay }: {
20
20
  hasOverlay: boolean;
21
- }): CSSObject;
21
+ }): import("@emotion/react").SerializedStyles;
22
22
  export declare const overlayCss: CSSObject;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/button",
3
- "version": "16.3.10",
3
+ "version": "16.4.0",
4
4
  "description": "A button triggers an event or action. They let users know what will happen next.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -42,11 +42,11 @@
42
42
  "dependencies": {
43
43
  "@atlaskit/analytics-next": "^8.2.0",
44
44
  "@atlaskit/ds-lib": "^2.1.0",
45
- "@atlaskit/spinner": "^15.1.0",
45
+ "@atlaskit/spinner": "^15.2.0",
46
46
  "@atlaskit/theme": "^12.2.0",
47
47
  "@atlaskit/tokens": "^0.10.0",
48
48
  "@babel/runtime": "^7.0.0",
49
- "@emotion/core": "^10.0.9"
49
+ "@emotion/react": "^11.7.1"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "react": "^16.8.0"
package/report.api.md CHANGED
@@ -1,6 +1,10 @@
1
- ## API Report File for "@atlaskit/button".
1
+ ## API Report File for "@atlaskit/button"
2
2
 
3
- > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ <!--
6
+ Generated API Report version: 2.0
7
+ -->
4
8
 
5
9
  [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
6
10
 
@@ -8,7 +12,8 @@
8
12
  /// <reference types="react" />
9
13
 
10
14
  import { ComponentType } from 'react';
11
- import { CSSObject } from '@emotion/core';
15
+ import { CSSObject } from '@emotion/react';
16
+ import { jsx } from '@emotion/react';
12
17
  import { default as React_2 } from 'react';
13
18
  import { ReactNode } from 'react';
14
19
  import { ThemeModes } from '@atlaskit/theme/types';
@@ -16,7 +21,8 @@ import { ThemeModes as ThemeModes_2 } from '@atlaskit/theme';
16
21
  import { ThemeProp } from '@atlaskit/theme/components';
17
22
  import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
18
23
 
19
- export declare type Appearance =
24
+ // @public (undocumented)
25
+ export type Appearance =
20
26
  | 'default'
21
27
  | 'danger'
22
28
  | 'link'
@@ -25,92 +31,37 @@ export declare type Appearance =
25
31
  | 'subtle-link'
26
32
  | 'warning';
27
33
 
28
- export declare type BaseOwnProps = {
29
- /**
30
- * The base styling to apply to the button
31
- */
34
+ // @public (undocumented)
35
+ export type BaseOwnProps = {
32
36
  appearance?: Appearance;
33
- /**
34
- * Set the button to autofocus on mount
35
- */
36
37
  autoFocus?: boolean;
37
- /**
38
- * Add a classname to the button
39
- */
40
38
  className?: string;
41
- /**
42
- * Used to 'overlay' something over a button. This is commonly used to display a loading spinner
43
- */
44
39
  overlay?: React_2.ReactNode;
45
- /**
46
- * Provides a url for buttons being used as a link
47
- */
48
40
  href?: string;
49
- /**
50
- * Places an icon within the button, after the button's text
51
- */
52
41
  iconAfter?: React_2.ReactChild;
53
- /**
54
- * Places an icon within the button, before the button's text
55
- */
56
42
  iconBefore?: React_2.ReactChild;
57
- /**
58
- * Set if the button is disabled
59
- */
60
43
  isDisabled?: boolean;
61
- /**
62
- * Change the style to indicate the button is selected
63
- */
64
44
  isSelected?: boolean;
65
- /**
66
- * Handler to be called on blur
67
- */
68
45
  onBlur?: React_2.FocusEventHandler<HTMLElement>;
69
- /**
70
- * Handler to be called on click. The second argument can be used to track analytics data. See the tutorial in the analytics-next package for details
71
- */
72
46
  onClick?: (
73
47
  e: React_2.MouseEvent<HTMLElement>,
74
48
  analyticsEvent: UIAnalyticsEvent,
75
49
  ) => void;
76
- /**
77
- * Handler to be called on focus
78
- */
79
50
  onFocus?: React_2.FocusEventHandler<HTMLElement>;
80
- /**
81
- * Set the amount of padding in the button
82
- */
83
51
  spacing?: Spacing;
84
- /**
85
- * Pass target down to a link within the button component, if a href is provided
86
- */
87
52
  target?: React_2.AnchorHTMLAttributes<HTMLAnchorElement>['target'];
88
- /**
89
- * Pass type down to a button
90
- */
91
53
  type?: React_2.ButtonHTMLAttributes<HTMLButtonElement>['type'];
92
- /**
93
- * Option to fit button width to its parent width
94
- */
95
54
  shouldFitContainer?: boolean;
96
- /**
97
- * Text content to be rendered in the button
98
- */
99
55
  children?: React_2.ReactNode;
100
- /**
101
- * A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests
102
- */
103
56
  testId?: string;
104
57
  component?:
105
58
  | React_2.ComponentType<React_2.AllHTMLAttributes<HTMLElement>>
106
59
  | React_2.ElementType;
107
- /**
108
- * Additional information to be included in the `context` of analytics events that come from button
109
- */
110
60
  analyticsContext?: Record<string, any>;
111
61
  };
112
62
 
113
- export declare type BaseProps = Combine<
63
+ // @public (undocumented)
64
+ export type BaseProps = Combine<
114
65
  Combine<
115
66
  Omit<React_2.AllHTMLAttributes<HTMLElement>, 'disabled'>,
116
67
  {
@@ -121,66 +72,52 @@ export declare type BaseProps = Combine<
121
72
  BaseOwnProps
122
73
  >;
123
74
 
124
- /**
125
- * __Button__
126
- *
127
- * A button triggers an event or action. They let users know what will happen next.
128
- *
129
- * - [Examples](https://atlassian.design/components/button/examples)
130
- * - [Code](https://atlassian.design/components/button/code)
131
- * - [Usage](https://atlassian.design/components/button/usage)
132
- */
133
- declare const Button: React_2.MemoExoticComponent<React_2.ForwardRefExoticComponent<
75
+ // @public
76
+ const Button: React_2.MemoExoticComponent<React_2.ForwardRefExoticComponent<
134
77
  ButtonProps & React_2.RefAttributes<HTMLElement>
135
78
  >>;
136
79
  export default Button;
137
80
 
138
- export declare function ButtonGroup({
81
+ // @public (undocumented)
82
+ export function ButtonGroup({
139
83
  appearance,
140
84
  children,
141
- }: ButtonGroupProps): JSX.Element;
85
+ }: ButtonGroupProps): jsx.JSX.Element;
142
86
 
143
- declare type ButtonGroupProps = {
144
- /**
145
- * The appearance to apply to all buttons.
146
- */
87
+ // @public (undocumented)
88
+ type ButtonGroupProps = {
147
89
  appearance?: Appearance;
148
90
  children?: React_2.ReactNode;
149
91
  };
150
92
 
151
- export declare interface ButtonProps extends BaseProps {}
93
+ // @public (undocumented)
94
+ export interface ButtonProps extends BaseProps {}
152
95
 
153
- declare type Combine<First, Second> = Omit<First, keyof Second> & Second;
96
+ // @public (undocumented)
97
+ type Combine<First, Second> = Omit<First, keyof Second> & Second;
154
98
 
155
- /**
156
- * __Custom theme button__
157
- *
158
- * A custom theme button. Avoid using this component. It exists for those already using custom theming, which is hard to use and has performance issues.
159
- *
160
- * - [Examples](https://atlassian.design/components/button/examples#custom-theme-button)
161
- */
162
- export declare const CustomThemeButton: React_2.MemoExoticComponent<React_2.ForwardRefExoticComponent<
99
+ // @public
100
+ export const CustomThemeButton: React_2.MemoExoticComponent<React_2.ForwardRefExoticComponent<
163
101
  Omit<BaseProps, 'overlay'> &
164
102
  CustomThemeButtonOwnProps &
165
103
  React_2.RefAttributes<HTMLElement>
166
104
  >>;
167
105
 
168
- export declare type CustomThemeButtonOwnProps = {
106
+ // @public (undocumented)
107
+ export type CustomThemeButtonOwnProps = {
169
108
  isLoading?: boolean;
170
- /**
171
- * Slow + discouraged custom theme API
172
- * See custom theme guide for usage details
173
- */
174
109
  theme?: (
175
110
  current: (props: ThemeProps) => ThemeTokens,
176
111
  props: ThemeProps,
177
112
  ) => ThemeTokens;
178
113
  };
179
114
 
180
- export declare type CustomThemeButtonProps = Omit<BaseProps, 'overlay'> &
115
+ // @public (undocumented)
116
+ export type CustomThemeButtonProps = Omit<BaseProps, 'overlay'> &
181
117
  CustomThemeButtonOwnProps;
182
118
 
183
- export declare type InteractionState =
119
+ // @public (undocumented)
120
+ export type InteractionState =
184
121
  | 'disabled'
185
122
  | 'focusSelected'
186
123
  | 'selected'
@@ -189,29 +126,27 @@ export declare type InteractionState =
189
126
  | 'focus'
190
127
  | 'default';
191
128
 
192
- /**
193
- * __Loading button__
194
- *
195
- * A small wrapper around Button that allows you to show an @atlaskit/spinner as an overlay on the button when you set an isLoading prop to true.
196
- *
197
- * - [Examples](https://atlassian.design/components/button/examples#loading-button)
198
- */
199
- export declare const LoadingButton: React_2.ForwardRefExoticComponent<
129
+ // @public
130
+ export const LoadingButton: React_2.ForwardRefExoticComponent<
200
131
  Omit<BaseProps, 'overlay'> &
201
132
  LoadingButtonOwnProps &
202
133
  React_2.RefAttributes<HTMLElement>
203
134
  >;
204
135
 
205
- export declare type LoadingButtonOwnProps = {
136
+ // @public (undocumented)
137
+ export type LoadingButtonOwnProps = {
206
138
  isLoading?: boolean;
207
139
  };
208
140
 
209
- export declare type LoadingButtonProps = Omit<BaseProps, 'overlay'> &
141
+ // @public (undocumented)
142
+ export type LoadingButtonProps = Omit<BaseProps, 'overlay'> &
210
143
  LoadingButtonOwnProps;
211
144
 
212
- export declare type Spacing = 'compact' | 'default' | 'none';
145
+ // @public (undocumented)
146
+ export type Spacing = 'compact' | 'default' | 'none';
213
147
 
214
- export declare const Theme: {
148
+ // @public (undocumented)
149
+ export const Theme: {
215
150
  Consumer: ComponentType<
216
151
  {
217
152
  children: (tokens: ThemeTokens) => ReactNode;
@@ -228,16 +163,18 @@ export declare const Theme: {
228
163
  useTheme: (props: ThemeProps) => ThemeTokens;
229
164
  };
230
165
 
231
- export declare type ThemeProps = Partial<CustomThemeButtonProps> & {
166
+ // @public (undocumented)
167
+ export type ThemeProps = Partial<CustomThemeButtonProps> & {
232
168
  state: InteractionState;
233
169
  iconIsOnlyChild?: boolean;
234
170
  mode?: ThemeModes;
235
171
  };
236
172
 
237
- export declare type ThemeTokens = {
173
+ // @public (undocumented)
174
+ export type ThemeTokens = {
238
175
  buttonStyles: CSSObject;
239
176
  spinnerStyles: CSSObject;
240
177
  };
241
178
 
242
- export {};
179
+ // (No @packageDocumentation comment for this package)
243
180
  ```