@cloudscape-design/components 3.0.1068 → 3.0.1069
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/visual-refresh-toolbar/skeleton/multi-layout.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/skeleton/multi-layout.js +19 -1
- package/app-layout/visual-refresh-toolbar/skeleton/multi-layout.js.map +1 -1
- package/flashbar/collapsible-flashbar.d.ts.map +1 -1
- package/flashbar/collapsible-flashbar.js +5 -3
- package/flashbar/collapsible-flashbar.js.map +1 -1
- package/flashbar/common.d.ts.map +1 -1
- package/flashbar/common.js +5 -2
- package/flashbar/common.js.map +1 -1
- package/flashbar/flash.d.ts +1 -1
- package/flashbar/flash.d.ts.map +1 -1
- package/flashbar/flash.js +2 -4
- package/flashbar/flash.js.map +1 -1
- package/flashbar/utils.d.ts +1 -1
- package/flashbar/utils.d.ts.map +1 -1
- package/flashbar/utils.js +1 -1
- package/flashbar/utils.js.map +1 -1
- package/internal/base-component/styles.scoped.css +1 -1
- package/internal/environment.js +2 -2
- package/internal/environment.json +2 -2
- package/internal/manifest.json +1 -1
- package/package.json +1 -1
- package/split-panel/bottom.d.ts +4 -1
- package/split-panel/bottom.d.ts.map +1 -1
- package/split-panel/bottom.js +4 -3
- package/split-panel/bottom.js.map +1 -1
- package/split-panel/implementation.d.ts +5 -0
- package/split-panel/implementation.d.ts.map +1 -1
- package/split-panel/implementation.js +30 -11
- package/split-panel/implementation.js.map +1 -1
- package/split-panel/index.d.ts.map +1 -1
- package/split-panel/index.js +6 -0
- package/split-panel/index.js.map +1 -1
- package/split-panel/interfaces.d.ts +24 -3
- package/split-panel/interfaces.d.ts.map +1 -1
- package/split-panel/interfaces.js.map +1 -1
- package/split-panel/side.d.ts +1 -0
- package/split-panel/side.d.ts.map +1 -1
- package/split-panel/side.js +2 -2
- package/split-panel/side.js.map +1 -1
- package/split-panel/styles.css.js +38 -27
- package/split-panel/styles.scoped.css +93 -56
- package/split-panel/styles.selectors.js +38 -27
- package/split-panel/test-classes/styles.css.js +12 -8
- package/split-panel/test-classes/styles.scoped.css +12 -8
- package/split-panel/test-classes/styles.selectors.js +12 -8
- package/test-utils/dom/split-panel/index.d.ts +4 -0
- package/test-utils/dom/split-panel/index.js +12 -0
- package/test-utils/dom/split-panel/index.js.map +1 -1
- package/test-utils/selectors/split-panel/index.d.ts +4 -0
- package/test-utils/selectors/split-panel/index.js +12 -0
- package/test-utils/selectors/split-panel/index.js.map +1 -1
package/internal/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"./internal/base-component/index.js",
|
|
151
151
|
"./internal/base-component/styles.css.js"
|
|
152
152
|
],
|
|
153
|
-
"version": "3.0.
|
|
153
|
+
"version": "3.0.1069",
|
|
154
154
|
"repository": {
|
|
155
155
|
"type": "git",
|
|
156
156
|
"url": "https://github.com/cloudscape-design/components.git"
|
package/split-panel/bottom.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { SplitPanelContentProps, SplitPanelProps } from './interfaces';
|
|
|
3
3
|
interface SplitPanelContentBottomProps extends SplitPanelContentProps {
|
|
4
4
|
appLayoutMaxWidth: React.CSSProperties | undefined;
|
|
5
5
|
closeBehavior: SplitPanelProps['closeBehavior'];
|
|
6
|
+
hasCustomElements?: boolean;
|
|
6
7
|
}
|
|
7
8
|
export declare function SplitPanelContentBottom({
|
|
8
9
|
closeBehavior,
|
|
@@ -15,6 +16,8 @@ export declare function SplitPanelContentBottom({
|
|
|
15
16
|
children,
|
|
16
17
|
appLayoutMaxWidth,
|
|
17
18
|
panelHeaderId,
|
|
18
|
-
|
|
19
|
+
ariaLabel,
|
|
20
|
+
onToggle,
|
|
21
|
+
hasCustomElements
|
|
19
22
|
}: SplitPanelContentBottomProps): JSX.Element;
|
|
20
23
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bottom.d.ts","sourceRoot":"","sources":["../../../src/split-panel/bottom.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAUjD,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAMvE,UAAU,4BAA6B,SAAQ,sBAAsB;IACnE,iBAAiB,EAAE,KAAK,CAAC,aAAa,GAAG,SAAS,CAAC;IACnD,aAAa,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"bottom.d.ts","sourceRoot":"","sources":["../../../src/split-panel/bottom.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAUjD,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAMvE,UAAU,4BAA6B,SAAQ,sBAAsB;IACnE,iBAAiB,EAAE,KAAK,CAAC,aAAa,GAAG,SAAS,CAAC;IACnD,aAAa,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;IAChD,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAgB,uBAAuB,CAAC,EACtC,aAAa,EACb,SAAS,EACT,MAAM,EACN,aAAa,EACb,UAAU,EACV,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,QAAQ,EACR,iBAAiB,GAClB,EAAE,4BAA4B,eAqF9B"}
|
package/split-panel/bottom.js
CHANGED
|
@@ -11,7 +11,7 @@ import { useVisualRefresh } from '../internal/hooks/use-visual-mode';
|
|
|
11
11
|
import sharedStyles from '../app-layout/resize/styles.css.js';
|
|
12
12
|
import styles from './styles.css.js';
|
|
13
13
|
import testUtilStyles from './test-classes/styles.css.js';
|
|
14
|
-
export function SplitPanelContentBottom({ closeBehavior, baseProps, isOpen, splitPanelRef, cappedSize, header, resizeHandle, children, appLayoutMaxWidth, panelHeaderId, onToggle, }) {
|
|
14
|
+
export function SplitPanelContentBottom({ closeBehavior, baseProps, isOpen, splitPanelRef, cappedSize, header, resizeHandle, children, appLayoutMaxWidth, panelHeaderId, ariaLabel, onToggle, hasCustomElements, }) {
|
|
15
15
|
const isRefresh = useVisualRefresh();
|
|
16
16
|
const isToolbar = useAppLayoutToolbarDesignEnabled();
|
|
17
17
|
const { bottomOffset, leftOffset, rightOffset, disableContentPaddings, contentWrapperPaddings, reportHeaderHeight, headerHeight: headerBlockSize, animationDisabled, } = useSplitPanelContext();
|
|
@@ -35,12 +35,13 @@ export function SplitPanelContentBottom({ closeBehavior, baseProps, isOpen, spli
|
|
|
35
35
|
[sharedStyles['with-motion-vertical']]: !animationDisabled,
|
|
36
36
|
[testUtilStyles['open-position-bottom']]: isOpen,
|
|
37
37
|
[styles['drawer-closed']]: !isOpen,
|
|
38
|
+
[styles['drawer-clickable']]: !hasCustomElements,
|
|
38
39
|
[styles['drawer-mobile']]: isMobile,
|
|
39
40
|
[styles['drawer-disable-content-paddings']]: disableContentPaddings,
|
|
40
41
|
[styles.refresh]: isRefresh,
|
|
41
42
|
[styles['with-toolbar']]: isToolbar,
|
|
42
43
|
[styles.hidden]: closeBehavior === 'hide' && !isOpen,
|
|
43
|
-
}), onClick: () => !isOpen && onToggle(), style: {
|
|
44
|
+
}), onClick: () => !isOpen && !hasCustomElements && onToggle(), style: {
|
|
44
45
|
insetBlockEnd: bottomOffset,
|
|
45
46
|
insetInlineStart: leftOffset,
|
|
46
47
|
insetInlineEnd: rightOffset,
|
|
@@ -53,7 +54,7 @@ export function SplitPanelContentBottom({ closeBehavior, baseProps, isOpen, spli
|
|
|
53
54
|
: undefined,
|
|
54
55
|
}, ref: splitPanelRef }), closeBehavior === 'hide' && !isOpen ? null : (React.createElement(React.Fragment, null,
|
|
55
56
|
isOpen && React.createElement("div", { className: styles['slider-wrapper-bottom'] }, resizeHandle),
|
|
56
|
-
React.createElement("div", { className: styles['drawer-content-bottom'], "aria-labelledby": panelHeaderId, role: "region" },
|
|
57
|
+
React.createElement("div", { className: styles['drawer-content-bottom'], "aria-labelledby": panelHeaderId, "aria-label": ariaLabel, role: "region" },
|
|
57
58
|
React.createElement("div", { className: clsx(styles['pane-header-wrapper-bottom'], centeredMaxWidthClasses), ref: headerRef }, header),
|
|
58
59
|
React.createElement("div", { className: clsx(styles['content-bottom'], centeredMaxWidthClasses), "aria-hidden": !isOpen },
|
|
59
60
|
React.createElement("div", { className: clsx({ [styles['content-bottom-max-width']]: isRefresh }), style: appLayoutMaxWidth }, children)))))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bottom.js","sourceRoot":"","sources":["../../../src/split-panel/bottom.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,OAAO,EAAE,gCAAgC,EAAE,MAAM,mCAAmC,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,KAAK,MAAM,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGrE,OAAO,YAAY,MAAM,oCAAoC,CAAC;AAC9D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"bottom.js","sourceRoot":"","sources":["../../../src/split-panel/bottom.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,OAAO,EAAE,g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,YAAY;YAC3B,gBAAgB,EAAE,UAAU;YAC5B,cAAc,EAAE,WAAW;YAC3B,SAAS,EAAE,MAAM;gBACf,CAAC,CAAC,UAAU;gBACZ,CAAC,CAAC,aAAa,KAAK,MAAM;oBACxB,CAAC,CAAC,CAAC;oBACH,CAAC,CAAC,SAAS,IAAI,eAAe,KAAK,SAAS;wBAC1C,CAAC,CAAC,QAAQ,eAAe,QAAQ,MAAM,CAAC,mBAAmB,GAAG;wBAC9D,CAAC,CAAC,SAAS;SAClB,EACD,GAAG,EAAE,aAAa,KAEjB,aAAa,KAAK,MAAM,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAC5C;QACG,MAAM,IAAI,6BAAK,SAAS,EAAE,MAAM,CAAC,uBAAuB,CAAC,IAAG,YAAY,CAAO;QAChF,6BACE,SAAS,EAAE,MAAM,CAAC,uBAAuB,CAAC,qBACzB,aAAa,gBAClB,SAAS,EACrB,IAAI,EAAC,QAAQ;YAEb,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,4BAA4B,CAAC,EAAE,uBAAuB,CAAC,EAAE,GAAG,EAAE,SAAS,IAChG,MAAM,CACH;YACN,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,uBAAuB,CAAC,iBAAe,CAAC,MAAM;gBAC3F,6BAAK,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,iBAAiB,IAChG,QAAQ,CACL,CACF,CACF,CACL,CACJ,CACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useAppLayoutToolbarDesignEnabled } from '../app-layout/utils/feature-flags';\nimport { useSplitPanelContext } from '../internal/context/split-panel-context';\nimport * as tokens from '../internal/generated/styles/tokens';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { SplitPanelContentProps, SplitPanelProps } from './interfaces';\n\nimport sharedStyles from '../app-layout/resize/styles.css.js';\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\ninterface SplitPanelContentBottomProps extends SplitPanelContentProps {\n appLayoutMaxWidth: React.CSSProperties | undefined;\n closeBehavior: SplitPanelProps['closeBehavior'];\n hasCustomElements?: boolean;\n}\n\nexport function SplitPanelContentBottom({\n closeBehavior,\n baseProps,\n isOpen,\n splitPanelRef,\n cappedSize,\n header,\n resizeHandle,\n children,\n appLayoutMaxWidth,\n panelHeaderId,\n ariaLabel,\n onToggle,\n hasCustomElements,\n}: SplitPanelContentBottomProps) {\n const isRefresh = useVisualRefresh();\n const isToolbar = useAppLayoutToolbarDesignEnabled();\n const {\n bottomOffset,\n leftOffset,\n rightOffset,\n disableContentPaddings,\n contentWrapperPaddings,\n reportHeaderHeight,\n headerHeight: headerBlockSize,\n animationDisabled,\n } = useSplitPanelContext();\n const isMobile = useMobile();\n\n const headerRef = useRef<HTMLDivElement>(null);\n\n useResizeObserver(headerRef, entry => {\n const visibleHeaderSize = closeBehavior === 'hide' && !isOpen ? 0 : entry.borderBoxHeight;\n reportHeaderHeight(visibleHeaderSize);\n });\n\n useEffect(() => {\n // report empty height when unmounting the panel\n return () => reportHeaderHeight(0);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const centeredMaxWidthClasses = clsx({\n [styles['pane-bottom-center-align']]: isRefresh,\n [styles['pane-bottom-content-nav-padding']]: contentWrapperPaddings?.closedNav,\n [styles['pane-bottom-content-tools-padding']]: contentWrapperPaddings?.closedTools,\n });\n\n return (\n <div\n {...baseProps}\n className={clsx(baseProps.className, styles.drawer, styles['position-bottom'], testUtilStyles.root, {\n [sharedStyles['with-motion-vertical']]: !animationDisabled,\n [testUtilStyles['open-position-bottom']]: isOpen,\n [styles['drawer-closed']]: !isOpen,\n [styles['drawer-clickable']]: !hasCustomElements,\n [styles['drawer-mobile']]: isMobile,\n [styles['drawer-disable-content-paddings']]: disableContentPaddings,\n [styles.refresh]: isRefresh,\n [styles['with-toolbar']]: isToolbar,\n [styles.hidden]: closeBehavior === 'hide' && !isOpen,\n })}\n onClick={() => !isOpen && !hasCustomElements && onToggle()}\n style={{\n insetBlockEnd: bottomOffset,\n insetInlineStart: leftOffset,\n insetInlineEnd: rightOffset,\n blockSize: isOpen\n ? cappedSize\n : closeBehavior === 'hide'\n ? 0\n : isToolbar && headerBlockSize !== undefined\n ? `calc(${headerBlockSize}px + ${tokens.borderPanelTopWidth})`\n : undefined,\n }}\n ref={splitPanelRef}\n >\n {closeBehavior === 'hide' && !isOpen ? null : (\n <>\n {isOpen && <div className={styles['slider-wrapper-bottom']}>{resizeHandle}</div>}\n <div\n className={styles['drawer-content-bottom']}\n aria-labelledby={panelHeaderId}\n aria-label={ariaLabel}\n role=\"region\"\n >\n <div className={clsx(styles['pane-header-wrapper-bottom'], centeredMaxWidthClasses)} ref={headerRef}>\n {header}\n </div>\n <div className={clsx(styles['content-bottom'], centeredMaxWidthClasses)} aria-hidden={!isOpen}>\n <div className={clsx({ [styles['content-bottom-max-width']]: isRefresh })} style={appLayoutMaxWidth}>\n {children}\n </div>\n </div>\n </div>\n </>\n )}\n </div>\n );\n}\n"]}
|
|
@@ -10,6 +10,11 @@ export declare function SplitPanelImplementation({
|
|
|
10
10
|
hidePreferencesButton,
|
|
11
11
|
closeBehavior,
|
|
12
12
|
i18nStrings,
|
|
13
|
+
ariaLabel,
|
|
14
|
+
headerActions,
|
|
15
|
+
headerBefore,
|
|
16
|
+
headerDescription,
|
|
17
|
+
headerInfo,
|
|
13
18
|
...restProps
|
|
14
19
|
}: SplitPanelImplementationProps): JSX.Element;
|
|
15
20
|
export declare const createWidgetizedSplitPanel: (Loader?: typeof SplitPanelImplementation | undefined) => typeof SplitPanelImplementation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../../../src/split-panel/implementation.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAO/C,MAAM,MAAM,6BAA6B,GAAG,YAAY,CAAC,eAAe,EAAE,uBAAuB,GAAG,eAAe,CAAC,GAClH,0BAA0B,CAAC;AAE7B,wBAAgB,wBAAwB,CAAC,EACvC,iBAAiB,EACjB,MAAM,EACN,QAAQ,EACR,qBAAqB,EACrB,aAAa,EACb,WAAgB,EAChB,GAAG,SAAS,EACb,EAAE,6BAA6B,
|
|
1
|
+
{"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../../../src/split-panel/implementation.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAO/C,MAAM,MAAM,6BAA6B,GAAG,YAAY,CAAC,eAAe,EAAE,uBAAuB,GAAG,eAAe,CAAC,GAClH,0BAA0B,CAAC;AAE7B,wBAAgB,wBAAwB,CAAC,EACvC,iBAAiB,EACjB,MAAM,EACN,QAAQ,EACR,qBAAqB,EACrB,aAAa,EACb,WAAgB,EAChB,SAAS,EACT,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,GAAG,SAAS,EACb,EAAE,6BAA6B,eA4Q/B;AAED,eAAO,MAAM,0BAA0B,2FAAsD,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { __rest } from "tslib";
|
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
-
import { useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';
|
|
6
|
+
import { useMergeRefs, useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';
|
|
7
7
|
import { useAppLayoutToolbarDesignEnabled } from '../app-layout/utils/feature-flags';
|
|
8
8
|
import { useKeyboardEvents } from '../app-layout/utils/use-keyboard-events';
|
|
9
9
|
import { usePointerEvents } from '../app-layout/utils/use-pointer-events';
|
|
@@ -20,9 +20,12 @@ import { SplitPanelContentSide } from './side';
|
|
|
20
20
|
import styles from './styles.css.js';
|
|
21
21
|
import testUtilStyles from './test-classes/styles.css.js';
|
|
22
22
|
export function SplitPanelImplementation(_a) {
|
|
23
|
-
var { __internalRootRef, header, children, hidePreferencesButton, closeBehavior, i18nStrings = {} } = _a, restProps = __rest(_a, ["__internalRootRef", "header", "children", "hidePreferencesButton", "closeBehavior", "i18nStrings"]);
|
|
23
|
+
var { __internalRootRef, header, children, hidePreferencesButton, closeBehavior, i18nStrings = {}, ariaLabel, headerActions, headerBefore, headerDescription, headerInfo } = _a, restProps = __rest(_a, ["__internalRootRef", "header", "children", "hidePreferencesButton", "closeBehavior", "i18nStrings", "ariaLabel", "headerActions", "headerBefore", "headerDescription", "headerInfo"]);
|
|
24
24
|
const isRefresh = useVisualRefresh();
|
|
25
25
|
const isToolbar = useAppLayoutToolbarDesignEnabled();
|
|
26
|
+
if (!header && !headerBefore) {
|
|
27
|
+
warnOnce('SplitPanel', 'You must provide either `header` or `headerBefore`.');
|
|
28
|
+
}
|
|
26
29
|
const { position, topOffset, bottomOffset, rightOffset, contentWidthStyles, isOpen, isForcedPosition, onPreferencesChange, onResize, onToggle, size, relativeSize, setSplitPanelToggle, refs, animationDisabled, } = useSplitPanelContext();
|
|
27
30
|
const baseProps = getBaseProps(restProps);
|
|
28
31
|
const [isPreferencesOpen, setPreferencesOpen] = useState(false);
|
|
@@ -47,14 +50,30 @@ export function SplitPanelImplementation(_a) {
|
|
|
47
50
|
[globalVars.stickyVerticalTopOffset]: topOffset,
|
|
48
51
|
[globalVars.stickyVerticalBottomOffset]: bottomOffset,
|
|
49
52
|
};
|
|
50
|
-
const
|
|
53
|
+
const panelHeaderUniqueId = useUniqueId('split-panel-header');
|
|
54
|
+
const panelHeaderId = ariaLabel ? undefined : panelHeaderUniqueId;
|
|
55
|
+
const showActions = headerActions && isOpen;
|
|
56
|
+
const showDescription = headerDescription && isOpen;
|
|
57
|
+
const hasCustomElements = !!headerActions || !!headerBefore || !!headerInfo;
|
|
51
58
|
const wrappedHeader = (React.createElement("div", { className: clsx(styles.header, isToolbar && styles['with-toolbar']), style: appLayoutMaxWidth },
|
|
52
|
-
React.createElement("
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
React.createElement("div", { className: styles['header-main-row'] },
|
|
60
|
+
React.createElement("div", { className: styles['header-main-content'] },
|
|
61
|
+
React.createElement("div", { className: clsx(styles['header-tag-and-info'], showDescription && styles['with-description']) },
|
|
62
|
+
React.createElement("h2", { className: clsx(styles['header-tag'], !!headerInfo && styles['with-info']), id: panelHeaderId },
|
|
63
|
+
headerBefore && (React.createElement("div", { className: clsx(styles['header-before-slot'], testUtilStyles['header-before'], !!header && styles['with-header-text']) }, headerBefore)),
|
|
64
|
+
!!header && React.createElement("div", { className: clsx(styles['header-text'], testUtilStyles['header-text']) }, header)),
|
|
65
|
+
headerInfo && (React.createElement("span", { className: clsx(styles['header-info-slot'], testUtilStyles['header-info']) }, headerInfo))),
|
|
66
|
+
showActions && (React.createElement("div", { className: clsx(styles['header-actions-slot'], testUtilStyles['header-actions']) }, headerActions))),
|
|
67
|
+
React.createElement("div", { className: styles['header-buttons'] },
|
|
68
|
+
!hidePreferencesButton && isOpen && (React.createElement(React.Fragment, null,
|
|
69
|
+
React.createElement(InternalButton, { className: testUtilStyles['preferences-button'], iconName: "settings", variant: "icon", onClick: () => setPreferencesOpen(true), formAction: "none", ariaLabel: i18nStrings.preferencesTitle, ref: refs.preferences }),
|
|
70
|
+
React.createElement("span", { className: styles.divider }))),
|
|
71
|
+
isOpen ? (React.createElement(InternalButton, { className: testUtilStyles['close-button'], iconName: isRefresh && closeBehavior === 'collapse'
|
|
72
|
+
? position === 'side'
|
|
73
|
+
? 'angle-right'
|
|
74
|
+
: 'angle-down'
|
|
75
|
+
: 'close', variant: "icon", onClick: onToggle, formAction: "none", ariaLabel: i18nStrings.closeButtonAriaLabel, ariaExpanded: isOpen })) : position === 'side' || closeBehavior === 'hide' ? null : (React.createElement(InternalButton, { className: testUtilStyles['open-button'], iconName: "angle-up", variant: "icon", formAction: "none", ariaLabel: i18nStrings.openButtonAriaLabel, ref: refs.toggle, ariaExpanded: isOpen, onClick: hasCustomElements ? onToggle : undefined })))),
|
|
76
|
+
showDescription && (React.createElement("p", { className: clsx(styles['header-description'], testUtilStyles['header-description']) }, headerDescription))));
|
|
58
77
|
const resizeHandle = (React.createElement(PanelResizeHandle, { ref: refs.slider, className: testUtilStyles.slider, tooltipText: i18nStrings.resizeHandleTooltipText, ariaLabel: i18nStrings.resizeHandleAriaLabel,
|
|
59
78
|
// Allows us to use the logical left/right keys to move the slider left/right,
|
|
60
79
|
// but match aria keyboard behavior of using left/right to decrease/increase
|
|
@@ -94,8 +113,8 @@ export function SplitPanelImplementation(_a) {
|
|
|
94
113
|
return React.createElement(React.Fragment, null);
|
|
95
114
|
}
|
|
96
115
|
return (React.createElement(React.Fragment, null,
|
|
97
|
-
position === 'side' && (React.createElement(SplitPanelContentSide, { style: contentStyle, resizeHandle: resizeHandle, baseProps: baseProps, isOpen: isOpen, splitPanelRef: mergedRef, cappedSize: size, onToggle: onToggle, openButtonAriaLabel: openButtonAriaLabel, toggleRef: refs.toggle, header: wrappedHeader, panelHeaderId: panelHeaderId, closeBehavior: closeBehavior }, children)),
|
|
98
|
-
position === 'bottom' && (React.createElement(SplitPanelContentBottom, { style: contentStyle, resizeHandle: resizeHandle, baseProps: baseProps, isOpen: isOpen, splitPanelRef: mergedRef, cappedSize: size, onToggle: onToggle, header: wrappedHeader, panelHeaderId: panelHeaderId, appLayoutMaxWidth: appLayoutMaxWidth, closeBehavior: closeBehavior }, children)),
|
|
116
|
+
position === 'side' && (React.createElement(SplitPanelContentSide, { style: contentStyle, resizeHandle: resizeHandle, baseProps: baseProps, isOpen: isOpen, splitPanelRef: mergedRef, cappedSize: size, onToggle: onToggle, openButtonAriaLabel: openButtonAriaLabel, toggleRef: refs.toggle, header: wrappedHeader, panelHeaderId: panelHeaderId, ariaLabel: ariaLabel, closeBehavior: closeBehavior }, children)),
|
|
117
|
+
position === 'bottom' && (React.createElement(SplitPanelContentBottom, { style: contentStyle, resizeHandle: resizeHandle, baseProps: baseProps, isOpen: isOpen, splitPanelRef: mergedRef, cappedSize: size, onToggle: onToggle, header: wrappedHeader, panelHeaderId: panelHeaderId, appLayoutMaxWidth: appLayoutMaxWidth, ariaLabel: ariaLabel, closeBehavior: closeBehavior, hasCustomElements: hasCustomElements }, children)),
|
|
99
118
|
isPreferencesOpen && (React.createElement(PreferencesModal, { visible: true, preferences: { position }, disabledSidePosition: position === 'bottom' && isForcedPosition, isRefresh: isRefresh, i18nStrings: {
|
|
100
119
|
header: i18nStrings.preferencesTitle,
|
|
101
120
|
confirm: i18nStrings.preferencesConfirm,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../../src/split-panel/implementation.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MA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SAAS,EACpB,WAAW,EAAE;gBACX,MAAM,EAAE,WAAW,CAAC,gBAAgB;gBACpC,OAAO,EAAE,WAAW,CAAC,kBAAkB;gBACvC,MAAM,EAAE,WAAW,CAAC,iBAAiB;gBACrC,KAAK,EAAE,WAAW,CAAC,yBAAyB;gBAC5C,aAAa,EAAE,WAAW,CAAC,wBAAwB;gBACnD,mBAAmB,EAAE,WAAW,CAAC,8BAA8B;gBAC/D,cAAc,EAAE,WAAW,CAAC,yBAAyB;gBACrD,YAAY,EAAE,WAAW,CAAC,uBAAuB;aAClD,EACD,SAAS,EAAE,WAAW,CAAC,EAAE;gBACvB,mBAAmB,mBAAM,WAAW,EAAG,CAAC;gBACxC,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,EACD,SAAS,EAAE,GAAG,EAAE;gBACd,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,GACD,CACH,CACA,CACJ,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAG,yBAAyB,CAAC,wBAAwB,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useAppLayoutToolbarDesignEnabled } from '../app-layout/utils/feature-flags';\nimport { SizeControlProps } from '../app-layout/utils/interfaces';\nimport { useKeyboardEvents } from '../app-layout/utils/use-keyboard-events';\nimport { usePointerEvents } from '../app-layout/utils/use-pointer-events';\nimport { InternalButton } from '../button/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport PanelResizeHandle from '../internal/components/panel-resize-handle';\nimport { useSplitPanelContext } from '../internal/context/split-panel-context';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport globalVars from '../internal/styles/global-vars';\nimport { SomeRequired } from '../internal/types';\nimport { createWidgetizedComponent } from '../internal/widgets';\nimport { SplitPanelContentBottom } from './bottom';\nimport { SplitPanelProps } from './interfaces';\nimport PreferencesModal from './preferences-modal';\nimport { SplitPanelContentSide } from './side';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\nexport type SplitPanelImplementationProps = SomeRequired<SplitPanelProps, 'hidePreferencesButton' | 'closeBehavior'> &\n InternalBaseComponentProps;\n\nexport function SplitPanelImplementation({\n __internalRootRef,\n header,\n children,\n hidePreferencesButton,\n closeBehavior,\n i18nStrings = {},\n ...restProps\n}: SplitPanelImplementationProps) {\n const isRefresh = useVisualRefresh();\n const isToolbar = useAppLayoutToolbarDesignEnabled();\n\n const {\n position,\n topOffset,\n bottomOffset,\n rightOffset,\n contentWidthStyles,\n isOpen,\n isForcedPosition,\n onPreferencesChange,\n onResize,\n onToggle,\n size,\n relativeSize,\n setSplitPanelToggle,\n refs,\n animationDisabled,\n } = useSplitPanelContext();\n const baseProps = getBaseProps(restProps);\n const [isPreferencesOpen, setPreferencesOpen] = useState<boolean>(false);\n\n const appLayoutMaxWidth = isRefresh && position === 'bottom' ? contentWidthStyles : undefined;\n\n const openButtonAriaLabel = i18nStrings.openButtonAriaLabel;\n useEffect(() => {\n setSplitPanelToggle({ displayed: closeBehavior === 'collapse', ariaLabel: openButtonAriaLabel });\n\n return () => {\n setSplitPanelToggle({ displayed: false, ariaLabel: undefined });\n };\n }, [setSplitPanelToggle, openButtonAriaLabel, closeBehavior]);\n\n const splitPanelRefObject = useRef<HTMLDivElement>(null);\n\n const sizeControlProps: SizeControlProps = {\n position,\n panelRef: splitPanelRefObject,\n handleRef: refs.slider,\n onResize,\n };\n const onSliderPointerDown = usePointerEvents(sizeControlProps);\n const { onKeyDown, onDirectionClick } = useKeyboardEvents(sizeControlProps);\n\n const contentStyle = {\n [globalVars.stickyVerticalTopOffset]: topOffset,\n [globalVars.stickyVerticalBottomOffset]: bottomOffset,\n };\n\n const panelHeaderId = useUniqueId('split-panel-header');\n\n const wrappedHeader = (\n <div className={clsx(styles.header, isToolbar && styles['with-toolbar'])} style={appLayoutMaxWidth}>\n <h2 className={clsx(styles['header-text'], testUtilStyles['header-text'])} id={panelHeaderId}>\n {header}\n </h2>\n <div className={styles['header-actions']}>\n {!hidePreferencesButton && isOpen && (\n <>\n <InternalButton\n className={testUtilStyles['preferences-button']}\n iconName=\"settings\"\n variant=\"icon\"\n onClick={() => setPreferencesOpen(true)}\n formAction=\"none\"\n ariaLabel={i18nStrings.preferencesTitle}\n ref={refs.preferences}\n />\n <span className={styles.divider} />\n </>\n )}\n\n {isOpen ? (\n <InternalButton\n className={testUtilStyles['close-button']}\n iconName={\n isRefresh && closeBehavior === 'collapse' ? (position === 'side' ? 'angle-right' : 'angle-down') : 'close'\n }\n variant=\"icon\"\n onClick={onToggle}\n formAction=\"none\"\n ariaLabel={i18nStrings.closeButtonAriaLabel}\n ariaExpanded={isOpen}\n />\n ) : position === 'side' || closeBehavior === 'hide' ? null : (\n <InternalButton\n className={testUtilStyles['open-button']}\n iconName=\"angle-up\"\n variant=\"icon\"\n formAction=\"none\"\n ariaLabel={i18nStrings.openButtonAriaLabel}\n ref={refs.toggle}\n ariaExpanded={isOpen}\n />\n )}\n </div>\n </div>\n );\n\n const resizeHandle = (\n <PanelResizeHandle\n ref={refs.slider}\n className={testUtilStyles.slider}\n tooltipText={i18nStrings.resizeHandleTooltipText}\n ariaLabel={i18nStrings.resizeHandleAriaLabel}\n // Allows us to use the logical left/right keys to move the slider left/right,\n // but match aria keyboard behavior of using left/right to decrease/increase\n // the slider value.\n ariaValuenow={position === 'bottom' ? relativeSize : 100 - relativeSize}\n position={position}\n onKeyDown={onKeyDown}\n onPointerDown={onSliderPointerDown}\n onDirectionClick={onDirectionClick}\n />\n );\n\n /*\n This effect forces the browser to recalculate the layout\n whenever the split panel might have moved.\n\n This is needed as a workaround for a bug in Safari, which does\n not automatically calculate the new position of the split panel\n _content_ when the split panel moves.\n */\n useLayoutEffect(() => {\n const root = splitPanelRefObject.current;\n\n if (root) {\n const property = 'transform';\n const temporaryValue = 'translateZ(0)';\n\n const valueBefore = root.style[property];\n root.style[property] = temporaryValue;\n\n // This line forces the browser to recalculate the layout\n void root.offsetHeight;\n\n root.style[property] = valueBefore;\n }\n }, [rightOffset, __internalRootRef]);\n\n const mergedRef = useMergeRefs(splitPanelRefObject, __internalRootRef);\n\n if (closeBehavior === 'hide' && !isOpen && (animationDisabled || !isRefresh)) {\n return <></>;\n }\n\n /**\n * The AppLayout factor moved the circular buttons out of the\n * SplitPanel and into the Tools component. This conditional\n * is still needed for the early return to prevent execution\n * of the following code.\n */\n if (isRefresh && !isToolbar && !isOpen && position === 'side') {\n return <></>;\n }\n\n return (\n <>\n {position === 'side' && (\n <SplitPanelContentSide\n style={contentStyle}\n resizeHandle={resizeHandle}\n baseProps={baseProps}\n isOpen={isOpen}\n splitPanelRef={mergedRef}\n cappedSize={size}\n onToggle={onToggle}\n openButtonAriaLabel={openButtonAriaLabel}\n toggleRef={refs.toggle}\n header={wrappedHeader}\n panelHeaderId={panelHeaderId}\n closeBehavior={closeBehavior}\n >\n {children}\n </SplitPanelContentSide>\n )}\n\n {position === 'bottom' && (\n <SplitPanelContentBottom\n style={contentStyle}\n resizeHandle={resizeHandle}\n baseProps={baseProps}\n isOpen={isOpen}\n splitPanelRef={mergedRef}\n cappedSize={size}\n onToggle={onToggle}\n header={wrappedHeader}\n panelHeaderId={panelHeaderId}\n appLayoutMaxWidth={appLayoutMaxWidth}\n closeBehavior={closeBehavior}\n >\n {children}\n </SplitPanelContentBottom>\n )}\n {isPreferencesOpen && (\n <PreferencesModal\n visible={true}\n preferences={{ position }}\n disabledSidePosition={position === 'bottom' && isForcedPosition}\n isRefresh={isRefresh}\n i18nStrings={{\n header: i18nStrings.preferencesTitle,\n confirm: i18nStrings.preferencesConfirm,\n cancel: i18nStrings.preferencesCancel,\n close: i18nStrings.preferencesCloseAriaLabel,\n positionLabel: i18nStrings.preferencesPositionLabel,\n positionDescription: i18nStrings.preferencesPositionDescription,\n positionBottom: i18nStrings.preferencesPositionBottom,\n positionSide: i18nStrings.preferencesPositionSide,\n }}\n onConfirm={preferences => {\n onPreferencesChange({ ...preferences });\n setPreferencesOpen(false);\n }}\n onDismiss={() => {\n setPreferencesOpen(false);\n }}\n />\n )}\n </>\n );\n}\n\nexport const createWidgetizedSplitPanel = createWidgetizedComponent(SplitPanelImplementation);\n"]}
|
|
1
|
+
{"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../../src/split-panel/implementation.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEpG,OAAO,EAAE,gCAAgC,EAAE,MAAM,mCAAmC,CAAC;AAErF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,iBAAiB,MAAM,4CAA4C,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAE/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,UAAU,MAAM,gCAAgC,CAAC;AAExD,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAEnD,OAAO,gBAAgB,MAAM,qBAAqB,C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AAwB;gBACnD,mBAAmB,EAAE,WAAW,CAAC,8BAA8B;gBAC/D,cAAc,EAAE,WAAW,CAAC,yBAAyB;gBACrD,YAAY,EAAE,WAAW,CAAC,uBAAuB;aAClD,EACD,SAAS,EAAE,WAAW,CAAC,EAAE;gBACvB,mBAAmB,mBAAM,WAAW,EAAG,CAAC;gBACxC,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,EACD,SAAS,EAAE,GAAG,EAAE;gBACd,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,GACD,CACH,CACA,CACJ,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAG,yBAAyB,CAAC,wBAAwB,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useAppLayoutToolbarDesignEnabled } from '../app-layout/utils/feature-flags';\nimport { SizeControlProps } from '../app-layout/utils/interfaces';\nimport { useKeyboardEvents } from '../app-layout/utils/use-keyboard-events';\nimport { usePointerEvents } from '../app-layout/utils/use-pointer-events';\nimport { InternalButton } from '../button/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport PanelResizeHandle from '../internal/components/panel-resize-handle';\nimport { useSplitPanelContext } from '../internal/context/split-panel-context';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport globalVars from '../internal/styles/global-vars';\nimport { SomeRequired } from '../internal/types';\nimport { createWidgetizedComponent } from '../internal/widgets';\nimport { SplitPanelContentBottom } from './bottom';\nimport { SplitPanelProps } from './interfaces';\nimport PreferencesModal from './preferences-modal';\nimport { SplitPanelContentSide } from './side';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\nexport type SplitPanelImplementationProps = SomeRequired<SplitPanelProps, 'hidePreferencesButton' | 'closeBehavior'> &\n InternalBaseComponentProps;\n\nexport function SplitPanelImplementation({\n __internalRootRef,\n header,\n children,\n hidePreferencesButton,\n closeBehavior,\n i18nStrings = {},\n ariaLabel,\n headerActions,\n headerBefore,\n headerDescription,\n headerInfo,\n ...restProps\n}: SplitPanelImplementationProps) {\n const isRefresh = useVisualRefresh();\n const isToolbar = useAppLayoutToolbarDesignEnabled();\n\n if (!header && !headerBefore) {\n warnOnce('SplitPanel', 'You must provide either `header` or `headerBefore`.');\n }\n\n const {\n position,\n topOffset,\n bottomOffset,\n rightOffset,\n contentWidthStyles,\n isOpen,\n isForcedPosition,\n onPreferencesChange,\n onResize,\n onToggle,\n size,\n relativeSize,\n setSplitPanelToggle,\n refs,\n animationDisabled,\n } = useSplitPanelContext();\n const baseProps = getBaseProps(restProps);\n const [isPreferencesOpen, setPreferencesOpen] = useState<boolean>(false);\n\n const appLayoutMaxWidth = isRefresh && position === 'bottom' ? contentWidthStyles : undefined;\n\n const openButtonAriaLabel = i18nStrings.openButtonAriaLabel;\n useEffect(() => {\n setSplitPanelToggle({ displayed: closeBehavior === 'collapse', ariaLabel: openButtonAriaLabel });\n\n return () => {\n setSplitPanelToggle({ displayed: false, ariaLabel: undefined });\n };\n }, [setSplitPanelToggle, openButtonAriaLabel, closeBehavior]);\n\n const splitPanelRefObject = useRef<HTMLDivElement>(null);\n\n const sizeControlProps: SizeControlProps = {\n position,\n panelRef: splitPanelRefObject,\n handleRef: refs.slider,\n onResize,\n };\n const onSliderPointerDown = usePointerEvents(sizeControlProps);\n const { onKeyDown, onDirectionClick } = useKeyboardEvents(sizeControlProps);\n\n const contentStyle = {\n [globalVars.stickyVerticalTopOffset]: topOffset,\n [globalVars.stickyVerticalBottomOffset]: bottomOffset,\n };\n\n const panelHeaderUniqueId = useUniqueId('split-panel-header');\n const panelHeaderId = ariaLabel ? undefined : panelHeaderUniqueId;\n\n const showActions = headerActions && isOpen;\n const showDescription = headerDescription && isOpen;\n const hasCustomElements = !!headerActions || !!headerBefore || !!headerInfo;\n\n const wrappedHeader = (\n <div className={clsx(styles.header, isToolbar && styles['with-toolbar'])} style={appLayoutMaxWidth}>\n <div className={styles['header-main-row']}>\n <div className={styles['header-main-content']}>\n <div className={clsx(styles['header-tag-and-info'], showDescription && styles['with-description'])}>\n <h2 className={clsx(styles['header-tag'], !!headerInfo && styles['with-info'])} id={panelHeaderId}>\n {headerBefore && (\n <div\n className={clsx(\n styles['header-before-slot'],\n testUtilStyles['header-before'],\n !!header && styles['with-header-text']\n )}\n >\n {headerBefore}\n </div>\n )}\n {!!header && <div className={clsx(styles['header-text'], testUtilStyles['header-text'])}>{header}</div>}\n </h2>\n {headerInfo && (\n <span className={clsx(styles['header-info-slot'], testUtilStyles['header-info'])}>{headerInfo}</span>\n )}\n </div>\n {showActions && (\n <div className={clsx(styles['header-actions-slot'], testUtilStyles['header-actions'])}>{headerActions}</div>\n )}\n </div>\n <div className={styles['header-buttons']}>\n {!hidePreferencesButton && isOpen && (\n <>\n <InternalButton\n className={testUtilStyles['preferences-button']}\n iconName=\"settings\"\n variant=\"icon\"\n onClick={() => setPreferencesOpen(true)}\n formAction=\"none\"\n ariaLabel={i18nStrings.preferencesTitle}\n ref={refs.preferences}\n />\n <span className={styles.divider} />\n </>\n )}\n\n {isOpen ? (\n <InternalButton\n className={testUtilStyles['close-button']}\n iconName={\n isRefresh && closeBehavior === 'collapse'\n ? position === 'side'\n ? 'angle-right'\n : 'angle-down'\n : 'close'\n }\n variant=\"icon\"\n onClick={onToggle}\n formAction=\"none\"\n ariaLabel={i18nStrings.closeButtonAriaLabel}\n ariaExpanded={isOpen}\n />\n ) : position === 'side' || closeBehavior === 'hide' ? null : (\n <InternalButton\n className={testUtilStyles['open-button']}\n iconName=\"angle-up\"\n variant=\"icon\"\n formAction=\"none\"\n ariaLabel={i18nStrings.openButtonAriaLabel}\n ref={refs.toggle}\n ariaExpanded={isOpen}\n onClick={hasCustomElements ? onToggle : undefined}\n />\n )}\n </div>\n </div>\n\n {showDescription && (\n <p className={clsx(styles['header-description'], testUtilStyles['header-description'])}>{headerDescription}</p>\n )}\n </div>\n );\n\n const resizeHandle = (\n <PanelResizeHandle\n ref={refs.slider}\n className={testUtilStyles.slider}\n tooltipText={i18nStrings.resizeHandleTooltipText}\n ariaLabel={i18nStrings.resizeHandleAriaLabel}\n // Allows us to use the logical left/right keys to move the slider left/right,\n // but match aria keyboard behavior of using left/right to decrease/increase\n // the slider value.\n ariaValuenow={position === 'bottom' ? relativeSize : 100 - relativeSize}\n position={position}\n onKeyDown={onKeyDown}\n onPointerDown={onSliderPointerDown}\n onDirectionClick={onDirectionClick}\n />\n );\n\n /*\n This effect forces the browser to recalculate the layout\n whenever the split panel might have moved.\n\n This is needed as a workaround for a bug in Safari, which does\n not automatically calculate the new position of the split panel\n _content_ when the split panel moves.\n */\n useLayoutEffect(() => {\n const root = splitPanelRefObject.current;\n\n if (root) {\n const property = 'transform';\n const temporaryValue = 'translateZ(0)';\n\n const valueBefore = root.style[property];\n root.style[property] = temporaryValue;\n\n // This line forces the browser to recalculate the layout\n void root.offsetHeight;\n\n root.style[property] = valueBefore;\n }\n }, [rightOffset, __internalRootRef]);\n\n const mergedRef = useMergeRefs(splitPanelRefObject, __internalRootRef);\n\n if (closeBehavior === 'hide' && !isOpen && (animationDisabled || !isRefresh)) {\n return <></>;\n }\n\n /**\n * The AppLayout factor moved the circular buttons out of the\n * SplitPanel and into the Tools component. This conditional\n * is still needed for the early return to prevent execution\n * of the following code.\n */\n if (isRefresh && !isToolbar && !isOpen && position === 'side') {\n return <></>;\n }\n\n return (\n <>\n {position === 'side' && (\n <SplitPanelContentSide\n style={contentStyle}\n resizeHandle={resizeHandle}\n baseProps={baseProps}\n isOpen={isOpen}\n splitPanelRef={mergedRef}\n cappedSize={size}\n onToggle={onToggle}\n openButtonAriaLabel={openButtonAriaLabel}\n toggleRef={refs.toggle}\n header={wrappedHeader}\n panelHeaderId={panelHeaderId}\n ariaLabel={ariaLabel}\n closeBehavior={closeBehavior}\n >\n {children}\n </SplitPanelContentSide>\n )}\n\n {position === 'bottom' && (\n <SplitPanelContentBottom\n style={contentStyle}\n resizeHandle={resizeHandle}\n baseProps={baseProps}\n isOpen={isOpen}\n splitPanelRef={mergedRef}\n cappedSize={size}\n onToggle={onToggle}\n header={wrappedHeader}\n panelHeaderId={panelHeaderId}\n appLayoutMaxWidth={appLayoutMaxWidth}\n ariaLabel={ariaLabel}\n closeBehavior={closeBehavior}\n hasCustomElements={hasCustomElements}\n >\n {children}\n </SplitPanelContentBottom>\n )}\n {isPreferencesOpen && (\n <PreferencesModal\n visible={true}\n preferences={{ position }}\n disabledSidePosition={position === 'bottom' && isForcedPosition}\n isRefresh={isRefresh}\n i18nStrings={{\n header: i18nStrings.preferencesTitle,\n confirm: i18nStrings.preferencesConfirm,\n cancel: i18nStrings.preferencesCancel,\n close: i18nStrings.preferencesCloseAriaLabel,\n positionLabel: i18nStrings.preferencesPositionLabel,\n positionDescription: i18nStrings.preferencesPositionDescription,\n positionBottom: i18nStrings.preferencesPositionBottom,\n positionSide: i18nStrings.preferencesPositionSide,\n }}\n onConfirm={preferences => {\n onPreferencesChange({ ...preferences });\n setPreferencesOpen(false);\n }}\n onDismiss={() => {\n setPreferencesOpen(false);\n }}\n />\n )}\n </>\n );\n}\n\nexport const createWidgetizedSplitPanel = createWidgetizedComponent(SplitPanelImplementation);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/split-panel/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,qBAA6B,EAC7B,aAA0B,EAC1B,WAAgB,EAChB,GAAG,SAAS,EACb,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/split-panel/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,qBAA6B,EAC7B,aAA0B,EAC1B,WAAgB,EAChB,GAAG,SAAS,EACb,EAAE,eAAe,eA2CjB"}
|
package/split-panel/index.js
CHANGED
|
@@ -11,6 +11,12 @@ export default function SplitPanel(_a) {
|
|
|
11
11
|
var { hidePreferencesButton = false, closeBehavior = 'collapse', i18nStrings = {} } = _a, restProps = __rest(_a, ["hidePreferencesButton", "closeBehavior", "i18nStrings"]);
|
|
12
12
|
const { __internalRootRef } = useBaseComponent('SplitPanel', {
|
|
13
13
|
props: { closeBehavior, hidePreferencesButton },
|
|
14
|
+
metadata: {
|
|
15
|
+
hasHeaderActions: Boolean(restProps.headerActions),
|
|
16
|
+
hasHeaderDescription: Boolean(restProps.headerDescription),
|
|
17
|
+
hasHeaderInfo: Boolean(restProps.headerInfo),
|
|
18
|
+
hasHeaderBefore: Boolean(restProps.headerBefore),
|
|
19
|
+
},
|
|
14
20
|
});
|
|
15
21
|
const i18n = useInternalI18n('split-panel');
|
|
16
22
|
const i18nModal = useInternalI18n('modal');
|
package/split-panel/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/split-panel/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,EAAE,kB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,IAAI,CAClC,4CAA4C,EAC5C,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,8BAA8B,CAC5C,EACD,yBAAyB,EAAE,IAAI,CAC7B,uCAAuC,EACvC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,yBAAyB,CACvC,EACD,uBAAuB,EAAE,IAAI,CAAC,qCAAqC,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,uBAAuB,CAAC,OAE5G,CACH,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport { useInternalI18n } from '../i18n/context';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { SplitPanelProps } from './interfaces';\nimport { SplitPanelInternal } from './internal';\n\nexport { SplitPanelProps };\n\nexport default function SplitPanel({\n hidePreferencesButton = false,\n closeBehavior = 'collapse',\n i18nStrings = {},\n ...restProps\n}: SplitPanelProps) {\n const { __internalRootRef } = useBaseComponent('SplitPanel', {\n props: { closeBehavior, hidePreferencesButton },\n metadata: {\n hasHeaderActions: Boolean(restProps.headerActions),\n hasHeaderDescription: Boolean(restProps.headerDescription),\n hasHeaderInfo: Boolean(restProps.headerInfo),\n hasHeaderBefore: Boolean(restProps.headerBefore),\n },\n });\n const i18n = useInternalI18n('split-panel');\n const i18nModal = useInternalI18n('modal');\n\n return (\n <SplitPanelInternal\n {...restProps}\n __internalRootRef={__internalRootRef}\n hidePreferencesButton={hidePreferencesButton}\n closeBehavior={closeBehavior}\n i18nStrings={{\n ...i18nStrings,\n closeButtonAriaLabel: i18n('i18nStrings.closeButtonAriaLabel', i18nStrings?.closeButtonAriaLabel),\n openButtonAriaLabel: i18n('i18nStrings.openButtonAriaLabel', i18nStrings?.openButtonAriaLabel),\n resizeHandleAriaLabel: i18n('i18nStrings.resizeHandleAriaLabel', i18nStrings?.resizeHandleAriaLabel),\n resizeHandleTooltipText: i18n('i18nStrings.resizeHandleTooltipText', i18nStrings?.resizeHandleTooltipText),\n preferencesTitle: i18n('i18nStrings.preferencesTitle', i18nStrings?.preferencesTitle),\n preferencesConfirm: i18n('i18nStrings.preferencesConfirm', i18nStrings?.preferencesConfirm),\n preferencesCancel: i18n('i18nStrings.preferencesCancel', i18nStrings?.preferencesCancel),\n preferencesCloseAriaLabel:\n i18nModal('closeAriaLabel', i18nStrings?.preferencesCloseAriaLabel) || i18nStrings?.preferencesCancel,\n preferencesPositionLabel: i18n('i18nStrings.preferencesPositionLabel', i18nStrings?.preferencesPositionLabel),\n preferencesPositionDescription: i18n(\n 'i18nStrings.preferencesPositionDescription',\n i18nStrings?.preferencesPositionDescription\n ),\n preferencesPositionBottom: i18n(\n 'i18nStrings.preferencesPositionBottom',\n i18nStrings?.preferencesPositionBottom\n ),\n preferencesPositionSide: i18n('i18nStrings.preferencesPositionSide', i18nStrings?.preferencesPositionSide),\n }}\n />\n );\n}\n\napplyDisplayName(SplitPanel, 'SplitPanel');\n"]}
|
|
@@ -2,9 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { BaseComponentProps } from '../internal/base-component';
|
|
3
3
|
export interface SplitPanelProps extends BaseComponentProps {
|
|
4
4
|
/**
|
|
5
|
-
* Header of the split panel.
|
|
5
|
+
* Header text of the split panel.
|
|
6
6
|
*/
|
|
7
|
-
header
|
|
7
|
+
header?: string;
|
|
8
8
|
children: React.ReactNode;
|
|
9
9
|
/**
|
|
10
10
|
* Determines whether the split panel collapses or hides completely when closed.
|
|
@@ -29,6 +29,26 @@ export interface SplitPanelProps extends BaseComponentProps {
|
|
|
29
29
|
* @i18n
|
|
30
30
|
*/
|
|
31
31
|
i18nStrings?: SplitPanelProps.I18nStrings;
|
|
32
|
+
/**
|
|
33
|
+
* ARIA label for the panel. Use this if the value passed in the `header` property is not descriptive as a label for the panel.
|
|
34
|
+
*/
|
|
35
|
+
ariaLabel?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Actions for the header.
|
|
38
|
+
*/
|
|
39
|
+
headerActions?: React.ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* Supplementary text below the heading.
|
|
42
|
+
*/
|
|
43
|
+
headerDescription?: React.ReactNode;
|
|
44
|
+
/**
|
|
45
|
+
* The area next to the heading, used to display an Info link.
|
|
46
|
+
*/
|
|
47
|
+
headerInfo?: React.ReactNode;
|
|
48
|
+
/**
|
|
49
|
+
* Content displayed before the header text.
|
|
50
|
+
*/
|
|
51
|
+
headerBefore?: React.ReactNode;
|
|
32
52
|
}
|
|
33
53
|
export declare namespace SplitPanelProps {
|
|
34
54
|
interface I18nStrings {
|
|
@@ -52,7 +72,8 @@ export interface SplitPanelContentProps {
|
|
|
52
72
|
isOpen?: boolean;
|
|
53
73
|
splitPanelRef?: React.Ref<any>;
|
|
54
74
|
cappedSize: number;
|
|
55
|
-
panelHeaderId
|
|
75
|
+
panelHeaderId?: string;
|
|
76
|
+
ariaLabel?: string;
|
|
56
77
|
resizeHandle: React.ReactNode;
|
|
57
78
|
header: React.ReactNode;
|
|
58
79
|
children: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/split-panel/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,WAAW,eAAgB,SAAQ,kBAAkB;IACzD;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/split-panel/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,WAAW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IAC9B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/split-panel/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\n\nexport interface SplitPanelProps extends BaseComponentProps {\n /**\n * Header of the split panel.\n */\n header
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/split-panel/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\n\nexport interface SplitPanelProps extends BaseComponentProps {\n /**\n * Header text of the split panel.\n */\n header?: string;\n children: React.ReactNode;\n /**\n * Determines whether the split panel collapses or hides completely when closed.\n */\n closeBehavior?: 'collapse' | 'hide';\n /**\n * When set to `true`, the preferences button is not displayed.\n */\n hidePreferencesButton?: boolean;\n /**\n * An object containing all the necessary localized strings required by the component.\n * - `closeButtonAriaLabel` - The text of the panel close button aria label.\n * - `openButtonAriaLabel` - The text of the panel open button aria label.\n * - `preferencesTitle` - The text of the preferences modal header.\n * - `preferencesPositionLabel` - The text of the position preference label.\n * - `preferencesPositionDescription` - The text of the position preference description.\n * - `preferencesPositionSide` - The text of the side position preference label.\n * - `preferencesPositionBottom` - The text of the bottom position preference label.\n * - `preferencesConfirm` - The text of the preference modal confirm button.\n * - `preferencesCancel` - The text of the preference modal cancel button.\n * - `resizeHandleAriaLabel` - The label of the resize handle aria label.\n * @i18n\n */\n i18nStrings?: SplitPanelProps.I18nStrings;\n\n /**\n * ARIA label for the panel. Use this if the value passed in the `header` property is not descriptive as a label for the panel.\n */\n ariaLabel?: string;\n\n /**\n * Actions for the header.\n */\n headerActions?: React.ReactNode;\n\n /**\n * Supplementary text below the heading.\n */\n headerDescription?: React.ReactNode;\n\n /**\n * The area next to the heading, used to display an Info link.\n */\n headerInfo?: React.ReactNode;\n\n /**\n * Content displayed before the header text.\n */\n headerBefore?: React.ReactNode;\n}\n\nexport namespace SplitPanelProps {\n export interface I18nStrings {\n closeButtonAriaLabel?: string;\n openButtonAriaLabel?: string;\n preferencesTitle?: string;\n preferencesPositionLabel?: string;\n preferencesPositionDescription?: string;\n preferencesPositionSide?: string;\n preferencesPositionBottom?: string;\n preferencesConfirm?: string;\n preferencesCancel?: string;\n preferencesCloseAriaLabel?: string;\n resizeHandleAriaLabel?: string;\n resizeHandleTooltipText?: string;\n }\n}\n\nexport interface SplitPanelContentProps {\n style: React.CSSProperties;\n baseProps: BaseComponentProps;\n isOpen?: boolean;\n splitPanelRef?: React.Ref<any>;\n cappedSize: number;\n panelHeaderId?: string;\n ariaLabel?: string;\n resizeHandle: React.ReactNode;\n header: React.ReactNode;\n children: React.ReactNode;\n onToggle: () => void;\n}\n"]}
|
package/split-panel/side.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"side.d.ts","sourceRoot":"","sources":["../../../src/split-panel/side.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAInD,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAMvE,UAAU,0BAA2B,SAAQ,sBAAsB;IACjE,aAAa,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;IAChD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;CAC7C;AAED,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,SAAS,EACT,aAAa,EACb,SAAS,EACT,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,UAAU,EACV,mBAAmB,EACnB,aAAa,EACb,QAAQ,EACR,aAAa,GACd,EAAE,0BAA0B,
|
|
1
|
+
{"version":3,"file":"side.d.ts","sourceRoot":"","sources":["../../../src/split-panel/side.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAInD,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAMvE,UAAU,0BAA2B,SAAQ,sBAAsB;IACjE,aAAa,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;IAChD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;CAC7C;AAED,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,SAAS,EACT,aAAa,EACb,SAAS,EACT,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,UAAU,EACV,mBAAmB,EACnB,aAAa,EACb,SAAS,EACT,QAAQ,EACR,aAAa,GACd,EAAE,0BAA0B,eA0D5B"}
|
package/split-panel/side.js
CHANGED
|
@@ -9,7 +9,7 @@ import { useVisualRefresh } from '../internal/hooks/use-visual-mode';
|
|
|
9
9
|
import sharedStyles from '../app-layout/resize/styles.css.js';
|
|
10
10
|
import styles from './styles.css.js';
|
|
11
11
|
import testUtilStyles from './test-classes/styles.css.js';
|
|
12
|
-
export function SplitPanelContentSide({ style, baseProps, splitPanelRef, toggleRef, header, children, resizeHandle, isOpen, cappedSize, openButtonAriaLabel, panelHeaderId, onToggle, closeBehavior, }) {
|
|
12
|
+
export function SplitPanelContentSide({ style, baseProps, splitPanelRef, toggleRef, header, children, resizeHandle, isOpen, cappedSize, openButtonAriaLabel, panelHeaderId, ariaLabel, onToggle, closeBehavior, }) {
|
|
13
13
|
const { topOffset, bottomOffset, animationDisabled } = useSplitPanelContext();
|
|
14
14
|
const isRefresh = useVisualRefresh();
|
|
15
15
|
const isToolbar = useAppLayoutToolbarDesignEnabled();
|
|
@@ -24,7 +24,7 @@ export function SplitPanelContentSide({ style, baseProps, splitPanelRef, toggleR
|
|
|
24
24
|
React.createElement("div", { className: styles['drawer-content-side'], style: {
|
|
25
25
|
top: topOffset,
|
|
26
26
|
bottom: bottomOffset,
|
|
27
|
-
}, onClick: () => !isOpen && onToggle(), "aria-labelledby": panelHeaderId, role: "region" },
|
|
27
|
+
}, onClick: () => !isOpen && onToggle(), "aria-labelledby": panelHeaderId, "aria-label": ariaLabel, role: "region" },
|
|
28
28
|
isOpen ? (React.createElement("div", { className: clsx(styles['slider-wrapper-side'], isToolbar && styles['with-toolbar']) }, resizeHandle)) : closeBehavior === 'hide' ? null : (React.createElement(InternalButton, { className: clsx(testUtilStyles['open-button'], styles['open-button-side']), iconName: "angle-left", variant: "icon", formAction: "none", ariaLabel: openButtonAriaLabel, ariaExpanded: isOpen,
|
|
29
29
|
//toggleRef should only be assigned when there is no other trigger-buttons
|
|
30
30
|
ref: isRefresh || isToolbar ? null : toggleRef })),
|
package/split-panel/side.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"side.js","sourceRoot":"","sources":["../../../src/split-panel/side.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAA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AAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,EAAE,SAAS,IAAI,MAAM,CAAC,cAAc,CAAC,CAAC,IAAG,YAAY,CAAO,CAC/G,CAAC,CAAC,CAAC,aAAa,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACpC,oBAAC,cAAc,IACb,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC,kBAAkB,CAAC,CAAC,EAC1E,QAAQ,EAAC,YAAY,EACrB,OAAO,EAAC,MAAM,EACd,UAAU,EAAC,MAAM,EACjB,SAAS,EAAE,mBAAmB,EAC9B,YAAY,EAAE,MAAM;gBACpB,0EAA0E;gBAC1E,GAAG,EAAE,SAAS,IAAI,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,GAC9C,CACH;YACD,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,SAAS,IAAI,MAAM,CAAC,cAAc,CAAC,CAAC,iBAC/D,CAAC,MAAM,EACpB,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,EAAE;gBAEhD,6BAAK,SAAS,EAAE,MAAM,CAAC,0BAA0B,CAAC,IAAG,MAAM,CAAO;gBAClE,6BAAK,SAAS,EAAE,MAAM,CAAC,2BAA2B,CAAC,IAAG,QAAQ,CAAO,CACjE,CACF,CACF,CACP,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 { useAppLayoutToolbarDesignEnabled } from '../app-layout/utils/feature-flags';\nimport { ButtonProps } from '../button/interfaces';\nimport InternalButton from '../button/internal';\nimport { useSplitPanelContext } from '../internal/context/split-panel-context';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { SplitPanelContentProps, SplitPanelProps } from './interfaces';\n\nimport sharedStyles from '../app-layout/resize/styles.css.js';\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\ninterface SplitPanelContentSideProps extends SplitPanelContentProps {\n closeBehavior: SplitPanelProps['closeBehavior'];\n openButtonAriaLabel?: string;\n toggleRef: React.RefObject<ButtonProps.Ref>;\n}\n\nexport function SplitPanelContentSide({\n style,\n baseProps,\n splitPanelRef,\n toggleRef,\n header,\n children,\n resizeHandle,\n isOpen,\n cappedSize,\n openButtonAriaLabel,\n panelHeaderId,\n ariaLabel,\n onToggle,\n closeBehavior,\n}: SplitPanelContentSideProps) {\n const { topOffset, bottomOffset, animationDisabled } = useSplitPanelContext();\n const isRefresh = useVisualRefresh();\n const isToolbar = useAppLayoutToolbarDesignEnabled();\n const disableAnimation = animationDisabled || (closeBehavior === 'hide' && !isOpen);\n return (\n <div\n {...baseProps}\n className={clsx(baseProps.className, styles.drawer, styles['position-side'], testUtilStyles.root, {\n [sharedStyles['with-motion-horizontal']]: !disableAnimation,\n [testUtilStyles['open-position-side']]: isOpen,\n [styles['drawer-closed']]: !isOpen,\n [styles['with-toolbar']]: isToolbar,\n [styles.refresh]: isRefresh,\n })}\n style={{\n width: isOpen ? cappedSize : isRefresh ? '0px' : undefined,\n maxWidth: isRefresh ? '100%' : undefined,\n ...style,\n }}\n ref={splitPanelRef}\n >\n <div\n className={styles['drawer-content-side']}\n style={{\n top: topOffset,\n bottom: bottomOffset,\n }}\n onClick={() => !isOpen && onToggle()}\n aria-labelledby={panelHeaderId}\n aria-label={ariaLabel}\n role=\"region\"\n >\n {isOpen ? (\n <div className={clsx(styles['slider-wrapper-side'], isToolbar && styles['with-toolbar'])}>{resizeHandle}</div>\n ) : closeBehavior === 'hide' ? null : (\n <InternalButton\n className={clsx(testUtilStyles['open-button'], styles['open-button-side'])}\n iconName=\"angle-left\"\n variant=\"icon\"\n formAction=\"none\"\n ariaLabel={openButtonAriaLabel}\n ariaExpanded={isOpen}\n //toggleRef should only be assigned when there is no other trigger-buttons\n ref={isRefresh || isToolbar ? null : toggleRef}\n />\n )}\n <div\n className={clsx(styles['content-side'], isToolbar && styles['with-toolbar'])}\n aria-hidden={!isOpen}\n style={{ width: isToolbar ? cappedSize : '0px' }} // to prevent text wrapping upon entering\n >\n <div className={styles['pane-header-wrapper-side']}>{header}</div>\n <div className={styles['pane-content-wrapper-side']}>{children}</div>\n </div>\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -1,32 +1,43 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"drawer": "
|
|
5
|
-
"drawer-closed": "awsui_drawer-
|
|
6
|
-
"refresh": "
|
|
7
|
-
"drawer-content-side": "awsui_drawer-content-
|
|
8
|
-
"drawer-content-bottom": "awsui_drawer-content-
|
|
9
|
-
"position-bottom": "awsui_position-
|
|
10
|
-
"hidden": "
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"slider-wrapper-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"drawer-
|
|
19
|
-
"content-
|
|
20
|
-
"
|
|
21
|
-
"pane-bottom-
|
|
22
|
-
"pane-bottom-content-
|
|
23
|
-
"
|
|
24
|
-
"content-
|
|
25
|
-
"
|
|
26
|
-
"pane-
|
|
27
|
-
"
|
|
28
|
-
"header
|
|
29
|
-
"header-
|
|
30
|
-
"
|
|
4
|
+
"drawer": "awsui_drawer_1r9lg_492kg_153",
|
|
5
|
+
"drawer-closed": "awsui_drawer-closed_1r9lg_492kg_190",
|
|
6
|
+
"refresh": "awsui_refresh_1r9lg_492kg_190",
|
|
7
|
+
"drawer-content-side": "awsui_drawer-content-side_1r9lg_492kg_194",
|
|
8
|
+
"drawer-content-bottom": "awsui_drawer-content-bottom_1r9lg_492kg_210",
|
|
9
|
+
"position-bottom": "awsui_position-bottom_1r9lg_492kg_217",
|
|
10
|
+
"hidden": "awsui_hidden_1r9lg_492kg_225",
|
|
11
|
+
"drawer-clickable": "awsui_drawer-clickable_1r9lg_492kg_236",
|
|
12
|
+
"position-side": "awsui_position-side_1r9lg_492kg_247",
|
|
13
|
+
"with-toolbar": "awsui_with-toolbar_1r9lg_492kg_252",
|
|
14
|
+
"slider-wrapper-bottom": "awsui_slider-wrapper-bottom_1r9lg_492kg_256",
|
|
15
|
+
"slider-wrapper-side": "awsui_slider-wrapper-side_1r9lg_492kg_267",
|
|
16
|
+
"open-button-side": "awsui_open-button-side_1r9lg_492kg_281",
|
|
17
|
+
"pane-header-wrapper-bottom": "awsui_pane-header-wrapper-bottom_1r9lg_492kg_290",
|
|
18
|
+
"drawer-mobile": "awsui_drawer-mobile_1r9lg_492kg_300",
|
|
19
|
+
"drawer-disable-content-paddings": "awsui_drawer-disable-content-paddings_1r9lg_492kg_304",
|
|
20
|
+
"content-bottom": "awsui_content-bottom_1r9lg_492kg_316",
|
|
21
|
+
"pane-bottom-center-align": "awsui_pane-bottom-center-align_1r9lg_492kg_335",
|
|
22
|
+
"pane-bottom-content-nav-padding": "awsui_pane-bottom-content-nav-padding_1r9lg_492kg_340",
|
|
23
|
+
"pane-bottom-content-tools-padding": "awsui_pane-bottom-content-tools-padding_1r9lg_492kg_344",
|
|
24
|
+
"content-bottom-max-width": "awsui_content-bottom-max-width_1r9lg_492kg_348",
|
|
25
|
+
"content-side": "awsui_content-side_1r9lg_492kg_353",
|
|
26
|
+
"pane-header-wrapper-side": "awsui_pane-header-wrapper-side_1r9lg_492kg_365",
|
|
27
|
+
"pane-content-wrapper-side": "awsui_pane-content-wrapper-side_1r9lg_492kg_374",
|
|
28
|
+
"header": "awsui_header_1r9lg_492kg_385",
|
|
29
|
+
"header-main-row": "awsui_header-main-row_1r9lg_492kg_393",
|
|
30
|
+
"header-main-content": "awsui_header-main-content_1r9lg_492kg_393",
|
|
31
|
+
"header-tag-and-info": "awsui_header-tag-and-info_1r9lg_492kg_407",
|
|
32
|
+
"with-description": "awsui_with-description_1r9lg_492kg_412",
|
|
33
|
+
"header-tag": "awsui_header-tag_1r9lg_492kg_407",
|
|
34
|
+
"with-info": "awsui_with-info_1r9lg_492kg_415",
|
|
35
|
+
"header-text": "awsui_header-text_1r9lg_492kg_415",
|
|
36
|
+
"header-before-slot": "awsui_header-before-slot_1r9lg_492kg_421",
|
|
37
|
+
"with-header-text": "awsui_with-header-text_1r9lg_492kg_432",
|
|
38
|
+
"header-actions-slot": "awsui_header-actions-slot_1r9lg_492kg_438",
|
|
39
|
+
"header-description": "awsui_header-description_1r9lg_492kg_444",
|
|
40
|
+
"header-buttons": "awsui_header-buttons_1r9lg_492kg_451",
|
|
41
|
+
"divider": "awsui_divider_1r9lg_492kg_459"
|
|
31
42
|
};
|
|
32
43
|
|