@atlaskit/right-side-panel 2.0.2 → 3.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.
Files changed (26) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/components/RightSidePanel/constants.js +2 -4
  3. package/dist/cjs/components/RightSidePanel/index.js +2 -20
  4. package/dist/cjs/components/RightSidePanel/styled.compiled.css +14 -0
  5. package/dist/cjs/components/RightSidePanel/styled.js +48 -37
  6. package/dist/cjs/components/styled.compiled.css +7 -0
  7. package/dist/cjs/components/styled.js +20 -19
  8. package/dist/es2019/components/RightSidePanel/constants.js +1 -3
  9. package/dist/es2019/components/RightSidePanel/index.js +2 -24
  10. package/dist/es2019/components/RightSidePanel/styled.compiled.css +16 -0
  11. package/dist/es2019/components/RightSidePanel/styled.js +37 -33
  12. package/dist/es2019/components/styled.compiled.css +7 -0
  13. package/dist/es2019/components/styled.js +18 -19
  14. package/dist/esm/components/RightSidePanel/constants.js +1 -3
  15. package/dist/esm/components/RightSidePanel/index.js +2 -20
  16. package/dist/esm/components/RightSidePanel/styled.compiled.css +14 -0
  17. package/dist/esm/components/RightSidePanel/styled.js +47 -33
  18. package/dist/esm/components/styled.compiled.css +7 -0
  19. package/dist/esm/components/styled.js +20 -19
  20. package/dist/types/components/RightSidePanel/constants.d.ts +0 -2
  21. package/dist/types/components/RightSidePanel/styled.d.ts +14 -9
  22. package/dist/types/components/styled.d.ts +12 -9
  23. package/dist/types-ts4.5/components/RightSidePanel/constants.d.ts +0 -2
  24. package/dist/types-ts4.5/components/RightSidePanel/styled.d.ts +14 -9
  25. package/dist/types-ts4.5/components/styled.d.ts +12 -9
  26. package/package.json +7 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/right-side-panel
2
2
 
3
+ ## 3.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#142581](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/142581)
8
+ [`94d88942d9b95`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/94d88942d9b95) -
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.
11
+
12
+ Please note, in order to use this version of `@atlaskit/right-side-panel`, you will need to ensure
13
+ that your bundler is configured to handle `.css` imports correctly. Most bundlers come with
14
+ built-in support for `.css` imports, so you may not need to do anything. If you are using a
15
+ different bundler, please refer to the documentation for that bundler to understand how to handle
16
+ `.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
+
3
19
  ## 2.0.2
4
20
 
5
21
  ### Patch Changes
@@ -3,7 +3,5 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.transitionTimingFunction = exports.transitionDurationMs = exports.panelWidth = void 0;
7
- var transitionDurationMs = exports.transitionDurationMs = 220;
8
- var transitionTimingFunction = exports.transitionTimingFunction = 'cubic-bezier(0.2, 0, 0, 1)';
9
- var panelWidth = exports.panelWidth = 368;
6
+ exports.transitionTimingFunction = void 0;
7
+ var transitionTimingFunction = exports.transitionTimingFunction = 'cubic-bezier(0.2, 0, 0, 1)';
@@ -16,29 +16,11 @@ var _react = _interopRequireWildcard(require("react"));
16
16
  var _exenv = require("exenv");
17
17
  var _reactDom = require("react-dom");
18
18
  var _reactTransitionGroup = require("react-transition-group");
19
- var _constants = require("./constants");
20
19
  var _styled = require("./styled");
21
20
  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); }
22
21
  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; }
23
- 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; }
24
- 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; }
25
22
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
26
23
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
27
- var defaultStyle = {
28
- transition: "width ".concat(_constants.transitionDurationMs, "ms,\n flex ").concat(_constants.transitionDurationMs, "ms"),
29
- width: "0",
30
- flex: "0 0 0"
31
- };
32
- var transitionStyles = {
33
- entered: {
34
- width: "".concat(_constants.panelWidth, "px"),
35
- flex: "0 0 ".concat(_constants.panelWidth, "px")
36
- },
37
- exited: {
38
- width: 0,
39
- flex: "0 0 0"
40
- }
41
- };
42
24
  var RightSidePanel = exports.RightSidePanel = /*#__PURE__*/function (_Component) {
43
25
  function RightSidePanel() {
44
26
  var _this;
@@ -82,7 +64,7 @@ var RightSidePanel = exports.RightSidePanel = /*#__PURE__*/function (_Component)
82
64
  onCloseAnimationFinished = _this$props.onCloseAnimationFinished;
83
65
  return /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.Transition, {
84
66
  in: isOpen,
85
- timeout: _constants.transitionDurationMs,
67
+ timeout: _styled.transitionDurationMs,
86
68
  mountOnEnter: mountOnEnter,
87
69
  unmountOnExit: unmountOnExit,
88
70
  appear: !skipAnimationOnMount,
@@ -92,7 +74,7 @@ var RightSidePanel = exports.RightSidePanel = /*#__PURE__*/function (_Component)
92
74
  onExited: onCloseAnimationFinished
93
75
  }, function (state) {
94
76
  return /*#__PURE__*/_react.default.createElement(_styled.RightSidePanelDrawer, {
95
- style: _objectSpread(_objectSpread({}, defaultStyle), transitionStyles[state])
77
+ transitionState: state
96
78
  }, /*#__PURE__*/_react.default.createElement(_styled.RightSidePanelDrawerContent, null, children));
97
79
  }), Container);
98
80
  }
@@ -0,0 +1,14 @@
1
+
2
+ ._kkes1j74{flex:var(--_14jqjno)}
3
+ ._1kl75djz{border-left:var(--_1na4za0)}._16jlkb7n{flex-grow:1}
4
+ ._18m915vq{overflow-y:hidden}
5
+ ._1bsb1xdr{width:var(--_h7eijm)}
6
+ ._1o9zkb7n{flex-shrink:1}
7
+ ._1reo15vq{overflow-x:hidden}
8
+ ._2lx21bp4{flex-direction:column}
9
+ ._4t3i1osq{height:100%}
10
+ ._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
11
+ ._i0dlf1ug{flex-basis:0%}
12
+ ._kqsw1n9t{position:fixed}
13
+ ._kqswh2mm{position:relative}
14
+ ._vchhusvi{box-sizing:border-box}
@@ -1,43 +1,54 @@
1
+ /* styled.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.RightSidePanelDrawerContent = exports.RightSidePanelDrawer = void 0;
9
- var _styled = _interopRequireDefault(require("@emotion/styled"));
10
- var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
11
- var _constants = require("./constants");
12
- 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); }
13
- 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; }
14
- /**
15
- * @jsxRuntime classic
16
- * @jsx jsx
17
- */
18
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
19
-
20
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
21
- var RightSidePanelDrawer = exports.RightSidePanelDrawer = _styled.default.div({
22
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
23
- width: "".concat(_constants.panelWidth, "px"),
24
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
25
- flex: "0 0 ".concat(_constants.panelWidth, "px"),
26
- position: 'relative',
27
- overflow: 'hidden'
28
- });
29
-
30
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
31
- var RightSidePanelDrawerContent = exports.RightSidePanelDrawerContent = _styled.default.div({
32
- backgroundColor: "var(--ds-surface-overlay, white)",
33
- boxSizing: 'border-box',
34
- flex: 1,
35
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
36
- borderLeft: "3px solid ".concat("var(--ds-border, ".concat(colors.N30, ")")),
37
- overflow: 'hidden',
38
- flexDirection: 'column',
39
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
40
- width: "".concat(_constants.panelWidth, "px"),
41
- height: '100%',
42
- position: 'fixed'
43
- });
8
+ exports.transitionDurationMs = exports.RightSidePanelDrawerContent = exports.RightSidePanelDrawer = void 0;
9
+ require("./styled.compiled.css");
10
+ var _runtime = require("@compiled/react/runtime");
11
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
+ var _react = _interopRequireDefault(require("react"));
13
+ var _colors = require("@atlaskit/theme/colors");
14
+ 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; }
15
+ 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; }
16
+ var PANEL_WIDTH = 368;
17
+ var transitionDurationMs = exports.transitionDurationMs = 220;
18
+ var rightSidePanelDrawerStyles = null;
19
+ var rightSidePanelDrawerTransitionStyles = {
20
+ entered: {
21
+ width: "".concat(PANEL_WIDTH, "px"),
22
+ flex: "0 0 ".concat(PANEL_WIDTH, "px")
23
+ },
24
+ exited: {
25
+ width: 0,
26
+ flex: "0 0 0"
27
+ }
28
+ };
29
+ var RightSidePanelDrawer = exports.RightSidePanelDrawer = function RightSidePanelDrawer(_ref) {
30
+ var transitionState = _ref.transitionState,
31
+ children = _ref.children;
32
+ return /*#__PURE__*/_react.default.createElement("div", {
33
+ className: (0, _runtime.ax)(["_kkes1j74 _1reo15vq _18m915vq _1bsb1xdr _kqswh2mm"]),
34
+ style: _objectSpread(_objectSpread({
35
+ transition: "width ".concat(transitionDurationMs, "ms, flex ").concat(transitionDurationMs, "ms"),
36
+ width: "0",
37
+ flex: "0 0 0"
38
+ }, rightSidePanelDrawerTransitionStyles[transitionState]), {}, {
39
+ "--_h7eijm": (0, _runtime.ix)("".concat(PANEL_WIDTH, "px")),
40
+ "--_14jqjno": (0, _runtime.ix)("0 0 ".concat(PANEL_WIDTH, "px"))
41
+ })
42
+ }, children);
43
+ };
44
+ var rightSidePanelDrawerContentStyles = null;
45
+ var RightSidePanelDrawerContent = exports.RightSidePanelDrawerContent = function RightSidePanelDrawerContent(_ref2) {
46
+ var children = _ref2.children;
47
+ return /*#__PURE__*/_react.default.createElement("div", {
48
+ className: (0, _runtime.ax)(["_16jlkb7n _1o9zkb7n _i0dlf1ug _1reo15vq _18m915vq _1kl75djz _bfhk1bhr _vchhusvi _2lx21bp4 _1bsb1xdr _4t3i1osq _kqsw1n9t"]),
49
+ style: {
50
+ "--_1na4za0": (0, _runtime.ix)("3px solid ".concat("var(--ds-border, ".concat(_colors.N30, ")"))),
51
+ "--_h7eijm": (0, _runtime.ix)("".concat(PANEL_WIDTH, "px"))
52
+ }
53
+ }, children);
54
+ };
@@ -0,0 +1,7 @@
1
+ ._16jlkb7n{flex-grow:1}
2
+ ._1e0c1txw{display:flex}
3
+ ._1o9zkb7n{flex-shrink:1}
4
+ ._1reo15vq{overflow-x:hidden}
5
+ ._1ul9idpf{min-width:0}
6
+ ._i0dl1wug{flex-basis:auto}
7
+ ._kqswh2mm{position:relative}
@@ -1,3 +1,4 @@
1
+ /* styled.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -5,22 +6,22 @@ Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.FlexContainer = exports.ContentWrapper = void 0;
8
- var _styled = _interopRequireDefault(require("@emotion/styled"));
9
- /**
10
- * @jsxRuntime classic
11
- * @jsx jsx
12
- */
13
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
14
-
15
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
16
- var FlexContainer = exports.FlexContainer = _styled.default.div({
17
- display: 'flex'
18
- });
19
-
20
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
21
- var ContentWrapper = exports.ContentWrapper = _styled.default.div({
22
- position: 'relative',
23
- minWidth: 0,
24
- flex: '1 1 auto',
25
- overflowX: 'hidden'
26
- });
9
+ require("./styled.compiled.css");
10
+ var _runtime = require("@compiled/react/runtime");
11
+ var _react = _interopRequireDefault(require("react"));
12
+ var flexContainerStyles = null;
13
+ var FlexContainer = exports.FlexContainer = function FlexContainer(_ref) {
14
+ var id = _ref.id,
15
+ children = _ref.children;
16
+ return /*#__PURE__*/_react.default.createElement("div", {
17
+ id: id,
18
+ className: (0, _runtime.ax)(["_1e0c1txw"])
19
+ }, children);
20
+ };
21
+ var contentWrapperStyles = null;
22
+ var ContentWrapper = exports.ContentWrapper = function ContentWrapper(_ref2) {
23
+ var children = _ref2.children;
24
+ return /*#__PURE__*/_react.default.createElement("div", {
25
+ className: (0, _runtime.ax)(["_16jlkb7n _1o9zkb7n _i0dl1wug _kqswh2mm _1ul9idpf _1reo15vq"])
26
+ }, children);
27
+ };
@@ -1,3 +1 @@
1
- export const transitionDurationMs = 220;
2
- export const transitionTimingFunction = 'cubic-bezier(0.2, 0, 0, 1)';
3
- export const panelWidth = 368;
1
+ export const transitionTimingFunction = 'cubic-bezier(0.2, 0, 0, 1)';
@@ -4,24 +4,7 @@ import { Component } from 'react';
4
4
  import { canUseDOM } from 'exenv';
5
5
  import { createPortal } from 'react-dom';
6
6
  import { Transition } from 'react-transition-group';
7
- import { transitionDurationMs, panelWidth } from './constants';
8
- import { RightSidePanelDrawer, RightSidePanelDrawerContent } from './styled';
9
- const defaultStyle = {
10
- transition: `width ${transitionDurationMs}ms,
11
- flex ${transitionDurationMs}ms`,
12
- width: `0`,
13
- flex: `0 0 0`
14
- };
15
- const transitionStyles = {
16
- entered: {
17
- width: `${panelWidth}px`,
18
- flex: `0 0 ${panelWidth}px`
19
- },
20
- exited: {
21
- width: 0,
22
- flex: `0 0 0`
23
- }
24
- };
7
+ import { RightSidePanelDrawer, RightSidePanelDrawerContent, transitionDurationMs } from './styled';
25
8
  export class RightSidePanel extends Component {
26
9
  constructor(...args) {
27
10
  super(...args);
@@ -59,12 +42,7 @@ export class RightSidePanel extends Component {
59
42
  onEntered: onOpenAnimationFinished,
60
43
  onExited: onCloseAnimationFinished
61
44
  }, state => /*#__PURE__*/React.createElement(RightSidePanelDrawer, {
62
- style: {
63
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
64
- ...defaultStyle,
65
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
66
- ...transitionStyles[state]
67
- }
45
+ transitionState: state
68
46
  }, /*#__PURE__*/React.createElement(RightSidePanelDrawerContent, null, children))), Container);
69
47
  }
70
48
  render() {
@@ -0,0 +1,16 @@
1
+
2
+ ._1kl71osx{border-left:3px solid var(--ds-border,#ebecf0)}._16jlidpf{flex-grow:0}
3
+ ._16jlkb7n{flex-grow:1}
4
+ ._18m915vq{overflow-y:hidden}
5
+ ._1bsb1feq{width:23pc}
6
+ ._1o9zidpf{flex-shrink:0}
7
+ ._1o9zkb7n{flex-shrink:1}
8
+ ._1reo15vq{overflow-x:hidden}
9
+ ._2lx21bp4{flex-direction:column}
10
+ ._4t3i1osq{height:100%}
11
+ ._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
12
+ ._i0dlf1ug{flex-basis:0%}
13
+ ._i0dlorbt{flex-basis:368px}
14
+ ._kqsw1n9t{position:fixed}
15
+ ._kqswh2mm{position:relative}
16
+ ._vchhusvi{box-sizing:border-box}
@@ -1,33 +1,37 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
- import styled from '@emotion/styled';
7
- import * as colors from '@atlaskit/theme/colors';
8
- import { panelWidth } from './constants';
9
-
10
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
11
- export const RightSidePanelDrawer = styled.div({
12
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
13
- width: `${panelWidth}px`,
14
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
15
- flex: `0 0 ${panelWidth}px`,
16
- position: 'relative',
17
- overflow: 'hidden'
18
- });
19
-
20
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
21
- export const RightSidePanelDrawerContent = styled.div({
22
- backgroundColor: "var(--ds-surface-overlay, white)",
23
- boxSizing: 'border-box',
24
- flex: 1,
25
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
26
- borderLeft: `3px solid ${`var(--ds-border, ${colors.N30})`}`,
27
- overflow: 'hidden',
28
- flexDirection: 'column',
29
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
30
- width: `${panelWidth}px`,
31
- height: '100%',
32
- position: 'fixed'
33
- });
1
+ /* styled.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import "./styled.compiled.css";
3
+ import { ax, ix } from "@compiled/react/runtime";
4
+ import React from 'react';
5
+ import { N30 } from '@atlaskit/theme/colors';
6
+ const PANEL_WIDTH = 368;
7
+ export const transitionDurationMs = 220;
8
+ const rightSidePanelDrawerStyles = null;
9
+ const rightSidePanelDrawerTransitionStyles = {
10
+ entered: {
11
+ width: `${PANEL_WIDTH}px`,
12
+ flex: `0 0 ${PANEL_WIDTH}px`
13
+ },
14
+ exited: {
15
+ width: 0,
16
+ flex: `0 0 0`
17
+ }
18
+ };
19
+ export const RightSidePanelDrawer = ({
20
+ transitionState,
21
+ children
22
+ }) => /*#__PURE__*/React.createElement("div", {
23
+ style: {
24
+ transition: `width ${transitionDurationMs}ms, flex ${transitionDurationMs}ms`,
25
+ width: `0`,
26
+ flex: `0 0 0`,
27
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
28
+ ...rightSidePanelDrawerTransitionStyles[transitionState]
29
+ },
30
+ className: ax(["_16jlidpf _1o9zidpf _i0dlorbt _1reo15vq _18m915vq _1bsb1feq _kqswh2mm"])
31
+ }, children);
32
+ const rightSidePanelDrawerContentStyles = null;
33
+ export const RightSidePanelDrawerContent = ({
34
+ children
35
+ }) => /*#__PURE__*/React.createElement("div", {
36
+ className: ax(["_16jlkb7n _1o9zkb7n _i0dlf1ug _1reo15vq _18m915vq _1kl71osx _bfhk1bhr _vchhusvi _2lx21bp4 _1bsb1feq _4t3i1osq _kqsw1n9t"])
37
+ }, children);
@@ -0,0 +1,7 @@
1
+ ._16jlkb7n{flex-grow:1}
2
+ ._1e0c1txw{display:flex}
3
+ ._1o9zkb7n{flex-shrink:1}
4
+ ._1reo15vq{overflow-x:hidden}
5
+ ._1ul9idpf{min-width:0}
6
+ ._i0dl1wug{flex-basis:auto}
7
+ ._kqswh2mm{position:relative}
@@ -1,19 +1,18 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
- import styled from '@emotion/styled';
7
-
8
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
9
- export const FlexContainer = styled.div({
10
- display: 'flex'
11
- });
12
-
13
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
14
- export const ContentWrapper = styled.div({
15
- position: 'relative',
16
- minWidth: 0,
17
- flex: '1 1 auto',
18
- overflowX: 'hidden'
19
- });
1
+ /* styled.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import "./styled.compiled.css";
3
+ import { ax, ix } from "@compiled/react/runtime";
4
+ import React from 'react';
5
+ const flexContainerStyles = null;
6
+ export const FlexContainer = ({
7
+ id,
8
+ children
9
+ }) => /*#__PURE__*/React.createElement("div", {
10
+ id: id,
11
+ className: ax(["_1e0c1txw"])
12
+ }, children);
13
+ const contentWrapperStyles = null;
14
+ export const ContentWrapper = ({
15
+ children
16
+ }) => /*#__PURE__*/React.createElement("div", {
17
+ className: ax(["_16jlkb7n _1o9zkb7n _i0dl1wug _kqswh2mm _1ul9idpf _1reo15vq"])
18
+ }, children);
@@ -1,3 +1 @@
1
- export var transitionDurationMs = 220;
2
- export var transitionTimingFunction = 'cubic-bezier(0.2, 0, 0, 1)';
3
- export var panelWidth = 368;
1
+ export var transitionTimingFunction = 'cubic-bezier(0.2, 0, 0, 1)';
@@ -4,8 +4,6 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
4
4
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
5
  import _inherits from "@babel/runtime/helpers/inherits";
6
6
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
- 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; }
8
- 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; }
9
7
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
8
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
9
  import React from 'react';
@@ -13,23 +11,7 @@ import { Component } from 'react';
13
11
  import { canUseDOM } from 'exenv';
14
12
  import { createPortal } from 'react-dom';
15
13
  import { Transition } from 'react-transition-group';
16
- import { transitionDurationMs, panelWidth } from './constants';
17
- import { RightSidePanelDrawer, RightSidePanelDrawerContent } from './styled';
18
- var defaultStyle = {
19
- transition: "width ".concat(transitionDurationMs, "ms,\n flex ").concat(transitionDurationMs, "ms"),
20
- width: "0",
21
- flex: "0 0 0"
22
- };
23
- var transitionStyles = {
24
- entered: {
25
- width: "".concat(panelWidth, "px"),
26
- flex: "0 0 ".concat(panelWidth, "px")
27
- },
28
- exited: {
29
- width: 0,
30
- flex: "0 0 0"
31
- }
32
- };
14
+ import { RightSidePanelDrawer, RightSidePanelDrawerContent, transitionDurationMs } from './styled';
33
15
  export var RightSidePanel = /*#__PURE__*/function (_Component) {
34
16
  function RightSidePanel() {
35
17
  var _this;
@@ -83,7 +65,7 @@ export var RightSidePanel = /*#__PURE__*/function (_Component) {
83
65
  onExited: onCloseAnimationFinished
84
66
  }, function (state) {
85
67
  return /*#__PURE__*/React.createElement(RightSidePanelDrawer, {
86
- style: _objectSpread(_objectSpread({}, defaultStyle), transitionStyles[state])
68
+ transitionState: state
87
69
  }, /*#__PURE__*/React.createElement(RightSidePanelDrawerContent, null, children));
88
70
  }), Container);
89
71
  }
@@ -0,0 +1,14 @@
1
+
2
+ ._kkes1j74{flex:var(--_14jqjno)}
3
+ ._1kl75djz{border-left:var(--_1na4za0)}._16jlkb7n{flex-grow:1}
4
+ ._18m915vq{overflow-y:hidden}
5
+ ._1bsb1xdr{width:var(--_h7eijm)}
6
+ ._1o9zkb7n{flex-shrink:1}
7
+ ._1reo15vq{overflow-x:hidden}
8
+ ._2lx21bp4{flex-direction:column}
9
+ ._4t3i1osq{height:100%}
10
+ ._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
11
+ ._i0dlf1ug{flex-basis:0%}
12
+ ._kqsw1n9t{position:fixed}
13
+ ._kqswh2mm{position:relative}
14
+ ._vchhusvi{box-sizing:border-box}
@@ -1,33 +1,47 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
- import styled from '@emotion/styled';
7
- import * as colors from '@atlaskit/theme/colors';
8
- import { panelWidth } from './constants';
9
-
10
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
11
- export var RightSidePanelDrawer = styled.div({
12
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
13
- width: "".concat(panelWidth, "px"),
14
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
15
- flex: "0 0 ".concat(panelWidth, "px"),
16
- position: 'relative',
17
- overflow: 'hidden'
18
- });
19
-
20
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
21
- export var RightSidePanelDrawerContent = styled.div({
22
- backgroundColor: "var(--ds-surface-overlay, white)",
23
- boxSizing: 'border-box',
24
- flex: 1,
25
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
26
- borderLeft: "3px solid ".concat("var(--ds-border, ".concat(colors.N30, ")")),
27
- overflow: 'hidden',
28
- flexDirection: 'column',
29
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
30
- width: "".concat(panelWidth, "px"),
31
- height: '100%',
32
- position: 'fixed'
33
- });
1
+ /* styled.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ import "./styled.compiled.css";
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ 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; }
6
+ 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; }
7
+ import React from 'react';
8
+ import { N30 } from '@atlaskit/theme/colors';
9
+ var PANEL_WIDTH = 368;
10
+ export var transitionDurationMs = 220;
11
+ var rightSidePanelDrawerStyles = null;
12
+ var rightSidePanelDrawerTransitionStyles = {
13
+ entered: {
14
+ width: "".concat(PANEL_WIDTH, "px"),
15
+ flex: "0 0 ".concat(PANEL_WIDTH, "px")
16
+ },
17
+ exited: {
18
+ width: 0,
19
+ flex: "0 0 0"
20
+ }
21
+ };
22
+ export var RightSidePanelDrawer = function RightSidePanelDrawer(_ref) {
23
+ var transitionState = _ref.transitionState,
24
+ children = _ref.children;
25
+ return /*#__PURE__*/React.createElement("div", {
26
+ className: ax(["_kkes1j74 _1reo15vq _18m915vq _1bsb1xdr _kqswh2mm"]),
27
+ style: _objectSpread(_objectSpread({
28
+ transition: "width ".concat(transitionDurationMs, "ms, flex ").concat(transitionDurationMs, "ms"),
29
+ width: "0",
30
+ flex: "0 0 0"
31
+ }, rightSidePanelDrawerTransitionStyles[transitionState]), {}, {
32
+ "--_h7eijm": ix("".concat(PANEL_WIDTH, "px")),
33
+ "--_14jqjno": ix("0 0 ".concat(PANEL_WIDTH, "px"))
34
+ })
35
+ }, children);
36
+ };
37
+ var rightSidePanelDrawerContentStyles = null;
38
+ export var RightSidePanelDrawerContent = function RightSidePanelDrawerContent(_ref2) {
39
+ var children = _ref2.children;
40
+ return /*#__PURE__*/React.createElement("div", {
41
+ className: ax(["_16jlkb7n _1o9zkb7n _i0dlf1ug _1reo15vq _18m915vq _1kl75djz _bfhk1bhr _vchhusvi _2lx21bp4 _1bsb1xdr _4t3i1osq _kqsw1n9t"]),
42
+ style: {
43
+ "--_1na4za0": ix("3px solid ".concat("var(--ds-border, ".concat(N30, ")"))),
44
+ "--_h7eijm": ix("".concat(PANEL_WIDTH, "px"))
45
+ }
46
+ }, children);
47
+ };
@@ -0,0 +1,7 @@
1
+ ._16jlkb7n{flex-grow:1}
2
+ ._1e0c1txw{display:flex}
3
+ ._1o9zkb7n{flex-shrink:1}
4
+ ._1reo15vq{overflow-x:hidden}
5
+ ._1ul9idpf{min-width:0}
6
+ ._i0dl1wug{flex-basis:auto}
7
+ ._kqswh2mm{position:relative}
@@ -1,19 +1,20 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
- import styled from '@emotion/styled';
7
-
8
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
9
- export var FlexContainer = styled.div({
10
- display: 'flex'
11
- });
12
-
13
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
14
- export var ContentWrapper = styled.div({
15
- position: 'relative',
16
- minWidth: 0,
17
- flex: '1 1 auto',
18
- overflowX: 'hidden'
19
- });
1
+ /* styled.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import "./styled.compiled.css";
3
+ import { ax, ix } from "@compiled/react/runtime";
4
+ import React from 'react';
5
+ var flexContainerStyles = null;
6
+ export var FlexContainer = function FlexContainer(_ref) {
7
+ var id = _ref.id,
8
+ children = _ref.children;
9
+ return /*#__PURE__*/React.createElement("div", {
10
+ id: id,
11
+ className: ax(["_1e0c1txw"])
12
+ }, children);
13
+ };
14
+ var contentWrapperStyles = null;
15
+ export var ContentWrapper = function ContentWrapper(_ref2) {
16
+ var children = _ref2.children;
17
+ return /*#__PURE__*/React.createElement("div", {
18
+ className: ax(["_16jlkb7n _1o9zkb7n _i0dl1wug _kqswh2mm _1ul9idpf _1reo15vq"])
19
+ }, children);
20
+ };
@@ -1,3 +1 @@
1
- export declare const transitionDurationMs = 220;
2
1
  export declare const transitionTimingFunction = "cubic-bezier(0.2, 0, 0, 1)";
3
- export declare const panelWidth = 368;
@@ -1,9 +1,14 @@
1
- /// <reference types="react" />
2
- export declare const RightSidePanelDrawer: import("@emotion/styled").StyledComponent<{
3
- theme?: import("@emotion/react").Theme | undefined;
4
- as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
- export declare const RightSidePanelDrawerContent: import("@emotion/styled").StyledComponent<{
7
- theme?: import("@emotion/react").Theme | undefined;
8
- as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
9
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import React from 'react';
6
+ import { TransitionStatus } from '.';
7
+ export declare const transitionDurationMs = 220;
8
+ export declare const RightSidePanelDrawer: ({ transitionState, children, }: {
9
+ transitionState: TransitionStatus;
10
+ children: React.ReactNode;
11
+ }) => JSX.Element;
12
+ export declare const RightSidePanelDrawerContent: ({ children }: {
13
+ children: React.ReactNode;
14
+ }) => JSX.Element;
@@ -1,9 +1,12 @@
1
- /// <reference types="react" />
2
- export declare const FlexContainer: import("@emotion/styled").StyledComponent<{
3
- theme?: import("@emotion/react").Theme | undefined;
4
- as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
- export declare const ContentWrapper: import("@emotion/styled").StyledComponent<{
7
- theme?: import("@emotion/react").Theme | undefined;
8
- as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
9
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import React from 'react';
6
+ export declare const FlexContainer: ({ id, children }: {
7
+ id: string;
8
+ children: React.ReactNode;
9
+ }) => JSX.Element;
10
+ export declare const ContentWrapper: ({ children }: {
11
+ children: React.ReactNode;
12
+ }) => JSX.Element;
@@ -1,3 +1 @@
1
- export declare const transitionDurationMs = 220;
2
1
  export declare const transitionTimingFunction = "cubic-bezier(0.2, 0, 0, 1)";
3
- export declare const panelWidth = 368;
@@ -1,9 +1,14 @@
1
- /// <reference types="react" />
2
- export declare const RightSidePanelDrawer: import("@emotion/styled").StyledComponent<{
3
- theme?: import("@emotion/react").Theme | undefined;
4
- as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
- export declare const RightSidePanelDrawerContent: import("@emotion/styled").StyledComponent<{
7
- theme?: import("@emotion/react").Theme | undefined;
8
- as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
9
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import React from 'react';
6
+ import { TransitionStatus } from '.';
7
+ export declare const transitionDurationMs = 220;
8
+ export declare const RightSidePanelDrawer: ({ transitionState, children, }: {
9
+ transitionState: TransitionStatus;
10
+ children: React.ReactNode;
11
+ }) => JSX.Element;
12
+ export declare const RightSidePanelDrawerContent: ({ children }: {
13
+ children: React.ReactNode;
14
+ }) => JSX.Element;
@@ -1,9 +1,12 @@
1
- /// <reference types="react" />
2
- export declare const FlexContainer: import("@emotion/styled").StyledComponent<{
3
- theme?: import("@emotion/react").Theme | undefined;
4
- as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
- export declare const ContentWrapper: import("@emotion/styled").StyledComponent<{
7
- theme?: import("@emotion/react").Theme | undefined;
8
- as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
9
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import React from 'react';
6
+ export declare const FlexContainer: ({ id, children }: {
7
+ id: string;
8
+ children: React.ReactNode;
9
+ }) => JSX.Element;
10
+ export declare const ContentWrapper: ({ children }: {
11
+ children: React.ReactNode;
12
+ }) => JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/right-side-panel",
3
- "version": "2.0.2",
3
+ "version": "3.0.0",
4
4
  "description": "A cross-product right-side-panel component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -21,7 +21,7 @@
21
21
  }
22
22
  },
23
23
  "sideEffects": [
24
- "*.compiled.css"
24
+ "**/*.compiled.css"
25
25
  ],
26
26
  "atlaskit:src": "src/index.ts",
27
27
  "af:exports": {
@@ -36,9 +36,9 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@atlaskit/theme": "^18.0.0",
39
- "@atlaskit/tokens": "^4.3.0",
39
+ "@atlaskit/tokens": "^4.8.0",
40
40
  "@babel/runtime": "^7.0.0",
41
- "@emotion/styled": "^11.0.0",
41
+ "@compiled/react": "^0.18.3",
42
42
  "exenv": "^1.2.2",
43
43
  "react-transition-group": "^4.4.1"
44
44
  },
@@ -69,6 +69,9 @@
69
69
  "design-tokens": [
70
70
  "color",
71
71
  "spacing"
72
+ ],
73
+ "styling": [
74
+ "compiled"
72
75
  ]
73
76
  }
74
77
  }