@cloudscape-design/components-themeable 3.0.785 → 3.0.787

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 (281) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/app-layout/test-classes/styles.scss +3 -0
  3. package/lib/internal/scss/app-layout/visual-refresh-toolbar/drawer/styles.scss +40 -0
  4. package/lib/internal/scss/app-layout/visual-refresh-toolbar/skeleton/styles.scss +27 -9
  5. package/lib/internal/scss/collection-preferences/analytics-metadata/styles.scss +8 -0
  6. package/lib/internal/scss/collection-preferences/content-display/styles.scss +3 -1
  7. package/lib/internal/scss/date-range-picker/styles.scss +0 -4
  8. package/lib/internal/scss/flashbar/styles.scss +8 -0
  9. package/lib/internal/scss/internal/components/drag-handle/styles.scss +4 -0
  10. package/lib/internal/scss/internal/styles/forms/mixins.scss +0 -7
  11. package/lib/internal/scss/prompt-input/styles.scss +34 -127
  12. package/lib/internal/scss/prompt-input/test-classes/styles.scss +0 -8
  13. package/lib/internal/scss/steps/styles.scss +53 -0
  14. package/lib/internal/scss/wizard/analytics-metadata/styles.scss +8 -0
  15. package/lib/internal/template/app-layout/drawer/index.js.map +1 -1
  16. package/lib/internal/template/app-layout/drawer/overflow-menu.d.ts +6 -2
  17. package/lib/internal/template/app-layout/drawer/overflow-menu.d.ts.map +1 -1
  18. package/lib/internal/template/app-layout/drawer/overflow-menu.js +22 -8
  19. package/lib/internal/template/app-layout/drawer/overflow-menu.js.map +1 -1
  20. package/lib/internal/template/app-layout/interfaces.d.ts +2 -1
  21. package/lib/internal/template/app-layout/interfaces.d.ts.map +1 -1
  22. package/lib/internal/template/app-layout/interfaces.js.map +1 -1
  23. package/lib/internal/template/app-layout/mobile-toolbar/index.js.map +1 -1
  24. package/lib/internal/template/app-layout/runtime-api.d.ts +4 -3
  25. package/lib/internal/template/app-layout/runtime-api.d.ts.map +1 -1
  26. package/lib/internal/template/app-layout/runtime-api.js +15 -11
  27. package/lib/internal/template/app-layout/runtime-api.js.map +1 -1
  28. package/lib/internal/template/app-layout/test-classes/styles.css.js +20 -19
  29. package/lib/internal/template/app-layout/test-classes/styles.scoped.css +23 -19
  30. package/lib/internal/template/app-layout/test-classes/styles.selectors.js +20 -19
  31. package/lib/internal/template/app-layout/utils/use-drawers.d.ts +12 -1
  32. package/lib/internal/template/app-layout/utils/use-drawers.d.ts.map +1 -1
  33. package/lib/internal/template/app-layout/utils/use-drawers.js +125 -20
  34. package/lib/internal/template/app-layout/utils/use-drawers.js.map +1 -1
  35. package/lib/internal/template/app-layout/utils/use-focus-control.d.ts +10 -0
  36. package/lib/internal/template/app-layout/utils/use-focus-control.d.ts.map +1 -1
  37. package/lib/internal/template/app-layout/utils/use-focus-control.js +60 -1
  38. package/lib/internal/template/app-layout/utils/use-focus-control.js.map +1 -1
  39. package/lib/internal/template/app-layout/utils/visibility-context.d.ts +3 -0
  40. package/lib/internal/template/app-layout/utils/visibility-context.d.ts.map +1 -0
  41. package/lib/internal/template/app-layout/utils/visibility-context.js +5 -0
  42. package/lib/internal/template/app-layout/utils/visibility-context.js.map +1 -0
  43. package/lib/internal/template/app-layout/visual-refresh/drawers.js.map +1 -1
  44. package/lib/internal/template/app-layout/visual-refresh-toolbar/compute-layout.d.ts +5 -1
  45. package/lib/internal/template/app-layout/visual-refresh-toolbar/compute-layout.d.ts.map +1 -1
  46. package/lib/internal/template/app-layout/visual-refresh-toolbar/compute-layout.js +15 -4
  47. package/lib/internal/template/app-layout/visual-refresh-toolbar/compute-layout.js.map +1 -1
  48. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts +15 -0
  49. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts.map +1 -0
  50. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.js +71 -0
  51. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.js.map +1 -0
  52. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawers.d.ts +6 -1
  53. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawers.d.ts.map +1 -1
  54. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawers.js +15 -4
  55. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawers.js.map +1 -1
  56. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.d.ts.map +1 -1
  57. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.js +35 -23
  58. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.js.map +1 -1
  59. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.css.js +10 -6
  60. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +28 -6
  61. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +10 -6
  62. package/lib/internal/template/app-layout/visual-refresh-toolbar/index.d.ts.map +1 -1
  63. package/lib/internal/template/app-layout/visual-refresh-toolbar/index.js +60 -6
  64. package/lib/internal/template/app-layout/visual-refresh-toolbar/index.js.map +1 -1
  65. package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.d.ts +10 -1
  66. package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.d.ts.map +1 -1
  67. package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.js.map +1 -1
  68. package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.d.ts +3 -1
  69. package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.d.ts.map +1 -1
  70. package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.js +3 -2
  71. package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.js.map +1 -1
  72. package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +17 -16
  73. package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +50 -32
  74. package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +17 -16
  75. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.d.ts +6 -2
  76. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.d.ts.map +1 -1
  77. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js +34 -10
  78. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js.map +1 -1
  79. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.d.ts +5 -1
  80. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.d.ts.map +1 -1
  81. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js +17 -13
  82. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js.map +1 -1
  83. package/lib/internal/template/collection-preferences/analytics-metadata/interfaces.d.ts +43 -0
  84. package/lib/internal/template/collection-preferences/analytics-metadata/interfaces.d.ts.map +1 -0
  85. package/lib/internal/template/collection-preferences/analytics-metadata/interfaces.js +4 -0
  86. package/lib/internal/template/collection-preferences/analytics-metadata/interfaces.js.map +1 -0
  87. package/lib/internal/template/collection-preferences/analytics-metadata/styles.css.js +6 -0
  88. package/lib/internal/template/collection-preferences/analytics-metadata/styles.scoped.css +7 -0
  89. package/lib/internal/template/collection-preferences/analytics-metadata/styles.selectors.js +7 -0
  90. package/lib/internal/template/collection-preferences/analytics-metadata/utils.d.ts +9 -0
  91. package/lib/internal/template/collection-preferences/analytics-metadata/utils.d.ts.map +1 -0
  92. package/lib/internal/template/collection-preferences/analytics-metadata/utils.js +48 -0
  93. package/lib/internal/template/collection-preferences/analytics-metadata/utils.js.map +1 -0
  94. package/lib/internal/template/collection-preferences/content-display/content-display-option.d.ts +1 -0
  95. package/lib/internal/template/collection-preferences/content-display/content-display-option.d.ts.map +1 -1
  96. package/lib/internal/template/collection-preferences/content-display/content-display-option.js +2 -2
  97. package/lib/internal/template/collection-preferences/content-display/content-display-option.js.map +1 -1
  98. package/lib/internal/template/collection-preferences/content-display/draggable-option.d.ts.map +1 -1
  99. package/lib/internal/template/collection-preferences/content-display/draggable-option.js +2 -2
  100. package/lib/internal/template/collection-preferences/content-display/draggable-option.js.map +1 -1
  101. package/lib/internal/template/collection-preferences/content-display/index.d.ts +1 -1
  102. package/lib/internal/template/collection-preferences/content-display/index.d.ts.map +1 -1
  103. package/lib/internal/template/collection-preferences/content-display/index.js +21 -7
  104. package/lib/internal/template/collection-preferences/content-display/index.js.map +1 -1
  105. package/lib/internal/template/collection-preferences/content-display/styles.css.js +13 -11
  106. package/lib/internal/template/collection-preferences/content-display/styles.scoped.css +19 -17
  107. package/lib/internal/template/collection-preferences/content-display/styles.selectors.js +13 -11
  108. package/lib/internal/template/collection-preferences/index.d.ts.map +1 -1
  109. package/lib/internal/template/collection-preferences/index.js +21 -15
  110. package/lib/internal/template/collection-preferences/index.js.map +1 -1
  111. package/lib/internal/template/collection-preferences/interfaces.d.ts +29 -0
  112. package/lib/internal/template/collection-preferences/interfaces.d.ts.map +1 -1
  113. package/lib/internal/template/collection-preferences/interfaces.js.map +1 -1
  114. package/lib/internal/template/collection-preferences/styles.css.js +39 -37
  115. package/lib/internal/template/collection-preferences/styles.scoped.css +46 -44
  116. package/lib/internal/template/collection-preferences/styles.selectors.js +39 -37
  117. package/lib/internal/template/collection-preferences/utils.d.ts.map +1 -1
  118. package/lib/internal/template/collection-preferences/utils.js +12 -13
  119. package/lib/internal/template/collection-preferences/utils.js.map +1 -1
  120. package/lib/internal/template/collection-preferences/visible-content.d.ts.map +1 -1
  121. package/lib/internal/template/collection-preferences/visible-content.js +2 -1
  122. package/lib/internal/template/collection-preferences/visible-content.js.map +1 -1
  123. package/lib/internal/template/date-range-picker/index.d.ts.map +1 -1
  124. package/lib/internal/template/date-range-picker/index.js +9 -10
  125. package/lib/internal/template/date-range-picker/index.js.map +1 -1
  126. package/lib/internal/template/date-range-picker/styles.css.js +38 -39
  127. package/lib/internal/template/date-range-picker/styles.scoped.css +47 -51
  128. package/lib/internal/template/date-range-picker/styles.selectors.js +38 -39
  129. package/lib/internal/template/flashbar/styles.css.js +50 -50
  130. package/lib/internal/template/flashbar/styles.scoped.css +156 -149
  131. package/lib/internal/template/flashbar/styles.selectors.js +50 -50
  132. package/lib/internal/template/i18n/messages/all.all.js +1 -1
  133. package/lib/internal/template/i18n/messages/all.all.json +1 -1
  134. package/lib/internal/template/i18n/messages/all.ar.js +1 -1
  135. package/lib/internal/template/i18n/messages/all.ar.json +1 -1
  136. package/lib/internal/template/i18n/messages/all.de.js +1 -1
  137. package/lib/internal/template/i18n/messages/all.de.json +1 -1
  138. package/lib/internal/template/i18n/messages/all.en-GB.js +1 -1
  139. package/lib/internal/template/i18n/messages/all.en-GB.json +1 -1
  140. package/lib/internal/template/i18n/messages/all.en.js +1 -1
  141. package/lib/internal/template/i18n/messages/all.en.json +1 -1
  142. package/lib/internal/template/i18n/messages/all.es.js +1 -1
  143. package/lib/internal/template/i18n/messages/all.es.json +1 -1
  144. package/lib/internal/template/i18n/messages/all.fr.js +1 -1
  145. package/lib/internal/template/i18n/messages/all.fr.json +1 -1
  146. package/lib/internal/template/i18n/messages/all.id.js +1 -1
  147. package/lib/internal/template/i18n/messages/all.id.json +1 -1
  148. package/lib/internal/template/i18n/messages/all.it.js +1 -1
  149. package/lib/internal/template/i18n/messages/all.it.json +1 -1
  150. package/lib/internal/template/i18n/messages/all.ja.js +1 -1
  151. package/lib/internal/template/i18n/messages/all.ja.json +1 -1
  152. package/lib/internal/template/i18n/messages/all.ko.js +1 -1
  153. package/lib/internal/template/i18n/messages/all.ko.json +1 -1
  154. package/lib/internal/template/i18n/messages/all.pt-BR.js +1 -1
  155. package/lib/internal/template/i18n/messages/all.pt-BR.json +1 -1
  156. package/lib/internal/template/i18n/messages/all.tr.js +1 -1
  157. package/lib/internal/template/i18n/messages/all.tr.json +1 -1
  158. package/lib/internal/template/i18n/messages/all.zh-CN.js +1 -1
  159. package/lib/internal/template/i18n/messages/all.zh-CN.json +1 -1
  160. package/lib/internal/template/i18n/messages/all.zh-TW.js +1 -1
  161. package/lib/internal/template/i18n/messages/all.zh-TW.json +1 -1
  162. package/lib/internal/template/i18n/messages-types.d.ts +7 -0
  163. package/lib/internal/template/i18n/messages-types.d.ts.map +1 -1
  164. package/lib/internal/template/i18n/messages-types.js.map +1 -1
  165. package/lib/internal/template/index.d.ts +1 -0
  166. package/lib/internal/template/index.d.ts.map +1 -1
  167. package/lib/internal/template/index.js +1 -0
  168. package/lib/internal/template/index.js.map +1 -1
  169. package/lib/internal/template/internal/analytics/interfaces.d.ts +1 -0
  170. package/lib/internal/template/internal/analytics/interfaces.d.ts.map +1 -1
  171. package/lib/internal/template/internal/analytics/interfaces.js.map +1 -1
  172. package/lib/internal/template/internal/components/drag-handle/index.d.ts +2 -1
  173. package/lib/internal/template/internal/components/drag-handle/index.d.ts.map +1 -1
  174. package/lib/internal/template/internal/components/drag-handle/index.js +3 -3
  175. package/lib/internal/template/internal/components/drag-handle/index.js.map +1 -1
  176. package/lib/internal/template/internal/components/drag-handle/styles.css.js +2 -1
  177. package/lib/internal/template/internal/components/drag-handle/styles.scoped.css +6 -2
  178. package/lib/internal/template/internal/components/drag-handle/styles.selectors.js +2 -1
  179. package/lib/internal/template/internal/environment.js +1 -1
  180. package/lib/internal/template/internal/environment.json +1 -1
  181. package/lib/internal/template/internal/hooks/use-component-analytics/index.d.ts +7 -1
  182. package/lib/internal/template/internal/hooks/use-component-analytics/index.d.ts.map +1 -1
  183. package/lib/internal/template/internal/hooks/use-component-analytics/index.js +21 -4
  184. package/lib/internal/template/internal/hooks/use-component-analytics/index.js.map +1 -1
  185. package/lib/internal/template/internal/plugins/controllers/drawers.d.ts +19 -2
  186. package/lib/internal/template/internal/plugins/controllers/drawers.d.ts.map +1 -1
  187. package/lib/internal/template/internal/plugins/controllers/drawers.js +34 -2
  188. package/lib/internal/template/internal/plugins/controllers/drawers.js.map +1 -1
  189. package/lib/internal/template/internal/plugins/helpers/runtime-content-wrapper.d.ts +4 -2
  190. package/lib/internal/template/internal/plugins/helpers/runtime-content-wrapper.d.ts.map +1 -1
  191. package/lib/internal/template/internal/plugins/helpers/runtime-content-wrapper.js +19 -4
  192. package/lib/internal/template/internal/plugins/helpers/runtime-content-wrapper.js.map +1 -1
  193. package/lib/internal/template/modal/internal.d.ts +1 -0
  194. package/lib/internal/template/modal/internal.d.ts.map +1 -1
  195. package/lib/internal/template/modal/internal.js +2 -2
  196. package/lib/internal/template/modal/internal.js.map +1 -1
  197. package/lib/internal/template/package.json +1 -0
  198. package/lib/internal/template/prompt-input/interfaces.d.ts +0 -16
  199. package/lib/internal/template/prompt-input/interfaces.d.ts.map +1 -1
  200. package/lib/internal/template/prompt-input/interfaces.js.map +1 -1
  201. package/lib/internal/template/prompt-input/internal.d.ts.map +1 -1
  202. package/lib/internal/template/prompt-input/internal.js +11 -28
  203. package/lib/internal/template/prompt-input/internal.js.map +1 -1
  204. package/lib/internal/template/prompt-input/styles.css.js +8 -14
  205. package/lib/internal/template/prompt-input/styles.scoped.css +68 -264
  206. package/lib/internal/template/prompt-input/styles.selectors.js +8 -14
  207. package/lib/internal/template/prompt-input/test-classes/styles.css.js +3 -5
  208. package/lib/internal/template/prompt-input/test-classes/styles.scoped.css +3 -11
  209. package/lib/internal/template/prompt-input/test-classes/styles.selectors.js +3 -5
  210. package/lib/internal/template/steps/index.d.ts +6 -0
  211. package/lib/internal/template/steps/index.d.ts.map +1 -0
  212. package/lib/internal/template/steps/index.js +19 -0
  213. package/lib/internal/template/steps/index.js.map +1 -0
  214. package/lib/internal/template/steps/interfaces.d.ts +40 -0
  215. package/lib/internal/template/steps/interfaces.d.ts.map +1 -0
  216. package/lib/internal/template/steps/interfaces.js +2 -0
  217. package/lib/internal/template/steps/interfaces.js.map +1 -0
  218. package/lib/internal/template/steps/internal.d.ts +8 -0
  219. package/lib/internal/template/steps/internal.d.ts.map +1 -0
  220. package/lib/internal/template/steps/internal.js +21 -0
  221. package/lib/internal/template/steps/internal.js.map +1 -0
  222. package/lib/internal/template/steps/styles.css.js +11 -0
  223. package/lib/internal/template/steps/styles.scoped.css +247 -0
  224. package/lib/internal/template/steps/styles.selectors.js +12 -0
  225. package/lib/internal/template/table/internal.d.ts.map +1 -1
  226. package/lib/internal/template/table/internal.js +2 -2
  227. package/lib/internal/template/table/internal.js.map +1 -1
  228. package/lib/internal/template/test-utils/dom/collection-preferences/content-display-preference.d.ts +9 -0
  229. package/lib/internal/template/test-utils/dom/collection-preferences/content-display-preference.js +13 -0
  230. package/lib/internal/template/test-utils/dom/collection-preferences/content-display-preference.js.map +1 -1
  231. package/lib/internal/template/test-utils/dom/index.d.ts +3 -0
  232. package/lib/internal/template/test-utils/dom/index.js +9 -1
  233. package/lib/internal/template/test-utils/dom/index.js.map +1 -1
  234. package/lib/internal/template/test-utils/dom/prompt-input/index.d.ts +0 -2
  235. package/lib/internal/template/test-utils/dom/prompt-input/index.js +0 -6
  236. package/lib/internal/template/test-utils/dom/prompt-input/index.js.map +1 -1
  237. package/lib/internal/template/test-utils/dom/steps/index.d.ts +18 -0
  238. package/lib/internal/template/test-utils/dom/steps/index.js +33 -0
  239. package/lib/internal/template/test-utils/dom/steps/index.js.map +1 -0
  240. package/lib/internal/template/test-utils/selectors/collection-preferences/content-display-preference.d.ts +9 -0
  241. package/lib/internal/template/test-utils/selectors/collection-preferences/content-display-preference.js +13 -0
  242. package/lib/internal/template/test-utils/selectors/collection-preferences/content-display-preference.js.map +1 -1
  243. package/lib/internal/template/test-utils/selectors/index.d.ts +3 -0
  244. package/lib/internal/template/test-utils/selectors/index.js +9 -1
  245. package/lib/internal/template/test-utils/selectors/index.js.map +1 -1
  246. package/lib/internal/template/test-utils/selectors/prompt-input/index.d.ts +0 -2
  247. package/lib/internal/template/test-utils/selectors/prompt-input/index.js +0 -6
  248. package/lib/internal/template/test-utils/selectors/prompt-input/index.js.map +1 -1
  249. package/lib/internal/template/test-utils/selectors/steps/index.d.ts +18 -0
  250. package/lib/internal/template/test-utils/selectors/steps/index.js +33 -0
  251. package/lib/internal/template/test-utils/selectors/steps/index.js.map +1 -0
  252. package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
  253. package/lib/internal/template/wizard/analytics-metadata/interfaces.d.ts +35 -0
  254. package/lib/internal/template/wizard/analytics-metadata/interfaces.d.ts.map +1 -0
  255. package/lib/internal/template/wizard/analytics-metadata/interfaces.js +4 -0
  256. package/lib/internal/template/wizard/analytics-metadata/interfaces.js.map +1 -0
  257. package/lib/internal/template/wizard/analytics-metadata/styles.css.js +6 -0
  258. package/lib/internal/template/wizard/analytics-metadata/styles.scoped.css +7 -0
  259. package/lib/internal/template/wizard/analytics-metadata/styles.selectors.js +7 -0
  260. package/lib/internal/template/wizard/analytics-metadata/utils.d.ts +7 -0
  261. package/lib/internal/template/wizard/analytics-metadata/utils.d.ts.map +1 -0
  262. package/lib/internal/template/wizard/analytics-metadata/utils.js +14 -0
  263. package/lib/internal/template/wizard/analytics-metadata/utils.js.map +1 -0
  264. package/lib/internal/template/wizard/index.d.ts.map +1 -1
  265. package/lib/internal/template/wizard/index.js +1 -1
  266. package/lib/internal/template/wizard/index.js.map +1 -1
  267. package/lib/internal/template/wizard/internal.d.ts +4 -2
  268. package/lib/internal/template/wizard/internal.d.ts.map +1 -1
  269. package/lib/internal/template/wizard/internal.js +14 -3
  270. package/lib/internal/template/wizard/internal.js.map +1 -1
  271. package/lib/internal/template/wizard/wizard-actions.d.ts +4 -1
  272. package/lib/internal/template/wizard/wizard-actions.d.ts.map +1 -1
  273. package/lib/internal/template/wizard/wizard-actions.js +9 -5
  274. package/lib/internal/template/wizard/wizard-actions.js.map +1 -1
  275. package/lib/internal/template/wizard/wizard-form.d.ts.map +1 -1
  276. package/lib/internal/template/wizard/wizard-form.js +1 -1
  277. package/lib/internal/template/wizard/wizard-form.js.map +1 -1
  278. package/lib/internal/template/wizard/wizard-navigation.d.ts.map +1 -1
  279. package/lib/internal/template/wizard/wizard-navigation.js +12 -6
  280. package/lib/internal/template/wizard/wizard-navigation.js.map +1 -1
  281. package/package.json +1 -1
@@ -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,MAAM,gBAAgB,CAAC;AAevD,MAAM,UAAU,uBAAuB,CAAC,EACtC,cAAc,EACd,eAAe,EACf,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,wBAAwB,GACF;IACtB,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,WAAW;IAC1C,MAAM,qB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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,EA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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,EACnB,QAAQ,EACR,SAAS,EACT,eAAe,EACf,oBAAoB,EACpB,oBAAoB,GACrB,GAAG,kBAAkB,CAAC;IACvB,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC/C,MAAM,cAAc,GAAG,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,EAAE,CAAC;IAExC,MAAM,kBAAkB,GAAG;Q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AAC;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,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,iBAAiB,MAAM,kDAAkD,CAAC;AACjF,OA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import 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_nqc97_185",
5
- "drawer-content-container": "awsui_drawer-content-container_12i0j_nqc97_198",
6
- "drawer-close-button": "awsui_drawer-close-button_12i0j_nqc97_206",
7
- "drawer-content": "awsui_drawer-content_12i0j_nqc97_198",
8
- "drawer-content-hidden": "awsui_drawer-content-hidden_12i0j_nqc97_215",
9
- "drawer-slider": "awsui_drawer-slider_12i0j_nqc97_218"
4
+ "drawer": "awsui_drawer_12i0j_12jqq_185",
5
+ "legacy": "awsui_legacy_12i0j_12jqq_200",
6
+ "last-opened": "awsui_last-opened_12i0j_12jqq_205",
7
+ "drawer-global": "awsui_drawer-global_12i0j_12jqq_210",
8
+ "drawer-hidden": "awsui_drawer-hidden_12i0j_12jqq_217",
9
+ "drawer-content-container": "awsui_drawer-content-container_12i0j_12jqq_220",
10
+ "drawer-close-button": "awsui_drawer-close-button_12i0j_12jqq_228",
11
+ "drawer-content": "awsui_drawer-content_12i0j_12jqq_220",
12
+ "drawer-content-hidden": "awsui_drawer-content-hidden_12i0j_12jqq_237",
13
+ "drawer-slider": "awsui_drawer-slider_12i0j_12jqq_240"
10
14
  };
11
15
 
@@ -182,12 +182,13 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
182
182
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
183
183
  SPDX-License-Identifier: Apache-2.0
184
184
  */
185
- .awsui_drawer_12i0j_nqc97_185:not(#\9) {
185
+ .awsui_drawer_12i0j_12jqq_185:not(#\9) {
186
186
  position: sticky;
187
187
  z-index: 830;
188
188
  background-color: var(--color-background-container-content-myy7cn, #ffffff);
189
189
  display: grid;
190
190
  grid-template-columns: var(--space-m-u91ipm, 16px) 1fr;
191
+ inline-size: var(--awsui-drawer-size-g964ok);
191
192
  block-size: 100%;
192
193
  overflow: hidden;
193
194
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
@@ -195,7 +196,28 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
195
196
  pointer-events: auto;
196
197
  word-wrap: break-word;
197
198
  }
198
- .awsui_drawer_12i0j_nqc97_185 > .awsui_drawer-content-container_12i0j_nqc97_198:not(#\9) {
199
+ @media (min-width: 689px) {
200
+ .awsui_drawer_12i0j_12jqq_185:not(#\9):not(.awsui_legacy_12i0j_12jqq_200) {
201
+ border-inline-start: var(--border-divider-section-width-iueskx, 1px) solid var(--color-border-layout-5gml03, #d5dbdb);
202
+ }
203
+ }
204
+ @media (max-width: 688px) {
205
+ .awsui_drawer_12i0j_12jqq_185.awsui_last-opened_12i0j_12jqq_205:not(#\9) {
206
+ z-index: 1001;
207
+ }
208
+ }
209
+ @media (max-width: 688px) {
210
+ .awsui_drawer_12i0j_12jqq_185.awsui_drawer-global_12i0j_12jqq_210:not(#\9) {
211
+ display: none;
212
+ }
213
+ .awsui_drawer_12i0j_12jqq_185.awsui_drawer-global_12i0j_12jqq_210.awsui_last-opened_12i0j_12jqq_205:not(#\9) {
214
+ display: block;
215
+ }
216
+ }
217
+ .awsui_drawer_12i0j_12jqq_185.awsui_drawer-hidden_12i0j_12jqq_217:not(#\9) {
218
+ display: none;
219
+ }
220
+ .awsui_drawer_12i0j_12jqq_185 > .awsui_drawer-content-container_12i0j_12jqq_220:not(#\9) {
199
221
  grid-column: 1/span 2;
200
222
  grid-row: 1;
201
223
  display: grid;
@@ -203,19 +225,19 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
203
225
  grid-template-rows: 10px auto 1fr;
204
226
  overflow-y: auto;
205
227
  }
206
- .awsui_drawer_12i0j_nqc97_185 > .awsui_drawer-content-container_12i0j_nqc97_198 > .awsui_drawer-close-button_12i0j_nqc97_206:not(#\9) {
228
+ .awsui_drawer_12i0j_12jqq_185 > .awsui_drawer-content-container_12i0j_12jqq_220 > .awsui_drawer-close-button_12i0j_12jqq_228:not(#\9) {
207
229
  grid-column: 3;
208
230
  grid-row: 2;
209
231
  z-index: 1;
210
232
  }
211
- .awsui_drawer_12i0j_nqc97_185 > .awsui_drawer-content-container_12i0j_nqc97_198 > .awsui_drawer-content_12i0j_nqc97_198:not(#\9) {
233
+ .awsui_drawer_12i0j_12jqq_185 > .awsui_drawer-content-container_12i0j_12jqq_220 > .awsui_drawer-content_12i0j_12jqq_220:not(#\9) {
212
234
  grid-column: 1/span 4;
213
235
  grid-row: 1/span 2;
214
236
  }
215
- .awsui_drawer_12i0j_nqc97_185 > .awsui_drawer-content-container_12i0j_nqc97_198 > .awsui_drawer-content_12i0j_nqc97_198.awsui_drawer-content-hidden_12i0j_nqc97_215:not(#\9) {
237
+ .awsui_drawer_12i0j_12jqq_185 > .awsui_drawer-content-container_12i0j_12jqq_220 > .awsui_drawer-content_12i0j_12jqq_220.awsui_drawer-content-hidden_12i0j_12jqq_237:not(#\9) {
216
238
  display: none;
217
239
  }
218
- .awsui_drawer_12i0j_nqc97_185 > .awsui_drawer-slider_12i0j_nqc97_218:not(#\9) {
240
+ .awsui_drawer_12i0j_12jqq_185 > .awsui_drawer-slider_12i0j_12jqq_240:not(#\9) {
219
241
  grid-column: 1;
220
242
  grid-row: 1;
221
243
  block-size: 100%;
@@ -2,11 +2,15 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "drawer": "awsui_drawer_12i0j_nqc97_185",
6
- "drawer-content-container": "awsui_drawer-content-container_12i0j_nqc97_198",
7
- "drawer-close-button": "awsui_drawer-close-button_12i0j_nqc97_206",
8
- "drawer-content": "awsui_drawer-content_12i0j_nqc97_198",
9
- "drawer-content-hidden": "awsui_drawer-content-hidden_12i0j_nqc97_215",
10
- "drawer-slider": "awsui_drawer-slider_12i0j_nqc97_218"
5
+ "drawer": "awsui_drawer_12i0j_12jqq_185",
6
+ "legacy": "awsui_legacy_12i0j_12jqq_200",
7
+ "last-opened": "awsui_last-opened_12i0j_12jqq_205",
8
+ "drawer-global": "awsui_drawer-global_12i0j_12jqq_210",
9
+ "drawer-hidden": "awsui_drawer-hidden_12i0j_12jqq_217",
10
+ "drawer-content-container": "awsui_drawer-content-container_12i0j_12jqq_220",
11
+ "drawer-close-button": "awsui_drawer-close-button_12i0j_12jqq_228",
12
+ "drawer-content": "awsui_drawer-content_12i0j_12jqq_220",
13
+ "drawer-content-hidden": "awsui_drawer-content-hidden_12i0j_12jqq_237",
14
+ "drawer-slider": "awsui_drawer-slider_12i0j_12jqq_240"
11
15
  };
12
16
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAWxE,OAAO,EAAE,cAAc,EAA8B,MAAM,eAAe,CAAC;AAkB3E,QAAA,MAAM,6BAA6B;;;;;;;;;;;;;;;4CA6TlC,CAAC;AAEF,eAAe,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAWxE,OAAO,EAAE,cAAc,EAA8B,MAAM,eAAe,CAAC;AAoB3E,QAAA,MAAM,6BAA6B;;;;;;;;;;;;;;;4CA8YlC,CAAC;AAEF,eAAe,6BAA6B,CAAC"}
@@ -10,11 +10,12 @@ import { useUniqueId } from '../../internal/hooks/use-unique-id';
10
10
  import { useGetGlobalBreadcrumbs } from '../../internal/plugins/helpers/use-global-breadcrumbs';
11
11
  import globalVars from '../../internal/styles/global-vars';
12
12
  import { getSplitPanelDefaultSize } from '../../split-panel/utils/size-utils';
13
- import { useDrawers } from '../utils/use-drawers';
14
- import { useFocusControl } from '../utils/use-focus-control';
13
+ import { MIN_DRAWER_SIZE, useDrawers } from '../utils/use-drawers';
14
+ import { useFocusControl, useMultipleFocusControl } from '../utils/use-focus-control';
15
15
  import { useSplitPanelFocusControl } from '../utils/use-split-panel-focus-control';
16
+ import { ActiveDrawersContext } from '../utils/visibility-context';
16
17
  import { computeHorizontalLayout, computeVerticalLayout } from './compute-layout';
17
- import { AppLayoutDrawer, AppLayoutNavigation, AppLayoutNotifications, AppLayoutSplitPanelBottom, AppLayoutSplitPanelSide, AppLayoutToolbar, } from './internal';
18
+ import { AppLayoutDrawer, AppLayoutGlobalDrawers, AppLayoutNavigation, AppLayoutNotifications, AppLayoutSplitPanelBottom, AppLayoutSplitPanelSide, AppLayoutToolbar, } from './internal';
18
19
  import { useMultiAppLayout } from './multi-layout';
19
20
  import { SkeletonLayout } from './skeleton';
20
21
  const AppLayoutVisualRefreshToolbar = React.forwardRef((_a, forwardRef) => {
@@ -40,7 +41,48 @@ const AppLayoutVisualRefreshToolbar = React.forwardRef((_a, forwardRef) => {
40
41
  drawersFocusControl.setFocus();
41
42
  fireNonCancelableEvent(onToolsChange, { open });
42
43
  };
43
- const { drawers, activeDrawer, minDrawerSize, activeDrawerSize, ariaLabelsWithDrawers, onActiveDrawerChange, onActiveDrawerResize, } = useDrawers(rest, ariaLabels, {
44
+ const onGlobalDrawerFocus = (drawerId, open) => {
45
+ globalDrawersFocusControl.setFocus({ force: true, drawerId, open });
46
+ };
47
+ const onAddNewActiveDrawer = (drawerId) => {
48
+ var _a, _b, _c;
49
+ // If a local drawer is already open, and we attempt to open a new one,
50
+ // it will replace the existing one instead of opening an additional drawer,
51
+ // since only one local drawer is supported. Therefore, layout calculations are not necessary.
52
+ if (activeDrawer && (drawers === null || drawers === void 0 ? void 0 : drawers.find(drawer => drawer.id === drawerId))) {
53
+ return;
54
+ }
55
+ // get the size of drawerId. it could be either local or global drawer
56
+ const combinedDrawers = [...(drawers || []), ...globalDrawers];
57
+ const newDrawer = combinedDrawers.find(drawer => drawer.id === drawerId);
58
+ if (!newDrawer) {
59
+ return;
60
+ }
61
+ const newDrawerSize = Math.min((_b = (_a = newDrawer.defaultSize) !== null && _a !== void 0 ? _a : drawerSizes[drawerId]) !== null && _b !== void 0 ? _b : MIN_DRAWER_SIZE, MIN_DRAWER_SIZE);
62
+ // check if the active drawers could be resized to fit the new drawers
63
+ // to do this, we need to take all active drawers, sum up their min sizes, truncate it from resizableSpaceAvailable
64
+ // and compare a given number with the new drawer id min size
65
+ // the total size of all global drawers resized to their min size
66
+ let totalActiveDrawersMinSize = activeGlobalDrawersIds
67
+ .map(activeDrawerId => { var _a, _b; return (_b = (_a = combinedDrawers.find(drawer => drawer.id === activeDrawerId)) === null || _a === void 0 ? void 0 : _a.defaultSize) !== null && _b !== void 0 ? _b : MIN_DRAWER_SIZE; })
68
+ .reduce((acc, curr) => acc + curr, 0);
69
+ if (activeDrawer) {
70
+ totalActiveDrawersMinSize += Math.min((_c = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.defaultSize) !== null && _c !== void 0 ? _c : MIN_DRAWER_SIZE, MIN_DRAWER_SIZE);
71
+ }
72
+ const availableSpaceForNewDrawer = resizableSpaceAvailable - totalActiveDrawersMinSize;
73
+ if (availableSpaceForNewDrawer >= newDrawerSize) {
74
+ return;
75
+ }
76
+ // now we made sure we cannot accommodate the new drawer with existing ones
77
+ const drawerToClose = drawersOpenQueue[drawersOpenQueue.length - 1];
78
+ if (activeDrawer && (activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id) === drawerToClose) {
79
+ onActiveDrawerChange(null);
80
+ }
81
+ else if (activeGlobalDrawersIds.includes(drawerToClose)) {
82
+ onActiveGlobalDrawersChange(drawerToClose);
83
+ }
84
+ };
85
+ const { drawers, activeDrawer, minDrawerSize, minGlobalDrawersSizes, activeDrawerSize, ariaLabelsWithDrawers, globalDrawers, activeGlobalDrawers, activeGlobalDrawersIds, activeGlobalDrawersSizes, drawerSizes, drawersOpenQueue, onActiveDrawerChange, onActiveDrawerResize, onActiveGlobalDrawersChange, } = useDrawers(Object.assign(Object.assign({}, rest), { onGlobalDrawerFocus, onAddNewActiveDrawer }), ariaLabels, {
44
86
  ariaLabels,
45
87
  toolsHide,
46
88
  toolsOpen,
@@ -81,6 +123,7 @@ const AppLayoutVisualRefreshToolbar = React.forwardRef((_a, forwardRef) => {
81
123
  ariaLabel: undefined,
82
124
  displayed: false,
83
125
  });
126
+ const globalDrawersFocusControl = useMultipleFocusControl(true, activeGlobalDrawersIds);
84
127
  const drawersFocusControl = useFocusControl(!!(activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id), true, activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id);
85
128
  const navigationFocusControl = useFocusControl(navigationOpen);
86
129
  const splitPanelFocusControl = useSplitPanelFocusControl([splitPanelPreferences, splitPanelOpen]);
@@ -92,7 +135,7 @@ const AppLayoutVisualRefreshToolbar = React.forwardRef((_a, forwardRef) => {
92
135
  focusSplitPanel: () => { var _a; return (_a = splitPanelFocusControl.refs.slider.current) === null || _a === void 0 ? void 0 : _a.focus(); },
93
136
  }));
94
137
  const resolvedNavigation = navigationHide ? null : navigation !== null && navigation !== void 0 ? navigation : React.createElement(React.Fragment, null);
95
- const { maxDrawerSize, maxSplitPanelSize, splitPanelForcedPosition, splitPanelPosition } = computeHorizontalLayout({
138
+ const { maxDrawerSize, maxSplitPanelSize, splitPanelForcedPosition, splitPanelPosition, maxGlobalDrawersSizes, resizableSpaceAvailable, } = computeHorizontalLayout({
96
139
  activeDrawerSize: activeDrawer ? activeDrawerSize : 0,
97
140
  splitPanelSize,
98
141
  minContentWidth,
@@ -102,6 +145,7 @@ const AppLayoutVisualRefreshToolbar = React.forwardRef((_a, forwardRef) => {
102
145
  splitPanelOpen,
103
146
  splitPanelPosition: splitPanelPreferences === null || splitPanelPreferences === void 0 ? void 0 : splitPanelPreferences.position,
104
147
  isMobile,
148
+ activeGlobalDrawersSizes,
105
149
  });
106
150
  const { registered, toolbarProps } = useMultiAppLayout({
107
151
  forceDeduplicationType,
@@ -144,8 +188,16 @@ const AppLayoutVisualRefreshToolbar = React.forwardRef((_a, forwardRef) => {
144
188
  activeDrawerSize,
145
189
  minDrawerSize,
146
190
  maxDrawerSize,
191
+ minGlobalDrawersSizes,
192
+ maxGlobalDrawersSizes,
147
193
  drawers: drawers,
194
+ globalDrawers,
195
+ activeGlobalDrawers,
196
+ activeGlobalDrawersIds,
197
+ activeGlobalDrawersSizes,
198
+ onActiveGlobalDrawersChange,
148
199
  drawersFocusControl,
200
+ globalDrawersFocusControl,
149
201
  splitPanelPosition,
150
202
  splitPanelToggleConfig,
151
203
  splitPanelOpen,
@@ -155,6 +207,7 @@ const AppLayoutVisualRefreshToolbar = React.forwardRef((_a, forwardRef) => {
155
207
  toolbarState,
156
208
  setToolbarState,
157
209
  verticalOffsets,
210
+ drawersOpenQueue,
158
211
  setToolbarHeight,
159
212
  setNotificationsHeight,
160
213
  onSplitPanelToggle: onSplitPanelToggleHandler,
@@ -202,7 +255,8 @@ const AppLayoutVisualRefreshToolbar = React.forwardRef((_a, forwardRef) => {
202
255
  paddingBlockEnd: splitPanelOpen && splitPanelPosition === 'bottom' ? splitPanelReportedSize : '',
203
256
  }, toolbar: hasToolbar && React.createElement(AppLayoutToolbar, { appLayoutInternals: appLayoutInternals, toolbarProps: toolbarProps }), notifications: notifications && (React.createElement(AppLayoutNotifications, { appLayoutInternals: appLayoutInternals }, notifications)), contentHeader: contentHeader,
204
257
  // delay rendering the content until registration of this instance is complete
205
- content: registered ? content : null, navigation: resolvedNavigation && React.createElement(AppLayoutNavigation, { appLayoutInternals: appLayoutInternals }), navigationOpen: navigationOpen, navigationWidth: navigationWidth, tools: activeDrawer && React.createElement(AppLayoutDrawer, { appLayoutInternals: appLayoutInternals }), toolsOpen: !!activeDrawer, toolsWidth: activeDrawerSize, sideSplitPanel: splitPanelPosition === 'side' && (React.createElement(AppLayoutSplitPanelSide, { appLayoutInternals: appLayoutInternals, splitPanelInternals: splitPanelInternals }, splitPanel)), bottomSplitPanel: splitPanelPosition === 'bottom' && (React.createElement(AppLayoutSplitPanelBottom, { appLayoutInternals: appLayoutInternals, splitPanelInternals: splitPanelInternals }, splitPanel)), splitPanelOpen: splitPanelOpen, placement: placement, contentType: contentType, maxContentWidth: maxContentWidth, disableContentPaddings: disableContentPaddings })));
258
+ content: registered ? content : null, navigation: resolvedNavigation && React.createElement(AppLayoutNavigation, { appLayoutInternals: appLayoutInternals }), navigationOpen: navigationOpen, navigationWidth: navigationWidth, tools: activeDrawer && React.createElement(AppLayoutDrawer, { appLayoutInternals: appLayoutInternals }), globalTools: React.createElement(ActiveDrawersContext.Provider, { value: activeGlobalDrawersIds },
259
+ React.createElement(AppLayoutGlobalDrawers, { appLayoutInternals: appLayoutInternals })), globalToolsOpen: !!activeGlobalDrawersIds.length, toolsOpen: !!activeDrawer, toolsWidth: activeDrawerSize, sideSplitPanel: splitPanelPosition === 'side' && (React.createElement(AppLayoutSplitPanelSide, { appLayoutInternals: appLayoutInternals, splitPanelInternals: splitPanelInternals }, splitPanel)), bottomSplitPanel: splitPanelPosition === 'bottom' && (React.createElement(AppLayoutSplitPanelBottom, { appLayoutInternals: appLayoutInternals, splitPanelInternals: splitPanelInternals }, splitPanel)), splitPanelOpen: splitPanelOpen, placement: placement, contentType: contentType, maxContentWidth: maxContentWidth, disableContentPaddings: disableContentPaddings })));
206
260
  });
207
261
  export default AppLayoutVisualRefreshToolbar;
208
262
  //# sourceMappingURL=index.js.map