@cloudscape-design/components 3.0.647 → 3.0.649

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 (152) hide show
  1. package/app-layout/drawer/index.js +2 -2
  2. package/app-layout/drawer/index.js.map +1 -1
  3. package/app-layout/mobile-toolbar/index.js +1 -1
  4. package/app-layout/mobile-toolbar/index.js.map +1 -1
  5. package/app-layout/utils/sticky-offsets.d.ts +1 -1
  6. package/app-layout/utils/sticky-offsets.d.ts.map +1 -1
  7. package/app-layout/utils/sticky-offsets.js +2 -2
  8. package/app-layout/utils/sticky-offsets.js.map +1 -1
  9. package/app-layout/visual-refresh/background.d.ts.map +1 -1
  10. package/app-layout/visual-refresh/background.js +2 -5
  11. package/app-layout/visual-refresh/background.js.map +1 -1
  12. package/app-layout/visual-refresh/breadcrumbs.d.ts.map +1 -1
  13. package/app-layout/visual-refresh/breadcrumbs.js +1 -2
  14. package/app-layout/visual-refresh/breadcrumbs.js.map +1 -1
  15. package/app-layout/visual-refresh/context.d.ts +0 -2
  16. package/app-layout/visual-refresh/context.d.ts.map +1 -1
  17. package/app-layout/visual-refresh/context.js +2 -7
  18. package/app-layout/visual-refresh/context.js.map +1 -1
  19. package/app-layout/visual-refresh/drawers.js +2 -2
  20. package/app-layout/visual-refresh/drawers.js.map +1 -1
  21. package/app-layout/visual-refresh/layout.d.ts.map +1 -1
  22. package/app-layout/visual-refresh/layout.js +1 -3
  23. package/app-layout/visual-refresh/layout.js.map +1 -1
  24. package/app-layout/visual-refresh/main.d.ts.map +1 -1
  25. package/app-layout/visual-refresh/main.js +2 -4
  26. package/app-layout/visual-refresh/main.js.map +1 -1
  27. package/app-layout/visual-refresh/navigation.js +2 -2
  28. package/app-layout/visual-refresh/navigation.js.map +1 -1
  29. package/app-layout/visual-refresh/notifications.d.ts.map +1 -1
  30. package/app-layout/visual-refresh/notifications.js +3 -1
  31. package/app-layout/visual-refresh/notifications.js.map +1 -1
  32. package/app-layout/visual-refresh/styles.css.js +82 -83
  33. package/app-layout/visual-refresh/styles.scoped.css +168 -190
  34. package/app-layout/visual-refresh/styles.selectors.js +82 -83
  35. package/app-layout/visual-refresh/tools.js +2 -2
  36. package/app-layout/visual-refresh/tools.js.map +1 -1
  37. package/app-layout/visual-refresh/trigger-button.js +1 -1
  38. package/app-layout/visual-refresh/trigger-button.js.map +1 -1
  39. package/app-layout/visual-refresh/use-background-overlap.d.ts +0 -6
  40. package/app-layout/visual-refresh/use-background-overlap.d.ts.map +1 -1
  41. package/app-layout/visual-refresh/use-background-overlap.js +0 -6
  42. package/app-layout/visual-refresh/use-background-overlap.js.map +1 -1
  43. package/button-dropdown/category-elements/category-element.js +1 -1
  44. package/button-dropdown/category-elements/category-element.js.map +1 -1
  45. package/button-dropdown/category-elements/mobile-expandable-category-element.js +1 -1
  46. package/button-dropdown/category-elements/mobile-expandable-category-element.js.map +1 -1
  47. package/button-dropdown/mobile-expandable-group/mobile-expandable-group.js +1 -1
  48. package/button-dropdown/mobile-expandable-group/mobile-expandable-group.js.map +1 -1
  49. package/container/internal.d.ts.map +1 -1
  50. package/container/internal.js +7 -25
  51. package/container/internal.js.map +1 -1
  52. package/container/styles.css.js +30 -29
  53. package/container/styles.scoped.css +60 -53
  54. package/container/styles.selectors.js +30 -29
  55. package/container/use-sticky-header.d.ts +3 -2
  56. package/container/use-sticky-header.d.ts.map +1 -1
  57. package/container/use-sticky-header.js +5 -3
  58. package/container/use-sticky-header.js.map +1 -1
  59. package/content-layout/internal.js +2 -2
  60. package/content-layout/internal.js.map +1 -1
  61. package/drawer/implementation.js +2 -2
  62. package/drawer/implementation.js.map +1 -1
  63. package/help-panel/implementation.js +2 -2
  64. package/help-panel/implementation.js.map +1 -1
  65. package/icon/icons.js +1 -1
  66. package/icon/interfaces.d.ts +1 -1
  67. package/icon/interfaces.d.ts.map +1 -1
  68. package/icon/interfaces.js.map +1 -1
  69. package/internal/analytics/index.d.ts +7 -1
  70. package/internal/analytics/index.d.ts.map +1 -1
  71. package/internal/analytics/index.js +10 -0
  72. package/internal/analytics/index.js.map +1 -1
  73. package/internal/analytics/interfaces.d.ts +12 -0
  74. package/internal/analytics/interfaces.d.ts.map +1 -1
  75. package/internal/analytics/interfaces.js.map +1 -1
  76. package/internal/base-component/index.d.ts +5 -3
  77. package/internal/base-component/index.d.ts.map +1 -1
  78. package/internal/base-component/index.js.map +1 -1
  79. package/internal/components/cartesian-chart/inline-start-labels.js +1 -1
  80. package/internal/components/cartesian-chart/inline-start-labels.js.map +1 -1
  81. package/internal/components/option/highlight-match.d.ts.map +1 -1
  82. package/internal/components/option/highlight-match.js +1 -2
  83. package/internal/components/option/highlight-match.js.map +1 -1
  84. package/internal/components/option/index.js +2 -2
  85. package/internal/components/option/index.js.map +1 -1
  86. package/internal/context/reset-contexts-for-modal.d.ts.map +1 -1
  87. package/internal/context/reset-contexts-for-modal.js +6 -8
  88. package/internal/context/reset-contexts-for-modal.js.map +1 -1
  89. package/internal/context/single-tab-stop-navigation-context.d.ts +16 -2
  90. package/internal/context/single-tab-stop-navigation-context.d.ts.map +1 -1
  91. package/internal/context/single-tab-stop-navigation-context.js +51 -1
  92. package/internal/context/single-tab-stop-navigation-context.js.map +1 -1
  93. package/internal/environment.js +1 -1
  94. package/internal/environment.json +1 -1
  95. package/internal/hooks/use-table-interaction-metrics/index.d.ts +10 -0
  96. package/internal/hooks/use-table-interaction-metrics/index.d.ts.map +1 -0
  97. package/internal/hooks/use-table-interaction-metrics/index.js +47 -0
  98. package/internal/hooks/use-table-interaction-metrics/index.js.map +1 -0
  99. package/internal/manifest.json +1 -1
  100. package/package.json +1 -1
  101. package/popover/index.d.ts +1 -1
  102. package/popover/index.d.ts.map +1 -1
  103. package/popover/index.js +2 -2
  104. package/popover/index.js.map +1 -1
  105. package/popover/interfaces.d.ts +5 -0
  106. package/popover/interfaces.d.ts.map +1 -1
  107. package/popover/interfaces.js.map +1 -1
  108. package/popover/internal.js +2 -2
  109. package/popover/internal.js.map +1 -1
  110. package/popover/styles.css.js +50 -49
  111. package/popover/styles.scoped.css +74 -66
  112. package/popover/styles.selectors.js +50 -49
  113. package/slider/internal.js +1 -1
  114. package/slider/internal.js.map +1 -1
  115. package/slider/slider-labels.js +1 -1
  116. package/slider/slider-labels.js.map +1 -1
  117. package/slider/tick-marks.js +2 -2
  118. package/slider/tick-marks.js.map +1 -1
  119. package/split-panel/side.js +3 -3
  120. package/split-panel/side.js.map +1 -1
  121. package/table/internal.d.ts.map +1 -1
  122. package/table/internal.js +23 -17
  123. package/table/internal.js.map +1 -1
  124. package/table/selection/selection-control.js +1 -1
  125. package/table/selection/selection-control.js.map +1 -1
  126. package/table/table-role/grid-navigation.d.ts.map +1 -1
  127. package/table/table-role/grid-navigation.js +40 -67
  128. package/table/table-role/grid-navigation.js.map +1 -1
  129. package/table/thead.d.ts +1 -0
  130. package/table/thead.d.ts.map +1 -1
  131. package/table/thead.js +5 -2
  132. package/table/thead.js.map +1 -1
  133. package/table/tools-header.d.ts +2 -1
  134. package/table/tools-header.d.ts.map +1 -1
  135. package/table/tools-header.js +4 -4
  136. package/table/tools-header.js.map +1 -1
  137. package/tabs/tab-header-bar.d.ts.map +1 -1
  138. package/tabs/tab-header-bar.js +106 -55
  139. package/tabs/tab-header-bar.js.map +1 -1
  140. package/token-group/dismiss-button.d.ts.map +1 -1
  141. package/token-group/dismiss-button.js +1 -2
  142. package/token-group/dismiss-button.js.map +1 -1
  143. package/wizard/wizard-form-header.js +1 -1
  144. package/wizard/wizard-form-header.js.map +1 -1
  145. package/wizard/wizard-form.js +1 -1
  146. package/wizard/wizard-form.js.map +1 -1
  147. package/wizard/wizard-navigation.js +3 -3
  148. package/wizard/wizard-navigation.js.map +1 -1
  149. package/internal/context/app-layout-context.d.ts +0 -8
  150. package/internal/context/app-layout-context.d.ts.map +0 -1
  151. package/internal/context/app-layout-context.js +0 -9
  152. package/internal/context/app-layout-context.js.map +0 -1
@@ -97,14 +97,14 @@ export const DrawerTriggersBar = ({ isMobile, topOffset, bottomOffset, activeDra
97
97
  }), onClick: drawers.length === 1
98
98
  ? () => onDrawerChange(drawers[0].id !== activeDrawerId ? drawers[0].id : null)
99
99
  : undefined }, !isMobile && (React.createElement("aside", { "aria-label": ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.drawers, role: "region" },
100
- React.createElement("div", { className: clsx(styles['drawer-triggers-wrapper']), role: "toolbar", "aria-orientation": "vertical" },
100
+ React.createElement("div", { className: styles['drawer-triggers-wrapper'], role: "toolbar", "aria-orientation": "vertical" },
101
101
  visibleItems.map((item, index) => {
102
102
  var _a;
103
103
  return (React.createElement(DrawerTrigger, { key: index, testUtilsClassName: clsx(testutilStyles['drawers-trigger'], item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']), ariaExpanded: activeDrawerId === item.id, ref: item.id === previousActiveDrawerId.current ? drawerRefs.toggle : undefined, ariaLabel: (_a = item.ariaLabels) === null || _a === void 0 ? void 0 : _a.triggerButton, ariaControls: activeDrawerId === item.id ? item.id : undefined, trigger: item.trigger, badge: item.badge, itemId: item.id, isActive: activeDrawerId === item.id, onClick: drawers.length !== 1
104
104
  ? () => onDrawerChange(item.id !== activeDrawerId ? item.id : null)
105
105
  : undefined }));
106
106
  }),
107
- overflowItems.length > 0 && (React.createElement("div", { className: clsx(styles['drawer-trigger']) },
107
+ overflowItems.length > 0 && (React.createElement("div", { className: styles['drawer-trigger'] },
108
108
  React.createElement(OverflowMenu, { ariaLabel: overflowMenuHasBadge ? ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.drawersOverflowWithBadge : ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.drawersOverflow, items: overflowItems, onItemClick: ({ detail }) => onDrawerChange(detail.id) })))))))));
109
109
  };
110
110
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app-layout/drawer/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAs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CAAC,CAAC,SAAS,GAEf,CACH,CAAC;gBACJ,CAAC,CAAC;gBACD,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,CAC3B,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;oBAC5C,oBAAC,YAAY,IACX,SAAS,EACP,oBAAoB,CAAC,CAAC,CAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,wBAAwB,CAAC,CAAC,CAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,eAAe,EAE3F,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,GACtD,CACE,CACP,CACG,CACA,CACT,CACG,CACF,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useRef } from 'react';\nimport { ToggleButton, CloseButton, togglesConfig } from '../toggles';\n\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\nimport { DesktopDrawerProps, DrawerTriggersBarProps } from './interfaces';\nimport OverflowMenu from './overflow-menu';\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { useDensityMode } from '@cloudscape-design/component-toolkit/internal';\nimport { splitItems } from './drawers-helpers';\nimport { TOOLS_DRAWER_ID } from '../utils/use-drawers';\nimport { AppLayoutProps } from '../interfaces';\n\n// We are using two landmarks per drawer, i.e. two NAVs and two ASIDEs, because of several\n// known bugs in NVDA that cause focus changes within a container to sometimes not be\n// announced. As a result, we use one region for the open button and one region for the\n// actual drawer content, always hiding the other one when it's not visible.\n// An alternative solution to follow a more classic implementation here to only have one\n// button that triggers the opening/closing of the drawer also did not work due to another\n// series of bugs in NVDA (together with Firefox) which prevent the changed expanded state\n// from being announced.\n// Even with this workaround in place, the announcement of the close button when opening a\n// panel in NVDA is not working correctly. The suspected root cause is one of the bugs below\n// as well.\n// Relevant tickets:\n// * https://github.com/nvaccess/nvda/issues/6606\n// * https://github.com/nvaccess/nvda/issues/5825\n// * https://github.com/nvaccess/nvda/issues/5247\n// * https://github.com/nvaccess/nvda/pull/8869 (reverted PR that was going to fix it)\nexport const Drawer = React.forwardRef(\n (\n {\n id,\n contentClassName,\n toggleClassName,\n closeClassName,\n width,\n type,\n toggleRefs,\n topOffset,\n bottomOffset,\n ariaLabels,\n children,\n hideOpenButton,\n isOpen,\n isHidden,\n isMobile,\n onToggle,\n onClick,\n onLoseFocus,\n resizeHandle,\n }: DesktopDrawerProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n const openButtonWrapperRef = useRef<HTMLElement | null>(null);\n const { TagName, iconName } = togglesConfig[type];\n const { mainLabel, closeLabel, openLabel } = ariaLabels;\n const drawerContentWidthOpen = isMobile ? undefined : width;\n const drawerContentWidth = isOpen ? drawerContentWidthOpen : undefined;\n\n const regularOpenButton = (\n <TagName ref={openButtonWrapperRef} aria-label={mainLabel} className={styles.toggle} aria-hidden={isOpen}>\n <ToggleButton\n ref={toggleRefs.toggle}\n className={toggleClassName}\n iconName={iconName}\n ariaLabel={openLabel}\n onClick={() => onToggle(true)}\n ariaExpanded={isOpen ? undefined : false}\n />\n </TagName>\n );\n\n return (\n <div\n ref={ref}\n className={clsx(styles.drawer, {\n [styles.hide]: isHidden,\n [styles['drawer-closed']]: !isOpen,\n [testutilStyles['drawer-closed']]: !isOpen,\n [styles['drawer-mobile']]: isMobile,\n })}\n style={{ width: drawerContentWidth }}\n onBlur={\n onLoseFocus\n ? e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n onLoseFocus(e);\n }\n }\n : undefined\n }\n onClick={event => {\n if (onClick) {\n onClick(event);\n }\n if (!isOpen) {\n // to prevent calling onToggle from the drawer when it's called from the toggle button\n if (\n openButtonWrapperRef.current === event.target ||\n !openButtonWrapperRef.current?.contains(event.target as Node)\n ) {\n onToggle(true);\n }\n }\n }}\n >\n <div\n id={id}\n style={{ width: drawerContentWidth, top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], styles['drawer-content-clickable'], contentClassName)}\n >\n {!isMobile && !hideOpenButton && regularOpenButton}\n <TagName\n className={clsx(resizeHandle && styles['drawer-resize-content'])}\n aria-label={mainLabel}\n aria-hidden={!isOpen}\n >\n {!isMobile && isOpen && <div className={styles['resize-handle-wrapper']}>{resizeHandle}</div>}\n <CloseButton\n ref={toggleRefs.close}\n className={closeClassName}\n ariaLabel={closeLabel}\n onClick={() => {\n onToggle(false);\n }}\n />\n {children}\n </TagName>\n </div>\n </div>\n );\n }\n);\n\ninterface DrawerTriggerProps {\n testUtilsClassName?: string;\n ariaLabel: string | undefined;\n ariaExpanded: boolean;\n ariaControls?: string;\n badge: boolean | undefined;\n itemId?: string;\n isActive: boolean;\n trigger: AppLayoutProps.Drawer['trigger'];\n onClick: (() => void) | undefined;\n}\n\nconst DrawerTrigger = React.forwardRef(\n (\n {\n testUtilsClassName,\n ariaLabel,\n ariaExpanded,\n ariaControls,\n badge,\n itemId,\n isActive,\n trigger,\n onClick,\n }: DrawerTriggerProps,\n ref: React.Ref<{ focus: () => void }>\n ) => (\n <div className={clsx(styles['drawer-trigger'], isActive && styles['drawer-trigger-active'])} onClick={onClick}>\n <ToggleButton\n ref={ref}\n className={testUtilsClassName}\n iconName={trigger.iconName}\n iconSvg={trigger.iconSvg}\n ariaLabel={ariaLabel}\n ariaExpanded={ariaExpanded}\n ariaControls={ariaControls}\n badge={badge}\n testId={itemId && `awsui-app-layout-trigger-${itemId}`}\n />\n </div>\n )\n);\n\nexport const DrawerTriggersBar = ({\n isMobile,\n topOffset,\n bottomOffset,\n activeDrawerId,\n ariaLabels,\n drawers,\n drawerRefs,\n onDrawerChange,\n}: DrawerTriggersBarProps) => {\n const containerRef = React.useRef<HTMLDivElement>(null);\n const previousActiveDrawerId = useRef(activeDrawerId);\n const [containerHeight, triggersContainerRef] = useContainerQuery(rect => rect.contentBoxHeight);\n const isCompactMode = useDensityMode(containerRef) === 'compact';\n\n if (activeDrawerId) {\n previousActiveDrawerId.current = activeDrawerId;\n }\n\n const getIndexOfOverflowItem = () => {\n if (containerHeight) {\n const ITEM_HEIGHT = isCompactMode ? 34 : 38;\n const overflowSpot = containerHeight / 1.5;\n\n const index = Math.floor(overflowSpot / ITEM_HEIGHT);\n\n return index;\n }\n return 0;\n };\n\n const { visibleItems, overflowItems } = splitItems(drawers, getIndexOfOverflowItem(), activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n <div\n className={clsx(styles.drawer, styles['drawer-closed'], testutilStyles['drawer-closed'], {\n [styles['drawer-mobile']]: isMobile,\n [styles.hide]: drawers.length === 1 && !!activeDrawerId,\n })}\n ref={containerRef}\n >\n <div\n ref={triggersContainerRef}\n style={{ top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], {\n [styles['drawer-content-clickable']]: drawers.length === 1,\n })}\n onClick={\n drawers.length === 1\n ? () => onDrawerChange(drawers[0].id !== activeDrawerId ? drawers[0].id : null)\n : undefined\n }\n >\n {!isMobile && (\n <aside aria-label={ariaLabels?.drawers} role=\"region\">\n <div className={clsx(styles['drawer-triggers-wrapper'])} role=\"toolbar\" aria-orientation=\"vertical\">\n {visibleItems.map((item, index) => {\n return (\n <DrawerTrigger\n key={index}\n testUtilsClassName={clsx(\n testutilStyles['drawers-trigger'],\n item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']\n )}\n ariaExpanded={activeDrawerId === item.id}\n ref={item.id === previousActiveDrawerId.current ? drawerRefs.toggle : undefined}\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaControls={activeDrawerId === item.id ? item.id : undefined}\n trigger={item.trigger}\n badge={item.badge}\n itemId={item.id}\n isActive={activeDrawerId === item.id}\n onClick={\n drawers.length !== 1\n ? () => onDrawerChange(item.id !== activeDrawerId ? item.id : null)\n : undefined\n }\n />\n );\n })}\n {overflowItems.length > 0 && (\n <div className={clsx(styles['drawer-trigger'])}>\n <OverflowMenu\n ariaLabel={\n overflowMenuHasBadge ? ariaLabels?.drawersOverflowWithBadge : ariaLabels?.drawersOverflow\n }\n items={overflowItems}\n onItemClick={({ detail }) => onDrawerChange(detail.id)}\n />\n </div>\n )}\n </div>\n </aside>\n )}\n </div>\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app-layout/drawer/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEtE,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,0FAA0F;AAC1F,qFAAqF;AACrF,uFAAuF;AACvF,4EAA4E;AAC5E,wFAAwF;AACxF,0FAA0F;AAC1F,0FAA0F;AAC1F,wBAAwB;AACxB,0FAA0F;AAC1F,4FAA4F;AAC5F,WAAW;AACX,oBAAoB;AACpB,iDAAiD;AACjD,iDAAiD;AACjD,iDAAiD;AACjD,sFAAsF;AACtF,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CACpC,CACE,EACE,EAAE,EACF,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,KAAK,EACL,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C9D,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,MAAM,EAAE,IAAI,CAAC,EAAE,EACf,QAAQ,EAAE,cAAc,KAAK,IAAI,CAAC,EAAE,EACpC,OAAO,EACL,OAAO,CAAC,MAAM,KAAK,CAAC;4BAClB,CAAC,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,KAAK,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;4BACnE,CAAC,CAAC,SAAS,GAEf,CACH,CAAC;gBACJ,CAAC,CAAC;gBACD,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,CAC3B,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC;oBACtC,oBAAC,YAAY,IACX,SAAS,EACP,oBAAoB,CAAC,CAAC,CAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,wBAAwB,CAAC,CAAC,CAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,eAAe,EAE3F,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,GACtD,CACE,CACP,CACG,CACA,CACT,CACG,CACF,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useRef } from 'react';\nimport { ToggleButton, CloseButton, togglesConfig } from '../toggles';\n\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\nimport { DesktopDrawerProps, DrawerTriggersBarProps } from './interfaces';\nimport OverflowMenu from './overflow-menu';\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { useDensityMode } from '@cloudscape-design/component-toolkit/internal';\nimport { splitItems } from './drawers-helpers';\nimport { TOOLS_DRAWER_ID } from '../utils/use-drawers';\nimport { AppLayoutProps } from '../interfaces';\n\n// We are using two landmarks per drawer, i.e. two NAVs and two ASIDEs, because of several\n// known bugs in NVDA that cause focus changes within a container to sometimes not be\n// announced. As a result, we use one region for the open button and one region for the\n// actual drawer content, always hiding the other one when it's not visible.\n// An alternative solution to follow a more classic implementation here to only have one\n// button that triggers the opening/closing of the drawer also did not work due to another\n// series of bugs in NVDA (together with Firefox) which prevent the changed expanded state\n// from being announced.\n// Even with this workaround in place, the announcement of the close button when opening a\n// panel in NVDA is not working correctly. The suspected root cause is one of the bugs below\n// as well.\n// Relevant tickets:\n// * https://github.com/nvaccess/nvda/issues/6606\n// * https://github.com/nvaccess/nvda/issues/5825\n// * https://github.com/nvaccess/nvda/issues/5247\n// * https://github.com/nvaccess/nvda/pull/8869 (reverted PR that was going to fix it)\nexport const Drawer = React.forwardRef(\n (\n {\n id,\n contentClassName,\n toggleClassName,\n closeClassName,\n width,\n type,\n toggleRefs,\n topOffset,\n bottomOffset,\n ariaLabels,\n children,\n hideOpenButton,\n isOpen,\n isHidden,\n isMobile,\n onToggle,\n onClick,\n onLoseFocus,\n resizeHandle,\n }: DesktopDrawerProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n const openButtonWrapperRef = useRef<HTMLElement | null>(null);\n const { TagName, iconName } = togglesConfig[type];\n const { mainLabel, closeLabel, openLabel } = ariaLabels;\n const drawerContentWidthOpen = isMobile ? undefined : width;\n const drawerContentWidth = isOpen ? drawerContentWidthOpen : undefined;\n\n const regularOpenButton = (\n <TagName ref={openButtonWrapperRef} aria-label={mainLabel} className={styles.toggle} aria-hidden={isOpen}>\n <ToggleButton\n ref={toggleRefs.toggle}\n className={toggleClassName}\n iconName={iconName}\n ariaLabel={openLabel}\n onClick={() => onToggle(true)}\n ariaExpanded={isOpen ? undefined : false}\n />\n </TagName>\n );\n\n return (\n <div\n ref={ref}\n className={clsx(styles.drawer, {\n [styles.hide]: isHidden,\n [styles['drawer-closed']]: !isOpen,\n [testutilStyles['drawer-closed']]: !isOpen,\n [styles['drawer-mobile']]: isMobile,\n })}\n style={{ width: drawerContentWidth }}\n onBlur={\n onLoseFocus\n ? e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n onLoseFocus(e);\n }\n }\n : undefined\n }\n onClick={event => {\n if (onClick) {\n onClick(event);\n }\n if (!isOpen) {\n // to prevent calling onToggle from the drawer when it's called from the toggle button\n if (\n openButtonWrapperRef.current === event.target ||\n !openButtonWrapperRef.current?.contains(event.target as Node)\n ) {\n onToggle(true);\n }\n }\n }}\n >\n <div\n id={id}\n style={{ width: drawerContentWidth, top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], styles['drawer-content-clickable'], contentClassName)}\n >\n {!isMobile && !hideOpenButton && regularOpenButton}\n <TagName\n className={clsx(resizeHandle && styles['drawer-resize-content'])}\n aria-label={mainLabel}\n aria-hidden={!isOpen}\n >\n {!isMobile && isOpen && <div className={styles['resize-handle-wrapper']}>{resizeHandle}</div>}\n <CloseButton\n ref={toggleRefs.close}\n className={closeClassName}\n ariaLabel={closeLabel}\n onClick={() => {\n onToggle(false);\n }}\n />\n {children}\n </TagName>\n </div>\n </div>\n );\n }\n);\n\ninterface DrawerTriggerProps {\n testUtilsClassName?: string;\n ariaLabel: string | undefined;\n ariaExpanded: boolean;\n ariaControls?: string;\n badge: boolean | undefined;\n itemId?: string;\n isActive: boolean;\n trigger: AppLayoutProps.Drawer['trigger'];\n onClick: (() => void) | undefined;\n}\n\nconst DrawerTrigger = React.forwardRef(\n (\n {\n testUtilsClassName,\n ariaLabel,\n ariaExpanded,\n ariaControls,\n badge,\n itemId,\n isActive,\n trigger,\n onClick,\n }: DrawerTriggerProps,\n ref: React.Ref<{ focus: () => void }>\n ) => (\n <div className={clsx(styles['drawer-trigger'], isActive && styles['drawer-trigger-active'])} onClick={onClick}>\n <ToggleButton\n ref={ref}\n className={testUtilsClassName}\n iconName={trigger.iconName}\n iconSvg={trigger.iconSvg}\n ariaLabel={ariaLabel}\n ariaExpanded={ariaExpanded}\n ariaControls={ariaControls}\n badge={badge}\n testId={itemId && `awsui-app-layout-trigger-${itemId}`}\n />\n </div>\n )\n);\n\nexport const DrawerTriggersBar = ({\n isMobile,\n topOffset,\n bottomOffset,\n activeDrawerId,\n ariaLabels,\n drawers,\n drawerRefs,\n onDrawerChange,\n}: DrawerTriggersBarProps) => {\n const containerRef = React.useRef<HTMLDivElement>(null);\n const previousActiveDrawerId = useRef(activeDrawerId);\n const [containerHeight, triggersContainerRef] = useContainerQuery(rect => rect.contentBoxHeight);\n const isCompactMode = useDensityMode(containerRef) === 'compact';\n\n if (activeDrawerId) {\n previousActiveDrawerId.current = activeDrawerId;\n }\n\n const getIndexOfOverflowItem = () => {\n if (containerHeight) {\n const ITEM_HEIGHT = isCompactMode ? 34 : 38;\n const overflowSpot = containerHeight / 1.5;\n\n const index = Math.floor(overflowSpot / ITEM_HEIGHT);\n\n return index;\n }\n return 0;\n };\n\n const { visibleItems, overflowItems } = splitItems(drawers, getIndexOfOverflowItem(), activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n <div\n className={clsx(styles.drawer, styles['drawer-closed'], testutilStyles['drawer-closed'], {\n [styles['drawer-mobile']]: isMobile,\n [styles.hide]: drawers.length === 1 && !!activeDrawerId,\n })}\n ref={containerRef}\n >\n <div\n ref={triggersContainerRef}\n style={{ top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], {\n [styles['drawer-content-clickable']]: drawers.length === 1,\n })}\n onClick={\n drawers.length === 1\n ? () => onDrawerChange(drawers[0].id !== activeDrawerId ? drawers[0].id : null)\n : undefined\n }\n >\n {!isMobile && (\n <aside aria-label={ariaLabels?.drawers} role=\"region\">\n <div className={styles['drawer-triggers-wrapper']} role=\"toolbar\" aria-orientation=\"vertical\">\n {visibleItems.map((item, index) => {\n return (\n <DrawerTrigger\n key={index}\n testUtilsClassName={clsx(\n testutilStyles['drawers-trigger'],\n item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']\n )}\n ariaExpanded={activeDrawerId === item.id}\n ref={item.id === previousActiveDrawerId.current ? drawerRefs.toggle : undefined}\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaControls={activeDrawerId === item.id ? item.id : undefined}\n trigger={item.trigger}\n badge={item.badge}\n itemId={item.id}\n isActive={activeDrawerId === item.id}\n onClick={\n drawers.length !== 1\n ? () => onDrawerChange(item.id !== activeDrawerId ? item.id : null)\n : undefined\n }\n />\n );\n })}\n {overflowItems.length > 0 && (\n <div className={styles['drawer-trigger']}>\n <OverflowMenu\n ariaLabel={\n overflowMenuHasBadge ? ariaLabels?.drawersOverflowWithBadge : ariaLabels?.drawersOverflow\n }\n items={overflowItems}\n onItemClick={({ detail }) => onDrawerChange(detail.id)}\n />\n </div>\n )}\n </div>\n </aside>\n )}\n </div>\n </div>\n );\n};\n"]}
@@ -34,7 +34,7 @@ export function MobileToolbar({ ariaLabels, toggleRefs, topOffset, navigationHid
34
34
  React.createElement("div", { className: styles['mobile-bar-breadcrumbs'] }, children && React.createElement("div", { className: testutilStyles.breadcrumbs }, children)),
35
35
  !toolsHide && !drawers && (React.createElement(MobileToggle, { ref: toggleRefs.tools, type: "tools", className: testutilStyles['tools-toggle'], ariaLabels: ariaLabels, disabled: anyPanelOpen, onClick: onToolsOpen })),
36
36
  drawers && (React.createElement("aside", { "aria-label": ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.drawers, role: "region" },
37
- React.createElement("div", { className: clsx(styles['drawers-container']), role: "toolbar", "aria-orientation": "horizontal" },
37
+ React.createElement("div", { className: styles['drawers-container'], role: "toolbar", "aria-orientation": "horizontal" },
38
38
  visibleItems.map((item, index) => {
39
39
  var _a;
40
40
  return (React.createElement("div", { className: clsx(styles['mobile-toggle'], styles['mobile-toggle-type-drawer']), key: index, onClick: () => onDrawerChange(item.id) },
@@ -1 +1 @@
1
- {"version":3,"file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AC,QAAQ,EAC/B,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAC7B,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,SAAS,EAAE,MAAA,IAAI,CAAC,UAAU,0CAAE,aAAa,EACzC,YAAY,EAAE,cAAc,KAAK,IAAI,CAAC,EAAE,EACxC,MAAM,EAAE,4BAA4B,IAAI,CAAC,EAAE,EAAE,GAC7C,CACE,CACP,CAAA;iBAAA,CAAC;gBACD,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,CAC3B,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,2BAA2B,CAAC,CAAC;oBAChF,oBAAC,YAAY,IACX,SAAS,EAAE,oBAAoB,CAAC,CAAC,CAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,wBAAwB,CAAC,CAAC,CAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,eAAe,EACpG,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,GACtD,CACE,CACP,CACG,CACA,CACT,CACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useEffect } from 'react';\nimport { ButtonProps } from '../../button/interfaces';\nimport { AppLayoutProps } from '../interfaces';\nimport { ToggleButton, togglesConfig } from '../toggles';\nimport OverflowMenu from '../drawer/overflow-menu';\nimport styles from './styles.css.js';\nimport sharedStyles from '../styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { splitItems } from '../drawer/drawers-helpers';\nimport { TOOLS_DRAWER_ID } from '../utils/use-drawers';\n\ninterface MobileToggleProps {\n className?: string;\n ariaLabels?: AppLayoutProps.Labels;\n type: keyof typeof togglesConfig;\n disabled?: boolean;\n onClick: () => void;\n}\nconst MobileToggle = React.forwardRef(\n ({ className, ariaLabels, type, disabled, onClick }: MobileToggleProps, ref: React.Ref<ButtonProps.Ref>) => {\n const { TagName, iconName, getLabels } = togglesConfig[type];\n const { mainLabel, openLabel } = getLabels(ariaLabels);\n\n return (\n <TagName\n className={clsx(styles['mobile-toggle'], styles[`mobile-toggle-type-${type}`])}\n aria-hidden={disabled}\n aria-label={mainLabel}\n onClick={e => e.target === e.currentTarget && onClick()}\n >\n <ToggleButton\n ref={ref}\n className={className}\n iconName={iconName}\n onClick={onClick}\n ariaLabel={openLabel}\n disabled={disabled}\n ariaExpanded={disabled}\n />\n </TagName>\n );\n }\n);\ninterface MobileToolbarProps {\n anyPanelOpen: boolean;\n unfocusable: boolean | undefined;\n toggleRefs: {\n navigation: React.Ref<ButtonProps.Ref>;\n tools: React.Ref<ButtonProps.Ref>;\n };\n navigationHide: boolean | undefined;\n toolsHide: boolean | undefined;\n topOffset?: number;\n ariaLabels: AppLayoutProps.Labels | undefined;\n mobileBarRef: React.Ref<HTMLDivElement>;\n children: React.ReactNode;\n onNavigationOpen: () => void;\n onToolsOpen: () => void;\n drawers: Array<AppLayoutProps.Drawer> | undefined;\n activeDrawerId: string | null;\n onDrawerChange: (newDrawerId: string | null) => void;\n}\n\nexport function MobileToolbar({\n ariaLabels,\n toggleRefs,\n topOffset,\n navigationHide,\n toolsHide,\n anyPanelOpen,\n unfocusable,\n drawers,\n activeDrawerId,\n children,\n onNavigationOpen,\n onToolsOpen,\n onDrawerChange,\n mobileBarRef,\n}: MobileToolbarProps) {\n useEffect(() => {\n if (anyPanelOpen) {\n document.body.classList.add(styles['block-body-scroll']);\n return () => {\n document.body.classList.remove(styles['block-body-scroll']);\n };\n } else {\n document.body.classList.remove(styles['block-body-scroll']);\n }\n }, [anyPanelOpen]);\n\n const { overflowItems, visibleItems } = splitItems(drawers, 2, activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n <div\n ref={mobileBarRef}\n className={clsx(styles['mobile-bar'], testutilStyles['mobile-bar'], unfocusable && sharedStyles.unfocusable)}\n style={{ top: topOffset }}\n >\n {!navigationHide && (\n <MobileToggle\n ref={toggleRefs.navigation}\n type=\"navigation\"\n className={testutilStyles['navigation-toggle']}\n ariaLabels={ariaLabels}\n disabled={anyPanelOpen}\n onClick={onNavigationOpen}\n />\n )}\n <div className={styles['mobile-bar-breadcrumbs']}>\n {children && <div className={testutilStyles.breadcrumbs}>{children}</div>}\n </div>\n {!toolsHide && !drawers && (\n <MobileToggle\n ref={toggleRefs.tools}\n type=\"tools\"\n className={testutilStyles['tools-toggle']}\n ariaLabels={ariaLabels}\n disabled={anyPanelOpen}\n onClick={onToolsOpen}\n />\n )}\n {drawers && (\n <aside aria-label={ariaLabels?.drawers} role=\"region\">\n <div className={clsx(styles['drawers-container'])} role=\"toolbar\" aria-orientation=\"horizontal\">\n {visibleItems.map((item, index) => (\n <div\n className={clsx(styles['mobile-toggle'], styles['mobile-toggle-type-drawer'])}\n key={index}\n onClick={() => onDrawerChange(item.id)}\n >\n <ToggleButton\n className={clsx(\n testutilStyles['drawers-trigger'],\n item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']\n )}\n iconName={item.trigger.iconName}\n iconSvg={item.trigger.iconSvg}\n badge={item.badge}\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaExpanded={activeDrawerId === item.id}\n testId={`awsui-app-layout-trigger-${item.id}`}\n />\n </div>\n ))}\n {overflowItems.length > 0 && (\n <div className={clsx(styles['mobile-toggle'], styles['mobile-toggle-type-drawer'])}>\n <OverflowMenu\n ariaLabel={overflowMenuHasBadge ? ariaLabels?.drawersOverflowWithBadge : ariaLabels?.drawersOverflow}\n items={overflowItems}\n onItemClick={({ detail }) => onDrawerChange(detail.id)}\n />\n </div>\n )}\n </div>\n </aside>\n )}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app-layout/mobile-to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AC7B,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,SAAS,EAAE,MAAA,IAAI,CAAC,UAAU,0CAAE,aAAa,EACzC,YAAY,EAAE,cAAc,KAAK,IAAI,CAAC,EAAE,EACxC,MAAM,EAAE,4BAA4B,IAAI,CAAC,EAAE,EAAE,GAC7C,CACE,CACP,CAAA;iBAAA,CAAC;gBACD,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,CAC3B,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,2BAA2B,CAAC,CAAC;oBAChF,oBAAC,YAAY,IACX,SAAS,EAAE,oBAAoB,CAAC,CAAC,CAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,wBAAwB,CAAC,CAAC,CAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,eAAe,EACpG,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,GACtD,CACE,CACP,CACG,CACA,CACT,CACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useEffect } from 'react';\nimport { ButtonProps } from '../../button/interfaces';\nimport { AppLayoutProps } from '../interfaces';\nimport { ToggleButton, togglesConfig } from '../toggles';\nimport OverflowMenu from '../drawer/overflow-menu';\nimport styles from './styles.css.js';\nimport sharedStyles from '../styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { splitItems } from '../drawer/drawers-helpers';\nimport { TOOLS_DRAWER_ID } from '../utils/use-drawers';\n\ninterface MobileToggleProps {\n className?: string;\n ariaLabels?: AppLayoutProps.Labels;\n type: keyof typeof togglesConfig;\n disabled?: boolean;\n onClick: () => void;\n}\nconst MobileToggle = React.forwardRef(\n ({ className, ariaLabels, type, disabled, onClick }: MobileToggleProps, ref: React.Ref<ButtonProps.Ref>) => {\n const { TagName, iconName, getLabels } = togglesConfig[type];\n const { mainLabel, openLabel } = getLabels(ariaLabels);\n\n return (\n <TagName\n className={clsx(styles['mobile-toggle'], styles[`mobile-toggle-type-${type}`])}\n aria-hidden={disabled}\n aria-label={mainLabel}\n onClick={e => e.target === e.currentTarget && onClick()}\n >\n <ToggleButton\n ref={ref}\n className={className}\n iconName={iconName}\n onClick={onClick}\n ariaLabel={openLabel}\n disabled={disabled}\n ariaExpanded={disabled}\n />\n </TagName>\n );\n }\n);\ninterface MobileToolbarProps {\n anyPanelOpen: boolean;\n unfocusable: boolean | undefined;\n toggleRefs: {\n navigation: React.Ref<ButtonProps.Ref>;\n tools: React.Ref<ButtonProps.Ref>;\n };\n navigationHide: boolean | undefined;\n toolsHide: boolean | undefined;\n topOffset?: number;\n ariaLabels: AppLayoutProps.Labels | undefined;\n mobileBarRef: React.Ref<HTMLDivElement>;\n children: React.ReactNode;\n onNavigationOpen: () => void;\n onToolsOpen: () => void;\n drawers: Array<AppLayoutProps.Drawer> | undefined;\n activeDrawerId: string | null;\n onDrawerChange: (newDrawerId: string | null) => void;\n}\n\nexport function MobileToolbar({\n ariaLabels,\n toggleRefs,\n topOffset,\n navigationHide,\n toolsHide,\n anyPanelOpen,\n unfocusable,\n drawers,\n activeDrawerId,\n children,\n onNavigationOpen,\n onToolsOpen,\n onDrawerChange,\n mobileBarRef,\n}: MobileToolbarProps) {\n useEffect(() => {\n if (anyPanelOpen) {\n document.body.classList.add(styles['block-body-scroll']);\n return () => {\n document.body.classList.remove(styles['block-body-scroll']);\n };\n } else {\n document.body.classList.remove(styles['block-body-scroll']);\n }\n }, [anyPanelOpen]);\n\n const { overflowItems, visibleItems } = splitItems(drawers, 2, activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n <div\n ref={mobileBarRef}\n className={clsx(styles['mobile-bar'], testutilStyles['mobile-bar'], unfocusable && sharedStyles.unfocusable)}\n style={{ top: topOffset }}\n >\n {!navigationHide && (\n <MobileToggle\n ref={toggleRefs.navigation}\n type=\"navigation\"\n className={testutilStyles['navigation-toggle']}\n ariaLabels={ariaLabels}\n disabled={anyPanelOpen}\n onClick={onNavigationOpen}\n />\n )}\n <div className={styles['mobile-bar-breadcrumbs']}>\n {children && <div className={testutilStyles.breadcrumbs}>{children}</div>}\n </div>\n {!toolsHide && !drawers && (\n <MobileToggle\n ref={toggleRefs.tools}\n type=\"tools\"\n className={testutilStyles['tools-toggle']}\n ariaLabels={ariaLabels}\n disabled={anyPanelOpen}\n onClick={onToolsOpen}\n />\n )}\n {drawers && (\n <aside aria-label={ariaLabels?.drawers} role=\"region\">\n <div className={styles['drawers-container']} role=\"toolbar\" aria-orientation=\"horizontal\">\n {visibleItems.map((item, index) => (\n <div\n className={clsx(styles['mobile-toggle'], styles['mobile-toggle-type-drawer'])}\n key={index}\n onClick={() => onDrawerChange(item.id)}\n >\n <ToggleButton\n className={clsx(\n testutilStyles['drawers-trigger'],\n item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']\n )}\n iconName={item.trigger.iconName}\n iconSvg={item.trigger.iconSvg}\n badge={item.badge}\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaExpanded={activeDrawerId === item.id}\n testId={`awsui-app-layout-trigger-${item.id}`}\n />\n </div>\n ))}\n {overflowItems.length > 0 && (\n <div className={clsx(styles['mobile-toggle'], styles['mobile-toggle-type-drawer'])}>\n <OverflowMenu\n ariaLabel={overflowMenuHasBadge ? ariaLabels?.drawersOverflowWithBadge : ariaLabels?.drawersOverflow}\n items={overflowItems}\n onItemClick={({ detail }) => onDrawerChange(detail.id)}\n />\n </div>\n )}\n </div>\n </aside>\n )}\n </div>\n );\n}\n"]}
@@ -1,4 +1,4 @@
1
- export declare function getStickyOffsetVars(headerHeight: number, footerHeight: number, stickyNotificationsHeight: string, mobileToolbarHeight: string, disableBodyScroll: boolean, isMobile: boolean, extraTopOffset?: string): {
1
+ export declare function getStickyOffsetVars(headerHeight: number, footerHeight: number, stickyNotificationsHeight: string, mobileToolbarHeight: string, disableBodyScroll: boolean, isMobile: boolean): {
2
2
  [x: string]: string;
3
3
  };
4
4
  //# sourceMappingURL=sticky-offsets.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sticky-offsets.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/utils/sticky-offsets.ts"],"names":[],"mappings":"AAKA,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,yBAAyB,EAAE,MAAM,EACjC,mBAAmB,EAAE,MAAM,EAC3B,iBAAiB,EAAE,OAAO,EAC1B,QAAQ,EAAE,OAAO,EACjB,cAAc,CAAC,EAAE,MAAM;;EAQxB"}
1
+ {"version":3,"file":"sticky-offsets.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/utils/sticky-offsets.ts"],"names":[],"mappings":"AAKA,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,yBAAyB,EAAE,MAAM,EACjC,mBAAmB,EAAE,MAAM,EAC3B,iBAAiB,EAAE,OAAO,EAC1B,QAAQ,EAAE,OAAO;;EAQlB"}
@@ -1,9 +1,9 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import globalVars from '../../internal/styles/global-vars';
4
- export function getStickyOffsetVars(headerHeight, footerHeight, stickyNotificationsHeight, mobileToolbarHeight, disableBodyScroll, isMobile, extraTopOffset) {
4
+ export function getStickyOffsetVars(headerHeight, footerHeight, stickyNotificationsHeight, mobileToolbarHeight, disableBodyScroll, isMobile) {
5
5
  return {
6
- [globalVars.stickyVerticalTopOffset]: `calc(${!disableBodyScroll ? headerHeight : 0}px + ${isMobile ? mobileToolbarHeight : stickyNotificationsHeight} + ${extraTopOffset !== null && extraTopOffset !== void 0 ? extraTopOffset : '0px'})`,
6
+ [globalVars.stickyVerticalTopOffset]: `calc(${!disableBodyScroll ? headerHeight : 0}px + ${isMobile ? mobileToolbarHeight : stickyNotificationsHeight})`,
7
7
  [globalVars.stickyVerticalBottomOffset]: `${!disableBodyScroll ? footerHeight : 0}px`,
8
8
  };
9
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sticky-offsets.js","sourceRoot":"","sources":["../../../../src/app-layout/utils/sticky-offsets.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,UAAU,MAAM,mCAAmC,CAAC;AAE3D,MAAM,UAAU,mBAAmB,CACjC,YAAoB,EACpB,YAAoB,EACpB,yBAAiC,EACjC,mBAA2B,EAC3B,iBAA0B,EAC1B,QAAiB,EACjB,cAAuB;IAEvB,OAAO;QACL,CAAC,UAAU,CAAC,uBAAuB,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,QACjF,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,yBACnC,MAAM,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,KAAK,GAAG;QAChC,CAAC,UAAU,CAAC,0BAA0B,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI;KACtF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport globalVars from '../../internal/styles/global-vars';\n\nexport function getStickyOffsetVars(\n headerHeight: number,\n footerHeight: number,\n stickyNotificationsHeight: string,\n mobileToolbarHeight: string,\n disableBodyScroll: boolean,\n isMobile: boolean,\n extraTopOffset?: string\n) {\n return {\n [globalVars.stickyVerticalTopOffset]: `calc(${!disableBodyScroll ? headerHeight : 0}px + ${\n isMobile ? mobileToolbarHeight : stickyNotificationsHeight\n } + ${extraTopOffset ?? '0px'})`,\n [globalVars.stickyVerticalBottomOffset]: `${!disableBodyScroll ? footerHeight : 0}px`,\n };\n}\n"]}
1
+ {"version":3,"file":"sticky-offsets.js","sourceRoot":"","sources":["../../../../src/app-layout/utils/sticky-offsets.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,UAAU,MAAM,mCAAmC,CAAC;AAE3D,MAAM,UAAU,mBAAmB,CACjC,YAAoB,EACpB,YAAoB,EACpB,yBAAiC,EACjC,mBAA2B,EAC3B,iBAA0B,EAC1B,QAAiB;IAEjB,OAAO;QACL,CAAC,UAAU,CAAC,uBAAuB,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,QACjF,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,yBACnC,GAAG;QACH,CAAC,UAAU,CAAC,0BAA0B,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI;KACtF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport globalVars from '../../internal/styles/global-vars';\n\nexport function getStickyOffsetVars(\n headerHeight: number,\n footerHeight: number,\n stickyNotificationsHeight: string,\n mobileToolbarHeight: string,\n disableBodyScroll: boolean,\n isMobile: boolean\n) {\n return {\n [globalVars.stickyVerticalTopOffset]: `calc(${!disableBodyScroll ? headerHeight : 0}px + ${\n isMobile ? mobileToolbarHeight : stickyNotificationsHeight\n })`,\n [globalVars.stickyVerticalBottomOffset]: `${!disableBodyScroll ? footerHeight : 0}px`,\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"background.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/background.tsx"],"names":[],"mappings":";AAQA,MAAM,CAAC,OAAO,UAAU,UAAU,uBA4BjC"}
1
+ {"version":3,"file":"background.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/background.tsx"],"names":[],"mappings":";AAQA,MAAM,CAAC,OAAO,UAAU,UAAU,uBAajC"}
@@ -6,14 +6,11 @@ import { highContrastHeaderClassName } from '../../internal/utils/content-header
6
6
  import { useAppLayoutInternals } from './context';
7
7
  import styles from './styles.css.js';
8
8
  export default function Background() {
9
- const { breadcrumbs, hasBackgroundOverlap, hasNotificationsContent, hasStickyBackground, isMobile, stickyNotifications, headerVariant, } = useAppLayoutInternals();
9
+ const { breadcrumbs, hasBackgroundOverlap, hasNotificationsContent, isMobile, headerVariant } = useAppLayoutInternals();
10
10
  if (!hasNotificationsContent && (!breadcrumbs || isMobile) && !hasBackgroundOverlap) {
11
11
  return null;
12
12
  }
13
13
  return (React.createElement("div", { className: clsx(styles.background, { [highContrastHeaderClassName]: headerVariant === 'high-contrast' }) },
14
- React.createElement("div", { className: styles['scrolling-background'] }),
15
- !isMobile && hasStickyBackground && (React.createElement("div", { className: clsx(styles['sticky-background'], {
16
- [styles['has-sticky-notifications']]: stickyNotifications,
17
- }) }))));
14
+ React.createElement("div", { className: styles['scrolling-background'] })));
18
15
  }
19
16
  //# sourceMappingURL=background.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"background.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/background.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,CAAC,OAAO,UAAU,UAAU;IAChC,MAAM,EACJ,WAAW,EACX,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,QAAQ,EACR,mBAAmB,EACnB,aAAa,GACd,GAAG,qBAAqB,EAAE,CAAC;IAE5B,IAAI,CAAC,uBAAuB,IAAI,CAAC,CAAC,WAAW,IAAI,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE;QACnF,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,2BAA2B,CAAC,EAAE,aAAa,KAAK,eAAe,EAAE,CAAC;QAC3G,6BAAK,SAAS,EAAE,MAAM,CAAC,sBAAsB,CAAC,GAAI;QAEjD,CAAC,QAAQ,IAAI,mBAAmB,IAAI,CACnC,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE;gBAC3C,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,EAAE,mBAAmB;aAC1D,CAAC,GACF,CACH,CACG,CACP,CAAC;AACJ,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 { highContrastHeaderClassName } from '../../internal/utils/content-header-utils';\nimport { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\n\nexport default function Background() {\n const {\n breadcrumbs,\n hasBackgroundOverlap,\n hasNotificationsContent,\n hasStickyBackground,\n isMobile,\n stickyNotifications,\n headerVariant,\n } = useAppLayoutInternals();\n\n if (!hasNotificationsContent && (!breadcrumbs || isMobile) && !hasBackgroundOverlap) {\n return null;\n }\n\n return (\n <div className={clsx(styles.background, { [highContrastHeaderClassName]: headerVariant === 'high-contrast' })}>\n <div className={styles['scrolling-background']} />\n\n {!isMobile && hasStickyBackground && (\n <div\n className={clsx(styles['sticky-background'], {\n [styles['has-sticky-notifications']]: stickyNotifications,\n })}\n />\n )}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"background.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/background.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,CAAC,OAAO,UAAU,UAAU;IAChC,MAAM,EAAE,WAAW,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,QAAQ,EAAE,aAAa,EAAE,GAC3F,qBAAqB,EAAE,CAAC;IAE1B,IAAI,CAAC,uBAAuB,IAAI,CAAC,CAAC,WAAW,IAAI,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE;QACnF,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,2BAA2B,CAAC,EAAE,aAAa,KAAK,eAAe,EAAE,CAAC;QAC3G,6BAAK,SAAS,EAAE,MAAM,CAAC,sBAAsB,CAAC,GAAI,CAC9C,CACP,CAAC;AACJ,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 { highContrastHeaderClassName } from '../../internal/utils/content-header-utils';\nimport { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\n\nexport default function Background() {\n const { breadcrumbs, hasBackgroundOverlap, hasNotificationsContent, isMobile, headerVariant } =\n useAppLayoutInternals();\n\n if (!hasNotificationsContent && (!breadcrumbs || isMobile) && !hasBackgroundOverlap) {\n return null;\n }\n\n return (\n <div className={clsx(styles.background, { [highContrastHeaderClassName]: headerVariant === 'high-contrast' })}>\n <div className={styles['scrolling-background']} />\n </div>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumbs.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/breadcrumbs.tsx"],"names":[],"mappings":";AASA,MAAM,CAAC,OAAO,UAAU,WAAW,uBAiBlC"}
1
+ {"version":3,"file":"breadcrumbs.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/breadcrumbs.tsx"],"names":[],"mappings":";AASA,MAAM,CAAC,OAAO,UAAU,WAAW,uBAgBlC"}
@@ -7,12 +7,11 @@ import { useAppLayoutInternals } from './context';
7
7
  import styles from './styles.css.js';
8
8
  import testutilStyles from '../test-classes/styles.css.js';
9
9
  export default function Breadcrumbs() {
10
- const { breadcrumbs, hasStickyBackground, isMobile, headerVariant } = useAppLayoutInternals();
10
+ const { breadcrumbs, isMobile, headerVariant } = useAppLayoutInternals();
11
11
  if (isMobile || !breadcrumbs) {
12
12
  return null;
13
13
  }
14
14
  return (React.createElement("div", { className: clsx(styles.breadcrumbs, testutilStyles.breadcrumbs, {
15
- [styles['has-sticky-background']]: hasStickyBackground,
16
15
  [highContrastHeaderClassName]: headerVariant === 'high-contrast',
17
16
  }) }, breadcrumbs));
18
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumbs.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/breadcrumbs.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAE3D,MAAM,CAAC,OAAO,UAAU,WAAW;IACjC,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,qBAAqB,EAAE,CAAC;IAE9F,IAAI,QAAQ,IAAI,CAAC,WAAW,EAAE;QAC5B,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,WAAW,EAAE;YAC9D,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,EAAE,mBAAmB;YACtD,CAAC,2BAA2B,CAAC,EAAE,aAAa,KAAK,eAAe;SACjE,CAAC,IAED,WAAW,CACR,CACP,CAAC;AACJ,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 { highContrastHeaderClassName } from '../../internal/utils/content-header-utils';\nimport { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\n\nexport default function Breadcrumbs() {\n const { breadcrumbs, hasStickyBackground, isMobile, headerVariant } = useAppLayoutInternals();\n\n if (isMobile || !breadcrumbs) {\n return null;\n }\n\n return (\n <div\n className={clsx(styles.breadcrumbs, testutilStyles.breadcrumbs, {\n [styles['has-sticky-background']]: hasStickyBackground,\n [highContrastHeaderClassName]: headerVariant === 'high-contrast',\n })}\n >\n {breadcrumbs}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"breadcrumbs.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/breadcrumbs.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAE3D,MAAM,CAAC,OAAO,UAAU,WAAW;IACjC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,qBAAqB,EAAE,CAAC;IAEzE,IAAI,QAAQ,IAAI,CAAC,WAAW,EAAE;QAC5B,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,WAAW,EAAE;YAC9D,CAAC,2BAA2B,CAAC,EAAE,aAAa,KAAK,eAAe;SACjE,CAAC,IAED,WAAW,CACR,CACP,CAAC;AACJ,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 { highContrastHeaderClassName } from '../../internal/utils/content-header-utils';\nimport { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\n\nexport default function Breadcrumbs() {\n const { breadcrumbs, isMobile, headerVariant } = useAppLayoutInternals();\n\n if (isMobile || !breadcrumbs) {\n return null;\n }\n\n return (\n <div\n className={clsx(styles.breadcrumbs, testutilStyles.breadcrumbs, {\n [highContrastHeaderClassName]: headerVariant === 'high-contrast',\n })}\n >\n {breadcrumbs}\n </div>\n );\n}\n"]}
@@ -26,7 +26,6 @@ interface AppLayoutInternals extends AppLayoutPropsWithDefaults {
26
26
  hasDrawerViewportOverlay: boolean;
27
27
  hasNotificationsContent: boolean;
28
28
  hasOpenDrawer?: boolean;
29
- hasStickyBackground: boolean;
30
29
  isBackgroundOverlapDisabled: boolean;
31
30
  isMobile: boolean;
32
31
  isSplitPanelForcedPosition: boolean;
@@ -42,7 +41,6 @@ interface AppLayoutInternals extends AppLayoutPropsWithDefaults {
42
41
  notificationsElement: React.Ref<HTMLDivElement>;
43
42
  notificationsHeight: number;
44
43
  offsetBottom: number;
45
- setHasStickyBackground: (value: boolean) => void;
46
44
  setSplitPanelReportedSize: (value: number) => void;
47
45
  setSplitPanelReportedHeaderHeight: (value: number) => void;
48
46
  headerHeight: number;
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/context.tsx"],"names":[],"mappings":"AAEA,OAAO,KASN,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EAAE,gBAAgB,EAAmB,MAAM,4BAA4B,CAAC;AAI/E,OAAO,EAAE,0BAA0B,EAA6B,MAAM,wCAAwC,CAAC;AAC/G,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAYvF,UAAU,kBAAmB,SAAQ,0BAA0B;IAC7D,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IAClD,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,wBAAwB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C,iCAAiC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtD,WAAW,EAAE,gBAAgB,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAClC,YAAY,EAAE,KAAK,CAAC,YAAY,CAAC;IACjC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,EAAE,gBAAgB,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACxF,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAClC,qBAAqB,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,iCAAiC,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC,qBAAqB,KAA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Ac,EAAE,gBAAgB,CAAC;IACjC,oBAAoB,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,yBAAyB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,iCAAiC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,cAAc,CAAC,kBAAkB,CAAC;IACtD,sBAAsB,EAAE,MAAM,CAAC;IAC/B,8BAA8B,EAAE,MAAM,CAAC;IACvC,gBAAgB,EAAE,yBAAyB,CAAC;IAC5C,mBAAmB,EAAE,CAAC,MAAM,EAAE,yBAAyB,KAAK,IAAI,CAAC;IACjE,mBAAmB,EAAE,OAAO,CAAC;IAC7B,cAAc,EAAE,0BAA0B,CAAC;IAC3C,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AASD,UAAU,+BAAgC,SAAQ,0BAA0B;IAC1E,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,qBAAqB,uBAMpC;AAED,eAAO,MAAM,0BAA0B,4GAmetC,CAAC"}
@@ -2,7 +2,6 @@ import { __rest } from "tslib";
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  import React, { createContext, useCallback, useEffect, useLayoutEffect, useImperativeHandle, useRef, useState, useContext, } from 'react';
5
- import { AppLayoutContext } from '../../internal/context/app-layout-context';
6
5
  import { DynamicOverlapContext } from '../../internal/context/dynamic-overlap-context';
7
6
  import { fireNonCancelableEvent } from '../../internal/events';
8
7
  import { useFocusControl } from '../utils/use-focus-control';
@@ -39,7 +38,6 @@ export const AppLayoutInternalsProvider = React.forwardRef((props, forwardRef) =
39
38
  const isMobile = useMobile();
40
39
  // Private API for embedded view mode
41
40
  const __embeddedViewMode = Boolean(props.__embeddedViewMode);
42
- const [hasStickyBackground, setHasStickyBackground] = useState(false);
43
41
  /**
44
42
  * Set the default values for minimum and maximum content width.
45
43
  */
@@ -350,8 +348,7 @@ export const AppLayoutInternalsProvider = React.forwardRef((props, forwardRef) =
350
348
  handleToolsClick,
351
349
  hasBackgroundOverlap,
352
350
  hasNotificationsContent,
353
- hasOpenDrawer,
354
- hasStickyBackground, isBackgroundOverlapDisabled: props.disableContentHeaderOverlap || !hasBackgroundOverlap, isMobile,
351
+ hasOpenDrawer, isBackgroundOverlapDisabled: props.disableContentHeaderOverlap || !hasBackgroundOverlap, isMobile,
355
352
  isSplitPanelForcedPosition,
356
353
  isSplitPanelOpen,
357
354
  isToolsOpen,
@@ -366,7 +363,6 @@ export const AppLayoutInternalsProvider = React.forwardRef((props, forwardRef) =
366
363
  notificationsElement,
367
364
  notificationsHeight,
368
365
  offsetBottom,
369
- setHasStickyBackground,
370
366
  setSplitPanelReportedSize,
371
367
  setSplitPanelReportedHeaderHeight,
372
368
  splitPanel,
@@ -385,7 +381,6 @@ export const AppLayoutInternalsProvider = React.forwardRef((props, forwardRef) =
385
381
  toolsHide, toolsOpen: isToolsOpen, toolsWidth,
386
382
  toolsRefs,
387
383
  __embeddedViewMode }) },
388
- React.createElement(AppLayoutContext.Provider, { value: { setHasStickyBackground } },
389
- React.createElement(DynamicOverlapContext.Provider, { value: updateBackgroundOverlapHeight }, children))));
384
+ React.createElement(DynamicOverlapContext.Provider, { value: updateBackgroundOverlapHeight }, children)));
390
385
  });
391
386
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/context.tsx"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,gBAAgB;YAChB,mBAAmB;YACnB,cAAc;YACd,cAAc;YACd,SAAS,EACT,SAAS,EAAE,WAAW,EACtB,UAAU;YACV,SAAS;YACT,kBAAkB;QAGpB,oBAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,sBAAsB,EAAE;YAC1D,oBAAC,qBAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,6BAA6B,IACjE,QAAQ,CACsB,CACP,CACO,CACtC,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, {\n createContext,\n useCallback,\n useEffect,\n useLayoutEffect,\n useImperativeHandle,\n useRef,\n useState,\n useContext,\n} from 'react';\nimport { AppLayoutContext } from '../../internal/context/app-layout-context';\nimport { DynamicOverlapContext } from '../../internal/context/dynamic-overlap-context';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from '../interfaces';\nimport { fireNonCancelableEvent } from '../../internal/events';\nimport { FocusControlRefs, useFocusControl } from '../utils/use-focus-control';\nimport { getSplitPanelDefaultSize } from '../../split-panel/utils/size-utils';\nimport { getSplitPanelPosition } from './split-panel';\nimport { useControllable } from '../../internal/hooks/use-controllable';\nimport { SplitPanelFocusControlRefs, useSplitPanelFocusControl } from '../utils/use-split-panel-focus-control';\nimport { SplitPanelSideToggleProps } from '../../internal/context/split-panel-context';\nimport { useMobile } from '../../internal/hooks/use-mobile';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\nimport useResize from '../utils/use-resize';\nimport styles from './styles.css.js';\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport useBackgroundOverlap from './use-background-overlap';\nimport { useDrawers } from '../utils/use-drawers';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport { SPLIT_PANEL_MIN_WIDTH } from '../split-panel';\nimport { getOffsetInlineStart } from '@cloudscape-design/component-toolkit/internal';\n\ninterface AppLayoutInternals extends AppLayoutPropsWithDefaults {\n activeDrawerId: string | null;\n drawers: Array<AppLayoutProps.Drawer> | undefined;\n drawersAriaLabel: string | undefined;\n drawersOverflowAriaLabel: string | undefined;\n drawersOverflowWithBadgeAriaLabel: string | undefined;\n drawersRefs: FocusControlRefs;\n drawerSize: number;\n drawersMinWidth: number;\n drawersMaxWidth: number;\n drawerRef: React.Ref<HTMLElement>;\n resizeHandle: React.ReactElement;\n drawersTriggerCount: number;\n handleDrawersClick: (activeDrawerId: string | null, skipFocusControl?: boolean) => void;\n handleSplitPanelClick: () => void;\n handleNavigationClick: (isOpen: boolean) => void;\n handleSplitPanelPreferencesChange: (detail: AppLayoutProps.SplitPanelPreferences) => void;\n handleSplitPanelResize: (newSize: number) => void;\n handleToolsClick: (value: boolean, skipFocusControl?: boolean) => void;\n hasBackgroundOverlap: boolean;\n hasDrawerViewportOverlay: boolean;\n hasNotificationsContent: boolean;\n hasOpenDrawer?: boolean;\n hasStickyBackground: boolean;\n isBackgroundOverlapDisabled: boolean;\n isMobile: boolean;\n isSplitPanelForcedPosition: boolean;\n isSplitPanelOpen?: boolean;\n isToolsOpen: boolean;\n layoutElement: React.Ref<HTMLElement>;\n layoutWidth: number;\n loseToolsFocus: () => void;\n loseDrawersFocus: () => void;\n mainElement: React.Ref<HTMLDivElement>;\n mainOffsetLeft: number;\n navigationRefs: FocusControlRefs;\n notificationsElement: React.Ref<HTMLDivElement>;\n notificationsHeight: number;\n offsetBottom: number;\n setHasStickyBackground: (value: boolean) => void;\n setSplitPanelReportedSize: (value: number) => void;\n setSplitPanelReportedHeaderHeight: (value: number) => void;\n headerHeight: number;\n footerHeight: number;\n splitPanelControlId: string;\n splitPanelMaxWidth: number;\n splitPanelPosition: AppLayoutProps.SplitPanelPosition;\n splitPanelReportedSize: number;\n splitPanelReportedHeaderHeight: number;\n splitPanelToggle: SplitPanelSideToggleProps;\n setSplitPanelToggle: (toggle: SplitPanelSideToggleProps) => void;\n splitPanelDisplayed: boolean;\n splitPanelRefs: SplitPanelFocusControlRefs;\n toolsControlId: string;\n toolsRefs: FocusControlRefs;\n __embeddedViewMode?: boolean;\n}\n\n/**\n * The default values are destructured in the context instantiation to\n * prevent downstream Typescript errors. This could likely be replaced\n * by a context interface definition that extends the AppLayout interface.\n */\nconst AppLayoutInternalsContext = createContext<AppLayoutInternals | null>(null);\n\ninterface AppLayoutProviderInternalsProps extends AppLayoutPropsWithDefaults {\n children: React.ReactNode;\n}\n\nexport function useAppLayoutInternals() {\n const ctx = useContext(AppLayoutInternalsContext);\n if (!ctx) {\n throw new Error('Invariant violation: this context is only available inside app layout');\n }\n return ctx;\n}\n\nexport const AppLayoutInternalsProvider = React.forwardRef(\n (props: AppLayoutProviderInternalsProps, forwardRef: React.Ref<AppLayoutProps.Ref>) => {\n const {\n toolsHide,\n toolsOpen: controlledToolsOpen,\n navigationHide,\n navigationOpen,\n contentType,\n placement,\n children,\n splitPanel,\n } = props;\n const isMobile = useMobile();\n\n // Private API for embedded view mode\n const __embeddedViewMode = Boolean((props as any).__embeddedViewMode);\n\n const [hasStickyBackground, setHasStickyBackground] = useState(false);\n\n /**\n * Set the default values for minimum and maximum content width.\n */\n const geckoMaxCssLength = ((1 << 30) - 1) / 60;\n const halfGeckoMaxCssLength = geckoMaxCssLength / 2;\n // CSS lengths in Gecko are limited to at most (1<<30)-1 app units (Gecko uses 60 as app unit).\n // Limit the maxContentWidth to the half of the upper boundary (≈4230^2) to be on the safe side.\n const maxContentWidth =\n props.maxContentWidth && props.maxContentWidth > halfGeckoMaxCssLength\n ? halfGeckoMaxCssLength\n : props.maxContentWidth ?? 0;\n const minContentWidth = props.minContentWidth ?? 280;\n\n const { refs: navigationRefs, setFocus: focusNavButtons } = useFocusControl(navigationOpen);\n\n const handleNavigationClick = useStableCallback(function handleNavigationChange(isOpen: boolean) {\n focusNavButtons();\n fireNonCancelableEvent(props.onNavigationChange, { open: isOpen });\n });\n\n useEffect(() => {\n // Close navigation drawer on mobile so that the main content is visible\n if (isMobile) {\n handleNavigationClick(false);\n }\n }, [isMobile, handleNavigationClick]);\n\n const toolsWidth = props.toolsWidth;\n const [isToolsOpen = false, setIsToolsOpen] = useControllable(controlledToolsOpen, props.onToolsChange, false, {\n componentName: 'AppLayout',\n controlledProp: 'toolsOpen',\n changeHandler: 'onToolsChange',\n });\n\n const {\n refs: toolsRefs,\n setFocus: focusToolsButtons,\n loseFocus: loseToolsFocus,\n } = useFocusControl(isToolsOpen, true);\n\n const handleToolsClick = useCallback(\n function handleToolsChange(isOpen: boolean, skipFocusControl?: boolean) {\n setIsToolsOpen(isOpen);\n !skipFocusControl && focusToolsButtons();\n fireNonCancelableEvent(props.onToolsChange, { open: isOpen });\n },\n [props.onToolsChange, setIsToolsOpen, focusToolsButtons]\n );\n\n /**\n * Set the default values for the minimum and maximum Split Panel width when it is\n * in the side position. The useLayoutEffect will compute the available space in the\n * DOM for the Split Panel given the current state. The minimum and maximum\n * widths will potentially trigger a side effect that will put the Split Panel into\n * a forced position on the bottom.\n */\n const [splitPanelMaxWidth, setSplitPanelMaxWidth] = useState(SPLIT_PANEL_MIN_WIDTH);\n\n /**\n * The useControllable hook will set the default value and manage either\n * the controlled or uncontrolled state of the Split Panel. By default\n * the Split Panel should always be closed on page load.\n *\n * The callback that will be passed to the SplitPanel component\n * to handle the click events that will change the state of the SplitPanel\n * to open or closed given the current state. It will set the isSplitPanelOpen\n * controlled state and fire the onSplitPanelToggle event.\n */\n const [isSplitPanelOpen, setIsSplitPanelOpen] = useControllable(\n props.splitPanelOpen,\n props.onSplitPanelToggle,\n false,\n { componentName: 'AppLayout', controlledProp: 'splitPanelOpen', changeHandler: 'onSplitPanelToggle' }\n );\n\n /**\n * The useControllable hook will manage the controlled or uncontrolled\n * state of the splitPanelPreferences. By default the splitPanelPreferences\n * is undefined. When set the object shape should have a single key to indicate\n * either bottom or side position.\n *\n * The callback that will handle changes to the splitPanelPreferences\n * object that will determine if the SplitPanel is rendered either on the\n * bottom of the viewport or within the Tools container.\n */\n const [splitPanelPreferences, setSplitPanelPreferences] = useControllable(\n props.splitPanelPreferences,\n props.onSplitPanelPreferencesChange,\n undefined,\n {\n componentName: 'AppLayout',\n controlledProp: 'splitPanelPreferences',\n changeHandler: 'onSplitPanelPreferencesChange',\n }\n );\n\n const { refs: splitPanelRefs, setLastInteraction: setSplitPanelLastInteraction } = useSplitPanelFocusControl([\n splitPanelPreferences,\n isSplitPanelOpen,\n ]);\n\n const handleSplitPanelClick = useCallback(\n function handleSplitPanelChange() {\n setIsSplitPanelOpen(!isSplitPanelOpen);\n setSplitPanelLastInteraction({ type: isSplitPanelOpen ? 'close' : 'open' });\n fireNonCancelableEvent(props.onSplitPanelToggle, { open: !isSplitPanelOpen });\n },\n [props.onSplitPanelToggle, isSplitPanelOpen, setIsSplitPanelOpen, setSplitPanelLastInteraction]\n );\n\n /**\n * The Split Panel will be in forced (bottom) position if the defined minimum width is\n * greater than the maximum width. In other words, the maximum width is the currently\n * available horizontal space based on all other components that are rendered. If the\n * minimum width exceeds this value then there is not enough horizontal space and we must\n * force it to the bottom position.\n */\n const isSplitPanelForcedPosition = isMobile || SPLIT_PANEL_MIN_WIDTH > splitPanelMaxWidth;\n const splitPanelPosition = getSplitPanelPosition(isSplitPanelForcedPosition, splitPanelPreferences);\n\n /**\n * The useControllable hook will set the default size of the SplitPanel based\n * on the default position set in the splitPanelPreferences. The logic for the\n * default size is contained in the SplitPanel component. The splitPanelControlledSize\n * will be bound to the size property in the SplitPanel context for rendering.\n *\n * The callback that will be passed to the SplitPanel component\n * to handle the resize events that will change the size of the SplitPanel.\n * It will set the splitPanelControlledSize controlled state and fire the\n * onSplitPanelResize event.\n */\n const [splitPanelReportedSize, setSplitPanelReportedSize] = useState(0);\n const [splitPanelReportedHeaderHeight, setSplitPanelReportedHeaderHeight] = useState(0);\n const [splitPanelToggle, setSplitPanelToggle] = useState<SplitPanelSideToggleProps>({\n displayed: false,\n ariaLabel: undefined,\n });\n const splitPanelDisplayed = !!(splitPanelToggle.displayed || isSplitPanelOpen) && !!splitPanel;\n const splitPanelControlId = useUniqueId('split-panel-');\n const toolsControlId = useUniqueId('tools-');\n\n const [splitPanelSize, setSplitPanelSize] = useControllable(\n props.splitPanelSize,\n props.onSplitPanelResize,\n getSplitPanelDefaultSize(splitPanelPosition),\n { componentName: 'AppLayout', controlledProp: 'splitPanelSize', changeHandler: 'onSplitPanelResize' }\n );\n\n const handleSplitPanelResize = useCallback(\n (size: number) => {\n setSplitPanelSize(size);\n fireNonCancelableEvent(props.onSplitPanelResize, { size });\n },\n [props.onSplitPanelResize, setSplitPanelSize]\n );\n\n const handleSplitPanelPreferencesChange = useCallback(\n function handleSplitPanelChange(detail: AppLayoutProps.SplitPanelPreferences) {\n setSplitPanelPreferences(detail);\n setSplitPanelLastInteraction({ type: 'position' });\n fireNonCancelableEvent(props.onSplitPanelPreferencesChange, detail);\n },\n [props.onSplitPanelPreferencesChange, setSplitPanelPreferences, setSplitPanelLastInteraction]\n );\n\n const {\n drawers,\n activeDrawer,\n activeDrawerId,\n minDrawerSize: drawersMinWidth,\n onActiveDrawerChange,\n onActiveDrawerResize,\n activeDrawerSize,\n ...drawersProps\n } = useDrawers(props, props.ariaLabels, {\n ariaLabels: props.ariaLabels,\n toolsHide,\n toolsOpen: isToolsOpen,\n tools: props.tools,\n toolsWidth,\n onToolsToggle: handleToolsClick,\n });\n\n const [drawersMaxWidth, setDrawersMaxWidth] = useState(toolsWidth);\n const hasDrawers = !!drawers && drawers.length > 0;\n\n const {\n refs: drawersRefs,\n setFocus: focusDrawersButtons,\n loseFocus: loseDrawersFocus,\n } = useFocusControl(!!activeDrawerId, true, activeDrawerId);\n\n const drawerRef = useRef<HTMLDivElement>(null);\n const { resizeHandle, drawerSize } = useResize(drawerRef, {\n onActiveDrawerResize,\n activeDrawerSize,\n activeDrawer,\n drawersRefs,\n isToolsOpen,\n drawersMaxWidth,\n drawersMinWidth,\n });\n\n const handleDrawersClick = (id: string | null, skipFocusControl?: boolean) => {\n const newActiveDrawerId = id !== activeDrawerId ? id : null;\n\n onActiveDrawerChange(newActiveDrawerId);\n\n !skipFocusControl && focusDrawersButtons();\n };\n\n let drawersTriggerCount = drawers ? drawers.length : !toolsHide ? 1 : 0;\n if (splitPanelDisplayed && splitPanelPosition === 'side') {\n drawersTriggerCount++;\n }\n const hasOpenDrawer =\n !!activeDrawerId ||\n (!toolsHide && isToolsOpen) ||\n (splitPanelDisplayed && splitPanelPosition === 'side' && isSplitPanelOpen);\n const hasDrawerViewportOverlay =\n isMobile && (!!activeDrawerId || (!navigationHide && navigationOpen) || (!toolsHide && isToolsOpen));\n\n const layoutElement = useRef<HTMLDivElement>(null);\n const mainElement = useRef<HTMLDivElement>(null);\n const [mainOffsetLeft, setMainOffsetLeft] = useState(0);\n\n const { hasBackgroundOverlap, updateBackgroundOverlapHeight } = useBackgroundOverlap({\n contentHeader: props.contentHeader,\n disableContentHeaderOverlap: props.disableContentHeaderOverlap,\n layoutElement,\n });\n\n useLayoutEffect(\n function handleMainOffsetLeft() {\n const offsetInlineStart = mainElement?.current ? getOffsetInlineStart(mainElement?.current) : 0;\n setMainOffsetLeft(offsetInlineStart);\n },\n [placement.inlineSize, navigationOpen, isToolsOpen, splitPanelReportedSize]\n );\n\n /**\n * On mobile viewports the navigation and tools drawers are adjusted to a fixed position\n * that consumes 100% of the viewport height and width. The body content could potentially\n * be scrollable underneath the drawer. In order to prevent this a CSS class needs to be\n * added to the document body that sets overflow to hidden.\n */\n useEffect(\n function handleBodyScroll() {\n if (isMobile && (navigationOpen || isToolsOpen || !!activeDrawer)) {\n document.body.classList.add(styles['block-body-scroll']);\n } else {\n document.body.classList.remove(styles['block-body-scroll']);\n }\n\n // Ensure the CSS class is removed from the body on side effect cleanup\n return function cleanup() {\n document.body.classList.remove(styles['block-body-scroll']);\n };\n },\n [isMobile, navigationOpen, isToolsOpen, activeDrawer]\n );\n\n /**\n * Because the notifications slot does not give us any direction insight into\n * what the state of the child content is we need to have a mechanism for\n * tracking the height of the notifications and whether or not it has content.\n * The height of the notifications is an integer that will be used as a custom\n * property on the Layout component to determine what the sticky offset should\n * be if there are sticky notifications. This could be any number including\n * zero based on how the child content renders. The hasNotificationsContent boolean\n * is simply centralizing the logic of the notifications height being > 0 such\n * that it is not repeated in various components (such as MobileToolbar) that need to\n * know if the notifications slot is empty.\n */\n const [notificationsContainerQuery, notificationsElement] = useContainerQuery(rect => rect.contentBoxHeight);\n\n const notificationsHeight = notificationsContainerQuery ?? 0;\n const hasNotificationsContent = notificationsHeight > 0;\n /**\n * Determine the offsetBottom value based on the presence of a footer element and\n * the SplitPanel component. Ignore the SplitPanel if it is not in the bottom\n * position. Use the size property if it is open and the header height if it is closed.\n */\n let offsetBottom = placement.insetBlockEnd;\n\n if (splitPanelDisplayed && splitPanelPosition === 'bottom') {\n if (isSplitPanelOpen) {\n offsetBottom += splitPanelReportedSize;\n } else {\n offsetBottom += splitPanelReportedHeaderHeight;\n }\n }\n\n /**\n * Warning! This is a hack! In order to accurately calculate if there is adequate\n * horizontal space for the Split Panel to be in the side position we need two values\n * that are not available in JavaScript.\n *\n * The first is the the content gap on the right which is stored in a design token\n * and applied in the Layout CSS:\n *\n * $contentGapRight: #{awsui.$space-layout-content-horizontal};\n *\n * The second is the width of the element that has the circular buttons for the\n * Tools and Split Panel. This could be suppressed given the state of the Tools\n * drawer returning a zero value. It would, however, be rendered if the Split Panel\n * were to move into the side position. This is calculated in the Tools CSS and\n * the Trigger button CSS with design tokens:\n *\n * padding: awsui.$space-scaled-s awsui.$space-layout-toggle-padding;\n * width: awsui.$space-layout-toggle-diameter;\n *\n * These values will be defined below as static integers that are rough approximations\n * of their computed width when rendered in the DOM, but doubled to ensure adequate\n * spacing for the Split Panel to be in side position.\n */\n useLayoutEffect(\n function handleSplitPanelMaxWidth() {\n const contentGapRight = 50; // Approximately 24px when rendered but doubled for safety\n const toolsFormOffsetWidth = 120; // Approximately 60px when rendered but doubled for safety\n const getPanelOffsetWidth = () => {\n if (drawers) {\n return activeDrawerId ? drawerSize : 0;\n }\n return isToolsOpen ? toolsWidth : 0;\n };\n\n setSplitPanelMaxWidth(\n placement.inlineSize -\n mainOffsetLeft -\n minContentWidth -\n contentGapRight -\n toolsFormOffsetWidth -\n getPanelOffsetWidth()\n );\n\n setDrawersMaxWidth(\n placement.inlineSize - mainOffsetLeft - minContentWidth - contentGapRight - toolsFormOffsetWidth\n );\n },\n [\n activeDrawerId,\n drawerSize,\n drawers,\n navigationOpen,\n isToolsOpen,\n placement.inlineSize,\n mainOffsetLeft,\n minContentWidth,\n toolsWidth,\n ]\n );\n\n /**\n * The useImperativeHandle hook in conjunction with the forwardRef function\n * in the AppLayout component definition expose the following callable\n * functions to component consumers when they put a ref as a property on\n * their component implementation.\n */\n useImperativeHandle(\n forwardRef,\n function createImperativeHandle() {\n return {\n closeNavigationIfNecessary: function () {\n isMobile && handleNavigationClick(false);\n },\n openTools: function () {\n handleToolsClick(true);\n },\n focusToolsClose: () => {\n if (hasDrawers) {\n focusDrawersButtons(true);\n } else {\n focusToolsButtons(true);\n }\n },\n focusActiveDrawer: () => focusDrawersButtons(true),\n focusSplitPanel: () => splitPanelRefs.slider.current?.focus(),\n };\n },\n [\n isMobile,\n handleNavigationClick,\n handleToolsClick,\n focusToolsButtons,\n focusDrawersButtons,\n splitPanelRefs.slider,\n hasDrawers,\n ]\n );\n\n return (\n <AppLayoutInternalsContext.Provider\n value={{\n ...props,\n activeDrawerId,\n contentType,\n drawers,\n drawersAriaLabel: drawersProps.ariaLabelsWithDrawers?.drawers,\n drawersOverflowAriaLabel: drawersProps.ariaLabelsWithDrawers?.drawersOverflow,\n drawersOverflowWithBadgeAriaLabel: drawersProps.ariaLabelsWithDrawers?.drawersOverflowWithBadge,\n drawersRefs,\n drawersMinWidth,\n drawersMaxWidth,\n drawerSize,\n drawerRef,\n resizeHandle,\n drawersTriggerCount,\n headerHeight: placement.insetBlockStart,\n footerHeight: placement.insetBlockEnd,\n hasDrawerViewportOverlay,\n handleDrawersClick,\n handleNavigationClick,\n handleSplitPanelClick,\n handleSplitPanelPreferencesChange,\n handleSplitPanelResize,\n handleToolsClick,\n hasBackgroundOverlap,\n hasNotificationsContent,\n hasOpenDrawer,\n hasStickyBackground,\n isBackgroundOverlapDisabled: props.disableContentHeaderOverlap || !hasBackgroundOverlap,\n isMobile,\n isSplitPanelForcedPosition,\n isSplitPanelOpen,\n isToolsOpen,\n layoutElement,\n layoutWidth: placement.inlineSize,\n loseToolsFocus,\n loseDrawersFocus,\n mainElement,\n mainOffsetLeft,\n maxContentWidth,\n minContentWidth,\n navigationHide,\n navigationRefs,\n notificationsElement,\n notificationsHeight,\n offsetBottom,\n setHasStickyBackground,\n setSplitPanelReportedSize,\n setSplitPanelReportedHeaderHeight,\n splitPanel,\n splitPanelControlId,\n splitPanelDisplayed,\n splitPanelMaxWidth,\n splitPanelPosition,\n splitPanelPreferences,\n splitPanelReportedSize,\n splitPanelReportedHeaderHeight,\n splitPanelSize,\n splitPanelToggle,\n setSplitPanelToggle,\n splitPanelRefs,\n toolsControlId,\n toolsHide,\n toolsOpen: isToolsOpen,\n toolsWidth,\n toolsRefs,\n __embeddedViewMode,\n }}\n >\n <AppLayoutContext.Provider value={{ setHasStickyBackground }}>\n <DynamicOverlapContext.Provider value={updateBackgroundOverlapHeight}>\n {children}\n </DynamicOverlapContext.Provider>\n </AppLayoutContext.Provider>\n </AppLayoutInternalsContext.Provider>\n );\n }\n);\n"]}
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/context.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EACZ,aAAa,EACb,WAAW,EACX,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,UAAU,GACX,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AAEvF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB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,YAAY,CAAC,qBAAqB,0CAAE,wBAAwB,EAC/F,WAAW;YACX,eAAe;YACf,eAAe;YACf,UAAU;YACV,SAAS;YACT,YAAY;YACZ,mBAAmB,EACnB,YAAY,EAAE,SAAS,CAAC,eAAe,EACvC,YAAY,EAAE,SAAS,CAAC,aAAa,EACrC,wBAAwB;YACxB,kBAAkB;YAClB,qBAAqB;YACrB,qBAAqB;YACrB,iCAAiC;YACjC,sBAAsB;YACtB,gBAAgB;YAChB,oBAAoB;YACpB,uBAAuB;YACvB,aAAa,EACb,2BAA2B,EAAE,KAAK,CAAC,2BAA2B,IAAI,CAAC,oBAAoB,EACvF,QAAQ;YACR,0BAA0B;YAC1B,gBAAgB;YAChB,WAAW;YACX,aAAa,EACb,WAAW,EAAE,SAAS,CAAC,UAAU,EACjC,cAAc;YACd,gBAAgB;YAChB,WAAW;YACX,cAAc;YACd,eAAe;YACf,eAAe;YACf,cAAc;YACd,cAAc;YACd,oBAAoB;YACpB,mBAAmB;YACnB,YAAY;YACZ,yBAAyB;YACzB,iCAAiC;YACjC,UAAU;YACV,mBAAmB;YACnB,mBAAmB;YACnB,kBAAkB;YAClB,kBAAkB;YAClB,qBAAqB;YACrB,sBAAsB;YACtB,8BAA8B;YAC9B,cAAc;YACd,gBAAgB;YAChB,mBAAmB;YACnB,cAAc;YACd,cAAc;YACd,SAAS,EACT,SAAS,EAAE,WAAW,EACtB,UAAU;YACV,SAAS;YACT,kBAAkB;QAGpB,oBAAC,qBAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,6BAA6B,IACjE,QAAQ,CACsB,CACE,CACtC,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, {\n createContext,\n useCallback,\n useEffect,\n useLayoutEffect,\n useImperativeHandle,\n useRef,\n useState,\n useContext,\n} from 'react';\nimport { DynamicOverlapContext } from '../../internal/context/dynamic-overlap-context';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from '../interfaces';\nimport { fireNonCancelableEvent } from '../../internal/events';\nimport { FocusControlRefs, useFocusControl } from '../utils/use-focus-control';\nimport { getSplitPanelDefaultSize } from '../../split-panel/utils/size-utils';\nimport { getSplitPanelPosition } from './split-panel';\nimport { useControllable } from '../../internal/hooks/use-controllable';\nimport { SplitPanelFocusControlRefs, useSplitPanelFocusControl } from '../utils/use-split-panel-focus-control';\nimport { SplitPanelSideToggleProps } from '../../internal/context/split-panel-context';\nimport { useMobile } from '../../internal/hooks/use-mobile';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\nimport useResize from '../utils/use-resize';\nimport styles from './styles.css.js';\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport useBackgroundOverlap from './use-background-overlap';\nimport { useDrawers } from '../utils/use-drawers';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport { SPLIT_PANEL_MIN_WIDTH } from '../split-panel';\nimport { getOffsetInlineStart } from '@cloudscape-design/component-toolkit/internal';\n\ninterface AppLayoutInternals extends AppLayoutPropsWithDefaults {\n activeDrawerId: string | null;\n drawers: Array<AppLayoutProps.Drawer> | undefined;\n drawersAriaLabel: string | undefined;\n drawersOverflowAriaLabel: string | undefined;\n drawersOverflowWithBadgeAriaLabel: string | undefined;\n drawersRefs: FocusControlRefs;\n drawerSize: number;\n drawersMinWidth: number;\n drawersMaxWidth: number;\n drawerRef: React.Ref<HTMLElement>;\n resizeHandle: React.ReactElement;\n drawersTriggerCount: number;\n handleDrawersClick: (activeDrawerId: string | null, skipFocusControl?: boolean) => void;\n handleSplitPanelClick: () => void;\n handleNavigationClick: (isOpen: boolean) => void;\n handleSplitPanelPreferencesChange: (detail: AppLayoutProps.SplitPanelPreferences) => void;\n handleSplitPanelResize: (newSize: number) => void;\n handleToolsClick: (value: boolean, skipFocusControl?: boolean) => void;\n hasBackgroundOverlap: boolean;\n hasDrawerViewportOverlay: boolean;\n hasNotificationsContent: boolean;\n hasOpenDrawer?: boolean;\n isBackgroundOverlapDisabled: boolean;\n isMobile: boolean;\n isSplitPanelForcedPosition: boolean;\n isSplitPanelOpen?: boolean;\n isToolsOpen: boolean;\n layoutElement: React.Ref<HTMLElement>;\n layoutWidth: number;\n loseToolsFocus: () => void;\n loseDrawersFocus: () => void;\n mainElement: React.Ref<HTMLDivElement>;\n mainOffsetLeft: number;\n navigationRefs: FocusControlRefs;\n notificationsElement: React.Ref<HTMLDivElement>;\n notificationsHeight: number;\n offsetBottom: number;\n setSplitPanelReportedSize: (value: number) => void;\n setSplitPanelReportedHeaderHeight: (value: number) => void;\n headerHeight: number;\n footerHeight: number;\n splitPanelControlId: string;\n splitPanelMaxWidth: number;\n splitPanelPosition: AppLayoutProps.SplitPanelPosition;\n splitPanelReportedSize: number;\n splitPanelReportedHeaderHeight: number;\n splitPanelToggle: SplitPanelSideToggleProps;\n setSplitPanelToggle: (toggle: SplitPanelSideToggleProps) => void;\n splitPanelDisplayed: boolean;\n splitPanelRefs: SplitPanelFocusControlRefs;\n toolsControlId: string;\n toolsRefs: FocusControlRefs;\n __embeddedViewMode?: boolean;\n}\n\n/**\n * The default values are destructured in the context instantiation to\n * prevent downstream Typescript errors. This could likely be replaced\n * by a context interface definition that extends the AppLayout interface.\n */\nconst AppLayoutInternalsContext = createContext<AppLayoutInternals | null>(null);\n\ninterface AppLayoutProviderInternalsProps extends AppLayoutPropsWithDefaults {\n children: React.ReactNode;\n}\n\nexport function useAppLayoutInternals() {\n const ctx = useContext(AppLayoutInternalsContext);\n if (!ctx) {\n throw new Error('Invariant violation: this context is only available inside app layout');\n }\n return ctx;\n}\n\nexport const AppLayoutInternalsProvider = React.forwardRef(\n (props: AppLayoutProviderInternalsProps, forwardRef: React.Ref<AppLayoutProps.Ref>) => {\n const {\n toolsHide,\n toolsOpen: controlledToolsOpen,\n navigationHide,\n navigationOpen,\n contentType,\n placement,\n children,\n splitPanel,\n } = props;\n const isMobile = useMobile();\n\n // Private API for embedded view mode\n const __embeddedViewMode = Boolean((props as any).__embeddedViewMode);\n\n /**\n * Set the default values for minimum and maximum content width.\n */\n const geckoMaxCssLength = ((1 << 30) - 1) / 60;\n const halfGeckoMaxCssLength = geckoMaxCssLength / 2;\n // CSS lengths in Gecko are limited to at most (1<<30)-1 app units (Gecko uses 60 as app unit).\n // Limit the maxContentWidth to the half of the upper boundary (≈4230^2) to be on the safe side.\n const maxContentWidth =\n props.maxContentWidth && props.maxContentWidth > halfGeckoMaxCssLength\n ? halfGeckoMaxCssLength\n : props.maxContentWidth ?? 0;\n const minContentWidth = props.minContentWidth ?? 280;\n\n const { refs: navigationRefs, setFocus: focusNavButtons } = useFocusControl(navigationOpen);\n\n const handleNavigationClick = useStableCallback(function handleNavigationChange(isOpen: boolean) {\n focusNavButtons();\n fireNonCancelableEvent(props.onNavigationChange, { open: isOpen });\n });\n\n useEffect(() => {\n // Close navigation drawer on mobile so that the main content is visible\n if (isMobile) {\n handleNavigationClick(false);\n }\n }, [isMobile, handleNavigationClick]);\n\n const toolsWidth = props.toolsWidth;\n const [isToolsOpen = false, setIsToolsOpen] = useControllable(controlledToolsOpen, props.onToolsChange, false, {\n componentName: 'AppLayout',\n controlledProp: 'toolsOpen',\n changeHandler: 'onToolsChange',\n });\n\n const {\n refs: toolsRefs,\n setFocus: focusToolsButtons,\n loseFocus: loseToolsFocus,\n } = useFocusControl(isToolsOpen, true);\n\n const handleToolsClick = useCallback(\n function handleToolsChange(isOpen: boolean, skipFocusControl?: boolean) {\n setIsToolsOpen(isOpen);\n !skipFocusControl && focusToolsButtons();\n fireNonCancelableEvent(props.onToolsChange, { open: isOpen });\n },\n [props.onToolsChange, setIsToolsOpen, focusToolsButtons]\n );\n\n /**\n * Set the default values for the minimum and maximum Split Panel width when it is\n * in the side position. The useLayoutEffect will compute the available space in the\n * DOM for the Split Panel given the current state. The minimum and maximum\n * widths will potentially trigger a side effect that will put the Split Panel into\n * a forced position on the bottom.\n */\n const [splitPanelMaxWidth, setSplitPanelMaxWidth] = useState(SPLIT_PANEL_MIN_WIDTH);\n\n /**\n * The useControllable hook will set the default value and manage either\n * the controlled or uncontrolled state of the Split Panel. By default\n * the Split Panel should always be closed on page load.\n *\n * The callback that will be passed to the SplitPanel component\n * to handle the click events that will change the state of the SplitPanel\n * to open or closed given the current state. It will set the isSplitPanelOpen\n * controlled state and fire the onSplitPanelToggle event.\n */\n const [isSplitPanelOpen, setIsSplitPanelOpen] = useControllable(\n props.splitPanelOpen,\n props.onSplitPanelToggle,\n false,\n { componentName: 'AppLayout', controlledProp: 'splitPanelOpen', changeHandler: 'onSplitPanelToggle' }\n );\n\n /**\n * The useControllable hook will manage the controlled or uncontrolled\n * state of the splitPanelPreferences. By default the splitPanelPreferences\n * is undefined. When set the object shape should have a single key to indicate\n * either bottom or side position.\n *\n * The callback that will handle changes to the splitPanelPreferences\n * object that will determine if the SplitPanel is rendered either on the\n * bottom of the viewport or within the Tools container.\n */\n const [splitPanelPreferences, setSplitPanelPreferences] = useControllable(\n props.splitPanelPreferences,\n props.onSplitPanelPreferencesChange,\n undefined,\n {\n componentName: 'AppLayout',\n controlledProp: 'splitPanelPreferences',\n changeHandler: 'onSplitPanelPreferencesChange',\n }\n );\n\n const { refs: splitPanelRefs, setLastInteraction: setSplitPanelLastInteraction } = useSplitPanelFocusControl([\n splitPanelPreferences,\n isSplitPanelOpen,\n ]);\n\n const handleSplitPanelClick = useCallback(\n function handleSplitPanelChange() {\n setIsSplitPanelOpen(!isSplitPanelOpen);\n setSplitPanelLastInteraction({ type: isSplitPanelOpen ? 'close' : 'open' });\n fireNonCancelableEvent(props.onSplitPanelToggle, { open: !isSplitPanelOpen });\n },\n [props.onSplitPanelToggle, isSplitPanelOpen, setIsSplitPanelOpen, setSplitPanelLastInteraction]\n );\n\n /**\n * The Split Panel will be in forced (bottom) position if the defined minimum width is\n * greater than the maximum width. In other words, the maximum width is the currently\n * available horizontal space based on all other components that are rendered. If the\n * minimum width exceeds this value then there is not enough horizontal space and we must\n * force it to the bottom position.\n */\n const isSplitPanelForcedPosition = isMobile || SPLIT_PANEL_MIN_WIDTH > splitPanelMaxWidth;\n const splitPanelPosition = getSplitPanelPosition(isSplitPanelForcedPosition, splitPanelPreferences);\n\n /**\n * The useControllable hook will set the default size of the SplitPanel based\n * on the default position set in the splitPanelPreferences. The logic for the\n * default size is contained in the SplitPanel component. The splitPanelControlledSize\n * will be bound to the size property in the SplitPanel context for rendering.\n *\n * The callback that will be passed to the SplitPanel component\n * to handle the resize events that will change the size of the SplitPanel.\n * It will set the splitPanelControlledSize controlled state and fire the\n * onSplitPanelResize event.\n */\n const [splitPanelReportedSize, setSplitPanelReportedSize] = useState(0);\n const [splitPanelReportedHeaderHeight, setSplitPanelReportedHeaderHeight] = useState(0);\n const [splitPanelToggle, setSplitPanelToggle] = useState<SplitPanelSideToggleProps>({\n displayed: false,\n ariaLabel: undefined,\n });\n const splitPanelDisplayed = !!(splitPanelToggle.displayed || isSplitPanelOpen) && !!splitPanel;\n const splitPanelControlId = useUniqueId('split-panel-');\n const toolsControlId = useUniqueId('tools-');\n\n const [splitPanelSize, setSplitPanelSize] = useControllable(\n props.splitPanelSize,\n props.onSplitPanelResize,\n getSplitPanelDefaultSize(splitPanelPosition),\n { componentName: 'AppLayout', controlledProp: 'splitPanelSize', changeHandler: 'onSplitPanelResize' }\n );\n\n const handleSplitPanelResize = useCallback(\n (size: number) => {\n setSplitPanelSize(size);\n fireNonCancelableEvent(props.onSplitPanelResize, { size });\n },\n [props.onSplitPanelResize, setSplitPanelSize]\n );\n\n const handleSplitPanelPreferencesChange = useCallback(\n function handleSplitPanelChange(detail: AppLayoutProps.SplitPanelPreferences) {\n setSplitPanelPreferences(detail);\n setSplitPanelLastInteraction({ type: 'position' });\n fireNonCancelableEvent(props.onSplitPanelPreferencesChange, detail);\n },\n [props.onSplitPanelPreferencesChange, setSplitPanelPreferences, setSplitPanelLastInteraction]\n );\n\n const {\n drawers,\n activeDrawer,\n activeDrawerId,\n minDrawerSize: drawersMinWidth,\n onActiveDrawerChange,\n onActiveDrawerResize,\n activeDrawerSize,\n ...drawersProps\n } = useDrawers(props, props.ariaLabels, {\n ariaLabels: props.ariaLabels,\n toolsHide,\n toolsOpen: isToolsOpen,\n tools: props.tools,\n toolsWidth,\n onToolsToggle: handleToolsClick,\n });\n\n const [drawersMaxWidth, setDrawersMaxWidth] = useState(toolsWidth);\n const hasDrawers = !!drawers && drawers.length > 0;\n\n const {\n refs: drawersRefs,\n setFocus: focusDrawersButtons,\n loseFocus: loseDrawersFocus,\n } = useFocusControl(!!activeDrawerId, true, activeDrawerId);\n\n const drawerRef = useRef<HTMLDivElement>(null);\n const { resizeHandle, drawerSize } = useResize(drawerRef, {\n onActiveDrawerResize,\n activeDrawerSize,\n activeDrawer,\n drawersRefs,\n isToolsOpen,\n drawersMaxWidth,\n drawersMinWidth,\n });\n\n const handleDrawersClick = (id: string | null, skipFocusControl?: boolean) => {\n const newActiveDrawerId = id !== activeDrawerId ? id : null;\n\n onActiveDrawerChange(newActiveDrawerId);\n\n !skipFocusControl && focusDrawersButtons();\n };\n\n let drawersTriggerCount = drawers ? drawers.length : !toolsHide ? 1 : 0;\n if (splitPanelDisplayed && splitPanelPosition === 'side') {\n drawersTriggerCount++;\n }\n const hasOpenDrawer =\n !!activeDrawerId ||\n (!toolsHide && isToolsOpen) ||\n (splitPanelDisplayed && splitPanelPosition === 'side' && isSplitPanelOpen);\n const hasDrawerViewportOverlay =\n isMobile && (!!activeDrawerId || (!navigationHide && navigationOpen) || (!toolsHide && isToolsOpen));\n\n const layoutElement = useRef<HTMLDivElement>(null);\n const mainElement = useRef<HTMLDivElement>(null);\n const [mainOffsetLeft, setMainOffsetLeft] = useState(0);\n\n const { hasBackgroundOverlap, updateBackgroundOverlapHeight } = useBackgroundOverlap({\n contentHeader: props.contentHeader,\n disableContentHeaderOverlap: props.disableContentHeaderOverlap,\n layoutElement,\n });\n\n useLayoutEffect(\n function handleMainOffsetLeft() {\n const offsetInlineStart = mainElement?.current ? getOffsetInlineStart(mainElement?.current) : 0;\n setMainOffsetLeft(offsetInlineStart);\n },\n [placement.inlineSize, navigationOpen, isToolsOpen, splitPanelReportedSize]\n );\n\n /**\n * On mobile viewports the navigation and tools drawers are adjusted to a fixed position\n * that consumes 100% of the viewport height and width. The body content could potentially\n * be scrollable underneath the drawer. In order to prevent this a CSS class needs to be\n * added to the document body that sets overflow to hidden.\n */\n useEffect(\n function handleBodyScroll() {\n if (isMobile && (navigationOpen || isToolsOpen || !!activeDrawer)) {\n document.body.classList.add(styles['block-body-scroll']);\n } else {\n document.body.classList.remove(styles['block-body-scroll']);\n }\n\n // Ensure the CSS class is removed from the body on side effect cleanup\n return function cleanup() {\n document.body.classList.remove(styles['block-body-scroll']);\n };\n },\n [isMobile, navigationOpen, isToolsOpen, activeDrawer]\n );\n\n /**\n * Because the notifications slot does not give us any direction insight into\n * what the state of the child content is we need to have a mechanism for\n * tracking the height of the notifications and whether or not it has content.\n * The height of the notifications is an integer that will be used as a custom\n * property on the Layout component to determine what the sticky offset should\n * be if there are sticky notifications. This could be any number including\n * zero based on how the child content renders. The hasNotificationsContent boolean\n * is simply centralizing the logic of the notifications height being > 0 such\n * that it is not repeated in various components (such as MobileToolbar) that need to\n * know if the notifications slot is empty.\n */\n const [notificationsContainerQuery, notificationsElement] = useContainerQuery(rect => rect.contentBoxHeight);\n\n const notificationsHeight = notificationsContainerQuery ?? 0;\n const hasNotificationsContent = notificationsHeight > 0;\n /**\n * Determine the offsetBottom value based on the presence of a footer element and\n * the SplitPanel component. Ignore the SplitPanel if it is not in the bottom\n * position. Use the size property if it is open and the header height if it is closed.\n */\n let offsetBottom = placement.insetBlockEnd;\n\n if (splitPanelDisplayed && splitPanelPosition === 'bottom') {\n if (isSplitPanelOpen) {\n offsetBottom += splitPanelReportedSize;\n } else {\n offsetBottom += splitPanelReportedHeaderHeight;\n }\n }\n\n /**\n * Warning! This is a hack! In order to accurately calculate if there is adequate\n * horizontal space for the Split Panel to be in the side position we need two values\n * that are not available in JavaScript.\n *\n * The first is the the content gap on the right which is stored in a design token\n * and applied in the Layout CSS:\n *\n * $contentGapRight: #{awsui.$space-layout-content-horizontal};\n *\n * The second is the width of the element that has the circular buttons for the\n * Tools and Split Panel. This could be suppressed given the state of the Tools\n * drawer returning a zero value. It would, however, be rendered if the Split Panel\n * were to move into the side position. This is calculated in the Tools CSS and\n * the Trigger button CSS with design tokens:\n *\n * padding: awsui.$space-scaled-s awsui.$space-layout-toggle-padding;\n * width: awsui.$space-layout-toggle-diameter;\n *\n * These values will be defined below as static integers that are rough approximations\n * of their computed width when rendered in the DOM, but doubled to ensure adequate\n * spacing for the Split Panel to be in side position.\n */\n useLayoutEffect(\n function handleSplitPanelMaxWidth() {\n const contentGapRight = 50; // Approximately 24px when rendered but doubled for safety\n const toolsFormOffsetWidth = 120; // Approximately 60px when rendered but doubled for safety\n const getPanelOffsetWidth = () => {\n if (drawers) {\n return activeDrawerId ? drawerSize : 0;\n }\n return isToolsOpen ? toolsWidth : 0;\n };\n\n setSplitPanelMaxWidth(\n placement.inlineSize -\n mainOffsetLeft -\n minContentWidth -\n contentGapRight -\n toolsFormOffsetWidth -\n getPanelOffsetWidth()\n );\n\n setDrawersMaxWidth(\n placement.inlineSize - mainOffsetLeft - minContentWidth - contentGapRight - toolsFormOffsetWidth\n );\n },\n [\n activeDrawerId,\n drawerSize,\n drawers,\n navigationOpen,\n isToolsOpen,\n placement.inlineSize,\n mainOffsetLeft,\n minContentWidth,\n toolsWidth,\n ]\n );\n\n /**\n * The useImperativeHandle hook in conjunction with the forwardRef function\n * in the AppLayout component definition expose the following callable\n * functions to component consumers when they put a ref as a property on\n * their component implementation.\n */\n useImperativeHandle(\n forwardRef,\n function createImperativeHandle() {\n return {\n closeNavigationIfNecessary: function () {\n isMobile && handleNavigationClick(false);\n },\n openTools: function () {\n handleToolsClick(true);\n },\n focusToolsClose: () => {\n if (hasDrawers) {\n focusDrawersButtons(true);\n } else {\n focusToolsButtons(true);\n }\n },\n focusActiveDrawer: () => focusDrawersButtons(true),\n focusSplitPanel: () => splitPanelRefs.slider.current?.focus(),\n };\n },\n [\n isMobile,\n handleNavigationClick,\n handleToolsClick,\n focusToolsButtons,\n focusDrawersButtons,\n splitPanelRefs.slider,\n hasDrawers,\n ]\n );\n\n return (\n <AppLayoutInternalsContext.Provider\n value={{\n ...props,\n activeDrawerId,\n contentType,\n drawers,\n drawersAriaLabel: drawersProps.ariaLabelsWithDrawers?.drawers,\n drawersOverflowAriaLabel: drawersProps.ariaLabelsWithDrawers?.drawersOverflow,\n drawersOverflowWithBadgeAriaLabel: drawersProps.ariaLabelsWithDrawers?.drawersOverflowWithBadge,\n drawersRefs,\n drawersMinWidth,\n drawersMaxWidth,\n drawerSize,\n drawerRef,\n resizeHandle,\n drawersTriggerCount,\n headerHeight: placement.insetBlockStart,\n footerHeight: placement.insetBlockEnd,\n hasDrawerViewportOverlay,\n handleDrawersClick,\n handleNavigationClick,\n handleSplitPanelClick,\n handleSplitPanelPreferencesChange,\n handleSplitPanelResize,\n handleToolsClick,\n hasBackgroundOverlap,\n hasNotificationsContent,\n hasOpenDrawer,\n isBackgroundOverlapDisabled: props.disableContentHeaderOverlap || !hasBackgroundOverlap,\n isMobile,\n isSplitPanelForcedPosition,\n isSplitPanelOpen,\n isToolsOpen,\n layoutElement,\n layoutWidth: placement.inlineSize,\n loseToolsFocus,\n loseDrawersFocus,\n mainElement,\n mainOffsetLeft,\n maxContentWidth,\n minContentWidth,\n navigationHide,\n navigationRefs,\n notificationsElement,\n notificationsHeight,\n offsetBottom,\n setSplitPanelReportedSize,\n setSplitPanelReportedHeaderHeight,\n splitPanel,\n splitPanelControlId,\n splitPanelDisplayed,\n splitPanelMaxWidth,\n splitPanelPosition,\n splitPanelPreferences,\n splitPanelReportedSize,\n splitPanelReportedHeaderHeight,\n splitPanelSize,\n splitPanelToggle,\n setSplitPanelToggle,\n splitPanelRefs,\n toolsControlId,\n toolsHide,\n toolsOpen: isToolsOpen,\n toolsWidth,\n toolsRefs,\n __embeddedViewMode,\n }}\n >\n <DynamicOverlapContext.Provider value={updateBackgroundOverlapHeight}>\n {children}\n </DynamicOverlapContext.Provider>\n </AppLayoutInternalsContext.Provider>\n );\n }\n);\n"]}
@@ -61,7 +61,7 @@ function ActiveDrawer() {
61
61
  } },
62
62
  !isMobile && (activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.resizable) && React.createElement("div", { className: styles['drawer-slider'] }, resizeHandle),
63
63
  React.createElement("div", { className: styles['drawer-content-container'] },
64
- React.createElement("div", { className: clsx(styles['drawer-close-button']) },
64
+ React.createElement("div", { className: styles['drawer-close-button'] },
65
65
  React.createElement(InternalButton, { ariaLabel: computedAriaLabels.closeButton, className: clsx({
66
66
  [testutilStyles['active-drawer-close-button']]: activeDrawerId,
67
67
  [testutilStyles['tools-close']]: isToolsDrawer,
@@ -142,7 +142,7 @@ export function MobileTriggers() {
142
142
  return (React.createElement("aside", { "aria-hidden": hasDrawerViewportOverlay, className: clsx({
143
143
  [styles.unfocusable]: hasDrawerViewportOverlay,
144
144
  }), "aria-label": drawersAriaLabel, role: "region" },
145
- React.createElement("div", { className: clsx(styles['drawers-mobile-triggers-container']), role: "toolbar", "aria-orientation": "horizontal" },
145
+ React.createElement("div", { className: styles['drawers-mobile-triggers-container'], role: "toolbar", "aria-orientation": "horizontal" },
146
146
  visibleItems.map(item => {
147
147
  var _a;
148
148
  return (React.createElement(InternalButton, { ariaExpanded: item.id === activeDrawerId, ariaLabel: (_a = item.ariaLabels) === null || _a === void 0 ? void 0 : _a.triggerButton, className: clsx(styles['drawers-trigger'], testutilStyles['drawers-trigger'], item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']), disabled: hasDrawerViewportOverlay, ref: item.id === previousActiveDrawerId.current ? drawersRefs.toggle : undefined, formAction: "none", iconName: item.trigger.iconName, iconSvg: item.trigger.iconSvg, badge: item.badge, key: item.id, onClick: () => handleDrawersClick(item.id), variant: "icon", __nativeAttributes: { 'aria-haspopup': true, 'data-testid': `awsui-app-layout-trigger-${item.id}` } }));