@cloudscape-design/components 3.0.76 → 3.0.78

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 (84) hide show
  1. package/app-layout/drawer.d.ts +2 -1
  2. package/app-layout/drawer.d.ts.map +1 -1
  3. package/app-layout/drawer.js +8 -2
  4. package/app-layout/drawer.js.map +1 -1
  5. package/app-layout/index.d.ts.map +1 -1
  6. package/app-layout/index.js +6 -5
  7. package/app-layout/index.js.map +1 -1
  8. package/app-layout/interfaces.d.ts +6 -0
  9. package/app-layout/interfaces.d.ts.map +1 -1
  10. package/app-layout/interfaces.js.map +1 -1
  11. package/app-layout/notifications/index.js +1 -1
  12. package/app-layout/notifications/index.js.map +1 -1
  13. package/app-layout/tools-and-split-panel.d.ts +2 -1
  14. package/app-layout/tools-and-split-panel.d.ts.map +1 -1
  15. package/app-layout/tools-and-split-panel.js +2 -2
  16. package/app-layout/tools-and-split-panel.js.map +1 -1
  17. package/app-layout/utils/use-focus-control.d.ts +10 -4
  18. package/app-layout/utils/use-focus-control.d.ts.map +1 -1
  19. package/app-layout/utils/use-focus-control.js +30 -9
  20. package/app-layout/utils/use-focus-control.js.map +1 -1
  21. package/app-layout/visual-refresh/app-bar.js +2 -2
  22. package/app-layout/visual-refresh/app-bar.js.map +1 -1
  23. package/app-layout/visual-refresh/context.d.ts +3 -1
  24. package/app-layout/visual-refresh/context.d.ts.map +1 -1
  25. package/app-layout/visual-refresh/context.js +8 -4
  26. package/app-layout/visual-refresh/context.js.map +1 -1
  27. package/app-layout/visual-refresh/navigation.js +1 -1
  28. package/app-layout/visual-refresh/navigation.js.map +1 -1
  29. package/app-layout/visual-refresh/notifications.js +2 -2
  30. package/app-layout/visual-refresh/notifications.js.map +1 -1
  31. package/app-layout/visual-refresh/tools.d.ts.map +1 -1
  32. package/app-layout/visual-refresh/tools.js +7 -4
  33. package/app-layout/visual-refresh/tools.js.map +1 -1
  34. package/date-range-picker/calendar/index.d.ts.map +1 -1
  35. package/date-range-picker/calendar/index.js +22 -26
  36. package/date-range-picker/calendar/index.js.map +1 -1
  37. package/date-range-picker/index.js +1 -1
  38. package/date-range-picker/index.js.map +1 -1
  39. package/date-range-picker/styles.css.js +36 -37
  40. package/date-range-picker/styles.scoped.css +50 -54
  41. package/date-range-picker/styles.selectors.js +36 -37
  42. package/input/internal.d.ts.map +1 -1
  43. package/input/internal.js +2 -3
  44. package/input/internal.js.map +1 -1
  45. package/internal/base-component/styles.scoped.css +4 -0
  46. package/internal/components/autosuggest-input/index.d.ts.map +1 -1
  47. package/internal/components/autosuggest-input/index.js +4 -5
  48. package/internal/components/autosuggest-input/index.js.map +1 -1
  49. package/internal/components/button-trigger/index.d.ts.map +1 -1
  50. package/internal/components/button-trigger/index.js +2 -3
  51. package/internal/components/button-trigger/index.js.map +1 -1
  52. package/internal/components/chart-popover/index.js +1 -1
  53. package/internal/components/chart-popover/index.js.map +1 -1
  54. package/internal/components/dropdown/index.d.ts.map +1 -1
  55. package/internal/components/dropdown/index.js +1 -1
  56. package/internal/components/dropdown/index.js.map +1 -1
  57. package/internal/components/dropdown-status/index.d.ts.map +1 -1
  58. package/internal/components/dropdown-status/index.js +2 -4
  59. package/internal/components/dropdown-status/index.js.map +1 -1
  60. package/internal/components/options-list/index.d.ts.map +1 -1
  61. package/internal/components/options-list/index.js +2 -2
  62. package/internal/components/options-list/index.js.map +1 -1
  63. package/internal/environment.js +1 -1
  64. package/internal/events/index.d.ts +0 -9
  65. package/internal/events/index.d.ts.map +1 -1
  66. package/internal/events/index.js +0 -11
  67. package/internal/events/index.js.map +1 -1
  68. package/internal/generated/theming/index.cjs +23 -0
  69. package/internal/generated/theming/index.js +23 -0
  70. package/package.json +1 -1
  71. package/pagination/internal.d.ts.map +1 -1
  72. package/pagination/internal.js +1 -1
  73. package/pagination/internal.js.map +1 -1
  74. package/popover/internal.js +2 -2
  75. package/popover/internal.js.map +1 -1
  76. package/popover/styles.css.js +50 -49
  77. package/popover/styles.scoped.css +67 -62
  78. package/popover/styles.selectors.js +50 -49
  79. package/table/header-cell/index.d.ts.map +1 -1
  80. package/table/header-cell/index.js +1 -0
  81. package/table/header-cell/index.js.map +1 -1
  82. package/table/header-cell/styles.css.js +15 -14
  83. package/table/header-cell/styles.scoped.css +27 -24
  84. package/table/header-cell/styles.selectors.js +15 -14
@@ -23,7 +23,8 @@ export interface DesktopDrawerProps {
23
23
  hasDividerWithSplitPanel?: boolean;
24
24
  onToggle: (isOpen: boolean) => void;
25
25
  onClick?: (event: React.MouseEvent) => void;
26
+ onLoseFocus?: (event: React.FocusEvent) => void;
26
27
  extendRight?: number;
27
28
  }
28
- export declare function Drawer({ contentClassName, toggleClassName, closeClassName, width, type, toggleRefs, topOffset, bottomOffset, ariaLabels, children, isOpen, isHidden, isMobile, hasDividerWithSplitPanel, onToggle, onClick, extendRight, }: DesktopDrawerProps): JSX.Element;
29
+ export declare function Drawer({ contentClassName, toggleClassName, closeClassName, width, type, toggleRefs, topOffset, bottomOffset, ariaLabels, children, isOpen, isHidden, isMobile, hasDividerWithSplitPanel, onToggle, onClick, onLoseFocus, extendRight, }: DesktopDrawerProps): JSX.Element;
29
30
  //# sourceMappingURL=drawer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../src/app-layout/drawer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAgC,aAAa,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAM9C,MAAM,WAAW,kBAAkB;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE;QACV,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,W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AW,EACX,WAAe,GAChB,EAAE,kBAAkB,eAgFpB"}
@@ -24,7 +24,7 @@ var BORDER_WIDTH = 2;
24
24
  // * https://github.com/nvaccess/nvda/pull/8869 (reverted PR that was going to fix it)
25
25
  export function Drawer(_a) {
26
26
  var _b;
27
- var contentClassName = _a.contentClassName, toggleClassName = _a.toggleClassName, closeClassName = _a.closeClassName, width = _a.width, type = _a.type, toggleRefs = _a.toggleRefs, topOffset = _a.topOffset, bottomOffset = _a.bottomOffset, ariaLabels = _a.ariaLabels, children = _a.children, isOpen = _a.isOpen, isHidden = _a.isHidden, isMobile = _a.isMobile, hasDividerWithSplitPanel = _a.hasDividerWithSplitPanel, onToggle = _a.onToggle, onClick = _a.onClick, _c = _a.extendRight, extendRight = _c === void 0 ? 0 : _c;
27
+ var contentClassName = _a.contentClassName, toggleClassName = _a.toggleClassName, closeClassName = _a.closeClassName, width = _a.width, type = _a.type, toggleRefs = _a.toggleRefs, topOffset = _a.topOffset, bottomOffset = _a.bottomOffset, ariaLabels = _a.ariaLabels, children = _a.children, isOpen = _a.isOpen, isHidden = _a.isHidden, isMobile = _a.isMobile, hasDividerWithSplitPanel = _a.hasDividerWithSplitPanel, onToggle = _a.onToggle, onClick = _a.onClick, onLoseFocus = _a.onLoseFocus, _c = _a.extendRight, extendRight = _c === void 0 ? 0 : _c;
28
28
  var _d = togglesConfig[type], TagName = _d.TagName, iconName = _d.iconName, getLabels = _d.getLabels;
29
29
  var _e = getLabels(ariaLabels), mainLabel = _e.mainLabel, closeLabel = _e.closeLabel, openLabel = _e.openLabel;
30
30
  var hasDividerWithButtonBar = isOpen && extendRight !== 0;
@@ -44,7 +44,13 @@ export function Drawer(_a) {
44
44
  width: drawerWidth,
45
45
  marginRight: isOpen ? -1 * extendRight : 0,
46
46
  paddingRight: isOpen ? extendRight : 0
47
- }, onClick: function (event) {
47
+ }, onBlur: onLoseFocus
48
+ ? function (e) {
49
+ if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {
50
+ onLoseFocus(e);
51
+ }
52
+ }
53
+ : undefined, onClick: function (event) {
48
54
  if (onClick) {
49
55
  onClick(event);
50
56
  }
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../../src/app-layout/drawer.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAExE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,sFAAsF;AACtF,IAAM,YAAY,GAAG,CAAC,CAAC;AA0BvB,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;AAEtF,MAAM,UAAU,MAAM,CAAC,EAkBF;;QAjBnB,gBAAgB,sBAAA,EAChB,eAAe,qBAAA,EACf,cAAc,oBAAA,EACd,KAAK,WAAA,EACL,IAAI,UAAA,EACJ,UAAU,gBAAA,EACV,SAAS,eAAA,EACT,YAAY,kBAAA,EACZ,UAAU,gBAAA,EACV,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,wBAAwB,8BAAA,EACxB,QAAQ,cAAA,EACR,OAAO,aAAA,EACP,mBAAe,EAAf,WAAW,mBAAG,CAAC,KAAA;IAET,IAAA,KAAmC,aAAa,CAAC,IAAI,CAAC,EAApD,OAAO,aAAA,EAAE,QAAQ,cAAA,EAAE,SAAS,eAAwB,CAAC;IACvD,IAAA,KAAuC,SAAS,CAAC,UAAU,CAAC,EAA1D,SAAS,eAAA,EAA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AAC,CAAC,CAAC,CAAC;YAC1C,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;SACvC,EACD,OAAO,EAAE,UAAA,KAAK;YACZ,IAAI,OAAO,EAAE;gBACX,OAAO,CAAC,KAAK,CAAC,CAAC;aAChB;YAED,IAAI,CAAC,MAAM,EAAE;gBACX,sFAAsF;gBACtF,IAAK,KAAK,CAAC,MAAkB,CAAC,OAAO,KAAK,QAAQ,EAAE;oBAClD,QAAQ,CAAC,IAAI,CAAC,CAAC;iBAChB;aACF;QACH,CAAC;QAED,6BACE,KAAK,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,EAC1E,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;YAE1D,CAAC,QAAQ,IAAI,iBAAiB;YAC/B,oBAAC,OAAO,kBAAa,SAAS,iBAAe,CAAC,MAAM;gBAClD,oBAAC,WAAW,IACV,GAAG,EAAE,UAAU,CAAC,KAAK,EACrB,SAAS,EAAE,cAAc,EACzB,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,cAAM,OAAA,QAAQ,CAAC,KAAK,CAAC,EAAf,CAAe,EAC9B,QAAQ,EAAE,aAAa,GACvB;gBACD,QAAQ,CACD,CACN,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 from 'react';\nimport { ButtonProps } from '../button/interfaces';\nimport { AppLayoutButton, CloseButton, togglesConfig } from './toggles';\nimport { AppLayoutProps } from './interfaces';\nimport styles from './styles.css.js';\n\n// This matches the design token awsui.$border-divider-section-width in Visual Refresh\nconst BORDER_WIDTH = 2;\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 externalizedToggle?: boolean;\n width: number;\n topOffset?: number;\n bottomOffset?: number;\n ariaLabels?: AppLayoutProps.Labels;\n children: React.ReactNode;\n type: keyof typeof togglesConfig;\n isMobile?: boolean;\n isOpen?: boolean;\n isHidden?: boolean;\n hasDividerWithSplitPanel?: boolean;\n onToggle: (isOpen: boolean) => void;\n onClick?: (event: React.MouseEvent) => void;\n extendRight?: number;\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 isHidden,\n isMobile,\n hasDividerWithSplitPanel,\n onToggle,\n onClick,\n extendRight = 0,\n}: DesktopDrawerProps) {\n const { TagName, iconName, getLabels } = togglesConfig[type];\n const { mainLabel, closeLabel, openLabel } = getLabels(ariaLabels);\n const hasDividerWithButtonBar = isOpen && extendRight !== 0;\n\n const drawerContentWidthOpen = isMobile ? undefined : width;\n const drawerContentWidth = isOpen ? drawerContentWidthOpen : undefined;\n\n const drawerWidth =\n hasDividerWithButtonBar && drawerContentWidth ? drawerContentWidth + BORDER_WIDTH : drawerContentWidth;\n\n const closeIconName = 'close';\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 [styles['drawer-hidden']]: isHidden,\n [styles['drawer-mobile']]: isMobile,\n [styles['has-divider-with-splitpanel']]: hasDividerWithSplitPanel,\n [styles['opaque-background']]: hasDividerWithButtonBar,\n })}\n style={{\n width: drawerWidth,\n marginRight: isOpen ? -1 * extendRight : 0,\n paddingRight: isOpen ? extendRight : 0,\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 iconName={closeIconName}\n />\n {children}\n </TagName>\n </div>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../../src/app-layout/drawer.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAExE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,sFAAsF;AACtF,IAAM,YAAY,GAAG,CAA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,KAAK,CAAC,CAAC;aAChB;YAED,IAAI,CAAC,MAAM,EAAE;gBACX,sFAAsF;gBACtF,IAAK,KAAK,CAAC,MAAkB,CAAC,OAAO,KAAK,QAAQ,EAAE;oBAClD,QAAQ,CAAC,IAAI,CAAC,CAAC;iBAChB;aACF;QACH,CAAC;QAED,6BACE,KAAK,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,EAC1E,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;YAE1D,CAAC,QAAQ,IAAI,iBAAiB;YAC/B,oBAAC,OAAO,kBAAa,SAAS,iBAAe,CAAC,MAAM;gBAClD,oBAAC,WAAW,IACV,GAAG,EAAE,UAAU,CAAC,KAAK,EACrB,SAAS,EAAE,cAAc,EACzB,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,cAAM,OAAA,QAAQ,CAAC,KAAK,CAAC,EAAf,CAAe,EAC9B,QAAQ,EAAE,aAAa,GACvB;gBACD,QAAQ,CACD,CACN,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 from 'react';\nimport { ButtonProps } from '../button/interfaces';\nimport { AppLayoutButton, CloseButton, togglesConfig } from './toggles';\nimport { AppLayoutProps } from './interfaces';\nimport styles from './styles.css.js';\n\n// This matches the design token awsui.$border-divider-section-width in Visual Refresh\nconst BORDER_WIDTH = 2;\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 externalizedToggle?: boolean;\n width: number;\n topOffset?: number;\n bottomOffset?: number;\n ariaLabels?: AppLayoutProps.Labels;\n children: React.ReactNode;\n type: keyof typeof togglesConfig;\n isMobile?: boolean;\n isOpen?: boolean;\n isHidden?: boolean;\n hasDividerWithSplitPanel?: boolean;\n onToggle: (isOpen: boolean) => void;\n onClick?: (event: React.MouseEvent) => void;\n onLoseFocus?: (event: React.FocusEvent) => void;\n extendRight?: number;\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 isHidden,\n isMobile,\n hasDividerWithSplitPanel,\n onToggle,\n onClick,\n onLoseFocus,\n extendRight = 0,\n}: DesktopDrawerProps) {\n const { TagName, iconName, getLabels } = togglesConfig[type];\n const { mainLabel, closeLabel, openLabel } = getLabels(ariaLabels);\n const hasDividerWithButtonBar = isOpen && extendRight !== 0;\n\n const drawerContentWidthOpen = isMobile ? undefined : width;\n const drawerContentWidth = isOpen ? drawerContentWidthOpen : undefined;\n\n const drawerWidth =\n hasDividerWithButtonBar && drawerContentWidth ? drawerContentWidth + BORDER_WIDTH : drawerContentWidth;\n\n const closeIconName = 'close';\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 [styles['drawer-hidden']]: isHidden,\n [styles['drawer-mobile']]: isMobile,\n [styles['has-divider-with-splitpanel']]: hasDividerWithSplitPanel,\n [styles['opaque-background']]: hasDividerWithButtonBar,\n })}\n style={{\n width: drawerWidth,\n marginRight: isOpen ? -1 * extendRight : 0,\n paddingRight: isOpen ? extendRight : 0,\n }}\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 iconName={closeIconName}\n />\n {children}\n </TagName>\n </div>\n </div>\n );\n}\n"]}
@@ -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;AAoC9C,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,QAAA,MAAM,SAAS,2FAmBd,CAAC;AAwgBF,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;AAoC9C,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,QAAA,MAAM,SAAS,2FAmBd,CAAC;AA0gBF,eAAe,SAAS,CAAC"}
@@ -214,16 +214,17 @@ var OldAppLayout = React.forwardRef(function (_a, ref) {
214
214
  splitPanelOpenOnTheSide,
215
215
  isMobile: isMobile
216
216
  };
217
- var navigationRefs = useFocusControl(navigationOpen);
218
- var toolsRefs = useFocusControl(toolsOpen);
217
+ var navigationRefs = useFocusControl(navigationOpen).refs;
218
+ var _1 = useFocusControl(toolsOpen, true), toolsRefs = _1.refs, focusToolsClose = _1.setFocus, loseToolsFocus = _1.loseFocus;
219
219
  useImperativeHandle(ref, function () { return ({
220
220
  openTools: function () { return onToolsToggle(true); },
221
221
  closeNavigationIfNecessary: function () {
222
222
  if (isMobile) {
223
223
  onNavigationToggle(false);
224
224
  }
225
- }
226
- }); }, [isMobile, onNavigationToggle, onToolsToggle]);
225
+ },
226
+ focusToolsClose: focusToolsClose
227
+ }); }, [isMobile, onNavigationToggle, onToolsToggle, focusToolsClose]);
227
228
  var splitPanelBottomOffset = (_c = (!splitPanel || finalSplitPanePosition !== 'bottom'
228
229
  ? undefined
229
230
  : splitPanelOpen
@@ -294,7 +295,7 @@ var OldAppLayout = React.forwardRef(function (_a, ref) {
294
295
  stickyOffsetBottom: footerHeight + (splitPanelBottomOffset || 0)
295
296
  } }, content)))),
296
297
  finalSplitPanePosition === 'bottom' && (React.createElement(SplitPanelWrapper, { context: splitPanelContext }, splitPanel))),
297
- React.createElement(ToolsAndSplitPanel, { splitPanel: finalSplitPanePosition === 'side' ? splitPanel : undefined, ariaLabels: ariaLabels, closedDrawerWidth: closedDrawerWidth, contentHeightStyle: contentHeightStyle, disableContentPaddings: disableContentPaddings, drawerWidth: toolsDrawerWidth, footerHeight: footerHeight, headerHeight: headerHeight, isHidden: isToolsDrawerHidden, isMobile: isMobile, isMotionEnabled: isMotionEnabled, onToolsToggle: onToolsToggle, panelHeightStyle: panelHeightStyle, splitPanelContext: splitPanelContext, splitPanelOpen: splitPanelOpenOnTheSide, splitPanelReportedSize: splitPanelReportedSize, toggleRefs: toolsRefs, tools: tools, toolsHide: Boolean(toolsHide), toolsOpen: toolsOpen, toolsWidth: toolsWidth })))));
298
+ React.createElement(ToolsAndSplitPanel, { splitPanel: finalSplitPanePosition === 'side' ? splitPanel : undefined, ariaLabels: ariaLabels, closedDrawerWidth: closedDrawerWidth, contentHeightStyle: contentHeightStyle, disableContentPaddings: disableContentPaddings, drawerWidth: toolsDrawerWidth, footerHeight: footerHeight, headerHeight: headerHeight, isHidden: isToolsDrawerHidden, isMobile: isMobile, isMotionEnabled: isMotionEnabled, onToolsToggle: onToolsToggle, panelHeightStyle: panelHeightStyle, splitPanelContext: splitPanelContext, splitPanelOpen: splitPanelOpenOnTheSide, splitPanelReportedSize: splitPanelReportedSize, toggleRefs: toolsRefs, onLoseToolsFocus: loseToolsFocus, tools: tools, toolsHide: Boolean(toolsHide), toolsOpen: toolsOpen, toolsWidth: toolsWidth })))));
298
299
  });
299
300
  applyDisplayName(AppLayout, 'AppLayout');
300
301
  export default AppLayout;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/app-layout/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7F,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,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AmB,EAC7B,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,iBAAiB,EAAE,iBAAiB,EACpC,cAAc,EAAE,uBAAuB,EACvC,sBAAsB,EAAE,sBAAsB,EAC9C,UAAU,EAAE,SAAS,EACrB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,EAC7B,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,GACtB,CACE,CACF,CACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AACzC,eAAe,SAAS,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, { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport { getBaseProps } from '../internal/base-component';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { applyDefaults } from './defaults';\nimport { AppLayoutProps } from './interfaces';\nimport { Notifications } from './notifications';\nimport { MobileToolbar } from './mobile-toolbar';\nimport { SplitPanelWrapper } from './split-panel-wrapper';\nimport { useFocusControl } from './utils/use-focus-control';\nimport useWindowWidth from './utils/use-window-width';\nimport useContentHeight from './utils/use-content-height';\nimport styles from './styles.css.js';\nimport testutilStyles from './test-classes/styles.css.js';\nimport { findUpUntil } from '../internal/utils/dom';\nimport { AppLayoutContext } from '../internal/context/app-layout-context';\nimport { useContainerQuery } from '../internal/hooks/container-queries';\nimport { useStableEventHandler } from '../internal/hooks/use-stable-event-handler';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { SplitPanelContextProps, SplitPanelLastInteraction } from '../internal/context/split-panel-context';\nimport {\n CONSTRAINED_MAIN_PANEL_MIN_HEIGHT,\n CONSTRAINED_PAGE_HEIGHT,\n getSplitPanelDefaultSize,\n MAIN_PANEL_MIN_HEIGHT,\n} from '../split-panel/utils/size-utils';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport ContentWrapper, { ContentWrapperProps } from './content-wrapper';\nimport { isMotionDisabled } from '../internal/motion';\nimport { useEffectOnUpdate } from '../internal/hooks/use-effect-on-update';\nimport { NavigationPanel } from './navigation-panel';\nimport { ToolsAndSplitPanel } from './tools-and-split-panel';\nimport { usePreviousFrameValue } from '../internal/hooks/use-previous-frame';\nimport useAppLayoutOffsets from './utils/use-content-width';\nimport { isDevelopment } from '../internal/is-development';\nimport { warnOnce } from '../internal/logging';\n\nimport RefreshedAppLayout from './visual-refresh';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\n\nexport { AppLayoutProps };\n\nconst AppLayout = React.forwardRef(\n (\n { contentType = 'default', headerSelector = '#b #h', footerSelector = '#b #f', ...rest }: AppLayoutProps,\n ref: React.Ref<AppLayoutProps.Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent<HTMLDivElement>('AppLayout');\n const isRefresh = useVisualRefresh();\n\n // This re-builds the props including the default values\n const props = { contentType, headerSelector, footerSelector, ...rest };\n\n const baseProps = getBaseProps(rest);\n\n return (\n <div ref={__internalRootRef} {...baseProps}>\n {isRefresh ? <RefreshedAppLayout {...props} ref={ref} /> : <OldAppLayout {...props} ref={ref} />}\n </div>\n );\n }\n);\n\nconst OldAppLayout = React.forwardRef(\n (\n {\n navigation,\n navigationWidth = 280,\n navigationHide,\n navigationOpen: controlledNavigationOpen,\n tools,\n toolsWidth = 290,\n toolsHide,\n toolsOpen: controlledToolsOpen,\n breadcrumbs,\n notifications,\n stickyNotifications,\n contentHeader,\n disableContentHeaderOverlap,\n content,\n contentType = 'default',\n disableContentPaddings,\n disableBodyScroll,\n maxContentWidth,\n minContentWidth,\n headerSelector = '#b #h',\n footerSelector = '#b #f',\n ariaLabels,\n splitPanel,\n splitPanelSize: controlledSplitPanelSize,\n splitPanelOpen: controlledSplitPanelOpen,\n splitPanelPreferences: controlledSplitPanelPreferences,\n onSplitPanelPreferencesChange,\n onSplitPanelResize,\n onSplitPanelToggle,\n onNavigationChange,\n onToolsChange,\n }: AppLayoutProps,\n ref: React.Ref<AppLayoutProps.Ref>\n ) => {\n if (isDevelopment) {\n if (controlledToolsOpen && toolsHide) {\n warnOnce(\n 'AppLayout',\n `You have enabled both the \\`toolsOpen\\` prop and the \\`toolsHide\\` prop. This is not supported. Set \\`toolsOpen\\` to \\`false\\` when you set \\`toolsHide\\` to \\`true\\`.`\n );\n }\n }\n const rootRef = useRef<HTMLDivElement>(null);\n const isMobile = useMobile();\n const isMotionEnabled = rootRef.current ? !isMotionDisabled(rootRef.current) : false;\n\n const defaults = applyDefaults(contentType, { maxContentWidth, minContentWidth }, false);\n const [navigationOpen = false, setNavigationOpen] = useControllable(\n controlledNavigationOpen,\n onNavigationChange,\n isMobile ? false : defaults.navigationOpen,\n { componentName: 'AppLayout', controlledProp: 'navigationOpen', changeHandler: 'onNavigationChange' }\n );\n\n const [toolsOpen = false, setToolsOpen] = useControllable(\n controlledToolsOpen,\n onToolsChange,\n isMobile ? false : defaults.toolsOpen,\n { componentName: 'AppLayout', controlledProp: 'toolsOpen', changeHandler: 'onToolsChange' }\n );\n\n const onNavigationToggle = useCallback(\n (open: boolean) => {\n setNavigationOpen(open);\n fireNonCancelableEvent(onNavigationChange, { open });\n },\n [setNavigationOpen, onNavigationChange]\n );\n const onToolsToggle = useCallback(\n (open: boolean) => {\n setToolsOpen(open);\n fireNonCancelableEvent(onToolsChange, { open });\n },\n [setToolsOpen, onToolsChange]\n );\n const onNavigationClick = (event: React.MouseEvent) => {\n const hasLink = findUpUntil(\n event.target as HTMLElement,\n node => node.tagName === 'A' && !!(node as HTMLAnchorElement).href\n );\n if (hasLink) {\n onNavigationToggle(false);\n }\n };\n\n const navigationVisible = !navigationHide && navigationOpen;\n const toolsVisible = !toolsHide && toolsOpen;\n\n const { contentHeightStyle, headerHeight, footerHeight, panelHeightStyle } = useContentHeight(\n headerSelector,\n footerSelector,\n disableBodyScroll\n );\n const [notificationsHeight, notificationsRef] = useContainerQuery(rect => rect.height);\n const [splitPanelHeaderHeight, splitPanelHeaderMeasureRef] = useContainerQuery(\n rect => (splitPanel ? rect.height : 0),\n [splitPanel]\n );\n const splitPanelHeaderRefObject = useRef(null);\n const splitPanelHeaderRef = useMergeRefs(splitPanelHeaderMeasureRef, splitPanelHeaderRefObject);\n const anyPanelOpen = navigationVisible || toolsVisible;\n const hasRenderedNotifications = notificationsHeight ? notificationsHeight > 0 : false;\n const stickyNotificationsHeight = stickyNotifications ? notificationsHeight : null;\n\n const [splitPanelPreferences, setSplitPanelPreferences] = useControllable(\n controlledSplitPanelPreferences,\n onSplitPanelPreferencesChange,\n undefined,\n {\n componentName: 'AppLayout',\n controlledProp: 'splitPanelPreferences',\n changeHandler: 'onSplitPanelPreferencesChange',\n }\n );\n const splitPanelPosition = splitPanelPreferences?.position || 'bottom';\n\n const [splitPanelHeight, splitPanelRef] = useContainerQuery(\n rect => (splitPanel ? rect.height : 0),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [splitPanel, splitPanelPosition]\n );\n\n const closedDrawerWidth = 40;\n const effectiveNavigationWidth = navigationHide ? 0 : navigationOpen ? navigationWidth : closedDrawerWidth;\n const effectiveToolsWidth =\n toolsHide && (!splitPanel || splitPanelPreferences?.position !== 'side')\n ? 0\n : toolsOpen\n ? toolsWidth\n : closedDrawerWidth;\n\n const defaultSplitPanelSize = getSplitPanelDefaultSize(splitPanelPosition);\n const [splitPanelSize = defaultSplitPanelSize, setSplitPanelSize] = useControllable(\n controlledSplitPanelSize,\n onSplitPanelResize,\n defaultSplitPanelSize,\n {\n componentName: 'AppLayout',\n controlledProp: 'splitPanelSize',\n changeHandler: 'onSplitPanelResize',\n }\n );\n\n const [splitPanelOpen = false, setSplitPanelOpen] = useControllable(\n controlledSplitPanelOpen,\n onSplitPanelToggle,\n false,\n {\n componentName: 'AppLayout',\n controlledProp: 'splitPanelOpen',\n changeHandler: 'onSplitPanelToggle',\n }\n );\n\n const mainContentRef = useRef<HTMLDivElement>(null);\n const legacyScrollRootRef = useRef<HTMLElement>(null);\n\n const onSplitPanelPreferencesSet = useCallback(\n (detail: { position: 'side' | 'bottom' }) => {\n setSplitPanelPreferences(detail);\n fireNonCancelableEvent(onSplitPanelPreferencesChange, detail);\n },\n [setSplitPanelPreferences, onSplitPanelPreferencesChange]\n );\n const onSplitPanelSizeSet = useCallback(\n (detail: { size: number }) => {\n setSplitPanelSize(detail.size);\n fireNonCancelableEvent(onSplitPanelResize, detail);\n },\n [setSplitPanelSize, onSplitPanelResize]\n );\n const onToggle = useCallback(() => {\n setSplitPanelOpen(!splitPanelOpen);\n fireNonCancelableEvent(onSplitPanelToggle, { open: !splitPanelOpen });\n }, [setSplitPanelOpen, splitPanelOpen, onSplitPanelToggle]);\n\n const getSplitPanelMaxWidth = useStableEventHandler(() => {\n if (!mainContentRef.current || !defaults.minContentWidth) {\n return NaN;\n }\n\n const width = parseInt(getComputedStyle(mainContentRef.current).width);\n // when disableContentPaddings is true there is less available space,\n // so we subtract space-scaled-2x-xxxl * 2 for left and right padding\n const contentPadding = disableContentPaddings ? 80 : 0;\n const spaceAvailable = width - defaults.minContentWidth - contentPadding;\n const spaceTaken = finalSplitPanePosition === 'side' ? splitPanelSize : 0;\n return Math.max(0, spaceTaken + spaceAvailable);\n });\n\n const getSplitPanelMaxHeight = useStableEventHandler(() => {\n if (typeof document === 'undefined') {\n return 0; // render the split panel in its minimum possible size\n } else if (disableBodyScroll && legacyScrollRootRef.current) {\n const availableHeight = legacyScrollRootRef.current.clientHeight;\n return availableHeight < CONSTRAINED_PAGE_HEIGHT ? availableHeight : availableHeight - MAIN_PANEL_MIN_HEIGHT;\n } else {\n const availableHeight = document.documentElement.clientHeight - headerHeight - footerHeight;\n return availableHeight < CONSTRAINED_PAGE_HEIGHT\n ? availableHeight - CONSTRAINED_MAIN_PANEL_MIN_HEIGHT\n : availableHeight - MAIN_PANEL_MIN_HEIGHT;\n }\n });\n\n const [isForcedPosition, setIsForcedPosition] = useState(false);\n const finalSplitPanePosition = isForcedPosition ? 'bottom' : splitPanelPosition;\n\n const splitPaneAvailableOnTheSide = Boolean(splitPanel) && finalSplitPanePosition === 'side';\n const splitPanelOpenOnTheSide = splitPaneAvailableOnTheSide && splitPanelOpen;\n\n const toggleButtonsBarWidth = 0;\n\n const windowWidth = useWindowWidth();\n const { left: leftOffset, right: rightOffset } = useAppLayoutOffsets(rootRef.current);\n const contentWidthWithSplitPanel =\n windowWidth -\n leftOffset -\n rightOffset -\n effectiveToolsWidth -\n effectiveNavigationWidth -\n (disableContentPaddings ? 0 : toggleButtonsBarWidth);\n\n useEffect(() => {\n const contentWidth = contentWidthWithSplitPanel - splitPanelSize;\n setIsForcedPosition(isMobile || (defaults.minContentWidth || 0) > contentWidth);\n // This is a workaround to avoid a forced position due to splitPanelSize, which is\n // user controlled variable.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [contentWidthWithSplitPanel, defaults.minContentWidth, isMobile]);\n\n const navigationClosedWidth = navigationHide || isMobile ? 0 : closedDrawerWidth;\n const toolsClosedWidth = toolsHide || isMobile ? 0 : closedDrawerWidth;\n\n const [splitPanelLastInteraction, setSplitPanelLastInteraction] = useState<undefined | SplitPanelLastInteraction>();\n useEffectOnUpdate(\n () => setSplitPanelLastInteraction(splitPanelOpen ? { type: 'open' } : { type: 'close' }),\n [splitPanelOpen]\n );\n useEffectOnUpdate(() => setSplitPanelLastInteraction({ type: 'position' }), [splitPanelPosition]);\n\n const contentMaxWidthStyle = !isMobile ? { maxWidth: defaults.maxContentWidth } : undefined;\n\n const [splitPanelReportedSize, setSplitPanelReportedSize] = useState(0);\n\n const splitPanelContext: SplitPanelContextProps = {\n topOffset: headerHeight + (finalSplitPanePosition === 'bottom' ? stickyNotificationsHeight || 0 : 0),\n bottomOffset: footerHeight,\n leftOffset:\n leftOffset + (isMobile ? 0 : !navigationHide && navigationOpen ? navigationWidth : navigationClosedWidth),\n rightOffset: rightOffset + (isMobile ? 0 : !toolsHide && toolsOpen ? toolsWidth : toolsClosedWidth),\n position: finalSplitPanePosition,\n size: splitPanelSize,\n getMaxWidth: getSplitPanelMaxWidth,\n getMaxHeight: getSplitPanelMaxHeight,\n getHeader: () => splitPanelHeaderRefObject.current,\n disableContentPaddings,\n contentWidthStyles: contentMaxWidthStyle,\n isOpen: splitPanelOpen,\n isMobile,\n isRefresh: false,\n isForcedPosition,\n lastInteraction: splitPanelLastInteraction,\n splitPanelRef,\n splitPanelHeaderRef,\n onResize: onSplitPanelSizeSet,\n onToggle,\n onPreferencesChange: onSplitPanelPreferencesSet,\n reportSize: setSplitPanelReportedSize,\n };\n\n const contentWrapperProps: ContentWrapperProps = {\n navigationPadding: navigationHide || !!navigationOpen,\n toolsPadding:\n // tools padding is displayed in one of the three cases\n // 1. Nothing on the that screen edge (no tools panel and no split panel)\n (toolsHide && (!splitPanel || finalSplitPanePosition !== 'side')) ||\n // 2. Tools panel is present and open\n toolsVisible ||\n // 3. Split panel is open in side position\n splitPanelOpenOnTheSide,\n isMobile,\n };\n\n const navigationRefs = useFocusControl(navigationOpen);\n const toolsRefs = useFocusControl(toolsOpen);\n\n useImperativeHandle(\n ref,\n () => ({\n openTools: () => onToolsToggle(true),\n closeNavigationIfNecessary: () => {\n if (isMobile) {\n onNavigationToggle(false);\n }\n },\n }),\n [isMobile, onNavigationToggle, onToolsToggle]\n );\n\n const splitPanelBottomOffset =\n (!splitPanel || finalSplitPanePosition !== 'bottom'\n ? undefined\n : splitPanelOpen\n ? splitPanelHeight\n : splitPanelHeaderHeight) ?? undefined;\n\n const contentWidthStyles = !isMobile\n ? { minWidth: defaults.minContentWidth, maxWidth: defaults.maxContentWidth }\n : undefined;\n\n const isToolsDrawerHidden = disableContentPaddings;\n\n const toolsDrawerWidth = (() => {\n if (isMobile) {\n return 0;\n }\n\n const toolsPanelWidth = toolsHide ? 0 : toolsOpen ? toolsWidth : closedDrawerWidth;\n const splitPanelWidth =\n !splitPanel || finalSplitPanePosition !== 'side'\n ? 0\n : splitPanelOpen\n ? splitPanelReportedSize\n : closedDrawerWidth;\n\n return toolsPanelWidth + splitPanelWidth;\n })();\n\n const navigationDrawerWidth = (() => {\n if (isMobile) {\n return 0;\n }\n\n return effectiveNavigationWidth;\n })();\n\n const previousContentWidth = usePreviousFrameValue(\n contentWidthWithSplitPanel - (splitPanelOpenOnTheSide ? splitPanelReportedSize : 0)\n );\n\n const contentScaleX = (() => {\n if (isMobile || !isMotionEnabled || !disableContentPaddings || !previousContentWidth) {\n return undefined;\n }\n })();\n\n return (\n <div\n className={clsx(styles.root, testutilStyles.root, disableBodyScroll && styles['root-no-scroll'])}\n ref={rootRef}\n >\n <div className={styles['layout-wrapper']} style={contentHeightStyle}>\n {isMobile && (!toolsHide || !navigationHide || breadcrumbs) && (\n <MobileToolbar\n anyPanelOpen={anyPanelOpen}\n toggleRefs={{ navigation: navigationRefs.toggle, tools: toolsRefs.toggle }}\n topOffset={headerHeight}\n ariaLabels={ariaLabels}\n navigationHide={navigationHide}\n toolsHide={toolsHide}\n onNavigationOpen={() => onNavigationToggle(true)}\n onToolsOpen={() => onToolsToggle(true)}\n unfocusable={anyPanelOpen}\n >\n {breadcrumbs}\n </MobileToolbar>\n )}\n <div className={clsx(styles.layout, disableBodyScroll && styles['layout-no-scroll'])}>\n {!navigationHide && (\n <NavigationPanel\n ariaLabels={ariaLabels}\n footerHeight={footerHeight}\n headerHeight={headerHeight}\n isHidden={disableContentPaddings}\n isMobile={isMobile}\n isMotionEnabled={isMotionEnabled}\n navigation={navigation}\n navigationDrawerWidth={navigationDrawerWidth}\n navigationOpen={navigationOpen}\n onClick={isMobile ? onNavigationClick : undefined}\n onNavigationToggle={onNavigationToggle}\n panelHeightStyle={panelHeightStyle}\n toggleRefs={navigationRefs}\n navigationWidth={navigationWidth}\n />\n )}\n <main\n ref={legacyScrollRootRef}\n className={clsx(styles['layout-main'], {\n [styles['layout-main-scrollable']]: disableBodyScroll,\n [testutilStyles['disable-body-scroll-root']]: disableBodyScroll,\n [styles.unfocusable]: isMobile && anyPanelOpen,\n })}\n >\n <div\n style={{\n marginBottom: splitPanelBottomOffset,\n transform: contentScaleX ? `scaleX(${contentScaleX})` : undefined,\n }}\n >\n {notifications && (\n <Notifications\n testUtilsClassName={clsx(styles.notifications, testutilStyles.notifications)}\n labels={ariaLabels}\n topOffset={disableBodyScroll ? 0 : headerHeight}\n sticky={!isMobile && stickyNotifications}\n ref={notificationsRef}\n isMobile={isMobile}\n navigationPadding={contentWrapperProps.navigationPadding}\n toolsPadding={contentWrapperProps.toolsPadding}\n contentWidthStyles={contentWidthStyles}\n >\n {notifications}\n </Notifications>\n )}\n {((!isMobile && breadcrumbs) || contentHeader) && (\n <ContentWrapper {...contentWrapperProps} contentWidthStyles={contentWidthStyles}>\n {!isMobile && breadcrumbs && (\n <div\n className={clsx(styles.breadcrumbs, testutilStyles.breadcrumbs, styles['breadcrumbs-desktop'])}\n >\n {breadcrumbs}\n </div>\n )}\n {contentHeader && (\n <div\n className={clsx(\n styles['content-header-wrapper'],\n !hasRenderedNotifications &&\n (isMobile || !breadcrumbs) &&\n styles['content-extra-top-padding'],\n !hasRenderedNotifications && !breadcrumbs && styles['content-header-wrapper-first-child'],\n !disableContentHeaderOverlap && styles['content-header-wrapper-overlapped']\n )}\n >\n {contentHeader}\n </div>\n )}\n </ContentWrapper>\n )}\n <ContentWrapper\n {...contentWrapperProps}\n ref={mainContentRef}\n disablePaddings={disableContentPaddings}\n // eslint-disable-next-line react/forbid-component-props\n className={clsx(\n !disableContentPaddings && styles['content-wrapper'],\n !disableContentPaddings &&\n (isMobile || !breadcrumbs) &&\n !contentHeader &&\n styles['content-extra-top-padding'],\n !hasRenderedNotifications &&\n !breadcrumbs &&\n !isMobile &&\n !contentHeader &&\n styles['content-wrapper-first-child']\n )}\n >\n <div\n className={clsx(\n styles.content,\n testutilStyles.content,\n !disableContentHeaderOverlap && contentHeader && styles['content-overlapped']\n )}\n style={contentWidthStyles}\n >\n <AppLayoutContext.Provider\n value={{\n stickyOffsetTop:\n (disableBodyScroll ? 0 : headerHeight) +\n (stickyNotificationsHeight !== null ? stickyNotificationsHeight : 0),\n stickyOffsetBottom: footerHeight + (splitPanelBottomOffset || 0),\n }}\n >\n {content}\n </AppLayoutContext.Provider>\n </div>\n </ContentWrapper>\n </div>\n {finalSplitPanePosition === 'bottom' && (\n <SplitPanelWrapper context={splitPanelContext}>{splitPanel}</SplitPanelWrapper>\n )}\n </main>\n\n <ToolsAndSplitPanel\n splitPanel={finalSplitPanePosition === 'side' ? splitPanel : undefined}\n ariaLabels={ariaLabels}\n closedDrawerWidth={closedDrawerWidth}\n contentHeightStyle={contentHeightStyle}\n disableContentPaddings={disableContentPaddings}\n drawerWidth={toolsDrawerWidth}\n footerHeight={footerHeight}\n headerHeight={headerHeight}\n isHidden={isToolsDrawerHidden}\n isMobile={isMobile}\n isMotionEnabled={isMotionEnabled}\n onToolsToggle={onToolsToggle}\n panelHeightStyle={panelHeightStyle}\n splitPanelContext={splitPanelContext}\n splitPanelOpen={splitPanelOpenOnTheSide}\n splitPanelReportedSize={splitPanelReportedSize}\n toggleRefs={toolsRefs}\n tools={tools}\n toolsHide={Boolean(toolsHide)}\n toolsOpen={toolsOpen}\n toolsWidth={toolsWidth}\n />\n </div>\n </div>\n </div>\n );\n }\n);\n\napplyDisplayName(AppLayout, 'AppLayout');\nexport default AppLayout;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/app-layout/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,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AC,kBAAkB,IACjB,UAAU,EAAE,sBAAsB,KAAK,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EACtE,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,kBAAkB,EAAE,kBAAkB,EACtC,sBAAsB,EAAE,sBAAsB,EAC9C,WAAW,EAAE,gBAAgB,EAC7B,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,mBAAmB,EAC7B,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,iBAAiB,EAAE,iBAAiB,EACpC,cAAc,EAAE,uBAAuB,EACvC,sBAAsB,EAAE,sBAAsB,EAC9C,UAAU,EAAE,SAAS,EACrB,gBAAgB,EAAE,cAAc,EAChC,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,EAC7B,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,GACtB,CACE,CACF,CACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AACzC,eAAe,SAAS,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, { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport { getBaseProps } from '../internal/base-component';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { applyDefaults } from './defaults';\nimport { AppLayoutProps } from './interfaces';\nimport { Notifications } from './notifications';\nimport { MobileToolbar } from './mobile-toolbar';\nimport { SplitPanelWrapper } from './split-panel-wrapper';\nimport { useFocusControl } from './utils/use-focus-control';\nimport useWindowWidth from './utils/use-window-width';\nimport useContentHeight from './utils/use-content-height';\nimport styles from './styles.css.js';\nimport testutilStyles from './test-classes/styles.css.js';\nimport { findUpUntil } from '../internal/utils/dom';\nimport { AppLayoutContext } from '../internal/context/app-layout-context';\nimport { useContainerQuery } from '../internal/hooks/container-queries';\nimport { useStableEventHandler } from '../internal/hooks/use-stable-event-handler';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { SplitPanelContextProps, SplitPanelLastInteraction } from '../internal/context/split-panel-context';\nimport {\n CONSTRAINED_MAIN_PANEL_MIN_HEIGHT,\n CONSTRAINED_PAGE_HEIGHT,\n getSplitPanelDefaultSize,\n MAIN_PANEL_MIN_HEIGHT,\n} from '../split-panel/utils/size-utils';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport ContentWrapper, { ContentWrapperProps } from './content-wrapper';\nimport { isMotionDisabled } from '../internal/motion';\nimport { useEffectOnUpdate } from '../internal/hooks/use-effect-on-update';\nimport { NavigationPanel } from './navigation-panel';\nimport { ToolsAndSplitPanel } from './tools-and-split-panel';\nimport { usePreviousFrameValue } from '../internal/hooks/use-previous-frame';\nimport useAppLayoutOffsets from './utils/use-content-width';\nimport { isDevelopment } from '../internal/is-development';\nimport { warnOnce } from '../internal/logging';\n\nimport RefreshedAppLayout from './visual-refresh';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\n\nexport { AppLayoutProps };\n\nconst AppLayout = React.forwardRef(\n (\n { contentType = 'default', headerSelector = '#b #h', footerSelector = '#b #f', ...rest }: AppLayoutProps,\n ref: React.Ref<AppLayoutProps.Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent<HTMLDivElement>('AppLayout');\n const isRefresh = useVisualRefresh();\n\n // This re-builds the props including the default values\n const props = { contentType, headerSelector, footerSelector, ...rest };\n\n const baseProps = getBaseProps(rest);\n\n return (\n <div ref={__internalRootRef} {...baseProps}>\n {isRefresh ? <RefreshedAppLayout {...props} ref={ref} /> : <OldAppLayout {...props} ref={ref} />}\n </div>\n );\n }\n);\n\nconst OldAppLayout = React.forwardRef(\n (\n {\n navigation,\n navigationWidth = 280,\n navigationHide,\n navigationOpen: controlledNavigationOpen,\n tools,\n toolsWidth = 290,\n toolsHide,\n toolsOpen: controlledToolsOpen,\n breadcrumbs,\n notifications,\n stickyNotifications,\n contentHeader,\n disableContentHeaderOverlap,\n content,\n contentType = 'default',\n disableContentPaddings,\n disableBodyScroll,\n maxContentWidth,\n minContentWidth,\n headerSelector = '#b #h',\n footerSelector = '#b #f',\n ariaLabels,\n splitPanel,\n splitPanelSize: controlledSplitPanelSize,\n splitPanelOpen: controlledSplitPanelOpen,\n splitPanelPreferences: controlledSplitPanelPreferences,\n onSplitPanelPreferencesChange,\n onSplitPanelResize,\n onSplitPanelToggle,\n onNavigationChange,\n onToolsChange,\n }: AppLayoutProps,\n ref: React.Ref<AppLayoutProps.Ref>\n ) => {\n if (isDevelopment) {\n if (controlledToolsOpen && toolsHide) {\n warnOnce(\n 'AppLayout',\n `You have enabled both the \\`toolsOpen\\` prop and the \\`toolsHide\\` prop. This is not supported. Set \\`toolsOpen\\` to \\`false\\` when you set \\`toolsHide\\` to \\`true\\`.`\n );\n }\n }\n const rootRef = useRef<HTMLDivElement>(null);\n const isMobile = useMobile();\n const isMotionEnabled = rootRef.current ? !isMotionDisabled(rootRef.current) : false;\n\n const defaults = applyDefaults(contentType, { maxContentWidth, minContentWidth }, false);\n const [navigationOpen = false, setNavigationOpen] = useControllable(\n controlledNavigationOpen,\n onNavigationChange,\n isMobile ? false : defaults.navigationOpen,\n { componentName: 'AppLayout', controlledProp: 'navigationOpen', changeHandler: 'onNavigationChange' }\n );\n\n const [toolsOpen = false, setToolsOpen] = useControllable(\n controlledToolsOpen,\n onToolsChange,\n isMobile ? false : defaults.toolsOpen,\n { componentName: 'AppLayout', controlledProp: 'toolsOpen', changeHandler: 'onToolsChange' }\n );\n\n const onNavigationToggle = useCallback(\n (open: boolean) => {\n setNavigationOpen(open);\n fireNonCancelableEvent(onNavigationChange, { open });\n },\n [setNavigationOpen, onNavigationChange]\n );\n const onToolsToggle = useCallback(\n (open: boolean) => {\n setToolsOpen(open);\n fireNonCancelableEvent(onToolsChange, { open });\n },\n [setToolsOpen, onToolsChange]\n );\n const onNavigationClick = (event: React.MouseEvent) => {\n const hasLink = findUpUntil(\n event.target as HTMLElement,\n node => node.tagName === 'A' && !!(node as HTMLAnchorElement).href\n );\n if (hasLink) {\n onNavigationToggle(false);\n }\n };\n\n const navigationVisible = !navigationHide && navigationOpen;\n const toolsVisible = !toolsHide && toolsOpen;\n\n const { contentHeightStyle, headerHeight, footerHeight, panelHeightStyle } = useContentHeight(\n headerSelector,\n footerSelector,\n disableBodyScroll\n );\n const [notificationsHeight, notificationsRef] = useContainerQuery(rect => rect.height);\n const [splitPanelHeaderHeight, splitPanelHeaderMeasureRef] = useContainerQuery(\n rect => (splitPanel ? rect.height : 0),\n [splitPanel]\n );\n const splitPanelHeaderRefObject = useRef(null);\n const splitPanelHeaderRef = useMergeRefs(splitPanelHeaderMeasureRef, splitPanelHeaderRefObject);\n const anyPanelOpen = navigationVisible || toolsVisible;\n const hasRenderedNotifications = notificationsHeight ? notificationsHeight > 0 : false;\n const stickyNotificationsHeight = stickyNotifications ? notificationsHeight : null;\n\n const [splitPanelPreferences, setSplitPanelPreferences] = useControllable(\n controlledSplitPanelPreferences,\n onSplitPanelPreferencesChange,\n undefined,\n {\n componentName: 'AppLayout',\n controlledProp: 'splitPanelPreferences',\n changeHandler: 'onSplitPanelPreferencesChange',\n }\n );\n const splitPanelPosition = splitPanelPreferences?.position || 'bottom';\n\n const [splitPanelHeight, splitPanelRef] = useContainerQuery(\n rect => (splitPanel ? rect.height : 0),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [splitPanel, splitPanelPosition]\n );\n\n const closedDrawerWidth = 40;\n const effectiveNavigationWidth = navigationHide ? 0 : navigationOpen ? navigationWidth : closedDrawerWidth;\n const effectiveToolsWidth =\n toolsHide && (!splitPanel || splitPanelPreferences?.position !== 'side')\n ? 0\n : toolsOpen\n ? toolsWidth\n : closedDrawerWidth;\n\n const defaultSplitPanelSize = getSplitPanelDefaultSize(splitPanelPosition);\n const [splitPanelSize = defaultSplitPanelSize, setSplitPanelSize] = useControllable(\n controlledSplitPanelSize,\n onSplitPanelResize,\n defaultSplitPanelSize,\n {\n componentName: 'AppLayout',\n controlledProp: 'splitPanelSize',\n changeHandler: 'onSplitPanelResize',\n }\n );\n\n const [splitPanelOpen = false, setSplitPanelOpen] = useControllable(\n controlledSplitPanelOpen,\n onSplitPanelToggle,\n false,\n {\n componentName: 'AppLayout',\n controlledProp: 'splitPanelOpen',\n changeHandler: 'onSplitPanelToggle',\n }\n );\n\n const mainContentRef = useRef<HTMLDivElement>(null);\n const legacyScrollRootRef = useRef<HTMLElement>(null);\n\n const onSplitPanelPreferencesSet = useCallback(\n (detail: { position: 'side' | 'bottom' }) => {\n setSplitPanelPreferences(detail);\n fireNonCancelableEvent(onSplitPanelPreferencesChange, detail);\n },\n [setSplitPanelPreferences, onSplitPanelPreferencesChange]\n );\n const onSplitPanelSizeSet = useCallback(\n (detail: { size: number }) => {\n setSplitPanelSize(detail.size);\n fireNonCancelableEvent(onSplitPanelResize, detail);\n },\n [setSplitPanelSize, onSplitPanelResize]\n );\n const onToggle = useCallback(() => {\n setSplitPanelOpen(!splitPanelOpen);\n fireNonCancelableEvent(onSplitPanelToggle, { open: !splitPanelOpen });\n }, [setSplitPanelOpen, splitPanelOpen, onSplitPanelToggle]);\n\n const getSplitPanelMaxWidth = useStableEventHandler(() => {\n if (!mainContentRef.current || !defaults.minContentWidth) {\n return NaN;\n }\n\n const width = parseInt(getComputedStyle(mainContentRef.current).width);\n // when disableContentPaddings is true there is less available space,\n // so we subtract space-scaled-2x-xxxl * 2 for left and right padding\n const contentPadding = disableContentPaddings ? 80 : 0;\n const spaceAvailable = width - defaults.minContentWidth - contentPadding;\n const spaceTaken = finalSplitPanePosition === 'side' ? splitPanelSize : 0;\n return Math.max(0, spaceTaken + spaceAvailable);\n });\n\n const getSplitPanelMaxHeight = useStableEventHandler(() => {\n if (typeof document === 'undefined') {\n return 0; // render the split panel in its minimum possible size\n } else if (disableBodyScroll && legacyScrollRootRef.current) {\n const availableHeight = legacyScrollRootRef.current.clientHeight;\n return availableHeight < CONSTRAINED_PAGE_HEIGHT ? availableHeight : availableHeight - MAIN_PANEL_MIN_HEIGHT;\n } else {\n const availableHeight = document.documentElement.clientHeight - headerHeight - footerHeight;\n return availableHeight < CONSTRAINED_PAGE_HEIGHT\n ? availableHeight - CONSTRAINED_MAIN_PANEL_MIN_HEIGHT\n : availableHeight - MAIN_PANEL_MIN_HEIGHT;\n }\n });\n\n const [isForcedPosition, setIsForcedPosition] = useState(false);\n const finalSplitPanePosition = isForcedPosition ? 'bottom' : splitPanelPosition;\n\n const splitPaneAvailableOnTheSide = Boolean(splitPanel) && finalSplitPanePosition === 'side';\n const splitPanelOpenOnTheSide = splitPaneAvailableOnTheSide && splitPanelOpen;\n\n const toggleButtonsBarWidth = 0;\n\n const windowWidth = useWindowWidth();\n const { left: leftOffset, right: rightOffset } = useAppLayoutOffsets(rootRef.current);\n const contentWidthWithSplitPanel =\n windowWidth -\n leftOffset -\n rightOffset -\n effectiveToolsWidth -\n effectiveNavigationWidth -\n (disableContentPaddings ? 0 : toggleButtonsBarWidth);\n\n useEffect(() => {\n const contentWidth = contentWidthWithSplitPanel - splitPanelSize;\n setIsForcedPosition(isMobile || (defaults.minContentWidth || 0) > contentWidth);\n // This is a workaround to avoid a forced position due to splitPanelSize, which is\n // user controlled variable.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [contentWidthWithSplitPanel, defaults.minContentWidth, isMobile]);\n\n const navigationClosedWidth = navigationHide || isMobile ? 0 : closedDrawerWidth;\n const toolsClosedWidth = toolsHide || isMobile ? 0 : closedDrawerWidth;\n\n const [splitPanelLastInteraction, setSplitPanelLastInteraction] = useState<undefined | SplitPanelLastInteraction>();\n useEffectOnUpdate(\n () => setSplitPanelLastInteraction(splitPanelOpen ? { type: 'open' } : { type: 'close' }),\n [splitPanelOpen]\n );\n useEffectOnUpdate(() => setSplitPanelLastInteraction({ type: 'position' }), [splitPanelPosition]);\n\n const contentMaxWidthStyle = !isMobile ? { maxWidth: defaults.maxContentWidth } : undefined;\n\n const [splitPanelReportedSize, setSplitPanelReportedSize] = useState(0);\n\n const splitPanelContext: SplitPanelContextProps = {\n topOffset: headerHeight + (finalSplitPanePosition === 'bottom' ? stickyNotificationsHeight || 0 : 0),\n bottomOffset: footerHeight,\n leftOffset:\n leftOffset + (isMobile ? 0 : !navigationHide && navigationOpen ? navigationWidth : navigationClosedWidth),\n rightOffset: rightOffset + (isMobile ? 0 : !toolsHide && toolsOpen ? toolsWidth : toolsClosedWidth),\n position: finalSplitPanePosition,\n size: splitPanelSize,\n getMaxWidth: getSplitPanelMaxWidth,\n getMaxHeight: getSplitPanelMaxHeight,\n getHeader: () => splitPanelHeaderRefObject.current,\n disableContentPaddings,\n contentWidthStyles: contentMaxWidthStyle,\n isOpen: splitPanelOpen,\n isMobile,\n isRefresh: false,\n isForcedPosition,\n lastInteraction: splitPanelLastInteraction,\n splitPanelRef,\n splitPanelHeaderRef,\n onResize: onSplitPanelSizeSet,\n onToggle,\n onPreferencesChange: onSplitPanelPreferencesSet,\n reportSize: setSplitPanelReportedSize,\n };\n\n const contentWrapperProps: ContentWrapperProps = {\n navigationPadding: navigationHide || !!navigationOpen,\n toolsPadding:\n // tools padding is displayed in one of the three cases\n // 1. Nothing on the that screen edge (no tools panel and no split panel)\n (toolsHide && (!splitPanel || finalSplitPanePosition !== 'side')) ||\n // 2. Tools panel is present and open\n toolsVisible ||\n // 3. Split panel is open in side position\n splitPanelOpenOnTheSide,\n isMobile,\n };\n\n const { refs: navigationRefs } = useFocusControl(navigationOpen);\n const { refs: toolsRefs, setFocus: focusToolsClose, loseFocus: loseToolsFocus } = useFocusControl(toolsOpen, true);\n\n useImperativeHandle(\n ref,\n () => ({\n openTools: () => onToolsToggle(true),\n closeNavigationIfNecessary: () => {\n if (isMobile) {\n onNavigationToggle(false);\n }\n },\n focusToolsClose,\n }),\n [isMobile, onNavigationToggle, onToolsToggle, focusToolsClose]\n );\n\n const splitPanelBottomOffset =\n (!splitPanel || finalSplitPanePosition !== 'bottom'\n ? undefined\n : splitPanelOpen\n ? splitPanelHeight\n : splitPanelHeaderHeight) ?? undefined;\n\n const contentWidthStyles = !isMobile\n ? { minWidth: defaults.minContentWidth, maxWidth: defaults.maxContentWidth }\n : undefined;\n\n const isToolsDrawerHidden = disableContentPaddings;\n\n const toolsDrawerWidth = (() => {\n if (isMobile) {\n return 0;\n }\n\n const toolsPanelWidth = toolsHide ? 0 : toolsOpen ? toolsWidth : closedDrawerWidth;\n const splitPanelWidth =\n !splitPanel || finalSplitPanePosition !== 'side'\n ? 0\n : splitPanelOpen\n ? splitPanelReportedSize\n : closedDrawerWidth;\n\n return toolsPanelWidth + splitPanelWidth;\n })();\n\n const navigationDrawerWidth = (() => {\n if (isMobile) {\n return 0;\n }\n\n return effectiveNavigationWidth;\n })();\n\n const previousContentWidth = usePreviousFrameValue(\n contentWidthWithSplitPanel - (splitPanelOpenOnTheSide ? splitPanelReportedSize : 0)\n );\n\n const contentScaleX = (() => {\n if (isMobile || !isMotionEnabled || !disableContentPaddings || !previousContentWidth) {\n return undefined;\n }\n })();\n\n return (\n <div\n className={clsx(styles.root, testutilStyles.root, disableBodyScroll && styles['root-no-scroll'])}\n ref={rootRef}\n >\n <div className={styles['layout-wrapper']} style={contentHeightStyle}>\n {isMobile && (!toolsHide || !navigationHide || breadcrumbs) && (\n <MobileToolbar\n anyPanelOpen={anyPanelOpen}\n toggleRefs={{ navigation: navigationRefs.toggle, tools: toolsRefs.toggle }}\n topOffset={headerHeight}\n ariaLabels={ariaLabels}\n navigationHide={navigationHide}\n toolsHide={toolsHide}\n onNavigationOpen={() => onNavigationToggle(true)}\n onToolsOpen={() => onToolsToggle(true)}\n unfocusable={anyPanelOpen}\n >\n {breadcrumbs}\n </MobileToolbar>\n )}\n <div className={clsx(styles.layout, disableBodyScroll && styles['layout-no-scroll'])}>\n {!navigationHide && (\n <NavigationPanel\n ariaLabels={ariaLabels}\n footerHeight={footerHeight}\n headerHeight={headerHeight}\n isHidden={disableContentPaddings}\n isMobile={isMobile}\n isMotionEnabled={isMotionEnabled}\n navigation={navigation}\n navigationDrawerWidth={navigationDrawerWidth}\n navigationOpen={navigationOpen}\n onClick={isMobile ? onNavigationClick : undefined}\n onNavigationToggle={onNavigationToggle}\n panelHeightStyle={panelHeightStyle}\n toggleRefs={navigationRefs}\n navigationWidth={navigationWidth}\n />\n )}\n <main\n ref={legacyScrollRootRef}\n className={clsx(styles['layout-main'], {\n [styles['layout-main-scrollable']]: disableBodyScroll,\n [testutilStyles['disable-body-scroll-root']]: disableBodyScroll,\n [styles.unfocusable]: isMobile && anyPanelOpen,\n })}\n >\n <div\n style={{\n marginBottom: splitPanelBottomOffset,\n transform: contentScaleX ? `scaleX(${contentScaleX})` : undefined,\n }}\n >\n {notifications && (\n <Notifications\n testUtilsClassName={clsx(styles.notifications, testutilStyles.notifications)}\n labels={ariaLabels}\n topOffset={disableBodyScroll ? 0 : headerHeight}\n sticky={!isMobile && stickyNotifications}\n ref={notificationsRef}\n isMobile={isMobile}\n navigationPadding={contentWrapperProps.navigationPadding}\n toolsPadding={contentWrapperProps.toolsPadding}\n contentWidthStyles={contentWidthStyles}\n >\n {notifications}\n </Notifications>\n )}\n {((!isMobile && breadcrumbs) || contentHeader) && (\n <ContentWrapper {...contentWrapperProps} contentWidthStyles={contentWidthStyles}>\n {!isMobile && breadcrumbs && (\n <div\n className={clsx(styles.breadcrumbs, testutilStyles.breadcrumbs, styles['breadcrumbs-desktop'])}\n >\n {breadcrumbs}\n </div>\n )}\n {contentHeader && (\n <div\n className={clsx(\n styles['content-header-wrapper'],\n !hasRenderedNotifications &&\n (isMobile || !breadcrumbs) &&\n styles['content-extra-top-padding'],\n !hasRenderedNotifications && !breadcrumbs && styles['content-header-wrapper-first-child'],\n !disableContentHeaderOverlap && styles['content-header-wrapper-overlapped']\n )}\n >\n {contentHeader}\n </div>\n )}\n </ContentWrapper>\n )}\n <ContentWrapper\n {...contentWrapperProps}\n ref={mainContentRef}\n disablePaddings={disableContentPaddings}\n // eslint-disable-next-line react/forbid-component-props\n className={clsx(\n !disableContentPaddings && styles['content-wrapper'],\n !disableContentPaddings &&\n (isMobile || !breadcrumbs) &&\n !contentHeader &&\n styles['content-extra-top-padding'],\n !hasRenderedNotifications &&\n !breadcrumbs &&\n !isMobile &&\n !contentHeader &&\n styles['content-wrapper-first-child']\n )}\n >\n <div\n className={clsx(\n styles.content,\n testutilStyles.content,\n !disableContentHeaderOverlap && contentHeader && styles['content-overlapped']\n )}\n style={contentWidthStyles}\n >\n <AppLayoutContext.Provider\n value={{\n stickyOffsetTop:\n (disableBodyScroll ? 0 : headerHeight) +\n (stickyNotificationsHeight !== null ? stickyNotificationsHeight : 0),\n stickyOffsetBottom: footerHeight + (splitPanelBottomOffset || 0),\n }}\n >\n {content}\n </AppLayoutContext.Provider>\n </div>\n </ContentWrapper>\n </div>\n {finalSplitPanePosition === 'bottom' && (\n <SplitPanelWrapper context={splitPanelContext}>{splitPanel}</SplitPanelWrapper>\n )}\n </main>\n\n <ToolsAndSplitPanel\n splitPanel={finalSplitPanePosition === 'side' ? splitPanel : undefined}\n ariaLabels={ariaLabels}\n closedDrawerWidth={closedDrawerWidth}\n contentHeightStyle={contentHeightStyle}\n disableContentPaddings={disableContentPaddings}\n drawerWidth={toolsDrawerWidth}\n footerHeight={footerHeight}\n headerHeight={headerHeight}\n isHidden={isToolsDrawerHidden}\n isMobile={isMobile}\n isMotionEnabled={isMotionEnabled}\n onToolsToggle={onToolsToggle}\n panelHeightStyle={panelHeightStyle}\n splitPanelContext={splitPanelContext}\n splitPanelOpen={splitPanelOpenOnTheSide}\n splitPanelReportedSize={splitPanelReportedSize}\n toggleRefs={toolsRefs}\n onLoseToolsFocus={loseToolsFocus}\n tools={tools}\n toolsHide={Boolean(toolsHide)}\n toolsOpen={toolsOpen}\n toolsWidth={toolsWidth}\n />\n </div>\n </div>\n </div>\n );\n }\n);\n\napplyDisplayName(AppLayout, 'AppLayout');\nexport default AppLayout;\n"]}
@@ -175,6 +175,12 @@ export declare namespace AppLayoutProps {
175
175
  * to control the state by listening to `toolsChange` and providing `toolsOpen`.
176
176
  */
177
177
  openTools(): void;
178
+ /**
179
+ * Focuses the tools panel if it is open. Use this to focus the tools panel
180
+ * after changing the content, for example when clicking on an 'info' link while
181
+ * the panel is already open.
182
+ */
183
+ focusToolsClose(): void;
178
184
  }
179
185
  interface Labels {
180
186
  notifications?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/app-layout/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,cAAe,SAAQ,kBAAkB;IACxD;;;OAGG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC;IAEzC;;OAEG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,eAAe,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I,EAAE,MAAM,CAAC;KACd;IAED,UAAiB,qBAAqB;QACpC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;KAC7B;IAGD,KAAY,kBAAkB,GAAG,MAAM,GAAG,QAAQ,CAAC;CACpD"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/app-layout/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 { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface AppLayoutProps extends BaseComponentProps {\n /**\n * Determines the default behavior of the component based on some predefined page layouts.\n * Individual properties will always take precedence over the default coming from the content type.\n */\n contentType?: AppLayoutProps.ContentType;\n\n /**\n * If `true`, disables outer paddings for the content slot.\n */\n disableContentPaddings?: boolean;\n\n /**\n * Activates a backwards-compatibility mode for applications with non-fixed headers and footers.\n */\n disableBodyScroll?: boolean;\n\n /**\n * State of the navigation drawer.\n */\n navigationOpen?: boolean;\n\n /**\n * Navigation drawer width in pixels.\n */\n navigationWidth?: number;\n\n /**\n * If `true`, the navigation drawer is not displayed at all.\n */\n navigationHide?: boolean;\n\n /**\n * State of the tools drawer.\n */\n toolsOpen?: boolean;\n\n /**\n * If `true`, the tools drawer is not displayed at all.\n */\n toolsHide?: boolean;\n\n /**\n * Tools drawer width in pixels.\n */\n toolsWidth?: number;\n\n /**\n * Maximum main content panel width in pixels.\n *\n * If set to `Number.MAX_VALUE`, the main content panel will occupy the full available width.\n */\n maxContentWidth?: number;\n\n /**\n * Minimum main content panel width in pixels.\n */\n minContentWidth?: number;\n\n /**\n * If true, the notification slot is rendered above the scrollable\n * content area so it is always visible.\n *\n * Note that sticky notifications are not supported in Internet Explorer.\n */\n stickyNotifications?: boolean;\n\n /**\n * CSS selector for the application header.\n */\n headerSelector?: string;\n\n /**\n * CSS selector for the application footer.\n */\n footerSelector?: string;\n\n /**\n * Aria labels for the drawer operating buttons. Use this property to ensure accessibility.\n *\n * * `navigation` (string) - Label for the landmark that wraps the navigation drawer.\n * * `navigationClose` (string) - Label for the button that closes the navigation drawer.\n * * `navigationToggle` (string) - Label for the button that opens the navigation drawer.\n * * `notification` (string) - Label for the region that contains notification messages.\n * * `tools` (string) - Label for the landmark that wraps the tools drawer.\n * * `toolsClose` (string) - Label for the button that closes the tools drawer.\n * * `toolsToggle` (string) - Label for the button that opens the tools drawer.\n *\n * Example:\n * ```\n * {\n * navigation: \"Navigation drawer\",\n * navigationClose: \"Close navigation drawer\",\n * navigationToggle: \"Open navigation drawer\",\n * notifications: \"Notifications\",\n * tools: \"Help panel\",\n * toolsClose: \"Close help panel\",\n * toolsToggle: \"Open help panel\"\n * }\n * ```\n */\n ariaLabels?: AppLayoutProps.Labels;\n\n /**\n * Navigation drawer.\n */\n navigation?: React.ReactNode;\n\n /**\n * Top area of the page content.\n * **Deprecated**, replaced by the `header` slot of the [content layout](/components/content-layout/) component.\n * @visualrefresh\n */\n contentHeader?: React.ReactNode;\n\n /**\n * Disables overlap between `contentHeader` and `content` slots.\n * **Deprecated**, replaced by the `disableOverlap` property of the [content layout](/components/content-layout/) component.\n * @visualrefresh\n */\n disableContentHeaderOverlap?: boolean;\n\n /**\n * Main content.\n */\n content?: React.ReactNode;\n\n /**\n * Tools drawer.\n */\n tools?: React.ReactNode;\n\n /**\n * Displayed on top of the main content in the scrollable area.\n *\n * Conceived to contain notifications (flash messages).\n */\n notifications?: React.ReactNode;\n\n /**\n * Use this slot to add the [breadcrumb group component](/components/breadcrumb-group/) to the app layout.\n */\n breadcrumbs?: React.ReactNode;\n\n /**\n * Fired when the navigation drawer is toggled.\n */\n onNavigationChange?: NonCancelableEventHandler<AppLayoutProps.ChangeDetail>;\n\n /**\n * Fired when the tools drawer is toggled.\n */\n onToolsChange?: NonCancelableEventHandler<AppLayoutProps.ChangeDetail>;\n /**\n * Use this slot to add the [split panel component](/components/split-panel/) to the app layout.\n */\n splitPanel?: React.ReactNode;\n\n /**\n * The size of the split panel in pixels.\n */\n splitPanelSize?: number;\n\n /**\n * State of the split panel.\n */\n splitPanelOpen?: boolean;\n /**\n * Controls the split panel preferences.\n *\n * By default, the preference is `{ position: 'bottom' }`\n */\n splitPanelPreferences?: AppLayoutProps.SplitPanelPreferences;\n /**\n * Fired when the split panel is resized.\n */\n onSplitPanelResize?: NonCancelableEventHandler<AppLayoutProps.SplitPanelResizeDetail>;\n /**\n * Fired when the split panel is toggled.\n */\n onSplitPanelToggle?: NonCancelableEventHandler<AppLayoutProps.ChangeDetail>;\n /**\n * Fired when the split panel preferences change.\n */\n onSplitPanelPreferencesChange?: NonCancelableEventHandler<AppLayoutProps.SplitPanelPreferences>;\n}\n\nexport namespace AppLayoutProps {\n export type ContentType = 'default' | 'form' | 'table' | 'cards' | 'wizard';\n\n export interface Ref {\n /**\n * Manually closes the navigation drawer if it is necessary for the current\n * viewport size.\n */\n closeNavigationIfNecessary(): void;\n\n /**\n * Opens the tools panel if it is not already open. Note that it is preferable\n * to control the state by listening to `toolsChange` and providing `toolsOpen`.\n */\n openTools(): void;\n }\n\n export interface Labels {\n notifications?: string;\n\n navigation?: string;\n navigationToggle?: string;\n navigationClose?: string;\n\n tools?: string;\n toolsToggle?: string;\n toolsClose?: string;\n }\n\n export interface ChangeDetail {\n open: boolean;\n }\n\n export interface SplitPanelResizeDetail {\n size: number;\n }\n\n export interface SplitPanelPreferences {\n position: 'side' | 'bottom';\n }\n // Duplicated the positions because using this definition in SplitPanelPreferences would display\n // 'AppLayoutProps.SplitPanelPosition' on the API docs instead of the string values.\n export type SplitPanelPosition = 'side' | 'bottom';\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/app-layout/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 { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface AppLayoutProps extends BaseComponentProps {\n /**\n * Determines the default behavior of the component based on some predefined page layouts.\n * Individual properties will always take precedence over the default coming from the content type.\n */\n contentType?: AppLayoutProps.ContentType;\n\n /**\n * If `true`, disables outer paddings for the content slot.\n */\n disableContentPaddings?: boolean;\n\n /**\n * Activates a backwards-compatibility mode for applications with non-fixed headers and footers.\n */\n disableBodyScroll?: boolean;\n\n /**\n * State of the navigation drawer.\n */\n navigationOpen?: boolean;\n\n /**\n * Navigation drawer width in pixels.\n */\n navigationWidth?: number;\n\n /**\n * If `true`, the navigation drawer is not displayed at all.\n */\n navigationHide?: boolean;\n\n /**\n * State of the tools drawer.\n */\n toolsOpen?: boolean;\n\n /**\n * If `true`, the tools drawer is not displayed at all.\n */\n toolsHide?: boolean;\n\n /**\n * Tools drawer width in pixels.\n */\n toolsWidth?: number;\n\n /**\n * Maximum main content panel width in pixels.\n *\n * If set to `Number.MAX_VALUE`, the main content panel will occupy the full available width.\n */\n maxContentWidth?: number;\n\n /**\n * Minimum main content panel width in pixels.\n */\n minContentWidth?: number;\n\n /**\n * If true, the notification slot is rendered above the scrollable\n * content area so it is always visible.\n *\n * Note that sticky notifications are not supported in Internet Explorer.\n */\n stickyNotifications?: boolean;\n\n /**\n * CSS selector for the application header.\n */\n headerSelector?: string;\n\n /**\n * CSS selector for the application footer.\n */\n footerSelector?: string;\n\n /**\n * Aria labels for the drawer operating buttons. Use this property to ensure accessibility.\n *\n * * `navigation` (string) - Label for the landmark that wraps the navigation drawer.\n * * `navigationClose` (string) - Label for the button that closes the navigation drawer.\n * * `navigationToggle` (string) - Label for the button that opens the navigation drawer.\n * * `notification` (string) - Label for the region that contains notification messages.\n * * `tools` (string) - Label for the landmark that wraps the tools drawer.\n * * `toolsClose` (string) - Label for the button that closes the tools drawer.\n * * `toolsToggle` (string) - Label for the button that opens the tools drawer.\n *\n * Example:\n * ```\n * {\n * navigation: \"Navigation drawer\",\n * navigationClose: \"Close navigation drawer\",\n * navigationToggle: \"Open navigation drawer\",\n * notifications: \"Notifications\",\n * tools: \"Help panel\",\n * toolsClose: \"Close help panel\",\n * toolsToggle: \"Open help panel\"\n * }\n * ```\n */\n ariaLabels?: AppLayoutProps.Labels;\n\n /**\n * Navigation drawer.\n */\n navigation?: React.ReactNode;\n\n /**\n * Top area of the page content.\n * **Deprecated**, replaced by the `header` slot of the [content layout](/components/content-layout/) component.\n * @visualrefresh\n */\n contentHeader?: React.ReactNode;\n\n /**\n * Disables overlap between `contentHeader` and `content` slots.\n * **Deprecated**, replaced by the `disableOverlap` property of the [content layout](/components/content-layout/) component.\n * @visualrefresh\n */\n disableContentHeaderOverlap?: boolean;\n\n /**\n * Main content.\n */\n content?: React.ReactNode;\n\n /**\n * Tools drawer.\n */\n tools?: React.ReactNode;\n\n /**\n * Displayed on top of the main content in the scrollable area.\n *\n * Conceived to contain notifications (flash messages).\n */\n notifications?: React.ReactNode;\n\n /**\n * Use this slot to add the [breadcrumb group component](/components/breadcrumb-group/) to the app layout.\n */\n breadcrumbs?: React.ReactNode;\n\n /**\n * Fired when the navigation drawer is toggled.\n */\n onNavigationChange?: NonCancelableEventHandler<AppLayoutProps.ChangeDetail>;\n\n /**\n * Fired when the tools drawer is toggled.\n */\n onToolsChange?: NonCancelableEventHandler<AppLayoutProps.ChangeDetail>;\n /**\n * Use this slot to add the [split panel component](/components/split-panel/) to the app layout.\n */\n splitPanel?: React.ReactNode;\n\n /**\n * The size of the split panel in pixels.\n */\n splitPanelSize?: number;\n\n /**\n * State of the split panel.\n */\n splitPanelOpen?: boolean;\n /**\n * Controls the split panel preferences.\n *\n * By default, the preference is `{ position: 'bottom' }`\n */\n splitPanelPreferences?: AppLayoutProps.SplitPanelPreferences;\n /**\n * Fired when the split panel is resized.\n */\n onSplitPanelResize?: NonCancelableEventHandler<AppLayoutProps.SplitPanelResizeDetail>;\n /**\n * Fired when the split panel is toggled.\n */\n onSplitPanelToggle?: NonCancelableEventHandler<AppLayoutProps.ChangeDetail>;\n /**\n * Fired when the split panel preferences change.\n */\n onSplitPanelPreferencesChange?: NonCancelableEventHandler<AppLayoutProps.SplitPanelPreferences>;\n}\n\nexport namespace AppLayoutProps {\n export type ContentType = 'default' | 'form' | 'table' | 'cards' | 'wizard';\n\n export interface Ref {\n /**\n * Manually closes the navigation drawer if it is necessary for the current\n * viewport size.\n */\n closeNavigationIfNecessary(): void;\n\n /**\n * Opens the tools panel if it is not already open. Note that it is preferable\n * to control the state by listening to `toolsChange` and providing `toolsOpen`.\n */\n openTools(): void;\n\n /**\n * Focuses the tools panel if it is open. Use this to focus the tools panel\n * after changing the content, for example when clicking on an 'info' link while\n * the panel is already open.\n */\n focusToolsClose(): void;\n }\n\n export interface Labels {\n notifications?: string;\n\n navigation?: string;\n navigationToggle?: string;\n navigationClose?: string;\n\n tools?: string;\n toolsToggle?: string;\n toolsClose?: string;\n }\n\n export interface ChangeDetail {\n open: boolean;\n }\n\n export interface SplitPanelResizeDetail {\n size: number;\n }\n\n export interface SplitPanelPreferences {\n position: 'side' | 'bottom';\n }\n // Duplicated the positions because using this definition in SplitPanelPreferences would display\n // 'AppLayoutProps.SplitPanelPosition' on the API docs instead of the string values.\n export type SplitPanelPosition = 'side' | 'bottom';\n}\n"]}
@@ -8,6 +8,6 @@ export var Notifications = React.forwardRef(function (_a, ref) {
8
8
  var _b, _c;
9
9
  var sticky = _a.sticky, props = __rest(_a, ["sticky"]);
10
10
  return sticky ? (React.createElement("div", { ref: ref, className: styles['notifications-sticky'], style: { top: props.topOffset } },
11
- React.createElement("div", { className: clsx(props.testUtilsClassName), role: "region", "aria-label": (_b = props.labels) === null || _b === void 0 ? void 0 : _b.notifications }, props.children))) : (React.createElement("div", { ref: ref, className: clsx(props.testUtilsClassName), role: "region", "aria-label": (_c = props.labels) === null || _c === void 0 ? void 0 : _c.notifications }, props.children));
11
+ React.createElement("div", { role: "region", className: clsx(props.testUtilsClassName), "aria-label": (_b = props.labels) === null || _b === void 0 ? void 0 : _b.notifications }, props.children))) : (React.createElement("div", { role: "region", ref: ref, className: clsx(props.testUtilsClassName), "aria-label": (_c = props.labels) === null || _c === void 0 ? void 0 : _c.notifications }, props.children));
12
12
  });
13
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app-layout/notifications/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAiBrC,MAAM,CAAC,IAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CAC3C,UAAC,EAA8C,EAAE,GAA8B;;IAA5E,IAAA,MAAM,YAAA,EAAK,KAAK,cAAlB,UAAoB,CAAF;IACjB,OAAO,MAAM,CAAC,CAAC,CAAC,CACd,6BAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,sBAAsB,CAAC,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,SAAS,EAAE;QACvF,6BAAK,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE,IAAI,EAAC,QAAQ,gBAAa,MAAA,KAAK,CAAC,MAAM,0CAAE,aAAa,IAClG,KAAK,CAAC,QAAQ,CACX,CACF,CACP,CAAC,CAAC,CAAC,CACF,6BAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE,IAAI,EAAC,QAAQ,gBAAa,MAAA,KAAK,CAAC,MAAM,0CAAE,aAAa,IAC5G,KAAK,CAAC,QAAQ,CACX,CACP,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport { AppLayoutProps } from '../interfaces';\n\ninterface NotificationsProps {\n testUtilsClassName: string;\n children?: React.ReactNode;\n labels: AppLayoutProps.Labels | undefined;\n topOffset: number | undefined;\n isMobile: boolean;\n}\ninterface NotificationWrapperProps extends NotificationsProps {\n sticky: boolean | undefined;\n navigationPadding: boolean;\n toolsPadding: boolean;\n contentWidthStyles?: React.CSSProperties;\n}\n\nexport const Notifications = React.forwardRef(\n ({ sticky, ...props }: NotificationWrapperProps, ref: React.Ref<HTMLDivElement>) => {\n return sticky ? (\n <div ref={ref} className={styles['notifications-sticky']} style={{ top: props.topOffset }}>\n <div className={clsx(props.testUtilsClassName)} role=\"region\" aria-label={props.labels?.notifications}>\n {props.children}\n </div>\n </div>\n ) : (\n <div ref={ref} className={clsx(props.testUtilsClassName)} role=\"region\" aria-label={props.labels?.notifications}>\n {props.children}\n </div>\n );\n }\n);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app-layout/notifications/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAiBrC,MAAM,CAAC,IAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CAC3C,UAAC,EAA8C,EAAE,GAA8B;;IAA5E,IAAA,MAAM,YAAA,EAAK,KAAK,cAAlB,UAAoB,CAAF;IACjB,OAAO,MAAM,CAAC,CAAC,CAAC,CACd,6BAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,sBAAsB,CAAC,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,SAAS,EAAE;QACvF,6BAAK,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,gBAAc,MAAA,KAAK,CAAC,MAAM,0CAAE,aAAa,IAClG,KAAK,CAAC,QAAQ,CACX,CACF,CACP,CAAC,CAAC,CAAC,CACF,6BAAK,IAAI,EAAC,QAAQ,EAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,gBAAc,MAAA,KAAK,CAAC,MAAM,0CAAE,aAAa,IAC5G,KAAK,CAAC,QAAQ,CACX,CACP,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport { AppLayoutProps } from '../interfaces';\n\ninterface NotificationsProps {\n testUtilsClassName: string;\n children?: React.ReactNode;\n labels: AppLayoutProps.Labels | undefined;\n topOffset: number | undefined;\n isMobile: boolean;\n}\ninterface NotificationWrapperProps extends NotificationsProps {\n sticky: boolean | undefined;\n navigationPadding: boolean;\n toolsPadding: boolean;\n contentWidthStyles?: React.CSSProperties;\n}\n\nexport const Notifications = React.forwardRef(\n ({ sticky, ...props }: NotificationWrapperProps, ref: React.Ref<HTMLDivElement>) => {\n return sticky ? (\n <div ref={ref} className={styles['notifications-sticky']} style={{ top: props.topOffset }}>\n <div role=\"region\" className={clsx(props.testUtilsClassName)} aria-label={props.labels?.notifications}>\n {props.children}\n </div>\n </div>\n ) : (\n <div role=\"region\" ref={ref} className={clsx(props.testUtilsClassName)} aria-label={props.labels?.notifications}>\n {props.children}\n </div>\n );\n }\n);\n"]}
@@ -25,7 +25,8 @@ interface ToolsAndSplitPanelProps {
25
25
  isMotionEnabled: boolean;
26
26
  onToolsToggle: DesktopDrawerProps['onToggle'];
27
27
  toggleRefs: DesktopDrawerProps['toggleRefs'];
28
+ onLoseToolsFocus: (event: React.FocusEvent) => void;
28
29
  }
29
- export declare function ToolsAndSplitPanel({ ariaLabels, drawerWidth, footerHeight, headerHeight, isHidden, isMobile, onToolsToggle, panelHeightStyle, splitPanel, splitPanelContext, toggleRefs, tools, toolsHide, toolsOpen, toolsWidth, splitPanelOpen, }: ToolsAndSplitPanelProps): JSX.Element;
30
+ export declare function ToolsAndSplitPanel({ ariaLabels, drawerWidth, footerHeight, headerHeight, isHidden, isMobile, onToolsToggle, panelHeightStyle, splitPanel, splitPanelContext, toggleRefs, onLoseToolsFocus, tools, toolsHide, toolsOpen, toolsWidth, splitPanelOpen, }: ToolsAndSplitPanelProps): JSX.Element;
30
31
  export {};
31
32
  //# sourceMappingURL=tools-and-split-panel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tools-and-split-panel.d.ts","sourceRoot":"","sources":["../../../src/app-layout/tools-and-split-panel.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAU,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,gBAAgB,MAAM,4BAA4B,CAAC;AAG1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAEjF,UAAU,uBAAuB;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAEzC,cAAc,EAAE,OAAO,CAAC;IAExB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAE1B,YAAY,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAC9C,YAAY,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC;IACjD,gBAAgB,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,kBAAkB,CAAC,CAAC;IAC1E,kBAAkB,EAAE,UAAU,CAAC,OAAO,gBAAgB,C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ACnB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAE1B,YAAY,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAC9C,YAAY,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC;IACjD,gBAAgB,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,kBAAkB,CAAC,CAAC;IAC1E,kBAAkB,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,oBAAoB,CAAC,CAAC;IAE9E,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,iBAAiB,EAAE,sBAAsB,CAAC;IAE1C,UAAU,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;IAEzC,sBAAsB,EAAE,cAAc,CAAC,wBAAwB,CAAC,CAAC;IACjE,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;IAEzB,aAAa,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAE9C,UAAU,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAE7C,gBAAgB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;CACrD;AAED,wBAAgB,kBAAkB,CAAC,EACjC,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,KAAK,EACL,SAAS,EACT,SAAS,EACT,UAAU,EACV,cAAc,GACf,EAAE,uBAAuB,eA+CzB"}
@@ -9,7 +9,7 @@ import styles from './styles.css.js';
9
9
  import testutilStyles from './test-classes/styles.css.js';
10
10
  export function ToolsAndSplitPanel(_a) {
11
11
  var _b;
12
- var ariaLabels = _a.ariaLabels, drawerWidth = _a.drawerWidth, footerHeight = _a.footerHeight, headerHeight = _a.headerHeight, isHidden = _a.isHidden, isMobile = _a.isMobile, onToolsToggle = _a.onToolsToggle, panelHeightStyle = _a.panelHeightStyle, splitPanel = _a.splitPanel, splitPanelContext = _a.splitPanelContext, toggleRefs = _a.toggleRefs, tools = _a.tools, toolsHide = _a.toolsHide, toolsOpen = _a.toolsOpen, toolsWidth = _a.toolsWidth, splitPanelOpen = _a.splitPanelOpen;
12
+ var ariaLabels = _a.ariaLabels, drawerWidth = _a.drawerWidth, footerHeight = _a.footerHeight, headerHeight = _a.headerHeight, isHidden = _a.isHidden, isMobile = _a.isMobile, onToolsToggle = _a.onToolsToggle, panelHeightStyle = _a.panelHeightStyle, splitPanel = _a.splitPanel, splitPanelContext = _a.splitPanelContext, toggleRefs = _a.toggleRefs, onLoseToolsFocus = _a.onLoseToolsFocus, tools = _a.tools, toolsHide = _a.toolsHide, toolsOpen = _a.toolsOpen, toolsWidth = _a.toolsWidth, splitPanelOpen = _a.splitPanelOpen;
13
13
  var splitPanelVisible = splitPanelOpen && Boolean(splitPanel);
14
14
  return (React.createElement(React.Fragment, null,
15
15
  React.createElement("div", { style: {
@@ -20,6 +20,6 @@ export function ToolsAndSplitPanel(_a) {
20
20
  _b[styles.open] = toolsOpen,
21
21
  _b)), style: __assign({}, (isMobile ? { top: headerHeight, bottom: footerHeight } : panelHeightStyle)) },
22
22
  splitPanel && React.createElement(SplitPanelWrapper, { context: splitPanelContext }, splitPanel),
23
- !toolsHide && (React.createElement(Drawer, { type: "tools", isMobile: isMobile, width: toolsWidth, isOpen: toolsOpen, onToggle: onToolsToggle, toggleRefs: toggleRefs, isHidden: isHidden, externalizedToggle: Boolean(splitPanel), contentClassName: clsx(styles.tools, testutilStyles.tools), closeClassName: clsx(styles['tools-close'], testutilStyles['tools-close']), toggleClassName: clsx(styles['tools-toggle'], testutilStyles['tools-toggle']), topOffset: headerHeight, bottomOffset: footerHeight, ariaLabels: ariaLabels, extendRight: 0, hasDividerWithSplitPanel: splitPanelVisible }, tools))))));
23
+ !toolsHide && (React.createElement(Drawer, { type: "tools", isMobile: isMobile, width: toolsWidth, isOpen: toolsOpen, onToggle: onToolsToggle, toggleRefs: toggleRefs, onLoseFocus: onLoseToolsFocus, isHidden: isHidden, externalizedToggle: Boolean(splitPanel), contentClassName: clsx(styles.tools, testutilStyles.tools), closeClassName: clsx(styles['tools-close'], testutilStyles['tools-close']), toggleClassName: clsx(styles['tools-toggle'], testutilStyles['tools-toggle']), topOffset: headerHeight, bottomOffset: footerHeight, ariaLabels: ariaLabels, extendRight: 0, hasDividerWithSplitPanel: splitPanelVisible }, tools))))));
24
24
  }
25
25
  //# sourceMappingURL=tools-and-split-panel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tools-and-split-panel.js","sourceRoot":"","sources":["../../../src/app-layout/tools-and-split-panel.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAsB,MAAM,EAAE,MAAM,UAAU,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAmC1D,MAAM,UAAU,kBAAkB,CAAC,EAiBT;;QAhBxB,UAAU,gBAAA,EACV,WAAW,iBAAA,EACX,YAAY,kBAAA,EACZ,YAAY,kBAAA,EACZ,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,aAAa,mBAAA,EACb,gBAAgB,sBAAA,EAChB,UAAU,gBAAA,EACV,iBAAiB,uBAAA,EACjB,UAAU,gBAAA,EACV,KAAK,WAAA,EACL,SAAS,eAAA,EACT,SAAS,eAAA,EACT,UAAU,gBAAA,EACV,cAAc,oBAAA;IAEd,IAAM,iBAAiB,GAAG,cAAc,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;IAEhE,OA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 'clsx';\nimport React from 'react';\nimport { DesktopDrawerProps, Drawer } from './drawer';\nimport { AppLayoutProps } from './interfaces';\nimport { SplitPanelWrapper } from './split-panel-wrapper';\nimport useContentHeight from './utils/use-content-height';\nimport styles from './styles.css.js';\nimport testutilStyles from './test-classes/styles.css.js';\nimport { SplitPanelContextProps } from '../internal/context/split-panel-context';\n\ninterface ToolsAndSplitPanelProps {\n toolsHide: boolean;\n toolsOpen: boolean;\n isHidden: DesktopDrawerProps['isHidden'];\n\n splitPanelOpen: boolean;\n\n drawerWidth: number;\n toolsWidth: number;\n splitPanelReportedSize: number;\n closedDrawerWidth: number;\n\n headerHeight: DesktopDrawerProps['topOffset'];\n footerHeight: DesktopDrawerProps['bottomOffset'];\n panelHeightStyle: ReturnType<typeof useContentHeight>['panelHeightStyle'];\n contentHeightStyle: ReturnType<typeof useContentHeight>['contentHeightStyle'];\n\n tools: React.ReactNode;\n splitPanel?: React.ReactNode;\n splitPanelContext: SplitPanelContextProps;\n\n ariaLabels: AppLayoutProps['ariaLabels'];\n\n disableContentPaddings: AppLayoutProps['disableContentPaddings'];\n isMobile: boolean;\n isMotionEnabled: boolean;\n\n onToolsToggle: DesktopDrawerProps['onToggle'];\n\n toggleRefs: DesktopDrawerProps['toggleRefs'];\n}\n\nexport function ToolsAndSplitPanel({\n ariaLabels,\n drawerWidth,\n footerHeight,\n headerHeight,\n isHidden,\n isMobile,\n onToolsToggle,\n panelHeightStyle,\n splitPanel,\n splitPanelContext,\n toggleRefs,\n tools,\n toolsHide,\n toolsOpen,\n toolsWidth,\n splitPanelOpen,\n}: ToolsAndSplitPanelProps) {\n const splitPanelVisible = splitPanelOpen && Boolean(splitPanel);\n\n return (\n <>\n <div\n style={{\n width: drawerWidth,\n }}\n >\n <div\n className={clsx(styles['panel-wrapper-outer'], {\n [styles.mobile]: isMobile,\n [styles.open]: toolsOpen,\n })}\n style={{\n ...(isMobile ? { top: headerHeight, bottom: footerHeight } : panelHeightStyle),\n }}\n >\n {splitPanel && <SplitPanelWrapper context={splitPanelContext}>{splitPanel}</SplitPanelWrapper>}\n {!toolsHide && (\n <Drawer\n type=\"tools\"\n isMobile={isMobile}\n width={toolsWidth}\n isOpen={toolsOpen}\n onToggle={onToolsToggle}\n toggleRefs={toggleRefs}\n isHidden={isHidden}\n externalizedToggle={Boolean(splitPanel)}\n contentClassName={clsx(styles.tools, testutilStyles.tools)}\n closeClassName={clsx(styles['tools-close'], testutilStyles['tools-close'])}\n toggleClassName={clsx(styles['tools-toggle'], testutilStyles['tools-toggle'])}\n topOffset={headerHeight}\n bottomOffset={footerHeight}\n ariaLabels={ariaLabels}\n extendRight={0}\n hasDividerWithSplitPanel={splitPanelVisible}\n >\n {tools}\n </Drawer>\n )}\n </div>\n </div>\n </>\n );\n}\n"]}
1
+ {"version":3,"file":"tools-and-split-panel.js","sourceRoot":"","sources":["../../../src/app-layout/tools-and-split-panel.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAsB,MAAM,EAAE,MAAM,UAAU,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAqC1D,MAAM,UAAU,kBAAkB,CAAC,EAkBT;;QAjBxB,UAAU,gBAAA,EACV,WAAW,iBAAA,EACX,YAAY,kBAAA,EACZ,YAAY,kBAAA,EACZ,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,aAAa,mBAAA,EACb,gBAAgB,sBAAA,EAChB,UAAU,gBAAA,EACV,iBAAiB,uBAAA,EACjB,UAAU,gBAAA,EACV,gBAAgB,sBAAA,EAChB,KAAK,WAAA,EACL,SAAS,eAAA,EACT,SAAS,eAAA,EACT,UAAU,gBAAA,EACV,cAAc,oBAAA;IAEd,IA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;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 from 'react';\nimport { DesktopDrawerProps, Drawer } from './drawer';\nimport { AppLayoutProps } from './interfaces';\nimport { SplitPanelWrapper } from './split-panel-wrapper';\nimport useContentHeight from './utils/use-content-height';\nimport styles from './styles.css.js';\nimport testutilStyles from './test-classes/styles.css.js';\nimport { SplitPanelContextProps } from '../internal/context/split-panel-context';\n\ninterface ToolsAndSplitPanelProps {\n toolsHide: boolean;\n toolsOpen: boolean;\n isHidden: DesktopDrawerProps['isHidden'];\n\n splitPanelOpen: boolean;\n\n drawerWidth: number;\n toolsWidth: number;\n splitPanelReportedSize: number;\n closedDrawerWidth: number;\n\n headerHeight: DesktopDrawerProps['topOffset'];\n footerHeight: DesktopDrawerProps['bottomOffset'];\n panelHeightStyle: ReturnType<typeof useContentHeight>['panelHeightStyle'];\n contentHeightStyle: ReturnType<typeof useContentHeight>['contentHeightStyle'];\n\n tools: React.ReactNode;\n splitPanel?: React.ReactNode;\n splitPanelContext: SplitPanelContextProps;\n\n ariaLabels: AppLayoutProps['ariaLabels'];\n\n disableContentPaddings: AppLayoutProps['disableContentPaddings'];\n isMobile: boolean;\n isMotionEnabled: boolean;\n\n onToolsToggle: DesktopDrawerProps['onToggle'];\n\n toggleRefs: DesktopDrawerProps['toggleRefs'];\n\n onLoseToolsFocus: (event: React.FocusEvent) => void;\n}\n\nexport function ToolsAndSplitPanel({\n ariaLabels,\n drawerWidth,\n footerHeight,\n headerHeight,\n isHidden,\n isMobile,\n onToolsToggle,\n panelHeightStyle,\n splitPanel,\n splitPanelContext,\n toggleRefs,\n onLoseToolsFocus,\n tools,\n toolsHide,\n toolsOpen,\n toolsWidth,\n splitPanelOpen,\n}: ToolsAndSplitPanelProps) {\n const splitPanelVisible = splitPanelOpen && Boolean(splitPanel);\n\n return (\n <>\n <div\n style={{\n width: drawerWidth,\n }}\n >\n <div\n className={clsx(styles['panel-wrapper-outer'], {\n [styles.mobile]: isMobile,\n [styles.open]: toolsOpen,\n })}\n style={{\n ...(isMobile ? { top: headerHeight, bottom: footerHeight } : panelHeightStyle),\n }}\n >\n {splitPanel && <SplitPanelWrapper context={splitPanelContext}>{splitPanel}</SplitPanelWrapper>}\n {!toolsHide && (\n <Drawer\n type=\"tools\"\n isMobile={isMobile}\n width={toolsWidth}\n isOpen={toolsOpen}\n onToggle={onToolsToggle}\n toggleRefs={toggleRefs}\n onLoseFocus={onLoseToolsFocus}\n isHidden={isHidden}\n externalizedToggle={Boolean(splitPanel)}\n contentClassName={clsx(styles.tools, testutilStyles.tools)}\n closeClassName={clsx(styles['tools-close'], testutilStyles['tools-close'])}\n toggleClassName={clsx(styles['tools-toggle'], testutilStyles['tools-toggle'])}\n topOffset={headerHeight}\n bottomOffset={footerHeight}\n ariaLabels={ariaLabels}\n extendRight={0}\n hasDividerWithSplitPanel={splitPanelVisible}\n >\n {tools}\n </Drawer>\n )}\n </div>\n </div>\n </>\n );\n}\n"]}
@@ -1,6 +1,12 @@
1
+ import { RefObject } from 'react';
1
2
  import { ButtonProps } from '../../button/interfaces';
2
- export declare function useFocusControl(isOpen?: boolean): {
3
- toggle: import("react").RefObject<ButtonProps.Ref>;
4
- close: import("react").RefObject<ButtonProps.Ref>;
5
- };
3
+ export interface FocusControlState {
4
+ refs: {
5
+ toggle: RefObject<ButtonProps.Ref>;
6
+ close: RefObject<ButtonProps.Ref>;
7
+ };
8
+ setFocus: () => void;
9
+ loseFocus: () => void;
10
+ }
11
+ export declare function useFocusControl(isOpen: boolean, restoreFocus?: boolean): FocusControlState;
6
12
  //# sourceMappingURL=use-focus-control.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-focus-control.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-focus-control.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,wBAAgB,eAAe,CAAC,MAAM,CAAC,EAAE,OAAO;;;EAa/C"}
1
+ {"version":3,"file":"use-focus-control.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-focus-control.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAwC,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE;QACJ,MAAM,EAAE,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACnC,KAAK,EAAE,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;KACnC,CAAC;IACF,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,UAAQ,GAAG,iBAAiB,CAkCxF"}
@@ -1,18 +1,39 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import { useLayoutEffect, useRef } from 'react';
4
- export function useFocusControl(isOpen) {
5
- var toggleRef = useRef(null);
6
- var closeRef = useRef(null);
7
- useLayoutEffect(function () {
3
+ import { useCallback, useLayoutEffect, useRef } from 'react';
4
+ export function useFocusControl(isOpen, restoreFocus) {
5
+ if (restoreFocus === void 0) { restoreFocus = false; }
6
+ var refs = {
7
+ toggle: useRef(null),
8
+ close: useRef(null)
9
+ };
10
+ var previousFocusedElement = useRef();
11
+ var setFocus = useCallback(function () {
8
12
  var _a, _b;
13
+ // due to mounting/remounting, this hook gets called multiple times for a single change,
14
+ // so we ignore any calls where the refs are undefined
15
+ if (!(refs.toggle.current || refs.close.current)) {
16
+ return;
17
+ }
9
18
  if (isOpen) {
10
- (_a = closeRef.current) === null || _a === void 0 ? void 0 : _a.focus();
19
+ previousFocusedElement.current = document.activeElement;
20
+ (_a = refs.close.current) === null || _a === void 0 ? void 0 : _a.focus();
11
21
  }
12
22
  else {
13
- (_b = toggleRef.current) === null || _b === void 0 ? void 0 : _b.focus();
23
+ if (restoreFocus && previousFocusedElement.current && document.contains(previousFocusedElement.current)) {
24
+ previousFocusedElement.current.focus();
25
+ previousFocusedElement.current = undefined;
26
+ }
27
+ else {
28
+ (_b = refs.toggle.current) === null || _b === void 0 ? void 0 : _b.focus();
29
+ }
14
30
  }
15
- }, [isOpen]);
16
- return { toggle: toggleRef, close: closeRef };
31
+ }, [isOpen, restoreFocus, refs.close, refs.toggle]);
32
+ var loseFocus = useCallback(function () {
33
+ previousFocusedElement.current = undefined;
34
+ }, []);
35
+ // eslint-disable-next-line react-hooks/exhaustive-deps
36
+ useLayoutEffect(setFocus, [isOpen, restoreFocus]);
37
+ return { refs: refs, setFocus: setFocus, loseFocus: loseFocus };
17
38
  }
18
39
  //# sourceMappingURL=use-focus-control.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-focus-control.js","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-focus-control.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGhD,MAAM,UAAU,eAAe,CAAC,MAAgB;IAC9C,IAAM,SAAS,GAAG,MAAM,CAAkB,IAAI,CAAC,CAAC;IAChD,IAAM,QAAQ,GAAG,MAAM,CAAkB,IAAI,CAAC,CAAC;IAE/C,eAAe,CAAC;;QACd,IAAI,MAAM,EAAE;YACV,MAAA,QAAQ,CAAC,OAAO,0CAAE,KAAK,EAAE,CAAC;SAC3B;aAAM;YACL,MAAA,SAAS,CAAC,OAAO,0CAAE,KAAK,EAAE,CAAC;SAC5B;IACH,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAChD,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useLayoutEffect, useRef } from 'react';\nimport { ButtonProps } from '../../button/interfaces';\n\nexport function useFocusControl(isOpen?: boolean) {\n const toggleRef = useRef<ButtonProps.Ref>(null);\n const closeRef = useRef<ButtonProps.Ref>(null);\n\n useLayoutEffect(() => {\n if (isOpen) {\n closeRef.current?.focus();\n } else {\n toggleRef.current?.focus();\n }\n }, [isOpen]);\n\n return { toggle: toggleRef, close: closeRef };\n}\n"]}
1
+ {"version":3,"file":"use-focus-control.js","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-focus-control.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAa,WAAW,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAYxE,MAAM,UAAU,eAAe,CAAC,MAAe,EAAE,YAAoB;IAApB,6BAAA,EAAA,oBAAoB;IACnE,IAAM,IAAI,GAAG;QACX,MAAM,EAAE,MAAM,CAAkB,IAAI,CAAC;QACrC,KAAK,EAAE,MAAM,CAAkB,IAAI,CAAC;KACrC,CAAC;IACF,IAAM,sBAAsB,GAAG,MAAM,EAAe,CAAC;IAErD,IAAM,QAAQ,GAAG,WAAW,CAAC;;QAC3B,wFAAwF;QACxF,sDAAsD;QACtD,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;YAChD,OAAO;SACR;QACD,IAAI,MAAM,EAAE;YACV,sBAAsB,CAAC,OAAO,GAAG,QAAQ,CAAC,aAA4B,CAAC;YACvE,MAAA,IAAI,CAAC,KAAK,CAAC,OAAO,0CAAE,KAAK,EAAE,CAAC;SAC7B;aAAM;YACL,IAAI,YAAY,IAAI,sBAAsB,CAAC,OAAO,IAAI,QAAQ,CAAC,QAAQ,CAAC,sBAAsB,CAAC,OAAO,CAAC,EAAE;gBACvG,sBAAsB,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;gBACvC,sBAAsB,CAAC,OAAO,GAAG,SAAS,CAAC;aAC5C;iBAAM;gBACL,MAAA,IAAI,CAAC,MAAM,CAAC,OAAO,0CAAE,KAAK,EAAE,CAAC;aAC9B;SACF;IACH,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAEpD,IAAM,SAAS,GAAG,WAAW,CAAC;QAC5B,sBAAsB,CAAC,OAAO,GAAG,SAAS,CAAC;IAC7C,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,uDAAuD;IACvD,eAAe,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;IAElD,OAAO,EAAE,IAAI,MAAA,EAAE,QAAQ,UAAA,EAAE,SAAS,WAAA,EAAE,CAAC;AACvC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { RefObject, useCallback, useLayoutEffect, useRef } from 'react';\nimport { ButtonProps } from '../../button/interfaces';\n\nexport interface FocusControlState {\n refs: {\n toggle: RefObject<ButtonProps.Ref>;\n close: RefObject<ButtonProps.Ref>;\n };\n setFocus: () => void;\n loseFocus: () => void;\n}\n\nexport function useFocusControl(isOpen: boolean, restoreFocus = false): FocusControlState {\n const refs = {\n toggle: useRef<ButtonProps.Ref>(null),\n close: useRef<ButtonProps.Ref>(null),\n };\n const previousFocusedElement = useRef<HTMLElement>();\n\n const setFocus = useCallback(() => {\n // due to mounting/remounting, this hook gets called multiple times for a single change,\n // so we ignore any calls where the refs are undefined\n if (!(refs.toggle.current || refs.close.current)) {\n return;\n }\n if (isOpen) {\n previousFocusedElement.current = document.activeElement as HTMLElement;\n refs.close.current?.focus();\n } else {\n if (restoreFocus && previousFocusedElement.current && document.contains(previousFocusedElement.current)) {\n previousFocusedElement.current.focus();\n previousFocusedElement.current = undefined;\n } else {\n refs.toggle.current?.focus();\n }\n }\n }, [isOpen, restoreFocus, refs.close, refs.toggle]);\n\n const loseFocus = useCallback(() => {\n previousFocusedElement.current = undefined;\n }, []);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useLayoutEffect(setFocus, [isOpen, restoreFocus]);\n\n return { refs, setFocus, loseFocus };\n}\n"]}