@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
|
@@ -8,9 +8,9 @@ import useIconButton from './use-icon-button';
|
|
|
8
8
|
*
|
|
9
9
|
* TODO: Description
|
|
10
10
|
*
|
|
11
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
12
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
13
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
11
|
+
* - [Examples](https://atlassian.design/components/icon-button/examples)
|
|
12
|
+
* - [Code](https://atlassian.design/components/icon-button/code)
|
|
13
|
+
* - [Usage](https://atlassian.design/components/icon-button/usage)
|
|
14
14
|
*/
|
|
15
15
|
const IconButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function Button({
|
|
16
16
|
// Prevent duplicate labels being added.
|
|
@@ -56,19 +56,19 @@ const IconButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(functi
|
|
|
56
56
|
icon,
|
|
57
57
|
interactionName,
|
|
58
58
|
isDisabled,
|
|
59
|
-
isSelected,
|
|
60
59
|
isLoading,
|
|
60
|
+
isSelected,
|
|
61
61
|
label,
|
|
62
62
|
onClick,
|
|
63
|
-
|
|
64
|
-
onMouseUpCapture,
|
|
63
|
+
onClickCapture,
|
|
65
64
|
onKeyDownCapture,
|
|
66
65
|
onKeyUpCapture,
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
onMouseDownCapture,
|
|
67
|
+
onMouseUpCapture,
|
|
69
68
|
onPointerDownCapture,
|
|
70
69
|
onPointerUpCapture,
|
|
71
|
-
|
|
70
|
+
onTouchEndCapture,
|
|
71
|
+
onTouchStartCapture,
|
|
72
72
|
overlay,
|
|
73
73
|
ref,
|
|
74
74
|
shape,
|
|
@@ -45,15 +45,15 @@ const LinkIconButtonBase = ({
|
|
|
45
45
|
isSelected,
|
|
46
46
|
label,
|
|
47
47
|
onClick,
|
|
48
|
-
|
|
49
|
-
onMouseUpCapture,
|
|
48
|
+
onClickCapture,
|
|
50
49
|
onKeyDownCapture,
|
|
51
50
|
onKeyUpCapture,
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
onMouseDownCapture,
|
|
52
|
+
onMouseUpCapture,
|
|
54
53
|
onPointerDownCapture,
|
|
55
54
|
onPointerUpCapture,
|
|
56
|
-
|
|
55
|
+
onTouchEndCapture,
|
|
56
|
+
onTouchStartCapture,
|
|
57
57
|
overlay,
|
|
58
58
|
ref,
|
|
59
59
|
shape,
|
|
@@ -190,9 +190,9 @@ const WithRef = /*#__PURE__*/forwardRef(LinkIconButtonBase);
|
|
|
190
190
|
*
|
|
191
191
|
* Renders a link in the style of an icon button.
|
|
192
192
|
*
|
|
193
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
194
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
195
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
193
|
+
* - [Examples](https://atlassian.design/components/link-icon-button/examples)
|
|
194
|
+
* - [Code](https://atlassian.design/components/link-icon-button/code)
|
|
195
|
+
* - [Usage](https://atlassian.design/components/link-icon-button/usage)
|
|
196
196
|
*/
|
|
197
197
|
const LinkIconButton = /*#__PURE__*/memo(WithRef);
|
|
198
198
|
export default LinkIconButton;
|
|
@@ -20,19 +20,19 @@ const useIconButton = ({
|
|
|
20
20
|
icon: Icon,
|
|
21
21
|
interactionName,
|
|
22
22
|
isDisabled,
|
|
23
|
-
isSelected,
|
|
24
23
|
isLoading,
|
|
24
|
+
isSelected,
|
|
25
25
|
label,
|
|
26
26
|
onClick,
|
|
27
|
-
|
|
28
|
-
onMouseUpCapture,
|
|
27
|
+
onClickCapture,
|
|
29
28
|
onKeyDownCapture,
|
|
30
29
|
onKeyUpCapture,
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
onMouseDownCapture,
|
|
31
|
+
onMouseUpCapture,
|
|
33
32
|
onPointerDownCapture,
|
|
34
33
|
onPointerUpCapture,
|
|
35
|
-
|
|
34
|
+
onTouchEndCapture,
|
|
35
|
+
onTouchStartCapture,
|
|
36
36
|
overlay,
|
|
37
37
|
ref,
|
|
38
38
|
shape,
|
|
@@ -9,11 +9,13 @@ const isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowe
|
|
|
9
9
|
/**
|
|
10
10
|
* __Button__
|
|
11
11
|
*
|
|
12
|
+
* CAUTION: Legacy buttons will soon be deprecated. Please use the new Button components from `@atlaskit/button/new`.
|
|
13
|
+
*
|
|
12
14
|
* A button triggers an event or action. They let users know what will happen next.
|
|
13
15
|
*
|
|
14
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
15
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
16
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
16
|
+
* - [Examples](https://atlassian.design/components/button/button-legacy/examples)
|
|
17
|
+
* - [Code](https://atlassian.design/components/button/button-legacy/code)
|
|
18
|
+
* - [Usage](https://atlassian.design/components/button/button-legacy/usage)
|
|
17
19
|
*/
|
|
18
20
|
const Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function Button({
|
|
19
21
|
appearance = 'default',
|
|
@@ -5,6 +5,8 @@ import LoadingSpinner from './shared/loading-spinner';
|
|
|
5
5
|
/**
|
|
6
6
|
* __Loading button__
|
|
7
7
|
*
|
|
8
|
+
* CAUTION: Legacy loading buttons will soon be deprecated. Please use the new Button components from `@atlaskit/button/new` with the `isLoading` prop.
|
|
9
|
+
*
|
|
8
10
|
* 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.
|
|
9
11
|
*
|
|
10
12
|
* - [Examples](https://atlassian.design/components/button/examples#loading-button)
|
|
@@ -114,7 +114,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
114
114
|
action: 'clicked',
|
|
115
115
|
componentName: 'button',
|
|
116
116
|
packageName: "@atlaskit/button",
|
|
117
|
-
packageVersion: "17.17.
|
|
117
|
+
packageVersion: "17.17.2",
|
|
118
118
|
analyticsData: analyticsContext
|
|
119
119
|
});
|
|
120
120
|
|
|
@@ -153,7 +153,9 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
155
|
return jsx(FocusRing, null, jsx(Component, _extends({}, rest, {
|
|
156
|
-
ref: setRef
|
|
156
|
+
ref: setRef
|
|
157
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
158
|
+
,
|
|
157
159
|
className: className,
|
|
158
160
|
css: [buttonCss, isInteractive ? null : noPointerEventsOnChildrenCss]
|
|
159
161
|
// using undefined so that the property doesn't exist when false
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["analyticsContext", "
|
|
3
|
+
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"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import Pressable from '@atlaskit/primitives/pressable';
|
|
6
6
|
import useDefaultButton from './use-default-button';
|
|
@@ -15,33 +15,33 @@ import useDefaultButton from './use-default-button';
|
|
|
15
15
|
*/
|
|
16
16
|
var Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function Button(_ref, ref) {
|
|
17
17
|
var analyticsContext = _ref.analyticsContext,
|
|
18
|
-
interactionName = _ref.interactionName,
|
|
19
|
-
autoFocus = _ref.autoFocus,
|
|
20
18
|
appearance = _ref.appearance,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
autoFocus = _ref.autoFocus,
|
|
20
|
+
children = _ref.children,
|
|
21
|
+
iconAfter = _ref.iconAfter,
|
|
24
22
|
iconBefore = _ref.iconBefore,
|
|
23
|
+
interactionName = _ref.interactionName,
|
|
24
|
+
isDisabled = _ref.isDisabled,
|
|
25
25
|
isLoading = _ref.isLoading,
|
|
26
|
-
|
|
27
|
-
iconAfter = _ref.iconAfter,
|
|
28
|
-
UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
|
|
29
|
-
children = _ref.children,
|
|
30
|
-
shouldFitContainer = _ref.shouldFitContainer,
|
|
31
|
-
overlay = _ref.overlay,
|
|
26
|
+
isSelected = _ref.isSelected,
|
|
32
27
|
onClick = _ref.onClick,
|
|
33
|
-
|
|
34
|
-
onMouseUpCapture = _ref.onMouseUpCapture,
|
|
28
|
+
onClickCapture = _ref.onClickCapture,
|
|
35
29
|
onKeyDownCapture = _ref.onKeyDownCapture,
|
|
36
30
|
onKeyUpCapture = _ref.onKeyUpCapture,
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
onMouseDownCapture = _ref.onMouseDownCapture,
|
|
32
|
+
onMouseUpCapture = _ref.onMouseUpCapture,
|
|
39
33
|
onPointerDownCapture = _ref.onPointerDownCapture,
|
|
40
34
|
onPointerUpCapture = _ref.onPointerUpCapture,
|
|
41
|
-
|
|
35
|
+
onTouchEndCapture = _ref.onTouchEndCapture,
|
|
36
|
+
onTouchStartCapture = _ref.onTouchStartCapture,
|
|
37
|
+
overlay = _ref.overlay,
|
|
38
|
+
shouldFitContainer = _ref.shouldFitContainer,
|
|
39
|
+
spacing = _ref.spacing,
|
|
40
|
+
testId = _ref.testId,
|
|
42
41
|
_ref$type = _ref.type,
|
|
43
42
|
type = _ref$type === void 0 ? 'button' : _ref$type,
|
|
44
|
-
|
|
43
|
+
UNSAFE_iconAfter_size = _ref.UNSAFE_iconAfter_size,
|
|
44
|
+
UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
|
|
45
45
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
46
46
|
var baseProps = useDefaultButton({
|
|
47
47
|
analyticsContext: analyticsContext,
|
|
@@ -49,28 +49,28 @@ var Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function But
|
|
|
49
49
|
autoFocus: autoFocus,
|
|
50
50
|
buttonType: 'button',
|
|
51
51
|
children: children,
|
|
52
|
-
iconBefore: iconBefore,
|
|
53
|
-
UNSAFE_iconBefore_size: UNSAFE_iconBefore_size,
|
|
54
52
|
iconAfter: iconAfter,
|
|
55
|
-
|
|
53
|
+
iconBefore: iconBefore,
|
|
56
54
|
interactionName: interactionName,
|
|
57
55
|
isDisabled: isDisabled,
|
|
58
|
-
isSelected: isSelected,
|
|
59
56
|
isLoading: isLoading,
|
|
57
|
+
isSelected: isSelected,
|
|
60
58
|
onClick: onClick,
|
|
61
|
-
|
|
62
|
-
onMouseUpCapture: onMouseUpCapture,
|
|
59
|
+
onClickCapture: onClickCapture,
|
|
63
60
|
onKeyDownCapture: onKeyDownCapture,
|
|
64
61
|
onKeyUpCapture: onKeyUpCapture,
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
onMouseDownCapture: onMouseDownCapture,
|
|
63
|
+
onMouseUpCapture: onMouseUpCapture,
|
|
67
64
|
onPointerDownCapture: onPointerDownCapture,
|
|
68
65
|
onPointerUpCapture: onPointerUpCapture,
|
|
69
|
-
|
|
66
|
+
onTouchEndCapture: onTouchEndCapture,
|
|
67
|
+
onTouchStartCapture: onTouchStartCapture,
|
|
70
68
|
overlay: overlay,
|
|
71
69
|
ref: ref,
|
|
72
70
|
shouldFitContainer: shouldFitContainer,
|
|
73
|
-
spacing: spacing
|
|
71
|
+
spacing: spacing,
|
|
72
|
+
UNSAFE_iconAfter_size: UNSAFE_iconAfter_size,
|
|
73
|
+
UNSAFE_iconBefore_size: UNSAFE_iconBefore_size
|
|
74
74
|
});
|
|
75
75
|
return /*#__PURE__*/React.createElement(Pressable
|
|
76
76
|
// TODO: Remove spread props
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["analyticsContext", "
|
|
3
|
+
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"];
|
|
4
4
|
import React, { forwardRef, memo } from 'react';
|
|
5
5
|
import UNSAFE_ANCHOR from '@atlaskit/primitives/anchor';
|
|
6
6
|
import useDefaultButton from './use-default-button';
|
|
7
7
|
var LinkButtonBase = function LinkButtonBase(_ref, ref) {
|
|
8
8
|
var analyticsContext = _ref.analyticsContext,
|
|
9
|
-
interactionName = _ref.interactionName,
|
|
10
|
-
autoFocus = _ref.autoFocus,
|
|
11
9
|
appearance = _ref.appearance,
|
|
12
|
-
|
|
10
|
+
autoFocus = _ref.autoFocus,
|
|
11
|
+
children = _ref.children,
|
|
12
|
+
href = _ref.href,
|
|
13
|
+
iconAfter = _ref.iconAfter,
|
|
14
|
+
iconBefore = _ref.iconBefore,
|
|
15
|
+
interactionName = _ref.interactionName,
|
|
13
16
|
isDisabled = _ref.isDisabled,
|
|
14
17
|
isSelected = _ref.isSelected,
|
|
15
|
-
iconBefore = _ref.iconBefore,
|
|
16
|
-
UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
|
|
17
|
-
iconAfter = _ref.iconAfter,
|
|
18
|
-
UNSAFE_iconAfter_size = _ref.UNSAFE_iconAfter_size,
|
|
19
|
-
children = _ref.children,
|
|
20
|
-
shouldFitContainer = _ref.shouldFitContainer,
|
|
21
|
-
overlay = _ref.overlay,
|
|
22
18
|
onClick = _ref.onClick,
|
|
23
|
-
|
|
24
|
-
onMouseUpCapture = _ref.onMouseUpCapture,
|
|
19
|
+
onClickCapture = _ref.onClickCapture,
|
|
25
20
|
onKeyDownCapture = _ref.onKeyDownCapture,
|
|
26
21
|
onKeyUpCapture = _ref.onKeyUpCapture,
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
onMouseDownCapture = _ref.onMouseDownCapture,
|
|
23
|
+
onMouseUpCapture = _ref.onMouseUpCapture,
|
|
29
24
|
onPointerDownCapture = _ref.onPointerDownCapture,
|
|
30
25
|
onPointerUpCapture = _ref.onPointerUpCapture,
|
|
31
|
-
|
|
26
|
+
onTouchEndCapture = _ref.onTouchEndCapture,
|
|
27
|
+
onTouchStartCapture = _ref.onTouchStartCapture,
|
|
28
|
+
overlay = _ref.overlay,
|
|
29
|
+
shouldFitContainer = _ref.shouldFitContainer,
|
|
30
|
+
spacing = _ref.spacing,
|
|
32
31
|
testId = _ref.testId,
|
|
33
|
-
|
|
32
|
+
UNSAFE_iconAfter_size = _ref.UNSAFE_iconAfter_size,
|
|
33
|
+
UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
|
|
34
34
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
35
35
|
var baseProps = useDefaultButton({
|
|
36
36
|
analyticsContext: analyticsContext,
|
|
@@ -38,27 +38,27 @@ var LinkButtonBase = function LinkButtonBase(_ref, ref) {
|
|
|
38
38
|
autoFocus: autoFocus,
|
|
39
39
|
buttonType: 'link',
|
|
40
40
|
children: children,
|
|
41
|
-
iconBefore: iconBefore,
|
|
42
|
-
UNSAFE_iconBefore_size: UNSAFE_iconBefore_size,
|
|
43
41
|
iconAfter: iconAfter,
|
|
44
|
-
|
|
42
|
+
iconBefore: iconBefore,
|
|
45
43
|
interactionName: interactionName,
|
|
46
44
|
isDisabled: isDisabled,
|
|
47
45
|
isSelected: isSelected,
|
|
48
46
|
onClick: onClick,
|
|
49
|
-
|
|
50
|
-
onMouseUpCapture: onMouseUpCapture,
|
|
47
|
+
onClickCapture: onClickCapture,
|
|
51
48
|
onKeyDownCapture: onKeyDownCapture,
|
|
52
49
|
onKeyUpCapture: onKeyUpCapture,
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
onMouseDownCapture: onMouseDownCapture,
|
|
51
|
+
onMouseUpCapture: onMouseUpCapture,
|
|
55
52
|
onPointerDownCapture: onPointerDownCapture,
|
|
56
53
|
onPointerUpCapture: onPointerUpCapture,
|
|
57
|
-
|
|
54
|
+
onTouchEndCapture: onTouchEndCapture,
|
|
55
|
+
onTouchStartCapture: onTouchStartCapture,
|
|
58
56
|
overlay: overlay,
|
|
59
57
|
ref: ref,
|
|
60
58
|
shouldFitContainer: shouldFitContainer,
|
|
61
|
-
spacing: spacing
|
|
59
|
+
spacing: spacing,
|
|
60
|
+
UNSAFE_iconAfter_size: UNSAFE_iconAfter_size,
|
|
61
|
+
UNSAFE_iconBefore_size: UNSAFE_iconBefore_size
|
|
62
62
|
});
|
|
63
63
|
return /*#__PURE__*/React.createElement(UNSAFE_ANCHOR
|
|
64
64
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
@@ -99,9 +99,9 @@ var WithRef = /*#__PURE__*/forwardRef(LinkButtonBase);
|
|
|
99
99
|
*
|
|
100
100
|
* Renders a link in the style of a button.
|
|
101
101
|
*
|
|
102
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
103
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
104
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
102
|
+
* - [Examples](https://atlassian.design/components/link-button/examples)
|
|
103
|
+
* - [Code](https://atlassian.design/components/link-button/code)
|
|
104
|
+
* - [Usage](https://atlassian.design/components/link-button/usage)
|
|
105
105
|
*/
|
|
106
106
|
var LinkButton = /*#__PURE__*/memo(WithRef);
|
|
107
107
|
export default LinkButton;
|
|
@@ -16,30 +16,30 @@ var useDefaultButton = function useDefaultButton(_ref) {
|
|
|
16
16
|
appearance = _ref.appearance,
|
|
17
17
|
autoFocus = _ref.autoFocus,
|
|
18
18
|
buttonType = _ref.buttonType,
|
|
19
|
-
|
|
20
|
-
UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
|
|
19
|
+
children = _ref.children,
|
|
21
20
|
IconAfter = _ref.iconAfter,
|
|
22
|
-
|
|
21
|
+
IconBefore = _ref.iconBefore,
|
|
23
22
|
interactionName = _ref.interactionName,
|
|
24
23
|
isDisabled = _ref.isDisabled,
|
|
25
|
-
isSelected = _ref.isSelected,
|
|
26
24
|
_ref$isLoading = _ref.isLoading,
|
|
27
25
|
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
28
|
-
|
|
26
|
+
isSelected = _ref.isSelected,
|
|
29
27
|
onClick = _ref.onClick,
|
|
30
|
-
|
|
31
|
-
onMouseUpCapture = _ref.onMouseUpCapture,
|
|
28
|
+
onClickCapture = _ref.onClickCapture,
|
|
32
29
|
onKeyDownCapture = _ref.onKeyDownCapture,
|
|
33
30
|
onKeyUpCapture = _ref.onKeyUpCapture,
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
onMouseDownCapture = _ref.onMouseDownCapture,
|
|
32
|
+
onMouseUpCapture = _ref.onMouseUpCapture,
|
|
36
33
|
onPointerDownCapture = _ref.onPointerDownCapture,
|
|
37
34
|
onPointerUpCapture = _ref.onPointerUpCapture,
|
|
38
|
-
|
|
35
|
+
onTouchEndCapture = _ref.onTouchEndCapture,
|
|
36
|
+
onTouchStartCapture = _ref.onTouchStartCapture,
|
|
39
37
|
overlay = _ref.overlay,
|
|
40
38
|
ref = _ref.ref,
|
|
41
39
|
shouldFitContainer = _ref.shouldFitContainer,
|
|
42
|
-
spacing = _ref.spacing
|
|
40
|
+
spacing = _ref.spacing,
|
|
41
|
+
UNSAFE_iconAfter_size = _ref.UNSAFE_iconAfter_size,
|
|
42
|
+
UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size;
|
|
43
43
|
var hasOverlay = Boolean(overlay || isLoading);
|
|
44
44
|
var baseProps = useButtonBase({
|
|
45
45
|
analyticsContext: analyticsContext,
|
|
@@ -10,9 +10,9 @@ import useIconButton from './use-icon-button';
|
|
|
10
10
|
*
|
|
11
11
|
* TODO: Description
|
|
12
12
|
*
|
|
13
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
14
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
15
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
13
|
+
* - [Examples](https://atlassian.design/components/icon-button/examples)
|
|
14
|
+
* - [Code](https://atlassian.design/components/icon-button/code)
|
|
15
|
+
* - [Usage](https://atlassian.design/components/icon-button/usage)
|
|
16
16
|
*/
|
|
17
17
|
var IconButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function Button(_ref, ref) {
|
|
18
18
|
var preventedAriaLabel = _ref['aria-label'],
|
|
@@ -58,19 +58,19 @@ var IconButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
|
|
|
58
58
|
icon: icon,
|
|
59
59
|
interactionName: interactionName,
|
|
60
60
|
isDisabled: isDisabled,
|
|
61
|
-
isSelected: isSelected,
|
|
62
61
|
isLoading: isLoading,
|
|
62
|
+
isSelected: isSelected,
|
|
63
63
|
label: label,
|
|
64
64
|
onClick: onClick,
|
|
65
|
-
|
|
66
|
-
onMouseUpCapture: onMouseUpCapture,
|
|
65
|
+
onClickCapture: onClickCapture,
|
|
67
66
|
onKeyDownCapture: onKeyDownCapture,
|
|
68
67
|
onKeyUpCapture: onKeyUpCapture,
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
onMouseDownCapture: onMouseDownCapture,
|
|
69
|
+
onMouseUpCapture: onMouseUpCapture,
|
|
71
70
|
onPointerDownCapture: onPointerDownCapture,
|
|
72
71
|
onPointerUpCapture: onPointerUpCapture,
|
|
73
|
-
|
|
72
|
+
onTouchEndCapture: onTouchEndCapture,
|
|
73
|
+
onTouchStartCapture: onTouchStartCapture,
|
|
74
74
|
overlay: overlay,
|
|
75
75
|
ref: ref,
|
|
76
76
|
shape: shape,
|
|
@@ -46,15 +46,15 @@ var LinkIconButtonBase = function LinkIconButtonBase(_ref, ref) {
|
|
|
46
46
|
isSelected: isSelected,
|
|
47
47
|
label: label,
|
|
48
48
|
onClick: onClick,
|
|
49
|
-
|
|
50
|
-
onMouseUpCapture: onMouseUpCapture,
|
|
49
|
+
onClickCapture: onClickCapture,
|
|
51
50
|
onKeyDownCapture: onKeyDownCapture,
|
|
52
51
|
onKeyUpCapture: onKeyUpCapture,
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
onMouseDownCapture: onMouseDownCapture,
|
|
53
|
+
onMouseUpCapture: onMouseUpCapture,
|
|
55
54
|
onPointerDownCapture: onPointerDownCapture,
|
|
56
55
|
onPointerUpCapture: onPointerUpCapture,
|
|
57
|
-
|
|
56
|
+
onTouchEndCapture: onTouchEndCapture,
|
|
57
|
+
onTouchStartCapture: onTouchStartCapture,
|
|
58
58
|
overlay: overlay,
|
|
59
59
|
ref: ref,
|
|
60
60
|
shape: shape,
|
|
@@ -193,9 +193,9 @@ var WithRef = /*#__PURE__*/forwardRef(LinkIconButtonBase);
|
|
|
193
193
|
*
|
|
194
194
|
* Renders a link in the style of an icon button.
|
|
195
195
|
*
|
|
196
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
197
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
198
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
196
|
+
* - [Examples](https://atlassian.design/components/link-icon-button/examples)
|
|
197
|
+
* - [Code](https://atlassian.design/components/link-icon-button/code)
|
|
198
|
+
* - [Usage](https://atlassian.design/components/link-icon-button/usage)
|
|
199
199
|
*/
|
|
200
200
|
var LinkIconButton = /*#__PURE__*/memo(WithRef);
|
|
201
201
|
export default LinkIconButton;
|
|
@@ -20,19 +20,19 @@ var useIconButton = function useIconButton(_ref) {
|
|
|
20
20
|
Icon = _ref.icon,
|
|
21
21
|
interactionName = _ref.interactionName,
|
|
22
22
|
isDisabled = _ref.isDisabled,
|
|
23
|
-
isSelected = _ref.isSelected,
|
|
24
23
|
isLoading = _ref.isLoading,
|
|
24
|
+
isSelected = _ref.isSelected,
|
|
25
25
|
label = _ref.label,
|
|
26
26
|
onClick = _ref.onClick,
|
|
27
|
-
|
|
28
|
-
onMouseUpCapture = _ref.onMouseUpCapture,
|
|
27
|
+
onClickCapture = _ref.onClickCapture,
|
|
29
28
|
onKeyDownCapture = _ref.onKeyDownCapture,
|
|
30
29
|
onKeyUpCapture = _ref.onKeyUpCapture,
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
onMouseDownCapture = _ref.onMouseDownCapture,
|
|
31
|
+
onMouseUpCapture = _ref.onMouseUpCapture,
|
|
33
32
|
onPointerDownCapture = _ref.onPointerDownCapture,
|
|
34
33
|
onPointerUpCapture = _ref.onPointerUpCapture,
|
|
35
|
-
|
|
34
|
+
onTouchEndCapture = _ref.onTouchEndCapture,
|
|
35
|
+
onTouchStartCapture = _ref.onTouchStartCapture,
|
|
36
36
|
overlay = _ref.overlay,
|
|
37
37
|
ref = _ref.ref,
|
|
38
38
|
shape = _ref.shape,
|
|
@@ -12,11 +12,13 @@ var isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerC
|
|
|
12
12
|
/**
|
|
13
13
|
* __Button__
|
|
14
14
|
*
|
|
15
|
+
* CAUTION: Legacy buttons will soon be deprecated. Please use the new Button components from `@atlaskit/button/new`.
|
|
16
|
+
*
|
|
15
17
|
* A button triggers an event or action. They let users know what will happen next.
|
|
16
18
|
*
|
|
17
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
18
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
19
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
19
|
+
* - [Examples](https://atlassian.design/components/button/button-legacy/examples)
|
|
20
|
+
* - [Code](https://atlassian.design/components/button/button-legacy/code)
|
|
21
|
+
* - [Usage](https://atlassian.design/components/button/button-legacy/usage)
|
|
20
22
|
*/
|
|
21
23
|
var Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function Button(_ref, ref) {
|
|
22
24
|
var _ref$appearance = _ref.appearance,
|
|
@@ -7,6 +7,8 @@ import LoadingSpinner from './shared/loading-spinner';
|
|
|
7
7
|
/**
|
|
8
8
|
* __Loading button__
|
|
9
9
|
*
|
|
10
|
+
* CAUTION: Legacy loading buttons will soon be deprecated. Please use the new Button components from `@atlaskit/button/new` with the `isLoading` prop.
|
|
11
|
+
*
|
|
10
12
|
* 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.
|
|
11
13
|
*
|
|
12
14
|
* - [Examples](https://atlassian.design/components/button/examples#loading-button)
|
|
@@ -120,7 +120,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
120
120
|
action: 'clicked',
|
|
121
121
|
componentName: 'button',
|
|
122
122
|
packageName: "@atlaskit/button",
|
|
123
|
-
packageVersion: "17.17.
|
|
123
|
+
packageVersion: "17.17.2",
|
|
124
124
|
analyticsData: analyticsContext
|
|
125
125
|
});
|
|
126
126
|
|
|
@@ -159,7 +159,9 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
159
159
|
};
|
|
160
160
|
}
|
|
161
161
|
return jsx(FocusRing, null, jsx(Component, _extends({}, rest, {
|
|
162
|
-
ref: setRef
|
|
162
|
+
ref: setRef
|
|
163
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
164
|
+
,
|
|
163
165
|
className: className,
|
|
164
166
|
css: [buttonCss, isInteractive ? null : noPointerEventsOnChildrenCss]
|
|
165
167
|
// using undefined so that the property doesn't exist when false
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { SplitButton, SplitButtonWithSlots, Divider, SplitButtonContainer
|
|
1
|
+
export { SplitButton, SplitButtonWithSlots, Divider, SplitButtonContainer } from './split-button';
|
|
2
2
|
export { getActions } from './utils';
|
|
3
|
-
export { SplitButtonContext, useSplitButtonContext
|
|
3
|
+
export { SplitButtonContext, useSplitButtonContext } from './split-button-context';
|
|
@@ -10,7 +10,7 @@ type DividerProps = {
|
|
|
10
10
|
/**
|
|
11
11
|
* TODO: Add JSDoc
|
|
12
12
|
*/
|
|
13
|
-
export declare const Divider: ({ appearance, spacing, isDisabled
|
|
13
|
+
export declare const Divider: ({ appearance, spacing, isDisabled }: DividerProps) => jsx.JSX.Element;
|
|
14
14
|
/**
|
|
15
15
|
* TODO: Add JSdoc
|
|
16
16
|
*/
|
|
@@ -2,15 +2,15 @@ import { type Ref } from 'react';
|
|
|
2
2
|
import { type AdditionalDefaultLinkVariantProps, type CommonLinkVariantProps } from '../types';
|
|
3
3
|
import { type CommonDefaultButtonProps } from './types';
|
|
4
4
|
export type LinkButtonProps<RouterLinkConfig extends Record<string, any> = never> = CommonDefaultButtonProps & CommonLinkVariantProps<RouterLinkConfig> & AdditionalDefaultLinkVariantProps;
|
|
5
|
-
declare const LinkButtonBase: <RouterLinkConfig extends Record<string, any> = never>({ analyticsContext,
|
|
5
|
+
declare const LinkButtonBase: <RouterLinkConfig extends Record<string, any> = never>({ 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, ...rest }: LinkButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
|
|
6
6
|
/**
|
|
7
7
|
* __Link Button__
|
|
8
8
|
*
|
|
9
9
|
* Renders a link in the style of a button.
|
|
10
10
|
*
|
|
11
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
12
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
13
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
11
|
+
* - [Examples](https://atlassian.design/components/link-button/examples)
|
|
12
|
+
* - [Code](https://atlassian.design/components/link-button/code)
|
|
13
|
+
* - [Usage](https://atlassian.design/components/link-button/usage)
|
|
14
14
|
*/
|
|
15
15
|
declare const LinkButton: <RouterLinkConfig extends Record<string, any> = never>(props: LinkButtonProps<RouterLinkConfig> & {
|
|
16
16
|
ref?: Ref<HTMLAnchorElement>;
|
|
@@ -11,5 +11,5 @@ type UseButtonReturn<TagName extends HTMLElement> = UseButtonBaseReturn<TagName>
|
|
|
11
11
|
*
|
|
12
12
|
* @private
|
|
13
13
|
*/
|
|
14
|
-
declare const useDefaultButton: <TagName extends HTMLElement>({ analyticsContext, appearance, autoFocus, buttonType,
|
|
14
|
+
declare const useDefaultButton: <TagName extends HTMLElement>({ analyticsContext, appearance, autoFocus, buttonType, children, iconAfter: IconAfter, iconBefore: IconBefore, interactionName, isDisabled, isLoading, isSelected, onClick, onClickCapture, onKeyDownCapture, onKeyUpCapture, onMouseDownCapture, onMouseUpCapture, onPointerDownCapture, onPointerUpCapture, onTouchEndCapture, onTouchStartCapture, overlay, ref, shouldFitContainer, spacing, UNSAFE_iconAfter_size, UNSAFE_iconBefore_size, }: UseDefaultButtonArgs<TagName>) => UseButtonReturn<TagName>;
|
|
15
15
|
export default useDefaultButton;
|
|
@@ -7,9 +7,9 @@ export type IconButtonProps = CommonIconButtonProps & CommonButtonVariantProps;
|
|
|
7
7
|
*
|
|
8
8
|
* TODO: Description
|
|
9
9
|
*
|
|
10
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
11
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
12
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
10
|
+
* - [Examples](https://atlassian.design/components/icon-button/examples)
|
|
11
|
+
* - [Code](https://atlassian.design/components/icon-button/code)
|
|
12
|
+
* - [Usage](https://atlassian.design/components/icon-button/usage)
|
|
13
13
|
*/
|
|
14
14
|
declare const IconButton: React.MemoExoticComponent<React.ForwardRefExoticComponent<CommonIconButtonProps & import("../types").AdditionalButtonVariantProps & Omit<import("../types").AdditionalHTMLElementPropsExtender<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "children">>, keyof import("../types").CommonButtonProps<TagName>> & import("../types").CommonButtonProps<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>>;
|
|
15
15
|
export default IconButton;
|
|
@@ -8,9 +8,9 @@ declare const LinkIconButtonBase: <RouterLinkConfig extends Record<string, any>
|
|
|
8
8
|
*
|
|
9
9
|
* Renders a link in the style of an icon button.
|
|
10
10
|
*
|
|
11
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
12
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
13
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
11
|
+
* - [Examples](https://atlassian.design/components/link-icon-button/examples)
|
|
12
|
+
* - [Code](https://atlassian.design/components/link-icon-button/code)
|
|
13
|
+
* - [Usage](https://atlassian.design/components/link-icon-button/usage)
|
|
14
14
|
*/
|
|
15
15
|
declare const LinkIconButton: <RouterLinkConfig extends Record<string, any> = never>(props: LinkIconButtonProps<RouterLinkConfig> & {
|
|
16
16
|
ref?: Ref<HTMLAnchorElement>;
|
|
@@ -11,5 +11,5 @@ type UseIconButtonReturn<TagName extends HTMLElement> = UseButtonBaseReturn<TagN
|
|
|
11
11
|
*
|
|
12
12
|
* @private
|
|
13
13
|
*/
|
|
14
|
-
declare const useIconButton: <TagName extends HTMLElement>({ analyticsContext, appearance, autoFocus, buttonType, icon: Icon, interactionName, isDisabled,
|
|
14
|
+
declare const useIconButton: <TagName extends HTMLElement>({ analyticsContext, appearance, autoFocus, buttonType, icon: Icon, interactionName, isDisabled, isLoading, isSelected, label, onClick, onClickCapture, onKeyDownCapture, onKeyUpCapture, onMouseDownCapture, onMouseUpCapture, onPointerDownCapture, onPointerUpCapture, onTouchEndCapture, onTouchStartCapture, overlay, ref, shape, shouldFitContainer, spacing, UNSAFE_size, }: UseIconButtonArgs<TagName>) => UseIconButtonReturn<TagName>;
|
|
15
15
|
export default useIconButton;
|