@cloudscape-design/components-themeable 3.0.834 → 3.0.836

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 (65) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/app-layout/drawer/styles.scss +5 -0
  3. package/lib/internal/scss/app-layout/visual-refresh/drawers.scss +1 -0
  4. package/lib/internal/scss/app-layout/visual-refresh/navigation.scss +6 -0
  5. package/lib/internal/scss/app-layout/visual-refresh-toolbar/drawer/styles.scss +3 -4
  6. package/lib/internal/scss/app-layout/visual-refresh-toolbar/navigation/styles.scss +6 -0
  7. package/lib/internal/template/app-layout/drawer/index.d.ts.map +1 -1
  8. package/lib/internal/template/app-layout/drawer/index.js +3 -1
  9. package/lib/internal/template/app-layout/drawer/index.js.map +1 -1
  10. package/lib/internal/template/app-layout/drawer/styles.css.js +14 -13
  11. package/lib/internal/template/app-layout/drawer/styles.scoped.css +26 -21
  12. package/lib/internal/template/app-layout/drawer/styles.selectors.js +14 -13
  13. package/lib/internal/template/app-layout/split-panel/provider.d.ts +1 -0
  14. package/lib/internal/template/app-layout/split-panel/provider.d.ts.map +1 -1
  15. package/lib/internal/template/app-layout/split-panel/provider.js.map +1 -1
  16. package/lib/internal/template/app-layout/visual-refresh/navigation.js +1 -1
  17. package/lib/internal/template/app-layout/visual-refresh/navigation.js.map +1 -1
  18. package/lib/internal/template/app-layout/visual-refresh/styles.css.js +86 -85
  19. package/lib/internal/template/app-layout/visual-refresh/styles.scoped.css +168 -162
  20. package/lib/internal/template/app-layout/visual-refresh/styles.selectors.js +86 -85
  21. package/lib/internal/template/app-layout/visual-refresh-toolbar/compute-layout.d.ts +4 -1
  22. package/lib/internal/template/app-layout/visual-refresh-toolbar/compute-layout.d.ts.map +1 -1
  23. package/lib/internal/template/app-layout/visual-refresh-toolbar/compute-layout.js +4 -2
  24. package/lib/internal/template/app-layout/visual-refresh-toolbar/compute-layout.js.map +1 -1
  25. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts +2 -7
  26. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts.map +1 -1
  27. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.js +7 -6
  28. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.js.map +1 -1
  29. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.d.ts.map +1 -1
  30. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.js +8 -6
  31. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.js.map +1 -1
  32. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.css.js +10 -10
  33. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +12 -14
  34. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +10 -10
  35. package/lib/internal/template/app-layout/visual-refresh-toolbar/index.d.ts.map +1 -1
  36. package/lib/internal/template/app-layout/visual-refresh-toolbar/index.js +6 -1
  37. package/lib/internal/template/app-layout/visual-refresh-toolbar/index.js.map +1 -1
  38. package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.d.ts +8 -4
  39. package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.d.ts.map +1 -1
  40. package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.js.map +1 -1
  41. package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/index.js +5 -5
  42. package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/index.js.map +1 -1
  43. package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.css.js +5 -4
  44. package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.scoped.css +10 -5
  45. package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.selectors.js +5 -4
  46. package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.d.ts +1 -0
  47. package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.d.ts.map +1 -1
  48. package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.js +2 -2
  49. package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.js.map +1 -1
  50. package/lib/internal/template/app-layout/visual-refresh-toolbar/split-panel/index.d.ts +1 -1
  51. package/lib/internal/template/app-layout/visual-refresh-toolbar/split-panel/index.d.ts.map +1 -1
  52. package/lib/internal/template/app-layout/visual-refresh-toolbar/split-panel/index.js +7 -7
  53. package/lib/internal/template/app-layout/visual-refresh-toolbar/split-panel/index.js.map +1 -1
  54. package/lib/internal/template/internal/context/split-panel-context.d.ts +1 -0
  55. package/lib/internal/template/internal/context/split-panel-context.d.ts.map +1 -1
  56. package/lib/internal/template/internal/context/split-panel-context.js.map +1 -1
  57. package/lib/internal/template/internal/environment.js +1 -1
  58. package/lib/internal/template/internal/environment.json +1 -1
  59. package/lib/internal/template/split-panel/bottom.d.ts.map +1 -1
  60. package/lib/internal/template/split-panel/bottom.js +3 -2
  61. package/lib/internal/template/split-panel/bottom.js.map +1 -1
  62. package/lib/internal/template/split-panel/side.d.ts.map +1 -1
  63. package/lib/internal/template/split-panel/side.js +3 -2
  64. package/lib/internal/template/split-panel/side.js.map +1 -1
  65. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "926742deb0f8fd535a1395c20d2caa4116d1b0f4"
2
+ "commit": "89c8f435bbf69639e0fc84b39b7c783c4131f581"
3
3
  }
@@ -36,6 +36,8 @@
36
36
  position: fixed;
37
37
  overflow: auto;
38
38
  background-color: awsui.$color-background-layout-panel-content;
39
+ display: flex;
40
+ flex-direction: column;
39
41
  .drawer-mobile > & {
40
42
  z-index: constants.$drawer-z-index-mobile;
41
43
  inset: 0;
@@ -58,6 +60,9 @@
58
60
  block-size: 100%;
59
61
  position: relative;
60
62
  }
63
+ > .drawer-content-wrapper {
64
+ flex: 1;
65
+ }
61
66
  }
62
67
 
63
68
  .drawer-triggers-wrapper {
@@ -142,6 +142,7 @@
142
142
 
143
143
  > .drawer-content {
144
144
  grid-column: 1 / span 4;
145
+ block-size: var(#{custom-props.$contentHeight});
145
146
  &.drawer-content-hidden {
146
147
  display: none;
147
148
  }
@@ -93,6 +93,8 @@ nav.navigation {
93
93
  word-wrap: break-word;
94
94
  pointer-events: auto;
95
95
  border-inline-end: solid awsui.$border-divider-section-width awsui.$color-border-divider-default;
96
+ display: flex;
97
+ flex-direction: column;
96
98
 
97
99
  // Animation for the Navigation opacity and width when it is added to the DOM
98
100
  @keyframes openNavigation {
@@ -132,6 +134,10 @@ nav.navigation {
132
134
  inline-size: var(#{custom-props.$navigationWidth});
133
135
  }
134
136
 
137
+ & > .content-container {
138
+ flex-grow: 1;
139
+ }
140
+
135
141
  // The Navigation drawer will take up the entire viewport on mobile
136
142
  @include styles.media-breakpoint-down(styles.$breakpoint-x-small) {
137
143
  #{custom-props.$navigationWidth}: 100vw;
@@ -49,10 +49,8 @@
49
49
 
50
50
  &.drawer-global {
51
51
  @include mobile-only {
52
- display: none;
53
-
54
- &.last-opened {
55
- display: block;
52
+ &:not(.last-opened) {
53
+ display: none;
56
54
  }
57
55
  }
58
56
  }
@@ -73,6 +71,7 @@
73
71
  grid-column: 3;
74
72
  grid-row: 2;
75
73
  z-index: 1;
74
+ align-self: start;
76
75
  }
77
76
 
78
77
  > .drawer-content {
@@ -20,6 +20,8 @@
20
20
  overscroll-behavior-y: contain;
21
21
  word-wrap: break-word;
22
22
  pointer-events: auto;
23
+ display: flex;
24
+ flex-direction: column;
23
25
 
24
26
  // All content is hidden by the overflow-x property
25
27
  &:not(.is-navigation-open) {
@@ -28,6 +30,10 @@
28
30
  display: none;
29
31
  }
30
32
 
33
+ & > .content-container {
34
+ flex-grow: 1;
35
+ }
36
+
31
37
  /*
32
38
  A non-semantic node is added with a fixed width equal to the final Navigation
33
39
  width. This will create the visual appearance of horizontal movement and
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/drawer/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAWtC,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAsB1E,eAAO,MAAM,MAAM,2FAyGlB,CAAC;AAoDF,eAAO,MAAM,iBAAiB,4GAS3B,sBAAsB,gBAyFxB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/drawer/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAWtC,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAsB1E,eAAO,MAAM,MAAM,2FA4GlB,CAAC;AAoDF,eAAO,MAAM,iBAAiB,4GAS3B,sBAAsB,gBAyFxB,CAAC"}
@@ -62,7 +62,9 @@ export const Drawer = React.forwardRef(({ id, contentClassName, toggleClassName,
62
62
  [testutilStyles['drawer-closed']]: !isOpen,
63
63
  }) },
64
64
  !isMobile && !hideOpenButton && regularOpenButton,
65
- React.createElement(TagName, { className: clsx(resizeHandle && styles['drawer-resize-content']), "aria-label": mainLabel, "aria-hidden": !isOpen },
65
+ React.createElement(TagName, { className: clsx(resizeHandle && styles['drawer-resize-content'], styles['drawer-content-wrapper']), "aria-label": mainLabel, "aria-hidden": !isOpen, style: {
66
+ blockSize: `calc(100vh - ${(topOffset || 0) + (bottomOffset || 0)}px)`,
67
+ } },
66
68
  !isMobile && isOpen && React.createElement("div", { className: styles['resize-handle-wrapper'] }, resizeHandle),
67
69
  React.createElement(CloseButton, { ref: toggleRefs.close, className: closeClassName, ariaLabel: closeLabel, onClick: () => {
68
70
  onToggle(false);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app-layout/drawer/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAA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C,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;4BACnE,CAAC,CAAC,SAAS,GAEf,CACH,CAAC;gBACJ,CAAC,CAAC;gBACD,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,CAC3B,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC;oBACtC,oBAAC,YAAY,IACX,SAAS,EACP,oBAAoB,CAAC,CAAC,CAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,wBAAwB,CAAC,CAAC,CAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,eAAe,EAE3F,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,GACtD,CACE,CACP,CACG,CACA,CACT,CACG,CACF,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { useDensityMode } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getVisualContextClassname } from '../../internal/components/visual-context';\nimport { AppLayoutProps } from '../interfaces';\nimport { CloseButton, ToggleButton, togglesConfig } from '../toggles';\nimport { TOOLS_DRAWER_ID } from '../utils/use-drawers';\nimport { splitItems } from './drawers-helpers';\nimport { DesktopDrawerProps, DrawerTriggersBarProps } from './interfaces';\nimport OverflowMenu from './overflow-menu';\n\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\n// We are using two landmarks per drawer, i.e. two NAVs and two ASIDEs, because of several\n// known bugs in NVDA that cause focus changes within a container to sometimes not be\n// announced. As a result, we use one region for the open button and one region for the\n// actual drawer content, always hiding the other one when it's not visible.\n// An alternative solution to follow a more classic implementation here to only have one\n// button that triggers the opening/closing of the drawer also did not work due to another\n// series of bugs in NVDA (together with Firefox) which prevent the changed expanded state\n// from being announced.\n// Even with this workaround in place, the announcement of the close button when opening a\n// panel in NVDA is not working correctly. The suspected root cause is one of the bugs below\n// as well.\n// Relevant tickets:\n// * https://github.com/nvaccess/nvda/issues/6606\n// * https://github.com/nvaccess/nvda/issues/5825\n// * https://github.com/nvaccess/nvda/issues/5247\n// * https://github.com/nvaccess/nvda/pull/8869 (reverted PR that was going to fix it)\nexport const Drawer = React.forwardRef(\n (\n {\n id,\n contentClassName,\n toggleClassName,\n closeClassName,\n width,\n type,\n toggleRefs,\n topOffset,\n bottomOffset,\n ariaLabels,\n children,\n hideOpenButton,\n isOpen,\n isHidden,\n isMobile,\n onToggle,\n onClick,\n onLoseFocus,\n resizeHandle,\n }: DesktopDrawerProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n const openButtonWrapperRef = useRef<HTMLElement | null>(null);\n const { TagName, iconName } = togglesConfig[type];\n const { mainLabel, closeLabel, openLabel } = ariaLabels;\n const drawerContentWidthOpen = isMobile ? undefined : width;\n const drawerContentWidth = isOpen ? drawerContentWidthOpen : undefined;\n\n const regularOpenButton = (\n <TagName ref={openButtonWrapperRef} aria-label={mainLabel} className={styles.toggle} aria-hidden={isOpen}>\n <ToggleButton\n ref={toggleRefs.toggle}\n className={toggleClassName}\n iconName={iconName}\n ariaLabel={openLabel}\n onClick={() => onToggle(true)}\n ariaExpanded={isOpen ? undefined : false}\n />\n </TagName>\n );\n\n return (\n <div\n ref={ref}\n className={clsx(styles.drawer, {\n [styles.hide]: isHidden,\n [styles['drawer-closed']]: !isOpen,\n [styles['drawer-mobile']]: isMobile,\n })}\n style={{ width: drawerContentWidth }}\n onBlur={\n onLoseFocus\n ? e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n onLoseFocus(e);\n }\n }\n : undefined\n }\n onClick={event => {\n if (onClick) {\n onClick(event);\n }\n if (!isOpen) {\n // to prevent calling onToggle from the drawer when it's called from the toggle button\n if (\n openButtonWrapperRef.current === event.target ||\n !openButtonWrapperRef.current?.contains(event.target as Node)\n ) {\n onToggle(true);\n }\n }\n }}\n >\n <div\n id={id}\n style={{ width: drawerContentWidth, top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], styles['drawer-content-clickable'], contentClassName, {\n [testutilStyles['drawer-closed']]: !isOpen,\n })}\n >\n {!isMobile && !hideOpenButton && regularOpenButton}\n <TagName\n className={clsx(resizeHandle && styles['drawer-resize-content'])}\n aria-label={mainLabel}\n aria-hidden={!isOpen}\n >\n {!isMobile && isOpen && <div className={styles['resize-handle-wrapper']}>{resizeHandle}</div>}\n <CloseButton\n ref={toggleRefs.close}\n className={closeClassName}\n ariaLabel={closeLabel}\n onClick={() => {\n onToggle(false);\n }}\n />\n {children}\n </TagName>\n </div>\n </div>\n );\n }\n);\n\ninterface DrawerTriggerProps {\n testUtilsClassName?: string;\n ariaLabel: string | undefined;\n ariaExpanded: boolean;\n ariaControls?: string;\n badge: boolean | undefined;\n itemId?: string;\n isActive: boolean;\n trigger: AppLayoutProps.Drawer['trigger'];\n onClick: (() => void) | undefined;\n}\n\nconst DrawerTrigger = React.forwardRef(\n (\n {\n testUtilsClassName,\n ariaLabel,\n ariaExpanded,\n ariaControls,\n badge,\n itemId,\n isActive,\n trigger,\n onClick,\n }: DrawerTriggerProps,\n ref: React.Ref<{ focus: () => void }>\n ) => (\n <div\n className={clsx(\n styles['drawer-trigger'],\n isActive && styles['drawer-trigger-active'],\n isActive && getVisualContextClassname('app-layout-tools-drawer-trigger')\n )}\n onClick={onClick}\n >\n <ToggleButton\n ref={ref}\n className={testUtilsClassName}\n iconName={trigger!.iconName}\n iconSvg={trigger!.iconSvg}\n ariaLabel={ariaLabel}\n ariaExpanded={ariaExpanded}\n ariaControls={ariaControls}\n badge={badge}\n testId={itemId && `awsui-app-layout-trigger-${itemId}`}\n />\n </div>\n )\n);\n\nexport const DrawerTriggersBar = ({\n isMobile,\n topOffset,\n bottomOffset,\n activeDrawerId,\n ariaLabels,\n drawers,\n drawerRefs,\n onDrawerChange,\n}: DrawerTriggersBarProps) => {\n const containerRef = React.useRef<HTMLDivElement>(null);\n const previousActiveDrawerId = useRef(activeDrawerId);\n const [containerHeight, triggersContainerRef] = useContainerQuery(rect => rect.contentBoxHeight);\n const isCompactMode = useDensityMode(containerRef) === 'compact';\n\n if (activeDrawerId) {\n previousActiveDrawerId.current = activeDrawerId;\n }\n\n const getIndexOfOverflowItem = () => {\n if (containerHeight) {\n const ITEM_HEIGHT = isCompactMode ? 34 : 38;\n const overflowSpot = containerHeight / 1.5;\n\n const index = Math.floor(overflowSpot / ITEM_HEIGHT);\n\n return index;\n }\n return 0;\n };\n\n const { visibleItems, overflowItems } = splitItems(drawers, getIndexOfOverflowItem(), activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n <div\n className={clsx(styles.drawer, styles['drawer-closed'], testutilStyles['drawer-closed'], {\n [styles['drawer-mobile']]: isMobile,\n [styles.hide]: drawers.length === 1 && !!activeDrawerId,\n })}\n ref={containerRef}\n >\n <div\n ref={triggersContainerRef}\n style={{ top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], {\n [styles['drawer-content-clickable']]: drawers.length === 1,\n })}\n onClick={\n drawers.length === 1\n ? () => onDrawerChange(drawers[0].id !== activeDrawerId ? drawers[0].id : null)\n : undefined\n }\n >\n {!isMobile && (\n <aside aria-label={ariaLabels?.drawers} role=\"region\">\n <div className={styles['drawer-triggers-wrapper']} role=\"toolbar\" aria-orientation=\"vertical\">\n {visibleItems.map((item, index) => {\n return (\n <DrawerTrigger\n key={index}\n testUtilsClassName={clsx(\n testutilStyles['drawers-trigger'],\n item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']\n )}\n ariaExpanded={activeDrawerId === item.id}\n ref={item.id === previousActiveDrawerId.current ? drawerRefs.toggle : undefined}\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaControls={activeDrawerId === item.id ? item.id : undefined}\n trigger={item.trigger}\n badge={item.badge}\n itemId={item.id}\n isActive={activeDrawerId === item.id}\n onClick={\n drawers.length !== 1\n ? () => onDrawerChange(item.id !== activeDrawerId ? item.id : null)\n : undefined\n }\n />\n );\n })}\n {overflowItems.length > 0 && (\n <div className={styles['drawer-trigger']}>\n <OverflowMenu\n ariaLabel={\n overflowMenuHasBadge ? ariaLabels?.drawersOverflowWithBadge : ariaLabels?.drawersOverflow\n }\n items={overflowItems}\n onItemClick={({ detail }) => onDrawerChange(detail.id)}\n />\n </div>\n )}\n </div>\n </aside>\n )}\n </div>\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app-layout/drawer/index.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;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAE/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAErF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAE3C,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,0FAA0F;AAC1F,qFAAqF;AACrF,uFAAuF;AACvF,4EAA4E;AAC5E,wFAAwF;AACxF,0FAA0F;AAC1F,0FAA0F;AAC1F,wBAAwB;AACxB,0FAA0F;AAC1F,4FAA4F;AAC5F,WAAW;AACX,oBA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ACG,CACF,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { useDensityMode } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getVisualContextClassname } from '../../internal/components/visual-context';\nimport { AppLayoutProps } from '../interfaces';\nimport { CloseButton, ToggleButton, togglesConfig } from '../toggles';\nimport { TOOLS_DRAWER_ID } from '../utils/use-drawers';\nimport { splitItems } from './drawers-helpers';\nimport { DesktopDrawerProps, DrawerTriggersBarProps } from './interfaces';\nimport OverflowMenu from './overflow-menu';\n\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\n// We are using two landmarks per drawer, i.e. two NAVs and two ASIDEs, because of several\n// known bugs in NVDA that cause focus changes within a container to sometimes not be\n// announced. As a result, we use one region for the open button and one region for the\n// actual drawer content, always hiding the other one when it's not visible.\n// An alternative solution to follow a more classic implementation here to only have one\n// button that triggers the opening/closing of the drawer also did not work due to another\n// series of bugs in NVDA (together with Firefox) which prevent the changed expanded state\n// from being announced.\n// Even with this workaround in place, the announcement of the close button when opening a\n// panel in NVDA is not working correctly. The suspected root cause is one of the bugs below\n// as well.\n// Relevant tickets:\n// * https://github.com/nvaccess/nvda/issues/6606\n// * https://github.com/nvaccess/nvda/issues/5825\n// * https://github.com/nvaccess/nvda/issues/5247\n// * https://github.com/nvaccess/nvda/pull/8869 (reverted PR that was going to fix it)\nexport const Drawer = React.forwardRef(\n (\n {\n id,\n contentClassName,\n toggleClassName,\n closeClassName,\n width,\n type,\n toggleRefs,\n topOffset,\n bottomOffset,\n ariaLabels,\n children,\n hideOpenButton,\n isOpen,\n isHidden,\n isMobile,\n onToggle,\n onClick,\n onLoseFocus,\n resizeHandle,\n }: DesktopDrawerProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n const openButtonWrapperRef = useRef<HTMLElement | null>(null);\n const { TagName, iconName } = togglesConfig[type];\n const { mainLabel, closeLabel, openLabel } = ariaLabels;\n const drawerContentWidthOpen = isMobile ? undefined : width;\n const drawerContentWidth = isOpen ? drawerContentWidthOpen : undefined;\n\n const regularOpenButton = (\n <TagName ref={openButtonWrapperRef} aria-label={mainLabel} className={styles.toggle} aria-hidden={isOpen}>\n <ToggleButton\n ref={toggleRefs.toggle}\n className={toggleClassName}\n iconName={iconName}\n ariaLabel={openLabel}\n onClick={() => onToggle(true)}\n ariaExpanded={isOpen ? undefined : false}\n />\n </TagName>\n );\n\n return (\n <div\n ref={ref}\n className={clsx(styles.drawer, {\n [styles.hide]: isHidden,\n [styles['drawer-closed']]: !isOpen,\n [styles['drawer-mobile']]: isMobile,\n })}\n style={{ width: drawerContentWidth }}\n onBlur={\n onLoseFocus\n ? e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n onLoseFocus(e);\n }\n }\n : undefined\n }\n onClick={event => {\n if (onClick) {\n onClick(event);\n }\n if (!isOpen) {\n // to prevent calling onToggle from the drawer when it's called from the toggle button\n if (\n openButtonWrapperRef.current === event.target ||\n !openButtonWrapperRef.current?.contains(event.target as Node)\n ) {\n onToggle(true);\n }\n }\n }}\n >\n <div\n id={id}\n style={{ width: drawerContentWidth, top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], styles['drawer-content-clickable'], contentClassName, {\n [testutilStyles['drawer-closed']]: !isOpen,\n })}\n >\n {!isMobile && !hideOpenButton && regularOpenButton}\n <TagName\n className={clsx(resizeHandle && styles['drawer-resize-content'], styles['drawer-content-wrapper'])}\n aria-label={mainLabel}\n aria-hidden={!isOpen}\n style={{\n blockSize: `calc(100vh - ${(topOffset || 0) + (bottomOffset || 0)}px)`,\n }}\n >\n {!isMobile && isOpen && <div className={styles['resize-handle-wrapper']}>{resizeHandle}</div>}\n <CloseButton\n ref={toggleRefs.close}\n className={closeClassName}\n ariaLabel={closeLabel}\n onClick={() => {\n onToggle(false);\n }}\n />\n {children}\n </TagName>\n </div>\n </div>\n );\n }\n);\n\ninterface DrawerTriggerProps {\n testUtilsClassName?: string;\n ariaLabel: string | undefined;\n ariaExpanded: boolean;\n ariaControls?: string;\n badge: boolean | undefined;\n itemId?: string;\n isActive: boolean;\n trigger: AppLayoutProps.Drawer['trigger'];\n onClick: (() => void) | undefined;\n}\n\nconst DrawerTrigger = React.forwardRef(\n (\n {\n testUtilsClassName,\n ariaLabel,\n ariaExpanded,\n ariaControls,\n badge,\n itemId,\n isActive,\n trigger,\n onClick,\n }: DrawerTriggerProps,\n ref: React.Ref<{ focus: () => void }>\n ) => (\n <div\n className={clsx(\n styles['drawer-trigger'],\n isActive && styles['drawer-trigger-active'],\n isActive && getVisualContextClassname('app-layout-tools-drawer-trigger')\n )}\n onClick={onClick}\n >\n <ToggleButton\n ref={ref}\n className={testUtilsClassName}\n iconName={trigger!.iconName}\n iconSvg={trigger!.iconSvg}\n ariaLabel={ariaLabel}\n ariaExpanded={ariaExpanded}\n ariaControls={ariaControls}\n badge={badge}\n testId={itemId && `awsui-app-layout-trigger-${itemId}`}\n />\n </div>\n )\n);\n\nexport const DrawerTriggersBar = ({\n isMobile,\n topOffset,\n bottomOffset,\n activeDrawerId,\n ariaLabels,\n drawers,\n drawerRefs,\n onDrawerChange,\n}: DrawerTriggersBarProps) => {\n const containerRef = React.useRef<HTMLDivElement>(null);\n const previousActiveDrawerId = useRef(activeDrawerId);\n const [containerHeight, triggersContainerRef] = useContainerQuery(rect => rect.contentBoxHeight);\n const isCompactMode = useDensityMode(containerRef) === 'compact';\n\n if (activeDrawerId) {\n previousActiveDrawerId.current = activeDrawerId;\n }\n\n const getIndexOfOverflowItem = () => {\n if (containerHeight) {\n const ITEM_HEIGHT = isCompactMode ? 34 : 38;\n const overflowSpot = containerHeight / 1.5;\n\n const index = Math.floor(overflowSpot / ITEM_HEIGHT);\n\n return index;\n }\n return 0;\n };\n\n const { visibleItems, overflowItems } = splitItems(drawers, getIndexOfOverflowItem(), activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n <div\n className={clsx(styles.drawer, styles['drawer-closed'], testutilStyles['drawer-closed'], {\n [styles['drawer-mobile']]: isMobile,\n [styles.hide]: drawers.length === 1 && !!activeDrawerId,\n })}\n ref={containerRef}\n >\n <div\n ref={triggersContainerRef}\n style={{ top: topOffset, bottom: bottomOffset }}\n className={clsx(styles['drawer-content'], {\n [styles['drawer-content-clickable']]: drawers.length === 1,\n })}\n onClick={\n drawers.length === 1\n ? () => onDrawerChange(drawers[0].id !== activeDrawerId ? drawers[0].id : null)\n : undefined\n }\n >\n {!isMobile && (\n <aside aria-label={ariaLabels?.drawers} role=\"region\">\n <div className={styles['drawer-triggers-wrapper']} role=\"toolbar\" aria-orientation=\"vertical\">\n {visibleItems.map((item, index) => {\n return (\n <DrawerTrigger\n key={index}\n testUtilsClassName={clsx(\n testutilStyles['drawers-trigger'],\n item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']\n )}\n ariaExpanded={activeDrawerId === item.id}\n ref={item.id === previousActiveDrawerId.current ? drawerRefs.toggle : undefined}\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaControls={activeDrawerId === item.id ? item.id : undefined}\n trigger={item.trigger}\n badge={item.badge}\n itemId={item.id}\n isActive={activeDrawerId === item.id}\n onClick={\n drawers.length !== 1\n ? () => onDrawerChange(item.id !== activeDrawerId ? item.id : null)\n : undefined\n }\n />\n );\n })}\n {overflowItems.length > 0 && (\n <div className={styles['drawer-trigger']}>\n <OverflowMenu\n ariaLabel={\n overflowMenuHasBadge ? ariaLabels?.drawersOverflowWithBadge : ariaLabels?.drawersOverflow\n }\n items={overflowItems}\n onItemClick={({ detail }) => onDrawerChange(detail.id)}\n />\n </div>\n )}\n </div>\n </aside>\n )}\n </div>\n </div>\n );\n};\n"]}
@@ -1,18 +1,19 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "toggle": "awsui_toggle_1uo6m_vdmba_189",
5
- "drawer-triggers": "awsui_drawer-triggers_1uo6m_vdmba_195",
6
- "drawer": "awsui_drawer_1uo6m_vdmba_195",
7
- "drawer-mobile": "awsui_drawer-mobile_1uo6m_vdmba_205",
8
- "drawer-closed": "awsui_drawer-closed_1uo6m_vdmba_208",
9
- "drawer-content": "awsui_drawer-content_1uo6m_vdmba_215",
10
- "drawer-content-clickable": "awsui_drawer-content-clickable_1uo6m_vdmba_227",
11
- "drawer-resize-content": "awsui_drawer-resize-content_1uo6m_vdmba_237",
12
- "drawer-triggers-wrapper": "awsui_drawer-triggers-wrapper_1uo6m_vdmba_243",
13
- "drawer-trigger": "awsui_drawer-trigger_1uo6m_vdmba_195",
14
- "drawer-trigger-active": "awsui_drawer-trigger-active_1uo6m_vdmba_262",
15
- "resize-handle-wrapper": "awsui_resize-handle-wrapper_1uo6m_vdmba_270",
16
- "hide": "awsui_hide_1uo6m_vdmba_280"
4
+ "toggle": "awsui_toggle_1uo6m_11o8o_189",
5
+ "drawer-triggers": "awsui_drawer-triggers_1uo6m_11o8o_195",
6
+ "drawer": "awsui_drawer_1uo6m_11o8o_195",
7
+ "drawer-mobile": "awsui_drawer-mobile_1uo6m_11o8o_205",
8
+ "drawer-closed": "awsui_drawer-closed_1uo6m_11o8o_208",
9
+ "drawer-content": "awsui_drawer-content_1uo6m_11o8o_215",
10
+ "drawer-content-clickable": "awsui_drawer-content-clickable_1uo6m_11o8o_229",
11
+ "drawer-resize-content": "awsui_drawer-resize-content_1uo6m_11o8o_239",
12
+ "drawer-content-wrapper": "awsui_drawer-content-wrapper_1uo6m_11o8o_244",
13
+ "drawer-triggers-wrapper": "awsui_drawer-triggers-wrapper_1uo6m_11o8o_248",
14
+ "drawer-trigger": "awsui_drawer-trigger_1uo6m_11o8o_195",
15
+ "drawer-trigger-active": "awsui_drawer-trigger-active_1uo6m_11o8o_267",
16
+ "resize-handle-wrapper": "awsui_resize-handle-wrapper_1uo6m_11o8o_275",
17
+ "hide": "awsui_hide_1uo6m_11o8o_285"
17
18
  };
18
19
 
@@ -186,88 +186,93 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
186
186
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
187
187
  SPDX-License-Identifier: Apache-2.0
188
188
  */
189
- .awsui_toggle_1uo6m_vdmba_189:not(#\9) {
189
+ .awsui_toggle_1uo6m_11o8o_189:not(#\9) {
190
190
  box-sizing: border-box;
191
191
  padding-block: var(--space-xxs-y2432o, 4px);
192
192
  padding-inline: 7px;
193
193
  }
194
194
 
195
- .awsui_drawer-triggers_1uo6m_vdmba_195:not(#\9) {
195
+ .awsui_drawer-triggers_1uo6m_11o8o_195:not(#\9) {
196
196
  box-sizing: border-box;
197
197
  }
198
198
 
199
- .awsui_drawer_1uo6m_vdmba_195:not(#\9) {
199
+ .awsui_drawer_1uo6m_11o8o_195:not(#\9) {
200
200
  flex-shrink: 0;
201
201
  position: relative;
202
202
  word-wrap: break-word;
203
203
  box-shadow: var(--shadow-panel-yrshw4, 0 1px 1px 0 rgba(0, 28, 36, 0.3), 1px 1px 1px 0 rgba(0, 28, 36, 0.15), -1px 1px 1px 0 rgba(0, 28, 36, 0.15));
204
204
  }
205
- .awsui_drawer_1uo6m_vdmba_195:not(#\9):not(.awsui_drawer-mobile_1uo6m_vdmba_205) {
205
+ .awsui_drawer_1uo6m_11o8o_195:not(#\9):not(.awsui_drawer-mobile_1uo6m_11o8o_205) {
206
206
  z-index: 830;
207
207
  }
208
- .awsui_drawer-closed_1uo6m_vdmba_208:not(#\9) {
208
+ .awsui_drawer-closed_1uo6m_11o8o_208:not(#\9) {
209
209
  min-inline-size: 40px;
210
210
  }
211
- .awsui_drawer-closed_1uo6m_vdmba_208.awsui_drawer-mobile_1uo6m_vdmba_205:not(#\9) {
211
+ .awsui_drawer-closed_1uo6m_11o8o_208.awsui_drawer-mobile_1uo6m_11o8o_205:not(#\9) {
212
212
  display: none;
213
213
  }
214
214
 
215
- .awsui_drawer-content_1uo6m_vdmba_215:not(#\9) {
215
+ .awsui_drawer-content_1uo6m_11o8o_215:not(#\9) {
216
216
  position: fixed;
217
217
  overflow: auto;
218
218
  background-color: var(--color-background-layout-panel-content-70ws8g, #ffffff);
219
+ display: flex;
220
+ flex-direction: column;
219
221
  }
220
- .awsui_drawer-mobile_1uo6m_vdmba_205 > .awsui_drawer-content_1uo6m_vdmba_215:not(#\9) {
222
+ .awsui_drawer-mobile_1uo6m_11o8o_205 > .awsui_drawer-content_1uo6m_11o8o_215:not(#\9) {
221
223
  z-index: 1001;
222
224
  inset: 0;
223
225
  }
224
- .awsui_drawer-closed_1uo6m_vdmba_208 > .awsui_drawer-content_1uo6m_vdmba_215:not(#\9) {
226
+ .awsui_drawer-closed_1uo6m_11o8o_208 > .awsui_drawer-content_1uo6m_11o8o_215:not(#\9) {
225
227
  inline-size: 40px;
226
228
  }
227
- .awsui_drawer-closed_1uo6m_vdmba_208 > .awsui_drawer-content_1uo6m_vdmba_215.awsui_drawer-content-clickable_1uo6m_vdmba_227:not(#\9) {
229
+ .awsui_drawer-closed_1uo6m_11o8o_208 > .awsui_drawer-content_1uo6m_11o8o_215.awsui_drawer-content-clickable_1uo6m_11o8o_229:not(#\9) {
228
230
  cursor: pointer;
229
231
  color: var(--color-text-interactive-default-t1snbz, #545b64);
230
232
  }
231
- .awsui_drawer-closed_1uo6m_vdmba_208 > .awsui_drawer-content_1uo6m_vdmba_215.awsui_drawer-content-clickable_1uo6m_vdmba_227:not(#\9):hover {
233
+ .awsui_drawer-closed_1uo6m_11o8o_208 > .awsui_drawer-content_1uo6m_11o8o_215.awsui_drawer-content-clickable_1uo6m_11o8o_229:not(#\9):hover {
232
234
  background: var(--color-background-layout-panel-hover-7apn2n, #eaeded);
233
235
  }
234
- .awsui_drawer-content_1uo6m_vdmba_215 > [aria-hidden=true]:not(#\9) {
236
+ .awsui_drawer-content_1uo6m_11o8o_215 > [aria-hidden=true]:not(#\9) {
235
237
  display: none;
236
238
  }
237
- .awsui_drawer-content_1uo6m_vdmba_215 > .awsui_drawer-resize-content_1uo6m_vdmba_237:not(#\9) {
239
+ .awsui_drawer-content_1uo6m_11o8o_215 > .awsui_drawer-resize-content_1uo6m_11o8o_239:not(#\9) {
238
240
  overflow: auto;
239
241
  block-size: 100%;
240
242
  position: relative;
241
243
  }
244
+ .awsui_drawer-content_1uo6m_11o8o_215 > .awsui_drawer-content-wrapper_1uo6m_11o8o_244:not(#\9) {
245
+ flex: 1;
246
+ }
242
247
 
243
- .awsui_drawer-triggers-wrapper_1uo6m_vdmba_243:not(#\9) {
248
+ .awsui_drawer-triggers-wrapper_1uo6m_11o8o_248:not(#\9) {
244
249
  display: flex;
245
250
  flex-direction: column;
246
251
  text-align: center;
247
252
  align-items: stretch;
248
253
  }
249
254
 
250
- .awsui_drawer-trigger_1uo6m_vdmba_195:not(#\9) {
255
+ .awsui_drawer-trigger_1uo6m_11o8o_195:not(#\9) {
251
256
  padding-block: var(--space-xxs-y2432o, 4px);
252
257
  padding-inline: 7px;
253
258
  cursor: pointer;
254
259
  color: var(--color-text-interactive-default-t1snbz, #545b64);
255
260
  }
256
- .awsui_drawer-trigger_1uo6m_vdmba_195:not(#\9):not(:first-child) {
261
+ .awsui_drawer-trigger_1uo6m_11o8o_195:not(#\9):not(:first-child) {
257
262
  border-block-start: 1px solid var(--color-border-layout-5gml03, #d5dbdb);
258
263
  }
259
- .awsui_drawer-trigger_1uo6m_vdmba_195:not(#\9):hover {
264
+ .awsui_drawer-trigger_1uo6m_11o8o_195:not(#\9):hover {
260
265
  color: var(--color-text-layout-toggle-hover-2duwd4, #0073bb);
261
266
  }
262
- .awsui_drawer-trigger-active_1uo6m_vdmba_262:not(#\9), .awsui_drawer-trigger-active_1uo6m_vdmba_262:not(#\9):hover {
267
+ .awsui_drawer-trigger-active_1uo6m_11o8o_267:not(#\9), .awsui_drawer-trigger-active_1uo6m_11o8o_267:not(#\9):hover {
263
268
  background-color: var(--color-background-layout-toggle-selected-default-qcp7lk, #0073bb);
264
269
  color: var(--color-text-layout-toggle-active-ox34la, #ffffff);
265
270
  }
266
- .awsui_drawer-content-clickable_1uo6m_vdmba_227 > .awsui_drawer-triggers-wrapper_1uo6m_vdmba_243 > .awsui_drawer-trigger_1uo6m_vdmba_195:not(#\9):hover {
271
+ .awsui_drawer-content-clickable_1uo6m_11o8o_229 > .awsui_drawer-triggers-wrapper_1uo6m_11o8o_248 > .awsui_drawer-trigger_1uo6m_11o8o_195:not(#\9):hover {
267
272
  color: var(--color-text-interactive-default-t1snbz, #545b64);
268
273
  }
269
274
 
270
- .awsui_resize-handle-wrapper_1uo6m_vdmba_270:not(#\9) {
275
+ .awsui_resize-handle-wrapper_1uo6m_11o8o_275:not(#\9) {
271
276
  position: absolute;
272
277
  inset-inline-start: 0;
273
278
  inset-block-start: 0;
@@ -277,6 +282,6 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
277
282
  z-index: 1;
278
283
  }
279
284
 
280
- .awsui_hide_1uo6m_vdmba_280:not(#\9) {
285
+ .awsui_hide_1uo6m_11o8o_285:not(#\9) {
281
286
  display: none;
282
287
  }
@@ -2,18 +2,19 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "toggle": "awsui_toggle_1uo6m_vdmba_189",
6
- "drawer-triggers": "awsui_drawer-triggers_1uo6m_vdmba_195",
7
- "drawer": "awsui_drawer_1uo6m_vdmba_195",
8
- "drawer-mobile": "awsui_drawer-mobile_1uo6m_vdmba_205",
9
- "drawer-closed": "awsui_drawer-closed_1uo6m_vdmba_208",
10
- "drawer-content": "awsui_drawer-content_1uo6m_vdmba_215",
11
- "drawer-content-clickable": "awsui_drawer-content-clickable_1uo6m_vdmba_227",
12
- "drawer-resize-content": "awsui_drawer-resize-content_1uo6m_vdmba_237",
13
- "drawer-triggers-wrapper": "awsui_drawer-triggers-wrapper_1uo6m_vdmba_243",
14
- "drawer-trigger": "awsui_drawer-trigger_1uo6m_vdmba_195",
15
- "drawer-trigger-active": "awsui_drawer-trigger-active_1uo6m_vdmba_262",
16
- "resize-handle-wrapper": "awsui_resize-handle-wrapper_1uo6m_vdmba_270",
17
- "hide": "awsui_hide_1uo6m_vdmba_280"
5
+ "toggle": "awsui_toggle_1uo6m_11o8o_189",
6
+ "drawer-triggers": "awsui_drawer-triggers_1uo6m_11o8o_195",
7
+ "drawer": "awsui_drawer_1uo6m_11o8o_195",
8
+ "drawer-mobile": "awsui_drawer-mobile_1uo6m_11o8o_205",
9
+ "drawer-closed": "awsui_drawer-closed_1uo6m_11o8o_208",
10
+ "drawer-content": "awsui_drawer-content_1uo6m_11o8o_215",
11
+ "drawer-content-clickable": "awsui_drawer-content-clickable_1uo6m_11o8o_229",
12
+ "drawer-resize-content": "awsui_drawer-resize-content_1uo6m_11o8o_239",
13
+ "drawer-content-wrapper": "awsui_drawer-content-wrapper_1uo6m_11o8o_244",
14
+ "drawer-triggers-wrapper": "awsui_drawer-triggers-wrapper_1uo6m_11o8o_248",
15
+ "drawer-trigger": "awsui_drawer-trigger_1uo6m_11o8o_195",
16
+ "drawer-trigger-active": "awsui_drawer-trigger-active_1uo6m_11o8o_267",
17
+ "resize-handle-wrapper": "awsui_resize-handle-wrapper_1uo6m_11o8o_275",
18
+ "hide": "awsui_hide_1uo6m_11o8o_285"
18
19
  };
19
20
 
@@ -5,6 +5,7 @@ export interface SplitPanelProviderProps extends SplitPanelContextBaseProps {
5
5
  reportSize: (size: number) => void;
6
6
  getMaxHeight: () => number;
7
7
  children?: React.ReactNode;
8
+ animationDisabled?: boolean;
8
9
  }
9
10
  export declare function SplitPanelProvider({ children, size, getMaxHeight, maxWidth, reportSize, onResize, ...rest }: SplitPanelProviderProps): JSX.Element;
10
11
  //# sourceMappingURL=provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/split-panel/provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,0BAA0B,EAA6B,MAAM,4CAA4C,CAAC;AAInH,MAAM,WAAW,uBAAwB,SAAQ,0BAA0B;IACzE,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,uBAAuB,eA4CzB"}
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/split-panel/provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,0BAA0B,EAA6B,MAAM,4CAA4C,CAAC;AAInH,MAAM,WAAW,uBAAwB,SAAQ,0BAA0B;IACzE,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,uBAAuB,eA4CzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../../src/app-layout/split-panel/provider.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KA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import React, { useEffect, useState } from 'react';\n\nimport { SplitPanelContextBaseProps, SplitPanelContextProvider } from '../../internal/context/split-panel-context';\nimport { getLimitedValue } from '../../split-panel/utils/size-utils';\nimport { SPLIT_PANEL_MIN_HEIGHT, SPLIT_PANEL_MIN_WIDTH } from './constants';\n\nexport interface SplitPanelProviderProps extends SplitPanelContextBaseProps {\n maxWidth: number;\n reportSize: (size: number) => void;\n getMaxHeight: () => number;\n children?: React.ReactNode;\n}\n\nexport function SplitPanelProvider({\n children,\n size,\n getMaxHeight,\n maxWidth,\n reportSize,\n onResize,\n ...rest\n}: SplitPanelProviderProps) {\n const { position, isOpen } = rest;\n const [maxHeight, setMaxHeight] = useState(size);\n const minSize = position === 'bottom' ? SPLIT_PANEL_MIN_HEIGHT : SPLIT_PANEL_MIN_WIDTH;\n const maxSize = position === 'bottom' ? maxHeight : maxWidth;\n const cappedSize = getLimitedValue(minSize, size, maxSize);\n const relativeSize = ((size - minSize) / (maxSize - minSize)) * 100;\n\n const onResizeWithValidation = (newSize: number) => {\n const maxSize = position === 'side' ? maxWidth : getMaxHeight();\n const isResizeValid = position === 'side' ? maxSize >= SPLIT_PANEL_MIN_WIDTH : maxSize >= SPLIT_PANEL_MIN_HEIGHT;\n if (isOpen && isResizeValid) {\n onResize(getLimitedValue(minSize, newSize, maxSize));\n }\n };\n\n useEffect(() => {\n if (position !== 'bottom') {\n return;\n }\n // effects are called inside out in the components tree\n // wait one frame to allow app-layout to complete its calculations\n const handle = requestAnimationFrame(() => setMaxHeight(getMaxHeight()));\n return () => cancelAnimationFrame(handle);\n }, [size, minSize, position, getMaxHeight]);\n\n useEffect(() => {\n reportSize(cappedSize);\n }, [reportSize, cappedSize]);\n\n useEffect(() => {\n if (position !== 'bottom') {\n return;\n }\n const handler = () => setMaxHeight(getMaxHeight());\n window.addEventListener('resize', handler);\n return () => window.removeEventListener('resize', handler);\n }, [position, getMaxHeight]);\n\n return (\n <SplitPanelContextProvider value={{ ...rest, size: cappedSize, relativeSize, onResize: onResizeWithValidation }}>\n {children}\n </SplitPanelContextProvider>\n );\n}\n"]}
1
+ {"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../../src/app-layout/split-panel/provider.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAA8B,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACnH,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAU5E,MAAM,UAAU,kBAAkB,CAAC,EAQT;QARS,EACjC,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,QAAQ,OAEgB,EADrB,IAAI,cAP0B,0EAQlC,CADQ;IAEP,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAClC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IACjD,MAAM,OAAO,GAAG,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,qBAAqB,CAAC;IACvF,MAAM,OAAO,GAAG,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC7D,MAAM,UAAU,GAAG,eAAe,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3D,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC;IAEpE,MAAM,sBAAsB,GAAG,CAAC,OAAe,EAAE,EAAE;QACjD,MAAM,OAAO,GAAG,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,QA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AE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,sBAAsB,OAC1G,QAAQ,CACiB,CAC7B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useState } from 'react';\n\nimport { SplitPanelContextBaseProps, SplitPanelContextProvider } from '../../internal/context/split-panel-context';\nimport { getLimitedValue } from '../../split-panel/utils/size-utils';\nimport { SPLIT_PANEL_MIN_HEIGHT, SPLIT_PANEL_MIN_WIDTH } from './constants';\n\nexport interface SplitPanelProviderProps extends SplitPanelContextBaseProps {\n maxWidth: number;\n reportSize: (size: number) => void;\n getMaxHeight: () => number;\n children?: React.ReactNode;\n animationDisabled?: boolean;\n}\n\nexport function SplitPanelProvider({\n children,\n size,\n getMaxHeight,\n maxWidth,\n reportSize,\n onResize,\n ...rest\n}: SplitPanelProviderProps) {\n const { position, isOpen } = rest;\n const [maxHeight, setMaxHeight] = useState(size);\n const minSize = position === 'bottom' ? SPLIT_PANEL_MIN_HEIGHT : SPLIT_PANEL_MIN_WIDTH;\n const maxSize = position === 'bottom' ? maxHeight : maxWidth;\n const cappedSize = getLimitedValue(minSize, size, maxSize);\n const relativeSize = ((size - minSize) / (maxSize - minSize)) * 100;\n\n const onResizeWithValidation = (newSize: number) => {\n const maxSize = position === 'side' ? maxWidth : getMaxHeight();\n const isResizeValid = position === 'side' ? maxSize >= SPLIT_PANEL_MIN_WIDTH : maxSize >= SPLIT_PANEL_MIN_HEIGHT;\n if (isOpen && isResizeValid) {\n onResize(getLimitedValue(minSize, newSize, maxSize));\n }\n };\n\n useEffect(() => {\n if (position !== 'bottom') {\n return;\n }\n // effects are called inside out in the components tree\n // wait one frame to allow app-layout to complete its calculations\n const handle = requestAnimationFrame(() => setMaxHeight(getMaxHeight()));\n return () => cancelAnimationFrame(handle);\n }, [size, minSize, position, getMaxHeight]);\n\n useEffect(() => {\n reportSize(cappedSize);\n }, [reportSize, cappedSize]);\n\n useEffect(() => {\n if (position !== 'bottom') {\n return;\n }\n const handler = () => setMaxHeight(getMaxHeight());\n window.addEventListener('resize', handler);\n return () => window.removeEventListener('resize', handler);\n }, [position, getMaxHeight]);\n\n return (\n <SplitPanelContextProvider value={{ ...rest, size: cappedSize, relativeSize, onResize: onResizeWithValidation }}>\n {children}\n </SplitPanelContextProvider>\n );\n}\n"]}
@@ -48,7 +48,7 @@ export default function Navigation() {
48
48
  }), ref: state !== 'exiting' ? transitionEventsRef : undefined, "aria-hidden": !navigationOpen, onClick: event => {
49
49
  onNavigationClick && onNavigationClick(event);
50
50
  } },
51
- React.createElement("div", { className: styles['animated-content'] },
51
+ React.createElement("div", { className: clsx(styles['content-container'], styles['animated-content']) },
52
52
  React.createElement("div", { className: styles['hide-navigation'] },
53
53
  React.createElement(InternalButton, { ariaLabel: (_c = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigationClose) !== null && _c !== void 0 ? _c : undefined, iconName: isMobile ? 'close' : 'angle-left', onClick: () => handleNavigationClick(false), variant: "icon", formAction: "none", className: testutilStyles['navigation-close'], ref: navigationRefs.close })),
54
54
  navigation))));
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/navigation.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAEvE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,cAAc,MAAM,gDAAgD,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAE7C,OAAO,cAA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,KAAK,CAAC,EAAE;oBACf,iBAAiB,IAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC;gBAChD,CAAC;gBAED,6BAAK,SAAS,EAAE,MAAM,CAAC,kBAAkB,CAAC;oBACxC,6BAAK,SAAS,EAAE,MAAM,CAAC,iBAAiB,CAAC;wBACvC,oBAAC,cAAc,IACb,SAAS,EAAE,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,eAAe,mCAAI,SAAS,EACnD,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,EAC3C,OAAO,EAAE,GAAG,EAAE,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAC3C,OAAO,EAAC,MAAM,EACd,UAAU,EAAC,MAAM,EACjB,SAAS,EAAE,cAAc,CAAC,kBAAkB,CAAC,EAC7C,GAAG,EAAE,cAAc,CAAC,KAAK,GACzB,CACE;oBACL,UAAU,CACP,CACF,CACF,CACP,CAAA;KAAA,CACU,CACd,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { findUpUntil } from '@cloudscape-design/component-toolkit/dom';\n\nimport { InternalButton } from '../../button/internal';\nimport { Transition } from '../../internal/components/transition';\nimport customCssProps from '../../internal/generated/custom-css-properties';\nimport { useAppLayoutInternals } from './context';\nimport TriggerButton from './trigger-button';\n\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\n/**\n * The Navigation component consists of the following elements:\n * the container, or root element, that sits as a direct child to the Layout grid definition;\n * the show navigation form that contains the trigger for the drawer in large viewports;\n * the navigation, or drawer, that contains the hide navigation form and the children\n * passed through the API;\n */\nexport default function Navigation() {\n const {\n ariaLabels,\n disableBodyScroll,\n handleNavigationClick,\n hasDrawerViewportOverlay,\n isMobile,\n navigationOpen,\n isToolsOpen,\n navigation,\n navigationHide,\n navigationRefs,\n navigationWidth,\n toolsHide,\n headerVariant,\n } = useAppLayoutInternals();\n\n if (navigationHide) {\n return null;\n }\n\n // Close the Navigation drawer on mobile when a user clicks a link inside.\n const onNavigationClick = (event: React.MouseEvent) => {\n const hasLink = findUpUntil(\n event.target as HTMLElement,\n node => node.tagName === 'A' && !!(node as HTMLAnchorElement).href\n );\n if (hasLink && isMobile) {\n handleNavigationClick(false);\n }\n };\n\n const isUnfocusable = hasDrawerViewportOverlay && (!navigationOpen || (isToolsOpen && !toolsHide));\n\n return (\n <Transition in={navigationOpen}>\n {(state, transitionEventsRef) => (\n <div\n className={clsx(styles['navigation-container'], {\n [styles['disable-body-scroll']]: disableBodyScroll,\n [styles.unfocusable]: isUnfocusable,\n })}\n style={{ [customCssProps.navigationWidth]: `${navigationWidth}px` }}\n >\n {!isMobile && (\n <nav\n aria-hidden={isMobile || navigationOpen}\n aria-label={ariaLabels?.navigation ?? undefined}\n className={clsx(styles['show-navigation'], {\n [styles.animating]: state === 'exiting',\n [styles['is-navigation-open']]: navigationOpen,\n })}\n ref={state === 'exiting' ? transitionEventsRef : undefined}\n >\n <TriggerButton\n ariaLabel={ariaLabels?.navigationToggle}\n ariaExpanded={navigationOpen ? undefined : false}\n iconName=\"menu\"\n className={testutilStyles['navigation-toggle']}\n onClick={() => handleNavigationClick(true)}\n ref={navigationRefs.toggle}\n highContrastHeader={headerVariant === 'high-contrast'}\n />\n </nav>\n )}\n\n <nav\n aria-label={ariaLabels?.navigation ?? undefined}\n className={clsx(styles.navigation, testutilStyles.navigation, {\n [testutilStyles['drawer-closed']]: !navigationOpen,\n [styles.animating]: state === 'entering',\n [styles['is-navigation-open']]: navigationOpen,\n })}\n ref={state !== 'exiting' ? transitionEventsRef : undefined}\n aria-hidden={!navigationOpen}\n onClick={event => {\n onNavigationClick && onNavigationClick(event);\n }}\n >\n <div className={styles['animated-content']}>\n <div className={styles['hide-navigation']}>\n <InternalButton\n ariaLabel={ariaLabels?.navigationClose ?? undefined}\n iconName={isMobile ? 'close' : 'angle-left'}\n onClick={() => handleNavigationClick(false)}\n variant=\"icon\"\n formAction=\"none\"\n className={testutilStyles['navigation-close']}\n ref={navigationRefs.close}\n />\n </div>\n {navigation}\n </div>\n </nav>\n </div>\n )}\n </Transition>\n );\n}\n"]}
1
+ {"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/navigation.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAEvE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,cAAc,MAAM,gDAAgD,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAE7C,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU;IAChC,MAAM,EACJ,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACxB,QAAQ,EACR,cAAc,EACd,WAAW,EACX,UAAU,EACV,cAAc,EACd,cAAc,EACd,eAAe,EACf,SAAS,EACT,aAAa,GACd,GAAG,qBAAqB,EAAE,CAAC;IAE5B,IAAI,cAAc,EAAE;QAClB,OAAO,IAAI,CAAC;KACb;IAED,0EAA0E;IAC1E,MAAM,iBAAiB,GAAG,CAAC,KAAuB,EAAE,EAAE;QACpD,MAAM,OAAO,GAAG,WAAW,CACzB,KAAK,CAAC,MAAqB,EAC3B,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,GAAG,IAAI,CAAC,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AkB,CAAC,EAC7C,GAAG,EAAE,cAAc,CAAC,KAAK,GACzB,CACE;oBACL,UAAU,CACP,CACF,CACF,CACP,CAAA;KAAA,CACU,CACd,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { findUpUntil } from '@cloudscape-design/component-toolkit/dom';\n\nimport { InternalButton } from '../../button/internal';\nimport { Transition } from '../../internal/components/transition';\nimport customCssProps from '../../internal/generated/custom-css-properties';\nimport { useAppLayoutInternals } from './context';\nimport TriggerButton from './trigger-button';\n\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\n/**\n * The Navigation component consists of the following elements:\n * the container, or root element, that sits as a direct child to the Layout grid definition;\n * the show navigation form that contains the trigger for the drawer in large viewports;\n * the navigation, or drawer, that contains the hide navigation form and the children\n * passed through the API;\n */\nexport default function Navigation() {\n const {\n ariaLabels,\n disableBodyScroll,\n handleNavigationClick,\n hasDrawerViewportOverlay,\n isMobile,\n navigationOpen,\n isToolsOpen,\n navigation,\n navigationHide,\n navigationRefs,\n navigationWidth,\n toolsHide,\n headerVariant,\n } = useAppLayoutInternals();\n\n if (navigationHide) {\n return null;\n }\n\n // Close the Navigation drawer on mobile when a user clicks a link inside.\n const onNavigationClick = (event: React.MouseEvent) => {\n const hasLink = findUpUntil(\n event.target as HTMLElement,\n node => node.tagName === 'A' && !!(node as HTMLAnchorElement).href\n );\n if (hasLink && isMobile) {\n handleNavigationClick(false);\n }\n };\n\n const isUnfocusable = hasDrawerViewportOverlay && (!navigationOpen || (isToolsOpen && !toolsHide));\n\n return (\n <Transition in={navigationOpen}>\n {(state, transitionEventsRef) => (\n <div\n className={clsx(styles['navigation-container'], {\n [styles['disable-body-scroll']]: disableBodyScroll,\n [styles.unfocusable]: isUnfocusable,\n })}\n style={{ [customCssProps.navigationWidth]: `${navigationWidth}px` }}\n >\n {!isMobile && (\n <nav\n aria-hidden={isMobile || navigationOpen}\n aria-label={ariaLabels?.navigation ?? undefined}\n className={clsx(styles['show-navigation'], {\n [styles.animating]: state === 'exiting',\n [styles['is-navigation-open']]: navigationOpen,\n })}\n ref={state === 'exiting' ? transitionEventsRef : undefined}\n >\n <TriggerButton\n ariaLabel={ariaLabels?.navigationToggle}\n ariaExpanded={navigationOpen ? undefined : false}\n iconName=\"menu\"\n className={testutilStyles['navigation-toggle']}\n onClick={() => handleNavigationClick(true)}\n ref={navigationRefs.toggle}\n highContrastHeader={headerVariant === 'high-contrast'}\n />\n </nav>\n )}\n\n <nav\n aria-label={ariaLabels?.navigation ?? undefined}\n className={clsx(styles.navigation, testutilStyles.navigation, {\n [testutilStyles['drawer-closed']]: !navigationOpen,\n [styles.animating]: state === 'entering',\n [styles['is-navigation-open']]: navigationOpen,\n })}\n ref={state !== 'exiting' ? transitionEventsRef : undefined}\n aria-hidden={!navigationOpen}\n onClick={event => {\n onNavigationClick && onNavigationClick(event);\n }}\n >\n <div className={clsx(styles['content-container'], styles['animated-content'])}>\n <div className={styles['hide-navigation']}>\n <InternalButton\n ariaLabel={ariaLabels?.navigationClose ?? undefined}\n iconName={isMobile ? 'close' : 'angle-left'}\n onClick={() => handleNavigationClick(false)}\n variant=\"icon\"\n formAction=\"none\"\n className={testutilStyles['navigation-close']}\n ref={navigationRefs.close}\n />\n </div>\n {navigation}\n </div>\n </nav>\n </div>\n )}\n </Transition>\n );\n}\n"]}