@atlaskit/button 17.22.1 → 17.23.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 (30) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/cjs/new-button/containers/split-button/split-button.js +2 -4
  3. package/dist/cjs/new-button/variants/default/button.js +11 -2
  4. package/dist/cjs/new-button/variants/default/link.js +13 -4
  5. package/dist/cjs/new-button/variants/icon/button.js +14 -5
  6. package/dist/cjs/new-button/variants/icon/link.js +11 -2
  7. package/dist/cjs/new-button/variants/shared/use-button-base.js +11 -12
  8. package/dist/cjs/old-button/shared/button-base.js +1 -1
  9. package/dist/cjs/old-button/shared/css.js +2 -3
  10. package/dist/es2019/new-button/containers/split-button/split-button.js +2 -4
  11. package/dist/es2019/new-button/variants/default/button.js +11 -1
  12. package/dist/es2019/new-button/variants/default/link.js +13 -3
  13. package/dist/es2019/new-button/variants/icon/button.js +14 -4
  14. package/dist/es2019/new-button/variants/icon/link.js +11 -1
  15. package/dist/es2019/new-button/variants/shared/use-button-base.js +9 -10
  16. package/dist/es2019/old-button/shared/button-base.js +1 -1
  17. package/dist/es2019/old-button/shared/css.js +3 -4
  18. package/dist/esm/new-button/containers/split-button/split-button.js +2 -4
  19. package/dist/esm/new-button/variants/default/button.js +11 -2
  20. package/dist/esm/new-button/variants/default/link.js +13 -4
  21. package/dist/esm/new-button/variants/icon/button.js +14 -5
  22. package/dist/esm/new-button/variants/icon/link.js +11 -2
  23. package/dist/esm/new-button/variants/shared/use-button-base.js +9 -10
  24. package/dist/esm/old-button/shared/button-base.js +1 -1
  25. package/dist/esm/old-button/shared/css.js +3 -4
  26. package/dist/types/new-button/variants/default/link.d.ts +1 -1
  27. package/dist/types/new-button/variants/icon/link.d.ts +1 -1
  28. package/dist/types-ts4.5/new-button/variants/default/link.d.ts +1 -1
  29. package/dist/types-ts4.5/new-button/variants/icon/link.d.ts +1 -1
  30. package/package.json +5 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @atlaskit/button
2
2
 
3
+ ## 17.23.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#112945](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/112945)
8
+ [`d7af9e23536c0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d7af9e23536c0) -
9
+ New button prevents unintended spread props being passed to children. The following props will now
10
+ be ignored:
11
+
12
+ - css
13
+ - style
14
+ - as
15
+ - className
16
+
17
+ Note: These props were already excluded via types. The API has not changed.
18
+
19
+ ## 17.22.2
20
+
21
+ ### Patch Changes
22
+
23
+ - [#105813](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/105813)
24
+ [`f2f51e7a24d00`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f2f51e7a24d00) -
25
+ Internal change only. Remove references to deprecated @atlaskit/theme constants and replace with
26
+ hard-coded values.
27
+ - Updated dependencies
28
+
3
29
  ## 17.22.1
4
30
 
5
31
  ### Patch Changes
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.SplitButtonWithSlots = exports.SplitButtonContainer = exports.SplitButton = exports.Divider = void 0;
7
7
  var _react = require("@emotion/react");
8
8
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
9
- var _constants = require("@atlaskit/theme/constants");
10
9
  var _splitButtonContext = require("./split-button-context");
11
10
  var _utils = require("./utils");
12
11
  /**
@@ -16,10 +15,9 @@ var _utils = require("./utils");
16
15
 
17
16
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
18
17
 
19
- var fontSize = (0, _constants.fontSize)();
20
18
  var heights = {
21
- default: "".concat(32 / fontSize, "em"),
22
- compact: "".concat(24 / fontSize, "em"),
19
+ default: "".concat(32 / 14, "em"),
20
+ compact: "".concat(24 / 14, "em"),
23
21
  none: 'auto'
24
22
  };
25
23
  var baseDividerStyles = (0, _react.css)({
@@ -8,9 +8,11 @@ exports.default = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
10
  var _react = _interopRequireDefault(require("react"));
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
12
  var _pressable = _interopRequireDefault(require("@atlaskit/primitives/pressable"));
12
13
  var _useDefaultButton = _interopRequireDefault(require("./use-default-button"));
13
- var _excluded = ["analyticsContext", "appearance", "aria-label", "aria-labelledby", "autoFocus", "children", "iconAfter", "iconBefore", "interactionName", "isDisabled", "isLoading", "isSelected", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shouldFitContainer", "spacing", "testId", "type", "UNSAFE_iconAfter_size", "UNSAFE_iconBefore_size"];
14
+ var _excluded = ["analyticsContext", "appearance", "aria-label", "aria-labelledby", "autoFocus", "children", "iconAfter", "iconBefore", "interactionName", "isDisabled", "isLoading", "isSelected", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shouldFitContainer", "spacing", "testId", "type", "UNSAFE_iconAfter_size", "UNSAFE_iconBefore_size"],
15
+ _excluded2 = ["className", "css", "as", "style"];
14
16
  /**
15
17
  * __Button__
16
18
  *
@@ -51,7 +53,14 @@ var Button = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
51
53
  type = _ref$type === void 0 ? 'button' : _ref$type,
52
54
  UNSAFE_iconAfter_size = _ref.UNSAFE_iconAfter_size,
53
55
  UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
54
- rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
56
+ unsafeRest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
57
+ // @ts-expect-error
58
+ var _className = unsafeRest.className,
59
+ _css = unsafeRest.css,
60
+ _as = unsafeRest.as,
61
+ _style = unsafeRest.style,
62
+ saferRest = (0, _objectWithoutProperties2.default)(unsafeRest, _excluded2);
63
+ var rest = (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.remove-unsafe-spread-from-new-button_a2xhw') ? saferRest : unsafeRest;
55
64
  var baseProps = (0, _useDefaultButton.default)({
56
65
  ariaLabel: ariaLabel,
57
66
  ariaLabelledBy: ariaLabelledBy,
@@ -9,9 +9,11 @@ exports.default = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
11
  var _react = _interopRequireWildcard(require("react"));
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
13
  var _anchor = _interopRequireDefault(require("@atlaskit/primitives/anchor"));
13
14
  var _useDefaultButton = _interopRequireDefault(require("./use-default-button"));
14
- var _excluded = ["analyticsContext", "appearance", "aria-label", "aria-labelledby", "autoFocus", "children", "href", "iconAfter", "iconBefore", "interactionName", "isDisabled", "isSelected", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shouldFitContainer", "spacing", "testId", "UNSAFE_iconAfter_size", "UNSAFE_iconBefore_size"];
15
+ var _excluded = ["analyticsContext", "appearance", "aria-label", "aria-labelledby", "autoFocus", "children", "href", "iconAfter", "iconBefore", "interactionName", "isDisabled", "isSelected", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shouldFitContainer", "spacing", "testId", "UNSAFE_iconAfter_size", "UNSAFE_iconBefore_size"],
16
+ _excluded2 = ["className", "css", "as", "style"];
15
17
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
16
18
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
19
  var LinkButtonBase = function LinkButtonBase(_ref, ref) {
@@ -43,12 +45,19 @@ var LinkButtonBase = function LinkButtonBase(_ref, ref) {
43
45
  testId = _ref.testId,
44
46
  UNSAFE_iconAfter_size = _ref.UNSAFE_iconAfter_size,
45
47
  UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
46
- rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
48
+ unsafeRest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
49
+ // @ts-expect-error
50
+ var _className = unsafeRest.className,
51
+ _css = unsafeRest.css,
52
+ _as = unsafeRest.as,
53
+ _style = unsafeRest.style,
54
+ saferRest = (0, _objectWithoutProperties2.default)(unsafeRest, _excluded2);
55
+ var rest = (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.remove-unsafe-spread-from-new-button_a2xhw') ? saferRest : unsafeRest;
47
56
  var baseProps = (0, _useDefaultButton.default)({
48
- ariaLabel: ariaLabel,
49
- ariaLabelledBy: ariaLabelledBy,
50
57
  analyticsContext: analyticsContext,
51
58
  appearance: appearance,
59
+ ariaLabel: ariaLabel,
60
+ ariaLabelledBy: ariaLabelledBy,
52
61
  autoFocus: autoFocus,
53
62
  buttonType: 'link',
54
63
  children: children,
@@ -8,10 +8,12 @@ exports.default = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
10
  var _react = _interopRequireDefault(require("react"));
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
12
  var _pressable = _interopRequireDefault(require("@atlaskit/primitives/pressable"));
12
13
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
13
14
  var _useIconButton = _interopRequireDefault(require("./use-icon-button"));
14
- var _excluded = ["aria-label", "aria-labelledby", "analyticsContext", "appearance", "autoFocus", "icon", "interactionName", "isDisabled", "isLoading", "isSelected", "isTooltipDisabled", "label", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shape", "spacing", "testId", "tooltip", "type", "UNSAFE_size"];
15
+ var _excluded = ["aria-label", "aria-labelledby", "analyticsContext", "appearance", "autoFocus", "icon", "interactionName", "isDisabled", "isLoading", "isSelected", "isTooltipDisabled", "label", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shape", "spacing", "testId", "tooltip", "type", "UNSAFE_size"],
16
+ _excluded2 = ["className", "css", "as", "style"];
15
17
  /**
16
18
  * __Icon Button__
17
19
  *
@@ -53,7 +55,15 @@ var IconButton = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.f
53
55
  _ref$type = _ref.type,
54
56
  type = _ref$type === void 0 ? 'button' : _ref$type,
55
57
  UNSAFE_size = _ref.UNSAFE_size,
56
- rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
58
+ unsafeRest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
59
+ // @ts-expect-error
60
+ var _className = unsafeRest.className,
61
+ _css = unsafeRest.css,
62
+ _as = unsafeRest.as,
63
+ _style = unsafeRest.style,
64
+ saferRest = (0, _objectWithoutProperties2.default)(unsafeRest, _excluded2);
65
+ var rest = (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.remove-unsafe-spread-from-new-button_a2xhw') ? saferRest : unsafeRest;
66
+
57
67
  /**
58
68
  * TODO: At some stage I'll look into re-using more logic across 'default' and 'icon'
59
69
  * buttons. It's currently duplicated and mostly the same.
@@ -105,9 +115,8 @@ var IconButton = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.f
105
115
  hideTooltipOnClick: tooltip === null || tooltip === void 0 ? void 0 : tooltip.hideTooltipOnClick,
106
116
  hideTooltipOnMouseDown: tooltip === null || tooltip === void 0 ? void 0 : tooltip.hideTooltipOnMouseDown
107
117
  }, function (triggerProps) {
108
- return /*#__PURE__*/_react.default.createElement(_pressable.default
109
- // Top level props
110
- , (0, _extends2.default)({}, rest, {
118
+ return /*#__PURE__*/_react.default.createElement(_pressable.default, (0, _extends2.default)({}, rest, {
119
+ // Top level props
111
120
  "aria-labelledby": baseProps['aria-labelledby'],
112
121
  type: type,
113
122
  testId: testId,
@@ -9,10 +9,12 @@ exports.default = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
11
  var _react = _interopRequireWildcard(require("react"));
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
13
  var _anchor = _interopRequireDefault(require("@atlaskit/primitives/anchor"));
13
14
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
14
15
  var _useIconButton = _interopRequireDefault(require("./use-icon-button"));
15
- var _excluded = ["aria-label", "aria-labelledby", "analyticsContext", "appearance", "autoFocus", "href", "icon", "interactionName", "isDisabled", "isSelected", "isTooltipDisabled", "label", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shape", "spacing", "testId", "tooltip", "UNSAFE_size"];
16
+ var _excluded = ["aria-label", "aria-labelledby", "analyticsContext", "appearance", "autoFocus", "href", "icon", "interactionName", "isDisabled", "isSelected", "isTooltipDisabled", "label", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shape", "spacing", "testId", "tooltip", "UNSAFE_size"],
17
+ _excluded2 = ["className", "css", "as", "style"];
16
18
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
17
19
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
20
  var LinkIconButtonBase = function LinkIconButtonBase(_ref, ref) {
@@ -45,7 +47,14 @@ var LinkIconButtonBase = function LinkIconButtonBase(_ref, ref) {
45
47
  testId = _ref.testId,
46
48
  tooltip = _ref.tooltip,
47
49
  UNSAFE_size = _ref.UNSAFE_size,
48
- rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
50
+ unsafeRest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
51
+ // @ts-expect-error
52
+ var _className = unsafeRest.className,
53
+ _css = unsafeRest.css,
54
+ _as = unsafeRest.as,
55
+ _style = unsafeRest.style,
56
+ saferRest = (0, _objectWithoutProperties2.default)(unsafeRest, _excluded2);
57
+ var rest = (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.remove-unsafe-spread-from-new-button_a2xhw') ? saferRest : unsafeRest;
49
58
  var baseProps = (0, _useIconButton.default)({
50
59
  analyticsContext: analyticsContext,
51
60
  appearance: appearance,
@@ -14,16 +14,14 @@ var _useAutoFocus = _interopRequireDefault(require("@atlaskit/ds-lib/use-auto-fo
14
14
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
15
  var _primitives = require("@atlaskit/primitives");
16
16
  var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
17
- var _constants = require("@atlaskit/theme/constants");
18
17
  var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
19
18
  var _splitButtonContext = require("../../containers/split-button/split-button-context");
20
19
  var _blockEvents = _interopRequireDefault(require("./block-events"));
21
- var _constants2 = require("./constants");
20
+ var _constants = require("./constants");
22
21
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
23
22
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
23
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
25
24
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
26
- var fontSize = (0, _constants.fontSize)();
27
25
  var buttonStyles = (0, _primitives.xcss)({
28
26
  display: 'inline-flex',
29
27
  boxSizing: 'border-box',
@@ -36,7 +34,7 @@ var buttonStyles = (0, _primitives.xcss)({
36
34
  borderRadius: 'border.radius.100',
37
35
  borderWidth: 'border.width.0',
38
36
  flexShrink: 0,
39
- height: "".concat(32 / fontSize, "em"),
37
+ height: "".concat(32 / 14, "em"),
40
38
  paddingInlineEnd: 'space.150',
41
39
  paddingInlineStart: 'space.150',
42
40
  textAlign: 'center',
@@ -56,7 +54,7 @@ var hardCodedButtonStyles = (0, _primitives.xcss)({
56
54
  fontSize: 'inherit',
57
55
  fontStyle: 'normal',
58
56
  fontWeight: 500,
59
- lineHeight: "".concat(32 / fontSize, "em"),
57
+ lineHeight: "".concat(32 / 14, "em"),
60
58
  paddingBlock: 'space.0'
61
59
  });
62
60
  var tokenizedButtonStyles = (0, _primitives.xcss)({
@@ -93,6 +91,7 @@ var defaultStyles = (0, _primitives.xcss)({
93
91
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
94
92
  background: "var(--ds-background-neutral, ".concat(colors.N20A, ")"),
95
93
  // @ts-expect-error — using tokens for explicit fallback usage.
94
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- -- Ignored via go/DSP-18766
96
95
  color: "var(--ds-text, ".concat(colors.N500, ")"),
97
96
  ':visited': {
98
97
  // @ts-expect-error
@@ -422,13 +421,13 @@ var selectedDiscoveryStyles = (0, _primitives.xcss)({
422
421
  });
423
422
  var spacingCompactStyles = (0, _primitives.xcss)({
424
423
  columnGap: 'space.050',
425
- height: "".concat(24 / fontSize, "em"),
424
+ height: "".concat(24 / 14, "em"),
426
425
  paddingInlineEnd: 'space.150',
427
426
  paddingInlineStart: 'space.150',
428
427
  verticalAlign: 'middle'
429
428
  });
430
429
  var baseSpacingCompactStyles = (0, _primitives.xcss)({
431
- lineHeight: "".concat(24 / fontSize, "em")
430
+ lineHeight: "".concat(24 / 14, "em")
432
431
  });
433
432
  var tokenizedSpacingCompactStyles = (0, _primitives.xcss)({
434
433
  paddingBlock: 'space.025'
@@ -457,14 +456,14 @@ var nonInteractiveStyles = (0, _primitives.xcss)({
457
456
  cursor: 'not-allowed'
458
457
  });
459
458
  var iconButtonStyles = (0, _primitives.xcss)({
460
- height: "".concat(32 / fontSize, "em"),
461
- width: "".concat(32 / fontSize, "em"),
459
+ height: "".concat(32 / 14, "em"),
460
+ width: "".concat(32 / 14, "em"),
462
461
  paddingInlineEnd: 'space.0',
463
462
  paddingInlineStart: 'space.0'
464
463
  });
465
464
  var iconButtonCompactStyles = (0, _primitives.xcss)({
466
- width: "".concat(24 / fontSize, "em"),
467
- height: "".concat(24 / fontSize, "em")
465
+ width: "".concat(24 / 14, "em"),
466
+ height: "".concat(24 / 14, "em")
468
467
  });
469
468
  var buttonIconBeforeStyles = (0, _primitives.xcss)({
470
469
  paddingInlineStart: 'space.100'
@@ -580,7 +579,7 @@ var useButtonBase = function useButtonBase(_ref) {
580
579
  }, overlay) : null, isLoading && (children && !ariaLabel && !ariaLabelledBy || ariaLabelledBy) && /*#__PURE__*/_react.default.createElement(_visuallyHidden.default, {
581
580
  id: loadingLabelId
582
581
  }, ", Loading")),
583
- 'aria-label': isLoading && ariaLabel && !ariaLabelledBy ? "".concat(ariaLabel, " ").concat(_constants2.LOADING_LABEL) : ariaLabel,
582
+ 'aria-label': isLoading && ariaLabel && !ariaLabelledBy ? "".concat(ariaLabel, " ").concat(_constants.LOADING_LABEL) : ariaLabel,
584
583
  'aria-labelledby': isLoading && ariaLabelledBy ? "".concat(ariaLabelledBy, " ").concat(loadingLabelId) : ariaLabelledBy
585
584
  }, (0, _blockEvents.default)(isEffectivelyDisabled, {
586
585
  onClick: onClick,
@@ -133,7 +133,7 @@ var _default = exports.default = /*#__PURE__*/_react.default.forwardRef(function
133
133
  action: 'clicked',
134
134
  componentName: 'button',
135
135
  packageName: "@atlaskit/button",
136
- packageVersion: "17.22.1",
136
+ packageVersion: "17.23.0",
137
137
  analyticsData: analyticsContext
138
138
  });
139
139
 
@@ -16,7 +16,6 @@ var _colors = _interopRequireDefault(require("./colors"));
16
16
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
17
17
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
18
18
  var gridSize = (0, _constants.gridSize)();
19
- var fontSize = (0, _constants.fontSize)();
20
19
 
21
20
  // ## Button layout
22
21
  //
@@ -31,9 +30,9 @@ var fontSize = (0, _constants.fontSize)();
31
30
  // Margins don't collapse with inline-flex
32
31
  //
33
32
  var heights = {
34
- default: "".concat(gridSize * 4 / fontSize, "em"),
33
+ default: "".concat(32 / 14, "em"),
35
34
  // 32px
36
- compact: "".concat(gridSize * 3 / fontSize, "em"),
35
+ compact: "".concat(24 / 14, "em"),
37
36
  none: 'auto'
38
37
  };
39
38
  var lineHeights = {
@@ -6,11 +6,9 @@
6
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
7
  import { css, jsx } from '@emotion/react';
8
8
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
9
- import { fontSize as getFontSize } from '@atlaskit/theme/constants';
10
- const fontSize = getFontSize();
11
9
  const heights = {
12
- default: `${32 / fontSize}em`,
13
- compact: `${24 / fontSize}em`,
10
+ default: `${32 / 14}em`,
11
+ compact: `${24 / 14}em`,
14
12
  none: 'auto'
15
13
  };
16
14
  import { SplitButtonContext } from './split-button-context';
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
3
4
  import Pressable from '@atlaskit/primitives/pressable';
4
5
  import useDefaultButton from './use-default-button';
5
6
  /**
@@ -41,8 +42,17 @@ const Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function B
41
42
  type = 'button',
42
43
  UNSAFE_iconAfter_size,
43
44
  UNSAFE_iconBefore_size,
44
- ...rest
45
+ ...unsafeRest
45
46
  }, ref) {
47
+ // @ts-expect-error
48
+ const {
49
+ className: _className,
50
+ css: _css,
51
+ as: _as,
52
+ style: _style,
53
+ ...saferRest
54
+ } = unsafeRest;
55
+ const rest = getBooleanFF('platform.design-system-team.remove-unsafe-spread-from-new-button_a2xhw') ? saferRest : unsafeRest;
46
56
  const baseProps = useDefaultButton({
47
57
  ariaLabel,
48
58
  ariaLabelledBy,
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { forwardRef, memo } from 'react';
3
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
3
4
  import Anchor from '@atlaskit/primitives/anchor';
4
5
  import useDefaultButton from './use-default-button';
5
6
  const LinkButtonBase = ({
@@ -31,13 +32,22 @@ const LinkButtonBase = ({
31
32
  testId,
32
33
  UNSAFE_iconAfter_size,
33
34
  UNSAFE_iconBefore_size,
34
- ...rest
35
+ ...unsafeRest
35
36
  }, ref) => {
37
+ // @ts-expect-error
38
+ const {
39
+ className: _className,
40
+ css: _css,
41
+ as: _as,
42
+ style: _style,
43
+ ...saferRest
44
+ } = unsafeRest;
45
+ const rest = getBooleanFF('platform.design-system-team.remove-unsafe-spread-from-new-button_a2xhw') ? saferRest : unsafeRest;
36
46
  const baseProps = useDefaultButton({
37
- ariaLabel,
38
- ariaLabelledBy,
39
47
  analyticsContext,
40
48
  appearance,
49
+ ariaLabel,
50
+ ariaLabelledBy,
41
51
  autoFocus,
42
52
  buttonType: 'link',
43
53
  children,
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
3
4
  import Pressable from '@atlaskit/primitives/pressable';
4
5
  import Tooltip from '@atlaskit/tooltip';
5
6
  import useIconButton from './use-icon-button';
@@ -43,8 +44,18 @@ const IconButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
43
44
  tooltip,
44
45
  type = 'button',
45
46
  UNSAFE_size,
46
- ...rest
47
+ ...unsafeRest
47
48
  }, ref) {
49
+ // @ts-expect-error
50
+ const {
51
+ className: _className,
52
+ css: _css,
53
+ as: _as,
54
+ style: _style,
55
+ ...saferRest
56
+ } = unsafeRest;
57
+ const rest = getBooleanFF('platform.design-system-team.remove-unsafe-spread-from-new-button_a2xhw') ? saferRest : unsafeRest;
58
+
48
59
  /**
49
60
  * TODO: At some stage I'll look into re-using more logic across 'default' and 'icon'
50
61
  * buttons. It's currently duplicated and mostly the same.
@@ -95,9 +106,8 @@ const IconButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
95
106
  component: tooltip === null || tooltip === void 0 ? void 0 : tooltip.component,
96
107
  hideTooltipOnClick: tooltip === null || tooltip === void 0 ? void 0 : tooltip.hideTooltipOnClick,
97
108
  hideTooltipOnMouseDown: tooltip === null || tooltip === void 0 ? void 0 : tooltip.hideTooltipOnMouseDown
98
- }, triggerProps => /*#__PURE__*/React.createElement(Pressable
99
- // Top level props
100
- , _extends({}, rest, {
109
+ }, triggerProps => /*#__PURE__*/React.createElement(Pressable, _extends({}, rest, {
110
+ // Top level props
101
111
  "aria-labelledby": baseProps['aria-labelledby'],
102
112
  type: type,
103
113
  testId: testId,
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { forwardRef, memo } from 'react';
3
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
3
4
  import Anchor from '@atlaskit/primitives/anchor';
4
5
  import Tooltip from '@atlaskit/tooltip';
5
6
  import useIconButton from './use-icon-button';
@@ -33,8 +34,17 @@ const LinkIconButtonBase = ({
33
34
  testId,
34
35
  tooltip,
35
36
  UNSAFE_size,
36
- ...rest
37
+ ...unsafeRest
37
38
  }, ref) => {
39
+ // @ts-expect-error
40
+ const {
41
+ className: _className,
42
+ css: _css,
43
+ as: _as,
44
+ style: _style,
45
+ ...saferRest
46
+ } = unsafeRest;
47
+ const rest = getBooleanFF('platform.design-system-team.remove-unsafe-spread-from-new-button_a2xhw') ? saferRest : unsafeRest;
38
48
  const baseProps = useIconButton({
39
49
  analyticsContext,
40
50
  appearance,
@@ -5,12 +5,10 @@ import useAutoFocus from '@atlaskit/ds-lib/use-auto-focus';
5
5
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
6
6
  import { Box, xcss } from '@atlaskit/primitives';
7
7
  import * as colors from '@atlaskit/theme/colors';
8
- import { fontSize as getFontSize } from '@atlaskit/theme/constants';
9
8
  import VisuallyHidden from '@atlaskit/visually-hidden';
10
9
  import { useSplitButtonContext } from '../../containers/split-button/split-button-context';
11
10
  import blockEvents from './block-events';
12
11
  import { LOADING_LABEL } from './constants';
13
- const fontSize = getFontSize();
14
12
  const buttonStyles = xcss({
15
13
  display: 'inline-flex',
16
14
  boxSizing: 'border-box',
@@ -23,7 +21,7 @@ const buttonStyles = xcss({
23
21
  borderRadius: 'border.radius.100',
24
22
  borderWidth: 'border.width.0',
25
23
  flexShrink: 0,
26
- height: `${32 / fontSize}em`,
24
+ height: `${32 / 14}em`,
27
25
  paddingInlineEnd: 'space.150',
28
26
  paddingInlineStart: 'space.150',
29
27
  textAlign: 'center',
@@ -43,7 +41,7 @@ const hardCodedButtonStyles = xcss({
43
41
  fontSize: 'inherit',
44
42
  fontStyle: 'normal',
45
43
  fontWeight: 500,
46
- lineHeight: `${32 / fontSize}em`,
44
+ lineHeight: `${32 / 14}em`,
47
45
  paddingBlock: 'space.0'
48
46
  });
49
47
  const tokenizedButtonStyles = xcss({
@@ -80,6 +78,7 @@ const defaultStyles = xcss({
80
78
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
81
79
  background: `var(--ds-background-neutral, ${colors.N20A})`,
82
80
  // @ts-expect-error — using tokens for explicit fallback usage.
81
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- -- Ignored via go/DSP-18766
83
82
  color: `var(--ds-text, ${colors.N500})`,
84
83
  ':visited': {
85
84
  // @ts-expect-error
@@ -409,13 +408,13 @@ const selectedDiscoveryStyles = xcss({
409
408
  });
410
409
  const spacingCompactStyles = xcss({
411
410
  columnGap: 'space.050',
412
- height: `${24 / fontSize}em`,
411
+ height: `${24 / 14}em`,
413
412
  paddingInlineEnd: 'space.150',
414
413
  paddingInlineStart: 'space.150',
415
414
  verticalAlign: 'middle'
416
415
  });
417
416
  const baseSpacingCompactStyles = xcss({
418
- lineHeight: `${24 / fontSize}em`
417
+ lineHeight: `${24 / 14}em`
419
418
  });
420
419
  const tokenizedSpacingCompactStyles = xcss({
421
420
  paddingBlock: 'space.025'
@@ -444,14 +443,14 @@ const nonInteractiveStyles = xcss({
444
443
  cursor: 'not-allowed'
445
444
  });
446
445
  const iconButtonStyles = xcss({
447
- height: `${32 / fontSize}em`,
448
- width: `${32 / fontSize}em`,
446
+ height: `${32 / 14}em`,
447
+ width: `${32 / 14}em`,
449
448
  paddingInlineEnd: 'space.0',
450
449
  paddingInlineStart: 'space.0'
451
450
  });
452
451
  const iconButtonCompactStyles = xcss({
453
- width: `${24 / fontSize}em`,
454
- height: `${24 / fontSize}em`
452
+ width: `${24 / 14}em`,
453
+ height: `${24 / 14}em`
455
454
  });
456
455
  const buttonIconBeforeStyles = xcss({
457
456
  paddingInlineStart: 'space.100'
@@ -119,7 +119,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
119
119
  action: 'clicked',
120
120
  componentName: 'button',
121
121
  packageName: "@atlaskit/button",
122
- packageVersion: "17.22.1",
122
+ packageVersion: "17.23.0",
123
123
  analyticsData: analyticsContext
124
124
  });
125
125
 
@@ -1,11 +1,10 @@
1
1
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
2
2
  import { css } from '@emotion/react';
3
- import { fontSize as getFontSize,
3
+ import {
4
4
  // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
5
5
  gridSize as getGridSize } from '@atlaskit/theme/constants';
6
6
  import colors from './colors';
7
7
  const gridSize = getGridSize();
8
- const fontSize = getFontSize();
9
8
 
10
9
  // ## Button layout
11
10
  //
@@ -20,9 +19,9 @@ const fontSize = getFontSize();
20
19
  // Margins don't collapse with inline-flex
21
20
  //
22
21
  const heights = {
23
- default: `${gridSize * 4 / fontSize}em`,
22
+ default: `${32 / 14}em`,
24
23
  // 32px
25
- compact: `${gridSize * 3 / fontSize}em`,
24
+ compact: `${24 / 14}em`,
26
25
  none: 'auto'
27
26
  };
28
27
  const lineHeights = {
@@ -6,11 +6,9 @@
6
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
7
  import { css, jsx } from '@emotion/react';
8
8
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
9
- import { fontSize as getFontSize } from '@atlaskit/theme/constants';
10
- var fontSize = getFontSize();
11
9
  var heights = {
12
- default: "".concat(32 / fontSize, "em"),
13
- compact: "".concat(24 / fontSize, "em"),
10
+ default: "".concat(32 / 14, "em"),
11
+ compact: "".concat(24 / 14, "em"),
14
12
  none: 'auto'
15
13
  };
16
14
  import { SplitButtonContext } from './split-button-context';
@@ -1,7 +1,9 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["analyticsContext", "appearance", "aria-label", "aria-labelledby", "autoFocus", "children", "iconAfter", "iconBefore", "interactionName", "isDisabled", "isLoading", "isSelected", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shouldFitContainer", "spacing", "testId", "type", "UNSAFE_iconAfter_size", "UNSAFE_iconBefore_size"];
3
+ var _excluded = ["analyticsContext", "appearance", "aria-label", "aria-labelledby", "autoFocus", "children", "iconAfter", "iconBefore", "interactionName", "isDisabled", "isLoading", "isSelected", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shouldFitContainer", "spacing", "testId", "type", "UNSAFE_iconAfter_size", "UNSAFE_iconBefore_size"],
4
+ _excluded2 = ["className", "css", "as", "style"];
4
5
  import React from 'react';
6
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
7
  import Pressable from '@atlaskit/primitives/pressable';
6
8
  import useDefaultButton from './use-default-button';
7
9
  /**
@@ -44,7 +46,14 @@ var Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function But
44
46
  type = _ref$type === void 0 ? 'button' : _ref$type,
45
47
  UNSAFE_iconAfter_size = _ref.UNSAFE_iconAfter_size,
46
48
  UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
47
- rest = _objectWithoutProperties(_ref, _excluded);
49
+ unsafeRest = _objectWithoutProperties(_ref, _excluded);
50
+ // @ts-expect-error
51
+ var _className = unsafeRest.className,
52
+ _css = unsafeRest.css,
53
+ _as = unsafeRest.as,
54
+ _style = unsafeRest.style,
55
+ saferRest = _objectWithoutProperties(unsafeRest, _excluded2);
56
+ var rest = getBooleanFF('platform.design-system-team.remove-unsafe-spread-from-new-button_a2xhw') ? saferRest : unsafeRest;
48
57
  var baseProps = useDefaultButton({
49
58
  ariaLabel: ariaLabel,
50
59
  ariaLabelledBy: ariaLabelledBy,
@@ -1,7 +1,9 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["analyticsContext", "appearance", "aria-label", "aria-labelledby", "autoFocus", "children", "href", "iconAfter", "iconBefore", "interactionName", "isDisabled", "isSelected", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shouldFitContainer", "spacing", "testId", "UNSAFE_iconAfter_size", "UNSAFE_iconBefore_size"];
3
+ var _excluded = ["analyticsContext", "appearance", "aria-label", "aria-labelledby", "autoFocus", "children", "href", "iconAfter", "iconBefore", "interactionName", "isDisabled", "isSelected", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shouldFitContainer", "spacing", "testId", "UNSAFE_iconAfter_size", "UNSAFE_iconBefore_size"],
4
+ _excluded2 = ["className", "css", "as", "style"];
4
5
  import React, { forwardRef, memo } from 'react';
6
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
7
  import Anchor from '@atlaskit/primitives/anchor';
6
8
  import useDefaultButton from './use-default-button';
7
9
  var LinkButtonBase = function LinkButtonBase(_ref, ref) {
@@ -33,12 +35,19 @@ var LinkButtonBase = function LinkButtonBase(_ref, ref) {
33
35
  testId = _ref.testId,
34
36
  UNSAFE_iconAfter_size = _ref.UNSAFE_iconAfter_size,
35
37
  UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
36
- rest = _objectWithoutProperties(_ref, _excluded);
38
+ unsafeRest = _objectWithoutProperties(_ref, _excluded);
39
+ // @ts-expect-error
40
+ var _className = unsafeRest.className,
41
+ _css = unsafeRest.css,
42
+ _as = unsafeRest.as,
43
+ _style = unsafeRest.style,
44
+ saferRest = _objectWithoutProperties(unsafeRest, _excluded2);
45
+ var rest = getBooleanFF('platform.design-system-team.remove-unsafe-spread-from-new-button_a2xhw') ? saferRest : unsafeRest;
37
46
  var baseProps = useDefaultButton({
38
- ariaLabel: ariaLabel,
39
- ariaLabelledBy: ariaLabelledBy,
40
47
  analyticsContext: analyticsContext,
41
48
  appearance: appearance,
49
+ ariaLabel: ariaLabel,
50
+ ariaLabelledBy: ariaLabelledBy,
42
51
  autoFocus: autoFocus,
43
52
  buttonType: 'link',
44
53
  children: children,
@@ -1,7 +1,9 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["aria-label", "aria-labelledby", "analyticsContext", "appearance", "autoFocus", "icon", "interactionName", "isDisabled", "isLoading", "isSelected", "isTooltipDisabled", "label", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shape", "spacing", "testId", "tooltip", "type", "UNSAFE_size"];
3
+ var _excluded = ["aria-label", "aria-labelledby", "analyticsContext", "appearance", "autoFocus", "icon", "interactionName", "isDisabled", "isLoading", "isSelected", "isTooltipDisabled", "label", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shape", "spacing", "testId", "tooltip", "type", "UNSAFE_size"],
4
+ _excluded2 = ["className", "css", "as", "style"];
4
5
  import React from 'react';
6
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
7
  import Pressable from '@atlaskit/primitives/pressable';
6
8
  import Tooltip from '@atlaskit/tooltip';
7
9
  import useIconButton from './use-icon-button';
@@ -46,7 +48,15 @@ var IconButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
46
48
  _ref$type = _ref.type,
47
49
  type = _ref$type === void 0 ? 'button' : _ref$type,
48
50
  UNSAFE_size = _ref.UNSAFE_size,
49
- rest = _objectWithoutProperties(_ref, _excluded);
51
+ unsafeRest = _objectWithoutProperties(_ref, _excluded);
52
+ // @ts-expect-error
53
+ var _className = unsafeRest.className,
54
+ _css = unsafeRest.css,
55
+ _as = unsafeRest.as,
56
+ _style = unsafeRest.style,
57
+ saferRest = _objectWithoutProperties(unsafeRest, _excluded2);
58
+ var rest = getBooleanFF('platform.design-system-team.remove-unsafe-spread-from-new-button_a2xhw') ? saferRest : unsafeRest;
59
+
50
60
  /**
51
61
  * TODO: At some stage I'll look into re-using more logic across 'default' and 'icon'
52
62
  * buttons. It's currently duplicated and mostly the same.
@@ -98,9 +108,8 @@ var IconButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
98
108
  hideTooltipOnClick: tooltip === null || tooltip === void 0 ? void 0 : tooltip.hideTooltipOnClick,
99
109
  hideTooltipOnMouseDown: tooltip === null || tooltip === void 0 ? void 0 : tooltip.hideTooltipOnMouseDown
100
110
  }, function (triggerProps) {
101
- return /*#__PURE__*/React.createElement(Pressable
102
- // Top level props
103
- , _extends({}, rest, {
111
+ return /*#__PURE__*/React.createElement(Pressable, _extends({}, rest, {
112
+ // Top level props
104
113
  "aria-labelledby": baseProps['aria-labelledby'],
105
114
  type: type,
106
115
  testId: testId,
@@ -1,7 +1,9 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["aria-label", "aria-labelledby", "analyticsContext", "appearance", "autoFocus", "href", "icon", "interactionName", "isDisabled", "isSelected", "isTooltipDisabled", "label", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shape", "spacing", "testId", "tooltip", "UNSAFE_size"];
3
+ var _excluded = ["aria-label", "aria-labelledby", "analyticsContext", "appearance", "autoFocus", "href", "icon", "interactionName", "isDisabled", "isSelected", "isTooltipDisabled", "label", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shape", "spacing", "testId", "tooltip", "UNSAFE_size"],
4
+ _excluded2 = ["className", "css", "as", "style"];
4
5
  import React, { forwardRef, memo } from 'react';
6
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
7
  import Anchor from '@atlaskit/primitives/anchor';
6
8
  import Tooltip from '@atlaskit/tooltip';
7
9
  import useIconButton from './use-icon-button';
@@ -35,7 +37,14 @@ var LinkIconButtonBase = function LinkIconButtonBase(_ref, ref) {
35
37
  testId = _ref.testId,
36
38
  tooltip = _ref.tooltip,
37
39
  UNSAFE_size = _ref.UNSAFE_size,
38
- rest = _objectWithoutProperties(_ref, _excluded);
40
+ unsafeRest = _objectWithoutProperties(_ref, _excluded);
41
+ // @ts-expect-error
42
+ var _className = unsafeRest.className,
43
+ _css = unsafeRest.css,
44
+ _as = unsafeRest.as,
45
+ _style = unsafeRest.style,
46
+ saferRest = _objectWithoutProperties(unsafeRest, _excluded2);
47
+ var rest = getBooleanFF('platform.design-system-team.remove-unsafe-spread-from-new-button_a2xhw') ? saferRest : unsafeRest;
39
48
  var baseProps = useIconButton({
40
49
  analyticsContext: analyticsContext,
41
50
  appearance: appearance,
@@ -8,12 +8,10 @@ import useAutoFocus from '@atlaskit/ds-lib/use-auto-focus';
8
8
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
9
9
  import { Box, xcss } from '@atlaskit/primitives';
10
10
  import * as colors from '@atlaskit/theme/colors';
11
- import { fontSize as getFontSize } from '@atlaskit/theme/constants';
12
11
  import VisuallyHidden from '@atlaskit/visually-hidden';
13
12
  import { useSplitButtonContext } from '../../containers/split-button/split-button-context';
14
13
  import blockEvents from './block-events';
15
14
  import { LOADING_LABEL } from './constants';
16
- var fontSize = getFontSize();
17
15
  var buttonStyles = xcss({
18
16
  display: 'inline-flex',
19
17
  boxSizing: 'border-box',
@@ -26,7 +24,7 @@ var buttonStyles = xcss({
26
24
  borderRadius: 'border.radius.100',
27
25
  borderWidth: 'border.width.0',
28
26
  flexShrink: 0,
29
- height: "".concat(32 / fontSize, "em"),
27
+ height: "".concat(32 / 14, "em"),
30
28
  paddingInlineEnd: 'space.150',
31
29
  paddingInlineStart: 'space.150',
32
30
  textAlign: 'center',
@@ -46,7 +44,7 @@ var hardCodedButtonStyles = xcss({
46
44
  fontSize: 'inherit',
47
45
  fontStyle: 'normal',
48
46
  fontWeight: 500,
49
- lineHeight: "".concat(32 / fontSize, "em"),
47
+ lineHeight: "".concat(32 / 14, "em"),
50
48
  paddingBlock: 'space.0'
51
49
  });
52
50
  var tokenizedButtonStyles = xcss({
@@ -83,6 +81,7 @@ var defaultStyles = xcss({
83
81
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
84
82
  background: "var(--ds-background-neutral, ".concat(colors.N20A, ")"),
85
83
  // @ts-expect-error — using tokens for explicit fallback usage.
84
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- -- Ignored via go/DSP-18766
86
85
  color: "var(--ds-text, ".concat(colors.N500, ")"),
87
86
  ':visited': {
88
87
  // @ts-expect-error
@@ -412,13 +411,13 @@ var selectedDiscoveryStyles = xcss({
412
411
  });
413
412
  var spacingCompactStyles = xcss({
414
413
  columnGap: 'space.050',
415
- height: "".concat(24 / fontSize, "em"),
414
+ height: "".concat(24 / 14, "em"),
416
415
  paddingInlineEnd: 'space.150',
417
416
  paddingInlineStart: 'space.150',
418
417
  verticalAlign: 'middle'
419
418
  });
420
419
  var baseSpacingCompactStyles = xcss({
421
- lineHeight: "".concat(24 / fontSize, "em")
420
+ lineHeight: "".concat(24 / 14, "em")
422
421
  });
423
422
  var tokenizedSpacingCompactStyles = xcss({
424
423
  paddingBlock: 'space.025'
@@ -447,14 +446,14 @@ var nonInteractiveStyles = xcss({
447
446
  cursor: 'not-allowed'
448
447
  });
449
448
  var iconButtonStyles = xcss({
450
- height: "".concat(32 / fontSize, "em"),
451
- width: "".concat(32 / fontSize, "em"),
449
+ height: "".concat(32 / 14, "em"),
450
+ width: "".concat(32 / 14, "em"),
452
451
  paddingInlineEnd: 'space.0',
453
452
  paddingInlineStart: 'space.0'
454
453
  });
455
454
  var iconButtonCompactStyles = xcss({
456
- width: "".concat(24 / fontSize, "em"),
457
- height: "".concat(24 / fontSize, "em")
455
+ width: "".concat(24 / 14, "em"),
456
+ height: "".concat(24 / 14, "em")
458
457
  });
459
458
  var buttonIconBeforeStyles = xcss({
460
459
  paddingInlineStart: 'space.100'
@@ -125,7 +125,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
125
125
  action: 'clicked',
126
126
  componentName: 'button',
127
127
  packageName: "@atlaskit/button",
128
- packageVersion: "17.22.1",
128
+ packageVersion: "17.23.0",
129
129
  analyticsData: analyticsContext
130
130
  });
131
131
 
@@ -3,12 +3,11 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
5
5
  import { css } from '@emotion/react';
6
- import { fontSize as getFontSize,
6
+ import {
7
7
  // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
8
8
  gridSize as getGridSize } from '@atlaskit/theme/constants';
9
9
  import colors from './colors';
10
10
  var gridSize = getGridSize();
11
- var fontSize = getFontSize();
12
11
 
13
12
  // ## Button layout
14
13
  //
@@ -23,9 +22,9 @@ var fontSize = getFontSize();
23
22
  // Margins don't collapse with inline-flex
24
23
  //
25
24
  var heights = {
26
- default: "".concat(gridSize * 4 / fontSize, "em"),
25
+ default: "".concat(32 / 14, "em"),
27
26
  // 32px
28
- compact: "".concat(gridSize * 3 / fontSize, "em"),
27
+ compact: "".concat(24 / 14, "em"),
29
28
  none: 'auto'
30
29
  };
31
30
  var lineHeights = {
@@ -2,7 +2,7 @@ import { type Ref } from 'react';
2
2
  import { type AdditionalDefaultLinkVariantProps, 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> & AdditionalDefaultLinkVariantProps;
5
- declare const LinkButtonBase: <RouterLinkConfig extends Record<string, any> = never>({ analyticsContext, appearance, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, autoFocus, children, href, iconAfter, iconBefore, interactionName, isDisabled, isSelected, onClick, onClickCapture, onKeyDownCapture, onKeyUpCapture, onMouseDownCapture, onMouseUpCapture, onPointerDownCapture, onPointerUpCapture, onTouchEndCapture, onTouchStartCapture, overlay, shouldFitContainer, spacing, testId, UNSAFE_iconAfter_size, UNSAFE_iconBefore_size, ...rest }: LinkButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
5
+ declare const LinkButtonBase: <RouterLinkConfig extends Record<string, any> = never>({ analyticsContext, appearance, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, autoFocus, children, href, iconAfter, iconBefore, interactionName, isDisabled, isSelected, onClick, onClickCapture, onKeyDownCapture, onKeyUpCapture, onMouseDownCapture, onMouseUpCapture, onPointerDownCapture, onPointerUpCapture, onTouchEndCapture, onTouchStartCapture, overlay, shouldFitContainer, spacing, testId, UNSAFE_iconAfter_size, UNSAFE_iconBefore_size, ...unsafeRest }: LinkButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
6
6
  /**
7
7
  * __Link Button__
8
8
  *
@@ -2,7 +2,7 @@ import { type Ref } from 'react';
2
2
  import { type CommonLinkVariantProps } from '../types';
3
3
  import { type CommonIconButtonProps } from './types';
4
4
  export type LinkIconButtonProps<RouterLinkConfig extends Record<string, any> = never> = CommonIconButtonProps & CommonLinkVariantProps<RouterLinkConfig>;
5
- declare const LinkIconButtonBase: <RouterLinkConfig extends Record<string, any> = never>({ "aria-label": preventedAriaLabel, "aria-labelledby": ariaLabelledBy, analyticsContext, appearance, autoFocus, href, icon, interactionName, isDisabled, isSelected, isTooltipDisabled, label, onClick, onClickCapture, onKeyDownCapture, onKeyUpCapture, onMouseDownCapture, onMouseUpCapture, onPointerDownCapture, onPointerUpCapture, onTouchEndCapture, onTouchStartCapture, overlay, shape, spacing, testId, tooltip, UNSAFE_size, ...rest }: LinkIconButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
5
+ declare const LinkIconButtonBase: <RouterLinkConfig extends Record<string, any> = never>({ "aria-label": preventedAriaLabel, "aria-labelledby": ariaLabelledBy, analyticsContext, appearance, autoFocus, href, icon, interactionName, isDisabled, isSelected, isTooltipDisabled, label, onClick, onClickCapture, onKeyDownCapture, onKeyUpCapture, onMouseDownCapture, onMouseUpCapture, onPointerDownCapture, onPointerUpCapture, onTouchEndCapture, onTouchStartCapture, overlay, shape, spacing, testId, tooltip, UNSAFE_size, ...unsafeRest }: LinkIconButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
6
6
  /**
7
7
  * __Link Icon Button__
8
8
  *
@@ -2,7 +2,7 @@ import { type Ref } from 'react';
2
2
  import { type AdditionalDefaultLinkVariantProps, 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> & AdditionalDefaultLinkVariantProps;
5
- declare const LinkButtonBase: <RouterLinkConfig extends Record<string, any> = never>({ analyticsContext, appearance, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, autoFocus, children, href, iconAfter, iconBefore, interactionName, isDisabled, isSelected, onClick, onClickCapture, onKeyDownCapture, onKeyUpCapture, onMouseDownCapture, onMouseUpCapture, onPointerDownCapture, onPointerUpCapture, onTouchEndCapture, onTouchStartCapture, overlay, shouldFitContainer, spacing, testId, UNSAFE_iconAfter_size, UNSAFE_iconBefore_size, ...rest }: LinkButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
5
+ declare const LinkButtonBase: <RouterLinkConfig extends Record<string, any> = never>({ analyticsContext, appearance, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, autoFocus, children, href, iconAfter, iconBefore, interactionName, isDisabled, isSelected, onClick, onClickCapture, onKeyDownCapture, onKeyUpCapture, onMouseDownCapture, onMouseUpCapture, onPointerDownCapture, onPointerUpCapture, onTouchEndCapture, onTouchStartCapture, overlay, shouldFitContainer, spacing, testId, UNSAFE_iconAfter_size, UNSAFE_iconBefore_size, ...unsafeRest }: LinkButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
6
6
  /**
7
7
  * __Link Button__
8
8
  *
@@ -2,7 +2,7 @@ import { type Ref } from 'react';
2
2
  import { type CommonLinkVariantProps } from '../types';
3
3
  import { type CommonIconButtonProps } from './types';
4
4
  export type LinkIconButtonProps<RouterLinkConfig extends Record<string, any> = never> = CommonIconButtonProps & CommonLinkVariantProps<RouterLinkConfig>;
5
- declare const LinkIconButtonBase: <RouterLinkConfig extends Record<string, any> = never>({ "aria-label": preventedAriaLabel, "aria-labelledby": ariaLabelledBy, analyticsContext, appearance, autoFocus, href, icon, interactionName, isDisabled, isSelected, isTooltipDisabled, label, onClick, onClickCapture, onKeyDownCapture, onKeyUpCapture, onMouseDownCapture, onMouseUpCapture, onPointerDownCapture, onPointerUpCapture, onTouchEndCapture, onTouchStartCapture, overlay, shape, spacing, testId, tooltip, UNSAFE_size, ...rest }: LinkIconButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
5
+ declare const LinkIconButtonBase: <RouterLinkConfig extends Record<string, any> = never>({ "aria-label": preventedAriaLabel, "aria-labelledby": ariaLabelledBy, analyticsContext, appearance, autoFocus, href, icon, interactionName, isDisabled, isSelected, isTooltipDisabled, label, onClick, onClickCapture, onKeyDownCapture, onKeyUpCapture, onMouseDownCapture, onMouseUpCapture, onPointerDownCapture, onPointerUpCapture, onTouchEndCapture, onTouchStartCapture, overlay, shape, spacing, testId, tooltip, UNSAFE_size, ...unsafeRest }: LinkIconButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
6
6
  /**
7
7
  * __Link Icon Button__
8
8
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/button",
3
- "version": "17.22.1",
3
+ "version": "17.23.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/"
@@ -137,7 +137,7 @@
137
137
  "@atlaskit/platform-feature-flags": "^0.2.5",
138
138
  "@atlaskit/primitives": "^8.0.0",
139
139
  "@atlaskit/spinner": "^16.2.0",
140
- "@atlaskit/theme": "^12.10.0",
140
+ "@atlaskit/theme": "^12.11.0",
141
141
  "@atlaskit/tokens": "^1.51.0",
142
142
  "@atlaskit/tooltip": "^18.5.0",
143
143
  "@atlaskit/visually-hidden": "^1.4.0",
@@ -204,6 +204,9 @@
204
204
  "platform.design-system-team.component-visual-refresh_t8zbo": {
205
205
  "type": "boolean"
206
206
  },
207
+ "platform.design-system-team.remove-unsafe-spread-from-new-button_a2xhw": {
208
+ "type": "boolean"
209
+ },
207
210
  "platform.design-system-team.button-render-prop-fix_lyo55": {
208
211
  "type": "boolean"
209
212
  }