@atlaskit/button 17.17.0 → 17.17.2
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 +1223 -1221
- package/dist/cjs/new-button/variants/default/button.js +28 -28
- package/dist/cjs/new-button/variants/default/link.js +29 -29
- package/dist/cjs/new-button/variants/default/use-default-button.js +11 -11
- package/dist/cjs/new-button/variants/icon/button.js +9 -9
- package/dist/cjs/new-button/variants/icon/link.js +8 -8
- package/dist/cjs/new-button/variants/icon/use-icon-button.js +6 -6
- package/dist/cjs/old-button/button.js +5 -3
- package/dist/cjs/old-button/loading-button.js +2 -0
- package/dist/cjs/old-button/shared/button-base.js +4 -2
- package/dist/es2019/new-button/variants/default/button.js +27 -27
- package/dist/es2019/new-button/variants/default/link.js +28 -28
- package/dist/es2019/new-button/variants/default/use-default-button.js +11 -11
- package/dist/es2019/new-button/variants/icon/button.js +9 -9
- package/dist/es2019/new-button/variants/icon/link.js +8 -8
- package/dist/es2019/new-button/variants/icon/use-icon-button.js +6 -6
- package/dist/es2019/old-button/button.js +5 -3
- package/dist/es2019/old-button/loading-button.js +2 -0
- package/dist/es2019/old-button/shared/button-base.js +4 -2
- package/dist/esm/new-button/variants/default/button.js +28 -28
- package/dist/esm/new-button/variants/default/link.js +29 -29
- package/dist/esm/new-button/variants/default/use-default-button.js +11 -11
- package/dist/esm/new-button/variants/icon/button.js +9 -9
- package/dist/esm/new-button/variants/icon/link.js +8 -8
- package/dist/esm/new-button/variants/icon/use-icon-button.js +6 -6
- package/dist/esm/old-button/button.js +5 -3
- package/dist/esm/old-button/loading-button.js +2 -0
- package/dist/esm/old-button/shared/button-base.js +4 -2
- package/dist/types/new-button/containers/split-button/index.d.ts +2 -2
- package/dist/types/new-button/containers/split-button/split-button.d.ts +1 -1
- package/dist/types/new-button/variants/default/link.d.ts +4 -4
- package/dist/types/new-button/variants/default/use-default-button.d.ts +1 -1
- package/dist/types/new-button/variants/icon/button.d.ts +3 -3
- package/dist/types/new-button/variants/icon/link.d.ts +3 -3
- package/dist/types/new-button/variants/icon/use-icon-button.d.ts +1 -1
- package/dist/types/new-button/variants/shared/content.d.ts +1 -1
- package/dist/types/new-button/variants/types.d.ts +1 -1
- package/dist/types/old-button/button.d.ts +5 -3
- package/dist/types/old-button/loading-button.d.ts +2 -0
- package/dist/types-ts4.5/new-button/containers/split-button/index.d.ts +2 -2
- package/dist/types-ts4.5/new-button/containers/split-button/split-button.d.ts +1 -1
- package/dist/types-ts4.5/new-button/variants/default/link.d.ts +4 -4
- package/dist/types-ts4.5/new-button/variants/default/use-default-button.d.ts +1 -1
- package/dist/types-ts4.5/new-button/variants/icon/button.d.ts +3 -3
- package/dist/types-ts4.5/new-button/variants/icon/link.d.ts +3 -3
- package/dist/types-ts4.5/new-button/variants/icon/use-icon-button.d.ts +1 -1
- package/dist/types-ts4.5/new-button/variants/shared/content.d.ts +1 -1
- package/dist/types-ts4.5/new-button/variants/types.d.ts +1 -1
- package/dist/types-ts4.5/old-button/button.d.ts +5 -3
- package/dist/types-ts4.5/old-button/loading-button.d.ts +2 -0
- package/package.json +60 -24
|
@@ -10,7 +10,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
var _pressable = _interopRequireDefault(require("@atlaskit/primitives/pressable"));
|
|
12
12
|
var _useDefaultButton = _interopRequireDefault(require("./use-default-button"));
|
|
13
|
-
var _excluded = ["analyticsContext", "
|
|
13
|
+
var _excluded = ["analyticsContext", "appearance", "autoFocus", "children", "iconAfter", "iconBefore", "interactionName", "isDisabled", "isLoading", "isSelected", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shouldFitContainer", "spacing", "testId", "type", "UNSAFE_iconAfter_size", "UNSAFE_iconBefore_size"];
|
|
14
14
|
/**
|
|
15
15
|
* __Button__
|
|
16
16
|
*
|
|
@@ -22,33 +22,33 @@ var _excluded = ["analyticsContext", "interactionName", "autoFocus", "appearance
|
|
|
22
22
|
*/
|
|
23
23
|
var Button = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef(function Button(_ref, ref) {
|
|
24
24
|
var analyticsContext = _ref.analyticsContext,
|
|
25
|
-
interactionName = _ref.interactionName,
|
|
26
|
-
autoFocus = _ref.autoFocus,
|
|
27
25
|
appearance = _ref.appearance,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
autoFocus = _ref.autoFocus,
|
|
27
|
+
children = _ref.children,
|
|
28
|
+
iconAfter = _ref.iconAfter,
|
|
31
29
|
iconBefore = _ref.iconBefore,
|
|
30
|
+
interactionName = _ref.interactionName,
|
|
31
|
+
isDisabled = _ref.isDisabled,
|
|
32
32
|
isLoading = _ref.isLoading,
|
|
33
|
-
|
|
34
|
-
iconAfter = _ref.iconAfter,
|
|
35
|
-
UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
|
|
36
|
-
children = _ref.children,
|
|
37
|
-
shouldFitContainer = _ref.shouldFitContainer,
|
|
38
|
-
overlay = _ref.overlay,
|
|
33
|
+
isSelected = _ref.isSelected,
|
|
39
34
|
onClick = _ref.onClick,
|
|
40
|
-
|
|
41
|
-
onMouseUpCapture = _ref.onMouseUpCapture,
|
|
35
|
+
onClickCapture = _ref.onClickCapture,
|
|
42
36
|
onKeyDownCapture = _ref.onKeyDownCapture,
|
|
43
37
|
onKeyUpCapture = _ref.onKeyUpCapture,
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
onMouseDownCapture = _ref.onMouseDownCapture,
|
|
39
|
+
onMouseUpCapture = _ref.onMouseUpCapture,
|
|
46
40
|
onPointerDownCapture = _ref.onPointerDownCapture,
|
|
47
41
|
onPointerUpCapture = _ref.onPointerUpCapture,
|
|
48
|
-
|
|
42
|
+
onTouchEndCapture = _ref.onTouchEndCapture,
|
|
43
|
+
onTouchStartCapture = _ref.onTouchStartCapture,
|
|
44
|
+
overlay = _ref.overlay,
|
|
45
|
+
shouldFitContainer = _ref.shouldFitContainer,
|
|
46
|
+
spacing = _ref.spacing,
|
|
47
|
+
testId = _ref.testId,
|
|
49
48
|
_ref$type = _ref.type,
|
|
50
49
|
type = _ref$type === void 0 ? 'button' : _ref$type,
|
|
51
|
-
|
|
50
|
+
UNSAFE_iconAfter_size = _ref.UNSAFE_iconAfter_size,
|
|
51
|
+
UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
|
|
52
52
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
53
53
|
var baseProps = (0, _useDefaultButton.default)({
|
|
54
54
|
analyticsContext: analyticsContext,
|
|
@@ -56,28 +56,28 @@ var Button = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
56
56
|
autoFocus: autoFocus,
|
|
57
57
|
buttonType: 'button',
|
|
58
58
|
children: children,
|
|
59
|
-
iconBefore: iconBefore,
|
|
60
|
-
UNSAFE_iconBefore_size: UNSAFE_iconBefore_size,
|
|
61
59
|
iconAfter: iconAfter,
|
|
62
|
-
|
|
60
|
+
iconBefore: iconBefore,
|
|
63
61
|
interactionName: interactionName,
|
|
64
62
|
isDisabled: isDisabled,
|
|
65
|
-
isSelected: isSelected,
|
|
66
63
|
isLoading: isLoading,
|
|
64
|
+
isSelected: isSelected,
|
|
67
65
|
onClick: onClick,
|
|
68
|
-
|
|
69
|
-
onMouseUpCapture: onMouseUpCapture,
|
|
66
|
+
onClickCapture: onClickCapture,
|
|
70
67
|
onKeyDownCapture: onKeyDownCapture,
|
|
71
68
|
onKeyUpCapture: onKeyUpCapture,
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
onMouseDownCapture: onMouseDownCapture,
|
|
70
|
+
onMouseUpCapture: onMouseUpCapture,
|
|
74
71
|
onPointerDownCapture: onPointerDownCapture,
|
|
75
72
|
onPointerUpCapture: onPointerUpCapture,
|
|
76
|
-
|
|
73
|
+
onTouchEndCapture: onTouchEndCapture,
|
|
74
|
+
onTouchStartCapture: onTouchStartCapture,
|
|
77
75
|
overlay: overlay,
|
|
78
76
|
ref: ref,
|
|
79
77
|
shouldFitContainer: shouldFitContainer,
|
|
80
|
-
spacing: spacing
|
|
78
|
+
spacing: spacing,
|
|
79
|
+
UNSAFE_iconAfter_size: UNSAFE_iconAfter_size,
|
|
80
|
+
UNSAFE_iconBefore_size: UNSAFE_iconBefore_size
|
|
81
81
|
});
|
|
82
82
|
return /*#__PURE__*/_react.default.createElement(_pressable.default
|
|
83
83
|
// TODO: Remove spread props
|
|
@@ -11,36 +11,36 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _anchor = _interopRequireDefault(require("@atlaskit/primitives/anchor"));
|
|
13
13
|
var _useDefaultButton = _interopRequireDefault(require("./use-default-button"));
|
|
14
|
-
var _excluded = ["analyticsContext", "
|
|
14
|
+
var _excluded = ["analyticsContext", "appearance", "autoFocus", "children", "href", "iconAfter", "iconBefore", "interactionName", "isDisabled", "isSelected", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shouldFitContainer", "spacing", "testId", "UNSAFE_iconAfter_size", "UNSAFE_iconBefore_size"];
|
|
15
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
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
|
-
interactionName = _ref.interactionName,
|
|
20
|
-
autoFocus = _ref.autoFocus,
|
|
21
19
|
appearance = _ref.appearance,
|
|
22
|
-
|
|
20
|
+
autoFocus = _ref.autoFocus,
|
|
21
|
+
children = _ref.children,
|
|
22
|
+
href = _ref.href,
|
|
23
|
+
iconAfter = _ref.iconAfter,
|
|
24
|
+
iconBefore = _ref.iconBefore,
|
|
25
|
+
interactionName = _ref.interactionName,
|
|
23
26
|
isDisabled = _ref.isDisabled,
|
|
24
27
|
isSelected = _ref.isSelected,
|
|
25
|
-
iconBefore = _ref.iconBefore,
|
|
26
|
-
UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
|
|
27
|
-
iconAfter = _ref.iconAfter,
|
|
28
|
-
UNSAFE_iconAfter_size = _ref.UNSAFE_iconAfter_size,
|
|
29
|
-
children = _ref.children,
|
|
30
|
-
shouldFitContainer = _ref.shouldFitContainer,
|
|
31
|
-
overlay = _ref.overlay,
|
|
32
28
|
onClick = _ref.onClick,
|
|
33
|
-
|
|
34
|
-
onMouseUpCapture = _ref.onMouseUpCapture,
|
|
29
|
+
onClickCapture = _ref.onClickCapture,
|
|
35
30
|
onKeyDownCapture = _ref.onKeyDownCapture,
|
|
36
31
|
onKeyUpCapture = _ref.onKeyUpCapture,
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
onMouseDownCapture = _ref.onMouseDownCapture,
|
|
33
|
+
onMouseUpCapture = _ref.onMouseUpCapture,
|
|
39
34
|
onPointerDownCapture = _ref.onPointerDownCapture,
|
|
40
35
|
onPointerUpCapture = _ref.onPointerUpCapture,
|
|
41
|
-
|
|
36
|
+
onTouchEndCapture = _ref.onTouchEndCapture,
|
|
37
|
+
onTouchStartCapture = _ref.onTouchStartCapture,
|
|
38
|
+
overlay = _ref.overlay,
|
|
39
|
+
shouldFitContainer = _ref.shouldFitContainer,
|
|
40
|
+
spacing = _ref.spacing,
|
|
42
41
|
testId = _ref.testId,
|
|
43
|
-
|
|
42
|
+
UNSAFE_iconAfter_size = _ref.UNSAFE_iconAfter_size,
|
|
43
|
+
UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
|
|
44
44
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
45
45
|
var baseProps = (0, _useDefaultButton.default)({
|
|
46
46
|
analyticsContext: analyticsContext,
|
|
@@ -48,27 +48,27 @@ var LinkButtonBase = function LinkButtonBase(_ref, ref) {
|
|
|
48
48
|
autoFocus: autoFocus,
|
|
49
49
|
buttonType: 'link',
|
|
50
50
|
children: children,
|
|
51
|
-
iconBefore: iconBefore,
|
|
52
|
-
UNSAFE_iconBefore_size: UNSAFE_iconBefore_size,
|
|
53
51
|
iconAfter: iconAfter,
|
|
54
|
-
|
|
52
|
+
iconBefore: iconBefore,
|
|
55
53
|
interactionName: interactionName,
|
|
56
54
|
isDisabled: isDisabled,
|
|
57
55
|
isSelected: isSelected,
|
|
58
56
|
onClick: onClick,
|
|
59
|
-
|
|
60
|
-
onMouseUpCapture: onMouseUpCapture,
|
|
57
|
+
onClickCapture: onClickCapture,
|
|
61
58
|
onKeyDownCapture: onKeyDownCapture,
|
|
62
59
|
onKeyUpCapture: onKeyUpCapture,
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
onMouseDownCapture: onMouseDownCapture,
|
|
61
|
+
onMouseUpCapture: onMouseUpCapture,
|
|
65
62
|
onPointerDownCapture: onPointerDownCapture,
|
|
66
63
|
onPointerUpCapture: onPointerUpCapture,
|
|
67
|
-
|
|
64
|
+
onTouchEndCapture: onTouchEndCapture,
|
|
65
|
+
onTouchStartCapture: onTouchStartCapture,
|
|
68
66
|
overlay: overlay,
|
|
69
67
|
ref: ref,
|
|
70
68
|
shouldFitContainer: shouldFitContainer,
|
|
71
|
-
spacing: spacing
|
|
69
|
+
spacing: spacing,
|
|
70
|
+
UNSAFE_iconAfter_size: UNSAFE_iconAfter_size,
|
|
71
|
+
UNSAFE_iconBefore_size: UNSAFE_iconBefore_size
|
|
72
72
|
});
|
|
73
73
|
return /*#__PURE__*/_react.default.createElement(_anchor.default
|
|
74
74
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
@@ -109,9 +109,9 @@ var WithRef = /*#__PURE__*/(0, _react.forwardRef)(LinkButtonBase);
|
|
|
109
109
|
*
|
|
110
110
|
* Renders a link in the style of a button.
|
|
111
111
|
*
|
|
112
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
113
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
114
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
112
|
+
* - [Examples](https://atlassian.design/components/link-button/examples)
|
|
113
|
+
* - [Code](https://atlassian.design/components/link-button/code)
|
|
114
|
+
* - [Usage](https://atlassian.design/components/link-button/usage)
|
|
115
115
|
*/
|
|
116
116
|
var LinkButton = /*#__PURE__*/(0, _react.memo)(WithRef);
|
|
117
117
|
var _default = exports.default = LinkButton;
|
|
@@ -26,30 +26,30 @@ var useDefaultButton = function useDefaultButton(_ref) {
|
|
|
26
26
|
appearance = _ref.appearance,
|
|
27
27
|
autoFocus = _ref.autoFocus,
|
|
28
28
|
buttonType = _ref.buttonType,
|
|
29
|
-
|
|
30
|
-
UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
|
|
29
|
+
children = _ref.children,
|
|
31
30
|
IconAfter = _ref.iconAfter,
|
|
32
|
-
|
|
31
|
+
IconBefore = _ref.iconBefore,
|
|
33
32
|
interactionName = _ref.interactionName,
|
|
34
33
|
isDisabled = _ref.isDisabled,
|
|
35
|
-
isSelected = _ref.isSelected,
|
|
36
34
|
_ref$isLoading = _ref.isLoading,
|
|
37
35
|
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
38
|
-
|
|
36
|
+
isSelected = _ref.isSelected,
|
|
39
37
|
onClick = _ref.onClick,
|
|
40
|
-
|
|
41
|
-
onMouseUpCapture = _ref.onMouseUpCapture,
|
|
38
|
+
onClickCapture = _ref.onClickCapture,
|
|
42
39
|
onKeyDownCapture = _ref.onKeyDownCapture,
|
|
43
40
|
onKeyUpCapture = _ref.onKeyUpCapture,
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
onMouseDownCapture = _ref.onMouseDownCapture,
|
|
42
|
+
onMouseUpCapture = _ref.onMouseUpCapture,
|
|
46
43
|
onPointerDownCapture = _ref.onPointerDownCapture,
|
|
47
44
|
onPointerUpCapture = _ref.onPointerUpCapture,
|
|
48
|
-
|
|
45
|
+
onTouchEndCapture = _ref.onTouchEndCapture,
|
|
46
|
+
onTouchStartCapture = _ref.onTouchStartCapture,
|
|
49
47
|
overlay = _ref.overlay,
|
|
50
48
|
ref = _ref.ref,
|
|
51
49
|
shouldFitContainer = _ref.shouldFitContainer,
|
|
52
|
-
spacing = _ref.spacing
|
|
50
|
+
spacing = _ref.spacing,
|
|
51
|
+
UNSAFE_iconAfter_size = _ref.UNSAFE_iconAfter_size,
|
|
52
|
+
UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size;
|
|
53
53
|
var hasOverlay = Boolean(overlay || isLoading);
|
|
54
54
|
var baseProps = (0, _useButtonBase.default)({
|
|
55
55
|
analyticsContext: analyticsContext,
|
|
@@ -17,9 +17,9 @@ var _excluded = ["aria-label", "analyticsContext", "appearance", "autoFocus", "i
|
|
|
17
17
|
*
|
|
18
18
|
* TODO: Description
|
|
19
19
|
*
|
|
20
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
21
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
22
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
20
|
+
* - [Examples](https://atlassian.design/components/icon-button/examples)
|
|
21
|
+
* - [Code](https://atlassian.design/components/icon-button/code)
|
|
22
|
+
* - [Usage](https://atlassian.design/components/icon-button/usage)
|
|
23
23
|
*/
|
|
24
24
|
var IconButton = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef(function Button(_ref, ref) {
|
|
25
25
|
var preventedAriaLabel = _ref['aria-label'],
|
|
@@ -65,19 +65,19 @@ var IconButton = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.f
|
|
|
65
65
|
icon: icon,
|
|
66
66
|
interactionName: interactionName,
|
|
67
67
|
isDisabled: isDisabled,
|
|
68
|
-
isSelected: isSelected,
|
|
69
68
|
isLoading: isLoading,
|
|
69
|
+
isSelected: isSelected,
|
|
70
70
|
label: label,
|
|
71
71
|
onClick: onClick,
|
|
72
|
-
|
|
73
|
-
onMouseUpCapture: onMouseUpCapture,
|
|
72
|
+
onClickCapture: onClickCapture,
|
|
74
73
|
onKeyDownCapture: onKeyDownCapture,
|
|
75
74
|
onKeyUpCapture: onKeyUpCapture,
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
onMouseDownCapture: onMouseDownCapture,
|
|
76
|
+
onMouseUpCapture: onMouseUpCapture,
|
|
78
77
|
onPointerDownCapture: onPointerDownCapture,
|
|
79
78
|
onPointerUpCapture: onPointerUpCapture,
|
|
80
|
-
|
|
79
|
+
onTouchEndCapture: onTouchEndCapture,
|
|
80
|
+
onTouchStartCapture: onTouchStartCapture,
|
|
81
81
|
overlay: overlay,
|
|
82
82
|
ref: ref,
|
|
83
83
|
shape: shape,
|
|
@@ -56,15 +56,15 @@ var LinkIconButtonBase = function LinkIconButtonBase(_ref, ref) {
|
|
|
56
56
|
isSelected: isSelected,
|
|
57
57
|
label: label,
|
|
58
58
|
onClick: onClick,
|
|
59
|
-
|
|
60
|
-
onMouseUpCapture: onMouseUpCapture,
|
|
59
|
+
onClickCapture: onClickCapture,
|
|
61
60
|
onKeyDownCapture: onKeyDownCapture,
|
|
62
61
|
onKeyUpCapture: onKeyUpCapture,
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
onMouseDownCapture: onMouseDownCapture,
|
|
63
|
+
onMouseUpCapture: onMouseUpCapture,
|
|
65
64
|
onPointerDownCapture: onPointerDownCapture,
|
|
66
65
|
onPointerUpCapture: onPointerUpCapture,
|
|
67
|
-
|
|
66
|
+
onTouchEndCapture: onTouchEndCapture,
|
|
67
|
+
onTouchStartCapture: onTouchStartCapture,
|
|
68
68
|
overlay: overlay,
|
|
69
69
|
ref: ref,
|
|
70
70
|
shape: shape,
|
|
@@ -203,9 +203,9 @@ var WithRef = /*#__PURE__*/(0, _react.forwardRef)(LinkIconButtonBase);
|
|
|
203
203
|
*
|
|
204
204
|
* Renders a link in the style of an icon button.
|
|
205
205
|
*
|
|
206
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
207
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
208
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
206
|
+
* - [Examples](https://atlassian.design/components/link-icon-button/examples)
|
|
207
|
+
* - [Code](https://atlassian.design/components/link-icon-button/code)
|
|
208
|
+
* - [Usage](https://atlassian.design/components/link-icon-button/usage)
|
|
209
209
|
*/
|
|
210
210
|
var LinkIconButton = /*#__PURE__*/(0, _react.memo)(WithRef);
|
|
211
211
|
var _default = exports.default = LinkIconButton;
|
|
@@ -27,19 +27,19 @@ var useIconButton = function useIconButton(_ref) {
|
|
|
27
27
|
Icon = _ref.icon,
|
|
28
28
|
interactionName = _ref.interactionName,
|
|
29
29
|
isDisabled = _ref.isDisabled,
|
|
30
|
-
isSelected = _ref.isSelected,
|
|
31
30
|
isLoading = _ref.isLoading,
|
|
31
|
+
isSelected = _ref.isSelected,
|
|
32
32
|
label = _ref.label,
|
|
33
33
|
onClick = _ref.onClick,
|
|
34
|
-
|
|
35
|
-
onMouseUpCapture = _ref.onMouseUpCapture,
|
|
34
|
+
onClickCapture = _ref.onClickCapture,
|
|
36
35
|
onKeyDownCapture = _ref.onKeyDownCapture,
|
|
37
36
|
onKeyUpCapture = _ref.onKeyUpCapture,
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
onMouseDownCapture = _ref.onMouseDownCapture,
|
|
38
|
+
onMouseUpCapture = _ref.onMouseUpCapture,
|
|
40
39
|
onPointerDownCapture = _ref.onPointerDownCapture,
|
|
41
40
|
onPointerUpCapture = _ref.onPointerUpCapture,
|
|
42
|
-
|
|
41
|
+
onTouchEndCapture = _ref.onTouchEndCapture,
|
|
42
|
+
onTouchStartCapture = _ref.onTouchStartCapture,
|
|
43
43
|
overlay = _ref.overlay,
|
|
44
44
|
ref = _ref.ref,
|
|
45
45
|
shape = _ref.shape,
|
|
@@ -22,11 +22,13 @@ var isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerC
|
|
|
22
22
|
/**
|
|
23
23
|
* __Button__
|
|
24
24
|
*
|
|
25
|
+
* CAUTION: Legacy buttons will soon be deprecated. Please use the new Button components from `@atlaskit/button/new`.
|
|
26
|
+
*
|
|
25
27
|
* A button triggers an event or action. They let users know what will happen next.
|
|
26
28
|
*
|
|
27
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
28
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
29
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
29
|
+
* - [Examples](https://atlassian.design/components/button/button-legacy/examples)
|
|
30
|
+
* - [Code](https://atlassian.design/components/button/button-legacy/code)
|
|
31
|
+
* - [Usage](https://atlassian.design/components/button/button-legacy/usage)
|
|
30
32
|
*/
|
|
31
33
|
var Button = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef(function Button(_ref, ref) {
|
|
32
34
|
var _ref$appearance = _ref.appearance,
|
|
@@ -14,6 +14,8 @@ var _excluded = ["appearance", "isDisabled", "isSelected", "isLoading", "spacing
|
|
|
14
14
|
/**
|
|
15
15
|
* __Loading button__
|
|
16
16
|
*
|
|
17
|
+
* CAUTION: Legacy loading buttons will soon be deprecated. Please use the new Button components from `@atlaskit/button/new` with the `isLoading` prop.
|
|
18
|
+
*
|
|
17
19
|
* A small wrapper around Button that allows you to show an @atlaskit/spinner as an overlay on the button when you set an isLoading prop to true.
|
|
18
20
|
*
|
|
19
21
|
* - [Examples](https://atlassian.design/components/button/examples#loading-button)
|
|
@@ -129,7 +129,7 @@ var _default = exports.default = /*#__PURE__*/_react.default.forwardRef(function
|
|
|
129
129
|
action: 'clicked',
|
|
130
130
|
componentName: 'button',
|
|
131
131
|
packageName: "@atlaskit/button",
|
|
132
|
-
packageVersion: "17.17.
|
|
132
|
+
packageVersion: "17.17.2",
|
|
133
133
|
analyticsData: analyticsContext
|
|
134
134
|
});
|
|
135
135
|
|
|
@@ -168,7 +168,9 @@ var _default = exports.default = /*#__PURE__*/_react.default.forwardRef(function
|
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
170
|
return (0, _react2.jsx)(_focusRing.default, null, (0, _react2.jsx)(Component, (0, _extends2.default)({}, rest, {
|
|
171
|
-
ref: setRef
|
|
171
|
+
ref: setRef
|
|
172
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
173
|
+
,
|
|
172
174
|
className: className,
|
|
173
175
|
css: [buttonCss, isInteractive ? null : noPointerEventsOnChildrenCss]
|
|
174
176
|
// using undefined so that the property doesn't exist when false
|
|
@@ -13,32 +13,32 @@ import useDefaultButton from './use-default-button';
|
|
|
13
13
|
*/
|
|
14
14
|
const Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function Button({
|
|
15
15
|
analyticsContext,
|
|
16
|
-
interactionName,
|
|
17
|
-
autoFocus,
|
|
18
16
|
appearance,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
autoFocus,
|
|
18
|
+
children,
|
|
19
|
+
iconAfter,
|
|
22
20
|
iconBefore,
|
|
21
|
+
interactionName,
|
|
22
|
+
isDisabled,
|
|
23
23
|
isLoading,
|
|
24
|
-
|
|
25
|
-
iconAfter,
|
|
26
|
-
UNSAFE_iconBefore_size,
|
|
27
|
-
children,
|
|
28
|
-
shouldFitContainer,
|
|
29
|
-
overlay,
|
|
24
|
+
isSelected,
|
|
30
25
|
onClick,
|
|
31
|
-
|
|
32
|
-
onMouseUpCapture,
|
|
26
|
+
onClickCapture,
|
|
33
27
|
onKeyDownCapture,
|
|
34
28
|
onKeyUpCapture,
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
onMouseDownCapture,
|
|
30
|
+
onMouseUpCapture,
|
|
37
31
|
onPointerDownCapture,
|
|
38
32
|
onPointerUpCapture,
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
onTouchEndCapture,
|
|
34
|
+
onTouchStartCapture,
|
|
35
|
+
overlay,
|
|
36
|
+
shouldFitContainer,
|
|
37
|
+
spacing,
|
|
41
38
|
testId,
|
|
39
|
+
type = 'button',
|
|
40
|
+
UNSAFE_iconAfter_size,
|
|
41
|
+
UNSAFE_iconBefore_size,
|
|
42
42
|
...rest
|
|
43
43
|
}, ref) {
|
|
44
44
|
const baseProps = useDefaultButton({
|
|
@@ -47,28 +47,28 @@ const Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function B
|
|
|
47
47
|
autoFocus,
|
|
48
48
|
buttonType: 'button',
|
|
49
49
|
children,
|
|
50
|
-
iconBefore,
|
|
51
|
-
UNSAFE_iconBefore_size,
|
|
52
50
|
iconAfter,
|
|
53
|
-
|
|
51
|
+
iconBefore,
|
|
54
52
|
interactionName,
|
|
55
53
|
isDisabled,
|
|
56
|
-
isSelected,
|
|
57
54
|
isLoading,
|
|
55
|
+
isSelected,
|
|
58
56
|
onClick,
|
|
59
|
-
|
|
60
|
-
onMouseUpCapture,
|
|
57
|
+
onClickCapture,
|
|
61
58
|
onKeyDownCapture,
|
|
62
59
|
onKeyUpCapture,
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
onMouseDownCapture,
|
|
61
|
+
onMouseUpCapture,
|
|
65
62
|
onPointerDownCapture,
|
|
66
63
|
onPointerUpCapture,
|
|
67
|
-
|
|
64
|
+
onTouchEndCapture,
|
|
65
|
+
onTouchStartCapture,
|
|
68
66
|
overlay,
|
|
69
67
|
ref,
|
|
70
68
|
shouldFitContainer,
|
|
71
|
-
spacing
|
|
69
|
+
spacing,
|
|
70
|
+
UNSAFE_iconAfter_size,
|
|
71
|
+
UNSAFE_iconBefore_size
|
|
72
72
|
});
|
|
73
73
|
return /*#__PURE__*/React.createElement(Pressable
|
|
74
74
|
// TODO: Remove spread props
|
|
@@ -4,31 +4,31 @@ import UNSAFE_ANCHOR from '@atlaskit/primitives/anchor';
|
|
|
4
4
|
import useDefaultButton from './use-default-button';
|
|
5
5
|
const LinkButtonBase = ({
|
|
6
6
|
analyticsContext,
|
|
7
|
-
interactionName,
|
|
8
|
-
autoFocus,
|
|
9
7
|
appearance,
|
|
10
|
-
|
|
8
|
+
autoFocus,
|
|
9
|
+
children,
|
|
10
|
+
href,
|
|
11
|
+
iconAfter,
|
|
12
|
+
iconBefore,
|
|
13
|
+
interactionName,
|
|
11
14
|
isDisabled,
|
|
12
15
|
isSelected,
|
|
13
|
-
iconBefore,
|
|
14
|
-
UNSAFE_iconBefore_size,
|
|
15
|
-
iconAfter,
|
|
16
|
-
UNSAFE_iconAfter_size,
|
|
17
|
-
children,
|
|
18
|
-
shouldFitContainer,
|
|
19
|
-
overlay,
|
|
20
16
|
onClick,
|
|
21
|
-
|
|
22
|
-
onMouseUpCapture,
|
|
17
|
+
onClickCapture,
|
|
23
18
|
onKeyDownCapture,
|
|
24
19
|
onKeyUpCapture,
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
onMouseDownCapture,
|
|
21
|
+
onMouseUpCapture,
|
|
27
22
|
onPointerDownCapture,
|
|
28
23
|
onPointerUpCapture,
|
|
29
|
-
|
|
24
|
+
onTouchEndCapture,
|
|
25
|
+
onTouchStartCapture,
|
|
26
|
+
overlay,
|
|
27
|
+
shouldFitContainer,
|
|
28
|
+
spacing,
|
|
30
29
|
testId,
|
|
31
|
-
|
|
30
|
+
UNSAFE_iconAfter_size,
|
|
31
|
+
UNSAFE_iconBefore_size,
|
|
32
32
|
...rest
|
|
33
33
|
}, ref) => {
|
|
34
34
|
const baseProps = useDefaultButton({
|
|
@@ -37,27 +37,27 @@ const LinkButtonBase = ({
|
|
|
37
37
|
autoFocus,
|
|
38
38
|
buttonType: 'link',
|
|
39
39
|
children,
|
|
40
|
-
iconBefore,
|
|
41
|
-
UNSAFE_iconBefore_size,
|
|
42
40
|
iconAfter,
|
|
43
|
-
|
|
41
|
+
iconBefore,
|
|
44
42
|
interactionName,
|
|
45
43
|
isDisabled,
|
|
46
44
|
isSelected,
|
|
47
45
|
onClick,
|
|
48
|
-
|
|
49
|
-
onMouseUpCapture,
|
|
46
|
+
onClickCapture,
|
|
50
47
|
onKeyDownCapture,
|
|
51
48
|
onKeyUpCapture,
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
onMouseDownCapture,
|
|
50
|
+
onMouseUpCapture,
|
|
54
51
|
onPointerDownCapture,
|
|
55
52
|
onPointerUpCapture,
|
|
56
|
-
|
|
53
|
+
onTouchEndCapture,
|
|
54
|
+
onTouchStartCapture,
|
|
57
55
|
overlay,
|
|
58
56
|
ref,
|
|
59
57
|
shouldFitContainer,
|
|
60
|
-
spacing
|
|
58
|
+
spacing,
|
|
59
|
+
UNSAFE_iconAfter_size,
|
|
60
|
+
UNSAFE_iconBefore_size
|
|
61
61
|
});
|
|
62
62
|
return /*#__PURE__*/React.createElement(UNSAFE_ANCHOR
|
|
63
63
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
@@ -98,9 +98,9 @@ const WithRef = /*#__PURE__*/forwardRef(LinkButtonBase);
|
|
|
98
98
|
*
|
|
99
99
|
* Renders a link in the style of a button.
|
|
100
100
|
*
|
|
101
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
102
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
103
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
101
|
+
* - [Examples](https://atlassian.design/components/link-button/examples)
|
|
102
|
+
* - [Code](https://atlassian.design/components/link-button/code)
|
|
103
|
+
* - [Usage](https://atlassian.design/components/link-button/usage)
|
|
104
104
|
*/
|
|
105
105
|
const LinkButton = /*#__PURE__*/memo(WithRef);
|
|
106
106
|
export default LinkButton;
|
|
@@ -16,29 +16,29 @@ const useDefaultButton = ({
|
|
|
16
16
|
appearance,
|
|
17
17
|
autoFocus,
|
|
18
18
|
buttonType,
|
|
19
|
-
|
|
20
|
-
UNSAFE_iconBefore_size,
|
|
19
|
+
children,
|
|
21
20
|
iconAfter: IconAfter,
|
|
22
|
-
|
|
21
|
+
iconBefore: IconBefore,
|
|
23
22
|
interactionName,
|
|
24
23
|
isDisabled,
|
|
25
|
-
isSelected,
|
|
26
24
|
isLoading = false,
|
|
27
|
-
|
|
25
|
+
isSelected,
|
|
28
26
|
onClick,
|
|
29
|
-
|
|
30
|
-
onMouseUpCapture,
|
|
27
|
+
onClickCapture,
|
|
31
28
|
onKeyDownCapture,
|
|
32
29
|
onKeyUpCapture,
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
onMouseDownCapture,
|
|
31
|
+
onMouseUpCapture,
|
|
35
32
|
onPointerDownCapture,
|
|
36
33
|
onPointerUpCapture,
|
|
37
|
-
|
|
34
|
+
onTouchEndCapture,
|
|
35
|
+
onTouchStartCapture,
|
|
38
36
|
overlay,
|
|
39
37
|
ref,
|
|
40
38
|
shouldFitContainer,
|
|
41
|
-
spacing
|
|
39
|
+
spacing,
|
|
40
|
+
UNSAFE_iconAfter_size,
|
|
41
|
+
UNSAFE_iconBefore_size
|
|
42
42
|
}) => {
|
|
43
43
|
const hasOverlay = Boolean(overlay || isLoading);
|
|
44
44
|
const baseProps = useButtonBase({
|