@atlaskit/page-layout 1.0.7 → 1.2.1
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 +30 -0
- package/README.md +3 -3
- package/__perf__/utils/perf-example.tsx +27 -18
- package/__perf__/utils/product-integration/Create.tsx +5 -1
- package/__perf__/utils/product-integration/NotificationsPopup.tsx +6 -5
- package/__perf__/utils/product-integration/SampleFooter.tsx +14 -13
- package/dist/cjs/common/hooks/index.js +23 -0
- package/dist/cjs/common/hooks/use-is-sidebar-collapsing.js +46 -0
- package/dist/cjs/common/hooks/use-is-sidebar-dragging.js +46 -0
- package/dist/cjs/components/resize-control/grab-area.js +42 -4
- package/dist/cjs/components/resize-control/index.js +22 -20
- package/dist/cjs/components/resize-control/resize-button.js +59 -4
- package/dist/cjs/components/resize-control/shadow.js +48 -0
- package/dist/cjs/components/skip-links/skip-link-components.js +49 -5
- package/dist/cjs/components/slots/banner.js +27 -11
- package/dist/cjs/components/slots/content.js +9 -2
- package/dist/cjs/components/slots/internal/left-sidebar-inner.js +65 -0
- package/dist/cjs/components/slots/internal/left-sidebar-outer.js +100 -0
- package/dist/cjs/components/slots/internal/resizable-children-wrapper.js +63 -0
- package/dist/cjs/components/slots/internal/slot-focus-ring.js +61 -0
- package/dist/cjs/components/slots/left-panel.js +26 -11
- package/dist/cjs/components/slots/left-sidebar-without-resize.js +10 -10
- package/dist/cjs/components/slots/left-sidebar.js +21 -16
- package/dist/cjs/components/slots/main.js +53 -6
- package/dist/cjs/components/slots/page-layout.js +10 -3
- package/dist/cjs/components/slots/right-panel.js +26 -11
- package/dist/cjs/components/slots/right-sidebar.js +57 -13
- package/dist/cjs/components/slots/top-navigation.js +27 -11
- package/dist/cjs/controllers/sidebar-resize-context.js +2 -1
- package/dist/cjs/controllers/sidebar-resize-controller.js +10 -5
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/common/hooks/index.js +2 -0
- package/dist/es2019/common/hooks/use-is-sidebar-collapsing.js +29 -0
- package/dist/es2019/common/hooks/use-is-sidebar-dragging.js +29 -0
- package/dist/es2019/components/resize-control/grab-area.js +46 -4
- package/dist/es2019/components/resize-control/index.js +12 -9
- package/dist/es2019/components/resize-control/resize-button.js +61 -4
- package/dist/es2019/components/resize-control/shadow.js +43 -0
- package/dist/es2019/components/skip-links/skip-link-components.js +47 -5
- package/dist/es2019/components/slots/banner.js +21 -7
- package/dist/es2019/components/slots/content.js +8 -2
- package/dist/es2019/components/slots/internal/left-sidebar-inner.js +52 -0
- package/dist/es2019/components/slots/internal/left-sidebar-outer.js +79 -0
- package/dist/es2019/components/slots/internal/resizable-children-wrapper.js +49 -0
- package/dist/es2019/components/slots/internal/slot-focus-ring.js +50 -0
- package/dist/es2019/components/slots/left-panel.js +20 -7
- package/dist/es2019/components/slots/left-sidebar-without-resize.js +10 -11
- package/dist/es2019/components/slots/left-sidebar.js +20 -17
- package/dist/es2019/components/slots/main.js +46 -6
- package/dist/es2019/components/slots/page-layout.js +15 -3
- package/dist/es2019/components/slots/right-panel.js +20 -7
- package/dist/es2019/components/slots/right-sidebar.js +50 -8
- package/dist/es2019/components/slots/top-navigation.js +21 -7
- package/dist/es2019/controllers/sidebar-resize-context.js +2 -1
- package/dist/es2019/controllers/sidebar-resize-controller.js +10 -5
- package/dist/es2019/version.json +1 -1
- package/dist/esm/common/hooks/index.js +2 -0
- package/dist/esm/common/hooks/use-is-sidebar-collapsing.js +34 -0
- package/dist/esm/common/hooks/use-is-sidebar-dragging.js +34 -0
- package/dist/esm/components/resize-control/grab-area.js +42 -4
- package/dist/esm/components/resize-control/index.js +23 -20
- package/dist/esm/components/resize-control/resize-button.js +57 -4
- package/dist/esm/components/resize-control/shadow.js +37 -0
- package/dist/esm/components/skip-links/skip-link-components.js +47 -5
- package/dist/esm/components/slots/banner.js +27 -12
- package/dist/esm/components/slots/content.js +8 -2
- package/dist/esm/components/slots/internal/left-sidebar-inner.js +53 -0
- package/dist/esm/components/slots/internal/left-sidebar-outer.js +82 -0
- package/dist/esm/components/slots/internal/resizable-children-wrapper.js +51 -0
- package/dist/esm/components/slots/internal/slot-focus-ring.js +51 -0
- package/dist/esm/components/slots/left-panel.js +26 -12
- package/dist/esm/components/slots/left-sidebar-without-resize.js +10 -10
- package/dist/esm/components/slots/left-sidebar.js +20 -16
- package/dist/esm/components/slots/main.js +49 -8
- package/dist/esm/components/slots/page-layout.js +12 -3
- package/dist/esm/components/slots/right-panel.js +26 -12
- package/dist/esm/components/slots/right-sidebar.js +57 -14
- package/dist/esm/components/slots/top-navigation.js +27 -12
- package/dist/esm/controllers/sidebar-resize-context.js +2 -1
- package/dist/esm/controllers/sidebar-resize-controller.js +10 -5
- package/dist/esm/version.json +1 -1
- package/dist/types/common/hooks/index.d.ts +2 -0
- package/dist/types/common/hooks/use-is-sidebar-collapsing.d.ts +2 -0
- package/dist/types/common/hooks/use-is-sidebar-dragging.d.ts +2 -0
- package/dist/types/components/resize-control/shadow.d.ts +6 -0
- package/dist/types/components/slots/internal/left-sidebar-inner.d.ts +9 -0
- package/dist/types/components/slots/internal/left-sidebar-outer.d.ts +13 -0
- package/dist/types/components/slots/internal/resizable-children-wrapper.d.ts +10 -0
- package/dist/types/components/slots/internal/slot-focus-ring.d.ts +19 -0
- package/dist/types/controllers/sidebar-resize-context.d.ts +1 -0
- package/package.json +14 -9
- package/dist/cjs/components/resize-control/styles.js +0 -156
- package/dist/cjs/components/skip-links/styles.js +0 -58
- package/dist/cjs/components/slots/left-sidebar-styles.js +0 -116
- package/dist/cjs/components/slots/styles.js +0 -154
- package/dist/es2019/components/resize-control/styles.js +0 -136
- package/dist/es2019/components/skip-links/styles.js +0 -41
- package/dist/es2019/components/slots/left-sidebar-styles.js +0 -96
- package/dist/es2019/components/slots/styles.js +0 -130
- package/dist/esm/components/resize-control/styles.js +0 -131
- package/dist/esm/components/skip-links/styles.js +0 -45
- package/dist/esm/components/slots/left-sidebar-styles.js +0 -94
- package/dist/esm/components/slots/styles.js +0 -117
- package/dist/types/components/resize-control/styles.d.ts +0 -41
- package/dist/types/components/skip-links/styles.d.ts +0 -2
- package/dist/types/components/slots/left-sidebar-styles.d.ts +0 -5
- package/dist/types/components/slots/styles.d.ts +0 -23
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
7
|
-
import { easeOut, mediumDurationMs, smallDurationMs } from '@atlaskit/motion';
|
|
8
|
-
import { B100, B200, N0, N200, N30A } from '@atlaskit/theme/colors';
|
|
9
|
-
import { GRAB_AREA_LINE_SELECTOR, GRAB_AREA_SELECTOR, IS_SIDEBAR_DRAGGING, RESIZE_BUTTON_SELECTOR } from '../../common/constants';
|
|
10
|
-
export var resizeControlCSS = function resizeControlCSS(setIsGrabAreaFocused, isLeftSidebarCollapsed) {
|
|
11
|
-
var _$concat, _ref;
|
|
12
|
-
|
|
13
|
-
return _ref = {
|
|
14
|
-
left: '100%',
|
|
15
|
-
top: 0,
|
|
16
|
-
bottom: 0,
|
|
17
|
-
position: 'absolute',
|
|
18
|
-
outline: 'none'
|
|
19
|
-
}, _defineProperty(_ref, "[".concat(GRAB_AREA_SELECTOR, "]:enabled"), (_$concat = {}, _defineProperty(_$concat, "&:hover [".concat(GRAB_AREA_LINE_SELECTOR, "]"), {
|
|
20
|
-
backgroundColor: B100
|
|
21
|
-
}), _defineProperty(_$concat, "&:active [".concat(GRAB_AREA_LINE_SELECTOR, "] , &:focus [").concat(GRAB_AREA_LINE_SELECTOR, "]"), {
|
|
22
|
-
backgroundColor: B200
|
|
23
|
-
}), _defineProperty(_$concat, "&:hover [".concat(RESIZE_BUTTON_SELECTOR, "]:not(:focus):not(:hover)"), {
|
|
24
|
-
color: B100
|
|
25
|
-
}), _defineProperty(_$concat, "&:hover [".concat(RESIZE_BUTTON_SELECTOR, "]"), {
|
|
26
|
-
opacity: 1
|
|
27
|
-
}), _$concat)), _defineProperty(_ref, "[".concat(RESIZE_BUTTON_SELECTOR, "]"), {
|
|
28
|
-
opacity: setIsGrabAreaFocused || isLeftSidebarCollapsed ? 1 : 0
|
|
29
|
-
}), _ref;
|
|
30
|
-
};
|
|
31
|
-
export var resizeIconButtonCSS = function resizeIconButtonCSS(isCollapsed) {
|
|
32
|
-
return _objectSpread(_objectSpread({
|
|
33
|
-
backgroundColor: N0,
|
|
34
|
-
position: 'absolute',
|
|
35
|
-
top: 32,
|
|
36
|
-
left: 0,
|
|
37
|
-
transform: 'translateX(-50%)',
|
|
38
|
-
border: 0,
|
|
39
|
-
borderRadius: '50%',
|
|
40
|
-
boxShadow: "0 0 0 1px ".concat(N30A, ", 0 2px 4px 1px ").concat(N30A),
|
|
41
|
-
color: N200,
|
|
42
|
-
cursor: 'pointer',
|
|
43
|
-
height: 24,
|
|
44
|
-
opacity: 0,
|
|
45
|
-
outline: 0,
|
|
46
|
-
padding: 0,
|
|
47
|
-
transition: "\n background-color ".concat(smallDurationMs, "ms linear,\n color ").concat(smallDurationMs, "ms linear,\n opacity ").concat(mediumDurationMs, "ms ").concat(easeOut, "\n "),
|
|
48
|
-
width: 24,
|
|
49
|
-
':hover': {
|
|
50
|
-
backgroundColor: B100,
|
|
51
|
-
color: N0,
|
|
52
|
-
opacity: 1
|
|
53
|
-
},
|
|
54
|
-
':active': {
|
|
55
|
-
backgroundColor: B200,
|
|
56
|
-
color: N0,
|
|
57
|
-
opacity: 1
|
|
58
|
-
},
|
|
59
|
-
':focus': {
|
|
60
|
-
backgroundColor: B200,
|
|
61
|
-
color: N0,
|
|
62
|
-
opacity: 1
|
|
63
|
-
}
|
|
64
|
-
}, !isCollapsed && {
|
|
65
|
-
transform: 'rotate(180deg)',
|
|
66
|
-
transformOrigin: 7,
|
|
67
|
-
opacity: 1
|
|
68
|
-
}), {}, _defineProperty({}, "[".concat(IS_SIDEBAR_DRAGGING, "] &"), {
|
|
69
|
-
opacity: 1
|
|
70
|
-
}));
|
|
71
|
-
};
|
|
72
|
-
export var grabAreaCSS = function grabAreaCSS(isLeftSidebarCollapsed) {
|
|
73
|
-
var _objectSpread3;
|
|
74
|
-
|
|
75
|
-
return _objectSpread((_objectSpread3 = {
|
|
76
|
-
cursor: 'ew-resize',
|
|
77
|
-
height: '100%',
|
|
78
|
-
width: '24px',
|
|
79
|
-
padding: 0,
|
|
80
|
-
border: 0,
|
|
81
|
-
backgroundColor: 'transparent'
|
|
82
|
-
}, _defineProperty(_objectSpread3, '&::-moz-focus-inner', {
|
|
83
|
-
border: 0
|
|
84
|
-
}), _defineProperty(_objectSpread3, ':focus', {
|
|
85
|
-
outline: 0
|
|
86
|
-
}), _objectSpread3), isLeftSidebarCollapsed && {
|
|
87
|
-
padding: 0,
|
|
88
|
-
border: 0,
|
|
89
|
-
backgroundColor: 'transparent',
|
|
90
|
-
cursor: 'default'
|
|
91
|
-
});
|
|
92
|
-
};
|
|
93
|
-
export var lineCSS = function lineCSS(isLeftSidebarCollapsed) {
|
|
94
|
-
return _objectSpread({
|
|
95
|
-
display: 'block',
|
|
96
|
-
height: '100%',
|
|
97
|
-
transition: 'background-color 200ms',
|
|
98
|
-
width: 2
|
|
99
|
-
}, isLeftSidebarCollapsed && {
|
|
100
|
-
'&&': {
|
|
101
|
-
backgroundColor: 'transparent'
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
};
|
|
105
|
-
export var increaseHitArea = {
|
|
106
|
-
position: 'absolute',
|
|
107
|
-
left: -8,
|
|
108
|
-
right: -12,
|
|
109
|
-
bottom: -8,
|
|
110
|
-
top: -8
|
|
111
|
-
};
|
|
112
|
-
var colorStops = "\n rgba(0, 0, 0, 0.2) 0px,\n rgba(0, 0, 0, 0.2) 1px,\n rgba(0, 0, 0, 0.1) 1px,\n rgba(0, 0, 0, 0) 100%\n ";
|
|
113
|
-
var direction = 'to left';
|
|
114
|
-
var transitionDuration = '0.22s';
|
|
115
|
-
export var shadowCSS = _defineProperty({
|
|
116
|
-
background: "linear-gradient(".concat(direction, ", ").concat(colorStops, ")"),
|
|
117
|
-
bottom: 0,
|
|
118
|
-
top: 0,
|
|
119
|
-
left: -1,
|
|
120
|
-
opacity: 0.5,
|
|
121
|
-
pointerEvents: 'none',
|
|
122
|
-
position: 'absolute',
|
|
123
|
-
transitionDuration: transitionDuration,
|
|
124
|
-
transitionProperty: 'left, opacity, width',
|
|
125
|
-
transitionTimingFunction: easeOut,
|
|
126
|
-
width: 3
|
|
127
|
-
}, "[".concat(IS_SIDEBAR_DRAGGING, "] &"), {
|
|
128
|
-
opacity: 0.8,
|
|
129
|
-
width: 6,
|
|
130
|
-
left: -6
|
|
131
|
-
});
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
7
|
-
import { easeOut, prefersReducedMotion } from '@atlaskit/motion';
|
|
8
|
-
import { N30A, N60A } from '@atlaskit/theme/colors';
|
|
9
|
-
export var skipLinkStyles = _objectSpread(_objectSpread({
|
|
10
|
-
zIndex: -1,
|
|
11
|
-
left: -999999,
|
|
12
|
-
position: 'fixed',
|
|
13
|
-
opacity: 0,
|
|
14
|
-
background: 'white',
|
|
15
|
-
border: 'none',
|
|
16
|
-
padding: '0.8rem 1rem',
|
|
17
|
-
boxShadow: "0 0 0 1px ".concat(N30A, ", 0 2px 10px ").concat(N30A, ", 0 0 20px -4px ").concat(N60A),
|
|
18
|
-
borderRadius: '3px',
|
|
19
|
-
margin: 10
|
|
20
|
-
}, prefersReducedMotion()), {}, {
|
|
21
|
-
transform: 'translateY(-50%)',
|
|
22
|
-
transition: "transform 0.3s ".concat(easeOut),
|
|
23
|
-
':focus-within': {
|
|
24
|
-
transform: 'translateY(0%)',
|
|
25
|
-
opacity: 1,
|
|
26
|
-
left: 0,
|
|
27
|
-
|
|
28
|
-
/* Max z-index is 2147483647. Skip links always be on top,
|
|
29
|
-
but giving a few digits extra space just in case there's
|
|
30
|
-
a future need. */
|
|
31
|
-
zIndex: 2147483640
|
|
32
|
-
},
|
|
33
|
-
'& > span': {
|
|
34
|
-
fontWeight: 'bold'
|
|
35
|
-
},
|
|
36
|
-
'> ol': {
|
|
37
|
-
listStyleType: 'none',
|
|
38
|
-
listStylePosition: 'outside',
|
|
39
|
-
paddingLeft: 0,
|
|
40
|
-
marginTop: '4px',
|
|
41
|
-
'> li': {
|
|
42
|
-
marginTop: 0
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
});
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
7
|
-
import { easeOut, prefersReducedMotion } from '@atlaskit/motion';
|
|
8
|
-
import { BANNER_HEIGHT, COLLAPSED_LEFT_SIDEBAR_WIDTH, DEFAULT_LEFT_SIDEBAR_FLYOUT_WIDTH, IS_SIDEBAR_COLLAPSING, IS_SIDEBAR_DRAGGING, LEFT_PANEL_WIDTH, LEFT_SIDEBAR_FLYOUT_WIDTH, LEFT_SIDEBAR_WIDTH, RESIZE_BUTTON_SELECTOR, TOP_NAVIGATION_HEIGHT, TRANSITION_DURATION, VAR_LEFT_SIDEBAR_FLYOUT } from '../../common/constants';
|
|
9
|
-
import { getPageLayoutSlotCSSSelector } from '../../common/utils';
|
|
10
|
-
import { focusStyles } from './styles'; // This inner wrapper is required to allow the
|
|
11
|
-
// sidebar to be position: fixed. If we were to apply position: fixed
|
|
12
|
-
// to the outer wrapper, it will be popped out of it's flex container
|
|
13
|
-
// and Main would stretch to occupy all the space.
|
|
14
|
-
|
|
15
|
-
export var fixedLeftSidebarInnerStyles = function fixedLeftSidebarInnerStyles(isFixed, isFlyoutOpen, isLeftSidebarCollapsed) {
|
|
16
|
-
return _objectSpread(_objectSpread(_objectSpread({}, focusStyles), isFixed ? _objectSpread(_defineProperty({
|
|
17
|
-
position: 'fixed',
|
|
18
|
-
top: "calc(".concat(BANNER_HEIGHT, " + ").concat(TOP_NAVIGATION_HEIGHT, ")"),
|
|
19
|
-
left: "".concat(LEFT_PANEL_WIDTH),
|
|
20
|
-
bottom: 0,
|
|
21
|
-
width: "".concat(LEFT_SIDEBAR_WIDTH),
|
|
22
|
-
transition: "width ".concat(TRANSITION_DURATION, "ms ").concat(easeOut, " 0s")
|
|
23
|
-
}, "[".concat(IS_SIDEBAR_DRAGGING, "] &"), {
|
|
24
|
-
// Make sure drag to resize does not animate as the user drags
|
|
25
|
-
transition: 'none',
|
|
26
|
-
cursor: 'ew-resize'
|
|
27
|
-
}), isFlyoutOpen && {
|
|
28
|
-
width: LEFT_SIDEBAR_FLYOUT_WIDTH
|
|
29
|
-
}) : {
|
|
30
|
-
height: '100%'
|
|
31
|
-
}), prefersReducedMotion());
|
|
32
|
-
};
|
|
33
|
-
export var leftSidebarStyles = function leftSidebarStyles(isFixed, isFlyoutOpen) {
|
|
34
|
-
var _objectSpread3;
|
|
35
|
-
|
|
36
|
-
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread((_objectSpread3 = {
|
|
37
|
-
position: 'relative',
|
|
38
|
-
width: "".concat(LEFT_SIDEBAR_WIDTH),
|
|
39
|
-
transition: "width ".concat(TRANSITION_DURATION, "ms ").concat(easeOut, " 0s"),
|
|
40
|
-
zIndex: 1,
|
|
41
|
-
// Make resize affordance appear on top of content
|
|
42
|
-
marginLeft: 0
|
|
43
|
-
}, _defineProperty(_objectSpread3, "[".concat(IS_SIDEBAR_DRAGGING, "] &"), {
|
|
44
|
-
// Make sure drag to resize does not animate as the user drags
|
|
45
|
-
transition: 'none',
|
|
46
|
-
cursor: 'ew-resize'
|
|
47
|
-
}), _defineProperty(_objectSpread3, "&:hover [".concat(RESIZE_BUTTON_SELECTOR, "]"), {
|
|
48
|
-
opacity: 1
|
|
49
|
-
}), _objectSpread3), isFlyoutOpen && {
|
|
50
|
-
width: LEFT_SIDEBAR_FLYOUT_WIDTH
|
|
51
|
-
}), isFlyoutOpen && !isFixed && _defineProperty({}, "& + ".concat(getPageLayoutSlotCSSSelector('main')), {
|
|
52
|
-
// adds a negative left margin to main
|
|
53
|
-
// which transitions at the same speed
|
|
54
|
-
// with which left sidebars width increases
|
|
55
|
-
// This give an illusion that the flyout is appearing
|
|
56
|
-
// on top of the main content, while main remains in place
|
|
57
|
-
marginLeft: "calc(-1 * var(--".concat(VAR_LEFT_SIDEBAR_FLYOUT, ", ").concat(DEFAULT_LEFT_SIDEBAR_FLYOUT_WIDTH, "px) + ").concat(COLLAPSED_LEFT_SIDEBAR_WIDTH, "px)")
|
|
58
|
-
})), isFixed && _objectSpread({
|
|
59
|
-
// in fixed mode this element's child is taken out of the document flow
|
|
60
|
-
// It doesn't take up the width as expected
|
|
61
|
-
// psuedo element forces it to take up the necessary width
|
|
62
|
-
'&::after': {
|
|
63
|
-
content: "''",
|
|
64
|
-
display: 'inline-block',
|
|
65
|
-
width: "".concat(LEFT_SIDEBAR_WIDTH)
|
|
66
|
-
}
|
|
67
|
-
}, isFlyoutOpen && {
|
|
68
|
-
width: COLLAPSED_LEFT_SIDEBAR_WIDTH
|
|
69
|
-
})), focusStyles), prefersReducedMotion());
|
|
70
|
-
};
|
|
71
|
-
export var resizeableChildrenWrapperStyle = function resizeableChildrenWrapperStyle(isFlyoutOpen, isLeftSidebarCollapsed, collapsedState) {
|
|
72
|
-
return _objectSpread(_defineProperty({
|
|
73
|
-
visibility: 'visible',
|
|
74
|
-
transition: 'none',
|
|
75
|
-
opacity: 1,
|
|
76
|
-
overflow: 'hidden auto',
|
|
77
|
-
height: '100%'
|
|
78
|
-
}, "[".concat(IS_SIDEBAR_COLLAPSING, "] &"), hideLeftSidebarContents), (isLeftSidebarCollapsed || collapsedState) && !isFlyoutOpen && hideLeftSidebarContents);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
var hideLeftSidebarContents = _objectSpread({
|
|
82
|
-
// the transition duration is intentionally set to 0ms
|
|
83
|
-
// transition is being used here to delay the setting of
|
|
84
|
-
// opacity and visibility so that it syncs collapsing sidebar.
|
|
85
|
-
transition: "opacity 0ms linear, visibility 0ms linear",
|
|
86
|
-
transitionDelay: "".concat(TRANSITION_DURATION - 100, "ms"),
|
|
87
|
-
opacity: 0,
|
|
88
|
-
visibility: 'hidden'
|
|
89
|
-
}, prefersReducedMotion());
|
|
90
|
-
|
|
91
|
-
export var fixedChildrenWrapperStyle = {
|
|
92
|
-
height: '100%',
|
|
93
|
-
minWidth: '240px'
|
|
94
|
-
};
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
|
-
|
|
4
|
-
var _templateObject, _templateObject2;
|
|
5
|
-
|
|
6
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7
|
-
|
|
8
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9
|
-
|
|
10
|
-
import { css } from '@emotion/core';
|
|
11
|
-
import { easeOut, prefersReducedMotion } from '@atlaskit/motion';
|
|
12
|
-
import { BANNER, BANNER_HEIGHT, CONTENT, IS_SIDEBAR_DRAGGING, LEFT_PANEL, LEFT_PANEL_WIDTH, RIGHT_PANEL, RIGHT_PANEL_WIDTH, RIGHT_SIDEBAR_WIDTH, TOP_NAVIGATION, TOP_NAVIGATION_HEIGHT, TRANSITION_DURATION } from '../../common/constants';
|
|
13
|
-
var gridTemplateAreas = "\n \"".concat(LEFT_PANEL, " ").concat(BANNER, " ").concat(RIGHT_PANEL, "\"\n \"").concat(LEFT_PANEL, " ").concat(TOP_NAVIGATION, " ").concat(RIGHT_PANEL, "\"\n \"").concat(LEFT_PANEL, " ").concat(CONTENT, " ").concat(RIGHT_PANEL, "\"\n ");
|
|
14
|
-
export var gridStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n outline: none;\n\n display: grid;\n height: 100%;\n // prettier-ignore\n grid-template-columns: ", " minmax(0, 1fr) ", ";\n grid-template-rows:\n ", " ", "\n auto;\n grid-template-areas: ", ";\n"])), LEFT_PANEL_WIDTH, RIGHT_PANEL_WIDTH, BANNER_HEIGHT, TOP_NAVIGATION_HEIGHT, gridTemplateAreas);
|
|
15
|
-
export var contentStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n grid-area: ", ";\n display: flex;\n height: 100%;\n position: relative;\n"])), CONTENT);
|
|
16
|
-
export var focusStyles = {
|
|
17
|
-
'&:focus': {
|
|
18
|
-
outline: 'none',
|
|
19
|
-
'& [data-wrapper-element]': {
|
|
20
|
-
outline: 'none',
|
|
21
|
-
boxShadow: '0px 0px 0px 2px inset #4C9AFF'
|
|
22
|
-
},
|
|
23
|
-
'& > div:not([data-skip-link-wrapper])': {
|
|
24
|
-
outline: 'none',
|
|
25
|
-
boxShadow: '0px 0px 0px 2px inset #4C9AFF'
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
export var bannerStyles = function bannerStyles(isFixed) {
|
|
30
|
-
return _objectSpread(_objectSpread({
|
|
31
|
-
gridArea: "".concat(BANNER),
|
|
32
|
-
height: "".concat(BANNER_HEIGHT)
|
|
33
|
-
}, focusStyles), isFixed && {
|
|
34
|
-
position: 'fixed',
|
|
35
|
-
top: 0,
|
|
36
|
-
left: "".concat(LEFT_PANEL_WIDTH),
|
|
37
|
-
right: "".concat(RIGHT_PANEL_WIDTH),
|
|
38
|
-
zIndex: 2
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
export var topNavigationStyles = function topNavigationStyles(isFixed) {
|
|
42
|
-
return _objectSpread(_objectSpread({
|
|
43
|
-
gridArea: "".concat(TOP_NAVIGATION),
|
|
44
|
-
height: "".concat(TOP_NAVIGATION_HEIGHT)
|
|
45
|
-
}, focusStyles), isFixed && {
|
|
46
|
-
position: 'fixed',
|
|
47
|
-
top: "".concat(BANNER_HEIGHT),
|
|
48
|
-
left: "".concat(LEFT_PANEL_WIDTH),
|
|
49
|
-
right: "".concat(RIGHT_PANEL_WIDTH),
|
|
50
|
-
zIndex: 2
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
export var mainStyles = _objectSpread(_objectSpread({}, focusStyles), {}, _defineProperty({
|
|
54
|
-
// Prevent flex container from blowing
|
|
55
|
-
// up when there's super wide content
|
|
56
|
-
flexGrow: 1,
|
|
57
|
-
minWidth: 0,
|
|
58
|
-
// Transition negative margin on main
|
|
59
|
-
// in sync with the increase in width of
|
|
60
|
-
// leftSidebar
|
|
61
|
-
transition: "margin-left ".concat(TRANSITION_DURATION, "ms ").concat(easeOut, " 0s"),
|
|
62
|
-
marginLeft: 0
|
|
63
|
-
}, "[".concat(IS_SIDEBAR_DRAGGING, "] &"), {
|
|
64
|
-
// Make sure drag to resize remains snappy
|
|
65
|
-
transition: 'none',
|
|
66
|
-
cursor: 'ew-resize'
|
|
67
|
-
}), prefersReducedMotion()); // This inner wrapper is required to allow the
|
|
68
|
-
// sidebar to be position: fixed. If we were to apply position: fixed
|
|
69
|
-
// to the outer wrapper, it will be popped out of it's flex container
|
|
70
|
-
// and Main would stretch to occupy all the space.
|
|
71
|
-
|
|
72
|
-
export var fixedRightSidebarInnerStyles = function fixedRightSidebarInnerStyles(isFixed) {
|
|
73
|
-
return _objectSpread(_objectSpread({}, focusStyles), isFixed ? {
|
|
74
|
-
position: 'fixed',
|
|
75
|
-
top: "calc(".concat(BANNER_HEIGHT, " + ").concat(TOP_NAVIGATION_HEIGHT, ")"),
|
|
76
|
-
right: "calc(".concat(RIGHT_PANEL_WIDTH, ")"),
|
|
77
|
-
bottom: 0
|
|
78
|
-
} : {
|
|
79
|
-
height: '100%'
|
|
80
|
-
});
|
|
81
|
-
};
|
|
82
|
-
export var rightSidebarStyles = function rightSidebarStyles(isFixed) {
|
|
83
|
-
return _objectSpread(_objectSpread({
|
|
84
|
-
width: "".concat(RIGHT_SIDEBAR_WIDTH)
|
|
85
|
-
}, focusStyles), isFixed && {
|
|
86
|
-
// in fixed mode this element's child is taken out of the document flow
|
|
87
|
-
// It doesn't take up the width as expected
|
|
88
|
-
// psuedo element forces it to take up the necessary width
|
|
89
|
-
'&::after': {
|
|
90
|
-
content: "''",
|
|
91
|
-
display: 'inline-block',
|
|
92
|
-
width: "".concat(RIGHT_SIDEBAR_WIDTH)
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
};
|
|
96
|
-
export var rightPanelStyles = function rightPanelStyles(isFixed) {
|
|
97
|
-
return _objectSpread(_objectSpread({
|
|
98
|
-
gridArea: RIGHT_PANEL
|
|
99
|
-
}, focusStyles), isFixed && {
|
|
100
|
-
position: 'fixed',
|
|
101
|
-
width: "".concat(RIGHT_PANEL_WIDTH),
|
|
102
|
-
top: 0,
|
|
103
|
-
bottom: 0,
|
|
104
|
-
right: 0
|
|
105
|
-
});
|
|
106
|
-
};
|
|
107
|
-
export var leftPanelStyles = function leftPanelStyles(isFixed) {
|
|
108
|
-
return _objectSpread(_objectSpread({
|
|
109
|
-
gridArea: LEFT_PANEL
|
|
110
|
-
}, focusStyles), isFixed && {
|
|
111
|
-
position: 'fixed',
|
|
112
|
-
width: "".concat(LEFT_PANEL_WIDTH),
|
|
113
|
-
top: 0,
|
|
114
|
-
bottom: 0,
|
|
115
|
-
left: 0
|
|
116
|
-
});
|
|
117
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { CSSObject } from '@emotion/core';
|
|
2
|
-
export declare const resizeControlCSS: (setIsGrabAreaFocused: boolean, isLeftSidebarCollapsed: boolean) => CSSObject;
|
|
3
|
-
export declare const resizeIconButtonCSS: (isCollapsed: boolean) => CSSObject;
|
|
4
|
-
export declare const grabAreaCSS: (isLeftSidebarCollapsed: boolean) => {
|
|
5
|
-
cursor: string;
|
|
6
|
-
height: string;
|
|
7
|
-
width: string;
|
|
8
|
-
padding: number;
|
|
9
|
-
border: number;
|
|
10
|
-
backgroundColor: string;
|
|
11
|
-
"&::-moz-focus-inner": {
|
|
12
|
-
border: number;
|
|
13
|
-
};
|
|
14
|
-
":focus": {
|
|
15
|
-
outline: number;
|
|
16
|
-
};
|
|
17
|
-
} | {
|
|
18
|
-
padding: number;
|
|
19
|
-
border: number;
|
|
20
|
-
backgroundColor: string;
|
|
21
|
-
cursor: string;
|
|
22
|
-
height: string;
|
|
23
|
-
width: string;
|
|
24
|
-
"&::-moz-focus-inner": {
|
|
25
|
-
border: number;
|
|
26
|
-
};
|
|
27
|
-
":focus": {
|
|
28
|
-
outline: number;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
export declare const lineCSS: (isLeftSidebarCollapsed: boolean) => {
|
|
32
|
-
'&&'?: {
|
|
33
|
-
backgroundColor: string;
|
|
34
|
-
};
|
|
35
|
-
display: string;
|
|
36
|
-
height: string;
|
|
37
|
-
transition: string;
|
|
38
|
-
width: number;
|
|
39
|
-
};
|
|
40
|
-
export declare const increaseHitArea: CSSObject;
|
|
41
|
-
export declare const shadowCSS: CSSObject;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { CSSObject } from '@emotion/core';
|
|
2
|
-
export declare const fixedLeftSidebarInnerStyles: (isFixed?: boolean | undefined, isFlyoutOpen?: boolean | undefined, isLeftSidebarCollapsed?: boolean | undefined) => CSSObject;
|
|
3
|
-
export declare const leftSidebarStyles: (isFixed?: boolean | undefined, isFlyoutOpen?: boolean | undefined) => CSSObject;
|
|
4
|
-
export declare const resizeableChildrenWrapperStyle: (isFlyoutOpen?: boolean | undefined, isLeftSidebarCollapsed?: boolean | undefined, collapsedState?: boolean | undefined) => CSSObject;
|
|
5
|
-
export declare const fixedChildrenWrapperStyle: CSSObject;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { CSSObject } from '@emotion/core';
|
|
2
|
-
export declare const gridStyles: import("@emotion/core").SerializedStyles;
|
|
3
|
-
export declare const contentStyles: import("@emotion/core").SerializedStyles;
|
|
4
|
-
export declare const focusStyles: {
|
|
5
|
-
'&:focus': {
|
|
6
|
-
outline: string;
|
|
7
|
-
'& [data-wrapper-element]': {
|
|
8
|
-
outline: string;
|
|
9
|
-
boxShadow: string;
|
|
10
|
-
};
|
|
11
|
-
'& > div:not([data-skip-link-wrapper])': {
|
|
12
|
-
outline: string;
|
|
13
|
-
boxShadow: string;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export declare const bannerStyles: (isFixed?: boolean | undefined) => CSSObject;
|
|
18
|
-
export declare const topNavigationStyles: (isFixed?: boolean | undefined) => CSSObject;
|
|
19
|
-
export declare const mainStyles: CSSObject;
|
|
20
|
-
export declare const fixedRightSidebarInnerStyles: (isFixed?: boolean | undefined) => CSSObject;
|
|
21
|
-
export declare const rightSidebarStyles: (isFixed?: boolean | undefined) => CSSObject;
|
|
22
|
-
export declare const rightPanelStyles: (isFixed?: boolean | undefined) => CSSObject;
|
|
23
|
-
export declare const leftPanelStyles: (isFixed?: boolean | undefined) => CSSObject;
|