@cloudscape-design/components-themeable 3.0.233 → 3.0.234

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 (50) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/app-layout/drawer/styles.scss +59 -0
  3. package/lib/internal/scss/app-layout/split-panel-drawer/styles.scss +13 -0
  4. package/lib/internal/scss/app-layout/styles.scss +0 -98
  5. package/lib/internal/template/app-layout/{drawer.d.ts → drawer/index.d.ts} +12 -12
  6. package/lib/internal/template/app-layout/drawer/index.d.ts.map +1 -0
  7. package/lib/internal/template/app-layout/{drawer.js → drawer/index.js} +6 -7
  8. package/lib/internal/template/app-layout/drawer/index.js.map +1 -0
  9. package/lib/internal/template/app-layout/drawer/styles.css.js +10 -0
  10. package/lib/internal/template/app-layout/drawer/styles.scoped.css +139 -0
  11. package/lib/internal/template/app-layout/drawer/styles.selectors.js +11 -0
  12. package/lib/internal/template/app-layout/index.d.ts.map +1 -1
  13. package/lib/internal/template/app-layout/index.js +6 -23
  14. package/lib/internal/template/app-layout/index.js.map +1 -1
  15. package/lib/internal/template/app-layout/split-panel-drawer/index.d.ts +11 -0
  16. package/lib/internal/template/app-layout/split-panel-drawer/index.d.ts.map +1 -0
  17. package/lib/internal/template/app-layout/split-panel-drawer/index.js +10 -0
  18. package/lib/internal/template/app-layout/split-panel-drawer/index.js.map +1 -0
  19. package/lib/internal/template/app-layout/split-panel-drawer/styles.css.js +7 -0
  20. package/lib/internal/template/app-layout/split-panel-drawer/styles.scoped.css +103 -0
  21. package/lib/internal/template/app-layout/split-panel-drawer/styles.selectors.js +8 -0
  22. package/lib/internal/template/app-layout/styles.css.js +13 -26
  23. package/lib/internal/template/app-layout/styles.scoped.css +13 -100
  24. package/lib/internal/template/app-layout/styles.selectors.js +13 -26
  25. package/lib/internal/template/app-layout/toggles/index.d.ts +0 -2
  26. package/lib/internal/template/app-layout/toggles/index.d.ts.map +1 -1
  27. package/lib/internal/template/app-layout/toggles/index.js +2 -2
  28. package/lib/internal/template/app-layout/toggles/index.js.map +1 -1
  29. package/lib/internal/template/app-layout/utils/use-content-height.d.ts +0 -3
  30. package/lib/internal/template/app-layout/utils/use-content-height.d.ts.map +1 -1
  31. package/lib/internal/template/app-layout/utils/use-content-height.js +0 -3
  32. package/lib/internal/template/app-layout/utils/use-content-height.js.map +1 -1
  33. package/lib/internal/template/internal/environment.js +1 -1
  34. package/lib/internal/template/internal/events/index.d.ts +2 -1
  35. package/lib/internal/template/internal/events/index.d.ts.map +1 -1
  36. package/lib/internal/template/internal/events/index.js +4 -6
  37. package/lib/internal/template/internal/events/index.js.map +1 -1
  38. package/lib/internal/template/tabs/tab-header-bar.js +2 -2
  39. package/lib/internal/template/tabs/tab-header-bar.js.map +1 -1
  40. package/package.json +1 -1
  41. package/lib/internal/template/app-layout/drawer.d.ts.map +0 -1
  42. package/lib/internal/template/app-layout/drawer.js.map +0 -1
  43. package/lib/internal/template/app-layout/navigation-panel.d.ts +0 -21
  44. package/lib/internal/template/app-layout/navigation-panel.d.ts.map +0 -1
  45. package/lib/internal/template/app-layout/navigation-panel.js +0 -16
  46. package/lib/internal/template/app-layout/navigation-panel.js.map +0 -1
  47. package/lib/internal/template/app-layout/tools-and-split-panel.d.ts +0 -23
  48. package/lib/internal/template/app-layout/tools-and-split-panel.d.ts.map +0 -1
  49. package/lib/internal/template/app-layout/tools-and-split-panel.js +0 -20
  50. package/lib/internal/template/app-layout/tools-and-split-panel.js.map +0 -1
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "a905cd624839c4f67b05a3f8efed4ba2304bb96d"
2
+ "commit": "425aff2e638ede57b85aff3606d7840961b9f3af"
3
3
  }
@@ -0,0 +1,59 @@
1
+ /*
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ @use '../../internal/styles/tokens' as awsui;
6
+ @use '../constants' as constants;
7
+
8
+ // should be above sticky notifications
9
+ $drawer-z-index: 830;
10
+ // should be above mobile toolbar
11
+ $drawer-z-index-mobile: 1001;
12
+
13
+ .toggle {
14
+ box-sizing: border-box;
15
+ padding: constants.$toggle-padding;
16
+ }
17
+
18
+ .drawer {
19
+ flex-shrink: 0;
20
+ position: relative;
21
+ word-wrap: break-word;
22
+ box-shadow: awsui.$shadow-panel;
23
+
24
+ &:not(.drawer-mobile) {
25
+ z-index: $drawer-z-index;
26
+ }
27
+ &-closed {
28
+ min-width: constants.$sidebar-size-closed;
29
+ cursor: pointer;
30
+ &.drawer-mobile {
31
+ display: none;
32
+ }
33
+ }
34
+ }
35
+
36
+ .drawer-content {
37
+ position: fixed;
38
+ overflow: auto;
39
+ background-color: awsui.$color-background-layout-panel-content;
40
+
41
+ .drawer-mobile > & {
42
+ z-index: $drawer-z-index-mobile;
43
+ top: 0;
44
+ bottom: 0;
45
+ left: 0;
46
+ right: 0;
47
+ }
48
+
49
+ .drawer-closed > & {
50
+ width: constants.$sidebar-size-closed;
51
+ &:hover {
52
+ background: awsui.$color-background-layout-panel-hover;
53
+ }
54
+ }
55
+
56
+ & > [aria-hidden='true'] {
57
+ display: none;
58
+ }
59
+ }
@@ -0,0 +1,13 @@
1
+ /*
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ @use '../constants' as constants;
6
+
7
+ .drawer-displayed {
8
+ min-width: constants.$sidebar-size-closed;
9
+ }
10
+
11
+ .drawer-content {
12
+ position: fixed;
13
+ }
@@ -7,12 +7,6 @@
7
7
  @use '../internal/styles/tokens' as awsui;
8
8
  @use './constants' as constants;
9
9
 
10
- $drawer-z-index: 830;
11
- // should be above mobile toolbar
12
- $drawer-z-index-mobile: 1001;
13
-
14
- $drawer-width: calc(#{awsui.$space-layout-toggle-diameter} + 2 * #{awsui.$space-layout-toggle-padding});
15
-
16
10
  // double flex container to work around flexbox issue in IE
17
11
  // https://github.com/philipwalton/flexbugs#flexbug-3
18
12
  .root,
@@ -55,75 +49,6 @@ $drawer-width: calc(#{awsui.$space-layout-toggle-diameter} + 2 * #{awsui.$space-
55
49
  visibility: hidden;
56
50
  }
57
51
 
58
- .navigation-panel {
59
- overflow-anchor: none;
60
- }
61
-
62
- .drawer {
63
- flex-shrink: 0;
64
- position: relative;
65
- word-wrap: break-word;
66
- box-shadow: awsui.$shadow-panel;
67
-
68
- &:not(.drawer-mobile) {
69
- z-index: $drawer-z-index;
70
- }
71
- &-closed {
72
- min-width: constants.$sidebar-size-closed;
73
- cursor: pointer;
74
- &.drawer-mobile {
75
- display: none;
76
- }
77
- }
78
- }
79
-
80
- .drawer-content {
81
- position: fixed;
82
- overflow: auto;
83
- background-color: awsui.$color-background-layout-panel-content;
84
-
85
- .drawer-mobile > & {
86
- z-index: $drawer-z-index-mobile;
87
- top: 0;
88
- bottom: 0;
89
- left: 0;
90
- right: 0;
91
- }
92
-
93
- .drawer-closed > & {
94
- width: constants.$sidebar-size-closed;
95
- &:hover {
96
- background: awsui.$color-background-layout-panel-hover;
97
- }
98
- }
99
-
100
- & > [aria-hidden='true'] {
101
- display: none;
102
- }
103
- }
104
-
105
- .toggle {
106
- box-sizing: border-box;
107
- padding: constants.$toggle-padding;
108
- }
109
-
110
- .visual-refresh-toggle {
111
- position: fixed;
112
- padding: awsui.$space-scaled-s awsui.$space-layout-toggle-padding;
113
- &-type-tools {
114
- right: 0;
115
- }
116
- &-type-navigation {
117
- left: 0;
118
- }
119
- &[aria-hidden='true'] {
120
- visibility: hidden;
121
- }
122
- &[aria-hidden='false'] {
123
- visibility: visible;
124
- }
125
- }
126
-
127
52
  .breadcrumbs-desktop {
128
53
  padding-top: awsui.$space-scaled-m;
129
54
  padding-bottom: awsui.$space-scaled-s;
@@ -146,26 +71,3 @@ $drawer-width: calc(#{awsui.$space-layout-toggle-diameter} + 2 * #{awsui.$space-
146
71
  // applied to content or content header, whatever comes first
147
72
  padding-top: awsui.$space-scaled-m;
148
73
  }
149
-
150
- .panel-wrapper-outer {
151
- position: fixed;
152
- height: 100%;
153
- z-index: $drawer-z-index;
154
- display: flex;
155
-
156
- &.mobile {
157
- left: 0;
158
- right: 0;
159
- z-index: -1;
160
- pointer-events: none;
161
- &.open {
162
- z-index: $drawer-z-index-mobile;
163
- width: 100vw;
164
- pointer-events: auto;
165
- }
166
- }
167
- }
168
-
169
- .panel-wrapper-inner {
170
- background: awsui.$color-background-layout-panel-content;
171
- }
@@ -1,26 +1,26 @@
1
1
  import React from 'react';
2
- import { ButtonProps } from '../button/interfaces';
3
- import { togglesConfig } from './toggles';
4
- import { AppLayoutProps } from './interfaces';
2
+ import { ButtonProps } from '../../button/interfaces';
3
+ import { togglesConfig } from '../toggles';
4
+ import { AppLayoutProps } from '../interfaces';
5
5
  export interface DesktopDrawerProps {
6
- contentClassName?: string;
7
- toggleClassName?: string;
8
- closeClassName?: string;
6
+ contentClassName: string;
7
+ toggleClassName: string;
8
+ closeClassName: string;
9
9
  toggleRefs: {
10
10
  toggle: React.Ref<ButtonProps.Ref>;
11
11
  close: React.Ref<ButtonProps.Ref>;
12
12
  };
13
13
  width: number;
14
- topOffset?: number;
15
- bottomOffset?: number;
16
- ariaLabels?: AppLayoutProps.Labels;
14
+ topOffset: number | undefined;
15
+ bottomOffset: number | undefined;
16
+ ariaLabels: AppLayoutProps.Labels | undefined;
17
17
  children: React.ReactNode;
18
18
  type: keyof typeof togglesConfig;
19
- isMobile?: boolean;
20
- isOpen?: boolean;
19
+ isMobile: boolean;
20
+ isOpen: boolean;
21
21
  onToggle: (isOpen: boolean) => void;
22
22
  onClick?: (event: React.MouseEvent) => void;
23
23
  onLoseFocus?: (event: React.FocusEvent) => void;
24
24
  }
25
25
  export declare function Drawer({ contentClassName, toggleClassName, closeClassName, width, type, toggleRefs, topOffset, bottomOffset, ariaLabels, children, isOpen, isMobile, onToggle, onClick, onLoseFocus, }: DesktopDrawerProps): JSX.Element;
26
- //# sourceMappingURL=drawer.d.ts.map
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/drawer/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAgC,aAAa,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAI/C,MAAM,WAAW,kBAAkB;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE;QACV,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACnC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;KACnC,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,UAAU,EAAE,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC;IAC9C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,EAAE,MAAM,OAAO,aAAa,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC5C,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;CACjD;AAmBD,wBAAgB,MAAM,CAAC,EACrB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,KAAK,EACL,IAAI,EACJ,UAAU,EACV,SAAS,EACT,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,WAAW,GACZ,EAAE,kBAAkB,eAkEpB"}
@@ -2,7 +2,8 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import clsx from 'clsx';
4
4
  import React from 'react';
5
- import { AppLayoutButton, CloseButton, togglesConfig } from './toggles';
5
+ import { AppLayoutButton, CloseButton, togglesConfig } from '../toggles';
6
+ import testutilStyles from '../test-classes/styles.css.js';
6
7
  import styles from './styles.css.js';
7
8
  // We are using two landmarks per drawer, i.e. two NAVs and two ASIDEs, because of several
8
9
  // known bugs in NVDA that cause focus changes within a container to sometimes not be
@@ -25,15 +26,13 @@ export function Drawer({ contentClassName, toggleClassName, closeClassName, widt
25
26
  const { mainLabel, closeLabel, openLabel } = getLabels(ariaLabels);
26
27
  const drawerContentWidthOpen = isMobile ? undefined : width;
27
28
  const drawerContentWidth = isOpen ? drawerContentWidthOpen : undefined;
28
- const closeIconName = 'close';
29
29
  const regularOpenButton = (React.createElement(TagName, { "aria-label": mainLabel, className: styles.toggle, "aria-hidden": isOpen },
30
30
  React.createElement(AppLayoutButton, { ref: toggleRefs.toggle, className: toggleClassName, iconName: iconName, ariaLabel: openLabel, onClick: () => onToggle(true), ariaExpanded: false })));
31
31
  return (React.createElement("div", { className: clsx(styles.drawer, {
32
32
  [styles['drawer-closed']]: !isOpen,
33
+ [testutilStyles['drawer-closed']]: !isOpen,
33
34
  [styles['drawer-mobile']]: isMobile,
34
- }), style: {
35
- width: drawerContentWidth,
36
- }, onBlur: onLoseFocus
35
+ }), style: { width: drawerContentWidth }, onBlur: onLoseFocus
37
36
  ? e => {
38
37
  if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {
39
38
  onLoseFocus(e);
@@ -53,7 +52,7 @@ export function Drawer({ contentClassName, toggleClassName, closeClassName, widt
53
52
  React.createElement("div", { style: { width: drawerContentWidth, top: topOffset, bottom: bottomOffset }, className: clsx(styles['drawer-content'], contentClassName) },
54
53
  !isMobile && regularOpenButton,
55
54
  React.createElement(TagName, { "aria-label": mainLabel, "aria-hidden": !isOpen },
56
- React.createElement(CloseButton, { ref: toggleRefs.close, className: closeClassName, ariaLabel: closeLabel, onClick: () => onToggle(false), iconName: closeIconName }),
55
+ React.createElement(CloseButton, { ref: toggleRefs.close, className: closeClassName, ariaLabel: closeLabel, onClick: () => onToggle(false) }),
57
56
  children))));
58
57
  }
59
- //# sourceMappingURL=drawer.js.map
58
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app-layout/drawer/index.tsx"],"names":[],"mappings":"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","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport { ButtonProps } from '../../button/interfaces';\nimport { AppLayoutButton, CloseButton, togglesConfig } from '../toggles';\nimport { AppLayoutProps } from '../interfaces';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\nexport interface DesktopDrawerProps {\n contentClassName: string;\n toggleClassName: string;\n closeClassName: string;\n toggleRefs: {\n toggle: React.Ref<ButtonProps.Ref>;\n close: React.Ref<ButtonProps.Ref>;\n };\n width: number;\n topOffset: number | undefined;\n bottomOffset: number | undefined;\n ariaLabels: AppLayoutProps.Labels | undefined;\n children: React.ReactNode;\n type: keyof typeof togglesConfig;\n isMobile: boolean;\n isOpen: boolean;\n onToggle: (isOpen: boolean) => void;\n onClick?: (event: React.MouseEvent) => void;\n onLoseFocus?: (event: React.FocusEvent) => void;\n}\n\n// We are using two landmarks per drawer, i.e. two NAVs and two ASIDEs, because of several\n// known bugs in NVDA that cause focus changes within a container to sometimes not be\n// announced. As a result, we use one region for the open button and one region for the\n// actual drawer content, always hiding the other one when it's not visible.\n// An alternative solution to follow a more classic implementation here to only have one\n// button that triggers the opening/closing of the drawer also did not work due to another\n// series of bugs in NVDA (together with Firefox) which prevent the changed expanded state\n// from being announced.\n// Even with this workaround in place, the announcement of the close button when opening a\n// panel in NVDA is not working correctly. The suspected root cause is one of the bugs below\n// as well.\n// Relevant tickets:\n// * https://github.com/nvaccess/nvda/issues/6606\n// * https://github.com/nvaccess/nvda/issues/5825\n// * https://github.com/nvaccess/nvda/issues/5247\n// * https://github.com/nvaccess/nvda/pull/8869 (reverted PR that was going to fix it)\n\nexport function Drawer({\n contentClassName,\n toggleClassName,\n closeClassName,\n width,\n type,\n toggleRefs,\n topOffset,\n bottomOffset,\n ariaLabels,\n children,\n isOpen,\n isMobile,\n onToggle,\n onClick,\n onLoseFocus,\n}: DesktopDrawerProps) {\n const { TagName, iconName, getLabels } = togglesConfig[type];\n const { mainLabel, closeLabel, openLabel } = getLabels(ariaLabels);\n const drawerContentWidthOpen = isMobile ? undefined : width;\n const drawerContentWidth = isOpen ? drawerContentWidthOpen : undefined;\n\n const regularOpenButton = (\n <TagName aria-label={mainLabel} className={styles.toggle} aria-hidden={isOpen}>\n <AppLayoutButton\n ref={toggleRefs.toggle}\n className={toggleClassName}\n iconName={iconName}\n ariaLabel={openLabel}\n onClick={() => onToggle(true)}\n ariaExpanded={false}\n />\n </TagName>\n );\n\n return (\n <div\n className={clsx(styles.drawer, {\n [styles['drawer-closed']]: !isOpen,\n [testutilStyles['drawer-closed']]: !isOpen,\n [styles['drawer-mobile']]: isMobile,\n })}\n style={{ width: drawerContentWidth }}\n onBlur={\n onLoseFocus\n ? e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n onLoseFocus(e);\n }\n }\n : undefined\n }\n onClick={event => {\n if (onClick) {\n onClick(event);\n }\n\n if (!isOpen) {\n // to prevent calling onToggle from the drawer when it's called from the toggle button\n if ((event.target as Element).tagName !== 'BUTTON') {\n onToggle(true);\n }\n }\n }}\n >\n <div\n style={{ width: drawerContentWidth, top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], contentClassName)}\n >\n {!isMobile && regularOpenButton}\n <TagName aria-label={mainLabel} aria-hidden={!isOpen}>\n <CloseButton\n ref={toggleRefs.close}\n className={closeClassName}\n ariaLabel={closeLabel}\n onClick={() => onToggle(false)}\n />\n {children}\n </TagName>\n </div>\n </div>\n );\n}\n"]}
@@ -0,0 +1,10 @@
1
+
2
+ import './styles.scoped.css';
3
+ export default {
4
+ "toggle": "awsui_toggle_1uo6m_cnce0_97",
5
+ "drawer": "awsui_drawer_1uo6m_cnce0_102",
6
+ "drawer-mobile": "awsui_drawer-mobile_1uo6m_cnce0_108",
7
+ "drawer-closed": "awsui_drawer-closed_1uo6m_cnce0_111",
8
+ "drawer-content": "awsui_drawer-content_1uo6m_cnce0_119"
9
+ };
10
+
@@ -0,0 +1,139 @@
1
+ /*
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ /*
6
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
7
+ SPDX-License-Identifier: Apache-2.0
8
+ */
9
+ /*
10
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
11
+ SPDX-License-Identifier: Apache-2.0
12
+ */
13
+ /*
14
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
15
+ SPDX-License-Identifier: Apache-2.0
16
+ */
17
+ /*
18
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
19
+ SPDX-License-Identifier: Apache-2.0
20
+ */
21
+ /*
22
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
23
+ SPDX-License-Identifier: Apache-2.0
24
+ */
25
+ /*
26
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
27
+ SPDX-License-Identifier: Apache-2.0
28
+ */
29
+ /*
30
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
31
+ SPDX-License-Identifier: Apache-2.0
32
+ */
33
+ /*
34
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
35
+ SPDX-License-Identifier: Apache-2.0
36
+ */
37
+ /*
38
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
39
+ SPDX-License-Identifier: Apache-2.0
40
+ */
41
+ /*
42
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
43
+ SPDX-License-Identifier: Apache-2.0
44
+ */
45
+ /*
46
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
47
+ SPDX-License-Identifier: Apache-2.0
48
+ */
49
+ /*
50
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
51
+ SPDX-License-Identifier: Apache-2.0
52
+ */
53
+ /*
54
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
55
+ SPDX-License-Identifier: Apache-2.0
56
+ */
57
+ /*
58
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
59
+ SPDX-License-Identifier: Apache-2.0
60
+ */
61
+ /*
62
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
63
+ SPDX-License-Identifier: Apache-2.0
64
+ */
65
+ /* stylelint-disable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
66
+ /* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
67
+ /*
68
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
69
+ SPDX-License-Identifier: Apache-2.0
70
+ */
71
+ /*
72
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
73
+ SPDX-License-Identifier: Apache-2.0
74
+ */
75
+ /*
76
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
77
+ SPDX-License-Identifier: Apache-2.0
78
+ */
79
+ /*
80
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
81
+ SPDX-License-Identifier: Apache-2.0
82
+ */
83
+ /* Style used for links in slots/components that are text heavy, to help links stand out among
84
+ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
85
+ /*
86
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
87
+ SPDX-License-Identifier: Apache-2.0
88
+ */
89
+ /*
90
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
91
+ SPDX-License-Identifier: Apache-2.0
92
+ */
93
+ /*
94
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
95
+ SPDX-License-Identifier: Apache-2.0
96
+ */
97
+ .awsui_toggle_1uo6m_cnce0_97:not(#\9) {
98
+ box-sizing: border-box;
99
+ padding: var(--space-xxs-ynfts5, 4px) 7px;
100
+ }
101
+
102
+ .awsui_drawer_1uo6m_cnce0_102:not(#\9) {
103
+ flex-shrink: 0;
104
+ position: relative;
105
+ word-wrap: break-word;
106
+ box-shadow: var(--shadow-panel-v9vx7i, 0 1px 1px 0 rgba(0, 28, 36, 0.3), 1px 1px 1px 0 rgba(0, 28, 36, 0.15), -1px 1px 1px 0 rgba(0, 28, 36, 0.15));
107
+ }
108
+ .awsui_drawer_1uo6m_cnce0_102:not(#\9):not(.awsui_drawer-mobile_1uo6m_cnce0_108) {
109
+ z-index: 830;
110
+ }
111
+ .awsui_drawer-closed_1uo6m_cnce0_111:not(#\9) {
112
+ min-width: 40px;
113
+ cursor: pointer;
114
+ }
115
+ .awsui_drawer-closed_1uo6m_cnce0_111.awsui_drawer-mobile_1uo6m_cnce0_108:not(#\9) {
116
+ display: none;
117
+ }
118
+
119
+ .awsui_drawer-content_1uo6m_cnce0_119:not(#\9) {
120
+ position: fixed;
121
+ overflow: auto;
122
+ background-color: var(--color-background-layout-panel-content-r9pdjh, #ffffff);
123
+ }
124
+ .awsui_drawer-mobile_1uo6m_cnce0_108 > .awsui_drawer-content_1uo6m_cnce0_119:not(#\9) {
125
+ z-index: 1001;
126
+ top: 0;
127
+ bottom: 0;
128
+ left: 0;
129
+ right: 0;
130
+ }
131
+ .awsui_drawer-closed_1uo6m_cnce0_111 > .awsui_drawer-content_1uo6m_cnce0_119:not(#\9) {
132
+ width: 40px;
133
+ }
134
+ .awsui_drawer-closed_1uo6m_cnce0_111 > .awsui_drawer-content_1uo6m_cnce0_119:not(#\9):hover {
135
+ background: var(--color-background-layout-panel-hover-thdv3z, #eaeded);
136
+ }
137
+ .awsui_drawer-content_1uo6m_cnce0_119 > [aria-hidden=true]:not(#\9) {
138
+ display: none;
139
+ }
@@ -0,0 +1,11 @@
1
+
2
+ // es-module interop with Babel and Typescript
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ module.exports.default = {
5
+ "toggle": "awsui_toggle_1uo6m_cnce0_97",
6
+ "drawer": "awsui_drawer_1uo6m_cnce0_102",
7
+ "drawer-mobile": "awsui_drawer-mobile_1uo6m_cnce0_108",
8
+ "drawer-closed": "awsui_drawer-closed_1uo6m_cnce0_111",
9
+ "drawer-content": "awsui_drawer-content_1uo6m_cnce0_119"
10
+ };
11
+
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/app-layout/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAwE,MAAM,OAAO,CAAC;AAM7F,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAqC9C,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,QAAA,MAAM,SAAS,2FAmBd,CAAC;AAgeF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/app-layout/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAwE,MAAM,OAAO,CAAC;AAM7F,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAqC9C,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,QAAA,MAAM,SAAS,2FAmBd,CAAC;AAydF,eAAe,SAAS,CAAC"}
@@ -26,8 +26,8 @@ import useBaseComponent from '../internal/hooks/use-base-component';
26
26
  import { useVisualRefresh } from '../internal/hooks/use-visual-mode';
27
27
  import ContentWrapper from './content-wrapper';
28
28
  import { useEffectOnUpdate } from '../internal/hooks/use-effect-on-update';
29
- import { NavigationPanel } from './navigation-panel';
30
- import { ToolsAndSplitPanel } from './tools-and-split-panel';
29
+ import { Drawer } from './drawer';
30
+ import { SideSplitPanelDrawer } from './split-panel-drawer';
31
31
  import useAppLayoutOffsets from './utils/use-content-width';
32
32
  import { isDevelopment } from '../internal/is-development';
33
33
  import { warnOnce } from '../internal/logging';
@@ -69,7 +69,7 @@ const OldAppLayout = React.forwardRef(({ navigation, navigationWidth = 280, navi
69
69
  };
70
70
  const navigationVisible = !navigationHide && navigationOpen;
71
71
  const toolsVisible = !toolsHide && toolsOpen;
72
- const { contentHeightStyle, headerHeight, footerHeight, panelHeightStyle } = useContentHeight(headerSelector, footerSelector, disableBodyScroll);
72
+ const { contentHeightStyle, headerHeight, footerHeight } = useContentHeight(headerSelector, footerSelector, disableBodyScroll);
73
73
  const [isSplitpanelForcedPosition, setIsSplitpanelForcedPosition] = useState(false);
74
74
  const [notificationsHeight, notificationsRef] = useContainerQuery(rect => rect.height);
75
75
  const anyPanelOpen = navigationVisible || toolsVisible;
@@ -227,29 +227,11 @@ const OldAppLayout = React.forwardRef(({ navigation, navigationWidth = 280, navi
227
227
  : splitPanelOpen
228
228
  ? splitPanelReportedSize
229
229
  : splitPanelReportedHeaderHeight)) !== null && _a !== void 0 ? _a : undefined;
230
- const toolsDrawerWidth = (() => {
231
- if (isMobile) {
232
- return 0;
233
- }
234
- const toolsPanelWidth = toolsHide ? 0 : toolsOpen ? toolsWidth : closedDrawerWidth;
235
- const splitPanelWidth = !splitPanelDisplayed || finalSplitPanePosition !== 'side'
236
- ? 0
237
- : splitPanelOpen
238
- ? splitPanelReportedSize
239
- : closedDrawerWidth;
240
- return toolsPanelWidth + splitPanelWidth;
241
- })();
242
- const navigationDrawerWidth = (() => {
243
- if (isMobile) {
244
- return 0;
245
- }
246
- return effectiveNavigationWidth;
247
- })();
248
230
  return (React.createElement("div", { className: clsx(styles.root, testutilStyles.root, disableBodyScroll && styles['root-no-scroll']), ref: rootRef },
249
231
  React.createElement("div", { className: styles['layout-wrapper'], style: contentHeightStyle },
250
232
  isMobile && (!toolsHide || !navigationHide || breadcrumbs) && (React.createElement(MobileToolbar, { anyPanelOpen: anyPanelOpen, toggleRefs: { navigation: navigationRefs.toggle, tools: toolsRefs.toggle }, topOffset: headerHeight, ariaLabels: ariaLabels, navigationHide: navigationHide, toolsHide: toolsHide, onNavigationOpen: () => onNavigationToggle(true), onToolsOpen: () => onToolsToggle(true), unfocusable: anyPanelOpen }, breadcrumbs)),
251
233
  React.createElement("div", { className: clsx(styles.layout, disableBodyScroll && styles['layout-no-scroll']) },
252
- !navigationHide && (React.createElement(NavigationPanel, { ariaLabels: ariaLabels, footerHeight: footerHeight, headerHeight: headerHeight, isMobile: isMobile, navigation: navigation, navigationDrawerWidth: navigationDrawerWidth, navigationOpen: navigationOpen, onClick: isMobile ? onNavigationClick : undefined, onNavigationToggle: onNavigationToggle, panelHeightStyle: panelHeightStyle, toggleRefs: navigationRefs, navigationWidth: navigationWidth })),
234
+ !navigationHide && (React.createElement(Drawer, { contentClassName: testutilStyles.navigation, toggleClassName: testutilStyles['navigation-toggle'], closeClassName: testutilStyles['navigation-close'], ariaLabels: ariaLabels, bottomOffset: footerHeight, topOffset: headerHeight, isMobile: isMobile, isOpen: navigationOpen, onClick: isMobile ? onNavigationClick : undefined, onToggle: onNavigationToggle, toggleRefs: navigationRefs, type: "navigation", width: navigationWidth }, navigation)),
253
235
  React.createElement("main", { ref: legacyScrollRootRef, className: clsx(styles['layout-main'], {
254
236
  [styles['layout-main-scrollable']]: disableBodyScroll,
255
237
  [testutilStyles['disable-body-scroll-root']]: disableBodyScroll,
@@ -281,7 +263,8 @@ const OldAppLayout = React.forwardRef(({ navigation, navigationWidth = 280, navi
281
263
  hasBreadcrumbs: !!breadcrumbs,
282
264
  } }, content))),
283
265
  finalSplitPanePosition === 'bottom' && splitPanelWrapped),
284
- React.createElement(ToolsAndSplitPanel, { splitPanel: finalSplitPanePosition === 'side' ? splitPanelWrapped : undefined, ariaLabels: ariaLabels, drawerWidth: toolsDrawerWidth, footerHeight: footerHeight, headerHeight: headerHeight, isMobile: isMobile, onToolsToggle: onToolsToggle, panelHeightStyle: panelHeightStyle, toggleRefs: toolsRefs, onLoseToolsFocus: loseToolsFocus, tools: tools, toolsHide: Boolean(toolsHide), toolsOpen: toolsOpen, toolsWidth: toolsWidth })))));
266
+ finalSplitPanePosition === 'side' && (React.createElement(SideSplitPanelDrawer, { topOffset: headerHeight, bottomOffset: footerHeight, displayed: splitPanelDisplayed, width: splitPanelOpen ? splitPanelSize : undefined }, splitPanelWrapped)),
267
+ !toolsHide && (React.createElement(Drawer, { contentClassName: testutilStyles.tools, toggleClassName: testutilStyles['tools-toggle'], closeClassName: testutilStyles['tools-close'], ariaLabels: ariaLabels, width: toolsWidth, bottomOffset: footerHeight, topOffset: headerHeight, isMobile: isMobile, onToggle: onToolsToggle, isOpen: toolsOpen, toggleRefs: toolsRefs, type: "tools", onLoseFocus: loseToolsFocus }, tools))))));
285
268
  });
286
269
  applyDisplayName(AppLayout, 'AppLayout');
287
270
  export default AppLayout;