@cloudscape-design/components 3.0.1163 → 3.0.1164

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/app-layout/visual-refresh/drawers.d.ts.map +1 -1
  2. package/app-layout/visual-refresh/drawers.js +2 -2
  3. package/app-layout/visual-refresh/drawers.js.map +1 -1
  4. package/app-layout/visual-refresh/main.d.ts.map +1 -1
  5. package/app-layout/visual-refresh/main.js +1 -3
  6. package/app-layout/visual-refresh/main.js.map +1 -1
  7. package/app-layout/visual-refresh-toolbar/drawer/local-drawer.d.ts.map +1 -1
  8. package/app-layout/visual-refresh-toolbar/drawer/local-drawer.js +2 -2
  9. package/app-layout/visual-refresh-toolbar/drawer/local-drawer.js.map +1 -1
  10. package/app-layout/visual-refresh-toolbar/skeleton/index.d.ts.map +1 -1
  11. package/app-layout/visual-refresh-toolbar/skeleton/index.js +1 -2
  12. package/app-layout/visual-refresh-toolbar/skeleton/index.js.map +1 -1
  13. package/container/internal.d.ts +0 -6
  14. package/container/internal.d.ts.map +1 -1
  15. package/container/internal.js +28 -32
  16. package/container/internal.js.map +1 -1
  17. package/drawer/implementation.d.ts.map +1 -1
  18. package/drawer/implementation.js +3 -5
  19. package/drawer/implementation.js.map +1 -1
  20. package/form/internal.d.ts.map +1 -1
  21. package/form/internal.js +14 -20
  22. package/form/internal.js.map +1 -1
  23. package/i18n/messages-types.d.ts +4 -5
  24. package/i18n/messages-types.d.ts.map +1 -1
  25. package/i18n/messages-types.js.map +1 -1
  26. package/index.d.ts +0 -1
  27. package/index.d.ts.map +1 -1
  28. package/index.js +0 -1
  29. package/index.js.map +1 -1
  30. package/internal/base-component/styles.scoped.css +1 -1
  31. package/internal/environment.js +2 -2
  32. package/internal/environment.json +2 -2
  33. package/internal/manifest.json +1 -1
  34. package/modal/internal.d.ts.map +1 -1
  35. package/modal/internal.js +5 -8
  36. package/modal/internal.js.map +1 -1
  37. package/package.json +1 -2
  38. package/popover/body.d.ts.map +1 -1
  39. package/popover/body.js +8 -10
  40. package/popover/body.js.map +1 -1
  41. package/split-panel/implementation.d.ts.map +1 -1
  42. package/split-panel/implementation.js +2 -5
  43. package/split-panel/implementation.js.map +1 -1
  44. package/tabs/index.d.ts.map +1 -1
  45. package/tabs/index.js +1 -1
  46. package/tabs/index.js.map +1 -1
  47. package/test-utils/dom/index.d.ts +0 -20
  48. package/test-utils/dom/index.js +2 -16
  49. package/test-utils/dom/index.js.map +1 -1
  50. package/test-utils/selectors/index.d.ts +0 -18
  51. package/test-utils/selectors/index.js +2 -16
  52. package/test-utils/selectors/index.js.map +1 -1
  53. package/error-boundary/fallback.d.ts +0 -5
  54. package/error-boundary/fallback.d.ts.map +0 -1
  55. package/error-boundary/fallback.js +0 -61
  56. package/error-boundary/fallback.js.map +0 -1
  57. package/error-boundary/index.d.ts +0 -7
  58. package/error-boundary/index.d.ts.map +0 -1
  59. package/error-boundary/index.js +0 -22
  60. package/error-boundary/index.js.map +0 -1
  61. package/error-boundary/interfaces.d.ts +0 -84
  62. package/error-boundary/interfaces.d.ts.map +0 -1
  63. package/error-boundary/interfaces.js +0 -4
  64. package/error-boundary/interfaces.js.map +0 -1
  65. package/error-boundary/internal.d.ts +0 -30
  66. package/error-boundary/internal.d.ts.map +0 -1
  67. package/error-boundary/internal.js +0 -58
  68. package/error-boundary/internal.js.map +0 -1
  69. package/error-boundary/styles.css.js +0 -9
  70. package/error-boundary/styles.scoped.css +0 -10
  71. package/error-boundary/styles.selectors.js +0 -10
  72. package/error-boundary/test-classes/styles.css.js +0 -11
  73. package/error-boundary/test-classes/styles.scoped.css +0 -12
  74. package/error-boundary/test-classes/styles.selectors.js +0 -12
  75. package/error-boundary/utils.d.ts +0 -1
  76. package/error-boundary/utils.d.ts.map +0 -1
  77. package/error-boundary/utils.js +0 -7
  78. package/error-boundary/utils.js.map +0 -1
  79. package/test-utils/dom/error-boundary/index.d.ts +0 -9
  80. package/test-utils/dom/error-boundary/index.js +0 -26
  81. package/test-utils/dom/error-boundary/index.js.map +0 -1
  82. package/test-utils/selectors/error-boundary/index.d.ts +0 -9
  83. package/test-utils/selectors/error-boundary/index.js +0 -26
  84. package/test-utils/selectors/error-boundary/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"drawers.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/drawers.tsx"],"names":[],"mappings":"AA8BA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,uBA+B9B;AAqPD;;;;;GAKG;AACH,wBAAgB,cAAc,uBA2E7B"}
1
+ {"version":3,"file":"drawers.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/drawers.tsx"],"names":[],"mappings":"AA8BA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,uBA+B9B;AAkPD;;;;;GAKG;AACH,wBAAgB,cAAc,uBA2E7B"}
@@ -79,8 +79,8 @@ function ActiveDrawer() {
79
79
  handleDrawersClick(activeDrawerId);
80
80
  handleToolsClick(false);
81
81
  }, ref: drawersRefs.close, variant: "icon" })),
82
- toolsContent && (React.createElement("div", { key: TOOLS_DRAWER_ID, className: clsx(styles['drawer-content'], activeDrawerId !== TOOLS_DRAWER_ID && styles['drawer-content-hidden']) }, toolsContent)),
83
- activeDrawerId !== TOOLS_DRAWER_ID && (React.createElement("div", { key: activeDrawerId, className: styles['drawer-content'] }, activeDrawerId && (activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.content))))));
82
+ toolsContent && (React.createElement("div", { className: clsx(styles['drawer-content'], activeDrawerId !== TOOLS_DRAWER_ID && styles['drawer-content-hidden']) }, toolsContent)),
83
+ activeDrawerId !== TOOLS_DRAWER_ID && (React.createElement("div", { className: styles['drawer-content'] }, activeDrawerId && (activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.content))))));
84
84
  }
85
85
  /**
86
86
  * The DesktopTriggers will render the trigger buttons for Tools, Drawers, and the
@@ -1 +1 @@
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,yBAAyB,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC/D,QAAQ,EAAE,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,0CAAE,QAAQ,EACjC,OAAO,EAAE,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,0CAAE,OAAO,EAC/B,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,GAAG,EAAE,IAAI,CAAC,EAAE,EACZ,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC,EAC1C,MAAM,EAAE,4BAA4B,IAAI,CAAC,EAAE,EAAE,EAC7C,kBAAkB,EAAE,aAAa,KAAK,eAAe,EACrD,QAAQ,EAAE,IAAI,CAAC,EAAE,KAAK,cAAc,GACpC,CACH,CAAC;YACJ,CAAC,CAAC;YACD,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,CAC3B,oBAAC,YAAY,IACX,KAAK,EAAE,aAAa,EACpB,SAAS,EAAE,oBAAoB,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,wBAAwB,EAC9F,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,GAC1D,CACH,CACG,CACA,CACT,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\n\nimport { InternalButton } from '../../button/internal';\nimport customCssProps from '../../internal/generated/custom-css-properties';\nimport { getLimitedValue } from '../../split-panel/utils/size-utils';\nimport { splitItems } from '../drawer/drawers-helpers';\nimport OverflowMenu from '../drawer/overflow-menu';\nimport { TOOLS_DRAWER_ID } from '../utils/use-drawers';\nimport { useAppLayoutInternals } from './context';\nimport SplitPanel from './split-panel';\nimport TriggerButton from './trigger-button';\n\nimport splitPanelTestUtilStyles from '../../split-panel/test-classes/styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\n/**\n * The VISIBLE_MOBILE_TOOLBAR_TRIGGERS_LIMIT is used to reduce the number\n * of triggers that are initially visible on the mobile toolbar, the rest\n * are then placed into an overflow menu\n *\n * Note if one of the triggers is for a split-panel, it would not count that\n */\nconst VISIBLE_MOBILE_TOOLBAR_TRIGGERS_LIMIT = 2;\n\n/**\n * The Drawers root component is mounted in the AppLayout index file. It will only\n * render if the drawers are defined, and it will take over the mounting of and\n * rendering of the Tools and SplitPanel (side position) if they exist. If drawers\n * do not exist then the Tools and SplitPanel will be handled by the Tools component.\n */\nexport default function Drawers() {\n const {\n disableBodyScroll,\n drawers,\n drawersTriggerCount,\n hasDrawerViewportOverlay,\n hasOpenDrawer,\n navigationOpen,\n navigationHide,\n isMobile,\n } = useAppLayoutInternals();\n\n const isUnfocusable = hasDrawerViewportOverlay && navigationOpen && !navigationHide;\n\n if (!drawers || drawersTriggerCount === 0) {\n return null;\n }\n\n return (\n <div\n className={clsx(styles['drawers-container'], {\n [styles['disable-body-scroll']]: disableBodyScroll,\n [styles['has-open-drawer']]: hasOpenDrawer,\n [styles.unfocusable]: isUnfocusable,\n })}\n >\n <SplitPanel.Side />\n <ActiveDrawer />\n {!isMobile && <DesktopTriggers />}\n </div>\n );\n}\n\nfunction ActiveDrawer() {\n const {\n activeDrawerId,\n ariaLabels,\n drawers,\n drawersRefs,\n handleDrawersClick,\n handleToolsClick,\n hasDrawerViewportOverlay,\n isMobile,\n navigationOpen,\n navigationHide,\n loseDrawersFocus,\n resizeHandle,\n drawerSize,\n drawersMinWidth,\n drawersMaxWidth,\n drawerRef,\n } = useAppLayoutInternals();\n\n const activeDrawer = drawers?.find(item => item.id === activeDrawerId) ?? null;\n\n const computedAriaLabels = {\n closeButton: activeDrawerId ? activeDrawer?.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeDrawerId ? activeDrawer?.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const isHidden = !activeDrawerId;\n const isUnfocusable = isHidden || (hasDrawerViewportOverlay && navigationOpen && !navigationHide);\n const isToolsDrawer = activeDrawerId === TOOLS_DRAWER_ID;\n const toolsContent = drawers?.find(drawer => drawer.id === TOOLS_DRAWER_ID)?.content;\n\n const size = getLimitedValue(drawersMinWidth, drawerSize, drawersMaxWidth);\n\n return (\n <aside\n id={activeDrawerId ?? undefined}\n aria-hidden={isHidden}\n aria-label={computedAriaLabels.content}\n className={clsx(styles.drawer, {\n [styles['is-drawer-open']]: activeDrawerId,\n [styles.unfocusable]: isUnfocusable,\n [testutilStyles['active-drawer']]: activeDrawerId,\n [testutilStyles.tools]: isToolsDrawer,\n })}\n style={{\n ...(!isMobile && drawerSize && { [customCssProps.drawerSize]: `${size}px` }),\n }}\n ref={drawerRef}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n loseDrawersFocus();\n }\n }}\n >\n {!isMobile && activeDrawer?.resizable && <div className={styles['drawer-slider']}>{resizeHandle}</div>}\n <div className={styles['drawer-content-container']}>\n <div className={styles['drawer-close-button']}>\n <InternalButton\n ariaLabel={computedAriaLabels.closeButton}\n className={clsx({\n [testutilStyles['active-drawer-close-button']]: activeDrawerId,\n [testutilStyles['tools-close']]: isToolsDrawer,\n })}\n formAction=\"none\"\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => {\n handleDrawersClick(activeDrawerId);\n handleToolsClick(false);\n }}\n ref={drawersRefs.close}\n variant=\"icon\"\n />\n </div>\n {toolsContent && (\n <div\n key={TOOLS_DRAWER_ID}\n className={clsx(\n styles['drawer-content'],\n activeDrawerId !== TOOLS_DRAWER_ID && styles['drawer-content-hidden']\n )}\n >\n {toolsContent}\n </div>\n )}\n {activeDrawerId !== TOOLS_DRAWER_ID && (\n <div key={activeDrawerId} className={styles['drawer-content']}>\n {activeDrawerId && activeDrawer?.content}\n </div>\n )}\n </div>\n </aside>\n );\n}\n\n/**\n * The DesktopTriggers will render the trigger buttons for Tools, Drawers, and the\n * SplitPanel in non mobile viewports. Changes to the activeDrawerId need to be\n * tracked by the previousActiveDrawerId property in order to appropriately apply\n * the ref required to manage focus control.\n */\nfunction DesktopTriggers() {\n const {\n activeDrawerId,\n drawers,\n drawersAriaLabel,\n drawersOverflowAriaLabel,\n drawersOverflowWithBadgeAriaLabel,\n drawersRefs,\n drawersTriggerCount,\n handleDrawersClick,\n handleSplitPanelClick,\n hasOpenDrawer,\n isSplitPanelOpen,\n splitPanel,\n splitPanelControlId,\n splitPanelDisplayed,\n splitPanelPosition,\n splitPanelRefs,\n splitPanelToggle,\n splitPanelReportedHeaderHeight,\n splitPanelReportedSize,\n headerVariant,\n } = useAppLayoutInternals();\n\n const hasMultipleTriggers = drawersTriggerCount > 1;\n const hasSplitPanel = splitPanel && splitPanelDisplayed && splitPanelPosition === 'side';\n\n const previousActiveDrawerId = useRef(activeDrawerId);\n const [containerHeight, triggersContainerRef] = useContainerQuery(rect => rect.contentBoxHeight);\n\n if (activeDrawerId) {\n previousActiveDrawerId.current = activeDrawerId;\n }\n\n const splitPanelHeight =\n isSplitPanelOpen && splitPanelPosition === 'bottom' ? splitPanelReportedSize : splitPanelReportedHeaderHeight;\n\n const getIndexOfOverflowItem = () => {\n if (containerHeight) {\n const ITEM_HEIGHT = 48;\n const overflowSpot =\n activeDrawerId && isSplitPanelOpen\n ? (containerHeight - splitPanelReportedHeaderHeight) / 1.5\n : (containerHeight - splitPanelHeight) / 1.5;\n\n const index = Math.floor(overflowSpot / ITEM_HEIGHT);\n\n let splitPanelItem = 0;\n if (hasSplitPanel && splitPanelToggle.displayed) {\n splitPanelItem = 1;\n }\n return index - splitPanelItem;\n }\n\n return 0;\n };\n\n const { visibleItems, overflowItems } = splitItems(drawers ?? undefined, getIndexOfOverflowItem(), activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n <aside\n className={clsx(styles['drawers-desktop-triggers-container'], {\n [styles['has-multiple-triggers']]: hasMultipleTriggers,\n [styles['has-open-drawer']]: hasOpenDrawer,\n })}\n aria-label={drawersAriaLabel}\n ref={triggersContainerRef}\n role=\"region\"\n >\n <div\n className={clsx(styles['drawers-trigger-content'], {\n [styles['has-multiple-triggers']]: hasMultipleTriggers,\n [styles['has-open-drawer']]: hasOpenDrawer,\n })}\n aria-label={drawersAriaLabel}\n role=\"toolbar\"\n aria-orientation=\"vertical\"\n >\n {visibleItems.map(item => {\n const isForPreviousActiveDrawer = previousActiveDrawerId?.current === item.id;\n return (\n <TriggerButton\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaExpanded={item.id === activeDrawerId}\n ariaControls={activeDrawerId === item.id ? item.id : undefined}\n className={clsx(styles['drawers-trigger'], testutilStyles['drawers-trigger'], {\n [testutilStyles['drawers-trigger-with-badge']]: item.badge,\n [testutilStyles['tools-toggle']]: item.id === TOOLS_DRAWER_ID,\n })}\n iconName={item?.trigger?.iconName}\n iconSvg={item?.trigger?.iconSvg}\n key={item.id}\n onClick={() => handleDrawersClick(item.id)}\n ref={isForPreviousActiveDrawer ? drawersRefs.toggle : undefined}\n badge={item.badge}\n testId={`awsui-app-layout-trigger-${item.id}`}\n highContrastHeader={headerVariant === 'high-contrast'}\n selected={item.id === activeDrawerId}\n />\n );\n })}\n\n {overflowItems.length > 0 && (\n <OverflowMenu\n items={overflowItems}\n ariaLabel={overflowMenuHasBadge ? drawersOverflowWithBadgeAriaLabel : drawersOverflowAriaLabel}\n customTriggerBuilder={({ onClick, triggerRef, ariaLabel, ariaExpanded, testUtilsClass }) => (\n <TriggerButton\n ref={triggerRef}\n ariaLabel={ariaLabel}\n ariaExpanded={ariaExpanded}\n badge={overflowMenuHasBadge}\n className={clsx(styles['drawers-trigger'], testutilStyles['drawers-trigger'], testUtilsClass)}\n iconName=\"ellipsis\"\n onClick={onClick}\n highContrastHeader={headerVariant === 'high-contrast'}\n />\n )}\n onItemClick={({ detail }) => {\n handleDrawersClick(detail.id);\n }}\n />\n )}\n {hasSplitPanel && splitPanelToggle.displayed && (\n <TriggerButton\n ariaLabel={splitPanelToggle.ariaLabel}\n ariaControls={splitPanelControlId}\n ariaExpanded={!!isSplitPanelOpen}\n className={clsx(styles['drawers-trigger'], splitPanelTestUtilStyles['open-button'])}\n iconName=\"view-vertical\"\n onClick={() => handleSplitPanelClick()}\n selected={hasSplitPanel && isSplitPanelOpen}\n ref={splitPanelRefs.toggle}\n highContrastHeader={headerVariant === 'high-contrast'}\n />\n )}\n </div>\n </aside>\n );\n}\n\n/**\n * The MobileTriggers will be mounted inside of the AppBar component and\n * only rendered when Drawers are defined in mobile viewports. The same logic\n * will in the AppBar component will suppress the rendering of the legacy\n * trigger button for the Tools drawer.\n */\nexport function MobileTriggers() {\n const {\n activeDrawerId,\n drawers,\n drawersAriaLabel,\n drawersOverflowAriaLabel,\n drawersOverflowWithBadgeAriaLabel,\n drawersRefs,\n handleDrawersClick,\n hasDrawerViewportOverlay,\n headerVariant,\n } = useAppLayoutInternals();\n\n const previousActiveDrawerId = useRef(activeDrawerId);\n\n if (!drawers) {\n return null;\n }\n\n if (activeDrawerId) {\n previousActiveDrawerId.current = activeDrawerId;\n }\n\n const { visibleItems, overflowItems } = splitItems(drawers, VISIBLE_MOBILE_TOOLBAR_TRIGGERS_LIMIT, activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n <aside\n aria-hidden={hasDrawerViewportOverlay}\n className={clsx({\n [styles.unfocusable]: hasDrawerViewportOverlay,\n })}\n aria-label={drawersAriaLabel}\n role=\"region\"\n >\n <div\n className={styles['drawers-mobile-triggers-container']}\n aria-label={drawersAriaLabel}\n role=\"toolbar\"\n aria-orientation=\"horizontal\"\n >\n {visibleItems.map(item => {\n const isForPreviousActiveDrawer = previousActiveDrawerId?.current === item.id;\n return (\n <TriggerButton\n ariaExpanded={item.id === activeDrawerId}\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaControls={activeDrawerId === item.id ? item.id : undefined}\n className={clsx(styles['drawers-trigger'], testutilStyles['drawers-trigger'], {\n [testutilStyles['drawers-trigger-with-badge']]: item.badge,\n [testutilStyles['tools-toggle']]: item.id === TOOLS_DRAWER_ID,\n })}\n disabled={hasDrawerViewportOverlay}\n ref={isForPreviousActiveDrawer ? drawersRefs.toggle : undefined}\n iconName={item?.trigger?.iconName}\n iconSvg={item?.trigger?.iconSvg}\n badge={item.badge}\n key={item.id}\n onClick={() => handleDrawersClick(item.id)}\n testId={`awsui-app-layout-trigger-${item.id}`}\n highContrastHeader={headerVariant === 'high-contrast'}\n selected={item.id === activeDrawerId}\n />\n );\n })}\n {overflowItems.length > 0 && (\n <OverflowMenu\n items={overflowItems}\n ariaLabel={overflowMenuHasBadge ? drawersOverflowWithBadgeAriaLabel : drawersOverflowAriaLabel}\n onItemClick={({ detail }) => handleDrawersClick(detail.id)}\n />\n )}\n </div>\n </aside>\n );\n}\n"]}
1
+ {"version":3,"file":"drawers.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/drawers.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,cAAc,MAAM,gDAAgD,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MA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ACX,KAAK,EAAE,aAAa,EACpB,SAAS,EAAE,oBAAoB,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,wBAAwB,EAC9F,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,GAC1D,CACH,CACG,CACA,CACT,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\n\nimport { InternalButton } from '../../button/internal';\nimport customCssProps from '../../internal/generated/custom-css-properties';\nimport { getLimitedValue } from '../../split-panel/utils/size-utils';\nimport { splitItems } from '../drawer/drawers-helpers';\nimport OverflowMenu from '../drawer/overflow-menu';\nimport { TOOLS_DRAWER_ID } from '../utils/use-drawers';\nimport { useAppLayoutInternals } from './context';\nimport SplitPanel from './split-panel';\nimport TriggerButton from './trigger-button';\n\nimport splitPanelTestUtilStyles from '../../split-panel/test-classes/styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\n/**\n * The VISIBLE_MOBILE_TOOLBAR_TRIGGERS_LIMIT is used to reduce the number\n * of triggers that are initially visible on the mobile toolbar, the rest\n * are then placed into an overflow menu\n *\n * Note if one of the triggers is for a split-panel, it would not count that\n */\nconst VISIBLE_MOBILE_TOOLBAR_TRIGGERS_LIMIT = 2;\n\n/**\n * The Drawers root component is mounted in the AppLayout index file. It will only\n * render if the drawers are defined, and it will take over the mounting of and\n * rendering of the Tools and SplitPanel (side position) if they exist. If drawers\n * do not exist then the Tools and SplitPanel will be handled by the Tools component.\n */\nexport default function Drawers() {\n const {\n disableBodyScroll,\n drawers,\n drawersTriggerCount,\n hasDrawerViewportOverlay,\n hasOpenDrawer,\n navigationOpen,\n navigationHide,\n isMobile,\n } = useAppLayoutInternals();\n\n const isUnfocusable = hasDrawerViewportOverlay && navigationOpen && !navigationHide;\n\n if (!drawers || drawersTriggerCount === 0) {\n return null;\n }\n\n return (\n <div\n className={clsx(styles['drawers-container'], {\n [styles['disable-body-scroll']]: disableBodyScroll,\n [styles['has-open-drawer']]: hasOpenDrawer,\n [styles.unfocusable]: isUnfocusable,\n })}\n >\n <SplitPanel.Side />\n <ActiveDrawer />\n {!isMobile && <DesktopTriggers />}\n </div>\n );\n}\n\nfunction ActiveDrawer() {\n const {\n activeDrawerId,\n ariaLabels,\n drawers,\n drawersRefs,\n handleDrawersClick,\n handleToolsClick,\n hasDrawerViewportOverlay,\n isMobile,\n navigationOpen,\n navigationHide,\n loseDrawersFocus,\n resizeHandle,\n drawerSize,\n drawersMinWidth,\n drawersMaxWidth,\n drawerRef,\n } = useAppLayoutInternals();\n\n const activeDrawer = drawers?.find(item => item.id === activeDrawerId) ?? null;\n\n const computedAriaLabels = {\n closeButton: activeDrawerId ? activeDrawer?.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeDrawerId ? activeDrawer?.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const isHidden = !activeDrawerId;\n const isUnfocusable = isHidden || (hasDrawerViewportOverlay && navigationOpen && !navigationHide);\n const isToolsDrawer = activeDrawerId === TOOLS_DRAWER_ID;\n const toolsContent = drawers?.find(drawer => drawer.id === TOOLS_DRAWER_ID)?.content;\n\n const size = getLimitedValue(drawersMinWidth, drawerSize, drawersMaxWidth);\n\n return (\n <aside\n id={activeDrawerId ?? undefined}\n aria-hidden={isHidden}\n aria-label={computedAriaLabels.content}\n className={clsx(styles.drawer, {\n [styles['is-drawer-open']]: activeDrawerId,\n [styles.unfocusable]: isUnfocusable,\n [testutilStyles['active-drawer']]: activeDrawerId,\n [testutilStyles.tools]: isToolsDrawer,\n })}\n style={{\n ...(!isMobile && drawerSize && { [customCssProps.drawerSize]: `${size}px` }),\n }}\n ref={drawerRef}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n loseDrawersFocus();\n }\n }}\n >\n {!isMobile && activeDrawer?.resizable && <div className={styles['drawer-slider']}>{resizeHandle}</div>}\n <div className={styles['drawer-content-container']}>\n <div className={styles['drawer-close-button']}>\n <InternalButton\n ariaLabel={computedAriaLabels.closeButton}\n className={clsx({\n [testutilStyles['active-drawer-close-button']]: activeDrawerId,\n [testutilStyles['tools-close']]: isToolsDrawer,\n })}\n formAction=\"none\"\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => {\n handleDrawersClick(activeDrawerId);\n handleToolsClick(false);\n }}\n ref={drawersRefs.close}\n variant=\"icon\"\n />\n </div>\n {toolsContent && (\n <div\n className={clsx(\n styles['drawer-content'],\n activeDrawerId !== TOOLS_DRAWER_ID && styles['drawer-content-hidden']\n )}\n >\n {toolsContent}\n </div>\n )}\n {activeDrawerId !== TOOLS_DRAWER_ID && (\n <div className={styles['drawer-content']}>{activeDrawerId && activeDrawer?.content}</div>\n )}\n </div>\n </aside>\n );\n}\n\n/**\n * The DesktopTriggers will render the trigger buttons for Tools, Drawers, and the\n * SplitPanel in non mobile viewports. Changes to the activeDrawerId need to be\n * tracked by the previousActiveDrawerId property in order to appropriately apply\n * the ref required to manage focus control.\n */\nfunction DesktopTriggers() {\n const {\n activeDrawerId,\n drawers,\n drawersAriaLabel,\n drawersOverflowAriaLabel,\n drawersOverflowWithBadgeAriaLabel,\n drawersRefs,\n drawersTriggerCount,\n handleDrawersClick,\n handleSplitPanelClick,\n hasOpenDrawer,\n isSplitPanelOpen,\n splitPanel,\n splitPanelControlId,\n splitPanelDisplayed,\n splitPanelPosition,\n splitPanelRefs,\n splitPanelToggle,\n splitPanelReportedHeaderHeight,\n splitPanelReportedSize,\n headerVariant,\n } = useAppLayoutInternals();\n\n const hasMultipleTriggers = drawersTriggerCount > 1;\n const hasSplitPanel = splitPanel && splitPanelDisplayed && splitPanelPosition === 'side';\n\n const previousActiveDrawerId = useRef(activeDrawerId);\n const [containerHeight, triggersContainerRef] = useContainerQuery(rect => rect.contentBoxHeight);\n\n if (activeDrawerId) {\n previousActiveDrawerId.current = activeDrawerId;\n }\n\n const splitPanelHeight =\n isSplitPanelOpen && splitPanelPosition === 'bottom' ? splitPanelReportedSize : splitPanelReportedHeaderHeight;\n\n const getIndexOfOverflowItem = () => {\n if (containerHeight) {\n const ITEM_HEIGHT = 48;\n const overflowSpot =\n activeDrawerId && isSplitPanelOpen\n ? (containerHeight - splitPanelReportedHeaderHeight) / 1.5\n : (containerHeight - splitPanelHeight) / 1.5;\n\n const index = Math.floor(overflowSpot / ITEM_HEIGHT);\n\n let splitPanelItem = 0;\n if (hasSplitPanel && splitPanelToggle.displayed) {\n splitPanelItem = 1;\n }\n return index - splitPanelItem;\n }\n\n return 0;\n };\n\n const { visibleItems, overflowItems } = splitItems(drawers ?? undefined, getIndexOfOverflowItem(), activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n <aside\n className={clsx(styles['drawers-desktop-triggers-container'], {\n [styles['has-multiple-triggers']]: hasMultipleTriggers,\n [styles['has-open-drawer']]: hasOpenDrawer,\n })}\n aria-label={drawersAriaLabel}\n ref={triggersContainerRef}\n role=\"region\"\n >\n <div\n className={clsx(styles['drawers-trigger-content'], {\n [styles['has-multiple-triggers']]: hasMultipleTriggers,\n [styles['has-open-drawer']]: hasOpenDrawer,\n })}\n aria-label={drawersAriaLabel}\n role=\"toolbar\"\n aria-orientation=\"vertical\"\n >\n {visibleItems.map(item => {\n const isForPreviousActiveDrawer = previousActiveDrawerId?.current === item.id;\n return (\n <TriggerButton\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaExpanded={item.id === activeDrawerId}\n ariaControls={activeDrawerId === item.id ? item.id : undefined}\n className={clsx(styles['drawers-trigger'], testutilStyles['drawers-trigger'], {\n [testutilStyles['drawers-trigger-with-badge']]: item.badge,\n [testutilStyles['tools-toggle']]: item.id === TOOLS_DRAWER_ID,\n })}\n iconName={item?.trigger?.iconName}\n iconSvg={item?.trigger?.iconSvg}\n key={item.id}\n onClick={() => handleDrawersClick(item.id)}\n ref={isForPreviousActiveDrawer ? drawersRefs.toggle : undefined}\n badge={item.badge}\n testId={`awsui-app-layout-trigger-${item.id}`}\n highContrastHeader={headerVariant === 'high-contrast'}\n selected={item.id === activeDrawerId}\n />\n );\n })}\n\n {overflowItems.length > 0 && (\n <OverflowMenu\n items={overflowItems}\n ariaLabel={overflowMenuHasBadge ? drawersOverflowWithBadgeAriaLabel : drawersOverflowAriaLabel}\n customTriggerBuilder={({ onClick, triggerRef, ariaLabel, ariaExpanded, testUtilsClass }) => (\n <TriggerButton\n ref={triggerRef}\n ariaLabel={ariaLabel}\n ariaExpanded={ariaExpanded}\n badge={overflowMenuHasBadge}\n className={clsx(styles['drawers-trigger'], testutilStyles['drawers-trigger'], testUtilsClass)}\n iconName=\"ellipsis\"\n onClick={onClick}\n highContrastHeader={headerVariant === 'high-contrast'}\n />\n )}\n onItemClick={({ detail }) => {\n handleDrawersClick(detail.id);\n }}\n />\n )}\n {hasSplitPanel && splitPanelToggle.displayed && (\n <TriggerButton\n ariaLabel={splitPanelToggle.ariaLabel}\n ariaControls={splitPanelControlId}\n ariaExpanded={!!isSplitPanelOpen}\n className={clsx(styles['drawers-trigger'], splitPanelTestUtilStyles['open-button'])}\n iconName=\"view-vertical\"\n onClick={() => handleSplitPanelClick()}\n selected={hasSplitPanel && isSplitPanelOpen}\n ref={splitPanelRefs.toggle}\n highContrastHeader={headerVariant === 'high-contrast'}\n />\n )}\n </div>\n </aside>\n );\n}\n\n/**\n * The MobileTriggers will be mounted inside of the AppBar component and\n * only rendered when Drawers are defined in mobile viewports. The same logic\n * will in the AppBar component will suppress the rendering of the legacy\n * trigger button for the Tools drawer.\n */\nexport function MobileTriggers() {\n const {\n activeDrawerId,\n drawers,\n drawersAriaLabel,\n drawersOverflowAriaLabel,\n drawersOverflowWithBadgeAriaLabel,\n drawersRefs,\n handleDrawersClick,\n hasDrawerViewportOverlay,\n headerVariant,\n } = useAppLayoutInternals();\n\n const previousActiveDrawerId = useRef(activeDrawerId);\n\n if (!drawers) {\n return null;\n }\n\n if (activeDrawerId) {\n previousActiveDrawerId.current = activeDrawerId;\n }\n\n const { visibleItems, overflowItems } = splitItems(drawers, VISIBLE_MOBILE_TOOLBAR_TRIGGERS_LIMIT, activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n <aside\n aria-hidden={hasDrawerViewportOverlay}\n className={clsx({\n [styles.unfocusable]: hasDrawerViewportOverlay,\n })}\n aria-label={drawersAriaLabel}\n role=\"region\"\n >\n <div\n className={styles['drawers-mobile-triggers-container']}\n aria-label={drawersAriaLabel}\n role=\"toolbar\"\n aria-orientation=\"horizontal\"\n >\n {visibleItems.map(item => {\n const isForPreviousActiveDrawer = previousActiveDrawerId?.current === item.id;\n return (\n <TriggerButton\n ariaExpanded={item.id === activeDrawerId}\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaControls={activeDrawerId === item.id ? item.id : undefined}\n className={clsx(styles['drawers-trigger'], testutilStyles['drawers-trigger'], {\n [testutilStyles['drawers-trigger-with-badge']]: item.badge,\n [testutilStyles['tools-toggle']]: item.id === TOOLS_DRAWER_ID,\n })}\n disabled={hasDrawerViewportOverlay}\n ref={isForPreviousActiveDrawer ? drawersRefs.toggle : undefined}\n iconName={item?.trigger?.iconName}\n iconSvg={item?.trigger?.iconSvg}\n badge={item.badge}\n key={item.id}\n onClick={() => handleDrawersClick(item.id)}\n testId={`awsui-app-layout-trigger-${item.id}`}\n highContrastHeader={headerVariant === 'high-contrast'}\n selected={item.id === activeDrawerId}\n />\n );\n })}\n {overflowItems.length > 0 && (\n <OverflowMenu\n items={overflowItems}\n ariaLabel={overflowMenuHasBadge ? drawersOverflowWithBadgeAriaLabel : drawersOverflowAriaLabel}\n onItemClick={({ detail }) => handleDrawersClick(detail.id)}\n />\n )}\n </div>\n </aside>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/main.tsx"],"names":[],"mappings":"AAcA,MAAM,CAAC,OAAO,UAAU,IAAI,gBAuD3B"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/main.tsx"],"names":[],"mappings":"AAaA,MAAM,CAAC,OAAO,UAAU,IAAI,gBAuD3B"}
@@ -2,7 +2,6 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import React from 'react';
4
4
  import clsx from 'clsx';
5
- import { BuiltInErrorBoundary } from '../../error-boundary/internal';
6
5
  import customCssProps from '../../internal/generated/custom-css-properties';
7
6
  import * as tokens from '../../internal/generated/styles/tokens';
8
7
  import { getStickyOffsetVars } from '../utils/sticky-offsets';
@@ -23,7 +22,6 @@ export default function Main() {
23
22
  }, testutilStyles.content), ref: mainElement, style: {
24
23
  [customCssProps.splitPanelHeight]: `${splitPanelHeight}px`,
25
24
  ...getStickyOffsetVars(placement.insetBlockStart, offsetBottom, stickyNotifications && notificationsHeight > 0 ? `${tokens.spaceXs} + ${notificationsHeight}px` : '0px', `var(${customCssProps.mobileBarHeight})`, !!disableBodyScroll, isMobile),
26
- } },
27
- React.createElement(BuiltInErrorBoundary, null, content)));
25
+ } }, content));
28
26
  }
29
27
  //# sourceMappingURL=main.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/main.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,cAAc,MAAM,gDAAgD,CAAC;AAC5E,OAAO,KAAK,MAAM,MAAM,wCAAwC,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;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AAe,EACzB,YAAY,EACZ,mBAAmB,IAAI,mBAAmB,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,MAAM,mBAAmB,IAAI,CAAC,CAAC,CAAC,KAAK,EACvG,OAAO,cAAc,CAAC,eAAe,GAAG,EACxC,CAAC,CAAC,iBAAiB,EACnB,QAAQ,CACT;SACF;QAED,oBAAC,oBAAoB,QAAE,OAAO,CAAwB,CAClD,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';\n\nimport { BuiltInErrorBoundary } from '../../error-boundary/internal';\nimport customCssProps from '../../internal/generated/custom-css-properties';\nimport * as tokens from '../../internal/generated/styles/tokens';\nimport { getStickyOffsetVars } from '../utils/sticky-offsets';\nimport { useAppLayoutInternals } from './context';\n\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\nexport default function Main() {\n const {\n content,\n disableBodyScroll,\n disableContentPaddings,\n footerHeight,\n hasDrawerViewportOverlay,\n navigationOpen,\n placement,\n isMobile,\n isSplitPanelOpen,\n isToolsOpen,\n mainElement,\n notificationsHeight,\n stickyNotifications,\n offsetBottom,\n splitPanelDisplayed,\n splitPanelPosition,\n activeDrawerId,\n } = useAppLayoutInternals();\n\n const splitPanelHeight = offsetBottom - footerHeight;\n\n return (\n <div\n className={clsx(\n styles.container,\n styles[`split-panel-position-${splitPanelPosition ?? 'bottom'}`],\n {\n [styles['disable-content-paddings']]: disableContentPaddings,\n [styles['has-split-panel']]: splitPanelDisplayed,\n [styles['is-navigation-open']]: navigationOpen,\n [styles['is-tools-open']]: isToolsOpen,\n [styles['has-active-drawer']]: !!activeDrawerId,\n [styles['is-split-panel-open']]: isSplitPanelOpen,\n [styles.unfocusable]: hasDrawerViewportOverlay,\n },\n testutilStyles.content\n )}\n ref={mainElement}\n style={{\n [customCssProps.splitPanelHeight]: `${splitPanelHeight}px`,\n ...getStickyOffsetVars(\n placement.insetBlockStart,\n offsetBottom,\n stickyNotifications && notificationsHeight > 0 ? `${tokens.spaceXs} + ${notificationsHeight}px` : '0px',\n `var(${customCssProps.mobileBarHeight})`,\n !!disableBodyScroll,\n isMobile\n ),\n }}\n >\n <BuiltInErrorBoundary>{content}</BuiltInErrorBoundary>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/main.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,cAAc,MAAM,gDAAgD,CAAC;AAC5E,OAAO,KAAK,MAAM,MAAM,wCAAwC,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,CAAC,OAAO,UAAU,IAAI;IAC1B,MAAM,EACJ,OAAO,EACP,iBAAiB,EACjB,sBAAsB,EACtB,YAAY,EACZ,wBAAwB,EACxB,cAAc,EACd,SAAS,EACT,QAAQ,EACR,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,mBAAmB,EACnB,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,GACf,GAAG,qBAAqB,EAAE,CAAC;IAE5B,MAAM,gBAAgB,GAAG,YAAY,GAAG,YAAY,CAAC;IAErD,OAAO,CACL,6BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,wBAAwB,kBAAkB,aAAlB,kBAAkB,cAAlB,kBAAkB,GAAI,QAAQ,EAAE,CAAC,EAChE;YACE,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,EAAE,sBAAsB;YAC5D,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,EAAE,mBAAmB;YAChD,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,EAAE,cAAc;YAC9C,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,WAAW;YACtC,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,cAAc;YAC/C,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,EAAE,gBAAgB;YACjD,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,wBAAwB;SAC/C,EACD,cAAc,CAAC,OAAO,CACvB,EACD,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE;YACL,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,GAAG,gBAAgB,IAAI;YAC1D,GAAG,mBAAmB,CACpB,SAAS,CAAC,eAAe,EACzB,YAAY,EACZ,mBAAmB,IAAI,mBAAmB,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,MAAM,mBAAmB,IAAI,CAAC,CAAC,CAAC,KAAK,EACvG,OAAO,cAAc,CAAC,eAAe,GAAG,EACxC,CAAC,CAAC,iBAAiB,EACnB,QAAQ,CACT;SACF,IAEA,OAAO,CACJ,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';\n\nimport customCssProps from '../../internal/generated/custom-css-properties';\nimport * as tokens from '../../internal/generated/styles/tokens';\nimport { getStickyOffsetVars } from '../utils/sticky-offsets';\nimport { useAppLayoutInternals } from './context';\n\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\nexport default function Main() {\n const {\n content,\n disableBodyScroll,\n disableContentPaddings,\n footerHeight,\n hasDrawerViewportOverlay,\n navigationOpen,\n placement,\n isMobile,\n isSplitPanelOpen,\n isToolsOpen,\n mainElement,\n notificationsHeight,\n stickyNotifications,\n offsetBottom,\n splitPanelDisplayed,\n splitPanelPosition,\n activeDrawerId,\n } = useAppLayoutInternals();\n\n const splitPanelHeight = offsetBottom - footerHeight;\n\n return (\n <div\n className={clsx(\n styles.container,\n styles[`split-panel-position-${splitPanelPosition ?? 'bottom'}`],\n {\n [styles['disable-content-paddings']]: disableContentPaddings,\n [styles['has-split-panel']]: splitPanelDisplayed,\n [styles['is-navigation-open']]: navigationOpen,\n [styles['is-tools-open']]: isToolsOpen,\n [styles['has-active-drawer']]: !!activeDrawerId,\n [styles['is-split-panel-open']]: isSplitPanelOpen,\n [styles.unfocusable]: hasDrawerViewportOverlay,\n },\n testutilStyles.content\n )}\n ref={mainElement}\n style={{\n [customCssProps.splitPanelHeight]: `${splitPanelHeight}px`,\n ...getStickyOffsetVars(\n placement.insetBlockStart,\n offsetBottom,\n stickyNotifications && notificationsHeight > 0 ? `${tokens.spaceXs} + ${notificationsHeight}px` : '0px',\n `var(${customCssProps.mobileBarHeight})`,\n !!disableBodyScroll,\n isMobile\n ),\n }}\n >\n {content}\n </div>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"local-drawer.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/local-drawer.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAOnD,UAAU,kCAAkC;IAC1C,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,wBAAgB,6BAA6B,CAAC,EAC5C,kBAAkB,EAClB,wBAAwB,GACzB,EAAE,kCAAkC,eAkIpC"}
1
+ {"version":3,"file":"local-drawer.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/local-drawer.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAOnD,UAAU,kCAAkC;IAC1C,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,wBAAgB,6BAA6B,CAAC,EAC5C,kBAAkB,EAClB,wBAAwB,GACzB,EAAE,kCAAkC,eAiIpC"}
@@ -69,8 +69,8 @@ export function AppLayoutDrawerImplementation({ appLayoutInternals, bottomDrawer
69
69
  [testutilStyles['active-drawer-close-button']]: !isToolsDrawer && activeDrawerId,
70
70
  [testutilStyles['tools-close']]: isToolsDrawer,
71
71
  }), formAction: "none", iconName: isMobile ? 'close' : 'angle-right', onClick: () => onActiveDrawerChange(null, { initiatedByUserAction: true }), ref: drawersFocusControl.refs.close, variant: "icon", analyticsAction: "close" })),
72
- React.createElement("div", { key: TOOLS_DRAWER_ID, className: clsx(styles['drawer-content'], activeDrawerId !== TOOLS_DRAWER_ID && styles['drawer-content-hidden']), style: { blockSize: drawerHeight } }, toolsContent),
73
- activeDrawerId !== TOOLS_DRAWER_ID && (React.createElement("div", { key: activeDrawerId, className: styles['drawer-content'], style: { blockSize: drawerHeight } }, activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.content)))));
72
+ React.createElement("div", { className: clsx(styles['drawer-content'], activeDrawerId !== TOOLS_DRAWER_ID && styles['drawer-content-hidden']), style: { blockSize: drawerHeight } }, toolsContent),
73
+ activeDrawerId !== TOOLS_DRAWER_ID && (React.createElement("div", { className: styles['drawer-content'], style: { blockSize: drawerHeight } }, activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.content)))));
74
74
  }));
75
75
  }
76
76
  //# sourceMappingURL=local-drawer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"local-drawer.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/local-drawer.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,C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F,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,EAAE,aAAa;yBAC/C,CAAC,EACF,UAAU,EAAC,MAAM,EACjB,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa,EAC5C,OAAO,EAAE,GAAG,EAAE,CAAC,oBAAoB,CAAC,IAAI,EAAE,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC,EAC1E,GAAG,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,EACnC,OAAO,EAAC,MAAM,EACd,eAAe,EAAC,OAAO,GACvB,CACE;gBACN,6BACE,GAAG,EAAE,eAAe,EACpB,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,gBAAgB,CAAC,EACxB,cAAc,KAAK,eAAe,IAAI,MAAM,CAAC,uBAAuB,CAAC,CACtE,EACD,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,IAEjC,YAAY,CACT;gBACL,cAAc,KAAK,eAAe,IAAI,CACrC,6BAAK,GAAG,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,IAC9F,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,CAClB,CACP,CACG,CACA,CACT,CAAA;KAAA,CACU,CACd,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport { InternalButton } from '../../../button/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { TOOLS_DRAWER_ID } from '../../utils/use-drawers';\nimport { getDrawerStyles } from '../compute-layout';\nimport { AppLayoutInternals } from '../interfaces';\nimport { useResize } from './use-resize';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface AppLayoutDrawerImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n bottomDrawerReportedSize?: number;\n}\n\nexport function AppLayoutDrawerImplementation({\n appLayoutInternals,\n bottomDrawerReportedSize,\n}: AppLayoutDrawerImplementationProps) {\n const {\n activeDrawer,\n minDrawerSize,\n activeDrawerSize,\n maxDrawerSize,\n ariaLabels,\n drawers,\n drawersFocusControl,\n isMobile,\n placement,\n verticalOffsets,\n drawersOpenQueue,\n onActiveDrawerChange,\n onActiveDrawerResize,\n } = appLayoutInternals;\n const drawerRef = useRef<HTMLDivElement>(null);\n const activeDrawerId = activeDrawer?.id;\n\n const computedAriaLabels = {\n closeButton: activeDrawer ? activeDrawer.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeDrawer ? activeDrawer.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const { drawerTopOffset, drawerHeight } = getDrawerStyles(\n verticalOffsets,\n isMobile,\n placement,\n isMobile ? 0 : (bottomDrawerReportedSize ?? 0)\n );\n const toolsOnlyMode = drawers.length === 1 && drawers[0].id === TOOLS_DRAWER_ID;\n const isToolsDrawer = activeDrawer?.id === TOOLS_DRAWER_ID || toolsOnlyMode;\n const toolsContent = drawers?.find(drawer => drawer.id === TOOLS_DRAWER_ID)?.content;\n const resizeProps = useResize({\n currentWidth: activeDrawerSize,\n minWidth: minDrawerSize,\n maxWidth: maxDrawerSize,\n panelRef: drawerRef,\n handleRef: drawersFocusControl.refs.slider,\n onResize: size => onActiveDrawerResize({ id: activeDrawerId!, size }),\n });\n // temporary handle a situation when app-layout is old, but this component come as a widget\n const isLegacyDrawer = drawersOpenQueue === undefined;\n const size = getLimitedValue(minDrawerSize, activeDrawerSize, maxDrawerSize);\n const lastOpenedDrawerId = drawersOpenQueue?.length ? drawersOpenQueue[0] : activeDrawerId;\n const animationDisabled = activeDrawer?.defaultActive && !drawersOpenQueue.includes(activeDrawer.id);\n\n return (\n <Transition nodeRef={drawerRef} in={!!activeDrawer} appear={true} timeout={0}>\n {state => (\n <aside\n id={activeDrawerId}\n aria-hidden={!activeDrawer}\n aria-label={computedAriaLabels.content}\n className={clsx(styles.drawer, {\n [sharedStyles['with-motion-horizontal']]: !animationDisabled,\n [styles['last-opened']]: lastOpenedDrawerId === activeDrawerId,\n [styles.legacy]: isLegacyDrawer,\n [testutilStyles['active-drawer']]: !toolsOnlyMode && activeDrawerId,\n [testutilStyles.tools]: isToolsDrawer,\n [styles['drawer-hidden']]: !activeDrawer,\n [testutilStyles['drawer-closed']]: !activeDrawer,\n })}\n ref={drawerRef}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n drawersFocusControl.loseFocus();\n }\n }}\n style={{\n blockSize: drawerHeight,\n insetBlockStart: drawerTopOffset,\n ...(!isMobile &&\n !isLegacyDrawer && {\n [customCssProps.drawerSize]: `${['entering', 'entered'].includes(state) ? size : 0}px`,\n }),\n }}\n data-testid={activeDrawerId && `awsui-app-layout-drawer-${activeDrawerId}`}\n >\n {!isMobile && activeDrawer?.resizable && (\n <div className={styles['drawer-slider']}>\n <PanelResizeHandle\n ref={drawersFocusControl.refs.slider}\n position=\"side\"\n className={testutilStyles['drawers-slider']}\n ariaLabel={activeDrawer?.ariaLabels?.resizeHandle}\n tooltipText={activeDrawer?.ariaLabels?.resizeHandleTooltipText}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onPointerDown={resizeProps.onPointerDown}\n onDirectionClick={resizeProps.onDirectionClick}\n />\n </div>\n )}\n <div className={clsx(styles['drawer-content-container'], sharedStyles['with-motion-horizontal'])}>\n <div className={clsx(styles['drawer-close-button'])}>\n <InternalButton\n ariaLabel={computedAriaLabels.closeButton}\n className={clsx({\n [testutilStyles['active-drawer-close-button']]: !isToolsDrawer && activeDrawerId,\n [testutilStyles['tools-close']]: isToolsDrawer,\n })}\n formAction=\"none\"\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => onActiveDrawerChange(null, { initiatedByUserAction: true })}\n ref={drawersFocusControl.refs.close}\n variant=\"icon\"\n analyticsAction=\"close\"\n />\n </div>\n <div\n key={TOOLS_DRAWER_ID}\n className={clsx(\n styles['drawer-content'],\n activeDrawerId !== TOOLS_DRAWER_ID && styles['drawer-content-hidden']\n )}\n style={{ blockSize: drawerHeight }}\n >\n {toolsContent}\n </div>\n {activeDrawerId !== TOOLS_DRAWER_ID && (\n <div key={activeDrawerId} className={styles['drawer-content']} style={{ blockSize: drawerHeight }}>\n {activeDrawer?.content}\n </div>\n )}\n </div>\n </aside>\n )}\n </Transition>\n );\n}\n"]}
1
+ {"version":3,"file":"local-drawer.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/local-drawer.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,iBAAiB,MAAM,kDAAkD,CAAC;AACjF,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAOrC,MAAM,UAAU,6BAA6B,C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c,KAAK,eAAe,IAAI,CACrC,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,IACzE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,CAClB,CACP,CACG,CACA,CACT,CAAA;KAAA,CACU,CACd,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport { InternalButton } from '../../../button/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { TOOLS_DRAWER_ID } from '../../utils/use-drawers';\nimport { getDrawerStyles } from '../compute-layout';\nimport { AppLayoutInternals } from '../interfaces';\nimport { useResize } from './use-resize';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface AppLayoutDrawerImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n bottomDrawerReportedSize?: number;\n}\n\nexport function AppLayoutDrawerImplementation({\n appLayoutInternals,\n bottomDrawerReportedSize,\n}: AppLayoutDrawerImplementationProps) {\n const {\n activeDrawer,\n minDrawerSize,\n activeDrawerSize,\n maxDrawerSize,\n ariaLabels,\n drawers,\n drawersFocusControl,\n isMobile,\n placement,\n verticalOffsets,\n drawersOpenQueue,\n onActiveDrawerChange,\n onActiveDrawerResize,\n } = appLayoutInternals;\n const drawerRef = useRef<HTMLDivElement>(null);\n const activeDrawerId = activeDrawer?.id;\n\n const computedAriaLabels = {\n closeButton: activeDrawer ? activeDrawer.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeDrawer ? activeDrawer.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const { drawerTopOffset, drawerHeight } = getDrawerStyles(\n verticalOffsets,\n isMobile,\n placement,\n isMobile ? 0 : (bottomDrawerReportedSize ?? 0)\n );\n const toolsOnlyMode = drawers.length === 1 && drawers[0].id === TOOLS_DRAWER_ID;\n const isToolsDrawer = activeDrawer?.id === TOOLS_DRAWER_ID || toolsOnlyMode;\n const toolsContent = drawers?.find(drawer => drawer.id === TOOLS_DRAWER_ID)?.content;\n const resizeProps = useResize({\n currentWidth: activeDrawerSize,\n minWidth: minDrawerSize,\n maxWidth: maxDrawerSize,\n panelRef: drawerRef,\n handleRef: drawersFocusControl.refs.slider,\n onResize: size => onActiveDrawerResize({ id: activeDrawerId!, size }),\n });\n // temporary handle a situation when app-layout is old, but this component come as a widget\n const isLegacyDrawer = drawersOpenQueue === undefined;\n const size = getLimitedValue(minDrawerSize, activeDrawerSize, maxDrawerSize);\n const lastOpenedDrawerId = drawersOpenQueue?.length ? drawersOpenQueue[0] : activeDrawerId;\n const animationDisabled = activeDrawer?.defaultActive && !drawersOpenQueue.includes(activeDrawer.id);\n\n return (\n <Transition nodeRef={drawerRef} in={!!activeDrawer} appear={true} timeout={0}>\n {state => (\n <aside\n id={activeDrawerId}\n aria-hidden={!activeDrawer}\n aria-label={computedAriaLabels.content}\n className={clsx(styles.drawer, {\n [sharedStyles['with-motion-horizontal']]: !animationDisabled,\n [styles['last-opened']]: lastOpenedDrawerId === activeDrawerId,\n [styles.legacy]: isLegacyDrawer,\n [testutilStyles['active-drawer']]: !toolsOnlyMode && activeDrawerId,\n [testutilStyles.tools]: isToolsDrawer,\n [styles['drawer-hidden']]: !activeDrawer,\n [testutilStyles['drawer-closed']]: !activeDrawer,\n })}\n ref={drawerRef}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n drawersFocusControl.loseFocus();\n }\n }}\n style={{\n blockSize: drawerHeight,\n insetBlockStart: drawerTopOffset,\n ...(!isMobile &&\n !isLegacyDrawer && {\n [customCssProps.drawerSize]: `${['entering', 'entered'].includes(state) ? size : 0}px`,\n }),\n }}\n data-testid={activeDrawerId && `awsui-app-layout-drawer-${activeDrawerId}`}\n >\n {!isMobile && activeDrawer?.resizable && (\n <div className={styles['drawer-slider']}>\n <PanelResizeHandle\n ref={drawersFocusControl.refs.slider}\n position=\"side\"\n className={testutilStyles['drawers-slider']}\n ariaLabel={activeDrawer?.ariaLabels?.resizeHandle}\n tooltipText={activeDrawer?.ariaLabels?.resizeHandleTooltipText}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onPointerDown={resizeProps.onPointerDown}\n onDirectionClick={resizeProps.onDirectionClick}\n />\n </div>\n )}\n <div className={clsx(styles['drawer-content-container'], sharedStyles['with-motion-horizontal'])}>\n <div className={clsx(styles['drawer-close-button'])}>\n <InternalButton\n ariaLabel={computedAriaLabels.closeButton}\n className={clsx({\n [testutilStyles['active-drawer-close-button']]: !isToolsDrawer && activeDrawerId,\n [testutilStyles['tools-close']]: isToolsDrawer,\n })}\n formAction=\"none\"\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => onActiveDrawerChange(null, { initiatedByUserAction: true })}\n ref={drawersFocusControl.refs.close}\n variant=\"icon\"\n analyticsAction=\"close\"\n />\n </div>\n <div\n className={clsx(\n styles['drawer-content'],\n activeDrawerId !== TOOLS_DRAWER_ID && styles['drawer-content-hidden']\n )}\n style={{ blockSize: drawerHeight }}\n >\n {toolsContent}\n </div>\n {activeDrawerId !== TOOLS_DRAWER_ID && (\n <div className={styles['drawer-content']} style={{ blockSize: drawerHeight }}>\n {activeDrawer?.content}\n </div>\n )}\n </div>\n </aside>\n )}\n </Transition>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/skeleton/index.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAQ9E,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAqB,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAK1E,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,sBAAsB,CAAC;IACvC,cAAc,EAAE,qBAAqB,CAAC;IACtC,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,uBAAuB,EAAE,uBAAuB,CAAC;CAClD;AAUD,eAAO,MAAM,cAAc,GAAI,wFAM5B,mBAAmB,gBAsDrB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/skeleton/index.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAQ9E,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAqB,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAK1E,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,sBAAsB,CAAC;IACvC,cAAc,EAAE,qBAAqB,CAAC;IACtC,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,uBAAuB,EAAE,uBAAuB,CAAC;CAClD;AAUD,eAAO,MAAM,cAAc,GAAI,wFAM5B,mBAAmB,gBAsDrB,CAAC"}
@@ -3,7 +3,6 @@
3
3
  import React from 'react';
4
4
  import clsx from 'clsx';
5
5
  import { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';
6
- import { BuiltInErrorBoundary } from '../../../error-boundary/internal';
7
6
  import VisualContext from '../../../internal/components/visual-context';
8
7
  import customCssProps from '../../../internal/generated/custom-css-properties';
9
8
  import { AppLayoutAfterMainSlot, AppLayoutBeforeMainSlot, AppLayoutBottomContentSlot, AppLayoutTopContentSlot, } from '../internal';
@@ -37,7 +36,7 @@ export const SkeletonLayout = ({ registered, appLayoutProps, appLayoutState, too
37
36
  React.createElement(AppLayoutTopContentSlot, { ...mergedProps }),
38
37
  React.createElement("div", { ...contentWrapperElAttributes, className: (_d = contentWrapperElAttributes === null || contentWrapperElAttributes === void 0 ? void 0 : contentWrapperElAttributes.className) !== null && _d !== void 0 ? _d : clsx(styles.main, { [styles['main-disable-paddings']]: appLayoutProps.disableContentPaddings }) },
39
38
  contentHeader && React.createElement("div", { ...contentHeaderElAttributes }, contentHeader),
40
- React.createElement("div", { ...contentElAttributes, className: (_e = contentElAttributes === null || contentElAttributes === void 0 ? void 0 : contentElAttributes.className) !== null && _e !== void 0 ? _e : testutilStyles.content }, registered ? React.createElement(BuiltInErrorBoundary, null, content) : null)),
39
+ React.createElement("div", { ...contentElAttributes, className: (_e = contentElAttributes === null || contentElAttributes === void 0 ? void 0 : contentElAttributes.className) !== null && _e !== void 0 ? _e : testutilStyles.content }, registered ? content : null)),
41
40
  React.createElement(AppLayoutBottomContentSlot, { ...mergedProps })),
42
41
  React.createElement(AppLayoutAfterMainSlot, { ...mergedProps }))));
43
42
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/skeleton/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAGjH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,aAAa,MAAM,6CAA6C,CAAC;AACxE,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAE/E,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CA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zD;YAGH,oBAAC,uBAAuB,OAAK,WAAW,GAAI;YAC5C,iCAAU,gBAAgB,EAAE,SAAS,EAAE,MAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,SAAS,mCAAI,MAAM,CAAC,eAAe,CAAC;gBAC3F,oBAAC,uBAAuB,OAAK,WAAW,GAAI;gBAC5C,gCACM,0BAA0B,EAC9B,SAAS,EACP,MAAA,0BAA0B,aAA1B,0BAA0B,uBAA1B,0BAA0B,CAAE,SAAS,mCACrC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,EAAE,cAAc,CAAC,sBAAsB,EAAE,CAAC;oBAGhG,aAAa,IAAI,gCAAS,yBAAyB,IAAG,aAAa,CAAO;oBAE3E,gCAAS,mBAAmB,EAAE,SAAS,EAAE,MAAA,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,SAAS,mCAAI,cAAc,CAAC,OAAO,IAC9F,UAAU,CAAC,CAAC,CAAC,oBAAC,oBAAoB,QAAE,OAAO,CAAwB,CAAC,CAAC,CAAC,IAAI,CACvE,CACF;gBACN,oBAAC,0BAA0B,OAAK,WAAW,GAAI,CAC1C;YACP,oBAAC,sBAAsB,OAAK,WAAW,GAAI,CACvC,CACQ,CACjB,CAAC;AACJ,CAAC,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';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { GeneratedAnalyticsMetadataAppLayoutToolbarComponent } from '../../../app-layout-toolbar/analytics-metadata/interfaces';\nimport { BuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport VisualContext from '../../../internal/components/visual-context';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { AppLayoutInternalProps, AppLayoutPendingState } from '../interfaces';\nimport {\n AppLayoutAfterMainSlot,\n AppLayoutBeforeMainSlot,\n AppLayoutBottomContentSlot,\n AppLayoutTopContentSlot,\n} from '../internal';\nimport { isWidgetReady } from '../state/invariants';\nimport { ToolbarProps } from '../toolbar';\nimport { SkeletonPartProps, SkeletonSlotsAttributes } from './interfaces';\n\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\nexport interface SkeletonLayoutProps {\n registered: boolean;\n appLayoutProps: AppLayoutInternalProps;\n appLayoutState: AppLayoutPendingState;\n toolbarProps: ToolbarProps | null;\n skeletonSlotsAttributes: SkeletonSlotsAttributes;\n}\n\nconst componentAnalyticsMetadata: GeneratedAnalyticsMetadataAppLayoutToolbarComponent = {\n name: 'awsui.AppLayoutToolbar',\n label: {\n selector: 'h1',\n root: 'body',\n },\n};\n\nexport const SkeletonLayout = ({\n registered,\n appLayoutProps,\n appLayoutState,\n toolbarProps,\n skeletonSlotsAttributes,\n}: SkeletonLayoutProps) => {\n const { contentHeader, content, navigationWidth } = appLayoutProps;\n const mergedProps: SkeletonPartProps = {\n toolbarProps,\n appLayoutProps,\n appLayoutState,\n };\n const {\n wrapperElAttributes,\n mainElAttributes,\n contentWrapperElAttributes,\n contentHeaderElAttributes,\n contentElAttributes,\n } = skeletonSlotsAttributes;\n\n const isWidgetLoaded = isWidgetReady(appLayoutState);\n\n return (\n <VisualContext contextName=\"app-layout-toolbar\">\n <div\n {...getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata })}\n ref={appLayoutState.rootRef as React.Ref<HTMLDivElement>}\n data-awsui-app-layout-widget-loaded={isWidgetLoaded}\n {...wrapperElAttributes}\n className={wrapperElAttributes?.className ?? clsx(styles.root, testutilStyles.root)}\n style={\n wrapperElAttributes?.style ?? {\n blockSize: `calc(100vh - ${appLayoutProps.placement.insetBlockStart + appLayoutProps.placement.insetBlockEnd}px)`,\n [customCssProps.navigationWidth]: `${navigationWidth}px`,\n }\n }\n >\n <AppLayoutBeforeMainSlot {...mergedProps} />\n <main {...mainElAttributes} className={mainElAttributes?.className ?? styles['main-landmark']}>\n <AppLayoutTopContentSlot {...mergedProps} />\n <div\n {...contentWrapperElAttributes}\n className={\n contentWrapperElAttributes?.className ??\n clsx(styles.main, { [styles['main-disable-paddings']]: appLayoutProps.disableContentPaddings })\n }\n >\n {contentHeader && <div {...contentHeaderElAttributes}>{contentHeader}</div>}\n {/*delay rendering the content until registration of this instance is complete*/}\n <div {...contentElAttributes} className={contentElAttributes?.className ?? testutilStyles.content}>\n {registered ? <BuiltInErrorBoundary>{content}</BuiltInErrorBoundary> : null}\n </div>\n </div>\n <AppLayoutBottomContentSlot {...mergedProps} />\n </main>\n <AppLayoutAfterMainSlot {...mergedProps} />\n </div>\n </VisualContext>\n );\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/skeleton/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAGjH,OAAO,aAAa,MAAM,6CAA6C,CAAC;AACxE,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAE/E,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIpD,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAUrC,MAAM,0BAA0B,GAAwD;IACtF,IAAI,EAAE,wBAAwB;IAC9B,KAAK,EAAE;QACL,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,MAAM;KACb;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,UAA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AA1B,0BAA0B,uBAA1B,0BAA0B,CAAE,SAAS,mCACrC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,EAAE,cAAc,CAAC,sBAAsB,EAAE,CAAC;oBAGhG,aAAa,IAAI,gCAAS,yBAAyB,IAAG,aAAa,CAAO;oBAE3E,gCAAS,mBAAmB,EAAE,SAAS,EAAE,MAAA,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,SAAS,mCAAI,cAAc,CAAC,OAAO,IAC9F,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CACxB,CACF;gBACN,oBAAC,0BAA0B,OAAK,WAAW,GAAI,CAC1C;YACP,oBAAC,sBAAsB,OAAK,WAAW,GAAI,CACvC,CACQ,CACjB,CAAC;AACJ,CAAC,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';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { GeneratedAnalyticsMetadataAppLayoutToolbarComponent } from '../../../app-layout-toolbar/analytics-metadata/interfaces';\nimport VisualContext from '../../../internal/components/visual-context';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { AppLayoutInternalProps, AppLayoutPendingState } from '../interfaces';\nimport {\n AppLayoutAfterMainSlot,\n AppLayoutBeforeMainSlot,\n AppLayoutBottomContentSlot,\n AppLayoutTopContentSlot,\n} from '../internal';\nimport { isWidgetReady } from '../state/invariants';\nimport { ToolbarProps } from '../toolbar';\nimport { SkeletonPartProps, SkeletonSlotsAttributes } from './interfaces';\n\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\nexport interface SkeletonLayoutProps {\n registered: boolean;\n appLayoutProps: AppLayoutInternalProps;\n appLayoutState: AppLayoutPendingState;\n toolbarProps: ToolbarProps | null;\n skeletonSlotsAttributes: SkeletonSlotsAttributes;\n}\n\nconst componentAnalyticsMetadata: GeneratedAnalyticsMetadataAppLayoutToolbarComponent = {\n name: 'awsui.AppLayoutToolbar',\n label: {\n selector: 'h1',\n root: 'body',\n },\n};\n\nexport const SkeletonLayout = ({\n registered,\n appLayoutProps,\n appLayoutState,\n toolbarProps,\n skeletonSlotsAttributes,\n}: SkeletonLayoutProps) => {\n const { contentHeader, content, navigationWidth } = appLayoutProps;\n const mergedProps: SkeletonPartProps = {\n toolbarProps,\n appLayoutProps,\n appLayoutState,\n };\n const {\n wrapperElAttributes,\n mainElAttributes,\n contentWrapperElAttributes,\n contentHeaderElAttributes,\n contentElAttributes,\n } = skeletonSlotsAttributes;\n\n const isWidgetLoaded = isWidgetReady(appLayoutState);\n\n return (\n <VisualContext contextName=\"app-layout-toolbar\">\n <div\n {...getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata })}\n ref={appLayoutState.rootRef as React.Ref<HTMLDivElement>}\n data-awsui-app-layout-widget-loaded={isWidgetLoaded}\n {...wrapperElAttributes}\n className={wrapperElAttributes?.className ?? clsx(styles.root, testutilStyles.root)}\n style={\n wrapperElAttributes?.style ?? {\n blockSize: `calc(100vh - ${appLayoutProps.placement.insetBlockStart + appLayoutProps.placement.insetBlockEnd}px)`,\n [customCssProps.navigationWidth]: `${navigationWidth}px`,\n }\n }\n >\n <AppLayoutBeforeMainSlot {...mergedProps} />\n <main {...mainElAttributes} className={mainElAttributes?.className ?? styles['main-landmark']}>\n <AppLayoutTopContentSlot {...mergedProps} />\n <div\n {...contentWrapperElAttributes}\n className={\n contentWrapperElAttributes?.className ??\n clsx(styles.main, { [styles['main-disable-paddings']]: appLayoutProps.disableContentPaddings })\n }\n >\n {contentHeader && <div {...contentHeaderElAttributes}>{contentHeader}</div>}\n {/*delay rendering the content until registration of this instance is complete*/}\n <div {...contentElAttributes} className={contentElAttributes?.className ?? testutilStyles.content}>\n {registered ? content : null}\n </div>\n </div>\n <AppLayoutBottomContentSlot {...mergedProps} />\n </main>\n <AppLayoutAfterMainSlot {...mergedProps} />\n </div>\n </VisualContext>\n );\n};\n"]}
@@ -21,11 +21,6 @@ export interface InternalContainerProps extends Omit<ContainerProps, 'variant'>,
21
21
  variant?: ContainerProps['variant'] | 'embedded' | 'full-page' | 'cards';
22
22
  __funnelSubStepProps?: ReturnType<typeof useFunnelSubStep>['funnelSubStepProps'];
23
23
  __subStepRef?: ReturnType<typeof useFunnelSubStep>['subStepRef'];
24
- /**
25
- * React key attached to the content wrapper. It is used to force content re-mount but not container re-mount, which
26
- * is necessary for components that use container as a root node internally so that their test-utils wrapper is not detached.
27
- */
28
- __contentKey?: string;
29
24
  }
30
25
  export declare function InternalContainerAsSubstep(props: InternalContainerProps): JSX.Element;
31
26
  export default function InternalContainer({
@@ -50,6 +45,5 @@ export default function InternalContainer({
50
45
  __disableStickyMobile,
51
46
  __funnelSubStepProps,
52
47
  __subStepRef,
53
- __contentKey,
54
48
  ...restProps
55
49
  }: InternalContainerProps): JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/container/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAQtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAI1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAQ9C,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,EAAE,0BAA0B;IACzG,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,eAAe,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,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,EAAE,0BAA0B;IACzG,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC9C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,GAAG,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC;IAEzE,oBAAoB,CAAC,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,oBAAoB,CAAC,CAAC;IACjF,YAAY,CAAC,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,YAAY,CAAC,CAAC;CAClE;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,sBAAsB,eAWvE;AAED,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,MAAM,EACN,MAAM,EACN,QAAQ,EACR,OAAmB,EACnB,qBAA6B,EAC7B,sBAA8B,EAC9B,qBAA6B,EAC7B,SAAS,EACT,KAAK,EACL,KAAK,EACL,cAAc,EACd,oBAAoB,EACpB,cAAsB,EACtB,iBAAiB,EACjB,sBAA8B,EAC9B,eAAuB,EACvB,WAAW,EACX,UAAkB,EAClB,qBAA4B,EAC5B,oBAAoB,EACpB,YAAY,EACZ,GAAG,SAAS,EACb,EAAE,sBAAsB,eA2HxB"}
@@ -4,8 +4,6 @@ import React, { useRef } from 'react';
4
4
  import clsx from 'clsx';
5
5
  import { useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';
6
6
  import { getAnalyticsLabelAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';
7
- import InternalBox from '../box/internal';
8
- import { BuiltInErrorBoundary } from '../error-boundary/internal';
9
7
  import { useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';
10
8
  import { getBaseProps } from '../internal/base-component';
11
9
  import { ContainerHeaderContextProvider } from '../internal/context/container-header';
@@ -22,7 +20,7 @@ export function InternalContainerAsSubstep(props) {
22
20
  const modalContext = useModalContext();
23
21
  return (React.createElement(InternalContainer, { ...props, __subStepRef: (modalContext === null || modalContext === void 0 ? void 0 : modalContext.isInModal) ? { current: null } : subStepRef, __funnelSubStepProps: (modalContext === null || modalContext === void 0 ? void 0 : modalContext.isInModal) ? {} : funnelSubStepProps }));
24
22
  }
25
- export default function InternalContainer({ header, footer, children, variant = 'default', disableHeaderPaddings = false, disableContentPaddings = false, disableFooterPaddings = false, fitHeight, media, style, __stickyOffset, __mobileStickyOffset, __stickyHeader = false, __internalRootRef, __disableFooterDivider = false, __hiddenContent = false, __headerRef, __fullPage = false, __disableStickyMobile = true, __funnelSubStepProps, __subStepRef, __contentKey, ...restProps }) {
23
+ export default function InternalContainer({ header, footer, children, variant = 'default', disableHeaderPaddings = false, disableContentPaddings = false, disableFooterPaddings = false, fitHeight, media, style, __stickyOffset, __mobileStickyOffset, __stickyHeader = false, __internalRootRef, __disableFooterDivider = false, __hiddenContent = false, __headerRef, __fullPage = false, __disableStickyMobile = true, __funnelSubStepProps, __subStepRef, ...restProps }) {
26
24
  var _a;
27
25
  const isMobile = useMobile();
28
26
  const isRefresh = useVisualRefresh();
@@ -43,34 +41,32 @@ export default function InternalContainer({ header, footer, children, variant =
43
41
  hasMedia && (React.createElement("div", { className: clsx(styles[`media-${mediaPosition === 'side' ? 'side' : 'top'}`], styles.media), style: mediaPosition === 'top'
44
42
  ? { ...getMediaStyles(mediaPosition, style), height: (media === null || media === void 0 ? void 0 : media.height) || '' }
45
43
  : { ...getMediaStyles(mediaPosition, style), width: (media === null || media === void 0 ? void 0 : media.width) || '' } }, media.content)),
46
- React.createElement("div", { id: contentId, ref: __subStepRef, key: __contentKey, className: clsx(styles['content-wrapper'], fitHeight && styles['content-wrapper-fit-height']) },
47
- React.createElement(BuiltInErrorBoundary, { wrapper: content => React.createElement(InternalBox, { padding: "m" }, content) },
48
- header && (React.createElement(ContainerHeaderContextProvider, null,
49
- React.createElement(StickyHeaderContext.Provider, { value: { isStuck, isStuckAtBottom } },
50
- React.createElement("div", { className: clsx(isRefresh && styles.refresh, styles.header, analyticsSelectors.header, styles[`header-variant-${variant}`], {
51
- [styles['header-sticky-disabled']]: __stickyHeader && !isSticky,
52
- [styles['header-sticky-enabled']]: isSticky,
53
- [styles['header-dynamic-height']]: hasDynamicHeight,
54
- [styles['header-stuck']]: isStuck,
55
- [styles['with-paddings']]: !disableHeaderPaddings,
56
- [styles['with-hidden-content']]: !children || __hiddenContent,
57
- [styles['header-with-media']]: hasMedia,
58
- [styles['header-full-page']]: __fullPage && isRefresh,
59
- }), ref: headerMergedRef, style: {
60
- ...stickyStyles.style,
61
- ...getHeaderStyles(style),
62
- } },
63
- isStuck && !isMobile && isRefresh && __fullPage && React.createElement("div", { className: styles['header-cover'] }),
64
- header)))),
65
- React.createElement("div", { className: clsx(styles.content, fitHeight && styles['content-fit-height']) },
66
- React.createElement("div", { className: clsx(styles['content-inner'], testStyles['content-inner'], {
67
- [styles['with-paddings']]: !disableContentPaddings,
68
- [styles['with-header']]: !!header,
69
- }), style: getContentStyles(style) },
70
- React.createElement(BuiltInErrorBoundary, { wrapper: content => (React.createElement(InternalBox, { padding: disableContentPaddings ? 'm' : undefined }, content)) }, children))),
71
- footer && (React.createElement("div", { className: clsx(styles.footer, {
72
- [styles['with-divider']]: !__disableFooterDivider,
73
- [styles['with-paddings']]: !disableFooterPaddings,
74
- }), style: getFooterStyles(style) }, footer))))));
44
+ React.createElement("div", { id: contentId, ref: __subStepRef, className: clsx(styles['content-wrapper'], fitHeight && styles['content-wrapper-fit-height']) },
45
+ header && (React.createElement(ContainerHeaderContextProvider, null,
46
+ React.createElement(StickyHeaderContext.Provider, { value: { isStuck, isStuckAtBottom } },
47
+ React.createElement("div", { className: clsx(isRefresh && styles.refresh, styles.header, analyticsSelectors.header, styles[`header-variant-${variant}`], {
48
+ [styles['header-sticky-disabled']]: __stickyHeader && !isSticky,
49
+ [styles['header-sticky-enabled']]: isSticky,
50
+ [styles['header-dynamic-height']]: hasDynamicHeight,
51
+ [styles['header-stuck']]: isStuck,
52
+ [styles['with-paddings']]: !disableHeaderPaddings,
53
+ [styles['with-hidden-content']]: !children || __hiddenContent,
54
+ [styles['header-with-media']]: hasMedia,
55
+ [styles['header-full-page']]: __fullPage && isRefresh,
56
+ }), ref: headerMergedRef, style: {
57
+ ...stickyStyles.style,
58
+ ...getHeaderStyles(style),
59
+ } },
60
+ isStuck && !isMobile && isRefresh && __fullPage && React.createElement("div", { className: styles['header-cover'] }),
61
+ header)))),
62
+ React.createElement("div", { className: clsx(styles.content, fitHeight && styles['content-fit-height']) },
63
+ React.createElement("div", { className: clsx(styles['content-inner'], testStyles['content-inner'], {
64
+ [styles['with-paddings']]: !disableContentPaddings,
65
+ [styles['with-header']]: !!header,
66
+ }), style: getContentStyles(style) }, children)),
67
+ footer && (React.createElement("div", { className: clsx(styles.footer, {
68
+ [styles['with-divider']]: !__disableFooterDivider,
69
+ [styles['with-paddings']]: !disableFooterPaddings,
70
+ }), style: getFooterStyles(style) }, footer)))));
75
71
  }
76
72
  //# sourceMappingURL=internal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/container/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC1F,O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EACF,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC,IAE5B,MAAM,CACH,CACP,CACoB,CACnB,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsLabelAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalBox from '../box/internal';\nimport { BuiltInErrorBoundary } from '../error-boundary/internal';\nimport { useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport { getBaseProps } from '../internal/base-component';\nimport { ContainerHeaderContextProvider } from '../internal/context/container-header';\nimport { useModalContext } from '../internal/context/modal-context';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { ContainerProps } from './interfaces';\nimport { getContentStyles, getFooterStyles, getHeaderStyles, getMediaStyles, getRootStyles } from './style';\nimport { StickyHeaderContext, useStickyHeader } from './use-sticky-header';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\nimport testStyles from './test-classes/styles.css.js';\n\nexport interface InternalContainerProps extends Omit<ContainerProps, 'variant'>, InternalBaseComponentProps {\n disableFooterPaddings?: boolean;\n __stickyHeader?: boolean;\n __stickyOffset?: number;\n __mobileStickyOffset?: number;\n __disableFooterDivider?: boolean;\n __hiddenContent?: boolean;\n __headerRef?: React.RefObject<HTMLDivElement>;\n __fullPage?: boolean;\n __disableStickyMobile?: boolean;\n /**\n * Additional internal variant:\n * * `embedded` - Use this variant within a parent container (such as a modal,\n * expandable section, container or split panel).\n * * `full-page` – Only for internal use in table, cards and other components\n */\n variant?: ContainerProps['variant'] | 'embedded' | 'full-page' | 'cards';\n\n __funnelSubStepProps?: ReturnType<typeof useFunnelSubStep>['funnelSubStepProps'];\n __subStepRef?: ReturnType<typeof useFunnelSubStep>['subStepRef'];\n\n /**\n * React key attached to the content wrapper. It is used to force content re-mount but not container re-mount, which\n * is necessary for components that use container as a root node internally so that their test-utils wrapper is not detached.\n */\n __contentKey?: string;\n}\n\nexport function InternalContainerAsSubstep(props: InternalContainerProps) {\n const { subStepRef, funnelSubStepProps } = useFunnelSubStep();\n const modalContext = useModalContext();\n\n return (\n <InternalContainer\n {...props}\n __subStepRef={modalContext?.isInModal ? { current: null } : subStepRef}\n __funnelSubStepProps={modalContext?.isInModal ? {} : funnelSubStepProps}\n />\n );\n}\n\nexport default function InternalContainer({\n header,\n footer,\n children,\n variant = 'default',\n disableHeaderPaddings = false,\n disableContentPaddings = false,\n disableFooterPaddings = false,\n fitHeight,\n media,\n style,\n __stickyOffset,\n __mobileStickyOffset,\n __stickyHeader = false,\n __internalRootRef,\n __disableFooterDivider = false,\n __hiddenContent = false,\n __headerRef,\n __fullPage = false,\n __disableStickyMobile = true,\n __funnelSubStepProps,\n __subStepRef,\n __contentKey,\n ...restProps\n}: InternalContainerProps) {\n const isMobile = useMobile();\n const isRefresh = useVisualRefresh();\n const baseProps = getBaseProps(restProps);\n const rootRef = useRef<HTMLDivElement>(null);\n const headerRef = useRef<HTMLDivElement>(null);\n const { isSticky, isStuck, isStuckAtBottom, stickyStyles } = useStickyHeader(\n rootRef,\n headerRef,\n __stickyHeader,\n __stickyOffset,\n __mobileStickyOffset,\n __disableStickyMobile,\n __fullPage && isRefresh && !isMobile\n );\n const contentId = useUniqueId();\n\n const hasDynamicHeight = isRefresh && variant === 'full-page';\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n const headerMergedRef = useMergeRefs(headerRef, __headerRef);\n\n // The container is only sticky on mobile if it is the header for the table.\n // In this case we don't want the container to have sticky styles, as only the table header row will show as stuck on scroll.\n const shouldHaveStickyStyles = isSticky && !isMobile;\n\n const hasMedia = !!media?.content;\n const mediaPosition = media?.position ?? 'top';\n\n return (\n <div\n {...baseProps}\n {...__funnelSubStepProps}\n className={clsx(\n baseProps.className,\n styles.root,\n styles[`variant-${variant}`],\n fitHeight && styles['fit-height'],\n hasMedia && (mediaPosition === 'side' ? styles['with-side-media'] : styles['with-top-media']),\n shouldHaveStickyStyles && [styles['sticky-enabled']],\n shouldHaveStickyStyles && isStuck && isStuckAtBottom && [styles['with-stuck-sticky-header-at-bottom']],\n isRefresh && styles.refresh\n )}\n ref={mergedRef}\n {...getAnalyticsLabelAttribute(\n `.${analyticsSelectors.header} h1, .${analyticsSelectors.header} h2, .${analyticsSelectors.header} h3`\n )}\n style={getRootStyles(style)}\n >\n {hasMedia && (\n <div\n className={clsx(styles[`media-${mediaPosition === 'side' ? 'side' : 'top'}`], styles.media)}\n style={\n mediaPosition === 'top'\n ? { ...getMediaStyles(mediaPosition, style), height: media?.height || '' }\n : { ...getMediaStyles(mediaPosition, style), width: media?.width || '' }\n }\n >\n {media.content}\n </div>\n )}\n <div\n id={contentId}\n ref={__subStepRef}\n key={__contentKey}\n className={clsx(styles['content-wrapper'], fitHeight && styles['content-wrapper-fit-height'])}\n >\n {/* We use a wrapper around the boundary to preserve container's paddings. */}\n <BuiltInErrorBoundary wrapper={content => <InternalBox padding=\"m\">{content}</InternalBox>}>\n {header && (\n <ContainerHeaderContextProvider>\n <StickyHeaderContext.Provider value={{ isStuck, isStuckAtBottom }}>\n <div\n className={clsx(\n isRefresh && styles.refresh,\n styles.header,\n analyticsSelectors.header,\n styles[`header-variant-${variant}`],\n {\n [styles['header-sticky-disabled']]: __stickyHeader && !isSticky,\n [styles['header-sticky-enabled']]: isSticky,\n [styles['header-dynamic-height']]: hasDynamicHeight,\n [styles['header-stuck']]: isStuck,\n [styles['with-paddings']]: !disableHeaderPaddings,\n [styles['with-hidden-content']]: !children || __hiddenContent,\n [styles['header-with-media']]: hasMedia,\n [styles['header-full-page']]: __fullPage && isRefresh,\n }\n )}\n ref={headerMergedRef}\n style={{\n ...stickyStyles.style,\n ...getHeaderStyles(style),\n }}\n >\n {isStuck && !isMobile && isRefresh && __fullPage && <div className={styles['header-cover']}></div>}\n {header}\n </div>\n </StickyHeaderContext.Provider>\n </ContainerHeaderContextProvider>\n )}\n <div className={clsx(styles.content, fitHeight && styles['content-fit-height'])}>\n <div\n className={clsx(styles['content-inner'], testStyles['content-inner'], {\n [styles['with-paddings']]: !disableContentPaddings,\n [styles['with-header']]: !!header,\n })}\n style={getContentStyles(style)}\n >\n {/* We use a wrapper around the boundary to preserve paddings in case they were disabled by the consumer.\n That is needed because the consumer-defined paddings that normally come with the content can no longer\n apply since the content failed to render. */}\n <BuiltInErrorBoundary\n wrapper={content => (\n <InternalBox padding={disableContentPaddings ? 'm' : undefined}>{content}</InternalBox>\n )}\n >\n {children}\n </BuiltInErrorBoundary>\n </div>\n </div>\n {footer && (\n <div\n className={clsx(styles.footer, {\n [styles['with-divider']]: !__disableFooterDivider,\n [styles['with-paddings']]: !disableFooterPaddings,\n })}\n style={getFooterStyles(style)}\n >\n {footer}\n </div>\n )}\n </BuiltInErrorBoundary>\n </div>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/container/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AAE9G,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAE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AC;gBAC7E,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC,eAAe,CAAC,EAAE;wBACpE,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,sBAAsB;wBAClD,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM;qBAClC,CAAC,EACF,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,IAE7B,QAAQ,CACL,CACF;YACL,MAAM,IAAI,CACT,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;oBAC7B,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,sBAAsB;oBACjD,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,qBAAqB;iBAClD,CAAC,EACF,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC,IAE5B,MAAM,CACH,CACP,CACG,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsLabelAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport { getBaseProps } from '../internal/base-component';\nimport { ContainerHeaderContextProvider } from '../internal/context/container-header';\nimport { useModalContext } from '../internal/context/modal-context';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { ContainerProps } from './interfaces';\nimport { getContentStyles, getFooterStyles, getHeaderStyles, getMediaStyles, getRootStyles } from './style';\nimport { StickyHeaderContext, useStickyHeader } from './use-sticky-header';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\nimport testStyles from './test-classes/styles.css.js';\n\nexport interface InternalContainerProps extends Omit<ContainerProps, 'variant'>, InternalBaseComponentProps {\n disableFooterPaddings?: boolean;\n __stickyHeader?: boolean;\n __stickyOffset?: number;\n __mobileStickyOffset?: number;\n __disableFooterDivider?: boolean;\n __hiddenContent?: boolean;\n __headerRef?: React.RefObject<HTMLDivElement>;\n __fullPage?: boolean;\n __disableStickyMobile?: boolean;\n /**\n * Additional internal variant:\n * * `embedded` - Use this variant within a parent container (such as a modal,\n * expandable section, container or split panel).\n * * `full-page` – Only for internal use in table, cards and other components\n */\n variant?: ContainerProps['variant'] | 'embedded' | 'full-page' | 'cards';\n\n __funnelSubStepProps?: ReturnType<typeof useFunnelSubStep>['funnelSubStepProps'];\n __subStepRef?: ReturnType<typeof useFunnelSubStep>['subStepRef'];\n}\n\nexport function InternalContainerAsSubstep(props: InternalContainerProps) {\n const { subStepRef, funnelSubStepProps } = useFunnelSubStep();\n const modalContext = useModalContext();\n\n return (\n <InternalContainer\n {...props}\n __subStepRef={modalContext?.isInModal ? { current: null } : subStepRef}\n __funnelSubStepProps={modalContext?.isInModal ? {} : funnelSubStepProps}\n />\n );\n}\n\nexport default function InternalContainer({\n header,\n footer,\n children,\n variant = 'default',\n disableHeaderPaddings = false,\n disableContentPaddings = false,\n disableFooterPaddings = false,\n fitHeight,\n media,\n style,\n __stickyOffset,\n __mobileStickyOffset,\n __stickyHeader = false,\n __internalRootRef,\n __disableFooterDivider = false,\n __hiddenContent = false,\n __headerRef,\n __fullPage = false,\n __disableStickyMobile = true,\n __funnelSubStepProps,\n __subStepRef,\n ...restProps\n}: InternalContainerProps) {\n const isMobile = useMobile();\n const isRefresh = useVisualRefresh();\n const baseProps = getBaseProps(restProps);\n const rootRef = useRef<HTMLDivElement>(null);\n const headerRef = useRef<HTMLDivElement>(null);\n const { isSticky, isStuck, isStuckAtBottom, stickyStyles } = useStickyHeader(\n rootRef,\n headerRef,\n __stickyHeader,\n __stickyOffset,\n __mobileStickyOffset,\n __disableStickyMobile,\n __fullPage && isRefresh && !isMobile\n );\n const contentId = useUniqueId();\n\n const hasDynamicHeight = isRefresh && variant === 'full-page';\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n const headerMergedRef = useMergeRefs(headerRef, __headerRef);\n\n // The container is only sticky on mobile if it is the header for the table.\n // In this case we don't want the container to have sticky styles, as only the table header row will show as stuck on scroll.\n const shouldHaveStickyStyles = isSticky && !isMobile;\n\n const hasMedia = !!media?.content;\n const mediaPosition = media?.position ?? 'top';\n\n return (\n <div\n {...baseProps}\n {...__funnelSubStepProps}\n className={clsx(\n baseProps.className,\n styles.root,\n styles[`variant-${variant}`],\n fitHeight && styles['fit-height'],\n hasMedia && (mediaPosition === 'side' ? styles['with-side-media'] : styles['with-top-media']),\n shouldHaveStickyStyles && [styles['sticky-enabled']],\n shouldHaveStickyStyles && isStuck && isStuckAtBottom && [styles['with-stuck-sticky-header-at-bottom']],\n isRefresh && styles.refresh\n )}\n ref={mergedRef}\n {...getAnalyticsLabelAttribute(\n `.${analyticsSelectors.header} h1, .${analyticsSelectors.header} h2, .${analyticsSelectors.header} h3`\n )}\n style={getRootStyles(style)}\n >\n {hasMedia && (\n <div\n className={clsx(styles[`media-${mediaPosition === 'side' ? 'side' : 'top'}`], styles.media)}\n style={\n mediaPosition === 'top'\n ? { ...getMediaStyles(mediaPosition, style), height: media?.height || '' }\n : { ...getMediaStyles(mediaPosition, style), width: media?.width || '' }\n }\n >\n {media.content}\n </div>\n )}\n <div\n id={contentId}\n ref={__subStepRef}\n className={clsx(styles['content-wrapper'], fitHeight && styles['content-wrapper-fit-height'])}\n >\n {header && (\n <ContainerHeaderContextProvider>\n <StickyHeaderContext.Provider value={{ isStuck, isStuckAtBottom }}>\n <div\n className={clsx(\n isRefresh && styles.refresh,\n styles.header,\n analyticsSelectors.header,\n styles[`header-variant-${variant}`],\n {\n [styles['header-sticky-disabled']]: __stickyHeader && !isSticky,\n [styles['header-sticky-enabled']]: isSticky,\n [styles['header-dynamic-height']]: hasDynamicHeight,\n [styles['header-stuck']]: isStuck,\n [styles['with-paddings']]: !disableHeaderPaddings,\n [styles['with-hidden-content']]: !children || __hiddenContent,\n [styles['header-with-media']]: hasMedia,\n [styles['header-full-page']]: __fullPage && isRefresh,\n }\n )}\n ref={headerMergedRef}\n style={{\n ...stickyStyles.style,\n ...getHeaderStyles(style),\n }}\n >\n {isStuck && !isMobile && isRefresh && __fullPage && <div className={styles['header-cover']}></div>}\n {header}\n </div>\n </StickyHeaderContext.Provider>\n </ContainerHeaderContextProvider>\n )}\n <div className={clsx(styles.content, fitHeight && styles['content-fit-height'])}>\n <div\n className={clsx(styles['content-inner'], testStyles['content-inner'], {\n [styles['with-paddings']]: !disableContentPaddings,\n [styles['with-header']]: !!header,\n })}\n style={getContentStyles(style)}\n >\n {children}\n </div>\n </div>\n {footer && (\n <div\n className={clsx(styles.footer, {\n [styles['with-divider']]: !__disableFooterDivider,\n [styles['with-paddings']]: !disableFooterPaddings,\n })}\n style={getFooterStyles(style)}\n >\n {footer}\n </div>\n )}\n </div>\n </div>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../../../src/drawer/implementation.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAIlF,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAK3C,KAAK,mBAAmB,GAAG,WAAW,GAAG,0BAA0B,CAAC;AAEpE,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,MAAM,EACN,QAAQ,EACR,OAAO,EACP,WAAW,EACX,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,EACb,GAAG,SAAS,EACb,EAAE,mBAAmB,eAqErB;AAED,eAAO,MAAM,sBAAsB,mFAAkD,CAAC"}
1
+ {"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../../../src/drawer/implementation.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAIlF,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAK3C,KAAK,mBAAmB,GAAG,WAAW,GAAG,0BAA0B,CAAC;AAEpE,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,MAAM,EACN,QAAQ,EACR,OAAO,EACP,WAAW,EACX,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,EACb,GAAG,SAAS,EACb,EAAE,mBAAmB,eAqErB;AAED,eAAO,MAAM,sBAAsB,mFAAkD,CAAC"}
@@ -4,7 +4,6 @@ import React, { useRef } from 'react';
4
4
  import clsx from 'clsx';
5
5
  import { useRuntimeDrawerContext } from '../app-layout/runtime-drawer/use-runtime-drawer-context';
6
6
  import { useAppLayoutToolbarDesignEnabled } from '../app-layout/utils/feature-flags';
7
- import { BuiltInErrorBoundary } from '../error-boundary/internal';
8
7
  import { useInternalI18n } from '../i18n/context';
9
8
  import { getBaseProps } from '../internal/base-component';
10
9
  import { createWidgetizedComponent } from '../internal/widgets';
@@ -22,7 +21,7 @@ export function DrawerImplementation({ header, footer, children, loading, i18nSt
22
21
  };
23
22
  const footerRef = useRef(null);
24
23
  const runtimeDrawerContext = useRuntimeDrawerContext({ rootRef: __internalRootRef });
25
- const hasAdditionalDrawerAction = !!(runtimeDrawerContext === null || runtimeDrawerContext === void 0 ? void 0 : runtimeDrawerContext.isExpandable);
24
+ const hasAdditioalDrawerAction = !!(runtimeDrawerContext === null || runtimeDrawerContext === void 0 ? void 0 : runtimeDrawerContext.isExpandable);
26
25
  const { isSticky: isFooterSticky } = useStickyFooter({
27
26
  drawerRef: __internalRootRef,
28
27
  footerRef,
@@ -30,11 +29,10 @@ export function DrawerImplementation({ header, footer, children, loading, i18nSt
30
29
  return loading ? (React.createElement("div", { ...containerProps, className: clsx(containerProps.className, styles['content-with-paddings']), ref: __internalRootRef },
31
30
  React.createElement(InternalStatusIndicator, { type: "loading" },
32
31
  React.createElement(InternalLiveRegion, { tagName: "span" }, i18n('i18nStrings.loadingText', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.loadingText))))) : (React.createElement("div", { ...containerProps, ref: __internalRootRef },
33
- header && (React.createElement("div", { className: clsx(styles.header, runtimeDrawerContext && styles['with-runtime-context'], hasAdditionalDrawerAction && styles['with-additional-action']) },
32
+ header && (React.createElement("div", { className: clsx(styles.header, runtimeDrawerContext && styles['with-runtime-context'], hasAdditioalDrawerAction && styles['with-additional-action']) },
34
33
  header,
35
34
  headerActions && React.createElement("div", { className: styles['header-actions'] }, headerActions))),
36
- React.createElement("div", { className: clsx(styles['test-utils-drawer-content'], styles.content, !disableContentPaddings && styles['content-with-paddings']) },
37
- React.createElement(BuiltInErrorBoundary, null, children)),
35
+ React.createElement("div", { className: clsx(styles['test-utils-drawer-content'], styles.content, !disableContentPaddings && styles['content-with-paddings']) }, children),
38
36
  footer && (React.createElement("div", { ref: footerRef, className: clsx(styles.footer, {
39
37
  [styles['is-sticky']]: isFooterSticky,
40
38
  }) }, footer))));