@atlaskit/button 17.17.2 → 17.18.0
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 +56 -1
- 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/containers/button-group.js +3 -1
- package/dist/cjs/new-button/containers/split-button/split-button.js +6 -2
- package/dist/cjs/new-button/variants/default/button.js +8 -1
- package/dist/cjs/new-button/variants/default/link.js +8 -1
- package/dist/cjs/new-button/variants/default/use-default-button.js +7 -1
- package/dist/cjs/new-button/variants/icon/button.js +6 -1
- package/dist/cjs/new-button/variants/icon/link.js +6 -1
- package/dist/cjs/new-button/variants/icon/use-icon-button.js +7 -1
- package/dist/cjs/new-button/variants/shared/constants.js +7 -0
- package/dist/cjs/new-button/variants/shared/loading-overlay.js +4 -3
- package/dist/cjs/new-button/variants/shared/use-button-base.js +54 -2
- package/dist/cjs/old-button/button.js +1 -1
- package/dist/cjs/old-button/custom-theme-button/custom-theme-button.js +1 -1
- package/dist/cjs/old-button/custom-theme-button/theme.js +1 -1
- package/dist/cjs/old-button/shared/button-base.js +9 -3
- package/dist/cjs/old-button/shared/css.js +4 -3
- package/dist/es2019/containers/button-group.js +3 -1
- package/dist/es2019/new-button/containers/split-button/split-button.js +5 -2
- package/dist/es2019/new-button/variants/default/button.js +7 -0
- package/dist/es2019/new-button/variants/default/link.js +9 -2
- package/dist/es2019/new-button/variants/default/use-default-button.js +7 -1
- package/dist/es2019/new-button/variants/icon/button.js +5 -0
- package/dist/es2019/new-button/variants/icon/link.js +8 -3
- package/dist/es2019/new-button/variants/icon/use-icon-button.js +7 -1
- package/dist/es2019/new-button/variants/shared/constants.js +1 -0
- package/dist/es2019/new-button/variants/shared/loading-overlay.js +4 -3
- package/dist/es2019/new-button/variants/shared/use-button-base.js +54 -2
- package/dist/es2019/old-button/button.js +3 -0
- package/dist/es2019/old-button/custom-theme-button/custom-theme-button.js +3 -0
- package/dist/es2019/old-button/custom-theme-button/theme.js +2 -0
- package/dist/es2019/old-button/shared/button-base.js +10 -3
- package/dist/es2019/old-button/shared/css.js +4 -2
- package/dist/esm/containers/button-group.js +3 -1
- package/dist/esm/new-button/containers/split-button/split-button.js +5 -2
- package/dist/esm/new-button/variants/default/button.js +8 -1
- package/dist/esm/new-button/variants/default/link.js +10 -3
- package/dist/esm/new-button/variants/default/use-default-button.js +7 -1
- package/dist/esm/new-button/variants/icon/button.js +6 -1
- package/dist/esm/new-button/variants/icon/link.js +9 -4
- package/dist/esm/new-button/variants/icon/use-icon-button.js +7 -1
- package/dist/esm/new-button/variants/shared/constants.js +1 -0
- package/dist/esm/new-button/variants/shared/loading-overlay.js +4 -3
- package/dist/esm/new-button/variants/shared/use-button-base.js +54 -2
- package/dist/esm/old-button/button.js +3 -0
- package/dist/esm/old-button/custom-theme-button/custom-theme-button.js +3 -0
- package/dist/esm/old-button/custom-theme-button/theme.js +2 -0
- package/dist/esm/old-button/shared/button-base.js +10 -3
- package/dist/esm/old-button/shared/css.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/variants/default/link.d.ts +1 -1
- package/dist/types/new-button/variants/default/types.d.ts +1 -1
- package/dist/types/new-button/variants/default/use-default-button.d.ts +4 -3
- package/dist/types/new-button/variants/icon/link.d.ts +1 -1
- package/dist/types/new-button/variants/icon/use-icon-button.d.ts +4 -3
- package/dist/types/new-button/variants/shared/constants.d.ts +1 -0
- package/dist/types/new-button/variants/shared/loading-overlay.d.ts +2 -1
- package/dist/types/new-button/variants/shared/use-button-base.d.ts +5 -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/variants/default/link.d.ts +1 -1
- package/dist/types-ts4.5/new-button/variants/default/types.d.ts +1 -1
- package/dist/types-ts4.5/new-button/variants/default/use-default-button.d.ts +4 -3
- package/dist/types-ts4.5/new-button/variants/icon/link.d.ts +1 -1
- package/dist/types-ts4.5/new-button/variants/icon/use-icon-button.d.ts +4 -3
- package/dist/types-ts4.5/new-button/variants/shared/constants.d.ts +1 -0
- package/dist/types-ts4.5/new-button/variants/shared/loading-overlay.d.ts +2 -1
- package/dist/types-ts4.5/new-button/variants/shared/use-button-base.d.ts +5 -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 +202 -201
- package/report.api.md +78 -96
|
@@ -24,6 +24,8 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
24
24
|
var useDefaultButton = function useDefaultButton(_ref) {
|
|
25
25
|
var analyticsContext = _ref.analyticsContext,
|
|
26
26
|
appearance = _ref.appearance,
|
|
27
|
+
ariaLabel = _ref.ariaLabel,
|
|
28
|
+
ariaLabelledBy = _ref.ariaLabelledBy,
|
|
27
29
|
autoFocus = _ref.autoFocus,
|
|
28
30
|
buttonType = _ref.buttonType,
|
|
29
31
|
children = _ref.children,
|
|
@@ -48,6 +50,7 @@ var useDefaultButton = function useDefaultButton(_ref) {
|
|
|
48
50
|
ref = _ref.ref,
|
|
49
51
|
shouldFitContainer = _ref.shouldFitContainer,
|
|
50
52
|
spacing = _ref.spacing,
|
|
53
|
+
testId = _ref.testId,
|
|
51
54
|
UNSAFE_iconAfter_size = _ref.UNSAFE_iconAfter_size,
|
|
52
55
|
UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size;
|
|
53
56
|
var hasOverlay = Boolean(overlay || isLoading);
|
|
@@ -55,6 +58,8 @@ var useDefaultButton = function useDefaultButton(_ref) {
|
|
|
55
58
|
analyticsContext: analyticsContext,
|
|
56
59
|
appearance: appearance,
|
|
57
60
|
autoFocus: autoFocus,
|
|
61
|
+
ariaLabel: ariaLabel,
|
|
62
|
+
ariaLabelledBy: ariaLabelledBy,
|
|
58
63
|
buttonType: buttonType,
|
|
59
64
|
children: /*#__PURE__*/_react.default.createElement(_react.Fragment, null, IconBefore && /*#__PURE__*/_react.default.createElement(_content.default, {
|
|
60
65
|
type: "icon",
|
|
@@ -93,7 +98,8 @@ var useDefaultButton = function useDefaultButton(_ref) {
|
|
|
93
98
|
spacing: spacing,
|
|
94
99
|
appearance: appearance,
|
|
95
100
|
isDisabled: isDisabled,
|
|
96
|
-
isSelected: isSelected
|
|
101
|
+
isSelected: isSelected,
|
|
102
|
+
testId: testId
|
|
97
103
|
}) : overlay,
|
|
98
104
|
ref: ref,
|
|
99
105
|
shouldFitContainer: shouldFitContainer,
|
|
@@ -11,7 +11,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
var _pressable = _interopRequireDefault(require("@atlaskit/primitives/pressable"));
|
|
12
12
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
13
13
|
var _useIconButton = _interopRequireDefault(require("./use-icon-button"));
|
|
14
|
-
var _excluded = ["aria-label", "analyticsContext", "appearance", "autoFocus", "icon", "interactionName", "isDisabled", "isLoading", "isSelected", "isTooltipDisabled", "label", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shape", "spacing", "testId", "tooltip", "type", "UNSAFE_size"];
|
|
14
|
+
var _excluded = ["aria-label", "aria-labelledby", "analyticsContext", "appearance", "autoFocus", "icon", "interactionName", "isDisabled", "isLoading", "isSelected", "isTooltipDisabled", "label", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shape", "spacing", "testId", "tooltip", "type", "UNSAFE_size"];
|
|
15
15
|
/**
|
|
16
16
|
* __Icon Button__
|
|
17
17
|
*
|
|
@@ -23,6 +23,7 @@ var _excluded = ["aria-label", "analyticsContext", "appearance", "autoFocus", "i
|
|
|
23
23
|
*/
|
|
24
24
|
var IconButton = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef(function Button(_ref, ref) {
|
|
25
25
|
var preventedAriaLabel = _ref['aria-label'],
|
|
26
|
+
ariaLabelledBy = _ref['aria-labelledby'],
|
|
26
27
|
analyticsContext = _ref.analyticsContext,
|
|
27
28
|
appearance = _ref.appearance,
|
|
28
29
|
autoFocus = _ref.autoFocus,
|
|
@@ -60,6 +61,7 @@ var IconButton = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.f
|
|
|
60
61
|
var baseProps = (0, _useIconButton.default)({
|
|
61
62
|
analyticsContext: analyticsContext,
|
|
62
63
|
appearance: appearance,
|
|
64
|
+
ariaLabelledBy: ariaLabelledBy,
|
|
63
65
|
autoFocus: autoFocus,
|
|
64
66
|
buttonType: 'button',
|
|
65
67
|
icon: icon,
|
|
@@ -82,6 +84,7 @@ var IconButton = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.f
|
|
|
82
84
|
ref: ref,
|
|
83
85
|
shape: shape,
|
|
84
86
|
spacing: spacing,
|
|
87
|
+
testId: testId,
|
|
85
88
|
UNSAFE_size: UNSAFE_size
|
|
86
89
|
});
|
|
87
90
|
if (!isTooltipDisabled) {
|
|
@@ -105,6 +108,7 @@ var IconButton = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.f
|
|
|
105
108
|
return /*#__PURE__*/_react.default.createElement(_pressable.default
|
|
106
109
|
// Top level props
|
|
107
110
|
, (0, _extends2.default)({}, rest, {
|
|
111
|
+
"aria-labelledby": baseProps['aria-labelledby'],
|
|
108
112
|
type: type,
|
|
109
113
|
testId: testId,
|
|
110
114
|
componentName: "IconButton",
|
|
@@ -171,6 +175,7 @@ var IconButton = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.f
|
|
|
171
175
|
});
|
|
172
176
|
}
|
|
173
177
|
return /*#__PURE__*/_react.default.createElement(_pressable.default, (0, _extends2.default)({}, rest, {
|
|
178
|
+
"aria-labelledby": baseProps['aria-labelledby'],
|
|
174
179
|
ref: baseProps.ref,
|
|
175
180
|
xcss: baseProps.xcss,
|
|
176
181
|
isDisabled: baseProps.isDisabled,
|
|
@@ -12,11 +12,12 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _anchor = _interopRequireDefault(require("@atlaskit/primitives/anchor"));
|
|
13
13
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
14
14
|
var _useIconButton = _interopRequireDefault(require("./use-icon-button"));
|
|
15
|
-
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"];
|
|
15
|
+
var _excluded = ["aria-label", "aria-labelledby", "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"];
|
|
16
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
18
|
var LinkIconButtonBase = function LinkIconButtonBase(_ref, ref) {
|
|
19
19
|
var preventedAriaLabel = _ref['aria-label'],
|
|
20
|
+
ariaLabelledBy = _ref['aria-labelledby'],
|
|
20
21
|
analyticsContext = _ref.analyticsContext,
|
|
21
22
|
appearance = _ref.appearance,
|
|
22
23
|
autoFocus = _ref.autoFocus,
|
|
@@ -48,6 +49,7 @@ var LinkIconButtonBase = function LinkIconButtonBase(_ref, ref) {
|
|
|
48
49
|
var baseProps = (0, _useIconButton.default)({
|
|
49
50
|
analyticsContext: analyticsContext,
|
|
50
51
|
appearance: appearance,
|
|
52
|
+
ariaLabelledBy: ariaLabelledBy,
|
|
51
53
|
autoFocus: autoFocus,
|
|
52
54
|
buttonType: 'link',
|
|
53
55
|
icon: icon,
|
|
@@ -69,6 +71,7 @@ var LinkIconButtonBase = function LinkIconButtonBase(_ref, ref) {
|
|
|
69
71
|
ref: ref,
|
|
70
72
|
shape: shape,
|
|
71
73
|
spacing: spacing,
|
|
74
|
+
testId: testId,
|
|
72
75
|
UNSAFE_size: UNSAFE_size
|
|
73
76
|
});
|
|
74
77
|
if (!isTooltipDisabled) {
|
|
@@ -92,6 +95,7 @@ var LinkIconButtonBase = function LinkIconButtonBase(_ref, ref) {
|
|
|
92
95
|
return /*#__PURE__*/_react.default.createElement(_anchor.default
|
|
93
96
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
94
97
|
, (0, _extends2.default)({}, rest, {
|
|
98
|
+
"aria-labelledby": baseProps['aria-labelledby'],
|
|
95
99
|
testId: testId,
|
|
96
100
|
componentName: "LinkIconButton",
|
|
97
101
|
analyticsContext: analyticsContext,
|
|
@@ -167,6 +171,7 @@ var LinkIconButtonBase = function LinkIconButtonBase(_ref, ref) {
|
|
|
167
171
|
return /*#__PURE__*/_react.default.createElement(_anchor.default
|
|
168
172
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
169
173
|
, (0, _extends2.default)({}, rest, {
|
|
174
|
+
"aria-labelledby": baseProps['aria-labelledby'],
|
|
170
175
|
ref: baseProps.ref,
|
|
171
176
|
xcss: baseProps.xcss,
|
|
172
177
|
onClick: baseProps.onClick,
|
|
@@ -22,6 +22,8 @@ var _useButtonBase = _interopRequireDefault(require("../shared/use-button-base")
|
|
|
22
22
|
var useIconButton = function useIconButton(_ref) {
|
|
23
23
|
var analyticsContext = _ref.analyticsContext,
|
|
24
24
|
appearance = _ref.appearance,
|
|
25
|
+
ariaLabel = _ref.ariaLabel,
|
|
26
|
+
ariaLabelledBy = _ref.ariaLabelledBy,
|
|
25
27
|
autoFocus = _ref.autoFocus,
|
|
26
28
|
buttonType = _ref.buttonType,
|
|
27
29
|
Icon = _ref.icon,
|
|
@@ -45,6 +47,7 @@ var useIconButton = function useIconButton(_ref) {
|
|
|
45
47
|
shape = _ref.shape,
|
|
46
48
|
shouldFitContainer = _ref.shouldFitContainer,
|
|
47
49
|
spacing = _ref.spacing,
|
|
50
|
+
testId = _ref.testId,
|
|
48
51
|
UNSAFE_size = _ref.UNSAFE_size;
|
|
49
52
|
var hasOverlay = Boolean(overlay || isLoading);
|
|
50
53
|
var isCircle = shape === 'circle';
|
|
@@ -52,6 +55,8 @@ var useIconButton = function useIconButton(_ref) {
|
|
|
52
55
|
analyticsContext: analyticsContext,
|
|
53
56
|
appearance: appearance,
|
|
54
57
|
autoFocus: autoFocus,
|
|
58
|
+
ariaLabel: ariaLabel,
|
|
59
|
+
ariaLabelledBy: ariaLabelledBy,
|
|
55
60
|
buttonType: buttonType,
|
|
56
61
|
children: /*#__PURE__*/_react.default.createElement(_content.default, {
|
|
57
62
|
type: "icon",
|
|
@@ -81,7 +86,8 @@ var useIconButton = function useIconButton(_ref) {
|
|
|
81
86
|
spacing: spacing,
|
|
82
87
|
appearance: appearance,
|
|
83
88
|
isDisabled: isDisabled,
|
|
84
|
-
isSelected: isSelected
|
|
89
|
+
isSelected: isSelected,
|
|
90
|
+
testId: testId
|
|
85
91
|
}) : overlay,
|
|
86
92
|
ref: ref,
|
|
87
93
|
shouldFitContainer: shouldFitContainer,
|
|
@@ -33,14 +33,15 @@ function renderLoadingOverlay(_ref2) {
|
|
|
33
33
|
var appearance = _ref2.appearance,
|
|
34
34
|
spacing = _ref2.spacing,
|
|
35
35
|
isDisabled = _ref2.isDisabled,
|
|
36
|
-
isSelected = _ref2.isSelected
|
|
36
|
+
isSelected = _ref2.isSelected,
|
|
37
|
+
testId = _ref2.testId;
|
|
37
38
|
return /*#__PURE__*/_react.default.createElement(_spinner.default, {
|
|
38
|
-
label: ", Loading",
|
|
39
39
|
size: getIconSpacing(spacing),
|
|
40
40
|
appearance: getSpinnerAppearance({
|
|
41
41
|
appearance: appearance,
|
|
42
42
|
isDisabled: isDisabled,
|
|
43
43
|
isSelected: isSelected
|
|
44
|
-
})
|
|
44
|
+
}),
|
|
45
|
+
testId: testId ? "".concat(testId, "--loading-spinner") : undefined
|
|
45
46
|
});
|
|
46
47
|
}
|
|
@@ -8,14 +8,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _reactUid = require("react-uid");
|
|
11
12
|
var _mergeRefs = _interopRequireDefault(require("@atlaskit/ds-lib/merge-refs"));
|
|
12
13
|
var _useAutoFocus = _interopRequireDefault(require("@atlaskit/ds-lib/use-auto-focus"));
|
|
13
14
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
15
|
var _primitives = require("@atlaskit/primitives");
|
|
15
16
|
var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
|
|
16
17
|
var _constants = require("@atlaskit/theme/constants");
|
|
18
|
+
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
|
|
17
19
|
var _splitButtonContext = require("../../containers/split-button/split-button-context");
|
|
18
20
|
var _blockEvents = _interopRequireDefault(require("./block-events"));
|
|
21
|
+
var _constants2 = require("./constants");
|
|
19
22
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
23
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
24
|
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; }
|
|
@@ -30,10 +33,12 @@ var buttonStyles = (0, _primitives.xcss)({
|
|
|
30
33
|
alignItems: 'baseline',
|
|
31
34
|
justifyContent: 'center',
|
|
32
35
|
columnGap: 'space.050',
|
|
36
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
33
37
|
background: "var(--ds-background-neutral, ".concat(colors.N20A, ")"),
|
|
34
38
|
borderRadius: 'border.radius.100',
|
|
35
39
|
borderWidth: 'border.width.0',
|
|
36
40
|
// @ts-expect-error
|
|
41
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
37
42
|
color: "var(--ds-text, ".concat(colors.N500, ")"),
|
|
38
43
|
flexShrink: 0,
|
|
39
44
|
height: "".concat(32 / fontSize, "em"),
|
|
@@ -44,6 +49,7 @@ var buttonStyles = (0, _primitives.xcss)({
|
|
|
44
49
|
verticalAlign: 'middle',
|
|
45
50
|
':visited': {
|
|
46
51
|
// @ts-expect-error
|
|
52
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
47
53
|
color: "var(--ds-text, ".concat(colors.N500, ")")
|
|
48
54
|
}
|
|
49
55
|
});
|
|
@@ -64,12 +70,15 @@ var defaultInteractiveStyles = (0, _primitives.xcss)({
|
|
|
64
70
|
':hover': {
|
|
65
71
|
background: "var(--ds-background-neutral-hovered, #091e4214)",
|
|
66
72
|
// @ts-expect-error
|
|
73
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
67
74
|
color: "var(--ds-text, ".concat(colors.N500, ")"),
|
|
68
75
|
transitionDuration: '0s, 0.15s'
|
|
69
76
|
},
|
|
70
77
|
':active': {
|
|
78
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
71
79
|
background: "var(--ds-background-neutral-pressed, ".concat(colors.B75, ")"),
|
|
72
80
|
// @ts-expect-error
|
|
81
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
73
82
|
color: "var(--ds-text, ".concat(colors.B400, ")"),
|
|
74
83
|
transitionDuration: '0s, 0s'
|
|
75
84
|
}
|
|
@@ -173,11 +182,13 @@ var subtleInteractiveStyles = (0, _primitives.xcss)({
|
|
|
173
182
|
});
|
|
174
183
|
var linkStyles = (0, _primitives.xcss)({
|
|
175
184
|
// @ts-expect-error
|
|
185
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
176
186
|
color: "var(--ds-link, ".concat(colors.B400, ")"),
|
|
177
187
|
background: "var(--ds-background-neutral-subtle, transparent)",
|
|
178
188
|
textDecoration: 'none',
|
|
179
189
|
':hover': {
|
|
180
190
|
// @ts-expect-error
|
|
191
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
181
192
|
color: "var(--ds-link, ".concat(colors.B300, ")"),
|
|
182
193
|
background: "var(--ds-background-neutral-subtle, transparent)"
|
|
183
194
|
},
|
|
@@ -188,26 +199,31 @@ var linkStyles = (0, _primitives.xcss)({
|
|
|
188
199
|
},
|
|
189
200
|
':visited': {
|
|
190
201
|
// @ts-expect-error
|
|
202
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
191
203
|
color: "var(--ds-link, ".concat(colors.B400, ")")
|
|
192
204
|
}
|
|
193
205
|
});
|
|
194
206
|
var subtleLinkStyles = (0, _primitives.xcss)({
|
|
195
207
|
// @ts-expect-error
|
|
208
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
196
209
|
color: "var(--ds-text-subtle, ".concat(colors.N200, ")"),
|
|
197
210
|
background: "var(--ds-background-neutral-subtle, transparent)",
|
|
198
211
|
textDecoration: 'none',
|
|
199
212
|
':hover': {
|
|
200
213
|
// @ts-expect-error
|
|
214
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
201
215
|
color: "var(--ds-text-subtle, ".concat(colors.N90, ")"),
|
|
202
216
|
background: "var(--ds-background-neutral-subtle, transparent)"
|
|
203
217
|
},
|
|
204
218
|
':active': {
|
|
205
219
|
// @ts-expect-error
|
|
220
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
206
221
|
color: "var(--ds-text, ".concat(colors.N400, ")"),
|
|
207
222
|
background: "var(--ds-background-neutral-subtle, transparent)"
|
|
208
223
|
},
|
|
209
224
|
':visited': {
|
|
210
225
|
// @ts-expect-error
|
|
226
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
211
227
|
color: "var(--ds-text-subtle, ".concat(colors.N200, ")")
|
|
212
228
|
}
|
|
213
229
|
});
|
|
@@ -234,72 +250,94 @@ var linkDecorationStyles = (0, _primitives.xcss)({
|
|
|
234
250
|
}
|
|
235
251
|
});
|
|
236
252
|
var disabledStyles = (0, _primitives.xcss)({
|
|
253
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
237
254
|
background: "var(--ds-background-disabled, ".concat(colors.N20A, ")"),
|
|
238
255
|
// @ts-expect-error
|
|
239
256
|
color: "var(--ds-text-disabled, #091E424F)",
|
|
240
257
|
':hover': {
|
|
258
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
241
259
|
background: "var(--ds-background-disabled, ".concat(colors.N20A, ")"),
|
|
242
260
|
// @ts-expect-error
|
|
243
261
|
color: "var(--ds-text-disabled, #091E424F)"
|
|
244
262
|
},
|
|
245
263
|
':active': {
|
|
264
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
246
265
|
background: "var(--ds-background-disabled, ".concat(colors.N20A, ")"),
|
|
247
266
|
// @ts-expect-error
|
|
248
267
|
color: "var(--ds-text-disabled, #091E424F)"
|
|
249
268
|
}
|
|
250
269
|
});
|
|
251
270
|
var selectedStyles = (0, _primitives.xcss)({
|
|
271
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
252
272
|
background: "var(--ds-background-selected, ".concat(colors.N700, ")"),
|
|
253
273
|
// @ts-expect-error
|
|
274
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
254
275
|
color: "var(--ds-text-selected, ".concat(colors.N20, ")"),
|
|
255
276
|
':visited': {
|
|
256
277
|
// @ts-expect-error
|
|
278
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
257
279
|
color: "var(--ds-text-selected, ".concat(colors.N20, ")")
|
|
258
280
|
}
|
|
259
281
|
});
|
|
260
282
|
var selectedInteractiveStyles = (0, _primitives.xcss)({
|
|
261
283
|
':hover': {
|
|
262
284
|
// @ts-expect-error
|
|
285
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
263
286
|
color: "var(--ds-text-selected, ".concat(colors.N20, ")"),
|
|
287
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
264
288
|
background: "var(--ds-background-selected-hovered, ".concat(colors.N700, ")")
|
|
265
289
|
},
|
|
266
290
|
':active': {
|
|
267
291
|
// @ts-expect-error
|
|
292
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
268
293
|
color: "var(--ds-text-selected, ".concat(colors.N20, ")"),
|
|
294
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
269
295
|
background: "var(--ds-background-selected-pressed, ".concat(colors.N700, ")")
|
|
270
296
|
}
|
|
271
297
|
});
|
|
272
298
|
|
|
273
299
|
// TODO: Remove me once we kill color fallbacks
|
|
274
300
|
var selectedWarningStyles = (0, _primitives.xcss)({
|
|
301
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
275
302
|
background: "var(--ds-background-selected, ".concat(colors.Y400, ")"),
|
|
276
303
|
// @ts-expect-error
|
|
304
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
277
305
|
color: "var(--ds-text-selected, ".concat(colors.N800, ")"),
|
|
278
306
|
':hover': {
|
|
279
307
|
// @ts-expect-error
|
|
308
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
280
309
|
color: "var(--ds-text-selected, ".concat(colors.N20, ")"),
|
|
310
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
281
311
|
background: "var(--ds-background-selected, ".concat(colors.Y400, ")")
|
|
282
312
|
},
|
|
283
313
|
':active': {
|
|
284
314
|
// @ts-expect-error
|
|
315
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
285
316
|
color: "var(--ds-text-selected, ".concat(colors.N20, ")"),
|
|
317
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
286
318
|
background: "var(--ds-background-selected, ".concat(colors.Y400, ")")
|
|
287
319
|
}
|
|
288
320
|
});
|
|
289
321
|
|
|
290
322
|
// TODO: Remove me once we kill color fallbacks
|
|
291
323
|
var selectedDangerStyles = (0, _primitives.xcss)({
|
|
324
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
292
325
|
background: "var(--ds-background-selected, ".concat(colors.R500, ")"),
|
|
293
326
|
// @ts-expect-error
|
|
327
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
294
328
|
color: "var(--ds-text-selected, ".concat(colors.N20, ")"),
|
|
295
329
|
':hover': {
|
|
296
330
|
// @ts-expect-error
|
|
331
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
297
332
|
color: "var(--ds-text-selected, ".concat(colors.N20, ")"),
|
|
333
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
298
334
|
background: "var(--ds-background-selected, ".concat(colors.R500, ")")
|
|
299
335
|
},
|
|
300
336
|
':active': {
|
|
301
337
|
// @ts-expect-error
|
|
338
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
302
339
|
color: "var(--ds-text-selected, ".concat(colors.N20, ")"),
|
|
340
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
303
341
|
background: "var(--ds-background-selected, ".concat(colors.R500, ")")
|
|
304
342
|
}
|
|
305
343
|
});
|
|
@@ -308,14 +346,17 @@ var selectedDangerStyles = (0, _primitives.xcss)({
|
|
|
308
346
|
var selectedDiscoveryStyles = (0, _primitives.xcss)({
|
|
309
347
|
background: "var(--ds-background-selected, #403294)",
|
|
310
348
|
// @ts-expect-error
|
|
349
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
311
350
|
color: "var(--ds-text-selected, ".concat(colors.N20, ")"),
|
|
312
351
|
':hover': {
|
|
313
352
|
// @ts-expect-error
|
|
353
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
314
354
|
color: "var(--ds-text-selected, ".concat(colors.N20, ")"),
|
|
315
355
|
background: "var(--ds-background-selected, #403294)"
|
|
316
356
|
},
|
|
317
357
|
':active': {
|
|
318
358
|
// @ts-expect-error
|
|
359
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
319
360
|
color: "var(--ds-text-selected, ".concat(colors.N20, ")"),
|
|
320
361
|
background: "var(--ds-background-selected, #403294)"
|
|
321
362
|
}
|
|
@@ -442,9 +483,16 @@ var useButtonBase = function useButtonBase(_ref) {
|
|
|
442
483
|
_ref$shouldFitContain = _ref.shouldFitContainer,
|
|
443
484
|
shouldFitContainer = _ref$shouldFitContain === void 0 ? false : _ref$shouldFitContain,
|
|
444
485
|
_ref$spacing = _ref.spacing,
|
|
445
|
-
propSpacing = _ref$spacing === void 0 ? 'default' : _ref$spacing
|
|
486
|
+
propSpacing = _ref$spacing === void 0 ? 'default' : _ref$spacing,
|
|
487
|
+
ariaLabel = _ref.ariaLabel,
|
|
488
|
+
ariaLabelledBy = _ref.ariaLabelledBy;
|
|
446
489
|
var localRef = (0, _react.useRef)(null);
|
|
447
490
|
var splitButtonContext = (0, _splitButtonContext.useSplitButtonContext)();
|
|
491
|
+
// TODO: Use React 18's useId() hook when we update.
|
|
492
|
+
// eslint-disable-next-line @repo/internal/react/disallow-unstable-values
|
|
493
|
+
var loadingLabelId = (0, _reactUid.uid)({
|
|
494
|
+
ariaLabelledBy: ariaLabelledBy
|
|
495
|
+
});
|
|
448
496
|
var isSplitButton = Boolean(splitButtonContext);
|
|
449
497
|
var isNavigationSplitButton = (splitButtonContext === null || splitButtonContext === void 0 ? void 0 : splitButtonContext.isNavigationSplitButton) || false;
|
|
450
498
|
var appearance = (splitButtonContext === null || splitButtonContext === void 0 ? void 0 : splitButtonContext.appearance) || propAppearance;
|
|
@@ -468,7 +516,11 @@ var useButtonBase = function useButtonBase(_ref) {
|
|
|
468
516
|
children: /*#__PURE__*/_react.default.createElement(_react.Fragment, null, children, overlay ? /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
469
517
|
as: "span",
|
|
470
518
|
xcss: overlayStyles
|
|
471
|
-
}, overlay) : null)
|
|
519
|
+
}, overlay) : null, isLoading && (children && !ariaLabel && !ariaLabelledBy || ariaLabelledBy) && /*#__PURE__*/_react.default.createElement(_visuallyHidden.default, {
|
|
520
|
+
id: loadingLabelId
|
|
521
|
+
}, ", Loading")),
|
|
522
|
+
'aria-label': isLoading && ariaLabel && !ariaLabelledBy ? "".concat(ariaLabel, " ").concat(_constants2.LOADING_LABEL) : ariaLabel,
|
|
523
|
+
'aria-labelledby': isLoading && ariaLabelledBy ? "".concat(ariaLabelledBy, " ").concat(loadingLabelId) : ariaLabelledBy
|
|
472
524
|
}, (0, _blockEvents.default)(isEffectivelyDisabled, {
|
|
473
525
|
onClick: onClick,
|
|
474
526
|
onMouseDownCapture: onMouseDownCapture,
|
|
@@ -15,7 +15,7 @@ var _components = require("@atlaskit/theme/components");
|
|
|
15
15
|
var _buttonBase = _interopRequireDefault(require("./shared/button-base"));
|
|
16
16
|
var _css = require("./shared/css");
|
|
17
17
|
var _getIsOnlySingleIcon = _interopRequireDefault(require("./shared/get-is-only-single-icon"));
|
|
18
|
-
var _excluded = ["appearance", "children", "iconBefore", "iconAfter", "isSelected", "onMouseDown", "onMouseUp", "shouldFitContainer", "spacing"];
|
|
18
|
+
var _excluded = ["appearance", "children", "iconBefore", "iconAfter", "isSelected", "onMouseDown", "onMouseUp", "shouldFitContainer", "spacing"]; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
19
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
20
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
21
|
var isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
|
@@ -16,7 +16,7 @@ var _buttonBase = _interopRequireDefault(require("../shared/button-base"));
|
|
|
16
16
|
var _getIsOnlySingleIcon = _interopRequireDefault(require("../shared/get-is-only-single-icon"));
|
|
17
17
|
var _loadingSpinner = _interopRequireDefault(require("../shared/loading-spinner"));
|
|
18
18
|
var _theme = _interopRequireWildcard(require("./theme"));
|
|
19
|
-
var _excluded = ["appearance", "autoFocus", "isDisabled", "isSelected", "shouldFitContainer", "spacing", "isLoading", "onMouseEnter", "onMouseLeave", "onMouseDown", "onMouseUp", "onFocus", "onBlur", "theme"];
|
|
19
|
+
var _excluded = ["appearance", "autoFocus", "isDisabled", "isSelected", "shouldFitContainer", "spacing", "isLoading", "onMouseEnter", "onMouseLeave", "onMouseDown", "onMouseUp", "onFocus", "onBlur", "theme"]; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
20
20
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
21
21
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
22
22
|
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; }
|
|
@@ -12,7 +12,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
12
12
|
var _components = require("@atlaskit/theme/components");
|
|
13
13
|
var _css = require("../shared/css");
|
|
14
14
|
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; }
|
|
15
|
-
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) { (0, _defineProperty2.default)(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; }
|
|
15
|
+
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) { (0, _defineProperty2.default)(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; } // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
16
16
|
var stateToSelectorMap = {
|
|
17
17
|
focus: '&:focus',
|
|
18
18
|
focusSelected: '&:focus',
|
|
@@ -22,6 +22,7 @@ var _getIfVisuallyHiddenChildren = require("./get-if-visually-hidden-children");
|
|
|
22
22
|
var _excluded = ["analyticsContext", "appearance", "autoFocus", "buttonCss", "children", "className", "href", "component", "iconAfter", "iconBefore", "interactionName", "isDisabled", "isSelected", "onBlur", "onClick", "onFocus", "onMouseDown", "overlay", "shouldFitContainer", "spacing", "tabIndex", "type", "testId"];
|
|
23
23
|
/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
|
|
24
24
|
/** @jsx jsx */
|
|
25
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
25
26
|
// eslint-disable-next-line no-duplicate-imports
|
|
26
27
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
27
28
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -129,7 +130,7 @@ var _default = exports.default = /*#__PURE__*/_react.default.forwardRef(function
|
|
|
129
130
|
action: 'clicked',
|
|
130
131
|
componentName: 'button',
|
|
131
132
|
packageName: "@atlaskit/button",
|
|
132
|
-
packageVersion: "17.
|
|
133
|
+
packageVersion: "17.18.0",
|
|
133
134
|
analyticsData: analyticsContext
|
|
134
135
|
});
|
|
135
136
|
|
|
@@ -149,6 +150,7 @@ var _default = exports.default = /*#__PURE__*/_react.default.forwardRef(function
|
|
|
149
150
|
|
|
150
151
|
// we are 'disabling' input with a button when there is an overlay
|
|
151
152
|
var hasOverlay = Boolean(overlay);
|
|
153
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
152
154
|
var fadeStyles = (0, _react2.css)((0, _css.getFadingCss)({
|
|
153
155
|
hasOverlay: hasOverlay
|
|
154
156
|
}));
|
|
@@ -192,13 +194,17 @@ var _default = exports.default = /*#__PURE__*/_react.default.forwardRef(function
|
|
|
192
194
|
}, (0, _blockEvents.default)({
|
|
193
195
|
isInteractive: isInteractive
|
|
194
196
|
})), iconBefore ? (0, _react2.jsx)("span", {
|
|
195
|
-
css: [fadeStyles,
|
|
197
|
+
css: [fadeStyles,
|
|
198
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
199
|
+
(0, _css.getIconStyle)({
|
|
196
200
|
spacing: spacing
|
|
197
201
|
}), getSpacingFix(children, iconBeforeSpacingFixStyle)]
|
|
198
202
|
}, iconBefore) : null, getChildren(children, [fadeStyles, (0, _css.getContentStyle)({
|
|
199
203
|
spacing: spacing
|
|
200
204
|
})]), iconAfter ? (0, _react2.jsx)("span", {
|
|
201
|
-
css: [fadeStyles,
|
|
205
|
+
css: [fadeStyles,
|
|
206
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
207
|
+
(0, _css.getIconStyle)({
|
|
202
208
|
spacing: spacing
|
|
203
209
|
}), getSpacingFix(children, iconAfterSpacingFixStyle)]
|
|
204
210
|
}, iconAfter) : null, overlay ? (0, _react2.jsx)("span", {
|
|
@@ -14,7 +14,7 @@ var _react = require("@emotion/react");
|
|
|
14
14
|
var _constants = require("@atlaskit/theme/constants");
|
|
15
15
|
var _colors = _interopRequireDefault(require("./colors"));
|
|
16
16
|
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; }
|
|
17
|
-
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) { (0, _defineProperty2.default)(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; }
|
|
17
|
+
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) { (0, _defineProperty2.default)(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; } // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
18
18
|
var gridSize = (0, _constants.gridSize)();
|
|
19
19
|
var fontSize = (0, _constants.fontSize)();
|
|
20
20
|
|
|
@@ -196,7 +196,7 @@ function getIconStyle(_ref4) {
|
|
|
196
196
|
return (0, _react.css)({
|
|
197
197
|
display: 'flex',
|
|
198
198
|
// icon size cannot grow and shrink
|
|
199
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
199
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
200
200
|
margin: spacing === 'none' ? 0 : innerMargin.icon,
|
|
201
201
|
flexGrow: 0,
|
|
202
202
|
flexShrink: 0,
|
|
@@ -211,7 +211,7 @@ function getIconStyle(_ref4) {
|
|
|
211
211
|
function getContentStyle(_ref5) {
|
|
212
212
|
var spacing = _ref5.spacing;
|
|
213
213
|
return (0, _react.css)({
|
|
214
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
214
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
215
215
|
margin: spacing === 'none' ? 0 : innerMargin.content,
|
|
216
216
|
// content can grow and shrink
|
|
217
217
|
flexGrow: 1,
|
|
@@ -225,6 +225,7 @@ function getContentStyle(_ref5) {
|
|
|
225
225
|
function getFadingCss(_ref6) {
|
|
226
226
|
var hasOverlay = _ref6.hasOverlay;
|
|
227
227
|
return (0, _react.css)({
|
|
228
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
228
229
|
opacity: hasOverlay ? 0 : 1,
|
|
229
230
|
transition: 'opacity 0.3s'
|
|
230
231
|
});
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React, { Fragment } from 'react';
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
5
|
import { css, jsx } from '@emotion/react';
|
|
4
6
|
const buttonGroupStyles = css({
|
|
5
7
|
display: 'inline-flex',
|
|
6
8
|
gap: "var(--ds-space-050, 4px)",
|
|
7
|
-
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
9
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
8
10
|
'> *': {
|
|
9
11
|
flex: '1 0 auto'
|
|
10
12
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
|
|
3
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
4
|
import { css, jsx } from '@emotion/react';
|
|
4
5
|
import { fontSize as getFontSize } from '@atlaskit/theme/constants';
|
|
5
6
|
const fontSize = getFontSize();
|
|
@@ -17,9 +18,11 @@ const baseDividerStyles = css({
|
|
|
17
18
|
zIndex: 2
|
|
18
19
|
});
|
|
19
20
|
const defaultDividerStyles = css({
|
|
21
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
20
22
|
height: heights.default
|
|
21
23
|
});
|
|
22
24
|
const compactDividerStyles = css({
|
|
25
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
23
26
|
height: heights.compact
|
|
24
27
|
});
|
|
25
28
|
const dividerDisabledStyles = css({
|
|
@@ -69,14 +72,14 @@ const splitButtonStyles = css({
|
|
|
69
72
|
whiteSpace: 'nowrap'
|
|
70
73
|
});
|
|
71
74
|
const primaryButtonStyles = css({
|
|
72
|
-
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
75
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
73
76
|
'button,a': {
|
|
74
77
|
borderEndEndRadius: 0,
|
|
75
78
|
borderStartEndRadius: 0
|
|
76
79
|
}
|
|
77
80
|
});
|
|
78
81
|
const secondaryButtonStyles = css({
|
|
79
|
-
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
82
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
80
83
|
'button,a': {
|
|
81
84
|
borderEndStartRadius: 0,
|
|
82
85
|
borderStartStartRadius: 0
|