@atlaskit/blanket 13.3.4 → 14.0.0

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,29 @@
1
1
  # @atlaskit/blanket
2
2
 
3
+ ## 14.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#176786](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/176786)
8
+ [`30a4108a8fe56`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/30a4108a8fe56) -
9
+ Migrated from `@emotion/react` to `@compiled/react` in order to improve performance, align with
10
+ the rest of the Atlaskit techstack, and support React 18 Streaming SSR. Please note, in order to
11
+ use this version of `@atlaskit/blanket`, you will need to ensure that your bundler is configured
12
+ to handle `.css` imports correctly.
13
+
14
+ Most bundlers come with built-in support for `.css` imports, so you may not need to do anything.
15
+ If you are using a different bundler, please refer to the documentation for that bundler to
16
+ understand how to handle `.css` imports. For more information on the migration, please refer to
17
+ [RFC-73 Migrating our components to Compiled CSS-in-JS](https://community.developer.atlassian.com/t/rfc-73-migrating-our-components-to-compiled-css-in-js/85953).
18
+
19
+ ## 13.3.5
20
+
21
+ ### Patch Changes
22
+
23
+ - [#165531](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/165531)
24
+ [`57f451bda8919`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/57f451bda8919) -
25
+ Adds side-effect config to support Compiled css extraction in third-party apps
26
+
3
27
  ## 13.3.4
4
28
 
5
29
  ### Patch Changes
@@ -0,0 +1,8 @@
1
+
2
+ ._1r04idpf{inset:0}._18m91wug{overflow-y:auto}
3
+ ._1pbybfng{z-index:500}
4
+ ._bfhk18uv{background-color:initial}
5
+ ._bfhk705f{background-color:var(--_10avjlk)}
6
+ ._kqsw1n9t{position:fixed}
7
+ ._lcxv1wug{pointer-events:auto}
8
+ ._lcxvglyw{pointer-events:none}
@@ -1,43 +1,35 @@
1
+ /* blanket.tsx generated by @compiled/babel-plugin v0.32.2 */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
6
  Object.defineProperty(exports, "__esModule", {
5
7
  value: true
6
8
  });
7
9
  exports.default = void 0;
10
+ require("./blanket.compiled.css");
11
+ var _react = _interopRequireWildcard(require("react"));
12
+ var React = _react;
13
+ var _runtime = require("@compiled/react/runtime");
8
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _react = require("react");
10
- var _react2 = require("@emotion/react");
11
15
  var _usePlatformLeafEventHandler = require("@atlaskit/analytics-next/usePlatformLeafEventHandler");
12
16
  var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
13
17
  var _colors = require("@atlaskit/theme/colors");
14
18
  var _constants = require("@atlaskit/theme/constants");
19
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
20
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
21
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /**
17
- * @jsxRuntime classic
18
- * @jsx jsx
19
- */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
22
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
20
23
  var packageName = "@atlaskit/blanket";
21
- var packageVersion = "13.3.4";
24
+ var packageVersion = "14.0.0";
22
25
  var analyticsAttributes = {
23
26
  componentName: 'blanket',
24
27
  packageName: packageName,
25
28
  packageVersion: packageVersion
26
29
  };
27
- var baseStyles = (0, _react2.css)({
28
- position: 'fixed',
29
- zIndex: _constants.layers.blanket(),
30
- inset: 0,
31
- backgroundColor: "var(--ds-blanket, ".concat(_colors.N100A, ")"),
32
- overflowY: 'auto',
33
- pointerEvents: 'initial'
34
- });
35
- var shouldAllowClickThroughStyles = (0, _react2.css)({
36
- pointerEvents: 'none'
37
- });
38
- var invisibleStyles = (0, _react2.css)({
39
- backgroundColor: 'transparent'
40
- });
30
+ var baseStyles = null;
31
+ var shouldAllowClickThroughStyles = null;
32
+ var invisibleStyles = null;
41
33
 
42
34
  /**
43
35
  * __Blanket__
@@ -69,23 +61,17 @@ var Blanket = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)
69
61
  var onMouseDown = (0, _react.useCallback)(function (e) {
70
62
  mouseDownTarget.current = e.target;
71
63
  }, []);
72
- return (
73
- /**
74
- * It is not normally acceptable to add click and key handlers to non-interactive
75
- * elements as this is an accessibility anti-pattern. However, because this
76
- * instance is to enable light dismiss functionality instead of creating an
77
- * inaccessible custom element, we can add role="presentation" so that there
78
- * are no negative impacts to assistive technologies.
79
- */
80
- (0, _react2.jsx)("div", {
81
- role: "presentation",
82
- css: [baseStyles, shouldAllowClickThrough && shouldAllowClickThroughStyles, !isTinted && invisibleStyles],
83
- onClick: onClick,
84
- onMouseDown: onMouseDown,
85
- "data-testid": testId,
86
- ref: ref
87
- }, children)
88
- );
64
+ return /*#__PURE__*/React.createElement("div", {
65
+ role: "presentation",
66
+ onClick: onClick,
67
+ onMouseDown: onMouseDown,
68
+ "data-testid": testId,
69
+ ref: ref,
70
+ className: (0, _runtime.ax)(["_kqsw1n9t _1pbybfng _1r04idpf _bfhk705f _18m91wug _lcxv1wug", shouldAllowClickThrough && "_lcxvglyw", !isTinted && "_bfhk18uv"]),
71
+ style: {
72
+ "--_10avjlk": (0, _runtime.ix)("var(--ds-blanket, ".concat(_colors.N100A, ")"))
73
+ }
74
+ }, children);
89
75
  }));
90
76
  Blanket.displayName = 'Blanket';
91
77
  var _default = exports.default = Blanket;
@@ -0,0 +1,8 @@
1
+
2
+ ._1r04idpf{inset:0}._18m91wug{overflow-y:auto}
3
+ ._1pbybfng{z-index:500}
4
+ ._bfhk10ak{background-color:var(--ds-blanket,rgba(9,30,66,.54))}
5
+ ._bfhk18uv{background-color:initial}
6
+ ._kqsw1n9t{position:fixed}
7
+ ._lcxv1wug{pointer-events:auto}
8
+ ._lcxvglyw{pointer-events:none}
@@ -1,36 +1,22 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
1
+ /* blanket.tsx generated by @compiled/babel-plugin v0.32.2 */
2
+ import "./blanket.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
5
  import { forwardRef, memo, useCallback, useRef } from 'react';
6
-
7
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
- import { css, jsx } from '@emotion/react';
9
6
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
10
7
  import noop from '@atlaskit/ds-lib/noop';
11
8
  import { N100A } from '@atlaskit/theme/colors';
12
9
  import { layers } from '@atlaskit/theme/constants';
13
10
  const packageName = "@atlaskit/blanket";
14
- const packageVersion = "13.3.4";
11
+ const packageVersion = "14.0.0";
15
12
  const analyticsAttributes = {
16
13
  componentName: 'blanket',
17
14
  packageName,
18
15
  packageVersion
19
16
  };
20
- const baseStyles = css({
21
- position: 'fixed',
22
- zIndex: layers.blanket(),
23
- inset: 0,
24
- backgroundColor: `var(--ds-blanket, ${N100A})`,
25
- overflowY: 'auto',
26
- pointerEvents: 'initial'
27
- });
28
- const shouldAllowClickThroughStyles = css({
29
- pointerEvents: 'none'
30
- });
31
- const invisibleStyles = css({
32
- backgroundColor: 'transparent'
33
- });
17
+ const baseStyles = null;
18
+ const shouldAllowClickThroughStyles = null;
19
+ const invisibleStyles = null;
34
20
 
35
21
  /**
36
22
  * __Blanket__
@@ -59,23 +45,14 @@ const Blanket = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Blanket({
59
45
  const onMouseDown = useCallback(e => {
60
46
  mouseDownTarget.current = e.target;
61
47
  }, []);
62
- return (
63
- /**
64
- * It is not normally acceptable to add click and key handlers to non-interactive
65
- * elements as this is an accessibility anti-pattern. However, because this
66
- * instance is to enable light dismiss functionality instead of creating an
67
- * inaccessible custom element, we can add role="presentation" so that there
68
- * are no negative impacts to assistive technologies.
69
- */
70
- jsx("div", {
71
- role: "presentation",
72
- css: [baseStyles, shouldAllowClickThrough && shouldAllowClickThroughStyles, !isTinted && invisibleStyles],
73
- onClick: onClick,
74
- onMouseDown: onMouseDown,
75
- "data-testid": testId,
76
- ref: ref
77
- }, children)
78
- );
48
+ return /*#__PURE__*/React.createElement("div", {
49
+ role: "presentation",
50
+ onClick: onClick,
51
+ onMouseDown: onMouseDown,
52
+ "data-testid": testId,
53
+ ref: ref,
54
+ className: ax(["_kqsw1n9t _1pbybfng _1r04idpf _bfhk10ak _18m91wug _lcxv1wug", shouldAllowClickThrough && "_lcxvglyw", !isTinted && "_bfhk18uv"])
55
+ }, children);
79
56
  }));
80
57
  Blanket.displayName = 'Blanket';
81
58
  export default Blanket;
@@ -0,0 +1,8 @@
1
+
2
+ ._1r04idpf{inset:0}._18m91wug{overflow-y:auto}
3
+ ._1pbybfng{z-index:500}
4
+ ._bfhk18uv{background-color:initial}
5
+ ._bfhk705f{background-color:var(--_10avjlk)}
6
+ ._kqsw1n9t{position:fixed}
7
+ ._lcxv1wug{pointer-events:auto}
8
+ ._lcxvglyw{pointer-events:none}
@@ -1,39 +1,25 @@
1
+ /* blanket.tsx generated by @compiled/babel-plugin v0.32.2 */
1
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ import "./blanket.compiled.css";
4
+ import * as React from 'react';
5
+ import { ax, ix } from "@compiled/react/runtime";
2
6
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
7
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- /**
5
- * @jsxRuntime classic
6
- * @jsx jsx
7
- */
8
8
  import { forwardRef, memo, useCallback, useRef } from 'react';
9
-
10
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
11
- import { css, jsx } from '@emotion/react';
12
9
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
13
10
  import noop from '@atlaskit/ds-lib/noop';
14
11
  import { N100A } from '@atlaskit/theme/colors';
15
12
  import { layers } from '@atlaskit/theme/constants';
16
13
  var packageName = "@atlaskit/blanket";
17
- var packageVersion = "13.3.4";
14
+ var packageVersion = "14.0.0";
18
15
  var analyticsAttributes = {
19
16
  componentName: 'blanket',
20
17
  packageName: packageName,
21
18
  packageVersion: packageVersion
22
19
  };
23
- var baseStyles = css({
24
- position: 'fixed',
25
- zIndex: layers.blanket(),
26
- inset: 0,
27
- backgroundColor: "var(--ds-blanket, ".concat(N100A, ")"),
28
- overflowY: 'auto',
29
- pointerEvents: 'initial'
30
- });
31
- var shouldAllowClickThroughStyles = css({
32
- pointerEvents: 'none'
33
- });
34
- var invisibleStyles = css({
35
- backgroundColor: 'transparent'
36
- });
20
+ var baseStyles = null;
21
+ var shouldAllowClickThroughStyles = null;
22
+ var invisibleStyles = null;
37
23
 
38
24
  /**
39
25
  * __Blanket__
@@ -65,23 +51,17 @@ var Blanket = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Blanket(_ref,
65
51
  var onMouseDown = useCallback(function (e) {
66
52
  mouseDownTarget.current = e.target;
67
53
  }, []);
68
- return (
69
- /**
70
- * It is not normally acceptable to add click and key handlers to non-interactive
71
- * elements as this is an accessibility anti-pattern. However, because this
72
- * instance is to enable light dismiss functionality instead of creating an
73
- * inaccessible custom element, we can add role="presentation" so that there
74
- * are no negative impacts to assistive technologies.
75
- */
76
- jsx("div", {
77
- role: "presentation",
78
- css: [baseStyles, shouldAllowClickThrough && shouldAllowClickThroughStyles, !isTinted && invisibleStyles],
79
- onClick: onClick,
80
- onMouseDown: onMouseDown,
81
- "data-testid": testId,
82
- ref: ref
83
- }, children)
84
- );
54
+ return /*#__PURE__*/React.createElement("div", {
55
+ role: "presentation",
56
+ onClick: onClick,
57
+ onMouseDown: onMouseDown,
58
+ "data-testid": testId,
59
+ ref: ref,
60
+ className: ax(["_kqsw1n9t _1pbybfng _1r04idpf _bfhk705f _18m91wug _lcxv1wug", shouldAllowClickThrough && "_lcxvglyw", !isTinted && "_bfhk18uv"]),
61
+ style: {
62
+ "--_10avjlk": ix("var(--ds-blanket, ".concat(N100A, ")"))
63
+ }
64
+ }, children);
85
65
  }));
86
66
  Blanket.displayName = 'Blanket';
87
67
  export default Blanket;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/blanket",
3
- "version": "13.3.4",
3
+ "version": "14.0.0",
4
4
  "description": "A blanket covers the underlying UI for a layered component, such as a modal dialog or a tooltip.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -20,7 +20,9 @@
20
20
  ]
21
21
  }
22
22
  },
23
- "sideEffects": false,
23
+ "sideEffects": [
24
+ "**/*.compiled.css"
25
+ ],
24
26
  "atlaskit:src": "src/index.tsx",
25
27
  "homepage": "https://atlassian.design/components/blanket",
26
28
  "atlassian": {
@@ -28,7 +30,7 @@
28
30
  "runReact18": true,
29
31
  "website": {
30
32
  "name": "Blanket",
31
- "category": "Components"
33
+ "category": "Overlays and layering"
32
34
  }
33
35
  },
34
36
  "af:exports": {
@@ -36,13 +38,14 @@
36
38
  "./types": "./src/entry-points/types.tsx"
37
39
  },
38
40
  "dependencies": {
39
- "@atlaskit/analytics-next": "^10.1.0",
41
+ "@atlaskit/analytics-next": "^10.2.0",
40
42
  "@atlaskit/codemod-utils": "^4.2.0",
41
- "@atlaskit/ds-lib": "^3.1.0",
43
+ "@atlaskit/css": "^0.7.0",
44
+ "@atlaskit/ds-lib": "^3.3.0",
42
45
  "@atlaskit/theme": "^14.0.0",
43
- "@atlaskit/tokens": "^2.0.0",
46
+ "@atlaskit/tokens": "^2.4.0",
44
47
  "@babel/runtime": "^7.0.0",
45
- "@emotion/react": "^11.7.1"
48
+ "@compiled/react": "^0.18.1"
46
49
  },
47
50
  "peerDependencies": {
48
51
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
@@ -50,9 +53,9 @@
50
53
  "devDependencies": {
51
54
  "@af/accessibility-testing": "*",
52
55
  "@af/integration-testing": "*",
53
- "@atlaskit/layering": "^0.6.0",
56
+ "@atlaskit/layering": "^1.0.0",
54
57
  "@atlaskit/ssr": "*",
55
- "@atlaskit/toggle": "^13.4.0",
58
+ "@atlaskit/toggle": "^14.0.0",
56
59
  "@atlaskit/visual-regression": "*",
57
60
  "@testing-library/dom": "^10.1.0",
58
61
  "@testing-library/react": "^12.1.5",
@@ -60,7 +63,7 @@
60
63
  "jscodeshift": "^0.13.0",
61
64
  "react-dom": "^16.8.0",
62
65
  "react-lorem-component": "^0.13.0",
63
- "storybook-addon-performance": "^0.16.0",
66
+ "storybook-addon-performance": "^0.17.3",
64
67
  "typescript": "~5.4.2",
65
68
  "wait-for-expect": "^1.2.0"
66
69
  },
@@ -3,7 +3,9 @@
3
3
  "main": "../dist/cjs/entry-points/types.js",
4
4
  "module": "../dist/esm/entry-points/types.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/types.js",
6
- "sideEffects": false,
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
7
9
  "types": "../dist/types/entry-points/types.d.ts",
8
10
  "typesVersions": {
9
11
  ">=4.5 <5.4": {