@atlaskit/button 16.9.3 → 16.9.4
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 +6 -0
- package/dist/cjs/entry-points/button-group.js +1 -1
- package/dist/cjs/entry-points/custom-theme-button.js +1 -1
- package/dist/cjs/entry-points/loading-button.js +1 -1
- package/dist/cjs/entry-points/new.js +34 -0
- package/dist/cjs/entry-points/standard-button.js +1 -1
- package/dist/cjs/entry-points/unsafe.js +13 -0
- package/dist/cjs/new-button/variants/default/button.js +100 -0
- package/dist/cjs/new-button/variants/default/link.js +106 -0
- package/dist/cjs/new-button/variants/default/use-default-button.js +90 -0
- package/dist/cjs/new-button/variants/icon/button.js +96 -0
- package/dist/cjs/new-button/variants/icon/link.js +102 -0
- package/dist/cjs/new-button/variants/icon/use-icon-button.js +82 -0
- package/dist/cjs/new-button/variants/shared/block-events.js +33 -0
- package/dist/cjs/new-button/variants/shared/colors.js +130 -0
- package/dist/cjs/new-button/variants/shared/use-button-base.js +140 -0
- package/dist/cjs/new-button/variants/shared/xcss.js +191 -0
- package/dist/cjs/new-button/variants/types.js +5 -0
- package/dist/cjs/old-button/custom-theme-button/custom-theme-button-types.js +5 -0
- package/dist/cjs/{custom-theme-button → old-button/custom-theme-button}/custom-theme-button.js +2 -2
- package/dist/cjs/{custom-theme-button → old-button/custom-theme-button}/theme.js +2 -2
- package/dist/cjs/{shared → old-button/shared}/button-base.js +2 -2
- package/dist/cjs/{shared → old-button/shared}/css.js +2 -2
- package/dist/cjs/old-button/types.js +5 -0
- package/dist/cjs/utils/appearances.js +9 -0
- package/dist/cjs/utils/spacing.js +9 -0
- package/dist/cjs/utils/variants.js +35 -0
- package/dist/es2019/entry-points/button-group.js +1 -1
- package/dist/es2019/entry-points/custom-theme-button.js +1 -1
- package/dist/es2019/entry-points/loading-button.js +1 -1
- package/dist/es2019/entry-points/new.js +4 -0
- package/dist/es2019/entry-points/standard-button.js +1 -1
- package/dist/es2019/entry-points/unsafe.js +1 -0
- package/dist/es2019/new-button/variants/default/button.js +91 -0
- package/dist/es2019/new-button/variants/default/link.js +98 -0
- package/dist/es2019/new-button/variants/default/use-default-button.js +80 -0
- package/dist/es2019/new-button/variants/icon/button.js +87 -0
- package/dist/es2019/new-button/variants/icon/link.js +94 -0
- package/dist/es2019/new-button/variants/icon/use-icon-button.js +77 -0
- package/dist/es2019/new-button/variants/shared/block-events.js +27 -0
- package/dist/es2019/new-button/variants/shared/colors.js +120 -0
- package/dist/es2019/new-button/variants/shared/use-button-base.js +120 -0
- package/dist/es2019/new-button/variants/shared/xcss.js +182 -0
- package/dist/es2019/{shared → old-button/shared}/button-base.js +2 -5
- package/dist/es2019/old-button/types.js +1 -0
- package/dist/es2019/utils/appearances.js +2 -0
- package/dist/es2019/utils/spacing.js +2 -0
- package/dist/es2019/utils/variants.js +20 -0
- package/dist/esm/entry-points/button-group.js +1 -1
- package/dist/esm/entry-points/custom-theme-button.js +1 -1
- package/dist/esm/entry-points/loading-button.js +1 -1
- package/dist/esm/entry-points/new.js +4 -0
- package/dist/esm/entry-points/standard-button.js +1 -1
- package/dist/esm/entry-points/unsafe.js +1 -0
- package/dist/esm/new-button/variants/default/button.js +92 -0
- package/dist/esm/new-button/variants/default/link.js +98 -0
- package/dist/esm/new-button/variants/default/types.js +1 -0
- package/dist/esm/new-button/variants/default/use-default-button.js +79 -0
- package/dist/esm/new-button/variants/icon/button.js +88 -0
- package/dist/esm/new-button/variants/icon/link.js +94 -0
- package/dist/esm/new-button/variants/icon/types.js +1 -0
- package/dist/esm/new-button/variants/icon/use-icon-button.js +74 -0
- package/dist/esm/new-button/variants/shared/block-events.js +27 -0
- package/dist/esm/new-button/variants/shared/colors.js +120 -0
- package/dist/esm/new-button/variants/shared/use-button-base.js +131 -0
- package/dist/esm/new-button/variants/shared/xcss.js +178 -0
- package/dist/esm/new-button/variants/types.js +1 -0
- package/dist/esm/old-button/custom-theme-button/custom-theme-button-types.js +1 -0
- package/dist/esm/{custom-theme-button → old-button/custom-theme-button}/custom-theme-button.js +2 -2
- package/dist/esm/{custom-theme-button → old-button/custom-theme-button}/theme.js +2 -2
- package/dist/esm/{shared → old-button/shared}/button-base.js +2 -2
- package/dist/esm/{shared → old-button/shared}/css.js +2 -2
- package/dist/esm/old-button/types.js +1 -0
- package/dist/esm/utils/appearances.js +2 -0
- package/dist/esm/utils/spacing.js +2 -0
- package/dist/esm/utils/variants.js +22 -0
- package/dist/types/{button-group.d.ts → containers/button-group.d.ts} +1 -1
- package/dist/types/entry-points/button-group.d.ts +1 -1
- package/dist/types/entry-points/custom-theme-button.d.ts +2 -2
- package/dist/types/entry-points/loading-button.d.ts +2 -2
- package/dist/types/entry-points/new.d.ts +5 -0
- package/dist/types/entry-points/standard-button.d.ts +2 -2
- package/dist/types/entry-points/types.d.ts +1 -1
- package/dist/types/entry-points/unsafe.d.ts +1 -0
- package/dist/types/new-button/variants/default/button.d.ts +19 -0
- package/dist/types/new-button/variants/default/link.d.ts +17 -0
- package/dist/types/new-button/variants/default/types.d.ts +15 -0
- package/dist/types/new-button/variants/default/use-default-button.d.ts +15 -0
- package/dist/types/new-button/variants/icon/button.d.ts +17 -0
- package/dist/types/new-button/variants/icon/link.d.ts +17 -0
- package/dist/types/new-button/variants/icon/types.d.ts +8 -0
- package/dist/types/new-button/variants/icon/use-icon-button.d.ts +15 -0
- package/dist/types/new-button/variants/shared/block-events.d.ts +2 -0
- package/dist/types/new-button/variants/shared/colors.d.ts +18 -0
- package/dist/types/new-button/variants/shared/use-button-base.d.ts +37 -0
- package/dist/types/new-button/variants/shared/xcss.d.ts +24 -0
- package/dist/types/new-button/variants/types.d.ts +69 -0
- package/dist/{types-ts4.5 → types/old-button}/custom-theme-button/custom-theme-button.d.ts +1 -1
- package/dist/types/utils/appearances.d.ts +3 -0
- package/dist/types/utils/spacing.d.ts +3 -0
- package/dist/types/utils/variants.d.ts +15 -0
- package/dist/types-ts4.5/{button-group.d.ts → containers/button-group.d.ts} +1 -1
- package/dist/types-ts4.5/entry-points/button-group.d.ts +1 -1
- package/dist/types-ts4.5/entry-points/custom-theme-button.d.ts +2 -2
- package/dist/types-ts4.5/entry-points/loading-button.d.ts +2 -2
- package/dist/types-ts4.5/entry-points/new.d.ts +5 -0
- package/dist/types-ts4.5/entry-points/standard-button.d.ts +2 -2
- package/dist/types-ts4.5/entry-points/types.d.ts +1 -1
- package/dist/types-ts4.5/entry-points/unsafe.d.ts +1 -0
- package/dist/types-ts4.5/new-button/variants/default/button.d.ts +19 -0
- package/dist/types-ts4.5/new-button/variants/default/link.d.ts +17 -0
- package/dist/types-ts4.5/new-button/variants/default/types.d.ts +15 -0
- package/dist/types-ts4.5/new-button/variants/default/use-default-button.d.ts +15 -0
- package/dist/types-ts4.5/new-button/variants/icon/button.d.ts +17 -0
- package/dist/types-ts4.5/new-button/variants/icon/link.d.ts +17 -0
- package/dist/types-ts4.5/new-button/variants/icon/types.d.ts +8 -0
- package/dist/types-ts4.5/new-button/variants/icon/use-icon-button.d.ts +15 -0
- package/dist/types-ts4.5/new-button/variants/shared/block-events.d.ts +2 -0
- package/dist/types-ts4.5/new-button/variants/shared/colors.d.ts +18 -0
- package/dist/types-ts4.5/new-button/variants/shared/use-button-base.d.ts +37 -0
- package/dist/types-ts4.5/new-button/variants/shared/xcss.d.ts +24 -0
- package/dist/types-ts4.5/new-button/variants/types.d.ts +69 -0
- package/dist/{types → types-ts4.5/old-button}/custom-theme-button/custom-theme-button.d.ts +1 -1
- package/dist/types-ts4.5/utils/appearances.d.ts +3 -0
- package/dist/types-ts4.5/utils/spacing.d.ts +3 -0
- package/dist/types-ts4.5/utils/variants.d.ts +15 -0
- package/extract-react-types/custom-theme-button-props.tsx +1 -1
- package/extract-react-types/loading-button-props.tsx +1 -1
- package/extract-react-types/shared-props.tsx +1 -1
- package/package.json +9 -6
- package/unsafe/package.json +15 -0
- /package/dist/cjs/{button-group.js → containers/button-group.js} +0 -0
- /package/dist/cjs/{types.js → new-button/variants/default/types.js} +0 -0
- /package/dist/cjs/{custom-theme-button/custom-theme-button-types.js → new-button/variants/icon/types.js} +0 -0
- /package/dist/cjs/{button.js → old-button/button.js} +0 -0
- /package/dist/cjs/{custom-theme-button → old-button/custom-theme-button}/index.js +0 -0
- /package/dist/cjs/{loading-button.js → old-button/loading-button.js} +0 -0
- /package/dist/cjs/{shared → old-button/shared}/block-events.js +0 -0
- /package/dist/cjs/{shared → old-button/shared}/colors.js +0 -0
- /package/dist/cjs/{shared → old-button/shared}/get-if-visually-hidden-children.js +0 -0
- /package/dist/cjs/{shared → old-button/shared}/get-is-only-single-icon.js +0 -0
- /package/dist/cjs/{shared → old-button/shared}/loading-spinner.js +0 -0
- /package/dist/es2019/{button-group.js → containers/button-group.js} +0 -0
- /package/dist/es2019/{types.js → new-button/variants/default/types.js} +0 -0
- /package/dist/{esm → es2019/new-button/variants/icon}/types.js +0 -0
- /package/dist/es2019/{custom-theme-button/custom-theme-button-types.js → new-button/variants/types.js} +0 -0
- /package/dist/es2019/{button.js → old-button/button.js} +0 -0
- /package/dist/{esm → es2019/old-button}/custom-theme-button/custom-theme-button-types.js +0 -0
- /package/dist/es2019/{custom-theme-button → old-button/custom-theme-button}/custom-theme-button.js +0 -0
- /package/dist/es2019/{custom-theme-button → old-button/custom-theme-button}/index.js +0 -0
- /package/dist/es2019/{custom-theme-button → old-button/custom-theme-button}/theme.js +0 -0
- /package/dist/es2019/{loading-button.js → old-button/loading-button.js} +0 -0
- /package/dist/es2019/{shared → old-button/shared}/block-events.js +0 -0
- /package/dist/es2019/{shared → old-button/shared}/colors.js +0 -0
- /package/dist/es2019/{shared → old-button/shared}/css.js +0 -0
- /package/dist/es2019/{shared → old-button/shared}/get-if-visually-hidden-children.js +0 -0
- /package/dist/es2019/{shared → old-button/shared}/get-is-only-single-icon.js +0 -0
- /package/dist/es2019/{shared → old-button/shared}/loading-spinner.js +0 -0
- /package/dist/esm/{button-group.js → containers/button-group.js} +0 -0
- /package/dist/esm/{button.js → old-button/button.js} +0 -0
- /package/dist/esm/{custom-theme-button → old-button/custom-theme-button}/index.js +0 -0
- /package/dist/esm/{loading-button.js → old-button/loading-button.js} +0 -0
- /package/dist/esm/{shared → old-button/shared}/block-events.js +0 -0
- /package/dist/esm/{shared → old-button/shared}/colors.js +0 -0
- /package/dist/esm/{shared → old-button/shared}/get-if-visually-hidden-children.js +0 -0
- /package/dist/esm/{shared → old-button/shared}/get-is-only-single-icon.js +0 -0
- /package/dist/esm/{shared → old-button/shared}/loading-spinner.js +0 -0
- /package/dist/types/{button.d.ts → old-button/button.d.ts} +0 -0
- /package/dist/types/{custom-theme-button → old-button/custom-theme-button}/custom-theme-button-types.d.ts +0 -0
- /package/dist/types/{custom-theme-button → old-button/custom-theme-button}/index.d.ts +0 -0
- /package/dist/types/{custom-theme-button → old-button/custom-theme-button}/theme.d.ts +0 -0
- /package/dist/types/{loading-button.d.ts → old-button/loading-button.d.ts} +0 -0
- /package/dist/types/{shared → old-button/shared}/block-events.d.ts +0 -0
- /package/dist/types/{shared → old-button/shared}/button-base.d.ts +0 -0
- /package/dist/types/{shared → old-button/shared}/colors.d.ts +0 -0
- /package/dist/types/{shared → old-button/shared}/css.d.ts +0 -0
- /package/dist/types/{shared → old-button/shared}/get-if-visually-hidden-children.d.ts +0 -0
- /package/dist/types/{shared → old-button/shared}/get-is-only-single-icon.d.ts +0 -0
- /package/dist/types/{shared → old-button/shared}/loading-spinner.d.ts +0 -0
- /package/dist/types/{types.d.ts → old-button/types.d.ts} +0 -0
- /package/dist/types-ts4.5/{button.d.ts → old-button/button.d.ts} +0 -0
- /package/dist/types-ts4.5/{custom-theme-button → old-button/custom-theme-button}/custom-theme-button-types.d.ts +0 -0
- /package/dist/types-ts4.5/{custom-theme-button → old-button/custom-theme-button}/index.d.ts +0 -0
- /package/dist/types-ts4.5/{custom-theme-button → old-button/custom-theme-button}/theme.d.ts +0 -0
- /package/dist/types-ts4.5/{loading-button.d.ts → old-button/loading-button.d.ts} +0 -0
- /package/dist/types-ts4.5/{shared → old-button/shared}/block-events.d.ts +0 -0
- /package/dist/types-ts4.5/{shared → old-button/shared}/button-base.d.ts +0 -0
- /package/dist/types-ts4.5/{shared → old-button/shared}/colors.d.ts +0 -0
- /package/dist/types-ts4.5/{shared → old-button/shared}/css.d.ts +0 -0
- /package/dist/types-ts4.5/{shared → old-button/shared}/get-if-visually-hidden-children.d.ts +0 -0
- /package/dist/types-ts4.5/{shared → old-button/shared}/get-is-only-single-icon.d.ts +0 -0
- /package/dist/types-ts4.5/{shared → old-button/shared}/loading-spinner.d.ts +0 -0
- /package/dist/types-ts4.5/{types.d.ts → old-button/types.d.ts} +0 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["analyticsContext", "autoFocus", "appearance", "spacing", "isDisabled", "isSelected", "icon", "children", "interactionName", "overlay", "onClick", "onMouseDownCapture", "onMouseUpCapture", "onKeyDownCapture", "onKeyUpCapture", "onTouchStartCapture", "onTouchEndCapture", "onPointerDownCapture", "onPointerUpCapture", "onClickCapture", "type", "testId"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import UNSAFE_PRESSABLE from '@atlaskit/primitives/pressable';
|
|
6
|
+
import useIconButton from './use-icon-button';
|
|
7
|
+
/**
|
|
8
|
+
* __Icon Button__
|
|
9
|
+
*
|
|
10
|
+
* TODO: Description
|
|
11
|
+
*
|
|
12
|
+
* - [Examples](https://atlassian.design/components/button/examples)
|
|
13
|
+
* - [Code](https://atlassian.design/components/button/code)
|
|
14
|
+
* - [Usage](https://atlassian.design/components/button/usage)
|
|
15
|
+
*/
|
|
16
|
+
var IconButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function Button(_ref, ref) {
|
|
17
|
+
var analyticsContext = _ref.analyticsContext,
|
|
18
|
+
autoFocus = _ref.autoFocus,
|
|
19
|
+
appearance = _ref.appearance,
|
|
20
|
+
spacing = _ref.spacing,
|
|
21
|
+
isDisabled = _ref.isDisabled,
|
|
22
|
+
isSelected = _ref.isSelected,
|
|
23
|
+
icon = _ref.icon,
|
|
24
|
+
children = _ref.children,
|
|
25
|
+
interactionName = _ref.interactionName,
|
|
26
|
+
overlay = _ref.overlay,
|
|
27
|
+
onClick = _ref.onClick,
|
|
28
|
+
onMouseDownCapture = _ref.onMouseDownCapture,
|
|
29
|
+
onMouseUpCapture = _ref.onMouseUpCapture,
|
|
30
|
+
onKeyDownCapture = _ref.onKeyDownCapture,
|
|
31
|
+
onKeyUpCapture = _ref.onKeyUpCapture,
|
|
32
|
+
onTouchStartCapture = _ref.onTouchStartCapture,
|
|
33
|
+
onTouchEndCapture = _ref.onTouchEndCapture,
|
|
34
|
+
onPointerDownCapture = _ref.onPointerDownCapture,
|
|
35
|
+
onPointerUpCapture = _ref.onPointerUpCapture,
|
|
36
|
+
onClickCapture = _ref.onClickCapture,
|
|
37
|
+
_ref$type = _ref.type,
|
|
38
|
+
type = _ref$type === void 0 ? 'button' : _ref$type,
|
|
39
|
+
testId = _ref.testId,
|
|
40
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
41
|
+
/**
|
|
42
|
+
* TODO: At some stage I'll look into re-using more logic across 'default' and 'icon'
|
|
43
|
+
* buttons. It's currently duplicated and mostly the same.
|
|
44
|
+
*/
|
|
45
|
+
var baseProps = useIconButton({
|
|
46
|
+
analyticsContext: analyticsContext,
|
|
47
|
+
appearance: appearance,
|
|
48
|
+
autoFocus: autoFocus,
|
|
49
|
+
buttonType: 'button',
|
|
50
|
+
children: children,
|
|
51
|
+
icon: icon,
|
|
52
|
+
interactionName: interactionName,
|
|
53
|
+
isDisabled: isDisabled,
|
|
54
|
+
isSelected: isSelected,
|
|
55
|
+
onClick: onClick,
|
|
56
|
+
onMouseDownCapture: onMouseDownCapture,
|
|
57
|
+
onMouseUpCapture: onMouseUpCapture,
|
|
58
|
+
onKeyDownCapture: onKeyDownCapture,
|
|
59
|
+
onKeyUpCapture: onKeyUpCapture,
|
|
60
|
+
onTouchStartCapture: onTouchStartCapture,
|
|
61
|
+
onTouchEndCapture: onTouchEndCapture,
|
|
62
|
+
onPointerDownCapture: onPointerDownCapture,
|
|
63
|
+
onPointerUpCapture: onPointerUpCapture,
|
|
64
|
+
onClickCapture: onClickCapture,
|
|
65
|
+
overlay: overlay,
|
|
66
|
+
ref: ref,
|
|
67
|
+
spacing: spacing
|
|
68
|
+
});
|
|
69
|
+
return /*#__PURE__*/React.createElement(UNSAFE_PRESSABLE, _extends({}, rest, {
|
|
70
|
+
ref: baseProps.ref,
|
|
71
|
+
xcss: baseProps.xcss,
|
|
72
|
+
isDisabled: baseProps.isDisabled,
|
|
73
|
+
onClick: baseProps.onClick,
|
|
74
|
+
onMouseDownCapture: baseProps.onMouseDownCapture,
|
|
75
|
+
onMouseUpCapture: baseProps.onMouseUpCapture,
|
|
76
|
+
onKeyDownCapture: baseProps.onKeyDownCapture,
|
|
77
|
+
onKeyUpCapture: baseProps.onKeyUpCapture,
|
|
78
|
+
onTouchStartCapture: baseProps.onTouchStartCapture,
|
|
79
|
+
onTouchEndCapture: baseProps.onTouchEndCapture,
|
|
80
|
+
onPointerDownCapture: baseProps.onPointerDownCapture,
|
|
81
|
+
onPointerUpCapture: baseProps.onPointerUpCapture,
|
|
82
|
+
onClickCapture: baseProps.onClickCapture,
|
|
83
|
+
type: type,
|
|
84
|
+
testId: testId
|
|
85
|
+
}), baseProps.children);
|
|
86
|
+
}));
|
|
87
|
+
IconButton.displayName = 'IconButton';
|
|
88
|
+
export default IconButton;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["analyticsContext", "autoFocus", "appearance", "spacing", "isDisabled", "isSelected", "icon", "children", "interactionName", "overlay", "onClick", "onMouseDownCapture", "onMouseUpCapture", "onKeyDownCapture", "onKeyUpCapture", "onTouchStartCapture", "onTouchEndCapture", "onPointerDownCapture", "onPointerUpCapture", "onClickCapture", "testId", "href"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { Box } from '@atlaskit/primitives';
|
|
6
|
+
import useIconButton from './use-icon-button';
|
|
7
|
+
/**
|
|
8
|
+
* __Link Button__
|
|
9
|
+
*
|
|
10
|
+
* A link button renders a link in the style of a button.
|
|
11
|
+
*
|
|
12
|
+
* - [Examples](https://atlassian.design/components/button/examples)
|
|
13
|
+
* - [Code](https://atlassian.design/components/button/code)
|
|
14
|
+
* - [Usage](https://atlassian.design/components/button/usage)
|
|
15
|
+
*/
|
|
16
|
+
var LinkIconButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function LinkIconButton(_ref, ref) {
|
|
17
|
+
var analyticsContext = _ref.analyticsContext,
|
|
18
|
+
autoFocus = _ref.autoFocus,
|
|
19
|
+
appearance = _ref.appearance,
|
|
20
|
+
spacing = _ref.spacing,
|
|
21
|
+
isDisabled = _ref.isDisabled,
|
|
22
|
+
isSelected = _ref.isSelected,
|
|
23
|
+
icon = _ref.icon,
|
|
24
|
+
children = _ref.children,
|
|
25
|
+
interactionName = _ref.interactionName,
|
|
26
|
+
overlay = _ref.overlay,
|
|
27
|
+
onClick = _ref.onClick,
|
|
28
|
+
onMouseDownCapture = _ref.onMouseDownCapture,
|
|
29
|
+
onMouseUpCapture = _ref.onMouseUpCapture,
|
|
30
|
+
onKeyDownCapture = _ref.onKeyDownCapture,
|
|
31
|
+
onKeyUpCapture = _ref.onKeyUpCapture,
|
|
32
|
+
onTouchStartCapture = _ref.onTouchStartCapture,
|
|
33
|
+
onTouchEndCapture = _ref.onTouchEndCapture,
|
|
34
|
+
onPointerDownCapture = _ref.onPointerDownCapture,
|
|
35
|
+
onPointerUpCapture = _ref.onPointerUpCapture,
|
|
36
|
+
onClickCapture = _ref.onClickCapture,
|
|
37
|
+
testId = _ref.testId,
|
|
38
|
+
href = _ref.href,
|
|
39
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
40
|
+
var baseProps = useIconButton({
|
|
41
|
+
analyticsContext: analyticsContext,
|
|
42
|
+
appearance: appearance,
|
|
43
|
+
autoFocus: autoFocus,
|
|
44
|
+
buttonType: 'link',
|
|
45
|
+
children: children,
|
|
46
|
+
icon: icon,
|
|
47
|
+
interactionName: interactionName,
|
|
48
|
+
isDisabled: isDisabled,
|
|
49
|
+
isSelected: isSelected,
|
|
50
|
+
onClick: onClick,
|
|
51
|
+
onMouseDownCapture: onMouseDownCapture,
|
|
52
|
+
onMouseUpCapture: onMouseUpCapture,
|
|
53
|
+
onKeyDownCapture: onKeyDownCapture,
|
|
54
|
+
onKeyUpCapture: onKeyUpCapture,
|
|
55
|
+
onTouchStartCapture: onTouchStartCapture,
|
|
56
|
+
onTouchEndCapture: onTouchEndCapture,
|
|
57
|
+
onPointerDownCapture: onPointerDownCapture,
|
|
58
|
+
onPointerUpCapture: onPointerUpCapture,
|
|
59
|
+
onClickCapture: onClickCapture,
|
|
60
|
+
overlay: overlay,
|
|
61
|
+
ref: ref,
|
|
62
|
+
spacing: spacing
|
|
63
|
+
});
|
|
64
|
+
return (
|
|
65
|
+
/*#__PURE__*/
|
|
66
|
+
// TODO: Allow custom components for routing (with context)
|
|
67
|
+
// https://product-fabric.atlassian.net/browse/DSP-12505
|
|
68
|
+
React.createElement(Box, _extends({}, rest, {
|
|
69
|
+
ref: baseProps.ref,
|
|
70
|
+
xcss: baseProps.xcss,
|
|
71
|
+
onClick: baseProps.onClick,
|
|
72
|
+
onMouseDownCapture: baseProps.onMouseDownCapture,
|
|
73
|
+
onMouseUpCapture: baseProps.onMouseUpCapture,
|
|
74
|
+
onKeyDownCapture: baseProps.onKeyDownCapture,
|
|
75
|
+
onKeyUpCapture: baseProps.onKeyUpCapture,
|
|
76
|
+
onTouchStartCapture: baseProps.onTouchStartCapture,
|
|
77
|
+
onTouchEndCapture: baseProps.onTouchEndCapture,
|
|
78
|
+
onPointerDownCapture: baseProps.onPointerDownCapture,
|
|
79
|
+
onPointerUpCapture: baseProps.onPointerUpCapture,
|
|
80
|
+
onClickCapture: baseProps.onClickCapture,
|
|
81
|
+
as: "a",
|
|
82
|
+
testId: testId
|
|
83
|
+
/**
|
|
84
|
+
* Disable link in an accessible way using `href`, `role`, and `aria-disabled`.
|
|
85
|
+
* @see https://a11y-guidelines.orange.com/en/articles/disable-elements/#disable-a-link
|
|
86
|
+
*/,
|
|
87
|
+
href: baseProps.isDisabled ? undefined : href,
|
|
88
|
+
role: baseProps.isDisabled ? 'link' : undefined,
|
|
89
|
+
"aria-disabled": baseProps.isDisabled === true ? true : undefined
|
|
90
|
+
}), baseProps.children)
|
|
91
|
+
);
|
|
92
|
+
}));
|
|
93
|
+
LinkIconButton.displayName = 'LinkIconButton';
|
|
94
|
+
export default LinkIconButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box } from '@atlaskit/primitives';
|
|
3
|
+
import useButtonBase from '../shared/use-button-base';
|
|
4
|
+
import { getFadingStyles, iconStyles } from '../shared/xcss';
|
|
5
|
+
/**
|
|
6
|
+
* __Use icon button__
|
|
7
|
+
*
|
|
8
|
+
* A React hook that accepts a set of icon Button props,
|
|
9
|
+
* and processes them to return consistent base props for usage
|
|
10
|
+
* across IconButton and LinkIconButton variants.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
*/
|
|
14
|
+
var useIconButton = function useIconButton(_ref) {
|
|
15
|
+
var analyticsContext = _ref.analyticsContext,
|
|
16
|
+
appearance = _ref.appearance,
|
|
17
|
+
autoFocus = _ref.autoFocus,
|
|
18
|
+
buttonType = _ref.buttonType,
|
|
19
|
+
icon = _ref.icon,
|
|
20
|
+
interactionName = _ref.interactionName,
|
|
21
|
+
isDisabled = _ref.isDisabled,
|
|
22
|
+
isSelected = _ref.isSelected,
|
|
23
|
+
onClick = _ref.onClick,
|
|
24
|
+
onMouseDownCapture = _ref.onMouseDownCapture,
|
|
25
|
+
onMouseUpCapture = _ref.onMouseUpCapture,
|
|
26
|
+
onKeyDownCapture = _ref.onKeyDownCapture,
|
|
27
|
+
onKeyUpCapture = _ref.onKeyUpCapture,
|
|
28
|
+
onTouchStartCapture = _ref.onTouchStartCapture,
|
|
29
|
+
onTouchEndCapture = _ref.onTouchEndCapture,
|
|
30
|
+
onPointerDownCapture = _ref.onPointerDownCapture,
|
|
31
|
+
onPointerUpCapture = _ref.onPointerUpCapture,
|
|
32
|
+
onClickCapture = _ref.onClickCapture,
|
|
33
|
+
overlay = _ref.overlay,
|
|
34
|
+
ref = _ref.ref,
|
|
35
|
+
shouldFitContainer = _ref.shouldFitContainer,
|
|
36
|
+
spacing = _ref.spacing;
|
|
37
|
+
var fadeStyles = getFadingStyles({
|
|
38
|
+
hasOverlay: Boolean(overlay)
|
|
39
|
+
});
|
|
40
|
+
var baseProps = useButtonBase({
|
|
41
|
+
analyticsContext: analyticsContext,
|
|
42
|
+
appearance: appearance,
|
|
43
|
+
autoFocus: autoFocus,
|
|
44
|
+
buttonType: buttonType,
|
|
45
|
+
/**
|
|
46
|
+
* TODO: Have not finished IconButton yet. It also needs a required accessible
|
|
47
|
+
* label - likely implemented using VisuallyHidden
|
|
48
|
+
*/
|
|
49
|
+
children: /*#__PURE__*/React.createElement(Box, {
|
|
50
|
+
as: "span",
|
|
51
|
+
xcss: [fadeStyles, iconStyles]
|
|
52
|
+
}, icon),
|
|
53
|
+
interactionName: interactionName,
|
|
54
|
+
isDisabled: isDisabled,
|
|
55
|
+
isSelected: isSelected,
|
|
56
|
+
isIconButton: true,
|
|
57
|
+
onClick: onClick,
|
|
58
|
+
onMouseDownCapture: onMouseDownCapture,
|
|
59
|
+
onMouseUpCapture: onMouseUpCapture,
|
|
60
|
+
onKeyDownCapture: onKeyDownCapture,
|
|
61
|
+
onKeyUpCapture: onKeyUpCapture,
|
|
62
|
+
onTouchStartCapture: onTouchStartCapture,
|
|
63
|
+
onTouchEndCapture: onTouchEndCapture,
|
|
64
|
+
onPointerDownCapture: onPointerDownCapture,
|
|
65
|
+
onPointerUpCapture: onPointerUpCapture,
|
|
66
|
+
onClickCapture: onClickCapture,
|
|
67
|
+
overlay: overlay,
|
|
68
|
+
ref: ref,
|
|
69
|
+
shouldFitContainer: shouldFitContainer,
|
|
70
|
+
spacing: spacing
|
|
71
|
+
});
|
|
72
|
+
return baseProps;
|
|
73
|
+
};
|
|
74
|
+
export default useIconButton;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
function abort(event) {
|
|
2
|
+
event.preventDefault();
|
|
3
|
+
event.stopPropagation();
|
|
4
|
+
}
|
|
5
|
+
var tabKeyCode = 9;
|
|
6
|
+
function onKey(event) {
|
|
7
|
+
// Allowing tab so that a user can move focus away
|
|
8
|
+
if (event.keyCode === tabKeyCode) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
abort(event);
|
|
12
|
+
}
|
|
13
|
+
export default function blockEvents(shouldBlockEvents, events) {
|
|
14
|
+
return shouldBlockEvents ? {
|
|
15
|
+
onMouseDownCapture: abort,
|
|
16
|
+
onMouseUpCapture: abort,
|
|
17
|
+
onKeyDownCapture: onKey,
|
|
18
|
+
onKeyUpCapture: onKey,
|
|
19
|
+
onTouchStartCapture: abort,
|
|
20
|
+
onTouchEndCapture: abort,
|
|
21
|
+
onPointerDownCapture: abort,
|
|
22
|
+
onPointerUpCapture: abort,
|
|
23
|
+
onClickCapture: abort,
|
|
24
|
+
// Just smashing the existing onClick for good measure
|
|
25
|
+
onClick: abort
|
|
26
|
+
} : events;
|
|
27
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import * as colors from '@atlaskit/theme/colors';
|
|
2
|
+
var values = {
|
|
3
|
+
// Default appearance
|
|
4
|
+
background: {
|
|
5
|
+
default: {
|
|
6
|
+
/**
|
|
7
|
+
* Some colors need specific fallback colors specified
|
|
8
|
+
* to match the original Button when no theme is active.
|
|
9
|
+
*
|
|
10
|
+
* This is because the `xcss` automatic token fallbacks use
|
|
11
|
+
* the legacy themes, which do not match original colors.
|
|
12
|
+
*/
|
|
13
|
+
// @ts-expect-error
|
|
14
|
+
default: "var(--ds-background-neutral, ".concat(colors.N20A, ")"),
|
|
15
|
+
hover: 'color.background.neutral.hovered',
|
|
16
|
+
active: 'color.background.neutral.pressed',
|
|
17
|
+
// @ts-expect-error
|
|
18
|
+
disabled: "var(--ds-background-disabled, ".concat(colors.N20A, ")"),
|
|
19
|
+
// @ts-expect-error
|
|
20
|
+
selected: "var(--ds-background-selected, ".concat(colors.N700, ")")
|
|
21
|
+
},
|
|
22
|
+
primary: {
|
|
23
|
+
default: 'color.background.brand.bold',
|
|
24
|
+
hover: 'color.background.brand.bold.hovered',
|
|
25
|
+
active: 'color.background.brand.bold.pressed',
|
|
26
|
+
// @ts-expect-error
|
|
27
|
+
disabled: "var(--ds-background-disabled, ".concat(colors.N20A, ")"),
|
|
28
|
+
// @ts-expect-error
|
|
29
|
+
selected: "var(--ds-background-selected, ".concat(colors.N700, ")")
|
|
30
|
+
},
|
|
31
|
+
warning: {
|
|
32
|
+
default: 'color.background.warning.bold',
|
|
33
|
+
hover: 'color.background.warning.bold.hovered',
|
|
34
|
+
active: 'color.background.warning.bold.pressed',
|
|
35
|
+
// @ts-expect-error
|
|
36
|
+
disabled: "var(--ds-background-disabled, ".concat(colors.N20A, ")"),
|
|
37
|
+
// @ts-expect-error
|
|
38
|
+
selected: "var(--ds-background-selected, ".concat(colors.Y400, ")")
|
|
39
|
+
},
|
|
40
|
+
danger: {
|
|
41
|
+
default: 'color.background.danger.bold',
|
|
42
|
+
hover: 'color.background.danger.bold.hovered',
|
|
43
|
+
active: 'color.background.danger.bold.pressed',
|
|
44
|
+
// @ts-expect-error
|
|
45
|
+
disabled: "var(--ds-background-disabled, ".concat(colors.N20A, ")"),
|
|
46
|
+
// @ts-expect-error
|
|
47
|
+
selected: "var(--ds-background-selected, ".concat(colors.R500, ")")
|
|
48
|
+
},
|
|
49
|
+
link: {
|
|
50
|
+
default: 'color.background.neutral.subtle',
|
|
51
|
+
// @ts-expect-error
|
|
52
|
+
selected: "var(--ds-background-selected, ".concat(colors.N700, ")")
|
|
53
|
+
},
|
|
54
|
+
subtle: {
|
|
55
|
+
default: 'color.background.neutral.subtle',
|
|
56
|
+
hover: 'color.background.neutral.subtle.hovered',
|
|
57
|
+
active: 'color.background.neutral.subtle.pressed',
|
|
58
|
+
// @ts-expect-error
|
|
59
|
+
disabled: "var(--ds-background-neutral-subtle, none)",
|
|
60
|
+
// @ts-expect-error
|
|
61
|
+
selected: "var(--ds-background-selected, ".concat(colors.N700, ")")
|
|
62
|
+
},
|
|
63
|
+
'subtle-link': {
|
|
64
|
+
default: 'color.background.neutral.subtle',
|
|
65
|
+
// @ts-expect-error
|
|
66
|
+
selected: "var(--ds-background-selected, ".concat(colors.N700, ")")
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
color: {
|
|
70
|
+
default: {
|
|
71
|
+
default: 'color.text',
|
|
72
|
+
active: 'color.text',
|
|
73
|
+
disabled: 'color.text.disabled',
|
|
74
|
+
// @ts-expect-error
|
|
75
|
+
selected: "var(--ds-text-selected, ".concat(colors.N20, ")")
|
|
76
|
+
},
|
|
77
|
+
primary: {
|
|
78
|
+
default: 'color.text.inverse',
|
|
79
|
+
disabled: 'color.text.disabled',
|
|
80
|
+
// @ts-expect-error
|
|
81
|
+
selected: "var(--ds-text-selected, ".concat(colors.N20, ")")
|
|
82
|
+
},
|
|
83
|
+
warning: {
|
|
84
|
+
default: 'color.text.warning.inverse',
|
|
85
|
+
disabled: 'color.text.disabled',
|
|
86
|
+
// @ts-expect-error
|
|
87
|
+
selected: "var(--ds-text-selected, ".concat(colors.N800, ")")
|
|
88
|
+
},
|
|
89
|
+
danger: {
|
|
90
|
+
default: 'color.text.inverse',
|
|
91
|
+
disabled: 'color.text.disabled',
|
|
92
|
+
// @ts-expect-error
|
|
93
|
+
selected: "var(--ds-text-selected, ".concat(colors.N0, ")")
|
|
94
|
+
},
|
|
95
|
+
link: {
|
|
96
|
+
default: 'color.link',
|
|
97
|
+
hover: 'color.link',
|
|
98
|
+
active: 'color.link.pressed',
|
|
99
|
+
disabled: 'color.text.disabled',
|
|
100
|
+
// @ts-expect-error
|
|
101
|
+
selected: "var(--ds-text-selected, ".concat(colors.N20, ")")
|
|
102
|
+
},
|
|
103
|
+
subtle: {
|
|
104
|
+
default: 'color.text',
|
|
105
|
+
active: 'color.text',
|
|
106
|
+
disabled: 'color.text.disabled',
|
|
107
|
+
// @ts-expect-error
|
|
108
|
+
selected: "var(--ds-text-selected, ".concat(colors.N20, ")")
|
|
109
|
+
},
|
|
110
|
+
'subtle-link': {
|
|
111
|
+
default: 'color.text.subtle',
|
|
112
|
+
hover: 'color.text.subtle',
|
|
113
|
+
active: 'color.text',
|
|
114
|
+
disabled: 'color.text.disabled',
|
|
115
|
+
// @ts-expect-error
|
|
116
|
+
selected: "var(--ds-text-selected, ".concat(colors.N20, ")")
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
export default values;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
import React, { Fragment, useCallback, useContext, useMemo, useRef } from 'react';
|
|
5
|
+
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
|
|
6
|
+
import noop from '@atlaskit/ds-lib/noop';
|
|
7
|
+
import useAutoFocus from '@atlaskit/ds-lib/use-auto-focus';
|
|
8
|
+
// eslint-disable-next-line no-duplicate-imports
|
|
9
|
+
import InteractionContext from '@atlaskit/interaction-context';
|
|
10
|
+
import { Box } from '@atlaskit/primitives';
|
|
11
|
+
import blockEvents from './block-events';
|
|
12
|
+
import { getXCSS, overlayStyles } from './xcss';
|
|
13
|
+
|
|
14
|
+
// Include modified onClick with analytics
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* __Use button base__
|
|
18
|
+
*
|
|
19
|
+
* A React hook that accepts a set of common Button props,
|
|
20
|
+
* and processes them to return consistent base props for usage
|
|
21
|
+
* across various Button components.
|
|
22
|
+
*
|
|
23
|
+
* It also:
|
|
24
|
+
* - Implements auto focus when enabled.
|
|
25
|
+
* - Appends the `onClick` event with UFO analytics tracking.
|
|
26
|
+
*
|
|
27
|
+
* @private
|
|
28
|
+
*/
|
|
29
|
+
var useButtonBase = function useButtonBase(_ref) {
|
|
30
|
+
var analyticsContext = _ref.analyticsContext,
|
|
31
|
+
_ref$appearance = _ref.appearance,
|
|
32
|
+
appearance = _ref$appearance === void 0 ? 'default' : _ref$appearance,
|
|
33
|
+
_ref$autoFocus = _ref.autoFocus,
|
|
34
|
+
autoFocus = _ref$autoFocus === void 0 ? false : _ref$autoFocus,
|
|
35
|
+
buttonType = _ref.buttonType,
|
|
36
|
+
interactionName = _ref.interactionName,
|
|
37
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
38
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
39
|
+
_ref$isSelected = _ref.isSelected,
|
|
40
|
+
isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
|
|
41
|
+
_ref$isIconButton = _ref.isIconButton,
|
|
42
|
+
isIconButton = _ref$isIconButton === void 0 ? false : _ref$isIconButton,
|
|
43
|
+
_ref$hasIconBefore = _ref.hasIconBefore,
|
|
44
|
+
hasIconBefore = _ref$hasIconBefore === void 0 ? false : _ref$hasIconBefore,
|
|
45
|
+
_ref$hasIconAfter = _ref.hasIconAfter,
|
|
46
|
+
hasIconAfter = _ref$hasIconAfter === void 0 ? false : _ref$hasIconAfter,
|
|
47
|
+
children = _ref.children,
|
|
48
|
+
_ref$onClick = _ref.onClick,
|
|
49
|
+
providedOnClick = _ref$onClick === void 0 ? noop : _ref$onClick,
|
|
50
|
+
onMouseDownCapture = _ref.onMouseDownCapture,
|
|
51
|
+
onMouseUpCapture = _ref.onMouseUpCapture,
|
|
52
|
+
onKeyDownCapture = _ref.onKeyDownCapture,
|
|
53
|
+
onKeyUpCapture = _ref.onKeyUpCapture,
|
|
54
|
+
onTouchStartCapture = _ref.onTouchStartCapture,
|
|
55
|
+
onTouchEndCapture = _ref.onTouchEndCapture,
|
|
56
|
+
onPointerDownCapture = _ref.onPointerDownCapture,
|
|
57
|
+
onPointerUpCapture = _ref.onPointerUpCapture,
|
|
58
|
+
onClickCapture = _ref.onClickCapture,
|
|
59
|
+
overlay = _ref.overlay,
|
|
60
|
+
ref = _ref.ref,
|
|
61
|
+
_ref$shouldFitContain = _ref.shouldFitContainer,
|
|
62
|
+
shouldFitContainer = _ref$shouldFitContain === void 0 ? false : _ref$shouldFitContain,
|
|
63
|
+
_ref$spacing = _ref.spacing,
|
|
64
|
+
spacing = _ref$spacing === void 0 ? 'default' : _ref$spacing;
|
|
65
|
+
var ourRef = useRef();
|
|
66
|
+
var setRef = useCallback(function (node) {
|
|
67
|
+
ourRef.current = node;
|
|
68
|
+
if (ref === null) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (typeof ref === 'function') {
|
|
72
|
+
ref(node);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// @ts-ignore
|
|
77
|
+
ref.current = node;
|
|
78
|
+
}, [ourRef, ref]);
|
|
79
|
+
useAutoFocus(ourRef, autoFocus);
|
|
80
|
+
var interactionContext = useContext(InteractionContext);
|
|
81
|
+
var handleClick = useCallback(function (e, analyticsEvent) {
|
|
82
|
+
interactionContext && interactionContext.tracePress(interactionName, e.timeStamp);
|
|
83
|
+
providedOnClick(e, analyticsEvent);
|
|
84
|
+
}, [providedOnClick, interactionContext, interactionName]);
|
|
85
|
+
var onClick = usePlatformLeafEventHandler({
|
|
86
|
+
fn: handleClick,
|
|
87
|
+
action: 'clicked',
|
|
88
|
+
componentName: 'button',
|
|
89
|
+
packageName: "@atlaskit/button",
|
|
90
|
+
packageVersion: "16.9.4",
|
|
91
|
+
analyticsData: analyticsContext,
|
|
92
|
+
actionSubject: buttonType
|
|
93
|
+
});
|
|
94
|
+
var buttonXCSS = useMemo(function () {
|
|
95
|
+
return getXCSS({
|
|
96
|
+
appearance: appearance,
|
|
97
|
+
spacing: spacing,
|
|
98
|
+
isDisabled: isDisabled,
|
|
99
|
+
isSelected: isSelected,
|
|
100
|
+
shouldFitContainer: shouldFitContainer,
|
|
101
|
+
isIconButton: isIconButton,
|
|
102
|
+
hasOverlay: Boolean(overlay),
|
|
103
|
+
isLink: buttonType === 'link',
|
|
104
|
+
hasIconBefore: hasIconBefore,
|
|
105
|
+
hasIconAfter: hasIconAfter
|
|
106
|
+
});
|
|
107
|
+
}, [appearance, buttonType, spacing, isDisabled, isSelected, isIconButton, shouldFitContainer, overlay, hasIconBefore, hasIconAfter]);
|
|
108
|
+
var isEffectivelyDisabled = isDisabled || Boolean(overlay);
|
|
109
|
+
return _objectSpread({
|
|
110
|
+
ref: setRef,
|
|
111
|
+
xcss: buttonXCSS,
|
|
112
|
+
// Consider overlay buttons to be effectively disabled
|
|
113
|
+
isDisabled: isEffectivelyDisabled,
|
|
114
|
+
children: /*#__PURE__*/React.createElement(Fragment, null, children, overlay ? /*#__PURE__*/React.createElement(Box, {
|
|
115
|
+
as: "span",
|
|
116
|
+
xcss: overlayStyles
|
|
117
|
+
}, overlay) : null)
|
|
118
|
+
}, blockEvents(isEffectivelyDisabled, {
|
|
119
|
+
onClick: onClick,
|
|
120
|
+
onMouseDownCapture: onMouseDownCapture,
|
|
121
|
+
onMouseUpCapture: onMouseUpCapture,
|
|
122
|
+
onKeyDownCapture: onKeyDownCapture,
|
|
123
|
+
onKeyUpCapture: onKeyUpCapture,
|
|
124
|
+
onTouchStartCapture: onTouchStartCapture,
|
|
125
|
+
onTouchEndCapture: onTouchEndCapture,
|
|
126
|
+
onPointerDownCapture: onPointerDownCapture,
|
|
127
|
+
onPointerUpCapture: onPointerUpCapture,
|
|
128
|
+
onClickCapture: onClickCapture
|
|
129
|
+
}));
|
|
130
|
+
};
|
|
131
|
+
export default useButtonBase;
|