@atlaskit/button 16.3.6 → 16.3.7

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,11 @@
1
1
  # @atlaskit/button
2
2
 
3
+ ## 16.3.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`14d635468f6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/14d635468f6) - [ux] DSP-6696: prevent empty ButtonGroup items from showing spacing by switching to flexbox gap
8
+
3
9
  ## 16.3.6
4
10
 
5
11
  ### Patch Changes
@@ -1,48 +1,38 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
4
 
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = ButtonGroup;
9
- exports.groupItemStyles = void 0;
10
9
 
11
- var _react = _interopRequireDefault(require("react"));
10
+ var _react = _interopRequireWildcard(require("react"));
12
11
 
13
12
  var _core = require("@emotion/core");
14
13
 
15
- var _constants = require("@atlaskit/theme/constants");
14
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
+
16
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
17
 
17
18
  /** @jsx jsx */
18
- var groupItemStyles = {
19
- flex: '1 0 auto',
20
- display: 'flex',
21
-
22
- /* margins don't flip when the layout uses dir="rtl", whereas pseudos do */
23
- '& + &::before': {
24
- content: "''",
25
- display: 'inline-block',
26
- width: "".concat((0, _constants.gridSize)() / 2, "px")
27
- }
28
- };
29
- exports.groupItemStyles = groupItemStyles;
19
+ var buttonGroupStyles = (0, _core.css)({
20
+ display: 'inline-flex',
21
+ gap: 4
22
+ });
30
23
 
31
24
  function ButtonGroup(_ref) {
32
25
  var appearance = _ref.appearance,
33
26
  children = _ref.children;
34
27
  return (0, _core.jsx)("div", {
35
- css: {
36
- display: 'inline-flex'
37
- }
28
+ css: buttonGroupStyles
38
29
  }, _react.default.Children.map(children, function (child, idx) {
39
30
  if (!child) {
40
31
  return null;
41
32
  }
42
33
 
43
- return (0, _core.jsx)("div", {
44
- key: idx,
45
- css: groupItemStyles
34
+ return (0, _core.jsx)(_react.Fragment, {
35
+ key: idx
46
36
  }, appearance ?
47
37
  /*#__PURE__*/
48
38
  // eslint-disable-next-line @repo/internal/react/no-clone-element
@@ -101,7 +101,7 @@ var _default = /*#__PURE__*/_react.default.forwardRef(function ButtonBase(props,
101
101
  action: 'clicked',
102
102
  componentName: 'button',
103
103
  packageName: "@atlaskit/button",
104
- packageVersion: "16.3.6",
104
+ packageVersion: "16.3.7",
105
105
  analyticsData: analyticsContext
106
106
  }); // Button currently calls preventDefault, which is not standard button behaviour
107
107
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/button",
3
- "version": "16.3.6",
3
+ "version": "16.3.7",
4
4
  "sideEffects": false
5
5
  }
@@ -1,34 +1,23 @@
1
1
  /** @jsx jsx */
2
- import React from 'react';
3
- import { jsx } from '@emotion/core';
4
- import { gridSize } from '@atlaskit/theme/constants';
5
- export const groupItemStyles = {
6
- flex: '1 0 auto',
7
- display: 'flex',
8
-
9
- /* margins don't flip when the layout uses dir="rtl", whereas pseudos do */
10
- '& + &::before': {
11
- content: `''`,
12
- display: 'inline-block',
13
- width: `${gridSize() / 2}px`
14
- }
15
- };
2
+ import React, { Fragment } from 'react';
3
+ import { css, jsx } from '@emotion/core';
4
+ const buttonGroupStyles = css({
5
+ display: 'inline-flex',
6
+ gap: 4
7
+ });
16
8
  export default function ButtonGroup({
17
9
  appearance,
18
10
  children
19
11
  }) {
20
12
  return jsx("div", {
21
- css: {
22
- display: 'inline-flex'
23
- }
13
+ css: buttonGroupStyles
24
14
  }, React.Children.map(children, (child, idx) => {
25
15
  if (!child) {
26
16
  return null;
27
17
  }
28
18
 
29
- return jsx("div", {
30
- key: idx,
31
- css: groupItemStyles
19
+ return jsx(Fragment, {
20
+ key: idx
32
21
  }, appearance ?
33
22
  /*#__PURE__*/
34
23
  // eslint-disable-next-line @repo/internal/react/no-clone-element
@@ -68,7 +68,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
68
68
  action: 'clicked',
69
69
  componentName: 'button',
70
70
  packageName: "@atlaskit/button",
71
- packageVersion: "16.3.6",
71
+ packageVersion: "16.3.7",
72
72
  analyticsData: analyticsContext
73
73
  }); // Button currently calls preventDefault, which is not standard button behaviour
74
74
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/button",
3
- "version": "16.3.6",
3
+ "version": "16.3.7",
4
4
  "sideEffects": false
5
5
  }
@@ -1,33 +1,22 @@
1
1
  /** @jsx jsx */
2
- import React from 'react';
3
- import { jsx } from '@emotion/core';
4
- import { gridSize } from '@atlaskit/theme/constants';
5
- export var groupItemStyles = {
6
- flex: '1 0 auto',
7
- display: 'flex',
8
-
9
- /* margins don't flip when the layout uses dir="rtl", whereas pseudos do */
10
- '& + &::before': {
11
- content: "''",
12
- display: 'inline-block',
13
- width: "".concat(gridSize() / 2, "px")
14
- }
15
- };
2
+ import React, { Fragment } from 'react';
3
+ import { css, jsx } from '@emotion/core';
4
+ var buttonGroupStyles = css({
5
+ display: 'inline-flex',
6
+ gap: 4
7
+ });
16
8
  export default function ButtonGroup(_ref) {
17
9
  var appearance = _ref.appearance,
18
10
  children = _ref.children;
19
11
  return jsx("div", {
20
- css: {
21
- display: 'inline-flex'
22
- }
12
+ css: buttonGroupStyles
23
13
  }, React.Children.map(children, function (child, idx) {
24
14
  if (!child) {
25
15
  return null;
26
16
  }
27
17
 
28
- return jsx("div", {
29
- key: idx,
30
- css: groupItemStyles
18
+ return jsx(Fragment, {
19
+ key: idx
31
20
  }, appearance ?
32
21
  /*#__PURE__*/
33
22
  // eslint-disable-next-line @repo/internal/react/no-clone-element
@@ -77,7 +77,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
77
77
  action: 'clicked',
78
78
  componentName: 'button',
79
79
  packageName: "@atlaskit/button",
80
- packageVersion: "16.3.6",
80
+ packageVersion: "16.3.7",
81
81
  analyticsData: analyticsContext
82
82
  }); // Button currently calls preventDefault, which is not standard button behaviour
83
83
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/button",
3
- "version": "16.3.6",
3
+ "version": "16.3.7",
4
4
  "sideEffects": false
5
5
  }
@@ -8,13 +8,4 @@ export declare type ButtonGroupProps = {
8
8
  appearance?: Appearance;
9
9
  children?: React.ReactNode;
10
10
  };
11
- export declare const groupItemStyles: {
12
- flex: string;
13
- display: string;
14
- '& + &::before': {
15
- content: string;
16
- display: string;
17
- width: string;
18
- };
19
- };
20
11
  export default function ButtonGroup({ appearance, children, }: ButtonGroupProps): JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/button",
3
- "version": "16.3.6",
3
+ "version": "16.3.7",
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/"
@@ -34,7 +34,7 @@
34
34
  "@atlaskit/analytics-next": "^8.2.0",
35
35
  "@atlaskit/ds-lib": "^2.1.0",
36
36
  "@atlaskit/spinner": "^15.1.0",
37
- "@atlaskit/theme": "^12.1.0",
37
+ "@atlaskit/theme": "^12.2.0",
38
38
  "@atlaskit/tokens": "^0.10.0",
39
39
  "@babel/runtime": "^7.0.0",
40
40
  "@emotion/core": "^10.0.9"
@@ -46,14 +46,14 @@
46
46
  "@atlaskit/checkbox": "^12.3.0",
47
47
  "@atlaskit/docs": "*",
48
48
  "@atlaskit/icon": "^21.10.0",
49
- "@atlaskit/logo": "^13.8.0",
50
- "@atlaskit/section-message": "^6.1.0",
51
- "@atlaskit/select": "^15.6.0",
49
+ "@atlaskit/logo": "^13.9.0",
50
+ "@atlaskit/section-message": "^6.2.0",
51
+ "@atlaskit/select": "^15.7.0",
52
52
  "@atlaskit/ssr": "*",
53
53
  "@atlaskit/visual-regression": "*",
54
54
  "@atlaskit/webdriver-runner": "*",
55
55
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
56
- "@testing-library/react": "^8.0.1",
56
+ "@testing-library/react": "^12.1.5",
57
57
  "@types/react-router-dom": "^4.3.1",
58
58
  "ast-types": "^0.13.3",
59
59
  "bind-event-listener": "^2.1.1",