@cloudscape-design/components-themeable 3.0.328 → 3.0.329

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 (177) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/app-layout/styles.scss +26 -0
  3. package/lib/internal/scss/app-layout/visual-refresh/drawers.scss +17 -13
  4. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +39 -39
  5. package/lib/internal/scss/split-panel/styles.scss +0 -18
  6. package/lib/internal/scss/table/sticky-scrollbar/styles.scss +26 -0
  7. package/lib/internal/scss/table/styles.scss +0 -22
  8. package/lib/internal/template/annotation-context/annotation/styles.css.js +24 -24
  9. package/lib/internal/template/annotation-context/annotation/styles.scoped.css +30 -30
  10. package/lib/internal/template/annotation-context/annotation/styles.selectors.js +24 -24
  11. package/lib/internal/template/app-layout/drawer/interfaces.d.ts +0 -7
  12. package/lib/internal/template/app-layout/drawer/interfaces.d.ts.map +1 -1
  13. package/lib/internal/template/app-layout/drawer/interfaces.js.map +1 -1
  14. package/lib/internal/template/app-layout/drawer/resizable-drawer.d.ts.map +1 -1
  15. package/lib/internal/template/app-layout/drawer/resizable-drawer.js +3 -3
  16. package/lib/internal/template/app-layout/drawer/resizable-drawer.js.map +1 -1
  17. package/lib/internal/template/app-layout/notifications/styles.css.js +3 -3
  18. package/lib/internal/template/app-layout/notifications/styles.scoped.css +7 -7
  19. package/lib/internal/template/app-layout/notifications/styles.selectors.js +3 -3
  20. package/lib/internal/template/app-layout/runtime-api.d.ts.map +1 -1
  21. package/lib/internal/template/app-layout/runtime-api.js +5 -2
  22. package/lib/internal/template/app-layout/runtime-api.js.map +1 -1
  23. package/lib/internal/template/app-layout/styles.css.js +17 -13
  24. package/lib/internal/template/app-layout/styles.scoped.css +44 -13
  25. package/lib/internal/template/app-layout/styles.selectors.js +17 -13
  26. package/lib/internal/template/app-layout/utils/interfaces.d.ts +10 -0
  27. package/lib/internal/template/app-layout/utils/interfaces.d.ts.map +1 -0
  28. package/lib/internal/template/app-layout/utils/interfaces.js +2 -0
  29. package/lib/internal/template/app-layout/utils/interfaces.js.map +1 -0
  30. package/lib/internal/template/app-layout/utils/use-drawer-focus-control.d.ts.map +1 -1
  31. package/lib/internal/template/app-layout/utils/use-drawer-focus-control.js +8 -3
  32. package/lib/internal/template/app-layout/utils/use-drawer-focus-control.js.map +1 -1
  33. package/lib/internal/template/app-layout/utils/use-keyboard-events.d.ts +4 -0
  34. package/lib/internal/template/app-layout/utils/use-keyboard-events.d.ts.map +1 -0
  35. package/lib/internal/template/{split-panel → app-layout}/utils/use-keyboard-events.js +10 -11
  36. package/lib/internal/template/app-layout/utils/use-keyboard-events.js.map +1 -0
  37. package/lib/internal/template/app-layout/utils/use-pointer-events.d.ts +3 -0
  38. package/lib/internal/template/app-layout/utils/use-pointer-events.d.ts.map +1 -0
  39. package/lib/internal/template/{split-panel → app-layout}/utils/use-pointer-events.js +15 -8
  40. package/lib/internal/template/app-layout/utils/use-pointer-events.js.map +1 -0
  41. package/lib/internal/template/app-layout/utils/use-resize.d.ts +16 -0
  42. package/lib/internal/template/app-layout/utils/use-resize.d.ts.map +1 -0
  43. package/lib/internal/template/app-layout/utils/use-resize.js +84 -0
  44. package/lib/internal/template/app-layout/utils/use-resize.js.map +1 -0
  45. package/lib/internal/template/app-layout/visual-refresh/context.d.ts +11 -6
  46. package/lib/internal/template/app-layout/visual-refresh/context.d.ts.map +1 -1
  47. package/lib/internal/template/app-layout/visual-refresh/context.js +26 -7
  48. package/lib/internal/template/app-layout/visual-refresh/context.js.map +1 -1
  49. package/lib/internal/template/app-layout/visual-refresh/drawers.d.ts +1 -33
  50. package/lib/internal/template/app-layout/visual-refresh/drawers.d.ts.map +1 -1
  51. package/lib/internal/template/app-layout/visual-refresh/drawers.js +14 -7
  52. package/lib/internal/template/app-layout/visual-refresh/drawers.js.map +1 -1
  53. package/lib/internal/template/app-layout/visual-refresh/styles.css.js +69 -68
  54. package/lib/internal/template/app-layout/visual-refresh/styles.scoped.css +294 -298
  55. package/lib/internal/template/app-layout/visual-refresh/styles.selectors.js +69 -68
  56. package/lib/internal/template/app-layout/visual-refresh/trigger-button.d.ts.map +1 -1
  57. package/lib/internal/template/app-layout/visual-refresh/trigger-button.js +1 -2
  58. package/lib/internal/template/app-layout/visual-refresh/trigger-button.js.map +1 -1
  59. package/lib/internal/template/area-chart/{model/async-store.d.ts → async-store/index.d.ts} +1 -1
  60. package/lib/internal/template/area-chart/async-store/index.d.ts.map +1 -0
  61. package/lib/internal/template/area-chart/{model/async-store.js → async-store/index.js} +1 -1
  62. package/lib/internal/template/area-chart/async-store/index.js.map +1 -0
  63. package/lib/internal/template/area-chart/elements/area-chart-legend.d.ts.map +1 -1
  64. package/lib/internal/template/area-chart/elements/area-chart-legend.js +1 -1
  65. package/lib/internal/template/area-chart/elements/area-chart-legend.js.map +1 -1
  66. package/lib/internal/template/area-chart/elements/data-series.js +1 -1
  67. package/lib/internal/template/area-chart/elements/data-series.js.map +1 -1
  68. package/lib/internal/template/area-chart/elements/highlighted-point.js +1 -1
  69. package/lib/internal/template/area-chart/elements/highlighted-point.js.map +1 -1
  70. package/lib/internal/template/area-chart/elements/use-highlight-details.d.ts.map +1 -1
  71. package/lib/internal/template/area-chart/elements/use-highlight-details.js +3 -1
  72. package/lib/internal/template/area-chart/elements/use-highlight-details.js.map +1 -1
  73. package/lib/internal/template/area-chart/elements/vertical-marker.js +1 -1
  74. package/lib/internal/template/area-chart/elements/vertical-marker.js.map +1 -1
  75. package/lib/internal/template/area-chart/model/index.d.ts +1 -1
  76. package/lib/internal/template/area-chart/model/index.d.ts.map +1 -1
  77. package/lib/internal/template/area-chart/model/index.js.map +1 -1
  78. package/lib/internal/template/area-chart/model/interactions-store.d.ts +1 -1
  79. package/lib/internal/template/area-chart/model/interactions-store.d.ts.map +1 -1
  80. package/lib/internal/template/area-chart/model/interactions-store.js +1 -1
  81. package/lib/internal/template/area-chart/model/interactions-store.js.map +1 -1
  82. package/lib/internal/template/area-chart/model/use-chart-model.d.ts.map +1 -1
  83. package/lib/internal/template/area-chart/model/use-chart-model.js +1 -1
  84. package/lib/internal/template/area-chart/model/use-chart-model.js.map +1 -1
  85. package/lib/internal/template/attribute-editor/interfaces.d.ts +1 -1
  86. package/lib/internal/template/attribute-editor/interfaces.d.ts.map +1 -1
  87. package/lib/internal/template/attribute-editor/interfaces.js.map +1 -1
  88. package/lib/internal/template/content-layout/styles.css.js +7 -7
  89. package/lib/internal/template/content-layout/styles.scoped.css +13 -13
  90. package/lib/internal/template/content-layout/styles.selectors.js +7 -7
  91. package/lib/internal/template/flashbar/styles.css.js +45 -45
  92. package/lib/internal/template/flashbar/styles.scoped.css +169 -169
  93. package/lib/internal/template/flashbar/styles.selectors.js +45 -45
  94. package/lib/internal/template/internal/environment.js +1 -1
  95. package/lib/internal/template/internal/generated/custom-css-properties/index.js +39 -39
  96. package/lib/internal/template/internal/generated/custom-css-properties/index.js.map +1 -1
  97. package/lib/internal/template/internal/plugins/drawers-controller.d.ts +5 -0
  98. package/lib/internal/template/internal/plugins/drawers-controller.d.ts.map +1 -1
  99. package/lib/internal/template/internal/plugins/drawers-controller.js.map +1 -1
  100. package/lib/internal/template/mixed-line-bar-chart/data-series.d.ts.map +1 -1
  101. package/lib/internal/template/mixed-line-bar-chart/data-series.js +8 -2
  102. package/lib/internal/template/mixed-line-bar-chart/data-series.js.map +1 -1
  103. package/lib/internal/template/split-panel/index.d.ts.map +1 -1
  104. package/lib/internal/template/split-panel/index.js +3 -3
  105. package/lib/internal/template/split-panel/index.js.map +1 -1
  106. package/lib/internal/template/split-panel/interfaces.d.ts +0 -7
  107. package/lib/internal/template/split-panel/interfaces.d.ts.map +1 -1
  108. package/lib/internal/template/split-panel/interfaces.js.map +1 -1
  109. package/lib/internal/template/split-panel/styles.css.js +56 -59
  110. package/lib/internal/template/split-panel/styles.scoped.css +77 -93
  111. package/lib/internal/template/split-panel/styles.selectors.js +56 -59
  112. package/lib/internal/template/table/body-cell/td-element.d.ts +1 -1
  113. package/lib/internal/template/table/body-cell/td-element.d.ts.map +1 -1
  114. package/lib/internal/template/table/body-cell/td-element.js +1 -1
  115. package/lib/internal/template/table/body-cell/td-element.js.map +1 -1
  116. package/lib/internal/template/table/header-cell/index.d.ts +1 -1
  117. package/lib/internal/template/table/header-cell/index.d.ts.map +1 -1
  118. package/lib/internal/template/table/header-cell/index.js +1 -1
  119. package/lib/internal/template/table/header-cell/index.js.map +1 -1
  120. package/lib/internal/template/table/internal.js +2 -2
  121. package/lib/internal/template/table/internal.js.map +1 -1
  122. package/lib/internal/template/table/sticky-columns/index.d.ts +2 -0
  123. package/lib/internal/template/table/sticky-columns/index.d.ts.map +1 -0
  124. package/lib/internal/template/table/sticky-columns/index.js +4 -0
  125. package/lib/internal/template/table/sticky-columns/index.js.map +1 -0
  126. package/lib/internal/template/table/{use-sticky-columns.d.ts → sticky-columns/use-sticky-columns.d.ts} +1 -1
  127. package/lib/internal/template/table/sticky-columns/use-sticky-columns.d.ts.map +1 -0
  128. package/lib/internal/template/table/{use-sticky-columns.js → sticky-columns/use-sticky-columns.js} +3 -3
  129. package/lib/internal/template/table/sticky-columns/use-sticky-columns.js.map +1 -0
  130. package/lib/internal/template/table/sticky-scrollbar/index.d.ts +2 -0
  131. package/lib/internal/template/table/sticky-scrollbar/index.d.ts.map +1 -0
  132. package/lib/internal/template/table/sticky-scrollbar/index.js +4 -0
  133. package/lib/internal/template/table/sticky-scrollbar/index.js.map +1 -0
  134. package/lib/internal/template/table/sticky-scrollbar/sticky-scrollbar.d.ts.map +1 -0
  135. package/lib/internal/template/table/{sticky-scrollbar.js → sticky-scrollbar/sticky-scrollbar.js} +2 -2
  136. package/lib/internal/template/table/sticky-scrollbar/sticky-scrollbar.js.map +1 -0
  137. package/lib/internal/template/table/sticky-scrollbar/styles.css.js +9 -0
  138. package/lib/internal/template/table/sticky-scrollbar/styles.scoped.css +22 -0
  139. package/lib/internal/template/table/sticky-scrollbar/styles.selectors.js +10 -0
  140. package/lib/internal/template/table/sticky-scrollbar/use-sticky-scrollbar.d.ts.map +1 -0
  141. package/lib/internal/template/table/{use-sticky-scrollbar.js → sticky-scrollbar/use-sticky-scrollbar.js} +3 -3
  142. package/lib/internal/template/table/sticky-scrollbar/use-sticky-scrollbar.js.map +1 -0
  143. package/lib/internal/template/table/styles.css.js +32 -36
  144. package/lib/internal/template/table/styles.scoped.css +40 -59
  145. package/lib/internal/template/table/styles.selectors.js +32 -36
  146. package/lib/internal/template/table/thead.d.ts +1 -1
  147. package/lib/internal/template/table/thead.d.ts.map +1 -1
  148. package/lib/internal/template/table/thead.js +1 -1
  149. package/lib/internal/template/table/thead.js.map +1 -1
  150. package/lib/internal/template/table/utils.d.ts +1 -1
  151. package/lib/internal/template/table/utils.d.ts.map +1 -1
  152. package/lib/internal/template/table/utils.js.map +1 -1
  153. package/lib/internal/template/wizard/styles.css.js +31 -31
  154. package/lib/internal/template/wizard/styles.scoped.css +63 -63
  155. package/lib/internal/template/wizard/styles.selectors.js +31 -31
  156. package/lib/internal/template-tokens/package.json +9 -0
  157. package/lib/theming.d.ts +9 -0
  158. package/lib/theming.d.ts.map +1 -0
  159. package/lib/theming.js +26 -0
  160. package/lib/theming.js.map +1 -0
  161. package/package.json +1 -1
  162. package/lib/internal/template/area-chart/model/async-store.d.ts.map +0 -1
  163. package/lib/internal/template/area-chart/model/async-store.js.map +0 -1
  164. package/lib/internal/template/split-panel/utils/use-keyboard-events.d.ts +0 -4
  165. package/lib/internal/template/split-panel/utils/use-keyboard-events.d.ts.map +0 -1
  166. package/lib/internal/template/split-panel/utils/use-keyboard-events.js.map +0 -1
  167. package/lib/internal/template/split-panel/utils/use-pointer-events.d.ts +0 -3
  168. package/lib/internal/template/split-panel/utils/use-pointer-events.d.ts.map +0 -1
  169. package/lib/internal/template/split-panel/utils/use-pointer-events.js.map +0 -1
  170. package/lib/internal/template/table/sticky-scrollbar.d.ts.map +0 -1
  171. package/lib/internal/template/table/sticky-scrollbar.js.map +0 -1
  172. package/lib/internal/template/table/use-sticky-columns.d.ts.map +0 -1
  173. package/lib/internal/template/table/use-sticky-columns.js.map +0 -1
  174. package/lib/internal/template/table/use-sticky-scrollbar.d.ts.map +0 -1
  175. package/lib/internal/template/table/use-sticky-scrollbar.js.map +0 -1
  176. /package/lib/internal/template/table/{sticky-scrollbar.d.ts → sticky-scrollbar/sticky-scrollbar.d.ts} +0 -0
  177. /package/lib/internal/template/table/{use-sticky-scrollbar.d.ts → sticky-scrollbar/use-sticky-scrollbar.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"resizable-drawer.js","sourceRoot":"lib/default/","sources":["app-layout/drawer/resizable-drawer.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAE3D,OAAO,aAAa,MAAM,wCAAwC,CAAC;AACnE,OAAO,gBAAgB,MAAM,iCAAiC,CAAC;AAG/D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAOT,EAAE,EAAE;;QAPK,EAC9B,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,YAAY,OAES,EADlB,KAAK,cANsB,2DAO/B,CADS;IAER,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAE7C,MAAM,SAAS,GAAG,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,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AAC,MAAM;QACtB,iBAAiB;QACjB,oBAAoB;KACrB,CAAC;IAEF,MAAM,mBAAmB,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IAC/D,MAAM,SAAS,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IAEtD,MAAM,YAAY,GAAG,CACnB,6BACE,GAAG,EAAE,IAAI,CAAC,MAAM,EAChB,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,gBACC,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,UAAU,0CAAE,YAAY,mBACnC,GAAG,mBACH,CAAC,mBACD,YAAY,EAC3B,SAAS,EAAE,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,CAAC,aAAa,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC,EAC3G,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,mBAAmB;QAElC,oBAAC,aAAa,IAAC,SAAS,EAAE,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,gBAAgB,CAAC,kBAAkB,CAAC,CAAC,GAAI,CACrG,CACP,CAAC;IAEF,OAAO,CACL,oBAAC,MAAM,oBACD,KAAK,IACT,GAAG,EAAE,eAAe,EACpB,YAAY,EACV,CAAC,QAAQ;aACT,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,SAAS,CAAA,IAAI,6BAAK,SAAS,EAAE,gBAAgB,CAAC,qBAAqB,CAAC,IAAG,YAAY,CAAO,KAGzG,QAAQ,CACF,CACV,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useEffect, useState, useRef } from 'react';\n\nimport { getLimitedValue } from '../../split-panel/utils/size-utils';\nimport { usePointerEvents } from '../../split-panel/utils/use-pointer-events';\nimport { useKeyboardEvents } from '../../split-panel/utils/use-keyboard-events';\nimport { Drawer } from './index';\nimport testutilStyles from '../test-classes/styles.css.js';\n\nimport ResizeHandler from '../../split-panel/icons/resize-handler';\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport { SizeControlProps, ResizableDrawerProps } from './interfaces';\n\nexport const ResizableDrawer = ({\n onResize,\n size,\n getMaxWidth,\n refs,\n activeDrawer,\n ...props\n}: ResizableDrawerProps) => {\n const { isOpen, children, isMobile } = props;\n\n const MIN_WIDTH = activeDrawer?.defaultSize && activeDrawer.defaultSize < 280 ? activeDrawer?.defaultSize : 280;\n const [relativeSize, setRelativeSize] = useState(0);\n\n useEffect(() => {\n // effects are called inside out in the components tree\n // wait one frame to allow app-layout to complete its calculations\n const handle = requestAnimationFrame(() => {\n const maxSize = getMaxWidth();\n setRelativeSize((size / maxSize) * 100);\n });\n return () => cancelAnimationFrame(handle);\n }, [size, getMaxWidth]);\n\n const setSidePanelWidth = (width: number) => {\n const maxWidth = getMaxWidth();\n const size = getLimitedValue(MIN_WIDTH, width, maxWidth);\n const id = activeDrawer?.id;\n\n if (isOpen && id && maxWidth >= MIN_WIDTH) {\n onResize({ size, id });\n }\n };\n\n const position = 'side';\n const setBottomPanelHeight = () => {};\n const drawerRefObject = useRef<HTMLDivElement>(null);\n\n const sizeControlProps: SizeControlProps = {\n position,\n splitPanelRef: drawerRefObject,\n handleRef: refs.slider,\n setSidePanelWidth,\n setBottomPanelHeight,\n };\n\n const onSliderPointerDown = usePointerEvents(sizeControlProps);\n const onKeyDown = useKeyboardEvents(sizeControlProps);\n\n const resizeHandle = (\n <div\n ref={refs.slider}\n role=\"slider\"\n tabIndex={0}\n aria-label={activeDrawer?.ariaLabels?.resizeHandle}\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuenow={relativeSize}\n className={clsx(splitPanelStyles.slider, splitPanelStyles[`slider-side`], testutilStyles['drawers-slider'])}\n onKeyDown={onKeyDown}\n onPointerDown={onSliderPointerDown}\n >\n <ResizeHandler className={clsx(splitPanelStyles['slider-icon'], splitPanelStyles[`slider-icon-side`])} />\n </div>\n );\n\n return (\n <Drawer\n {...props}\n ref={drawerRefObject}\n resizeHandle={\n !isMobile &&\n activeDrawer?.resizable && <div className={splitPanelStyles['slider-wrapper-side']}>{resizeHandle}</div>\n }\n >\n {children}\n </Drawer>\n );\n};\n"]}
1
+ {"version":3,"file":"resizable-drawer.js","sourceRoot":"lib/default/","sources":["app-layout/drawer/resizable-drawer.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAE3D,OAAO,aAAa,MAAM,wCAAwC,CAAC;AACnE,OAAO,gBAAgB,MAAM,iCAAiC,CAAC;AAG/D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAOT,EAAE,EAAE;;QAPK,EAC9B,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,YAAY,OAES,EADlB,KAAK,cANsB,2DAO/B,CADS;IAER,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAE7C,MAAM,SAAS,GAAG,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,WAAW,KAAI,YAAY,CAAC,WAAW,GAAG,GAAG,CAAC,CAAC,CAAC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC;IAChH,MAAM,CAAC,YAAY,EAAE,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;IAEtD,MAAM,YAAY,GAAG,CACnB,6BACE,GAAG,EAAE,IAAI,CAAC,MAAM,EAChB,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,gBACC,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,UAAU,0CAAE,YAAY,mBACnC,GAAG,mBACH,CAAC,mBACD,YAAY,EAC3B,SAAS,EAAE,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,CAAC,aAAa,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC,EAC3G,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,mBAAmB;QAElC,oBAAC,aAAa,IAAC,SAAS,EAAE,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,gBAAgB,CAAC,kBAAkB,CAAC,CAAC,GAAI,CACrG,CACP,CAAC;IAEF,OAAO,CACL,oBAAC,MAAM,oBACD,KAAK,IACT,GAAG,EAAE,eAAe,EACpB,YAAY,EACV,CAAC,QAAQ;aACT,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,SAAS,CAAA,IAAI,6BAAK,SAAS,EAAE,gBAAgB,CAAC,qBAAqB,CAAC,IAAG,YAAY,CAAO,KAGzG,QAAQ,CACF,CACV,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useEffect, useState, useRef } from 'react';\n\nimport { getLimitedValue } from '../../split-panel/utils/size-utils';\nimport { usePointerEvents } from '../utils/use-pointer-events';\nimport { useKeyboardEvents } from '../utils/use-keyboard-events';\nimport { SizeControlProps } from '../utils/interfaces';\nimport { Drawer } from './index';\nimport testutilStyles from '../test-classes/styles.css.js';\n\nimport ResizeHandler from '../../split-panel/icons/resize-handler';\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport { ResizableDrawerProps } from './interfaces';\n\nexport const ResizableDrawer = ({\n onResize,\n size,\n getMaxWidth,\n refs,\n activeDrawer,\n ...props\n}: ResizableDrawerProps) => {\n const { isOpen, children, isMobile } = props;\n\n const MIN_WIDTH = activeDrawer?.defaultSize && activeDrawer.defaultSize < 280 ? activeDrawer?.defaultSize : 280;\n const [relativeSize, setRelativeSize] = useState(0);\n\n useEffect(() => {\n // effects are called inside out in the components tree\n // wait one frame to allow app-layout to complete its calculations\n const handle = requestAnimationFrame(() => {\n const maxSize = getMaxWidth();\n setRelativeSize((size / maxSize) * 100);\n });\n return () => cancelAnimationFrame(handle);\n }, [size, getMaxWidth]);\n\n const setSidePanelWidth = (width: number) => {\n const maxWidth = getMaxWidth();\n const size = getLimitedValue(MIN_WIDTH, width, maxWidth);\n const id = activeDrawer?.id;\n\n if (isOpen && id && maxWidth >= MIN_WIDTH) {\n onResize({ size, id });\n }\n };\n\n const position = 'side';\n const setBottomPanelHeight = () => {};\n const drawerRefObject = useRef<HTMLDivElement>(null);\n\n const sizeControlProps: SizeControlProps = {\n position,\n panelRef: drawerRefObject,\n handleRef: refs.slider,\n setSidePanelWidth,\n setBottomPanelHeight,\n };\n\n const onSliderPointerDown = usePointerEvents(sizeControlProps);\n const onKeyDown = useKeyboardEvents(sizeControlProps);\n\n const resizeHandle = (\n <div\n ref={refs.slider}\n role=\"slider\"\n tabIndex={0}\n aria-label={activeDrawer?.ariaLabels?.resizeHandle}\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuenow={relativeSize}\n className={clsx(splitPanelStyles.slider, splitPanelStyles[`slider-side`], testutilStyles['drawers-slider'])}\n onKeyDown={onKeyDown}\n onPointerDown={onSliderPointerDown}\n >\n <ResizeHandler className={clsx(splitPanelStyles['slider-icon'], splitPanelStyles[`slider-icon-side`])} />\n </div>\n );\n\n return (\n <Drawer\n {...props}\n ref={drawerRefObject}\n resizeHandle={\n !isMobile &&\n activeDrawer?.resizable && <div className={splitPanelStyles['slider-wrapper-side']}>{resizeHandle}</div>\n }\n >\n {children}\n </Drawer>\n );\n};\n"]}
@@ -1,8 +1,8 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "notifications": "awsui_notifications_1hmm4_ophqf_9",
5
- "notifications-sticky": "awsui_notifications-sticky_1hmm4_ophqf_10",
6
- "no-content-paddings": "awsui_no-content-paddings_1hmm4_ophqf_25"
4
+ "notifications": "awsui_notifications_1hmm4_1r3fz_9",
5
+ "notifications-sticky": "awsui_notifications-sticky_1hmm4_1r3fz_10",
6
+ "no-content-paddings": "awsui_no-content-paddings_1hmm4_1r3fz_25"
7
7
  };
8
8
 
@@ -6,26 +6,26 @@
6
6
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
7
7
  SPDX-License-Identifier: Apache-2.0
8
8
  */
9
- .awsui_notifications_1hmm4_ophqf_9:not(#\9),
10
- .awsui_notifications-sticky_1hmm4_ophqf_10:not(#\9) {
9
+ .awsui_notifications_1hmm4_1r3fz_9:not(#\9),
10
+ .awsui_notifications-sticky_1hmm4_1r3fz_10:not(#\9) {
11
11
  z-index: 850;
12
12
  }
13
13
 
14
- .awsui_notifications_1hmm4_ophqf_9:not(#\9) {
14
+ .awsui_notifications_1hmm4_1r3fz_9:not(#\9) {
15
15
  /* This is necessary for the z-index to have effect */
16
16
  position: relative;
17
17
  }
18
18
 
19
- .awsui_notifications-sticky_1hmm4_ophqf_10:not(#\9) {
19
+ .awsui_notifications-sticky_1hmm4_1r3fz_10:not(#\9) {
20
20
  top: 0;
21
21
  position: sticky;
22
- --awsui-flashbar-sticky-bottom-margin-8nglyc: var(--space-xxl-y3qgr4, 32px);
22
+ --awsui-flashbar-sticky-bottom-margin-zw2xxa: var(--space-xxl-y3qgr4, 32px);
23
23
  }
24
24
 
25
- .awsui_no-content-paddings_1hmm4_ophqf_25:not(#\9) {
25
+ .awsui_no-content-paddings_1hmm4_1r3fz_25:not(#\9) {
26
26
  /*
27
27
  When using the disableContentPaddings option, the Flashbar will use this custom property to add additional space
28
28
  when the notification bar is rendered, to prevent it from overlapping the content.
29
29
  */
30
- --awsui-stacked-notifications-bottom-margin-8nglyc: var(--space-scaled-l-w7rqqb, 20px);
30
+ --awsui-stacked-notifications-bottom-margin-zw2xxa: var(--space-scaled-l-w7rqqb, 20px);
31
31
  }
@@ -2,8 +2,8 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "notifications": "awsui_notifications_1hmm4_ophqf_9",
6
- "notifications-sticky": "awsui_notifications-sticky_1hmm4_ophqf_10",
7
- "no-content-paddings": "awsui_no-content-paddings_1hmm4_ophqf_25"
5
+ "notifications": "awsui_notifications_1hmm4_1r3fz_9",
6
+ "notifications-sticky": "awsui_notifications-sticky_1hmm4_1r3fz_10",
7
+ "no-content-paddings": "awsui_no-content-paddings_1hmm4_1r3fz_25"
8
8
  };
9
9
 
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-api.d.ts","sourceRoot":"lib/default/","sources":["app-layout/runtime-api.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAoBjD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;CAC1B;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,KAAK,CAAC,mBAAmB,CAAC,GAAG,aAAa,CAiBxF"}
1
+ {"version":3,"file":"runtime-api.d.ts","sourceRoot":"lib/default/","sources":["app-layout/runtime-api.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAoBjD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;CAC1B;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,KAAK,CAAC,mBAAmB,CAAC,GAAG,aAAa,CA0BxF"}
@@ -14,8 +14,11 @@ function RuntimeContentWrapper({ mountContent, unmountContent }) {
14
14
  }
15
15
  export function convertRuntimeDrawers(drawers) {
16
16
  const converted = drawers.map((_a) => {
17
- var { mountContent, unmountContent } = _a, runtimeDrawer = __rest(_a, ["mountContent", "unmountContent"]);
18
- return (Object.assign(Object.assign({}, runtimeDrawer), { content: (React.createElement(RuntimeContentWrapper, { key: runtimeDrawer.id, mountContent: mountContent, unmountContent: unmountContent })) }));
17
+ var { mountContent, unmountContent, trigger } = _a, runtimeDrawer = __rest(_a, ["mountContent", "unmountContent", "trigger"]);
18
+ return (Object.assign(Object.assign({}, runtimeDrawer), { trigger: trigger.iconSvg
19
+ ? Object.assign(Object.assign({}, trigger), { iconSvg: (
20
+ // eslint-disable-next-line react/no-danger
21
+ React.createElement("span", { dangerouslySetInnerHTML: { __html: trigger.iconSvg } })) }) : trigger, content: (React.createElement(RuntimeContentWrapper, { key: runtimeDrawer.id, mountContent: mountContent, unmountContent: unmountContent })) }));
19
22
  });
20
23
  converted.sort((a, b) => {
21
24
  var _a, _b;
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-api.js","sourceRoot":"lib/default/","sources":["app-layout/runtime-api.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AASjD,SAAS,qBAAqB,CAAC,EAAE,YAAY,EAAE,cAAc,EAA8B;IACzF,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAEzC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,SAAS,GAAG,GAAG,CAAC,OAAQ,CAAC;QAC/B,YAAY,CAAC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C,MAAA,IAAI,CAAC,aAAa,mCAAI,CAAC,CAAC,IAAI,CAAC,CAAA,EAAA,CAAC;KAChE,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport { DrawerConfig as RuntimeDrawerConfig } from '../internal/plugins/drawers-controller';\nimport { DrawerItem } from './drawer/interfaces';\n\ninterface RuntimeContentWrapperProps {\n mountContent: RuntimeDrawerConfig['mountContent'];\n unmountContent: RuntimeDrawerConfig['unmountContent'];\n}\n\nfunction RuntimeContentWrapper({ mountContent, unmountContent }: RuntimeContentWrapperProps) {\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const container = ref.current!;\n mountContent(container);\n return () => unmountContent(container);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return <div ref={ref}></div>;\n}\n\nexport interface DrawersLayout {\n before: Array<DrawerItem>;\n after: Array<DrawerItem>;\n}\n\nexport function convertRuntimeDrawers(drawers: Array<RuntimeDrawerConfig>): DrawersLayout {\n const converted = drawers.map(({ mountContent, unmountContent, ...runtimeDrawer }) => ({\n ...runtimeDrawer,\n content: (\n <RuntimeContentWrapper key={runtimeDrawer.id} mountContent={mountContent} unmountContent={unmountContent} />\n ),\n }));\n converted.sort((a, b) => {\n if (b.orderPriority !== a.orderPriority) {\n return Math.sign((b.orderPriority ?? 0) - (a.orderPriority ?? 0));\n }\n return b.id < a.id ? 1 : -1;\n });\n return {\n before: converted.filter(item => (item.orderPriority ?? 0) > 0),\n after: converted.filter(item => (item.orderPriority ?? 0) <= 0),\n };\n}\n"]}
1
+ {"version":3,"file":"runtime-api.js","sourceRoot":"lib/default/","sources":["app-layout/runtime-api.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AASjD,SAA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,mCAAI,CAAC,CAAC,CAAC,CAAC;SACnE;QACD,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IACH,OAAO;QACL,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,WAAC,OAAA,CAAC,MAAA,IAAI,CAAC,aAAa,mCAAI,CAAC,CAAC,GAAG,CAAC,CAAA,EAAA,CAAC;QAC/D,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,WAAC,OAAA,CAAC,MAAA,IAAI,CAAC,aAAa,mCAAI,CAAC,CAAC,IAAI,CAAC,CAAA,EAAA,CAAC;KAChE,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport { DrawerConfig as RuntimeDrawerConfig } from '../internal/plugins/drawers-controller';\nimport { DrawerItem } from './drawer/interfaces';\n\ninterface RuntimeContentWrapperProps {\n mountContent: RuntimeDrawerConfig['mountContent'];\n unmountContent: RuntimeDrawerConfig['unmountContent'];\n}\n\nfunction RuntimeContentWrapper({ mountContent, unmountContent }: RuntimeContentWrapperProps) {\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const container = ref.current!;\n mountContent(container);\n return () => unmountContent(container);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return <div ref={ref}></div>;\n}\n\nexport interface DrawersLayout {\n before: Array<DrawerItem>;\n after: Array<DrawerItem>;\n}\n\nexport function convertRuntimeDrawers(drawers: Array<RuntimeDrawerConfig>): DrawersLayout {\n const converted = drawers.map(({ mountContent, unmountContent, trigger, ...runtimeDrawer }) => ({\n ...runtimeDrawer,\n trigger: trigger.iconSvg\n ? {\n ...trigger,\n iconSvg: (\n // eslint-disable-next-line react/no-danger\n <span dangerouslySetInnerHTML={{ __html: trigger.iconSvg }} />\n ),\n }\n : trigger,\n content: (\n <RuntimeContentWrapper key={runtimeDrawer.id} mountContent={mountContent} unmountContent={unmountContent} />\n ),\n }));\n converted.sort((a, b) => {\n if (b.orderPriority !== a.orderPriority) {\n return Math.sign((b.orderPriority ?? 0) - (a.orderPriority ?? 0));\n }\n return b.id < a.id ? 1 : -1;\n });\n return {\n before: converted.filter(item => (item.orderPriority ?? 0) > 0),\n after: converted.filter(item => (item.orderPriority ?? 0) <= 0),\n };\n}\n"]}
@@ -1,18 +1,22 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "root": "awsui_root_lm6vo_qamh8_97",
5
- "layout-wrapper": "awsui_layout-wrapper_lm6vo_qamh8_98",
6
- "root-no-scroll": "awsui_root-no-scroll_lm6vo_qamh8_105",
7
- "layout": "awsui_layout_lm6vo_qamh8_98",
8
- "layout-no-scroll": "awsui_layout-no-scroll_lm6vo_qamh8_116",
9
- "layout-main": "awsui_layout-main_lm6vo_qamh8_120",
10
- "layout-main-scrollable": "awsui_layout-main-scrollable_lm6vo_qamh8_126",
11
- "unfocusable": "awsui_unfocusable_lm6vo_qamh8_131",
12
- "breadcrumbs-desktop": "awsui_breadcrumbs-desktop_lm6vo_qamh8_135",
13
- "content-header-wrapper": "awsui_content-header-wrapper_lm6vo_qamh8_140",
14
- "content-wrapper": "awsui_content-wrapper_lm6vo_qamh8_144",
15
- "content-overlapped": "awsui_content-overlapped_lm6vo_qamh8_148",
16
- "content-extra-top-padding": "awsui_content-extra-top-padding_lm6vo_qamh8_152"
4
+ "resize-active": "awsui_resize-active_lm6vo_1v63j_98",
5
+ "resize-side": "awsui_resize-side_lm6vo_1v63j_104",
6
+ "resize-bottom": "awsui_resize-bottom_lm6vo_1v63j_107",
7
+ "with-motion": "awsui_with-motion_lm6vo_1v63j_112",
8
+ "root": "awsui_root_lm6vo_1v63j_127",
9
+ "layout-wrapper": "awsui_layout-wrapper_lm6vo_1v63j_128",
10
+ "root-no-scroll": "awsui_root-no-scroll_lm6vo_1v63j_135",
11
+ "layout": "awsui_layout_lm6vo_1v63j_128",
12
+ "layout-no-scroll": "awsui_layout-no-scroll_lm6vo_1v63j_146",
13
+ "layout-main": "awsui_layout-main_lm6vo_1v63j_150",
14
+ "layout-main-scrollable": "awsui_layout-main-scrollable_lm6vo_1v63j_156",
15
+ "unfocusable": "awsui_unfocusable_lm6vo_1v63j_161",
16
+ "breadcrumbs-desktop": "awsui_breadcrumbs-desktop_lm6vo_1v63j_165",
17
+ "content-header-wrapper": "awsui_content-header-wrapper_lm6vo_1v63j_170",
18
+ "content-wrapper": "awsui_content-wrapper_lm6vo_1v63j_174",
19
+ "content-overlapped": "awsui_content-overlapped_lm6vo_1v63j_178",
20
+ "content-extra-top-padding": "awsui_content-extra-top-padding_lm6vo_1v63j_182"
17
21
  };
18
22
 
@@ -94,61 +94,92 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
94
94
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
95
95
  SPDX-License-Identifier: Apache-2.0
96
96
  */
97
- .awsui_root_lm6vo_qamh8_97:not(#\9),
98
- .awsui_layout-wrapper_lm6vo_qamh8_98:not(#\9) {
97
+ /* stylelint-disable selector-combinator-disallowed-list, selector-max-type, selector-max-universal */
98
+ .awsui_resize-active_lm6vo_1v63j_98 *:not(#\9) {
99
+ -webkit-user-select: none;
100
+ user-select: none;
101
+ }
102
+ .awsui_resize-active_lm6vo_1v63j_98 iframe:not(#\9) {
103
+ pointer-events: none;
104
+ }
105
+ .awsui_resize-side_lm6vo_1v63j_104 *:not(#\9) {
106
+ cursor: ew-resize;
107
+ }
108
+ .awsui_resize-bottom_lm6vo_1v63j_107 *:not(#\9) {
109
+ cursor: ns-resize;
110
+ }
111
+
112
+ /* stylelint-enable selector-combinator-disallowed-list, selector-max-type, selector-max-universal */
113
+ .awsui_with-motion_lm6vo_1v63j_112:not(#\9) {
114
+ transition: var(--motion-duration-refresh-only-fast-osz7cj, 115ms);
115
+ transition-property: border-color, opacity, width;
116
+ }
117
+ @media (prefers-reduced-motion: reduce) {
118
+ .awsui_with-motion_lm6vo_1v63j_112:not(#\9) {
119
+ animation: none;
120
+ transition: none;
121
+ }
122
+ }
123
+ .awsui-motion-disabled .awsui_with-motion_lm6vo_1v63j_112:not(#\9), .awsui-mode-entering .awsui_with-motion_lm6vo_1v63j_112:not(#\9) {
124
+ animation: none;
125
+ transition: none;
126
+ }
127
+
128
+ .awsui_root_lm6vo_1v63j_127:not(#\9),
129
+ .awsui_layout-wrapper_lm6vo_1v63j_128:not(#\9) {
99
130
  display: flex;
100
131
  flex-direction: column;
101
132
  position: relative;
102
133
  color: var(--color-text-body-default-fckvk9, #16191f);
103
134
  }
104
135
 
105
- .awsui_root-no-scroll_lm6vo_qamh8_105:not(#\9) {
136
+ .awsui_root-no-scroll_lm6vo_1v63j_135:not(#\9) {
106
137
  position: relative;
107
138
  z-index: 1;
108
139
  }
109
140
 
110
- .awsui_layout_lm6vo_qamh8_98:not(#\9) {
141
+ .awsui_layout_lm6vo_1v63j_128:not(#\9) {
111
142
  flex: 1 1 auto;
112
143
  display: flex;
113
144
  align-items: stretch;
114
145
  background-color: var(--color-background-layout-main-nd5gs3, #f2f3f3);
115
146
  }
116
- .awsui_layout-no-scroll_lm6vo_qamh8_116:not(#\9) {
147
+ .awsui_layout-no-scroll_lm6vo_1v63j_146:not(#\9) {
117
148
  overflow: hidden;
118
149
  }
119
150
 
120
- .awsui_layout-main_lm6vo_qamh8_120:not(#\9) {
151
+ .awsui_layout-main_lm6vo_1v63j_150:not(#\9) {
121
152
  flex: 1;
122
153
  min-width: 0;
123
154
  background-color: var(--color-background-layout-main-nd5gs3, #f2f3f3);
124
155
  position: relative;
125
156
  }
126
- .awsui_layout-main-scrollable_lm6vo_qamh8_126:not(#\9) {
157
+ .awsui_layout-main-scrollable_lm6vo_1v63j_156:not(#\9) {
127
158
  overflow: auto;
128
159
  }
129
160
 
130
161
  /* stylelint-disable-next-line selector-combinator-disallowed-list, selector-max-universal */
131
- .awsui_unfocusable_lm6vo_qamh8_131 *:not(#\9) {
162
+ .awsui_unfocusable_lm6vo_1v63j_161 *:not(#\9) {
132
163
  visibility: hidden;
133
164
  }
134
165
 
135
- .awsui_breadcrumbs-desktop_lm6vo_qamh8_135:not(#\9) {
166
+ .awsui_breadcrumbs-desktop_lm6vo_1v63j_165:not(#\9) {
136
167
  padding-top: var(--space-scaled-m-5caa5e, 16px);
137
168
  padding-bottom: var(--space-scaled-s-73r995, 12px);
138
169
  }
139
170
 
140
- .awsui_content-header-wrapper_lm6vo_qamh8_140:not(#\9) {
171
+ .awsui_content-header-wrapper_lm6vo_1v63j_170:not(#\9) {
141
172
  padding-bottom: var(--space-content-header-padding-bottom-v55qlt, 16px);
142
173
  }
143
174
 
144
- .awsui_content-wrapper_lm6vo_qamh8_144:not(#\9) {
175
+ .awsui_content-wrapper_lm6vo_1v63j_174:not(#\9) {
145
176
  padding-bottom: var(--space-layout-content-bottom-zu47sf, 20px);
146
177
  }
147
178
 
148
- .awsui_content-overlapped_lm6vo_qamh8_148:not(#\9) {
179
+ .awsui_content-overlapped_lm6vo_1v63j_178:not(#\9) {
149
180
  margin-top: calc(-1 * var(--space-dark-header-overlap-distance-g5z45b, 0px));
150
181
  }
151
182
 
152
- .awsui_content-extra-top-padding_lm6vo_qamh8_152:not(#\9) {
183
+ .awsui_content-extra-top-padding_lm6vo_1v63j_182:not(#\9) {
153
184
  padding-top: var(--space-scaled-m-5caa5e, 16px);
154
185
  }
@@ -2,18 +2,22 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "root": "awsui_root_lm6vo_qamh8_97",
6
- "layout-wrapper": "awsui_layout-wrapper_lm6vo_qamh8_98",
7
- "root-no-scroll": "awsui_root-no-scroll_lm6vo_qamh8_105",
8
- "layout": "awsui_layout_lm6vo_qamh8_98",
9
- "layout-no-scroll": "awsui_layout-no-scroll_lm6vo_qamh8_116",
10
- "layout-main": "awsui_layout-main_lm6vo_qamh8_120",
11
- "layout-main-scrollable": "awsui_layout-main-scrollable_lm6vo_qamh8_126",
12
- "unfocusable": "awsui_unfocusable_lm6vo_qamh8_131",
13
- "breadcrumbs-desktop": "awsui_breadcrumbs-desktop_lm6vo_qamh8_135",
14
- "content-header-wrapper": "awsui_content-header-wrapper_lm6vo_qamh8_140",
15
- "content-wrapper": "awsui_content-wrapper_lm6vo_qamh8_144",
16
- "content-overlapped": "awsui_content-overlapped_lm6vo_qamh8_148",
17
- "content-extra-top-padding": "awsui_content-extra-top-padding_lm6vo_qamh8_152"
5
+ "resize-active": "awsui_resize-active_lm6vo_1v63j_98",
6
+ "resize-side": "awsui_resize-side_lm6vo_1v63j_104",
7
+ "resize-bottom": "awsui_resize-bottom_lm6vo_1v63j_107",
8
+ "with-motion": "awsui_with-motion_lm6vo_1v63j_112",
9
+ "root": "awsui_root_lm6vo_1v63j_127",
10
+ "layout-wrapper": "awsui_layout-wrapper_lm6vo_1v63j_128",
11
+ "root-no-scroll": "awsui_root-no-scroll_lm6vo_1v63j_135",
12
+ "layout": "awsui_layout_lm6vo_1v63j_128",
13
+ "layout-no-scroll": "awsui_layout-no-scroll_lm6vo_1v63j_146",
14
+ "layout-main": "awsui_layout-main_lm6vo_1v63j_150",
15
+ "layout-main-scrollable": "awsui_layout-main-scrollable_lm6vo_1v63j_156",
16
+ "unfocusable": "awsui_unfocusable_lm6vo_1v63j_161",
17
+ "breadcrumbs-desktop": "awsui_breadcrumbs-desktop_lm6vo_1v63j_165",
18
+ "content-header-wrapper": "awsui_content-header-wrapper_lm6vo_1v63j_170",
19
+ "content-wrapper": "awsui_content-wrapper_lm6vo_1v63j_174",
20
+ "content-overlapped": "awsui_content-overlapped_lm6vo_1v63j_178",
21
+ "content-extra-top-padding": "awsui_content-extra-top-padding_lm6vo_1v63j_182"
18
22
  };
19
23
 
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ export interface SizeControlProps {
3
+ position: 'side' | 'bottom';
4
+ panelRef?: React.RefObject<HTMLDivElement>;
5
+ handleRef?: React.RefObject<HTMLDivElement>;
6
+ setSidePanelWidth: (width: number) => void;
7
+ setBottomPanelHeight: (height: number) => void;
8
+ hasTransitions?: boolean;
9
+ }
10
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["app-layout/utils/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC3C,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC5C,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,oBAAoB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["app-layout/utils/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nexport interface SizeControlProps {\n position: 'side' | 'bottom';\n panelRef?: React.RefObject<HTMLDivElement>;\n handleRef?: React.RefObject<HTMLDivElement>;\n setSidePanelWidth: (width: number) => void;\n setBottomPanelHeight: (height: number) => void;\n hasTransitions?: boolean;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"use-drawer-focus-control.d.ts","sourceRoot":"lib/default/","sources":["app-layout/utils/use-drawer-focus-control.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAkC,MAAM,OAAO,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,MAAM,qBAAqB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEzE,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACnC,KAAK,EAAE,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;CACnC;AAED,UAAU,iBAAiB;IACzB,IAAI,EAAE,sBAAsB,CAAC;IAC7B,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,kBAAkB,EAAE,CAAC,WAAW,EAAE,qBAAqB,KAAK,IAAI,CAAC;CAClE;AAED,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,cAAc,EAC5B,MAAM,EAAE,OAAO,EACf,YAAY,UAAQ,GACnB,iBAAiB,CA6DnB"}
1
+ {"version":3,"file":"use-drawer-focus-control.d.ts","sourceRoot":"lib/default/","sources":["app-layout/utils/use-drawer-focus-control.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAkC,MAAM,OAAO,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,MAAM,qBAAqB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEzE,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACnC,KAAK,EAAE,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;CACnC;AAED,UAAU,iBAAiB;IACzB,IAAI,EAAE,sBAAsB,CAAC;IAC7B,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,kBAAkB,EAAE,CAAC,WAAW,EAAE,qBAAqB,KAAK,IAAI,CAAC;CAClE;AAED,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,cAAc,EAC5B,MAAM,EAAE,OAAO,EACf,YAAY,UAAQ,GACnB,iBAAiB,CAiEnB"}
@@ -11,13 +11,18 @@ export function useDrawerFocusControl(dependencies, isOpen, restoreFocus = false
11
11
  const shouldFocus = useRef(false);
12
12
  const lastInteraction = useRef(null);
13
13
  useEffect(() => {
14
- var _a, _b, _c;
14
+ var _a, _b, _c, _d;
15
15
  switch ((_a = lastInteraction.current) === null || _a === void 0 ? void 0 : _a.type) {
16
16
  case 'open':
17
- (_b = refs.slider.current) === null || _b === void 0 ? void 0 : _b.focus();
17
+ if (refs.slider.current) {
18
+ (_b = refs.slider.current) === null || _b === void 0 ? void 0 : _b.focus();
19
+ }
20
+ else {
21
+ (_c = refs.close.current) === null || _c === void 0 ? void 0 : _c.focus();
22
+ }
18
23
  break;
19
24
  case 'close':
20
- (_c = refs.toggle.current) === null || _c === void 0 ? void 0 : _c.focus();
25
+ (_d = refs.toggle.current) === null || _d === void 0 ? void 0 : _d.focus();
21
26
  break;
22
27
  }
23
28
  lastInteraction.current = null;
@@ -1 +1 @@
1
- {"version":3,"file":"use-drawer-focus-control.js","sourceRoot":"lib/default/","sources":["app-layout/utils/use-drawer-focus-control.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAA6B,SAAS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,CAAC,QAAQ,CAAC,sBAAsB,CAAC,OAAO,CAAC,EAAE;gBACvG,sBAAsB,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;gBACvC,sBAAsB,CAAC,OAAO,GAAG,SAAS,CAAC;aAC5C;iBAAM;gBACL,MAAA,IAAI,CAAC,MAAM,CAAC,OAAO,0CAAE,KAAK,EAAE,CAAC;aAC9B;SACF;QACD,WAAW,CAAC,OAAO,GAAG,KAAK,CAAC;IAC9B,CAAC,CAAC;IAEF,kEAAkE;IAClE,uDAAuD;IACvD,SAAS,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAE7B,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE;QACjC,sBAAsB,CAAC,OAAO,GAAG,SAAS,CAAC;IAC7C,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,IAAI;QACJ,QAAQ,EAAE,KAAK,CAAC,EAAE;YAChB,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC;YAC3B,IAAI,KAAK,IAAI,MAAM,EAAE;gBACnB,OAAO,EAAE,CAAC;aACX;QACH,CAAC;QACD,SAAS;QACT,kBAAkB,EAAE,CAAC,WAAkC,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,OAAO,GAAG,WAAW,CAAC;KACpG,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DependencyList, RefObject, useEffect, useRef, useCallback } from 'react';\nimport { ButtonProps } from '../../button/interfaces';\n\nexport type DrawerLastInteraction = { type: 'open' } | { type: 'close' };\n\nexport interface DrawerFocusControlRefs {\n toggle: RefObject<ButtonProps.Ref>;\n close: RefObject<ButtonProps.Ref>;\n slider: RefObject<HTMLDivElement>;\n}\n\ninterface FocusControlState {\n refs: DrawerFocusControlRefs;\n setFocus: (force?: boolean) => void;\n loseFocus: () => void;\n setLastInteraction: (interaction: DrawerLastInteraction) => void;\n}\n\nexport function useDrawerFocusControl(\n dependencies: DependencyList,\n isOpen: boolean,\n restoreFocus = false\n): FocusControlState {\n const refs = {\n toggle: useRef<ButtonProps.Ref>(null),\n close: useRef<ButtonProps.Ref>(null),\n slider: useRef<HTMLDivElement>(null),\n };\n const previousFocusedElement = useRef<HTMLElement>();\n const shouldFocus = useRef(false);\n const lastInteraction = useRef<DrawerLastInteraction | null>(null);\n\n useEffect(() => {\n switch (lastInteraction.current?.type) {\n case 'open':\n refs.slider.current?.focus();\n break;\n case 'close':\n refs.toggle.current?.focus();\n break;\n }\n lastInteraction.current = null;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies);\n\n const doFocus = () => {\n if (!shouldFocus.current) {\n return;\n }\n if (isOpen) {\n previousFocusedElement.current =\n document.activeElement !== document.body ? (document.activeElement as HTMLElement) : undefined;\n refs.close.current?.focus();\n } else {\n if (restoreFocus && previousFocusedElement.current && document.contains(previousFocusedElement.current)) {\n previousFocusedElement.current.focus();\n previousFocusedElement.current = undefined;\n } else {\n refs.toggle.current?.focus();\n }\n }\n shouldFocus.current = false;\n };\n\n // We explictly want this effect to run when only `isOpen` changes\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(doFocus, [isOpen]);\n\n const loseFocus = useCallback(() => {\n previousFocusedElement.current = undefined;\n }, []);\n\n return {\n refs,\n setFocus: force => {\n shouldFocus.current = true;\n if (force && isOpen) {\n doFocus();\n }\n },\n loseFocus,\n setLastInteraction: (interaction: DrawerLastInteraction) => (lastInteraction.current = interaction),\n };\n}\n"]}
1
+ {"version":3,"file":"use-drawer-focus-control.js","sourceRoot":"lib/default/","sources":["app-layout/utils/use-drawer-focus-control.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAA6B,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAkBlF,MAAM,UAAU,qBAAqB,CACnC,YAA4B,EAC5B,MAAe,EACf,YAA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B,CAAC,OAAO,IAAI,QAAQ,CAAC,QAAQ,CAAC,sBAAsB,CAAC,OAAO,CAAC,EAAE;gBACvG,sBAAsB,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;gBACvC,sBAAsB,CAAC,OAAO,GAAG,SAAS,CAAC;aAC5C;iBAAM;gBACL,MAAA,IAAI,CAAC,MAAM,CAAC,OAAO,0CAAE,KAAK,EAAE,CAAC;aAC9B;SACF;QACD,WAAW,CAAC,OAAO,GAAG,KAAK,CAAC;IAC9B,CAAC,CAAC;IAEF,kEAAkE;IAClE,uDAAuD;IACvD,SAAS,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAE7B,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE;QACjC,sBAAsB,CAAC,OAAO,GAAG,SAAS,CAAC;IAC7C,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,IAAI;QACJ,QAAQ,EAAE,KAAK,CAAC,EAAE;YAChB,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC;YAC3B,IAAI,KAAK,IAAI,MAAM,EAAE;gBACnB,OAAO,EAAE,CAAC;aACX;QACH,CAAC;QACD,SAAS;QACT,kBAAkB,EAAE,CAAC,WAAkC,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,OAAO,GAAG,WAAW,CAAC;KACpG,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DependencyList, RefObject, useEffect, useRef, useCallback } from 'react';\nimport { ButtonProps } from '../../button/interfaces';\n\nexport type DrawerLastInteraction = { type: 'open' } | { type: 'close' };\n\nexport interface DrawerFocusControlRefs {\n toggle: RefObject<ButtonProps.Ref>;\n close: RefObject<ButtonProps.Ref>;\n slider: RefObject<HTMLDivElement>;\n}\n\ninterface FocusControlState {\n refs: DrawerFocusControlRefs;\n setFocus: (force?: boolean) => void;\n loseFocus: () => void;\n setLastInteraction: (interaction: DrawerLastInteraction) => void;\n}\n\nexport function useDrawerFocusControl(\n dependencies: DependencyList,\n isOpen: boolean,\n restoreFocus = false\n): FocusControlState {\n const refs = {\n toggle: useRef<ButtonProps.Ref>(null),\n close: useRef<ButtonProps.Ref>(null),\n slider: useRef<HTMLDivElement>(null),\n };\n const previousFocusedElement = useRef<HTMLElement>();\n const shouldFocus = useRef(false);\n const lastInteraction = useRef<DrawerLastInteraction | null>(null);\n\n useEffect(() => {\n switch (lastInteraction.current?.type) {\n case 'open':\n if (refs.slider.current) {\n refs.slider.current?.focus();\n } else {\n refs.close.current?.focus();\n }\n break;\n case 'close':\n refs.toggle.current?.focus();\n break;\n }\n lastInteraction.current = null;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies);\n\n const doFocus = () => {\n if (!shouldFocus.current) {\n return;\n }\n if (isOpen) {\n previousFocusedElement.current =\n document.activeElement !== document.body ? (document.activeElement as HTMLElement) : undefined;\n refs.close.current?.focus();\n } else {\n if (restoreFocus && previousFocusedElement.current && document.contains(previousFocusedElement.current)) {\n previousFocusedElement.current.focus();\n previousFocusedElement.current = undefined;\n } else {\n refs.toggle.current?.focus();\n }\n }\n shouldFocus.current = false;\n };\n\n // We explictly want this effect to run when only `isOpen` changes\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(doFocus, [isOpen]);\n\n const loseFocus = useCallback(() => {\n previousFocusedElement.current = undefined;\n }, []);\n\n return {\n refs,\n setFocus: force => {\n shouldFocus.current = true;\n if (force && isOpen) {\n doFocus();\n }\n },\n loseFocus,\n setLastInteraction: (interaction: DrawerLastInteraction) => (lastInteraction.current = interaction),\n };\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { SizeControlProps } from './interfaces';
3
+ export declare const useKeyboardEvents: ({ position, setSidePanelWidth, setBottomPanelHeight, panelRef, }: SizeControlProps) => (event: React.KeyboardEvent) => void;
4
+ //# sourceMappingURL=use-keyboard-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-keyboard-events.d.ts","sourceRoot":"lib/default/","sources":["app-layout/utils/use-keyboard-events.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAmBhD,eAAO,MAAM,iBAAiB,qEAK3B,gBAAgB,aACF,mBAAmB,SAwDnC,CAAC"}
@@ -1,34 +1,33 @@
1
1
  import { KeyCode } from '../../internal/keycode';
2
2
  const KEYBOARD_SINGLE_STEP_SIZE = 10;
3
3
  const KEYBOARD_MULTIPLE_STEPS_SIZE = 60;
4
- const getCurrentSize = (splitPanelRef) => {
5
- if (!splitPanelRef || !splitPanelRef.current) {
4
+ const getCurrentSize = (panelRef) => {
5
+ if (!panelRef || !panelRef.current) {
6
6
  return {
7
- splitPanelHeight: 0,
8
- splitPanelWidth: 0,
7
+ panelHeight: 0,
8
+ panelWidth: 0,
9
9
  };
10
10
  }
11
- const safeParseFloat = (size = '') => parseFloat(size) || 0;
12
11
  return {
13
- splitPanelHeight: safeParseFloat(splitPanelRef.current.style.height),
14
- splitPanelWidth: safeParseFloat(splitPanelRef.current.style.width),
12
+ panelHeight: panelRef.current.clientHeight,
13
+ panelWidth: panelRef.current.clientWidth,
15
14
  };
16
15
  };
17
- export const useKeyboardEvents = ({ position, setSidePanelWidth, setBottomPanelHeight, splitPanelRef, }) => {
16
+ export const useKeyboardEvents = ({ position, setSidePanelWidth, setBottomPanelHeight, panelRef, }) => {
18
17
  return (event) => {
19
18
  let setSizeFunction;
20
19
  let currentSize;
21
20
  let maxSize;
22
- const { splitPanelHeight, splitPanelWidth } = getCurrentSize(splitPanelRef);
21
+ const { panelHeight, panelWidth } = getCurrentSize(panelRef);
23
22
  if (position === 'side') {
24
23
  setSizeFunction = setSidePanelWidth;
25
- currentSize = splitPanelWidth;
24
+ currentSize = panelWidth;
26
25
  // don't need the exact max size as it's constrained in the set size function
27
26
  maxSize = window.innerWidth;
28
27
  }
29
28
  else {
30
29
  setSizeFunction = setBottomPanelHeight;
31
- currentSize = splitPanelHeight;
30
+ currentSize = panelHeight;
32
31
  // don't need the exact max size as it's constrained in the set size function
33
32
  maxSize = window.innerHeight;
34
33
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-keyboard-events.js","sourceRoot":"lib/default/","sources":["app-layout/utils/use-keyboard-events.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGjD,MAAM,yBAAyB,GAAG,EAAE,CAAC;AACrC,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAExC,MAAM,cAAc,GAAG,CAAC,QAA0C,EAAE,EAAE;IACpE,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;QAClC,OAAO;YACL,WAAW,EAAE,CAAC;YACd,UAAU,EAAE,CAAC;SACd,CAAC;KACH;IAED,OAAO;QACL,WAAW,EAAE,QAAQ,CAAC,OAAO,CAAC,YAAY;QAC1C,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,WAAW;KACzC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAChC,QAAQ,EACR,iBAAiB,EACjB,oBAAoB,EACpB,QAAQ,GACS,EAAE,EAAE;IACrB,OAAO,CAAC,KAA0B,EAAE,EAAE;QACpC,IAAI,eAAe,CAAC;QACpB,IAAI,WAAW,CAAC;QAChB,IAAI,OAAO,CAAC;QAEZ,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;QAE7D,IAAI,QAAQ,KAAK,MAAM,EAAE;YACvB,eAAe,GAAG,iBAAiB,CAAC;YACpC,WAAW,GAAG,UAAU,CAAC;YACzB,6EAA6E;YAC7E,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC;SAC7B;aAAM;YACL,eAAe,GAAG,oBAAoB,CAAC;Y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BACE,cAAc,GAAG,KAAK,CAAC;SAC1B;QAED,IAAI,cAAc,EAAE;YAClB,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,KAAK,CAAC,eAAe,EAAE,CAAC;SACzB;IACH,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { KeyCode } from '../../internal/keycode';\nimport { SizeControlProps } from './interfaces';\n\nconst KEYBOARD_SINGLE_STEP_SIZE = 10;\nconst KEYBOARD_MULTIPLE_STEPS_SIZE = 60;\n\nconst getCurrentSize = (panelRef?: React.RefObject<HTMLDivElement>) => {\n if (!panelRef || !panelRef.current) {\n return {\n panelHeight: 0,\n panelWidth: 0,\n };\n }\n\n return {\n panelHeight: panelRef.current.clientHeight,\n panelWidth: panelRef.current.clientWidth,\n };\n};\n\nexport const useKeyboardEvents = ({\n position,\n setSidePanelWidth,\n setBottomPanelHeight,\n panelRef,\n}: SizeControlProps) => {\n return (event: React.KeyboardEvent) => {\n let setSizeFunction;\n let currentSize;\n let maxSize;\n\n const { panelHeight, panelWidth } = getCurrentSize(panelRef);\n\n if (position === 'side') {\n setSizeFunction = setSidePanelWidth;\n currentSize = panelWidth;\n // don't need the exact max size as it's constrained in the set size function\n maxSize = window.innerWidth;\n } else {\n setSizeFunction = setBottomPanelHeight;\n currentSize = panelHeight;\n // don't need the exact max size as it's constrained in the set size function\n maxSize = window.innerHeight;\n }\n\n const primaryGrowKey = position === 'bottom' ? KeyCode.up : KeyCode.left;\n const primaryShrinkKey = position === 'bottom' ? KeyCode.down : KeyCode.right;\n const altGrowKey = position === 'bottom' ? KeyCode.right : KeyCode.down;\n const altShrinkKey = position === 'bottom' ? KeyCode.left : KeyCode.up;\n\n let isEventHandled = true;\n switch (event.keyCode) {\n case primaryGrowKey:\n case altGrowKey:\n setSizeFunction(currentSize + KEYBOARD_SINGLE_STEP_SIZE);\n\n break;\n case primaryShrinkKey:\n case altShrinkKey:\n setSizeFunction(currentSize - KEYBOARD_SINGLE_STEP_SIZE);\n break;\n case KeyCode.pageUp:\n setSizeFunction(currentSize + KEYBOARD_MULTIPLE_STEPS_SIZE);\n break;\n case KeyCode.pageDown:\n setSizeFunction(currentSize - KEYBOARD_MULTIPLE_STEPS_SIZE);\n break;\n case KeyCode.home:\n setSizeFunction(maxSize);\n break;\n case KeyCode.end:\n setSizeFunction(0);\n break;\n default:\n isEventHandled = false;\n }\n\n if (isEventHandled) {\n event.preventDefault();\n event.stopPropagation();\n }\n };\n};\n"]}
@@ -0,0 +1,3 @@
1
+ import { SizeControlProps } from './interfaces';
2
+ export declare const usePointerEvents: ({ position, panelRef, handleRef, setSidePanelWidth, setBottomPanelHeight, hasTransitions, }: SizeControlProps) => () => void;
3
+ //# sourceMappingURL=use-pointer-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-pointer-events.d.ts","sourceRoot":"lib/default/","sources":["app-layout/utils/use-pointer-events.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,eAAO,MAAM,gBAAgB,gGAO1B,gBAAgB,eAoDlB,CAAC"}
@@ -2,32 +2,39 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { useCallback } from 'react';
4
4
  import styles from '../styles.css.js';
5
- export const usePointerEvents = ({ position, splitPanelRef, handleRef, setSidePanelWidth, setBottomPanelHeight, }) => {
5
+ export const usePointerEvents = ({ position, panelRef, handleRef, setSidePanelWidth, setBottomPanelHeight, hasTransitions = false, }) => {
6
6
  const onDocumentPointerMove = useCallback((event) => {
7
- if (!splitPanelRef || !splitPanelRef.current || !handleRef || !handleRef.current) {
7
+ if (!panelRef || !panelRef.current || !handleRef || !handleRef.current) {
8
8
  return;
9
9
  }
10
+ panelRef.current.classList.remove(styles['with-motion']);
10
11
  if (position === 'side') {
11
- const mouseClientX = event.clientX;
12
+ const mouseClientX = event.clientX || 0;
12
13
  // The handle offset aligns the cursor with the middle of the resize handle.
13
14
  const handleOffset = handleRef.current.getBoundingClientRect().width / 2;
14
- const width = splitPanelRef.current.getBoundingClientRect().right - mouseClientX + handleOffset;
15
+ const width = panelRef.current.getBoundingClientRect().right - mouseClientX + handleOffset;
15
16
  setSidePanelWidth(width);
16
17
  }
17
18
  else {
18
- const mouseClientY = event.clientY;
19
+ const mouseClientY = event.clientY || 0;
19
20
  // The handle offset aligns the cursor with the middle of the resize handle.
20
21
  const handleOffset = handleRef.current.getBoundingClientRect().height / 2;
21
- const height = splitPanelRef.current.getBoundingClientRect().bottom - mouseClientY + handleOffset;
22
+ const height = panelRef.current.getBoundingClientRect().bottom - mouseClientY + handleOffset;
22
23
  setBottomPanelHeight(height);
23
24
  }
24
- }, [position, splitPanelRef, handleRef, setSidePanelWidth, setBottomPanelHeight]);
25
+ }, [position, panelRef, handleRef, setSidePanelWidth, setBottomPanelHeight]);
25
26
  const onDocumentPointerUp = useCallback(() => {
27
+ if (!panelRef || !panelRef.current) {
28
+ return;
29
+ }
30
+ if (hasTransitions) {
31
+ panelRef.current.classList.add(styles['with-motion']);
32
+ }
26
33
  document.body.classList.remove(styles['resize-active']);
27
34
  document.body.classList.remove(styles[`resize-${position}`]);
28
35
  document.removeEventListener('pointerup', onDocumentPointerUp);
29
36
  document.removeEventListener('pointermove', onDocumentPointerMove);
30
- }, [onDocumentPointerMove, position]);
37
+ }, [panelRef, onDocumentPointerMove, position, hasTransitions]);
31
38
  const onSliderPointerDown = useCallback(() => {
32
39
  document.body.classList.add(styles['resize-active']);
33
40
  document.body.classList.add(styles[`resize-${position}`]);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-pointer-events.js","sourceRoot":"lib/default/","sources":["app-layout/utils/use-pointer-events.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,MAAM,MAAM,kBAAk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X-License-Identifier: Apache-2.0\nimport { useCallback } from 'react';\nimport styles from '../styles.css.js';\nimport { SizeControlProps } from './interfaces';\n\nexport const usePointerEvents = ({\n position,\n panelRef,\n handleRef,\n setSidePanelWidth,\n setBottomPanelHeight,\n hasTransitions = false,\n}: SizeControlProps) => {\n const onDocumentPointerMove = useCallback(\n (event: PointerEvent) => {\n if (!panelRef || !panelRef.current || !handleRef || !handleRef.current) {\n return;\n }\n\n panelRef.current.classList.remove(styles['with-motion']);\n\n if (position === 'side') {\n const mouseClientX = event.clientX || 0;\n\n // The handle offset aligns the cursor with the middle of the resize handle.\n const handleOffset = handleRef.current.getBoundingClientRect().width / 2;\n const width = panelRef.current.getBoundingClientRect().right - mouseClientX + handleOffset;\n\n setSidePanelWidth(width);\n } else {\n const mouseClientY = event.clientY || 0;\n\n // The handle offset aligns the cursor with the middle of the resize handle.\n const handleOffset = handleRef.current.getBoundingClientRect().height / 2;\n const height = panelRef.current.getBoundingClientRect().bottom - mouseClientY + handleOffset;\n\n setBottomPanelHeight(height);\n }\n },\n [position, panelRef, handleRef, setSidePanelWidth, setBottomPanelHeight]\n );\n\n const onDocumentPointerUp = useCallback(() => {\n if (!panelRef || !panelRef.current) {\n return;\n }\n\n if (hasTransitions) {\n panelRef.current.classList.add(styles['with-motion']);\n }\n document.body.classList.remove(styles['resize-active']);\n document.body.classList.remove(styles[`resize-${position}`]);\n document.removeEventListener('pointerup', onDocumentPointerUp);\n document.removeEventListener('pointermove', onDocumentPointerMove);\n }, [panelRef, onDocumentPointerMove, position, hasTransitions]);\n\n const onSliderPointerDown = useCallback(() => {\n document.body.classList.add(styles['resize-active']);\n document.body.classList.add(styles[`resize-${position}`]);\n document.addEventListener('pointerup', onDocumentPointerUp);\n document.addEventListener('pointermove', onDocumentPointerMove);\n }, [onDocumentPointerMove, onDocumentPointerUp, position]);\n\n return onSliderPointerDown;\n};\n"]}
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { InternalDrawerProps } from '../drawer/interfaces';
3
+ import { DrawerFocusControlRefs } from './use-drawer-focus-control';
4
+ export interface DrawerResizeProps {
5
+ activeDrawerId?: string | null;
6
+ drawers: InternalDrawerProps['drawers'];
7
+ drawersRefs: DrawerFocusControlRefs;
8
+ isToolsOpen: boolean;
9
+ drawersMaxWidth: number;
10
+ }
11
+ declare function useResize(drawerRefObject: React.RefObject<HTMLDivElement>, drawerResizeProps: DrawerResizeProps): {
12
+ resizeHandle: JSX.Element;
13
+ drawerSize: number;
14
+ };
15
+ export default useResize;
16
+ //# sourceMappingURL=use-resize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-resize.d.ts","sourceRoot":"lib/default/","sources":["app-layout/utils/use-resize.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoD,MAAM,OAAO,CAAC;AASzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAK3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAGpE,MAAM,WAAW,iBAAiB;IAChC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,OAAO,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IACxC,WAAW,EAAE,sBAAsB,CAAC;IACpC,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,iBAAS,SAAS,CAAC,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,iBAAiB,EAAE,iBAAiB;;;EAgGxG;AAED,eAAe,SAAS,CAAC"}