@atlaskit/button 16.17.2 → 16.17.4

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 (35) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/dist/cjs/new-button/containers/split-button/split-button.js +9 -20
  3. package/dist/cjs/new-button/variants/default/button.js +5 -1
  4. package/dist/cjs/new-button/variants/default/link.js +5 -1
  5. package/dist/cjs/new-button/variants/default/use-default-button.js +16 -8
  6. package/dist/cjs/new-button/variants/icon/use-icon-button.js +0 -4
  7. package/dist/cjs/new-button/variants/shared/use-button-base.js +1 -1
  8. package/dist/cjs/old-button/shared/button-base.js +1 -1
  9. package/dist/es2019/new-button/containers/split-button/split-button.js +9 -20
  10. package/dist/es2019/new-button/variants/default/button.js +4 -0
  11. package/dist/es2019/new-button/variants/default/link.js +4 -0
  12. package/dist/es2019/new-button/variants/default/use-default-button.js +16 -8
  13. package/dist/es2019/new-button/variants/icon/use-icon-button.js +0 -4
  14. package/dist/es2019/new-button/variants/shared/use-button-base.js +1 -1
  15. package/dist/es2019/old-button/shared/button-base.js +1 -1
  16. package/dist/esm/new-button/containers/split-button/split-button.js +9 -20
  17. package/dist/esm/new-button/variants/default/button.js +5 -1
  18. package/dist/esm/new-button/variants/default/link.js +5 -1
  19. package/dist/esm/new-button/variants/default/use-default-button.js +16 -8
  20. package/dist/esm/new-button/variants/icon/use-icon-button.js +0 -4
  21. package/dist/esm/new-button/variants/shared/use-button-base.js +1 -1
  22. package/dist/esm/old-button/shared/button-base.js +1 -1
  23. package/dist/types/new-button/containers/split-button/types.d.ts +1 -1
  24. package/dist/types/new-button/variants/default/link.d.ts +1 -1
  25. package/dist/types/new-button/variants/default/types.d.ts +16 -3
  26. package/dist/types/new-button/variants/default/use-default-button.d.ts +1 -1
  27. package/dist/types/new-button/variants/icon/types.d.ts +4 -5
  28. package/dist/types/new-button/variants/types.d.ts +2 -0
  29. package/dist/types-ts4.5/new-button/containers/split-button/types.d.ts +1 -1
  30. package/dist/types-ts4.5/new-button/variants/default/link.d.ts +1 -1
  31. package/dist/types-ts4.5/new-button/variants/default/types.d.ts +16 -3
  32. package/dist/types-ts4.5/new-button/variants/default/use-default-button.d.ts +1 -1
  33. package/dist/types-ts4.5/new-button/variants/icon/types.d.ts +4 -5
  34. package/dist/types-ts4.5/new-button/variants/types.d.ts +2 -0
  35. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,10 +1,22 @@
1
1
  # @atlaskit/button
2
2
 
3
+ ## 16.17.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#43835](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43835) [`eba86990eef`](https://bitbucket.org/atlassian/atlassian-frontend/commits/eba86990eef) - Update new Button (in closed beta) API for `iconBefore` and `iconAfter` to be bounded with unsafe fallbacks for icon sizing
8
+
9
+ ## 16.17.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [#43714](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43714) [`d4c4a73a30a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d4c4a73a30a) - [ux] Updates supported SplitButton (closed beta) appearances to be 'default' or 'primary'. Makes dividers full height to match existing uses outside of navigation contexts.
14
+
3
15
  ## 16.17.2
4
16
 
5
17
  ### Patch Changes
6
18
 
7
- - [#43263](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43263) [`09f29df6245`](https://bitbucket.org/atlassian/atlassian-frontend/commits/09f29df6245) - Update IconButton API to be bounded with unsafe fallback for icon sizing
19
+ - [#43263](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43263) [`09f29df6245`](https://bitbucket.org/atlassian/atlassian-frontend/commits/09f29df6245) - Update IconButton (in closed beta) API to be bounded with unsafe fallback for icon sizing
8
20
 
9
21
  ## 16.17.1
10
22
 
@@ -5,32 +5,29 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.SplitButtonWithSlots = exports.SplitButtonContainer = exports.SplitButton = exports.Divider = void 0;
7
7
  var _react = require("@emotion/react");
8
+ var _xcss = require("../../variants/shared/xcss");
8
9
  var _splitButtonContext = require("./split-button-context");
9
10
  var _utils = require("./utils");
10
11
  /** @jsx jsx */
11
12
 
12
- var defaultDividerHeight = '16px';
13
- var defaultDividerStyles = (0, _react.css)({
14
- height: defaultDividerHeight,
15
- margin: "var(--ds-space-075, 6px)".concat(" -0.5px")
16
- });
17
- var compactDividerHeight = '12px';
18
- var compactDividerStyles = (0, _react.css)({
19
- height: compactDividerHeight,
20
- margin: "var(--ds-space-050, 4px)".concat(" -0.5px")
21
- });
22
13
  var baseDividerStyles = (0, _react.css)({
23
14
  display: 'inline-flex',
24
15
  width: '1px',
25
16
  position: 'relative',
26
17
  zIndex: 2
27
18
  });
19
+ var defaultDividerStyles = (0, _react.css)({
20
+ height: _xcss.heights.default
21
+ });
22
+ var compactDividerStyles = (0, _react.css)({
23
+ height: _xcss.heights.compact
24
+ });
28
25
  var dividerDisabledStyles = (0, _react.css)({
29
26
  backgroundColor: "var(--ds-text-disabled, #091E4224)",
30
27
  cursor: 'not-allowed'
31
28
  });
32
29
  var navigationDividerStyles = (0, _react.css)({
33
- height: compactDividerHeight,
30
+ height: '16px',
34
31
  margin: "var(--ds-space-100, 8px)".concat(" -0.5px"),
35
32
  backgroundColor: "var(--ds-text-subtle, #0052cc)",
36
33
  opacity: 0.62
@@ -44,14 +41,6 @@ var dividerAppearance = {
44
41
  backgroundColor: "var(--ds-text-inverse, #FFF)",
45
42
  opacity: 0.64
46
43
  }),
47
- danger: (0, _react.css)({
48
- backgroundColor: "var(--ds-text-inverse, #FFF)",
49
- opacity: 0.66
50
- }),
51
- warning: (0, _react.css)({
52
- backgroundColor: "var(--ds-text-warning-inverse, #172B4D)",
53
- opacity: 0.52
54
- }),
55
44
  navigation: navigationDividerStyles
56
45
  };
57
46
  var dividerHeight = {
@@ -69,7 +58,7 @@ var Divider = exports.Divider = function Divider(_ref) {
69
58
  return (
70
59
  // I find it funny to provide a div for Divider
71
60
  (0, _react.jsx)("div", {
72
- css: [baseDividerStyles, dividerAppearance[appearance], dividerHeight[spacing], isDisabled ? dividerDisabledStyles : undefined]
61
+ css: [baseDividerStyles, dividerHeight[spacing], dividerAppearance[appearance], isDisabled ? dividerDisabledStyles : undefined]
73
62
  })
74
63
  );
75
64
  };
@@ -10,7 +10,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
  var _pressable = _interopRequireDefault(require("@atlaskit/primitives/pressable"));
12
12
  var _useDefaultButton = _interopRequireDefault(require("./use-default-button"));
13
- var _excluded = ["analyticsContext", "autoFocus", "appearance", "spacing", "isDisabled", "isSelected", "iconBefore", "iconAfter", "children", "shouldFitContainer", "interactionName", "overlay", "onClick", "onMouseDownCapture", "onMouseUpCapture", "onKeyDownCapture", "onKeyUpCapture", "onTouchStartCapture", "onTouchEndCapture", "onPointerDownCapture", "onPointerUpCapture", "onClickCapture", "type", "testId"];
13
+ var _excluded = ["analyticsContext", "autoFocus", "appearance", "spacing", "isDisabled", "isSelected", "iconBefore", "UNSAFE_iconAfter_size", "iconAfter", "UNSAFE_iconBefore_size", "children", "shouldFitContainer", "interactionName", "overlay", "onClick", "onMouseDownCapture", "onMouseUpCapture", "onKeyDownCapture", "onKeyUpCapture", "onTouchStartCapture", "onTouchEndCapture", "onPointerDownCapture", "onPointerUpCapture", "onClickCapture", "type", "testId"];
14
14
  /**
15
15
  * __Button__
16
16
  *
@@ -30,7 +30,9 @@ var Button = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
30
30
  isDisabled = _ref.isDisabled,
31
31
  isSelected = _ref.isSelected,
32
32
  iconBefore = _ref.iconBefore,
33
+ UNSAFE_iconAfter_size = _ref.UNSAFE_iconAfter_size,
33
34
  iconAfter = _ref.iconAfter,
35
+ UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
34
36
  children = _ref.children,
35
37
  shouldFitContainer = _ref.shouldFitContainer,
36
38
  interactionName = _ref.interactionName,
@@ -56,7 +58,9 @@ var Button = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
56
58
  buttonType: 'button',
57
59
  children: children,
58
60
  iconBefore: iconBefore,
61
+ UNSAFE_iconBefore_size: UNSAFE_iconBefore_size,
59
62
  iconAfter: iconAfter,
63
+ UNSAFE_iconAfter_size: UNSAFE_iconAfter_size,
60
64
  interactionName: interactionName,
61
65
  isDisabled: isDisabled,
62
66
  isSelected: isSelected,
@@ -11,7 +11,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
11
11
  var _react = _interopRequireWildcard(require("react"));
12
12
  var _link = _interopRequireDefault(require("@atlaskit/primitives/link"));
13
13
  var _useDefaultButton = _interopRequireDefault(require("./use-default-button"));
14
- var _excluded = ["analyticsContext", "autoFocus", "appearance", "spacing", "isDisabled", "isSelected", "iconBefore", "iconAfter", "children", "shouldFitContainer", "interactionName", "overlay", "onClick", "onMouseDownCapture", "onMouseUpCapture", "onKeyDownCapture", "onKeyUpCapture", "onTouchStartCapture", "onTouchEndCapture", "onPointerDownCapture", "onPointerUpCapture", "onClickCapture", "testId", "href"];
14
+ var _excluded = ["analyticsContext", "autoFocus", "appearance", "spacing", "isDisabled", "isSelected", "iconBefore", "UNSAFE_iconBefore_size", "iconAfter", "UNSAFE_iconAfter_size", "children", "shouldFitContainer", "interactionName", "overlay", "onClick", "onMouseDownCapture", "onMouseUpCapture", "onKeyDownCapture", "onKeyUpCapture", "onTouchStartCapture", "onTouchEndCapture", "onPointerDownCapture", "onPointerUpCapture", "onClickCapture", "testId", "href"];
15
15
  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); }
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
  var LinkButtonBase = function LinkButtonBase(_ref, ref) {
@@ -22,7 +22,9 @@ var LinkButtonBase = function LinkButtonBase(_ref, ref) {
22
22
  isDisabled = _ref.isDisabled,
23
23
  isSelected = _ref.isSelected,
24
24
  iconBefore = _ref.iconBefore,
25
+ UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
25
26
  iconAfter = _ref.iconAfter,
27
+ UNSAFE_iconAfter_size = _ref.UNSAFE_iconAfter_size,
26
28
  children = _ref.children,
27
29
  shouldFitContainer = _ref.shouldFitContainer,
28
30
  interactionName = _ref.interactionName,
@@ -47,7 +49,9 @@ var LinkButtonBase = function LinkButtonBase(_ref, ref) {
47
49
  buttonType: 'link',
48
50
  children: children,
49
51
  iconBefore: iconBefore,
52
+ UNSAFE_iconBefore_size: UNSAFE_iconBefore_size,
50
53
  iconAfter: iconAfter,
54
+ UNSAFE_iconAfter_size: UNSAFE_iconAfter_size,
51
55
  interactionName: interactionName,
52
56
  isDisabled: isDisabled,
53
57
  isSelected: isSelected,
@@ -25,8 +25,10 @@ var useDefaultButton = function useDefaultButton(_ref) {
25
25
  appearance = _ref.appearance,
26
26
  autoFocus = _ref.autoFocus,
27
27
  buttonType = _ref.buttonType,
28
- iconBefore = _ref.iconBefore,
29
- iconAfter = _ref.iconAfter,
28
+ IconBefore = _ref.iconBefore,
29
+ UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
30
+ IconAfter = _ref.iconAfter,
31
+ UNSAFE_iconAfter_size = _ref.UNSAFE_iconAfter_size,
30
32
  interactionName = _ref.interactionName,
31
33
  isDisabled = _ref.isDisabled,
32
34
  isSelected = _ref.isSelected,
@@ -51,15 +53,21 @@ var useDefaultButton = function useDefaultButton(_ref) {
51
53
  appearance: appearance,
52
54
  autoFocus: autoFocus,
53
55
  buttonType: buttonType,
54
- children: /*#__PURE__*/_react.default.createElement(_react.Fragment, null, iconBefore && /*#__PURE__*/_react.default.createElement(_content.default, {
56
+ children: /*#__PURE__*/_react.default.createElement(_react.Fragment, null, IconBefore && /*#__PURE__*/_react.default.createElement(_content.default, {
55
57
  type: "icon",
56
58
  hasOverlay: hasOverlay
57
- }, iconBefore), children && /*#__PURE__*/_react.default.createElement(_content.default, {
59
+ }, /*#__PURE__*/_react.default.createElement(IconBefore, {
60
+ label: "",
61
+ size: UNSAFE_iconBefore_size
62
+ })), children && /*#__PURE__*/_react.default.createElement(_content.default, {
58
63
  hasOverlay: hasOverlay
59
- }, children), iconAfter && /*#__PURE__*/_react.default.createElement(_content.default, {
64
+ }, children), IconAfter && /*#__PURE__*/_react.default.createElement(_content.default, {
60
65
  type: "icon",
61
66
  hasOverlay: hasOverlay
62
- }, iconAfter)),
67
+ }, /*#__PURE__*/_react.default.createElement(IconAfter, {
68
+ label: "",
69
+ size: UNSAFE_iconAfter_size
70
+ }))),
63
71
  interactionName: interactionName,
64
72
  isDisabled: isDisabled,
65
73
  isSelected: isSelected,
@@ -77,8 +85,8 @@ var useDefaultButton = function useDefaultButton(_ref) {
77
85
  ref: ref,
78
86
  shouldFitContainer: shouldFitContainer,
79
87
  spacing: spacing,
80
- hasIconBefore: Boolean(iconBefore),
81
- hasIconAfter: Boolean(iconAfter)
88
+ hasIconBefore: Boolean(IconBefore),
89
+ hasIconAfter: Boolean(IconAfter)
82
90
  });
83
91
  return baseProps;
84
92
  };
@@ -49,10 +49,6 @@ var useIconButton = function useIconButton(_ref) {
49
49
  appearance: appearance,
50
50
  autoFocus: autoFocus,
51
51
  buttonType: buttonType,
52
- /**
53
- * TODO: Have not finished IconButton yet. It also needs a required accessible
54
- * label - likely implemented using VisuallyHidden
55
- */
56
52
  children: /*#__PURE__*/_react.default.createElement(_content.default, {
57
53
  type: "icon",
58
54
  hasOverlay: hasOverlay
@@ -115,7 +115,7 @@ var useButtonBase = function useButtonBase(_ref) {
115
115
  action: 'clicked',
116
116
  componentName: 'button',
117
117
  packageName: "@atlaskit/button",
118
- packageVersion: "16.17.2",
118
+ packageVersion: "16.17.4",
119
119
  analyticsData: analyticsContext,
120
120
  actionSubject: buttonType
121
121
  });
@@ -118,7 +118,7 @@ var _default = exports.default = /*#__PURE__*/_react.default.forwardRef(function
118
118
  action: 'clicked',
119
119
  componentName: 'button',
120
120
  packageName: "@atlaskit/button",
121
- packageVersion: "16.17.2",
121
+ packageVersion: "16.17.4",
122
122
  analyticsData: analyticsContext
123
123
  });
124
124
 
@@ -1,30 +1,27 @@
1
1
  /** @jsx jsx */
2
2
 
3
3
  import { css, jsx } from '@emotion/react';
4
+ import { heights } from '../../variants/shared/xcss';
4
5
  import { SplitButtonContext } from './split-button-context';
5
6
  import { getActions } from './utils';
6
- const defaultDividerHeight = '16px';
7
- const defaultDividerStyles = css({
8
- height: defaultDividerHeight,
9
- margin: `${"var(--ds-space-075, 6px)"} -0.5px`
10
- });
11
- const compactDividerHeight = '12px';
12
- const compactDividerStyles = css({
13
- height: compactDividerHeight,
14
- margin: `${"var(--ds-space-050, 4px)"} -0.5px`
15
- });
16
7
  const baseDividerStyles = css({
17
8
  display: 'inline-flex',
18
9
  width: '1px',
19
10
  position: 'relative',
20
11
  zIndex: 2
21
12
  });
13
+ const defaultDividerStyles = css({
14
+ height: heights.default
15
+ });
16
+ const compactDividerStyles = css({
17
+ height: heights.compact
18
+ });
22
19
  const dividerDisabledStyles = css({
23
20
  backgroundColor: "var(--ds-text-disabled, #091E4224)",
24
21
  cursor: 'not-allowed'
25
22
  });
26
23
  const navigationDividerStyles = css({
27
- height: compactDividerHeight,
24
+ height: '16px',
28
25
  margin: `${"var(--ds-space-100, 8px)"} -0.5px`,
29
26
  backgroundColor: "var(--ds-text-subtle, #0052cc)",
30
27
  opacity: 0.62
@@ -38,14 +35,6 @@ const dividerAppearance = {
38
35
  backgroundColor: "var(--ds-text-inverse, #FFF)",
39
36
  opacity: 0.64
40
37
  }),
41
- danger: css({
42
- backgroundColor: "var(--ds-text-inverse, #FFF)",
43
- opacity: 0.66
44
- }),
45
- warning: css({
46
- backgroundColor: "var(--ds-text-warning-inverse, #172B4D)",
47
- opacity: 0.52
48
- }),
49
38
  navigation: navigationDividerStyles
50
39
  };
51
40
  const dividerHeight = {
@@ -63,7 +52,7 @@ export const Divider = ({
63
52
  return (
64
53
  // I find it funny to provide a div for Divider
65
54
  jsx("div", {
66
- css: [baseDividerStyles, dividerAppearance[appearance], dividerHeight[spacing], isDisabled ? dividerDisabledStyles : undefined]
55
+ css: [baseDividerStyles, dividerHeight[spacing], dividerAppearance[appearance], isDisabled ? dividerDisabledStyles : undefined]
67
56
  })
68
57
  );
69
58
  };
@@ -21,7 +21,9 @@ const Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function B
21
21
  isDisabled,
22
22
  isSelected,
23
23
  iconBefore,
24
+ UNSAFE_iconAfter_size,
24
25
  iconAfter,
26
+ UNSAFE_iconBefore_size,
25
27
  children,
26
28
  shouldFitContainer,
27
29
  interactionName,
@@ -47,7 +49,9 @@ const Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function B
47
49
  buttonType: 'button',
48
50
  children,
49
51
  iconBefore,
52
+ UNSAFE_iconBefore_size,
50
53
  iconAfter,
54
+ UNSAFE_iconAfter_size,
51
55
  interactionName,
52
56
  isDisabled,
53
57
  isSelected,
@@ -10,7 +10,9 @@ const LinkButtonBase = ({
10
10
  isDisabled,
11
11
  isSelected,
12
12
  iconBefore,
13
+ UNSAFE_iconBefore_size,
13
14
  iconAfter,
15
+ UNSAFE_iconAfter_size,
14
16
  children,
15
17
  shouldFitContainer,
16
18
  interactionName,
@@ -36,7 +38,9 @@ const LinkButtonBase = ({
36
38
  buttonType: 'link',
37
39
  children,
38
40
  iconBefore,
41
+ UNSAFE_iconBefore_size,
39
42
  iconAfter,
43
+ UNSAFE_iconAfter_size,
40
44
  interactionName,
41
45
  isDisabled,
42
46
  isSelected,
@@ -15,8 +15,10 @@ const useDefaultButton = ({
15
15
  appearance,
16
16
  autoFocus,
17
17
  buttonType,
18
- iconBefore,
19
- iconAfter,
18
+ iconBefore: IconBefore,
19
+ UNSAFE_iconBefore_size,
20
+ iconAfter: IconAfter,
21
+ UNSAFE_iconAfter_size,
20
22
  interactionName,
21
23
  isDisabled,
22
24
  isSelected,
@@ -42,15 +44,21 @@ const useDefaultButton = ({
42
44
  appearance,
43
45
  autoFocus,
44
46
  buttonType,
45
- children: /*#__PURE__*/React.createElement(Fragment, null, iconBefore && /*#__PURE__*/React.createElement(Content, {
47
+ children: /*#__PURE__*/React.createElement(Fragment, null, IconBefore && /*#__PURE__*/React.createElement(Content, {
46
48
  type: "icon",
47
49
  hasOverlay: hasOverlay
48
- }, iconBefore), children && /*#__PURE__*/React.createElement(Content, {
50
+ }, /*#__PURE__*/React.createElement(IconBefore, {
51
+ label: "",
52
+ size: UNSAFE_iconBefore_size
53
+ })), children && /*#__PURE__*/React.createElement(Content, {
49
54
  hasOverlay: hasOverlay
50
- }, children), iconAfter && /*#__PURE__*/React.createElement(Content, {
55
+ }, children), IconAfter && /*#__PURE__*/React.createElement(Content, {
51
56
  type: "icon",
52
57
  hasOverlay: hasOverlay
53
- }, iconAfter)),
58
+ }, /*#__PURE__*/React.createElement(IconAfter, {
59
+ label: "",
60
+ size: UNSAFE_iconAfter_size
61
+ }))),
54
62
  interactionName,
55
63
  isDisabled,
56
64
  isSelected,
@@ -68,8 +76,8 @@ const useDefaultButton = ({
68
76
  ref,
69
77
  shouldFitContainer,
70
78
  spacing,
71
- hasIconBefore: Boolean(iconBefore),
72
- hasIconAfter: Boolean(iconAfter)
79
+ hasIconBefore: Boolean(IconBefore),
80
+ hasIconAfter: Boolean(IconAfter)
73
81
  });
74
82
  return baseProps;
75
83
  };
@@ -43,10 +43,6 @@ const useIconButton = ({
43
43
  appearance,
44
44
  autoFocus,
45
45
  buttonType,
46
- /**
47
- * TODO: Have not finished IconButton yet. It also needs a required accessible
48
- * label - likely implemented using VisuallyHidden
49
- */
50
46
  children: /*#__PURE__*/React.createElement(Content, {
51
47
  type: "icon",
52
48
  hasOverlay: hasOverlay
@@ -97,7 +97,7 @@ const useButtonBase = ({
97
97
  action: 'clicked',
98
98
  componentName: 'button',
99
99
  packageName: "@atlaskit/button",
100
- packageVersion: "16.17.2",
100
+ packageVersion: "16.17.4",
101
101
  analyticsData: analyticsContext,
102
102
  actionSubject: buttonType
103
103
  });
@@ -103,7 +103,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
103
103
  action: 'clicked',
104
104
  componentName: 'button',
105
105
  packageName: "@atlaskit/button",
106
- packageVersion: "16.17.2",
106
+ packageVersion: "16.17.4",
107
107
  analyticsData: analyticsContext
108
108
  });
109
109
 
@@ -1,30 +1,27 @@
1
1
  /** @jsx jsx */
2
2
 
3
3
  import { css, jsx } from '@emotion/react';
4
+ import { heights } from '../../variants/shared/xcss';
4
5
  import { SplitButtonContext } from './split-button-context';
5
6
  import { getActions } from './utils';
6
- var defaultDividerHeight = '16px';
7
- var defaultDividerStyles = css({
8
- height: defaultDividerHeight,
9
- margin: "var(--ds-space-075, 6px)".concat(" -0.5px")
10
- });
11
- var compactDividerHeight = '12px';
12
- var compactDividerStyles = css({
13
- height: compactDividerHeight,
14
- margin: "var(--ds-space-050, 4px)".concat(" -0.5px")
15
- });
16
7
  var baseDividerStyles = css({
17
8
  display: 'inline-flex',
18
9
  width: '1px',
19
10
  position: 'relative',
20
11
  zIndex: 2
21
12
  });
13
+ var defaultDividerStyles = css({
14
+ height: heights.default
15
+ });
16
+ var compactDividerStyles = css({
17
+ height: heights.compact
18
+ });
22
19
  var dividerDisabledStyles = css({
23
20
  backgroundColor: "var(--ds-text-disabled, #091E4224)",
24
21
  cursor: 'not-allowed'
25
22
  });
26
23
  var navigationDividerStyles = css({
27
- height: compactDividerHeight,
24
+ height: '16px',
28
25
  margin: "var(--ds-space-100, 8px)".concat(" -0.5px"),
29
26
  backgroundColor: "var(--ds-text-subtle, #0052cc)",
30
27
  opacity: 0.62
@@ -38,14 +35,6 @@ var dividerAppearance = {
38
35
  backgroundColor: "var(--ds-text-inverse, #FFF)",
39
36
  opacity: 0.64
40
37
  }),
41
- danger: css({
42
- backgroundColor: "var(--ds-text-inverse, #FFF)",
43
- opacity: 0.66
44
- }),
45
- warning: css({
46
- backgroundColor: "var(--ds-text-warning-inverse, #172B4D)",
47
- opacity: 0.52
48
- }),
49
38
  navigation: navigationDividerStyles
50
39
  };
51
40
  var dividerHeight = {
@@ -63,7 +52,7 @@ export var Divider = function Divider(_ref) {
63
52
  return (
64
53
  // I find it funny to provide a div for Divider
65
54
  jsx("div", {
66
- css: [baseDividerStyles, dividerAppearance[appearance], dividerHeight[spacing], isDisabled ? dividerDisabledStyles : undefined]
55
+ css: [baseDividerStyles, dividerHeight[spacing], dividerAppearance[appearance], isDisabled ? dividerDisabledStyles : undefined]
67
56
  })
68
57
  );
69
58
  };
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["analyticsContext", "autoFocus", "appearance", "spacing", "isDisabled", "isSelected", "iconBefore", "iconAfter", "children", "shouldFitContainer", "interactionName", "overlay", "onClick", "onMouseDownCapture", "onMouseUpCapture", "onKeyDownCapture", "onKeyUpCapture", "onTouchStartCapture", "onTouchEndCapture", "onPointerDownCapture", "onPointerUpCapture", "onClickCapture", "type", "testId"];
3
+ var _excluded = ["analyticsContext", "autoFocus", "appearance", "spacing", "isDisabled", "isSelected", "iconBefore", "UNSAFE_iconAfter_size", "iconAfter", "UNSAFE_iconBefore_size", "children", "shouldFitContainer", "interactionName", "overlay", "onClick", "onMouseDownCapture", "onMouseUpCapture", "onKeyDownCapture", "onKeyUpCapture", "onTouchStartCapture", "onTouchEndCapture", "onPointerDownCapture", "onPointerUpCapture", "onClickCapture", "type", "testId"];
4
4
  import React from 'react';
5
5
  import UNSAFE_PRESSABLE from '@atlaskit/primitives/pressable';
6
6
  import useDefaultButton from './use-default-button';
@@ -23,7 +23,9 @@ var Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function But
23
23
  isDisabled = _ref.isDisabled,
24
24
  isSelected = _ref.isSelected,
25
25
  iconBefore = _ref.iconBefore,
26
+ UNSAFE_iconAfter_size = _ref.UNSAFE_iconAfter_size,
26
27
  iconAfter = _ref.iconAfter,
28
+ UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
27
29
  children = _ref.children,
28
30
  shouldFitContainer = _ref.shouldFitContainer,
29
31
  interactionName = _ref.interactionName,
@@ -49,7 +51,9 @@ var Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function But
49
51
  buttonType: 'button',
50
52
  children: children,
51
53
  iconBefore: iconBefore,
54
+ UNSAFE_iconBefore_size: UNSAFE_iconBefore_size,
52
55
  iconAfter: iconAfter,
56
+ UNSAFE_iconAfter_size: UNSAFE_iconAfter_size,
53
57
  interactionName: interactionName,
54
58
  isDisabled: isDisabled,
55
59
  isSelected: isSelected,
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["analyticsContext", "autoFocus", "appearance", "spacing", "isDisabled", "isSelected", "iconBefore", "iconAfter", "children", "shouldFitContainer", "interactionName", "overlay", "onClick", "onMouseDownCapture", "onMouseUpCapture", "onKeyDownCapture", "onKeyUpCapture", "onTouchStartCapture", "onTouchEndCapture", "onPointerDownCapture", "onPointerUpCapture", "onClickCapture", "testId", "href"];
3
+ var _excluded = ["analyticsContext", "autoFocus", "appearance", "spacing", "isDisabled", "isSelected", "iconBefore", "UNSAFE_iconBefore_size", "iconAfter", "UNSAFE_iconAfter_size", "children", "shouldFitContainer", "interactionName", "overlay", "onClick", "onMouseDownCapture", "onMouseUpCapture", "onKeyDownCapture", "onKeyUpCapture", "onTouchStartCapture", "onTouchEndCapture", "onPointerDownCapture", "onPointerUpCapture", "onClickCapture", "testId", "href"];
4
4
  import React, { forwardRef, memo } from 'react';
5
5
  import UNSAFE_LINK from '@atlaskit/primitives/link';
6
6
  import useDefaultButton from './use-default-button';
@@ -12,7 +12,9 @@ var LinkButtonBase = function LinkButtonBase(_ref, ref) {
12
12
  isDisabled = _ref.isDisabled,
13
13
  isSelected = _ref.isSelected,
14
14
  iconBefore = _ref.iconBefore,
15
+ UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
15
16
  iconAfter = _ref.iconAfter,
17
+ UNSAFE_iconAfter_size = _ref.UNSAFE_iconAfter_size,
16
18
  children = _ref.children,
17
19
  shouldFitContainer = _ref.shouldFitContainer,
18
20
  interactionName = _ref.interactionName,
@@ -37,7 +39,9 @@ var LinkButtonBase = function LinkButtonBase(_ref, ref) {
37
39
  buttonType: 'link',
38
40
  children: children,
39
41
  iconBefore: iconBefore,
42
+ UNSAFE_iconBefore_size: UNSAFE_iconBefore_size,
40
43
  iconAfter: iconAfter,
44
+ UNSAFE_iconAfter_size: UNSAFE_iconAfter_size,
41
45
  interactionName: interactionName,
42
46
  isDisabled: isDisabled,
43
47
  isSelected: isSelected,
@@ -15,8 +15,10 @@ var useDefaultButton = function useDefaultButton(_ref) {
15
15
  appearance = _ref.appearance,
16
16
  autoFocus = _ref.autoFocus,
17
17
  buttonType = _ref.buttonType,
18
- iconBefore = _ref.iconBefore,
19
- iconAfter = _ref.iconAfter,
18
+ IconBefore = _ref.iconBefore,
19
+ UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
20
+ IconAfter = _ref.iconAfter,
21
+ UNSAFE_iconAfter_size = _ref.UNSAFE_iconAfter_size,
20
22
  interactionName = _ref.interactionName,
21
23
  isDisabled = _ref.isDisabled,
22
24
  isSelected = _ref.isSelected,
@@ -41,15 +43,21 @@ var useDefaultButton = function useDefaultButton(_ref) {
41
43
  appearance: appearance,
42
44
  autoFocus: autoFocus,
43
45
  buttonType: buttonType,
44
- children: /*#__PURE__*/React.createElement(Fragment, null, iconBefore && /*#__PURE__*/React.createElement(Content, {
46
+ children: /*#__PURE__*/React.createElement(Fragment, null, IconBefore && /*#__PURE__*/React.createElement(Content, {
45
47
  type: "icon",
46
48
  hasOverlay: hasOverlay
47
- }, iconBefore), children && /*#__PURE__*/React.createElement(Content, {
49
+ }, /*#__PURE__*/React.createElement(IconBefore, {
50
+ label: "",
51
+ size: UNSAFE_iconBefore_size
52
+ })), children && /*#__PURE__*/React.createElement(Content, {
48
53
  hasOverlay: hasOverlay
49
- }, children), iconAfter && /*#__PURE__*/React.createElement(Content, {
54
+ }, children), IconAfter && /*#__PURE__*/React.createElement(Content, {
50
55
  type: "icon",
51
56
  hasOverlay: hasOverlay
52
- }, iconAfter)),
57
+ }, /*#__PURE__*/React.createElement(IconAfter, {
58
+ label: "",
59
+ size: UNSAFE_iconAfter_size
60
+ }))),
53
61
  interactionName: interactionName,
54
62
  isDisabled: isDisabled,
55
63
  isSelected: isSelected,
@@ -67,8 +75,8 @@ var useDefaultButton = function useDefaultButton(_ref) {
67
75
  ref: ref,
68
76
  shouldFitContainer: shouldFitContainer,
69
77
  spacing: spacing,
70
- hasIconBefore: Boolean(iconBefore),
71
- hasIconAfter: Boolean(iconAfter)
78
+ hasIconBefore: Boolean(IconBefore),
79
+ hasIconAfter: Boolean(IconAfter)
72
80
  });
73
81
  return baseProps;
74
82
  };
@@ -42,10 +42,6 @@ var useIconButton = function useIconButton(_ref) {
42
42
  appearance: appearance,
43
43
  autoFocus: autoFocus,
44
44
  buttonType: buttonType,
45
- /**
46
- * TODO: Have not finished IconButton yet. It also needs a required accessible
47
- * label - likely implemented using VisuallyHidden
48
- */
49
45
  children: /*#__PURE__*/React.createElement(Content, {
50
46
  type: "icon",
51
47
  hasOverlay: hasOverlay
@@ -107,7 +107,7 @@ var useButtonBase = function useButtonBase(_ref) {
107
107
  action: 'clicked',
108
108
  componentName: 'button',
109
109
  packageName: "@atlaskit/button",
110
- packageVersion: "16.17.2",
110
+ packageVersion: "16.17.4",
111
111
  analyticsData: analyticsContext,
112
112
  actionSubject: buttonType
113
113
  });
@@ -109,7 +109,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
109
109
  action: 'clicked',
110
110
  componentName: 'button',
111
111
  packageName: "@atlaskit/button",
112
- packageVersion: "16.17.2",
112
+ packageVersion: "16.17.4",
113
113
  analyticsData: analyticsContext
114
114
  });
115
115
 
@@ -1,4 +1,4 @@
1
1
  import type { Appearance, Spacing } from '../../variants/types';
2
- export type SplitButtonAppearance = Extract<Appearance, 'default' | 'primary' | 'danger' | 'warning'>;
2
+ export type SplitButtonAppearance = Extract<Appearance, 'default' | 'primary'>;
3
3
  export type SplitButtonContextAppearance = SplitButtonAppearance | 'navigation';
4
4
  export type SplitButtonSpacing = Extract<Spacing, 'default' | 'compact'>;
@@ -2,7 +2,7 @@ import React, { type Ref } from 'react';
2
2
  import { type CommonLinkVariantProps } from '../types';
3
3
  import { type CommonDefaultButtonProps } from './types';
4
4
  export type LinkButtonProps<RouterLinkConfig extends Record<string, any> = never> = CommonDefaultButtonProps & CommonLinkVariantProps<RouterLinkConfig>;
5
- declare const LinkButtonBase: <RouterLinkConfig extends Record<string, any> = never>({ analyticsContext, autoFocus, appearance, spacing, isDisabled, isSelected, iconBefore, iconAfter, children, shouldFitContainer, interactionName, overlay, onClick, onMouseDownCapture, onMouseUpCapture, onKeyDownCapture, onKeyUpCapture, onTouchStartCapture, onTouchEndCapture, onPointerDownCapture, onPointerUpCapture, onClickCapture, testId, href, ...rest }: LinkButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
5
+ declare const LinkButtonBase: <RouterLinkConfig extends Record<string, any> = never>({ analyticsContext, autoFocus, appearance, spacing, isDisabled, isSelected, iconBefore, UNSAFE_iconBefore_size, iconAfter, UNSAFE_iconAfter_size, children, shouldFitContainer, interactionName, overlay, onClick, onMouseDownCapture, onMouseUpCapture, onKeyDownCapture, onKeyUpCapture, onTouchStartCapture, onTouchEndCapture, onPointerDownCapture, onPointerUpCapture, onClickCapture, testId, href, ...rest }: LinkButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
6
6
  /**
7
7
  * __Link Button__
8
8
  *
@@ -1,13 +1,26 @@
1
- /// <reference types="react" />
1
+ import { type Size } from '@atlaskit/icon/types';
2
+ import { type IconProp } from '../types';
2
3
  export type CommonDefaultButtonProps = {
3
4
  /**
4
5
  * Places an icon within the button, after the button's text
5
6
  */
6
- iconAfter?: React.ReactChild;
7
+ iconAfter?: IconProp;
8
+ /**
9
+ * Set the size of the icon after.
10
+ *
11
+ * This is UNSAFE as it will be removed in future in favor of a 100% bounded API
12
+ */
13
+ UNSAFE_iconAfter_size?: Size;
7
14
  /**
8
15
  * Places an icon within the button, before the button's text
9
16
  */
10
- iconBefore?: React.ReactChild;
17
+ iconBefore?: IconProp;
18
+ /**
19
+ * Set the size of the icon before.
20
+ *
21
+ * This is UNSAFE as it will be removed in future in favor of a 100% bounded API
22
+ */
23
+ UNSAFE_iconBefore_size?: Size;
11
24
  /**
12
25
  * Option to fit button width to its parent width
13
26
  */
@@ -11,5 +11,5 @@ type UseButtonReturn<TagName extends HTMLElement> = UseButtonBaseReturn<TagName>
11
11
  *
12
12
  * @private
13
13
  */
14
- declare const useDefaultButton: <TagName extends HTMLElement>({ analyticsContext, appearance, autoFocus, buttonType, iconBefore, iconAfter, interactionName, isDisabled, isSelected, children, onClick, onMouseDownCapture, onMouseUpCapture, onKeyDownCapture, onKeyUpCapture, onTouchStartCapture, onTouchEndCapture, onPointerDownCapture, onPointerUpCapture, onClickCapture, overlay, ref, shouldFitContainer, spacing, }: UseDefaultButtonArgs<TagName>) => UseButtonReturn<TagName>;
14
+ declare const useDefaultButton: <TagName extends HTMLElement>({ analyticsContext, appearance, autoFocus, buttonType, iconBefore: IconBefore, UNSAFE_iconBefore_size, iconAfter: IconAfter, UNSAFE_iconAfter_size, interactionName, isDisabled, isSelected, children, onClick, onMouseDownCapture, onMouseUpCapture, onKeyDownCapture, onKeyUpCapture, onTouchStartCapture, onTouchEndCapture, onPointerDownCapture, onPointerUpCapture, onClickCapture, overlay, ref, shouldFitContainer, spacing, }: UseDefaultButtonArgs<TagName>) => UseButtonReturn<TagName>;
15
15
  export default useDefaultButton;
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
- import { type IconProps, type Size } from '@atlaskit/icon/types';
3
- import { type IconButtonAppearance } from '../types';
1
+ import { type Size } from '@atlaskit/icon/types';
2
+ import { type IconButtonAppearance, type IconProp } from '../types';
4
3
  export type CommonIconButtonProps = {
5
4
  /**
6
5
  * The button style variation
@@ -9,7 +8,7 @@ export type CommonIconButtonProps = {
9
8
  /**
10
9
  * Places an icon within the button
11
10
  */
12
- icon: React.ComponentType<IconProps>;
11
+ icon: IconProp;
13
12
  /**
14
13
  * Provide an accessible label, often used by screen readers
15
14
  */
@@ -17,7 +16,7 @@ export type CommonIconButtonProps = {
17
16
  /**
18
17
  * Set the size of the icon
19
18
  *
20
- * Set to UNSAFE as it will be removed in future in favour of a 100% bounded API
19
+ * This is UNSAFE as it will be removed in future in favor of a 100% bounded API
21
20
  */
22
21
  UNSAFE_size?: Size;
23
22
  };
@@ -1,10 +1,12 @@
1
1
  import React from 'react';
2
2
  import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
+ import { type IconProps } from '@atlaskit/icon/types';
3
4
  export type ButtonAppearance = 'default' | 'danger' | 'primary' | 'subtle' | 'warning';
4
5
  export type LinkButtonAppearance = 'default' | 'danger' | 'link' | 'primary' | 'subtle' | 'subtle-link' | 'warning';
5
6
  export type IconButtonAppearance = 'default' | 'primary' | 'subtle';
6
7
  export type Appearance = ButtonAppearance | LinkButtonAppearance | IconButtonAppearance;
7
8
  export type Spacing = 'compact' | 'default' | 'none';
9
+ export type IconProp = React.ComponentType<IconProps>;
8
10
  type Combine<First, Second> = Omit<First, keyof Second> & Second;
9
11
  export type CommonButtonProps<TagName extends HTMLElement> = {
10
12
  /**
@@ -1,4 +1,4 @@
1
1
  import type { Appearance, Spacing } from '../../variants/types';
2
- export type SplitButtonAppearance = Extract<Appearance, 'default' | 'primary' | 'danger' | 'warning'>;
2
+ export type SplitButtonAppearance = Extract<Appearance, 'default' | 'primary'>;
3
3
  export type SplitButtonContextAppearance = SplitButtonAppearance | 'navigation';
4
4
  export type SplitButtonSpacing = Extract<Spacing, 'default' | 'compact'>;
@@ -2,7 +2,7 @@ import React, { type Ref } from 'react';
2
2
  import { type CommonLinkVariantProps } from '../types';
3
3
  import { type CommonDefaultButtonProps } from './types';
4
4
  export type LinkButtonProps<RouterLinkConfig extends Record<string, any> = never> = CommonDefaultButtonProps & CommonLinkVariantProps<RouterLinkConfig>;
5
- declare const LinkButtonBase: <RouterLinkConfig extends Record<string, any> = never>({ analyticsContext, autoFocus, appearance, spacing, isDisabled, isSelected, iconBefore, iconAfter, children, shouldFitContainer, interactionName, overlay, onClick, onMouseDownCapture, onMouseUpCapture, onKeyDownCapture, onKeyUpCapture, onTouchStartCapture, onTouchEndCapture, onPointerDownCapture, onPointerUpCapture, onClickCapture, testId, href, ...rest }: LinkButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
5
+ declare const LinkButtonBase: <RouterLinkConfig extends Record<string, any> = never>({ analyticsContext, autoFocus, appearance, spacing, isDisabled, isSelected, iconBefore, UNSAFE_iconBefore_size, iconAfter, UNSAFE_iconAfter_size, children, shouldFitContainer, interactionName, overlay, onClick, onMouseDownCapture, onMouseUpCapture, onKeyDownCapture, onKeyUpCapture, onTouchStartCapture, onTouchEndCapture, onPointerDownCapture, onPointerUpCapture, onClickCapture, testId, href, ...rest }: LinkButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
6
6
  /**
7
7
  * __Link Button__
8
8
  *
@@ -1,13 +1,26 @@
1
- /// <reference types="react" />
1
+ import { type Size } from '@atlaskit/icon/types';
2
+ import { type IconProp } from '../types';
2
3
  export type CommonDefaultButtonProps = {
3
4
  /**
4
5
  * Places an icon within the button, after the button's text
5
6
  */
6
- iconAfter?: React.ReactChild;
7
+ iconAfter?: IconProp;
8
+ /**
9
+ * Set the size of the icon after.
10
+ *
11
+ * This is UNSAFE as it will be removed in future in favor of a 100% bounded API
12
+ */
13
+ UNSAFE_iconAfter_size?: Size;
7
14
  /**
8
15
  * Places an icon within the button, before the button's text
9
16
  */
10
- iconBefore?: React.ReactChild;
17
+ iconBefore?: IconProp;
18
+ /**
19
+ * Set the size of the icon before.
20
+ *
21
+ * This is UNSAFE as it will be removed in future in favor of a 100% bounded API
22
+ */
23
+ UNSAFE_iconBefore_size?: Size;
11
24
  /**
12
25
  * Option to fit button width to its parent width
13
26
  */
@@ -11,5 +11,5 @@ type UseButtonReturn<TagName extends HTMLElement> = UseButtonBaseReturn<TagName>
11
11
  *
12
12
  * @private
13
13
  */
14
- declare const useDefaultButton: <TagName extends HTMLElement>({ analyticsContext, appearance, autoFocus, buttonType, iconBefore, iconAfter, interactionName, isDisabled, isSelected, children, onClick, onMouseDownCapture, onMouseUpCapture, onKeyDownCapture, onKeyUpCapture, onTouchStartCapture, onTouchEndCapture, onPointerDownCapture, onPointerUpCapture, onClickCapture, overlay, ref, shouldFitContainer, spacing, }: UseDefaultButtonArgs<TagName>) => UseButtonReturn<TagName>;
14
+ declare const useDefaultButton: <TagName extends HTMLElement>({ analyticsContext, appearance, autoFocus, buttonType, iconBefore: IconBefore, UNSAFE_iconBefore_size, iconAfter: IconAfter, UNSAFE_iconAfter_size, interactionName, isDisabled, isSelected, children, onClick, onMouseDownCapture, onMouseUpCapture, onKeyDownCapture, onKeyUpCapture, onTouchStartCapture, onTouchEndCapture, onPointerDownCapture, onPointerUpCapture, onClickCapture, overlay, ref, shouldFitContainer, spacing, }: UseDefaultButtonArgs<TagName>) => UseButtonReturn<TagName>;
15
15
  export default useDefaultButton;
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
- import { type IconProps, type Size } from '@atlaskit/icon/types';
3
- import { type IconButtonAppearance } from '../types';
1
+ import { type Size } from '@atlaskit/icon/types';
2
+ import { type IconButtonAppearance, type IconProp } from '../types';
4
3
  export type CommonIconButtonProps = {
5
4
  /**
6
5
  * The button style variation
@@ -9,7 +8,7 @@ export type CommonIconButtonProps = {
9
8
  /**
10
9
  * Places an icon within the button
11
10
  */
12
- icon: React.ComponentType<IconProps>;
11
+ icon: IconProp;
13
12
  /**
14
13
  * Provide an accessible label, often used by screen readers
15
14
  */
@@ -17,7 +16,7 @@ export type CommonIconButtonProps = {
17
16
  /**
18
17
  * Set the size of the icon
19
18
  *
20
- * Set to UNSAFE as it will be removed in future in favour of a 100% bounded API
19
+ * This is UNSAFE as it will be removed in future in favor of a 100% bounded API
21
20
  */
22
21
  UNSAFE_size?: Size;
23
22
  };
@@ -1,10 +1,12 @@
1
1
  import React from 'react';
2
2
  import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
+ import { type IconProps } from '@atlaskit/icon/types';
3
4
  export type ButtonAppearance = 'default' | 'danger' | 'primary' | 'subtle' | 'warning';
4
5
  export type LinkButtonAppearance = 'default' | 'danger' | 'link' | 'primary' | 'subtle' | 'subtle-link' | 'warning';
5
6
  export type IconButtonAppearance = 'default' | 'primary' | 'subtle';
6
7
  export type Appearance = ButtonAppearance | LinkButtonAppearance | IconButtonAppearance;
7
8
  export type Spacing = 'compact' | 'default' | 'none';
9
+ export type IconProp = React.ComponentType<IconProps>;
8
10
  type Combine<First, Second> = Omit<First, keyof Second> & Second;
9
11
  export type CommonButtonProps<TagName extends HTMLElement> = {
10
12
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/button",
3
- "version": "16.17.2",
3
+ "version": "16.17.4",
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/"
@@ -85,7 +85,7 @@
85
85
  "@atlaskit/primitives": "^1.12.0",
86
86
  "@atlaskit/spinner": "^16.0.0",
87
87
  "@atlaskit/theme": "^12.6.0",
88
- "@atlaskit/tokens": "^1.28.0",
88
+ "@atlaskit/tokens": "^1.29.0",
89
89
  "@atlaskit/visually-hidden": "^1.2.4",
90
90
  "@babel/runtime": "^7.0.0",
91
91
  "@emotion/react": "^11.7.1"