@atlaskit/button 17.6.2 → 17.7.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.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/containers/button-group.js +2 -2
- package/dist/cjs/entry-points/custom-theme-button.js +2 -2
- package/dist/cjs/entry-points/types.js +1 -5
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/new-button/variants/default/link.js +2 -2
- package/dist/cjs/new-button/variants/default/use-default-button.js +2 -2
- package/dist/cjs/new-button/variants/icon/link.js +2 -2
- package/dist/cjs/new-button/variants/shared/colors.js +2 -2
- package/dist/cjs/new-button/variants/shared/use-button-base.js +2 -2
- package/dist/cjs/old-button/button.js +2 -2
- package/dist/cjs/old-button/custom-theme-button/custom-theme-button.js +2 -2
- package/dist/cjs/old-button/shared/button-base.js +3 -3
- package/dist/cjs/old-button/shared/colors.js +2 -2
- package/dist/cjs/utils/spacing.js +3 -3
- package/dist/cjs/utils/variants.js +11 -6
- package/dist/es2019/entry-points/types.js +0 -1
- package/dist/es2019/old-button/shared/button-base.js +1 -1
- package/dist/es2019/utils/spacing.js +3 -2
- package/dist/es2019/utils/variants.js +9 -4
- package/dist/esm/entry-points/types.js +0 -1
- package/dist/esm/old-button/shared/button-base.js +1 -1
- package/dist/esm/utils/spacing.js +3 -2
- package/dist/esm/utils/variants.js +9 -4
- package/dist/types/new-button/variants/default/types.d.ts +5 -1
- package/dist/types/new-button/variants/icon/types.d.ts +5 -1
- package/dist/types/new-button/variants/shared/use-button-base.d.ts +3 -2
- package/dist/types/new-button/variants/types.d.ts +3 -5
- package/dist/types/utils/spacing.d.ts +3 -2
- package/dist/types/utils/variants.d.ts +5 -0
- package/dist/types-ts4.5/new-button/variants/default/types.d.ts +5 -1
- package/dist/types-ts4.5/new-button/variants/icon/types.d.ts +5 -1
- package/dist/types-ts4.5/new-button/variants/shared/use-button-base.d.ts +3 -2
- package/dist/types-ts4.5/new-button/variants/types.d.ts +3 -5
- package/dist/types-ts4.5/utils/spacing.d.ts +3 -2
- package/dist/types-ts4.5/utils/variants.d.ts +5 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/button
|
|
2
2
|
|
|
3
|
+
## 17.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 17.7.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#73843](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/73843) [`9a090e6e7733`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9a090e6e7733) - The new icon button incorrectly supported `spacing="none"`. This release removes support for this, leaving `"default"` and `"compact"` as the only two options.
|
|
14
|
+
|
|
15
|
+
The icon button docs have also been updated to better reflect the intended use of the `label` prop instead of `aria-label`. The `label` prop is designed to abstract the technical implementation for accessibility requirements. The new icon button does not use the `aria-label` attribute under the hood, rather it relys on visually hidden text instead. This is done for accessibility reasons as `aria-label` is not always translated whereas visually hidden text will be.
|
|
16
|
+
|
|
3
17
|
## 17.6.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -7,8 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = ButtonGroup;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _react2 = require("@emotion/react");
|
|
10
|
-
function _getRequireWildcardCache(
|
|
11
|
-
function _interopRequireWildcard(
|
|
10
|
+
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); }
|
|
11
|
+
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; }
|
|
12
12
|
/** @jsx jsx */
|
|
13
13
|
|
|
14
14
|
var buttonGroupStyles = (0, _react2.css)({
|
|
@@ -17,5 +17,5 @@ Object.defineProperty(exports, "default", {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
var _customThemeButton = _interopRequireWildcard(require("../old-button/custom-theme-button"));
|
|
20
|
-
function _getRequireWildcardCache(
|
|
21
|
-
function _interopRequireWildcard(
|
|
20
|
+
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); }
|
|
21
|
+
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; }
|
package/dist/cjs/index.js
CHANGED
|
@@ -39,5 +39,5 @@ var _standardButton = _interopRequireDefault(require("./entry-points/standard-bu
|
|
|
39
39
|
var _loadingButton = _interopRequireDefault(require("./entry-points/loading-button"));
|
|
40
40
|
var _customThemeButton = _interopRequireWildcard(require("./entry-points/custom-theme-button"));
|
|
41
41
|
var _buttonGroup = _interopRequireDefault(require("./entry-points/button-group"));
|
|
42
|
-
function _getRequireWildcardCache(
|
|
43
|
-
function _interopRequireWildcard(
|
|
42
|
+
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); }
|
|
43
|
+
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; }
|
|
@@ -12,8 +12,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _anchor = _interopRequireDefault(require("@atlaskit/primitives/anchor"));
|
|
13
13
|
var _useDefaultButton = _interopRequireDefault(require("./use-default-button"));
|
|
14
14
|
var _excluded = ["analyticsContext", "interactionName", "autoFocus", "appearance", "spacing", "isDisabled", "isSelected", "iconBefore", "UNSAFE_iconBefore_size", "iconAfter", "UNSAFE_iconAfter_size", "children", "shouldFitContainer", "overlay", "onClick", "onMouseDownCapture", "onMouseUpCapture", "onKeyDownCapture", "onKeyUpCapture", "onTouchStartCapture", "onTouchEndCapture", "onPointerDownCapture", "onPointerUpCapture", "onClickCapture", "testId", "href"];
|
|
15
|
-
function _getRequireWildcardCache(
|
|
16
|
-
function _interopRequireWildcard(
|
|
15
|
+
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
|
+
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
17
|
var LinkButtonBase = function LinkButtonBase(_ref, ref) {
|
|
18
18
|
var analyticsContext = _ref.analyticsContext,
|
|
19
19
|
interactionName = _ref.interactionName,
|
|
@@ -9,8 +9,8 @@ exports.default = void 0;
|
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _content = _interopRequireDefault(require("../shared/content"));
|
|
11
11
|
var _useButtonBase = _interopRequireDefault(require("../shared/use-button-base"));
|
|
12
|
-
function _getRequireWildcardCache(
|
|
13
|
-
function _interopRequireWildcard(
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
14
|
/**
|
|
15
15
|
* __Use default button base__
|
|
16
16
|
*
|
|
@@ -12,8 +12,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _anchor = _interopRequireDefault(require("@atlaskit/primitives/anchor"));
|
|
13
13
|
var _useIconButton = _interopRequireDefault(require("./use-icon-button"));
|
|
14
14
|
var _excluded = ["analyticsContext", "interactionName", "autoFocus", "appearance", "spacing", "isDisabled", "isSelected", "icon", "label", "overlay", "onClick", "onMouseDownCapture", "onMouseUpCapture", "onKeyDownCapture", "onKeyUpCapture", "onTouchStartCapture", "onTouchEndCapture", "onPointerDownCapture", "onPointerUpCapture", "onClickCapture", "shape", "testId", "UNSAFE_size", "href", "aria-label"];
|
|
15
|
-
function _getRequireWildcardCache(
|
|
16
|
-
function _interopRequireWildcard(
|
|
15
|
+
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
|
+
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
17
|
var LinkIconButtonBase = function LinkIconButtonBase(_ref, ref) {
|
|
18
18
|
var analyticsContext = _ref.analyticsContext,
|
|
19
19
|
interactionName = _ref.interactionName,
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
|
|
9
|
-
function _getRequireWildcardCache(
|
|
10
|
-
function _interopRequireWildcard(
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
11
11
|
var values = {
|
|
12
12
|
// Default appearance
|
|
13
13
|
background: {
|
|
@@ -13,8 +13,8 @@ var _primitives = require("@atlaskit/primitives");
|
|
|
13
13
|
var _splitButtonContext = require("../../containers/split-button/split-button-context");
|
|
14
14
|
var _blockEvents = _interopRequireDefault(require("./block-events"));
|
|
15
15
|
var _xcss = require("./xcss");
|
|
16
|
-
function _getRequireWildcardCache(
|
|
17
|
-
function _interopRequireWildcard(
|
|
16
|
+
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
|
+
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
18
|
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; }
|
|
19
19
|
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; }
|
|
20
20
|
var overlayStyles = (0, _primitives.xcss)({
|
|
@@ -16,8 +16,8 @@ var _buttonBase = _interopRequireDefault(require("./shared/button-base"));
|
|
|
16
16
|
var _css = require("./shared/css");
|
|
17
17
|
var _getIsOnlySingleIcon = _interopRequireDefault(require("./shared/get-is-only-single-icon"));
|
|
18
18
|
var _excluded = ["appearance", "children", "iconBefore", "iconAfter", "isSelected", "onMouseDown", "onMouseUp", "shouldFitContainer", "spacing"];
|
|
19
|
-
function _getRequireWildcardCache(
|
|
20
|
-
function _interopRequireWildcard(
|
|
19
|
+
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); }
|
|
20
|
+
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; }
|
|
21
21
|
var isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
|
22
22
|
/**
|
|
23
23
|
* __Button__
|
|
@@ -17,8 +17,8 @@ var _getIsOnlySingleIcon = _interopRequireDefault(require("../shared/get-is-only
|
|
|
17
17
|
var _loadingSpinner = _interopRequireDefault(require("../shared/loading-spinner"));
|
|
18
18
|
var _theme = _interopRequireWildcard(require("./theme"));
|
|
19
19
|
var _excluded = ["appearance", "autoFocus", "isDisabled", "isSelected", "shouldFitContainer", "spacing", "isLoading", "onMouseEnter", "onMouseLeave", "onMouseDown", "onMouseUp", "onFocus", "onBlur", "theme"];
|
|
20
|
-
function _getRequireWildcardCache(
|
|
21
|
-
function _interopRequireWildcard(
|
|
20
|
+
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); }
|
|
21
|
+
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; }
|
|
22
22
|
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; }
|
|
23
23
|
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; }
|
|
24
24
|
function getInteractionState(_ref) {
|
|
@@ -23,8 +23,8 @@ var _excluded = ["analyticsContext", "appearance", "autoFocus", "buttonCss", "ch
|
|
|
23
23
|
/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
|
|
24
24
|
/** @jsx jsx */
|
|
25
25
|
// eslint-disable-next-line no-duplicate-imports
|
|
26
|
-
function _getRequireWildcardCache(
|
|
27
|
-
function _interopRequireWildcard(
|
|
26
|
+
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); }
|
|
27
|
+
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; }
|
|
28
28
|
// Disabled buttons will still publish events for nested elements in webkit.
|
|
29
29
|
// We are disabling pointer events on child elements so that
|
|
30
30
|
// the button will always be the target of events
|
|
@@ -117,7 +117,7 @@ var _default = exports.default = /*#__PURE__*/_react.default.forwardRef(function
|
|
|
117
117
|
action: 'clicked',
|
|
118
118
|
componentName: 'button',
|
|
119
119
|
packageName: "@atlaskit/button",
|
|
120
|
-
packageVersion: "17.
|
|
120
|
+
packageVersion: "17.7.1",
|
|
121
121
|
analyticsData: analyticsContext
|
|
122
122
|
});
|
|
123
123
|
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
|
|
9
|
-
function _getRequireWildcardCache(
|
|
10
|
-
function _interopRequireWildcard(
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
11
11
|
// Hard coding the active rgba color value rather than using a helper to convert it
|
|
12
12
|
// With helper it would be: hex2rgba(colors.B75, 0.6)
|
|
13
13
|
var fadedB75 = 'rgba(179, 212, 255, 0.6)';
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var
|
|
8
|
-
var
|
|
6
|
+
exports.iconButtonSpacing = exports.buttonSpacing = void 0;
|
|
7
|
+
var buttonSpacing = exports.buttonSpacing = ['default', 'compact', 'none'];
|
|
8
|
+
var iconButtonSpacing = exports.iconButtonSpacing = ['default', 'compact'];
|
|
@@ -15,11 +15,12 @@ var _link = _interopRequireDefault(require("../new-button/variants/default/link"
|
|
|
15
15
|
var _button2 = _interopRequireDefault(require("../new-button/variants/icon/button"));
|
|
16
16
|
var _link2 = _interopRequireDefault(require("../new-button/variants/icon/link"));
|
|
17
17
|
var _appearances = require("./appearances");
|
|
18
|
+
var _spacing = require("./spacing");
|
|
18
19
|
var _excluded = ["href", "children"],
|
|
19
20
|
_excluded2 = ["icon", "label"],
|
|
20
21
|
_excluded3 = ["href", "icon", "label"];
|
|
21
|
-
function _getRequireWildcardCache(
|
|
22
|
-
function _interopRequireWildcard(
|
|
22
|
+
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
|
+
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; }
|
|
23
24
|
// Add required default props to variants
|
|
24
25
|
var LinkButtonRender = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
25
26
|
var _ref$href = _ref.href,
|
|
@@ -62,22 +63,26 @@ var variants = [{
|
|
|
62
63
|
name: 'Button',
|
|
63
64
|
Component: _button.default,
|
|
64
65
|
elementType: HTMLButtonElement,
|
|
65
|
-
appearances: _appearances.buttonAppearances
|
|
66
|
+
appearances: _appearances.buttonAppearances,
|
|
67
|
+
spacing: _spacing.buttonSpacing
|
|
66
68
|
}, {
|
|
67
69
|
name: 'LinkButton',
|
|
68
70
|
Component: LinkButtonRender,
|
|
69
71
|
elementType: HTMLAnchorElement,
|
|
70
|
-
appearances: _appearances.linkButtonAppearances
|
|
72
|
+
appearances: _appearances.linkButtonAppearances,
|
|
73
|
+
spacing: _spacing.buttonSpacing
|
|
71
74
|
}, {
|
|
72
75
|
name: 'IconButton',
|
|
73
76
|
Component: IconButtonRender,
|
|
74
77
|
elementType: HTMLButtonElement,
|
|
75
|
-
appearances: _appearances.iconButtonAppearances
|
|
78
|
+
appearances: _appearances.iconButtonAppearances,
|
|
79
|
+
spacing: _spacing.iconButtonSpacing
|
|
76
80
|
}, {
|
|
77
81
|
name: 'LinkIconButton',
|
|
78
82
|
Component: LinkIconButtonRender,
|
|
79
83
|
elementType: HTMLAnchorElement,
|
|
80
|
-
appearances: _appearances.iconButtonAppearances
|
|
84
|
+
appearances: _appearances.iconButtonAppearances,
|
|
85
|
+
spacing: _spacing.iconButtonSpacing
|
|
81
86
|
}];
|
|
82
87
|
var defaultButtonVariants = exports.defaultButtonVariants = variants.filter(function (_ref4) {
|
|
83
88
|
var name = _ref4.name;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -102,7 +102,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
102
102
|
action: 'clicked',
|
|
103
103
|
componentName: 'button',
|
|
104
104
|
packageName: "@atlaskit/button",
|
|
105
|
-
packageVersion: "17.
|
|
105
|
+
packageVersion: "17.7.1",
|
|
106
106
|
analyticsData: analyticsContext
|
|
107
107
|
});
|
|
108
108
|
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const buttonSpacing = ['default', 'compact', 'none'];
|
|
2
|
+
const iconButtonSpacing = ['default', 'compact'];
|
|
3
|
+
export { buttonSpacing, iconButtonSpacing };
|
|
@@ -6,6 +6,7 @@ import LinkButton from '../new-button/variants/default/link';
|
|
|
6
6
|
import IconButton from '../new-button/variants/icon/button';
|
|
7
7
|
import LinkIconButton from '../new-button/variants/icon/link';
|
|
8
8
|
import { buttonAppearances, iconButtonAppearances, linkButtonAppearances } from './appearances';
|
|
9
|
+
import { buttonSpacing, iconButtonSpacing } from './spacing';
|
|
9
10
|
// Add required default props to variants
|
|
10
11
|
const LinkButtonRender = /*#__PURE__*/forwardRef(({
|
|
11
12
|
href = 'home',
|
|
@@ -39,22 +40,26 @@ const variants = [{
|
|
|
39
40
|
name: 'Button',
|
|
40
41
|
Component: Button,
|
|
41
42
|
elementType: HTMLButtonElement,
|
|
42
|
-
appearances: buttonAppearances
|
|
43
|
+
appearances: buttonAppearances,
|
|
44
|
+
spacing: buttonSpacing
|
|
43
45
|
}, {
|
|
44
46
|
name: 'LinkButton',
|
|
45
47
|
Component: LinkButtonRender,
|
|
46
48
|
elementType: HTMLAnchorElement,
|
|
47
|
-
appearances: linkButtonAppearances
|
|
49
|
+
appearances: linkButtonAppearances,
|
|
50
|
+
spacing: buttonSpacing
|
|
48
51
|
}, {
|
|
49
52
|
name: 'IconButton',
|
|
50
53
|
Component: IconButtonRender,
|
|
51
54
|
elementType: HTMLButtonElement,
|
|
52
|
-
appearances: iconButtonAppearances
|
|
55
|
+
appearances: iconButtonAppearances,
|
|
56
|
+
spacing: iconButtonSpacing
|
|
53
57
|
}, {
|
|
54
58
|
name: 'LinkIconButton',
|
|
55
59
|
Component: LinkIconButtonRender,
|
|
56
60
|
elementType: HTMLAnchorElement,
|
|
57
|
-
appearances: iconButtonAppearances
|
|
61
|
+
appearances: iconButtonAppearances,
|
|
62
|
+
spacing: iconButtonSpacing
|
|
58
63
|
}];
|
|
59
64
|
export const defaultButtonVariants = variants.filter(({
|
|
60
65
|
name
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -108,7 +108,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
108
108
|
action: 'clicked',
|
|
109
109
|
componentName: 'button',
|
|
110
110
|
packageName: "@atlaskit/button",
|
|
111
|
-
packageVersion: "17.
|
|
111
|
+
packageVersion: "17.7.1",
|
|
112
112
|
analyticsData: analyticsContext
|
|
113
113
|
});
|
|
114
114
|
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
1
|
+
var buttonSpacing = ['default', 'compact', 'none'];
|
|
2
|
+
var iconButtonSpacing = ['default', 'compact'];
|
|
3
|
+
export { buttonSpacing, iconButtonSpacing };
|
|
@@ -10,6 +10,7 @@ import LinkButton from '../new-button/variants/default/link';
|
|
|
10
10
|
import IconButton from '../new-button/variants/icon/button';
|
|
11
11
|
import LinkIconButton from '../new-button/variants/icon/link';
|
|
12
12
|
import { buttonAppearances, iconButtonAppearances, linkButtonAppearances } from './appearances';
|
|
13
|
+
import { buttonSpacing, iconButtonSpacing } from './spacing';
|
|
13
14
|
// Add required default props to variants
|
|
14
15
|
var LinkButtonRender = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
15
16
|
var _ref$href = _ref.href,
|
|
@@ -52,22 +53,26 @@ var variants = [{
|
|
|
52
53
|
name: 'Button',
|
|
53
54
|
Component: Button,
|
|
54
55
|
elementType: HTMLButtonElement,
|
|
55
|
-
appearances: buttonAppearances
|
|
56
|
+
appearances: buttonAppearances,
|
|
57
|
+
spacing: buttonSpacing
|
|
56
58
|
}, {
|
|
57
59
|
name: 'LinkButton',
|
|
58
60
|
Component: LinkButtonRender,
|
|
59
61
|
elementType: HTMLAnchorElement,
|
|
60
|
-
appearances: linkButtonAppearances
|
|
62
|
+
appearances: linkButtonAppearances,
|
|
63
|
+
spacing: buttonSpacing
|
|
61
64
|
}, {
|
|
62
65
|
name: 'IconButton',
|
|
63
66
|
Component: IconButtonRender,
|
|
64
67
|
elementType: HTMLButtonElement,
|
|
65
|
-
appearances: iconButtonAppearances
|
|
68
|
+
appearances: iconButtonAppearances,
|
|
69
|
+
spacing: iconButtonSpacing
|
|
66
70
|
}, {
|
|
67
71
|
name: 'LinkIconButton',
|
|
68
72
|
Component: LinkIconButtonRender,
|
|
69
73
|
elementType: HTMLAnchorElement,
|
|
70
|
-
appearances: iconButtonAppearances
|
|
74
|
+
appearances: iconButtonAppearances,
|
|
75
|
+
spacing: iconButtonSpacing
|
|
71
76
|
}];
|
|
72
77
|
export var defaultButtonVariants = variants.filter(function (_ref4) {
|
|
73
78
|
var name = _ref4.name;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type IconProp, type IconSize } from '../types';
|
|
2
|
+
import { type ButtonSpacing, type IconProp, type IconSize } from '../types';
|
|
3
3
|
export type CommonDefaultButtonProps = {
|
|
4
4
|
/**
|
|
5
5
|
* Text content to be rendered in the button. Required so that screen readers always have an accessible label provided for the button.
|
|
@@ -27,4 +27,8 @@ export type CommonDefaultButtonProps = {
|
|
|
27
27
|
* Option to fit button width to its parent width.
|
|
28
28
|
*/
|
|
29
29
|
shouldFitContainer?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Controls the amount of padding in the button.
|
|
32
|
+
*/
|
|
33
|
+
spacing?: ButtonSpacing;
|
|
30
34
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type IconButtonAppearance, type IconProp, type IconSize } from '../types';
|
|
1
|
+
import { type IconButtonAppearance, type IconButtonSpacing, type IconProp, type IconSize } from '../types';
|
|
2
2
|
export type CommonIconButtonProps = {
|
|
3
3
|
/**
|
|
4
4
|
* The button style variation.
|
|
@@ -17,6 +17,10 @@ export type CommonIconButtonProps = {
|
|
|
17
17
|
* Set the shape of the icon, defaults to square with rounded corners.
|
|
18
18
|
*/
|
|
19
19
|
shape?: 'default' | 'circle';
|
|
20
|
+
/**
|
|
21
|
+
* Controls the amount of padding in the button.
|
|
22
|
+
*/
|
|
23
|
+
spacing?: IconButtonSpacing;
|
|
20
24
|
/**
|
|
21
25
|
* Set the size of the icon. `medium` is default, so it does not need to be specified.
|
|
22
26
|
* This is UNSAFE as it will be removed in future in favor of a 100% bounded API.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { xcss } from '@atlaskit/primitives';
|
|
3
|
-
import { type Appearance, type CommonButtonProps } from '../types';
|
|
3
|
+
import { type Appearance, type CommonButtonProps, type Spacing } from '../types';
|
|
4
4
|
export type ControlledEvents<TagName extends HTMLElement> = Pick<React.DOMAttributes<TagName>, 'onMouseDownCapture' | 'onMouseUpCapture' | 'onKeyDownCapture' | 'onKeyUpCapture' | 'onTouchStartCapture' | 'onTouchEndCapture' | 'onPointerDownCapture' | 'onPointerUpCapture' | 'onClickCapture'> & Pick<CommonButtonProps<TagName>, 'onClick'>;
|
|
5
5
|
export type UseButtonBaseArgs<TagName extends HTMLElement> = {
|
|
6
6
|
ref: React.Ref<TagName>;
|
|
@@ -15,7 +15,8 @@ export type UseButtonBaseArgs<TagName extends HTMLElement> = {
|
|
|
15
15
|
shouldFitContainer?: boolean;
|
|
16
16
|
appearance?: Appearance;
|
|
17
17
|
children: React.ReactNode;
|
|
18
|
-
|
|
18
|
+
spacing?: Spacing;
|
|
19
|
+
} & Pick<CommonButtonProps<TagName>, 'analyticsContext' | 'autoFocus' | 'interactionName' | 'isDisabled' | 'isSelected' | 'overlay'> & ControlledEvents<TagName>;
|
|
19
20
|
export type UseButtonBaseReturn<TagName extends HTMLElement> = {
|
|
20
21
|
xcss: ReturnType<typeof xcss>;
|
|
21
22
|
ref(node: TagName | null): void;
|
|
@@ -5,7 +5,9 @@ export type ButtonAppearance = 'default' | 'danger' | 'primary' | 'subtle' | 'wa
|
|
|
5
5
|
export type LinkButtonAppearance = 'default' | 'danger' | 'link' | 'primary' | 'subtle' | 'subtle-link' | 'warning';
|
|
6
6
|
export type IconButtonAppearance = 'default' | 'primary' | 'subtle';
|
|
7
7
|
export type Appearance = ButtonAppearance | LinkButtonAppearance | IconButtonAppearance;
|
|
8
|
-
export type
|
|
8
|
+
export type ButtonSpacing = 'compact' | 'default' | 'none';
|
|
9
|
+
export type IconButtonSpacing = 'compact' | 'default';
|
|
10
|
+
export type Spacing = ButtonSpacing | IconButtonSpacing;
|
|
9
11
|
export type IconProp = React.ComponentType<IconProps>;
|
|
10
12
|
export type IconSize = 'small' | 'large' | 'xlarge';
|
|
11
13
|
type Combine<First, Second> = Omit<First, keyof Second> & Second;
|
|
@@ -38,10 +40,6 @@ export type CommonButtonProps<TagName extends HTMLElement> = {
|
|
|
38
40
|
* Handler to be called on focus.
|
|
39
41
|
*/
|
|
40
42
|
onFocus?: React.FocusEventHandler<TagName>;
|
|
41
|
-
/**
|
|
42
|
-
* Controls the amount of padding in the button.
|
|
43
|
-
*/
|
|
44
|
-
spacing?: Spacing;
|
|
45
43
|
/**
|
|
46
44
|
* A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
|
|
47
45
|
*/
|
|
@@ -4,29 +4,34 @@ import { LinkButtonProps } from '../new-button/variants/default/link';
|
|
|
4
4
|
import { type IconButtonProps } from '../new-button/variants/icon/button';
|
|
5
5
|
import { type LinkIconButtonProps } from '../new-button/variants/icon/link';
|
|
6
6
|
import { buttonAppearances, iconButtonAppearances, linkButtonAppearances } from './appearances';
|
|
7
|
+
import { buttonSpacing, iconButtonSpacing } from './spacing';
|
|
7
8
|
type DefaultButtonVariant = {
|
|
8
9
|
name: 'Button';
|
|
9
10
|
Component: typeof Button;
|
|
10
11
|
elementType: typeof HTMLButtonElement;
|
|
11
12
|
appearances: typeof buttonAppearances;
|
|
13
|
+
spacing: typeof buttonSpacing;
|
|
12
14
|
};
|
|
13
15
|
type LinkButtonVariant = {
|
|
14
16
|
name: 'LinkButton';
|
|
15
17
|
Component: typeof LinkButtonRender;
|
|
16
18
|
elementType: typeof HTMLAnchorElement;
|
|
17
19
|
appearances: typeof linkButtonAppearances;
|
|
20
|
+
spacing: typeof buttonSpacing;
|
|
18
21
|
};
|
|
19
22
|
type IconButtonVariant = {
|
|
20
23
|
name: 'IconButton';
|
|
21
24
|
Component: typeof IconButtonRender;
|
|
22
25
|
elementType: typeof HTMLButtonElement;
|
|
23
26
|
appearances: typeof iconButtonAppearances;
|
|
27
|
+
spacing: typeof iconButtonSpacing;
|
|
24
28
|
};
|
|
25
29
|
type LinkIconButtonVariant = {
|
|
26
30
|
name: 'LinkIconButton';
|
|
27
31
|
Component: typeof LinkIconButtonRender;
|
|
28
32
|
elementType: typeof HTMLAnchorElement;
|
|
29
33
|
appearances: typeof iconButtonAppearances;
|
|
34
|
+
spacing: typeof iconButtonSpacing;
|
|
30
35
|
};
|
|
31
36
|
type DefaultButtonVariants = DefaultButtonVariant | LinkButtonVariant;
|
|
32
37
|
type LinkButtonVariants = LinkButtonVariant | LinkIconButtonVariant;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type IconProp, type IconSize } from '../types';
|
|
2
|
+
import { type ButtonSpacing, type IconProp, type IconSize } from '../types';
|
|
3
3
|
export type CommonDefaultButtonProps = {
|
|
4
4
|
/**
|
|
5
5
|
* Text content to be rendered in the button. Required so that screen readers always have an accessible label provided for the button.
|
|
@@ -27,4 +27,8 @@ export type CommonDefaultButtonProps = {
|
|
|
27
27
|
* Option to fit button width to its parent width.
|
|
28
28
|
*/
|
|
29
29
|
shouldFitContainer?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Controls the amount of padding in the button.
|
|
32
|
+
*/
|
|
33
|
+
spacing?: ButtonSpacing;
|
|
30
34
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type IconButtonAppearance, type IconProp, type IconSize } from '../types';
|
|
1
|
+
import { type IconButtonAppearance, type IconButtonSpacing, type IconProp, type IconSize } from '../types';
|
|
2
2
|
export type CommonIconButtonProps = {
|
|
3
3
|
/**
|
|
4
4
|
* The button style variation.
|
|
@@ -17,6 +17,10 @@ export type CommonIconButtonProps = {
|
|
|
17
17
|
* Set the shape of the icon, defaults to square with rounded corners.
|
|
18
18
|
*/
|
|
19
19
|
shape?: 'default' | 'circle';
|
|
20
|
+
/**
|
|
21
|
+
* Controls the amount of padding in the button.
|
|
22
|
+
*/
|
|
23
|
+
spacing?: IconButtonSpacing;
|
|
20
24
|
/**
|
|
21
25
|
* Set the size of the icon. `medium` is default, so it does not need to be specified.
|
|
22
26
|
* This is UNSAFE as it will be removed in future in favor of a 100% bounded API.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { xcss } from '@atlaskit/primitives';
|
|
3
|
-
import { type Appearance, type CommonButtonProps } from '../types';
|
|
3
|
+
import { type Appearance, type CommonButtonProps, type Spacing } from '../types';
|
|
4
4
|
export type ControlledEvents<TagName extends HTMLElement> = Pick<React.DOMAttributes<TagName>, 'onMouseDownCapture' | 'onMouseUpCapture' | 'onKeyDownCapture' | 'onKeyUpCapture' | 'onTouchStartCapture' | 'onTouchEndCapture' | 'onPointerDownCapture' | 'onPointerUpCapture' | 'onClickCapture'> & Pick<CommonButtonProps<TagName>, 'onClick'>;
|
|
5
5
|
export type UseButtonBaseArgs<TagName extends HTMLElement> = {
|
|
6
6
|
ref: React.Ref<TagName>;
|
|
@@ -15,7 +15,8 @@ export type UseButtonBaseArgs<TagName extends HTMLElement> = {
|
|
|
15
15
|
shouldFitContainer?: boolean;
|
|
16
16
|
appearance?: Appearance;
|
|
17
17
|
children: React.ReactNode;
|
|
18
|
-
|
|
18
|
+
spacing?: Spacing;
|
|
19
|
+
} & Pick<CommonButtonProps<TagName>, 'analyticsContext' | 'autoFocus' | 'interactionName' | 'isDisabled' | 'isSelected' | 'overlay'> & ControlledEvents<TagName>;
|
|
19
20
|
export type UseButtonBaseReturn<TagName extends HTMLElement> = {
|
|
20
21
|
xcss: ReturnType<typeof xcss>;
|
|
21
22
|
ref(node: TagName | null): void;
|
|
@@ -5,7 +5,9 @@ export type ButtonAppearance = 'default' | 'danger' | 'primary' | 'subtle' | 'wa
|
|
|
5
5
|
export type LinkButtonAppearance = 'default' | 'danger' | 'link' | 'primary' | 'subtle' | 'subtle-link' | 'warning';
|
|
6
6
|
export type IconButtonAppearance = 'default' | 'primary' | 'subtle';
|
|
7
7
|
export type Appearance = ButtonAppearance | LinkButtonAppearance | IconButtonAppearance;
|
|
8
|
-
export type
|
|
8
|
+
export type ButtonSpacing = 'compact' | 'default' | 'none';
|
|
9
|
+
export type IconButtonSpacing = 'compact' | 'default';
|
|
10
|
+
export type Spacing = ButtonSpacing | IconButtonSpacing;
|
|
9
11
|
export type IconProp = React.ComponentType<IconProps>;
|
|
10
12
|
export type IconSize = 'small' | 'large' | 'xlarge';
|
|
11
13
|
type Combine<First, Second> = Omit<First, keyof Second> & Second;
|
|
@@ -38,10 +40,6 @@ export type CommonButtonProps<TagName extends HTMLElement> = {
|
|
|
38
40
|
* Handler to be called on focus.
|
|
39
41
|
*/
|
|
40
42
|
onFocus?: React.FocusEventHandler<TagName>;
|
|
41
|
-
/**
|
|
42
|
-
* Controls the amount of padding in the button.
|
|
43
|
-
*/
|
|
44
|
-
spacing?: Spacing;
|
|
45
43
|
/**
|
|
46
44
|
* A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
|
|
47
45
|
*/
|
|
@@ -4,29 +4,34 @@ import { LinkButtonProps } from '../new-button/variants/default/link';
|
|
|
4
4
|
import { type IconButtonProps } from '../new-button/variants/icon/button';
|
|
5
5
|
import { type LinkIconButtonProps } from '../new-button/variants/icon/link';
|
|
6
6
|
import { buttonAppearances, iconButtonAppearances, linkButtonAppearances } from './appearances';
|
|
7
|
+
import { buttonSpacing, iconButtonSpacing } from './spacing';
|
|
7
8
|
type DefaultButtonVariant = {
|
|
8
9
|
name: 'Button';
|
|
9
10
|
Component: typeof Button;
|
|
10
11
|
elementType: typeof HTMLButtonElement;
|
|
11
12
|
appearances: typeof buttonAppearances;
|
|
13
|
+
spacing: typeof buttonSpacing;
|
|
12
14
|
};
|
|
13
15
|
type LinkButtonVariant = {
|
|
14
16
|
name: 'LinkButton';
|
|
15
17
|
Component: typeof LinkButtonRender;
|
|
16
18
|
elementType: typeof HTMLAnchorElement;
|
|
17
19
|
appearances: typeof linkButtonAppearances;
|
|
20
|
+
spacing: typeof buttonSpacing;
|
|
18
21
|
};
|
|
19
22
|
type IconButtonVariant = {
|
|
20
23
|
name: 'IconButton';
|
|
21
24
|
Component: typeof IconButtonRender;
|
|
22
25
|
elementType: typeof HTMLButtonElement;
|
|
23
26
|
appearances: typeof iconButtonAppearances;
|
|
27
|
+
spacing: typeof iconButtonSpacing;
|
|
24
28
|
};
|
|
25
29
|
type LinkIconButtonVariant = {
|
|
26
30
|
name: 'LinkIconButton';
|
|
27
31
|
Component: typeof LinkIconButtonRender;
|
|
28
32
|
elementType: typeof HTMLAnchorElement;
|
|
29
33
|
appearances: typeof iconButtonAppearances;
|
|
34
|
+
spacing: typeof iconButtonSpacing;
|
|
30
35
|
};
|
|
31
36
|
type DefaultButtonVariants = DefaultButtonVariant | LinkButtonVariant;
|
|
32
37
|
type LinkButtonVariants = LinkButtonVariant | LinkIconButtonVariant;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/button",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.7.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,10 +87,10 @@
|
|
|
87
87
|
"@atlaskit/focus-ring": "^1.3.0",
|
|
88
88
|
"@atlaskit/icon": "^22.1.0",
|
|
89
89
|
"@atlaskit/interaction-context": "^2.1.0",
|
|
90
|
-
"@atlaskit/primitives": "^
|
|
90
|
+
"@atlaskit/primitives": "^5.0.0",
|
|
91
91
|
"@atlaskit/spinner": "^16.0.0",
|
|
92
92
|
"@atlaskit/theme": "^12.6.0",
|
|
93
|
-
"@atlaskit/tokens": "^1.
|
|
93
|
+
"@atlaskit/tokens": "^1.41.0",
|
|
94
94
|
"@atlaskit/visually-hidden": "^1.2.4",
|
|
95
95
|
"@babel/runtime": "^7.0.0",
|
|
96
96
|
"@emotion/react": "^11.7.1"
|