@cloudscape-design/components-themeable 3.0.350 → 3.0.351

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 (48) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/app-layout/constants.scss +3 -8
  3. package/lib/internal/scss/app-layout/drawer/styles.scss +26 -35
  4. package/lib/internal/scss/app-layout/mobile-toolbar/styles.scss +9 -22
  5. package/lib/internal/scss/app-layout/toggles/styles.scss +18 -0
  6. package/lib/internal/template/app-layout/drawer/index.js +6 -5
  7. package/lib/internal/template/app-layout/drawer/index.js.map +1 -1
  8. package/lib/internal/template/app-layout/drawer/interfaces.d.ts +6 -3
  9. package/lib/internal/template/app-layout/drawer/interfaces.d.ts.map +1 -1
  10. package/lib/internal/template/app-layout/drawer/interfaces.js.map +1 -1
  11. package/lib/internal/template/app-layout/drawer/styles.css.js +10 -10
  12. package/lib/internal/template/app-layout/drawer/styles.scoped.css +32 -35
  13. package/lib/internal/template/app-layout/drawer/styles.selectors.js +10 -10
  14. package/lib/internal/template/app-layout/mobile-toolbar/index.d.ts.map +1 -1
  15. package/lib/internal/template/app-layout/mobile-toolbar/index.js +6 -5
  16. package/lib/internal/template/app-layout/mobile-toolbar/index.js.map +1 -1
  17. package/lib/internal/template/app-layout/mobile-toolbar/styles.css.js +8 -6
  18. package/lib/internal/template/app-layout/mobile-toolbar/styles.scoped.css +11 -23
  19. package/lib/internal/template/app-layout/mobile-toolbar/styles.selectors.js +8 -6
  20. package/lib/internal/template/app-layout/toggles/index.d.ts +3 -1
  21. package/lib/internal/template/app-layout/toggles/index.d.ts.map +1 -1
  22. package/lib/internal/template/app-layout/toggles/index.js +6 -3
  23. package/lib/internal/template/app-layout/toggles/index.js.map +1 -1
  24. package/lib/internal/template/app-layout/toggles/interfaces.d.ts +3 -2
  25. package/lib/internal/template/app-layout/toggles/interfaces.d.ts.map +1 -1
  26. package/lib/internal/template/app-layout/toggles/interfaces.js.map +1 -1
  27. package/lib/internal/template/app-layout/toggles/styles.css.js +2 -1
  28. package/lib/internal/template/app-layout/toggles/styles.scoped.css +31 -1
  29. package/lib/internal/template/app-layout/toggles/styles.selectors.js +2 -1
  30. package/lib/internal/template/app-layout/visual-refresh/drawers.d.ts.map +1 -1
  31. package/lib/internal/template/app-layout/visual-refresh/drawers.js +2 -2
  32. package/lib/internal/template/app-layout/visual-refresh/drawers.js.map +1 -1
  33. package/lib/internal/template/app-layout/visual-refresh/trigger-button.d.ts +1 -0
  34. package/lib/internal/template/app-layout/visual-refresh/trigger-button.d.ts.map +1 -1
  35. package/lib/internal/template/app-layout/visual-refresh/trigger-button.js +2 -2
  36. package/lib/internal/template/app-layout/visual-refresh/trigger-button.js.map +1 -1
  37. package/lib/internal/template/internal/base-component/styles.scoped.css +0 -11
  38. package/lib/internal/template/internal/environment.js +1 -1
  39. package/lib/internal/template/internal/generated/theming/index.cjs +0 -27
  40. package/lib/internal/template/internal/generated/theming/index.js +0 -27
  41. package/lib/internal/template/test-utils/dom/app-layout/index.d.ts +1 -0
  42. package/lib/internal/template/test-utils/dom/app-layout/index.js +3 -0
  43. package/lib/internal/template/test-utils/dom/app-layout/index.js.map +1 -1
  44. package/lib/internal/template/test-utils/selectors/app-layout/index.d.ts +1 -0
  45. package/lib/internal/template/test-utils/selectors/app-layout/index.js +3 -0
  46. package/lib/internal/template/test-utils/selectors/app-layout/index.js.map +1 -1
  47. package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
  48. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "b80535d74110de4e1e2e3459ef46bbb215d3baf3"
2
+ "commit": "d85259aaebc05fdf1fb4a2b939e95d2e034a6767"
3
3
  }
@@ -8,14 +8,9 @@
8
8
 
9
9
  // Toggle should have 40px width, whereas button is 26px wide.
10
10
  // 40 - 26 = 14px in total or 7px on each side
11
- $toggle-padding-horizontal: 0.7 * styles.$base-size;
12
- $toggle-padding-vertical: awsui.$space-xxs;
13
- $toggle-padding: $toggle-padding-vertical $toggle-padding-horizontal;
14
-
15
- // New styles for when there are drawers
16
- $drawers-padding-horizontal: 0.6 * styles.$base-size;
17
- $drawers-padding-vertical: awsui.$space-scaled-xs;
18
- $drawers-padding: $drawers-padding-vertical $drawers-padding-horizontal;
11
+ $_toggle-padding-horizontal: 0.7 * styles.$base-size;
12
+ $_toggle-padding-vertical: awsui.$space-xxs;
13
+ $toggle-padding: $_toggle-padding-vertical $_toggle-padding-horizontal;
19
14
 
20
15
  $sidebar-size-closed: 4 * styles.$base-size;
21
16
 
@@ -3,6 +3,8 @@
3
3
  SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  @use '../../internal/styles/tokens' as awsui;
6
+ @use '../../internal/styles' as styles;
7
+ @use '../../internal/hooks/focus-visible' as focus-visible;
6
8
  @use '../constants' as constants;
7
9
 
8
10
  // should be above sticky notifications
@@ -29,7 +31,6 @@ $drawer-z-index-mobile: 1001;
29
31
  }
30
32
  &-closed {
31
33
  min-width: constants.$sidebar-size-closed;
32
- cursor: pointer;
33
34
  &.drawer-mobile {
34
35
  display: none;
35
36
  }
@@ -48,13 +49,11 @@ $drawer-z-index-mobile: 1001;
48
49
  }
49
50
  .drawer-closed > & {
50
51
  width: constants.$sidebar-size-closed;
51
- &:hover {
52
- background: awsui.$color-background-layout-panel-hover;
53
- }
54
- &.non-interactive {
52
+ &.drawer-content-clickable {
53
+ cursor: pointer;
54
+ color: awsui.$color-text-interactive-default;
55
55
  &:hover {
56
- background: awsui.$color-background-layout-panel-content;
57
- cursor: default;
56
+ background: awsui.$color-background-layout-panel-hover;
58
57
  }
59
58
  }
60
59
  }
@@ -63,34 +62,26 @@ $drawer-z-index-mobile: 1001;
63
62
  }
64
63
  }
65
64
 
66
- .trigger {
67
- .drawer-content > .drawer-triggers > & {
68
- background: awsui.$color-background-layout-toggle-default;
69
- border: 0;
70
- border-radius: 0;
71
- color: awsui.$color-text-layout-toggle;
72
- padding: constants.$drawers-padding-vertical awsui.$space-s;
73
- margin-top: 1px;
74
-
75
- &:not(:last-child) {
76
- box-shadow: 0px 1px awsui.$color-shadow-layout-toggle;
77
- }
78
- &-drawer {
79
- &:hover:not(.selected) {
80
- color: awsui.$color-text-layout-toggle-hover;
81
- &:not(:last-child) {
82
- box-shadow: 0px 1px awsui.$color-shadow-layout-toggle;
83
- }
84
- }
85
- }
65
+ .drawer-triggers-wrapper {
66
+ display: flex;
67
+ flex-direction: column;
68
+ text-align: center;
69
+ align-items: stretch;
70
+ }
86
71
 
87
- &.selected,
88
- &.selected:hover {
89
- background-color: awsui.$color-background-layout-toggle-selected-default;
90
- border-top: 1px solid awsui.$color-background-layout-toggle-selected-default;
91
- box-shadow: none;
92
- color: awsui.$color-text-layout-toggle-active;
93
- margin: 0;
94
- }
72
+ .drawer-trigger {
73
+ padding: constants.$toggle-padding;
74
+ cursor: pointer;
75
+ color: awsui.$color-text-interactive-default;
76
+ &:not(:first-child) {
77
+ border-top: 1px solid awsui.$color-border-layout;
78
+ }
79
+ &:hover {
80
+ color: awsui.$color-text-layout-toggle-hover;
81
+ }
82
+ &-active,
83
+ &-active:hover {
84
+ background-color: awsui.$color-background-layout-toggle-selected-default;
85
+ color: awsui.$color-text-layout-toggle-active;
95
86
  }
96
87
  }
@@ -12,7 +12,6 @@
12
12
  }
13
13
 
14
14
  .mobile-bar {
15
- /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
16
15
  position: sticky;
17
16
  display: flex;
18
17
  align-items: center;
@@ -32,38 +31,26 @@
32
31
  margin-right: awsui.$space-m;
33
32
  }
34
33
 
35
- .mobile-trigger-with-drawers {
36
- width: constants.$sidebar-size-closed;
37
- display: flex;
38
- justify-content: center;
39
- }
40
-
41
34
  .mobile-toggle {
42
35
  box-sizing: border-box;
43
36
  cursor: pointer;
44
37
  z-index: 1;
45
38
  padding: constants.$toggle-padding;
46
39
  width: constants.$sidebar-size-closed;
47
- &:first-child {
40
+ color: awsui.$color-text-interactive-default;
41
+ &-type-navigation {
48
42
  border-right: 1px solid awsui.$color-border-layout;
49
43
  }
50
- &:last-child:not(.mobile-toggle-with-drawers) {
44
+ &-type-tools,
45
+ &-type-drawer {
51
46
  border-left: 1px solid awsui.$color-border-layout;
52
47
  }
53
- &:hover:not(.mobile-toggle-with-drawers) {
48
+ &:hover {
54
49
  background: awsui.$color-background-layout-panel-hover;
55
50
  }
51
+ }
56
52
 
57
- &-with-drawers {
58
- display: flex;
59
- width: auto;
60
- padding: 0;
61
- height: 100%;
62
-
63
- > .mobile-trigger-with-drawers {
64
- border-left: 1px solid awsui.$color-border-layout;
65
- display: flex;
66
- align-items: center;
67
- }
68
- }
53
+ .drawers-container {
54
+ display: flex;
55
+ align-items: stretch;
69
56
  }
@@ -7,6 +7,24 @@
7
7
  @use '../../internal/styles' as styles;
8
8
  @use '../../internal/hooks/focus-visible' as focus-visible;
9
9
 
10
+ .toggle-button {
11
+ cursor: pointer;
12
+ border: 0;
13
+ // resemble button styles with an extra 1px offset for non-existing here border width
14
+ $padding-vertical: calc(#{awsui.$space-scaled-xxs} + 1px);
15
+ $padding-horizontal: calc(#{awsui.$space-xxs} + 1px);
16
+ padding: $padding-vertical $padding-horizontal;
17
+ background: transparent;
18
+ color: currentColor;
19
+ &:focus {
20
+ outline: none;
21
+ text-decoration: none;
22
+ }
23
+ @include focus-visible.when-visible {
24
+ @include styles.focus-highlight(awsui.$space-button-inline-icon-focus-outline-gutter);
25
+ }
26
+ }
27
+
10
28
  .close-button {
11
29
  position: absolute;
12
30
  outline: none;
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import clsx from 'clsx';
4
4
  import React, { useRef } from 'react';
5
- import { AppLayoutButton, CloseButton, togglesConfig } from '../toggles';
5
+ import { ToggleButton, CloseButton, togglesConfig } from '../toggles';
6
6
  import testutilStyles from '../test-classes/styles.css.js';
7
7
  import styles from './styles.css.js';
8
8
  // We are using two landmarks per drawer, i.e. two NAVs and two ASIDEs, because of several
@@ -34,7 +34,7 @@ export const Drawer = React.forwardRef(({ contentClassName, toggleClassName, clo
34
34
  });
35
35
  const { drawerMainLabel, drawerCloseLabel } = getDrawersLabels(drawersAriaLabels);
36
36
  const regularOpenButton = (React.createElement(TagName, { ref: openButtonWrapperRef, "aria-label": mainLabel, className: styles.toggle, "aria-hidden": isOpen },
37
- React.createElement(AppLayoutButton, { ref: toggleRefs.toggle, className: toggleClassName, iconName: iconName, ariaLabel: openLabel, onClick: () => onToggle(true), ariaExpanded: false })));
37
+ React.createElement(ToggleButton, { ref: toggleRefs.toggle, className: toggleClassName, iconName: iconName, ariaLabel: openLabel, onClick: () => onToggle(true), ariaExpanded: false })));
38
38
  return (React.createElement("div", { ref: ref, className: clsx(styles.drawer, {
39
39
  [styles['drawer-closed']]: !isOpen,
40
40
  [testutilStyles['drawer-closed']]: !isOpen,
@@ -58,7 +58,7 @@ export const Drawer = React.forwardRef(({ contentClassName, toggleClassName, clo
58
58
  }
59
59
  }
60
60
  } },
61
- React.createElement("div", { style: { width: drawerContentWidth, top: topOffset, bottom: bottomOffset }, className: clsx(styles['drawer-content'], contentClassName) },
61
+ React.createElement("div", { style: { width: drawerContentWidth, top: topOffset, bottom: bottomOffset }, className: clsx(styles['drawer-content'], styles['drawer-content-clickable'], contentClassName) },
62
62
  !isMobile && regularOpenButton,
63
63
  resizeHandle,
64
64
  React.createElement(TagName, { "aria-label": drawers ? drawerMainLabel : mainLabel, "aria-hidden": !isOpen },
@@ -73,9 +73,10 @@ export function DrawerTriggersBar({ isMobile, topOffset, bottomOffset, drawers,
73
73
  return (React.createElement("div", { className: clsx(styles.drawer, styles['drawer-closed'], testutilStyles['drawer-closed'], {
74
74
  [styles['drawer-mobile']]: isMobile,
75
75
  }) },
76
- React.createElement("div", { style: { top: topOffset, bottom: bottomOffset }, className: clsx(styles['drawer-content'], styles['non-interactive']) }, !isMobile && (React.createElement("aside", { "aria-label": drawers === null || drawers === void 0 ? void 0 : drawers.ariaLabel, className: clsx(styles['drawer-triggers'], contentClassName) }, (_a = drawers === null || drawers === void 0 ? void 0 : drawers.items) === null || _a === void 0 ? void 0 : _a.map((item, index) => {
76
+ React.createElement("div", { style: { top: topOffset, bottom: bottomOffset }, className: styles['drawer-content'] }, !isMobile && (React.createElement("aside", { "aria-label": drawers === null || drawers === void 0 ? void 0 : drawers.ariaLabel, className: clsx(styles['drawer-triggers-wrapper'], contentClassName) }, (_a = drawers === null || drawers === void 0 ? void 0 : drawers.items) === null || _a === void 0 ? void 0 : _a.map((item, index) => {
77
77
  var _a;
78
- return (React.createElement(AppLayoutButton, { className: clsx(toggleClassName, styles.trigger, styles['trigger-drawer'], drawers.activeDrawerId === item.id && styles.selected), key: `drawer-trigger-${index}`, iconName: item.trigger.iconName, iconSvg: item.trigger.iconSvg, ariaLabel: (_a = item.ariaLabels) === null || _a === void 0 ? void 0 : _a.triggerButton, onClick: () => drawers.onChange({ activeDrawerId: item.id !== drawers.activeDrawerId ? item.id : undefined }), ariaExpanded: drawers.activeDrawerId !== undefined }));
78
+ return (React.createElement("span", { key: index, className: clsx(styles['drawer-trigger'], drawers.activeDrawerId === item.id && styles['drawer-trigger-active']), onClick: () => drawers.onChange({ activeDrawerId: item.id !== drawers.activeDrawerId ? item.id : undefined }) },
79
+ React.createElement(ToggleButton, { className: toggleClassName, iconName: item.trigger.iconName, iconSvg: item.trigger.iconSvg, ariaLabel: (_a = item.ariaLabels) === null || _a === void 0 ? void 0 : _a.triggerButton, ariaExpanded: drawers.activeDrawerId !== undefined, testId: `awsui-app-layout-trigger-${item.id}` })));
79
80
  }))))));
80
81
  }
81
82
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["app-layout/drawer/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,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,CAAA;SAAA,CAAC,CACI,CACT,CACG,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useRef } from 'react';\nimport { AppLayoutButton, CloseButton, togglesConfig } from '../toggles';\n\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\nimport { DesktopDrawerProps, DrawerTriggersBarProps, DrawerItem, DrawerItemAriaLabels } from './interfaces';\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)\nexport const Drawer = React.forwardRef(\n (\n {\n contentClassName,\n toggleClassName,\n closeClassName,\n width,\n type,\n toggleRefs,\n topOffset,\n bottomOffset,\n ariaLabels,\n drawersAriaLabels,\n children,\n isOpen,\n isMobile,\n onToggle,\n onClick,\n onLoseFocus,\n drawers,\n resizeHandle,\n }: DesktopDrawerProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n const openButtonWrapperRef = useRef<HTMLElement | null>(null);\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 getDrawersLabels = (labels: DrawerItemAriaLabels = {}) => ({\n drawerMainLabel: labels?.content,\n drawerOpenLabel: labels?.triggerButton,\n drawerCloseLabel: labels?.closeButton,\n });\n const { drawerMainLabel, drawerCloseLabel } = getDrawersLabels(drawersAriaLabels);\n\n const regularOpenButton = (\n <TagName ref={openButtonWrapperRef} 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 ref={ref}\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 if (!isOpen) {\n // to prevent calling onToggle from the drawer when it's called from the toggle button\n if (\n openButtonWrapperRef.current === event.target ||\n !openButtonWrapperRef.current?.contains(event.target as Node)\n ) {\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 {resizeHandle}\n <TagName aria-label={drawers ? drawerMainLabel : mainLabel} aria-hidden={!isOpen}>\n <CloseButton\n ref={toggleRefs.close}\n className={closeClassName}\n ariaLabel={drawers ? drawerCloseLabel : closeLabel}\n onClick={() => {\n onToggle(false);\n drawers?.onChange({ activeDrawerId: undefined });\n }}\n />\n {children}\n </TagName>\n </div>\n </div>\n );\n }\n);\n\nexport function DrawerTriggersBar({\n isMobile,\n topOffset,\n bottomOffset,\n drawers,\n contentClassName,\n toggleClassName,\n}: DrawerTriggersBarProps) {\n return (\n <div\n className={clsx(styles.drawer, styles['drawer-closed'], testutilStyles['drawer-closed'], {\n [styles['drawer-mobile']]: isMobile,\n })}\n >\n <div\n style={{ top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], styles['non-interactive'])}\n >\n {!isMobile && (\n <aside aria-label={drawers?.ariaLabel} className={clsx(styles['drawer-triggers'], contentClassName)}>\n {drawers?.items?.map((item: DrawerItem, index: number) => (\n <AppLayoutButton\n className={clsx(\n toggleClassName,\n styles.trigger,\n styles['trigger-drawer'],\n drawers.activeDrawerId === item.id && styles.selected\n )}\n key={`drawer-trigger-${index}`}\n iconName={item.trigger.iconName}\n iconSvg={item.trigger.iconSvg}\n ariaLabel={item.ariaLabels?.triggerButton}\n onClick={() =>\n drawers.onChange({ activeDrawerId: item.id !== drawers.activeDrawerId ? item.id : undefined })\n }\n ariaExpanded={drawers.activeDrawerId !== undefined}\n />\n ))}\n </aside>\n )}\n </div>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["app-layout/drawer/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEtE,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAGrC,0FAA0F;AAC1F,qFAAqF;AACrF,uFAAuF;AACvF,4EAA4E;AAC5E,wFAAwF;AACxF,0FAA0F;AAC1F,0FAA0F;AAC1F,wBAAwB;AACxB,0FAA0F;AAC1F,4FAA4F;AAC5F,WAAW;AACX,oBAAoB;AACpB,iDAAiD;AACjD,iDAAiD;AACjD,iDAAiD;AACjD,sFAAsF;AACtF,MAAM,CAAC,MAAM,MAA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AM,CAAC,yBAAyB,CAAC,EAAE,gBAAgB,CAAC,IACxG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,0CAAE,GAAG,CAAC,CAAC,IAAgB,EAAE,KAAa,EAAE,EAAE;;YAAC,OAAA,CACxD,8BACE,GAAG,EAAE,KAAK,EACV,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,gBAAgB,CAAC,EACxB,OAAO,CAAC,cAAc,KAAK,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,uBAAuB,CAAC,CACtE,EACD,OAAO,EAAE,GAAG,EAAE,CACZ,OAAO,CAAC,QAAQ,CAAC,EAAE,cAAc,EAAE,IAAI,CAAC,EAAE,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;gBAGhG,oBAAC,YAAY,IACX,SAAS,EAAE,eAAe,EAC1B,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,EAC/B,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAC7B,SAAS,EAAE,MAAA,IAAI,CAAC,UAAU,0CAAE,aAAa,EACzC,YAAY,EAAE,OAAO,CAAC,cAAc,KAAK,SAAS,EAClD,MAAM,EAAE,4BAA4B,IAAI,CAAC,EAAE,EAAE,GAC7C,CACG,CACR,CAAA;SAAA,CAAC,CACI,CACT,CACG,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useRef } from 'react';\nimport { ToggleButton, CloseButton, togglesConfig } from '../toggles';\n\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\nimport { DesktopDrawerProps, DrawerTriggersBarProps, DrawerItem, DrawerItemAriaLabels } from './interfaces';\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)\nexport const Drawer = React.forwardRef(\n (\n {\n contentClassName,\n toggleClassName,\n closeClassName,\n width,\n type,\n toggleRefs,\n topOffset,\n bottomOffset,\n ariaLabels,\n drawersAriaLabels,\n children,\n isOpen,\n isMobile,\n onToggle,\n onClick,\n onLoseFocus,\n drawers,\n resizeHandle,\n }: DesktopDrawerProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n const openButtonWrapperRef = useRef<HTMLElement | null>(null);\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 getDrawersLabels = (labels: DrawerItemAriaLabels = {}) => ({\n drawerMainLabel: labels?.content,\n drawerOpenLabel: labels?.triggerButton,\n drawerCloseLabel: labels?.closeButton,\n });\n const { drawerMainLabel, drawerCloseLabel } = getDrawersLabels(drawersAriaLabels);\n\n const regularOpenButton = (\n <TagName ref={openButtonWrapperRef} aria-label={mainLabel} className={styles.toggle} aria-hidden={isOpen}>\n <ToggleButton\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 ref={ref}\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 if (!isOpen) {\n // to prevent calling onToggle from the drawer when it's called from the toggle button\n if (\n openButtonWrapperRef.current === event.target ||\n !openButtonWrapperRef.current?.contains(event.target as Node)\n ) {\n onToggle(true);\n }\n }\n }}\n >\n <div\n style={{ width: drawerContentWidth, top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], styles['drawer-content-clickable'], contentClassName)}\n >\n {!isMobile && regularOpenButton}\n {resizeHandle}\n <TagName aria-label={drawers ? drawerMainLabel : mainLabel} aria-hidden={!isOpen}>\n <CloseButton\n ref={toggleRefs.close}\n className={closeClassName}\n ariaLabel={drawers ? drawerCloseLabel : closeLabel}\n onClick={() => {\n onToggle(false);\n drawers?.onChange({ activeDrawerId: undefined });\n }}\n />\n {children}\n </TagName>\n </div>\n </div>\n );\n }\n);\n\nexport function DrawerTriggersBar({\n isMobile,\n topOffset,\n bottomOffset,\n drawers,\n contentClassName,\n toggleClassName,\n}: DrawerTriggersBarProps) {\n return (\n <div\n className={clsx(styles.drawer, styles['drawer-closed'], testutilStyles['drawer-closed'], {\n [styles['drawer-mobile']]: isMobile,\n })}\n >\n <div style={{ top: topOffset, bottom: bottomOffset }} className={styles['drawer-content']}>\n {!isMobile && (\n <aside aria-label={drawers?.ariaLabel} className={clsx(styles['drawer-triggers-wrapper'], contentClassName)}>\n {drawers?.items?.map((item: DrawerItem, index: number) => (\n <span\n key={index}\n className={clsx(\n styles['drawer-trigger'],\n drawers.activeDrawerId === item.id && styles['drawer-trigger-active']\n )}\n onClick={() =>\n drawers.onChange({ activeDrawerId: item.id !== drawers.activeDrawerId ? item.id : undefined })\n }\n >\n <ToggleButton\n className={toggleClassName}\n iconName={item.trigger.iconName}\n iconSvg={item.trigger.iconSvg}\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaExpanded={drawers.activeDrawerId !== undefined}\n testId={`awsui-app-layout-trigger-${item.id}`}\n />\n </span>\n ))}\n </aside>\n )}\n </div>\n </div>\n );\n}\n"]}
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { ButtonProps } from '../../button/interfaces';
3
2
  import { togglesConfig } from '../toggles';
4
3
  import { AppLayoutProps } from '../interfaces';
5
4
  import { IconProps } from '../../icon/interfaces';
@@ -10,8 +9,12 @@ export interface DesktopDrawerProps {
10
9
  toggleClassName: string;
11
10
  closeClassName: string;
12
11
  toggleRefs: {
13
- toggle: React.Ref<ButtonProps.Ref>;
14
- close: React.Ref<ButtonProps.Ref>;
12
+ toggle: React.Ref<{
13
+ focus(): void;
14
+ }>;
15
+ close: React.Ref<{
16
+ focus(): void;
17
+ }>;
15
18
  };
16
19
  width: number;
17
20
  topOffset: number | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["app-layout/drawer/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAE3E,MAAM,WAAW,kBAAkB;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAA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"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["app-layout/drawer/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { ButtonProps } from '../../button/interfaces';\nimport { togglesConfig } from '../toggles';\nimport { AppLayoutProps } from '../interfaces';\nimport { IconProps } from '../../icon/interfaces';\nimport { NonCancelableEventHandler } from '../../internal/events';\n\nimport { DrawerFocusControlRefs } from '../utils/use-drawer-focus-control';\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 drawersAriaLabels?: DrawerItemAriaLabels | 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 drawers?: {\n items: Array<DrawerItem>;\n activeDrawerId: string | undefined;\n onChange: (changeDetail: { activeDrawerId: string | undefined }) => void;\n };\n resizeHandle?: React.ReactNode;\n}\n\nexport interface ResizableDrawerProps extends DesktopDrawerProps {\n activeDrawer?: DrawerItem;\n onResize: (resizeDetail: { size: number; id: string }) => void;\n size: number;\n getMaxWidth: () => number;\n refs: DrawerFocusControlRefs;\n}\n\nexport interface DrawerTriggersBarProps {\n contentClassName: string;\n toggleClassName: string;\n topOffset: number | undefined;\n bottomOffset: number | undefined;\n isMobile: boolean;\n drawers?: {\n items: Array<DrawerItem>;\n activeDrawerId?: string;\n onChange: (changeDetail: { activeDrawerId: string | undefined }) => void;\n ariaLabel?: string;\n };\n}\n\nexport interface DrawerItemAriaLabels {\n content?: string;\n closeButton?: string;\n triggerButton?: string;\n resizeHandle?: string;\n}\n\nexport interface DrawerItem {\n id: string;\n content: React.ReactNode;\n trigger: {\n iconName?: IconProps.Name;\n iconSvg?: React.ReactNode;\n };\n ariaLabels: DrawerItemAriaLabels;\n resizable?: boolean;\n defaultSize?: number;\n onResize?: NonCancelableEventHandler<{ size: number; id: string }>;\n}\n\nexport interface InternalDrawerProps {\n drawers?: {\n items: Array<DrawerItem>;\n activeDrawerId?: string;\n onChange?: NonCancelableEventHandler<string>;\n onResize?: NonCancelableEventHandler<{ size: number; id: string }>;\n ariaLabel?: string;\n };\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["app-layout/drawer/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { togglesConfig } from '../toggles';\nimport { AppLayoutProps } from '../interfaces';\nimport { IconProps } from '../../icon/interfaces';\nimport { NonCancelableEventHandler } from '../../internal/events';\n\nimport { DrawerFocusControlRefs } from '../utils/use-drawer-focus-control';\n\nexport interface DesktopDrawerProps {\n contentClassName: string;\n toggleClassName: string;\n closeClassName: string;\n toggleRefs: {\n toggle: React.Ref<{ focus(): void }>;\n close: React.Ref<{ focus(): void }>;\n };\n width: number;\n topOffset: number | undefined;\n bottomOffset: number | undefined;\n ariaLabels: AppLayoutProps.Labels | undefined;\n drawersAriaLabels?: DrawerItemAriaLabels | 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 drawers?: {\n items: Array<DrawerItem>;\n activeDrawerId: string | undefined;\n onChange: (changeDetail: { activeDrawerId: string | undefined }) => void;\n };\n resizeHandle?: React.ReactNode;\n}\n\nexport interface ResizableDrawerProps extends DesktopDrawerProps {\n activeDrawer?: DrawerItem;\n onResize: (resizeDetail: { size: number; id: string }) => void;\n size: number;\n getMaxWidth: () => number;\n refs: DrawerFocusControlRefs;\n}\n\nexport interface DrawerTriggersBarProps {\n contentClassName: string;\n toggleClassName: string;\n topOffset: number | undefined;\n bottomOffset: number | undefined;\n isMobile: boolean;\n drawers?: {\n items: Array<DrawerItem>;\n activeDrawerId?: string;\n onChange: (changeDetail: { activeDrawerId: string | undefined }) => void;\n ariaLabel?: string;\n };\n}\n\nexport interface DrawerItemAriaLabels {\n content?: string;\n closeButton?: string;\n triggerButton?: string;\n resizeHandle?: string;\n}\n\nexport interface DrawerItem {\n id: string;\n content: React.ReactNode;\n trigger: {\n iconName?: IconProps.Name;\n iconSvg?: React.ReactNode;\n };\n ariaLabels: DrawerItemAriaLabels;\n resizable?: boolean;\n defaultSize?: number;\n onResize?: NonCancelableEventHandler<{ size: number; id: string }>;\n}\n\nexport interface InternalDrawerProps {\n drawers?: {\n items: Array<DrawerItem>;\n activeDrawerId?: string;\n onChange?: NonCancelableEventHandler<string>;\n onResize?: NonCancelableEventHandler<{ size: number; id: string }>;\n ariaLabel?: string;\n };\n}\n"]}
@@ -1,15 +1,15 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "toggle": "awsui_toggle_1uo6m_dsezo_97",
5
- "drawer-triggers": "awsui_drawer-triggers_1uo6m_dsezo_102",
6
- "drawer": "awsui_drawer_1uo6m_dsezo_102",
7
- "drawer-mobile": "awsui_drawer-mobile_1uo6m_dsezo_112",
8
- "drawer-closed": "awsui_drawer-closed_1uo6m_dsezo_115",
9
- "drawer-content": "awsui_drawer-content_1uo6m_dsezo_123",
10
- "non-interactive": "awsui_non-interactive_1uo6m_dsezo_141",
11
- "trigger": "awsui_trigger_1uo6m_dsezo_149",
12
- "trigger-drawer": "awsui_trigger-drawer_1uo6m_dsezo_160",
13
- "selected": "awsui_selected_1uo6m_dsezo_160"
4
+ "toggle": "awsui_toggle_1uo6m_1fg2f_97",
5
+ "drawer-triggers": "awsui_drawer-triggers_1uo6m_1fg2f_102",
6
+ "drawer": "awsui_drawer_1uo6m_1fg2f_102",
7
+ "drawer-mobile": "awsui_drawer-mobile_1uo6m_1fg2f_112",
8
+ "drawer-closed": "awsui_drawer-closed_1uo6m_1fg2f_115",
9
+ "drawer-content": "awsui_drawer-content_1uo6m_1fg2f_122",
10
+ "drawer-content-clickable": "awsui_drawer-content-clickable_1uo6m_1fg2f_137",
11
+ "drawer-triggers-wrapper": "awsui_drawer-triggers-wrapper_1uo6m_1fg2f_148",
12
+ "drawer-trigger": "awsui_drawer-trigger_1uo6m_1fg2f_102",
13
+ "drawer-trigger-active": "awsui_drawer-trigger-active_1uo6m_1fg2f_166"
14
14
  };
15
15
 
@@ -94,79 +94,76 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
94
94
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
95
95
  SPDX-License-Identifier: Apache-2.0
96
96
  */
97
- .awsui_toggle_1uo6m_dsezo_97:not(#\9) {
97
+ .awsui_toggle_1uo6m_1fg2f_97:not(#\9) {
98
98
  box-sizing: border-box;
99
99
  padding: var(--space-xxs-xx079q, 4px) 7px;
100
100
  }
101
101
 
102
- .awsui_drawer-triggers_1uo6m_dsezo_102:not(#\9) {
102
+ .awsui_drawer-triggers_1uo6m_1fg2f_102:not(#\9) {
103
103
  box-sizing: border-box;
104
104
  }
105
105
 
106
- .awsui_drawer_1uo6m_dsezo_102:not(#\9) {
106
+ .awsui_drawer_1uo6m_1fg2f_102:not(#\9) {
107
107
  flex-shrink: 0;
108
108
  position: relative;
109
109
  word-wrap: break-word;
110
110
  box-shadow: var(--shadow-panel-5eimfm, 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));
111
111
  }
112
- .awsui_drawer_1uo6m_dsezo_102:not(#\9):not(.awsui_drawer-mobile_1uo6m_dsezo_112) {
112
+ .awsui_drawer_1uo6m_1fg2f_102:not(#\9):not(.awsui_drawer-mobile_1uo6m_1fg2f_112) {
113
113
  z-index: 830;
114
114
  }
115
- .awsui_drawer-closed_1uo6m_dsezo_115:not(#\9) {
115
+ .awsui_drawer-closed_1uo6m_1fg2f_115:not(#\9) {
116
116
  min-width: 40px;
117
- cursor: pointer;
118
117
  }
119
- .awsui_drawer-closed_1uo6m_dsezo_115.awsui_drawer-mobile_1uo6m_dsezo_112:not(#\9) {
118
+ .awsui_drawer-closed_1uo6m_1fg2f_115.awsui_drawer-mobile_1uo6m_1fg2f_112:not(#\9) {
120
119
  display: none;
121
120
  }
122
121
 
123
- .awsui_drawer-content_1uo6m_dsezo_123:not(#\9) {
122
+ .awsui_drawer-content_1uo6m_1fg2f_122:not(#\9) {
124
123
  position: fixed;
125
124
  overflow: auto;
126
125
  background-color: var(--color-background-layout-panel-content-jx4wcr, #ffffff);
127
126
  }
128
- .awsui_drawer-mobile_1uo6m_dsezo_112 > .awsui_drawer-content_1uo6m_dsezo_123:not(#\9) {
127
+ .awsui_drawer-mobile_1uo6m_1fg2f_112 > .awsui_drawer-content_1uo6m_1fg2f_122:not(#\9) {
129
128
  z-index: 1001;
130
129
  top: 0;
131
130
  bottom: 0;
132
131
  left: 0;
133
132
  right: 0;
134
133
  }
135
- .awsui_drawer-closed_1uo6m_dsezo_115 > .awsui_drawer-content_1uo6m_dsezo_123:not(#\9) {
134
+ .awsui_drawer-closed_1uo6m_1fg2f_115 > .awsui_drawer-content_1uo6m_1fg2f_122:not(#\9) {
136
135
  width: 40px;
137
136
  }
138
- .awsui_drawer-closed_1uo6m_dsezo_115 > .awsui_drawer-content_1uo6m_dsezo_123:not(#\9):hover {
139
- background: var(--color-background-layout-panel-hover-yn48lk, #eaeded);
137
+ .awsui_drawer-closed_1uo6m_1fg2f_115 > .awsui_drawer-content_1uo6m_1fg2f_122.awsui_drawer-content-clickable_1uo6m_1fg2f_137:not(#\9) {
138
+ cursor: pointer;
139
+ color: var(--color-text-interactive-default-9x433a, #545b64);
140
140
  }
141
- .awsui_drawer-closed_1uo6m_dsezo_115 > .awsui_drawer-content_1uo6m_dsezo_123.awsui_non-interactive_1uo6m_dsezo_141:not(#\9):hover {
142
- background: var(--color-background-layout-panel-content-jx4wcr, #ffffff);
143
- cursor: default;
141
+ .awsui_drawer-closed_1uo6m_1fg2f_115 > .awsui_drawer-content_1uo6m_1fg2f_122.awsui_drawer-content-clickable_1uo6m_1fg2f_137:not(#\9):hover {
142
+ background: var(--color-background-layout-panel-hover-yn48lk, #eaeded);
144
143
  }
145
- .awsui_drawer-content_1uo6m_dsezo_123 > [aria-hidden=true]:not(#\9) {
144
+ .awsui_drawer-content_1uo6m_1fg2f_122 > [aria-hidden=true]:not(#\9) {
146
145
  display: none;
147
146
  }
148
147
 
149
- .awsui_drawer-content_1uo6m_dsezo_123 > .awsui_drawer-triggers_1uo6m_dsezo_102 > .awsui_trigger_1uo6m_dsezo_149:not(#\9) {
150
- background: var(--color-background-layout-toggle-default-ra31l6, transparent);
151
- border: 0;
152
- border-radius: 0;
153
- color: var(--color-text-layout-toggle-hg4zdn, #545b64);
154
- padding: var(--space-scaled-xs-sg3tfb, 8px) var(--space-s-o95p2n, 12px);
155
- margin-top: 1px;
156
- }
157
- .awsui_drawer-content_1uo6m_dsezo_123 > .awsui_drawer-triggers_1uo6m_dsezo_102 > .awsui_trigger_1uo6m_dsezo_149:not(#\9):not(:last-child) {
158
- box-shadow: 0px 1px var(--color-shadow-layout-toggle-67ezos, #d5dbdb);
159
- }
160
- .awsui_drawer-content_1uo6m_dsezo_123 > .awsui_drawer-triggers_1uo6m_dsezo_102 > .awsui_trigger-drawer_1uo6m_dsezo_160:not(#\9):hover:not(.awsui_selected_1uo6m_dsezo_160) {
161
- color: var(--color-text-layout-toggle-hover-x3sh37, #0073bb);
148
+ .awsui_drawer-triggers-wrapper_1uo6m_1fg2f_148:not(#\9) {
149
+ display: flex;
150
+ flex-direction: column;
151
+ text-align: center;
152
+ align-items: stretch;
162
153
  }
163
- .awsui_drawer-content_1uo6m_dsezo_123 > .awsui_drawer-triggers_1uo6m_dsezo_102 > .awsui_trigger-drawer_1uo6m_dsezo_160:not(#\9):hover:not(.awsui_selected_1uo6m_dsezo_160):not(:last-child) {
164
- box-shadow: 0px 1px var(--color-shadow-layout-toggle-67ezos, #d5dbdb);
154
+
155
+ .awsui_drawer-trigger_1uo6m_1fg2f_102:not(#\9) {
156
+ padding: var(--space-xxs-xx079q, 4px) 7px;
157
+ cursor: pointer;
158
+ color: var(--color-text-interactive-default-9x433a, #545b64);
159
+ }
160
+ .awsui_drawer-trigger_1uo6m_1fg2f_102:not(#\9):not(:first-child) {
161
+ border-top: 1px solid var(--color-border-layout-rmnayj, #d5dbdb);
162
+ }
163
+ .awsui_drawer-trigger_1uo6m_1fg2f_102:not(#\9):hover {
164
+ color: var(--color-text-layout-toggle-hover-x3sh37, #0073bb);
165
165
  }
166
- .awsui_drawer-content_1uo6m_dsezo_123 > .awsui_drawer-triggers_1uo6m_dsezo_102 > .awsui_trigger_1uo6m_dsezo_149.awsui_selected_1uo6m_dsezo_160:not(#\9), .awsui_drawer-content_1uo6m_dsezo_123 > .awsui_drawer-triggers_1uo6m_dsezo_102 > .awsui_trigger_1uo6m_dsezo_149.awsui_selected_1uo6m_dsezo_160:not(#\9):hover {
166
+ .awsui_drawer-trigger-active_1uo6m_1fg2f_166:not(#\9), .awsui_drawer-trigger-active_1uo6m_1fg2f_166:not(#\9):hover {
167
167
  background-color: var(--color-background-layout-toggle-selected-default-ksjxnl, #0073bb);
168
- border-top: 1px solid var(--color-background-layout-toggle-selected-default-ksjxnl, #0073bb);
169
- box-shadow: none;
170
168
  color: var(--color-text-layout-toggle-active-xajvuf, #ffffff);
171
- margin: 0;
172
169
  }
@@ -2,15 +2,15 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "toggle": "awsui_toggle_1uo6m_dsezo_97",
6
- "drawer-triggers": "awsui_drawer-triggers_1uo6m_dsezo_102",
7
- "drawer": "awsui_drawer_1uo6m_dsezo_102",
8
- "drawer-mobile": "awsui_drawer-mobile_1uo6m_dsezo_112",
9
- "drawer-closed": "awsui_drawer-closed_1uo6m_dsezo_115",
10
- "drawer-content": "awsui_drawer-content_1uo6m_dsezo_123",
11
- "non-interactive": "awsui_non-interactive_1uo6m_dsezo_141",
12
- "trigger": "awsui_trigger_1uo6m_dsezo_149",
13
- "trigger-drawer": "awsui_trigger-drawer_1uo6m_dsezo_160",
14
- "selected": "awsui_selected_1uo6m_dsezo_160"
5
+ "toggle": "awsui_toggle_1uo6m_1fg2f_97",
6
+ "drawer-triggers": "awsui_drawer-triggers_1uo6m_1fg2f_102",
7
+ "drawer": "awsui_drawer_1uo6m_1fg2f_102",
8
+ "drawer-mobile": "awsui_drawer-mobile_1uo6m_1fg2f_112",
9
+ "drawer-closed": "awsui_drawer-closed_1uo6m_1fg2f_115",
10
+ "drawer-content": "awsui_drawer-content_1uo6m_1fg2f_122",
11
+ "drawer-content-clickable": "awsui_drawer-content-clickable_1uo6m_1fg2f_137",
12
+ "drawer-triggers-wrapper": "awsui_drawer-triggers-wrapper_1uo6m_1fg2f_148",
13
+ "drawer-trigger": "awsui_drawer-trigger_1uo6m_1fg2f_102",
14
+ "drawer-trigger-active": "awsui_drawer-trigger-active_1uo6m_1fg2f_166"
15
15
  };
16
16
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["app-layout/mobile-toolbar/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAqClD,UAAU,kBAAkB;I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SPDX-License-Identifier: Apache-2.0
3
3
  import clsx from 'clsx';
4
4
  import React, { useEffect } from 'react';
5
- import { AppLayoutButton, togglesConfig } from '../toggles';
5
+ import { ToggleButton, togglesConfig } from '../toggles';
6
6
  import styles from './styles.css.js';
7
7
  import sharedStyles from '../styles.css.js';
8
8
  import testutilStyles from '../test-classes/styles.css.js';
9
9
  const MobileToggle = React.forwardRef(({ className, ariaLabels, type, disabled, onClick }, ref) => {
10
10
  const { TagName, iconName, getLabels } = togglesConfig[type];
11
11
  const { mainLabel, openLabel } = getLabels(ariaLabels);
12
- return (React.createElement(TagName, { className: clsx(styles['mobile-toggle']), "aria-hidden": disabled, "aria-label": mainLabel, onClick: e => e.target === e.currentTarget && onClick() },
13
- React.createElement(AppLayoutButton, { ref: ref, className: className, iconName: iconName, onClick: onClick, ariaLabel: openLabel, disabled: disabled, ariaExpanded: disabled })));
12
+ return (React.createElement(TagName, { className: clsx(styles['mobile-toggle'], styles[`mobile-toggle-type-${type}`]), "aria-hidden": disabled, "aria-label": mainLabel, onClick: e => e.target === e.currentTarget && onClick() },
13
+ React.createElement(ToggleButton, { ref: ref, className: className, iconName: iconName, onClick: onClick, ariaLabel: openLabel, disabled: disabled, ariaExpanded: disabled })));
14
14
  });
15
15
  export function MobileToolbar({ ariaLabels = {}, toggleRefs, topOffset, navigationHide, toolsHide, anyPanelOpen = false, unfocusable, children, onNavigationOpen, onToolsOpen, drawers, mobileBarRef, }) {
16
16
  useEffect(() => {
@@ -28,9 +28,10 @@ export function MobileToolbar({ ariaLabels = {}, toggleRefs, topOffset, navigati
28
28
  !navigationHide && (React.createElement(MobileToggle, { ref: toggleRefs.navigation, type: "navigation", className: testutilStyles['navigation-toggle'], ariaLabels: ariaLabels, disabled: anyPanelOpen, onClick: onNavigationOpen })),
29
29
  React.createElement("div", { className: styles['mobile-bar-breadcrumbs'] }, children && React.createElement("div", { className: testutilStyles.breadcrumbs }, children)),
30
30
  !toolsHide && !drawers && (React.createElement(MobileToggle, { ref: toggleRefs.tools, type: "tools", className: testutilStyles['tools-toggle'], ariaLabels: ariaLabels, disabled: anyPanelOpen, onClick: onToolsOpen })),
31
- drawers && (React.createElement("aside", { "aria-label": drawers.ariaLabel, className: clsx(styles['mobile-toggle'], styles['mobile-toggle-with-drawers'], testutilStyles['drawers-mobile-triggers-container']) }, drawers.items.map((item, index) => {
31
+ drawers && (React.createElement("aside", { "aria-label": drawers.ariaLabel, className: clsx(styles['drawers-container'], testutilStyles['drawers-mobile-triggers-container']) }, drawers.items.map((item, index) => {
32
32
  var _a;
33
- return (React.createElement(AppLayoutButton, { className: clsx(styles['mobile-trigger-with-drawers'], testutilStyles['drawers-trigger']), key: `drawer-trigger-${index}`, iconName: item.trigger.iconName, iconSvg: item.trigger.iconSvg, ariaLabel: (_a = item.ariaLabels) === null || _a === void 0 ? void 0 : _a.triggerButton, onClick: () => drawers.onChange({ activeDrawerId: item.id }), ariaExpanded: drawers.activeDrawerId !== undefined }));
33
+ return (React.createElement("span", { className: clsx(styles['mobile-toggle'], styles['mobile-toggle-type-drawer']), key: index },
34
+ React.createElement(ToggleButton, { className: testutilStyles['drawers-trigger'], iconName: item.trigger.iconName, iconSvg: item.trigger.iconSvg, ariaLabel: (_a = item.ariaLabels) === null || _a === void 0 ? void 0 : _a.triggerButton, onClick: () => drawers.onChange({ activeDrawerId: item.id }), ariaExpanded: drawers.activeDrawerId !== undefined, testId: `awsui-app-layout-trigger-${item.id}` })));
34
35
  })))));
35
36
  }
36
37
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["app-layout/mobile-toolbar/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIzC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC5D,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ACpC,cAAc,CAAC,mCAAmC,CAAC,CACpD,IAEA,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAgB,EAAE,KAAa,EAAE,EAAE;;YAAC,OAAA,CACtD,oBAAC,eAAe,IACd,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,6BAA6B,CAAC,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAC,EACzF,GAAG,EAAE,kBAAkB,KAAK,EAAE,EAC9B,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,EAC/B,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAC7B,SAAS,EAAE,MAAA,IAAI,CAAC,UAAU,0CAAE,aAAa,EACzC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,cAAc,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,EAC5D,YAAY,EAAE,OAAO,CAAC,cAAc,KAAK,SAAS,GAClD,CACH,CAAA;SAAA,CAAC,CACI,CACT,CACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useEffect } from 'react';\nimport { ButtonProps } from '../../button/interfaces';\nimport { AppLayoutProps } from '../interfaces';\nimport { DrawerItem } from '../drawer/interfaces';\nimport { AppLayoutButton, togglesConfig } from '../toggles';\nimport styles from './styles.css.js';\nimport sharedStyles from '../styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\ninterface MobileToggleProps {\n className?: string;\n ariaLabels?: AppLayoutProps.Labels;\n type: keyof typeof togglesConfig;\n disabled?: boolean;\n onClick: () => void;\n}\nconst MobileToggle = React.forwardRef(\n ({ className, ariaLabels, type, disabled, onClick }: MobileToggleProps, ref: React.Ref<ButtonProps.Ref>) => {\n const { TagName, iconName, getLabels } = togglesConfig[type];\n const { mainLabel, openLabel } = getLabels(ariaLabels);\n\n return (\n <TagName\n className={clsx(styles['mobile-toggle'])}\n aria-hidden={disabled}\n aria-label={mainLabel}\n onClick={e => e.target === e.currentTarget && onClick()}\n >\n <AppLayoutButton\n ref={ref}\n className={className}\n iconName={iconName}\n onClick={onClick}\n ariaLabel={openLabel}\n disabled={disabled}\n ariaExpanded={disabled}\n />\n </TagName>\n );\n }\n);\ninterface MobileToolbarProps {\n anyPanelOpen: boolean | undefined;\n unfocusable: boolean | undefined;\n toggleRefs: {\n navigation: React.Ref<ButtonProps.Ref>;\n tools: React.Ref<ButtonProps.Ref>;\n };\n navigationHide: boolean | undefined;\n toolsHide: boolean | undefined;\n topOffset?: number;\n ariaLabels?: AppLayoutProps.Labels;\n mobileBarRef: React.Ref<HTMLDivElement>;\n children: React.ReactNode;\n onNavigationOpen: () => void;\n onToolsOpen: () => void;\n drawers?: {\n items: Array<DrawerItem>;\n activeDrawerId: string | undefined;\n onChange: (changeDetail: { activeDrawerId: string | undefined }) => void;\n ariaLabel?: string;\n };\n}\n\nexport function MobileToolbar({\n ariaLabels = {},\n toggleRefs,\n topOffset,\n navigationHide,\n toolsHide,\n anyPanelOpen = false,\n unfocusable,\n children,\n onNavigationOpen,\n onToolsOpen,\n drawers,\n mobileBarRef,\n}: MobileToolbarProps) {\n useEffect(() => {\n if (anyPanelOpen) {\n document.body.classList.add(styles['block-body-scroll']);\n return () => {\n document.body.classList.remove(styles['block-body-scroll']);\n };\n } else {\n document.body.classList.remove(styles['block-body-scroll']);\n }\n }, [anyPanelOpen]);\n return (\n <div\n ref={mobileBarRef}\n className={clsx(styles['mobile-bar'], unfocusable && sharedStyles.unfocusable)}\n style={{ top: topOffset }}\n >\n {!navigationHide && (\n <MobileToggle\n ref={toggleRefs.navigation}\n type=\"navigation\"\n className={testutilStyles['navigation-toggle']}\n ariaLabels={ariaLabels}\n disabled={anyPanelOpen}\n onClick={onNavigationOpen}\n />\n )}\n <div className={styles['mobile-bar-breadcrumbs']}>\n {children && <div className={testutilStyles.breadcrumbs}>{children}</div>}\n </div>\n {!toolsHide && !drawers && (\n <MobileToggle\n ref={toggleRefs.tools}\n type=\"tools\"\n className={testutilStyles['tools-toggle']}\n ariaLabels={ariaLabels}\n disabled={anyPanelOpen}\n onClick={onToolsOpen}\n />\n )}\n {drawers && (\n <aside\n aria-label={drawers.ariaLabel}\n className={clsx(\n styles['mobile-toggle'],\n styles['mobile-toggle-with-drawers'],\n testutilStyles['drawers-mobile-triggers-container']\n )}\n >\n {drawers.items.map((item: DrawerItem, index: number) => (\n <AppLayoutButton\n className={clsx(styles['mobile-trigger-with-drawers'], testutilStyles['drawers-trigger'])}\n key={`drawer-trigger-${index}`}\n iconName={item.trigger.iconName}\n iconSvg={item.trigger.iconSvg}\n ariaLabel={item.ariaLabels?.triggerButton}\n onClick={() => drawers.onChange({ activeDrawerId: item.id })}\n ariaExpanded={drawers.activeDrawerId !== undefined}\n />\n ))}\n </aside>\n )}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["app-layout/mobile-toolbar/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIzC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAQ3D,MAAM,YAAY,GAAG,KAAK,CAAC,UAAU,CACnC,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAqB,EAAE,GAA+B,EAAE,EAAE;IACzG,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IAC7D,MAAM,EAAE,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,CAAC,QAAQ,EAC/B,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAC7B,SAAS,EAAE,MAAA,IAAI,CAAC,UAAU,0CAAE,aAAa,EACzC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,cAAc,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,EAC5D,YAAY,EAAE,OAAO,CAAC,cAAc,KAAK,SAAS,EAClD,MAAM,EAAE,4BAA4B,IAAI,CAAC,EAAE,EAAE,GAC7C,CACG,CACR,CAAA;SAAA,CAAC,CACI,CACT,CACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useEffect } from 'react';\nimport { ButtonProps } from '../../button/interfaces';\nimport { AppLayoutProps } from '../interfaces';\nimport { DrawerItem } from '../drawer/interfaces';\nimport { ToggleButton, togglesConfig } from '../toggles';\nimport styles from './styles.css.js';\nimport sharedStyles from '../styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\ninterface MobileToggleProps {\n className?: string;\n ariaLabels?: AppLayoutProps.Labels;\n type: keyof typeof togglesConfig;\n disabled?: boolean;\n onClick: () => void;\n}\nconst MobileToggle = React.forwardRef(\n ({ className, ariaLabels, type, disabled, onClick }: MobileToggleProps, ref: React.Ref<ButtonProps.Ref>) => {\n const { TagName, iconName, getLabels } = togglesConfig[type];\n const { mainLabel, openLabel } = getLabels(ariaLabels);\n\n return (\n <TagName\n className={clsx(styles['mobile-toggle'], styles[`mobile-toggle-type-${type}`])}\n aria-hidden={disabled}\n aria-label={mainLabel}\n onClick={e => e.target === e.currentTarget && onClick()}\n >\n <ToggleButton\n ref={ref}\n className={className}\n iconName={iconName}\n onClick={onClick}\n ariaLabel={openLabel}\n disabled={disabled}\n ariaExpanded={disabled}\n />\n </TagName>\n );\n }\n);\ninterface MobileToolbarProps {\n anyPanelOpen: boolean | undefined;\n unfocusable: boolean | undefined;\n toggleRefs: {\n navigation: React.Ref<ButtonProps.Ref>;\n tools: React.Ref<ButtonProps.Ref>;\n };\n navigationHide: boolean | undefined;\n toolsHide: boolean | undefined;\n topOffset?: number;\n ariaLabels?: AppLayoutProps.Labels;\n mobileBarRef: React.Ref<HTMLDivElement>;\n children: React.ReactNode;\n onNavigationOpen: () => void;\n onToolsOpen: () => void;\n drawers?: {\n items: Array<DrawerItem>;\n activeDrawerId: string | undefined;\n onChange: (changeDetail: { activeDrawerId: string | undefined }) => void;\n ariaLabel?: string;\n };\n}\n\nexport function MobileToolbar({\n ariaLabels = {},\n toggleRefs,\n topOffset,\n navigationHide,\n toolsHide,\n anyPanelOpen = false,\n unfocusable,\n children,\n onNavigationOpen,\n onToolsOpen,\n drawers,\n mobileBarRef,\n}: MobileToolbarProps) {\n useEffect(() => {\n if (anyPanelOpen) {\n document.body.classList.add(styles['block-body-scroll']);\n return () => {\n document.body.classList.remove(styles['block-body-scroll']);\n };\n } else {\n document.body.classList.remove(styles['block-body-scroll']);\n }\n }, [anyPanelOpen]);\n return (\n <div\n ref={mobileBarRef}\n className={clsx(styles['mobile-bar'], unfocusable && sharedStyles.unfocusable)}\n style={{ top: topOffset }}\n >\n {!navigationHide && (\n <MobileToggle\n ref={toggleRefs.navigation}\n type=\"navigation\"\n className={testutilStyles['navigation-toggle']}\n ariaLabels={ariaLabels}\n disabled={anyPanelOpen}\n onClick={onNavigationOpen}\n />\n )}\n <div className={styles['mobile-bar-breadcrumbs']}>\n {children && <div className={testutilStyles.breadcrumbs}>{children}</div>}\n </div>\n {!toolsHide && !drawers && (\n <MobileToggle\n ref={toggleRefs.tools}\n type=\"tools\"\n className={testutilStyles['tools-toggle']}\n ariaLabels={ariaLabels}\n disabled={anyPanelOpen}\n onClick={onToolsOpen}\n />\n )}\n {drawers && (\n <aside\n aria-label={drawers.ariaLabel}\n className={clsx(styles['drawers-container'], testutilStyles['drawers-mobile-triggers-container'])}\n >\n {drawers.items.map((item: DrawerItem, index: number) => (\n <span className={clsx(styles['mobile-toggle'], styles['mobile-toggle-type-drawer'])} key={index}>\n <ToggleButton\n className={testutilStyles['drawers-trigger']}\n iconName={item.trigger.iconName}\n iconSvg={item.trigger.iconSvg}\n ariaLabel={item.ariaLabels?.triggerButton}\n onClick={() => drawers.onChange({ activeDrawerId: item.id })}\n ariaExpanded={drawers.activeDrawerId !== undefined}\n testId={`awsui-app-layout-trigger-${item.id}`}\n />\n </span>\n ))}\n </aside>\n )}\n </div>\n );\n}\n"]}