@cloudscape-design/components 3.0.1116 → 3.0.1118

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/alert/styles.css.js +27 -27
  2. package/alert/styles.scoped.css +50 -50
  3. package/alert/styles.selectors.js +27 -27
  4. package/annotation-context/annotation/styles.css.js +24 -24
  5. package/annotation-context/annotation/styles.scoped.css +32 -32
  6. package/annotation-context/annotation/styles.selectors.js +24 -24
  7. package/app-layout/notifications/styles.css.js +3 -3
  8. package/app-layout/notifications/styles.scoped.css +7 -7
  9. package/app-layout/notifications/styles.selectors.js +3 -3
  10. package/app-layout/resize/styles.css.js +5 -5
  11. package/app-layout/resize/styles.scoped.css +13 -13
  12. package/app-layout/resize/styles.selectors.js +5 -5
  13. package/app-layout/runtime-drawer/index.d.ts +1 -0
  14. package/app-layout/runtime-drawer/index.d.ts.map +1 -1
  15. package/app-layout/runtime-drawer/index.js.map +1 -1
  16. package/app-layout/utils/use-drawers.d.ts +1 -1
  17. package/app-layout/utils/use-drawers.d.ts.map +1 -1
  18. package/app-layout/utils/use-drawers.js +4 -2
  19. package/app-layout/utils/use-drawers.js.map +1 -1
  20. package/app-layout/visual-refresh/styles.css.js +86 -86
  21. package/app-layout/visual-refresh/styles.scoped.css +258 -258
  22. package/app-layout/visual-refresh/styles.selectors.js +86 -86
  23. package/app-layout/visual-refresh-toolbar/compute-layout.d.ts +1 -1
  24. package/app-layout/visual-refresh-toolbar/compute-layout.d.ts.map +1 -1
  25. package/app-layout/visual-refresh-toolbar/compute-layout.js +2 -2
  26. package/app-layout/visual-refresh-toolbar/compute-layout.js.map +1 -1
  27. package/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.d.ts +18 -0
  28. package/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.d.ts.map +1 -0
  29. package/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.js +183 -0
  30. package/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.js.map +1 -0
  31. package/app-layout/visual-refresh-toolbar/drawer/global-drawers.js +1 -1
  32. package/app-layout/visual-refresh-toolbar/drawer/global-drawers.js.map +1 -1
  33. package/app-layout/visual-refresh-toolbar/drawer/local-drawer.d.ts +3 -1
  34. package/app-layout/visual-refresh-toolbar/drawer/local-drawer.d.ts.map +1 -1
  35. package/app-layout/visual-refresh-toolbar/drawer/local-drawer.js +2 -2
  36. package/app-layout/visual-refresh-toolbar/drawer/local-drawer.js.map +1 -1
  37. package/app-layout/visual-refresh-toolbar/drawer/styles.css.js +27 -26
  38. package/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +110 -76
  39. package/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +27 -26
  40. package/app-layout/visual-refresh-toolbar/drawer/use-resize.d.ts +1 -1
  41. package/app-layout/visual-refresh-toolbar/drawer/use-resize.d.ts.map +1 -1
  42. package/app-layout/visual-refresh-toolbar/drawer/use-resize.js.map +1 -1
  43. package/app-layout/visual-refresh-toolbar/interfaces.d.ts +19 -3
  44. package/app-layout/visual-refresh-toolbar/interfaces.d.ts.map +1 -1
  45. package/app-layout/visual-refresh-toolbar/interfaces.js.map +1 -1
  46. package/app-layout/visual-refresh-toolbar/navigation/index.d.ts +3 -1
  47. package/app-layout/visual-refresh-toolbar/navigation/index.d.ts.map +1 -1
  48. package/app-layout/visual-refresh-toolbar/navigation/index.js +2 -2
  49. package/app-layout/visual-refresh-toolbar/navigation/index.js.map +1 -1
  50. package/app-layout/visual-refresh-toolbar/navigation/styles.css.js +4 -4
  51. package/app-layout/visual-refresh-toolbar/navigation/styles.scoped.css +7 -7
  52. package/app-layout/visual-refresh-toolbar/navigation/styles.selectors.js +4 -4
  53. package/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +27 -25
  54. package/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +68 -52
  55. package/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +27 -25
  56. package/app-layout/visual-refresh-toolbar/split-panel/index.d.ts +3 -1
  57. package/app-layout/visual-refresh-toolbar/split-panel/index.d.ts.map +1 -1
  58. package/app-layout/visual-refresh-toolbar/split-panel/index.js +2 -2
  59. package/app-layout/visual-refresh-toolbar/split-panel/index.js.map +1 -1
  60. package/app-layout/visual-refresh-toolbar/state/interfaces.d.ts +4 -0
  61. package/app-layout/visual-refresh-toolbar/state/interfaces.d.ts.map +1 -1
  62. package/app-layout/visual-refresh-toolbar/state/interfaces.js.map +1 -1
  63. package/app-layout/visual-refresh-toolbar/state/props-merger.d.ts.map +1 -1
  64. package/app-layout/visual-refresh-toolbar/state/props-merger.js +12 -0
  65. package/app-layout/visual-refresh-toolbar/state/props-merger.js.map +1 -1
  66. package/app-layout/visual-refresh-toolbar/state/use-ai-drawer.d.ts.map +1 -1
  67. package/app-layout/visual-refresh-toolbar/state/use-ai-drawer.js +0 -17
  68. package/app-layout/visual-refresh-toolbar/state/use-ai-drawer.js.map +1 -1
  69. package/app-layout/visual-refresh-toolbar/state/use-app-layout.d.ts.map +1 -1
  70. package/app-layout/visual-refresh-toolbar/state/use-app-layout.js +108 -12
  71. package/app-layout/visual-refresh-toolbar/state/use-app-layout.js.map +1 -1
  72. package/app-layout/visual-refresh-toolbar/state/use-bottom-drawers.d.ts +42 -0
  73. package/app-layout/visual-refresh-toolbar/state/use-bottom-drawers.d.ts.map +1 -0
  74. package/app-layout/visual-refresh-toolbar/state/use-bottom-drawers.js +85 -0
  75. package/app-layout/visual-refresh-toolbar/state/use-bottom-drawers.js.map +1 -0
  76. package/app-layout/visual-refresh-toolbar/state/use-skeleton-slots-attributes.d.ts.map +1 -1
  77. package/app-layout/visual-refresh-toolbar/state/use-skeleton-slots-attributes.js +3 -1
  78. package/app-layout/visual-refresh-toolbar/state/use-skeleton-slots-attributes.js.map +1 -1
  79. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.d.ts +12 -3
  80. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.d.ts.map +1 -1
  81. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js +34 -7
  82. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js.map +1 -1
  83. package/app-layout/visual-refresh-toolbar/toolbar/index.d.ts +4 -0
  84. package/app-layout/visual-refresh-toolbar/toolbar/index.d.ts.map +1 -1
  85. package/app-layout/visual-refresh-toolbar/toolbar/index.js +7 -3
  86. package/app-layout/visual-refresh-toolbar/toolbar/index.js.map +1 -1
  87. package/app-layout/visual-refresh-toolbar/widget-areas/after-main-slot.d.ts.map +1 -1
  88. package/app-layout/visual-refresh-toolbar/widget-areas/after-main-slot.js +7 -3
  89. package/app-layout/visual-refresh-toolbar/widget-areas/after-main-slot.js.map +1 -1
  90. package/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.d.ts.map +1 -1
  91. package/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.js +2 -2
  92. package/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.js.map +1 -1
  93. package/app-layout/visual-refresh-toolbar/widget-areas/bottom-content-slot.d.ts.map +1 -1
  94. package/app-layout/visual-refresh-toolbar/widget-areas/bottom-content-slot.js +6 -2
  95. package/app-layout/visual-refresh-toolbar/widget-areas/bottom-content-slot.js.map +1 -1
  96. package/attribute-editor/interfaces.d.ts +2 -0
  97. package/attribute-editor/interfaces.d.ts.map +1 -1
  98. package/attribute-editor/interfaces.js.map +1 -1
  99. package/attribute-editor/row.d.ts.map +1 -1
  100. package/attribute-editor/row.js +2 -2
  101. package/attribute-editor/row.js.map +1 -1
  102. package/attribute-editor/styles.css.js +15 -15
  103. package/attribute-editor/styles.scoped.css +28 -28
  104. package/attribute-editor/styles.selectors.js +15 -15
  105. package/breadcrumb-group/item/styles.css.js +7 -7
  106. package/breadcrumb-group/item/styles.scoped.css +28 -28
  107. package/breadcrumb-group/item/styles.selectors.js +7 -7
  108. package/button/styles.css.js +22 -22
  109. package/button/styles.scoped.css +256 -256
  110. package/button/styles.selectors.js +22 -22
  111. package/button-dropdown/interfaces.d.ts +3 -1
  112. package/button-dropdown/interfaces.d.ts.map +1 -1
  113. package/button-dropdown/interfaces.js.map +1 -1
  114. package/button-dropdown/item-element/index.d.ts.map +1 -1
  115. package/button-dropdown/item-element/index.js +1 -1
  116. package/button-dropdown/item-element/index.js.map +1 -1
  117. package/button-dropdown/item-element/styles.css.js +16 -16
  118. package/button-dropdown/item-element/styles.scoped.css +27 -27
  119. package/button-dropdown/item-element/styles.selectors.js +16 -16
  120. package/checkbox/styles.css.js +3 -3
  121. package/checkbox/styles.scoped.css +11 -11
  122. package/checkbox/styles.selectors.js +3 -3
  123. package/code-editor/index.d.ts.map +1 -1
  124. package/code-editor/index.js +9 -1
  125. package/code-editor/index.js.map +1 -1
  126. package/content-layout/styles.css.js +14 -14
  127. package/content-layout/styles.scoped.css +27 -27
  128. package/content-layout/styles.selectors.js +14 -14
  129. package/flashbar/styles.css.js +50 -50
  130. package/flashbar/styles.scoped.css +187 -187
  131. package/flashbar/styles.selectors.js +50 -50
  132. package/help-panel/styles.css.js +6 -6
  133. package/help-panel/styles.scoped.css +73 -73
  134. package/help-panel/styles.selectors.js +6 -6
  135. package/internal/base-component/styles.scoped.css +1 -1
  136. package/internal/components/autosuggest-input/index.d.ts.map +1 -1
  137. package/internal/components/autosuggest-input/index.js +30 -7
  138. package/internal/components/autosuggest-input/index.js.map +1 -1
  139. package/internal/components/drag-handle-wrapper/styles.css.js +20 -20
  140. package/internal/components/drag-handle-wrapper/styles.scoped.css +48 -48
  141. package/internal/components/drag-handle-wrapper/styles.selectors.js +20 -20
  142. package/internal/components/dropdown/styles.css.js +20 -20
  143. package/internal/components/dropdown/styles.scoped.css +38 -38
  144. package/internal/components/dropdown/styles.selectors.js +20 -20
  145. package/internal/components/selectable-item/styles.css.js +22 -22
  146. package/internal/components/selectable-item/styles.scoped.css +74 -42
  147. package/internal/components/selectable-item/styles.selectors.js +22 -22
  148. package/internal/components/token-list/styles.css.js +10 -10
  149. package/internal/components/token-list/styles.scoped.css +25 -25
  150. package/internal/components/token-list/styles.selectors.js +10 -10
  151. package/internal/environment.js +2 -2
  152. package/internal/environment.json +2 -2
  153. package/internal/generated/custom-css-properties/index.d.ts +1 -0
  154. package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
  155. package/internal/generated/custom-css-properties/index.js +86 -85
  156. package/internal/generated/custom-css-properties/index.js.map +1 -1
  157. package/internal/hooks/use-base-component/styles-check.d.ts.map +1 -1
  158. package/internal/hooks/use-base-component/styles-check.js +4 -0
  159. package/internal/hooks/use-base-component/styles-check.js.map +1 -1
  160. package/internal/manifest.json +1 -1
  161. package/internal/plugins/controllers/action-buttons.d.ts +1 -0
  162. package/internal/plugins/controllers/action-buttons.d.ts.map +1 -1
  163. package/internal/plugins/controllers/action-buttons.js.map +1 -1
  164. package/internal/plugins/controllers/drawers.d.ts +1 -1
  165. package/internal/plugins/controllers/drawers.d.ts.map +1 -1
  166. package/internal/plugins/controllers/drawers.js.map +1 -1
  167. package/internal/plugins/helpers/use-discovered-action.d.ts.map +1 -1
  168. package/internal/plugins/helpers/use-discovered-action.js +16 -11
  169. package/internal/plugins/helpers/use-discovered-action.js.map +1 -1
  170. package/internal/plugins/widget/index.d.ts +6 -1
  171. package/internal/plugins/widget/index.d.ts.map +1 -1
  172. package/internal/plugins/widget/index.js +11 -1
  173. package/internal/plugins/widget/index.js.map +1 -1
  174. package/internal/plugins/widget/interfaces.d.ts +2 -1
  175. package/internal/plugins/widget/interfaces.d.ts.map +1 -1
  176. package/internal/plugins/widget/interfaces.js.map +1 -1
  177. package/internal/plugins/widget.d.ts +1 -1
  178. package/internal/plugins/widget.d.ts.map +1 -1
  179. package/internal/plugins/widget.js +1 -1
  180. package/internal/plugins/widget.js.map +1 -1
  181. package/link/styles.css.js +20 -20
  182. package/link/styles.scoped.css +103 -103
  183. package/link/styles.selectors.js +20 -20
  184. package/package.json +1 -1
  185. package/radio-group/styles.css.js +10 -10
  186. package/radio-group/styles.scoped.css +22 -22
  187. package/radio-group/styles.selectors.js +10 -10
  188. package/select/parts/virtual-list.d.ts.map +1 -1
  189. package/select/parts/virtual-list.js +4 -1
  190. package/select/parts/virtual-list.js.map +1 -1
  191. package/select/utils/render-options.d.ts.map +1 -1
  192. package/select/utils/render-options.js +4 -1
  193. package/select/utils/render-options.js.map +1 -1
  194. package/slider/styles.css.js +26 -26
  195. package/slider/styles.scoped.css +86 -86
  196. package/slider/styles.selectors.js +26 -26
  197. package/spinner/styles.css.js +13 -13
  198. package/spinner/styles.scoped.css +39 -39
  199. package/spinner/styles.selectors.js +13 -13
  200. package/table/internal.js +1 -1
  201. package/table/internal.js.map +1 -1
  202. package/tag-editor/styles.css.js +3 -3
  203. package/tag-editor/styles.scoped.css +13 -13
  204. package/tag-editor/styles.selectors.js +3 -3
  205. package/text-content/styles.css.js +1 -1
  206. package/text-content/styles.scoped.css +66 -66
  207. package/text-content/styles.selectors.js +1 -1
  208. package/toggle/styles.css.js +10 -10
  209. package/toggle/styles.scoped.css +23 -23
  210. package/toggle/styles.selectors.js +10 -10
  211. package/top-navigation/interfaces.d.ts +1 -1
  212. package/top-navigation/interfaces.js.map +1 -1
  213. package/top-navigation/internal.d.ts.map +1 -1
  214. package/top-navigation/internal.js +0 -9
  215. package/top-navigation/internal.js.map +1 -1
  216. package/top-navigation/parts/utility.d.ts.map +1 -1
  217. package/top-navigation/parts/utility.js +1 -15
  218. package/top-navigation/parts/utility.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"drawer-triggers.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,OAAO,EAAE,SAAS,EAAE,MAAM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AqB,EAAE,IAAI,EAAE,CAAC,CAAC;qBACpE;yBAAM;wBACL,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAG,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC,CAAC;qBAC1E;gBACH,CAAC,EACD,uBAAuB,EAAE,uBAAuB,GAAG,mBAAmB,GACtE,CACH,CACG,CACA,CACT,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\n\nimport { useMobile } from '../../../internal/hooks/use-mobile';\nimport { splitItems } from '../../drawer/drawers-helpers';\nimport OverflowMenu from '../../drawer/overflow-menu';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from '../../interfaces';\nimport { OnChangeParams, TOOLS_DRAWER_ID } from '../../utils/use-drawers';\nimport { Focusable, FocusControlMultipleStates } from '../../utils/use-focus-control';\nimport TriggerButton from './trigger-button';\n\nimport splitPanelTestUtilStyles from '../../../split-panel/test-classes/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\nexport interface SplitPanelToggleProps {\n displayed: boolean | undefined;\n ariaLabel: string | undefined;\n controlId: string | undefined;\n active: boolean | undefined;\n position: AppLayoutProps.SplitPanelPosition;\n}\n\ninterface DrawerTriggersProps {\n ariaLabels: AppLayoutPropsWithDefaults['ariaLabels'];\n\n activeDrawerId: string | null;\n drawersFocusRef: React.Ref<Focusable> | undefined;\n drawers: ReadonlyArray<AppLayoutProps.Drawer>;\n onActiveDrawerChange: ((drawerId: string | null, params: OnChangeParams) => void) | undefined;\n\n activeGlobalDrawersIds: ReadonlyArray<string>;\n globalDrawersFocusControl?: FocusControlMultipleStates;\n globalDrawers: ReadonlyArray<AppLayoutProps.Drawer>;\n onActiveGlobalDrawersChange?: (newDrawerId: string, params: OnChangeParams) => void;\n expandedDrawerId?: string | null;\n setExpandedDrawerId: (value: string | null) => void;\n\n splitPanelOpen?: boolean;\n splitPanelPosition?: AppLayoutProps.SplitPanelPreferences['position'];\n splitPanelToggleProps: SplitPanelToggleProps | undefined;\n splitPanelFocusRef: React.Ref<Focusable> | undefined;\n onSplitPanelToggle: (() => void) | undefined;\n disabled: boolean;\n}\n\nexport function DrawerTriggers({\n ariaLabels,\n activeDrawerId,\n drawers,\n drawersFocusRef,\n onActiveDrawerChange,\n splitPanelOpen,\n splitPanelPosition = 'bottom',\n splitPanelFocusRef,\n splitPanelToggleProps,\n onSplitPanelToggle,\n disabled,\n activeGlobalDrawersIds,\n globalDrawers,\n globalDrawersFocusControl,\n onActiveGlobalDrawersChange,\n expandedDrawerId,\n setExpandedDrawerId,\n}: DrawerTriggersProps) {\n const isMobile = useMobile();\n const hasMultipleTriggers = drawers.length > 1;\n const previousActiveLocalDrawerId = useRef(activeDrawerId);\n const previousActiveGlobalDrawersIds = useRef(activeGlobalDrawersIds);\n const [containerWidth, triggersContainerRef] = useContainerQuery(rect => rect.contentBoxWidth);\n if (!drawers.length && !globalDrawers.length && !splitPanelToggleProps) {\n return null;\n }\n\n if (activeDrawerId) {\n previousActiveLocalDrawerId.current = activeDrawerId;\n }\n\n if (activeGlobalDrawersIds.length) {\n previousActiveGlobalDrawersIds.current = activeGlobalDrawersIds;\n }\n\n const getIndexOfOverflowItem = () => {\n if (isMobile) {\n return 2;\n }\n if (containerWidth) {\n const ITEM_WIDTH = 50; // Roughly 34px + padding = 42px but added extra for safety\n const overflowSpot = containerWidth;\n\n const index = Math.floor(overflowSpot / ITEM_WIDTH);\n\n let splitPanelItem = 0;\n if (splitPanelToggleProps) {\n splitPanelItem = 1;\n }\n return index - splitPanelItem;\n }\n return 0;\n };\n\n const indexOfOverflowItem = getIndexOfOverflowItem();\n\n const { visibleItems, overflowItems } = splitItems(\n [...drawers, ...globalDrawers],\n indexOfOverflowItem,\n activeDrawerId ?? null\n );\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n const toolsOnlyMode = drawers.length === 1 && drawers[0].id === TOOLS_DRAWER_ID;\n const globalDrawersStartIndex = drawers.length;\n const hasOpenDrawer = !!activeDrawerId || (splitPanelPosition === 'side' && splitPanelOpen);\n const splitPanelResolvedPosition = splitPanelToggleProps?.position;\n\n const exitExpandedMode = () => {\n if (setExpandedDrawerId) {\n setExpandedDrawerId(null);\n }\n };\n\n return (\n <aside\n className={styles[`drawers-${isMobile ? 'mobile' : 'desktop'}-triggers-container`]}\n aria-label={ariaLabels?.drawers}\n ref={triggersContainerRef}\n role=\"region\"\n >\n <div\n className={styles['drawers-trigger-content']}\n aria-label={ariaLabels?.drawers}\n role=\"toolbar\"\n aria-orientation=\"horizontal\"\n >\n {splitPanelToggleProps && (\n <>\n <TriggerButton\n ariaLabel={splitPanelToggleProps.ariaLabel}\n ariaControls={splitPanelToggleProps.controlId}\n ariaExpanded={!expandedDrawerId && splitPanelToggleProps.active}\n className={clsx(\n styles['drawers-trigger'],\n testutilStyles['drawers-trigger'],\n splitPanelTestUtilStyles['open-button']\n )}\n iconName={splitPanelResolvedPosition === 'side' ? 'view-vertical' : 'view-horizontal'}\n onClick={() => {\n exitExpandedMode();\n if (!!expandedDrawerId && splitPanelToggleProps.active) {\n return;\n }\n onSplitPanelToggle?.();\n }}\n selected={!expandedDrawerId && splitPanelToggleProps.active}\n ref={splitPanelResolvedPosition === 'side' ? splitPanelFocusRef : undefined}\n hasTooltip={true}\n isMobile={isMobile}\n isForSplitPanel={true}\n disabled={disabled}\n />\n {hasMultipleTriggers ? <div className={styles['group-divider']}></div> : null}\n </>\n )}\n {visibleItems.slice(0, globalDrawersStartIndex).map(item => {\n const isForPreviousActiveDrawer = previousActiveLocalDrawerId?.current === item.id;\n const selected = !expandedDrawerId && item.id === activeDrawerId;\n return (\n <TriggerButton\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaExpanded={selected}\n ariaControls={activeDrawerId === item.id ? item.id : undefined}\n className={clsx(\n styles['drawers-trigger'],\n !toolsOnlyMode && testutilStyles['drawers-trigger'],\n item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']\n )}\n iconName={item.trigger!.iconName}\n iconSvg={item.trigger!.iconSvg}\n key={item.id}\n onClick={() => {\n exitExpandedMode();\n if (!!expandedDrawerId && activeDrawerId === item.id) {\n return;\n }\n onActiveDrawerChange?.(activeDrawerId !== item.id ? item.id : null, { initiatedByUserAction: true });\n }}\n ref={item.id === previousActiveLocalDrawerId.current ? drawersFocusRef : undefined}\n selected={selected}\n badge={item.badge}\n testId={`awsui-app-layout-trigger-${item.id}`}\n hasTooltip={true}\n hasOpenDrawer={hasOpenDrawer}\n tooltipText={item.ariaLabels?.drawerName}\n isForPreviousActiveDrawer={isForPreviousActiveDrawer}\n isMobile={isMobile}\n disabled={disabled}\n />\n );\n })}\n {globalDrawersStartIndex > 0 && visibleItems.length > globalDrawersStartIndex && (\n <div className={styles['group-divider']}></div>\n )}\n {visibleItems.slice(globalDrawersStartIndex).map(item => {\n const isForPreviousActiveDrawer = previousActiveGlobalDrawersIds?.current.includes(item.id);\n const selected =\n activeGlobalDrawersIds.includes(item.id) && (!expandedDrawerId || item.id === expandedDrawerId);\n return (\n <TriggerButton\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaExpanded={selected}\n ariaControls={selected ? item.id : undefined}\n className={clsx(\n styles['drawers-trigger'],\n testutilStyles['drawers-trigger'],\n testutilStyles['drawers-trigger-global']\n )}\n iconName={item.trigger!.iconName}\n iconSvg={item.trigger!.iconSvg}\n key={item.id}\n onClick={() => {\n exitExpandedMode();\n if (!!expandedDrawerId && item.id !== expandedDrawerId && activeGlobalDrawersIds.includes(item.id)) {\n return;\n }\n onActiveGlobalDrawersChange?.(item.id, { initiatedByUserAction: true });\n }}\n ref={globalDrawersFocusControl?.refs[item.id]?.toggle}\n selected={selected}\n badge={item.badge}\n testId={`awsui-app-layout-trigger-${item.id}`}\n hasTooltip={true}\n hasOpenDrawer={hasOpenDrawer}\n tooltipText={item.ariaLabels?.drawerName}\n isForPreviousActiveDrawer={isForPreviousActiveDrawer}\n isMobile={isMobile}\n disabled={disabled}\n />\n );\n })}\n {overflowItems.length > 0 && (\n <OverflowMenu\n items={overflowItems.map(item => ({\n ...item,\n active: activeGlobalDrawersIds.includes(item.id) && (!expandedDrawerId || item.id === expandedDrawerId),\n }))}\n ariaLabel={overflowMenuHasBadge ? ariaLabels?.drawersOverflowWithBadge : ariaLabels?.drawersOverflow}\n customTriggerBuilder={({ onClick, triggerRef, ariaLabel, ariaExpanded, testUtilsClass }) => {\n return (\n <TriggerButton\n ref={triggerRef}\n ariaLabel={ariaLabel}\n ariaExpanded={ariaExpanded}\n badge={overflowMenuHasBadge}\n className={clsx(\n styles['drawers-trigger'],\n testutilStyles['drawers-trigger'],\n testutilStyles['drawers-trigger-global'],\n testUtilsClass\n )}\n iconName=\"ellipsis\"\n onClick={onClick}\n disabled={disabled}\n />\n );\n }}\n onItemClick={event => {\n const id = event.detail.id;\n exitExpandedMode();\n if (globalDrawers.find(drawer => drawer.id === id)) {\n if (!!expandedDrawerId && id !== expandedDrawerId && activeGlobalDrawersIds.includes(id)) {\n return;\n }\n onActiveGlobalDrawersChange?.(id, { initiatedByUserAction: true });\n } else {\n onActiveDrawerChange?.(event.detail.id, { initiatedByUserAction: true });\n }\n }}\n globalDrawersStartIndex={globalDrawersStartIndex - indexOfOverflowItem}\n />\n )}\n </div>\n </aside>\n );\n}\n"]}
1
+ {"version":3,"file":"drawer-triggers.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCA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gB,IAAI,IAAI,CAAC,EAAE,KAAK,gBAAgB,CAAC,CAAC;wBAChG,gCAAgC,aAAhC,gCAAgC,uBAAhC,gCAAgC,CAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC,CAAC;wBAC/F,OAAO;qBACR;oBACD,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;wBAClD,IAAI,CAAC,CAAC,gBAAgB,IAAI,EAAE,KAAK,gBAAgB,IAAI,sBAAsB,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE;4BACxF,OAAO;yBACR;wBACD,2BAA2B,aAA3B,2BAA2B,uBAA3B,2BAA2B,CAAG,EAAE,EAAE,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC,CAAC;qBACpE;yBAAM;wBACL,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAG,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC,CAAC;qBAC1E;gBACH,CAAC,EACD,uBAAuB,EAAE,uBAAuB,GAAG,mBAAmB,GACtE,CACH,CACG,CACA,CACT,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\n\nimport { useMobile } from '../../../internal/hooks/use-mobile';\nimport { splitItems } from '../../drawer/drawers-helpers';\nimport OverflowMenu from '../../drawer/overflow-menu';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from '../../interfaces';\nimport { OnChangeParams, TOOLS_DRAWER_ID } from '../../utils/use-drawers';\nimport { Focusable, FocusControlMultipleStates } from '../../utils/use-focus-control';\nimport { InternalDrawer } from '../interfaces';\nimport TriggerButton from './trigger-button';\n\nimport splitPanelTestUtilStyles from '../../../split-panel/test-classes/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\nexport interface SplitPanelToggleProps {\n displayed: boolean | undefined;\n ariaLabel: string | undefined;\n controlId: string | undefined;\n active: boolean | undefined;\n position: AppLayoutProps.SplitPanelPosition;\n}\ninterface DrawerTriggersProps {\n ariaLabels: AppLayoutPropsWithDefaults['ariaLabels'];\n\n activeDrawerId: string | null;\n drawersFocusRef: React.Ref<Focusable> | undefined;\n drawers: ReadonlyArray<InternalDrawer>;\n onActiveDrawerChange: ((drawerId: string | null, params: OnChangeParams) => void) | undefined;\n\n activeGlobalDrawersIds: ReadonlyArray<string>;\n globalDrawersFocusControl?: FocusControlMultipleStates;\n bottomDrawers?: ReadonlyArray<InternalDrawer>;\n bottomDrawersFocusRef?: React.Ref<Focusable> | undefined;\n globalDrawers: ReadonlyArray<InternalDrawer>;\n onActiveGlobalDrawersChange?: (newDrawerId: string, params: OnChangeParams) => void;\n expandedDrawerId?: string | null;\n setExpandedDrawerId: (value: string | null) => void;\n activeGlobalBottomDrawerId?: string | null;\n onActiveGlobalBottomDrawerChange?: (value: string | null, params: OnChangeParams) => void;\n\n splitPanelOpen?: boolean;\n splitPanelPosition?: AppLayoutProps.SplitPanelPreferences['position'];\n splitPanelToggleProps: SplitPanelToggleProps | undefined;\n splitPanelFocusRef: React.Ref<Focusable> | undefined;\n onSplitPanelToggle: (() => void) | undefined;\n disabled: boolean;\n}\n\nexport function DrawerTriggers({\n ariaLabels,\n activeDrawerId,\n drawers,\n drawersFocusRef,\n onActiveDrawerChange,\n splitPanelOpen,\n splitPanelPosition = 'bottom',\n splitPanelFocusRef,\n splitPanelToggleProps,\n onSplitPanelToggle,\n disabled,\n activeGlobalDrawersIds,\n globalDrawers,\n globalDrawersFocusControl,\n onActiveGlobalDrawersChange,\n expandedDrawerId,\n setExpandedDrawerId,\n activeGlobalBottomDrawerId,\n onActiveGlobalBottomDrawerChange,\n bottomDrawersFocusRef,\n bottomDrawers,\n}: DrawerTriggersProps) {\n const isMobile = useMobile();\n const hasMultipleTriggers = drawers.length > 1;\n const previousActiveLocalDrawerId = useRef(activeDrawerId);\n const previousActiveGlobalBottomDrawerId = useRef(activeGlobalBottomDrawerId);\n const previousActiveGlobalDrawersIds = useRef(activeGlobalDrawersIds);\n const [containerWidth, triggersContainerRef] = useContainerQuery(rect => rect.contentBoxWidth);\n if (!drawers.length && !globalDrawers.length && !bottomDrawers?.length && !splitPanelToggleProps) {\n return null;\n }\n\n if (activeDrawerId) {\n previousActiveLocalDrawerId.current = activeDrawerId;\n }\n\n if (activeGlobalDrawersIds.length) {\n previousActiveGlobalDrawersIds.current = activeGlobalDrawersIds;\n }\n\n if (activeGlobalBottomDrawerId) {\n previousActiveGlobalBottomDrawerId.current = activeGlobalBottomDrawerId;\n }\n\n const getIndexOfOverflowItem = () => {\n if (isMobile) {\n return 2;\n }\n if (containerWidth) {\n const ITEM_WIDTH = 50; // Roughly 34px + padding = 42px but added extra for safety\n const overflowSpot = containerWidth;\n\n const index = Math.floor(overflowSpot / ITEM_WIDTH);\n\n let splitPanelItem = 0;\n if (splitPanelToggleProps) {\n splitPanelItem = 1;\n }\n return index - splitPanelItem;\n }\n return 0;\n };\n\n const indexOfOverflowItem = getIndexOfOverflowItem();\n\n const { visibleItems, overflowItems } = splitItems(\n [...drawers, ...globalDrawers, ...(bottomDrawers || [])],\n indexOfOverflowItem,\n activeDrawerId ?? null\n );\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n const toolsOnlyMode = drawers.length === 1 && drawers[0].id === TOOLS_DRAWER_ID;\n const globalDrawersStartIndex = drawers.length;\n const hasOpenDrawer = !!activeDrawerId || (splitPanelPosition === 'side' && splitPanelOpen);\n const splitPanelResolvedPosition = splitPanelToggleProps?.position;\n\n const exitExpandedMode = () => {\n if (setExpandedDrawerId) {\n setExpandedDrawerId(null);\n }\n };\n\n return (\n <aside\n className={styles[`drawers-${isMobile ? 'mobile' : 'desktop'}-triggers-container`]}\n aria-label={ariaLabels?.drawers}\n ref={triggersContainerRef}\n role=\"region\"\n >\n <div\n className={styles['drawers-trigger-content']}\n aria-label={ariaLabels?.drawers}\n role=\"toolbar\"\n aria-orientation=\"horizontal\"\n >\n {splitPanelToggleProps && (\n <>\n <TriggerButton\n ariaLabel={splitPanelToggleProps.ariaLabel}\n ariaControls={splitPanelToggleProps.controlId}\n ariaExpanded={!expandedDrawerId && splitPanelToggleProps.active}\n className={clsx(\n styles['drawers-trigger'],\n testutilStyles['drawers-trigger'],\n splitPanelTestUtilStyles['open-button']\n )}\n iconName={splitPanelResolvedPosition === 'side' ? 'view-vertical' : 'view-horizontal'}\n onClick={() => {\n exitExpandedMode();\n if (!!expandedDrawerId && splitPanelToggleProps.active) {\n return;\n }\n onSplitPanelToggle?.();\n }}\n selected={!expandedDrawerId && splitPanelToggleProps.active}\n ref={splitPanelResolvedPosition === 'side' ? splitPanelFocusRef : undefined}\n hasTooltip={true}\n isMobile={isMobile}\n isForSplitPanel={true}\n disabled={disabled}\n />\n {hasMultipleTriggers ? <div className={styles['group-divider']}></div> : null}\n </>\n )}\n {visibleItems.slice(0, globalDrawersStartIndex).map(item => {\n const isForPreviousActiveDrawer = previousActiveLocalDrawerId?.current === item.id;\n const selected = !expandedDrawerId && item.id === activeDrawerId;\n return (\n <TriggerButton\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaExpanded={selected}\n ariaControls={activeDrawerId === item.id ? item.id : undefined}\n className={clsx(\n styles['drawers-trigger'],\n !toolsOnlyMode && testutilStyles['drawers-trigger'],\n item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']\n )}\n iconName={item.trigger!.iconName}\n iconSvg={item.trigger!.iconSvg}\n key={item.id}\n onClick={() => {\n exitExpandedMode();\n if (!!expandedDrawerId && activeDrawerId === item.id) {\n return;\n }\n onActiveDrawerChange?.(activeDrawerId !== item.id ? item.id : null, { initiatedByUserAction: true });\n }}\n ref={item.id === previousActiveLocalDrawerId.current ? drawersFocusRef : undefined}\n selected={selected}\n badge={item.badge}\n testId={`awsui-app-layout-trigger-${item.id}`}\n hasTooltip={true}\n hasOpenDrawer={hasOpenDrawer}\n tooltipText={item.ariaLabels?.drawerName}\n isForPreviousActiveDrawer={isForPreviousActiveDrawer}\n isMobile={isMobile}\n disabled={disabled}\n />\n );\n })}\n {globalDrawersStartIndex > 0 && visibleItems.length > globalDrawersStartIndex && (\n <div className={styles['group-divider']}></div>\n )}\n {visibleItems.slice(globalDrawersStartIndex).map(item => {\n let isForPreviousActiveDrawer = previousActiveGlobalDrawersIds?.current.includes(item.id);\n const isBottom = item.position === 'bottom';\n let selected =\n activeGlobalDrawersIds.includes(item.id) && (!expandedDrawerId || item.id === expandedDrawerId);\n if (isBottom) {\n selected = item.id === activeGlobalBottomDrawerId && (!expandedDrawerId || item.id === expandedDrawerId);\n isForPreviousActiveDrawer = previousActiveGlobalBottomDrawerId.current === item.id;\n }\n\n return (\n <TriggerButton\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaExpanded={selected}\n ariaControls={selected ? item.id : undefined}\n className={clsx(\n styles['drawers-trigger'],\n testutilStyles['drawers-trigger'],\n testutilStyles['drawers-trigger-global']\n )}\n iconName={item.trigger!.iconName}\n iconSvg={item.trigger!.iconSvg}\n key={item.id}\n onClick={() => {\n exitExpandedMode();\n if (!!expandedDrawerId && item.id !== expandedDrawerId && activeGlobalDrawersIds.includes(item.id)) {\n return;\n }\n if (isBottom) {\n onActiveGlobalBottomDrawerChange?.(selected ? null : item.id, { initiatedByUserAction: true });\n return;\n }\n onActiveGlobalDrawersChange?.(item.id, { initiatedByUserAction: true });\n }}\n ref={isBottom ? bottomDrawersFocusRef : globalDrawersFocusControl?.refs[item.id]?.toggle}\n selected={selected}\n badge={item.badge}\n testId={`awsui-app-layout-trigger-${item.id}`}\n hasTooltip={true}\n hasOpenDrawer={hasOpenDrawer}\n tooltipText={item.ariaLabels?.drawerName}\n isForPreviousActiveDrawer={isForPreviousActiveDrawer}\n isMobile={isMobile}\n disabled={disabled}\n />\n );\n })}\n {overflowItems.length > 0 && (\n <OverflowMenu\n items={overflowItems.map(item => {\n const isBottom = item?.position === 'bottom';\n let active =\n activeGlobalDrawersIds.includes(item.id) && (!expandedDrawerId || item.id === expandedDrawerId);\n if (isBottom) {\n active = item.id === activeGlobalBottomDrawerId && (!expandedDrawerId || item.id === expandedDrawerId);\n }\n return {\n ...item,\n active,\n };\n })}\n ariaLabel={overflowMenuHasBadge ? ariaLabels?.drawersOverflowWithBadge : ariaLabels?.drawersOverflow}\n customTriggerBuilder={({ onClick, triggerRef, ariaLabel, ariaExpanded, testUtilsClass }) => {\n return (\n <TriggerButton\n ref={triggerRef}\n ariaLabel={ariaLabel}\n ariaExpanded={ariaExpanded}\n badge={overflowMenuHasBadge}\n className={clsx(\n styles['drawers-trigger'],\n testutilStyles['drawers-trigger'],\n testutilStyles['drawers-trigger-global'],\n testUtilsClass\n )}\n iconName=\"ellipsis\"\n onClick={onClick}\n disabled={disabled}\n />\n );\n }}\n onItemClick={event => {\n const id = event.detail.id;\n exitExpandedMode();\n const item = overflowItems.find(item => item.id === id);\n const isBottom = item?.position === 'bottom';\n if (isBottom) {\n const selected =\n item.id === activeGlobalBottomDrawerId && (!expandedDrawerId || item.id === expandedDrawerId);\n onActiveGlobalBottomDrawerChange?.(selected ? null : item.id, { initiatedByUserAction: true });\n return;\n }\n if (globalDrawers.find(drawer => drawer.id === id)) {\n if (!!expandedDrawerId && id !== expandedDrawerId && activeGlobalDrawersIds.includes(id)) {\n return;\n }\n onActiveGlobalDrawersChange?.(id, { initiatedByUserAction: true });\n } else {\n onActiveDrawerChange?.(event.detail.id, { initiatedByUserAction: true });\n }\n }}\n globalDrawersStartIndex={globalDrawersStartIndex - indexOfOverflowItem}\n />\n )}\n </div>\n </aside>\n );\n}\n"]}
@@ -19,11 +19,15 @@ export interface ToolbarProps {
19
19
  activeDrawerId?: string | null;
20
20
  drawers?: ReadonlyArray<AppLayoutProps.Drawer>;
21
21
  drawersFocusRef?: React.Ref<Focusable>;
22
+ bottomDrawersFocusRef?: React.Ref<Focusable>;
22
23
  globalDrawersFocusControl?: FocusControlMultipleStates;
23
24
  onActiveDrawerChange?: (drawerId: string | null, params: OnChangeParams) => void;
24
25
  globalDrawers?: ReadonlyArray<AppLayoutProps.Drawer> | undefined;
25
26
  activeGlobalDrawersIds?: ReadonlyArray<string>;
26
27
  onActiveGlobalDrawersChange?: ((drawerId: string, params: OnChangeParams) => void) | undefined;
28
+ bottomDrawers?: ReadonlyArray<AppLayoutProps.Drawer> | undefined;
29
+ activeGlobalBottomDrawerId?: string | null;
30
+ onActiveGlobalBottomDrawerChange?: (value: string | null, params: OnChangeParams) => void;
27
31
  expandedDrawerId?: string | null;
28
32
  setExpandedDrawerId?: (value: string | null) => void;
29
33
  aiDrawer?: AppLayoutProps.Drawer;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/toolbar/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAMjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAkB,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAO1E,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC;IAEnC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kBAAkB,CAAC,EAA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,EAAE,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,mCAAmC;IAClD,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,wBAAgB,8BAA8B,CAAC,EAC7C,kBAAkB,EAGlB,YAAiB,GAClB,EAAE,mCAAmC,eA6LrC"}
@@ -16,7 +16,7 @@ export function AppLayoutToolbarImplementation({ appLayoutInternals,
16
16
  toolbarProps = {}, }) {
17
17
  var _a, _b, _c;
18
18
  const { breadcrumbs, discoveredBreadcrumbs, verticalOffsets, isMobile, setToolbarHeight, aiDrawer, activeAiDrawer, onActiveAiDrawerChange, } = appLayoutInternals;
19
- const { ariaLabels, activeDrawerId, drawers, drawersFocusRef, onActiveDrawerChange, globalDrawersFocusControl, globalDrawers, activeGlobalDrawersIds, onActiveGlobalDrawersChange, hasNavigation, navigationOpen, navigationFocusRef, onNavigationToggle, hasSplitPanel, splitPanelFocusRef, splitPanelToggleProps, onSplitPanelToggle, expandedDrawerId, setExpandedDrawerId, aiDrawerFocusRef, } = toolbarProps;
19
+ const { ariaLabels, activeDrawerId, drawers, drawersFocusRef, onActiveDrawerChange, globalDrawersFocusControl, globalDrawers, activeGlobalDrawersIds, onActiveGlobalDrawersChange, hasNavigation, navigationOpen, navigationFocusRef, onNavigationToggle, hasSplitPanel, splitPanelFocusRef, splitPanelToggleProps, onSplitPanelToggle, expandedDrawerId, setExpandedDrawerId, aiDrawerFocusRef, onActiveGlobalBottomDrawerChange, activeGlobalBottomDrawerId, bottomDrawersFocusRef, bottomDrawers, } = toolbarProps;
20
20
  const drawerExpandedMode = !!expandedDrawerId;
21
21
  const ref = useRef(null);
22
22
  const aiDrawerTransitionRef = useRef(null);
@@ -33,6 +33,7 @@ toolbarProps = {}, }) {
33
33
  (!!activeDrawerId ||
34
34
  !!(activeGlobalDrawersIds === null || activeGlobalDrawersIds === void 0 ? void 0 : activeGlobalDrawersIds.length) ||
35
35
  !!activeAiDrawerId ||
36
+ !!activeGlobalBottomDrawerId ||
36
37
  (!!navigationOpen && !!hasNavigation));
37
38
  useEffect(() => {
38
39
  if (anyPanelOpenInMobile) {
@@ -81,7 +82,10 @@ toolbarProps = {}, }) {
81
82
  }, ref: navigationFocusRef, selected: !drawerExpandedMode && navigationOpen, disabled: anyPanelOpenInMobile }))),
82
83
  (breadcrumbs || discoveredBreadcrumbs) && (React.createElement("div", { className: clsx(styles['universal-toolbar-breadcrumbs'], testutilStyles.breadcrumbs) },
83
84
  React.createElement(BreadcrumbsSlot, { ownBreadcrumbs: appLayoutInternals.breadcrumbs, discoveredBreadcrumbs: appLayoutInternals.discoveredBreadcrumbs }))),
84
- ((drawers === null || drawers === void 0 ? void 0 : drawers.length) || (globalDrawers === null || globalDrawers === void 0 ? void 0 : globalDrawers.length) || (hasSplitPanel && (splitPanelToggleProps === null || splitPanelToggleProps === void 0 ? void 0 : splitPanelToggleProps.displayed))) && (React.createElement("div", { className: clsx(styles['universal-toolbar-drawers']) },
85
- React.createElement(DrawerTriggers, { ariaLabels: ariaLabels, activeDrawerId: activeDrawerId !== null && activeDrawerId !== void 0 ? activeDrawerId : null, drawers: (_b = drawers === null || drawers === void 0 ? void 0 : drawers.filter(item => !!item.trigger)) !== null && _b !== void 0 ? _b : [], drawersFocusRef: drawersFocusRef, onActiveDrawerChange: onActiveDrawerChange, splitPanelToggleProps: (splitPanelToggleProps === null || splitPanelToggleProps === void 0 ? void 0 : splitPanelToggleProps.displayed) ? splitPanelToggleProps : undefined, splitPanelFocusRef: splitPanelFocusRef, onSplitPanelToggle: onSplitPanelToggle, disabled: anyPanelOpenInMobile, globalDrawersFocusControl: globalDrawersFocusControl, globalDrawers: (_c = globalDrawers === null || globalDrawers === void 0 ? void 0 : globalDrawers.filter(item => !!item.trigger)) !== null && _c !== void 0 ? _c : [], activeGlobalDrawersIds: activeGlobalDrawersIds !== null && activeGlobalDrawersIds !== void 0 ? activeGlobalDrawersIds : [], onActiveGlobalDrawersChange: onActiveGlobalDrawersChange, expandedDrawerId: expandedDrawerId, setExpandedDrawerId: setExpandedDrawerId }))))));
85
+ ((drawers === null || drawers === void 0 ? void 0 : drawers.length) ||
86
+ (globalDrawers === null || globalDrawers === void 0 ? void 0 : globalDrawers.length) ||
87
+ (bottomDrawers === null || bottomDrawers === void 0 ? void 0 : bottomDrawers.length) ||
88
+ (hasSplitPanel && (splitPanelToggleProps === null || splitPanelToggleProps === void 0 ? void 0 : splitPanelToggleProps.displayed))) && (React.createElement("div", { className: clsx(styles['universal-toolbar-drawers']) },
89
+ React.createElement(DrawerTriggers, { ariaLabels: ariaLabels, activeDrawerId: activeDrawerId !== null && activeDrawerId !== void 0 ? activeDrawerId : null, drawers: (_b = drawers === null || drawers === void 0 ? void 0 : drawers.filter(item => !!item.trigger)) !== null && _b !== void 0 ? _b : [], drawersFocusRef: drawersFocusRef, onActiveDrawerChange: onActiveDrawerChange, splitPanelToggleProps: (splitPanelToggleProps === null || splitPanelToggleProps === void 0 ? void 0 : splitPanelToggleProps.displayed) ? splitPanelToggleProps : undefined, splitPanelFocusRef: splitPanelFocusRef, onSplitPanelToggle: onSplitPanelToggle, disabled: anyPanelOpenInMobile, globalDrawersFocusControl: globalDrawersFocusControl, bottomDrawersFocusRef: bottomDrawersFocusRef, globalDrawers: (_c = globalDrawers === null || globalDrawers === void 0 ? void 0 : globalDrawers.filter(item => !!item.trigger)) !== null && _c !== void 0 ? _c : [], activeGlobalDrawersIds: activeGlobalDrawersIds !== null && activeGlobalDrawersIds !== void 0 ? activeGlobalDrawersIds : [], onActiveGlobalDrawersChange: onActiveGlobalDrawersChange, expandedDrawerId: expandedDrawerId, setExpandedDrawerId: setExpandedDrawerId, bottomDrawers: bottomDrawers, onActiveGlobalBottomDrawerChange: onActiveGlobalBottomDrawerChange, activeGlobalBottomDrawerId: activeGlobalBottomDrawerId }))))));
86
90
  }
87
91
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/toolbar/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAMlF,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAyB,MAAM,mBAAmB,CAAC;AAC1E,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAE7C,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AA6CrC,MAAM,UAAU,8BAA8B,CAAC,EAC7C,kBAAkB;AAClB,yGAAyG;AACzG,yCAAyC;AACzC,YAAY,GAAG,EAAE,GACmB;;IACpC,MAAM,EACJ,WAAW,EACX,qBAAqB,EACrB,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,QAAQ,EACR,cAAc,EACd,sBAAsB,GACvB,GAAG,kBAAkB,CAAC;IACvB,MAAM,EACJ,UAAU,EACV,cAAc,EACd,OAAO,EACP,eAAe,EACf,oBAAoB,EACpB,yBAAyB,EACzB,aAAa,EACb,sBAAsB,EACtB,2BAA2B,EAC3B,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,GACjB,GAAG,YAAY,CAAC;IACjB,MAAM,kBAAkB,GAAG,CAAC,CAAC,gBAAgB,CAAC;IAC9C,MAAM,GAAG,GAAG,MAAM,CAAc,IAAI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Ac,IACb,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,IAAI,EACtC,OAAO,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,mCAAI,EAAE,EACtD,eAAe,EAAE,eAAe,EAChC,oBAAoB,EAAE,oBAAoB,EAC1C,qBAAqB,EAAE,CAAA,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,SAAS,EAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,EAC3F,kBAAkB,EAAE,kBAAkB,EACtC,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,oBAAoB,EAC9B,yBAAyB,EAAE,yBAAyB,EACpD,aAAa,EAAE,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,mCAAI,EAAE,EAClE,sBAAsB,EAAE,sBAAsB,aAAtB,sBAAsB,cAAtB,sBAAsB,GAAI,EAAE,EACpD,2BAA2B,EAAE,2BAA2B,EACxD,gBAAgB,EAAE,gBAAgB,EAClC,mBAAmB,EAAE,mBAAoB,GACzC,CACE,CACP,CACG,CACM,CACf,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 { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\n\nimport { AppLayoutProps } from '../../interfaces';\nimport { OnChangeParams } from '../../utils/use-drawers';\nimport { Focusable, FocusControlMultipleStates } from '../../utils/use-focus-control';\nimport { AppLayoutInternals } from '../interfaces';\nimport { BreadcrumbsSlot, ToolbarSlot } from '../skeleton/slots';\nimport { DrawerTriggers, SplitPanelToggleProps } from './drawer-triggers';\nimport TriggerButton from './trigger-button';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\nexport { SplitPanelToggleProps };\n\nexport interface ToolbarProps {\n ariaLabels?: AppLayoutProps.Labels;\n // navigation\n hasNavigation?: boolean;\n navigationOpen?: boolean;\n onNavigationToggle?: (open: boolean) => void;\n navigationFocusRef?: React.Ref<Focusable>;\n\n // breadcrumbs\n hasBreadcrumbsPortal?: boolean;\n\n // split panel\n hasSplitPanel?: boolean;\n splitPanelToggleProps?: SplitPanelToggleProps;\n splitPanelFocusRef?: React.Ref<Focusable>;\n onSplitPanelToggle?: () => void;\n\n // drawers\n activeDrawerId?: string | null;\n drawers?: ReadonlyArray<AppLayoutProps.Drawer>;\n drawersFocusRef?: React.Ref<Focusable>;\n globalDrawersFocusControl?: FocusControlMultipleStates;\n onActiveDrawerChange?: (drawerId: string | null, params: OnChangeParams) => void;\n globalDrawers?: ReadonlyArray<AppLayoutProps.Drawer> | undefined;\n activeGlobalDrawersIds?: ReadonlyArray<string>;\n onActiveGlobalDrawersChange?: ((drawerId: string, params: OnChangeParams) => void) | undefined;\n\n expandedDrawerId?: string | null;\n setExpandedDrawerId?: (value: string | null) => void;\n\n aiDrawer?: AppLayoutProps.Drawer;\n onActiveAiDrawerChange?: (value: string | null) => void;\n activeAiDrawerId?: string | null;\n aiDrawerFocusRef?: React.Ref<Focusable>;\n}\n\nexport interface AppLayoutToolbarImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n toolbarProps: ToolbarProps;\n}\n\nexport function AppLayoutToolbarImplementation({\n appLayoutInternals,\n // the value could be undefined if this component is loaded as a widget by a different app layout version\n // not testable in a single-version setup\n toolbarProps = {},\n}: AppLayoutToolbarImplementationProps) {\n const {\n breadcrumbs,\n discoveredBreadcrumbs,\n verticalOffsets,\n isMobile,\n setToolbarHeight,\n aiDrawer,\n activeAiDrawer,\n onActiveAiDrawerChange,\n } = appLayoutInternals;\n const {\n ariaLabels,\n activeDrawerId,\n drawers,\n drawersFocusRef,\n onActiveDrawerChange,\n globalDrawersFocusControl,\n globalDrawers,\n activeGlobalDrawersIds,\n onActiveGlobalDrawersChange,\n hasNavigation,\n navigationOpen,\n navigationFocusRef,\n onNavigationToggle,\n hasSplitPanel,\n splitPanelFocusRef,\n splitPanelToggleProps,\n onSplitPanelToggle,\n expandedDrawerId,\n setExpandedDrawerId,\n aiDrawerFocusRef,\n } = toolbarProps;\n const drawerExpandedMode = !!expandedDrawerId;\n const ref = useRef<HTMLElement>(null);\n const aiDrawerTransitionRef = useRef<HTMLDivElement>(null);\n const activeAiDrawerId = activeAiDrawer?.id;\n useResizeObserver(ref, entry => setToolbarHeight(entry.borderBoxHeight));\n useEffect(() => {\n return () => {\n setToolbarHeight(0);\n };\n // unmount effect only\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const anyPanelOpenInMobile =\n !!isMobile &&\n (!!activeDrawerId ||\n !!activeGlobalDrawersIds?.length ||\n !!activeAiDrawerId ||\n (!!navigationOpen && !!hasNavigation));\n useEffect(() => {\n if (anyPanelOpenInMobile) {\n document.body.classList.add(styles['block-body-scroll']);\n } else {\n document.body.classList.remove(styles['block-body-scroll']);\n }\n return () => {\n document.body.classList.remove(styles['block-body-scroll']);\n };\n }, [anyPanelOpenInMobile]);\n\n const navLandmarkAttributes = navigationOpen\n ? { role: 'presentation' }\n : { role: 'navigation', 'aria-label': ariaLabels?.navigation };\n\n return (\n <ToolbarSlot\n ref={ref}\n className={clsx(\n styles['universal-toolbar'],\n aiDrawer?.trigger && styles['with-ai-drawer'],\n testutilStyles.toolbar,\n {\n [testutilStyles['mobile-bar']]: isMobile,\n }\n )}\n style={{\n insetBlockStart: verticalOffsets.toolbar,\n }}\n >\n <Transition\n in={!!(aiDrawer?.trigger && !activeAiDrawerId)}\n timeout={{ enter: 0, exit: 165 }}\n mountOnEnter={true}\n unmountOnExit={true}\n nodeRef={aiDrawerTransitionRef}\n >\n {state => (\n <div\n className={clsx(!!aiDrawer?.trigger?.customIcon && styles['universal-toolbar-ai-custom'], [\n sharedStyles['with-motion-horizontal'],\n ])}\n style={{\n opacity: ['entering', 'exiting'].includes(state) ? 0 : 1,\n }}\n >\n <TriggerButton\n ariaLabel={aiDrawer?.ariaLabels?.triggerButton}\n ariaExpanded={!!activeAiDrawerId}\n iconName={aiDrawer?.trigger!.iconName}\n iconSvg={aiDrawer?.trigger!.iconSvg}\n customSvg={aiDrawer?.trigger!.customIcon}\n className={testutilStyles['ai-drawer-toggle']}\n onClick={() => {\n if (setExpandedDrawerId) {\n setExpandedDrawerId(null);\n }\n onActiveAiDrawerChange?.(aiDrawer?.id ?? null, { initiatedByUserAction: true });\n }}\n ref={aiDrawerFocusRef}\n selected={!drawerExpandedMode && !!activeAiDrawerId}\n disabled={anyPanelOpenInMobile}\n variant={aiDrawer?.trigger?.customIcon ? 'custom' : 'circle'}\n hasTooltip={true}\n testId={`awsui-app-layout-trigger-${aiDrawer?.id}`}\n isForPreviousActiveDrawer={true}\n />\n </div>\n )}\n </Transition>\n <div className={clsx(styles['toolbar-container'], !!aiDrawer?.trigger && styles['with-ai-drawer'])}>\n {hasNavigation && (\n <nav {...navLandmarkAttributes} className={clsx(styles['universal-toolbar-nav'])}>\n <TriggerButton\n ariaLabel={ariaLabels?.navigationToggle ?? undefined}\n ariaExpanded={!drawerExpandedMode && navigationOpen}\n iconName=\"menu\"\n className={testutilStyles['navigation-toggle']}\n onClick={() => {\n if (setExpandedDrawerId) {\n setExpandedDrawerId(null);\n }\n if (navigationOpen && expandedDrawerId) {\n return;\n }\n onNavigationToggle?.(!navigationOpen);\n }}\n ref={navigationFocusRef}\n selected={!drawerExpandedMode && navigationOpen}\n disabled={anyPanelOpenInMobile}\n />\n </nav>\n )}\n {(breadcrumbs || discoveredBreadcrumbs) && (\n <div className={clsx(styles['universal-toolbar-breadcrumbs'], testutilStyles.breadcrumbs)}>\n <BreadcrumbsSlot\n ownBreadcrumbs={appLayoutInternals.breadcrumbs}\n discoveredBreadcrumbs={appLayoutInternals.discoveredBreadcrumbs}\n />\n </div>\n )}\n {(drawers?.length || globalDrawers?.length || (hasSplitPanel && splitPanelToggleProps?.displayed)) && (\n <div className={clsx(styles['universal-toolbar-drawers'])}>\n <DrawerTriggers\n ariaLabels={ariaLabels}\n activeDrawerId={activeDrawerId ?? null}\n drawers={drawers?.filter(item => !!item.trigger) ?? []}\n drawersFocusRef={drawersFocusRef}\n onActiveDrawerChange={onActiveDrawerChange}\n splitPanelToggleProps={splitPanelToggleProps?.displayed ? splitPanelToggleProps : undefined}\n splitPanelFocusRef={splitPanelFocusRef}\n onSplitPanelToggle={onSplitPanelToggle}\n disabled={anyPanelOpenInMobile}\n globalDrawersFocusControl={globalDrawersFocusControl}\n globalDrawers={globalDrawers?.filter(item => !!item.trigger) ?? []}\n activeGlobalDrawersIds={activeGlobalDrawersIds ?? []}\n onActiveGlobalDrawersChange={onActiveGlobalDrawersChange}\n expandedDrawerId={expandedDrawerId}\n setExpandedDrawerId={setExpandedDrawerId!}\n />\n </div>\n )}\n </div>\n </ToolbarSlot>\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/toolbar/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAMlF,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAyB,MAAM,mBAAmB,CAAC;AAC1E,OAAO,aAAa,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A,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,SAAS,EAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,EAC3F,kBAAkB,EAAE,kBAAkB,EACtC,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,oBAAoB,EAC9B,yBAAyB,EAAE,yBAAyB,EACpD,qBAAqB,EAAE,qBAAqB,EAC5C,aAAa,EAAE,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,mCAAI,EAAE,EAClE,sBAAsB,EAAE,sBAAsB,aAAtB,sBAAsB,cAAtB,sBAAsB,GAAI,EAAE,EACpD,2BAA2B,EAAE,2BAA2B,EACxD,gBAAgB,EAAE,gBAAgB,EAClC,mBAAmB,EAAE,mBAAoB,EACzC,aAAa,EAAE,aAAa,EAC5B,gCAAgC,EAAE,gCAAgC,EAClE,0BAA0B,EAAE,0BAA0B,GACtD,CACE,CACP,CACG,CACM,CACf,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 { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\n\nimport { AppLayoutProps } from '../../interfaces';\nimport { OnChangeParams } from '../../utils/use-drawers';\nimport { Focusable, FocusControlMultipleStates } from '../../utils/use-focus-control';\nimport { AppLayoutInternals } from '../interfaces';\nimport { BreadcrumbsSlot, ToolbarSlot } from '../skeleton/slots';\nimport { DrawerTriggers, SplitPanelToggleProps } from './drawer-triggers';\nimport TriggerButton from './trigger-button';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\nexport { SplitPanelToggleProps };\n\nexport interface ToolbarProps {\n ariaLabels?: AppLayoutProps.Labels;\n // navigation\n hasNavigation?: boolean;\n navigationOpen?: boolean;\n onNavigationToggle?: (open: boolean) => void;\n navigationFocusRef?: React.Ref<Focusable>;\n\n // breadcrumbs\n hasBreadcrumbsPortal?: boolean;\n\n // split panel\n hasSplitPanel?: boolean;\n splitPanelToggleProps?: SplitPanelToggleProps;\n splitPanelFocusRef?: React.Ref<Focusable>;\n onSplitPanelToggle?: () => void;\n\n // drawers\n activeDrawerId?: string | null;\n drawers?: ReadonlyArray<AppLayoutProps.Drawer>;\n drawersFocusRef?: React.Ref<Focusable>;\n bottomDrawersFocusRef?: React.Ref<Focusable>;\n globalDrawersFocusControl?: FocusControlMultipleStates;\n onActiveDrawerChange?: (drawerId: string | null, params: OnChangeParams) => void;\n globalDrawers?: ReadonlyArray<AppLayoutProps.Drawer> | undefined;\n activeGlobalDrawersIds?: ReadonlyArray<string>;\n onActiveGlobalDrawersChange?: ((drawerId: string, params: OnChangeParams) => void) | undefined;\n bottomDrawers?: ReadonlyArray<AppLayoutProps.Drawer> | undefined;\n activeGlobalBottomDrawerId?: string | null;\n onActiveGlobalBottomDrawerChange?: (value: string | null, params: OnChangeParams) => void;\n\n expandedDrawerId?: string | null;\n setExpandedDrawerId?: (value: string | null) => void;\n\n aiDrawer?: AppLayoutProps.Drawer;\n onActiveAiDrawerChange?: (value: string | null) => void;\n activeAiDrawerId?: string | null;\n aiDrawerFocusRef?: React.Ref<Focusable>;\n}\n\nexport interface AppLayoutToolbarImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n toolbarProps: ToolbarProps;\n}\n\nexport function AppLayoutToolbarImplementation({\n appLayoutInternals,\n // the value could be undefined if this component is loaded as a widget by a different app layout version\n // not testable in a single-version setup\n toolbarProps = {},\n}: AppLayoutToolbarImplementationProps) {\n const {\n breadcrumbs,\n discoveredBreadcrumbs,\n verticalOffsets,\n isMobile,\n setToolbarHeight,\n aiDrawer,\n activeAiDrawer,\n onActiveAiDrawerChange,\n } = appLayoutInternals;\n const {\n ariaLabels,\n activeDrawerId,\n drawers,\n drawersFocusRef,\n onActiveDrawerChange,\n globalDrawersFocusControl,\n globalDrawers,\n activeGlobalDrawersIds,\n onActiveGlobalDrawersChange,\n hasNavigation,\n navigationOpen,\n navigationFocusRef,\n onNavigationToggle,\n hasSplitPanel,\n splitPanelFocusRef,\n splitPanelToggleProps,\n onSplitPanelToggle,\n expandedDrawerId,\n setExpandedDrawerId,\n aiDrawerFocusRef,\n onActiveGlobalBottomDrawerChange,\n activeGlobalBottomDrawerId,\n bottomDrawersFocusRef,\n bottomDrawers,\n } = toolbarProps;\n const drawerExpandedMode = !!expandedDrawerId;\n const ref = useRef<HTMLElement>(null);\n const aiDrawerTransitionRef = useRef<HTMLDivElement>(null);\n const activeAiDrawerId = activeAiDrawer?.id;\n useResizeObserver(ref, entry => setToolbarHeight(entry.borderBoxHeight));\n useEffect(() => {\n return () => {\n setToolbarHeight(0);\n };\n // unmount effect only\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const anyPanelOpenInMobile =\n !!isMobile &&\n (!!activeDrawerId ||\n !!activeGlobalDrawersIds?.length ||\n !!activeAiDrawerId ||\n !!activeGlobalBottomDrawerId ||\n (!!navigationOpen && !!hasNavigation));\n useEffect(() => {\n if (anyPanelOpenInMobile) {\n document.body.classList.add(styles['block-body-scroll']);\n } else {\n document.body.classList.remove(styles['block-body-scroll']);\n }\n return () => {\n document.body.classList.remove(styles['block-body-scroll']);\n };\n }, [anyPanelOpenInMobile]);\n\n const navLandmarkAttributes = navigationOpen\n ? { role: 'presentation' }\n : { role: 'navigation', 'aria-label': ariaLabels?.navigation };\n\n return (\n <ToolbarSlot\n ref={ref}\n className={clsx(\n styles['universal-toolbar'],\n aiDrawer?.trigger && styles['with-ai-drawer'],\n testutilStyles.toolbar,\n {\n [testutilStyles['mobile-bar']]: isMobile,\n }\n )}\n style={{\n insetBlockStart: verticalOffsets.toolbar,\n }}\n >\n <Transition\n in={!!(aiDrawer?.trigger && !activeAiDrawerId)}\n timeout={{ enter: 0, exit: 165 }}\n mountOnEnter={true}\n unmountOnExit={true}\n nodeRef={aiDrawerTransitionRef}\n >\n {state => (\n <div\n className={clsx(!!aiDrawer?.trigger?.customIcon && styles['universal-toolbar-ai-custom'], [\n sharedStyles['with-motion-horizontal'],\n ])}\n style={{\n opacity: ['entering', 'exiting'].includes(state) ? 0 : 1,\n }}\n >\n <TriggerButton\n ariaLabel={aiDrawer?.ariaLabels?.triggerButton}\n ariaExpanded={!!activeAiDrawerId}\n iconName={aiDrawer?.trigger!.iconName}\n iconSvg={aiDrawer?.trigger!.iconSvg}\n customSvg={aiDrawer?.trigger!.customIcon}\n className={testutilStyles['ai-drawer-toggle']}\n onClick={() => {\n if (setExpandedDrawerId) {\n setExpandedDrawerId(null);\n }\n onActiveAiDrawerChange?.(aiDrawer?.id ?? null, { initiatedByUserAction: true });\n }}\n ref={aiDrawerFocusRef}\n selected={!drawerExpandedMode && !!activeAiDrawerId}\n disabled={anyPanelOpenInMobile}\n variant={aiDrawer?.trigger?.customIcon ? 'custom' : 'circle'}\n hasTooltip={true}\n testId={`awsui-app-layout-trigger-${aiDrawer?.id}`}\n isForPreviousActiveDrawer={true}\n />\n </div>\n )}\n </Transition>\n <div className={clsx(styles['toolbar-container'], !!aiDrawer?.trigger && styles['with-ai-drawer'])}>\n {hasNavigation && (\n <nav {...navLandmarkAttributes} className={clsx(styles['universal-toolbar-nav'])}>\n <TriggerButton\n ariaLabel={ariaLabels?.navigationToggle ?? undefined}\n ariaExpanded={!drawerExpandedMode && navigationOpen}\n iconName=\"menu\"\n className={testutilStyles['navigation-toggle']}\n onClick={() => {\n if (setExpandedDrawerId) {\n setExpandedDrawerId(null);\n }\n if (navigationOpen && expandedDrawerId) {\n return;\n }\n onNavigationToggle?.(!navigationOpen);\n }}\n ref={navigationFocusRef}\n selected={!drawerExpandedMode && navigationOpen}\n disabled={anyPanelOpenInMobile}\n />\n </nav>\n )}\n {(breadcrumbs || discoveredBreadcrumbs) && (\n <div className={clsx(styles['universal-toolbar-breadcrumbs'], testutilStyles.breadcrumbs)}>\n <BreadcrumbsSlot\n ownBreadcrumbs={appLayoutInternals.breadcrumbs}\n discoveredBreadcrumbs={appLayoutInternals.discoveredBreadcrumbs}\n />\n </div>\n )}\n {(drawers?.length ||\n globalDrawers?.length ||\n bottomDrawers?.length ||\n (hasSplitPanel && splitPanelToggleProps?.displayed)) && (\n <div className={clsx(styles['universal-toolbar-drawers'])}>\n <DrawerTriggers\n ariaLabels={ariaLabels}\n activeDrawerId={activeDrawerId ?? null}\n drawers={drawers?.filter(item => !!item.trigger) ?? []}\n drawersFocusRef={drawersFocusRef}\n onActiveDrawerChange={onActiveDrawerChange}\n splitPanelToggleProps={splitPanelToggleProps?.displayed ? splitPanelToggleProps : undefined}\n splitPanelFocusRef={splitPanelFocusRef}\n onSplitPanelToggle={onSplitPanelToggle}\n disabled={anyPanelOpenInMobile}\n globalDrawersFocusControl={globalDrawersFocusControl}\n bottomDrawersFocusRef={bottomDrawersFocusRef}\n globalDrawers={globalDrawers?.filter(item => !!item.trigger) ?? []}\n activeGlobalDrawersIds={activeGlobalDrawersIds ?? []}\n onActiveGlobalDrawersChange={onActiveGlobalDrawersChange}\n expandedDrawerId={expandedDrawerId}\n setExpandedDrawerId={setExpandedDrawerId!}\n bottomDrawers={bottomDrawers}\n onActiveGlobalBottomDrawerChange={onActiveGlobalBottomDrawerChange}\n activeGlobalBottomDrawerId={activeGlobalBottomDrawerId}\n />\n </div>\n )}\n </div>\n </ToolbarSlot>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"after-main-slot.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/widget-areas/after-main-slot.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAO3D,eAAO,MAAM,2BAA2B,uCAAwC,iBAAiB,uBAqDhG,CAAC;AAEF,eAAO,MAAM,sCAAsC,kDAvD6B,iBAAiB,8EAAjB,iBAAiB,uBAuDW,CAAC"}
1
+ {"version":3,"file":"after-main-slot.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/widget-areas/after-main-slot.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAO3D,eAAO,MAAM,2BAA2B,uCAAwC,iBAAiB,uBAsEhG,CAAC;AAEF,eAAO,MAAM,sCAAsC,kDAxE6B,iBAAiB,8EAAjB,iBAAiB,uBAwEW,CAAC"}
@@ -5,6 +5,7 @@ import clsx from 'clsx';
5
5
  import { createWidgetizedComponent } from '../../../internal/widgets';
6
6
  import { ActiveDrawersContext } from '../../utils/visibility-context';
7
7
  import { AppLayoutDrawerImplementation as AppLayoutDrawer, AppLayoutGlobalDrawersImplementation as AppLayoutGlobalDrawers, } from '../drawer';
8
+ import { AppLayoutBottomDrawerWrapper } from '../drawer/global-bottom-drawer';
8
9
  import { AppLayoutSplitPanelDrawerSideImplementation as AppLayoutSplitPanelSide } from '../split-panel';
9
10
  import { isWidgetReady } from '../state/invariants';
10
11
  import sharedStyles from '../../resize/styles.css.js';
@@ -13,14 +14,17 @@ export const AfterMainSlotImplementation = ({ appLayoutState, appLayoutProps })
13
14
  if (!isWidgetReady(appLayoutState)) {
14
15
  return null;
15
16
  }
16
- const { navigationOpen, activeGlobalDrawersIds, expandedDrawerId, activeDrawer, splitPanelOpen, drawers, splitPanelPosition, } = appLayoutState.widgetizedState;
17
+ const { navigationOpen, activeGlobalDrawersIds, expandedDrawerId, activeDrawer, splitPanelOpen, drawers, splitPanelPosition, activeGlobalBottomDrawerId, bottomDrawers, bottomDrawerReportedSize, } = appLayoutState.widgetizedState;
17
18
  const drawerExpandedMode = !!expandedDrawerId;
18
19
  const toolsOpen = !!activeDrawer;
19
20
  const globalToolsOpen = !!(activeGlobalDrawersIds === null || activeGlobalDrawersIds === void 0 ? void 0 : activeGlobalDrawersIds.length);
20
21
  return (React.createElement(React.Fragment, null,
22
+ !!bottomDrawers.length && (React.createElement("div", { className: styles['bottom-tool'] },
23
+ React.createElement(ActiveDrawersContext.Provider, { value: activeGlobalBottomDrawerId ? [activeGlobalBottomDrawerId] : [] },
24
+ React.createElement(AppLayoutBottomDrawerWrapper, { widgetizedState: appLayoutState.widgetizedState })))),
21
25
  splitPanelPosition === 'side' && (React.createElement("div", { className: clsx(styles['split-panel-side'], !splitPanelOpen && styles['panel-hidden'], drawerExpandedMode && styles.hidden) },
22
- React.createElement(AppLayoutSplitPanelSide, { appLayoutInternals: appLayoutState.appLayoutInternals, splitPanelInternals: appLayoutState.splitPanelInternals }, appLayoutProps.splitPanel))),
23
- React.createElement("div", { className: clsx(styles.tools, !toolsOpen && styles['panel-hidden'], sharedStyles['with-motion-horizontal'], navigationOpen && !toolsOpen && styles['unfocusable-mobile'], toolsOpen && styles['tools-open'], drawerExpandedMode && styles.hidden) }, drawers && drawers.length > 0 && React.createElement(AppLayoutDrawer, { appLayoutInternals: appLayoutState.appLayoutInternals })),
26
+ React.createElement(AppLayoutSplitPanelSide, { appLayoutInternals: appLayoutState.appLayoutInternals, splitPanelInternals: appLayoutState.splitPanelInternals, bottomDrawerReportedSize: bottomDrawerReportedSize }, appLayoutProps.splitPanel))),
27
+ React.createElement("div", { className: clsx(styles.tools, !toolsOpen && styles['panel-hidden'], sharedStyles['with-motion-horizontal'], navigationOpen && !toolsOpen && styles['unfocusable-mobile'], toolsOpen && styles['tools-open'], drawerExpandedMode && styles.hidden) }, drawers && drawers.length > 0 && (React.createElement(AppLayoutDrawer, { appLayoutInternals: appLayoutState.appLayoutInternals, bottomDrawerReportedSize: activeGlobalBottomDrawerId ? bottomDrawerReportedSize : 0 }))),
24
28
  React.createElement("div", { className: clsx(styles['global-tools'], !globalToolsOpen && styles['panel-hidden']) },
25
29
  React.createElement(ActiveDrawersContext.Provider, { value: activeGlobalDrawersIds !== null && activeGlobalDrawersIds !== void 0 ? activeGlobalDrawersIds : [] },
26
30
  React.createElement(AppLayoutGlobalDrawers, { appLayoutInternals: appLayoutState.appLayoutInternals })))));
@@ -1 +1 @@
1
- {"version":3,"file":"after-main-slot.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/widget-areas/after-main-slot.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EACL,6BAA6B,IAAI,eAAe,EAChD,oCAAoC,IAAI,sBAAsB,GAC/D,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,2CAA2C,IAAI,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACxG,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAE/C,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,EAAE,cAAc,EAAE,cAAc,EAAqB,EAAE,EAAE;IACnG,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE;QAClC,OAAO,IAAI,CAAC;KACb;IACD,MAAM,EACJ,cAAc,EACd,sBAAsB,EACtB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,OAAO,EACP,kBAAkB,GACnB,GAAG,cAAc,CAAC,eAAe,CAAC;IACnC,MAAM,kBAAkB,GAAG,CAAC,CAAC,gBAAgB,CAAC;IAC9C,MAAM,SAAS,GAAG,CAAC,CAAC,YAAY,CAAC;IACjC,MAAM,eAAe,GAAG,CAAC,CAAC,CAAA,sBAAsB,aAAtB,sBAAsB,uBAAtB,sBAAsB,CAAE,MAAM,CAAA,CAAC;IACzD,OAAO,CACL;QACG,kBAAkB,KAAK,MAAM,IAAI,CAChC,6BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,kBAAkB,CAAC,EAC1B,CAAC,cAAc,IAAI,MAAM,CAAC,cAAc,CAAC,EACzC,kBAAkB,IAAI,MAAM,CAAC,MAAM,CACpC;YAED,oBAAC,uBAAuB,IACtB,kBAAkB,EAAE,cAAc,CAAC,kBAAkB,EACrD,mBAAmB,EAAE,cAAc,CAAC,mBAAmB,IAEtD,cAAc,CAAC,UAAU,CACF,CACtB,CACP;QACD,6BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,KAAK,EACZ,CAAC,SAAS,IAAI,MAAM,CAAC,cAAc,CAAC,EACpC,YAAY,CAAC,wBAAwB,CAAC,EACtC,cAAc,IAAI,CAAC,SAAS,IAAI,MAAM,CAAC,oBAAoB,CAAC,EAC5D,SAAS,IAAI,MAAM,CAAC,YAAY,CAAC,EACjC,kBAAkB,IAAI,MAAM,CAAC,MAAM,CACpC,IAEA,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,oBAAC,eAAe,IAAC,kBAAkB,EAAE,cAAc,CAAC,kBAAkB,GAAI,CACxG;QACN,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,eAAe,IAAI,MAAM,CAAC,cAAc,CAAC,CAAC;YACtF,oBAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,sBAAsB,aAAtB,sBAAsB,cAAtB,sBAAsB,GAAI,EAAE;gBAChE,oBAAC,sBAAsB,IAAC,kBAAkB,EAAE,cAAc,CAAC,kBAAkB,GAAI,CACnD,CAC5B,CACL,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sCAAsC,GAAG,yBAAyB,CAAC,2BAA2B,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { ActiveDrawersContext } from '../../utils/visibility-context';\nimport {\n AppLayoutDrawerImplementation as AppLayoutDrawer,\n AppLayoutGlobalDrawersImplementation as AppLayoutGlobalDrawers,\n} from '../drawer';\nimport { SkeletonPartProps } from '../skeleton/interfaces';\nimport { AppLayoutSplitPanelDrawerSideImplementation as AppLayoutSplitPanelSide } from '../split-panel';\nimport { isWidgetReady } from '../state/invariants';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport styles from '../skeleton/styles.css.js';\n\nexport const AfterMainSlotImplementation = ({ appLayoutState, appLayoutProps }: SkeletonPartProps) => {\n if (!isWidgetReady(appLayoutState)) {\n return null;\n }\n const {\n navigationOpen,\n activeGlobalDrawersIds,\n expandedDrawerId,\n activeDrawer,\n splitPanelOpen,\n drawers,\n splitPanelPosition,\n } = appLayoutState.widgetizedState;\n const drawerExpandedMode = !!expandedDrawerId;\n const toolsOpen = !!activeDrawer;\n const globalToolsOpen = !!activeGlobalDrawersIds?.length;\n return (\n <>\n {splitPanelPosition === 'side' && (\n <div\n className={clsx(\n styles['split-panel-side'],\n !splitPanelOpen && styles['panel-hidden'],\n drawerExpandedMode && styles.hidden\n )}\n >\n <AppLayoutSplitPanelSide\n appLayoutInternals={appLayoutState.appLayoutInternals}\n splitPanelInternals={appLayoutState.splitPanelInternals}\n >\n {appLayoutProps.splitPanel}\n </AppLayoutSplitPanelSide>\n </div>\n )}\n <div\n className={clsx(\n styles.tools,\n !toolsOpen && styles['panel-hidden'],\n sharedStyles['with-motion-horizontal'],\n navigationOpen && !toolsOpen && styles['unfocusable-mobile'],\n toolsOpen && styles['tools-open'],\n drawerExpandedMode && styles.hidden\n )}\n >\n {drawers && drawers.length > 0 && <AppLayoutDrawer appLayoutInternals={appLayoutState.appLayoutInternals} />}\n </div>\n <div className={clsx(styles['global-tools'], !globalToolsOpen && styles['panel-hidden'])}>\n <ActiveDrawersContext.Provider value={activeGlobalDrawersIds ?? []}>\n <AppLayoutGlobalDrawers appLayoutInternals={appLayoutState.appLayoutInternals} />\n </ActiveDrawersContext.Provider>\n </div>\n </>\n );\n};\n\nexport const createWidgetizedAppLayoutAfterMainSlot = createWidgetizedComponent(AfterMainSlotImplementation);\n"]}
1
+ {"version":3,"file":"after-main-slot.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/widget-areas/after-main-slot.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EACL,6BAA6B,IAAI,eAAe,EAChD,oCAAoC,IAAI,sBAAsB,GAC/D,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E,OAAO,EAAE,2CAA2C,IAAI,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACxG,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAE/C,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,EAAE,cAAc,EAAE,cAAc,EAAqB,EAAE,EAAE;IACnG,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE;QAClC,OAAO,IAAI,CAAC;KACb;IACD,MAAM,EACJ,cAAc,EACd,sBAAsB,EACtB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,OAAO,EACP,kBAAkB,EAClB,0BAA0B,EAC1B,aAAa,EACb,wBAAwB,GACzB,GAAG,cAAc,CAAC,eAAe,CAAC;IACnC,MAAM,kBAAkB,GAAG,CAAC,CAAC,gBAAgB,CAAC;IAC9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wB,EAAE,0BAA0B,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,GACnF,CACH,CACG;QACN,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,eAAe,IAAI,MAAM,CAAC,cAAc,CAAC,CAAC;YACtF,oBAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,sBAAsB,aAAtB,sBAAsB,cAAtB,sBAAsB,GAAI,EAAE;gBAChE,oBAAC,sBAAsB,IAAC,kBAAkB,EAAE,cAAc,CAAC,kBAAkB,GAAI,CACnD,CAC5B,CACL,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sCAAsC,GAAG,yBAAyB,CAAC,2BAA2B,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { ActiveDrawersContext } from '../../utils/visibility-context';\nimport {\n AppLayoutDrawerImplementation as AppLayoutDrawer,\n AppLayoutGlobalDrawersImplementation as AppLayoutGlobalDrawers,\n} from '../drawer';\nimport { AppLayoutBottomDrawerWrapper } from '../drawer/global-bottom-drawer';\nimport { SkeletonPartProps } from '../skeleton/interfaces';\nimport { AppLayoutSplitPanelDrawerSideImplementation as AppLayoutSplitPanelSide } from '../split-panel';\nimport { isWidgetReady } from '../state/invariants';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport styles from '../skeleton/styles.css.js';\n\nexport const AfterMainSlotImplementation = ({ appLayoutState, appLayoutProps }: SkeletonPartProps) => {\n if (!isWidgetReady(appLayoutState)) {\n return null;\n }\n const {\n navigationOpen,\n activeGlobalDrawersIds,\n expandedDrawerId,\n activeDrawer,\n splitPanelOpen,\n drawers,\n splitPanelPosition,\n activeGlobalBottomDrawerId,\n bottomDrawers,\n bottomDrawerReportedSize,\n } = appLayoutState.widgetizedState;\n const drawerExpandedMode = !!expandedDrawerId;\n const toolsOpen = !!activeDrawer;\n const globalToolsOpen = !!activeGlobalDrawersIds?.length;\n\n return (\n <>\n {!!bottomDrawers.length && (\n <div className={styles['bottom-tool']}>\n <ActiveDrawersContext.Provider value={activeGlobalBottomDrawerId ? [activeGlobalBottomDrawerId] : []}>\n <AppLayoutBottomDrawerWrapper widgetizedState={appLayoutState.widgetizedState} />\n </ActiveDrawersContext.Provider>\n </div>\n )}\n {splitPanelPosition === 'side' && (\n <div\n className={clsx(\n styles['split-panel-side'],\n !splitPanelOpen && styles['panel-hidden'],\n drawerExpandedMode && styles.hidden\n )}\n >\n <AppLayoutSplitPanelSide\n appLayoutInternals={appLayoutState.appLayoutInternals}\n splitPanelInternals={appLayoutState.splitPanelInternals}\n bottomDrawerReportedSize={bottomDrawerReportedSize}\n >\n {appLayoutProps.splitPanel}\n </AppLayoutSplitPanelSide>\n </div>\n )}\n <div\n className={clsx(\n styles.tools,\n !toolsOpen && styles['panel-hidden'],\n sharedStyles['with-motion-horizontal'],\n navigationOpen && !toolsOpen && styles['unfocusable-mobile'],\n toolsOpen && styles['tools-open'],\n drawerExpandedMode && styles.hidden\n )}\n >\n {drawers && drawers.length > 0 && (\n <AppLayoutDrawer\n appLayoutInternals={appLayoutState.appLayoutInternals}\n bottomDrawerReportedSize={activeGlobalBottomDrawerId ? bottomDrawerReportedSize : 0}\n />\n )}\n </div>\n <div className={clsx(styles['global-tools'], !globalToolsOpen && styles['panel-hidden'])}>\n <ActiveDrawersContext.Provider value={activeGlobalDrawersIds ?? []}>\n <AppLayoutGlobalDrawers appLayoutInternals={appLayoutState.appLayoutInternals} />\n </ActiveDrawersContext.Provider>\n </div>\n </>\n );\n};\n\nexport const createWidgetizedAppLayoutAfterMainSlot = createWidgetizedComponent(AfterMainSlotImplementation);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"before-main-slot.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAQ3D,eAAO,MAAM,4BAA4B,qDAAsD,iBAAiB,gBA4F/G,CAAC;AAEF,eAAO,MAAM,uCAAuC,gEA9F2C,iBAAiB,qFAAjB,iBAAiB,gBAiG/G,CAAC"}
1
+ {"version":3,"file":"before-main-slot.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAQ3D,eAAO,MAAM,4BAA4B,qDAAsD,iBAAiB,gBAgG/G,CAAC;AAEF,eAAO,MAAM,uCAAuC,gEAlG2C,iBAAiB,qFAAjB,iBAAiB,gBAqG/G,CAAC"}
@@ -16,7 +16,7 @@ export const BeforeMainSlotImplementation = ({ toolbarProps, appLayoutState, app
16
16
  if (!isWidgetReady(appLayoutState)) {
17
17
  return (React.createElement(BeforeMainSlotSkeleton, { toolbarProps: toolbarProps, appLayoutProps: appLayoutProps, appLayoutState: appLayoutState }));
18
18
  }
19
- const { activeDrawer, navigationOpen, navigation, expandedDrawerId, setExpandedDrawerId, navigationAnimationDisabled, activeAiDrawerId, aiDrawerExpandedMode, aiDrawer, activeAiDrawerSize, minAiDrawerSize, maxAiDrawerSize, onActiveAiDrawerResize, aiDrawerFocusControl, ariaLabels, isMobile, drawersOpenQueue, onActiveAiDrawerChange, activeAiDrawer, } = appLayoutState.widgetizedState;
19
+ const { activeDrawer, navigationOpen, navigation, expandedDrawerId, setExpandedDrawerId, navigationAnimationDisabled, activeAiDrawerId, aiDrawerExpandedMode, aiDrawer, activeAiDrawerSize, minAiDrawerSize, maxAiDrawerSize, onActiveAiDrawerResize, aiDrawerFocusControl, ariaLabels, isMobile, drawersOpenQueue, onActiveAiDrawerChange, activeAiDrawer, bottomDrawerReportedSize, } = appLayoutState.widgetizedState;
20
20
  const drawerExpandedMode = !!expandedDrawerId;
21
21
  const toolsOpen = !!activeDrawer;
22
22
  // Must use `toolbarProps` because all layouts have to apply this mode, not just the one with toolbar
@@ -42,7 +42,7 @@ export const BeforeMainSlotImplementation = ({ toolbarProps, appLayoutState, app
42
42
  setExpandedDrawerId,
43
43
  } })))))),
44
44
  navigation && (React.createElement("div", { className: clsx(styles.navigation, !navigationOpen && styles['panel-hidden'], toolsOpen && styles['unfocusable-mobile'], !navigationAnimationDisabled && sharedStyles['with-motion-horizontal'], (drawerExpandedMode || drawerExpandedModeInChildLayout) && styles.hidden) },
45
- React.createElement(AppLayoutNavigation, { appLayoutInternals: appLayoutState.appLayoutInternals })))));
45
+ React.createElement(AppLayoutNavigation, { appLayoutInternals: appLayoutState.appLayoutInternals, bottomDrawerReportedSize: bottomDrawerReportedSize })))));
46
46
  };
47
47
  export const createWidgetizedAppLayoutBeforeMainSlot = createWidgetizedComponent(BeforeMainSlotImplementation, BeforeMainSlotSkeleton);
48
48
  //# sourceMappingURL=before-main-slot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"before-main-slot.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.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,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,qCAAqC,EAAE,MAAM,4BAA4B,CAAC;AACnF,OAAO,EAAE,iCAAiC,IAAI,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;A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AY,CAAC,wBAAwB,CAAC,EACtE,CAAC,kBAAkB,IAAI,+BAA+B,CAAC,IAAI,MAAM,CAAC,MAAM,CACzE;YAED,oBAAC,mBAAmB,IAAC,kBAAkB,EAAE,cAAc,CAAC,kBAAkB,GAAI,CAC1E,CACP,CACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uCAAuC,GAAG,yBAAyB,CAC9E,4BAA4B,EAC5B,sBAAsB,CACvB,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 { createWidgetizedComponent } from '../../../internal/widgets';\nimport { ActiveDrawersContext } from '../../utils/visibility-context';\nimport { AppLayoutGlobalAiDrawerImplementation } from '../drawer/global-ai-drawer';\nimport { AppLayoutNavigationImplementation as AppLayoutNavigation } from '../navigation';\nimport { SkeletonPartProps } from '../skeleton/interfaces';\nimport { BeforeMainSlotSkeleton } from '../skeleton/skeleton-parts';\nimport { isWidgetReady } from '../state/invariants';\nimport { AppLayoutToolbarImplementation as AppLayoutToolbar } from '../toolbar';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport styles from '../skeleton/styles.css.js';\n\nexport const BeforeMainSlotImplementation = ({ toolbarProps, appLayoutState, appLayoutProps }: SkeletonPartProps) => {\n const wasAiDrawerOpenRef = useRef(false);\n if (!isWidgetReady(appLayoutState)) {\n return (\n <BeforeMainSlotSkeleton\n toolbarProps={toolbarProps}\n appLayoutProps={appLayoutProps}\n appLayoutState={appLayoutState}\n />\n );\n }\n const {\n activeDrawer,\n navigationOpen,\n navigation,\n expandedDrawerId,\n setExpandedDrawerId,\n navigationAnimationDisabled,\n activeAiDrawerId,\n aiDrawerExpandedMode,\n aiDrawer,\n activeAiDrawerSize,\n minAiDrawerSize,\n maxAiDrawerSize,\n onActiveAiDrawerResize,\n aiDrawerFocusControl,\n ariaLabels,\n isMobile,\n drawersOpenQueue,\n onActiveAiDrawerChange,\n activeAiDrawer,\n } = appLayoutState.widgetizedState;\n const drawerExpandedMode = !!expandedDrawerId;\n const toolsOpen = !!activeDrawer;\n // Must use `toolbarProps` because all layouts have to apply this mode, not just the one with toolbar\n const drawerExpandedModeInChildLayout = !!toolbarProps?.expandedDrawerId;\n const { __embeddedViewMode: embeddedViewMode } = appLayoutProps as any;\n return (\n <>\n {!!toolbarProps && !embeddedViewMode && !aiDrawerExpandedMode && (\n <AppLayoutToolbar appLayoutInternals={appLayoutState.appLayoutInternals} toolbarProps={toolbarProps} />\n )}\n {aiDrawer && (\n <div\n className={clsx(\n styles['ai-drawer'],\n (drawerExpandedMode || drawerExpandedModeInChildLayout) && !aiDrawerExpandedMode && styles.hidden\n )}\n >\n <ActiveDrawersContext.Provider value={activeAiDrawer ? [activeAiDrawer.id] : []}>\n {(!!activeAiDrawerId || (aiDrawer?.preserveInactiveContent && wasAiDrawerOpenRef.current)) && (\n <>\n {(wasAiDrawerOpenRef.current = true)}\n <AppLayoutGlobalAiDrawerImplementation\n show={!!activeAiDrawerId}\n activeAiDrawer={aiDrawer ?? null}\n appLayoutInternals={appLayoutState.appLayoutInternals}\n aiDrawerProps={{\n activeAiDrawerSize: activeAiDrawerSize!,\n minAiDrawerSize: minAiDrawerSize!,\n maxAiDrawerSize: maxAiDrawerSize!,\n aiDrawer: aiDrawer!,\n ariaLabels,\n aiDrawerFocusControl,\n isMobile,\n drawersOpenQueue,\n onActiveAiDrawerChange,\n onActiveDrawerResize: ({ size }) => onActiveAiDrawerResize(size),\n expandedDrawerId,\n setExpandedDrawerId,\n }}\n />\n </>\n )}\n </ActiveDrawersContext.Provider>\n </div>\n )}\n {navigation && (\n <div\n className={clsx(\n styles.navigation,\n !navigationOpen && styles['panel-hidden'],\n toolsOpen && styles['unfocusable-mobile'],\n !navigationAnimationDisabled && sharedStyles['with-motion-horizontal'],\n (drawerExpandedMode || drawerExpandedModeInChildLayout) && styles.hidden\n )}\n >\n <AppLayoutNavigation appLayoutInternals={appLayoutState.appLayoutInternals} />\n </div>\n )}\n </>\n );\n};\n\nexport const createWidgetizedAppLayoutBeforeMainSlot = createWidgetizedComponent(\n BeforeMainSlotImplementation,\n BeforeMainSlotSkeleton\n);\n"]}
1
+ {"version":3,"file":"before-main-slot.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.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,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,qCAAqC,EAAE,MAAM,4BAA4B,CAAC;AACnF,OAAO,EAAE,iCAAiC,IAAI,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,8BAA8B,IAAI,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEhF,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAE/C,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAqB,EAAE,EAAE;IAClH,MAAM,kBAAkB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACzC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE;QAClC,OAAO,CACL,oBAAC,sBAAsB,IACrB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;KACH;IACD,MAAM,EACJ,YAAY,EACZ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OAAO,GAAG,IAAI,CAAC;gBACpC,oBAAC,qCAAqC,IACpC,IAAI,EAAE,CAAC,CAAC,gBAAgB,EACxB,cAAc,EAAE,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,IAAI,EAChC,kBAAkB,EAAE,cAAc,CAAC,kBAAkB,EACrD,aAAa,EAAE;wBACb,kBAAkB,EAAE,kBAAmB;wBACvC,eAAe,EAAE,eAAgB;wBACjC,eAAe,EAAE,eAAgB;wBACjC,QAAQ,EAAE,QAAS;wBACnB,UAAU;wBACV,oBAAoB;wBACpB,QAAQ;wBACR,gBAAgB;wBAChB,sBAAsB;wBACtB,oBAAoB,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,sBAAsB,CAAC,IAAI,CAAC;wBAChE,gBAAgB;wBAChB,mBAAmB;qBACpB,GACD,CACD,CACJ,CAC6B,CAC5B,CACP;QACA,UAAU,IAAI,CACb,6BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,UAAU,EACjB,CAAC,cAAc,IAAI,MAAM,CAAC,cAAc,CAAC,EACzC,SAAS,IAAI,MAAM,CAAC,oBAAoB,CAAC,EACzC,CAAC,2BAA2B,IAAI,YAAY,CAAC,wBAAwB,CAAC,EACtE,CAAC,kBAAkB,IAAI,+BAA+B,CAAC,IAAI,MAAM,CAAC,MAAM,CACzE;YAED,oBAAC,mBAAmB,IAClB,kBAAkB,EAAE,cAAc,CAAC,kBAAkB,EACrD,wBAAwB,EAAE,wBAAwB,GAClD,CACE,CACP,CACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uCAAuC,GAAG,yBAAyB,CAC9E,4BAA4B,EAC5B,sBAAsB,CACvB,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 { createWidgetizedComponent } from '../../../internal/widgets';\nimport { ActiveDrawersContext } from '../../utils/visibility-context';\nimport { AppLayoutGlobalAiDrawerImplementation } from '../drawer/global-ai-drawer';\nimport { AppLayoutNavigationImplementation as AppLayoutNavigation } from '../navigation';\nimport { SkeletonPartProps } from '../skeleton/interfaces';\nimport { BeforeMainSlotSkeleton } from '../skeleton/skeleton-parts';\nimport { isWidgetReady } from '../state/invariants';\nimport { AppLayoutToolbarImplementation as AppLayoutToolbar } from '../toolbar';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport styles from '../skeleton/styles.css.js';\n\nexport const BeforeMainSlotImplementation = ({ toolbarProps, appLayoutState, appLayoutProps }: SkeletonPartProps) => {\n const wasAiDrawerOpenRef = useRef(false);\n if (!isWidgetReady(appLayoutState)) {\n return (\n <BeforeMainSlotSkeleton\n toolbarProps={toolbarProps}\n appLayoutProps={appLayoutProps}\n appLayoutState={appLayoutState}\n />\n );\n }\n const {\n activeDrawer,\n navigationOpen,\n navigation,\n expandedDrawerId,\n setExpandedDrawerId,\n navigationAnimationDisabled,\n activeAiDrawerId,\n aiDrawerExpandedMode,\n aiDrawer,\n activeAiDrawerSize,\n minAiDrawerSize,\n maxAiDrawerSize,\n onActiveAiDrawerResize,\n aiDrawerFocusControl,\n ariaLabels,\n isMobile,\n drawersOpenQueue,\n onActiveAiDrawerChange,\n activeAiDrawer,\n bottomDrawerReportedSize,\n } = appLayoutState.widgetizedState;\n const drawerExpandedMode = !!expandedDrawerId;\n const toolsOpen = !!activeDrawer;\n // Must use `toolbarProps` because all layouts have to apply this mode, not just the one with toolbar\n const drawerExpandedModeInChildLayout = !!toolbarProps?.expandedDrawerId;\n const { __embeddedViewMode: embeddedViewMode } = appLayoutProps as any;\n return (\n <>\n {!!toolbarProps && !embeddedViewMode && !aiDrawerExpandedMode && (\n <AppLayoutToolbar appLayoutInternals={appLayoutState.appLayoutInternals} toolbarProps={toolbarProps} />\n )}\n {aiDrawer && (\n <div\n className={clsx(\n styles['ai-drawer'],\n (drawerExpandedMode || drawerExpandedModeInChildLayout) && !aiDrawerExpandedMode && styles.hidden\n )}\n >\n <ActiveDrawersContext.Provider value={activeAiDrawer ? [activeAiDrawer.id] : []}>\n {(!!activeAiDrawerId || (aiDrawer?.preserveInactiveContent && wasAiDrawerOpenRef.current)) && (\n <>\n {(wasAiDrawerOpenRef.current = true)}\n <AppLayoutGlobalAiDrawerImplementation\n show={!!activeAiDrawerId}\n activeAiDrawer={aiDrawer ?? null}\n appLayoutInternals={appLayoutState.appLayoutInternals}\n aiDrawerProps={{\n activeAiDrawerSize: activeAiDrawerSize!,\n minAiDrawerSize: minAiDrawerSize!,\n maxAiDrawerSize: maxAiDrawerSize!,\n aiDrawer: aiDrawer!,\n ariaLabels,\n aiDrawerFocusControl,\n isMobile,\n drawersOpenQueue,\n onActiveAiDrawerChange,\n onActiveDrawerResize: ({ size }) => onActiveAiDrawerResize(size),\n expandedDrawerId,\n setExpandedDrawerId,\n }}\n />\n </>\n )}\n </ActiveDrawersContext.Provider>\n </div>\n )}\n {navigation && (\n <div\n className={clsx(\n styles.navigation,\n !navigationOpen && styles['panel-hidden'],\n toolsOpen && styles['unfocusable-mobile'],\n !navigationAnimationDisabled && sharedStyles['with-motion-horizontal'],\n (drawerExpandedMode || drawerExpandedModeInChildLayout) && styles.hidden\n )}\n >\n <AppLayoutNavigation\n appLayoutInternals={appLayoutState.appLayoutInternals}\n bottomDrawerReportedSize={bottomDrawerReportedSize}\n />\n </div>\n )}\n </>\n );\n};\n\nexport const createWidgetizedAppLayoutBeforeMainSlot = createWidgetizedComponent(\n BeforeMainSlotImplementation,\n BeforeMainSlotSkeleton\n);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"bottom-content-slot.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/widget-areas/bottom-content-slot.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAM3D,eAAO,MAAM,+BAA+B,uCAAwC,iBAAiB,uBAmBpG,CAAC;AAEF,eAAO,MAAM,0CAA0C,kDArB6B,iBAAiB,8EAAjB,iBAAiB,uBAqBe,CAAC"}
1
+ {"version":3,"file":"bottom-content-slot.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/widget-areas/bottom-content-slot.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAO3D,eAAO,MAAM,+BAA+B,uCAAwC,iBAAiB,uBA0BpG,CAAC;AAEF,eAAO,MAAM,0CAA0C,kDA5B6B,iBAAiB,8EAAjB,iBAAiB,uBA4Be,CAAC"}
@@ -1,16 +1,20 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import React from 'react';
4
+ import clsx from 'clsx';
4
5
  import { createWidgetizedComponent } from '../../../internal/widgets';
5
6
  import { AppLayoutSplitPanelDrawerBottomImplementation as AppLayoutSplitPanelBottom } from '../split-panel';
6
7
  import { isWidgetReady } from '../state/invariants';
8
+ import sharedStyles from '../../resize/styles.css.js';
7
9
  import styles from '../skeleton/styles.css.js';
8
10
  export const BottomContentSlotImplementation = ({ appLayoutState, appLayoutProps }) => {
9
11
  if (!isWidgetReady(appLayoutState)) {
10
12
  return null;
11
13
  }
12
- const { splitPanelPosition, placement } = appLayoutState.widgetizedState;
13
- return (React.createElement(React.Fragment, null, splitPanelPosition === 'bottom' && (React.createElement("div", { className: styles['split-panel-bottom'], style: { insetBlockEnd: placement.insetBlockEnd } },
14
+ const { splitPanelPosition, placement, activeGlobalBottomDrawerId, bottomDrawerReportedSize, isMobile } = appLayoutState.widgetizedState;
15
+ return (React.createElement(React.Fragment, null, splitPanelPosition === 'bottom' && (React.createElement("div", { className: clsx(styles['split-panel-bottom'], sharedStyles['with-motion-vertical']), style: {
16
+ insetBlockEnd: placement.insetBlockEnd + (activeGlobalBottomDrawerId && !isMobile ? bottomDrawerReportedSize : 0),
17
+ } },
14
18
  React.createElement(AppLayoutSplitPanelBottom, { appLayoutInternals: appLayoutState.appLayoutInternals, splitPanelInternals: appLayoutState.splitPanelInternals }, appLayoutProps.splitPanel)))));
15
19
  };
16
20
  export const createWidgetizedAppLayoutBottomContentSlot = createWidgetizedComponent(BottomContentSlotImplementation);
@@ -1 +1 @@
1
- {"version":3,"file":"bottom-content-slot.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/widget-areas/bottom-content-slot.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,6CAA6C,IAAI,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC5G,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAE/C,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,EAAE,cAAc,EAAE,cAAc,EAAqB,EAAE,EAAE;IACvG,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE;QAClC,OAAO,IAAI,CAAC;KACb;IACD,MAAM,EAAE,kBAAkB,EAAE,SAAS,EAAE,GAAG,cAAc,CAAC,eAAe,CAAC;IACzE,OAAO,CACL,0CACG,kBAAkB,KAAK,QAAQ,IAAI,CAClC,6BAAK,SAAS,EAAE,MAAM,CAAC,oBAAoB,CAAC,EAAE,KAAK,EAAE,EAAE,aAAa,EAAE,SAAS,CAAC,aAAa,EAAE;QAC7F,oBAAC,yBAAyB,IACxB,kBAAkB,EAAE,cAAc,CAAC,kBAAkB,EACrD,mBAAmB,EAAE,cAAc,CAAC,mBAAmB,IAEtD,cAAc,CAAC,UAAU,CACA,CACxB,CACP,CACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,0CAA0C,GAAG,yBAAyB,CAAC,+BAA+B,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';\nimport { SkeletonPartProps } from '../skeleton/interfaces';\nimport { AppLayoutSplitPanelDrawerBottomImplementation as AppLayoutSplitPanelBottom } from '../split-panel';\nimport { isWidgetReady } from '../state/invariants';\n\nimport styles from '../skeleton/styles.css.js';\n\nexport const BottomContentSlotImplementation = ({ appLayoutState, appLayoutProps }: SkeletonPartProps) => {\n if (!isWidgetReady(appLayoutState)) {\n return null;\n }\n const { splitPanelPosition, placement } = appLayoutState.widgetizedState;\n return (\n <>\n {splitPanelPosition === 'bottom' && (\n <div className={styles['split-panel-bottom']} style={{ insetBlockEnd: placement.insetBlockEnd }}>\n <AppLayoutSplitPanelBottom\n appLayoutInternals={appLayoutState.appLayoutInternals}\n splitPanelInternals={appLayoutState.splitPanelInternals}\n >\n {appLayoutProps.splitPanel}\n </AppLayoutSplitPanelBottom>\n </div>\n )}\n </>\n );\n};\n\nexport const createWidgetizedAppLayoutBottomContentSlot = createWidgetizedComponent(BottomContentSlotImplementation);\n"]}
1
+ {"version":3,"file":"bottom-content-slot.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/widget-areas/bottom-content-slot.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,6CAA6C,IAAI,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC5G,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAE/C,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,EAAE,cAAc,EAAE,cAAc,EAAqB,EAAE,EAAE;IACvG,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE;QAClC,OAAO,IAAI,CAAC;KACb;IACD,MAAM,EAAE,kBAAkB,EAAE,SAAS,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,QAAQ,EAAE,GACrG,cAAc,CAAC,eAAe,CAAC;IACjC,OAAO,CACL,0CACG,kBAAkB,KAAK,QAAQ,IAAI,CAClC,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,YAAY,CAAC,sBAAsB,CAAC,CAAC,EACnF,KAAK,EAAE;YACL,aAAa,EACX,SAAS,CAAC,aAAa,GAAG,CAAC,0BAA0B,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAC;SACrG;QAED,oBAAC,yBAAyB,IACxB,kBAAkB,EAAE,cAAc,CAAC,kBAAkB,EACrD,mBAAmB,EAAE,cAAc,CAAC,mBAAmB,IAEtD,cAAc,CAAC,UAAU,CACA,CACxB,CACP,CACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,0CAA0C,GAAG,yBAAyB,CAAC,+BAA+B,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { SkeletonPartProps } from '../skeleton/interfaces';\nimport { AppLayoutSplitPanelDrawerBottomImplementation as AppLayoutSplitPanelBottom } from '../split-panel';\nimport { isWidgetReady } from '../state/invariants';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport styles from '../skeleton/styles.css.js';\n\nexport const BottomContentSlotImplementation = ({ appLayoutState, appLayoutProps }: SkeletonPartProps) => {\n if (!isWidgetReady(appLayoutState)) {\n return null;\n }\n const { splitPanelPosition, placement, activeGlobalBottomDrawerId, bottomDrawerReportedSize, isMobile } =\n appLayoutState.widgetizedState;\n return (\n <>\n {splitPanelPosition === 'bottom' && (\n <div\n className={clsx(styles['split-panel-bottom'], sharedStyles['with-motion-vertical'])}\n style={{\n insetBlockEnd:\n placement.insetBlockEnd + (activeGlobalBottomDrawerId && !isMobile ? bottomDrawerReportedSize : 0),\n }}\n >\n <AppLayoutSplitPanelBottom\n appLayoutInternals={appLayoutState.appLayoutInternals}\n splitPanelInternals={appLayoutState.splitPanelInternals}\n >\n {appLayoutProps.splitPanel}\n </AppLayoutSplitPanelBottom>\n </div>\n )}\n </>\n );\n};\n\nexport const createWidgetizedAppLayoutBottomContentSlot = createWidgetizedComponent(BottomContentSlotImplementation);\n"]}
@@ -15,6 +15,7 @@ export declare namespace AttributeEditorProps {
15
15
  type FieldRenderable<T> = (item: T, itemIndex: number) => React.ReactNode;
16
16
  interface FieldDefinition<T> {
17
17
  label?: React.ReactNode;
18
+ description?: React.ReactNode;
18
19
  info?: React.ReactNode;
19
20
  control?: FieldRenderable<T> | React.ReactNode;
20
21
  errorText?: FieldRenderable<T> | React.ReactNode;
@@ -109,6 +110,7 @@ export interface AttributeEditorProps<T> extends BaseComponentProps {
109
110
  * If more than 6 attributes are specified, a `gridLayout` must be provided.
110
111
  *
111
112
  * * `label` (ReactNode) - Text label for the form field.
113
+ * * `description` (ReactNode) - Additional description for the form field.
112
114
  * * `info` (ReactNode) - Info link for the form field.
113
115
  * * `errorText` ((item, itemIndex) => ReactNode) - Error message text to display as a control validation message.
114
116
  * It renders the form field as invalid if the returned value is not `null` or `undefined`.
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/attribute-editor/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,M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;;;OAIG;IACH,gBAAgB,CAAC,EAAE,oBAAoB,CAAC,gBAAgB,CAAC;IAEzD;;;;;;;;;;;;;OAaG;IACH,UAAU,EAAE,aAAa,CAAC,oBAAoB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IAEnE;;;;;;;;;;;;;OAaG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAE5D;;;;;;;;;;;;;OAaG;IACH,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IAEvF;;OAEG;IACH,gBAAgB,CAAC,EAAE,yBAAyB,CAAC;IAE7C;;;OAGG;IACH,mBAAmB,CAAC,EAAE,yBAAyB,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,CAAC;IAE9F;;OAEG;IACH,WAAW,CAAC,EAAE,oBAAoB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;CACnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/attribute-editor/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\nimport { ButtonDropdownProps } from '../button-dropdown/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { Breakpoint as InternalBreakpoint } from '../internal/breakpoints';\nimport { NonCancelableEventHandler } from '../internal/events';\n\n/*\n * HACK: Cast the component to a named parametrized interface.\n *\n * This lets us use React.forwardRef and still let the component have type\n * parameters, and the naming convention lets the documenter know that this is\n * a forwardRef-wrapped component.\n *\n * We don't need to expose this type to customers because it's just a simple\n * function type.\n */\nexport interface AttributeEditorForwardRefType {\n <T>(props: AttributeEditorProps<T> & { ref?: React.Ref<AttributeEditorProps.Ref> }): JSX.Element;\n}\n\nexport namespace AttributeEditorProps {\n export interface IsItemRemovableFunction<T> {\n (item: T): boolean;\n }\n\n export type FieldRenderable<T> = (item: T, itemIndex: number) => React.ReactNode;\n export interface FieldDefinition<T> {\n label?: React.ReactNode;\n info?: React.ReactNode;\n control?: FieldRenderable<T> | React.ReactNode;\n errorText?: FieldRenderable<T> | React.ReactNode;\n warningText?: FieldRenderable<T> | React.ReactNode;\n constraintText?: FieldRenderable<T> | React.ReactNode;\n }\n\n export type AddButtonVariant = 'normal' | 'inline-link';\n\n export interface RemoveButtonClickDetail {\n itemIndex: number;\n }\n\n export interface Ref {\n /**\n * Focuses the 'remove' button for the given row index.\n */\n focusRemoveButton(itemIndex: number): void;\n /**\n * Focuses the 'add' button. Use this, for example, after a user removes the last row.\n */\n focusAddButton(): void;\n }\n\n export interface RowActionsProps<T> {\n item: T;\n itemIndex: number;\n ref: React.Ref<ButtonDropdownProps.Ref>;\n breakpoint: Breakpoint | null;\n ownRow: boolean;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n export interface I18nStrings<T = any> {\n errorIconAriaLabel?: string;\n warningIconAriaLabel?: string;\n itemRemovedAriaLive?: string;\n\n /**\n * @deprecated Use `removeButtonAriaLabel` on the component instead.\n */\n removeButtonAriaLabel?: (item: T) => string;\n }\n\n export type Breakpoint = InternalBreakpoint;\n\n export interface GridLayout {\n breakpoint?: Breakpoint;\n rows: ReadonlyArray<ReadonlyArray<number>>;\n removeButton?: {\n ownRow?: boolean;\n width?: number | 'auto';\n };\n }\n}\n\nexport interface AttributeEditorProps<T> extends BaseComponentProps {\n /**\n * Displayed when there are no items to display.\n */\n empty?: React.ReactNode;\n\n /**\n * Displayed below the add button. Use it for additional information related to the attribute editor.\n */\n additionalInfo?: React.ReactNode;\n\n /**\n * Specifies the text that's displayed in the add button.\n */\n addButtonText: string;\n\n /**\n * Specifies the text that's displayed in the remove button.\n * @i18n\n */\n removeButtonText?: string;\n\n /**\n * Adds an `aria-label` to the remove button.\n */\n removeButtonAriaLabel?: (item: T) => string;\n\n /**\n * Specifies the items that serve as the data source for all rows.\n * The display of a row is handled by the `definition` property.\n */\n items?: ReadonlyArray<T>;\n\n /**\n * Function that determines whether an item is removable. When this function returns `false`, the remove\n * button is not rendered and the user can't remove the item.\n * By default, all items are removable.\n */\n isItemRemovable?: AttributeEditorProps.IsItemRemovableFunction<T>;\n\n /**\n * Determines whether the add button is disabled.\n */\n disableAddButton?: boolean;\n\n /**\n * Specifies the variant to use for the add button. By default a normal button is used.\n * Use `inline-link` when using an attribute editor nested inside complex attribute editing\n * with expandable sections.\n */\n addButtonVariant?: AttributeEditorProps.AddButtonVariant;\n\n /**\n * Defines the editor configuration. Each object in the array represents one form field in the row.\n * If more than 6 attributes are specified, a `gridLayout` must be provided.\n *\n * * `label` (ReactNode) - Text label for the form field.\n * * `info` (ReactNode) - Info link for the form field.\n * * `errorText` ((item, itemIndex) => ReactNode) - Error message text to display as a control validation message.\n * It renders the form field as invalid if the returned value is not `null` or `undefined`.\n * * `warningText` ((item, itemIndex) => ReactNode) - Warning message text to display as a control validation message.\n * It renders the form field in a warning state if the returned value is not `null` or `undefined`.\n * * `constraintText` ((item, itemIndex) => ReactNode) - Text to display as a constraint message below the field.\n * * `control` ((item, itemIndex) => ReactNode) - A control to use as the input for the field.\n */\n definition: ReadonlyArray<AttributeEditorProps.FieldDefinition<T>>;\n\n /**\n * Optionally specifies the layout of the attributes. By default, all attributes will be\n * equally spaced and wrapped into multiple rows on smaller viewports.\n *\n * A `gridLayout` is an array of breakpoint definitions. Each definition consists of:\n * - `rows` (`number[][]`): the rows in which to display the attributes. Each row consists of a list of numbers indicating\n * the relative width of each attribute. For example, `[[1, 1, 1, 1]]` is a single row of four evenly-spaced attributes,\n * or `[[1, 2], [1, 1, 1]]` splits five attributes onto two rows.\n * - `breakpoint` (`string`): optionally specifies that the given entry should only be used when at least that much width is available.\n * - `removeButton`: optionally configures the remove (or row action) button placement. If this is not provided, the button will be\n * placed at the end of a single row, or below if multiple rows are present. The `removeButton` property supports contains two properties:\n * - `ownRow` (`boolean`): forces the remove button onto its own row.\n * - `width` (`number | 'auto'`): a number indicating the relative width (equivalent to a `rows` entry), or 'auto' to fit to the button width.\n */\n gridLayout?: ReadonlyArray<AttributeEditorProps.GridLayout>;\n\n /**\n * Specifies a custom action trigger for each row, in place of the remove button.\n * Only button and button dropdown components are supported.\n * If you provide this, `removeButtonText`, `removeButtonAriaLabel`,\n * and `onRemoveButtonClick` will be ignored.\n * The trigger must be given the provided `ref` in order for `focusRemoveButton`\n * to work.\n * The function receives the following properties:\n * - `item`: The item being rendered in the current row.\n * - `itemIndex` (`number`): The index of the item.\n * - `ref` (`ReactRef`): A React ref that should be passed to the rendered button.\n * - `breakpoint` (`Breakpoint`): The current breakpoint, for responsive behavior.\n * - `ownRow` (`boolean`): Whether the button is rendered on its own row.\n */\n customRowActions?: (props: AttributeEditorProps.RowActionsProps<T>) => React.ReactNode;\n\n /**\n * Called when add button is clicked.\n */\n onAddButtonClick?: NonCancelableEventHandler;\n\n /**\n * Called when remove button is clicked.\n * The event `detail` contains the index of the corresponding item.\n */\n onRemoveButtonClick?: NonCancelableEventHandler<AttributeEditorProps.RemoveButtonClickDetail>;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n */\n i18nStrings?: AttributeEditorProps.I18nStrings<T>;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/attribute-editor/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\nimport { ButtonDropdownProps } from '../button-dropdown/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { Breakpoint as InternalBreakpoint } from '../internal/breakpoints';\nimport { NonCancelableEventHandler } from '../internal/events';\n\n/*\n * HACK: Cast the component to a named parametrized interface.\n *\n * This lets us use React.forwardRef and still let the component have type\n * parameters, and the naming convention lets the documenter know that this is\n * a forwardRef-wrapped component.\n *\n * We don't need to expose this type to customers because it's just a simple\n * function type.\n */\nexport interface AttributeEditorForwardRefType {\n <T>(props: AttributeEditorProps<T> & { ref?: React.Ref<AttributeEditorProps.Ref> }): JSX.Element;\n}\n\nexport namespace AttributeEditorProps {\n export interface IsItemRemovableFunction<T> {\n (item: T): boolean;\n }\n\n export type FieldRenderable<T> = (item: T, itemIndex: number) => React.ReactNode;\n export interface FieldDefinition<T> {\n label?: React.ReactNode;\n description?: React.ReactNode;\n info?: React.ReactNode;\n control?: FieldRenderable<T> | React.ReactNode;\n errorText?: FieldRenderable<T> | React.ReactNode;\n warningText?: FieldRenderable<T> | React.ReactNode;\n constraintText?: FieldRenderable<T> | React.ReactNode;\n }\n\n export type AddButtonVariant = 'normal' | 'inline-link';\n\n export interface RemoveButtonClickDetail {\n itemIndex: number;\n }\n\n export interface Ref {\n /**\n * Focuses the 'remove' button for the given row index.\n */\n focusRemoveButton(itemIndex: number): void;\n /**\n * Focuses the 'add' button. Use this, for example, after a user removes the last row.\n */\n focusAddButton(): void;\n }\n\n export interface RowActionsProps<T> {\n item: T;\n itemIndex: number;\n ref: React.Ref<ButtonDropdownProps.Ref>;\n breakpoint: Breakpoint | null;\n ownRow: boolean;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n export interface I18nStrings<T = any> {\n errorIconAriaLabel?: string;\n warningIconAriaLabel?: string;\n itemRemovedAriaLive?: string;\n\n /**\n * @deprecated Use `removeButtonAriaLabel` on the component instead.\n */\n removeButtonAriaLabel?: (item: T) => string;\n }\n\n export type Breakpoint = InternalBreakpoint;\n\n export interface GridLayout {\n breakpoint?: Breakpoint;\n rows: ReadonlyArray<ReadonlyArray<number>>;\n removeButton?: {\n ownRow?: boolean;\n width?: number | 'auto';\n };\n }\n}\n\nexport interface AttributeEditorProps<T> extends BaseComponentProps {\n /**\n * Displayed when there are no items to display.\n */\n empty?: React.ReactNode;\n\n /**\n * Displayed below the add button. Use it for additional information related to the attribute editor.\n */\n additionalInfo?: React.ReactNode;\n\n /**\n * Specifies the text that's displayed in the add button.\n */\n addButtonText: string;\n\n /**\n * Specifies the text that's displayed in the remove button.\n * @i18n\n */\n removeButtonText?: string;\n\n /**\n * Adds an `aria-label` to the remove button.\n */\n removeButtonAriaLabel?: (item: T) => string;\n\n /**\n * Specifies the items that serve as the data source for all rows.\n * The display of a row is handled by the `definition` property.\n */\n items?: ReadonlyArray<T>;\n\n /**\n * Function that determines whether an item is removable. When this function returns `false`, the remove\n * button is not rendered and the user can't remove the item.\n * By default, all items are removable.\n */\n isItemRemovable?: AttributeEditorProps.IsItemRemovableFunction<T>;\n\n /**\n * Determines whether the add button is disabled.\n */\n disableAddButton?: boolean;\n\n /**\n * Specifies the variant to use for the add button. By default a normal button is used.\n * Use `inline-link` when using an attribute editor nested inside complex attribute editing\n * with expandable sections.\n */\n addButtonVariant?: AttributeEditorProps.AddButtonVariant;\n\n /**\n * Defines the editor configuration. Each object in the array represents one form field in the row.\n * If more than 6 attributes are specified, a `gridLayout` must be provided.\n *\n * * `label` (ReactNode) - Text label for the form field.\n * * `description` (ReactNode) - Additional description for the form field.\n * * `info` (ReactNode) - Info link for the form field.\n * * `errorText` ((item, itemIndex) => ReactNode) - Error message text to display as a control validation message.\n * It renders the form field as invalid if the returned value is not `null` or `undefined`.\n * * `warningText` ((item, itemIndex) => ReactNode) - Warning message text to display as a control validation message.\n * It renders the form field in a warning state if the returned value is not `null` or `undefined`.\n * * `constraintText` ((item, itemIndex) => ReactNode) - Text to display as a constraint message below the field.\n * * `control` ((item, itemIndex) => ReactNode) - A control to use as the input for the field.\n */\n definition: ReadonlyArray<AttributeEditorProps.FieldDefinition<T>>;\n\n /**\n * Optionally specifies the layout of the attributes. By default, all attributes will be\n * equally spaced and wrapped into multiple rows on smaller viewports.\n *\n * A `gridLayout` is an array of breakpoint definitions. Each definition consists of:\n * - `rows` (`number[][]`): the rows in which to display the attributes. Each row consists of a list of numbers indicating\n * the relative width of each attribute. For example, `[[1, 1, 1, 1]]` is a single row of four evenly-spaced attributes,\n * or `[[1, 2], [1, 1, 1]]` splits five attributes onto two rows.\n * - `breakpoint` (`string`): optionally specifies that the given entry should only be used when at least that much width is available.\n * - `removeButton`: optionally configures the remove (or row action) button placement. If this is not provided, the button will be\n * placed at the end of a single row, or below if multiple rows are present. The `removeButton` property supports contains two properties:\n * - `ownRow` (`boolean`): forces the remove button onto its own row.\n * - `width` (`number | 'auto'`): a number indicating the relative width (equivalent to a `rows` entry), or 'auto' to fit to the button width.\n */\n gridLayout?: ReadonlyArray<AttributeEditorProps.GridLayout>;\n\n /**\n * Specifies a custom action trigger for each row, in place of the remove button.\n * Only button and button dropdown components are supported.\n * If you provide this, `removeButtonText`, `removeButtonAriaLabel`,\n * and `onRemoveButtonClick` will be ignored.\n * The trigger must be given the provided `ref` in order for `focusRemoveButton`\n * to work.\n * The function receives the following properties:\n * - `item`: The item being rendered in the current row.\n * - `itemIndex` (`number`): The index of the item.\n * - `ref` (`ReactRef`): A React ref that should be passed to the rendered button.\n * - `breakpoint` (`Breakpoint`): The current breakpoint, for responsive behavior.\n * - `ownRow` (`boolean`): Whether the button is rendered on its own row.\n */\n customRowActions?: (props: AttributeEditorProps.RowActionsProps<T>) => React.ReactNode;\n\n /**\n * Called when add button is clicked.\n */\n onAddButtonClick?: NonCancelableEventHandler;\n\n /**\n * Called when remove button is clicked.\n * The event `detail` contains the index of the corresponding item.\n */\n onRemoveButtonClick?: NonCancelableEventHandler<AttributeEditorProps.RemoveButtonClickDetail>;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n */\n i18nStrings?: AttributeEditorProps.I18nStrings<T>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"row.d.ts","sourceRoot":"","sources":["../../../src/attribute-editor/row.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAK3C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAInD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CA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CAAC;IAClB,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9B,MAAM,EAAE,oBAAoB,CAAC,UAAU,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC;IACR,UAAU,EAAE,aAAa,CAAC,oBAAoB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IACnE,WAAW,EAAE,oBAAoB,CAAC,WAAW,GAAG,SAAS,CAAC;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,GAAG,SAAS,CAAC,CAAC;IACrD,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IACvF,mBAAmB,CAAC,EAAE,yBAAyB,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,CAAC;IAC9F,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;CAC7C;AAiBD,eAAO,MAAM,GAAG,6BAgGgB,WAAW,CAAC"}
@@ -39,9 +39,9 @@ export const Row = React.memo(({ breakpoint, item, definition, layout, i18nStrin
39
39
  ownRow: !removeButtonOnSameLine,
40
40
  });
41
41
  return (React.createElement("div", { className: clsx(styles.row, layout.rows.length === 1 && styles['single-row']), role: "group", "aria-labelledby": `${firstControlId}-label ${firstControlId}` },
42
- definition.map(({ info, label, constraintText, errorText, warningText, control }, defIndex) => {
42
+ definition.map(({ info, label, description, constraintText, errorText, warningText, control }, defIndex) => {
43
43
  ({ gridColumnStart, gridColumnEnd } = getItemGridColumns(layout, defIndex));
44
- return (React.createElement(InternalFormField, { key: defIndex, className: styles.field, __style: { gridColumnStart, gridColumnEnd }, label: label, info: info, constraintText: render(item, index, constraintText), errorText: render(item, index, errorText), warningText: render(item, index, warningText), stretch: true, i18nStrings: {
44
+ return (React.createElement(InternalFormField, { key: defIndex, className: styles.field, __style: { gridColumnStart, gridColumnEnd }, label: label, description: description, info: info, constraintText: render(item, index, constraintText), errorText: render(item, index, errorText), warningText: render(item, index, warningText), stretch: true, i18nStrings: {
45
45
  errorIconAriaLabel: i18nStrings.errorIconAriaLabel,
46
46
  warningIconAriaLabel: i18nStrings.warningIconAriaLabel,
47
47
  }, __hideLabel: index !== 0 && removeButtonOnSameLine, controlId: defIndex === 0 ? firstControlId : undefined }, render(item, index, control)));