@atlaskit/button 23.9.9 → 23.10.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 +19 -0
- package/dist/cjs/new-button/containers/split-button/split-button.js +1 -1
- package/dist/cjs/new-button/variants/default/link.js +1 -1
- package/dist/cjs/new-button/variants/icon/link.js +1 -1
- package/dist/cjs/new-button/variants/shared/button-base.js +1 -1
- package/dist/cjs/new-button/variants/shared/content.js +1 -1
- package/dist/cjs/old-button/button.js +1 -5
- package/dist/cjs/old-button/custom-theme-button/theme.js +0 -3
- package/dist/es2019/new-button/containers/split-button/split-button.js +1 -1
- package/dist/es2019/new-button/variants/default/link.js +1 -1
- package/dist/es2019/new-button/variants/icon/link.js +1 -1
- package/dist/es2019/new-button/variants/shared/button-base.js +1 -1
- package/dist/es2019/new-button/variants/shared/content.js +1 -1
- package/dist/es2019/old-button/button.js +1 -6
- package/dist/es2019/old-button/custom-theme-button/theme.js +0 -2
- package/dist/esm/new-button/containers/split-button/split-button.js +1 -1
- package/dist/esm/new-button/variants/default/link.js +1 -1
- package/dist/esm/new-button/variants/icon/link.js +1 -1
- package/dist/esm/new-button/variants/shared/button-base.js +1 -1
- package/dist/esm/new-button/variants/shared/content.js +1 -1
- package/dist/esm/old-button/button.js +1 -5
- package/dist/esm/old-button/custom-theme-button/theme.js +0 -3
- package/dist/types/old-button/custom-theme-button/theme.d.ts +1 -1
- package/dist/types/old-button/shared/css.d.ts +0 -2
- package/dist/types-ts4.5/old-button/custom-theme-button/theme.d.ts +1 -1
- package/dist/types-ts4.5/old-button/shared/css.d.ts +0 -2
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/button
|
|
2
2
|
|
|
3
|
+
## 23.10.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 23.10.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`4d78aaa844538`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4d78aaa844538) -
|
|
14
|
+
Hard-codes color-mode light as the default color scheme for legacy buttons. These buttons were
|
|
15
|
+
dependant on an old @ak/theming API which is non-functional and will be removed entirely in a
|
|
16
|
+
following release
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 23.9.9
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -11,7 +11,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
11
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
14
|
-
var _components = require("@atlaskit/theme/components");
|
|
15
14
|
var _buttonBase = _interopRequireDefault(require("./shared/button-base"));
|
|
16
15
|
var _css = require("./shared/css");
|
|
17
16
|
var _getIsOnlySingleIcon = _interopRequireDefault(require("./shared/get-is-only-single-icon"));
|
|
@@ -48,8 +47,6 @@ var Button = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
48
47
|
_ref$spacing = _ref.spacing,
|
|
49
48
|
spacing = _ref$spacing === void 0 ? 'default' : _ref$spacing,
|
|
50
49
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
51
|
-
var _useGlobalTheme = (0, _components.useGlobalTheme)(),
|
|
52
|
-
mode = _useGlobalTheme.mode;
|
|
53
50
|
var isOnlySingleIcon = (0, _getIsOnlySingleIcon.default)({
|
|
54
51
|
children: children,
|
|
55
52
|
iconBefore: iconBefore,
|
|
@@ -78,12 +75,11 @@ var Button = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
|
|
|
78
75
|
return (0, _css.getCss)({
|
|
79
76
|
appearance: appearance,
|
|
80
77
|
spacing: spacing,
|
|
81
|
-
mode: mode,
|
|
82
78
|
isSelected: isSelected,
|
|
83
79
|
shouldFitContainer: shouldFitContainer,
|
|
84
80
|
isOnlySingleIcon: isOnlySingleIcon
|
|
85
81
|
});
|
|
86
|
-
}, [appearance, spacing,
|
|
82
|
+
}, [appearance, spacing, isSelected, shouldFitContainer, isOnlySingleIcon]);
|
|
87
83
|
return /*#__PURE__*/_react.default.createElement(_buttonBase.default, (0, _extends2.default)({}, rest, {
|
|
88
84
|
ref: ref,
|
|
89
85
|
appearance: appearance,
|
|
@@ -29,8 +29,6 @@ function getCustomCss(_ref) {
|
|
|
29
29
|
appearance = _ref$appearance === void 0 ? 'default' : _ref$appearance,
|
|
30
30
|
_ref$spacing = _ref.spacing,
|
|
31
31
|
spacing = _ref$spacing === void 0 ? 'default' : _ref$spacing,
|
|
32
|
-
_ref$mode = _ref.mode,
|
|
33
|
-
mode = _ref$mode === void 0 ? 'light' : _ref$mode,
|
|
34
32
|
_ref$isSelected = _ref.isSelected,
|
|
35
33
|
isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
|
|
36
34
|
_ref$shouldFitContain = _ref.shouldFitContainer,
|
|
@@ -43,7 +41,6 @@ function getCustomCss(_ref) {
|
|
|
43
41
|
var result = (0, _css.getCss)({
|
|
44
42
|
appearance: appearance,
|
|
45
43
|
spacing: spacing,
|
|
46
|
-
mode: mode,
|
|
47
44
|
isSelected: isSelected,
|
|
48
45
|
shouldFitContainer: shouldFitContainer,
|
|
49
46
|
isOnlySingleIcon: iconIsOnlyChild
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* button-base.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* button-base.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import "./button-base.compiled.css";
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -4,7 +4,6 @@ import React, { useCallback, useMemo, useState } from 'react';
|
|
|
4
4
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
5
5
|
|
|
6
6
|
import noop from '@atlaskit/ds-lib/noop';
|
|
7
|
-
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
8
7
|
import ButtonBase from './shared/button-base';
|
|
9
8
|
import { getCss } from './shared/css';
|
|
10
9
|
import getIsOnlySingleIcon from './shared/get-is-only-single-icon';
|
|
@@ -34,9 +33,6 @@ const Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function B
|
|
|
34
33
|
spacing = 'default',
|
|
35
34
|
...rest
|
|
36
35
|
}, ref) {
|
|
37
|
-
const {
|
|
38
|
-
mode
|
|
39
|
-
} = useGlobalTheme();
|
|
40
36
|
const isOnlySingleIcon = getIsOnlySingleIcon({
|
|
41
37
|
children,
|
|
42
38
|
iconBefore,
|
|
@@ -61,11 +57,10 @@ const Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function B
|
|
|
61
57
|
const buttonCss = useMemo(() => getCss({
|
|
62
58
|
appearance,
|
|
63
59
|
spacing,
|
|
64
|
-
mode,
|
|
65
60
|
isSelected,
|
|
66
61
|
shouldFitContainer,
|
|
67
62
|
isOnlySingleIcon
|
|
68
|
-
}), [appearance, spacing,
|
|
63
|
+
}), [appearance, spacing, isSelected, shouldFitContainer, isOnlySingleIcon]);
|
|
69
64
|
return /*#__PURE__*/React.createElement(ButtonBase, _extends({}, rest, {
|
|
70
65
|
ref: ref,
|
|
71
66
|
appearance: appearance,
|
|
@@ -16,7 +16,6 @@ const stateToSelectorMap = {
|
|
|
16
16
|
export function getCustomCss({
|
|
17
17
|
appearance = 'default',
|
|
18
18
|
spacing = 'default',
|
|
19
|
-
mode = 'light',
|
|
20
19
|
isSelected = false,
|
|
21
20
|
shouldFitContainer = false,
|
|
22
21
|
iconIsOnlyChild = false,
|
|
@@ -26,7 +25,6 @@ export function getCustomCss({
|
|
|
26
25
|
let result = getCss({
|
|
27
26
|
appearance,
|
|
28
27
|
spacing,
|
|
29
|
-
mode,
|
|
30
28
|
isSelected,
|
|
31
29
|
shouldFitContainer,
|
|
32
30
|
isOnlySingleIcon: iconIsOnlyChild
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* link.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* link.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["analyticsContext", "appearance", "aria-label", "aria-labelledby", "autoFocus", "children", "href", "iconAfter", "iconBefore", "interactionName", "isDisabled", "isSelected", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "shouldFitContainer", "spacing", "testId"],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* link.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* link.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
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", "shape", "spacing", "testId", "tooltip"],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* button-base.tsx generated by @compiled/babel-plugin v0.
|
|
1
|
+
/* button-base.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["appearance", "autoFocus", "isDisabled", "isLoading", "isSelected", "isIconButton", "isCircle", "hasIconBefore", "hasIconAfter", "shouldFitContainer", "spacing", "ariaLabel", "ariaLabelledBy", "children", "interactionName", "onClick", "onMouseDown", "onMouseDownCapture", "onMouseUp", "onMouseUpCapture", "onKeyDown", "onKeyDownCapture", "onKeyUp", "onKeyUpCapture", "onTouchStart", "onTouchStartCapture", "onTouchEnd", "onTouchEndCapture", "onPointerDown", "onPointerDownCapture", "onPointerUp", "onPointerUpCapture", "onClickCapture", "testId", "analyticsContext", "componentName", "role", "onMouseOver", "onMouseOut", "onFocus", "onBlur", "onMouseMove", "type"],
|
|
@@ -7,7 +7,6 @@ import React, { useCallback, useMemo, useState } from 'react';
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
|
|
9
9
|
import noop from '@atlaskit/ds-lib/noop';
|
|
10
|
-
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
11
10
|
import ButtonBase from './shared/button-base';
|
|
12
11
|
import { getCss } from './shared/css';
|
|
13
12
|
import getIsOnlySingleIcon from './shared/get-is-only-single-icon';
|
|
@@ -42,8 +41,6 @@ var Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function But
|
|
|
42
41
|
_ref$spacing = _ref.spacing,
|
|
43
42
|
spacing = _ref$spacing === void 0 ? 'default' : _ref$spacing,
|
|
44
43
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
45
|
-
var _useGlobalTheme = useGlobalTheme(),
|
|
46
|
-
mode = _useGlobalTheme.mode;
|
|
47
44
|
var isOnlySingleIcon = getIsOnlySingleIcon({
|
|
48
45
|
children: children,
|
|
49
46
|
iconBefore: iconBefore,
|
|
@@ -72,12 +69,11 @@ var Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function But
|
|
|
72
69
|
return getCss({
|
|
73
70
|
appearance: appearance,
|
|
74
71
|
spacing: spacing,
|
|
75
|
-
mode: mode,
|
|
76
72
|
isSelected: isSelected,
|
|
77
73
|
shouldFitContainer: shouldFitContainer,
|
|
78
74
|
isOnlySingleIcon: isOnlySingleIcon
|
|
79
75
|
});
|
|
80
|
-
}, [appearance, spacing,
|
|
76
|
+
}, [appearance, spacing, isSelected, shouldFitContainer, isOnlySingleIcon]);
|
|
81
77
|
return /*#__PURE__*/React.createElement(ButtonBase, _extends({}, rest, {
|
|
82
78
|
ref: ref,
|
|
83
79
|
appearance: appearance,
|
|
@@ -21,8 +21,6 @@ export function getCustomCss(_ref) {
|
|
|
21
21
|
appearance = _ref$appearance === void 0 ? 'default' : _ref$appearance,
|
|
22
22
|
_ref$spacing = _ref.spacing,
|
|
23
23
|
spacing = _ref$spacing === void 0 ? 'default' : _ref$spacing,
|
|
24
|
-
_ref$mode = _ref.mode,
|
|
25
|
-
mode = _ref$mode === void 0 ? 'light' : _ref$mode,
|
|
26
24
|
_ref$isSelected = _ref.isSelected,
|
|
27
25
|
isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
|
|
28
26
|
_ref$shouldFitContain = _ref.shouldFitContainer,
|
|
@@ -35,7 +33,6 @@ export function getCustomCss(_ref) {
|
|
|
35
33
|
var result = getCss({
|
|
36
34
|
appearance: appearance,
|
|
37
35
|
spacing: spacing,
|
|
38
|
-
mode: mode,
|
|
39
36
|
isSelected: isSelected,
|
|
40
37
|
shouldFitContainer: shouldFitContainer,
|
|
41
38
|
isOnlySingleIcon: iconIsOnlyChild
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type CSSObject } from '@emotion/react';
|
|
2
2
|
import { createTheme } from '@atlaskit/theme/components';
|
|
3
3
|
import { type ThemeProps, type ThemeTokens } from './custom-theme-button-types';
|
|
4
|
-
export declare function getCustomCss({ appearance, spacing,
|
|
4
|
+
export declare function getCustomCss({ appearance, spacing, isSelected, shouldFitContainer, iconIsOnlyChild, isLoading, state, }: ThemeProps): CSSObject;
|
|
5
5
|
export declare function getSpecifiers(styles: CSSObject): CSSObject;
|
|
6
6
|
export declare function defaultThemeFn(current: (values: ThemeProps) => ThemeTokens, values: ThemeProps): ThemeTokens;
|
|
7
7
|
declare const Theme: ReturnType<typeof createTheme<ThemeTokens, ThemeProps>>;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { type CSSObject } from '@emotion/react';
|
|
2
|
-
import { type ThemeModes } from '@atlaskit/theme/types';
|
|
3
2
|
import { type Appearance, type Spacing } from '../types';
|
|
4
3
|
type GetCssArgs = {
|
|
5
4
|
appearance: Appearance;
|
|
6
5
|
spacing: Spacing;
|
|
7
|
-
mode: ThemeModes;
|
|
8
6
|
isSelected: boolean;
|
|
9
7
|
shouldFitContainer: boolean;
|
|
10
8
|
isOnlySingleIcon: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type CSSObject } from '@emotion/react';
|
|
2
2
|
import { createTheme } from '@atlaskit/theme/components';
|
|
3
3
|
import { type ThemeProps, type ThemeTokens } from './custom-theme-button-types';
|
|
4
|
-
export declare function getCustomCss({ appearance, spacing,
|
|
4
|
+
export declare function getCustomCss({ appearance, spacing, isSelected, shouldFitContainer, iconIsOnlyChild, isLoading, state, }: ThemeProps): CSSObject;
|
|
5
5
|
export declare function getSpecifiers(styles: CSSObject): CSSObject;
|
|
6
6
|
export declare function defaultThemeFn(current: (values: ThemeProps) => ThemeTokens, values: ThemeProps): ThemeTokens;
|
|
7
7
|
declare const Theme: ReturnType<typeof createTheme<ThemeTokens, ThemeProps>>;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { type CSSObject } from '@emotion/react';
|
|
2
|
-
import { type ThemeModes } from '@atlaskit/theme/types';
|
|
3
2
|
import { type Appearance, type Spacing } from '../types';
|
|
4
3
|
type GetCssArgs = {
|
|
5
4
|
appearance: Appearance;
|
|
6
5
|
spacing: Spacing;
|
|
7
|
-
mode: ThemeModes;
|
|
8
6
|
isSelected: boolean;
|
|
9
7
|
shouldFitContainer: boolean;
|
|
10
8
|
isOnlySingleIcon: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/button",
|
|
3
|
-
"version": "23.
|
|
3
|
+
"version": "23.10.1",
|
|
4
4
|
"description": "A button triggers an event or action. They let users know what will happen next.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -76,19 +76,19 @@
|
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
78
78
|
"@atlaskit/css": "^0.19.0",
|
|
79
|
-
"@atlaskit/ds-lib": "^
|
|
79
|
+
"@atlaskit/ds-lib": "^6.0.0",
|
|
80
80
|
"@atlaskit/focus-ring": "^3.0.0",
|
|
81
81
|
"@atlaskit/icon": "^32.0.0",
|
|
82
82
|
"@atlaskit/interaction-context": "^3.1.0",
|
|
83
83
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
84
84
|
"@atlaskit/primitives": "^18.0.0",
|
|
85
85
|
"@atlaskit/spinner": "^19.0.0",
|
|
86
|
-
"@atlaskit/theme": "^
|
|
87
|
-
"@atlaskit/tokens": "^11.
|
|
86
|
+
"@atlaskit/theme": "^22.0.0",
|
|
87
|
+
"@atlaskit/tokens": "^11.1.0",
|
|
88
88
|
"@atlaskit/tooltip": "^20.14.0",
|
|
89
89
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
90
90
|
"@babel/runtime": "^7.0.0",
|
|
91
|
-
"@compiled/react": "^0.
|
|
91
|
+
"@compiled/react": "^0.20.0",
|
|
92
92
|
"@emotion/react": "^11.7.1"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
@@ -100,15 +100,15 @@
|
|
|
100
100
|
"@af/visual-regression": "workspace:^",
|
|
101
101
|
"@atlaskit/app-provider": "^4.1.0",
|
|
102
102
|
"@atlaskit/checkbox": "^17.3.0",
|
|
103
|
-
"@atlaskit/docs": "^11.
|
|
104
|
-
"@atlaskit/dropdown-menu": "^16.
|
|
105
|
-
"@atlaskit/form": "^15.
|
|
103
|
+
"@atlaskit/docs": "^11.6.0",
|
|
104
|
+
"@atlaskit/dropdown-menu": "^16.6.0",
|
|
105
|
+
"@atlaskit/form": "^15.4.0",
|
|
106
106
|
"@atlaskit/heading": "^5.3.0",
|
|
107
107
|
"@atlaskit/link": "^3.3.0",
|
|
108
108
|
"@atlaskit/logo": "^19.10.0",
|
|
109
109
|
"@atlaskit/modal-dialog": "^14.11.0",
|
|
110
110
|
"@atlaskit/section-message": "^8.12.0",
|
|
111
|
-
"@atlaskit/select": "^21.
|
|
111
|
+
"@atlaskit/select": "^21.8.0",
|
|
112
112
|
"@atlaskit/toggle": "^15.2.0",
|
|
113
113
|
"@atlassian/feature-flags-test-utils": "^1.0.0",
|
|
114
114
|
"@atlassian/ssr-tests": "workspace:^",
|