@atlaskit/button 17.17.1 → 17.17.3
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 +1224 -1221
- package/__perf__/button.tsx +6 -6
- package/__perf__/custom.tsx +6 -6
- package/__perf__/customised.tsx +1 -3
- package/__perf__/utils/example-runner.tsx +32 -36
- package/__perf__/utils/interaction-tasks.tsx +65 -86
- package/codemods/15.0.0-lite-mode.tsx +32 -36
- package/codemods/15.1.1-data-testid.tsx +136 -142
- package/codemods/__tests__/15.0.0-lite-mode/optimistic.tsx +121 -121
- package/codemods/__tests__/15.0.0-lite-mode/safe.tsx +54 -54
- package/codemods/__tests__/15.0.0-lite-mode/shared.tsx +96 -97
- package/codemods/__tests__/15.1.1-data-testid/rename-data-testid.tsx +32 -32
- package/codemods/__tests__/_framework.tsx +32 -32
- package/codemods/helpers/15.0.0-runner.tsx +135 -137
- package/codemods/helpers/helpers-generic.tsx +524 -556
- package/codemods/optimistic-15.0.0-lite-mode.tsx +208 -231
- package/dist/cjs/new-button/variants/default/button.js +28 -28
- package/dist/cjs/new-button/variants/default/link.js +26 -26
- package/dist/cjs/new-button/variants/default/use-default-button.js +11 -11
- package/dist/cjs/new-button/variants/icon/button.js +6 -6
- package/dist/cjs/new-button/variants/icon/link.js +5 -5
- package/dist/cjs/new-button/variants/icon/use-icon-button.js +6 -6
- 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 +27 -27
- package/dist/es2019/new-button/variants/default/use-default-button.js +11 -11
- package/dist/es2019/new-button/variants/icon/button.js +6 -6
- 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/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 +28 -28
- package/dist/esm/new-button/variants/default/use-default-button.js +11 -11
- package/dist/esm/new-button/variants/icon/button.js +6 -6
- 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/shared/button-base.js +4 -2
- package/dist/types/entry-points/loading-button.d.ts +1 -1
- package/dist/types/entry-points/new.d.ts +3 -3
- package/dist/types/entry-points/types.d.ts +2 -2
- package/dist/types/index.d.ts +3 -3
- 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 +1 -1
- package/dist/types/new-button/variants/default/use-default-button.d.ts +1 -1
- 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.d.ts +3 -3
- package/dist/types-ts4.5/entry-points/loading-button.d.ts +1 -1
- package/dist/types-ts4.5/entry-points/new.d.ts +3 -3
- package/dist/types-ts4.5/entry-points/types.d.ts +2 -2
- package/dist/types-ts4.5/index.d.ts +3 -3
- 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 +1 -1
- 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/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.d.ts +3 -3
- package/extract-react-types/custom-theme-button-props.tsx +2 -4
- package/extract-react-types/legacy-button/custom-theme-button-props.tsx +2 -4
- package/extract-react-types/legacy-button/loading-button-props.tsx +1 -1
- package/extract-react-types/legacy-button/shared-props.tsx +1 -1
- package/extract-react-types/loading-button-props.tsx +1 -1
- package/extract-react-types/new-button/containers/split-button/split-button-props.tsx +1 -1
- package/extract-react-types/new-button/variants/default/button-props.tsx +1 -1
- package/extract-react-types/new-button/variants/default/common-default-button-props.tsx +4 -4
- package/extract-react-types/new-button/variants/default/link-button-props.tsx +4 -4
- package/extract-react-types/new-button/variants/icon-button/common-icon-button-props.tsx +4 -4
- package/extract-react-types/new-button/variants/icon-button/icon-button-props.tsx +1 -1
- package/extract-react-types/new-button/variants/icon-button/link-icon-button-props.tsx +2 -4
- package/extract-react-types/shared-props.tsx +1 -1
- package/package.json +5 -7
- package/report.api.md +78 -96
|
@@ -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
|
-
import
|
|
5
|
+
import 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,29 +38,29 @@ 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
|
-
return /*#__PURE__*/React.createElement(
|
|
63
|
+
return /*#__PURE__*/React.createElement(Anchor
|
|
64
64
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
65
65
|
, _extends({}, rest, {
|
|
66
66
|
ref: baseProps.ref,
|
|
@@ -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,
|
|
@@ -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,
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["aria-label", "analyticsContext", "appearance", "autoFocus", "href", "icon", "interactionName", "isDisabled", "isSelected", "isTooltipDisabled", "label", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shape", "spacing", "testId", "tooltip", "UNSAFE_size"];
|
|
4
4
|
import React, { forwardRef, memo } from 'react';
|
|
5
|
-
import
|
|
5
|
+
import Anchor from '@atlaskit/primitives/anchor';
|
|
6
6
|
import Tooltip from '@atlaskit/tooltip';
|
|
7
7
|
import useIconButton from './use-icon-button';
|
|
8
8
|
var LinkIconButtonBase = function LinkIconButtonBase(_ref, ref) {
|
|
@@ -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,
|
|
@@ -79,7 +79,7 @@ var LinkIconButtonBase = function LinkIconButtonBase(_ref, ref) {
|
|
|
79
79
|
hideTooltipOnClick: tooltip === null || tooltip === void 0 ? void 0 : tooltip.hideTooltipOnClick,
|
|
80
80
|
hideTooltipOnMouseDown: tooltip === null || tooltip === void 0 ? void 0 : tooltip.hideTooltipOnMouseDown
|
|
81
81
|
}, function (triggerProps) {
|
|
82
|
-
return /*#__PURE__*/React.createElement(
|
|
82
|
+
return /*#__PURE__*/React.createElement(Anchor
|
|
83
83
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
84
84
|
, _extends({}, rest, {
|
|
85
85
|
testId: testId,
|
|
@@ -154,7 +154,7 @@ var LinkIconButtonBase = function LinkIconButtonBase(_ref, ref) {
|
|
|
154
154
|
}), baseProps.children);
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
|
-
return /*#__PURE__*/React.createElement(
|
|
157
|
+
return /*#__PURE__*/React.createElement(Anchor
|
|
158
158
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
159
159
|
, _extends({}, rest, {
|
|
160
160
|
ref: baseProps.ref,
|
|
@@ -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,
|
|
@@ -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.3",
|
|
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,2 +1,2 @@
|
|
|
1
1
|
export { default } from '../old-button/loading-button';
|
|
2
|
-
export type { LoadingButtonProps, LoadingButtonOwnProps
|
|
2
|
+
export type { LoadingButtonProps, LoadingButtonOwnProps } from '../old-button/loading-button';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { default, type ButtonProps
|
|
2
|
-
export { default as LinkButton, type LinkButtonProps
|
|
3
|
-
export { default as IconButton, type IconButtonProps
|
|
1
|
+
export { default, type ButtonProps } from '../new-button/variants/default/button';
|
|
2
|
+
export { default as LinkButton, type LinkButtonProps } from '../new-button/variants/default/link';
|
|
3
|
+
export { default as IconButton, type IconButtonProps } from '../new-button/variants/icon/button';
|
|
4
4
|
export { default as LinkIconButton, type LinkIconButtonProps, } from '../new-button/variants/icon/link';
|
|
5
5
|
export { SplitButton } from '../new-button/containers/split-button';
|
|
6
6
|
export type { Appearance, Spacing } from '../new-button/variants/types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { Appearance, Spacing, BaseOwnProps, BaseProps
|
|
1
|
+
export type { Appearance, Spacing, BaseOwnProps, BaseProps } from '../old-button/types';
|
|
2
2
|
export type { ButtonProps } from './standard-button';
|
|
3
|
-
export type { LoadingButtonProps, LoadingButtonOwnProps
|
|
3
|
+
export type { LoadingButtonProps, LoadingButtonOwnProps } from './loading-button';
|
|
4
4
|
export type { ThemeTokens, ThemeProps, InteractionState, CustomThemeButtonProps, CustomThemeButtonOwnProps, } from './custom-theme-button';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export type { Appearance, Spacing, BaseOwnProps, BaseProps
|
|
1
|
+
export type { Appearance, Spacing, BaseOwnProps, BaseProps } from './entry-points/types';
|
|
2
2
|
export { default, } from './entry-points/standard-button';
|
|
3
3
|
export type { ButtonProps } from './entry-points/standard-button';
|
|
4
4
|
export { default as LoadingButton } from './entry-points/loading-button';
|
|
5
|
-
export type { LoadingButtonProps, LoadingButtonOwnProps
|
|
6
|
-
export { default as CustomThemeButton, Theme
|
|
5
|
+
export type { LoadingButtonProps, LoadingButtonOwnProps } from './entry-points/loading-button';
|
|
6
|
+
export { default as CustomThemeButton, Theme } from './entry-points/custom-theme-button';
|
|
7
7
|
export type { ThemeTokens, ThemeProps, InteractionState, CustomThemeButtonProps, CustomThemeButtonOwnProps, } from './entry-points/custom-theme-button';
|
|
8
8
|
export { default as ButtonGroup } from './entry-points/button-group';
|
|
9
9
|
export type { ButtonGroupProps } from './entry-points/button-group';
|
|
@@ -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,7 +2,7 @@ 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
|
*
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -10,5 +10,5 @@ type ContentProps = {
|
|
|
10
10
|
*
|
|
11
11
|
* Used for slots within a Button, including icons and text content.
|
|
12
12
|
*/
|
|
13
|
-
declare const Content: ({ children, type, hasOverlay, position
|
|
13
|
+
declare const Content: ({ children, type, hasOverlay, position }: ContentProps) => JSX.Element;
|
|
14
14
|
export default Content;
|
package/dist/types/new.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { default, type ButtonProps
|
|
2
|
-
export { default as LinkButton, type LinkButtonProps
|
|
3
|
-
export { default as IconButton, type IconButtonProps
|
|
1
|
+
export { default, type ButtonProps } from './new-button/variants/default/button';
|
|
2
|
+
export { default as LinkButton, type LinkButtonProps } from './new-button/variants/default/link';
|
|
3
|
+
export { default as IconButton, type IconButtonProps } from './new-button/variants/icon/button';
|
|
4
4
|
export { default as LinkIconButton, type LinkIconButtonProps, } from './new-button/variants/icon/link';
|
|
5
5
|
export { SplitButton } from './new-button/containers/split-button';
|
|
6
6
|
export type { Appearance, Spacing } from './new-button/variants/types';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from '../old-button/loading-button';
|
|
2
|
-
export type { LoadingButtonProps, LoadingButtonOwnProps
|
|
2
|
+
export type { LoadingButtonProps, LoadingButtonOwnProps } from '../old-button/loading-button';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { default, type ButtonProps
|
|
2
|
-
export { default as LinkButton, type LinkButtonProps
|
|
3
|
-
export { default as IconButton, type IconButtonProps
|
|
1
|
+
export { default, type ButtonProps } from '../new-button/variants/default/button';
|
|
2
|
+
export { default as LinkButton, type LinkButtonProps } from '../new-button/variants/default/link';
|
|
3
|
+
export { default as IconButton, type IconButtonProps } from '../new-button/variants/icon/button';
|
|
4
4
|
export { default as LinkIconButton, type LinkIconButtonProps, } from '../new-button/variants/icon/link';
|
|
5
5
|
export { SplitButton } from '../new-button/containers/split-button';
|
|
6
6
|
export type { Appearance, Spacing } from '../new-button/variants/types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { Appearance, Spacing, BaseOwnProps, BaseProps
|
|
1
|
+
export type { Appearance, Spacing, BaseOwnProps, BaseProps } from '../old-button/types';
|
|
2
2
|
export type { ButtonProps } from './standard-button';
|
|
3
|
-
export type { LoadingButtonProps, LoadingButtonOwnProps
|
|
3
|
+
export type { LoadingButtonProps, LoadingButtonOwnProps } from './loading-button';
|
|
4
4
|
export type { ThemeTokens, ThemeProps, InteractionState, CustomThemeButtonProps, CustomThemeButtonOwnProps, } from './custom-theme-button';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export type { Appearance, Spacing, BaseOwnProps, BaseProps
|
|
1
|
+
export type { Appearance, Spacing, BaseOwnProps, BaseProps } from './entry-points/types';
|
|
2
2
|
export { default, } from './entry-points/standard-button';
|
|
3
3
|
export type { ButtonProps } from './entry-points/standard-button';
|
|
4
4
|
export { default as LoadingButton } from './entry-points/loading-button';
|
|
5
|
-
export type { LoadingButtonProps, LoadingButtonOwnProps
|
|
6
|
-
export { default as CustomThemeButton, Theme
|
|
5
|
+
export type { LoadingButtonProps, LoadingButtonOwnProps } from './entry-points/loading-button';
|
|
6
|
+
export { default as CustomThemeButton, Theme } from './entry-points/custom-theme-button';
|
|
7
7
|
export type { ThemeTokens, ThemeProps, InteractionState, CustomThemeButtonProps, CustomThemeButtonOwnProps, } from './entry-points/custom-theme-button';
|
|
8
8
|
export { default as ButtonGroup } from './entry-points/button-group';
|
|
9
9
|
export type { ButtonGroupProps } from './entry-points/button-group';
|
|
@@ -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,7 +2,7 @@ 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
|
*
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -10,5 +10,5 @@ type ContentProps = {
|
|
|
10
10
|
*
|
|
11
11
|
* Used for slots within a Button, including icons and text content.
|
|
12
12
|
*/
|
|
13
|
-
declare const Content: ({ children, type, hasOverlay, position
|
|
13
|
+
declare const Content: ({ children, type, hasOverlay, position }: ContentProps) => JSX.Element;
|
|
14
14
|
export default Content;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { default, type ButtonProps
|
|
2
|
-
export { default as LinkButton, type LinkButtonProps
|
|
3
|
-
export { default as IconButton, type IconButtonProps
|
|
1
|
+
export { default, type ButtonProps } from './new-button/variants/default/button';
|
|
2
|
+
export { default as LinkButton, type LinkButtonProps } from './new-button/variants/default/link';
|
|
3
|
+
export { default as IconButton, type IconButtonProps } from './new-button/variants/icon/button';
|
|
4
4
|
export { default as LinkIconButton, type LinkIconButtonProps, } from './new-button/variants/icon/link';
|
|
5
5
|
export { SplitButton } from './new-button/containers/split-button';
|
|
6
6
|
export type { Appearance, Spacing } from './new-button/variants/types';
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { type CustomThemeButtonOwnProps } from '../src/old-button/custom-theme-button/custom-theme-button-types';
|
|
2
2
|
|
|
3
|
-
export default function CustomThemeButtonProps(
|
|
4
|
-
|
|
5
|
-
) {
|
|
6
|
-
return null;
|
|
3
|
+
export default function CustomThemeButtonProps(props: CustomThemeButtonOwnProps) {
|
|
4
|
+
return null;
|
|
7
5
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { type CustomThemeButtonOwnProps } from '../../src/old-button/custom-theme-button/custom-theme-button-types';
|
|
2
2
|
|
|
3
|
-
export default function CustomThemeButtonProps(
|
|
4
|
-
|
|
5
|
-
) {
|
|
6
|
-
return null;
|
|
3
|
+
export default function CustomThemeButtonProps(props: CustomThemeButtonOwnProps) {
|
|
4
|
+
return null;
|
|
7
5
|
}
|