@atlaskit/button 20.4.2 → 20.5.1

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 (25) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/new-button/containers/split-button/split-button.js +23 -1
  3. package/dist/cjs/new-button/variants/shared/use-button-base.js +55 -2
  4. package/dist/cjs/old-button/shared/button-base.js +1 -1
  5. package/dist/es2019/new-button/containers/split-button/split-button.js +23 -1
  6. package/dist/es2019/new-button/variants/shared/use-button-base.js +55 -2
  7. package/dist/es2019/old-button/shared/button-base.js +1 -1
  8. package/dist/esm/new-button/containers/split-button/split-button.js +23 -1
  9. package/dist/esm/new-button/variants/shared/use-button-base.js +55 -2
  10. package/dist/esm/old-button/shared/button-base.js +1 -1
  11. package/dist/types/new-button/containers/split-button/utils.d.ts +2 -2
  12. package/dist/types/new-button/variants/default/link.d.ts +2 -2
  13. package/dist/types/new-button/variants/icon/link.d.ts +2 -2
  14. package/dist/types/new-button/variants/shared/content.d.ts +1 -1
  15. package/dist/types/new-button/variants/shared/icon-renderer.d.ts +2 -2
  16. package/dist/types/new-button/variants/shared/loading-overlay.d.ts +2 -2
  17. package/dist/types/old-button/shared/loading-spinner.d.ts +2 -2
  18. package/dist/types-ts4.5/new-button/containers/split-button/utils.d.ts +2 -2
  19. package/dist/types-ts4.5/new-button/variants/default/link.d.ts +2 -2
  20. package/dist/types-ts4.5/new-button/variants/icon/link.d.ts +2 -2
  21. package/dist/types-ts4.5/new-button/variants/shared/content.d.ts +1 -1
  22. package/dist/types-ts4.5/new-button/variants/shared/icon-renderer.d.ts +2 -2
  23. package/dist/types-ts4.5/new-button/variants/shared/loading-overlay.d.ts +2 -2
  24. package/dist/types-ts4.5/old-button/shared/loading-spinner.d.ts +2 -2
  25. package/package.json +6 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/button
2
2
 
3
+ ## 20.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 20.5.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#110533](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110533)
14
+ [`9856bf5d3faeb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9856bf5d3faeb) -
15
+ Updated styles for new button to use `rem` unit for width and height instead of `em` with
16
+ fractional units.
17
+
3
18
  ## 20.4.2
4
19
 
5
20
  ### Patch Changes
@@ -68,6 +68,14 @@ var dividerHeight = {
68
68
  height: "".concat(24 / 14, "em")
69
69
  })
70
70
  };
71
+ var dividerHeightWithRem = {
72
+ default: (0, _react.css)({
73
+ height: '2rem'
74
+ }),
75
+ compact: (0, _react.css)({
76
+ height: '1.5rem'
77
+ })
78
+ };
71
79
  var defaultDividerHeight = {
72
80
  // The divider height is calculated by subtracting twice the border width from the button height.
73
81
  // This ensures the divider does not intersect with the button's border, avoiding visual issues
@@ -79,6 +87,17 @@ var defaultDividerHeight = {
79
87
  height: "calc(".concat(24 / 14, "em - ", "var(--ds-border-width, 1px)", " - ", "var(--ds-border-width, 1px)", ")")
80
88
  })
81
89
  };
90
+ var defaultDividerHeightWithRem = {
91
+ // The divider height is calculated by subtracting twice the border width from the button height.
92
+ // This ensures the divider does not intersect with the button's border, avoiding visual issues
93
+ // caused by overlapping alpha colors (color.border) at the intersection.
94
+ default: (0, _react.css)({
95
+ height: "calc(2rem - ".concat("var(--ds-border-width, 1px)", " - ", "var(--ds-border-width, 1px)", ")")
96
+ }),
97
+ compact: (0, _react.css)({
98
+ height: "calc(1.5rem - ".concat("var(--ds-border-width, 1px)", " - ", "var(--ds-border-width, 1px)", ")")
99
+ })
100
+ };
82
101
  /**
83
102
  * TODO: Add JSDoc
84
103
  */
@@ -87,10 +106,13 @@ var Divider = exports.Divider = function Divider(_ref) {
87
106
  spacing = _ref.spacing,
88
107
  _ref$isDisabled = _ref.isDisabled,
89
108
  isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled;
109
+ // Pulling these out of the below `css` prop to avoid nested ternaries
110
+ var defaultDividerHeightStyles = (0, _platformFeatureFlags.fg)('platform_dst_button_replace_em_with_rem') ? defaultDividerHeightWithRem : defaultDividerHeight;
111
+ var dividerHeightStyles = (0, _platformFeatureFlags.fg)('platform_dst_button_replace_em_with_rem') ? dividerHeightWithRem : dividerHeight;
90
112
  return (
91
113
  // I find it funny to provide a div for Divider
92
114
  (0, _react.jsx)("div", {
93
- css: [baseDividerStyles, appearance === 'default' && !isDisabled && (0, _platformFeatureFlags.fg)('platform-component-visual-refresh') ? defaultDividerHeight[spacing] : dividerHeight[spacing], isDisabled && ((0, _platformFeatureFlags.fg)('platform-component-visual-refresh') ? dividerDisabledRefreshedStyles : dividerDisabledStyles), !isDisabled && ((0, _platformFeatureFlags.fg)('platform-component-visual-refresh') ? dividerRefreshedAppearance[appearance] : dividerAppearance[appearance]), (0, _platformFeatureFlags.fg)('platform-component-visual-refresh') && dividerRefreshedOffsetStyles]
115
+ css: [baseDividerStyles, appearance === 'default' && !isDisabled && (0, _platformFeatureFlags.fg)('platform-component-visual-refresh') ? defaultDividerHeightStyles[spacing] : dividerHeightStyles[spacing], isDisabled && ((0, _platformFeatureFlags.fg)('platform-component-visual-refresh') ? dividerDisabledRefreshedStyles : dividerDisabledStyles), !isDisabled && ((0, _platformFeatureFlags.fg)('platform-component-visual-refresh') ? dividerRefreshedAppearance[appearance] : dividerAppearance[appearance]), (0, _platformFeatureFlags.fg)('platform-component-visual-refresh') && dividerRefreshedOffsetStyles]
94
116
  })
95
117
  );
96
118
  };
@@ -23,6 +23,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
23
23
  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 && {}.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
24
  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
25
  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
+ // If updating `buttonStyles`, also update `buttonStylesWithRem`.
26
27
  var buttonStyles = (0, _primitives.xcss)({
27
28
  display: 'inline-flex',
28
29
  boxSizing: 'border-box',
@@ -53,6 +54,36 @@ var buttonStyles = (0, _primitives.xcss)({
53
54
  position: 'absolute'
54
55
  }
55
56
  });
57
+ var buttonStylesWithRem = (0, _primitives.xcss)({
58
+ display: 'inline-flex',
59
+ boxSizing: 'border-box',
60
+ width: 'auto',
61
+ maxWidth: '100%',
62
+ position: 'relative',
63
+ alignItems: 'baseline',
64
+ justifyContent: 'center',
65
+ columnGap: 'space.050',
66
+ borderRadius: 'border.radius.100',
67
+ borderWidth: 'border.width.0',
68
+ flexShrink: 0,
69
+ height: '2rem',
70
+ font: 'font.body',
71
+ fontWeight: 'font.weight.medium',
72
+ paddingBlock: 'space.075',
73
+ paddingInlineEnd: 'space.150',
74
+ paddingInlineStart: 'space.150',
75
+ textAlign: 'center',
76
+ transition: 'background 0.1s ease-out',
77
+ verticalAlign: 'middle',
78
+ '::after': {
79
+ borderRadius: 'inherit',
80
+ inset: 'space.0',
81
+ borderStyle: 'solid',
82
+ borderWidth: "var(--ds-border-width, 1px)",
83
+ pointerEvents: 'none',
84
+ position: 'absolute'
85
+ }
86
+ });
56
87
  var defaultInteractiveStyles = (0, _primitives.xcss)({
57
88
  ':hover': {
58
89
  background: "var(--ds-background-neutral-hovered, #091e4214)",
@@ -362,6 +393,8 @@ var selectedDiscoveryStyles = (0, _primitives.xcss)({
362
393
  background: "var(--ds-background-selected, #403294)"
363
394
  }
364
395
  });
396
+
397
+ // If updating `spacingCompactStyles`, also update `spacingCompactStylesWithRem`.
365
398
  var spacingCompactStyles = (0, _primitives.xcss)({
366
399
  columnGap: 'space.050',
367
400
  height: "".concat(24 / 14, "em"),
@@ -370,6 +403,14 @@ var spacingCompactStyles = (0, _primitives.xcss)({
370
403
  paddingInlineStart: 'space.150',
371
404
  verticalAlign: 'middle'
372
405
  });
406
+ var spacingCompactStylesWithRem = (0, _primitives.xcss)({
407
+ columnGap: 'space.050',
408
+ height: '1.5rem',
409
+ paddingBlock: 'space.025',
410
+ paddingInlineEnd: 'space.150',
411
+ paddingInlineStart: 'space.150',
412
+ verticalAlign: 'middle'
413
+ });
373
414
  var circleStyles = (0, _primitives.xcss)({
374
415
  borderRadius: 'border.radius.circle'
375
416
  });
@@ -379,16 +420,28 @@ var fullWidthStyles = (0, _primitives.xcss)({
379
420
  var loadingStyles = (0, _primitives.xcss)({
380
421
  cursor: 'progress'
381
422
  });
423
+ // If updating `iconButtonStyles`, also update `iconButtonStylesWithRem`.
382
424
  var iconButtonStyles = (0, _primitives.xcss)({
383
425
  height: "".concat(32 / 14, "em"),
384
426
  width: "".concat(32 / 14, "em"),
385
427
  paddingInlineEnd: 'space.0',
386
428
  paddingInlineStart: 'space.0'
387
429
  });
430
+ var iconButtonStylesWithRem = (0, _primitives.xcss)({
431
+ height: '2rem',
432
+ width: '2rem',
433
+ paddingInlineEnd: 'space.0',
434
+ paddingInlineStart: 'space.0'
435
+ });
436
+ // If updating `iconButtonCompactStyles`, also update `iconButtonCompactStylesWithRem`.
388
437
  var iconButtonCompactStyles = (0, _primitives.xcss)({
389
438
  width: "".concat(24 / 14, "em"),
390
439
  height: "".concat(24 / 14, "em")
391
440
  });
441
+ var iconButtonCompactStylesWithRem = (0, _primitives.xcss)({
442
+ width: '1.5rem',
443
+ height: '1.5rem'
444
+ });
392
445
  var buttonIconBeforeStyles = (0, _primitives.xcss)({
393
446
  paddingInlineStart: 'space.100'
394
447
  });
@@ -484,13 +537,13 @@ var useButtonBase = function useButtonBase(_ref) {
484
537
  (0, _useAutoFocus.default)(localRef, autoFocus);
485
538
  return _objectSpread({
486
539
  ref: (0, _mergeRefs.default)([localRef, ref]),
487
- xcss: [buttonStyles, appearance === 'default' && ((0, _platformFeatureFlags.fg)('platform-component-visual-refresh') ? defaultRefreshedStyles : defaultStyles), appearance === 'default' && isInteractive && ((0, _platformFeatureFlags.fg)('platform-component-visual-refresh') ? defaultInteractiveRefreshedStyles : defaultInteractiveStyles), appearance === 'primary' && primaryStyles, appearance === 'primary' && isInteractive && primaryInteractiveStyles, appearance === 'warning' && warningStyles, appearance === 'warning' && isInteractive && warningInteractiveStyles, appearance === 'danger' && dangerStyles, appearance === 'danger' && isInteractive && dangerInteractiveStyles, appearance === 'discovery' && discoveryStyles, appearance === 'discovery' && isInteractive && discoveryInteractiveStyles, appearance === 'subtle' && ((0, _platformFeatureFlags.fg)('platform-component-visual-refresh') ? subtleRefreshedStyles : subtleStyles), appearance === 'subtle' && isInteractive && ((0, _platformFeatureFlags.fg)('platform-component-visual-refresh') ? subtleInteractiveRefreshedStyles : subtleInteractiveStyles), linkDecorationUnsetStyles, isSelected && ((0, _platformFeatureFlags.fg)('platform-component-visual-refresh') ? selectedRefreshedStyles : selectedStyles), isSelected && isSplitButton && selectedInsideSplitButtonStyles, isSelected && isInteractive && selectedInteractiveStyles,
540
+ xcss: [(0, _platformFeatureFlags.fg)('platform_dst_button_replace_em_with_rem') ? buttonStylesWithRem : buttonStyles, appearance === 'default' && ((0, _platformFeatureFlags.fg)('platform-component-visual-refresh') ? defaultRefreshedStyles : defaultStyles), appearance === 'default' && isInteractive && ((0, _platformFeatureFlags.fg)('platform-component-visual-refresh') ? defaultInteractiveRefreshedStyles : defaultInteractiveStyles), appearance === 'primary' && primaryStyles, appearance === 'primary' && isInteractive && primaryInteractiveStyles, appearance === 'warning' && warningStyles, appearance === 'warning' && isInteractive && warningInteractiveStyles, appearance === 'danger' && dangerStyles, appearance === 'danger' && isInteractive && dangerInteractiveStyles, appearance === 'discovery' && discoveryStyles, appearance === 'discovery' && isInteractive && discoveryInteractiveStyles, appearance === 'subtle' && ((0, _platformFeatureFlags.fg)('platform-component-visual-refresh') ? subtleRefreshedStyles : subtleStyles), appearance === 'subtle' && isInteractive && ((0, _platformFeatureFlags.fg)('platform-component-visual-refresh') ? subtleInteractiveRefreshedStyles : subtleInteractiveStyles), linkDecorationUnsetStyles, isSelected && ((0, _platformFeatureFlags.fg)('platform-component-visual-refresh') ? selectedRefreshedStyles : selectedStyles), isSelected && isSplitButton && selectedInsideSplitButtonStyles, isSelected && isInteractive && selectedInteractiveStyles,
488
541
  // TODO: remove me once we kill color fallbacks
489
542
  isSelected && appearance === 'danger' && selectedDangerStyles,
490
543
  // TODO: remove me once we kill color fallbacks
491
544
  isSelected && appearance === 'warning' && selectedWarningStyles,
492
545
  // TODO: remove me once we kill color fallbacks
493
- isSelected && appearance === 'discovery' && selectedDiscoveryStyles, isDisabled && disabledStyles, isCircle && !isSplitButton && circleStyles, spacing === 'compact' && spacingCompactStyles, hasIconBefore && buttonIconBeforeStyles, hasIconAfter && buttonIconAfterStyles, isIconButton && iconButtonStyles, isIconButton && spacing === 'compact' && iconButtonCompactStyles, shouldFitContainer && fullWidthStyles, isLoading && loadingStyles, isSplitButton && splitButtonStyles, isNavigationSplitButton && navigationSplitButtonStyles],
546
+ isSelected && appearance === 'discovery' && selectedDiscoveryStyles, isDisabled && disabledStyles, isCircle && !isSplitButton && circleStyles, spacing === 'compact' && ((0, _platformFeatureFlags.fg)('platform_dst_button_replace_em_with_rem') ? spacingCompactStylesWithRem : spacingCompactStyles), hasIconBefore && buttonIconBeforeStyles, hasIconAfter && buttonIconAfterStyles, isIconButton && ((0, _platformFeatureFlags.fg)('platform_dst_button_replace_em_with_rem') ? iconButtonStylesWithRem : iconButtonStyles), isIconButton && spacing === 'compact' && ((0, _platformFeatureFlags.fg)('platform_dst_button_replace_em_with_rem') ? iconButtonCompactStylesWithRem : iconButtonCompactStyles), shouldFitContainer && fullWidthStyles, isLoading && loadingStyles, isSplitButton && splitButtonStyles, isNavigationSplitButton && navigationSplitButtonStyles],
494
547
  isDisabled: isEffectivelyDisabled,
495
548
  children: /*#__PURE__*/_react.default.createElement(_splitButtonContext.SplitButtonContext.Provider, {
496
549
  value: undefined
@@ -133,7 +133,7 @@ var ButtonBase = /*#__PURE__*/_react.default.forwardRef(function ButtonBase(prop
133
133
  action: 'clicked',
134
134
  componentName: 'button',
135
135
  packageName: "@atlaskit/button",
136
- packageVersion: "20.4.2",
136
+ packageVersion: "20.5.1",
137
137
  analyticsData: analyticsContext
138
138
  });
139
139
 
@@ -62,6 +62,14 @@ const dividerHeight = {
62
62
  height: `${24 / 14}em`
63
63
  })
64
64
  };
65
+ const dividerHeightWithRem = {
66
+ default: css({
67
+ height: '2rem'
68
+ }),
69
+ compact: css({
70
+ height: '1.5rem'
71
+ })
72
+ };
65
73
  const defaultDividerHeight = {
66
74
  // The divider height is calculated by subtracting twice the border width from the button height.
67
75
  // This ensures the divider does not intersect with the button's border, avoiding visual issues
@@ -73,6 +81,17 @@ const defaultDividerHeight = {
73
81
  height: `calc(${24 / 14}em - ${"var(--ds-border-width, 1px)"} - ${"var(--ds-border-width, 1px)"})`
74
82
  })
75
83
  };
84
+ const defaultDividerHeightWithRem = {
85
+ // The divider height is calculated by subtracting twice the border width from the button height.
86
+ // This ensures the divider does not intersect with the button's border, avoiding visual issues
87
+ // caused by overlapping alpha colors (color.border) at the intersection.
88
+ default: css({
89
+ height: `calc(2rem - ${"var(--ds-border-width, 1px)"} - ${"var(--ds-border-width, 1px)"})`
90
+ }),
91
+ compact: css({
92
+ height: `calc(1.5rem - ${"var(--ds-border-width, 1px)"} - ${"var(--ds-border-width, 1px)"})`
93
+ })
94
+ };
76
95
  /**
77
96
  * TODO: Add JSDoc
78
97
  */
@@ -81,10 +100,13 @@ export const Divider = ({
81
100
  spacing,
82
101
  isDisabled = false
83
102
  }) => {
103
+ // Pulling these out of the below `css` prop to avoid nested ternaries
104
+ const defaultDividerHeightStyles = fg('platform_dst_button_replace_em_with_rem') ? defaultDividerHeightWithRem : defaultDividerHeight;
105
+ const dividerHeightStyles = fg('platform_dst_button_replace_em_with_rem') ? dividerHeightWithRem : dividerHeight;
84
106
  return (
85
107
  // I find it funny to provide a div for Divider
86
108
  jsx("div", {
87
- css: [baseDividerStyles, appearance === 'default' && !isDisabled && fg('platform-component-visual-refresh') ? defaultDividerHeight[spacing] : dividerHeight[spacing], isDisabled && (fg('platform-component-visual-refresh') ? dividerDisabledRefreshedStyles : dividerDisabledStyles), !isDisabled && (fg('platform-component-visual-refresh') ? dividerRefreshedAppearance[appearance] : dividerAppearance[appearance]), fg('platform-component-visual-refresh') && dividerRefreshedOffsetStyles]
109
+ css: [baseDividerStyles, appearance === 'default' && !isDisabled && fg('platform-component-visual-refresh') ? defaultDividerHeightStyles[spacing] : dividerHeightStyles[spacing], isDisabled && (fg('platform-component-visual-refresh') ? dividerDisabledRefreshedStyles : dividerDisabledStyles), !isDisabled && (fg('platform-component-visual-refresh') ? dividerRefreshedAppearance[appearance] : dividerAppearance[appearance]), fg('platform-component-visual-refresh') && dividerRefreshedOffsetStyles]
88
110
  })
89
111
  );
90
112
  };
@@ -10,6 +10,7 @@ import { SplitButtonContext, useSplitButtonContext } from '../../containers/spli
10
10
  import blockEvents from './block-events';
11
11
  import { LOADING_LABEL } from './constants';
12
12
  import renderLoadingOverlay from './loading-overlay';
13
+ // If updating `buttonStyles`, also update `buttonStylesWithRem`.
13
14
  const buttonStyles = xcss({
14
15
  display: 'inline-flex',
15
16
  boxSizing: 'border-box',
@@ -40,6 +41,36 @@ const buttonStyles = xcss({
40
41
  position: 'absolute'
41
42
  }
42
43
  });
44
+ const buttonStylesWithRem = xcss({
45
+ display: 'inline-flex',
46
+ boxSizing: 'border-box',
47
+ width: 'auto',
48
+ maxWidth: '100%',
49
+ position: 'relative',
50
+ alignItems: 'baseline',
51
+ justifyContent: 'center',
52
+ columnGap: 'space.050',
53
+ borderRadius: 'border.radius.100',
54
+ borderWidth: 'border.width.0',
55
+ flexShrink: 0,
56
+ height: '2rem',
57
+ font: 'font.body',
58
+ fontWeight: 'font.weight.medium',
59
+ paddingBlock: 'space.075',
60
+ paddingInlineEnd: 'space.150',
61
+ paddingInlineStart: 'space.150',
62
+ textAlign: 'center',
63
+ transition: 'background 0.1s ease-out',
64
+ verticalAlign: 'middle',
65
+ '::after': {
66
+ borderRadius: 'inherit',
67
+ inset: 'space.0',
68
+ borderStyle: 'solid',
69
+ borderWidth: "var(--ds-border-width, 1px)",
70
+ pointerEvents: 'none',
71
+ position: 'absolute'
72
+ }
73
+ });
43
74
  const defaultInteractiveStyles = xcss({
44
75
  ':hover': {
45
76
  background: "var(--ds-background-neutral-hovered, #091e4214)",
@@ -349,6 +380,8 @@ const selectedDiscoveryStyles = xcss({
349
380
  background: "var(--ds-background-selected, #403294)"
350
381
  }
351
382
  });
383
+
384
+ // If updating `spacingCompactStyles`, also update `spacingCompactStylesWithRem`.
352
385
  const spacingCompactStyles = xcss({
353
386
  columnGap: 'space.050',
354
387
  height: `${24 / 14}em`,
@@ -357,6 +390,14 @@ const spacingCompactStyles = xcss({
357
390
  paddingInlineStart: 'space.150',
358
391
  verticalAlign: 'middle'
359
392
  });
393
+ const spacingCompactStylesWithRem = xcss({
394
+ columnGap: 'space.050',
395
+ height: '1.5rem',
396
+ paddingBlock: 'space.025',
397
+ paddingInlineEnd: 'space.150',
398
+ paddingInlineStart: 'space.150',
399
+ verticalAlign: 'middle'
400
+ });
360
401
  const circleStyles = xcss({
361
402
  borderRadius: 'border.radius.circle'
362
403
  });
@@ -366,16 +407,28 @@ const fullWidthStyles = xcss({
366
407
  const loadingStyles = xcss({
367
408
  cursor: 'progress'
368
409
  });
410
+ // If updating `iconButtonStyles`, also update `iconButtonStylesWithRem`.
369
411
  const iconButtonStyles = xcss({
370
412
  height: `${32 / 14}em`,
371
413
  width: `${32 / 14}em`,
372
414
  paddingInlineEnd: 'space.0',
373
415
  paddingInlineStart: 'space.0'
374
416
  });
417
+ const iconButtonStylesWithRem = xcss({
418
+ height: '2rem',
419
+ width: '2rem',
420
+ paddingInlineEnd: 'space.0',
421
+ paddingInlineStart: 'space.0'
422
+ });
423
+ // If updating `iconButtonCompactStyles`, also update `iconButtonCompactStylesWithRem`.
375
424
  const iconButtonCompactStyles = xcss({
376
425
  width: `${24 / 14}em`,
377
426
  height: `${24 / 14}em`
378
427
  });
428
+ const iconButtonCompactStylesWithRem = xcss({
429
+ width: '1.5rem',
430
+ height: '1.5rem'
431
+ });
379
432
  const buttonIconBeforeStyles = xcss({
380
433
  paddingInlineStart: 'space.100'
381
434
  });
@@ -463,13 +516,13 @@ const useButtonBase = ({
463
516
  useAutoFocus(localRef, autoFocus);
464
517
  return {
465
518
  ref: mergeRefs([localRef, ref]),
466
- xcss: [buttonStyles, appearance === 'default' && (fg('platform-component-visual-refresh') ? defaultRefreshedStyles : defaultStyles), appearance === 'default' && isInteractive && (fg('platform-component-visual-refresh') ? defaultInteractiveRefreshedStyles : defaultInteractiveStyles), appearance === 'primary' && primaryStyles, appearance === 'primary' && isInteractive && primaryInteractiveStyles, appearance === 'warning' && warningStyles, appearance === 'warning' && isInteractive && warningInteractiveStyles, appearance === 'danger' && dangerStyles, appearance === 'danger' && isInteractive && dangerInteractiveStyles, appearance === 'discovery' && discoveryStyles, appearance === 'discovery' && isInteractive && discoveryInteractiveStyles, appearance === 'subtle' && (fg('platform-component-visual-refresh') ? subtleRefreshedStyles : subtleStyles), appearance === 'subtle' && isInteractive && (fg('platform-component-visual-refresh') ? subtleInteractiveRefreshedStyles : subtleInteractiveStyles), linkDecorationUnsetStyles, isSelected && (fg('platform-component-visual-refresh') ? selectedRefreshedStyles : selectedStyles), isSelected && isSplitButton && selectedInsideSplitButtonStyles, isSelected && isInteractive && selectedInteractiveStyles,
519
+ xcss: [fg('platform_dst_button_replace_em_with_rem') ? buttonStylesWithRem : buttonStyles, appearance === 'default' && (fg('platform-component-visual-refresh') ? defaultRefreshedStyles : defaultStyles), appearance === 'default' && isInteractive && (fg('platform-component-visual-refresh') ? defaultInteractiveRefreshedStyles : defaultInteractiveStyles), appearance === 'primary' && primaryStyles, appearance === 'primary' && isInteractive && primaryInteractiveStyles, appearance === 'warning' && warningStyles, appearance === 'warning' && isInteractive && warningInteractiveStyles, appearance === 'danger' && dangerStyles, appearance === 'danger' && isInteractive && dangerInteractiveStyles, appearance === 'discovery' && discoveryStyles, appearance === 'discovery' && isInteractive && discoveryInteractiveStyles, appearance === 'subtle' && (fg('platform-component-visual-refresh') ? subtleRefreshedStyles : subtleStyles), appearance === 'subtle' && isInteractive && (fg('platform-component-visual-refresh') ? subtleInteractiveRefreshedStyles : subtleInteractiveStyles), linkDecorationUnsetStyles, isSelected && (fg('platform-component-visual-refresh') ? selectedRefreshedStyles : selectedStyles), isSelected && isSplitButton && selectedInsideSplitButtonStyles, isSelected && isInteractive && selectedInteractiveStyles,
467
520
  // TODO: remove me once we kill color fallbacks
468
521
  isSelected && appearance === 'danger' && selectedDangerStyles,
469
522
  // TODO: remove me once we kill color fallbacks
470
523
  isSelected && appearance === 'warning' && selectedWarningStyles,
471
524
  // TODO: remove me once we kill color fallbacks
472
- isSelected && appearance === 'discovery' && selectedDiscoveryStyles, isDisabled && disabledStyles, isCircle && !isSplitButton && circleStyles, spacing === 'compact' && spacingCompactStyles, hasIconBefore && buttonIconBeforeStyles, hasIconAfter && buttonIconAfterStyles, isIconButton && iconButtonStyles, isIconButton && spacing === 'compact' && iconButtonCompactStyles, shouldFitContainer && fullWidthStyles, isLoading && loadingStyles, isSplitButton && splitButtonStyles, isNavigationSplitButton && navigationSplitButtonStyles],
525
+ isSelected && appearance === 'discovery' && selectedDiscoveryStyles, isDisabled && disabledStyles, isCircle && !isSplitButton && circleStyles, spacing === 'compact' && (fg('platform_dst_button_replace_em_with_rem') ? spacingCompactStylesWithRem : spacingCompactStyles), hasIconBefore && buttonIconBeforeStyles, hasIconAfter && buttonIconAfterStyles, isIconButton && (fg('platform_dst_button_replace_em_with_rem') ? iconButtonStylesWithRem : iconButtonStyles), isIconButton && spacing === 'compact' && (fg('platform_dst_button_replace_em_with_rem') ? iconButtonCompactStylesWithRem : iconButtonCompactStyles), shouldFitContainer && fullWidthStyles, isLoading && loadingStyles, isSplitButton && splitButtonStyles, isNavigationSplitButton && navigationSplitButtonStyles],
473
526
  isDisabled: isEffectivelyDisabled,
474
527
  children: /*#__PURE__*/React.createElement(SplitButtonContext.Provider, {
475
528
  value: undefined
@@ -119,7 +119,7 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref)
119
119
  action: 'clicked',
120
120
  componentName: 'button',
121
121
  packageName: "@atlaskit/button",
122
- packageVersion: "20.4.2",
122
+ packageVersion: "20.5.1",
123
123
  analyticsData: analyticsContext
124
124
  });
125
125
 
@@ -64,6 +64,14 @@ var dividerHeight = {
64
64
  height: "".concat(24 / 14, "em")
65
65
  })
66
66
  };
67
+ var dividerHeightWithRem = {
68
+ default: css({
69
+ height: '2rem'
70
+ }),
71
+ compact: css({
72
+ height: '1.5rem'
73
+ })
74
+ };
67
75
  var defaultDividerHeight = {
68
76
  // The divider height is calculated by subtracting twice the border width from the button height.
69
77
  // This ensures the divider does not intersect with the button's border, avoiding visual issues
@@ -75,6 +83,17 @@ var defaultDividerHeight = {
75
83
  height: "calc(".concat(24 / 14, "em - ", "var(--ds-border-width, 1px)", " - ", "var(--ds-border-width, 1px)", ")")
76
84
  })
77
85
  };
86
+ var defaultDividerHeightWithRem = {
87
+ // The divider height is calculated by subtracting twice the border width from the button height.
88
+ // This ensures the divider does not intersect with the button's border, avoiding visual issues
89
+ // caused by overlapping alpha colors (color.border) at the intersection.
90
+ default: css({
91
+ height: "calc(2rem - ".concat("var(--ds-border-width, 1px)", " - ", "var(--ds-border-width, 1px)", ")")
92
+ }),
93
+ compact: css({
94
+ height: "calc(1.5rem - ".concat("var(--ds-border-width, 1px)", " - ", "var(--ds-border-width, 1px)", ")")
95
+ })
96
+ };
78
97
  /**
79
98
  * TODO: Add JSDoc
80
99
  */
@@ -83,10 +102,13 @@ export var Divider = function Divider(_ref) {
83
102
  spacing = _ref.spacing,
84
103
  _ref$isDisabled = _ref.isDisabled,
85
104
  isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled;
105
+ // Pulling these out of the below `css` prop to avoid nested ternaries
106
+ var defaultDividerHeightStyles = fg('platform_dst_button_replace_em_with_rem') ? defaultDividerHeightWithRem : defaultDividerHeight;
107
+ var dividerHeightStyles = fg('platform_dst_button_replace_em_with_rem') ? dividerHeightWithRem : dividerHeight;
86
108
  return (
87
109
  // I find it funny to provide a div for Divider
88
110
  jsx("div", {
89
- css: [baseDividerStyles, appearance === 'default' && !isDisabled && fg('platform-component-visual-refresh') ? defaultDividerHeight[spacing] : dividerHeight[spacing], isDisabled && (fg('platform-component-visual-refresh') ? dividerDisabledRefreshedStyles : dividerDisabledStyles), !isDisabled && (fg('platform-component-visual-refresh') ? dividerRefreshedAppearance[appearance] : dividerAppearance[appearance]), fg('platform-component-visual-refresh') && dividerRefreshedOffsetStyles]
111
+ css: [baseDividerStyles, appearance === 'default' && !isDisabled && fg('platform-component-visual-refresh') ? defaultDividerHeightStyles[spacing] : dividerHeightStyles[spacing], isDisabled && (fg('platform-component-visual-refresh') ? dividerDisabledRefreshedStyles : dividerDisabledStyles), !isDisabled && (fg('platform-component-visual-refresh') ? dividerRefreshedAppearance[appearance] : dividerAppearance[appearance]), fg('platform-component-visual-refresh') && dividerRefreshedOffsetStyles]
90
112
  })
91
113
  );
92
114
  };
@@ -13,6 +13,7 @@ import { SplitButtonContext, useSplitButtonContext } from '../../containers/spli
13
13
  import blockEvents from './block-events';
14
14
  import { LOADING_LABEL } from './constants';
15
15
  import renderLoadingOverlay from './loading-overlay';
16
+ // If updating `buttonStyles`, also update `buttonStylesWithRem`.
16
17
  var buttonStyles = xcss({
17
18
  display: 'inline-flex',
18
19
  boxSizing: 'border-box',
@@ -43,6 +44,36 @@ var buttonStyles = xcss({
43
44
  position: 'absolute'
44
45
  }
45
46
  });
47
+ var buttonStylesWithRem = xcss({
48
+ display: 'inline-flex',
49
+ boxSizing: 'border-box',
50
+ width: 'auto',
51
+ maxWidth: '100%',
52
+ position: 'relative',
53
+ alignItems: 'baseline',
54
+ justifyContent: 'center',
55
+ columnGap: 'space.050',
56
+ borderRadius: 'border.radius.100',
57
+ borderWidth: 'border.width.0',
58
+ flexShrink: 0,
59
+ height: '2rem',
60
+ font: 'font.body',
61
+ fontWeight: 'font.weight.medium',
62
+ paddingBlock: 'space.075',
63
+ paddingInlineEnd: 'space.150',
64
+ paddingInlineStart: 'space.150',
65
+ textAlign: 'center',
66
+ transition: 'background 0.1s ease-out',
67
+ verticalAlign: 'middle',
68
+ '::after': {
69
+ borderRadius: 'inherit',
70
+ inset: 'space.0',
71
+ borderStyle: 'solid',
72
+ borderWidth: "var(--ds-border-width, 1px)",
73
+ pointerEvents: 'none',
74
+ position: 'absolute'
75
+ }
76
+ });
46
77
  var defaultInteractiveStyles = xcss({
47
78
  ':hover': {
48
79
  background: "var(--ds-background-neutral-hovered, #091e4214)",
@@ -352,6 +383,8 @@ var selectedDiscoveryStyles = xcss({
352
383
  background: "var(--ds-background-selected, #403294)"
353
384
  }
354
385
  });
386
+
387
+ // If updating `spacingCompactStyles`, also update `spacingCompactStylesWithRem`.
355
388
  var spacingCompactStyles = xcss({
356
389
  columnGap: 'space.050',
357
390
  height: "".concat(24 / 14, "em"),
@@ -360,6 +393,14 @@ var spacingCompactStyles = xcss({
360
393
  paddingInlineStart: 'space.150',
361
394
  verticalAlign: 'middle'
362
395
  });
396
+ var spacingCompactStylesWithRem = xcss({
397
+ columnGap: 'space.050',
398
+ height: '1.5rem',
399
+ paddingBlock: 'space.025',
400
+ paddingInlineEnd: 'space.150',
401
+ paddingInlineStart: 'space.150',
402
+ verticalAlign: 'middle'
403
+ });
363
404
  var circleStyles = xcss({
364
405
  borderRadius: 'border.radius.circle'
365
406
  });
@@ -369,16 +410,28 @@ var fullWidthStyles = xcss({
369
410
  var loadingStyles = xcss({
370
411
  cursor: 'progress'
371
412
  });
413
+ // If updating `iconButtonStyles`, also update `iconButtonStylesWithRem`.
372
414
  var iconButtonStyles = xcss({
373
415
  height: "".concat(32 / 14, "em"),
374
416
  width: "".concat(32 / 14, "em"),
375
417
  paddingInlineEnd: 'space.0',
376
418
  paddingInlineStart: 'space.0'
377
419
  });
420
+ var iconButtonStylesWithRem = xcss({
421
+ height: '2rem',
422
+ width: '2rem',
423
+ paddingInlineEnd: 'space.0',
424
+ paddingInlineStart: 'space.0'
425
+ });
426
+ // If updating `iconButtonCompactStyles`, also update `iconButtonCompactStylesWithRem`.
378
427
  var iconButtonCompactStyles = xcss({
379
428
  width: "".concat(24 / 14, "em"),
380
429
  height: "".concat(24 / 14, "em")
381
430
  });
431
+ var iconButtonCompactStylesWithRem = xcss({
432
+ width: '1.5rem',
433
+ height: '1.5rem'
434
+ });
382
435
  var buttonIconBeforeStyles = xcss({
383
436
  paddingInlineStart: 'space.100'
384
437
  });
@@ -474,13 +527,13 @@ var useButtonBase = function useButtonBase(_ref) {
474
527
  useAutoFocus(localRef, autoFocus);
475
528
  return _objectSpread({
476
529
  ref: mergeRefs([localRef, ref]),
477
- xcss: [buttonStyles, appearance === 'default' && (fg('platform-component-visual-refresh') ? defaultRefreshedStyles : defaultStyles), appearance === 'default' && isInteractive && (fg('platform-component-visual-refresh') ? defaultInteractiveRefreshedStyles : defaultInteractiveStyles), appearance === 'primary' && primaryStyles, appearance === 'primary' && isInteractive && primaryInteractiveStyles, appearance === 'warning' && warningStyles, appearance === 'warning' && isInteractive && warningInteractiveStyles, appearance === 'danger' && dangerStyles, appearance === 'danger' && isInteractive && dangerInteractiveStyles, appearance === 'discovery' && discoveryStyles, appearance === 'discovery' && isInteractive && discoveryInteractiveStyles, appearance === 'subtle' && (fg('platform-component-visual-refresh') ? subtleRefreshedStyles : subtleStyles), appearance === 'subtle' && isInteractive && (fg('platform-component-visual-refresh') ? subtleInteractiveRefreshedStyles : subtleInteractiveStyles), linkDecorationUnsetStyles, isSelected && (fg('platform-component-visual-refresh') ? selectedRefreshedStyles : selectedStyles), isSelected && isSplitButton && selectedInsideSplitButtonStyles, isSelected && isInteractive && selectedInteractiveStyles,
530
+ xcss: [fg('platform_dst_button_replace_em_with_rem') ? buttonStylesWithRem : buttonStyles, appearance === 'default' && (fg('platform-component-visual-refresh') ? defaultRefreshedStyles : defaultStyles), appearance === 'default' && isInteractive && (fg('platform-component-visual-refresh') ? defaultInteractiveRefreshedStyles : defaultInteractiveStyles), appearance === 'primary' && primaryStyles, appearance === 'primary' && isInteractive && primaryInteractiveStyles, appearance === 'warning' && warningStyles, appearance === 'warning' && isInteractive && warningInteractiveStyles, appearance === 'danger' && dangerStyles, appearance === 'danger' && isInteractive && dangerInteractiveStyles, appearance === 'discovery' && discoveryStyles, appearance === 'discovery' && isInteractive && discoveryInteractiveStyles, appearance === 'subtle' && (fg('platform-component-visual-refresh') ? subtleRefreshedStyles : subtleStyles), appearance === 'subtle' && isInteractive && (fg('platform-component-visual-refresh') ? subtleInteractiveRefreshedStyles : subtleInteractiveStyles), linkDecorationUnsetStyles, isSelected && (fg('platform-component-visual-refresh') ? selectedRefreshedStyles : selectedStyles), isSelected && isSplitButton && selectedInsideSplitButtonStyles, isSelected && isInteractive && selectedInteractiveStyles,
478
531
  // TODO: remove me once we kill color fallbacks
479
532
  isSelected && appearance === 'danger' && selectedDangerStyles,
480
533
  // TODO: remove me once we kill color fallbacks
481
534
  isSelected && appearance === 'warning' && selectedWarningStyles,
482
535
  // TODO: remove me once we kill color fallbacks
483
- isSelected && appearance === 'discovery' && selectedDiscoveryStyles, isDisabled && disabledStyles, isCircle && !isSplitButton && circleStyles, spacing === 'compact' && spacingCompactStyles, hasIconBefore && buttonIconBeforeStyles, hasIconAfter && buttonIconAfterStyles, isIconButton && iconButtonStyles, isIconButton && spacing === 'compact' && iconButtonCompactStyles, shouldFitContainer && fullWidthStyles, isLoading && loadingStyles, isSplitButton && splitButtonStyles, isNavigationSplitButton && navigationSplitButtonStyles],
536
+ isSelected && appearance === 'discovery' && selectedDiscoveryStyles, isDisabled && disabledStyles, isCircle && !isSplitButton && circleStyles, spacing === 'compact' && (fg('platform_dst_button_replace_em_with_rem') ? spacingCompactStylesWithRem : spacingCompactStyles), hasIconBefore && buttonIconBeforeStyles, hasIconAfter && buttonIconAfterStyles, isIconButton && (fg('platform_dst_button_replace_em_with_rem') ? iconButtonStylesWithRem : iconButtonStyles), isIconButton && spacing === 'compact' && (fg('platform_dst_button_replace_em_with_rem') ? iconButtonCompactStylesWithRem : iconButtonCompactStyles), shouldFitContainer && fullWidthStyles, isLoading && loadingStyles, isSplitButton && splitButtonStyles, isNavigationSplitButton && navigationSplitButtonStyles],
484
537
  isDisabled: isEffectivelyDisabled,
485
538
  children: /*#__PURE__*/React.createElement(SplitButtonContext.Provider, {
486
539
  value: undefined
@@ -125,7 +125,7 @@ var ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
125
125
  action: 'clicked',
126
126
  componentName: 'button',
127
127
  packageName: "@atlaskit/button",
128
- packageVersion: "20.4.2",
128
+ packageVersion: "20.5.1",
129
129
  analyticsData: analyticsContext
130
130
  });
131
131
 
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
2
  export declare const getActions: (children: ReactNode) => {
3
- PrimaryAction: string | number | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactFragment | import("react").ReactPortal;
4
- SecondaryAction: string | number | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactFragment | import("react").ReactPortal;
3
+ PrimaryAction: string | number | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | import("react").ReactPortal;
4
+ SecondaryAction: string | number | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | import("react").ReactPortal;
5
5
  };
@@ -1,8 +1,8 @@
1
- import { type Ref } from 'react';
1
+ import React, { 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, shouldFitContainer, spacing, testId, ...unsafeRest }: 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, shouldFitContainer, spacing, testId, ...unsafeRest }: LinkButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => React.JSX.Element;
6
6
  /**
7
7
  * __Link Button__
8
8
  *
@@ -1,8 +1,8 @@
1
- import { type Ref } from 'react';
1
+ import React, { 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, shape, spacing, testId, tooltip, ...unsafeRest }: 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, shape, spacing, testId, tooltip, ...unsafeRest }: LinkIconButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => React.JSX.Element;
6
6
  /**
7
7
  * __Link Icon Button__
8
8
  *
@@ -10,5 +10,5 @@ type ContentProps = {
10
10
  *
11
11
  * Used for slots within a Button, including icons and text content.
12
12
  */
13
- declare const Content: ({ children, type, isLoading, position }: ContentProps) => JSX.Element;
13
+ declare const Content: ({ children, type, isLoading, position }: ContentProps) => React.JSX.Element;
14
14
  export default Content;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { type IconProp } from '../types';
3
3
  /**
4
4
  * __Icon renderer__
@@ -8,5 +8,5 @@ import { type IconProp } from '../types';
8
8
  */
9
9
  declare const IconRenderer: ({ icon: Icon }: {
10
10
  icon: IconProp;
11
- }) => JSX.Element;
11
+ }) => React.JSX.Element;
12
12
  export default IconRenderer;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { type Appearance, type ButtonSpacing } from '../types';
3
3
  export default function renderLoadingOverlay({ appearance, spacing, isDisabled, isSelected, testId, }: {
4
4
  spacing?: ButtonSpacing;
@@ -6,4 +6,4 @@ export default function renderLoadingOverlay({ appearance, spacing, isDisabled,
6
6
  isDisabled?: boolean;
7
7
  isSelected?: boolean;
8
8
  testId?: string;
9
- }): JSX.Element;
9
+ }): React.JSX.Element;
@@ -1,5 +1,5 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { type BaseProps } from '../types';
3
3
  type LoadingSpinnerProps = Pick<BaseProps, 'appearance' | 'isDisabled' | 'isSelected' | 'spacing'>;
4
- export default function LoadingSpinner({ appearance, isDisabled, isSelected, spacing, }: LoadingSpinnerProps): JSX.Element;
4
+ export default function LoadingSpinner({ appearance, isDisabled, isSelected, spacing, }: LoadingSpinnerProps): React.JSX.Element;
5
5
  export {};
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
2
  export declare const getActions: (children: ReactNode) => {
3
- PrimaryAction: string | number | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactFragment | import("react").ReactPortal;
4
- SecondaryAction: string | number | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactFragment | import("react").ReactPortal;
3
+ PrimaryAction: string | number | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | import("react").ReactPortal;
4
+ SecondaryAction: string | number | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | import("react").ReactPortal;
5
5
  };
@@ -1,8 +1,8 @@
1
- import { type Ref } from 'react';
1
+ import React, { 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, shouldFitContainer, spacing, testId, ...unsafeRest }: 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, shouldFitContainer, spacing, testId, ...unsafeRest }: LinkButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => React.JSX.Element;
6
6
  /**
7
7
  * __Link Button__
8
8
  *
@@ -1,8 +1,8 @@
1
- import { type Ref } from 'react';
1
+ import React, { 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, shape, spacing, testId, tooltip, ...unsafeRest }: 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, shape, spacing, testId, tooltip, ...unsafeRest }: LinkIconButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => React.JSX.Element;
6
6
  /**
7
7
  * __Link Icon Button__
8
8
  *
@@ -10,5 +10,5 @@ type ContentProps = {
10
10
  *
11
11
  * Used for slots within a Button, including icons and text content.
12
12
  */
13
- declare const Content: ({ children, type, isLoading, position }: ContentProps) => JSX.Element;
13
+ declare const Content: ({ children, type, isLoading, position }: ContentProps) => React.JSX.Element;
14
14
  export default Content;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { type IconProp } from '../types';
3
3
  /**
4
4
  * __Icon renderer__
@@ -8,5 +8,5 @@ import { type IconProp } from '../types';
8
8
  */
9
9
  declare const IconRenderer: ({ icon: Icon }: {
10
10
  icon: IconProp;
11
- }) => JSX.Element;
11
+ }) => React.JSX.Element;
12
12
  export default IconRenderer;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { type Appearance, type ButtonSpacing } from '../types';
3
3
  export default function renderLoadingOverlay({ appearance, spacing, isDisabled, isSelected, testId, }: {
4
4
  spacing?: ButtonSpacing;
@@ -6,4 +6,4 @@ export default function renderLoadingOverlay({ appearance, spacing, isDisabled,
6
6
  isDisabled?: boolean;
7
7
  isSelected?: boolean;
8
8
  testId?: string;
9
- }): JSX.Element;
9
+ }): React.JSX.Element;
@@ -1,5 +1,5 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { type BaseProps } from '../types';
3
3
  type LoadingSpinnerProps = Pick<BaseProps, 'appearance' | 'isDisabled' | 'isSelected' | 'spacing'>;
4
- export default function LoadingSpinner({ appearance, isDisabled, isSelected, spacing, }: LoadingSpinnerProps): JSX.Element;
4
+ export default function LoadingSpinner({ appearance, isDisabled, isSelected, spacing, }: LoadingSpinnerProps): React.JSX.Element;
5
5
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/button",
3
- "version": "20.4.2",
3
+ "version": "20.5.1",
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/"
@@ -87,12 +87,12 @@
87
87
  "@atlaskit/analytics-next": "^10.3.0",
88
88
  "@atlaskit/ds-lib": "^3.5.0",
89
89
  "@atlaskit/focus-ring": "^2.1.0",
90
- "@atlaskit/icon": "^23.6.0",
90
+ "@atlaskit/icon": "^23.7.0",
91
91
  "@atlaskit/interaction-context": "^2.6.0",
92
92
  "@atlaskit/platform-feature-flags": "^1.0.0",
93
93
  "@atlaskit/primitives": "^13.4.0",
94
94
  "@atlaskit/spinner": "^17.1.0",
95
- "@atlaskit/theme": "^14.1.0",
95
+ "@atlaskit/theme": "^15.0.0",
96
96
  "@atlaskit/tokens": "^3.3.0",
97
97
  "@atlaskit/tooltip": "^19.1.0",
98
98
  "@atlaskit/visually-hidden": "^1.6.0",
@@ -132,6 +132,9 @@
132
132
  "platform-feature-flags": {
133
133
  "platform-component-visual-refresh": {
134
134
  "type": "boolean"
135
+ },
136
+ "platform_dst_button_replace_em_with_rem": {
137
+ "type": "boolean"
135
138
  }
136
139
  }
137
140
  }