@atlaskit/button 21.1.4 → 21.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/cjs/new-button/containers/split-button/split-button.compiled.css +34 -0
- package/dist/cjs/new-button/containers/split-button/split-button.js +58 -118
- package/dist/cjs/new-button/variants/default/button.js +36 -41
- package/dist/cjs/new-button/variants/default/link.compiled.css +119 -0
- package/dist/cjs/new-button/variants/default/link.js +111 -59
- package/dist/cjs/new-button/variants/icon/button.js +128 -143
- package/dist/cjs/new-button/variants/icon/link.compiled.css +104 -0
- package/dist/cjs/new-button/variants/icon/link.js +101 -75
- package/dist/cjs/new-button/variants/shared/button-base.compiled.css +137 -0
- package/dist/cjs/new-button/variants/shared/button-base.js +223 -0
- package/dist/cjs/new-button/variants/shared/content.compiled.css +19 -0
- package/dist/cjs/new-button/variants/shared/content.js +13 -53
- package/dist/cjs/old-button/shared/button-base.js +1 -1
- package/dist/es2019/new-button/containers/split-button/split-button.compiled.css +34 -0
- package/dist/es2019/new-button/containers/split-button/split-button.js +54 -117
- package/dist/es2019/new-button/variants/default/button.js +47 -56
- package/dist/es2019/new-button/variants/default/link.compiled.css +119 -0
- package/dist/es2019/new-button/variants/default/link.js +113 -63
- package/dist/es2019/new-button/variants/icon/button.js +117 -133
- package/dist/es2019/new-button/variants/icon/link.compiled.css +104 -0
- package/dist/es2019/new-button/variants/icon/link.js +94 -70
- package/dist/es2019/new-button/variants/shared/button-base.compiled.css +137 -0
- package/dist/es2019/new-button/variants/shared/button-base.js +203 -0
- package/dist/es2019/new-button/variants/shared/content.compiled.css +19 -0
- package/dist/es2019/new-button/variants/shared/content.js +13 -52
- package/dist/es2019/old-button/shared/button-base.js +1 -1
- package/dist/esm/new-button/containers/split-button/split-button.compiled.css +34 -0
- package/dist/esm/new-button/containers/split-button/split-button.js +55 -120
- package/dist/esm/new-button/variants/default/button.js +33 -41
- package/dist/esm/new-button/variants/default/link.compiled.css +119 -0
- package/dist/esm/new-button/variants/default/link.js +111 -59
- package/dist/esm/new-button/variants/icon/button.js +128 -143
- package/dist/esm/new-button/variants/icon/link.compiled.css +104 -0
- package/dist/esm/new-button/variants/icon/link.js +98 -72
- package/dist/esm/new-button/variants/shared/button-base.compiled.css +137 -0
- package/dist/esm/new-button/variants/shared/button-base.js +213 -0
- package/dist/esm/new-button/variants/shared/content.compiled.css +19 -0
- package/dist/esm/new-button/variants/shared/content.js +13 -53
- package/dist/esm/old-button/shared/button-base.js +1 -1
- package/dist/types/new-button/containers/split-button/split-button.d.ts +4 -5
- package/dist/types/new-button/variants/default/button.d.ts +5 -1
- package/dist/types/new-button/variants/default/link.d.ts +22 -8
- package/dist/types/new-button/variants/icon/button.d.ts +5 -1
- package/dist/types/new-button/variants/icon/link.d.ts +11 -4
- package/dist/types/new-button/variants/shared/block-events.d.ts +1 -1
- package/dist/types/new-button/variants/shared/button-base.d.ts +45 -0
- package/dist/types/new-button/variants/shared/content.d.ts +5 -1
- package/dist/types/new-button/variants/types.d.ts +26 -6
- package/dist/types-ts4.5/new-button/containers/split-button/split-button.d.ts +4 -5
- package/dist/types-ts4.5/new-button/variants/default/button.d.ts +5 -1
- package/dist/types-ts4.5/new-button/variants/default/link.d.ts +22 -8
- package/dist/types-ts4.5/new-button/variants/icon/button.d.ts +5 -1
- package/dist/types-ts4.5/new-button/variants/icon/link.d.ts +11 -4
- package/dist/types-ts4.5/new-button/variants/shared/block-events.d.ts +1 -1
- package/dist/types-ts4.5/new-button/variants/shared/button-base.d.ts +45 -0
- package/dist/types-ts4.5/new-button/variants/shared/content.d.ts +5 -1
- package/dist/types-ts4.5/new-button/variants/types.d.ts +26 -6
- package/package.json +17 -15
- package/dist/cjs/new-button/variants/default/use-default-button.js +0 -98
- package/dist/cjs/new-button/variants/icon/use-icon-button.js +0 -88
- package/dist/cjs/new-button/variants/shared/use-button-base.js +0 -639
- package/dist/es2019/new-button/variants/default/use-default-button.js +0 -88
- package/dist/es2019/new-button/variants/icon/use-icon-button.js +0 -81
- package/dist/es2019/new-button/variants/shared/use-button-base.js +0 -619
- package/dist/esm/new-button/variants/default/use-default-button.js +0 -88
- package/dist/esm/new-button/variants/icon/use-icon-button.js +0 -81
- package/dist/esm/new-button/variants/shared/use-button-base.js +0 -629
- package/dist/types/new-button/variants/default/use-default-button.d.ts +0 -16
- package/dist/types/new-button/variants/icon/use-icon-button.d.ts +0 -16
- package/dist/types/new-button/variants/shared/use-button-base.d.ts +0 -46
- package/dist/types-ts4.5/new-button/variants/default/use-default-button.d.ts +0 -16
- package/dist/types-ts4.5/new-button/variants/icon/use-icon-button.d.ts +0 -16
- package/dist/types-ts4.5/new-button/variants/shared/use-button-base.d.ts +0 -46
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import React, { Fragment } from 'react';
|
|
2
|
-
import Content from '../shared/content';
|
|
3
|
-
import IconRenderer from '../shared/icon-renderer';
|
|
4
|
-
import useButtonBase from '../shared/use-button-base';
|
|
5
|
-
/**
|
|
6
|
-
* __Use default button base__
|
|
7
|
-
*
|
|
8
|
-
* A React hook that accepts a set of default Button props,
|
|
9
|
-
* and processes them to return consistent base props for usage
|
|
10
|
-
* across Button and LinkButton variants.
|
|
11
|
-
*
|
|
12
|
-
* @private
|
|
13
|
-
*/
|
|
14
|
-
const useDefaultButton = ({
|
|
15
|
-
analyticsContext,
|
|
16
|
-
appearance,
|
|
17
|
-
ariaLabel,
|
|
18
|
-
ariaLabelledBy,
|
|
19
|
-
autoFocus,
|
|
20
|
-
buttonType,
|
|
21
|
-
children,
|
|
22
|
-
iconAfter,
|
|
23
|
-
iconBefore,
|
|
24
|
-
interactionName,
|
|
25
|
-
isDisabled,
|
|
26
|
-
isLoading = false,
|
|
27
|
-
isSelected,
|
|
28
|
-
onClick,
|
|
29
|
-
onClickCapture,
|
|
30
|
-
onKeyDownCapture,
|
|
31
|
-
onKeyUpCapture,
|
|
32
|
-
onMouseDownCapture,
|
|
33
|
-
onMouseUpCapture,
|
|
34
|
-
onPointerDownCapture,
|
|
35
|
-
onPointerUpCapture,
|
|
36
|
-
onTouchEndCapture,
|
|
37
|
-
onTouchStartCapture,
|
|
38
|
-
ref,
|
|
39
|
-
shouldFitContainer,
|
|
40
|
-
spacing,
|
|
41
|
-
testId
|
|
42
|
-
}) => {
|
|
43
|
-
const baseProps = useButtonBase({
|
|
44
|
-
analyticsContext,
|
|
45
|
-
appearance,
|
|
46
|
-
autoFocus,
|
|
47
|
-
ariaLabel,
|
|
48
|
-
ariaLabelledBy,
|
|
49
|
-
buttonType,
|
|
50
|
-
children: /*#__PURE__*/React.createElement(Fragment, null, iconBefore && /*#__PURE__*/React.createElement(Content, {
|
|
51
|
-
type: "icon",
|
|
52
|
-
position: "before",
|
|
53
|
-
isLoading: isLoading
|
|
54
|
-
}, /*#__PURE__*/React.createElement(IconRenderer, {
|
|
55
|
-
icon: iconBefore
|
|
56
|
-
})), children && /*#__PURE__*/React.createElement(Content, {
|
|
57
|
-
isLoading: isLoading
|
|
58
|
-
}, children), iconAfter && /*#__PURE__*/React.createElement(Content, {
|
|
59
|
-
type: "icon",
|
|
60
|
-
position: "after",
|
|
61
|
-
isLoading: isLoading
|
|
62
|
-
}, /*#__PURE__*/React.createElement(IconRenderer, {
|
|
63
|
-
icon: iconAfter
|
|
64
|
-
}))),
|
|
65
|
-
interactionName,
|
|
66
|
-
isDisabled,
|
|
67
|
-
isLoading,
|
|
68
|
-
isSelected,
|
|
69
|
-
onClick,
|
|
70
|
-
onMouseDownCapture,
|
|
71
|
-
onMouseUpCapture,
|
|
72
|
-
onKeyDownCapture,
|
|
73
|
-
onKeyUpCapture,
|
|
74
|
-
onTouchStartCapture,
|
|
75
|
-
onTouchEndCapture,
|
|
76
|
-
onPointerDownCapture,
|
|
77
|
-
onPointerUpCapture,
|
|
78
|
-
onClickCapture,
|
|
79
|
-
ref,
|
|
80
|
-
shouldFitContainer,
|
|
81
|
-
spacing,
|
|
82
|
-
testId,
|
|
83
|
-
hasIconBefore: Boolean(iconBefore),
|
|
84
|
-
hasIconAfter: Boolean(iconAfter)
|
|
85
|
-
});
|
|
86
|
-
return baseProps;
|
|
87
|
-
};
|
|
88
|
-
export default useDefaultButton;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
3
|
-
import Content from '../shared/content';
|
|
4
|
-
import IconRenderer from '../shared/icon-renderer';
|
|
5
|
-
import useButtonBase from '../shared/use-button-base';
|
|
6
|
-
/**
|
|
7
|
-
* __Use icon button__
|
|
8
|
-
*
|
|
9
|
-
* A React hook that accepts a set of icon Button props,
|
|
10
|
-
* and processes them to return consistent base props for usage
|
|
11
|
-
* across IconButton and LinkIconButton variants.
|
|
12
|
-
*
|
|
13
|
-
* @private
|
|
14
|
-
*/
|
|
15
|
-
const useIconButton = ({
|
|
16
|
-
analyticsContext,
|
|
17
|
-
appearance,
|
|
18
|
-
ariaLabel,
|
|
19
|
-
ariaLabelledBy,
|
|
20
|
-
autoFocus,
|
|
21
|
-
buttonType,
|
|
22
|
-
icon,
|
|
23
|
-
interactionName,
|
|
24
|
-
isDisabled,
|
|
25
|
-
isLoading = false,
|
|
26
|
-
isSelected,
|
|
27
|
-
label,
|
|
28
|
-
onClick,
|
|
29
|
-
onClickCapture,
|
|
30
|
-
onKeyDownCapture,
|
|
31
|
-
onKeyUpCapture,
|
|
32
|
-
onMouseDownCapture,
|
|
33
|
-
onMouseUpCapture,
|
|
34
|
-
onPointerDownCapture,
|
|
35
|
-
onPointerUpCapture,
|
|
36
|
-
onTouchEndCapture,
|
|
37
|
-
onTouchStartCapture,
|
|
38
|
-
ref,
|
|
39
|
-
shape,
|
|
40
|
-
shouldFitContainer,
|
|
41
|
-
spacing,
|
|
42
|
-
testId
|
|
43
|
-
}) => {
|
|
44
|
-
const isCircle = shape === 'circle';
|
|
45
|
-
const baseProps = useButtonBase({
|
|
46
|
-
analyticsContext,
|
|
47
|
-
appearance,
|
|
48
|
-
autoFocus,
|
|
49
|
-
ariaLabel,
|
|
50
|
-
ariaLabelledBy,
|
|
51
|
-
buttonType,
|
|
52
|
-
children: /*#__PURE__*/React.createElement(Content, {
|
|
53
|
-
type: "icon",
|
|
54
|
-
isLoading: isLoading
|
|
55
|
-
}, /*#__PURE__*/React.createElement(IconRenderer, {
|
|
56
|
-
icon: icon
|
|
57
|
-
}), /*#__PURE__*/React.createElement(VisuallyHidden, null, label)),
|
|
58
|
-
interactionName,
|
|
59
|
-
isDisabled,
|
|
60
|
-
isLoading,
|
|
61
|
-
isSelected,
|
|
62
|
-
isIconButton: true,
|
|
63
|
-
isCircle,
|
|
64
|
-
onClick,
|
|
65
|
-
onMouseDownCapture,
|
|
66
|
-
onMouseUpCapture,
|
|
67
|
-
onKeyDownCapture,
|
|
68
|
-
onKeyUpCapture,
|
|
69
|
-
onTouchStartCapture,
|
|
70
|
-
onTouchEndCapture,
|
|
71
|
-
onPointerDownCapture,
|
|
72
|
-
onPointerUpCapture,
|
|
73
|
-
onClickCapture,
|
|
74
|
-
ref,
|
|
75
|
-
shouldFitContainer,
|
|
76
|
-
spacing,
|
|
77
|
-
testId
|
|
78
|
-
});
|
|
79
|
-
return baseProps;
|
|
80
|
-
};
|
|
81
|
-
export default useIconButton;
|