@atlaskit/button 21.1.4 → 21.1.6

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 (74) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/new-button/containers/split-button/split-button.compiled.css +34 -0
  3. package/dist/cjs/new-button/containers/split-button/split-button.js +58 -118
  4. package/dist/cjs/new-button/variants/default/button.js +36 -41
  5. package/dist/cjs/new-button/variants/default/link.compiled.css +119 -0
  6. package/dist/cjs/new-button/variants/default/link.js +111 -59
  7. package/dist/cjs/new-button/variants/icon/button.js +128 -143
  8. package/dist/cjs/new-button/variants/icon/link.compiled.css +104 -0
  9. package/dist/cjs/new-button/variants/icon/link.js +101 -75
  10. package/dist/cjs/new-button/variants/shared/button-base.compiled.css +137 -0
  11. package/dist/cjs/new-button/variants/shared/button-base.js +223 -0
  12. package/dist/cjs/new-button/variants/shared/content.compiled.css +19 -0
  13. package/dist/cjs/new-button/variants/shared/content.js +13 -53
  14. package/dist/cjs/old-button/shared/button-base.js +1 -1
  15. package/dist/es2019/new-button/containers/split-button/split-button.compiled.css +34 -0
  16. package/dist/es2019/new-button/containers/split-button/split-button.js +54 -117
  17. package/dist/es2019/new-button/variants/default/button.js +47 -56
  18. package/dist/es2019/new-button/variants/default/link.compiled.css +119 -0
  19. package/dist/es2019/new-button/variants/default/link.js +113 -63
  20. package/dist/es2019/new-button/variants/icon/button.js +117 -133
  21. package/dist/es2019/new-button/variants/icon/link.compiled.css +104 -0
  22. package/dist/es2019/new-button/variants/icon/link.js +94 -70
  23. package/dist/es2019/new-button/variants/shared/button-base.compiled.css +137 -0
  24. package/dist/es2019/new-button/variants/shared/button-base.js +203 -0
  25. package/dist/es2019/new-button/variants/shared/content.compiled.css +19 -0
  26. package/dist/es2019/new-button/variants/shared/content.js +13 -52
  27. package/dist/es2019/old-button/shared/button-base.js +1 -1
  28. package/dist/esm/new-button/containers/split-button/split-button.compiled.css +34 -0
  29. package/dist/esm/new-button/containers/split-button/split-button.js +55 -120
  30. package/dist/esm/new-button/variants/default/button.js +33 -41
  31. package/dist/esm/new-button/variants/default/link.compiled.css +119 -0
  32. package/dist/esm/new-button/variants/default/link.js +111 -59
  33. package/dist/esm/new-button/variants/icon/button.js +128 -143
  34. package/dist/esm/new-button/variants/icon/link.compiled.css +104 -0
  35. package/dist/esm/new-button/variants/icon/link.js +98 -72
  36. package/dist/esm/new-button/variants/shared/button-base.compiled.css +137 -0
  37. package/dist/esm/new-button/variants/shared/button-base.js +213 -0
  38. package/dist/esm/new-button/variants/shared/content.compiled.css +19 -0
  39. package/dist/esm/new-button/variants/shared/content.js +13 -53
  40. package/dist/esm/old-button/shared/button-base.js +1 -1
  41. package/dist/types/new-button/containers/split-button/split-button.d.ts +4 -5
  42. package/dist/types/new-button/variants/default/button.d.ts +5 -1
  43. package/dist/types/new-button/variants/default/link.d.ts +22 -8
  44. package/dist/types/new-button/variants/icon/button.d.ts +5 -1
  45. package/dist/types/new-button/variants/icon/link.d.ts +11 -4
  46. package/dist/types/new-button/variants/shared/block-events.d.ts +1 -1
  47. package/dist/types/new-button/variants/shared/button-base.d.ts +45 -0
  48. package/dist/types/new-button/variants/shared/content.d.ts +5 -1
  49. package/dist/types/new-button/variants/types.d.ts +26 -6
  50. package/dist/types-ts4.5/new-button/containers/split-button/split-button.d.ts +4 -5
  51. package/dist/types-ts4.5/new-button/variants/default/button.d.ts +5 -1
  52. package/dist/types-ts4.5/new-button/variants/default/link.d.ts +22 -8
  53. package/dist/types-ts4.5/new-button/variants/icon/button.d.ts +5 -1
  54. package/dist/types-ts4.5/new-button/variants/icon/link.d.ts +11 -4
  55. package/dist/types-ts4.5/new-button/variants/shared/block-events.d.ts +1 -1
  56. package/dist/types-ts4.5/new-button/variants/shared/button-base.d.ts +45 -0
  57. package/dist/types-ts4.5/new-button/variants/shared/content.d.ts +5 -1
  58. package/dist/types-ts4.5/new-button/variants/types.d.ts +26 -6
  59. package/package.json +17 -15
  60. package/dist/cjs/new-button/variants/default/use-default-button.js +0 -98
  61. package/dist/cjs/new-button/variants/icon/use-icon-button.js +0 -88
  62. package/dist/cjs/new-button/variants/shared/use-button-base.js +0 -639
  63. package/dist/es2019/new-button/variants/default/use-default-button.js +0 -88
  64. package/dist/es2019/new-button/variants/icon/use-icon-button.js +0 -81
  65. package/dist/es2019/new-button/variants/shared/use-button-base.js +0 -619
  66. package/dist/esm/new-button/variants/default/use-default-button.js +0 -88
  67. package/dist/esm/new-button/variants/icon/use-icon-button.js +0 -81
  68. package/dist/esm/new-button/variants/shared/use-button-base.js +0 -629
  69. package/dist/types/new-button/variants/default/use-default-button.d.ts +0 -16
  70. package/dist/types/new-button/variants/icon/use-icon-button.d.ts +0 -16
  71. package/dist/types/new-button/variants/shared/use-button-base.d.ts +0 -46
  72. package/dist/types-ts4.5/new-button/variants/default/use-default-button.d.ts +0 -16
  73. package/dist/types-ts4.5/new-button/variants/icon/use-icon-button.d.ts +0 -16
  74. package/dist/types-ts4.5/new-button/variants/shared/use-button-base.d.ts +0 -46
@@ -1,3 +1,4 @@
1
+ /* content.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -5,57 +6,17 @@ Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.default = void 0;
8
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
+ require("./content.compiled.css");
10
+ var _runtime = require("@compiled/react/runtime");
9
11
  var _react = _interopRequireDefault(require("react"));
10
- var _primitives = require("@atlaskit/primitives");
11
- var textStyles = (0, _primitives.xcss)({
12
- // content can grow and shrink
13
- flexGrow: 1,
14
- flexShrink: 1,
15
- // ellipsis for overflow text
16
- overflow: 'hidden',
17
- textOverflow: 'ellipsis',
18
- whiteSpace: 'nowrap'
19
- });
20
- var iconStyles = (0, _primitives.xcss)({
21
- display: 'flex',
22
- // icon size cannot grow and shrink
23
- flexGrow: 0,
24
- flexShrink: 0,
25
- alignSelf: 'center',
26
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
27
- fontSize: 0,
28
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
29
- lineHeight: 0,
30
- userSelect: 'none'
31
- });
32
- var commonStyles = (0, _primitives.xcss)({
33
- transition: 'opacity 0.3s'
34
- });
35
- var fadeStyles = (0, _primitives.xcss)({
36
- opacity: 0
37
- });
38
-
39
- /**
40
- * These CSS variables consumed by the new icons, to allow them to have appropriate
41
- * padding inside Button while also maintaining spacing for the existing icons.
42
- *
43
- * These styles can be removed once the new icons are fully rolled out, feature flag
44
- * platform-visual-refresh-icons is cleaned up,
45
- * and we bump Button to set padding based on the new icons.
46
- */
47
- var beforeIconStyles = (0, _primitives.xcss)({
48
- // @ts-ignore
49
- '--ds--button--new-icon-padding-start': "var(--ds-space-050, 4px)",
50
- // @ts-ignore
51
- '--ds--button--new-icon-padding-end': "var(--ds-space-025, 2px)"
52
- });
53
- var afterIconStyles = (0, _primitives.xcss)({
54
- // @ts-ignore
55
- '--ds--button--new-icon-padding-start': "var(--ds-space-025, 2px)",
56
- // @ts-ignore
57
- '--ds--button--new-icon-padding-end': "var(--ds-space-050, 4px)"
58
- });
12
+ var styles = {
13
+ text: "_1reo15vq _18m915vq _16jlkb7n _1o9zkb7n _1bto1l2s _o5721q9c",
14
+ icon: "_1e0c1txw _16jlidpf _1o9zidpf _1wpz1h6o _1wybidpf _vwz4idpf _uiztglyw",
15
+ beforeIcon: "_1he91b66 _w795v77o",
16
+ afterIcon: "_1he9v77o _w7951b66",
17
+ common: "_v564g17y",
18
+ fade: "_tzy4idpf"
19
+ };
59
20
  /**
60
21
  * __Content__
61
22
  *
@@ -67,9 +28,8 @@ var Content = function Content(_ref) {
67
28
  type = _ref$type === void 0 ? 'text' : _ref$type,
68
29
  isLoading = _ref.isLoading,
69
30
  position = _ref.position;
70
- return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
71
- as: "span",
72
- xcss: [commonStyles].concat((0, _toConsumableArray2.default)(type === 'text' ? [textStyles] : [iconStyles]), (0, _toConsumableArray2.default)(isLoading ? [fadeStyles] : []), (0, _toConsumableArray2.default)(position === 'before' ? [beforeIconStyles] : []), (0, _toConsumableArray2.default)(position === 'after' ? [afterIconStyles] : []))
31
+ return /*#__PURE__*/_react.default.createElement("span", {
32
+ className: (0, _runtime.ax)([styles.common, type === 'text' && styles.text, type === 'icon' && styles.icon, isLoading && styles.fade, position === 'before' && styles.beforeIcon, position === 'after' && styles.afterIcon])
73
33
  }, children);
74
34
  };
75
35
  var _default = exports.default = Content;
@@ -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: "21.1.4",
136
+ packageVersion: "21.1.6",
137
137
  analyticsData: analyticsContext
138
138
  });
139
139
 
@@ -0,0 +1,34 @@
1
+
2
+ ._2rko1sit{border-radius:var(--ds-border-radius,3px)}
3
+ ._195g1h5n{margin-inline:-.03125rem}
4
+ ._195g1n1a{margin-inline:-1px}
5
+ ._1mouu2gc{margin-block:var(--ds-space-100,8px)}._12jimuej{outline-color:var(--ds-border,#091e4224)}
6
+ ._12y3t94y{outline-width:1px}
7
+ ._1bsbe4h9{width:var(--ds-border-width,1px)}
8
+ ._1cwg1n1a{outline-offset:-1px}
9
+ ._1e0c116y{display:inline-flex}
10
+ ._1j4hidpf a, ._1553idpf button{border-end-start-radius:0}
11
+ ._1pbykb7n{z-index:1}
12
+ ._1qgbidpf a, ._y1n3idpf button{border-start-start-radius:0}
13
+ ._1qu2nqa1{outline-style:solid}
14
+ ._4cvr1h6o{align-items:center}
15
+ ._4t3i1hvu{height:calc(1.5rem - var(--ds-border-width, 1px) - var(--ds-border-width, 1px))}
16
+ ._4t3i1k8s{height:1.5rem}
17
+ ._4t3i7vkz{height:1pc}
18
+ ._4t3im1ee{height:calc(2rem - var(--ds-border-width, 1px) - var(--ds-border-width, 1px))}
19
+ ._4t3iviql{height:2rem}
20
+ ._80om13gf{cursor:not-allowed}
21
+ ._bfhk15cr{background-color:var(--ds-text-inverse,#fff)}
22
+ ._bfhk1fxt{background-color:var(--ds-text,#172b4d)}
23
+ ._bfhk9xzm{background-color:var(--ds-border-disabled,#091e4224)}
24
+ ._bfhkdud1{background-color:var(--ds-text-subtle,#0052cc)}
25
+ ._bfhkmuej{background-color:var(--ds-border,#091e4224)}
26
+ ._bfhkojnm{background-color:var(--ds-text-disabled,#091e4224)}
27
+ ._bfhkveue{background-color:var(--ds-border-inverse,#fff)}
28
+ ._kqswh2mm{position:relative}
29
+ ._o5721q9c{white-space:nowrap}
30
+ ._p9ykidpf a, ._bepvidpf button{border-start-end-radius:0}
31
+ ._traeidpf a, ._anlpidpf button{border-end-end-radius:0}
32
+ ._tzy419lr{opacity:.62}
33
+ ._tzy41uwv{opacity:.51}
34
+ ._tzy41wzo{opacity:.64}
@@ -1,77 +1,37 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
-
6
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
- import { css, jsx } from '@emotion/react';
1
+ /* split-button.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import "./split-button.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
8
5
  import { fg } from '@atlaskit/platform-feature-flags';
9
6
  import { SplitButtonContext } from './split-button-context';
10
7
  import { getActions } from './utils';
11
- const baseDividerStyles = css({
12
- width: "var(--ds-border-width, 1px)",
13
- position: 'relative',
14
- // This is 1 so it appears above buttons by default.
15
- // When buttons are selected they have a zIndex of 2 applied.
16
- // See use-button-base.tsx.
17
- zIndex: 1
18
- });
19
- const dividerDisabledStyles = css({
20
- backgroundColor: "var(--ds-text-disabled, #091E4224)",
21
- cursor: 'not-allowed',
22
- opacity: 0.51
23
- });
24
- const dividerDisabledRefreshedStyles = css({
25
- backgroundColor: "var(--ds-border-disabled, #091E4224)",
26
- cursor: 'not-allowed'
27
- });
28
- const dividerAppearance = {
29
- default: css({
30
- backgroundColor: "var(--ds-text, #172B4D)",
31
- opacity: 0.51
32
- }),
33
- primary: css({
34
- backgroundColor: "var(--ds-text-inverse, #FFF)",
35
- opacity: 0.64
36
- }),
37
- navigation: css({
38
- height: '16px',
39
- margin: `${"var(--ds-space-100, 8px)"} -0.5px`,
40
- backgroundColor: "var(--ds-text-subtle, #0052cc)",
41
- opacity: 0.62
42
- })
8
+ const dividerStyles = {
9
+ baseDivider: "_1bsbe4h9 _kqswh2mm _1pbykb7n",
10
+ dividerDisabled: "_bfhkojnm _80om13gf _tzy41uwv",
11
+ dividerDisabledRefreshed: "_bfhk9xzm _80om13gf",
12
+ dividerOffsetRefreshed: "_195g1n1a"
43
13
  };
44
- const dividerRefreshedAppearance = {
45
- ...dividerAppearance,
46
- default: css({
47
- backgroundColor: "var(--ds-border, #091E4224)"
48
- }),
49
- primary: css({
50
- backgroundColor: "var(--ds-border-inverse, #FFF)",
51
- opacity: 0.64
52
- })
14
+ const dividerAppearanceStyles = {
15
+ default: "_bfhk1fxt _tzy41uwv",
16
+ primary: "_bfhk15cr _tzy41wzo",
17
+ navigation: "_1mouu2gc _195g1h5n _4t3i7vkz _bfhkdud1 _tzy419lr"
53
18
  };
54
- const dividerRefreshedOffsetStyles = css({
55
- marginInline: `calc(0px - ${"var(--ds-border-width, 1px)"})`
56
- });
57
- const dividerHeight = {
58
- default: css({
59
- height: '2rem'
60
- }),
61
- compact: css({
62
- height: '1.5rem'
63
- })
19
+ const dividerRefreshedAppearanceStyles = {
20
+ default: "_bfhkmuej",
21
+ primary: "_bfhkveue _tzy41wzo",
22
+ navigation: "_1mouu2gc _195g1h5n _4t3i7vkz _bfhkdud1 _tzy419lr"
64
23
  };
65
- const defaultDividerHeight = {
66
- // The divider height is calculated by subtracting twice the border width from the button height.
67
- // This ensures the divider does not intersect with the button's border, avoiding visual issues
68
- // caused by overlapping alpha colors (color.border) at the intersection.
69
- default: css({
70
- height: `calc(2rem - ${"var(--ds-border-width, 1px)"} - ${"var(--ds-border-width, 1px)"})`
71
- }),
72
- compact: css({
73
- height: `calc(1.5rem - ${"var(--ds-border-width, 1px)"} - ${"var(--ds-border-width, 1px)"})`
74
- })
24
+ const dividerHeightStyles = {
25
+ default: "_4t3iviql",
26
+ compact: "_4t3i1k8s"
27
+ };
28
+
29
+ // The divider height is calculated by subtracting twice the border width from the button height.
30
+ // This ensures the divider does not intersect with the button's border, avoiding visual issues
31
+ // caused by overlapping alpha colors (color.border) at the intersection.
32
+ const defaultDividerHeightStyles = {
33
+ default: "_4t3im1ee",
34
+ compact: "_4t3i1hvu"
75
35
  };
76
36
  /**
77
37
  * TODO: Add JSDoc
@@ -81,40 +41,17 @@ export const Divider = ({
81
41
  spacing,
82
42
  isDisabled = false
83
43
  }) => {
84
- return (
85
- // I find it funny to provide a div for Divider
86
- 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]
88
- })
89
- );
44
+ const isDefaultDivider = appearance === 'default' && !isDisabled && fg('platform-component-visual-refresh');
45
+ return /*#__PURE__*/React.createElement("div", {
46
+ className: ax([dividerStyles.baseDivider, isDefaultDivider && defaultDividerHeightStyles[spacing], !isDefaultDivider && dividerHeightStyles[spacing], isDisabled && fg('platform-component-visual-refresh') && dividerStyles.dividerDisabledRefreshed, isDisabled && !fg('platform-component-visual-refresh') && dividerStyles.dividerDisabled, !isDisabled && fg('platform-component-visual-refresh') && dividerRefreshedAppearanceStyles[appearance], !isDisabled && !fg('platform-component-visual-refresh') && dividerAppearanceStyles[appearance], fg('platform-component-visual-refresh') && dividerStyles.dividerOffsetRefreshed])
47
+ });
48
+ };
49
+ const buttonStyles = {
50
+ splitButton: "_1e0c116y _kqswh2mm _4cvr1h6o _o5721q9c",
51
+ primaryButton: "_traeidpf _anlpidpf _p9ykidpf _bepvidpf",
52
+ secondaryButton: "_1j4hidpf _1553idpf _1qgbidpf _y1n3idpf",
53
+ defaultAppearanceContainer: "_2rko1sit _12jimuej _1cwg1n1a _1qu2nqa1 _12y3t94y"
90
54
  };
91
- const splitButtonStyles = css({
92
- display: 'inline-flex',
93
- position: 'relative',
94
- alignItems: 'center',
95
- whiteSpace: 'nowrap'
96
- });
97
- const primaryButtonStyles = css({
98
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
99
- 'button,a': {
100
- borderEndEndRadius: 0,
101
- borderStartEndRadius: 0
102
- }
103
- });
104
- const secondaryButtonStyles = css({
105
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
106
- 'button,a': {
107
- borderEndStartRadius: 0,
108
- borderStartStartRadius: 0
109
- }
110
- });
111
- const defaultAppearanceContainerStyles = css({
112
- borderRadius: "var(--ds-border-radius, 3px)",
113
- outlineColor: "var(--ds-border, #091E4224)",
114
- outlineOffset: `calc(0px - ${"var(--ds-border-width, 1px)"})`,
115
- outlineStyle: 'solid',
116
- outlineWidth: "var(--ds-border-width, 1px)"
117
- });
118
55
 
119
56
  /**
120
57
  * TODO: Add JSdoc
@@ -124,8 +61,8 @@ export const SplitButtonContainer = ({
124
61
  children,
125
62
  isDisabled = false
126
63
  }) => {
127
- return jsx("div", {
128
- css: [appearance === 'default' && !isDisabled && fg('platform-component-visual-refresh') && defaultAppearanceContainerStyles, splitButtonStyles]
64
+ return /*#__PURE__*/React.createElement("div", {
65
+ className: ax([appearance === 'default' && !isDisabled && fg('platform-component-visual-refresh') && buttonStyles.defaultAppearanceContainer, buttonStyles.splitButton])
129
66
  }, children);
130
67
  };
131
68
 
@@ -148,23 +85,23 @@ export const SplitButton = ({
148
85
  PrimaryAction,
149
86
  SecondaryAction
150
87
  } = getActions(children);
151
- return jsx(SplitButtonContainer, {
88
+ return /*#__PURE__*/React.createElement(SplitButtonContainer, {
152
89
  appearance: appearance,
153
90
  isDisabled: isDisabled
154
- }, jsx(SplitButtonContext.Provider, {
91
+ }, /*#__PURE__*/React.createElement(SplitButtonContext.Provider, {
155
92
  value: {
156
93
  appearance,
157
94
  spacing,
158
95
  isDisabled
159
96
  }
160
- }, jsx("div", {
161
- css: primaryButtonStyles
162
- }, PrimaryAction), jsx(Divider, {
97
+ }, /*#__PURE__*/React.createElement("div", {
98
+ className: ax([buttonStyles.primaryButton])
99
+ }, PrimaryAction), /*#__PURE__*/React.createElement(Divider, {
163
100
  appearance: appearance,
164
101
  spacing: spacing,
165
102
  isDisabled: isDisabled
166
- }), jsx("div", {
167
- css: secondaryButtonStyles
103
+ }), /*#__PURE__*/React.createElement("div", {
104
+ className: ax([buttonStyles.secondaryButton])
168
105
  }, SecondaryAction)));
169
106
  };
170
107
  // TODO: Fill in the component {description} and ensure links point to the correct {packageName} location.
@@ -185,22 +122,22 @@ export const SplitButtonWithSlots = ({
185
122
  spacing = 'default',
186
123
  isDisabled = false
187
124
  }) => {
188
- return jsx(SplitButtonContainer, {
125
+ return /*#__PURE__*/React.createElement(SplitButtonContainer, {
189
126
  appearance: appearance,
190
127
  isDisabled: isDisabled
191
- }, jsx(SplitButtonContext.Provider, {
128
+ }, /*#__PURE__*/React.createElement(SplitButtonContext.Provider, {
192
129
  value: {
193
130
  appearance,
194
131
  spacing,
195
132
  isDisabled
196
133
  }
197
- }, jsx("div", {
198
- css: primaryButtonStyles
199
- }, primaryAction), jsx(Divider, {
134
+ }, /*#__PURE__*/React.createElement("div", {
135
+ className: ax([buttonStyles.primaryButton])
136
+ }, primaryAction), /*#__PURE__*/React.createElement(Divider, {
200
137
  appearance: appearance,
201
138
  spacing: spacing,
202
139
  isDisabled: isDisabled
203
- }), jsx("div", {
204
- css: secondaryButtonStyles
140
+ }), /*#__PURE__*/React.createElement("div", {
141
+ className: ax([buttonStyles.secondaryButton])
205
142
  }, secondaryAction)));
206
143
  };
@@ -1,7 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- import Pressable from '@atlaskit/primitives/pressable';
4
- import useDefaultButton from './use-default-button';
2
+ import React, { Fragment } from 'react';
3
+ import ButtonBase from '../shared/button-base';
4
+ import Content from '../shared/content';
5
+ import IconRenderer from '../shared/icon-renderer';
5
6
  /**
6
7
  * __Button__
7
8
  *
@@ -22,7 +23,7 @@ const Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function B
22
23
  iconBefore,
23
24
  interactionName,
24
25
  isDisabled,
25
- isLoading,
26
+ isLoading = false,
26
27
  isSelected,
27
28
  onClick,
28
29
  onClickCapture,
@@ -48,59 +49,49 @@ const Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function B
48
49
  style: _style,
49
50
  ...saferRest
50
51
  } = unsafeRest;
51
- const baseProps = useDefaultButton({
52
- ariaLabel,
53
- ariaLabelledBy,
54
- analyticsContext,
55
- appearance,
56
- autoFocus,
57
- buttonType: 'button',
58
- children,
59
- iconAfter,
60
- iconBefore,
61
- interactionName,
62
- isDisabled,
63
- isLoading,
64
- isSelected,
65
- onClick,
66
- onClickCapture,
67
- onKeyDownCapture,
68
- onKeyUpCapture,
69
- onMouseDownCapture,
70
- onMouseUpCapture,
71
- onPointerDownCapture,
72
- onPointerUpCapture,
73
- onTouchEndCapture,
74
- onTouchStartCapture,
75
- ref,
76
- shouldFitContainer,
77
- spacing,
78
- testId
79
- });
80
- return /*#__PURE__*/React.createElement(Pressable
81
- // TODO: Remove spread props
82
- , _extends({}, saferRest, {
83
- "aria-label": baseProps['aria-label'],
84
- "aria-labelledby": baseProps['aria-labelledby'],
85
- ref: baseProps.ref,
86
- xcss: baseProps.xcss,
87
- isDisabled: baseProps.isDisabled,
88
- onClick: baseProps.onClick,
89
- onMouseDownCapture: baseProps.onMouseDownCapture,
90
- onMouseUpCapture: baseProps.onMouseUpCapture,
91
- onKeyDownCapture: baseProps.onKeyDownCapture,
92
- onKeyUpCapture: baseProps.onKeyUpCapture,
93
- onTouchStartCapture: baseProps.onTouchStartCapture,
94
- onTouchEndCapture: baseProps.onTouchEndCapture,
95
- onPointerDownCapture: baseProps.onPointerDownCapture,
96
- onPointerUpCapture: baseProps.onPointerUpCapture,
97
- onClickCapture: baseProps.onClickCapture,
98
- type: type,
99
- testId: testId,
52
+ return /*#__PURE__*/React.createElement(ButtonBase, _extends({
100
53
  analyticsContext: analyticsContext,
101
- interactionName: interactionName,
102
- componentName: "Button"
103
- }), baseProps.children);
54
+ ref: ref,
55
+ appearance: appearance,
56
+ autoFocus: autoFocus,
57
+ isDisabled: isDisabled,
58
+ isLoading: isLoading,
59
+ isSelected: isSelected,
60
+ hasIconBefore: Boolean(iconBefore),
61
+ hasIconAfter: Boolean(iconAfter),
62
+ shouldFitContainer: shouldFitContainer,
63
+ spacing: spacing,
64
+ ariaLabel: ariaLabel,
65
+ ariaLabelledBy: ariaLabelledBy,
66
+ onClick: onClick,
67
+ onClickCapture: onClickCapture,
68
+ onKeyDownCapture: onKeyDownCapture,
69
+ onKeyUpCapture: onKeyUpCapture,
70
+ onMouseDownCapture: onMouseDownCapture,
71
+ onMouseUpCapture: onMouseUpCapture,
72
+ onPointerDownCapture: onPointerDownCapture,
73
+ onPointerUpCapture: onPointerUpCapture,
74
+ onTouchStartCapture: onTouchStartCapture,
75
+ onTouchEndCapture: onTouchEndCapture,
76
+ testId: testId,
77
+ componentName: "Button",
78
+ type: type,
79
+ interactionName: interactionName
80
+ }, saferRest), /*#__PURE__*/React.createElement(Fragment, null, iconBefore && /*#__PURE__*/React.createElement(Content, {
81
+ type: "icon",
82
+ position: "before",
83
+ isLoading: isLoading
84
+ }, /*#__PURE__*/React.createElement(IconRenderer, {
85
+ icon: iconBefore
86
+ })), children && /*#__PURE__*/React.createElement(Content, {
87
+ isLoading: isLoading
88
+ }, children), iconAfter && /*#__PURE__*/React.createElement(Content, {
89
+ type: "icon",
90
+ position: "after",
91
+ isLoading: isLoading
92
+ }, /*#__PURE__*/React.createElement(IconRenderer, {
93
+ icon: iconAfter
94
+ }))));
104
95
  }));
105
96
  Button.displayName = 'Button';
106
97
  export default Button;
@@ -0,0 +1,119 @@
1
+
2
+ ._11c82smr{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
3
+ ._14mj1kw7:after{border-radius:inherit}
4
+ ._2rkosqtm{border-radius:var(--ds-border-radius-100,3px)}
5
+ ._9v7aze3t:after{inset:var(--ds-space-0,0)}
6
+ ._v5649dqc{transition:background .1s ease-out}
7
+ ._189eidpf{border-width:0}
8
+ ._1rjc12x7{padding-block:var(--ds-space-075,6px)}
9
+ ._1rjcv77o{padding-block:var(--ds-space-025,2px)}
10
+ ._1tv3nqa1:after{border-style:solid}
11
+ ._39yqe4h9:after{border-width:var(--ds-border-width,1px)}
12
+ ._8l3mcoux:after{border-color:var(--ds-border-selected,#0052cc)}
13
+ ._8l3mmuej:after{border-color:var(--ds-border,#091e4224)}
14
+ ._11fnglyw:after{pointer-events:none}
15
+ ._18postnw:after{position:absolute}
16
+ ._1bah1h6o{justify-content:center}
17
+ ._1bsb1wug{width:auto}
18
+ ._1e0c116y{display:inline-flex}
19
+ ._1hmsagmp{text-decoration-line:none!important}
20
+ ._1o9zidpf{flex-shrink:0}
21
+ ._4bfu1snc{text-decoration-color:currentColor!important}
22
+ ._4cvr1q9y{align-items:baseline}
23
+ ._4t3i1k8s{height:1.5rem}
24
+ ._4t3iviql{height:2rem}
25
+ ._80om13gf{cursor:not-allowed}
26
+ ._aetrb3bt:after{content:""}
27
+ ._aetrglyw:after{content:none}
28
+ ._ajmmvv82{text-decoration-style:solid!important}
29
+ ._bfhk1g49{background-color:var(--ds-background-selected,#403294)}
30
+ ._bfhk1ikc{background-color:var(--ds-background-warning-bold,#ffab00)}
31
+ ._bfhk1j54{background-color:var(--ds-background-neutral,rgba(9,30,66,.04))}
32
+ ._bfhk1v7l{background-color:var(--ds-background-danger-bold,#de350b)}
33
+ ._bfhk1vbi{background-color:var(--ds-background-discovery-bold,#5243aa)}
34
+ ._bfhk7btw{background-color:var(--ds-background-selected,#253858)}
35
+ ._bfhkbeib{background-color:var(--ds-background-selected,#bf2600)}
36
+ ._bfhkfg4m{background-color:var(--ds-background-selected,#e9f2ff)}
37
+ ._bfhkomb0{background-color:var(--ds-background-brand-bold,#0052cc)}
38
+ ._bfhkqtfy{background-color:var(--ds-background-neutral-subtle,transparent)}
39
+ ._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
40
+ ._bfhksyzs{background-color:var(--ds-background-disabled,#091e4208)}
41
+ ._bfhkvdtc{background-color:var(--ds-background-selected,#ff991f)}
42
+ ._bozgu2gc{padding-inline-start:var(--ds-space-100,8px)}
43
+ ._bozgutpp{padding-inline-start:var(--ds-space-150,9pt)}
44
+ ._gy1p1b66{column-gap:var(--ds-space-050,4px)}
45
+ ._k48p1wq8{font-weight:var(--ds-font-weight-medium,500)}
46
+ ._kqswh2mm{position:relative}
47
+ ._p12f1osq{max-width:100%}
48
+ ._s7n4nkob{vertical-align:middle}
49
+ ._syaz10s3{color:var(--ds-text,#42526e)}
50
+ ._syaz15cr{color:var(--ds-text-inverse,#fff)}
51
+ ._syaz16q2{color:var(--ds-text-selected,#172b4d)}
52
+ ._syaz1gjq{color:var(--ds-text-subtle,#44546f)}
53
+ ._syaz1ldt{color:var(--ds-text-selected,#0052cc)}
54
+ ._syaz1lh4{color:var(--ds-text-disabled,#091e424f)}
55
+ ._syaz1pke{color:var(--ds-text-selected,#f4f5f7)}
56
+ ._syazal3n{color:var(--ds-text-warning-inverse,#172b4d)}
57
+ ._vchhusvi{box-sizing:border-box}
58
+ ._y3gn1h6o{text-align:center}
59
+ ._y4tiu2gc{padding-inline-end:var(--ds-space-100,8px)}
60
+ ._y4tiutpp{padding-inline-end:var(--ds-space-150,9pt)}._105310s3:visited{color:var(--ds-text,#42526e)}
61
+ ._105315cr:visited{color:var(--ds-text-inverse,#fff)}
62
+ ._10531gjq:visited{color:var(--ds-text-subtle,#44546f)}
63
+ ._10531ldt:visited{color:var(--ds-text-selected,#0052cc)}
64
+ ._10531pke:visited{color:var(--ds-text-selected,#f4f5f7)}
65
+ ._1053al3n:visited{color:var(--ds-text-warning-inverse,#172b4d)}
66
+ ._1a3b1r31:focus{text-decoration-color:currentColor}
67
+ ._4fprglyw:focus{text-decoration-line:none}
68
+ ._5goinqa1:focus{text-decoration-style:solid}
69
+ ._f8pj10s3:focus{color:var(--ds-text,#42526e)}
70
+ ._f8pj15cr:focus{color:var(--ds-text-inverse,#fff)}
71
+ ._f8pj1gjq:focus{color:var(--ds-text-subtle,#44546f)}
72
+ ._f8pj1ldt:focus{color:var(--ds-text-selected,#0052cc)}
73
+ ._f8pj1mjl:focus{color:color.text.subtle}
74
+ ._f8pj1pke:focus{color:var(--ds-text-selected,#f4f5f7)}
75
+ ._f8pjal3n:focus{color:var(--ds-text-warning-inverse,#172b4d)}
76
+ ._1bnxglyw:hover{text-decoration-line:none}
77
+ ._30l310s3:hover{color:var(--ds-text,#42526e)}
78
+ ._30l315cr:hover{color:var(--ds-text-inverse,#fff)}
79
+ ._30l31gjq:hover{color:var(--ds-text-subtle,#44546f)}
80
+ ._30l31ldt:hover{color:var(--ds-text-selected,#0052cc)}
81
+ ._30l31lh4:hover{color:var(--ds-text-disabled,#091e424f)}
82
+ ._30l31pke:hover{color:var(--ds-text-selected,#f4f5f7)}
83
+ ._30l3al3n:hover{color:var(--ds-text-warning-inverse,#172b4d)}
84
+ ._9oik1r31:hover{text-decoration-color:currentColor}
85
+ ._irr3166n:hover{background-color:var(--ds-background-neutral-subtle-hovered,#091e420f)}
86
+ ._irr31g49:hover{background-color:var(--ds-background-selected,#403294)}
87
+ ._irr31j43:hover{background-color:var(--ds-background-warning-bold-hovered,#ffc400)}
88
+ ._irr31rwk:hover{background-color:var(--ds-background-danger-bold-hovered,#ff5630)}
89
+ ._irr31wqm:hover{background-color:var(--ds-background-brand-bold-hovered,#0065ff)}
90
+ ._irr34mfv:hover{background-color:var(--ds-background-neutral-subtle-hovered,#091e4214)}
91
+ ._irr37gr8:hover{background-color:var(--ds-background-discovery-bold-hovered,#8777d9)}
92
+ ._irr3beib:hover{background-color:var(--ds-background-selected,#bf2600)}
93
+ ._irr3i1yw:hover{background-color:var(--ds-background-selected-hovered,#cce0ff)}
94
+ ._irr3syzs:hover{background-color:var(--ds-background-disabled,#091e4208)}
95
+ ._irr3vdtc:hover{background-color:var(--ds-background-selected,#ff991f)}
96
+ ._irr3yw9d:hover{background-color:var(--ds-background-neutral-hovered,#091e4214)}
97
+ ._jf4cnqa1:hover{text-decoration-style:solid}
98
+ ._1di617hq:active{background-color:var(--ds-background-brand-bold-pressed,#0747a6)}
99
+ ._1di619qy:active{background-color:var(--ds-background-neutral-subtle-pressed,#b3d4ff)}
100
+ ._1di619ru:active{background-color:var(--ds-background-selected-pressed,#85b8ff)}
101
+ ._1di61dty:active{background-color:var(--ds-background-neutral-subtle-pressed,#091e4224)}
102
+ ._1di61g49:active{background-color:var(--ds-background-selected,#403294)}
103
+ ._1di61wu2:active{background-color:var(--ds-background-discovery-bold-pressed,#5243aa)}
104
+ ._1di6beib:active{background-color:var(--ds-background-selected,#bf2600)}
105
+ ._1di6h4op:active{background-color:var(--ds-background-warning-bold-pressed,#ff991f)}
106
+ ._1di6ip91:active{background-color:var(--ds-background-neutral-pressed,#091e424f)}
107
+ ._1di6syzs:active{background-color:var(--ds-background-disabled,#091e4208)}
108
+ ._1di6vdtc:active{background-color:var(--ds-background-selected,#ff991f)}
109
+ ._1di6yycf:active{background-color:var(--ds-background-danger-bold-pressed,#bf2600)}
110
+ ._1iohnqa1:active{text-decoration-style:solid}
111
+ ._1nrm1r31:active{text-decoration-color:currentColor}
112
+ ._9h8h10s3:active{color:var(--ds-text,#42526e)}
113
+ ._9h8h15cr:active{color:var(--ds-text-inverse,#fff)}
114
+ ._9h8h1gjq:active{color:var(--ds-text-subtle,#44546f)}
115
+ ._9h8h1ldt:active{color:var(--ds-text-selected,#0052cc)}
116
+ ._9h8h1lh4:active{color:var(--ds-text-disabled,#091e424f)}
117
+ ._9h8h1pke:active{color:var(--ds-text-selected,#f4f5f7)}
118
+ ._9h8hal3n:active{color:var(--ds-text-warning-inverse,#172b4d)}
119
+ ._c2waglyw:active{text-decoration-line:none}