@atlaskit/button 17.16.0 → 17.17.1
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 +20 -3
- package/__perf__/utils/interaction-tasks.tsx +2 -2
- package/codemods/15.0.0-lite-mode.tsx +3 -3
- package/codemods/15.1.1-data-testid.tsx +3 -3
- package/codemods/__tests__/_framework.tsx +1 -1
- package/codemods/helpers/15.0.0-runner.tsx +3 -3
- package/codemods/helpers/helpers-generic.tsx +4 -3
- package/codemods/optimistic-15.0.0-lite-mode.tsx +11 -4
- package/dist/cjs/new-button/variants/default/link.js +3 -3
- package/dist/cjs/new-button/variants/icon/button.js +3 -3
- package/dist/cjs/new-button/variants/icon/link.js +3 -3
- package/dist/cjs/new-button/variants/shared/use-button-base.js +25 -9
- package/dist/cjs/old-button/button.js +5 -3
- package/dist/cjs/old-button/loading-button.js +2 -0
- package/dist/cjs/old-button/shared/button-base.js +1 -1
- package/dist/es2019/new-button/variants/default/link.js +3 -3
- package/dist/es2019/new-button/variants/icon/button.js +3 -3
- package/dist/es2019/new-button/variants/icon/link.js +3 -3
- package/dist/es2019/new-button/variants/shared/use-button-base.js +25 -9
- package/dist/es2019/old-button/button.js +5 -3
- package/dist/es2019/old-button/loading-button.js +2 -0
- package/dist/es2019/old-button/shared/button-base.js +1 -1
- package/dist/esm/new-button/variants/default/link.js +3 -3
- package/dist/esm/new-button/variants/icon/button.js +3 -3
- package/dist/esm/new-button/variants/icon/link.js +3 -3
- package/dist/esm/new-button/variants/shared/use-button-base.js +25 -9
- package/dist/esm/old-button/button.js +5 -3
- package/dist/esm/old-button/loading-button.js +2 -0
- package/dist/esm/old-button/shared/button-base.js +1 -1
- package/dist/types/containers/button-group.d.ts +1 -1
- package/dist/types/new-button/containers/split-button/split-button-context.d.ts +1 -1
- package/dist/types/new-button/variants/default/link.d.ts +3 -3
- package/dist/types/new-button/variants/icon/button.d.ts +3 -3
- package/dist/types/new-button/variants/icon/link.d.ts +3 -3
- package/dist/types/new-button/variants/shared/loading-overlay.d.ts +1 -1
- package/dist/types/new-button/variants/types.d.ts +1 -1
- package/dist/types/old-button/button.d.ts +6 -4
- package/dist/types/old-button/custom-theme-button/custom-theme-button-types.d.ts +3 -3
- package/dist/types/old-button/custom-theme-button/theme.d.ts +2 -2
- package/dist/types/old-button/loading-button.d.ts +3 -1
- package/dist/types/old-button/shared/colors.d.ts +2 -2
- package/dist/types/old-button/shared/css.d.ts +3 -3
- package/dist/types/old-button/shared/get-is-only-single-icon.d.ts +1 -1
- package/dist/types/old-button/shared/loading-spinner.d.ts +1 -1
- package/dist/types/utils/variants.d.ts +1 -1
- package/dist/types-ts4.5/containers/button-group.d.ts +1 -1
- package/dist/types-ts4.5/new-button/containers/split-button/split-button-context.d.ts +1 -1
- package/dist/types-ts4.5/new-button/variants/default/link.d.ts +3 -3
- package/dist/types-ts4.5/new-button/variants/icon/button.d.ts +3 -3
- package/dist/types-ts4.5/new-button/variants/icon/link.d.ts +3 -3
- package/dist/types-ts4.5/new-button/variants/shared/loading-overlay.d.ts +1 -1
- package/dist/types-ts4.5/new-button/variants/types.d.ts +1 -1
- package/dist/types-ts4.5/old-button/button.d.ts +6 -4
- package/dist/types-ts4.5/old-button/custom-theme-button/custom-theme-button-types.d.ts +3 -3
- package/dist/types-ts4.5/old-button/custom-theme-button/theme.d.ts +2 -2
- package/dist/types-ts4.5/old-button/loading-button.d.ts +3 -1
- package/dist/types-ts4.5/old-button/shared/colors.d.ts +2 -2
- package/dist/types-ts4.5/old-button/shared/css.d.ts +3 -3
- package/dist/types-ts4.5/old-button/shared/get-is-only-single-icon.d.ts +1 -1
- package/dist/types-ts4.5/old-button/shared/loading-spinner.d.ts +1 -1
- package/dist/types-ts4.5/utils/variants.d.ts +1 -1
- package/extract-react-types/custom-theme-button-props.tsx +1 -1
- package/extract-react-types/legacy-button/custom-theme-button-props.tsx +1 -1
- 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/variants/default/button-props.tsx +1 -1
- package/extract-react-types/new-button/variants/icon-button/icon-button-props.tsx +1 -1
- package/extract-react-types/shared-props.tsx +1 -1
- package/package.json +64 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/button
|
|
2
2
|
|
|
3
|
+
## 17.17.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#103760](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/103760)
|
|
8
|
+
[`53958b31d2e7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/53958b31d2e7) -
|
|
9
|
+
Legacy buttons are now marked with intent to deprecate in favor of new buttons
|
|
10
|
+
|
|
11
|
+
## 17.17.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#102849](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/102849)
|
|
16
|
+
[`36d7498311be`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/36d7498311be) -
|
|
17
|
+
We are testing an internal change to typography behind a feature flag. If this change is
|
|
18
|
+
successful it will be available in a later release.
|
|
19
|
+
|
|
3
20
|
## 17.16.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
|
@@ -288,12 +305,12 @@ See new features for new exports and entrypoint ⤵
|
|
|
288
305
|
|
|
289
306
|
New Button goes open beta!
|
|
290
307
|
|
|
291
|
-
Check out the exports under `@atlaskit/button/new` and the
|
|
292
|
-
|
|
308
|
+
Check out the exports under `@atlaskit/button/new` and the [docs](/components/button/examples) for
|
|
309
|
+
our new approach.
|
|
293
310
|
|
|
294
311
|
##### Button
|
|
295
312
|
|
|
296
|
-
[Read the docs here.](/components/button/
|
|
313
|
+
[Read the docs here.](/components/button/examples)
|
|
297
314
|
|
|
298
315
|
```js
|
|
299
316
|
import Button from '@atlaskit/button/new';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fireEvent } from '@testing-library/react';
|
|
2
2
|
import {
|
|
3
|
-
InteractionTaskArgs,
|
|
4
|
-
PublicInteractionTask,
|
|
3
|
+
type InteractionTaskArgs,
|
|
4
|
+
type PublicInteractionTask,
|
|
5
5
|
} from 'storybook-addon-performance';
|
|
6
6
|
|
|
7
7
|
export const interactionTasks: PublicInteractionTask[] = [
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { API, FileInfo, Options } from 'jscodeshift';
|
|
2
|
-
import { Collection } from 'jscodeshift/src/Collection';
|
|
1
|
+
import { type API, type FileInfo, type Options } from 'jscodeshift';
|
|
2
|
+
import { type Collection } from 'jscodeshift/src/Collection';
|
|
3
3
|
|
|
4
4
|
import { changeType, transformButton } from './helpers/15.0.0-runner';
|
|
5
5
|
import {
|
|
6
6
|
getDefaultSpecifierName,
|
|
7
|
-
Nullable,
|
|
7
|
+
type Nullable,
|
|
8
8
|
shiftDefaultImport,
|
|
9
9
|
} from './helpers/helpers-generic';
|
|
10
10
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Collection } from 'jscodeshift/src/Collection';
|
|
1
|
+
import type { API, default as core, FileInfo, Options } from 'jscodeshift';
|
|
2
|
+
import { type Collection } from 'jscodeshift/src/Collection';
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
addCommentToStartOfFile,
|
|
6
6
|
getDefaultSpecifierName,
|
|
7
7
|
getJSXAttributesByName,
|
|
8
8
|
hasImportDeclaration,
|
|
9
|
-
Nullable,
|
|
9
|
+
type Nullable,
|
|
10
10
|
} from './helpers/helpers-generic';
|
|
11
11
|
const relevantEntryPoints = [
|
|
12
12
|
'@atlaskit/button',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { NodePath } from 'ast-types/lib/node-path';
|
|
2
|
-
import core,
|
|
3
|
-
import { Collection } from 'jscodeshift/src/Collection';
|
|
1
|
+
import { type NodePath } from 'ast-types/lib/node-path';
|
|
2
|
+
import type { default as core, FileInfo, JSXElement } from 'jscodeshift';
|
|
3
|
+
import { type Collection } from 'jscodeshift/src/Collection';
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
addToImport,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { NodePath } from 'ast-types/lib/node-path';
|
|
2
|
-
import
|
|
1
|
+
import { type NodePath } from 'ast-types/lib/node-path';
|
|
2
|
+
import type {
|
|
3
3
|
ASTPath,
|
|
4
|
+
default as core,
|
|
4
5
|
ImportDeclaration,
|
|
5
6
|
ImportDefaultSpecifier,
|
|
6
7
|
ImportSpecifier,
|
|
@@ -9,7 +10,7 @@ import core, {
|
|
|
9
10
|
Node,
|
|
10
11
|
Program,
|
|
11
12
|
} from 'jscodeshift';
|
|
12
|
-
import { Collection } from 'jscodeshift/src/Collection';
|
|
13
|
+
import { type Collection } from 'jscodeshift/src/Collection';
|
|
13
14
|
|
|
14
15
|
export type Nullable<T> = T | null;
|
|
15
16
|
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import { NodePath } from 'ast-types/lib/node-path';
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { type NodePath } from 'ast-types/lib/node-path';
|
|
2
|
+
import type {
|
|
3
|
+
API,
|
|
4
|
+
default as core,
|
|
5
|
+
FileInfo,
|
|
6
|
+
JSXElement,
|
|
7
|
+
Node,
|
|
8
|
+
Options,
|
|
9
|
+
} from 'jscodeshift';
|
|
10
|
+
import { type Collection } from 'jscodeshift/src/Collection';
|
|
4
11
|
|
|
5
12
|
import { convertButtonType, transformButton } from './helpers/15.0.0-runner';
|
|
6
13
|
import {
|
|
@@ -13,7 +20,7 @@ import {
|
|
|
13
20
|
isOnlyUsingNameForJSX,
|
|
14
21
|
isUsingProp,
|
|
15
22
|
isUsingSupportedSpread,
|
|
16
|
-
Nullable,
|
|
23
|
+
type Nullable,
|
|
17
24
|
tryCreateImport,
|
|
18
25
|
} from './helpers/helpers-generic';
|
|
19
26
|
|
|
@@ -109,9 +109,9 @@ var WithRef = /*#__PURE__*/(0, _react.forwardRef)(LinkButtonBase);
|
|
|
109
109
|
*
|
|
110
110
|
* Renders a link in the style of a button.
|
|
111
111
|
*
|
|
112
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
113
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
114
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
112
|
+
* - [Examples](https://atlassian.design/components/link-button/examples)
|
|
113
|
+
* - [Code](https://atlassian.design/components/link-button/code)
|
|
114
|
+
* - [Usage](https://atlassian.design/components/link-button/usage)
|
|
115
115
|
*/
|
|
116
116
|
var LinkButton = /*#__PURE__*/(0, _react.memo)(WithRef);
|
|
117
117
|
var _default = exports.default = LinkButton;
|
|
@@ -17,9 +17,9 @@ var _excluded = ["aria-label", "analyticsContext", "appearance", "autoFocus", "i
|
|
|
17
17
|
*
|
|
18
18
|
* TODO: Description
|
|
19
19
|
*
|
|
20
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
21
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
22
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
20
|
+
* - [Examples](https://atlassian.design/components/icon-button/examples)
|
|
21
|
+
* - [Code](https://atlassian.design/components/icon-button/code)
|
|
22
|
+
* - [Usage](https://atlassian.design/components/icon-button/usage)
|
|
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'],
|
|
@@ -203,9 +203,9 @@ var WithRef = /*#__PURE__*/(0, _react.forwardRef)(LinkIconButtonBase);
|
|
|
203
203
|
*
|
|
204
204
|
* Renders a link in the style of an icon button.
|
|
205
205
|
*
|
|
206
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
207
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
208
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
206
|
+
* - [Examples](https://atlassian.design/components/link-icon-button/examples)
|
|
207
|
+
* - [Code](https://atlassian.design/components/link-icon-button/code)
|
|
208
|
+
* - [Usage](https://atlassian.design/components/link-icon-button/usage)
|
|
209
209
|
*/
|
|
210
210
|
var LinkIconButton = /*#__PURE__*/(0, _react.memo)(WithRef);
|
|
211
211
|
var _default = exports.default = LinkIconButton;
|
|
@@ -10,6 +10,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _mergeRefs = _interopRequireDefault(require("@atlaskit/ds-lib/merge-refs"));
|
|
12
12
|
var _useAutoFocus = _interopRequireDefault(require("@atlaskit/ds-lib/use-auto-focus"));
|
|
13
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
14
|
var _primitives = require("@atlaskit/primitives");
|
|
14
15
|
var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
|
|
15
16
|
var _constants = require("@atlaskit/theme/constants");
|
|
@@ -35,13 +36,7 @@ var buttonStyles = (0, _primitives.xcss)({
|
|
|
35
36
|
// @ts-expect-error
|
|
36
37
|
color: "var(--ds-text, ".concat(colors.N500, ")"),
|
|
37
38
|
flexShrink: 0,
|
|
38
|
-
fontFamily: 'inherit',
|
|
39
|
-
fontSize: 'inherit',
|
|
40
|
-
fontStyle: 'normal',
|
|
41
|
-
fontWeight: 500,
|
|
42
39
|
height: "".concat(32 / fontSize, "em"),
|
|
43
|
-
lineHeight: "".concat(32 / fontSize, "em"),
|
|
44
|
-
paddingBlock: 'space.0',
|
|
45
40
|
paddingInlineEnd: 'space.150',
|
|
46
41
|
paddingInlineStart: 'space.150',
|
|
47
42
|
textAlign: 'center',
|
|
@@ -52,6 +47,19 @@ var buttonStyles = (0, _primitives.xcss)({
|
|
|
52
47
|
color: "var(--ds-text, ".concat(colors.N500, ")")
|
|
53
48
|
}
|
|
54
49
|
});
|
|
50
|
+
var baseButtonStyles = (0, _primitives.xcss)({
|
|
51
|
+
fontFamily: 'inherit',
|
|
52
|
+
fontSize: 'inherit',
|
|
53
|
+
fontStyle: 'normal',
|
|
54
|
+
fontWeight: 500,
|
|
55
|
+
lineHeight: "".concat(32 / fontSize, "em"),
|
|
56
|
+
paddingBlock: 'space.0'
|
|
57
|
+
});
|
|
58
|
+
var tokenizedButtonStyles = (0, _primitives.xcss)({
|
|
59
|
+
font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
60
|
+
fontWeight: "var(--ds-font-weight-medium, 500)",
|
|
61
|
+
paddingBlock: 'space.075'
|
|
62
|
+
});
|
|
55
63
|
var defaultInteractiveStyles = (0, _primitives.xcss)({
|
|
56
64
|
':hover': {
|
|
57
65
|
background: "var(--ds-background-neutral-hovered, #091e4214)",
|
|
@@ -315,11 +323,16 @@ var selectedDiscoveryStyles = (0, _primitives.xcss)({
|
|
|
315
323
|
var spacingCompactStyles = (0, _primitives.xcss)({
|
|
316
324
|
columnGap: 'space.050',
|
|
317
325
|
height: "".concat(24 / fontSize, "em"),
|
|
318
|
-
lineHeight: "".concat(24 / fontSize, "em"),
|
|
319
326
|
paddingInlineEnd: 'space.150',
|
|
320
327
|
paddingInlineStart: 'space.150',
|
|
321
328
|
verticalAlign: 'middle'
|
|
322
329
|
});
|
|
330
|
+
var baseSpacingCompactStyles = (0, _primitives.xcss)({
|
|
331
|
+
lineHeight: "".concat(24 / fontSize, "em")
|
|
332
|
+
});
|
|
333
|
+
var tokenizedSpacingCompactStyles = (0, _primitives.xcss)({
|
|
334
|
+
paddingBlock: 'space.025'
|
|
335
|
+
});
|
|
323
336
|
var spacingNoneStyles = (0, _primitives.xcss)({
|
|
324
337
|
columnGap: 'space.0',
|
|
325
338
|
height: 'auto',
|
|
@@ -328,6 +341,9 @@ var spacingNoneStyles = (0, _primitives.xcss)({
|
|
|
328
341
|
paddingInlineStart: 'space.0',
|
|
329
342
|
verticalAlign: 'baseline'
|
|
330
343
|
});
|
|
344
|
+
var tokenizedSpacingNoneStyles = (0, _primitives.xcss)({
|
|
345
|
+
paddingBlock: 'space.0'
|
|
346
|
+
});
|
|
331
347
|
var circleStyles = (0, _primitives.xcss)({
|
|
332
348
|
borderRadius: 'border.radius.circle'
|
|
333
349
|
});
|
|
@@ -440,13 +456,13 @@ var useButtonBase = function useButtonBase(_ref) {
|
|
|
440
456
|
(0, _useAutoFocus.default)(localRef, autoFocus);
|
|
441
457
|
return _objectSpread({
|
|
442
458
|
ref: (0, _mergeRefs.default)([localRef, ref]),
|
|
443
|
-
xcss: [buttonStyles, appearance === 'default' && isInteractive && defaultInteractiveStyles, appearance === 'primary' && primaryStyles, appearance === 'primary' && isInteractive && primaryInteractiveStyles, appearance === 'warning' && warningStyles, appearance === 'warning' && isInteractive && warningInteractiveStyles, appearance === 'danger' && dangerStyles, appearance === 'danger' && isInteractive && dangerInteractiveStyles, appearance === 'discovery' && discoveryStyles, appearance === 'discovery' && isInteractive && discoveryInteractiveStyles, appearance === 'subtle' && subtleStyles, appearance === 'subtle' && isInteractive && subtleInteractiveStyles, appearance === 'link' && linkStyles, appearance === 'subtle-link' && subtleLinkStyles, !isSelected && (appearance === 'link' || appearance === 'subtle-link') ? linkDecorationStyles : linkDecorationUnsetStyles, isSelected && selectedStyles, isSelected && isInteractive && selectedInteractiveStyles,
|
|
459
|
+
xcss: [(0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.button-tokenised-typography-styles') ? tokenizedButtonStyles : baseButtonStyles, buttonStyles, appearance === 'default' && isInteractive && defaultInteractiveStyles, appearance === 'primary' && primaryStyles, appearance === 'primary' && isInteractive && primaryInteractiveStyles, appearance === 'warning' && warningStyles, appearance === 'warning' && isInteractive && warningInteractiveStyles, appearance === 'danger' && dangerStyles, appearance === 'danger' && isInteractive && dangerInteractiveStyles, appearance === 'discovery' && discoveryStyles, appearance === 'discovery' && isInteractive && discoveryInteractiveStyles, appearance === 'subtle' && subtleStyles, appearance === 'subtle' && isInteractive && subtleInteractiveStyles, appearance === 'link' && linkStyles, appearance === 'subtle-link' && subtleLinkStyles, !isSelected && (appearance === 'link' || appearance === 'subtle-link') ? linkDecorationStyles : linkDecorationUnsetStyles, isSelected && selectedStyles, isSelected && isInteractive && selectedInteractiveStyles,
|
|
444
460
|
// TODO: remove me once we kill color fallbacks
|
|
445
461
|
isSelected && appearance === 'danger' && selectedDangerStyles,
|
|
446
462
|
// TODO: remove me once we kill color fallbacks
|
|
447
463
|
isSelected && appearance === 'warning' && selectedWarningStyles,
|
|
448
464
|
// TODO: remove me once we kill color fallbacks
|
|
449
|
-
isSelected && appearance === 'discovery' && selectedDiscoveryStyles, isDisabled && disabledStyles, isCircle && !isSplitButton && circleStyles, spacing === 'compact' && spacingCompactStyles, spacing === 'none' && spacingNoneStyles, spacing !== 'none' && hasIconBefore && buttonIconBeforeStyles, spacing !== 'none' && hasIconAfter && buttonIconAfterStyles, isIconButton && iconButtonStyles, isIconButton && spacing === 'compact' && iconButtonCompactStyles, shouldFitContainer && fullWidthStyles, isLoading && loadingOverlayStyles, (isDisabled || hasOverlay && !isLoading) && nonInteractiveStyles, isSplitButton && splitButtonStyles, isNavigationSplitButton && navigationSplitButtonStyles],
|
|
465
|
+
isSelected && appearance === 'discovery' && selectedDiscoveryStyles, isDisabled && disabledStyles, isCircle && !isSplitButton && circleStyles, spacing === 'compact' && spacingCompactStyles, spacing === 'compact' && ((0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.button-tokenised-typography-styles') ? tokenizedSpacingCompactStyles : baseSpacingCompactStyles), spacing === 'none' && spacingNoneStyles, spacing === 'none' && (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.button-tokenised-typography-styles') && tokenizedSpacingNoneStyles, spacing !== 'none' && hasIconBefore && buttonIconBeforeStyles, spacing !== 'none' && hasIconAfter && buttonIconAfterStyles, isIconButton && iconButtonStyles, isIconButton && spacing === 'compact' && iconButtonCompactStyles, shouldFitContainer && fullWidthStyles, isLoading && loadingOverlayStyles, (isDisabled || hasOverlay && !isLoading) && nonInteractiveStyles, isSplitButton && splitButtonStyles, isNavigationSplitButton && navigationSplitButtonStyles],
|
|
450
466
|
// Consider overlay buttons to be effectively disabled
|
|
451
467
|
isDisabled: isEffectivelyDisabled,
|
|
452
468
|
children: /*#__PURE__*/_react.default.createElement(_react.Fragment, null, children, overlay ? /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
@@ -22,11 +22,13 @@ var isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerC
|
|
|
22
22
|
/**
|
|
23
23
|
* __Button__
|
|
24
24
|
*
|
|
25
|
+
* CAUTION: Legacy buttons will soon be deprecated. Please use the new Button components from `@atlaskit/button/new`.
|
|
26
|
+
*
|
|
25
27
|
* A button triggers an event or action. They let users know what will happen next.
|
|
26
28
|
*
|
|
27
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
28
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
29
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
29
|
+
* - [Examples](https://atlassian.design/components/button/button-legacy/examples)
|
|
30
|
+
* - [Code](https://atlassian.design/components/button/button-legacy/code)
|
|
31
|
+
* - [Usage](https://atlassian.design/components/button/button-legacy/usage)
|
|
30
32
|
*/
|
|
31
33
|
var Button = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef(function Button(_ref, ref) {
|
|
32
34
|
var _ref$appearance = _ref.appearance,
|
|
@@ -14,6 +14,8 @@ var _excluded = ["appearance", "isDisabled", "isSelected", "isLoading", "spacing
|
|
|
14
14
|
/**
|
|
15
15
|
* __Loading button__
|
|
16
16
|
*
|
|
17
|
+
* CAUTION: Legacy loading buttons will soon be deprecated. Please use the new Button components from `@atlaskit/button/new` with the `isLoading` prop.
|
|
18
|
+
*
|
|
17
19
|
* A small wrapper around Button that allows you to show an @atlaskit/spinner as an overlay on the button when you set an isLoading prop to true.
|
|
18
20
|
*
|
|
19
21
|
* - [Examples](https://atlassian.design/components/button/examples#loading-button)
|
|
@@ -129,7 +129,7 @@ var _default = exports.default = /*#__PURE__*/_react.default.forwardRef(function
|
|
|
129
129
|
action: 'clicked',
|
|
130
130
|
componentName: 'button',
|
|
131
131
|
packageName: "@atlaskit/button",
|
|
132
|
-
packageVersion: "17.
|
|
132
|
+
packageVersion: "17.17.1",
|
|
133
133
|
analyticsData: analyticsContext
|
|
134
134
|
});
|
|
135
135
|
|
|
@@ -98,9 +98,9 @@ const WithRef = /*#__PURE__*/forwardRef(LinkButtonBase);
|
|
|
98
98
|
*
|
|
99
99
|
* Renders a link in the style of a button.
|
|
100
100
|
*
|
|
101
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
102
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
103
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
101
|
+
* - [Examples](https://atlassian.design/components/link-button/examples)
|
|
102
|
+
* - [Code](https://atlassian.design/components/link-button/code)
|
|
103
|
+
* - [Usage](https://atlassian.design/components/link-button/usage)
|
|
104
104
|
*/
|
|
105
105
|
const LinkButton = /*#__PURE__*/memo(WithRef);
|
|
106
106
|
export default LinkButton;
|
|
@@ -8,9 +8,9 @@ import useIconButton from './use-icon-button';
|
|
|
8
8
|
*
|
|
9
9
|
* TODO: Description
|
|
10
10
|
*
|
|
11
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
12
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
13
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
11
|
+
* - [Examples](https://atlassian.design/components/icon-button/examples)
|
|
12
|
+
* - [Code](https://atlassian.design/components/icon-button/code)
|
|
13
|
+
* - [Usage](https://atlassian.design/components/icon-button/usage)
|
|
14
14
|
*/
|
|
15
15
|
const IconButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function Button({
|
|
16
16
|
// Prevent duplicate labels being added.
|
|
@@ -190,9 +190,9 @@ const WithRef = /*#__PURE__*/forwardRef(LinkIconButtonBase);
|
|
|
190
190
|
*
|
|
191
191
|
* Renders a link in the style of an icon button.
|
|
192
192
|
*
|
|
193
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
194
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
195
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
193
|
+
* - [Examples](https://atlassian.design/components/link-icon-button/examples)
|
|
194
|
+
* - [Code](https://atlassian.design/components/link-icon-button/code)
|
|
195
|
+
* - [Usage](https://atlassian.design/components/link-icon-button/usage)
|
|
196
196
|
*/
|
|
197
197
|
const LinkIconButton = /*#__PURE__*/memo(WithRef);
|
|
198
198
|
export default LinkIconButton;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { Fragment, useRef } from 'react';
|
|
2
2
|
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
3
3
|
import useAutoFocus from '@atlaskit/ds-lib/use-auto-focus';
|
|
4
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
5
6
|
import * as colors from '@atlaskit/theme/colors';
|
|
6
7
|
import { fontSize as getFontSize } from '@atlaskit/theme/constants';
|
|
@@ -22,13 +23,7 @@ const buttonStyles = xcss({
|
|
|
22
23
|
// @ts-expect-error
|
|
23
24
|
color: `var(--ds-text, ${colors.N500})`,
|
|
24
25
|
flexShrink: 0,
|
|
25
|
-
fontFamily: 'inherit',
|
|
26
|
-
fontSize: 'inherit',
|
|
27
|
-
fontStyle: 'normal',
|
|
28
|
-
fontWeight: 500,
|
|
29
26
|
height: `${32 / fontSize}em`,
|
|
30
|
-
lineHeight: `${32 / fontSize}em`,
|
|
31
|
-
paddingBlock: 'space.0',
|
|
32
27
|
paddingInlineEnd: 'space.150',
|
|
33
28
|
paddingInlineStart: 'space.150',
|
|
34
29
|
textAlign: 'center',
|
|
@@ -39,6 +34,19 @@ const buttonStyles = xcss({
|
|
|
39
34
|
color: `var(--ds-text, ${colors.N500})`
|
|
40
35
|
}
|
|
41
36
|
});
|
|
37
|
+
const baseButtonStyles = xcss({
|
|
38
|
+
fontFamily: 'inherit',
|
|
39
|
+
fontSize: 'inherit',
|
|
40
|
+
fontStyle: 'normal',
|
|
41
|
+
fontWeight: 500,
|
|
42
|
+
lineHeight: `${32 / fontSize}em`,
|
|
43
|
+
paddingBlock: 'space.0'
|
|
44
|
+
});
|
|
45
|
+
const tokenizedButtonStyles = xcss({
|
|
46
|
+
font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
47
|
+
fontWeight: "var(--ds-font-weight-medium, 500)",
|
|
48
|
+
paddingBlock: 'space.075'
|
|
49
|
+
});
|
|
42
50
|
const defaultInteractiveStyles = xcss({
|
|
43
51
|
':hover': {
|
|
44
52
|
background: "var(--ds-background-neutral-hovered, #091e4214)",
|
|
@@ -302,11 +310,16 @@ const selectedDiscoveryStyles = xcss({
|
|
|
302
310
|
const spacingCompactStyles = xcss({
|
|
303
311
|
columnGap: 'space.050',
|
|
304
312
|
height: `${24 / fontSize}em`,
|
|
305
|
-
lineHeight: `${24 / fontSize}em`,
|
|
306
313
|
paddingInlineEnd: 'space.150',
|
|
307
314
|
paddingInlineStart: 'space.150',
|
|
308
315
|
verticalAlign: 'middle'
|
|
309
316
|
});
|
|
317
|
+
const baseSpacingCompactStyles = xcss({
|
|
318
|
+
lineHeight: `${24 / fontSize}em`
|
|
319
|
+
});
|
|
320
|
+
const tokenizedSpacingCompactStyles = xcss({
|
|
321
|
+
paddingBlock: 'space.025'
|
|
322
|
+
});
|
|
310
323
|
const spacingNoneStyles = xcss({
|
|
311
324
|
columnGap: 'space.0',
|
|
312
325
|
height: 'auto',
|
|
@@ -315,6 +328,9 @@ const spacingNoneStyles = xcss({
|
|
|
315
328
|
paddingInlineStart: 'space.0',
|
|
316
329
|
verticalAlign: 'baseline'
|
|
317
330
|
});
|
|
331
|
+
const tokenizedSpacingNoneStyles = xcss({
|
|
332
|
+
paddingBlock: 'space.0'
|
|
333
|
+
});
|
|
318
334
|
const circleStyles = xcss({
|
|
319
335
|
borderRadius: 'border.radius.circle'
|
|
320
336
|
});
|
|
@@ -419,13 +435,13 @@ const useButtonBase = ({
|
|
|
419
435
|
useAutoFocus(localRef, autoFocus);
|
|
420
436
|
return {
|
|
421
437
|
ref: mergeRefs([localRef, ref]),
|
|
422
|
-
xcss: [buttonStyles, appearance === 'default' && isInteractive && defaultInteractiveStyles, appearance === 'primary' && primaryStyles, appearance === 'primary' && isInteractive && primaryInteractiveStyles, appearance === 'warning' && warningStyles, appearance === 'warning' && isInteractive && warningInteractiveStyles, appearance === 'danger' && dangerStyles, appearance === 'danger' && isInteractive && dangerInteractiveStyles, appearance === 'discovery' && discoveryStyles, appearance === 'discovery' && isInteractive && discoveryInteractiveStyles, appearance === 'subtle' && subtleStyles, appearance === 'subtle' && isInteractive && subtleInteractiveStyles, appearance === 'link' && linkStyles, appearance === 'subtle-link' && subtleLinkStyles, !isSelected && (appearance === 'link' || appearance === 'subtle-link') ? linkDecorationStyles : linkDecorationUnsetStyles, isSelected && selectedStyles, isSelected && isInteractive && selectedInteractiveStyles,
|
|
438
|
+
xcss: [getBooleanFF('platform.design-system-team.button-tokenised-typography-styles') ? tokenizedButtonStyles : baseButtonStyles, buttonStyles, appearance === 'default' && isInteractive && defaultInteractiveStyles, appearance === 'primary' && primaryStyles, appearance === 'primary' && isInteractive && primaryInteractiveStyles, appearance === 'warning' && warningStyles, appearance === 'warning' && isInteractive && warningInteractiveStyles, appearance === 'danger' && dangerStyles, appearance === 'danger' && isInteractive && dangerInteractiveStyles, appearance === 'discovery' && discoveryStyles, appearance === 'discovery' && isInteractive && discoveryInteractiveStyles, appearance === 'subtle' && subtleStyles, appearance === 'subtle' && isInteractive && subtleInteractiveStyles, appearance === 'link' && linkStyles, appearance === 'subtle-link' && subtleLinkStyles, !isSelected && (appearance === 'link' || appearance === 'subtle-link') ? linkDecorationStyles : linkDecorationUnsetStyles, isSelected && selectedStyles, isSelected && isInteractive && selectedInteractiveStyles,
|
|
423
439
|
// TODO: remove me once we kill color fallbacks
|
|
424
440
|
isSelected && appearance === 'danger' && selectedDangerStyles,
|
|
425
441
|
// TODO: remove me once we kill color fallbacks
|
|
426
442
|
isSelected && appearance === 'warning' && selectedWarningStyles,
|
|
427
443
|
// TODO: remove me once we kill color fallbacks
|
|
428
|
-
isSelected && appearance === 'discovery' && selectedDiscoveryStyles, isDisabled && disabledStyles, isCircle && !isSplitButton && circleStyles, spacing === 'compact' && spacingCompactStyles, spacing === 'none' && spacingNoneStyles, spacing !== 'none' && hasIconBefore && buttonIconBeforeStyles, spacing !== 'none' && hasIconAfter && buttonIconAfterStyles, isIconButton && iconButtonStyles, isIconButton && spacing === 'compact' && iconButtonCompactStyles, shouldFitContainer && fullWidthStyles, isLoading && loadingOverlayStyles, (isDisabled || hasOverlay && !isLoading) && nonInteractiveStyles, isSplitButton && splitButtonStyles, isNavigationSplitButton && navigationSplitButtonStyles],
|
|
444
|
+
isSelected && appearance === 'discovery' && selectedDiscoveryStyles, isDisabled && disabledStyles, isCircle && !isSplitButton && circleStyles, spacing === 'compact' && spacingCompactStyles, spacing === 'compact' && (getBooleanFF('platform.design-system-team.button-tokenised-typography-styles') ? tokenizedSpacingCompactStyles : baseSpacingCompactStyles), spacing === 'none' && spacingNoneStyles, spacing === 'none' && getBooleanFF('platform.design-system-team.button-tokenised-typography-styles') && tokenizedSpacingNoneStyles, spacing !== 'none' && hasIconBefore && buttonIconBeforeStyles, spacing !== 'none' && hasIconAfter && buttonIconAfterStyles, isIconButton && iconButtonStyles, isIconButton && spacing === 'compact' && iconButtonCompactStyles, shouldFitContainer && fullWidthStyles, isLoading && loadingOverlayStyles, (isDisabled || hasOverlay && !isLoading) && nonInteractiveStyles, isSplitButton && splitButtonStyles, isNavigationSplitButton && navigationSplitButtonStyles],
|
|
429
445
|
// Consider overlay buttons to be effectively disabled
|
|
430
446
|
isDisabled: isEffectivelyDisabled,
|
|
431
447
|
children: /*#__PURE__*/React.createElement(Fragment, null, children, overlay ? /*#__PURE__*/React.createElement(Box, {
|
|
@@ -9,11 +9,13 @@ const isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowe
|
|
|
9
9
|
/**
|
|
10
10
|
* __Button__
|
|
11
11
|
*
|
|
12
|
+
* CAUTION: Legacy buttons will soon be deprecated. Please use the new Button components from `@atlaskit/button/new`.
|
|
13
|
+
*
|
|
12
14
|
* A button triggers an event or action. They let users know what will happen next.
|
|
13
15
|
*
|
|
14
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
15
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
16
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
16
|
+
* - [Examples](https://atlassian.design/components/button/button-legacy/examples)
|
|
17
|
+
* - [Code](https://atlassian.design/components/button/button-legacy/code)
|
|
18
|
+
* - [Usage](https://atlassian.design/components/button/button-legacy/usage)
|
|
17
19
|
*/
|
|
18
20
|
const Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function Button({
|
|
19
21
|
appearance = 'default',
|
|
@@ -5,6 +5,8 @@ import LoadingSpinner from './shared/loading-spinner';
|
|
|
5
5
|
/**
|
|
6
6
|
* __Loading button__
|
|
7
7
|
*
|
|
8
|
+
* CAUTION: Legacy loading buttons will soon be deprecated. Please use the new Button components from `@atlaskit/button/new` with the `isLoading` prop.
|
|
9
|
+
*
|
|
8
10
|
* A small wrapper around Button that allows you to show an @atlaskit/spinner as an overlay on the button when you set an isLoading prop to true.
|
|
9
11
|
*
|
|
10
12
|
* - [Examples](https://atlassian.design/components/button/examples#loading-button)
|
|
@@ -114,7 +114,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
114
114
|
action: 'clicked',
|
|
115
115
|
componentName: 'button',
|
|
116
116
|
packageName: "@atlaskit/button",
|
|
117
|
-
packageVersion: "17.
|
|
117
|
+
packageVersion: "17.17.1",
|
|
118
118
|
analyticsData: analyticsContext
|
|
119
119
|
});
|
|
120
120
|
|
|
@@ -99,9 +99,9 @@ var WithRef = /*#__PURE__*/forwardRef(LinkButtonBase);
|
|
|
99
99
|
*
|
|
100
100
|
* Renders a link in the style of a button.
|
|
101
101
|
*
|
|
102
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
103
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
104
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
102
|
+
* - [Examples](https://atlassian.design/components/link-button/examples)
|
|
103
|
+
* - [Code](https://atlassian.design/components/link-button/code)
|
|
104
|
+
* - [Usage](https://atlassian.design/components/link-button/usage)
|
|
105
105
|
*/
|
|
106
106
|
var LinkButton = /*#__PURE__*/memo(WithRef);
|
|
107
107
|
export default LinkButton;
|
|
@@ -10,9 +10,9 @@ import useIconButton from './use-icon-button';
|
|
|
10
10
|
*
|
|
11
11
|
* TODO: Description
|
|
12
12
|
*
|
|
13
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
14
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
15
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
13
|
+
* - [Examples](https://atlassian.design/components/icon-button/examples)
|
|
14
|
+
* - [Code](https://atlassian.design/components/icon-button/code)
|
|
15
|
+
* - [Usage](https://atlassian.design/components/icon-button/usage)
|
|
16
16
|
*/
|
|
17
17
|
var IconButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function Button(_ref, ref) {
|
|
18
18
|
var preventedAriaLabel = _ref['aria-label'],
|
|
@@ -193,9 +193,9 @@ var WithRef = /*#__PURE__*/forwardRef(LinkIconButtonBase);
|
|
|
193
193
|
*
|
|
194
194
|
* Renders a link in the style of an icon button.
|
|
195
195
|
*
|
|
196
|
-
* - [Examples](https://atlassian.design/components/button/examples)
|
|
197
|
-
* - [Code](https://atlassian.design/components/button/code)
|
|
198
|
-
* - [Usage](https://atlassian.design/components/button/usage)
|
|
196
|
+
* - [Examples](https://atlassian.design/components/link-icon-button/examples)
|
|
197
|
+
* - [Code](https://atlassian.design/components/link-icon-button/code)
|
|
198
|
+
* - [Usage](https://atlassian.design/components/link-icon-button/usage)
|
|
199
199
|
*/
|
|
200
200
|
var LinkIconButton = /*#__PURE__*/memo(WithRef);
|
|
201
201
|
export default LinkIconButton;
|
|
@@ -4,6 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import React, { Fragment, useRef } from 'react';
|
|
5
5
|
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
6
6
|
import useAutoFocus from '@atlaskit/ds-lib/use-auto-focus';
|
|
7
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
8
9
|
import * as colors from '@atlaskit/theme/colors';
|
|
9
10
|
import { fontSize as getFontSize } from '@atlaskit/theme/constants';
|
|
@@ -25,13 +26,7 @@ var buttonStyles = xcss({
|
|
|
25
26
|
// @ts-expect-error
|
|
26
27
|
color: "var(--ds-text, ".concat(colors.N500, ")"),
|
|
27
28
|
flexShrink: 0,
|
|
28
|
-
fontFamily: 'inherit',
|
|
29
|
-
fontSize: 'inherit',
|
|
30
|
-
fontStyle: 'normal',
|
|
31
|
-
fontWeight: 500,
|
|
32
29
|
height: "".concat(32 / fontSize, "em"),
|
|
33
|
-
lineHeight: "".concat(32 / fontSize, "em"),
|
|
34
|
-
paddingBlock: 'space.0',
|
|
35
30
|
paddingInlineEnd: 'space.150',
|
|
36
31
|
paddingInlineStart: 'space.150',
|
|
37
32
|
textAlign: 'center',
|
|
@@ -42,6 +37,19 @@ var buttonStyles = xcss({
|
|
|
42
37
|
color: "var(--ds-text, ".concat(colors.N500, ")")
|
|
43
38
|
}
|
|
44
39
|
});
|
|
40
|
+
var baseButtonStyles = xcss({
|
|
41
|
+
fontFamily: 'inherit',
|
|
42
|
+
fontSize: 'inherit',
|
|
43
|
+
fontStyle: 'normal',
|
|
44
|
+
fontWeight: 500,
|
|
45
|
+
lineHeight: "".concat(32 / fontSize, "em"),
|
|
46
|
+
paddingBlock: 'space.0'
|
|
47
|
+
});
|
|
48
|
+
var tokenizedButtonStyles = xcss({
|
|
49
|
+
font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
50
|
+
fontWeight: "var(--ds-font-weight-medium, 500)",
|
|
51
|
+
paddingBlock: 'space.075'
|
|
52
|
+
});
|
|
45
53
|
var defaultInteractiveStyles = xcss({
|
|
46
54
|
':hover': {
|
|
47
55
|
background: "var(--ds-background-neutral-hovered, #091e4214)",
|
|
@@ -305,11 +313,16 @@ var selectedDiscoveryStyles = xcss({
|
|
|
305
313
|
var spacingCompactStyles = xcss({
|
|
306
314
|
columnGap: 'space.050',
|
|
307
315
|
height: "".concat(24 / fontSize, "em"),
|
|
308
|
-
lineHeight: "".concat(24 / fontSize, "em"),
|
|
309
316
|
paddingInlineEnd: 'space.150',
|
|
310
317
|
paddingInlineStart: 'space.150',
|
|
311
318
|
verticalAlign: 'middle'
|
|
312
319
|
});
|
|
320
|
+
var baseSpacingCompactStyles = xcss({
|
|
321
|
+
lineHeight: "".concat(24 / fontSize, "em")
|
|
322
|
+
});
|
|
323
|
+
var tokenizedSpacingCompactStyles = xcss({
|
|
324
|
+
paddingBlock: 'space.025'
|
|
325
|
+
});
|
|
313
326
|
var spacingNoneStyles = xcss({
|
|
314
327
|
columnGap: 'space.0',
|
|
315
328
|
height: 'auto',
|
|
@@ -318,6 +331,9 @@ var spacingNoneStyles = xcss({
|
|
|
318
331
|
paddingInlineStart: 'space.0',
|
|
319
332
|
verticalAlign: 'baseline'
|
|
320
333
|
});
|
|
334
|
+
var tokenizedSpacingNoneStyles = xcss({
|
|
335
|
+
paddingBlock: 'space.0'
|
|
336
|
+
});
|
|
321
337
|
var circleStyles = xcss({
|
|
322
338
|
borderRadius: 'border.radius.circle'
|
|
323
339
|
});
|
|
@@ -430,13 +446,13 @@ var useButtonBase = function useButtonBase(_ref) {
|
|
|
430
446
|
useAutoFocus(localRef, autoFocus);
|
|
431
447
|
return _objectSpread({
|
|
432
448
|
ref: mergeRefs([localRef, ref]),
|
|
433
|
-
xcss: [buttonStyles, appearance === 'default' && isInteractive && defaultInteractiveStyles, appearance === 'primary' && primaryStyles, appearance === 'primary' && isInteractive && primaryInteractiveStyles, appearance === 'warning' && warningStyles, appearance === 'warning' && isInteractive && warningInteractiveStyles, appearance === 'danger' && dangerStyles, appearance === 'danger' && isInteractive && dangerInteractiveStyles, appearance === 'discovery' && discoveryStyles, appearance === 'discovery' && isInteractive && discoveryInteractiveStyles, appearance === 'subtle' && subtleStyles, appearance === 'subtle' && isInteractive && subtleInteractiveStyles, appearance === 'link' && linkStyles, appearance === 'subtle-link' && subtleLinkStyles, !isSelected && (appearance === 'link' || appearance === 'subtle-link') ? linkDecorationStyles : linkDecorationUnsetStyles, isSelected && selectedStyles, isSelected && isInteractive && selectedInteractiveStyles,
|
|
449
|
+
xcss: [getBooleanFF('platform.design-system-team.button-tokenised-typography-styles') ? tokenizedButtonStyles : baseButtonStyles, buttonStyles, appearance === 'default' && isInteractive && defaultInteractiveStyles, appearance === 'primary' && primaryStyles, appearance === 'primary' && isInteractive && primaryInteractiveStyles, appearance === 'warning' && warningStyles, appearance === 'warning' && isInteractive && warningInteractiveStyles, appearance === 'danger' && dangerStyles, appearance === 'danger' && isInteractive && dangerInteractiveStyles, appearance === 'discovery' && discoveryStyles, appearance === 'discovery' && isInteractive && discoveryInteractiveStyles, appearance === 'subtle' && subtleStyles, appearance === 'subtle' && isInteractive && subtleInteractiveStyles, appearance === 'link' && linkStyles, appearance === 'subtle-link' && subtleLinkStyles, !isSelected && (appearance === 'link' || appearance === 'subtle-link') ? linkDecorationStyles : linkDecorationUnsetStyles, isSelected && selectedStyles, isSelected && isInteractive && selectedInteractiveStyles,
|
|
434
450
|
// TODO: remove me once we kill color fallbacks
|
|
435
451
|
isSelected && appearance === 'danger' && selectedDangerStyles,
|
|
436
452
|
// TODO: remove me once we kill color fallbacks
|
|
437
453
|
isSelected && appearance === 'warning' && selectedWarningStyles,
|
|
438
454
|
// TODO: remove me once we kill color fallbacks
|
|
439
|
-
isSelected && appearance === 'discovery' && selectedDiscoveryStyles, isDisabled && disabledStyles, isCircle && !isSplitButton && circleStyles, spacing === 'compact' && spacingCompactStyles, spacing === 'none' && spacingNoneStyles, spacing !== 'none' && hasIconBefore && buttonIconBeforeStyles, spacing !== 'none' && hasIconAfter && buttonIconAfterStyles, isIconButton && iconButtonStyles, isIconButton && spacing === 'compact' && iconButtonCompactStyles, shouldFitContainer && fullWidthStyles, isLoading && loadingOverlayStyles, (isDisabled || hasOverlay && !isLoading) && nonInteractiveStyles, isSplitButton && splitButtonStyles, isNavigationSplitButton && navigationSplitButtonStyles],
|
|
455
|
+
isSelected && appearance === 'discovery' && selectedDiscoveryStyles, isDisabled && disabledStyles, isCircle && !isSplitButton && circleStyles, spacing === 'compact' && spacingCompactStyles, spacing === 'compact' && (getBooleanFF('platform.design-system-team.button-tokenised-typography-styles') ? tokenizedSpacingCompactStyles : baseSpacingCompactStyles), spacing === 'none' && spacingNoneStyles, spacing === 'none' && getBooleanFF('platform.design-system-team.button-tokenised-typography-styles') && tokenizedSpacingNoneStyles, spacing !== 'none' && hasIconBefore && buttonIconBeforeStyles, spacing !== 'none' && hasIconAfter && buttonIconAfterStyles, isIconButton && iconButtonStyles, isIconButton && spacing === 'compact' && iconButtonCompactStyles, shouldFitContainer && fullWidthStyles, isLoading && loadingOverlayStyles, (isDisabled || hasOverlay && !isLoading) && nonInteractiveStyles, isSplitButton && splitButtonStyles, isNavigationSplitButton && navigationSplitButtonStyles],
|
|
440
456
|
// Consider overlay buttons to be effectively disabled
|
|
441
457
|
isDisabled: isEffectivelyDisabled,
|
|
442
458
|
children: /*#__PURE__*/React.createElement(Fragment, null, children, overlay ? /*#__PURE__*/React.createElement(Box, {
|