@cloudscape-design/components 3.0.773 → 3.0.774

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 (218) hide show
  1. package/app-layout/drawer/index.js.map +1 -1
  2. package/app-layout/drawer/overflow-menu.d.ts +6 -2
  3. package/app-layout/drawer/overflow-menu.d.ts.map +1 -1
  4. package/app-layout/drawer/overflow-menu.js +22 -8
  5. package/app-layout/drawer/overflow-menu.js.map +1 -1
  6. package/app-layout/interfaces.d.ts +2 -1
  7. package/app-layout/interfaces.d.ts.map +1 -1
  8. package/app-layout/interfaces.js.map +1 -1
  9. package/app-layout/mobile-toolbar/index.js.map +1 -1
  10. package/app-layout/runtime-api.d.ts +4 -3
  11. package/app-layout/runtime-api.d.ts.map +1 -1
  12. package/app-layout/runtime-api.js +15 -11
  13. package/app-layout/runtime-api.js.map +1 -1
  14. package/app-layout/test-classes/styles.css.js +20 -19
  15. package/app-layout/test-classes/styles.scoped.css +23 -19
  16. package/app-layout/test-classes/styles.selectors.js +20 -19
  17. package/app-layout/utils/use-drawers.d.ts +12 -1
  18. package/app-layout/utils/use-drawers.d.ts.map +1 -1
  19. package/app-layout/utils/use-drawers.js +125 -20
  20. package/app-layout/utils/use-drawers.js.map +1 -1
  21. package/app-layout/utils/use-focus-control.d.ts +10 -0
  22. package/app-layout/utils/use-focus-control.d.ts.map +1 -1
  23. package/app-layout/utils/use-focus-control.js +60 -1
  24. package/app-layout/utils/use-focus-control.js.map +1 -1
  25. package/app-layout/utils/visibility-context.d.ts +3 -0
  26. package/app-layout/utils/visibility-context.d.ts.map +1 -0
  27. package/app-layout/utils/visibility-context.js +5 -0
  28. package/app-layout/utils/visibility-context.js.map +1 -0
  29. package/app-layout/visual-refresh/drawers.js.map +1 -1
  30. package/app-layout/visual-refresh-toolbar/compute-layout.d.ts +5 -1
  31. package/app-layout/visual-refresh-toolbar/compute-layout.d.ts.map +1 -1
  32. package/app-layout/visual-refresh-toolbar/compute-layout.js +15 -4
  33. package/app-layout/visual-refresh-toolbar/compute-layout.js.map +1 -1
  34. package/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts +15 -0
  35. package/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts.map +1 -0
  36. package/app-layout/visual-refresh-toolbar/drawer/global-drawer.js +71 -0
  37. package/app-layout/visual-refresh-toolbar/drawer/global-drawer.js.map +1 -0
  38. package/app-layout/visual-refresh-toolbar/drawer/global-drawers.d.ts +6 -1
  39. package/app-layout/visual-refresh-toolbar/drawer/global-drawers.d.ts.map +1 -1
  40. package/app-layout/visual-refresh-toolbar/drawer/global-drawers.js +15 -4
  41. package/app-layout/visual-refresh-toolbar/drawer/global-drawers.js.map +1 -1
  42. package/app-layout/visual-refresh-toolbar/drawer/local-drawer.d.ts.map +1 -1
  43. package/app-layout/visual-refresh-toolbar/drawer/local-drawer.js +35 -23
  44. package/app-layout/visual-refresh-toolbar/drawer/local-drawer.js.map +1 -1
  45. package/app-layout/visual-refresh-toolbar/drawer/styles.css.js +10 -6
  46. package/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +28 -6
  47. package/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +10 -6
  48. package/app-layout/visual-refresh-toolbar/index.d.ts.map +1 -1
  49. package/app-layout/visual-refresh-toolbar/index.js +60 -6
  50. package/app-layout/visual-refresh-toolbar/index.js.map +1 -1
  51. package/app-layout/visual-refresh-toolbar/interfaces.d.ts +10 -1
  52. package/app-layout/visual-refresh-toolbar/interfaces.d.ts.map +1 -1
  53. package/app-layout/visual-refresh-toolbar/interfaces.js.map +1 -1
  54. package/app-layout/visual-refresh-toolbar/skeleton/index.d.ts +3 -1
  55. package/app-layout/visual-refresh-toolbar/skeleton/index.d.ts.map +1 -1
  56. package/app-layout/visual-refresh-toolbar/skeleton/index.js +3 -2
  57. package/app-layout/visual-refresh-toolbar/skeleton/index.js.map +1 -1
  58. package/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +17 -16
  59. package/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +50 -32
  60. package/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +17 -16
  61. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.d.ts +6 -2
  62. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.d.ts.map +1 -1
  63. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js +34 -10
  64. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js.map +1 -1
  65. package/app-layout/visual-refresh-toolbar/toolbar/index.d.ts +5 -1
  66. package/app-layout/visual-refresh-toolbar/toolbar/index.d.ts.map +1 -1
  67. package/app-layout/visual-refresh-toolbar/toolbar/index.js +17 -13
  68. package/app-layout/visual-refresh-toolbar/toolbar/index.js.map +1 -1
  69. package/collection-preferences/analytics-metadata/interfaces.d.ts +43 -0
  70. package/collection-preferences/analytics-metadata/interfaces.d.ts.map +1 -0
  71. package/collection-preferences/analytics-metadata/interfaces.js +4 -0
  72. package/collection-preferences/analytics-metadata/interfaces.js.map +1 -0
  73. package/collection-preferences/analytics-metadata/styles.css.js +6 -0
  74. package/collection-preferences/analytics-metadata/styles.scoped.css +7 -0
  75. package/collection-preferences/analytics-metadata/styles.selectors.js +7 -0
  76. package/collection-preferences/analytics-metadata/utils.d.ts +9 -0
  77. package/collection-preferences/analytics-metadata/utils.d.ts.map +1 -0
  78. package/collection-preferences/analytics-metadata/utils.js +48 -0
  79. package/collection-preferences/analytics-metadata/utils.js.map +1 -0
  80. package/collection-preferences/content-display/content-display-option.d.ts +1 -0
  81. package/collection-preferences/content-display/content-display-option.d.ts.map +1 -1
  82. package/collection-preferences/content-display/content-display-option.js +2 -2
  83. package/collection-preferences/content-display/content-display-option.js.map +1 -1
  84. package/collection-preferences/content-display/draggable-option.d.ts.map +1 -1
  85. package/collection-preferences/content-display/draggable-option.js +2 -2
  86. package/collection-preferences/content-display/draggable-option.js.map +1 -1
  87. package/collection-preferences/content-display/index.d.ts +1 -1
  88. package/collection-preferences/content-display/index.d.ts.map +1 -1
  89. package/collection-preferences/content-display/index.js +21 -7
  90. package/collection-preferences/content-display/index.js.map +1 -1
  91. package/collection-preferences/content-display/styles.css.js +13 -11
  92. package/collection-preferences/content-display/styles.scoped.css +19 -17
  93. package/collection-preferences/content-display/styles.selectors.js +13 -11
  94. package/collection-preferences/index.d.ts.map +1 -1
  95. package/collection-preferences/index.js +21 -15
  96. package/collection-preferences/index.js.map +1 -1
  97. package/collection-preferences/interfaces.d.ts +29 -0
  98. package/collection-preferences/interfaces.d.ts.map +1 -1
  99. package/collection-preferences/interfaces.js.map +1 -1
  100. package/collection-preferences/styles.css.js +39 -37
  101. package/collection-preferences/styles.scoped.css +46 -44
  102. package/collection-preferences/styles.selectors.js +39 -37
  103. package/collection-preferences/utils.d.ts.map +1 -1
  104. package/collection-preferences/utils.js +12 -13
  105. package/collection-preferences/utils.js.map +1 -1
  106. package/collection-preferences/visible-content.d.ts.map +1 -1
  107. package/collection-preferences/visible-content.js +2 -1
  108. package/collection-preferences/visible-content.js.map +1 -1
  109. package/date-range-picker/index.d.ts.map +1 -1
  110. package/date-range-picker/index.js +9 -10
  111. package/date-range-picker/index.js.map +1 -1
  112. package/date-range-picker/styles.css.js +38 -39
  113. package/date-range-picker/styles.scoped.css +47 -51
  114. package/date-range-picker/styles.selectors.js +38 -39
  115. package/flashbar/styles.css.js +50 -50
  116. package/flashbar/styles.scoped.css +156 -149
  117. package/flashbar/styles.selectors.js +50 -50
  118. package/i18n/messages/all.all.js +1 -1
  119. package/i18n/messages/all.all.json +1 -1
  120. package/i18n/messages/all.ar.js +1 -1
  121. package/i18n/messages/all.ar.json +1 -1
  122. package/i18n/messages/all.de.js +1 -1
  123. package/i18n/messages/all.de.json +1 -1
  124. package/i18n/messages/all.en-GB.js +1 -1
  125. package/i18n/messages/all.en-GB.json +1 -1
  126. package/i18n/messages/all.en.js +1 -1
  127. package/i18n/messages/all.en.json +1 -1
  128. package/i18n/messages/all.es.js +1 -1
  129. package/i18n/messages/all.es.json +1 -1
  130. package/i18n/messages/all.fr.js +1 -1
  131. package/i18n/messages/all.fr.json +1 -1
  132. package/i18n/messages/all.id.js +1 -1
  133. package/i18n/messages/all.id.json +1 -1
  134. package/i18n/messages/all.it.js +1 -1
  135. package/i18n/messages/all.it.json +1 -1
  136. package/i18n/messages/all.ja.js +1 -1
  137. package/i18n/messages/all.ja.json +1 -1
  138. package/i18n/messages/all.ko.js +1 -1
  139. package/i18n/messages/all.ko.json +1 -1
  140. package/i18n/messages/all.pt-BR.js +1 -1
  141. package/i18n/messages/all.pt-BR.json +1 -1
  142. package/i18n/messages/all.tr.js +1 -1
  143. package/i18n/messages/all.tr.json +1 -1
  144. package/i18n/messages/all.zh-CN.js +1 -1
  145. package/i18n/messages/all.zh-CN.json +1 -1
  146. package/i18n/messages/all.zh-TW.js +1 -1
  147. package/i18n/messages/all.zh-TW.json +1 -1
  148. package/i18n/messages-types.d.ts +7 -0
  149. package/i18n/messages-types.d.ts.map +1 -1
  150. package/i18n/messages-types.js.map +1 -1
  151. package/internal/analytics/interfaces.d.ts +1 -0
  152. package/internal/analytics/interfaces.d.ts.map +1 -1
  153. package/internal/analytics/interfaces.js.map +1 -1
  154. package/internal/components/drag-handle/index.d.ts +2 -1
  155. package/internal/components/drag-handle/index.d.ts.map +1 -1
  156. package/internal/components/drag-handle/index.js +3 -3
  157. package/internal/components/drag-handle/index.js.map +1 -1
  158. package/internal/components/drag-handle/styles.css.js +2 -1
  159. package/internal/components/drag-handle/styles.scoped.css +6 -2
  160. package/internal/components/drag-handle/styles.selectors.js +2 -1
  161. package/internal/environment.js +1 -1
  162. package/internal/environment.json +1 -1
  163. package/internal/hooks/use-component-analytics/index.d.ts +7 -1
  164. package/internal/hooks/use-component-analytics/index.d.ts.map +1 -1
  165. package/internal/hooks/use-component-analytics/index.js +21 -4
  166. package/internal/hooks/use-component-analytics/index.js.map +1 -1
  167. package/internal/manifest.json +1 -1
  168. package/internal/plugins/controllers/drawers.d.ts +19 -2
  169. package/internal/plugins/controllers/drawers.d.ts.map +1 -1
  170. package/internal/plugins/controllers/drawers.js +34 -2
  171. package/internal/plugins/controllers/drawers.js.map +1 -1
  172. package/internal/plugins/helpers/runtime-content-wrapper.d.ts +4 -2
  173. package/internal/plugins/helpers/runtime-content-wrapper.d.ts.map +1 -1
  174. package/internal/plugins/helpers/runtime-content-wrapper.js +19 -4
  175. package/internal/plugins/helpers/runtime-content-wrapper.js.map +1 -1
  176. package/modal/internal.d.ts +1 -0
  177. package/modal/internal.d.ts.map +1 -1
  178. package/modal/internal.js +2 -2
  179. package/modal/internal.js.map +1 -1
  180. package/package.json +1 -1
  181. package/table/internal.d.ts.map +1 -1
  182. package/table/internal.js +2 -2
  183. package/table/internal.js.map +1 -1
  184. package/test-utils/dom/collection-preferences/content-display-preference.d.ts +9 -0
  185. package/test-utils/dom/collection-preferences/content-display-preference.js +13 -0
  186. package/test-utils/dom/collection-preferences/content-display-preference.js.map +1 -1
  187. package/test-utils/selectors/collection-preferences/content-display-preference.d.ts +9 -0
  188. package/test-utils/selectors/collection-preferences/content-display-preference.js +13 -0
  189. package/test-utils/selectors/collection-preferences/content-display-preference.js.map +1 -1
  190. package/test-utils/tsconfig.tsbuildinfo +1 -1
  191. package/wizard/analytics-metadata/interfaces.d.ts +35 -0
  192. package/wizard/analytics-metadata/interfaces.d.ts.map +1 -0
  193. package/wizard/analytics-metadata/interfaces.js +4 -0
  194. package/wizard/analytics-metadata/interfaces.js.map +1 -0
  195. package/wizard/analytics-metadata/styles.css.js +6 -0
  196. package/wizard/analytics-metadata/styles.scoped.css +7 -0
  197. package/wizard/analytics-metadata/styles.selectors.js +7 -0
  198. package/wizard/analytics-metadata/utils.d.ts +7 -0
  199. package/wizard/analytics-metadata/utils.d.ts.map +1 -0
  200. package/wizard/analytics-metadata/utils.js +14 -0
  201. package/wizard/analytics-metadata/utils.js.map +1 -0
  202. package/wizard/index.d.ts.map +1 -1
  203. package/wizard/index.js +1 -1
  204. package/wizard/index.js.map +1 -1
  205. package/wizard/internal.d.ts +4 -2
  206. package/wizard/internal.d.ts.map +1 -1
  207. package/wizard/internal.js +14 -3
  208. package/wizard/internal.js.map +1 -1
  209. package/wizard/wizard-actions.d.ts +4 -1
  210. package/wizard/wizard-actions.d.ts.map +1 -1
  211. package/wizard/wizard-actions.js +9 -5
  212. package/wizard/wizard-actions.js.map +1 -1
  213. package/wizard/wizard-form.d.ts.map +1 -1
  214. package/wizard/wizard-form.js +1 -1
  215. package/wizard/wizard-form.js.map +1 -1
  216. package/wizard/wizard-navigation.d.ts.map +1 -1
  217. package/wizard/wizard-navigation.js +12 -6
  218. package/wizard/wizard-navigation.js.map +1 -1
@@ -1 +1 @@
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,MAAM,WAAW,CAAC;AAClD,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAE7C,OAAO,wBAAwB,MAAM,8CAA8C,CAAC;AACpF,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,MAAM,MAAM,i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AAc,CAAC,CAC9D,EACD,QAAQ,EAAE,wBAAwB,EAClC,GAAG,EAAE,yBAAyB,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC/D,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,EAC/B,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAC7B,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 */\nexport const 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 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(\n styles['drawers-trigger'],\n testutilStyles['drawers-trigger'],\n item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']\n )}\n iconName={item.trigger.iconName}\n iconSvg={item.trigger.iconSvg}\n 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 className={styles['drawers-mobile-triggers-container']} role=\"toolbar\" aria-orientation=\"horizontal\">\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(\n `awsui-app-layout-trigger-${item.id}`,\n styles['drawers-trigger'],\n testutilStyles['drawers-trigger'],\n item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']\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,MAAM,WAAW,CAAC;AAClD,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAE7C,OAAO,wBAAwB,MAAM,8CAA8C,CAAC;AACpF,OAAO,cAAc,M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AI,CAAC,EAAE,KAAK,eAAe,IAAI,cAAc,CAAC,cAAc,CAAC,CAC9D,EACD,QAAQ,EAAE,wBAAwB,EAClC,GAAG,EAAE,yBAAyB,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC/D,QAAQ,EAAE,IAAI,CAAC,OAAQ,CAAC,QAAQ,EAChC,OAAO,EAAE,IAAI,CAAC,OAAQ,CAAC,OAAO,EAC9B,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 */\nexport const 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 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(\n styles['drawers-trigger'],\n testutilStyles['drawers-trigger'],\n item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']\n )}\n iconName={item.trigger!.iconName}\n iconSvg={item.trigger!.iconSvg}\n 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 className={styles['drawers-mobile-triggers-container']} role=\"toolbar\" aria-orientation=\"horizontal\">\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(\n `awsui-app-layout-trigger-${item.id}`,\n styles['drawers-trigger'],\n testutilStyles['drawers-trigger'],\n item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']\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"]}
@@ -9,13 +9,17 @@ interface HorizontalLayoutInput {
9
9
  splitPanelPosition: 'side' | 'bottom' | undefined;
10
10
  splitPanelSize: number;
11
11
  isMobile: boolean;
12
+ activeGlobalDrawersSizes: Record<string, number>;
12
13
  }
13
- export declare function computeHorizontalLayout({ navigationOpen, navigationWidth, placement, minContentWidth, activeDrawerSize, splitPanelOpen, splitPanelPosition, splitPanelSize, isMobile, }: HorizontalLayoutInput): {
14
+ export declare function computeHorizontalLayout({ navigationOpen, navigationWidth, placement, minContentWidth, activeDrawerSize, splitPanelOpen, splitPanelPosition, splitPanelSize, isMobile, activeGlobalDrawersSizes, }: HorizontalLayoutInput): {
14
15
  splitPanelPosition: "bottom" | "side";
15
16
  splitPanelForcedPosition: boolean;
16
17
  sideSplitPanelSize: number;
17
18
  maxSplitPanelSize: number;
18
19
  maxDrawerSize: number;
20
+ maxGlobalDrawersSizes: Record<string, number>;
21
+ totalActiveGlobalDrawersSize: number;
22
+ resizableSpaceAvailable: number;
19
23
  };
20
24
  interface VerticalLayoutInput {
21
25
  topOffset: number;
@@ -1 +1 @@
1
- {"version":3,"file":"compute-layout.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/compute-layout.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAG3D,UAAU,qBAAqB;IAC7B,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,0BAA0B,CAAC,WAAW,CAAC,CAAC;IACnD,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;IAClD,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,uBAAuB,CAAC,EACtC,cAAc,EACd,eAAe,EACf,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,QAAQ,GACT,EAAE,qBAAqB;;;;;;EAsBvB;AAED,UAAU,mBAAmB;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,mBAAmB,GACpB,EAAE,mBAAmB,GAAG,oBAAoB,CAe5C"}
1
+ {"version":3,"file":"compute-layout.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/compute-layout.ts"],"names":[],"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
  import { SPLIT_PANEL_MIN_WIDTH } from '../split-panel';
4
- export function computeHorizontalLayout({ navigationOpen, navigationWidth, placement, minContentWidth, activeDrawerSize, splitPanelOpen, splitPanelPosition, splitPanelSize, isMobile, }) {
4
+ export function computeHorizontalLayout({ navigationOpen, navigationWidth, placement, minContentWidth, activeDrawerSize, splitPanelOpen, splitPanelPosition, splitPanelSize, isMobile, activeGlobalDrawersSizes, }) {
5
5
  const contentPadding = 2 * 24; // space-xl
6
6
  const activeNavigationWidth = navigationOpen ? navigationWidth : 0;
7
- const resizableSpaceAvailable = Math.max(0, placement.inlineSize - minContentWidth - contentPadding - activeNavigationWidth);
7
+ let resizableSpaceAvailable = Math.max(0, placement.inlineSize - minContentWidth - contentPadding - activeNavigationWidth);
8
+ const totalActiveGlobalDrawersSize = Object.values(activeGlobalDrawersSizes).reduce((acc, size) => acc + size, 0);
8
9
  const splitPanelForcedPosition = resizableSpaceAvailable - activeDrawerSize < SPLIT_PANEL_MIN_WIDTH || isMobile;
9
10
  const resolvedSplitPanelPosition = splitPanelForcedPosition ? 'bottom' : splitPanelPosition !== null && splitPanelPosition !== void 0 ? splitPanelPosition : 'bottom';
10
11
  const sideSplitPanelSize = resolvedSplitPanelPosition === 'side' && splitPanelOpen ? splitPanelSize !== null && splitPanelSize !== void 0 ? splitPanelSize : 0 : 0;
11
- const maxSplitPanelSize = resizableSpaceAvailable - activeDrawerSize;
12
- const maxDrawerSize = resizableSpaceAvailable - sideSplitPanelSize;
12
+ const maxSplitPanelSize = Math.max(resizableSpaceAvailable - totalActiveGlobalDrawersSize - activeDrawerSize, 0);
13
+ resizableSpaceAvailable -= sideSplitPanelSize;
14
+ const maxDrawerSize = resizableSpaceAvailable - totalActiveGlobalDrawersSize;
15
+ const maxGlobalDrawersSizes = Object.keys(activeGlobalDrawersSizes).reduce((acc, drawerId) => {
16
+ return Object.assign(Object.assign({}, acc), { [drawerId]: resizableSpaceAvailable -
17
+ activeDrawerSize -
18
+ totalActiveGlobalDrawersSize +
19
+ activeGlobalDrawersSizes[drawerId] });
20
+ }, {});
13
21
  return {
14
22
  splitPanelPosition: resolvedSplitPanelPosition,
15
23
  splitPanelForcedPosition,
16
24
  sideSplitPanelSize,
17
25
  maxSplitPanelSize,
18
26
  maxDrawerSize,
27
+ maxGlobalDrawersSizes,
28
+ totalActiveGlobalDrawersSize,
29
+ resizableSpaceAvailable,
19
30
  };
20
31
  }
21
32
  export function computeVerticalLayout({ topOffset, hasVisibleToolbar, toolbarHeight, stickyNotifications, notificationsHeight, }) {
@@ -1 +1 @@
1
- {"version":3,"file":"compute-layout.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/compute-layout.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAGtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAcvD,MAAM,UAAU,uBAAuB,CAAC,EACtC,cAAc,EACd,eAAe,EACf,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,QAAQ,GACc;IACtB,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,WAAW;IAC1C,MAAM,qBAAqB,GAAG,cAAc,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IAEnE,MAAM,uBAAuB,GAAG,IAAI,CAAC,GAAG,CACtC,CAAC,EACD,SAAS,CAAC,UAAU,GAAG,eAAe,GAAG,cAAc,GAAG,qBAAqB,CAChF,CAAC;IAEF,MAAM,wBAAwB,GAAG,uBAAuB,GAAG,gBAAgB,GAAG,qBAAqB,IAAI,QAAQ,CAAC;IAChH,MAAM,0BAA0B,GAAG,wBAAwB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,kBAAkB,aAAlB,kBAAkB,cAAlB,kBAAkB,GAAI,QAAQ,CAAC;IACxG,MAAM,kBAAkB,GAAG,0BAA0B,KAAK,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7G,MAAM,iBAAiB,GAAG,uBAAuB,GAAG,gBAAgB,CAAC;IACrE,MAAM,aAAa,GAAG,uBAAuB,GAAG,kBAAkB,CAAC;IAEnE,OAAO;QACL,kBAAkB,EAAE,0BAA0B;QAC9C,wBAAwB;QACxB,kBAAkB;QAClB,iBAAiB;QACjB,aAAa;KACd,CAAC;AACJ,CAAC;AAiBD,MAAM,UAAU,qBAAqB,CAAC,EACpC,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,mBAAmB,GACC;IACpB,MAAM,OAAO,GAAG,SAAS,CAAC;IAC1B,IAAI,aAAa,GAAG,SAAS,CAAC;IAC9B,IAAI,OAAO,GAAG,SAAS,CAAC;IAExB,IAAI,iBAAiB,EAAE;QACrB,aAAa,IAAI,aAAa,CAAC;QAC/B,OAAO,IAAI,aAAa,CAAC;KAC1B;IACD,IAAI,MAAM,GAAG,aAAa,CAAC;IAC3B,IAAI,mBAAmB,EAAE;QACvB,MAAM,IAAI,mBAAmB,CAAC;KAC/B;IAED,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AACrD,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AppLayoutPropsWithDefaults } from '../interfaces';\nimport { SPLIT_PANEL_MIN_WIDTH } from '../split-panel';\n\ninterface HorizontalLayoutInput {\n navigationOpen: boolean;\n navigationWidth: number;\n placement: AppLayoutPropsWithDefaults['placement'];\n minContentWidth: number;\n activeDrawerSize: number;\n splitPanelOpen: boolean;\n splitPanelPosition: 'side' | 'bottom' | undefined;\n splitPanelSize: number;\n isMobile: boolean;\n}\n\nexport function computeHorizontalLayout({\n navigationOpen,\n navigationWidth,\n placement,\n minContentWidth,\n activeDrawerSize,\n splitPanelOpen,\n splitPanelPosition,\n splitPanelSize,\n isMobile,\n}: HorizontalLayoutInput) {\n const contentPadding = 2 * 24; // space-xl\n const activeNavigationWidth = navigationOpen ? navigationWidth : 0;\n\n const resizableSpaceAvailable = Math.max(\n 0,\n placement.inlineSize - minContentWidth - contentPadding - activeNavigationWidth\n );\n\n const splitPanelForcedPosition = resizableSpaceAvailable - activeDrawerSize < SPLIT_PANEL_MIN_WIDTH || isMobile;\n const resolvedSplitPanelPosition = splitPanelForcedPosition ? 'bottom' : splitPanelPosition ?? 'bottom';\n const sideSplitPanelSize = resolvedSplitPanelPosition === 'side' && splitPanelOpen ? splitPanelSize ?? 0 : 0;\n const maxSplitPanelSize = resizableSpaceAvailable - activeDrawerSize;\n const maxDrawerSize = resizableSpaceAvailable - sideSplitPanelSize;\n\n return {\n splitPanelPosition: resolvedSplitPanelPosition,\n splitPanelForcedPosition,\n sideSplitPanelSize,\n maxSplitPanelSize,\n maxDrawerSize,\n };\n}\n\ninterface VerticalLayoutInput {\n topOffset: number;\n hasVisibleToolbar: boolean;\n toolbarHeight: number;\n stickyNotifications: boolean;\n notificationsHeight: number;\n}\n\nexport interface VerticalLayoutOutput {\n toolbar: number;\n notifications: number;\n header: number;\n drawers: number;\n}\n\nexport function computeVerticalLayout({\n topOffset,\n hasVisibleToolbar,\n toolbarHeight,\n stickyNotifications,\n notificationsHeight,\n}: VerticalLayoutInput): VerticalLayoutOutput {\n const toolbar = topOffset;\n let notifications = topOffset;\n let drawers = topOffset;\n\n if (hasVisibleToolbar) {\n notifications += toolbarHeight;\n drawers += toolbarHeight;\n }\n let header = notifications;\n if (stickyNotifications) {\n header += notificationsHeight;\n }\n\n return { toolbar, notifications, header, drawers };\n}\n"]}
1
+ {"version":3,"file":"compute-layout.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/compute-layout.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAGtC,OAAO,EAAE,qBAAqB,EAAE,MAA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IAAI,CAAC,wBAAwB,CAAC,CAAC,MAAM,CAChG,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE;QAChB,uCACK,GAAG,KACN,CAAC,QAAQ,CAAC,EACR,uBAAuB;gBACvB,gBAAgB;gBAChB,4BAA4B;gBAC5B,wBAAwB,CAAC,QAAQ,CAAC,IACpC;IACJ,CAAC,EACD,EAAE,CACH,CAAC;IAEF,OAAO;QACL,kBAAkB,EAAE,0BAA0B;QAC9C,wBAAwB;QACxB,kBAAkB;QAClB,iBAAiB;QACjB,aAAa;QACb,qBAAqB;QACrB,4BAA4B;QAC5B,uBAAuB;KACxB,CAAC;AACJ,CAAC;AAiBD,MAAM,UAAU,qBAAqB,CAAC,EACpC,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,mBAAmB,GACC;IACpB,MAAM,OAAO,GAAG,SAAS,CAAC;IAC1B,IAAI,aAAa,GAAG,SAAS,CAAC;IAC9B,IAAI,OAAO,GAAG,SAAS,CAAC;IAExB,IAAI,iBAAiB,EAAE;QACrB,aAAa,IAAI,aAAa,CAAC;QAC/B,OAAO,IAAI,aAAa,CAAC;KAC1B;IACD,IAAI,MAAM,GAAG,aAAa,CAAC;IAC3B,IAAI,mBAAmB,EAAE;QACvB,MAAM,IAAI,mBAAmB,CAAC;KAC/B;IAED,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AACrD,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AppLayoutPropsWithDefaults } from '../interfaces';\nimport { SPLIT_PANEL_MIN_WIDTH } from '../split-panel';\n\ninterface HorizontalLayoutInput {\n navigationOpen: boolean;\n navigationWidth: number;\n placement: AppLayoutPropsWithDefaults['placement'];\n minContentWidth: number;\n activeDrawerSize: number;\n splitPanelOpen: boolean;\n splitPanelPosition: 'side' | 'bottom' | undefined;\n splitPanelSize: number;\n isMobile: boolean;\n activeGlobalDrawersSizes: Record<string, number>;\n}\n\nexport function computeHorizontalLayout({\n navigationOpen,\n navigationWidth,\n placement,\n minContentWidth,\n activeDrawerSize,\n splitPanelOpen,\n splitPanelPosition,\n splitPanelSize,\n isMobile,\n activeGlobalDrawersSizes,\n}: HorizontalLayoutInput) {\n const contentPadding = 2 * 24; // space-xl\n const activeNavigationWidth = navigationOpen ? navigationWidth : 0;\n\n let resizableSpaceAvailable = Math.max(\n 0,\n placement.inlineSize - minContentWidth - contentPadding - activeNavigationWidth\n );\n const totalActiveGlobalDrawersSize = Object.values(activeGlobalDrawersSizes).reduce((acc, size) => acc + size, 0);\n\n const splitPanelForcedPosition = resizableSpaceAvailable - activeDrawerSize < SPLIT_PANEL_MIN_WIDTH || isMobile;\n const resolvedSplitPanelPosition = splitPanelForcedPosition ? 'bottom' : splitPanelPosition ?? 'bottom';\n const sideSplitPanelSize = resolvedSplitPanelPosition === 'side' && splitPanelOpen ? splitPanelSize ?? 0 : 0;\n const maxSplitPanelSize = Math.max(resizableSpaceAvailable - totalActiveGlobalDrawersSize - activeDrawerSize, 0);\n resizableSpaceAvailable -= sideSplitPanelSize;\n const maxDrawerSize = resizableSpaceAvailable - totalActiveGlobalDrawersSize;\n const maxGlobalDrawersSizes: Record<string, number> = Object.keys(activeGlobalDrawersSizes).reduce(\n (acc, drawerId) => {\n return {\n ...acc,\n [drawerId]:\n resizableSpaceAvailable -\n activeDrawerSize -\n totalActiveGlobalDrawersSize +\n activeGlobalDrawersSizes[drawerId],\n };\n },\n {}\n );\n\n return {\n splitPanelPosition: resolvedSplitPanelPosition,\n splitPanelForcedPosition,\n sideSplitPanelSize,\n maxSplitPanelSize,\n maxDrawerSize,\n maxGlobalDrawersSizes,\n totalActiveGlobalDrawersSize,\n resizableSpaceAvailable,\n };\n}\n\ninterface VerticalLayoutInput {\n topOffset: number;\n hasVisibleToolbar: boolean;\n toolbarHeight: number;\n stickyNotifications: boolean;\n notificationsHeight: number;\n}\n\nexport interface VerticalLayoutOutput {\n toolbar: number;\n notifications: number;\n header: number;\n drawers: number;\n}\n\nexport function computeVerticalLayout({\n topOffset,\n hasVisibleToolbar,\n toolbarHeight,\n stickyNotifications,\n notificationsHeight,\n}: VerticalLayoutInput): VerticalLayoutOutput {\n const toolbar = topOffset;\n let notifications = topOffset;\n let drawers = topOffset;\n\n if (hasVisibleToolbar) {\n notifications += toolbarHeight;\n drawers += toolbarHeight;\n }\n let header = notifications;\n if (stickyNotifications) {\n header += notificationsHeight;\n }\n\n return { toolbar, notifications, header, drawers };\n}\n"]}
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import { NonCancelableEventHandler } from '../../../internal/events';
3
+ import { AppLayoutProps } from '../../interfaces';
4
+ import { AppLayoutInternals } from '../interfaces';
5
+ interface AppLayoutGlobalDrawerImplementationProps {
6
+ appLayoutInternals: AppLayoutInternals;
7
+ show: boolean;
8
+ activeGlobalDrawer: (AppLayoutProps.Drawer & {
9
+ onShow?: NonCancelableEventHandler;
10
+ onHide?: NonCancelableEventHandler;
11
+ }) | undefined;
12
+ }
13
+ declare function AppLayoutGlobalDrawerImplementation({ appLayoutInternals, show, activeGlobalDrawer, }: AppLayoutGlobalDrawerImplementationProps): JSX.Element;
14
+ export default AppLayoutGlobalDrawerImplementation;
15
+ //# sourceMappingURL=global-drawer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global-drawer.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-drawer.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAGrE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAOnD,UAAU,wCAAwC;IAChD,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,kBAAkB,EACd,CAAC,cAAc,CAAC,MAAM,GAAG;QAAE,MAAM,CAAC,EAAE,yBAAyB,CAAC;QAAC,MAAM,CAAC,EAAE,yBAAyB,CAAA;KAAE,CAAC,GACpG,SAAS,CAAC;CACf;AAED,iBAAS,mCAAmC,CAAC,EAC3C,kBAAkB,EAClB,IAAI,EACJ,kBAAkB,GACnB,EAAE,wCAAwC,eA8G1C;AAED,eAAe,mCAAmC,CAAC"}
@@ -0,0 +1,71 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import React, { useRef } from 'react';
4
+ import { Transition } from 'react-transition-group';
5
+ import clsx from 'clsx';
6
+ import { InternalButton } from '../../../button/internal';
7
+ import PanelResizeHandle from '../../../internal/components/panel-resize-handle';
8
+ import customCssProps from '../../../internal/generated/custom-css-properties';
9
+ import { getLimitedValue } from '../../../split-panel/utils/size-utils';
10
+ import { useResize } from './use-resize';
11
+ import sharedStyles from '../../resize/styles.css.js';
12
+ import testutilStyles from '../../test-classes/styles.css.js';
13
+ import styles from './styles.css.js';
14
+ function AppLayoutGlobalDrawerImplementation({ appLayoutInternals, show, activeGlobalDrawer, }) {
15
+ var _a, _b, _c, _d, _e, _f, _g;
16
+ const { ariaLabels, globalDrawersFocusControl, isMobile, placement, onActiveGlobalDrawersChange, onActiveDrawerResize, minGlobalDrawersSizes, maxGlobalDrawersSizes, activeGlobalDrawersSizes, verticalOffsets, drawersOpenQueue, } = appLayoutInternals;
17
+ const drawerRef = useRef(null);
18
+ const activeDrawerId = (_a = activeGlobalDrawer === null || activeGlobalDrawer === void 0 ? void 0 : activeGlobalDrawer.id) !== null && _a !== void 0 ? _a : '';
19
+ const computedAriaLabels = {
20
+ closeButton: activeGlobalDrawer ? (_b = activeGlobalDrawer.ariaLabels) === null || _b === void 0 ? void 0 : _b.closeButton : ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.toolsClose,
21
+ content: activeGlobalDrawer ? (_c = activeGlobalDrawer.ariaLabels) === null || _c === void 0 ? void 0 : _c.drawerName : ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.tools,
22
+ };
23
+ const drawersTopOffset = (_d = verticalOffsets.drawers) !== null && _d !== void 0 ? _d : placement.insetBlockStart;
24
+ const activeDrawerSize = (_e = (activeDrawerId ? activeGlobalDrawersSizes[activeDrawerId] : 0)) !== null && _e !== void 0 ? _e : 0;
25
+ const minDrawerSize = (_f = (activeDrawerId ? minGlobalDrawersSizes[activeDrawerId] : 0)) !== null && _f !== void 0 ? _f : 0;
26
+ const maxDrawerSize = (_g = (activeDrawerId ? maxGlobalDrawersSizes[activeDrawerId] : 0)) !== null && _g !== void 0 ? _g : 0;
27
+ const refs = globalDrawersFocusControl.refs[activeDrawerId];
28
+ const resizeProps = useResize({
29
+ currentWidth: activeDrawerSize,
30
+ minWidth: minDrawerSize,
31
+ maxWidth: maxDrawerSize,
32
+ panelRef: drawerRef,
33
+ handleRef: refs === null || refs === void 0 ? void 0 : refs.slider,
34
+ onResize: size => onActiveDrawerResize({ id: activeDrawerId, size }),
35
+ });
36
+ const size = getLimitedValue(minDrawerSize, activeDrawerSize, maxDrawerSize);
37
+ const lastOpenedDrawerId = drawersOpenQueue.length ? drawersOpenQueue[0] : null;
38
+ const hasTriggerButton = !!(activeGlobalDrawer === null || activeGlobalDrawer === void 0 ? void 0 : activeGlobalDrawer.trigger);
39
+ return (React.createElement(Transition, { nodeRef: drawerRef, in: show, appear: show, timeout: 0 }, state => {
40
+ var _a;
41
+ return (React.createElement("aside", { id: activeDrawerId, "aria-hidden": !show, "aria-label": computedAriaLabels.content, className: clsx(styles.drawer, styles['drawer-global'], styles[state], sharedStyles['with-motion'], {
42
+ [styles['drawer-hidden']]: !show,
43
+ [styles['last-opened']]: lastOpenedDrawerId === activeDrawerId,
44
+ [testutilStyles['active-drawer']]: show,
45
+ }), ref: drawerRef, onBlur: e => {
46
+ // Drawers with trigger buttons follow this restore focus logic:
47
+ // If a previously focused element exists, restore focus on it; otherwise, focus on the associated trigger button.
48
+ // This function resets the previously focused element.
49
+ // If the drawer has no trigger button and loses focus on the previously focused element, it defaults to document.body,
50
+ // which ideally should never happen.
51
+ if (!hasTriggerButton) {
52
+ return;
53
+ }
54
+ if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {
55
+ globalDrawersFocusControl.loseFocus();
56
+ }
57
+ }, style: Object.assign({ blockSize: `calc(100vh - ${drawersTopOffset}px - ${placement.insetBlockEnd}px)`, insetBlockStart: drawersTopOffset }, (!isMobile && {
58
+ [customCssProps.drawerSize]: `${['entering', 'entered'].includes(state) ? size : 0}px`,
59
+ })), "data-testid": `awsui-app-layout-drawer-${activeDrawerId}` },
60
+ !isMobile && (activeGlobalDrawer === null || activeGlobalDrawer === void 0 ? void 0 : activeGlobalDrawer.resizable) && (React.createElement("div", { className: styles['drawer-slider'] },
61
+ React.createElement(PanelResizeHandle, { ref: refs === null || refs === void 0 ? void 0 : refs.slider, position: "side", className: testutilStyles['drawers-slider'], ariaLabel: (_a = activeGlobalDrawer === null || activeGlobalDrawer === void 0 ? void 0 : activeGlobalDrawer.ariaLabels) === null || _a === void 0 ? void 0 : _a.resizeHandle, ariaValuenow: resizeProps.relativeSize, onKeyDown: resizeProps.onKeyDown, onPointerDown: resizeProps.onPointerDown }))),
62
+ React.createElement("div", { className: clsx(styles['drawer-content-container'], sharedStyles['with-motion']) },
63
+ React.createElement("div", { className: clsx(styles['drawer-close-button']) },
64
+ React.createElement(InternalButton, { ariaLabel: computedAriaLabels.closeButton, className: clsx({
65
+ [testutilStyles['active-drawer-close-button']]: activeDrawerId,
66
+ }), formAction: "none", iconName: isMobile ? 'close' : 'angle-right', onClick: () => onActiveGlobalDrawersChange(activeDrawerId), ref: refs === null || refs === void 0 ? void 0 : refs.close, variant: "icon" })),
67
+ React.createElement("div", { className: styles['drawer-content'] }, activeGlobalDrawer === null || activeGlobalDrawer === void 0 ? void 0 : activeGlobalDrawer.content))));
68
+ }));
69
+ }
70
+ export default AppLayoutGlobalDrawerImplementation;
71
+ //# sourceMappingURL=global-drawer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global-drawer.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-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;AAEjF,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAGxE,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;AAUrC,SAAS,mCAAmC,CAAC,EAC3C,kBAAkB,EAClB,IAAI,EACJ,kBAAkB,GACuB;;IACzC,MAAM,EACJ,UAAU,EACV,yBAAyB,EACzB,QAAQ,EACR,SAAS,EACT,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,eAAe,EACf,gBAAgB,GACjB,GAAG,kBAAkB,CAAC;IACvB,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC/C,MAAM,cAAc,GAAG,MAAA,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,EAAE,mCAAI,EAAE,CAAC;IAEpD,MAAM,kBAAkB,GAAG;QACzB,WAAW,EAAE,kBAAkB,CAAC,CAAC,CAAC,MAAA,kBAAkB,CAAC,UAAU,0C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AA2B,CAAC,cAAc,CAAC,EAC1D,GAAG,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,EAChB,OAAO,EAAC,MAAM,GACd,CACE;gBACN,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,IAAG,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,OAAO,CAAO,CACzE,CACA,CACT,CAAC;IACJ,CAAC,CACU,CACd,CAAC;AACJ,CAAC;AAED,eAAe,mCAAmC,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 { NonCancelableEventHandler } from '../../../internal/events';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { AppLayoutProps } from '../../interfaces';\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 AppLayoutGlobalDrawerImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n show: boolean;\n activeGlobalDrawer:\n | (AppLayoutProps.Drawer & { onShow?: NonCancelableEventHandler; onHide?: NonCancelableEventHandler })\n | undefined;\n}\n\nfunction AppLayoutGlobalDrawerImplementation({\n appLayoutInternals,\n show,\n activeGlobalDrawer,\n}: AppLayoutGlobalDrawerImplementationProps) {\n const {\n ariaLabels,\n globalDrawersFocusControl,\n isMobile,\n placement,\n onActiveGlobalDrawersChange,\n onActiveDrawerResize,\n minGlobalDrawersSizes,\n maxGlobalDrawersSizes,\n activeGlobalDrawersSizes,\n verticalOffsets,\n drawersOpenQueue,\n } = appLayoutInternals;\n const drawerRef = useRef<HTMLDivElement>(null);\n const activeDrawerId = activeGlobalDrawer?.id ?? '';\n\n const computedAriaLabels = {\n closeButton: activeGlobalDrawer ? activeGlobalDrawer.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeGlobalDrawer ? activeGlobalDrawer.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const drawersTopOffset = verticalOffsets.drawers ?? placement.insetBlockStart;\n const activeDrawerSize = (activeDrawerId ? activeGlobalDrawersSizes[activeDrawerId] : 0) ?? 0;\n const minDrawerSize = (activeDrawerId ? minGlobalDrawersSizes[activeDrawerId] : 0) ?? 0;\n const maxDrawerSize = (activeDrawerId ? maxGlobalDrawersSizes[activeDrawerId] : 0) ?? 0;\n const refs = globalDrawersFocusControl.refs[activeDrawerId];\n const resizeProps = useResize({\n currentWidth: activeDrawerSize,\n minWidth: minDrawerSize,\n maxWidth: maxDrawerSize,\n panelRef: drawerRef,\n handleRef: refs?.slider,\n onResize: size => onActiveDrawerResize({ id: activeDrawerId!, size }),\n });\n const size = getLimitedValue(minDrawerSize, activeDrawerSize, maxDrawerSize);\n const lastOpenedDrawerId = drawersOpenQueue.length ? drawersOpenQueue[0] : null;\n const hasTriggerButton = !!activeGlobalDrawer?.trigger;\n\n return (\n <Transition nodeRef={drawerRef} in={show} appear={show} timeout={0}>\n {state => {\n return (\n <aside\n id={activeDrawerId}\n aria-hidden={!show}\n aria-label={computedAriaLabels.content}\n className={clsx(styles.drawer, styles['drawer-global'], styles[state], sharedStyles['with-motion'], {\n [styles['drawer-hidden']]: !show,\n [styles['last-opened']]: lastOpenedDrawerId === activeDrawerId,\n [testutilStyles['active-drawer']]: show,\n })}\n ref={drawerRef}\n onBlur={e => {\n // Drawers with trigger buttons follow this restore focus logic:\n // If a previously focused element exists, restore focus on it; otherwise, focus on the associated trigger button.\n // This function resets the previously focused element.\n // If the drawer has no trigger button and loses focus on the previously focused element, it defaults to document.body,\n // which ideally should never happen.\n if (!hasTriggerButton) {\n return;\n }\n\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n globalDrawersFocusControl.loseFocus();\n }\n }}\n style={{\n blockSize: `calc(100vh - ${drawersTopOffset}px - ${placement.insetBlockEnd}px)`,\n insetBlockStart: drawersTopOffset,\n ...(!isMobile && {\n [customCssProps.drawerSize]: `${['entering', 'entered'].includes(state) ? size : 0}px`,\n }),\n }}\n data-testid={`awsui-app-layout-drawer-${activeDrawerId}`}\n >\n {!isMobile && activeGlobalDrawer?.resizable && (\n <div className={styles['drawer-slider']}>\n <PanelResizeHandle\n ref={refs?.slider}\n position=\"side\"\n className={testutilStyles['drawers-slider']}\n ariaLabel={activeGlobalDrawer?.ariaLabels?.resizeHandle}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onPointerDown={resizeProps.onPointerDown}\n />\n </div>\n )}\n <div className={clsx(styles['drawer-content-container'], sharedStyles['with-motion'])}>\n <div className={clsx(styles['drawer-close-button'])}>\n <InternalButton\n ariaLabel={computedAriaLabels.closeButton}\n className={clsx({\n [testutilStyles['active-drawer-close-button']]: activeDrawerId,\n })}\n formAction=\"none\"\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => onActiveGlobalDrawersChange(activeDrawerId)}\n ref={refs?.close}\n variant=\"icon\"\n />\n </div>\n <div className={styles['drawer-content']}>{activeGlobalDrawer?.content}</div>\n </div>\n </aside>\n );\n }}\n </Transition>\n );\n}\n\nexport default AppLayoutGlobalDrawerImplementation;\n"]}
@@ -1,4 +1,9 @@
1
1
  /// <reference types="react" />
2
- export declare function AppLayoutGlobalDrawersImplementation(): JSX.Element;
2
+ import { AppLayoutInternals } from '../interfaces';
3
+ interface AppLayoutGlobalDrawersImplementationProps {
4
+ appLayoutInternals: AppLayoutInternals;
5
+ }
6
+ export declare function AppLayoutGlobalDrawersImplementation({ appLayoutInternals, }: AppLayoutGlobalDrawersImplementationProps): JSX.Element;
3
7
  export declare const createWidgetizedAppLayoutGlobalDrawers: (Loader?: typeof AppLayoutGlobalDrawersImplementation | undefined) => typeof AppLayoutGlobalDrawersImplementation;
8
+ export {};
4
9
  //# sourceMappingURL=global-drawers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"global-drawers.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-drawers.tsx"],"names":[],"mappings":";AAOA,wBAAgB,oCAAoC,gBAEnD;AAED,eAAO,MAAM,sCAAsC,mHAAkE,CAAC"}
1
+ {"version":3,"file":"global-drawers.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-drawers.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGnD,UAAU,yCAAyC;IACjD,kBAAkB,EAAE,kBAAkB,CAAC;CACxC;AAED,wBAAgB,oCAAoC,CAAC,EACnD,kBAAkB,GACnB,EAAE,yCAAyC,eA6B3C;AAED,eAAO,MAAM,sCAAsC,mHAAkE,CAAC"}
@@ -1,10 +1,21 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import React from 'react';
3
+ import React, { useRef } from 'react';
4
4
  import { createWidgetizedComponent } from '../../../internal/widgets';
5
- /* istanbul ignore next: noop stub */
6
- export function AppLayoutGlobalDrawersImplementation() {
7
- return React.createElement(React.Fragment, null);
5
+ import AppLayoutGlobalDrawer from './global-drawer';
6
+ export function AppLayoutGlobalDrawersImplementation({ appLayoutInternals, }) {
7
+ const { globalDrawers, activeGlobalDrawersIds } = appLayoutInternals;
8
+ const openDrawersHistory = useRef(new Set());
9
+ if (!globalDrawers.length) {
10
+ return React.createElement(React.Fragment, null);
11
+ }
12
+ return (React.createElement(React.Fragment, null, globalDrawers
13
+ .filter(drawer => activeGlobalDrawersIds.includes(drawer.id) ||
14
+ (drawer.preserveInactiveContent && openDrawersHistory.current.has(drawer.id)))
15
+ .map(drawer => {
16
+ openDrawersHistory.current.add(drawer.id);
17
+ return (React.createElement(AppLayoutGlobalDrawer, { key: drawer.id, show: activeGlobalDrawersIds.includes(drawer.id), activeGlobalDrawer: drawer, appLayoutInternals: appLayoutInternals }));
18
+ })));
8
19
  }
9
20
  export const createWidgetizedAppLayoutGlobalDrawers = createWidgetizedComponent(AppLayoutGlobalDrawersImplementation);
10
21
  //# sourceMappingURL=global-drawers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"global-drawers.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-drawers.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,qCAAqC;AACrC,MAAM,UAAU,oCAAoC;IAClD,OAAO,yCAAK,CAAC;AACf,CAAC;AAED,MAAM,CAAC,MAAM,sCAAsC,GAAG,yBAAyB,CAAC,oCAAoC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { createWidgetizedComponent } from '../../../internal/widgets';\n\n/* istanbul ignore next: noop stub */\nexport function AppLayoutGlobalDrawersImplementation() {\n return <></>;\n}\n\nexport const createWidgetizedAppLayoutGlobalDrawers = createWidgetizedComponent(AppLayoutGlobalDrawersImplementation);\n"]}
1
+ {"version":3,"file":"global-drawers.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-drawers.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,qBAAqB,MAAM,iBAAiB,CAAC;AAMpD,MAAM,UAAU,oCAAoC,CAAC,EACnD,kBAAkB,GACwB;IAC1C,MAAM,EAAE,aAAa,EAAE,sBAAsB,EAAE,GAAG,kBAAkB,CAAC;IACrE,MAAM,kBAAkB,GAAG,MAAM,CAAc,IAAI,GAAG,EAAE,CAAC,CAAC;IAE1D,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE;QACzB,OAAO,yCAAK,CAAC;KACd;IAED,OAAO,CACL,0CACG,aAAa;SACX,MAAM,CACL,MAAM,CAAC,EAAE,CACP,sBAAsB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1C,CAAC,MAAM,CAAC,uBAAuB,IAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAChF;SACA,GAAG,CAAC,MAAM,CAAC,EAAE;QACZ,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC1C,OAAO,CACL,oBAAC,qBAAqB,IACpB,GAAG,EAAE,MAAM,CAAC,EAAE,EACd,IAAI,EAAE,sBAAsB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,EAChD,kBAAkB,EAAE,MAAM,EAC1B,kBAAkB,EAAE,kBAAkB,GACtC,CACH,CAAC;IACJ,CAAC,CAAC,CACH,CACJ,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,sCAAsC,GAAG,yBAAyB,CAAC,oCAAoC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\n\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { AppLayoutInternals } from '../interfaces';\nimport AppLayoutGlobalDrawer from './global-drawer';\n\ninterface AppLayoutGlobalDrawersImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n}\n\nexport function AppLayoutGlobalDrawersImplementation({\n appLayoutInternals,\n}: AppLayoutGlobalDrawersImplementationProps) {\n const { globalDrawers, activeGlobalDrawersIds } = appLayoutInternals;\n const openDrawersHistory = useRef<Set<string>>(new Set());\n\n if (!globalDrawers.length) {\n return <></>;\n }\n\n return (\n <>\n {globalDrawers\n .filter(\n drawer =>\n activeGlobalDrawersIds.includes(drawer.id) ||\n (drawer.preserveInactiveContent && openDrawersHistory.current.has(drawer.id))\n )\n .map(drawer => {\n openDrawersHistory.current.add(drawer.id);\n return (\n <AppLayoutGlobalDrawer\n key={drawer.id}\n show={activeGlobalDrawersIds.includes(drawer.id)}\n activeGlobalDrawer={drawer}\n appLayoutInternals={appLayoutInternals}\n />\n );\n })}\n </>\n );\n}\n\nexport const createWidgetizedAppLayoutGlobalDrawers = createWidgetizedComponent(AppLayoutGlobalDrawersImplementation);\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":";AASA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAOnD,UAAU,kCAAkC;IAC1C,kBAAkB,EAAE,kBAAkB,CAAC;CACxC;AAED,wBAAgB,6BAA6B,CAAC,EAAE,kBAAkB,EAAE,EAAE,kCAAkC,eAmGvG;AAED,eAAO,MAAM,+BAA+B,qGAA2D,CAAC"}
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;CACxC;AAED,wBAAgB,6BAA6B,CAAC,EAAE,kBAAkB,EAAE,EAAE,kCAAkC,eAkHvG;AAED,eAAO,MAAM,+BAA+B,qGAA2D,CAAC"}
@@ -1,18 +1,21 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import React, { useRef } from 'react';
4
+ import { Transition } from 'react-transition-group';
4
5
  import clsx from 'clsx';
5
6
  import { InternalButton } from '../../../button/internal';
6
7
  import PanelResizeHandle from '../../../internal/components/panel-resize-handle';
8
+ import customCssProps from '../../../internal/generated/custom-css-properties';
7
9
  import { createWidgetizedComponent } from '../../../internal/widgets';
10
+ import { getLimitedValue } from '../../../split-panel/utils/size-utils';
8
11
  import { TOOLS_DRAWER_ID } from '../../utils/use-drawers';
9
12
  import { useResize } from './use-resize';
10
13
  import sharedStyles from '../../resize/styles.css.js';
11
14
  import testutilStyles from '../../test-classes/styles.css.js';
12
15
  import styles from './styles.css.js';
13
16
  export function AppLayoutDrawerImplementation({ appLayoutInternals }) {
14
- var _a, _b, _c, _d, _e;
15
- const { activeDrawer, minDrawerSize, activeDrawerSize, maxDrawerSize, ariaLabels, drawers, drawersFocusControl, isMobile, placement, verticalOffsets, onActiveDrawerChange, onActiveDrawerResize, } = appLayoutInternals;
17
+ var _a, _b, _c, _d;
18
+ const { activeDrawer, minDrawerSize, activeDrawerSize, maxDrawerSize, ariaLabels, drawers, drawersFocusControl, isMobile, placement, verticalOffsets, drawersOpenQueue, onActiveDrawerChange, onActiveDrawerResize, } = appLayoutInternals;
16
19
  const drawerRef = useRef(null);
17
20
  const activeDrawerId = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id;
18
21
  const computedAriaLabels = {
@@ -31,27 +34,36 @@ export function AppLayoutDrawerImplementation({ appLayoutInternals }) {
31
34
  handleRef: drawersFocusControl.refs.slider,
32
35
  onResize: size => onActiveDrawerResize({ id: activeDrawerId, size }),
33
36
  });
34
- return (React.createElement("aside", { id: activeDrawerId, "aria-hidden": !activeDrawer, "aria-label": computedAriaLabels.content, className: clsx(styles.drawer, sharedStyles['with-motion'], {
35
- [testutilStyles['active-drawer']]: !toolsOnlyMode && activeDrawerId,
36
- [testutilStyles.tools]: isToolsDrawer,
37
- }), ref: drawerRef, onBlur: e => {
38
- if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {
39
- drawersFocusControl.loseFocus();
40
- }
41
- }, style: {
42
- blockSize: `calc(100vh - ${drawersTopOffset}px - ${placement.insetBlockEnd}px)`,
43
- insetBlockStart: drawersTopOffset,
44
- } },
45
- !isMobile && (activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.resizable) && (React.createElement("div", { className: styles['drawer-slider'] },
46
- React.createElement(PanelResizeHandle, { ref: drawersFocusControl.refs.slider, position: "side", className: testutilStyles['drawers-slider'], ariaLabel: (_e = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _e === void 0 ? void 0 : _e.resizeHandle, ariaValuenow: resizeProps.relativeSize, onKeyDown: resizeProps.onKeyDown, onPointerDown: resizeProps.onPointerDown }))),
47
- React.createElement("div", { className: clsx(styles['drawer-content-container'], sharedStyles['with-motion']), style: { width: isMobile ? '100%' : `${activeDrawerSize}px` } },
48
- React.createElement("div", { className: clsx(styles['drawer-close-button']) },
49
- React.createElement(InternalButton, { ariaLabel: computedAriaLabels.closeButton, className: clsx({
50
- [testutilStyles['active-drawer-close-button']]: !isToolsDrawer && activeDrawerId,
51
- [testutilStyles['tools-close']]: isToolsDrawer,
52
- }), formAction: "none", iconName: isMobile ? 'close' : 'angle-right', onClick: () => onActiveDrawerChange(null), ref: drawersFocusControl.refs.close, variant: "icon" })),
53
- React.createElement("div", { className: clsx(styles['drawer-content'], activeDrawerId !== TOOLS_DRAWER_ID && styles['drawer-content-hidden']) }, toolsContent),
54
- activeDrawerId !== TOOLS_DRAWER_ID && React.createElement("div", { className: styles['drawer-content'] }, activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.content))));
37
+ // temporary handle a situation when app-layout is old, but this component come as a widget
38
+ const isLegacyDrawer = drawersOpenQueue === undefined;
39
+ const size = getLimitedValue(minDrawerSize, activeDrawerSize, maxDrawerSize);
40
+ const lastOpenedDrawerId = (drawersOpenQueue === null || drawersOpenQueue === void 0 ? void 0 : drawersOpenQueue.length) ? drawersOpenQueue[0] : activeDrawerId;
41
+ return (React.createElement(Transition, { nodeRef: drawerRef, in: true, appear: true, timeout: 0 }, state => {
42
+ var _a;
43
+ return (React.createElement("aside", { id: activeDrawerId, "aria-hidden": !activeDrawer, "aria-label": computedAriaLabels.content, className: clsx(styles.drawer, sharedStyles['with-motion'], {
44
+ [styles['last-opened']]: lastOpenedDrawerId === activeDrawerId,
45
+ [styles.legacy]: isLegacyDrawer,
46
+ [testutilStyles['active-drawer']]: !toolsOnlyMode && activeDrawerId,
47
+ [testutilStyles.tools]: isToolsDrawer,
48
+ }), ref: drawerRef, onBlur: e => {
49
+ if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {
50
+ drawersFocusControl.loseFocus();
51
+ }
52
+ }, style: Object.assign({ blockSize: `calc(100vh - ${drawersTopOffset}px - ${placement.insetBlockEnd}px)`, insetBlockStart: drawersTopOffset }, (!isMobile &&
53
+ !isLegacyDrawer && {
54
+ [customCssProps.drawerSize]: `${['entering', 'entered'].includes(state) ? size : 0}px`,
55
+ })), "data-testid": `awsui-app-layout-drawer-${activeDrawerId}` },
56
+ !isMobile && (activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.resizable) && (React.createElement("div", { className: styles['drawer-slider'] },
57
+ React.createElement(PanelResizeHandle, { ref: drawersFocusControl.refs.slider, position: "side", className: testutilStyles['drawers-slider'], ariaLabel: (_a = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _a === void 0 ? void 0 : _a.resizeHandle, ariaValuenow: resizeProps.relativeSize, onKeyDown: resizeProps.onKeyDown, onPointerDown: resizeProps.onPointerDown }))),
58
+ React.createElement("div", { className: clsx(styles['drawer-content-container'], sharedStyles['with-motion']) },
59
+ React.createElement("div", { className: clsx(styles['drawer-close-button']) },
60
+ React.createElement(InternalButton, { ariaLabel: computedAriaLabels.closeButton, className: clsx({
61
+ [testutilStyles['active-drawer-close-button']]: !isToolsDrawer && activeDrawerId,
62
+ [testutilStyles['tools-close']]: isToolsDrawer,
63
+ }), formAction: "none", iconName: isMobile ? 'close' : 'angle-right', onClick: () => onActiveDrawerChange(null), ref: drawersFocusControl.refs.close, variant: "icon" })),
64
+ React.createElement("div", { className: clsx(styles['drawer-content'], activeDrawerId !== TOOLS_DRAWER_ID && styles['drawer-content-hidden']) }, toolsContent),
65
+ activeDrawerId !== TOOLS_DRAWER_ID && (React.createElement("div", { className: styles['drawer-content'] }, activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.content)))));
66
+ }));
55
67
  }
56
68
  export const createWidgetizedAppLayoutDrawer = createWidgetizedComponent(AppLayoutDrawerImplementation);
57
69
  //# 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,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,iBAAiB,MAAM,kDAAkD,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,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;AAMrC,MAAM,UAAU,6BAA6B,CAAC,EAAE,kBAAkB,EAAsC;;IACtG,MAAM,EACJ,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,OAAO,EACP,mBAAmB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AI,CAAC,MAAM,CAAC,0BAA0B,CAAC,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC,EAChF,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,gBAAgB,IAAI,EAAE;YAE7D,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;gBACjD,oBAAC,cAAc,IACb,SAAS,EAAE,kBAAkB,CAAC,WAAW,EACzC,SAAS,EAAE,IAAI,CAAC;wBACd,CAAC,cAAc,CAAC,4BAA4B,CAAC,CAAC,EAAE,CAAC,aAAa,IAAI,cAAc;wBAChF,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,EAAE,aAAa;qBAC/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,CAAC,EACzC,GAAG,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,EACnC,OAAO,EAAC,MAAM,GACd,CACE;YACN,6BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,gBAAgB,CAAC,EACxB,cAAc,KAAK,eAAe,IAAI,MAAM,CAAC,uBAAuB,CAAC,CACtE,IAEA,YAAY,CACT;YACL,cAAc,KAAK,eAAe,IAAI,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,IAAG,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,CAAO,CAC1G,CACA,CACT,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,+BAA+B,GAAG,yBAAyB,CAAC,6BAA6B,CAAC,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 { InternalButton } from '../../../button/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { TOOLS_DRAWER_ID } from '../../utils/use-drawers';\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}\n\nexport function AppLayoutDrawerImplementation({ appLayoutInternals }: AppLayoutDrawerImplementationProps) {\n const {\n activeDrawer,\n minDrawerSize,\n activeDrawerSize,\n maxDrawerSize,\n ariaLabels,\n drawers,\n drawersFocusControl,\n isMobile,\n placement,\n verticalOffsets,\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 drawersTopOffset = verticalOffsets.drawers ?? placement.insetBlockStart;\n const isToolsDrawer = activeDrawer?.id === TOOLS_DRAWER_ID;\n const toolsOnlyMode = drawers.length === 1 && drawers[0].id === TOOLS_DRAWER_ID;\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\n return (\n <aside\n id={activeDrawerId}\n aria-hidden={!activeDrawer}\n aria-label={computedAriaLabels.content}\n className={clsx(styles.drawer, sharedStyles['with-motion'], {\n [testutilStyles['active-drawer']]: !toolsOnlyMode && activeDrawerId,\n [testutilStyles.tools]: isToolsDrawer,\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: `calc(100vh - ${drawersTopOffset}px - ${placement.insetBlockEnd}px)`,\n insetBlockStart: drawersTopOffset,\n }}\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 ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onPointerDown={resizeProps.onPointerDown}\n />\n </div>\n )}\n <div\n className={clsx(styles['drawer-content-container'], sharedStyles['with-motion'])}\n style={{ width: isMobile ? '100%' : `${activeDrawerSize}px` }}\n >\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)}\n ref={drawersFocusControl.refs.close}\n variant=\"icon\"\n />\n </div>\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 {activeDrawerId !== TOOLS_DRAWER_ID && <div className={styles['drawer-content']}>{activeDrawer?.content}</div>}\n </div>\n </aside>\n );\n}\n\nexport const createWidgetizedAppLayoutDrawer = createWidgetizedComponent(AppLayoutDrawerImplementation);\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,sCAAs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,YAAY,uBAAZ,YAAY,CAAE,OAAO,CAAO,CACxE,CACG,CACA,CACT,CAAA;KAAA,CACU,CACd,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,+BAA+B,GAAG,yBAAyB,CAAC,6BAA6B,CAAC,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 { createWidgetizedComponent } from '../../../internal/widgets';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { TOOLS_DRAWER_ID } from '../../utils/use-drawers';\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}\n\nexport function AppLayoutDrawerImplementation({ appLayoutInternals }: 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 drawersTopOffset = verticalOffsets.drawers ?? placement.insetBlockStart;\n const isToolsDrawer = activeDrawer?.id === TOOLS_DRAWER_ID;\n const toolsOnlyMode = drawers.length === 1 && drawers[0].id === TOOLS_DRAWER_ID;\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\n return (\n <Transition nodeRef={drawerRef} in={true} 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, sharedStyles['with-motion'], {\n [styles['last-opened']]: lastOpenedDrawerId === activeDrawerId,\n [styles.legacy]: isLegacyDrawer,\n [testutilStyles['active-drawer']]: !toolsOnlyMode && activeDrawerId,\n [testutilStyles.tools]: isToolsDrawer,\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: `calc(100vh - ${drawersTopOffset}px - ${placement.insetBlockEnd}px)`,\n insetBlockStart: drawersTopOffset,\n ...(!isMobile &&\n !isLegacyDrawer && {\n [customCssProps.drawerSize]: `${['entering', 'entered'].includes(state) ? size : 0}px`,\n }),\n }}\n data-testid={`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 ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onPointerDown={resizeProps.onPointerDown}\n />\n </div>\n )}\n <div className={clsx(styles['drawer-content-container'], sharedStyles['with-motion'])}>\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)}\n ref={drawersFocusControl.refs.close}\n variant=\"icon\"\n />\n </div>\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 {activeDrawerId !== TOOLS_DRAWER_ID && (\n <div className={styles['drawer-content']}>{activeDrawer?.content}</div>\n )}\n </div>\n </aside>\n )}\n </Transition>\n );\n}\n\nexport const createWidgetizedAppLayoutDrawer = createWidgetizedComponent(AppLayoutDrawerImplementation);\n"]}
@@ -1,11 +1,15 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "drawer": "awsui_drawer_12i0j_1tut5_185",
5
- "drawer-content-container": "awsui_drawer-content-container_12i0j_1tut5_198",
6
- "drawer-close-button": "awsui_drawer-close-button_12i0j_1tut5_206",
7
- "drawer-content": "awsui_drawer-content_12i0j_1tut5_198",
8
- "drawer-content-hidden": "awsui_drawer-content-hidden_12i0j_1tut5_215",
9
- "drawer-slider": "awsui_drawer-slider_12i0j_1tut5_218"
4
+ "drawer": "awsui_drawer_12i0j_1br4j_185",
5
+ "legacy": "awsui_legacy_12i0j_1br4j_200",
6
+ "last-opened": "awsui_last-opened_12i0j_1br4j_205",
7
+ "drawer-global": "awsui_drawer-global_12i0j_1br4j_210",
8
+ "drawer-hidden": "awsui_drawer-hidden_12i0j_1br4j_217",
9
+ "drawer-content-container": "awsui_drawer-content-container_12i0j_1br4j_220",
10
+ "drawer-close-button": "awsui_drawer-close-button_12i0j_1br4j_228",
11
+ "drawer-content": "awsui_drawer-content_12i0j_1br4j_220",
12
+ "drawer-content-hidden": "awsui_drawer-content-hidden_12i0j_1br4j_237",
13
+ "drawer-slider": "awsui_drawer-slider_12i0j_1br4j_240"
10
14
  };
11
15