@cloudscape-design/components 3.0.164 → 3.0.165
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/index.d.ts.map +1 -1
- package/app-layout/index.js +2 -1
- package/app-layout/index.js.map +1 -1
- package/app-layout/visual-refresh/app-bar.js +3 -3
- package/app-layout/visual-refresh/app-bar.js.map +1 -1
- package/app-layout/visual-refresh/background.js +3 -3
- package/app-layout/visual-refresh/background.js.map +1 -1
- package/app-layout/visual-refresh/context.d.ts +8 -45
- package/app-layout/visual-refresh/context.d.ts.map +1 -1
- package/app-layout/visual-refresh/context.js +19 -66
- package/app-layout/visual-refresh/context.js.map +1 -1
- package/app-layout/visual-refresh/header.js +3 -3
- package/app-layout/visual-refresh/header.js.map +1 -1
- package/app-layout/visual-refresh/index.d.ts.map +1 -1
- package/app-layout/visual-refresh/index.js +5 -4
- package/app-layout/visual-refresh/index.js.map +1 -1
- package/app-layout/visual-refresh/layout.d.ts.map +1 -1
- package/app-layout/visual-refresh/layout.js +3 -3
- package/app-layout/visual-refresh/layout.js.map +1 -1
- package/app-layout/visual-refresh/main.js +3 -3
- package/app-layout/visual-refresh/main.js.map +1 -1
- package/app-layout/visual-refresh/navigation.js +3 -3
- package/app-layout/visual-refresh/navigation.js.map +1 -1
- package/app-layout/visual-refresh/notifications.js +3 -3
- package/app-layout/visual-refresh/notifications.js.map +1 -1
- package/app-layout/visual-refresh/split-panel.d.ts.map +1 -1
- package/app-layout/visual-refresh/split-panel.js +5 -5
- package/app-layout/visual-refresh/split-panel.js.map +1 -1
- package/app-layout/visual-refresh/tools.d.ts.map +1 -1
- package/app-layout/visual-refresh/tools.js +3 -3
- package/app-layout/visual-refresh/tools.js.map +1 -1
- package/container/internal.d.ts.map +1 -1
- package/container/internal.js +9 -9
- package/container/internal.js.map +1 -1
- package/container/styles.css.js +17 -17
- package/container/styles.scoped.css +29 -37
- package/container/styles.selectors.js +17 -17
- package/content-layout/index.d.ts.map +1 -1
- package/content-layout/index.js +5 -5
- package/content-layout/index.js.map +1 -1
- package/internal/context/app-layout-context.d.ts +4 -4
- package/internal/context/app-layout-context.d.ts.map +1 -1
- package/internal/context/app-layout-context.js +3 -4
- package/internal/context/app-layout-context.js.map +1 -1
- package/internal/environment.js +1 -1
- package/{app-layout/visual-refresh/hooks/use-dynamic-overlap.d.ts → internal/hooks/use-dynamic-overlap/index.d.ts} +1 -1
- package/internal/hooks/use-dynamic-overlap/index.d.ts.map +1 -0
- package/{app-layout/visual-refresh/hooks/use-dynamic-overlap.js → internal/hooks/use-dynamic-overlap/index.js} +7 -7
- package/internal/hooks/use-dynamic-overlap/index.js.map +1 -0
- package/internal/manifest.json +1 -1
- package/package.json +1 -1
- package/split-panel/index.d.ts.map +1 -1
- package/split-panel/index.js +2 -1
- package/split-panel/index.js.map +1 -1
- package/table/internal.js +1 -1
- package/table/internal.js.map +1 -1
- package/table/sticky-scrollbar.d.ts.map +1 -1
- package/table/sticky-scrollbar.js +3 -8
- package/table/sticky-scrollbar.js.map +1 -1
- package/wizard/wizard-form-header.js +1 -1
- package/wizard/wizard-form-header.js.map +1 -1
- package/app-layout/visual-refresh/hooks/use-dynamic-overlap.d.ts.map +0 -1
- package/app-layout/visual-refresh/hooks/use-dynamic-overlap.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import React
|
|
3
|
+
import React from 'react';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { InternalButton } from '../../button/internal';
|
|
6
|
-
import {
|
|
6
|
+
import { useAppLayoutInternals } from './context';
|
|
7
7
|
import { useSplitPanelContext } from '../../internal/context/split-panel-context';
|
|
8
8
|
import TriggerButton from './trigger-button';
|
|
9
9
|
import styles from './styles.css.js';
|
|
@@ -21,7 +21,7 @@ import customCssProps from '../../internal/generated/custom-css-properties';
|
|
|
21
21
|
*/
|
|
22
22
|
export default function Tools(_a) {
|
|
23
23
|
var children = _a.children;
|
|
24
|
-
var _b =
|
|
24
|
+
var _b = useAppLayoutInternals(), ariaLabels = _b.ariaLabels, handleSplitPanelClick = _b.handleSplitPanelClick, handleToolsClick = _b.handleToolsClick, hasDefaultToolsWidth = _b.hasDefaultToolsWidth, isNavigationOpen = _b.isNavigationOpen, isMobile = _b.isMobile, isSplitPanelOpen = _b.isSplitPanelOpen, isToolsOpen = _b.isToolsOpen, splitPanel = _b.splitPanel, tools = _b.tools, toolsHide = _b.toolsHide, toolsWidth = _b.toolsWidth, isAnyPanelOpen = _b.isAnyPanelOpen, navigationHide = _b.navigationHide, toolsFocusControl = _b.toolsFocusControl, splitPanelPosition = _b.splitPanelPosition;
|
|
25
25
|
var openButtonAriaLabel = useSplitPanelContext().openButtonAriaLabel;
|
|
26
26
|
var hasSplitPanel = getSplitPanelStatus(splitPanel, splitPanelPosition);
|
|
27
27
|
var hasToolsForm = getToolsFormStatus(hasSplitPanel, isMobile, isSplitPanelOpen, isToolsOpen, toolsHide);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/tools.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,gBAAgB,MAAM,iCAAiC,CAAC;AAC/D,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3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ED,6BAA6B;QAC7B,IAAI,CAAC,aAAa,IAAI,CAAC,SAAS,IAAI,CAAC,WAAW,EAAE;YAChD,YAAY,GAAG,IAAI,CAAC;SACrB;KACF;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,uBAAuB,CAC9B,aAAsB,EACtB,gBAA0B,EAC1B,WAAqB,EACrB,SAAmB;IAEnB,IAAI,uBAAuB,GAAG,KAAK,CAAC;IAEpC,2DAA2D;IAC3D,IAAI,aAAa,IAAI,CAAC,SAAS,IAAI,CAAC,gBAAgB,IAAI,WAAW,CAAC,EAAE;QACpE,uBAAuB,GAAG,IAAI,CAAC;KAChC;IAED,OAAO,uBAAuB,CAAC;AACjC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext } from 'react';\nimport clsx from 'clsx';\nimport { InternalButton } from '../../button/internal';\nimport { AppLayoutContext } from './context';\nimport { useSplitPanelContext } from '../../internal/context/split-panel-context';\nimport TriggerButton from './trigger-button';\nimport styles from './styles.css.js';\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { Transition } from '../../internal/components/transition';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\ninterface ToolsProps {\n children: React.ReactNode;\n}\n\n/**\n * The Tools 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 split panel, which exists only if there is a split panel in side position;\n * the tools, or drawer, that contains the hide tools form and the children passed through the API;\n * the show tools form that contains the triggers for both the drawer and the\n * split panel in large viewports;\n */\nexport default function Tools({ children }: ToolsProps) {\n const {\n ariaLabels,\n handleSplitPanelClick,\n handleToolsClick,\n hasDefaultToolsWidth,\n isNavigationOpen,\n isMobile,\n isSplitPanelOpen,\n isToolsOpen,\n splitPanel,\n tools,\n toolsHide,\n toolsWidth,\n isAnyPanelOpen,\n navigationHide,\n toolsFocusControl,\n splitPanelPosition,\n } = useContext(AppLayoutContext);\n\n const { openButtonAriaLabel } = useSplitPanelContext();\n\n const hasSplitPanel = getSplitPanelStatus(splitPanel, splitPanelPosition);\n const hasToolsForm = getToolsFormStatus(hasSplitPanel, isMobile, isSplitPanelOpen, isToolsOpen, toolsHide);\n const hasToolsFormPersistence = getToolsFormPersistence(hasSplitPanel, isSplitPanelOpen, isToolsOpen, toolsHide);\n\n const { refs: focusRefs } = toolsFocusControl;\n\n if (toolsHide && !hasSplitPanel) {\n return null;\n }\n\n const isUnfocusable = isMobile && isAnyPanelOpen && isNavigationOpen && !navigationHide;\n\n return (\n <Transition in={isToolsOpen ?? false}>\n {(state, transitionEventsRef) => (\n <div\n className={clsx(styles['tools-container'], {\n [testutilStyles['drawer-closed']]: !isToolsOpen,\n [styles.unfocusable]: isUnfocusable,\n })}\n style={{\n [customCssProps.toolsAnimationStartingOpacity]: `${hasSplitPanel && isSplitPanelOpen ? 1 : 0}`,\n // Overwrite the default tools width (depends on breakpoints) only when the `toolsWidth` property has been set.\n [customCssProps.toolsWidth]: hasDefaultToolsWidth ? '' : `${toolsWidth}px`,\n }}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n toolsFocusControl.loseFocus();\n }\n }}\n >\n {children}\n\n {!toolsHide && (\n <aside\n aria-hidden={!isToolsOpen ? true : false}\n aria-label={ariaLabels?.tools ?? undefined}\n className={clsx(\n styles.tools,\n {\n [styles.animating]: state === 'entering',\n [styles['has-tools-form-persistence']]: hasToolsFormPersistence,\n [styles['is-tools-open']]: isToolsOpen,\n },\n testutilStyles.tools\n )}\n ref={state !== 'exiting' ? transitionEventsRef : undefined}\n >\n <div className={clsx(styles['animated-content'])}>\n <div className={clsx(styles['hide-tools'])}>\n <InternalButton\n ariaLabel={ariaLabels?.toolsClose ?? undefined}\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => handleToolsClick(false)}\n variant=\"icon\"\n formAction=\"none\"\n className={testutilStyles['tools-close']}\n ref={focusRefs.close}\n ariaExpanded={true}\n __nativeAttributes={{ 'aria-haspopup': true }}\n />\n </div>\n\n {tools}\n </div>\n </aside>\n )}\n\n {!isMobile && (\n <aside\n aria-hidden={!hasToolsForm ? true : false}\n aria-label={ariaLabels?.tools ?? undefined}\n className={clsx(\n styles['show-tools'],\n {\n [styles.animating]: state === 'exiting',\n [styles['has-tools-form']]: hasToolsForm,\n [styles['has-tools-form-persistence']]: hasToolsFormPersistence,\n },\n splitPanelStyles.root\n )}\n ref={state === 'exiting' ? transitionEventsRef : undefined}\n >\n {!toolsHide && (\n <TriggerButton\n ariaLabel={ariaLabels?.toolsToggle}\n iconName=\"status-info\"\n onClick={() => handleToolsClick(!isToolsOpen)}\n selected={hasSplitPanel && isToolsOpen}\n className={testutilStyles['tools-toggle']}\n ref={focusRefs.toggle}\n />\n )}\n\n {hasSplitPanel && (\n <TriggerButton\n ariaLabel={openButtonAriaLabel}\n iconName=\"view-vertical\"\n onClick={() => handleSplitPanelClick()}\n selected={hasSplitPanel && isSplitPanelOpen}\n className={splitPanelStyles['open-button']}\n // TODO should this button also get focus handling? (i.e. when the split panel is toggled)\n />\n )}\n </aside>\n )}\n </div>\n )}\n </Transition>\n );\n}\n\n/**\n * Determine the default state of the Tools component. Mobile viewports should be\n * closed by default under all circumstances. If the toolsOpen prop has not been\n * set then it should be closed as well. Otherwise, default to the toolsOpen prop.\n */\nexport function getToolsDefaultState(isMobile: boolean, stateFromProps?: boolean) {\n let isToolsOpen;\n\n if (isMobile || stateFromProps === undefined) {\n isToolsOpen = false;\n } else {\n isToolsOpen = stateFromProps;\n }\n\n return isToolsOpen;\n}\n\n/**\n * This simple function returns the presence of the split panel as a child of the\n * Tools component. It must exist and be in side position.\n */\nfunction getSplitPanelStatus(splitPanel: React.ReactNode, splitPanelPosition: string) {\n return splitPanel && splitPanelPosition === 'side' ? true : false;\n}\n\n/**\n * By default the Tools form is styled as display: none; This behavior should\n * be unchanged in mobile viewports where the Tools form is always suppressed.\n * In large viewports, however the Tools form and its corresponding buttons\n * should be present in the UI under the below circumstances.\n */\nfunction getToolsFormStatus(\n hasSplitPanel: boolean,\n isMobile: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsForm = false;\n\n if (!isMobile) {\n // Both the Split Panel and Tools button are needed\n if (hasSplitPanel && !toolsHide) {\n hasToolsForm = true;\n }\n\n // The Split Panel button is needed\n if (hasSplitPanel && !isSplitPanelOpen && toolsHide) {\n hasToolsForm = true;\n }\n\n // The Tools button is needed\n if (!hasSplitPanel && !toolsHide && !isToolsOpen) {\n hasToolsForm = true;\n }\n }\n\n return hasToolsForm;\n}\n\n/**\n * Under two scenarios the Tools form that contains the triggers\n * for the Tools content and the Split Panel may be persistent\n * in the UI (as opposed to disappearing when one of the drawers\n * is open). This will also add a white background as opposed to the\n * default transparent background. The buttons will present and in a\n * selected / not selected state.\n */\nfunction getToolsFormPersistence(\n hasSplitPanel: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsFormPersistence = false;\n\n // Both Tools and Split Panel exist and one or both is open\n if (hasSplitPanel && !toolsHide && (isSplitPanelOpen || isToolsOpen)) {\n hasToolsFormPersistence = true;\n }\n\n return hasToolsFormPersistence;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/tools.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,O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,mCAAmC;QACnC,IAAI,aAAa,IAAI,CAAC,gBAAgB,IAAI,SAAS,EAAE;YACnD,YAAY,GAAG,IAAI,CAAC;SACrB;QAED,6BAA6B;QAC7B,IAAI,CAAC,aAAa,IAAI,CAAC,SAAS,IAAI,CAAC,WAAW,EAAE;YAChD,YAAY,GAAG,IAAI,CAAC;SACrB;KACF;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,uBAAuB,CAC9B,aAAsB,EACtB,gBAA0B,EAC1B,WAAqB,EACrB,SAAmB;IAEnB,IAAI,uBAAuB,GAAG,KAAK,CAAC;IAEpC,2DAA2D;IAC3D,IAAI,aAAa,IAAI,CAAC,SAAS,IAAI,CAAC,gBAAgB,IAAI,WAAW,CAAC,EAAE;QACpE,uBAAuB,GAAG,IAAI,CAAC;KAChC;IAED,OAAO,uBAAuB,CAAC;AACjC,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';\nimport { InternalButton } from '../../button/internal';\nimport { useAppLayoutInternals } from './context';\nimport { useSplitPanelContext } from '../../internal/context/split-panel-context';\nimport TriggerButton from './trigger-button';\nimport styles from './styles.css.js';\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { Transition } from '../../internal/components/transition';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\ninterface ToolsProps {\n children: React.ReactNode;\n}\n\n/**\n * The Tools 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 split panel, which exists only if there is a split panel in side position;\n * the tools, or drawer, that contains the hide tools form and the children passed through the API;\n * the show tools form that contains the triggers for both the drawer and the\n * split panel in large viewports;\n */\nexport default function Tools({ children }: ToolsProps) {\n const {\n ariaLabels,\n handleSplitPanelClick,\n handleToolsClick,\n hasDefaultToolsWidth,\n isNavigationOpen,\n isMobile,\n isSplitPanelOpen,\n isToolsOpen,\n splitPanel,\n tools,\n toolsHide,\n toolsWidth,\n isAnyPanelOpen,\n navigationHide,\n toolsFocusControl,\n splitPanelPosition,\n } = useAppLayoutInternals();\n\n const { openButtonAriaLabel } = useSplitPanelContext();\n\n const hasSplitPanel = getSplitPanelStatus(splitPanel, splitPanelPosition);\n const hasToolsForm = getToolsFormStatus(hasSplitPanel, isMobile, isSplitPanelOpen, isToolsOpen, toolsHide);\n const hasToolsFormPersistence = getToolsFormPersistence(hasSplitPanel, isSplitPanelOpen, isToolsOpen, toolsHide);\n\n const { refs: focusRefs } = toolsFocusControl;\n\n if (toolsHide && !hasSplitPanel) {\n return null;\n }\n\n const isUnfocusable = isMobile && isAnyPanelOpen && isNavigationOpen && !navigationHide;\n\n return (\n <Transition in={isToolsOpen ?? false}>\n {(state, transitionEventsRef) => (\n <div\n className={clsx(styles['tools-container'], {\n [testutilStyles['drawer-closed']]: !isToolsOpen,\n [styles.unfocusable]: isUnfocusable,\n })}\n style={{\n [customCssProps.toolsAnimationStartingOpacity]: `${hasSplitPanel && isSplitPanelOpen ? 1 : 0}`,\n // Overwrite the default tools width (depends on breakpoints) only when the `toolsWidth` property has been set.\n [customCssProps.toolsWidth]: hasDefaultToolsWidth ? '' : `${toolsWidth}px`,\n }}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n toolsFocusControl.loseFocus();\n }\n }}\n >\n {children}\n\n {!toolsHide && (\n <aside\n aria-hidden={!isToolsOpen ? true : false}\n aria-label={ariaLabels?.tools ?? undefined}\n className={clsx(\n styles.tools,\n {\n [styles.animating]: state === 'entering',\n [styles['has-tools-form-persistence']]: hasToolsFormPersistence,\n [styles['is-tools-open']]: isToolsOpen,\n },\n testutilStyles.tools\n )}\n ref={state !== 'exiting' ? transitionEventsRef : undefined}\n >\n <div className={clsx(styles['animated-content'])}>\n <div className={clsx(styles['hide-tools'])}>\n <InternalButton\n ariaLabel={ariaLabels?.toolsClose ?? undefined}\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => handleToolsClick(false)}\n variant=\"icon\"\n formAction=\"none\"\n className={testutilStyles['tools-close']}\n ref={focusRefs.close}\n ariaExpanded={true}\n __nativeAttributes={{ 'aria-haspopup': true }}\n />\n </div>\n\n {tools}\n </div>\n </aside>\n )}\n\n {!isMobile && (\n <aside\n aria-hidden={!hasToolsForm ? true : false}\n aria-label={ariaLabels?.tools ?? undefined}\n className={clsx(\n styles['show-tools'],\n {\n [styles.animating]: state === 'exiting',\n [styles['has-tools-form']]: hasToolsForm,\n [styles['has-tools-form-persistence']]: hasToolsFormPersistence,\n },\n splitPanelStyles.root\n )}\n ref={state === 'exiting' ? transitionEventsRef : undefined}\n >\n {!toolsHide && (\n <TriggerButton\n ariaLabel={ariaLabels?.toolsToggle}\n iconName=\"status-info\"\n onClick={() => handleToolsClick(!isToolsOpen)}\n selected={hasSplitPanel && isToolsOpen}\n className={testutilStyles['tools-toggle']}\n ref={focusRefs.toggle}\n />\n )}\n\n {hasSplitPanel && (\n <TriggerButton\n ariaLabel={openButtonAriaLabel}\n iconName=\"view-vertical\"\n onClick={() => handleSplitPanelClick()}\n selected={hasSplitPanel && isSplitPanelOpen}\n className={splitPanelStyles['open-button']}\n // TODO should this button also get focus handling? (i.e. when the split panel is toggled)\n />\n )}\n </aside>\n )}\n </div>\n )}\n </Transition>\n );\n}\n\n/**\n * Determine the default state of the Tools component. Mobile viewports should be\n * closed by default under all circumstances. If the toolsOpen prop has not been\n * set then it should be closed as well. Otherwise, default to the toolsOpen prop.\n */\nexport function getToolsDefaultState(isMobile: boolean, stateFromProps?: boolean) {\n let isToolsOpen;\n\n if (isMobile || stateFromProps === undefined) {\n isToolsOpen = false;\n } else {\n isToolsOpen = stateFromProps;\n }\n\n return isToolsOpen;\n}\n\n/**\n * This simple function returns the presence of the split panel as a child of the\n * Tools component. It must exist and be in side position.\n */\nfunction getSplitPanelStatus(splitPanel: React.ReactNode, splitPanelPosition: string) {\n return splitPanel && splitPanelPosition === 'side' ? true : false;\n}\n\n/**\n * By default the Tools form is styled as display: none; This behavior should\n * be unchanged in mobile viewports where the Tools form is always suppressed.\n * In large viewports, however the Tools form and its corresponding buttons\n * should be present in the UI under the below circumstances.\n */\nfunction getToolsFormStatus(\n hasSplitPanel: boolean,\n isMobile: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsForm = false;\n\n if (!isMobile) {\n // Both the Split Panel and Tools button are needed\n if (hasSplitPanel && !toolsHide) {\n hasToolsForm = true;\n }\n\n // The Split Panel button is needed\n if (hasSplitPanel && !isSplitPanelOpen && toolsHide) {\n hasToolsForm = true;\n }\n\n // The Tools button is needed\n if (!hasSplitPanel && !toolsHide && !isToolsOpen) {\n hasToolsForm = true;\n }\n }\n\n return hasToolsForm;\n}\n\n/**\n * Under two scenarios the Tools form that contains the triggers\n * for the Tools content and the Split Panel may be persistent\n * in the UI (as opposed to disappearing when one of the drawers\n * is open). This will also add a white background as opposed to the\n * default transparent background. The buttons will present and in a\n * selected / not selected state.\n */\nfunction getToolsFormPersistence(\n hasSplitPanel: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsFormPersistence = false;\n\n // Both Tools and Split Panel exist and one or both is open\n if (hasSplitPanel && !toolsHide && (isSplitPanelOpen || isToolsOpen)) {\n hasToolsFormPersistence = true;\n }\n\n return hasToolsFormPersistence;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/container/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/container/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG9C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAOlF,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,EAAE,0BAA0B;IACzG,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,GAAG,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC;CAC1E;AAED,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,MAAM,EACN,MAAM,EACN,QAAQ,EACR,OAAmB,EACnB,qBAA6B,EAC7B,sBAA8B,EAC9B,SAAS,EACT,cAAc,EACd,cAAsB,EACtB,iBAAwB,EACxB,sBAA8B,EAC9B,uBAA+B,EAC/B,eAAuB,EACvB,WAAW,EACX,UAAU,EACV,YAAoB,EACpB,GAAG,SAAS,EACb,EAAE,sBAAsB,eAsFxB"}
|
package/container/internal.js
CHANGED
|
@@ -2,11 +2,11 @@ import { __assign, __rest } from "tslib";
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import React, {
|
|
6
|
-
import { AppLayoutContext } from '../app-layout/visual-refresh/context';
|
|
5
|
+
import React, { useEffect, useRef } from 'react';
|
|
7
6
|
import { getBaseProps } from '../internal/base-component';
|
|
7
|
+
import { useAppLayoutContext } from '../internal/context/app-layout-context';
|
|
8
8
|
import { StickyHeaderContext, useStickyHeader } from './use-sticky-header';
|
|
9
|
-
import { useDynamicOverlap } from '../
|
|
9
|
+
import { useDynamicOverlap } from '../internal/hooks/use-dynamic-overlap';
|
|
10
10
|
import { useMergeRefs } from '../internal/hooks/use-merge-refs';
|
|
11
11
|
import { useVisualRefresh } from '../internal/hooks/use-visual-mode';
|
|
12
12
|
import styles from './styles.css.js';
|
|
@@ -17,7 +17,7 @@ export default function InternalContainer(_a) {
|
|
|
17
17
|
var rootRef = useRef(null);
|
|
18
18
|
var headerRef = useRef(null);
|
|
19
19
|
var _p = useStickyHeader(rootRef, headerRef, __stickyHeader, __stickyOffset), isSticky = _p.isSticky, isStuck = _p.isStuck, stickyStyles = _p.stickyStyles;
|
|
20
|
-
var setHasStickyBackground =
|
|
20
|
+
var setHasStickyBackground = useAppLayoutContext().setHasStickyBackground;
|
|
21
21
|
var isRefresh = useVisualRefresh();
|
|
22
22
|
var hasDynamicHeight = isRefresh && variant === 'full-page';
|
|
23
23
|
var overlapElement = useDynamicOverlap({ disabled: !hasDynamicHeight || !__darkHeader });
|
|
@@ -26,20 +26,20 @@ export default function InternalContainer(_a) {
|
|
|
26
26
|
var headerIdProp = __headerId ? { id: __headerId } : {};
|
|
27
27
|
/**
|
|
28
28
|
* The visual refresh AppLayout component needs to know if a child component
|
|
29
|
-
* has a high
|
|
29
|
+
* has a high contrast sticky header. This is to make sure the background element
|
|
30
30
|
* stays in the same vertical position as the header content.
|
|
31
31
|
*/
|
|
32
|
-
useEffect(function
|
|
33
|
-
var shouldUpdateStickyBackground =
|
|
32
|
+
useEffect(function () {
|
|
33
|
+
var shouldUpdateStickyBackground = isSticky && variant === 'full-page' && setHasStickyBackground;
|
|
34
34
|
if (shouldUpdateStickyBackground) {
|
|
35
35
|
setHasStickyBackground(true);
|
|
36
36
|
}
|
|
37
|
-
return function
|
|
37
|
+
return function () {
|
|
38
38
|
if (shouldUpdateStickyBackground) {
|
|
39
39
|
setHasStickyBackground(false);
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
-
}, [
|
|
42
|
+
}, [isSticky, setHasStickyBackground, variant]);
|
|
43
43
|
return (React.createElement("div", __assign({}, baseProps, { className: clsx(baseProps.className, styles.root, styles["variant-".concat(variant)], fitHeight && styles['root-fit-height']), ref: mergedRef }),
|
|
44
44
|
header && (React.createElement(StickyHeaderContext.Provider, { value: { isStuck: isStuck } },
|
|
45
45
|
React.createElement("div", __assign({ className: clsx(styles.header, styles["header-variant-".concat(variant)], (_b = {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/container/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/container/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAE7E,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAoBrC,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EAkBjB;;IAjBvB,IAAA,MAAM,YAAA,EACN,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,eAAmB,EAA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C,IAAG,eAAe;wBAChD,IACE,YAAY,EACZ,YAAY,IAChB,GAAG,EAAE,eAAe,KAEnB,YAAY,CAAC,CAAC,CAAC,CACd,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,8BAA8B,CAAC,IAAG,MAAM,CAAO,CAC5F,CAAC,CAAC,CAAC,CACF,MAAM,CACP,CACG,CACuB,CAChC;QACD,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO;gBAC5B,GAAC,MAAM,CAAC,eAAe,CAAC,IAAG,CAAC,sBAAsB;oBAClD,IAED,QAAQ,CACL;QACL,MAAM,IAAI,CACT,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;gBAC3B,GAAC,MAAM,CAAC,cAAc,CAAC,IAAG,CAAC,sBAAsB;gBACjD,GAAC,MAAM,CAAC,eAAe,CAAC,IAAG,CAAC,uBAAuB;oBACnD,IAED,MAAM,CACH,CACP,CACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useEffect, useRef } from 'react';\nimport { ContainerProps } from './interfaces';\nimport { getBaseProps } from '../internal/base-component';\nimport { useAppLayoutContext } from '../internal/context/app-layout-context';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { StickyHeaderContext, useStickyHeader } from './use-sticky-header';\nimport { useDynamicOverlap } from '../internal/hooks/use-dynamic-overlap';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport styles from './styles.css.js';\n\nexport interface InternalContainerProps extends Omit<ContainerProps, 'variant'>, InternalBaseComponentProps {\n __stickyHeader?: boolean;\n __stickyOffset?: number;\n __disableFooterDivider?: boolean;\n __disableFooterPaddings?: boolean;\n __hiddenContent?: boolean;\n __headerRef?: React.RefObject<HTMLDivElement>;\n __headerId?: string;\n __darkHeader?: boolean;\n /**\n * Additional internal variant:\n * * `embedded` - Use this variant within a parent container (such as a modal,\n * expandable section, container or split panel).\n * * `full-page` – Only for internal use in table, cards and other components\n */\n variant?: ContainerProps['variant'] | 'embedded' | 'full-page' | 'cards';\n}\n\nexport default function InternalContainer({\n header,\n footer,\n children,\n variant = 'default',\n disableHeaderPaddings = false,\n disableContentPaddings = false,\n fitHeight,\n __stickyOffset,\n __stickyHeader = false,\n __internalRootRef = null,\n __disableFooterDivider = false,\n __disableFooterPaddings = false,\n __hiddenContent = false,\n __headerRef,\n __headerId,\n __darkHeader = false,\n ...restProps\n}: InternalContainerProps) {\n const baseProps = getBaseProps(restProps);\n const rootRef = useRef<HTMLDivElement>(null);\n const headerRef = useRef<HTMLDivElement>(null);\n const { isSticky, isStuck, stickyStyles } = useStickyHeader(rootRef, headerRef, __stickyHeader, __stickyOffset);\n const { setHasStickyBackground } = useAppLayoutContext();\n const isRefresh = useVisualRefresh();\n\n const hasDynamicHeight = isRefresh && variant === 'full-page';\n const overlapElement = useDynamicOverlap({ disabled: !hasDynamicHeight || !__darkHeader });\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n const headerMergedRef = useMergeRefs(headerRef, overlapElement, __headerRef);\n const headerIdProp = __headerId ? { id: __headerId } : {};\n\n /**\n * The visual refresh AppLayout component needs to know if a child component\n * has a high contrast sticky header. This is to make sure the background element\n * stays in the same vertical position as the header content.\n */\n useEffect(() => {\n const shouldUpdateStickyBackground = isSticky && variant === 'full-page' && setHasStickyBackground;\n if (shouldUpdateStickyBackground) {\n setHasStickyBackground(true);\n }\n\n return () => {\n if (shouldUpdateStickyBackground) {\n setHasStickyBackground(false);\n }\n };\n }, [isSticky, setHasStickyBackground, variant]);\n\n return (\n <div\n {...baseProps}\n className={clsx(\n baseProps.className,\n styles.root,\n styles[`variant-${variant}`],\n fitHeight && styles['root-fit-height']\n )}\n ref={mergedRef}\n >\n {header && (\n <StickyHeaderContext.Provider value={{ isStuck }}>\n <div\n className={clsx(styles.header, styles[`header-variant-${variant}`], {\n [styles['header-sticky-disabled']]: __stickyHeader && !isSticky,\n [styles['header-sticky-enabled']]: isSticky,\n [styles['header-dynamic-height']]: hasDynamicHeight,\n [styles['header-stuck']]: isStuck,\n [styles['with-paddings']]: !disableHeaderPaddings,\n [styles['with-hidden-content']]: __hiddenContent,\n })}\n {...headerIdProp}\n {...stickyStyles}\n ref={headerMergedRef}\n >\n {__darkHeader ? (\n <div className={clsx(styles['dark-header'], 'awsui-context-content-header')}>{header}</div>\n ) : (\n header\n )}\n </div>\n </StickyHeaderContext.Provider>\n )}\n <div\n className={clsx(styles.content, {\n [styles['with-paddings']]: !disableContentPaddings,\n })}\n >\n {children}\n </div>\n {footer && (\n <div\n className={clsx(styles.footer, {\n [styles['with-divider']]: !__disableFooterDivider,\n [styles['with-paddings']]: !__disableFooterPaddings,\n })}\n >\n {footer}\n </div>\n )}\n </div>\n );\n}\n"]}
|
package/container/styles.css.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"root": "
|
|
5
|
-
"root-fit-height": "awsui_root-fit-
|
|
6
|
-
"variant-default": "awsui_variant-
|
|
7
|
-
"variant-stacked": "awsui_variant-
|
|
8
|
-
"header": "
|
|
9
|
-
"header-sticky-disabled": "awsui_header-sticky-
|
|
10
|
-
"header-sticky-enabled": "awsui_header-sticky-
|
|
11
|
-
"header-stuck": "awsui_header-
|
|
12
|
-
"header-dynamic-height": "awsui_header-dynamic-
|
|
13
|
-
"with-paddings": "awsui_with-
|
|
14
|
-
"with-hidden-content": "awsui_with-hidden-
|
|
15
|
-
"header-variant-cards": "awsui_header-variant-
|
|
16
|
-
"header-variant-full-page": "awsui_header-variant-full-
|
|
17
|
-
"dark-header": "awsui_dark-
|
|
18
|
-
"content": "
|
|
19
|
-
"footer": "
|
|
20
|
-
"with-divider": "awsui_with-
|
|
4
|
+
"root": "awsui_root_14iqq_wbmbk_97",
|
|
5
|
+
"root-fit-height": "awsui_root-fit-height_14iqq_wbmbk_108",
|
|
6
|
+
"variant-default": "awsui_variant-default_14iqq_wbmbk_114",
|
|
7
|
+
"variant-stacked": "awsui_variant-stacked_14iqq_wbmbk_114",
|
|
8
|
+
"header": "awsui_header_14iqq_wbmbk_137",
|
|
9
|
+
"header-sticky-disabled": "awsui_header-sticky-disabled_14iqq_wbmbk_142",
|
|
10
|
+
"header-sticky-enabled": "awsui_header-sticky-enabled_14iqq_wbmbk_146",
|
|
11
|
+
"header-stuck": "awsui_header-stuck_14iqq_wbmbk_152",
|
|
12
|
+
"header-dynamic-height": "awsui_header-dynamic-height_14iqq_wbmbk_157",
|
|
13
|
+
"with-paddings": "awsui_with-paddings_14iqq_wbmbk_163",
|
|
14
|
+
"with-hidden-content": "awsui_with-hidden-content_14iqq_wbmbk_166",
|
|
15
|
+
"header-variant-cards": "awsui_header-variant-cards_14iqq_wbmbk_170",
|
|
16
|
+
"header-variant-full-page": "awsui_header-variant-full-page_14iqq_wbmbk_194",
|
|
17
|
+
"dark-header": "awsui_dark-header_14iqq_wbmbk_212",
|
|
18
|
+
"content": "awsui_content_14iqq_wbmbk_216",
|
|
19
|
+
"footer": "awsui_footer_14iqq_wbmbk_227",
|
|
20
|
+
"with-divider": "awsui_with-divider_14iqq_wbmbk_230"
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -94,7 +94,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
94
94
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
95
95
|
SPDX-License-Identifier: Apache-2.0
|
|
96
96
|
*/
|
|
97
|
-
.
|
|
97
|
+
.awsui_root_14iqq_wbmbk_97:not(#\9) {
|
|
98
98
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
99
99
|
border-collapse: separate;
|
|
100
100
|
border-spacing: 0;
|
|
@@ -129,16 +129,15 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
129
129
|
color: var(--color-text-body-default-ajf1h5, #000716);
|
|
130
130
|
font-weight: 400;
|
|
131
131
|
font-family: var(--font-family-base-qnistn, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
132
|
-
display: flex;
|
|
133
|
-
flex-flow: column nowrap;
|
|
134
132
|
word-wrap: break-word;
|
|
135
133
|
}
|
|
136
|
-
.awsui_root-fit-
|
|
137
|
-
|
|
134
|
+
.awsui_root-fit-height_14iqq_wbmbk_108:not(#\9) {
|
|
135
|
+
display: flex;
|
|
136
|
+
flex-direction: column;
|
|
138
137
|
overflow: hidden;
|
|
139
138
|
height: 100%;
|
|
140
139
|
}
|
|
141
|
-
.
|
|
140
|
+
.awsui_root_14iqq_wbmbk_97.awsui_variant-default_14iqq_wbmbk_114:not(#\9), .awsui_root_14iqq_wbmbk_97.awsui_variant-stacked_14iqq_wbmbk_114:not(#\9) {
|
|
142
141
|
box-shadow: var(--shadow-container-7nblnj, 0px 0px 1px 1px #e9ebed, 0px 1px 8px 2px rgba(0, 7, 22, 0.12));
|
|
143
142
|
border-top: var(--border-container-top-width-jk6fhm, 0px) solid var(--color-border-container-top-srcvx4, transparent);
|
|
144
143
|
border-radius: var(--border-radius-container-gh9ysk, 16px);
|
|
@@ -146,83 +145,82 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
146
145
|
background-color: var(--color-background-container-content-i8i4a0, #ffffff);
|
|
147
146
|
}
|
|
148
147
|
@media screen and (-ms-high-contrast: active) {
|
|
149
|
-
.
|
|
148
|
+
.awsui_root_14iqq_wbmbk_97.awsui_variant-default_14iqq_wbmbk_114:not(#\9), .awsui_root_14iqq_wbmbk_97.awsui_variant-stacked_14iqq_wbmbk_114:not(#\9) {
|
|
150
149
|
border: var(--border-field-width-idlekx, 2px) solid var(--color-border-container-top-srcvx4, transparent);
|
|
151
150
|
}
|
|
152
151
|
}
|
|
153
|
-
.
|
|
152
|
+
.awsui_root_14iqq_wbmbk_97.awsui_variant-stacked_14iqq_wbmbk_114:not(#\9):not(:last-child) {
|
|
154
153
|
border-bottom-right-radius: 0;
|
|
155
154
|
border-bottom-left-radius: 0;
|
|
156
155
|
}
|
|
157
|
-
.
|
|
156
|
+
.awsui_root_14iqq_wbmbk_97.awsui_variant-stacked_14iqq_wbmbk_114 + .awsui_root_14iqq_wbmbk_97.awsui_variant-stacked_14iqq_wbmbk_114:not(#\9) {
|
|
158
157
|
border-top: var(--border-divider-section-width-4wm2it, 2px) solid var(--color-border-divider-default-7s2wjw, #e9ebed);
|
|
159
158
|
border-top-left-radius: 0;
|
|
160
159
|
border-top-right-radius: 0;
|
|
161
160
|
box-shadow: var(--shadow-container-stacked-lumzae, -1px 1px 1px 0px #e9ebed, 1px 1px 1px 0px #e9ebed, 0px 9px 8px -7px rgba(0, 7, 22, 0.12), 8px 0px 8px -7px rgba(0, 7, 22, 0.12), -8px 0px 8px -7px rgba(0, 7, 22, 0.12));
|
|
162
161
|
}
|
|
163
162
|
|
|
164
|
-
.
|
|
165
|
-
flex: 0 0 auto;
|
|
163
|
+
.awsui_header_14iqq_wbmbk_137:not(#\9) {
|
|
166
164
|
background-color: var(--color-background-container-header-4flbq5, #ffffff);
|
|
167
165
|
border-top-left-radius: var(--border-radius-container-gh9ysk, 16px);
|
|
168
166
|
border-top-right-radius: var(--border-radius-container-gh9ysk, 16px);
|
|
169
167
|
}
|
|
170
|
-
.awsui_header-sticky-
|
|
168
|
+
.awsui_header-sticky-disabled_14iqq_wbmbk_142:not(#\9) {
|
|
171
169
|
position: relative;
|
|
172
170
|
z-index: 1;
|
|
173
171
|
}
|
|
174
|
-
.awsui_header-sticky-
|
|
172
|
+
.awsui_header-sticky-enabled_14iqq_wbmbk_146:not(#\9) {
|
|
175
173
|
top: 0;
|
|
176
174
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
177
175
|
position: sticky;
|
|
178
176
|
z-index: 800;
|
|
179
177
|
}
|
|
180
|
-
.awsui_header-
|
|
178
|
+
.awsui_header-stuck_14iqq_wbmbk_152:not(#\9) {
|
|
181
179
|
box-shadow: var(--shadow-sticky-embedded-qit8ba, 0px 2px 0px 0px #e9ebed, 0px 16px 16px -12px rgba(0, 7, 22, 0.1));
|
|
182
180
|
border: 0;
|
|
183
181
|
border-radius: 0;
|
|
184
182
|
}
|
|
185
|
-
.awsui_header-dynamic-
|
|
183
|
+
.awsui_header-dynamic-height_14iqq_wbmbk_157.awsui_header-stuck_14iqq_wbmbk_152:not(#\9) {
|
|
186
184
|
margin-bottom: calc(var(--font-heading-xl-line-height-doxfdj, 40px) - var(--font-heading-l-line-height-gev4n1, 30px));
|
|
187
185
|
}
|
|
188
|
-
.
|
|
186
|
+
.awsui_header_14iqq_wbmbk_137:not(#\9):not(:empty) {
|
|
189
187
|
border-bottom: var(--border-container-sticky-width-i7t7xe, 0px) solid var(--color-border-container-divider-4ade7z, transparent);
|
|
190
188
|
}
|
|
191
|
-
.
|
|
189
|
+
.awsui_header_14iqq_wbmbk_137.awsui_with-paddings_14iqq_wbmbk_163:not(#\9) {
|
|
192
190
|
padding: var(--space-container-header-vertical-zsjhel, 12px) var(--space-container-horizontal-tlw03i, 20px);
|
|
193
191
|
}
|
|
194
|
-
.
|
|
192
|
+
.awsui_header_14iqq_wbmbk_137.awsui_with-hidden-content_14iqq_wbmbk_166:not(#\9) {
|
|
195
193
|
border-bottom-left-radius: var(--border-radius-container-gh9ysk, 16px);
|
|
196
194
|
border-bottom-right-radius: var(--border-radius-container-gh9ysk, 16px);
|
|
197
195
|
}
|
|
198
|
-
.awsui_header-variant-
|
|
196
|
+
.awsui_header-variant-cards_14iqq_wbmbk_170:not(#\9) {
|
|
199
197
|
box-shadow: var(--shadow-container-7nblnj, 0px 0px 1px 1px #e9ebed, 0px 1px 8px 2px rgba(0, 7, 22, 0.12));
|
|
200
198
|
border-top: var(--border-container-top-width-jk6fhm, 0px) solid var(--color-border-container-top-srcvx4, transparent);
|
|
201
199
|
border-radius: var(--border-radius-container-gh9ysk, 16px);
|
|
202
200
|
box-sizing: border-box;
|
|
203
201
|
}
|
|
204
202
|
@media screen and (-ms-high-contrast: active) {
|
|
205
|
-
.awsui_header-variant-
|
|
203
|
+
.awsui_header-variant-cards_14iqq_wbmbk_170:not(#\9) {
|
|
206
204
|
border: var(--border-field-width-idlekx, 2px) solid var(--color-border-container-top-srcvx4, transparent);
|
|
207
205
|
}
|
|
208
206
|
}
|
|
209
|
-
.awsui_header-variant-
|
|
207
|
+
.awsui_header-variant-cards_14iqq_wbmbk_170:not(#\9):not(:empty) {
|
|
210
208
|
border-bottom: 1px solid #d5dbdb;
|
|
211
209
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
212
210
|
}
|
|
213
211
|
@supports (--css-variable-support-check: #000) {
|
|
214
|
-
.awsui_header-variant-
|
|
212
|
+
.awsui_header-variant-cards_14iqq_wbmbk_170:not(#\9):not(:empty) {
|
|
215
213
|
border-bottom: 0;
|
|
216
214
|
}
|
|
217
215
|
}
|
|
218
|
-
.awsui_header-variant-
|
|
216
|
+
.awsui_header-variant-cards_14iqq_wbmbk_170.awsui_header-stuck_14iqq_wbmbk_152:not(#\9) {
|
|
219
217
|
border-top-left-radius: 0;
|
|
220
218
|
border-top-right-radius: 0;
|
|
221
219
|
}
|
|
222
|
-
.awsui_header-variant-full-
|
|
220
|
+
.awsui_header-variant-full-page_14iqq_wbmbk_194.awsui_header-stuck_14iqq_wbmbk_152:not(#\9) {
|
|
223
221
|
box-shadow: none;
|
|
224
222
|
}
|
|
225
|
-
.awsui_header-variant-full-
|
|
223
|
+
.awsui_header-variant-full-page_14iqq_wbmbk_194.awsui_header-stuck_14iqq_wbmbk_152:not(#\9)::after {
|
|
226
224
|
content: "";
|
|
227
225
|
position: absolute;
|
|
228
226
|
right: 0;
|
|
@@ -237,30 +235,24 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
237
235
|
The dynamic height dark header needs a background that will cover
|
|
238
236
|
the default white background of the container component.
|
|
239
237
|
*/
|
|
240
|
-
.awsui_dark-
|
|
238
|
+
.awsui_dark-header_14iqq_wbmbk_212:not(#\9) {
|
|
241
239
|
background-color: var(--color-background-layout-main-sfhm4y, #ffffff);
|
|
242
240
|
}
|
|
243
241
|
|
|
244
|
-
.
|
|
245
|
-
flex: 1 0 auto;
|
|
246
|
-
}
|
|
247
|
-
.awsui_root-fit-height_14iqq_kxdhx_110 > .awsui_content_14iqq_kxdhx_218:not(#\9) {
|
|
242
|
+
.awsui_root-fit-height_14iqq_wbmbk_108 > .awsui_content_14iqq_wbmbk_216:not(#\9) {
|
|
248
243
|
flex: 1;
|
|
249
244
|
overflow: auto;
|
|
250
245
|
}
|
|
251
|
-
.
|
|
246
|
+
.awsui_content_14iqq_wbmbk_216.awsui_with-paddings_14iqq_wbmbk_163:not(#\9) {
|
|
252
247
|
padding: var(--space-scaled-l-t03y3z, 20px) var(--space-container-horizontal-tlw03i, 20px);
|
|
253
248
|
}
|
|
254
|
-
.
|
|
249
|
+
.awsui_header_14iqq_wbmbk_137 + .awsui_content_14iqq_wbmbk_216.awsui_with-paddings_14iqq_wbmbk_163:not(#\9) {
|
|
255
250
|
padding-top: var(--space-container-content-top-fsd8nr, 0px);
|
|
256
251
|
}
|
|
257
252
|
|
|
258
|
-
.
|
|
259
|
-
flex: 0 0 auto;
|
|
260
|
-
}
|
|
261
|
-
.awsui_footer_14iqq_kxdhx_232.awsui_with-paddings_14iqq_kxdhx_165:not(#\9) {
|
|
253
|
+
.awsui_footer_14iqq_wbmbk_227.awsui_with-paddings_14iqq_wbmbk_163:not(#\9) {
|
|
262
254
|
padding: var(--space-scaled-s-cu1hzn, 12px) var(--space-container-horizontal-tlw03i, 20px);
|
|
263
255
|
}
|
|
264
|
-
.
|
|
256
|
+
.awsui_footer_14iqq_wbmbk_227.awsui_with-divider_14iqq_wbmbk_230:not(#\9) {
|
|
265
257
|
border-top: var(--border-divider-section-width-4wm2it, 2px) solid var(--color-border-divider-default-7s2wjw, #e9ebed);
|
|
266
258
|
}
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"root": "
|
|
6
|
-
"root-fit-height": "awsui_root-fit-
|
|
7
|
-
"variant-default": "awsui_variant-
|
|
8
|
-
"variant-stacked": "awsui_variant-
|
|
9
|
-
"header": "
|
|
10
|
-
"header-sticky-disabled": "awsui_header-sticky-
|
|
11
|
-
"header-sticky-enabled": "awsui_header-sticky-
|
|
12
|
-
"header-stuck": "awsui_header-
|
|
13
|
-
"header-dynamic-height": "awsui_header-dynamic-
|
|
14
|
-
"with-paddings": "awsui_with-
|
|
15
|
-
"with-hidden-content": "awsui_with-hidden-
|
|
16
|
-
"header-variant-cards": "awsui_header-variant-
|
|
17
|
-
"header-variant-full-page": "awsui_header-variant-full-
|
|
18
|
-
"dark-header": "awsui_dark-
|
|
19
|
-
"content": "
|
|
20
|
-
"footer": "
|
|
21
|
-
"with-divider": "awsui_with-
|
|
5
|
+
"root": "awsui_root_14iqq_wbmbk_97",
|
|
6
|
+
"root-fit-height": "awsui_root-fit-height_14iqq_wbmbk_108",
|
|
7
|
+
"variant-default": "awsui_variant-default_14iqq_wbmbk_114",
|
|
8
|
+
"variant-stacked": "awsui_variant-stacked_14iqq_wbmbk_114",
|
|
9
|
+
"header": "awsui_header_14iqq_wbmbk_137",
|
|
10
|
+
"header-sticky-disabled": "awsui_header-sticky-disabled_14iqq_wbmbk_142",
|
|
11
|
+
"header-sticky-enabled": "awsui_header-sticky-enabled_14iqq_wbmbk_146",
|
|
12
|
+
"header-stuck": "awsui_header-stuck_14iqq_wbmbk_152",
|
|
13
|
+
"header-dynamic-height": "awsui_header-dynamic-height_14iqq_wbmbk_157",
|
|
14
|
+
"with-paddings": "awsui_with-paddings_14iqq_wbmbk_163",
|
|
15
|
+
"with-hidden-content": "awsui_with-hidden-content_14iqq_wbmbk_166",
|
|
16
|
+
"header-variant-cards": "awsui_header-variant-cards_14iqq_wbmbk_170",
|
|
17
|
+
"header-variant-full-page": "awsui_header-variant-full-page_14iqq_wbmbk_194",
|
|
18
|
+
"dark-header": "awsui_dark-header_14iqq_wbmbk_212",
|
|
19
|
+
"content": "awsui_content_14iqq_wbmbk_216",
|
|
20
|
+
"footer": "awsui_footer_14iqq_wbmbk_227",
|
|
21
|
+
"with-divider": "awsui_with-divider_14iqq_wbmbk_230"
|
|
22
22
|
};
|
|
23
23
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/content-layout/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/content-layout/index.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AASlD,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAE9B,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,kBAAkB,eAkDtG"}
|
package/content-layout/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { __assign, __rest } from "tslib";
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
import React, {
|
|
4
|
+
import React, { useRef } from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
-
import { AppLayoutContext } from '../app-layout/visual-refresh/context';
|
|
7
6
|
import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
8
7
|
import { getBaseProps } from '../internal/base-component';
|
|
8
|
+
import { useAppLayoutContext } from '../internal/context/app-layout-context';
|
|
9
9
|
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
10
|
-
import { useDynamicOverlap } from '../
|
|
10
|
+
import { useDynamicOverlap } from '../internal/hooks/use-dynamic-overlap';
|
|
11
11
|
import { useMergeRefs } from '../internal/hooks/use-merge-refs';
|
|
12
12
|
import { useVisualRefresh } from '../internal/hooks/use-visual-mode';
|
|
13
13
|
import styles from './styles.css.js';
|
|
@@ -15,7 +15,7 @@ export default function ContentLayout(_a) {
|
|
|
15
15
|
var _b, _c, _d;
|
|
16
16
|
var children = _a.children, disableOverlap = _a.disableOverlap, header = _a.header, rest = __rest(_a, ["children", "disableOverlap", "header"]);
|
|
17
17
|
var baseProps = getBaseProps(rest);
|
|
18
|
-
var
|
|
18
|
+
var hasBreadcrumbs = useAppLayoutContext().hasBreadcrumbs;
|
|
19
19
|
var rootElement = useRef(null);
|
|
20
20
|
var __internalRootRef = useBaseComponent('ContentLayout').__internalRootRef;
|
|
21
21
|
var mergedRef = useMergeRefs(rootElement, __internalRootRef);
|
|
@@ -32,7 +32,7 @@ export default function ContentLayout(_a) {
|
|
|
32
32
|
_b[styles['is-visual-refresh']] = isVisualRefresh,
|
|
33
33
|
_b)), ref: mergedRef }),
|
|
34
34
|
React.createElement("div", { className: clsx(styles.background, (_c = {}, _c[styles['is-overlap-disabled']] = isOverlapDisabled, _c), 'awsui-context-content-header'), ref: overlapElement }),
|
|
35
|
-
header && (React.createElement("div", { className: clsx(styles.header, (_d = {}, _d[styles['has-breadcrumbs']] =
|
|
35
|
+
header && (React.createElement("div", { className: clsx(styles.header, (_d = {}, _d[styles['has-breadcrumbs']] = isVisualRefresh && hasBreadcrumbs, _d), 'awsui-context-content-header') }, header)),
|
|
36
36
|
React.createElement("div", { className: styles.content }, children)));
|
|
37
37
|
}
|
|
38
38
|
applyDisplayName(ContentLayout, 'ContentLayout');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content-layout/index.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;OAIG;IACH,IAAM,iBAAiB,GAAG,CAAC,QAAQ,IAAI,CAAC,MAAM,IAAI,cAAc,CAAC;IAEjE,OAAO,CACL,wCACM,SAAS,IACb,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM;YAChD,GAAC,MAAM,CAAC,qBAAqB,CAAC,IAAG,iBAAiB;YAClD,GAAC,MAAM,CAAC,mBAAmB,CAAC,IAAG,eAAe;gBAC9C,EACF,GAAG,EAAE,SAAS;QAEd,6BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,UAAU,YACf,GAAC,MAAM,CAAC,qBAAqB,CAAC,IAAG,iBAAiB,OACpD,8BAA8B,CAC/B,EACD,GAAG,EAAE,cAAc,GACnB;QAED,MAAM,IAAI,CACT,6BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,MAAM,YACX,GAAC,MAAM,CAAC,iBAAiB,CAAC,IAAG,eAAe,IAAI,cAAc,OAChE,8BAA8B,CAC/B,IAEA,MAAM,CACH,CACP;QAED,6BAAK,SAAS,EAAE,MAAM,CAAC,OAAO,IAAG,QAAQ,CAAO,CAC5C,CACP,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,aAAa,EAAE,eAAe,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';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { ContentLayoutProps } from './interfaces';\nimport { getBaseProps } from '../internal/base-component';\nimport { useAppLayoutContext } from '../internal/context/app-layout-context';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useDynamicOverlap } from '../internal/hooks/use-dynamic-overlap';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport styles from './styles.css.js';\n\nexport { ContentLayoutProps };\n\nexport default function ContentLayout({ children, disableOverlap, header, ...rest }: ContentLayoutProps) {\n const baseProps = getBaseProps(rest);\n const { hasBreadcrumbs } = useAppLayoutContext();\n\n const rootElement = useRef<HTMLDivElement>(null);\n const { __internalRootRef } = useBaseComponent('ContentLayout');\n const mergedRef = useMergeRefs(rootElement, __internalRootRef);\n const overlapElement = useDynamicOverlap();\n const isVisualRefresh = useVisualRefresh();\n\n /**\n * Disable the overlap if the component is missing either a header or child\n * content. If the component is not using visual refresh then the overlap\n * will not be displayed at all. This is handled in the CSS not the JavaScript.\n */\n const isOverlapDisabled = !children || !header || disableOverlap;\n\n return (\n <div\n {...baseProps}\n className={clsx(baseProps.className, styles.layout, {\n [styles['is-overlap-disabled']]: isOverlapDisabled,\n [styles['is-visual-refresh']]: isVisualRefresh,\n })}\n ref={mergedRef}\n >\n <div\n className={clsx(\n styles.background,\n { [styles['is-overlap-disabled']]: isOverlapDisabled },\n 'awsui-context-content-header'\n )}\n ref={overlapElement}\n />\n\n {header && (\n <div\n className={clsx(\n styles.header,\n { [styles['has-breadcrumbs']]: isVisualRefresh && hasBreadcrumbs },\n 'awsui-context-content-header'\n )}\n >\n {header}\n </div>\n )}\n\n <div className={styles.content}>{children}</div>\n </div>\n );\n}\n\napplyDisplayName(ContentLayout, 'ContentLayout');\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export interface AppLayoutContextProps {
|
|
2
2
|
stickyOffsetBottom: number;
|
|
3
3
|
stickyOffsetTop: number;
|
|
4
|
+
hasBreadcrumbs: boolean;
|
|
5
|
+
setHasStickyBackground?: (hasBackground: boolean) => void;
|
|
6
|
+
setDynamicOverlapHeight?: (height: number) => void;
|
|
4
7
|
}
|
|
5
8
|
export declare const AppLayoutContext: import("react").Context<AppLayoutContextProps>;
|
|
6
|
-
export declare function useAppLayoutContext():
|
|
7
|
-
stickyOffsetBottom: number;
|
|
8
|
-
stickyOffsetTop: number;
|
|
9
|
-
};
|
|
9
|
+
export declare function useAppLayoutContext(): AppLayoutContextProps;
|
|
10
10
|
//# sourceMappingURL=app-layout-context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-layout-context.d.ts","sourceRoot":"","sources":["../../../../src/internal/context/app-layout-context.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,qBAAqB;IACpC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"app-layout-context.d.ts","sourceRoot":"","sources":["../../../../src/internal/context/app-layout-context.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,qBAAqB;IACpC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,sBAAsB,CAAC,EAAE,CAAC,aAAa,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1D,uBAAuB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD;AAED,eAAO,MAAM,gBAAgB,gDAI3B,CAAC;AAEH,wBAAgB,mBAAmB,0BAElC"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
2
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
3
|
import { useContext, createContext } from 'react';
|
|
5
4
|
export var AppLayoutContext = createContext({
|
|
6
5
|
stickyOffsetTop: 0,
|
|
7
|
-
stickyOffsetBottom: 0
|
|
6
|
+
stickyOffsetBottom: 0,
|
|
7
|
+
hasBreadcrumbs: false
|
|
8
8
|
});
|
|
9
9
|
export function useAppLayoutContext() {
|
|
10
|
-
|
|
11
|
-
return __assign({}, context);
|
|
10
|
+
return useContext(AppLayoutContext);
|
|
12
11
|
}
|
|
13
12
|
//# sourceMappingURL=app-layout-context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-layout-context.js","sourceRoot":"","sources":["../../../../src/internal/context/app-layout-context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-layout-context.js","sourceRoot":"","sources":["../../../../src/internal/context/app-layout-context.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAUlD,MAAM,CAAC,IAAM,gBAAgB,GAAG,aAAa,CAAwB;IACnE,eAAe,EAAE,CAAC;IAClB,kBAAkB,EAAE,CAAC;IACrB,cAAc,EAAE,KAAK;CACtB,CAAC,CAAC;AAEH,MAAM,UAAU,mBAAmB;IACjC,OAAO,UAAU,CAAC,gBAAgB,CAAC,CAAC;AACtC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useContext, createContext } from 'react';\n\nexport interface AppLayoutContextProps {\n stickyOffsetBottom: number;\n stickyOffsetTop: number;\n hasBreadcrumbs: boolean;\n setHasStickyBackground?: (hasBackground: boolean) => void;\n setDynamicOverlapHeight?: (height: number) => void;\n}\n\nexport const AppLayoutContext = createContext<AppLayoutContextProps>({\n stickyOffsetTop: 0,\n stickyOffsetBottom: 0,\n hasBreadcrumbs: false,\n});\n\nexport function useAppLayoutContext() {\n return useContext(AppLayoutContext);\n}\n"]}
|
package/internal/environment.js
CHANGED
|
@@ -11,4 +11,4 @@ export interface UseDynamicOverlapProps {
|
|
|
11
11
|
* @returns ref to be measured as overlapping height
|
|
12
12
|
*/
|
|
13
13
|
export declare function useDynamicOverlap(props?: UseDynamicOverlapProps): import("react").Ref<any>;
|
|
14
|
-
//# sourceMappingURL=
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-dynamic-overlap/index.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,EAAE,sBAAsB,4BAqB/D"}
|