@atlaskit/page-layout 2.0.1 → 2.1.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,17 @@
1
1
  # @atlaskit/page-layout
2
2
 
3
+ ## 2.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#64842](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/64842) [`664ecae2338b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/664ecae2338b) - Add PFF to reduce height of side bar grab area when collapsed in order to give the resize button more room and prevent accidental hovers causing the side bar to fly out
8
+
9
+ ## 2.0.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#61821](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/61821) [`bd212363ecc2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bd212363ecc2) - Add role=main to main slot
14
+
3
15
  ## 2.0.1
4
16
 
5
17
  ### Patch Changes
@@ -9,6 +9,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
  var _react = require("@emotion/react");
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
13
  var _colors = require("@atlaskit/theme/colors");
13
14
  var _constants = require("../../common/constants");
14
15
  var _excluded = ["testId", "valueTextLabel", "isDisabled", "isLeftSidebarCollapsed", "label", "leftSidebarPercentageExpanded", "onKeyDown", "onMouseDown", "onBlur", "onFocus", "ref"];
@@ -35,6 +36,11 @@ var grabAreaStyles = (0, _react.css)({
35
36
  },
36
37
  ':enabled:hover, :enabled:focus, :enabled:active': (0, _defineProperty2.default)({}, varLineColor, "var(--ds-border-selected, ".concat(_colors.B200, ")"))
37
38
  });
39
+ var grabAreaReducedHeightStyles = (0, _react.css)({
40
+ height: "calc(100% - ".concat("var(--ds-space-600, 3rem)", " * 2)"),
41
+ position: 'absolute',
42
+ insetBlockEnd: 0
43
+ });
38
44
  var grabAreaCollapsedStyles = (0, _react.css)({
39
45
  padding: 0,
40
46
  backgroundColor: 'transparent',
@@ -76,7 +82,7 @@ var GrabArea = function GrabArea(_ref) {
76
82
  // usability.
77
83
  ,
78
84
  role: "slider",
79
- css: [grabAreaStyles, isLeftSidebarCollapsed && grabAreaCollapsedStyles],
85
+ css: [grabAreaStyles, isLeftSidebarCollapsed && grabAreaCollapsedStyles, (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.page-layout-resize-button-fix_u0qxv') && isLeftSidebarCollapsed && grabAreaReducedHeightStyles],
80
86
  "aria-orientation": "vertical",
81
87
  "aria-valuenow": leftSidebarPercentageExpanded,
82
88
  "aria-valuemin": 0,
@@ -21,10 +21,8 @@ var _slotFocusRing = _interopRequireDefault(require("./internal/slot-focus-ring"
21
21
  var prefersReducedMotionStyles = (0, _react2.css)((0, _accessibility.prefersReducedMotion)());
22
22
  var mainStyles = (0, _react2.css)({
23
23
  minWidth: 0,
24
- marginLeft: 0,
25
- // Prevent flex container from blowing up when there's super wide content.
26
24
  flexGrow: 1,
27
- // Transition negative margin on main in sync with the increase in width of leftSidebar.
25
+ marginInlineStart: 0,
28
26
  transition: "margin-left ".concat(_constants.TRANSITION_DURATION, "ms ").concat(_curves.easeOut, " 0s")
29
27
  });
30
28
  var draggingStyles = (0, _react2.css)({
@@ -40,7 +38,7 @@ var draggingStyles = (0, _react2.css)({
40
38
  */
41
39
  var flyoutStyles = (0, _react2.css)({
42
40
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
43
- marginLeft: "calc(-1 * var(--".concat(_constants.VAR_LEFT_SIDEBAR_FLYOUT, ", ").concat(_constants.DEFAULT_LEFT_SIDEBAR_FLYOUT_WIDTH, "px) + ").concat(_constants.COLLAPSED_LEFT_SIDEBAR_WIDTH, "px)")
41
+ marginInlineStart: "calc(-1 * var(--".concat(_constants.VAR_LEFT_SIDEBAR_FLYOUT, ", ").concat(_constants.DEFAULT_LEFT_SIDEBAR_FLYOUT_WIDTH, "px) + ").concat(_constants.COLLAPSED_LEFT_SIDEBAR_WIDTH, "px)")
44
42
  });
45
43
 
46
44
  /**
@@ -65,6 +63,8 @@ var Main = function Main(props) {
65
63
  return (0, _react2.jsx)(_slotFocusRing.default, null, function (_ref) {
66
64
  var className = _ref.className;
67
65
  return (0, _react2.jsx)("div", (0, _extends2.default)({
66
+ // Using ARIA role instead of <main> tag to avoid any issues with downstream implementations.
67
+ role: "main",
68
68
  "data-testid": testId,
69
69
  css: [mainStyles, isDragging && draggingStyles, isFlyoutOpen && !isFixed && flyoutStyles, prefersReducedMotionStyles],
70
70
  className: className,
@@ -3,6 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  /** @jsx jsx */
4
4
 
5
5
  import { css, jsx } from '@emotion/react';
6
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
6
7
  import { B200 } from '@atlaskit/theme/colors';
7
8
  import { GRAB_AREA_LINE_SELECTOR, GRAB_AREA_SELECTOR } from '../../common/constants';
8
9
  /**
@@ -28,6 +29,11 @@ const grabAreaStyles = css({
28
29
  [varLineColor]: `var(--ds-border-selected, ${B200})`
29
30
  }
30
31
  });
32
+ const grabAreaReducedHeightStyles = css({
33
+ height: `calc(100% - ${"var(--ds-space-600, 3rem)"} * 2)`,
34
+ position: 'absolute',
35
+ insetBlockEnd: 0
36
+ });
31
37
  const grabAreaCollapsedStyles = css({
32
38
  padding: 0,
33
39
  backgroundColor: 'transparent',
@@ -72,7 +78,7 @@ const GrabArea = ({
72
78
  // usability.
73
79
  ,
74
80
  role: "slider",
75
- css: [grabAreaStyles, isLeftSidebarCollapsed && grabAreaCollapsedStyles],
81
+ css: [grabAreaStyles, isLeftSidebarCollapsed && grabAreaCollapsedStyles, getBooleanFF('platform.design-system-team.page-layout-resize-button-fix_u0qxv') && isLeftSidebarCollapsed && grabAreaReducedHeightStyles],
76
82
  "aria-orientation": "vertical",
77
83
  "aria-valuenow": leftSidebarPercentageExpanded,
78
84
  "aria-valuemin": 0,
@@ -14,10 +14,8 @@ import SlotFocusRing from './internal/slot-focus-ring';
14
14
  const prefersReducedMotionStyles = css(prefersReducedMotion());
15
15
  const mainStyles = css({
16
16
  minWidth: 0,
17
- marginLeft: 0,
18
- // Prevent flex container from blowing up when there's super wide content.
19
17
  flexGrow: 1,
20
- // Transition negative margin on main in sync with the increase in width of leftSidebar.
18
+ marginInlineStart: 0,
21
19
  transition: `margin-left ${TRANSITION_DURATION}ms ${easeOut} 0s`
22
20
  });
23
21
  const draggingStyles = css({
@@ -33,7 +31,7 @@ const draggingStyles = css({
33
31
  */
34
32
  const flyoutStyles = css({
35
33
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
36
- marginLeft: `calc(-1 * var(--${VAR_LEFT_SIDEBAR_FLYOUT}, ${DEFAULT_LEFT_SIDEBAR_FLYOUT_WIDTH}px) + ${COLLAPSED_LEFT_SIDEBAR_WIDTH}px)`
34
+ marginInlineStart: `calc(-1 * var(--${VAR_LEFT_SIDEBAR_FLYOUT}, ${DEFAULT_LEFT_SIDEBAR_FLYOUT_WIDTH}px) + ${COLLAPSED_LEFT_SIDEBAR_WIDTH}px)`
37
35
  });
38
36
 
39
37
  /**
@@ -62,6 +60,8 @@ const Main = props => {
62
60
  return jsx(SlotFocusRing, null, ({
63
61
  className
64
62
  }) => jsx("div", _extends({
63
+ // Using ARIA role instead of <main> tag to avoid any issues with downstream implementations.
64
+ role: "main",
65
65
  "data-testid": testId,
66
66
  css: [mainStyles, isDragging && draggingStyles, isFlyoutOpen && !isFixed && flyoutStyles, prefersReducedMotionStyles],
67
67
  className: className,
@@ -6,6 +6,7 @@ var _excluded = ["testId", "valueTextLabel", "isDisabled", "isLeftSidebarCollaps
6
6
  /** @jsx jsx */
7
7
 
8
8
  import { css, jsx } from '@emotion/react';
9
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
9
10
  import { B200 } from '@atlaskit/theme/colors';
10
11
  import { GRAB_AREA_LINE_SELECTOR, GRAB_AREA_SELECTOR } from '../../common/constants';
11
12
  /**
@@ -29,6 +30,11 @@ var grabAreaStyles = css({
29
30
  },
30
31
  ':enabled:hover, :enabled:focus, :enabled:active': _defineProperty({}, varLineColor, "var(--ds-border-selected, ".concat(B200, ")"))
31
32
  });
33
+ var grabAreaReducedHeightStyles = css({
34
+ height: "calc(100% - ".concat("var(--ds-space-600, 3rem)", " * 2)"),
35
+ position: 'absolute',
36
+ insetBlockEnd: 0
37
+ });
32
38
  var grabAreaCollapsedStyles = css({
33
39
  padding: 0,
34
40
  backgroundColor: 'transparent',
@@ -70,7 +76,7 @@ var GrabArea = function GrabArea(_ref) {
70
76
  // usability.
71
77
  ,
72
78
  role: "slider",
73
- css: [grabAreaStyles, isLeftSidebarCollapsed && grabAreaCollapsedStyles],
79
+ css: [grabAreaStyles, isLeftSidebarCollapsed && grabAreaCollapsedStyles, getBooleanFF('platform.design-system-team.page-layout-resize-button-fix_u0qxv') && isLeftSidebarCollapsed && grabAreaReducedHeightStyles],
74
80
  "aria-orientation": "vertical",
75
81
  "aria-valuenow": leftSidebarPercentageExpanded,
76
82
  "aria-valuemin": 0,
@@ -14,10 +14,8 @@ import SlotFocusRing from './internal/slot-focus-ring';
14
14
  var prefersReducedMotionStyles = css(prefersReducedMotion());
15
15
  var mainStyles = css({
16
16
  minWidth: 0,
17
- marginLeft: 0,
18
- // Prevent flex container from blowing up when there's super wide content.
19
17
  flexGrow: 1,
20
- // Transition negative margin on main in sync with the increase in width of leftSidebar.
18
+ marginInlineStart: 0,
21
19
  transition: "margin-left ".concat(TRANSITION_DURATION, "ms ").concat(easeOut, " 0s")
22
20
  });
23
21
  var draggingStyles = css({
@@ -33,7 +31,7 @@ var draggingStyles = css({
33
31
  */
34
32
  var flyoutStyles = css({
35
33
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
36
- marginLeft: "calc(-1 * var(--".concat(VAR_LEFT_SIDEBAR_FLYOUT, ", ").concat(DEFAULT_LEFT_SIDEBAR_FLYOUT_WIDTH, "px) + ").concat(COLLAPSED_LEFT_SIDEBAR_WIDTH, "px)")
34
+ marginInlineStart: "calc(-1 * var(--".concat(VAR_LEFT_SIDEBAR_FLYOUT, ", ").concat(DEFAULT_LEFT_SIDEBAR_FLYOUT_WIDTH, "px) + ").concat(COLLAPSED_LEFT_SIDEBAR_WIDTH, "px)")
37
35
  });
38
36
 
39
37
  /**
@@ -58,6 +56,8 @@ var Main = function Main(props) {
58
56
  return jsx(SlotFocusRing, null, function (_ref) {
59
57
  var className = _ref.className;
60
58
  return jsx("div", _extends({
59
+ // Using ARIA role instead of <main> tag to avoid any issues with downstream implementations.
60
+ role: "main",
61
61
  "data-testid": testId,
62
62
  css: [mainStyles, isDragging && draggingStyles, isFlyoutOpen && !isFixed && flyoutStyles, prefersReducedMotionStyles],
63
63
  className: className,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/page-layout",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "description": "A collection of components which let you compose an application's page layout.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -40,9 +40,9 @@
40
40
  "@atlaskit/icon": "^22.0.0",
41
41
  "@atlaskit/motion": "^1.5.0",
42
42
  "@atlaskit/platform-feature-flags": "^0.2.0",
43
- "@atlaskit/primitives": "^1.13.0",
43
+ "@atlaskit/primitives": "^1.16.0",
44
44
  "@atlaskit/theme": "^12.6.0",
45
- "@atlaskit/tokens": "^1.29.0",
45
+ "@atlaskit/tokens": "^1.33.0",
46
46
  "@babel/runtime": "^7.0.0",
47
47
  "@emotion/react": "^11.7.1",
48
48
  "bind-event-listener": "^2.1.1",
@@ -55,7 +55,7 @@
55
55
  "devDependencies": {
56
56
  "@af/accessibility-testing": "*",
57
57
  "@af/integration-testing": "*",
58
- "@atlaskit/atlassian-navigation": "^2.10.0",
58
+ "@atlaskit/atlassian-navigation": "^3.0.0",
59
59
  "@atlaskit/atlassian-notifications": "^0.4.0",
60
60
  "@atlaskit/drawer": "^7.6.0",
61
61
  "@atlaskit/logo": "^13.14.0",
@@ -67,7 +67,6 @@
67
67
  "@atlaskit/ssr": "*",
68
68
  "@atlaskit/tooltip": "*",
69
69
  "@atlaskit/visual-regression": "*",
70
- "@atlaskit/webdriver-runner": "*",
71
70
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
72
71
  "@testing-library/dom": "^8.17.1",
73
72
  "@testing-library/react": "^12.1.5",
@@ -114,6 +113,9 @@
114
113
  "platform-feature-flags": {
115
114
  "platform.design-system-team.responsive-page-layout-left-sidebar_p8r7g": {
116
115
  "type": "boolean"
116
+ },
117
+ "platform.design-system-team.page-layout-resize-button-fix_u0qxv": {
118
+ "type": "boolean"
117
119
  }
118
120
  }
119
121
  }