@atlaskit/button 23.4.1 → 23.4.3
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 +16 -0
- package/dist/cjs/new-button/variants/shared/icon-renderer.js +12 -11
- package/dist/cjs/old-button/shared/button-base.js +1 -1
- package/dist/es2019/new-button/variants/shared/icon-renderer.js +10 -11
- package/dist/es2019/old-button/shared/button-base.js +1 -1
- package/dist/esm/new-button/variants/shared/icon-renderer.js +12 -11
- package/dist/esm/old-button/shared/button-base.js +1 -1
- package/package.json +11 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/button
|
|
2
2
|
|
|
3
|
+
## 23.4.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 23.4.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`b3e26b962b5c7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b3e26b962b5c7) -
|
|
14
|
+
We are testing internal changes for Button icon sizing behind a feature flag. If this change is
|
|
15
|
+
successful it will be available in a later release: To balance icon sizing, any chevron icons used
|
|
16
|
+
in button icon slots will now render as `size="small"` by default.
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 23.4.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
10
|
function isIconRenderProp(func) {
|
|
10
11
|
return !func.displayName &&
|
|
11
12
|
// most function components and class components have a displayName, negate them
|
|
@@ -23,16 +24,16 @@ function isIconRenderProp(func) {
|
|
|
23
24
|
*/
|
|
24
25
|
var IconRenderer = function IconRenderer(_ref) {
|
|
25
26
|
var Icon = _ref.icon;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
);
|
|
27
|
+
var isRenderProp = isIconRenderProp(Icon);
|
|
28
|
+
var iconProps = {
|
|
29
|
+
label: '',
|
|
30
|
+
color: 'currentColor',
|
|
31
|
+
size: (0, _platformFeatureFlags.fg)('platform_dst_button_chevron_sizing') ? function (iconName) {
|
|
32
|
+
return iconName.startsWith('Chevron') ? 'small' : 'medium';
|
|
33
|
+
} : undefined
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// @ts-ignore - TS2322 TypeScript 5.9.2 upgrade
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isRenderProp ? Icon(iconProps) : /*#__PURE__*/_react.default.createElement(Icon, iconProps));
|
|
37
38
|
};
|
|
38
39
|
var _default = exports.default = IconRenderer;
|
|
@@ -132,7 +132,7 @@ var ButtonBase = /*#__PURE__*/_react.default.forwardRef(function ButtonBase(prop
|
|
|
132
132
|
action: 'clicked',
|
|
133
133
|
componentName: 'button',
|
|
134
134
|
packageName: "@atlaskit/button",
|
|
135
|
-
packageVersion: "23.4.
|
|
135
|
+
packageVersion: "23.4.2",
|
|
136
136
|
analyticsData: analyticsContext
|
|
137
137
|
});
|
|
138
138
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
function isIconRenderProp(func) {
|
|
3
4
|
return !func.displayName &&
|
|
4
5
|
// most function components and class components have a displayName, negate them
|
|
@@ -17,16 +18,14 @@ function isIconRenderProp(func) {
|
|
|
17
18
|
const IconRenderer = ({
|
|
18
19
|
icon: Icon
|
|
19
20
|
}) => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}))
|
|
30
|
-
);
|
|
21
|
+
const isRenderProp = isIconRenderProp(Icon);
|
|
22
|
+
let iconProps = {
|
|
23
|
+
label: '',
|
|
24
|
+
color: 'currentColor',
|
|
25
|
+
size: fg('platform_dst_button_chevron_sizing') ? iconName => iconName.startsWith('Chevron') ? 'small' : 'medium' : undefined
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// @ts-ignore - TS2322 TypeScript 5.9.2 upgrade
|
|
29
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, isRenderProp ? Icon(iconProps) : /*#__PURE__*/React.createElement(Icon, iconProps));
|
|
31
30
|
};
|
|
32
31
|
export default IconRenderer;
|
|
@@ -119,7 +119,7 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref)
|
|
|
119
119
|
action: 'clicked',
|
|
120
120
|
componentName: 'button',
|
|
121
121
|
packageName: "@atlaskit/button",
|
|
122
|
-
packageVersion: "23.4.
|
|
122
|
+
packageVersion: "23.4.2",
|
|
123
123
|
analyticsData: analyticsContext
|
|
124
124
|
});
|
|
125
125
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
function isIconRenderProp(func) {
|
|
3
4
|
return !func.displayName &&
|
|
4
5
|
// most function components and class components have a displayName, negate them
|
|
@@ -16,16 +17,16 @@ function isIconRenderProp(func) {
|
|
|
16
17
|
*/
|
|
17
18
|
var IconRenderer = function IconRenderer(_ref) {
|
|
18
19
|
var Icon = _ref.icon;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
);
|
|
20
|
+
var isRenderProp = isIconRenderProp(Icon);
|
|
21
|
+
var iconProps = {
|
|
22
|
+
label: '',
|
|
23
|
+
color: 'currentColor',
|
|
24
|
+
size: fg('platform_dst_button_chevron_sizing') ? function (iconName) {
|
|
25
|
+
return iconName.startsWith('Chevron') ? 'small' : 'medium';
|
|
26
|
+
} : undefined
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// @ts-ignore - TS2322 TypeScript 5.9.2 upgrade
|
|
30
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, isRenderProp ? Icon(iconProps) : /*#__PURE__*/React.createElement(Icon, iconProps));
|
|
30
31
|
};
|
|
31
32
|
export default IconRenderer;
|
|
@@ -125,7 +125,7 @@ var ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
125
125
|
action: 'clicked',
|
|
126
126
|
componentName: 'button',
|
|
127
127
|
packageName: "@atlaskit/button",
|
|
128
|
-
packageVersion: "23.4.
|
|
128
|
+
packageVersion: "23.4.2",
|
|
129
129
|
analyticsData: analyticsContext
|
|
130
130
|
});
|
|
131
131
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/button",
|
|
3
|
-
"version": "23.4.
|
|
3
|
+
"version": "23.4.3",
|
|
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/"
|
|
@@ -87,13 +87,13 @@
|
|
|
87
87
|
"@atlaskit/css": "^0.12.0",
|
|
88
88
|
"@atlaskit/ds-lib": "^5.0.0",
|
|
89
89
|
"@atlaskit/focus-ring": "^3.0.0",
|
|
90
|
-
"@atlaskit/icon": "^28.
|
|
90
|
+
"@atlaskit/icon": "^28.1.0",
|
|
91
91
|
"@atlaskit/interaction-context": "^3.0.0",
|
|
92
92
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
93
|
-
"@atlaskit/primitives": "^14.
|
|
93
|
+
"@atlaskit/primitives": "^14.12.0",
|
|
94
94
|
"@atlaskit/spinner": "^19.0.0",
|
|
95
|
-
"@atlaskit/theme": "^
|
|
96
|
-
"@atlaskit/tokens": "^6.
|
|
95
|
+
"@atlaskit/theme": "^20.0.0",
|
|
96
|
+
"@atlaskit/tokens": "^6.1.0",
|
|
97
97
|
"@atlaskit/tooltip": "^20.4.0",
|
|
98
98
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
99
99
|
"@babel/runtime": "^7.0.0",
|
|
@@ -111,17 +111,16 @@
|
|
|
111
111
|
"@atlaskit/checkbox": "^17.1.0",
|
|
112
112
|
"@atlaskit/docs": "^11.0.0",
|
|
113
113
|
"@atlaskit/dropdown-menu": "^16.3.0",
|
|
114
|
-
"@atlaskit/form": "^12.
|
|
114
|
+
"@atlaskit/form": "^12.2.0",
|
|
115
115
|
"@atlaskit/heading": "^5.2.0",
|
|
116
116
|
"@atlaskit/link": "^3.2.0",
|
|
117
117
|
"@atlaskit/logo": "^19.7.0",
|
|
118
118
|
"@atlaskit/modal-dialog": "^14.3.0",
|
|
119
|
-
"@atlaskit/section-message": "^8.
|
|
119
|
+
"@atlaskit/section-message": "^8.6.0",
|
|
120
120
|
"@atlaskit/select": "^21.2.0",
|
|
121
121
|
"@atlaskit/ssr": "workspace:^",
|
|
122
122
|
"@atlaskit/toggle": "^15.1.0",
|
|
123
|
-
"@
|
|
124
|
-
"@atlassian/ssr-tests": "^0.2.0",
|
|
123
|
+
"@atlassian/ssr-tests": "^0.3.0",
|
|
125
124
|
"@testing-library/react": "^13.4.0",
|
|
126
125
|
"@testing-library/user-event": "^14.4.3",
|
|
127
126
|
"ast-types": "^0.13.3",
|
|
@@ -133,6 +132,9 @@
|
|
|
133
132
|
"platform-feature-flags": {
|
|
134
133
|
"platform-component-visual-refresh": {
|
|
135
134
|
"type": "boolean"
|
|
135
|
+
},
|
|
136
|
+
"platform_dst_button_chevron_sizing": {
|
|
137
|
+
"type": "boolean"
|
|
136
138
|
}
|
|
137
139
|
}
|
|
138
140
|
}
|