@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
|
-
var useDefaultButton = function useDefaultButton(_ref) {
|
|
15
|
-
var analyticsContext = _ref.analyticsContext,
|
|
16
|
-
appearance = _ref.appearance,
|
|
17
|
-
ariaLabel = _ref.ariaLabel,
|
|
18
|
-
ariaLabelledBy = _ref.ariaLabelledBy,
|
|
19
|
-
autoFocus = _ref.autoFocus,
|
|
20
|
-
buttonType = _ref.buttonType,
|
|
21
|
-
children = _ref.children,
|
|
22
|
-
iconAfter = _ref.iconAfter,
|
|
23
|
-
iconBefore = _ref.iconBefore,
|
|
24
|
-
interactionName = _ref.interactionName,
|
|
25
|
-
isDisabled = _ref.isDisabled,
|
|
26
|
-
_ref$isLoading = _ref.isLoading,
|
|
27
|
-
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
28
|
-
isSelected = _ref.isSelected,
|
|
29
|
-
onClick = _ref.onClick,
|
|
30
|
-
onClickCapture = _ref.onClickCapture,
|
|
31
|
-
onKeyDownCapture = _ref.onKeyDownCapture,
|
|
32
|
-
onKeyUpCapture = _ref.onKeyUpCapture,
|
|
33
|
-
onMouseDownCapture = _ref.onMouseDownCapture,
|
|
34
|
-
onMouseUpCapture = _ref.onMouseUpCapture,
|
|
35
|
-
onPointerDownCapture = _ref.onPointerDownCapture,
|
|
36
|
-
onPointerUpCapture = _ref.onPointerUpCapture,
|
|
37
|
-
onTouchEndCapture = _ref.onTouchEndCapture,
|
|
38
|
-
onTouchStartCapture = _ref.onTouchStartCapture,
|
|
39
|
-
ref = _ref.ref,
|
|
40
|
-
shouldFitContainer = _ref.shouldFitContainer,
|
|
41
|
-
spacing = _ref.spacing,
|
|
42
|
-
testId = _ref.testId;
|
|
43
|
-
var baseProps = useButtonBase({
|
|
44
|
-
analyticsContext: analyticsContext,
|
|
45
|
-
appearance: appearance,
|
|
46
|
-
autoFocus: autoFocus,
|
|
47
|
-
ariaLabel: ariaLabel,
|
|
48
|
-
ariaLabelledBy: ariaLabelledBy,
|
|
49
|
-
buttonType: 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: interactionName,
|
|
66
|
-
isDisabled: isDisabled,
|
|
67
|
-
isLoading: isLoading,
|
|
68
|
-
isSelected: isSelected,
|
|
69
|
-
onClick: onClick,
|
|
70
|
-
onMouseDownCapture: onMouseDownCapture,
|
|
71
|
-
onMouseUpCapture: onMouseUpCapture,
|
|
72
|
-
onKeyDownCapture: onKeyDownCapture,
|
|
73
|
-
onKeyUpCapture: onKeyUpCapture,
|
|
74
|
-
onTouchStartCapture: onTouchStartCapture,
|
|
75
|
-
onTouchEndCapture: onTouchEndCapture,
|
|
76
|
-
onPointerDownCapture: onPointerDownCapture,
|
|
77
|
-
onPointerUpCapture: onPointerUpCapture,
|
|
78
|
-
onClickCapture: onClickCapture,
|
|
79
|
-
ref: ref,
|
|
80
|
-
shouldFitContainer: shouldFitContainer,
|
|
81
|
-
spacing: spacing,
|
|
82
|
-
testId: 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
|
-
var useIconButton = function useIconButton(_ref) {
|
|
16
|
-
var analyticsContext = _ref.analyticsContext,
|
|
17
|
-
appearance = _ref.appearance,
|
|
18
|
-
ariaLabel = _ref.ariaLabel,
|
|
19
|
-
ariaLabelledBy = _ref.ariaLabelledBy,
|
|
20
|
-
autoFocus = _ref.autoFocus,
|
|
21
|
-
buttonType = _ref.buttonType,
|
|
22
|
-
icon = _ref.icon,
|
|
23
|
-
interactionName = _ref.interactionName,
|
|
24
|
-
isDisabled = _ref.isDisabled,
|
|
25
|
-
_ref$isLoading = _ref.isLoading,
|
|
26
|
-
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
27
|
-
isSelected = _ref.isSelected,
|
|
28
|
-
label = _ref.label,
|
|
29
|
-
onClick = _ref.onClick,
|
|
30
|
-
onClickCapture = _ref.onClickCapture,
|
|
31
|
-
onKeyDownCapture = _ref.onKeyDownCapture,
|
|
32
|
-
onKeyUpCapture = _ref.onKeyUpCapture,
|
|
33
|
-
onMouseDownCapture = _ref.onMouseDownCapture,
|
|
34
|
-
onMouseUpCapture = _ref.onMouseUpCapture,
|
|
35
|
-
onPointerDownCapture = _ref.onPointerDownCapture,
|
|
36
|
-
onPointerUpCapture = _ref.onPointerUpCapture,
|
|
37
|
-
onTouchEndCapture = _ref.onTouchEndCapture,
|
|
38
|
-
onTouchStartCapture = _ref.onTouchStartCapture,
|
|
39
|
-
ref = _ref.ref,
|
|
40
|
-
shape = _ref.shape,
|
|
41
|
-
shouldFitContainer = _ref.shouldFitContainer,
|
|
42
|
-
spacing = _ref.spacing,
|
|
43
|
-
testId = _ref.testId;
|
|
44
|
-
var isCircle = shape === 'circle';
|
|
45
|
-
var baseProps = useButtonBase({
|
|
46
|
-
analyticsContext: analyticsContext,
|
|
47
|
-
appearance: appearance,
|
|
48
|
-
autoFocus: autoFocus,
|
|
49
|
-
ariaLabel: ariaLabel,
|
|
50
|
-
ariaLabelledBy: ariaLabelledBy,
|
|
51
|
-
buttonType: 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: interactionName,
|
|
59
|
-
isDisabled: isDisabled,
|
|
60
|
-
isLoading: isLoading,
|
|
61
|
-
isSelected: isSelected,
|
|
62
|
-
isIconButton: true,
|
|
63
|
-
isCircle: isCircle,
|
|
64
|
-
onClick: onClick,
|
|
65
|
-
onMouseDownCapture: onMouseDownCapture,
|
|
66
|
-
onMouseUpCapture: onMouseUpCapture,
|
|
67
|
-
onKeyDownCapture: onKeyDownCapture,
|
|
68
|
-
onKeyUpCapture: onKeyUpCapture,
|
|
69
|
-
onTouchStartCapture: onTouchStartCapture,
|
|
70
|
-
onTouchEndCapture: onTouchEndCapture,
|
|
71
|
-
onPointerDownCapture: onPointerDownCapture,
|
|
72
|
-
onPointerUpCapture: onPointerUpCapture,
|
|
73
|
-
onClickCapture: onClickCapture,
|
|
74
|
-
ref: ref,
|
|
75
|
-
shouldFitContainer: shouldFitContainer,
|
|
76
|
-
spacing: spacing,
|
|
77
|
-
testId: testId
|
|
78
|
-
});
|
|
79
|
-
return baseProps;
|
|
80
|
-
};
|
|
81
|
-
export default useIconButton;
|