@cloudscape-design/components 3.0.822 → 3.0.824
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.
- package/app-layout/drawer/index.d.ts.map +1 -1
- package/app-layout/drawer/index.js +3 -1
- package/app-layout/drawer/index.js.map +1 -1
- package/app-layout/drawer/styles.css.js +14 -13
- package/app-layout/drawer/styles.scoped.css +26 -21
- package/app-layout/drawer/styles.selectors.js +14 -13
- package/app-layout/split-panel/provider.d.ts +1 -0
- package/app-layout/split-panel/provider.d.ts.map +1 -1
- package/app-layout/split-panel/provider.js.map +1 -1
- package/app-layout/visual-refresh/navigation.js +1 -1
- package/app-layout/visual-refresh/navigation.js.map +1 -1
- package/app-layout/visual-refresh/styles.css.js +86 -85
- package/app-layout/visual-refresh/styles.scoped.css +168 -162
- package/app-layout/visual-refresh/styles.selectors.js +86 -85
- package/app-layout/visual-refresh-toolbar/compute-layout.d.ts +4 -1
- package/app-layout/visual-refresh-toolbar/compute-layout.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/compute-layout.js +4 -2
- package/app-layout/visual-refresh-toolbar/compute-layout.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts +2 -7
- package/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/drawer/global-drawer.js +7 -6
- package/app-layout/visual-refresh-toolbar/drawer/global-drawer.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/drawer/local-drawer.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/drawer/local-drawer.js +8 -6
- package/app-layout/visual-refresh-toolbar/drawer/local-drawer.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/drawer/styles.css.js +10 -10
- package/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +12 -14
- package/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +10 -10
- package/app-layout/visual-refresh-toolbar/index.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/index.js +6 -1
- package/app-layout/visual-refresh-toolbar/index.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/interfaces.d.ts +8 -4
- package/app-layout/visual-refresh-toolbar/interfaces.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/interfaces.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/navigation/index.js +5 -5
- package/app-layout/visual-refresh-toolbar/navigation/index.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/navigation/styles.css.js +5 -4
- package/app-layout/visual-refresh-toolbar/navigation/styles.scoped.css +10 -5
- package/app-layout/visual-refresh-toolbar/navigation/styles.selectors.js +5 -4
- package/app-layout/visual-refresh-toolbar/skeleton/index.d.ts +1 -0
- package/app-layout/visual-refresh-toolbar/skeleton/index.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/skeleton/index.js +2 -2
- package/app-layout/visual-refresh-toolbar/skeleton/index.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/split-panel/index.d.ts +1 -1
- package/app-layout/visual-refresh-toolbar/split-panel/index.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/split-panel/index.js +7 -7
- package/app-layout/visual-refresh-toolbar/split-panel/index.js.map +1 -1
- package/internal/context/split-panel-context.d.ts +1 -0
- package/internal/context/split-panel-context.d.ts.map +1 -1
- package/internal/context/split-panel-context.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/manifest.json +1 -1
- package/package.json +1 -1
- package/split-panel/bottom.d.ts.map +1 -1
- package/split-panel/bottom.js +3 -2
- package/split-panel/bottom.js.map +1 -1
- package/split-panel/side.d.ts.map +1 -1
- package/split-panel/side.js +3 -2
- package/split-panel/side.js.map +1 -1
|
@@ -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,
|
|
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,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,E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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,oBAAoB;AACpB,iDAAiD;AACjD,iDAAiD;AACjD,iDAAiD;AACjD,sFAAsF;AACtF,MAAM,CAAC,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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": "
|
|
5
|
-
"drawer-triggers": "awsui_drawer-
|
|
6
|
-
"drawer": "
|
|
7
|
-
"drawer-mobile": "awsui_drawer-
|
|
8
|
-
"drawer-closed": "awsui_drawer-
|
|
9
|
-
"drawer-content": "awsui_drawer-
|
|
10
|
-
"drawer-content-clickable": "awsui_drawer-content-
|
|
11
|
-
"drawer-resize-content": "awsui_drawer-resize-
|
|
12
|
-
"drawer-
|
|
13
|
-
"drawer-
|
|
14
|
-
"drawer-trigger
|
|
15
|
-
"
|
|
16
|
-
"
|
|
4
|
+
"toggle": "awsui_toggle_1uo6m_11iof_189",
|
|
5
|
+
"drawer-triggers": "awsui_drawer-triggers_1uo6m_11iof_195",
|
|
6
|
+
"drawer": "awsui_drawer_1uo6m_11iof_195",
|
|
7
|
+
"drawer-mobile": "awsui_drawer-mobile_1uo6m_11iof_205",
|
|
8
|
+
"drawer-closed": "awsui_drawer-closed_1uo6m_11iof_208",
|
|
9
|
+
"drawer-content": "awsui_drawer-content_1uo6m_11iof_215",
|
|
10
|
+
"drawer-content-clickable": "awsui_drawer-content-clickable_1uo6m_11iof_229",
|
|
11
|
+
"drawer-resize-content": "awsui_drawer-resize-content_1uo6m_11iof_239",
|
|
12
|
+
"drawer-content-wrapper": "awsui_drawer-content-wrapper_1uo6m_11iof_244",
|
|
13
|
+
"drawer-triggers-wrapper": "awsui_drawer-triggers-wrapper_1uo6m_11iof_248",
|
|
14
|
+
"drawer-trigger": "awsui_drawer-trigger_1uo6m_11iof_195",
|
|
15
|
+
"drawer-trigger-active": "awsui_drawer-trigger-active_1uo6m_11iof_267",
|
|
16
|
+
"resize-handle-wrapper": "awsui_resize-handle-wrapper_1uo6m_11iof_275",
|
|
17
|
+
"hide": "awsui_hide_1uo6m_11iof_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
|
-
.
|
|
189
|
+
.awsui_toggle_1uo6m_11iof_189:not(#\9) {
|
|
190
190
|
box-sizing: border-box;
|
|
191
191
|
padding-block: var(--space-xxs-p8yyaw, 4px);
|
|
192
192
|
padding-inline: 7px;
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
.awsui_drawer-
|
|
195
|
+
.awsui_drawer-triggers_1uo6m_11iof_195:not(#\9) {
|
|
196
196
|
box-sizing: border-box;
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
.
|
|
199
|
+
.awsui_drawer_1uo6m_11iof_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-g6fkp1, 0px 0px 0px 1px #b6bec9);
|
|
204
204
|
}
|
|
205
|
-
.
|
|
205
|
+
.awsui_drawer_1uo6m_11iof_195:not(#\9):not(.awsui_drawer-mobile_1uo6m_11iof_205) {
|
|
206
206
|
z-index: 830;
|
|
207
207
|
}
|
|
208
|
-
.awsui_drawer-
|
|
208
|
+
.awsui_drawer-closed_1uo6m_11iof_208:not(#\9) {
|
|
209
209
|
min-inline-size: 40px;
|
|
210
210
|
}
|
|
211
|
-
.awsui_drawer-
|
|
211
|
+
.awsui_drawer-closed_1uo6m_11iof_208.awsui_drawer-mobile_1uo6m_11iof_205:not(#\9) {
|
|
212
212
|
display: none;
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
.awsui_drawer-
|
|
215
|
+
.awsui_drawer-content_1uo6m_11iof_215:not(#\9) {
|
|
216
216
|
position: fixed;
|
|
217
217
|
overflow: auto;
|
|
218
218
|
background-color: var(--color-background-layout-panel-content-du0fbw, #ffffff);
|
|
219
|
+
display: flex;
|
|
220
|
+
flex-direction: column;
|
|
219
221
|
}
|
|
220
|
-
.awsui_drawer-
|
|
222
|
+
.awsui_drawer-mobile_1uo6m_11iof_205 > .awsui_drawer-content_1uo6m_11iof_215:not(#\9) {
|
|
221
223
|
z-index: 1001;
|
|
222
224
|
inset: 0;
|
|
223
225
|
}
|
|
224
|
-
.awsui_drawer-
|
|
226
|
+
.awsui_drawer-closed_1uo6m_11iof_208 > .awsui_drawer-content_1uo6m_11iof_215:not(#\9) {
|
|
225
227
|
inline-size: 40px;
|
|
226
228
|
}
|
|
227
|
-
.awsui_drawer-
|
|
229
|
+
.awsui_drawer-closed_1uo6m_11iof_208 > .awsui_drawer-content_1uo6m_11iof_215.awsui_drawer-content-clickable_1uo6m_11iof_229:not(#\9) {
|
|
228
230
|
cursor: pointer;
|
|
229
231
|
color: var(--color-text-interactive-default-tkx8fe, #424650);
|
|
230
232
|
}
|
|
231
|
-
.awsui_drawer-
|
|
233
|
+
.awsui_drawer-closed_1uo6m_11iof_208 > .awsui_drawer-content_1uo6m_11iof_215.awsui_drawer-content-clickable_1uo6m_11iof_229:not(#\9):hover {
|
|
232
234
|
background: var(--color-background-layout-panel-hover-1ftnua, #ebebf0);
|
|
233
235
|
}
|
|
234
|
-
.awsui_drawer-
|
|
236
|
+
.awsui_drawer-content_1uo6m_11iof_215 > [aria-hidden=true]:not(#\9) {
|
|
235
237
|
display: none;
|
|
236
238
|
}
|
|
237
|
-
.awsui_drawer-
|
|
239
|
+
.awsui_drawer-content_1uo6m_11iof_215 > .awsui_drawer-resize-content_1uo6m_11iof_239:not(#\9) {
|
|
238
240
|
overflow: auto;
|
|
239
241
|
block-size: 100%;
|
|
240
242
|
position: relative;
|
|
241
243
|
}
|
|
244
|
+
.awsui_drawer-content_1uo6m_11iof_215 > .awsui_drawer-content-wrapper_1uo6m_11iof_244:not(#\9) {
|
|
245
|
+
flex: 1;
|
|
246
|
+
}
|
|
242
247
|
|
|
243
|
-
.awsui_drawer-triggers-
|
|
248
|
+
.awsui_drawer-triggers-wrapper_1uo6m_11iof_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-
|
|
255
|
+
.awsui_drawer-trigger_1uo6m_11iof_195:not(#\9) {
|
|
251
256
|
padding-block: var(--space-xxs-p8yyaw, 4px);
|
|
252
257
|
padding-inline: 7px;
|
|
253
258
|
cursor: pointer;
|
|
254
259
|
color: var(--color-text-interactive-default-tkx8fe, #424650);
|
|
255
260
|
}
|
|
256
|
-
.awsui_drawer-
|
|
261
|
+
.awsui_drawer-trigger_1uo6m_11iof_195:not(#\9):not(:first-child) {
|
|
257
262
|
border-block-start: 1px solid var(--color-border-layout-hrw5xj, #b4b4bb);
|
|
258
263
|
}
|
|
259
|
-
.awsui_drawer-
|
|
264
|
+
.awsui_drawer-trigger_1uo6m_11iof_195:not(#\9):hover {
|
|
260
265
|
color: var(--color-text-layout-toggle-hover-v3lnw5, #006ce0);
|
|
261
266
|
}
|
|
262
|
-
.awsui_drawer-trigger-
|
|
267
|
+
.awsui_drawer-trigger-active_1uo6m_11iof_267:not(#\9), .awsui_drawer-trigger-active_1uo6m_11iof_267:not(#\9):hover {
|
|
263
268
|
background-color: var(--color-background-layout-toggle-selected-default-27rnk6, #006ce0);
|
|
264
269
|
color: var(--color-text-layout-toggle-active-as4nbt, #ffffff);
|
|
265
270
|
}
|
|
266
|
-
.awsui_drawer-content-
|
|
271
|
+
.awsui_drawer-content-clickable_1uo6m_11iof_229 > .awsui_drawer-triggers-wrapper_1uo6m_11iof_248 > .awsui_drawer-trigger_1uo6m_11iof_195:not(#\9):hover {
|
|
267
272
|
color: var(--color-text-interactive-default-tkx8fe, #424650);
|
|
268
273
|
}
|
|
269
274
|
|
|
270
|
-
.awsui_resize-handle-
|
|
275
|
+
.awsui_resize-handle-wrapper_1uo6m_11iof_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
|
-
.
|
|
285
|
+
.awsui_hide_1uo6m_11iof_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": "
|
|
6
|
-
"drawer-triggers": "awsui_drawer-
|
|
7
|
-
"drawer": "
|
|
8
|
-
"drawer-mobile": "awsui_drawer-
|
|
9
|
-
"drawer-closed": "awsui_drawer-
|
|
10
|
-
"drawer-content": "awsui_drawer-
|
|
11
|
-
"drawer-content-clickable": "awsui_drawer-content-
|
|
12
|
-
"drawer-resize-content": "awsui_drawer-resize-
|
|
13
|
-
"drawer-
|
|
14
|
-
"drawer-
|
|
15
|
-
"drawer-trigger
|
|
16
|
-
"
|
|
17
|
-
"
|
|
5
|
+
"toggle": "awsui_toggle_1uo6m_11iof_189",
|
|
6
|
+
"drawer-triggers": "awsui_drawer-triggers_1uo6m_11iof_195",
|
|
7
|
+
"drawer": "awsui_drawer_1uo6m_11iof_195",
|
|
8
|
+
"drawer-mobile": "awsui_drawer-mobile_1uo6m_11iof_205",
|
|
9
|
+
"drawer-closed": "awsui_drawer-closed_1uo6m_11iof_208",
|
|
10
|
+
"drawer-content": "awsui_drawer-content_1uo6m_11iof_215",
|
|
11
|
+
"drawer-content-clickable": "awsui_drawer-content-clickable_1uo6m_11iof_229",
|
|
12
|
+
"drawer-resize-content": "awsui_drawer-resize-content_1uo6m_11iof_239",
|
|
13
|
+
"drawer-content-wrapper": "awsui_drawer-content-wrapper_1uo6m_11iof_244",
|
|
14
|
+
"drawer-triggers-wrapper": "awsui_drawer-triggers-wrapper_1uo6m_11iof_248",
|
|
15
|
+
"drawer-trigger": "awsui_drawer-trigger_1uo6m_11iof_195",
|
|
16
|
+
"drawer-trigger-active": "awsui_drawer-trigger-active_1uo6m_11iof_267",
|
|
17
|
+
"resize-handle-wrapper": "awsui_resize-handle-wrapper_1uo6m_11iof_275",
|
|
18
|
+
"hide": "awsui_hide_1uo6m_11iof_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;
|
|
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,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;
|
|
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,M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;IAC5C,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;IAE5C,SAAS,CAAC,GAAG,EAAE;QACb,UAAU,CAAC,UAAU,CAAC,CAAC;IACzB,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;IAE7B,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,QAAQ,KAAK,QAAQ,EAAE;YACzB,OAAO;SACR;QACD,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC,CAAC;QACnD,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;IAE7B,OAAO,CACL,oBAAC,yBAAyB,IAAC,KAAK,kCAAO,IAAI,KAAE,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,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,CA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AC,EACF,GAAG,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,iBAC7C,CAAC,cAAc,EAC5B,OAAO,EAAE,KAAK,CAAC,EAAE;oBACf,iBAAiB,IAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC;gBAChD,CAAC;gBAED,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC,kBAAkB,CAAC,CAAC;oBAC3E,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={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"]}
|
|
@@ -1,90 +1,91 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"background": "
|
|
5
|
-
"scrolling-background": "awsui_scrolling-
|
|
6
|
-
"breadcrumbs": "
|
|
7
|
-
"drawers-container": "awsui_drawers-
|
|
8
|
-
"has-open-drawer": "awsui_has-open-
|
|
9
|
-
"disable-body-scroll": "awsui_disable-body-
|
|
10
|
-
"drawers-desktop-triggers-container": "awsui_drawers-desktop-triggers-
|
|
11
|
-
"has-multiple-triggers": "awsui_has-multiple-
|
|
12
|
-
"drawers-mobile-triggers-container": "awsui_drawers-mobile-triggers-
|
|
13
|
-
"drawers-trigger-content": "awsui_drawers-trigger-
|
|
14
|
-
"drawers-trigger-overflow": "awsui_drawers-trigger-
|
|
15
|
-
"drawers-trigger": "awsui_drawers-
|
|
16
|
-
"drawer": "
|
|
17
|
-
"drawer-content-container": "awsui_drawer-content-
|
|
18
|
-
"drawer-close-button": "awsui_drawer-close-
|
|
19
|
-
"drawer-content": "awsui_drawer-
|
|
20
|
-
"drawer-content-hidden": "awsui_drawer-content-
|
|
21
|
-
"drawer-slider": "awsui_drawer-
|
|
22
|
-
"is-drawer-open": "awsui_is-drawer-
|
|
23
|
-
"content": "
|
|
24
|
-
"layout": "
|
|
25
|
-
"has-max-content-width": "awsui_has-max-content-
|
|
26
|
-
"content-type-dashboard": "awsui_content-type-
|
|
27
|
-
"content-type-table": "awsui_content-type-
|
|
28
|
-
"content-type-cards": "awsui_content-type-
|
|
29
|
-
"is-overlap-disabled": "awsui_is-overlap-
|
|
30
|
-
"is-hide-mobile-toolbar": "awsui_is-hide-mobile-
|
|
31
|
-
"has-content-gap-left": "awsui_has-content-gap-
|
|
32
|
-
"has-content-gap-right": "awsui_has-content-gap-
|
|
33
|
-
"has-breadcrumbs": "awsui_has-
|
|
34
|
-
"content-first-child-header": "awsui_content-first-child-
|
|
35
|
-
"content-first-child-notifications": "awsui_content-first-child-
|
|
36
|
-
"has-header": "awsui_has-
|
|
37
|
-
"content-first-child-main": "awsui_content-first-child-
|
|
38
|
-
"disable-content-paddings": "awsui_disable-content-
|
|
39
|
-
"has-left-toggles-gutter": "awsui_has-left-toggles-
|
|
40
|
-
"has-right-toggles-gutter": "awsui_has-right-toggles-
|
|
41
|
-
"has-split-panel": "awsui_has-split-
|
|
42
|
-
"split-panel-position-bottom": "awsui_split-panel-position-
|
|
43
|
-
"block-body-scroll": "awsui_block-body-
|
|
44
|
-
"unfocusable": "
|
|
45
|
-
"container": "
|
|
46
|
-
"is-navigation-open": "awsui_is-navigation-
|
|
47
|
-
"is-tools-open": "awsui_is-tools-
|
|
48
|
-
"is-split-panel-open": "awsui_is-split-panel-
|
|
49
|
-
"split-panel-position-side": "awsui_split-panel-position-
|
|
50
|
-
"has-active-drawer": "awsui_has-active-
|
|
51
|
-
"mobile-toolbar": "awsui_mobile-
|
|
52
|
-
"remove-high-contrast-header": "awsui_remove-high-contrast-
|
|
53
|
-
"mobile-toolbar-nav": "awsui_mobile-toolbar-
|
|
54
|
-
"mobile-toolbar-breadcrumbs": "awsui_mobile-toolbar-
|
|
55
|
-
"mobile-toolbar-tools": "awsui_mobile-toolbar-
|
|
56
|
-
"navigation-container": "awsui_navigation-
|
|
57
|
-
"show-navigation": "awsui_show-
|
|
58
|
-
"animating": "
|
|
59
|
-
"showButtons": "
|
|
60
|
-
"navigation": "
|
|
61
|
-
"openNavigation": "
|
|
62
|
-
"animated-content": "awsui_animated-
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"tools": "
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"trigger-
|
|
82
|
-
"trigger": "
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"trigger-wrapper
|
|
87
|
-
"
|
|
88
|
-
"
|
|
4
|
+
"background": "awsui_background_hyvsj_17ek5_145",
|
|
5
|
+
"scrolling-background": "awsui_scrolling-background_hyvsj_17ek5_148",
|
|
6
|
+
"breadcrumbs": "awsui_breadcrumbs_hyvsj_17ek5_159",
|
|
7
|
+
"drawers-container": "awsui_drawers-container_hyvsj_17ek5_172",
|
|
8
|
+
"has-open-drawer": "awsui_has-open-drawer_hyvsj_17ek5_183",
|
|
9
|
+
"disable-body-scroll": "awsui_disable-body-scroll_hyvsj_17ek5_204",
|
|
10
|
+
"drawers-desktop-triggers-container": "awsui_drawers-desktop-triggers-container_hyvsj_17ek5_209",
|
|
11
|
+
"has-multiple-triggers": "awsui_has-multiple-triggers_hyvsj_17ek5_250",
|
|
12
|
+
"drawers-mobile-triggers-container": "awsui_drawers-mobile-triggers-container_hyvsj_17ek5_260",
|
|
13
|
+
"drawers-trigger-content": "awsui_drawers-trigger-content_hyvsj_17ek5_265",
|
|
14
|
+
"drawers-trigger-overflow": "awsui_drawers-trigger-overflow_hyvsj_17ek5_279",
|
|
15
|
+
"drawers-trigger": "awsui_drawers-trigger_hyvsj_17ek5_265",
|
|
16
|
+
"drawer": "awsui_drawer_hyvsj_17ek5_172",
|
|
17
|
+
"drawer-content-container": "awsui_drawer-content-container_hyvsj_17ek5_310",
|
|
18
|
+
"drawer-close-button": "awsui_drawer-close-button_hyvsj_17ek5_319",
|
|
19
|
+
"drawer-content": "awsui_drawer-content_hyvsj_17ek5_310",
|
|
20
|
+
"drawer-content-hidden": "awsui_drawer-content-hidden_hyvsj_17ek5_328",
|
|
21
|
+
"drawer-slider": "awsui_drawer-slider_hyvsj_17ek5_331",
|
|
22
|
+
"is-drawer-open": "awsui_is-drawer-open_hyvsj_17ek5_338",
|
|
23
|
+
"content": "awsui_content_hyvsj_17ek5_364",
|
|
24
|
+
"layout": "awsui_layout_hyvsj_17ek5_389",
|
|
25
|
+
"has-max-content-width": "awsui_has-max-content-width_hyvsj_17ek5_461",
|
|
26
|
+
"content-type-dashboard": "awsui_content-type-dashboard_hyvsj_17ek5_476",
|
|
27
|
+
"content-type-table": "awsui_content-type-table_hyvsj_17ek5_490",
|
|
28
|
+
"content-type-cards": "awsui_content-type-cards_hyvsj_17ek5_490",
|
|
29
|
+
"is-overlap-disabled": "awsui_is-overlap-disabled_hyvsj_17ek5_496",
|
|
30
|
+
"is-hide-mobile-toolbar": "awsui_is-hide-mobile-toolbar_hyvsj_17ek5_499",
|
|
31
|
+
"has-content-gap-left": "awsui_has-content-gap-left_hyvsj_17ek5_513",
|
|
32
|
+
"has-content-gap-right": "awsui_has-content-gap-right_hyvsj_17ek5_516",
|
|
33
|
+
"has-breadcrumbs": "awsui_has-breadcrumbs_hyvsj_17ek5_526",
|
|
34
|
+
"content-first-child-header": "awsui_content-first-child-header_hyvsj_17ek5_529",
|
|
35
|
+
"content-first-child-notifications": "awsui_content-first-child-notifications_hyvsj_17ek5_529",
|
|
36
|
+
"has-header": "awsui_has-header_hyvsj_17ek5_529",
|
|
37
|
+
"content-first-child-main": "awsui_content-first-child-main_hyvsj_17ek5_544",
|
|
38
|
+
"disable-content-paddings": "awsui_disable-content-paddings_hyvsj_17ek5_544",
|
|
39
|
+
"has-left-toggles-gutter": "awsui_has-left-toggles-gutter_hyvsj_17ek5_564",
|
|
40
|
+
"has-right-toggles-gutter": "awsui_has-right-toggles-gutter_hyvsj_17ek5_567",
|
|
41
|
+
"has-split-panel": "awsui_has-split-panel_hyvsj_17ek5_587",
|
|
42
|
+
"split-panel-position-bottom": "awsui_split-panel-position-bottom_hyvsj_17ek5_587",
|
|
43
|
+
"block-body-scroll": "awsui_block-body-scroll_hyvsj_17ek5_595",
|
|
44
|
+
"unfocusable": "awsui_unfocusable_hyvsj_17ek5_600",
|
|
45
|
+
"container": "awsui_container_hyvsj_17ek5_610",
|
|
46
|
+
"is-navigation-open": "awsui_is-navigation-open_hyvsj_17ek5_636",
|
|
47
|
+
"is-tools-open": "awsui_is-tools-open_hyvsj_17ek5_639",
|
|
48
|
+
"is-split-panel-open": "awsui_is-split-panel-open_hyvsj_17ek5_639",
|
|
49
|
+
"split-panel-position-side": "awsui_split-panel-position-side_hyvsj_17ek5_639",
|
|
50
|
+
"has-active-drawer": "awsui_has-active-drawer_hyvsj_17ek5_639",
|
|
51
|
+
"mobile-toolbar": "awsui_mobile-toolbar_hyvsj_17ek5_652",
|
|
52
|
+
"remove-high-contrast-header": "awsui_remove-high-contrast-header_hyvsj_17ek5_669",
|
|
53
|
+
"mobile-toolbar-nav": "awsui_mobile-toolbar-nav_hyvsj_17ek5_673",
|
|
54
|
+
"mobile-toolbar-breadcrumbs": "awsui_mobile-toolbar-breadcrumbs_hyvsj_17ek5_677",
|
|
55
|
+
"mobile-toolbar-tools": "awsui_mobile-toolbar-tools_hyvsj_17ek5_681",
|
|
56
|
+
"navigation-container": "awsui_navigation-container_hyvsj_17ek5_690",
|
|
57
|
+
"show-navigation": "awsui_show-navigation_hyvsj_17ek5_728",
|
|
58
|
+
"animating": "awsui_animating_hyvsj_17ek5_751",
|
|
59
|
+
"showButtons": "awsui_showButtons_hyvsj_17ek5_1",
|
|
60
|
+
"navigation": "awsui_navigation_hyvsj_17ek5_690",
|
|
61
|
+
"openNavigation": "awsui_openNavigation_hyvsj_17ek5_1",
|
|
62
|
+
"animated-content": "awsui_animated-content_hyvsj_17ek5_815",
|
|
63
|
+
"content-container": "awsui_content-container_hyvsj_17ek5_818",
|
|
64
|
+
"hide-navigation": "awsui_hide-navigation_hyvsj_17ek5_827",
|
|
65
|
+
"notifications": "awsui_notifications_hyvsj_17ek5_837",
|
|
66
|
+
"has-notification-content": "awsui_has-notification-content_hyvsj_17ek5_842",
|
|
67
|
+
"sticky-notifications": "awsui_sticky-notifications_hyvsj_17ek5_846",
|
|
68
|
+
"high-contrast": "awsui_high-contrast_hyvsj_17ek5_851",
|
|
69
|
+
"split-panel-bottom": "awsui_split-panel-bottom_hyvsj_17ek5_869",
|
|
70
|
+
"position-bottom": "awsui_position-bottom_hyvsj_17ek5_916",
|
|
71
|
+
"openSplitPanelBottom": "awsui_openSplitPanelBottom_hyvsj_17ek5_1",
|
|
72
|
+
"split-panel-side": "awsui_split-panel-side_hyvsj_17ek5_945",
|
|
73
|
+
"position-side": "awsui_position-side_hyvsj_17ek5_958",
|
|
74
|
+
"tools-container": "awsui_tools-container_hyvsj_17ek5_980",
|
|
75
|
+
"tools": "awsui_tools_hyvsj_17ek5_980",
|
|
76
|
+
"openTools": "awsui_openTools_hyvsj_17ek5_1",
|
|
77
|
+
"has-tools-form-persistence": "awsui_has-tools-form-persistence_hyvsj_17ek5_1069",
|
|
78
|
+
"hide-tools": "awsui_hide-tools_hyvsj_17ek5_1079",
|
|
79
|
+
"show-tools": "awsui_show-tools_hyvsj_17ek5_1091",
|
|
80
|
+
"has-tools-form": "awsui_has-tools-form_hyvsj_17ek5_1069",
|
|
81
|
+
"trigger-button-styles": "awsui_trigger-button-styles_hyvsj_17ek5_1174",
|
|
82
|
+
"trigger-badge-wrapper": "awsui_trigger-badge-wrapper_hyvsj_17ek5_1190",
|
|
83
|
+
"trigger": "awsui_trigger_hyvsj_17ek5_1174",
|
|
84
|
+
"selected": "awsui_selected_hyvsj_17ek5_1242",
|
|
85
|
+
"badge": "awsui_badge_hyvsj_17ek5_1262",
|
|
86
|
+
"trigger-wrapper": "awsui_trigger-wrapper_hyvsj_17ek5_1266",
|
|
87
|
+
"trigger-wrapper-tooltip-visible": "awsui_trigger-wrapper-tooltip-visible_hyvsj_17ek5_1277",
|
|
88
|
+
"dot": "awsui_dot_hyvsj_17ek5_1281",
|
|
89
|
+
"trigger-tooltip": "awsui_trigger-tooltip_hyvsj_17ek5_1294"
|
|
89
90
|
};
|
|
90
91
|
|