@atlaskit/button 23.4.0 → 23.4.2

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/button
2
2
 
3
+ ## 23.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b3e26b962b5c7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b3e26b962b5c7) -
8
+ We are testing internal changes for Button icon sizing behind a feature flag. If this change is
9
+ successful it will be available in a later release: To balance icon sizing, any chevron icons used
10
+ in button icon slots will now render as `size="small"` by default.
11
+ - Updated dependencies
12
+
13
+ ## 23.4.1
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies
18
+
3
19
  ## 23.4.0
4
20
 
5
21
  ### Minor 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
- return (
27
- /*#__PURE__*/
28
- // @ts-ignore - TS2322 TypeScript 5.9.2 upgrade
29
- _react.default.createElement(_react.default.Fragment, null, isIconRenderProp(Icon) ? Icon({
30
- label: '',
31
- color: 'currentColor'
32
- }) : /*#__PURE__*/_react.default.createElement(Icon, {
33
- label: "",
34
- color: 'currentColor'
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.3.2",
135
+ packageVersion: "23.4.1",
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
- return (
21
- /*#__PURE__*/
22
- // @ts-ignore - TS2322 TypeScript 5.9.2 upgrade
23
- React.createElement(React.Fragment, null, isIconRenderProp(Icon) ? Icon({
24
- label: '',
25
- color: 'currentColor'
26
- }) : /*#__PURE__*/React.createElement(Icon, {
27
- label: "",
28
- color: 'currentColor'
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.3.2",
122
+ packageVersion: "23.4.1",
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
- return (
20
- /*#__PURE__*/
21
- // @ts-ignore - TS2322 TypeScript 5.9.2 upgrade
22
- React.createElement(React.Fragment, null, isIconRenderProp(Icon) ? Icon({
23
- label: '',
24
- color: 'currentColor'
25
- }) : /*#__PURE__*/React.createElement(Icon, {
26
- label: "",
27
- color: 'currentColor'
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.3.2",
128
+ packageVersion: "23.4.1",
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.0",
3
+ "version": "23.4.2",
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,7 +87,7 @@
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": "^27.12.0",
90
+ "@atlaskit/icon": "^28.1.0",
91
91
  "@atlaskit/interaction-context": "^3.0.0",
92
92
  "@atlaskit/platform-feature-flags": "^1.1.0",
93
93
  "@atlaskit/primitives": "^14.11.0",
@@ -111,7 +111,7 @@
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.1.0",
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",
@@ -120,8 +120,7 @@
120
120
  "@atlaskit/select": "^21.2.0",
121
121
  "@atlaskit/ssr": "workspace:^",
122
122
  "@atlaskit/toggle": "^15.1.0",
123
- "@atlaskit/visual-regression": "workspace:^",
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
  }